@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.
@@ -1 +1 @@
1
- {"file":"sula-dropdown.js","mappings":";;;;AAAA,MAAM,eAAe,GAAG,o6WAAo6W;;MCQ/6WA,cAAY,iBAAAC,kBAAA,CAAA,MAAA,YAAA,SAAAC,CAAA,CAAA;AALzB,IAAA,WAAA,GAAA;;;;;;;;AAYE;;AAEG;AAEH,QAAA,IAAQ,CAAA,QAAA,GAAY,KAAK;AAEzB;;AAEG;AAEH,QAAA,IAAK,CAAA,KAAA,GAAuB,EAAE;AAc9B;;AAEG;AAEH,QAAA,IAAa,CAAA,aAAA,GAAW,GAAG;AAE3B;;AAEG;AAEH,QAAA,IAAgB,CAAA,gBAAA,GAAW,GAAG;AAQ9B;;AAEG;AAEH,QAAA,IAAa,CAAA,aAAA,GAAY,IAAI;AA8B7B,QAAA,IAAS,CAAA,SAAA,GAAG,KAAK;AAGjB,QAAA,IAAS,CAAA,SAAA,GAAG,KAAK;AAGjB,QAAA,IAAU,CAAA,UAAA,GAAW,EAAE;AAGvB,QAAA,IAAa,CAAA,aAAA,GAAuB,EAAE;AAGtC,QAAA,IAAU,CAAA,UAAA,GAAY,KAAK;AAoE3B,QAAA,IAAW,CAAA,WAAA,GAAG,MAAK;YACjB,IAAI,IAAI,CAAC,QAAQ;gBAAE;AAEnB,YAAA,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE;AAE3B,YAAA,IAAI,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;AAC/C,gBAAA,IAAI,CAAC,SAAS,GAAG,CAAC,IAAI,CAAC,SAAS;;AAGlC,YAAA,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,cAAc,EAAE;AAC5D,gBAAA,IAAI,CAAC,cAAc,CAAC,KAAK,EA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EAAE,IAAI,CAAC,aAAa,EAC7B,aAAa,EAAE,IAAI,CAAC,YAAY,EAChC,cAAc,EAAE,IAAI,CAAC,kBAAkB,EAAA,CAChB;AAE7B,SAAC,GAAG,CACA,CACP,CACG,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["SulaDropdown","__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/sula-dropdown/sula-dropdown.scss?tag=sula-dropdown&encapsulation=shadow","src/components/sula-dropdown/sula-dropdown.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n.dropdown-focus {\n outline: 2px solid var(--color-feedback-informational) !important;\n outline-offset: 2px !important;\n}\n","import { Component, Event, EventEmitter, Host, Listen, Prop, State, Watch, h } from '@stencil/core';\nimport { SulaMenuListItem, SulaMenuSelectListCustomEvent } from '../../components';\n\n@Component({\n tag: 'sula-dropdown',\n styleUrl: 'sula-dropdown.scss',\n shadow: true,\n})\nexport class SulaDropdown {\n /**\n * Dropdown label\n */\n @Prop({ mutable: true })\n label: string;\n\n /**\n * Dropdown is disabled\n */\n @Prop({ mutable: true })\n disabled: boolean = false;\n\n /**\n * Items for list\n */\n @Prop({ mutable: true })\n items: SulaMenuListItem[] = [];\n\n /**\n * Value for dropdown\n */\n @Prop({ mutable: true })\n value?: SulaMenuListItem;\n\n /**\n * Enable search/filter functionality in dropdown\n */\n @Prop({ reflect: true })\n searchable?: boolean;\n\n /**\n * Maximum height for dropdown menu in pixels\n */\n @Prop()\n menuMaxHeight: number = 260;\n\n /**\n * Maximum height for custom content area in pixels\n */\n @Prop()\n contentMaxHeight: number = 260;\n\n /**\n * Enable custom content via slot instead of items list\n */\n @Prop({ reflect: true })\n customContent?: boolean;\n\n /**\n * Close dropdown when an item is selected or content is clicked\n */\n @Prop()\n closeOnSelect: boolean = true;\n\n /**\n * Event emitted when dropdown is clicked\n */\n @Event()\n dropdownClicked: EventEmitter<void>;\n\n /**\n * Event emitted when dropdown is focused\n */\n @Event()\n dropdownFocused: EventEmitter<void>;\n\n /**\n * Event emitted when dropdown is focused out\n */\n @Event()\n dropdownFocusedOut: EventEmitter<void>;\n\n /**\n * Event emitted when item is selected\n */\n @Event()\n menuItemSelected: EventEmitter<SulaMenuListItem>;\n\n @State()\n selectedItem?: SulaMenuListItem;\n\n @State()\n showItems = false;\n\n @State()\n isFocused = false;\n\n @State()\n searchTerm: string = '';\n\n @State()\n filteredItems: SulaMenuListItem[] = [];\n\n @State()\n openUpward: boolean = false;\n\n node?: HTMLElement;\n searchInputRef?: HTMLInputElement;\n\n @Watch('value')\n handleValueChange() {\n if (this.value) {\n this.selectedItem = this.value;\n }\n }\n\n @Watch('showItems')\n handleShowItemsChange(newValue: boolean) {\n if (!newValue) {\n this.searchTerm = '';\n this.filteredItems = [];\n }\n }\n\n @Listen('click', { target: 'document' })\n handleDocumentClick(event: Event) {\n if (!this.node) return;\n\n const path = event.composedPath();\n const clickInside = path.some(el => el === this.node);\n\n if (!clickInside) {\n this.showItems = false;\n }\n }\n\n @Listen('resize', { target: 'window' })\n handleWindowResize() {\n if (this.showItems) {\n this.calculateMenuPosition();\n }\n }\n\n calculateMenuPosition() {\n if (!this.node) return;\n\n const rect = this.node.getBoundingClientRect();\n const viewportHeight = window.innerHeight;\n const spaceBelow = viewportHeight - rect.bottom;\n const spaceAbove = rect.top;\n const buffer = 60; \n const requiredSpace = (this.customContent ? this.contentMaxHeight : this.menuMaxHeight) + buffer;\n\n this.openUpward = spaceBelow < requiredSpace && (spaceAbove > requiredSpace || spaceAbove > spaceBelow);\n }\n\n componentWillLoad() {\n if (this.value) {\n this.selectedItem = this.value;\n }\n }\n\n componentDidRender() {\n if (this.showItems) {\n this.calculateMenuPosition();\n \n if (this.searchable && this.searchInputRef) {\n this.searchInputRef.focus();\n }\n }\n }\n\n handleClick = () => {\n if (this.disabled) return;\n\n this.dropdownClicked.emit();\n\n if (this.customContent || this.items.length > 0) {\n this.showItems = !this.showItems;\n }\n\n if (this.searchable && this.showItems && this.searchInputRef) {\n this.searchInputRef.focus();\n }\n };\n\n handleItemSelected = (item: SulaMenuSelectListCustomEvent<SulaMenuListItem>) => {\n this.selectedItem = item.detail;\n this.searchTerm = '';\n this.menuItemSelected.emit(item.detail);\n\n if (this.closeOnSelect) {\n setTimeout(() => {\n this.showItems = false;\n }, 0);\n }\n };\n\n filterItems = () => {\n if (!this.searchTerm.trim()) {\n return this.items;\n }\n const term = this.searchTerm.toLowerCase();\n return this.items.filter(item => item.title.toLowerCase().includes(term));\n };\n\n handleSearchInput = (event: Event) => {\n const target = event.target as HTMLInputElement;\n this.searchTerm = target.value;\n this.filteredItems = this.filterItems();\n };\n\n getIconClass() {\n if (this.disabled) return 'text-icon-disabled';\n\n return 'text-text-primary';\n }\n\n handleFocus = () => {\n if (this.disabled) return;\n\n this.isFocused = true;\n this.dropdownFocused.emit();\n };\n\n handleBlur = () => {\n if (this.disabled) return;\n\n this.isFocused = false;\n this.dropdownFocusedOut.emit();\n };\n\n render() {\n return (\n <Host ref={node => (this.node = node)}>\n <div\n class={{\n 'flex justify-between items-center border border-line-input h-[72px] px-16 rounded-xl relative': true,\n 'bg-surface-body cursor-pointer': !this.disabled,\n 'bg-states-bg-disabled': this.disabled,\n 'dropdown-focus': this.isFocused,\n }}\n onClick={this.handleClick}\n tabIndex={0}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n >\n <div class=\"flex flex-col w-full\">\n <label\n class={{\n 'text-base leading-4': !this.selectedItem && !(this.searchable && this.showItems),\n 'text-sm leading-4 font-bold': !!this.selectedItem || (this.searchable && this.showItems),\n 'text-text-primary': !this.disabled,\n 'text-text-disabled': this.disabled,\n }}\n >\n {this.label}\n </label>\n\n {this.searchable && this.showItems ? (\n <input\n ref={el => (this.searchInputRef = el)}\n type=\"text\"\n value={this.searchTerm}\n onInput={this.handleSearchInput}\n placeholder={this.selectedItem?.title || ''}\n class=\"w-full text-base text-text-primary bg-transparent border-none outline-none placeholder:text-text-secondary p-0 m-0 leading-4 pt-4\"\n />\n ) : (\n !!this.selectedItem && (\n <span\n class={{\n 'text-base leading-4 pt-4': true,\n 'text-text-primary': !this.disabled,\n 'text-text-disabled': this.disabled,\n }}\n >\n {this.selectedItem.title}\n </span>\n )\n )}\n </div>\n <div class=\"flex items-center justify-center ml-8 leading-6 text-2xl\">\n <sula-icon icon={`ph ph-caret-${this.showItems ? 'up' : 'down'}`} customClass={`${this.getIconClass()} text-2xl`}></sula-icon>\n </div>\n\n {this.showItems && (\n <div\n class={{\n 'absolute z-50 left-0 w-full transition-all duration-200 ease-in-out': true,\n 'bottom-[72px]': this.openUpward,\n 'top-[72px]': !this.openUpward,\n }}\n onClick={!this.closeOnSelect ? (e: Event) => e.stopPropagation() : undefined}\n >\n {this.customContent ? (\n <div class=\"bg-surface-body border border-line-general rounded-sm overflow-auto\" style={{ maxHeight: `${this.contentMaxHeight}px` }}>\n <slot></slot>\n </div>\n ) : (() => {\n const itemsToShow = this.searchable && this.searchTerm.trim() ? this.filteredItems : this.items;\n const showNoResults = this.searchable && this.searchTerm.trim() && itemsToShow.length === 0;\n\n if (showNoResults) {\n return (\n <div class=\"bg-surface-body border border-line-general rounded-sm py-16 px-24 text-base text-text-secondary\">\n Nenhum resultado encontrado\n </div>\n );\n }\n\n return (\n <sula-menu-select-list\n items={itemsToShow}\n fullWidth={true}\n maxHeight={this.menuMaxHeight}\n selectedValue={this.selectedItem}\n onItemSelected={this.handleItemSelected}\n ></sula-menu-select-list>\n );\n })()}\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"sula-dropdown.js","mappings":";;;;AAAA,MAAM,eAAe,GAAG,o6WAAo6W;;MCQ/6WA,cAAY,iBAAAC,kBAAA,CAAA,MAAA,YAAA,SAAAC,CAAA,CAAA;AALzB,IAAA,WAAA,GAAA;;;;;;;;AAYE;;AAEG;AAEH,QAAA,IAAQ,CAAA,QAAA,GAAY,KAAK;AAEzB;;AAEG;AAEH,QAAA,IAA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,IAAI,CAAC,UAAU;AAC/B,aAAA,EACD,OAAO,EAAE,CAAC,IAAI,CAAC,aAAa,GAAG,CAAC,CAAQ,KAAK,CAAC,CAAC,eAAe,EAAE,GAAG,SAAS,IAE3E,IAAI,CAAC,aAAa,IACjB,CAAA,CAAA,KAAA,EAAA,EAAK,KAAK,EAAC,qEAAqE,EAAC,KAAK,EAAE,EAAE,SAAS,EAAE,CAAG,EAAA,IAAI,CAAC,gBAAgB,CAAA,EAAA,CAAI,EAAE,EAAA,EACjI,CAAA,CAAA,MAAA,EAAA,IAAA,CAAa,CACT,IACJ,CAAC,MAAK;YACR,MAAM,WAAW,GAAG,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,KAAK;AAC/F,YAAA,MAAM,aAAa,GAAG,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC;YAE3F,IAAI,aAAa,EAAE;AACjB,gBAAA,QACE,CAAK,CAAA,KAAA,EAAA,EAAA,KAAK,EAAC,iGAAiG,EAAA,EAAA,6BAAA,CAEtG;;AAIV,YAAA,QACE,CAAA,CAAA,uBAAA,EAAA,EACE,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,IAAI,EACf,SAAS,EAAE,IAAI,CAAC,aAAa,EAC7B,aAAa,EAAE,IAAI,CAAC,YAAY,EAChC,cAAc,EAAE,IAAI,CAAC,kBAAkB,EAAA,CAChB;AAE7B,SAAC,GAAG,CACA,CACP,CACG,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["SulaDropdown","__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/sula-dropdown/sula-dropdown.scss?tag=sula-dropdown&encapsulation=shadow","src/components/sula-dropdown/sula-dropdown.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n.dropdown-focus {\n outline: 2px solid var(--color-feedback-informational) !important;\n outline-offset: 2px !important;\n}\n","import { Component, Event, EventEmitter, Host, Listen, Prop, State, Watch, h } from '@stencil/core';\nimport { SulaMenuListItem, SulaMenuSelectListCustomEvent } from '../../components';\n\n@Component({\n tag: 'sula-dropdown',\n styleUrl: 'sula-dropdown.scss',\n shadow: true,\n})\nexport class SulaDropdown {\n /**\n * Dropdown label\n */\n @Prop({ mutable: true })\n label: string;\n\n /**\n * Dropdown is disabled\n */\n @Prop({ mutable: true })\n disabled: boolean = false;\n\n /**\n * Items for list\n */\n @Prop({ mutable: true })\n items: SulaMenuListItem[] = [];\n\n /**\n * Value for dropdown\n */\n @Prop({ mutable: true })\n value?: SulaMenuListItem;\n\n /**\n * Enable search/filter functionality in dropdown\n */\n @Prop({ reflect: true })\n searchable?: boolean;\n\n /**\n * Maximum height for dropdown menu in pixels\n */\n @Prop()\n menuMaxHeight: number = 260;\n\n /**\n * Maximum height for custom content area in pixels\n */\n @Prop()\n contentMaxHeight: number = 260;\n\n /**\n * Enable custom content via slot instead of items list\n */\n @Prop({ reflect: true })\n customContent?: boolean;\n\n /**\n * Close dropdown when an item is selected or content is clicked\n */\n @Prop()\n closeOnSelect: boolean = true;\n\n /**\n * Show or hide dropdown content\n */\n @Prop({ mutable: true, reflect: true })\n showContent = false;\n \n /**\n * Event emitted when dropdown is clicked\n */\n @Event()\n dropdownClicked: EventEmitter<void>;\n\n /**\n * Event emitted when dropdown is focused\n */\n @Event()\n dropdownFocused: EventEmitter<void>;\n\n /**\n * Event emitted when dropdown is focused out\n */\n @Event()\n dropdownFocusedOut: EventEmitter<void>;\n\n /**\n * Event emitted when item is selected\n */\n @Event()\n menuItemSelected: EventEmitter<SulaMenuListItem>;\n\n @State()\n selectedItem?: SulaMenuListItem;\n\n @State()\n isFocused = false;\n\n @State()\n searchTerm: string = '';\n\n @State()\n filteredItems: SulaMenuListItem[] = [];\n\n @State()\n openUpward: boolean = false;\n\n node?: HTMLElement;\n searchInputRef?: HTMLInputElement;\n\n @Watch('value')\n handleValueChange() {\n if (this.value) {\n this.selectedItem = this.value;\n }\n }\n\n @Watch('showContent')\n handleShowContentChange(newValue: boolean) {\n if (!newValue) {\n this.searchTerm = '';\n this.filteredItems = [];\n }\n }\n\n @Listen('click', { target: 'document' })\n handleDocumentClick(event: Event) {\n if (!this.node) return;\n\n const path = event.composedPath();\n const clickInside = path.some(el => el === this.node);\n\n if (!clickInside) {\n this.showContent = false;\n }\n }\n\n @Listen('resize', { target: 'window' })\n handleWindowResize() {\n if (this.showContent) {\n this.calculateMenuPosition();\n }\n }\n\n calculateMenuPosition() {\n if (!this.node) return;\n\n const rect = this.node.getBoundingClientRect();\n const viewportHeight = window.innerHeight;\n const spaceBelow = viewportHeight - rect.bottom;\n const spaceAbove = rect.top;\n const buffer = 60; \n const requiredSpace = (this.customContent ? this.contentMaxHeight : this.menuMaxHeight) + buffer;\n\n this.openUpward = spaceBelow < requiredSpace && (spaceAbove > requiredSpace || spaceAbove > spaceBelow);\n }\n\n componentWillLoad() {\n if (this.value) {\n this.selectedItem = this.value;\n }\n }\n\n componentDidRender() {\n if (this.showContent) {\n this.calculateMenuPosition();\n \n if (this.searchable && this.searchInputRef) {\n this.searchInputRef.focus();\n }\n }\n }\n\n handleClick = () => {\n if (this.disabled) return;\n\n this.dropdownClicked.emit();\n\n if (this.customContent || this.items.length > 0) {\n this.showContent = !this.showContent;\n }\n\n if (this.searchable && this.showContent && this.searchInputRef) {\n this.searchInputRef.focus();\n }\n };\n\n handleItemSelected = (item: SulaMenuSelectListCustomEvent<SulaMenuListItem>) => {\n this.selectedItem = item.detail;\n this.searchTerm = '';\n this.menuItemSelected.emit(item.detail);\n\n if (this.closeOnSelect) {\n setTimeout(() => {\n this.showContent = false;\n }, 0);\n }\n };\n\n filterItems = () => {\n if (!this.searchTerm.trim()) {\n return this.items;\n }\n const term = this.searchTerm.toLowerCase();\n return this.items.filter(item => item.title.toLowerCase().includes(term));\n };\n\n handleSearchInput = (event: Event) => {\n const target = event.target as HTMLInputElement;\n this.searchTerm = target.value;\n this.filteredItems = this.filterItems();\n };\n\n getIconClass() {\n if (this.disabled) return 'text-icon-disabled';\n\n return 'text-text-primary';\n }\n\n handleFocus = () => {\n if (this.disabled) return;\n\n this.isFocused = true;\n this.dropdownFocused.emit();\n };\n\n handleBlur = () => {\n if (this.disabled) return;\n\n this.isFocused = false;\n this.dropdownFocusedOut.emit();\n };\n\n render() {\n return (\n <Host ref={node => (this.node = node)}>\n <div\n class={{\n 'flex justify-between items-center border border-line-input h-[72px] px-16 rounded-xl relative': true,\n 'bg-surface-body cursor-pointer': !this.disabled,\n 'bg-states-bg-disabled': this.disabled,\n 'dropdown-focus': this.isFocused,\n }}\n onClick={this.handleClick}\n tabIndex={0}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n >\n <div class=\"flex flex-col w-full\">\n <label\n class={{\n 'text-base leading-4': !this.selectedItem && !(this.searchable && this.showContent),\n 'text-sm leading-4 font-bold': !!this.selectedItem || (this.searchable && this.showContent),\n 'text-text-primary': !this.disabled,\n 'text-text-disabled': this.disabled,\n }}\n >\n {this.label}\n </label>\n\n {this.searchable && this.showContent ? (\n <input\n ref={el => (this.searchInputRef = el)}\n type=\"text\"\n value={this.searchTerm}\n onInput={this.handleSearchInput}\n placeholder={this.selectedItem?.title || ''}\n class=\"w-full text-base text-text-primary bg-transparent border-none outline-none placeholder:text-text-secondary p-0 m-0 leading-4 pt-4\"\n />\n ) : (\n !!this.selectedItem && (\n <span\n class={{\n 'text-base leading-4 pt-4': true,\n 'text-text-primary': !this.disabled,\n 'text-text-disabled': this.disabled,\n }}\n >\n {this.selectedItem.title}\n </span>\n )\n )}\n </div>\n <div class=\"flex items-center justify-center ml-8 leading-6 text-2xl\">\n <sula-icon icon={`ph ph-caret-${this.showContent ? 'up' : 'down'}`} customClass={`${this.getIconClass()} text-2xl`}></sula-icon>\n </div>\n\n {this.showContent && (\n <div\n class={{\n 'absolute z-50 left-0 w-full transition-all duration-200 ease-in-out': true,\n 'bottom-[72px]': this.openUpward,\n 'top-[72px]': !this.openUpward,\n }}\n onClick={!this.closeOnSelect ? (e: Event) => e.stopPropagation() : undefined}\n >\n {this.customContent ? (\n <div class=\"bg-surface-body border border-line-general rounded-sm overflow-auto\" style={{ maxHeight: `${this.contentMaxHeight}px` }}>\n <slot></slot>\n </div>\n ) : (() => {\n const itemsToShow = this.searchable && this.searchTerm.trim() ? this.filteredItems : this.items;\n const showNoResults = this.searchable && this.searchTerm.trim() && itemsToShow.length === 0;\n\n if (showNoResults) {\n return (\n <div class=\"bg-surface-body border border-line-general rounded-sm py-16 px-24 text-base text-text-secondary\">\n Nenhum resultado encontrado\n </div>\n );\n }\n\n return (\n <sula-menu-select-list\n items={itemsToShow}\n fullWidth={true}\n maxHeight={this.menuMaxHeight}\n selectedValue={this.selectedItem}\n onItemSelected={this.handleItemSelected}\n ></sula-menu-select-list>\n );\n })()}\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -4,7 +4,7 @@ export { s as setNonce } from './index-CwIBTB8E.js';
4
4
  const defineCustomElements = async (win, options) => {
5
5
  if (typeof window === 'undefined') return undefined;
6
6
  await globalScripts();
7
- 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"],"selectedItem":[32],"showItems":[32],"isFocused":[32],"searchTerm":[32],"filteredItems":[32],"openUpward":[32]},[[4,"click","handleDocumentClick"],[9,"resize","handleWindowResize"]],{"value":["handleValueChange"],"showItems":["handleShowItemsChange"]}],[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);
7
+ 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);
8
8
  };
9
9
 
10
10
  export { defineCustomElements };
@@ -573,7 +573,10 @@ const SulaDropdown = class {
573
573
  * Close dropdown when an item is selected or content is clicked
574
574
  */
575
575
  this.closeOnSelect = true;
576
- this.showItems = false;
576
+ /**
577
+ * Show or hide dropdown content
578
+ */
579
+ this.showContent = false;
577
580
  this.isFocused = false;
578
581
  this.searchTerm = '';
579
582
  this.filteredItems = [];
@@ -583,9 +586,9 @@ const SulaDropdown = class {
583
586
  return;
584
587
  this.dropdownClicked.emit();
585
588
  if (this.customContent || this.items.length > 0) {
586
- this.showItems = !this.showItems;
589
+ this.showContent = !this.showContent;
587
590
  }
588
- if (this.searchable && this.showItems && this.searchInputRef) {
591
+ if (this.searchable && this.showContent && this.searchInputRef) {
589
592
  this.searchInputRef.focus();
590
593
  }
591
594
  };
@@ -595,7 +598,7 @@ const SulaDropdown = class {
595
598
  this.menuItemSelected.emit(item.detail);
596
599
  if (this.closeOnSelect) {
597
600
  setTimeout(() => {
598
- this.showItems = false;
601
+ this.showContent = false;
599
602
  }, 0);
600
603
  }
601
604
  };
@@ -629,7 +632,7 @@ const SulaDropdown = class {
629
632
  this.selectedItem = this.value;
630
633
  }
631
634
  }
632
- handleShowItemsChange(newValue) {
635
+ handleShowContentChange(newValue) {
633
636
  if (!newValue) {
634
637
  this.searchTerm = '';
635
638
  this.filteredItems = [];
@@ -641,11 +644,11 @@ const SulaDropdown = class {
641
644
  const path = event.composedPath();
642
645
  const clickInside = path.some(el => el === this.node);
643
646
  if (!clickInside) {
644
- this.showItems = false;
647
+ this.showContent = false;
645
648
  }
646
649
  }
647
650
  handleWindowResize() {
648
- if (this.showItems) {
651
+ if (this.showContent) {
649
652
  this.calculateMenuPosition();
650
653
  }
651
654
  }
@@ -666,7 +669,7 @@ const SulaDropdown = class {
666
669
  }
667
670
  }
668
671
  componentDidRender() {
669
- if (this.showItems) {
672
+ if (this.showContent) {
670
673
  this.calculateMenuPosition();
671
674
  if (this.searchable && this.searchInputRef) {
672
675
  this.searchInputRef.focus();
@@ -680,21 +683,21 @@ const SulaDropdown = class {
680
683
  }
681
684
  render() {
682
685
  var _a;
683
- return (h$1(Host, { key: 'bcb9fc6510f1f67d054824aeb6d50502e20ab8d0', ref: node => (this.node = node) }, h$1("div", { key: 'a46d801d67e501faee720916fff32f37791b0ee9', class: {
686
+ return (h$1(Host, { key: '812029af9121bf2f6b10b426b93dc0095796d66d', ref: node => (this.node = node) }, h$1("div", { key: '24e4b075470cd3ac8311374d0eebbc9d62bc248e', class: {
684
687
  'flex justify-between items-center border border-line-input h-[72px] px-16 rounded-xl relative': true,
685
688
  'bg-surface-body cursor-pointer': !this.disabled,
686
689
  'bg-states-bg-disabled': this.disabled,
687
690
  'dropdown-focus': this.isFocused,
688
- }, onClick: this.handleClick, tabIndex: 0, onFocus: this.handleFocus, onBlur: this.handleBlur }, h$1("div", { key: 'ef745b49c183c29d86fd50d3fa9d2084e75d8156', class: "flex flex-col w-full" }, h$1("label", { key: '833a6a1866ebc31842d746fd1beef1af7d368fed', class: {
689
- 'text-base leading-4': !this.selectedItem && !(this.searchable && this.showItems),
690
- 'text-sm leading-4 font-bold': !!this.selectedItem || (this.searchable && this.showItems),
691
+ }, onClick: this.handleClick, tabIndex: 0, onFocus: this.handleFocus, onBlur: this.handleBlur }, h$1("div", { key: '10bb402bb063b83a66996c3b21e345045779fea6', class: "flex flex-col w-full" }, h$1("label", { key: '9e6013e76bd927d9cf50bccfe542205b2db5ad3c', class: {
692
+ 'text-base leading-4': !this.selectedItem && !(this.searchable && this.showContent),
693
+ 'text-sm leading-4 font-bold': !!this.selectedItem || (this.searchable && this.showContent),
691
694
  'text-text-primary': !this.disabled,
692
695
  'text-text-disabled': this.disabled,
693
- } }, this.label), this.searchable && this.showItems ? (h$1("input", { ref: el => (this.searchInputRef = el), type: "text", value: this.searchTerm, onInput: this.handleSearchInput, placeholder: ((_a = this.selectedItem) === null || _a === void 0 ? void 0 : _a.title) || '', class: "w-full text-base text-text-primary bg-transparent border-none outline-none placeholder:text-text-secondary p-0 m-0 leading-4 pt-4" })) : (!!this.selectedItem && (h$1("span", { class: {
696
+ } }, this.label), this.searchable && this.showContent ? (h$1("input", { ref: el => (this.searchInputRef = el), type: "text", value: this.searchTerm, onInput: this.handleSearchInput, placeholder: ((_a = this.selectedItem) === null || _a === void 0 ? void 0 : _a.title) || '', class: "w-full text-base text-text-primary bg-transparent border-none outline-none placeholder:text-text-secondary p-0 m-0 leading-4 pt-4" })) : (!!this.selectedItem && (h$1("span", { class: {
694
697
  'text-base leading-4 pt-4': true,
695
698
  'text-text-primary': !this.disabled,
696
699
  'text-text-disabled': this.disabled,
697
- } }, this.selectedItem.title)))), h$1("div", { key: '1b8a1970c4750c3f314aa7d8e5193e8d9cfa3483', class: "flex items-center justify-center ml-8 leading-6 text-2xl" }, h$1("sula-icon", { key: '635d6d6df91f4ea2d8d051ca7443941a44a7c856', icon: `ph ph-caret-${this.showItems ? 'up' : 'down'}`, customClass: `${this.getIconClass()} text-2xl` })), this.showItems && (h$1("div", { key: '223e42138b156a98b1296e317599c2eb16e3a633', class: {
700
+ } }, this.selectedItem.title)))), h$1("div", { key: '9c570fe666a9e400882728dd6cc7375efc6fd9c3', class: "flex items-center justify-center ml-8 leading-6 text-2xl" }, h$1("sula-icon", { key: 'c33165aec78c9d227a645d5a5390caa5f5580e48', icon: `ph ph-caret-${this.showContent ? 'up' : 'down'}`, customClass: `${this.getIconClass()} text-2xl` })), this.showContent && (h$1("div", { key: 'a5f4c9c26cfc64bb39300474e8efb52174b538ab', class: {
698
701
  'absolute z-50 left-0 w-full transition-all duration-200 ease-in-out': true,
699
702
  'bottom-[72px]': this.openUpward,
700
703
  'top-[72px]': !this.openUpward,
@@ -709,7 +712,7 @@ const SulaDropdown = class {
709
712
  }
710
713
  static get watchers() { return {
711
714
  "value": ["handleValueChange"],
712
- "showItems": ["handleShowItemsChange"]
715
+ "showContent": ["handleShowContentChange"]
713
716
  }; }
714
717
  };
715
718
  SulaDropdown.style = sulaDropdownCss;