@sula-tech/webcomponents 0.14.0 → 0.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sula-avatar_21.cjs.entry.js +18 -15
- package/dist/cjs/sula-avatar_21.cjs.entry.js.map +1 -1
- package/dist/cjs/webcomponents.cjs.js +1 -1
- package/dist/collection/components/sula-dropdown/sula-dropdown.js +39 -17
- package/dist/collection/components/sula-dropdown/sula-dropdown.js.map +1 -1
- package/dist/collection/components/sula-dropdown/sula-dropdown.stories.js +16 -1
- package/dist/collection/components/sula-dropdown/sula-dropdown.stories.js.map +1 -1
- package/dist/components/sula-dropdown.js +20 -17
- package/dist/components/sula-dropdown.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sula-avatar_21.entry.js +18 -15
- package/dist/esm/sula-avatar_21.entry.js.map +1 -1
- package/dist/esm/webcomponents.js +1 -1
- package/dist/types/components/sula-dropdown/sula-dropdown.d.ts +5 -2
- package/dist/types/components/sula-dropdown/sula-dropdown.stories.d.ts +8 -0
- package/dist/types/components.d.ts +10 -0
- package/dist/webcomponents/{p-01cb6887.entry.js → p-a7141407.entry.js} +24 -22
- package/dist/webcomponents/p-a7141407.entry.js.map +1 -0
- package/dist/webcomponents/webcomponents.esm.js +3 -3
- package/package.json +1 -1
- package/dist/webcomponents/p-01cb6887.entry.js.map +0 -1
|
@@ -16,7 +16,7 @@ var patchBrowser = () => {
|
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(async (options) => {
|
|
18
18
|
await globalScripts();
|
|
19
|
-
return bootstrapLazy([["sula-avatar_21",[[1,"sula-modal",{"opened":[1028],"blockBodyScroll":[1028,"block-body-scroll"],"closeOnClickOutside":[1028,"close-on-click-outside"],"type":[1],"headerIcon":[1,"header-icon"],"modalTitle":[1,"modal-title"],"promoImage":[1,"promo-image"],"subTitle":[1,"sub-title"],"primaryButtonText":[1,"primary-button-text"],"secondaryButtonText":[1,"secondary-button-text"],"slotOverflow":[1,"slot-overflow"],"isAnimating":[32],"shouldRender":[32]},null,{"opened":["handleOpenedChange"]}],[1,"sula-chip",{"text":[1025],"appearance":[1025],"disabled":[1028],"items":[1040],"selected":[1028],"isFocused":[32],"showItems":[32]},[[4,"click","handleDocumentClick"]]],[1,"sula-dropdown",{"label":[1025],"disabled":[1028],"items":[1040],"value":[1040],"searchable":[516],"menuMaxHeight":[2,"menu-max-height"],"contentMaxHeight":[2,"content-max-height"],"customContent":[516,"custom-content"],"closeOnSelect":[4,"close-on-select"],"
|
|
19
|
+
return bootstrapLazy([["sula-avatar_21",[[1,"sula-modal",{"opened":[1028],"blockBodyScroll":[1028,"block-body-scroll"],"closeOnClickOutside":[1028,"close-on-click-outside"],"type":[1],"headerIcon":[1,"header-icon"],"modalTitle":[1,"modal-title"],"promoImage":[1,"promo-image"],"subTitle":[1,"sub-title"],"primaryButtonText":[1,"primary-button-text"],"secondaryButtonText":[1,"secondary-button-text"],"slotOverflow":[1,"slot-overflow"],"isAnimating":[32],"shouldRender":[32]},null,{"opened":["handleOpenedChange"]}],[1,"sula-chip",{"text":[1025],"appearance":[1025],"disabled":[1028],"items":[1040],"selected":[1028],"isFocused":[32],"showItems":[32]},[[4,"click","handleDocumentClick"]]],[1,"sula-dropdown",{"label":[1025],"disabled":[1028],"items":[1040],"value":[1040],"searchable":[516],"menuMaxHeight":[2,"menu-max-height"],"contentMaxHeight":[2,"content-max-height"],"customContent":[516,"custom-content"],"closeOnSelect":[4,"close-on-select"],"showContent":[1540,"show-content"],"selectedItem":[32],"isFocused":[32],"searchTerm":[32],"filteredItems":[32],"openUpward":[32]},[[4,"click","handleDocumentClick"],[9,"resize","handleWindowResize"]],{"value":["handleValueChange"],"showContent":["handleShowContentChange"]}],[1,"sula-avatar",{"size":[1],"imageUrl":[1,"image-url"],"text":[1],"icon":[1]}],[1,"sula-badge",{"status":[1025],"size":[1025],"type":[1025],"text":[1025],"icon":[1025],"hasSlotContent":[32]}],[1,"sula-breadcrumb",{"items":[1040]}],[1,"sula-checkbox",{"type":[1025],"label":[1025],"subTitle":[1025,"sub-title"],"disabled":[1028],"checked":[1028],"isFocus":[32]}],[1,"sula-progress-bar",{"appearance":[1025],"state":[1025],"topLabel":[1025,"top-label"],"bottomLabel":[1025,"bottom-label"],"progress":[1026],"showProgress":[1028,"show-progress"]},null,{"progress":["validateProgress"]}],[1,"sula-search-bar",{"value":[1025],"searchBarStyle":[1025,"search-bar-style"],"placeholder":[1025],"leftIcon":[1025,"left-icon"],"rightIcon":[1025,"right-icon"],"isFocused":[32],"textValue":[32]}],[1,"sula-segmented-control",{"items":[1040],"type":[1025],"size":[1025],"color":[1025]}],[1,"sula-tag",{"label":[1025],"icon":[1025],"iconStatus":[1025,"icon-status"],"size":[1025],"appearance":[1025],"fontWeight":[1025,"font-weight"]}],[1,"sula-textfield",{"value":[1025],"type":[1],"status":[1025],"label":[1],"placeholder":[1],"disabled":[1028],"helpText":[1,"help-text"],"maxLength":[2,"max-length"],"icon":[1],"maskPattern":[1,"mask-pattern"],"maskPatternSwitchMaxLength":[2,"mask-pattern-switch-max-length"],"inputIsOpen":[32],"textValue":[32],"showPassword":[32],"inputIsFocused":[32]},[[4,"click","handleClick"]],{"value":["watchValueHandler"],"maskPattern":["watchMaskPatternHandler"],"maskPatternSwitchMaxLength":["watchMaskPatternSwitchMaxLengthHandler"]}],[1,"sula-tiles",{"type":[1],"size":[1],"ellipsis":[4],"icon":[1],"text":[1],"subText":[1,"sub-text"],"disabled":[4]}],[1,"sula-timeline-list",{"sulaTimelineList":[1040,"sula-timeline-list"]}],[1,"sula-radio-button",{"checked":[1028],"label":[1025],"disabled":[1028],"radioIsFocus":[32]}],[1,"sula-switch",{"type":[1025],"active":[1028],"disabled":[1028],"label":[1025],"subTitle":[1025,"sub-title"],"responsive":[4],"isFocus":[32]}],[1,"sula-textarea",{"value":[1025],"status":[1025],"label":[1],"placeholder":[1],"disabled":[1028],"helpText":[1,"help-text"],"maxLength":[2,"max-length"],"rows":[2],"isActive":[32],"textValue":[32],"textareaIsFocused":[32],"labelPadding":[32]},[[4,"click","handleClick"]],{"value":["watchValueHandler"]}],[1,"sula-button",{"text":[1025],"icon":[1025],"leftIcon":[1025,"left-icon"],"rightIcon":[1025,"right-icon"],"appearance":[1025],"type":[1025],"size":[1025],"status":[1025],"loading":[1028],"buttonDisabled":[1028,"button-disabled"],"fullWidth":[1028,"full-width"]}],[1,"sula-loader",{"size":[1],"animationInstance":[32]}],[1,"sula-menu-select-list",{"items":[1040],"fullWidth":[4,"full-width"],"maxHeight":[2,"max-height"],"selectedValue":[16,"selected-value"]}],[0,"sula-icon",{"icon":[1],"customClass":[1,"custom-class"]}]]]], options);
|
|
20
20
|
});
|
|
21
21
|
//# sourceMappingURL=webcomponents.js.map
|
|
22
22
|
|
|
@@ -37,6 +37,10 @@ export declare class SulaDropdown {
|
|
|
37
37
|
* Close dropdown when an item is selected or content is clicked
|
|
38
38
|
*/
|
|
39
39
|
closeOnSelect: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Show or hide dropdown content
|
|
42
|
+
*/
|
|
43
|
+
showContent: boolean;
|
|
40
44
|
/**
|
|
41
45
|
* Event emitted when dropdown is clicked
|
|
42
46
|
*/
|
|
@@ -54,7 +58,6 @@ export declare class SulaDropdown {
|
|
|
54
58
|
*/
|
|
55
59
|
menuItemSelected: EventEmitter<SulaMenuListItem>;
|
|
56
60
|
selectedItem?: SulaMenuListItem;
|
|
57
|
-
showItems: boolean;
|
|
58
61
|
isFocused: boolean;
|
|
59
62
|
searchTerm: string;
|
|
60
63
|
filteredItems: SulaMenuListItem[];
|
|
@@ -62,7 +65,7 @@ export declare class SulaDropdown {
|
|
|
62
65
|
node?: HTMLElement;
|
|
63
66
|
searchInputRef?: HTMLInputElement;
|
|
64
67
|
handleValueChange(): void;
|
|
65
|
-
|
|
68
|
+
handleShowContentChange(newValue: boolean): void;
|
|
66
69
|
handleDocumentClick(event: Event): void;
|
|
67
70
|
handleWindowResize(): void;
|
|
68
71
|
calculateMenuPosition(): void;
|
|
@@ -74,6 +74,14 @@ declare const _default: {
|
|
|
74
74
|
required: boolean;
|
|
75
75
|
};
|
|
76
76
|
};
|
|
77
|
+
showContent: {
|
|
78
|
+
control: string;
|
|
79
|
+
defaultValue: boolean;
|
|
80
|
+
description: string;
|
|
81
|
+
type: {
|
|
82
|
+
required: boolean;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
77
85
|
dropdownClicked: {
|
|
78
86
|
action: string;
|
|
79
87
|
description: string;
|
|
@@ -240,6 +240,11 @@ export namespace Components {
|
|
|
240
240
|
* Enable search/filter functionality in dropdown
|
|
241
241
|
*/
|
|
242
242
|
"searchable"?: boolean;
|
|
243
|
+
/**
|
|
244
|
+
* Show or hide dropdown content
|
|
245
|
+
* @default false
|
|
246
|
+
*/
|
|
247
|
+
"showContent": boolean;
|
|
243
248
|
/**
|
|
244
249
|
* Value for dropdown
|
|
245
250
|
*/
|
|
@@ -1263,6 +1268,11 @@ declare namespace LocalJSX {
|
|
|
1263
1268
|
* Enable search/filter functionality in dropdown
|
|
1264
1269
|
*/
|
|
1265
1270
|
"searchable"?: boolean;
|
|
1271
|
+
/**
|
|
1272
|
+
* Show or hide dropdown content
|
|
1273
|
+
* @default false
|
|
1274
|
+
*/
|
|
1275
|
+
"showContent"?: boolean;
|
|
1266
1276
|
/**
|
|
1267
1277
|
* Value for dropdown
|
|
1268
1278
|
*/
|
|
@@ -734,7 +734,9 @@ const SulaDropdown = class {
|
|
|
734
734
|
/**
|
|
735
735
|
* Close dropdown when an item is selected or content is clicked
|
|
736
736
|
*/ this.closeOnSelect = true;
|
|
737
|
-
|
|
737
|
+
/**
|
|
738
|
+
* Show or hide dropdown content
|
|
739
|
+
*/ this.showContent = false;
|
|
738
740
|
this.isFocused = false;
|
|
739
741
|
this.searchTerm = "";
|
|
740
742
|
this.filteredItems = [];
|
|
@@ -743,9 +745,9 @@ const SulaDropdown = class {
|
|
|
743
745
|
if (this.disabled) return;
|
|
744
746
|
this.dropdownClicked.emit();
|
|
745
747
|
if (this.customContent || this.items.length > 0) {
|
|
746
|
-
this.
|
|
748
|
+
this.showContent = !this.showContent;
|
|
747
749
|
}
|
|
748
|
-
if (this.searchable && this.
|
|
750
|
+
if (this.searchable && this.showContent && this.searchInputRef) {
|
|
749
751
|
this.searchInputRef.focus();
|
|
750
752
|
}
|
|
751
753
|
};
|
|
@@ -755,7 +757,7 @@ const SulaDropdown = class {
|
|
|
755
757
|
this.menuItemSelected.emit(e.detail);
|
|
756
758
|
if (this.closeOnSelect) {
|
|
757
759
|
setTimeout((() => {
|
|
758
|
-
this.
|
|
760
|
+
this.showContent = false;
|
|
759
761
|
}), 0);
|
|
760
762
|
}
|
|
761
763
|
};
|
|
@@ -787,7 +789,7 @@ const SulaDropdown = class {
|
|
|
787
789
|
this.selectedItem = this.value;
|
|
788
790
|
}
|
|
789
791
|
}
|
|
790
|
-
|
|
792
|
+
handleShowContentChange(e) {
|
|
791
793
|
if (!e) {
|
|
792
794
|
this.searchTerm = "";
|
|
793
795
|
this.filteredItems = [];
|
|
@@ -798,11 +800,11 @@ const SulaDropdown = class {
|
|
|
798
800
|
const t = e.composedPath();
|
|
799
801
|
const o = t.some((e => e === this.node));
|
|
800
802
|
if (!o) {
|
|
801
|
-
this.
|
|
803
|
+
this.showContent = false;
|
|
802
804
|
}
|
|
803
805
|
}
|
|
804
806
|
handleWindowResize() {
|
|
805
|
-
if (this.
|
|
807
|
+
if (this.showContent) {
|
|
806
808
|
this.calculateMenuPosition();
|
|
807
809
|
}
|
|
808
810
|
}
|
|
@@ -822,7 +824,7 @@ const SulaDropdown = class {
|
|
|
822
824
|
}
|
|
823
825
|
}
|
|
824
826
|
componentDidRender() {
|
|
825
|
-
if (this.
|
|
827
|
+
if (this.showContent) {
|
|
826
828
|
this.calculateMenuPosition();
|
|
827
829
|
if (this.searchable && this.searchInputRef) {
|
|
828
830
|
this.searchInputRef.focus();
|
|
@@ -836,10 +838,10 @@ const SulaDropdown = class {
|
|
|
836
838
|
render() {
|
|
837
839
|
var e;
|
|
838
840
|
return h$1(Host, {
|
|
839
|
-
key: "
|
|
841
|
+
key: "812029af9121bf2f6b10b426b93dc0095796d66d",
|
|
840
842
|
ref: e => this.node = e
|
|
841
843
|
}, h$1("div", {
|
|
842
|
-
key: "
|
|
844
|
+
key: "24e4b075470cd3ac8311374d0eebbc9d62bc248e",
|
|
843
845
|
class: {
|
|
844
846
|
"flex justify-between items-center border border-line-input h-[72px] px-16 rounded-xl relative": true,
|
|
845
847
|
"bg-surface-body cursor-pointer": !this.disabled,
|
|
@@ -851,17 +853,17 @@ const SulaDropdown = class {
|
|
|
851
853
|
onFocus: this.handleFocus,
|
|
852
854
|
onBlur: this.handleBlur
|
|
853
855
|
}, h$1("div", {
|
|
854
|
-
key: "
|
|
856
|
+
key: "10bb402bb063b83a66996c3b21e345045779fea6",
|
|
855
857
|
class: "flex flex-col w-full"
|
|
856
858
|
}, h$1("label", {
|
|
857
|
-
key: "
|
|
859
|
+
key: "9e6013e76bd927d9cf50bccfe542205b2db5ad3c",
|
|
858
860
|
class: {
|
|
859
|
-
"text-base leading-4": !this.selectedItem && !(this.searchable && this.
|
|
860
|
-
"text-sm leading-4 font-bold": !!this.selectedItem || this.searchable && this.
|
|
861
|
+
"text-base leading-4": !this.selectedItem && !(this.searchable && this.showContent),
|
|
862
|
+
"text-sm leading-4 font-bold": !!this.selectedItem || this.searchable && this.showContent,
|
|
861
863
|
"text-text-primary": !this.disabled,
|
|
862
864
|
"text-text-disabled": this.disabled
|
|
863
865
|
}
|
|
864
|
-
}, this.label), this.searchable && this.
|
|
866
|
+
}, this.label), this.searchable && this.showContent ? h$1("input", {
|
|
865
867
|
ref: e => this.searchInputRef = e,
|
|
866
868
|
type: "text",
|
|
867
869
|
value: this.searchTerm,
|
|
@@ -875,14 +877,14 @@ const SulaDropdown = class {
|
|
|
875
877
|
"text-text-disabled": this.disabled
|
|
876
878
|
}
|
|
877
879
|
}, this.selectedItem.title)), h$1("div", {
|
|
878
|
-
key: "
|
|
880
|
+
key: "9c570fe666a9e400882728dd6cc7375efc6fd9c3",
|
|
879
881
|
class: "flex items-center justify-center ml-8 leading-6 text-2xl"
|
|
880
882
|
}, h$1("sula-icon", {
|
|
881
|
-
key: "
|
|
882
|
-
icon: `ph ph-caret-${this.
|
|
883
|
+
key: "c33165aec78c9d227a645d5a5390caa5f5580e48",
|
|
884
|
+
icon: `ph ph-caret-${this.showContent ? "up" : "down"}`,
|
|
883
885
|
customClass: `${this.getIconClass()} text-2xl`
|
|
884
|
-
})), this.
|
|
885
|
-
key: "
|
|
886
|
+
})), this.showContent && h$1("div", {
|
|
887
|
+
key: "a5f4c9c26cfc64bb39300474e8efb52174b538ab",
|
|
886
888
|
class: {
|
|
887
889
|
"absolute z-50 left-0 w-full transition-all duration-200 ease-in-out": true,
|
|
888
890
|
"bottom-[72px]": this.openUpward,
|
|
@@ -914,7 +916,7 @@ const SulaDropdown = class {
|
|
|
914
916
|
static get watchers() {
|
|
915
917
|
return {
|
|
916
918
|
value: [ "handleValueChange" ],
|
|
917
|
-
|
|
919
|
+
showContent: [ "handleShowContentChange" ]
|
|
918
920
|
};
|
|
919
921
|
}
|
|
920
922
|
};
|
|
@@ -23082,4 +23084,4 @@ SulaTimelineList.style = sulaTimelineListCss;
|
|
|
23082
23084
|
|
|
23083
23085
|
export { SulaAvatar as sula_avatar, SulaBadge as sula_badge, SulaBreadcrumb as sula_breadcrumb, SulaButton as sula_button, SulaCheckbox as sula_checkbox, SulaChip as sula_chip, SulaDropdown as sula_dropdown, SulaIcon as sula_icon, SulaLoader as sula_loader, SulaMenuSelectList as sula_menu_select_list, SulaModal as sula_modal, SulaProgressBar as sula_progress_bar, SulaRadioButton as sula_radio_button, SulaSearchBar as sula_search_bar, SulaSegmentedControl as sula_segmented_control, SulaSwitch as sula_switch, SulaTag as sula_tag, SulaTextarea as sula_textarea, SulaTextfield as sula_textfield, SulaTiles as sula_tiles, SulaTimelineList as sula_timeline_list };
|
|
23084
23086
|
//# sourceMappingURL=sula-avatar.sula-badge.sula-breadcrumb.sula-button.sula-checkbox.sula-chip.sula-dropdown.sula-icon.sula-loader.sula-menu-select-list.sula-modal.sula-progress-bar.sula-radio-button.sula-search-bar.sula-segmented-control.sula-switch.sula-tag.sula-textarea.sula-textfield.sula-tiles.sula-timeline-list.entry.esm.js.map
|
|
23085
|
-
//# sourceMappingURL=p-
|
|
23087
|
+
//# sourceMappingURL=p-a7141407.entry.js.map
|