@govtechsg/sgds-web-component 3.21.0 → 3.21.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/Masthead/index.js +1 -1
- package/components/Badge/badge.js +1 -1
- package/components/Badge/index.umd.min.js +4 -4
- package/components/Badge/index.umd.min.js.map +1 -1
- package/components/Badge/sgds-badge.js +6 -9
- package/components/Badge/sgds-badge.js.map +1 -1
- package/components/ComboBox/combo-box.js +1 -1
- package/components/ComboBox/index.umd.min.js +6 -5
- package/components/ComboBox/index.umd.min.js.map +1 -1
- package/components/ComboBox/sgds-combo-box.js +1 -0
- package/components/ComboBox/sgds-combo-box.js.map +1 -1
- package/components/Datepicker/index.umd.min.js +12 -13
- package/components/Datepicker/index.umd.min.js.map +1 -1
- package/components/Input/index.umd.min.js +2 -3
- package/components/Input/index.umd.min.js.map +1 -1
- package/components/Input/sgds-input.js +8 -4
- package/components/Input/sgds-input.js.map +1 -1
- package/components/Masthead/index.umd.min.js +1 -1
- package/components/Masthead/index.umd.min.js.map +1 -1
- package/components/Masthead/masthead.js +1 -1
- package/components/QuantityToggle/index.umd.min.js +3 -4
- package/components/QuantityToggle/index.umd.min.js.map +1 -1
- package/components/QuantityToggle/sgds-quantity-toggle.js +1 -1
- package/components/QuantityToggle/sgds-quantity-toggle.js.map +1 -1
- package/components/index.umd.min.js +10 -10
- package/components/index.umd.min.js.map +1 -1
- package/custom-elements.json +1 -1
- package/index.umd.min.js +10 -10
- package/index.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/react/components/Badge/badge.cjs.js +1 -1
- package/react/components/Badge/badge.js +1 -1
- package/react/components/Badge/sgds-badge.cjs.js +6 -9
- package/react/components/Badge/sgds-badge.cjs.js.map +1 -1
- package/react/components/Badge/sgds-badge.js +6 -9
- package/react/components/Badge/sgds-badge.js.map +1 -1
- package/react/components/ComboBox/combo-box.cjs.js +1 -1
- package/react/components/ComboBox/combo-box.js +1 -1
- package/react/components/ComboBox/sgds-combo-box.cjs.js +1 -0
- package/react/components/ComboBox/sgds-combo-box.cjs.js.map +1 -1
- package/react/components/ComboBox/sgds-combo-box.js +1 -0
- package/react/components/ComboBox/sgds-combo-box.js.map +1 -1
- package/react/components/Input/sgds-input.cjs.js +8 -4
- package/react/components/Input/sgds-input.cjs.js.map +1 -1
- package/react/components/Input/sgds-input.js +8 -4
- package/react/components/Input/sgds-input.js.map +1 -1
- package/react/components/Masthead/masthead.cjs.js +1 -1
- package/react/components/Masthead/masthead.js +1 -1
- package/react/components/QuantityToggle/sgds-quantity-toggle.cjs.js +1 -1
- package/react/components/QuantityToggle/sgds-quantity-toggle.cjs.js.map +1 -1
- package/react/components/QuantityToggle/sgds-quantity-toggle.js +1 -1
- package/react/components/QuantityToggle/sgds-quantity-toggle.js.map +1 -1
- package/themes/day.css +1 -0
- package/themes/night.css +1 -0
|
@@ -69,13 +69,11 @@ class SgdsBadge extends SgdsElement {
|
|
|
69
69
|
}
|
|
70
70
|
/**@internal */
|
|
71
71
|
_handleTruncation() {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
const badgeLabel = this.shadowRoot.querySelector(".badge-label");
|
|
75
|
-
if (
|
|
76
|
-
|
|
77
|
-
const badgeHeight = badge.getBoundingClientRect().height;
|
|
78
|
-
this.truncated = labelHeight > badgeHeight;
|
|
72
|
+
var _a;
|
|
73
|
+
// check scroll width if its exceeding parent, it reflects truncation has happened
|
|
74
|
+
const badgeLabel = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(".badge-label");
|
|
75
|
+
if (badgeLabel) {
|
|
76
|
+
this.truncated = badgeLabel.scrollWidth > badgeLabel.clientWidth;
|
|
79
77
|
}
|
|
80
78
|
}
|
|
81
79
|
_handleLabelSlotChange(e) {
|
|
@@ -90,7 +88,6 @@ class SgdsBadge extends SgdsElement {
|
|
|
90
88
|
[`badge-dismissible`]: this.dismissible,
|
|
91
89
|
badge: true,
|
|
92
90
|
outlined: this.outlined,
|
|
93
|
-
truncated: this.truncated,
|
|
94
91
|
"full-width": this.fullWidth
|
|
95
92
|
})}"
|
|
96
93
|
aria-hidden=${this.show ? "false" : "true"}
|
|
@@ -152,7 +149,7 @@ __decorate([
|
|
|
152
149
|
watch("show")
|
|
153
150
|
], SgdsBadge.prototype, "_handleShowChange", null);
|
|
154
151
|
__decorate([
|
|
155
|
-
watch("text")
|
|
152
|
+
watch("text", { waitUntilFirstUpdate: true })
|
|
156
153
|
], SgdsBadge.prototype, "_handleTruncation", null);
|
|
157
154
|
|
|
158
155
|
export { SgdsBadge, SgdsBadge as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sgds-badge.js","sources":["../../../src/components/Badge/sgds-badge.ts"],"sourcesContent":["import { html, nothing } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\n\nimport { watch } from \"../../utils/watch\";\nimport badgeStyle from \"./badge.css\";\n\nimport SgdsElement from \"../../base/sgds-element\";\nimport SgdsTooltip from \"../Tooltip/sgds-tooltip\";\nimport SgdsCloseButton from \"../CloseButton/sgds-close-button\";\n\nimport { getTextContent } from \"../../utils/slot\";\n\nexport type BadgeVariant =\n | \"primary\"\n | \"accent\"\n | \"success\"\n | \"danger\"\n | \"warning\"\n | \"cyan\"\n | \"purple\"\n | \"neutral\"\n | \"white\"\n | \"info\";\n\n/**\n * @summary Badges can be used to highlight important bits of information such as labels, notifications & status.\n * When the text exceeds the width, it will be truncated with a tooltip that will be displayed on hover.\n *\n * @slot default - slot for badge\n * @slot icon - The slot for icon to the left of the badge text\n *\n * @event sgds-show - Emitted when the badge appears.\n * @event sgds-hide - Emitted when the badge is starting to close but has not closed.\n * @event sgds-after-show - Emitted after the badge has appeared\n * @event sgds-after-hide - Emitted after the badge has closed\n */\nexport class SgdsBadge extends SgdsElement {\n static styles = [...SgdsElement.styles, badgeStyle];\n\n /**@internal */\n static dependencies = {\n \"sgds-close-button\": SgdsCloseButton,\n \"sgds-tooltip\": SgdsTooltip\n };\n\n /** Controls the appearance of the dismissible badge. This prop only applies when dismissible is true */\n @property({ type: Boolean, reflect: true }) show = false;\n\n /**\n * One or more badge variant combinations.\n * Variants include: `primary`, `accent`, `success`, `danger`, `warning`, `cyan`, `purple`, `neutral`, `white`, `info`.\n *\n * (@deprecated) The `info` variant is deprecated. Use `primary` instead.\n */\n @property({ reflect: true }) variant: BadgeVariant = \"primary\";\n\n /** Manually set the outlined state to false */\n @property({ type: Boolean, reflect: true }) outlined = false;\n\n /** Manually set the dismissible state of the button to `false` */\n @property({ type: Boolean, reflect: true }) dismissible = false;\n\n /** Manually enable full width */\n @property({ type: Boolean, reflect: true }) fullWidth = false;\n\n @state() private truncated = false;\n @state() private text = \"\";\n\n /** Closes the badge */\n public close() {\n this.show = false;\n }\n\n /**@internal */\n @watch(\"show\")\n _handleShowChange() {\n if (this.show) {\n const sgdsShow = this.emit(\"sgds-show\", { cancelable: true });\n if (sgdsShow.defaultPrevented) {\n this.show = false;\n return;\n }\n // animations if any go here\n\n this.emit(\"sgds-after-show\");\n } else {\n const sgdsHide = this.emit(\"sgds-hide\", { cancelable: true });\n if (sgdsHide.defaultPrevented) {\n this.show = true;\n return;\n }\n // animations if any go here\n\n this.emit(\"sgds-after-hide\");\n }\n }\n\n /**@internal */\n @watch(\"text\")\n _handleTruncation() {\n //
|
|
1
|
+
{"version":3,"file":"sgds-badge.js","sources":["../../../src/components/Badge/sgds-badge.ts"],"sourcesContent":["import { html, nothing } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\n\nimport { watch } from \"../../utils/watch\";\nimport badgeStyle from \"./badge.css\";\n\nimport SgdsElement from \"../../base/sgds-element\";\nimport SgdsTooltip from \"../Tooltip/sgds-tooltip\";\nimport SgdsCloseButton from \"../CloseButton/sgds-close-button\";\n\nimport { getTextContent } from \"../../utils/slot\";\n\nexport type BadgeVariant =\n | \"primary\"\n | \"accent\"\n | \"success\"\n | \"danger\"\n | \"warning\"\n | \"cyan\"\n | \"purple\"\n | \"neutral\"\n | \"white\"\n | \"info\";\n\n/**\n * @summary Badges can be used to highlight important bits of information such as labels, notifications & status.\n * When the text exceeds the width, it will be truncated with a tooltip that will be displayed on hover.\n *\n * @slot default - slot for badge\n * @slot icon - The slot for icon to the left of the badge text\n *\n * @event sgds-show - Emitted when the badge appears.\n * @event sgds-hide - Emitted when the badge is starting to close but has not closed.\n * @event sgds-after-show - Emitted after the badge has appeared\n * @event sgds-after-hide - Emitted after the badge has closed\n */\nexport class SgdsBadge extends SgdsElement {\n static styles = [...SgdsElement.styles, badgeStyle];\n\n /**@internal */\n static dependencies = {\n \"sgds-close-button\": SgdsCloseButton,\n \"sgds-tooltip\": SgdsTooltip\n };\n\n /** Controls the appearance of the dismissible badge. This prop only applies when dismissible is true */\n @property({ type: Boolean, reflect: true }) show = false;\n\n /**\n * One or more badge variant combinations.\n * Variants include: `primary`, `accent`, `success`, `danger`, `warning`, `cyan`, `purple`, `neutral`, `white`, `info`.\n *\n * (@deprecated) The `info` variant is deprecated. Use `primary` instead.\n */\n @property({ reflect: true }) variant: BadgeVariant = \"primary\";\n\n /** Manually set the outlined state to false */\n @property({ type: Boolean, reflect: true }) outlined = false;\n\n /** Manually set the dismissible state of the button to `false` */\n @property({ type: Boolean, reflect: true }) dismissible = false;\n\n /** Manually enable full width */\n @property({ type: Boolean, reflect: true }) fullWidth = false;\n\n @state() private truncated = false;\n @state() private text = \"\";\n\n /** Closes the badge */\n public close() {\n this.show = false;\n }\n\n /**@internal */\n @watch(\"show\")\n _handleShowChange() {\n if (this.show) {\n const sgdsShow = this.emit(\"sgds-show\", { cancelable: true });\n if (sgdsShow.defaultPrevented) {\n this.show = false;\n return;\n }\n // animations if any go here\n\n this.emit(\"sgds-after-show\");\n } else {\n const sgdsHide = this.emit(\"sgds-hide\", { cancelable: true });\n if (sgdsHide.defaultPrevented) {\n this.show = true;\n return;\n }\n // animations if any go here\n\n this.emit(\"sgds-after-hide\");\n }\n }\n\n /**@internal */\n @watch(\"text\", { waitUntilFirstUpdate: true })\n _handleTruncation() {\n // check scroll width if its exceeding parent, it reflects truncation has happened\n const badgeLabel = this.shadowRoot?.querySelector(\".badge-label\");\n if (badgeLabel) {\n this.truncated = badgeLabel.scrollWidth > badgeLabel.clientWidth;\n }\n }\n\n private _handleLabelSlotChange(e: Event) {\n this.text = getTextContent(e.target as HTMLSlotElement);\n return;\n }\n\n private _renderBadge() {\n const isDarkCloseButton = this.outlined || this.variant === \"warning\" || this.variant === \"white\";\n\n return html`<div\n class=\" \n ${classMap({\n [`badge-dismissible`]: this.dismissible,\n badge: true,\n outlined: this.outlined,\n \"full-width\": this.fullWidth\n })}\"\n aria-hidden=${this.show ? \"false\" : \"true\"}\n >\n ${!this.dismissible ? html`<slot name=\"icon\"></slot>` : nothing}\n\n <span class=\"badge-label\">\n <slot @slotchange=${this._handleLabelSlotChange}></slot>\n </span>\n\n ${this.dismissible\n ? html`<sgds-close-button\n size=\"sm\"\n aria-label=\"close the badge\"\n @click=${this.close}\n tone=${isDarkCloseButton ? \"fixed-dark\" : \"fixed-light\"}\n ></sgds-close-button>`\n : nothing}\n </div>`;\n }\n\n render() {\n return (this.dismissible && this.show) || !this.dismissible\n ? this.truncated\n ? html`<sgds-tooltip content=${this.text} @sgds-hide=${e => e.stopPropagation()}\n >${this._renderBadge()}</sgds-tooltip\n >`\n : this._renderBadge()\n : nothing;\n }\n}\n\nexport default SgdsBadge;\n"],"names":["badgeStyle"],"mappings":";;;;;;;;;;;AAyBA;;;;;;;;;;;AAWG;AACG,MAAO,SAAU,SAAQ,WAAW,CAAA;AAA1C,IAAA,WAAA,GAAA;;;QAU8C,IAAI,CAAA,IAAA,GAAG,KAAK,CAAC;AAEzD;;;;;AAKG;QAC0B,IAAO,CAAA,OAAA,GAAiB,SAAS,CAAC;;QAGnB,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;;QAGjB,IAAW,CAAA,WAAA,GAAG,KAAK,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A,CAAA,CAAA,CAAA;AAClB,UAAA,CAAA;AAAhB,IAAA,KAAK,EAAE;AAAmB,CAAA,EAAA,SAAA,CAAA,SAAA,EAAA,MAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAS3B,UAAA,CAAA;IADC,KAAK,CAAC,MAAM,CAAC;AAqBb,CAAA,EAAA,SAAA,CAAA,SAAA,EAAA,mBAAA,EAAA,IAAA,CAAA,CAAA;AAID,UAAA,CAAA;IADC,KAAK,CAAC,MAAM,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;AAO7C,CAAA,EAAA,SAAA,CAAA,SAAA,EAAA,mBAAA,EAAA,IAAA,CAAA;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
2
|
|
|
3
|
-
var css_248z = css`:host{display:block;position:relative}.dropdown{display:flex;height:100%}.dropdown-menu{box-sizing:border-box;max-height:10rem;overflow-x:hidden;overflow-y:auto}.visually-hidden{clip:rect(0,0,0,0)!important;border:0!important;height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;white-space:nowrap!important;width:1px!important}.combobox .form-control-group{height:unset;min-height:var(--sgds-dimension-48)}.combobox-input-container{align-items:center;display:flex;flex-wrap:wrap;gap:var(--sgds-gap-xs);padding:calc(var(--sgds-form-padding-y) - var(--sgds-form-border-width-default)) 0;width:calc(100% - var(--sgds-icon-size-md, 1.25rem))}slot[id=default].d-none,slot[id=default].d-none::slotted(*){display:none}.form-clearable:focus-visible{outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus)}`;
|
|
3
|
+
var css_248z = css`:host{display:block;position:relative}.dropdown{display:flex;height:100%}.dropdown-menu{box-sizing:border-box;max-height:10rem;overflow-x:hidden;overflow-y:auto}.visually-hidden{clip:rect(0,0,0,0)!important;border:0!important;height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;white-space:nowrap!important;width:1px!important}.combobox .form-control-group{height:unset;min-height:var(--sgds-dimension-48)}.combobox-input-container{align-items:center;display:flex;flex-wrap:wrap;gap:var(--sgds-gap-xs);padding:calc(var(--sgds-form-padding-y) - var(--sgds-form-border-width-default)) 0;width:calc(100% - var(--sgds-icon-size-md, 1.25rem))}.combobox-input-container .form-control{flex:1 1 0;min-width:10ch}slot[id=default].d-none,slot[id=default].d-none::slotted(*){display:none}.form-clearable:focus-visible{outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus)}`;
|
|
4
4
|
|
|
5
5
|
export { css_248z as default };
|
|
6
6
|
//# sourceMappingURL=combo-box.js.map
|
|
@@ -92,7 +92,7 @@ function Ge(e){return(t,i)=>je(t,i,{async get(){return await this.updateComplete
|
|
|
92
92
|
class=${Xe({"form-label":!0,required:this.required})}
|
|
93
93
|
>${this.label}</label
|
|
94
94
|
>
|
|
95
|
-
`;return this.label&&e}_handleClick(){if(this.readonly)return null;this.menuIsOpen?this.hideMenu():this.showMenu()}async _getMenuListFromOptions(e){const t=e.map(async e=>(await e.updateComplete,e)),i=await Promise.all(t);return null==i?void 0:i.map(e=>{var t;return{label:e.innerText,value:e.getAttribute("value"),disabled:null!==(t=e.disabled)&&void 0!==t?t:void 0}})}_renderEmptyMenu(){return S` <div class="empty-menu">No options</div> `}_renderLoadingMenu(){return S`<div class="loading-menu"><sgds-spinner size="xs" tone="brand"></sgds-spinner>Loading...</div>`}}function tl(e,t){const i=Object.assign({waitUntilFirstUpdate:!1},t);return(t,l)=>{const{update:a}=t;if(e in t){const o=e;t.update=function(e){if(e.has(o)){const t=e.get(o),a=this[o];t!==a&&(i.waitUntilFirstUpdate&&!this.hasUpdated||this[l](t,a))}a.call(this,e)}}}}el.styles=[...Ji.styles,Oi,Di,zi,Ui,Qi],e([We({reflect:!0})],el.prototype,"label",void 0),e([We({reflect:!0})],el.prototype,"hintText",void 0),e([We({reflect:!0})],el.prototype,"name",void 0),e([We({type:String,reflect:!0})],el.prototype,"placeholder",void 0),e([We({type:Boolean,reflect:!0})],el.prototype,"autofocus",void 0),e([We({type:Boolean,reflect:!0})],el.prototype,"disabled",void 0),e([We({type:Boolean,reflect:!0})],el.prototype,"required",void 0),e([We({type:Boolean,reflect:!0})],el.prototype,"loading",void 0),e([We({type:String,reflect:!0})],el.prototype,"value",void 0),e([qe()],el.prototype,"displayValue",void 0),e([Fi()],el.prototype,"defaultValue",void 0),e([We({type:Boolean,reflect:!0})],el.prototype,"hasFeedback",void 0),e([We({type:String,reflect:!0})],el.prototype,"invalidFeedback",void 0),e([We({type:Boolean,reflect:!0})],el.prototype,"invalid",void 0),e([We({type:Array})],el.prototype,"menuList",void 0),e([qe()],el.prototype,"selectedItems",void 0),e([qe()],el.prototype,"filteredList",void 0),e([Ge("input.form-control")],el.prototype,"_input",void 0);var il=we`:host{cursor:default;display:inline-flex;max-width:100%}:host([variant=accent]) .badge{background-color:var(--sgds-accent-surface-default)}:host([variant=success]) .badge{background-color:var(--sgds-success-surface-default)}:host([variant=danger]) .badge{background-color:var(--sgds-danger-surface-default)}:host([variant=warning]) .badge{background-color:var(--sgds-warning-surface-default);color:var(--sgds-color-fixed-dark)}:host([variant=cyan]) .badge{background-color:var(--sgds-cyan-surface-default)}:host([variant=purple]) .badge{background-color:var(--sgds-purple-surface-default)}:host([variant=neutral]) .badge{background-color:var(--sgds-neutral-surface-default)}:host([variant=white]) .badge{background-color:var(--sgds-surface-fixed-light);color:var(--sgds-color-fixed-dark)}:host([variant=accent][outlined]) .badge{background-color:var(--sgds-accent-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-accent-border-color-muted);color:var(--sgds-accent-color-fixed-dark)}:host([variant=success][outlined]) .badge{background-color:var(--sgds-success-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-success-border-color-muted);color:var(--sgds-success-color-fixed-dark)}:host([variant=danger][outlined]) .badge{background-color:var(--sgds-danger-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-danger-border-color-muted);color:var(--sgds-danger-color-fixed-dark)}:host([variant=warning][outlined]) .badge{background-color:var(--sgds-warning-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-warning-border-color-muted);color:var(--sgds-warning-color-fixed-dark)}:host([variant=cyan][outlined]) .badge{background-color:var(--sgds-cyan-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-cyan-border-color-muted);color:var(--sgds-cyan-color-fixed-dark)}:host([variant=purple][outlined]) .badge{background-color:var(--sgds-purple-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-purple-border-color-muted);color:var(--sgds-purple-color-fixed-dark)}:host([variant=neutral][outlined]) .badge{background-color:var(--sgds-neutral-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-neutral-border-color-muted);color:var(--sgds-color-fixed-dark)}:host([variant=white][outlined]) .badge{background-color:var(--sgds-surface-fixed-light);border:var(--sgds-border-width-1) solid var(--sgds-border-color-muted);color:var(--sgds-color-fixed-dark)}sgds-tooltip{display:block;max-width:100%}.badge{align-items:center;background-color:var(--sgds-primary-surface-default);border:var(--sgds-border-width-1) solid var(--sgds-border-color-transparent);border-radius:var(--sgds-border-radius-sm);color:var(--sgds-color-fixed-light);display:inline-flex;font-size:var(--sgds-font-size-label-xs);height:var(--sgds-dimension-24,24px);justify-content:center;line-height:var(--sgds-line-height-3-xs);max-width:var(--sgds-dimension-192);min-width:var(--sgds-dimension-24);padding:var(--sgds-padding-none) var(--sgds-padding-xs)}.badge.outlined{background-color:var(--sgds-primary-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-primary-border-color-muted);color:var(--sgds-primary-color-fixed-dark)}.badge.full-width{max-width:100%}.badge-label{padding:var(--sgds-padding-none) var(--sgds-padding-3-xs)}.badge-dismissible{padding-right:0}.badge-dimissible sgds-close-button{--sgds-close-btn-border-radius:var(--sgds-border-radius-sm)}
|
|
95
|
+
`;return this.label&&e}_handleClick(){if(this.readonly)return null;this.menuIsOpen?this.hideMenu():this.showMenu()}async _getMenuListFromOptions(e){const t=e.map(async e=>(await e.updateComplete,e)),i=await Promise.all(t);return null==i?void 0:i.map(e=>{var t;return{label:e.innerText,value:e.getAttribute("value"),disabled:null!==(t=e.disabled)&&void 0!==t?t:void 0}})}_renderEmptyMenu(){return S` <div class="empty-menu">No options</div> `}_renderLoadingMenu(){return S`<div class="loading-menu"><sgds-spinner size="xs" tone="brand"></sgds-spinner>Loading...</div>`}}function tl(e,t){const i=Object.assign({waitUntilFirstUpdate:!1},t);return(t,l)=>{const{update:a}=t;if(e in t){const o=e;t.update=function(e){if(e.has(o)){const t=e.get(o),a=this[o];t!==a&&(i.waitUntilFirstUpdate&&!this.hasUpdated||this[l](t,a))}a.call(this,e)}}}}el.styles=[...Ji.styles,Oi,Di,zi,Ui,Qi],e([We({reflect:!0})],el.prototype,"label",void 0),e([We({reflect:!0})],el.prototype,"hintText",void 0),e([We({reflect:!0})],el.prototype,"name",void 0),e([We({type:String,reflect:!0})],el.prototype,"placeholder",void 0),e([We({type:Boolean,reflect:!0})],el.prototype,"autofocus",void 0),e([We({type:Boolean,reflect:!0})],el.prototype,"disabled",void 0),e([We({type:Boolean,reflect:!0})],el.prototype,"required",void 0),e([We({type:Boolean,reflect:!0})],el.prototype,"loading",void 0),e([We({type:String,reflect:!0})],el.prototype,"value",void 0),e([qe()],el.prototype,"displayValue",void 0),e([Fi()],el.prototype,"defaultValue",void 0),e([We({type:Boolean,reflect:!0})],el.prototype,"hasFeedback",void 0),e([We({type:String,reflect:!0})],el.prototype,"invalidFeedback",void 0),e([We({type:Boolean,reflect:!0})],el.prototype,"invalid",void 0),e([We({type:Array})],el.prototype,"menuList",void 0),e([qe()],el.prototype,"selectedItems",void 0),e([qe()],el.prototype,"filteredList",void 0),e([Ge("input.form-control")],el.prototype,"_input",void 0);var il=we`:host{cursor:default;display:inline-flex;max-width:100%}:host([variant=accent]) .badge{background-color:var(--sgds-accent-surface-default)}:host([variant=success]) .badge{background-color:var(--sgds-success-surface-default)}:host([variant=danger]) .badge{background-color:var(--sgds-danger-surface-default)}:host([variant=warning]) .badge{background-color:var(--sgds-warning-surface-default);color:var(--sgds-color-fixed-dark)}:host([variant=cyan]) .badge{background-color:var(--sgds-cyan-surface-default)}:host([variant=purple]) .badge{background-color:var(--sgds-purple-surface-default)}:host([variant=neutral]) .badge{background-color:var(--sgds-neutral-surface-default)}:host([variant=white]) .badge{background-color:var(--sgds-surface-fixed-light);color:var(--sgds-color-fixed-dark)}:host([variant=accent][outlined]) .badge{background-color:var(--sgds-accent-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-accent-border-color-muted);color:var(--sgds-accent-color-fixed-dark)}:host([variant=success][outlined]) .badge{background-color:var(--sgds-success-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-success-border-color-muted);color:var(--sgds-success-color-fixed-dark)}:host([variant=danger][outlined]) .badge{background-color:var(--sgds-danger-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-danger-border-color-muted);color:var(--sgds-danger-color-fixed-dark)}:host([variant=warning][outlined]) .badge{background-color:var(--sgds-warning-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-warning-border-color-muted);color:var(--sgds-warning-color-fixed-dark)}:host([variant=cyan][outlined]) .badge{background-color:var(--sgds-cyan-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-cyan-border-color-muted);color:var(--sgds-cyan-color-fixed-dark)}:host([variant=purple][outlined]) .badge{background-color:var(--sgds-purple-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-purple-border-color-muted);color:var(--sgds-purple-color-fixed-dark)}:host([variant=neutral][outlined]) .badge{background-color:var(--sgds-neutral-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-neutral-border-color-muted);color:var(--sgds-color-fixed-dark)}:host([variant=white][outlined]) .badge{background-color:var(--sgds-surface-fixed-light);border:var(--sgds-border-width-1) solid var(--sgds-border-color-muted);color:var(--sgds-color-fixed-dark)}sgds-tooltip{display:block;max-width:100%}.badge{align-items:center;background-color:var(--sgds-primary-surface-default);border:var(--sgds-border-width-1) solid var(--sgds-border-color-transparent);border-radius:var(--sgds-border-radius-sm);color:var(--sgds-color-fixed-light);display:inline-flex;font-size:var(--sgds-font-size-label-xs);height:var(--sgds-dimension-24,24px);justify-content:center;line-height:var(--sgds-line-height-3-xs);max-width:var(--sgds-dimension-192,192px);min-width:var(--sgds-dimension-24);padding:var(--sgds-padding-none) var(--sgds-padding-xs)}.badge.outlined{background-color:var(--sgds-primary-surface-muted);border:var(--sgds-border-width-1) solid var(--sgds-primary-border-color-muted);color:var(--sgds-primary-color-fixed-dark)}.badge.full-width{max-width:100%}.badge-label{overflow:hidden;padding:var(--sgds-padding-none) var(--sgds-padding-3-xs);text-overflow:ellipsis;white-space:nowrap}.badge-dismissible{padding-right:0}.badge-dimissible sgds-close-button{--sgds-close-btn-border-radius:var(--sgds-border-radius-sm)}slot::slotted(*){color:inherit!important;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;margin:inherit!important}`,ll=we`:host{display:contents}.tooltip-placeholder{display:inline-block;max-width:100%}.tooltip{word-wrap:break-word;background-color:var(--sgds-surface-fixed-dark);border-radius:var(--sgds-border-radius-md);box-shadow:0 0 2px 0 rgba(0,0,0,.12),0 8px 16px 0 rgba(0,0,0,.14);color:var(--sgds-color-fixed-light);display:block;font-size:var(--sgds-font-size-14);line-break:auto;max-width:var(--sgds-dimension-320);padding:var(--sgds-padding-xs) var(--sgds-padding-sm);text-align:left;text-decoration:none;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;z-index:var(--sgds-z-index-overlay)}div{max-width:fit-content}`;class al extends Ki{constructor(){super(...arguments),this._myTooltip=st(),this._tooltipBubble=st(),this.content="",this.placement="top",this.trigger="hover focus",this.open=!1,this._handleClickOutOfElement=e=>{this.open&&(e.composedPath().includes(this)||this.hide())}}connectedCallback(){super.connectedCallback(),this.trigger.includes("click")&&document.addEventListener("click",this._handleClickOutOfElement)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleClickOutOfElement),this._cleanupAutoUpdate&&(this._cleanupAutoUpdate(),this._cleanupAutoUpdate=void 0)}firstUpdated(e){super.firstUpdated(e),this._tooltipTargetElements.forEach(e=>{e.setAttribute("data-sgds-tooltip",this.content),this.trigger.includes("hover")&&(e.addEventListener("mouseenter",()=>this.show()),e.addEventListener("mouseleave",()=>this.hide())),this.trigger.includes("focus")&&(e.addEventListener("focus",()=>this.show()),e.addEventListener("blur",()=>this.hide())),"click"===this.trigger&&e.addEventListener("click",()=>this.toggle())})}_handleSlotChange(){this._tooltipTargetElements.forEach(e=>e.setAttribute("data-sgds-tooltip",this.content))}async updateFloatingPosition(){if(!this._myTooltip.value||!this._tooltipBubble.value)return;const{x:e,y:t,placement:i,strategy:l,middlewareData:a}=await Ri(this._tooltipTargetElements[0],this._tooltipBubble.value,{strategy:"fixed",placement:this.placement,middleware:[Li(8),Ii(),Ei(),Pi()]});this._tooltipBubble.value.setAttribute("data-placement",i),Object.assign(this._tooltipBubble.value.style,{position:l,left:`${e}px`,top:`${t}px`});const{referenceHidden:o,escaped:s}=a.hide||{};this._tooltipBubble.value.style.visibility=o||s?"hidden":"visible"}async show(){this.open||(this.open=!0,this.emit("sgds-show"),await this.updateComplete,await this.updateFloatingPosition(),this._myTooltip.value&&this._tooltipBubble.value&&(this._cleanupAutoUpdate=Ai(this._tooltipTargetElements[0],this._tooltipBubble.value,()=>this.updateFloatingPosition())),this.emit("sgds-after-show"))}hide(){this.open&&(this.emit("sgds-hide"),this.open=!1,this._cleanupAutoUpdate&&(this._cleanupAutoUpdate(),this._cleanupAutoUpdate=void 0),setTimeout(()=>this.emit("sgds-after-hide"),0))}toggle(){this.open?this.hide():this.show()}render(){return S`
|
|
96
96
|
<div ${ct(this._myTooltip)} class="tooltip-placeholder">
|
|
97
97
|
<slot @slotchange=${()=>this._handleSlotChange()}></slot>
|
|
98
98
|
${this.open?S`<div ${ct(this._tooltipBubble)} class="tooltip" role="tooltip">${this.content}</div>`:null}
|
|
@@ -101,9 +101,9 @@ function Ge(e){return(t,i)=>je(t,i,{async get(){return await this.updateComplete
|
|
|
101
101
|
<button class="btn-close" aria-label="Close button" ?disabled=${this.disabled} @click=${this._handleClick}>
|
|
102
102
|
<sgds-icon name="cross" size="sm"></sgds-icon>
|
|
103
103
|
</button>
|
|
104
|
-
`}}rl.styles=[...Ki.styles,ol],e([We({type:String,reflect:!0})],rl.prototype,"size",void 0),e([We({type:String,reflect:!0})],rl.prototype,"tone",void 0),e([We({type:Boolean,reflect:!0})],rl.prototype,"disabled",void 0);class cl extends Ki{constructor(){super(...arguments),this.show=!1,this.variant="primary",this.outlined=!1,this.dismissible=!1,this.fullWidth=!1,this.truncated=!1,this.text=""}close(){this.show=!1}_handleShowChange(){if(this.show){if(this.emit("sgds-show",{cancelable:!0}).defaultPrevented)return void(this.show=!1);this.emit("sgds-after-show")}else{if(this.emit("sgds-hide",{cancelable:!0}).defaultPrevented)return void(this.show=!0);this.emit("sgds-after-hide")}}_handleTruncation(){const e=this.shadowRoot
|
|
104
|
+
`}}rl.styles=[...Ki.styles,ol],e([We({type:String,reflect:!0})],rl.prototype,"size",void 0),e([We({type:String,reflect:!0})],rl.prototype,"tone",void 0),e([We({type:Boolean,reflect:!0})],rl.prototype,"disabled",void 0);class cl extends Ki{constructor(){super(...arguments),this.show=!1,this.variant="primary",this.outlined=!1,this.dismissible=!1,this.fullWidth=!1,this.truncated=!1,this.text=""}close(){this.show=!1}_handleShowChange(){if(this.show){if(this.emit("sgds-show",{cancelable:!0}).defaultPrevented)return void(this.show=!1);this.emit("sgds-after-show")}else{if(this.emit("sgds-hide",{cancelable:!0}).defaultPrevented)return void(this.show=!0);this.emit("sgds-after-hide")}}_handleTruncation(){var e;const t=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector(".badge-label");t&&(this.truncated=t.scrollWidth>t.clientWidth)}_handleLabelSlotChange(e){this.text=function(e){if(!e)return"";const t=e.assignedNodes({flatten:!0});let i="";return[...t].forEach(e=>{e.nodeType===Node.TEXT_NODE&&(i+=e.textContent.trim())}),i}(e.target)}_renderBadge(){const e=this.outlined||"warning"===this.variant||"white"===this.variant;return S`<div
|
|
105
105
|
class="
|
|
106
|
-
${Xe({"badge-dismissible":this.dismissible,badge:!0,outlined:this.outlined,
|
|
106
|
+
${Xe({"badge-dismissible":this.dismissible,badge:!0,outlined:this.outlined,"full-width":this.fullWidth})}"
|
|
107
107
|
aria-hidden=${this.show?"false":"true"}
|
|
108
108
|
>
|
|
109
109
|
${this.dismissible?L:S`<slot name="icon"></slot>`}
|
|
@@ -120,7 +120,7 @@ function Ge(e){return(t,i)=>je(t,i,{async get(){return await this.updateComplete
|
|
|
120
120
|
></sgds-close-button>`:L}
|
|
121
121
|
</div>`}render(){return this.dismissible&&this.show||!this.dismissible?this.truncated?S`<sgds-tooltip content=${this.text} @sgds-hide=${e=>e.stopPropagation()}
|
|
122
122
|
>${this._renderBadge()}</sgds-tooltip
|
|
123
|
-
>`:this._renderBadge():L}}cl.styles=[...Ki.styles,il],cl.dependencies={"sgds-close-button":rl,"sgds-tooltip":al},e([We({type:Boolean,reflect:!0})],cl.prototype,"show",void 0),e([We({reflect:!0})],cl.prototype,"variant",void 0),e([We({type:Boolean,reflect:!0})],cl.prototype,"outlined",void 0),e([We({type:Boolean,reflect:!0})],cl.prototype,"dismissible",void 0),e([We({type:Boolean,reflect:!0})],cl.prototype,"fullWidth",void 0),e([qe()],cl.prototype,"truncated",void 0),e([qe()],cl.prototype,"text",void 0),e([tl("show")],cl.prototype,"_handleShowChange",null),e([tl("text")],cl.prototype,"_handleTruncation",null);var dl=S`
|
|
123
|
+
>`:this._renderBadge():L}}cl.styles=[...Ki.styles,il],cl.dependencies={"sgds-close-button":rl,"sgds-tooltip":al},e([We({type:Boolean,reflect:!0})],cl.prototype,"show",void 0),e([We({reflect:!0})],cl.prototype,"variant",void 0),e([We({type:Boolean,reflect:!0})],cl.prototype,"outlined",void 0),e([We({type:Boolean,reflect:!0})],cl.prototype,"dismissible",void 0),e([We({type:Boolean,reflect:!0})],cl.prototype,"fullWidth",void 0),e([qe()],cl.prototype,"truncated",void 0),e([qe()],cl.prototype,"text",void 0),e([tl("show")],cl.prototype,"_handleShowChange",null),e([tl("text",{waitUntilFirstUpdate:!0})],cl.prototype,"_handleTruncation",null);var dl=S`
|
|
124
124
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
|
|
125
125
|
<path
|
|
126
126
|
fill="currentColor"
|
|
@@ -2336,7 +2336,7 @@ function Ge(e){return(t,i)=>je(t,i,{async get(){return await this.updateComplete
|
|
|
2336
2336
|
clip-rule="evenodd"
|
|
2337
2337
|
/>
|
|
2338
2338
|
</svg>
|
|
2339
|
-
`};var Vl=we`:host{color:inherit;display:inline-flex;vertical-align:bottom}:host(.icon-left){margin-right:.25rem}:host(.icon-right){margin-left:.25rem}:host([size=xs]) svg{height:var(--sgds-icon-size-xs);width:var(--sgds-icon-size-xs)}:host([size=sm]) svg{height:var(--sgds-icon-size-sm);width:var(--sgds-icon-size-sm)}:host([size=md]) svg{height:var(--sgds-icon-size-md);width:var(--sgds-icon-size-md)}:host([size=xl]) svg{height:var(--sgds-icon-size-xl);width:var(--sgds-icon-size-xl)}:host([size="2-xl"]) svg{height:var(--sgds-icon-size-2-xl);width:var(--sgds-icon-size-2-xl)}:host([size="3-xl"]) svg{height:var(--sgds-icon-size-3-xl);width:var(--sgds-icon-size-3-xl)}svg{display:inline-block;height:var(--sgds-icon-size-lg);width:var(--sgds-icon-size-lg)}`;class kl extends Ki{constructor(){super(...arguments),this.size="lg"}_getIconByName(e){if(!e)return;const t=Ml[e];if(t)return t;console.warn(`Icon not found: ${e}`)}updated(){var e;const t=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("svg");t&&(this.ariaLabel?(t.removeAttribute("aria-hidden"),t.setAttribute("aria-label",this.ariaLabel)):(t.removeAttribute("aria-label"),t.setAttribute("aria-hidden","true")))}render(){const e=this._getIconByName(this.name);return e||L}}kl.styles=[...Ki.styles,Vl],e([We({type:String,reflect:!0})],kl.prototype,"name",void 0),e([We({type:String,reflect:!0})],kl.prototype,"size",void 0),e([We({type:String})],kl.prototype,"ariaLabel",void 0);var Hl=we`:host{display:block;position:relative}.dropdown{display:flex;height:100%}.dropdown-menu{box-sizing:border-box;max-height:10rem;overflow-x:hidden;overflow-y:auto}.visually-hidden{clip:rect(0,0,0,0)!important;border:0!important;height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;white-space:nowrap!important;width:1px!important}.combobox .form-control-group{height:unset;min-height:var(--sgds-dimension-48)}.combobox-input-container{align-items:center;display:flex;flex-wrap:wrap;gap:var(--sgds-gap-xs);padding:calc(var(--sgds-form-padding-y) - var(--sgds-form-border-width-default)) 0;width:calc(100% - var(--sgds-icon-size-md, 1.25rem))}slot[id=default].d-none,slot[id=default].d-none::slotted(*){display:none}.form-clearable:focus-visible{outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus)}`,$l=we`:host([active]) .dropdown-item{background-color:var(--sgds-bg-translucent-subtle)}.dropdown-item{background-color:var(--sgds-bg-transparent);clear:both;color:var(--sgds-form-color-default);cursor:pointer;font-size:var(--sgds-font-size-label-md);height:100%;overflow-wrap:anywhere;padding:var(--sgds-padding-sm) var(--sgds-padding-md);text-align:inherit;white-space:normal}.dropdown-item.disabled{opacity:var(--sgds-opacity-40);pointer-events:none}.dropdown-item .normal-item-content{align-items:center;display:flex;justify-content:space-between}:host([active]) .dropdown-item .normal-item-content{color:var(--sgds-form-primary-color-default)}.dropdown-item:hover{background:var(--sgds-bg-translucent-subtle)}.dropdown-item:focus-visible{background:var(--sgds-bg-translucent-subtle);outline:var(--sgds-form-outline-focus);outline-offset:var(--sgds-form-outline-offset-focus)}`;class Sl extends Ki{constructor(){super(...arguments),this.active=!1,this.disabled=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","menuitem"),this.setAttribute("aria-disabled",`${this.disabled}`)}render(){const e={disabled:this.disabled,active:this.active};return S`
|
|
2339
|
+
`};var Vl=we`:host{color:inherit;display:inline-flex;vertical-align:bottom}:host(.icon-left){margin-right:.25rem}:host(.icon-right){margin-left:.25rem}:host([size=xs]) svg{height:var(--sgds-icon-size-xs);width:var(--sgds-icon-size-xs)}:host([size=sm]) svg{height:var(--sgds-icon-size-sm);width:var(--sgds-icon-size-sm)}:host([size=md]) svg{height:var(--sgds-icon-size-md);width:var(--sgds-icon-size-md)}:host([size=xl]) svg{height:var(--sgds-icon-size-xl);width:var(--sgds-icon-size-xl)}:host([size="2-xl"]) svg{height:var(--sgds-icon-size-2-xl);width:var(--sgds-icon-size-2-xl)}:host([size="3-xl"]) svg{height:var(--sgds-icon-size-3-xl);width:var(--sgds-icon-size-3-xl)}svg{display:inline-block;height:var(--sgds-icon-size-lg);width:var(--sgds-icon-size-lg)}`;class kl extends Ki{constructor(){super(...arguments),this.size="lg"}_getIconByName(e){if(!e)return;const t=Ml[e];if(t)return t;console.warn(`Icon not found: ${e}`)}updated(){var e;const t=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("svg");t&&(this.ariaLabel?(t.removeAttribute("aria-hidden"),t.setAttribute("aria-label",this.ariaLabel)):(t.removeAttribute("aria-label"),t.setAttribute("aria-hidden","true")))}render(){const e=this._getIconByName(this.name);return e||L}}kl.styles=[...Ki.styles,Vl],e([We({type:String,reflect:!0})],kl.prototype,"name",void 0),e([We({type:String,reflect:!0})],kl.prototype,"size",void 0),e([We({type:String})],kl.prototype,"ariaLabel",void 0);var Hl=we`:host{display:block;position:relative}.dropdown{display:flex;height:100%}.dropdown-menu{box-sizing:border-box;max-height:10rem;overflow-x:hidden;overflow-y:auto}.visually-hidden{clip:rect(0,0,0,0)!important;border:0!important;height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;white-space:nowrap!important;width:1px!important}.combobox .form-control-group{height:unset;min-height:var(--sgds-dimension-48)}.combobox-input-container{align-items:center;display:flex;flex-wrap:wrap;gap:var(--sgds-gap-xs);padding:calc(var(--sgds-form-padding-y) - var(--sgds-form-border-width-default)) 0;width:calc(100% - var(--sgds-icon-size-md, 1.25rem))}.combobox-input-container .form-control{flex:1 1 0;min-width:10ch}slot[id=default].d-none,slot[id=default].d-none::slotted(*){display:none}.form-clearable:focus-visible{outline:var(--sgds-outline-focus);outline-offset:var(--sgds-outline-offset-focus)}`,$l=we`:host([active]) .dropdown-item{background-color:var(--sgds-bg-translucent-subtle)}.dropdown-item{background-color:var(--sgds-bg-transparent);clear:both;color:var(--sgds-form-color-default);cursor:pointer;font-size:var(--sgds-font-size-label-md);height:100%;overflow-wrap:anywhere;padding:var(--sgds-padding-sm) var(--sgds-padding-md);text-align:inherit;white-space:normal}.dropdown-item.disabled{opacity:var(--sgds-opacity-40);pointer-events:none}.dropdown-item .normal-item-content{align-items:center;display:flex;justify-content:space-between}:host([active]) .dropdown-item .normal-item-content{color:var(--sgds-form-primary-color-default)}.dropdown-item:hover{background:var(--sgds-bg-translucent-subtle)}.dropdown-item:focus-visible{background:var(--sgds-bg-translucent-subtle);outline:var(--sgds-form-outline-focus);outline-offset:var(--sgds-form-outline-offset-focus)}`;class Sl extends Ki{constructor(){super(...arguments),this.active=!1,this.disabled=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","menuitem"),this.setAttribute("aria-disabled",`${this.disabled}`)}render(){const e={disabled:this.disabled,active:this.active};return S`
|
|
2340
2340
|
<div class="dropdown-item ${Xe(e)}" tabindex=${this.disabled?"-1":"0"}>
|
|
2341
2341
|
${this._renderItemContent()}
|
|
2342
2342
|
</div>
|
|
@@ -2489,6 +2489,7 @@ const Rl=(e,t,i)=>{const l=new Map;for(let a=t;a<=i;a++)l.set(e[a],a);return l};
|
|
|
2489
2489
|
class="visually-hidden"
|
|
2490
2490
|
?required=${this.required}
|
|
2491
2491
|
tabindex="-1"
|
|
2492
|
+
aria-hidden="true"
|
|
2492
2493
|
/>`:L}
|
|
2493
2494
|
`}}Kl.styles=[...el.styles,Ui,Hl],Kl.childName="sgds-combo-box-option",Kl.dependencies={[Kl.childName]:Pl,"sgds-icon":kl,"sgds-badge":cl,"sgds-spinner":jl},e([We({type:Boolean,reflect:!0})],Kl.prototype,"multiSelect",void 0),e([We({type:Boolean,reflect:!0})],Kl.prototype,"badgeFullWidth",void 0),e([We({type:Boolean,reflect:!0})],Kl.prototype,"clearable",void 0),e([We({type:Boolean,reflect:!0})],Kl.prototype,"noValidate",void 0),e([We({type:Boolean,reflect:!0})],Kl.prototype,"async",void 0),e([We({type:Boolean,reflect:!0})],Kl.prototype,"emptyMenuAsync",void 0),e([We()],Kl.prototype,"filterFunction",void 0),e([Ge("input#multi-select-input-tracker")],Kl.prototype,"_multiSelectInput",void 0),e([Je({flatten:!0,selector:"sgds-combo-box-option"})],Kl.prototype,"options",void 0),e([qe()],Kl.prototype,"optionList",void 0),e([qe()],Kl.prototype,"emptyMenuAfterFiltering",void 0),e([qe()],Kl.prototype,"isFocused",void 0),e([tl("value",{waitUntilFirstUpdate:!0})],Kl.prototype,"_handleValueChange",null),e([tl("optionList",{waitUntilFirstUpdate:!0})],Kl.prototype,"_handleOptionListChange",null),e([tl("menuList",{waitUntilFirstUpdate:!0})],Kl.prototype,"_handleMenuListChange",null),sl("sgds-combo-box",Kl),sl("sgds-combo-box-option",Pl)});
|
|
2494
2495
|
//# sourceMappingURL=index.umd.min.js.map
|