diff --git a/functionalTests/designer/toolbox.ts b/functionalTests/designer/toolbox.ts index edf1ae0f6c..02e0835339 100644 --- a/functionalTests/designer/toolbox.ts +++ b/functionalTests/designer/toolbox.ts @@ -355,6 +355,12 @@ test("toolbox subTypes: add items by drag-n-drop", async (t) => { .hover(getToolboxItemByText("Rating Scale").parent(".svc-toolbox__tool").find(".svc-toolbox__item-submenu-button")) .wait(400) .expect(toolboxSubTypesPopup.visible).ok() + .hover(getToolboxItemByText("Rating Scale").parent(".svc-toolbox__tool")) + .wait(400) + .expect(toolboxSubTypesPopup.visible).notOk() + .hover(getToolboxItemByText("Rating Scale").parent(".svc-toolbox__tool").find(".svc-toolbox__item-submenu-button")) + .wait(400) + .expect(toolboxSubTypesPopup.visible).ok() .hover(getSubToolboxItemByText("Smileys"), { speed: 0.1 }) .wait(400) diff --git a/packages/survey-creator-angular/src/toolbox/toolbox-item-group.component.html b/packages/survey-creator-angular/src/toolbox/toolbox-item-group.component.html index 3f64b92d08..565354ef48 100644 --- a/packages/survey-creator-angular/src/toolbox/toolbox-item-group.component.html +++ b/packages/survey-creator-angular/src/toolbox/toolbox-item-group.component.html @@ -1,7 +1,8 @@ -
+
+
- \ No newline at end of file diff --git a/packages/survey-creator-angular/src/toolbox/toolbox-tool.component.html b/packages/survey-creator-angular/src/toolbox/toolbox-tool.component.html index f038f634dc..1569bdb5d2 100644 --- a/packages/survey-creator-angular/src/toolbox/toolbox-tool.component.html +++ b/packages/survey-creator-angular/src/toolbox/toolbox-tool.component.html @@ -2,9 +2,7 @@
-
+
diff --git a/packages/survey-creator-core/creator-themes-import.js b/packages/survey-creator-core/creator-themes-import.js index c2846b3a52..369b9877ae 100644 --- a/packages/survey-creator-core/creator-themes-import.js +++ b/packages/survey-creator-core/creator-themes-import.js @@ -22,8 +22,9 @@ var themeConstants = { "--ctr-toolbox-scrollbar-right": "0", "--ctr-toolbox-scroller-align-items": "flex-start", "--ctr-toolbox-item-submenu-button-right": "8px", + "--ctr-toolbox-item-submenu-button-top": "12px", "--ctr-toolbox-item-align": "stretch", - "--ctr-toolbox-submenu-offset": "13px", + "--ctr-toolbox-submenu-offset": "20px", "--ctr-toolbox-width-compact": "72px", "--ctr-toolbox-margin-left-compact": "0px", "--ctr-toolbox-separator-width": "208px", diff --git a/packages/survey-creator-core/src/components/toolbox/toolbox-right.scss b/packages/survey-creator-core/src/components/toolbox/toolbox-right.scss index af1bdef067..0babf5c096 100644 --- a/packages/survey-creator-core/src/components/toolbox/toolbox-right.scss +++ b/packages/survey-creator-core/src/components/toolbox/toolbox-right.scss @@ -12,7 +12,9 @@ } } .svc-toolbox__item-submenu-button { + svg { transform: rotate(180deg); + } } } .svc-creator__toolbox--right { diff --git a/packages/survey-creator-core/src/components/toolbox/toolbox-tool.scss b/packages/survey-creator-core/src/components/toolbox/toolbox-tool.scss index 46fcb065af..4ab8a7500e 100644 --- a/packages/survey-creator-core/src/components/toolbox/toolbox-tool.scss +++ b/packages/survey-creator-core/src/components/toolbox/toolbox-tool.scss @@ -110,12 +110,12 @@ border-top-color: transparent; border-inline-end-color: transparent; box-shadow: - var(--ctr-tooltip-shadow-1-offset-x, 0px) var(--ctr-tooltip-shadow-1-offset-y, 2px) - var(--ctr-tooltip-shadow-1-blur, 6px) var(--ctr-tooltip-shadow-1-spread, 0px) - var(--ctr-tooltip-shadow-1-color, rgba(0, 0, 0, 0.1)), - var(--ctr-tooltip-shadow-2-offset-x, 0px) var(--ctr-tooltip-shadow-2-offset-y, 1px) - var(--ctr-tooltip-shadow-2-blur, 2px) var(--ctr-tooltip-shadow-2-spread, 0px) - var(--ctr-tooltip-shadow-2-color, transparent); + var(--ctr-tooltip-shadow-1-offset-x, 0px) var(--ctr-tooltip-shadow-1-offset-y, 2px) + var(--ctr-tooltip-shadow-1-blur, 6px) var(--ctr-tooltip-shadow-1-spread, 0px) + var(--ctr-tooltip-shadow-1-color, rgba(0, 0, 0, 0.1)), + var(--ctr-tooltip-shadow-2-offset-x, 0px) var(--ctr-tooltip-shadow-2-offset-y, 1px) + var(--ctr-tooltip-shadow-2-blur, 2px) var(--ctr-tooltip-shadow-2-spread, 0px) + var(--ctr-tooltip-shadow-2-color, transparent); align-self: center; position: absolute; inset-inline-end: 100%; @@ -124,7 +124,6 @@ clip-path: polygon(-100% -100%, -100% 200%, 200% 200%); } - .sv-svg-icon use { fill: var(--ctr-toolbox-item-icon-color-hovered, $primary); } @@ -151,11 +150,11 @@ // padding-inline-start: calcSize(4); // } } - .svc-toolbox__item-submenu-button { - background: var(--ctr-toolbox-item-submenu-button-background-color, $background-dim); - &:hover { - background: var(--ctr-toolbox-item-submenu-button-background-color-hovered, $background); - } +} +.svc-toolbox__item-submenu-button { + background: var(--ctr-toolbox-item-submenu-button-background-color, $background-dim); + &:hover { + background: var(--ctr-toolbox-item-submenu-button-background-color-hovered, $background); } } @@ -218,7 +217,7 @@ .svc-toolbox__item-submenu-button { position: absolute; inset-inline-end: var(--ctr-toolbox-item-submenu-button-right, calcSize(1.5)); - top: calcSize(1.5); + top: var(--ctr-toolbox-item-submenu-button-top, calcSize(1.5)); display: inline-flex; padding: var(--ctr-toolbox-item-submenu-button-padding-top, 4px) var(--ctr-toolbox-item-submenu-button-padding-right, 4px) var(--ctr-toolbox-item-submenu-button-padding-bottom, 4px) @@ -228,7 +227,7 @@ box-sizing: border-box; align-items: center; border-radius: var(--ctr-toolbox-item-submenu-button-corner-radius, 1024px); - z-index: 20; + z-index: 40; svg { fill: var(--ctr-toolbox-item-submenu-button-icon-color, $layer-1-foreground-50); } @@ -276,8 +275,13 @@ .svc-toolbox-subtypes { .sv-popup__container { + --toolbox-item-padding-top: calc(1 * #{$base-unit}); + margin-top: calc( + 0px - var(--ctr-toolbox-submenu-group-margin-top, 0px) - + var(--ctr-toolbox-item-padding-top, var(--toolbox-item-padding-top)) + ); padding: 0; - padding-inline-start: var(--ctr-toolbox-submenu-offset, calcSize(0.5)); + padding-inline-start: var(--ctr-toolbox-submenu-offset, calcSize(3.5)); box-shadow: unset; background: unset; } @@ -301,10 +305,10 @@ } .sv-popup__scrolling-content { - padding-top: calc(var(--ctr-toolbox-submenu-group-margin-top, 12px)); - padding-inline-end: var(--ctr-toolbox-submenu-group-margin-right, 12px); - padding-bottom: var(--ctr-toolbox-submenu-group-margin-bottom-last, 12px); - padding-inline-start: var(--ctr-toolbox-submenu-group-margin-left, 12px); + padding-top: calc(var(--ctr-toolbox-submenu-group-margin-top, 0px)); + padding-inline-end: var(--ctr-toolbox-submenu-group-margin-right, 0px); + padding-bottom: var(--ctr-toolbox-submenu-group-margin-bottom-last, 0px); + padding-inline-start: var(--ctr-toolbox-submenu-group-margin-left, 0px); overflow: visible; } diff --git a/packages/survey-creator-core/src/components/toolbox/toolbox-tool.ts b/packages/survey-creator-core/src/components/toolbox/toolbox-tool.ts index 9c15202844..a1d30a467b 100644 --- a/packages/survey-creator-core/src/components/toolbox/toolbox-tool.ts +++ b/packages/survey-creator-core/src/components/toolbox/toolbox-tool.ts @@ -53,9 +53,6 @@ export class ToolboxToolViewModel extends Base { public onMouseOver(itemValue, mouseoverEvent) { this.model.mouseOverHandler(itemValue); } - public onMouseOverTool(itemValue, mouseoverEvent) { - if (itemValue.popupModel?.isVisible) this.onMouseOver(itemValue, mouseoverEvent); - } public onMouseLeave(itemValue, mouseoverEvent) { itemValue.hidePopupDelayed(this.creator.toolbox.subItemsHideDelay); diff --git a/packages/survey-creator-core/src/components/toolbox/toolbox.scss b/packages/survey-creator-core/src/components/toolbox/toolbox.scss index c52a525c50..8be614392b 100644 --- a/packages/survey-creator-core/src/components/toolbox/toolbox.scss +++ b/packages/survey-creator-core/src/components/toolbox/toolbox.scss @@ -205,7 +205,6 @@ svc-toolbox { .svc-toolbox__search-container { position: sticky; top: 0; - z-index: 30; display: none; flex-direction: column; box-sizing: border-box; diff --git a/packages/survey-creator-core/src/themes/default.ts b/packages/survey-creator-core/src/themes/default.ts index cc9f90f616..5237a94d71 100644 --- a/packages/survey-creator-core/src/themes/default.ts +++ b/packages/survey-creator-core/src/themes/default.ts @@ -5,8 +5,9 @@ const Theme = { "--ctr-toolbox-scrollbar-right": "0", "--ctr-toolbox-scroller-align-items": "flex-start", "--ctr-toolbox-item-submenu-button-right": "8px", + "--ctr-toolbox-item-submenu-button-top": "12px", "--ctr-toolbox-item-align": "stretch", - "--ctr-toolbox-submenu-offset": "13px", + "--ctr-toolbox-submenu-offset": "20px", "--ctr-toolbox-width-compact": "72px", "--ctr-toolbox-margin-left-compact": "0px", "--ctr-toolbox-separator-width": "208px", diff --git a/packages/survey-creator-knockout/src/toolbox/toolbox-item-group.html b/packages/survey-creator-knockout/src/toolbox/toolbox-item-group.html index 3fa5282e87..784daafc46 100644 --- a/packages/survey-creator-knockout/src/toolbox/toolbox-item-group.html +++ b/packages/survey-creator-knockout/src/toolbox/toolbox-item-group.html @@ -1,7 +1,7 @@
+ data-bind="event: { mouseover: onMouseOver, mouseleave: onMouseLeave }"> -
- \ No newline at end of file + +
\ No newline at end of file diff --git a/packages/survey-creator-knockout/src/toolbox/toolbox-tool.html b/packages/survey-creator-knockout/src/toolbox/toolbox-tool.html index 79041715de..a1a91608c4 100644 --- a/packages/survey-creator-knockout/src/toolbox/toolbox-tool.html +++ b/packages/survey-creator-knockout/src/toolbox/toolbox-tool.html @@ -4,7 +4,7 @@
+ data-bind="event: { pointerdown: (model, event)=>{onPointerDown(event); return true;} }">
diff --git a/packages/survey-creator-react/src/toolbox/ToolboxItem.tsx b/packages/survey-creator-react/src/toolbox/ToolboxItem.tsx index cc79b2cd6f..9364b7c8e8 100644 --- a/packages/survey-creator-react/src/toolbox/ToolboxItem.tsx +++ b/packages/survey-creator-react/src/toolbox/ToolboxItem.tsx @@ -85,12 +85,6 @@ export class SurveyCreatorToolboxTool extends CreatorModelElement< event.persist(); this.model.onPointerDown(event); }} - onMouseOver={(event: any) => { - this.model.onMouseOverTool(item, event); - }} - onMouseLeave={(event: any) => { - this.model.onMouseLeave(item, event); - }} > {itemComponent}
diff --git a/packages/survey-creator-react/src/toolbox/ToolboxItemGroup.tsx b/packages/survey-creator-react/src/toolbox/ToolboxItemGroup.tsx index 37033867d1..c3c5baf262 100644 --- a/packages/survey-creator-react/src/toolbox/ToolboxItemGroup.tsx +++ b/packages/survey-creator-react/src/toolbox/ToolboxItemGroup.tsx @@ -38,8 +38,8 @@ export class SurveyCreatorToolboxItemGroup extends CreatorModelElement this.model.onMouseLeave(this.item, event)} > +
- ; } } diff --git a/packages/survey-creator-vue/src/toolbox/ToolboxItemGroup.vue b/packages/survey-creator-vue/src/toolbox/ToolboxItemGroup.vue index 0053e0fdf5..eadcaf4cee 100644 --- a/packages/survey-creator-vue/src/toolbox/ToolboxItemGroup.vue +++ b/packages/survey-creator-vue/src/toolbox/ToolboxItemGroup.vue @@ -6,14 +6,14 @@ :creator="creator" :isCompact="isCompact" > -
+
+
- diff --git a/packages/survey-creator-vue/src/toolbox/ToolboxTool.vue b/packages/survey-creator-vue/src/toolbox/ToolboxTool.vue index ea081162c7..cba9456888 100644 --- a/packages/survey-creator-vue/src/toolbox/ToolboxTool.vue +++ b/packages/survey-creator-vue/src/toolbox/ToolboxTool.vue @@ -7,16 +7,6 @@