diff --git a/packages/survey-creator-angular/src/tabs/logic/logic.component.html b/packages/survey-creator-angular/src/tabs/logic/logic.component.html index 6fbe74a68b..10cecb2535 100644 --- a/packages/survey-creator-angular/src/tabs/logic/logic.component.html +++ b/packages/survey-creator-angular/src/tabs/logic/logic.component.html @@ -1,6 +1,6 @@
-
+
{{model.emptyTabPlaceholder}} diff --git a/packages/survey-creator-core/src/components/creator.scss b/packages/survey-creator-core/src/components/creator.scss index 1b491be965..821c559454 100644 --- a/packages/survey-creator-core/src/components/creator.scss +++ b/packages/survey-creator-core/src/components/creator.scss @@ -1,6 +1,7 @@ @import "../variables.scss"; @import "./notifier.scss"; @import "./popup.scss"; +@import "./surface-placeholder.scss"; survey-creator, .svc-creator { diff --git a/packages/survey-creator-core/src/components/surface-placeholder.scss b/packages/survey-creator-core/src/components/surface-placeholder.scss new file mode 100644 index 0000000000..122c1f95bb --- /dev/null +++ b/packages/survey-creator-core/src/components/surface-placeholder.scss @@ -0,0 +1,83 @@ +@import "../variables.scss"; + +.svc-surface-placeholder { + display: flex; + width: 100%; + max-width: var(--ctr-surface-placeholder-max-width, 720px); + flex-direction: column; + align-items: center; + justify-content: center; + gap: 0px; + padding: calcSize(2); + box-sizing: border-box; +} + +.svc-surface-placeholder__image { + display: flex; + flex-direction: row; + gap: 0px; + align-items: center; + justify-content: center; + flex-shrink: 0; + position: relative; + overflow: hidden; + padding: 133px 168px 133px 168px; + display: flex; + flex-direction: row; + gap: 0px; + align-items: center; + justify-content: center; +} + +.svc-surface-placeholder__image--designer { + background: url("../images/placeholder-designer.png") no-repeat; +} + +.svc-surface-placeholder__image--preview { + background: url("../images/placeholder-preview.png") no-repeat; +} + +.svc-surface-placeholder__image--theme { + background: url("../images/placeholder-themes.png") no-repeat; +} + +.svc-surface-placeholder__image--logic { + background: url("../images/placeholder-logic.png") no-repeat; +} + +.svc-surface-placeholder__image--translation { + background: url("../images/placeholder-translations.png") no-repeat; +} + +.svc-surface-placeholder__text { + padding: var(--ctr-surface-placeholder-text-margin-top, 32px) 0px var(--ctr-surface-placeholder-text-margin-bottom, 24px) 0px; + display: flex; + flex-direction: column; + gap: var(--ctr-surface-placeholder-text-gap, 8px); + align-items: center; + justify-content: center; + align-self: center; + flex-shrink: 0; + width: 100%; +} + +.svc-surface-placeholder__title { + color: var(--ctr-surface-placeholder-text-title-color, rgba(0, 0, 0, 0.91)); + text-align: center; + font-family: var(--ctr-medium-bold-font-family, "OpenSans-Bold", sans-serif); + font-size: var(--ctr-medium-bold-font-size, 24px); + line-height: var(--ctr-medium-bold-line-height, 32px); + font-weight: var(--ctr-medium-bold-font-weight, 700); + align-self: stretch; +} + +.svc-surface-placeholder__description { + color: var(--ctr-surface-placeholder-text-description-color, + rgba(0, 0, 0, 0.45)); + text-align: center; + font-family: var(--ctr-default-font-family, "OpenSans-Regular", sans-serif); + font-size: var(--ctr-default-font-size, 16px); + line-height: var(--ctr-default-line-height, 24px); + font-weight: var(--ctr-default-font-weight, 400); + align-self: stretch; +} \ No newline at end of file diff --git a/packages/survey-creator-core/src/components/tabs/designer.scss b/packages/survey-creator-core/src/components/tabs/designer.scss index 7d158d6d07..91ccd9c8d6 100644 --- a/packages/survey-creator-core/src/components/tabs/designer.scss +++ b/packages/survey-creator-core/src/components/tabs/designer.scss @@ -111,87 +111,6 @@ svc-tab-designer { } } -.svc-designer-placeholder__image { - display: flex; - flex-direction: row; - gap: 0px; - align-items: center; - justify-content: center; - flex-shrink: 0; - position: relative; - overflow: hidden; - padding: 133px 168px 133px 168px; - display: flex; - flex-direction: row; - gap: 0px; - align-items: center; - justify-content: center; -} - -.svc-tab-designer { - .svc-designer-placeholder__image { - background: url("../../images/placeholder-designer.png") no-repeat; - } -} - -.svc-test-tab { - .svc-designer-placeholder__image { - background: url("../../images/placeholder-preview.png") no-repeat; - } -} - -.svc-themes-tab { - .svc-designer-placeholder__image { - background: url("../../images/placeholder-themes.png") no-repeat; - } -} - -.svc-logic-tab { - .svc-designer-placeholder__image { - background: url("../../images/placeholder-logic.png") no-repeat; - } -} - -.svc-translation-tab { - .svc-designer-placeholder__image { - background: url("../../images/placeholder-translations.png") no-repeat; - } -} - -.svc-designer-placeholder__text { - padding: var(--ctr-surface-placeholder-text-margin-top, 32px) 0px var(--ctr-surface-placeholder-text-margin-bottom, 24px) 0px; - display: flex; - flex-direction: column; - gap: var(--ctr-surface-placeholder-text-gap, 8px); - align-items: center; - justify-content: center; - align-self: stretch; - flex-shrink: 0; - width: 100%; - max-width: var(--ctr-surface-placeholder-max-width, 720px); -} - -.svc-designer-placeholder__title { - color: var(--ctr-surface-placeholder-text-title-color, rgba(0, 0, 0, 0.91)); - text-align: center; - font-family: var(--ctr-medium-bold-font-family, "OpenSans-Bold", sans-serif); - font-size: var(--ctr-medium-bold-font-size, 24px); - line-height: var(--ctr-medium-bold-line-height, 32px); - font-weight: var(--ctr-medium-bold-font-weight, 700); - align-self: stretch; -} - -.svc-designer-placeholder__description { - color: var(--ctr-surface-placeholder-text-description-color, - rgba(0, 0, 0, 0.45)); - text-align: center; - font-family: var(--ctr-default-font-family, "OpenSans-Regular", sans-serif); - font-size: var(--ctr-default-font-size, 16px); - line-height: var(--ctr-default-line-height, 24px); - font-weight: var(--ctr-default-font-weight, 400); - align-self: stretch; -} - .svc-designer-placeholder-page { margin-top: calcSize(2); } diff --git a/packages/survey-creator-core/src/components/tabs/designer.ts b/packages/survey-creator-core/src/components/tabs/designer.ts index 4af8555df4..f9e691dbe8 100644 --- a/packages/survey-creator-core/src/components/tabs/designer.ts +++ b/packages/survey-creator-core/src/components/tabs/designer.ts @@ -4,7 +4,6 @@ import { getLocString } from "../../editorLocalization"; import { PagesController } from "../../pages-controller"; import { SurveyHelper } from "../../survey-helper"; import { DragDropSurveyElements } from "../../survey-elements"; -import { SurveyElementActionContainer } from "../action-container-view-model"; require("./designer.scss"); export const initialSettingsAllowShowEmptyTitleInDesignMode = settings.allowShowEmptyTitleInDesignMode; diff --git a/packages/survey-creator-core/src/components/tabs/logic-ui.scss b/packages/survey-creator-core/src/components/tabs/logic-ui.scss index 36d42ec178..ca30d00a9c 100644 --- a/packages/survey-creator-core/src/components/tabs/logic-ui.scss +++ b/packages/survey-creator-core/src/components/tabs/logic-ui.scss @@ -219,11 +219,15 @@ } .svc-logic-tab__content { - &.svc-logic-tab__empty { + &.svc-logic-tab--empty { display: flex; flex-direction: column; align-items: center; justify-content: center; + flex-grow: 1; + flex-shrink: 0; + width: 100%; + gap: 0px; .svc-logic-tab__content-action { width: calcSize(33); @@ -299,6 +303,7 @@ .sl-table__cell--detail-panel { padding: 0; + .sd-body { margin: 0; min-width: none; @@ -377,4 +382,4 @@ .sv-popup--dropdown-overlay .sv-list__filter { padding-top: calcSize(1.5); -} +} \ No newline at end of file diff --git a/packages/survey-creator-core/src/components/tabs/translation.scss b/packages/survey-creator-core/src/components/tabs/translation.scss index 5a724674c4..cba8b44bf8 100644 --- a/packages/survey-creator-core/src/components/tabs/translation.scss +++ b/packages/survey-creator-core/src/components/tabs/translation.scss @@ -11,6 +11,18 @@ --sjs-transition-duration: 0ms; } +.svc-translation-tab--empty { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + flex-grow: 1; + flex-shrink: 0; + width: 100%; + gap: 0px; +} + + .st-properties { background-color: var(--ctr-property-grid-background-color, $background-dim); flex-grow: 1; @@ -268,6 +280,7 @@ td.st-table__cell:first-of-type { width: auto; } } + .st-body { @include disableLibraryAnimations; } \ No newline at end of file diff --git a/packages/survey-creator-knockout/src/tabs/logic.html b/packages/survey-creator-knockout/src/tabs/logic.html index 7bb08a127c..3e75e5c629 100644 --- a/packages/survey-creator-knockout/src/tabs/logic.html +++ b/packages/survey-creator-knockout/src/tabs/logic.html @@ -1,6 +1,6 @@
-
+
diff --git a/packages/survey-creator-react/src/components/SurfacePlaceholder.tsx b/packages/survey-creator-react/src/components/SurfacePlaceholder.tsx new file mode 100644 index 0000000000..dc37764ce0 --- /dev/null +++ b/packages/survey-creator-react/src/components/SurfacePlaceholder.tsx @@ -0,0 +1,31 @@ +import * as React from "react"; +import { ReactElementFactory } from "survey-react-ui"; + +interface ISurfacePlaceholderProps { + name: string; + placeholderTitleText: string; + placeholderDescriptionText: string; +} + +export class SurfacePlaceholder extends React.Component { + constructor(props: ISurfacePlaceholderProps) { + super(props); + } + render(): JSX.Element { + return ( +
+
+
+
{this.props.placeholderTitleText}
+
{this.props.placeholderDescriptionText}
+
+
+ ); + } +} + +ReactElementFactory.Instance.registerElement("svc-surface-placeholder", + (props: ISurfacePlaceholderProps) => { + return React.createElement(SurfacePlaceholder, props); + } +); \ No newline at end of file diff --git a/packages/survey-creator-react/src/tabs/Designer.tsx b/packages/survey-creator-react/src/tabs/Designer.tsx index 649e403a60..4d60143b41 100644 --- a/packages/survey-creator-react/src/tabs/Designer.tsx +++ b/packages/survey-creator-react/src/tabs/Designer.tsx @@ -8,7 +8,7 @@ import { } from "survey-react-ui"; import { SurveyCreatorModel, TabDesignerViewModel } from "survey-creator-core"; import { SurveyPageNavigator } from "../PageNavigator"; -import { SurveyNavigation } from "../Navigation"; +import { SurfacePlaceholder } from "../components/SurfacePlaceholder"; interface ITabDesignerComponentProps { data: TabDesignerViewModel; @@ -156,14 +156,7 @@ export class TabDesignerComponent extends SurveyElementBase); } renderPlaceHolderContent(): JSX.Element { - // return {this.model.placeholderText}; - return (<> -
-
-
{this.model.placeholderTitleText}
-
{this.model.placeholderDescriptionText}
-
- ); + return ; } renderTabContent(): JSX.Element { const survey: SurveyModel = this.creator.survey; diff --git a/packages/survey-creator-react/src/tabs/Logic.tsx b/packages/survey-creator-react/src/tabs/Logic.tsx index 7725f23787..db31bb43c5 100644 --- a/packages/survey-creator-react/src/tabs/Logic.tsx +++ b/packages/survey-creator-react/src/tabs/Logic.tsx @@ -3,6 +3,7 @@ import * as React from "react"; import { Action, Base } from "survey-core"; import { ReactElementFactory, SurveyElementBase, Survey, attachKey2click } from "survey-react-ui"; import { SurveyLogicUI } from "survey-creator-core"; +import { SurfacePlaceholder } from "src/components/SurfacePlaceholder"; export class TabLogicAddButtonComponent extends SurveyElementBase { private get model(): Action { @@ -48,7 +49,7 @@ export class TabLogicComponent extends SurveyElementBase { return
{content}
; } private renderViewContent(): JSX.Element { - const logicTabClassName = "svc-plugin-tab__content svc-logic-tab svc-logic-tab__content " + (this.model.hasItems ? "" : "svc-logic-tab__empty"); + const logicTabClassName = "svc-plugin-tab__content svc-logic-tab svc-logic-tab__content " + (this.model.hasItems ? "" : "svc-logic-tab--empty"); const addLogic = !this.model.readOnly ? : undefined; return ( @@ -56,12 +57,7 @@ export class TabLogicComponent extends SurveyElementBase { {this.model.hasItems ? null : (
- {/* {this.model.emptyTabPlaceholder} */} -
-
-
{this.model.placeholderTitleText}
-
{this.model.placeholderDescriptionText}
-
+
)} {addLogic}
diff --git a/packages/survey-creator-react/src/tabs/translation/Translation.tsx b/packages/survey-creator-react/src/tabs/translation/Translation.tsx index 789970747d..8274d37b1b 100644 --- a/packages/survey-creator-react/src/tabs/translation/Translation.tsx +++ b/packages/survey-creator-react/src/tabs/translation/Translation.tsx @@ -6,6 +6,7 @@ import { Survey } from "survey-react-ui"; import { Translation } from "survey-creator-core"; +import { SurfacePlaceholder } from "src/components/SurfacePlaceholder"; export class TabTranslationComponent extends SurveyElementBase { private get model(): Translation { @@ -17,25 +18,14 @@ export class TabTranslationComponent extends SurveyElementBase { renderElement(): JSX.Element { if (!this.model) return null; return ( -
+
{this.renderElementContent()}
); } renderElementContent(): JSX.Element { if (this.model.isEmpty) { - // return ( - //
- // {this.model.noStringsText} - //
- // ); - return (<> -
-
-
{this.model.placeholderTitleText}
-
{this.model.placeholderDescriptionText}
-
- ); + return ; } else { return (
diff --git a/packages/survey-creator-vue/src/tabs/logic/Logic.vue b/packages/survey-creator-vue/src/tabs/logic/Logic.vue index 37f937d2f8..f7fe0114e5 100644 --- a/packages/survey-creator-vue/src/tabs/logic/Logic.vue +++ b/packages/survey-creator-vue/src/tabs/logic/Logic.vue @@ -2,7 +2,7 @@