diff --git a/packages/devextreme/js/ui/html_editor/ui/formDialog.js b/packages/devextreme/js/ui/html_editor/ui/formDialog.js index 673f432c02ea..71aaad69fa2f 100644 --- a/packages/devextreme/js/ui/html_editor/ui/formDialog.js +++ b/packages/devextreme/js/ui/html_editor/ui/formDialog.js @@ -7,11 +7,33 @@ import { Deferred } from '../../../core/utils/deferred'; import localizationMessage from '../../../localization/message'; import { getCurrentScreenFactor, hasWindow } from '../../../core/utils/window'; import devices from '../../../core/devices'; -import { isMaterialBased } from '../../themes'; +import { isFluent, isMaterialBased } from '../../themes'; const DIALOG_CLASS = 'dx-formdialog'; const FORM_CLASS = 'dx-formdialog-form'; +const getApplyButtonConfig = () => { + if(isFluent()) { + return { + stylingMode: 'contained', + type: 'default', + }; + } + + return {}; +}; + +const getCancelButtonConfig = () => { + if(isFluent()) { + return { + stylingMode: 'outlined', + type: 'normal', + }; + } + + return {}; +}; + class FormDialog { constructor(editorInstance, popupConfig) { this._editorInstance = editorInstance; @@ -92,7 +114,8 @@ class FormDialog { options: { onInitialized: this._addEscapeHandler.bind(this), text: localizationMessage.format('OK'), - onClick: (e) => this.callAddButtonAction(e.event) + onClick: (e) => this.callAddButtonAction(e.event), + ...getApplyButtonConfig(), } }, { toolbar: 'bottom', @@ -103,7 +126,8 @@ class FormDialog { text: localizationMessage.format('Cancel'), onClick: () => { this._popup.hide(); - } + }, + ...getCancelButtonConfig(), } } ], diff --git a/packages/devextreme/scss/widgets/fluent/htmlEditor/_index.scss b/packages/devextreme/scss/widgets/fluent/htmlEditor/_index.scss index 74f8dcdb646e..111c5a6ccda3 100644 --- a/packages/devextreme/scss/widgets/fluent/htmlEditor/_index.scss +++ b/packages/devextreme/scss/widgets/fluent/htmlEditor/_index.scss @@ -238,15 +238,21 @@ padding-inline-start: 0; } + .dx-tabs { + padding: 0 $fluent-html-editor-add-image-dialog-tabs-padding; + } + .dx-fileuploader-input-wrapper { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: $fluent-html-editor-add-image-dialog-fileuploader-padding; - border: 1px dashed $htmleditor-fileuploader-input-wrapper-border-color; - background-color: $htmleditor-fileuploader-input-wrapper-bg-color; + border-width: $fluent-html-editor-fileuploader-input-wrapper-border-size; + border-style: dashed; + border-color: $htmleditor-fileuploader-input-wrapper-border-color; border-radius: $fluent-html-editor-fileuploader-input-wrapper-border-radius; + background-color: $htmleditor-fileuploader-input-wrapper-bg-color; &::after, &::before { @@ -273,6 +279,10 @@ } } +.dx-formdialog-field-target .dx-field-item-content { + text-align: start; +} + .dx-mention { background-color: $htmleditor-mention-bg; } diff --git a/packages/devextreme/scss/widgets/fluent/htmlEditor/_sizes.scss b/packages/devextreme/scss/widgets/fluent/htmlEditor/_sizes.scss index 3aaf63f07553..162674e830e3 100644 --- a/packages/devextreme/scss/widgets/fluent/htmlEditor/_sizes.scss +++ b/packages/devextreme/scss/widgets/fluent/htmlEditor/_sizes.scss @@ -9,12 +9,15 @@ $fluent-html-editor-horizontal-padding: null !default; $fluent-html-editor-add-image-dialog-fileuploader-padding: null !default; $fluent-html-editor-toolbar-menu-separator-margin: 4px !default; $fluent-html-editor-fileuploader-input-wrapper-border-radius: 8px !default; +$fluent-html-editor-fileuploader-input-wrapper-border-size: 1.5px !default; +$fluent-html-editor-add-image-dialog-tabs-padding: null !default; @if $size == "default" { $fluent-toolbar-size-editor-width: 120px !default; $fluent-html-editor-vertical-padding: 16px !default; $fluent-html-editor-horizontal-padding: 16px !default; $fluent-html-editor-add-image-dialog-fileuploader-padding: 48px 0 24px; + $fluent-html-editor-add-image-dialog-tabs-padding: 14px !default; } @else if $size == "compact" { @@ -22,6 +25,7 @@ $fluent-html-editor-fileuploader-input-wrapper-border-radius: 8px !default; $fluent-html-editor-vertical-padding: 12px !default; $fluent-html-editor-horizontal-padding: 12px !default; $fluent-html-editor-add-image-dialog-fileuploader-padding: 40px 0 18px; + $fluent-html-editor-add-image-dialog-tabs-padding: 8px !default; } $fluent-htmleditor-toolbar-padding: $fluent-html-editor-horizontal-padding !default; diff --git a/packages/devextreme/testing/testcafe/tests/htmlEditor/dialogs/addImage/common.ts b/packages/devextreme/testing/testcafe/tests/htmlEditor/dialogs/addImage/common.ts index 23162590f581..5607a0c0906d 100644 --- a/packages/devextreme/testing/testcafe/tests/htmlEditor/dialogs/addImage/common.ts +++ b/packages/devextreme/testing/testcafe/tests/htmlEditor/dialogs/addImage/common.ts @@ -18,7 +18,10 @@ test('TabPanel in HtmlEditor must have correct borders', async (t) => { await t.click(htmlEditor.toolbar.getItemByName('image')); - await testScreenshot(t, takeScreenshot, 'tabpanel-in-htmleditor.png', { element: ADD_IMAGE_POPUP_CONTENT_SELECTOR }); + await testScreenshot(t, takeScreenshot, 'tabpanel-in-htmleditor.png', { + element: ADD_IMAGE_POPUP_CONTENT_SELECTOR, + shouldTestInCompact: true, + }); await t .expect(compareResults.isValid()) diff --git a/packages/devextreme/testing/testcafe/tests/htmlEditor/dialogs/addImage/etalons/Image uploader from url appearance (fluent-blue-light).png b/packages/devextreme/testing/testcafe/tests/htmlEditor/dialogs/addImage/etalons/Image uploader from url appearance (fluent-blue-light).png index 003730b65f68..ad7af08e6ecd 100644 Binary files a/packages/devextreme/testing/testcafe/tests/htmlEditor/dialogs/addImage/etalons/Image uploader from url appearance (fluent-blue-light).png and b/packages/devextreme/testing/testcafe/tests/htmlEditor/dialogs/addImage/etalons/Image uploader from url appearance (fluent-blue-light).png differ diff --git a/packages/devextreme/testing/testcafe/tests/htmlEditor/dialogs/addImage/etalons/editor-before-click-add-button-and-validation (fluent-blue-light).png b/packages/devextreme/testing/testcafe/tests/htmlEditor/dialogs/addImage/etalons/editor-before-click-add-button-and-validation (fluent-blue-light).png index d7982028e9a9..ffa21429ffc3 100644 Binary files a/packages/devextreme/testing/testcafe/tests/htmlEditor/dialogs/addImage/etalons/editor-before-click-add-button-and-validation (fluent-blue-light).png and b/packages/devextreme/testing/testcafe/tests/htmlEditor/dialogs/addImage/etalons/editor-before-click-add-button-and-validation (fluent-blue-light).png differ diff --git a/packages/devextreme/testing/testcafe/tests/htmlEditor/dialogs/addImage/etalons/editor-before-click-add-button-from-device (fluent-blue-light).png b/packages/devextreme/testing/testcafe/tests/htmlEditor/dialogs/addImage/etalons/editor-before-click-add-button-from-device (fluent-blue-light).png index 6d47ed6a2e52..1990984db85c 100644 Binary files a/packages/devextreme/testing/testcafe/tests/htmlEditor/dialogs/addImage/etalons/editor-before-click-add-button-from-device (fluent-blue-light).png and b/packages/devextreme/testing/testcafe/tests/htmlEditor/dialogs/addImage/etalons/editor-before-click-add-button-from-device (fluent-blue-light).png differ diff --git a/packages/devextreme/testing/testcafe/tests/htmlEditor/dialogs/addImage/etalons/tabpanel-in-htmleditor (fluent-blue-light).png b/packages/devextreme/testing/testcafe/tests/htmlEditor/dialogs/addImage/etalons/tabpanel-in-htmleditor (fluent-blue-light).png index e92a3e6c6ddd..d373ff0894f0 100644 Binary files a/packages/devextreme/testing/testcafe/tests/htmlEditor/dialogs/addImage/etalons/tabpanel-in-htmleditor (fluent-blue-light).png and b/packages/devextreme/testing/testcafe/tests/htmlEditor/dialogs/addImage/etalons/tabpanel-in-htmleditor (fluent-blue-light).png differ diff --git a/packages/devextreme/testing/testcafe/tests/htmlEditor/dialogs/addImage/etalons/tabpanel-in-htmleditor (fluent-blue-light-compact).png b/packages/devextreme/testing/testcafe/tests/htmlEditor/dialogs/addImage/etalons/tabpanel-in-htmleditor (fluent-blue-light-compact).png new file mode 100644 index 000000000000..cd1a2e86f696 Binary files /dev/null and b/packages/devextreme/testing/testcafe/tests/htmlEditor/dialogs/addImage/etalons/tabpanel-in-htmleditor (fluent-blue-light-compact).png differ diff --git a/packages/devextreme/testing/testcafe/tests/htmlEditor/dialogs/addImage/etalons/tabpanel-in-htmleditor (generic-light-compact).png b/packages/devextreme/testing/testcafe/tests/htmlEditor/dialogs/addImage/etalons/tabpanel-in-htmleditor (generic-light-compact).png new file mode 100644 index 000000000000..f10160d1ee05 Binary files /dev/null and b/packages/devextreme/testing/testcafe/tests/htmlEditor/dialogs/addImage/etalons/tabpanel-in-htmleditor (generic-light-compact).png differ diff --git a/packages/devextreme/testing/testcafe/tests/htmlEditor/dialogs/addImage/etalons/tabpanel-in-htmleditor (material-blue-light-compact).png b/packages/devextreme/testing/testcafe/tests/htmlEditor/dialogs/addImage/etalons/tabpanel-in-htmleditor (material-blue-light-compact).png new file mode 100644 index 000000000000..6e8d976b432b Binary files /dev/null and b/packages/devextreme/testing/testcafe/tests/htmlEditor/dialogs/addImage/etalons/tabpanel-in-htmleditor (material-blue-light-compact).png differ