@govtechsg/sgds-web-component 3.10.0-rc.4 → 3.10.0
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/base/select-element.d.ts +0 -1
- package/base/select-element.js +0 -1
- package/base/select-element.js.map +1 -1
- package/components/Checkbox/index.umd.min.js +3 -3
- package/components/Checkbox/index.umd.min.js.map +1 -1
- package/components/Checkbox/sgds-checkbox-group.d.ts +0 -1
- package/components/Checkbox/sgds-checkbox-group.js +0 -1
- package/components/Checkbox/sgds-checkbox-group.js.map +1 -1
- package/components/Checkbox/sgds-checkbox.d.ts +0 -1
- package/components/Checkbox/sgds-checkbox.js +0 -1
- package/components/Checkbox/sgds-checkbox.js.map +1 -1
- package/components/ComboBox/index.umd.min.js +225 -225
- package/components/ComboBox/index.umd.min.js.map +1 -1
- package/components/Datepicker/index.umd.min.js +3 -3
- package/components/Datepicker/index.umd.min.js.map +1 -1
- package/components/Datepicker/sgds-datepicker.d.ts +0 -1
- package/components/Datepicker/sgds-datepicker.js +0 -1
- package/components/Datepicker/sgds-datepicker.js.map +1 -1
- package/components/FileUpload/index.umd.min.js +2 -2
- package/components/FileUpload/index.umd.min.js.map +1 -1
- package/components/FileUpload/sgds-file-upload.d.ts +0 -1
- package/components/FileUpload/sgds-file-upload.js +0 -1
- package/components/FileUpload/sgds-file-upload.js.map +1 -1
- package/components/Input/index.umd.min.js +2 -2
- package/components/Input/index.umd.min.js.map +1 -1
- package/components/Input/sgds-input.d.ts +0 -1
- package/components/Input/sgds-input.js +0 -1
- package/components/Input/sgds-input.js.map +1 -1
- package/components/QuantityToggle/index.umd.min.js +3 -3
- package/components/QuantityToggle/index.umd.min.js.map +1 -1
- package/components/QuantityToggle/sgds-quantity-toggle.d.ts +0 -1
- package/components/QuantityToggle/sgds-quantity-toggle.js +0 -1
- package/components/QuantityToggle/sgds-quantity-toggle.js.map +1 -1
- package/components/Radio/index.umd.min.js +6 -6
- package/components/Radio/index.umd.min.js.map +1 -1
- package/components/Radio/sgds-radio-group.d.ts +0 -1
- package/components/Radio/sgds-radio-group.js +0 -1
- package/components/Radio/sgds-radio-group.js.map +1 -1
- package/components/Select/index.umd.min.js +2 -2
- package/components/Select/index.umd.min.js.map +1 -1
- package/components/SystemBanner/index.umd.min.js +2 -2
- package/components/SystemBanner/index.umd.min.js.map +1 -1
- package/components/SystemBanner/sgds-system-banner.d.ts +2 -2
- package/components/SystemBanner/sgds-system-banner.js +5 -5
- package/components/SystemBanner/sgds-system-banner.js.map +1 -1
- package/components/Table/index.umd.min.js +62 -17
- package/components/Table/index.umd.min.js.map +1 -1
- package/components/Table/sgds-table-cell.js +1 -1
- package/components/Table/sgds-table-cell.js.map +1 -1
- package/components/Table/sgds-table-head.d.ts +2 -5
- package/components/Table/sgds-table-head.js +24 -15
- package/components/Table/sgds-table-head.js.map +1 -1
- package/components/Table/sgds-table.d.ts +41 -6
- package/components/Table/sgds-table.js +57 -15
- package/components/Table/sgds-table.js.map +1 -1
- package/components/Table/table-cell.js +1 -1
- package/components/Table/table-context.d.ts +3 -0
- package/components/Table/table-context.js +6 -0
- package/components/Table/table-context.js.map +1 -0
- package/components/Table/table-head.js +1 -1
- package/components/Table/table.js +1 -1
- package/components/Textarea/index.umd.min.js +6 -6
- package/components/Textarea/index.umd.min.js.map +1 -1
- package/components/Textarea/sgds-textarea.d.ts +0 -1
- package/components/Textarea/sgds-textarea.js +0 -1
- package/components/Textarea/sgds-textarea.js.map +1 -1
- package/components/index.umd.min.js +31 -27
- package/components/index.umd.min.js.map +1 -1
- package/index.umd.min.js +616 -612
- package/index.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/react/base/select-element.cjs.js +0 -1
- package/react/base/select-element.cjs.js.map +1 -1
- package/react/base/select-element.js +0 -1
- package/react/base/select-element.js.map +1 -1
- package/react/components/Checkbox/sgds-checkbox-group.cjs.js +0 -1
- package/react/components/Checkbox/sgds-checkbox-group.cjs.js.map +1 -1
- package/react/components/Checkbox/sgds-checkbox-group.js +0 -1
- package/react/components/Checkbox/sgds-checkbox-group.js.map +1 -1
- package/react/components/Checkbox/sgds-checkbox.cjs.js +0 -1
- package/react/components/Checkbox/sgds-checkbox.cjs.js.map +1 -1
- package/react/components/Checkbox/sgds-checkbox.js +0 -1
- package/react/components/Checkbox/sgds-checkbox.js.map +1 -1
- package/react/components/Datepicker/sgds-datepicker.cjs.js +0 -1
- package/react/components/Datepicker/sgds-datepicker.cjs.js.map +1 -1
- package/react/components/Datepicker/sgds-datepicker.js +0 -1
- package/react/components/Datepicker/sgds-datepicker.js.map +1 -1
- package/react/components/FileUpload/sgds-file-upload.cjs.js +0 -1
- package/react/components/FileUpload/sgds-file-upload.cjs.js.map +1 -1
- package/react/components/FileUpload/sgds-file-upload.js +0 -1
- package/react/components/FileUpload/sgds-file-upload.js.map +1 -1
- package/react/components/Input/sgds-input.cjs.js +0 -1
- package/react/components/Input/sgds-input.cjs.js.map +1 -1
- package/react/components/Input/sgds-input.js +0 -1
- package/react/components/Input/sgds-input.js.map +1 -1
- package/react/components/QuantityToggle/sgds-quantity-toggle.cjs.js +0 -1
- package/react/components/QuantityToggle/sgds-quantity-toggle.cjs.js.map +1 -1
- package/react/components/QuantityToggle/sgds-quantity-toggle.js +0 -1
- package/react/components/QuantityToggle/sgds-quantity-toggle.js.map +1 -1
- package/react/components/Radio/sgds-radio-group.cjs.js +0 -1
- package/react/components/Radio/sgds-radio-group.cjs.js.map +1 -1
- package/react/components/Radio/sgds-radio-group.js +0 -1
- package/react/components/Radio/sgds-radio-group.js.map +1 -1
- package/react/components/SystemBanner/sgds-system-banner.cjs.js +5 -5
- package/react/components/SystemBanner/sgds-system-banner.cjs.js.map +1 -1
- package/react/components/SystemBanner/sgds-system-banner.js +5 -5
- package/react/components/SystemBanner/sgds-system-banner.js.map +1 -1
- package/react/components/Table/sgds-table-cell.cjs.js +1 -1
- package/react/components/Table/sgds-table-cell.cjs.js.map +1 -1
- package/react/components/Table/sgds-table-cell.js +1 -1
- package/react/components/Table/sgds-table-cell.js.map +1 -1
- package/react/components/Table/sgds-table-head.cjs.js +24 -15
- package/react/components/Table/sgds-table-head.cjs.js.map +1 -1
- package/react/components/Table/sgds-table-head.js +24 -15
- package/react/components/Table/sgds-table-head.js.map +1 -1
- package/react/components/Table/sgds-table.cjs.js +56 -14
- package/react/components/Table/sgds-table.cjs.js.map +1 -1
- package/react/components/Table/sgds-table.js +57 -15
- package/react/components/Table/sgds-table.js.map +1 -1
- package/react/components/Table/table-cell.cjs.js +1 -1
- package/react/components/Table/table-cell.js +1 -1
- package/react/components/Table/table-context.cjs.js +11 -0
- package/react/components/Table/table-context.cjs.js.map +1 -0
- package/react/components/Table/table-context.js +7 -0
- package/react/components/Table/table-context.js.map +1 -0
- package/react/components/Table/table-head.cjs.js +1 -1
- package/react/components/Table/table-head.js +1 -1
- package/react/components/Table/table.cjs.js +1 -1
- package/react/components/Table/table.js +1 -1
- package/react/components/Textarea/sgds-textarea.cjs.js +0 -1
- package/react/components/Textarea/sgds-textarea.cjs.js.map +1 -1
- package/react/components/Textarea/sgds-textarea.js +0 -1
- package/react/components/Textarea/sgds-textarea.js.map +1 -1
- package/react/utils/inputValidationController.cjs.js +2 -2
- package/react/utils/inputValidationController.cjs.js.map +1 -1
- package/react/utils/inputValidationController.js +2 -2
- package/react/utils/inputValidationController.js.map +1 -1
- package/react/utils/validatorMixin.cjs.js +10 -13
- package/react/utils/validatorMixin.cjs.js.map +1 -1
- package/react/utils/validatorMixin.js +10 -13
- package/react/utils/validatorMixin.js.map +1 -1
- package/utils/inputValidationController.d.ts +1 -1
- package/utils/inputValidationController.js +2 -2
- package/utils/inputValidationController.js.map +1 -1
- package/utils/validatorMixin.js +10 -13
- package/utils/validatorMixin.js.map +1 -1
|
@@ -12,7 +12,6 @@ declare const SgdsRadioGroup_base: (new (...args: any[]) => import("../../utils/
|
|
|
12
12
|
*/
|
|
13
13
|
export declare class SgdsRadioGroup extends SgdsRadioGroup_base {
|
|
14
14
|
static styles: import("lit").CSSResult[];
|
|
15
|
-
static formAssociated: boolean;
|
|
16
15
|
/**@internal */
|
|
17
16
|
defaultSlot: HTMLSlotElement;
|
|
18
17
|
/**@internal */
|
|
@@ -239,7 +239,6 @@ class SgdsRadioGroup extends SgdsFormValidatorMixin(FormControlElement) {
|
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
241
|
SgdsRadioGroup.styles = [...FormControlElement.styles, css_248z];
|
|
242
|
-
SgdsRadioGroup.formAssociated = true;
|
|
243
242
|
__decorate([
|
|
244
243
|
query("slot:not([name])")
|
|
245
244
|
], SgdsRadioGroup.prototype, "defaultSlot", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sgds-radio-group.js","sources":["../../../src/components/Radio/sgds-radio-group.ts"],"sourcesContent":["import { html, nothing, PropertyValueMap } from \"lit\";\nimport { property, query, queryAssignedElements, state } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { live } from \"lit/directives/live.js\";\nimport FormControlElement from \"../../base/form-control-element\";\nimport { SgdsFormValidatorMixin } from \"../../utils/validatorMixin\";\nimport { watch } from \"../../utils/watch\";\nimport radioGroupStyles from \"./radio-group.css\";\nimport SgdsRadio from \"./sgds-radio\";\n\n/**\n * @summary RadioGroup group multiple radios so they function as a single form control.\n *\n * @slot default - The default slot where sgds-radio are placed.\n * @slot invalidIcon - The slot for invalid icon\n *\n * @event sgds-change - Emitted when the radio group's selected value changes.\n *\n */\nexport class SgdsRadioGroup extends SgdsFormValidatorMixin(FormControlElement) {\n static styles = [...FormControlElement.styles, radioGroupStyles];\n static formAssociated = true;\n\n /**@internal */\n @query(\"slot:not([name])\") defaultSlot: HTMLSlotElement;\n\n /**@internal */\n @state() defaultValue = \"\";\n\n /** The selected value of the control. */\n @property({ reflect: true }) value = \"\";\n\n /**Feedback text for error state when validated */\n @property({ type: String, reflect: true }) invalidFeedback = \"\";\n\n /** Allows invalidFeedback, invalid and valid styles to be visible with the input */\n @property({ type: Boolean, reflect: true }) hasFeedback = false;\n\n /** Makes the input as a required field. */\n @property({ type: Boolean, reflect: true }) required = false;\n\n @watch(\"value\", { waitUntilFirstUpdate: true })\n _handleValueChange() {\n this.emit(\"sgds-change\", { detail: { value: this.value } });\n this._updateCheckedRadio();\n }\n @watch(\"invalid\", { waitUntilFirstUpdate: true })\n _handleInvalidChange() {\n this._radios.forEach(r => (r.invalid = this.invalid));\n }\n\n @state() private _isTouched = false;\n /**\n * radio requries a custom _mixinResetFormControl as the update of input value\n * requires to fire a reset event manually\n * */\n private _mixinResetFormControl() {\n this.value = this.input.value = this.defaultValue;\n this._updateInputValue(\"reset\");\n this._mixinResetValidity(this.input);\n }\n\n connectedCallback() {\n super.connectedCallback();\n this.defaultValue = this.value;\n this.addEventListener(\"sgds-blur\", () => {\n this._isTouched = true;\n });\n }\n\n firstUpdated(changedProperties: PropertyValueMap<this>) {\n super.firstUpdated(changedProperties);\n const radios = this._radios;\n radios.forEach((item, index) => {\n if (radios.length > 1) {\n switch (index) {\n case 0:\n item.setAttribute(\"first-of-type\", \"\");\n break;\n\n case radios.length - 1:\n item.setAttribute(\"last-of-type\", \"\");\n break;\n\n default:\n item.setAttribute(\"nth-of-type\", \"\");\n }\n }\n });\n if (this.value) {\n this._updateInputValue(\"change\");\n }\n }\n\n @queryAssignedElements()\n private _radios!: Array<SgdsRadio>;\n\n private _handleRadioClick(event: MouseEvent) {\n event.preventDefault();\n const target = event.target as SgdsRadio;\n\n if (target.disabled) {\n return;\n }\n\n this.value = target.value;\n\n this._updateInputValue();\n\n const radios = this._radios;\n\n radios.forEach(radio => {\n return (radio.checked = radio === target);\n });\n }\n /**\n * when input value is set programatically, need to manually dispatch a change event\n * In order to prevent race conditions and ensure sequence of events, set input's value here instead of binding to value prop of input\n */\n private _updateInputValue(eventName = \"change\") {\n this.input.value = this.value;\n this.input.dispatchEvent(new InputEvent(eventName));\n }\n\n private _handleKeyDown(event: KeyboardEvent) {\n if (![\"ArrowUp\", \"ArrowDown\", \"ArrowLeft\", \"ArrowRight\", \" \"].includes(event.key)) {\n return;\n }\n\n const radios = this._radios.filter(radio => !radio.disabled);\n const checkedRadio = radios.find(radio => radio.checked) ?? radios[0];\n //if eventkey is space, index increment is 0, if eventkey arrowup/arrowleft, index is -1, arrowright/arrowdown, index incr is 1\n const incr = event.key === \" \" ? 0 : [\"ArrowUp\", \"ArrowLeft\"].includes(event.key) ? -1 : 1;\n let index = radios.indexOf(checkedRadio) + incr;\n if (index < 0) {\n index = radios.length - 1;\n }\n if (index > radios.length - 1) {\n index = 0;\n }\n\n this._radios.forEach(radio => {\n radio.checked = false;\n radio.tabIndex = -1;\n });\n\n this.value = radios[index].value;\n this._updateInputValue();\n radios[index].checked = true;\n radios[index].tabIndex = 0;\n // preventDefault at the end to allow Tab\n event.preventDefault();\n }\n\n private _handleSlotChange() {\n const radios = this._radios;\n\n radios.forEach(radio => (radio.checked = radio.value === this.value));\n this._disabledChildRadios();\n if (!radios.some(radio => radio.checked)) {\n if (radios[0]) radios[0].tabIndex = 0;\n }\n }\n\n private _updateCheckedRadio() {\n const radios = this._radios;\n radios.forEach(radio => (radio.checked = radio.value === this.value));\n }\n\n protected _renderHintText() {\n const hintTextTemplate = html` <div id=\"${this._controlId}Help\" class=\"form-text\">${this.hintText}</div> `;\n return this.hintText && hintTextTemplate;\n }\n /**\n * Checks for validity. Under the hood, HTMLFormElement's reportValidity method calls this method to check for component's validity state\n * Note that the native error popup is prevented for SGDS form components by default. Instead the validation message shows up in the feedback container of SgdsInput\n */\n public reportValidity(): boolean {\n return this._mixinReportValidity();\n }\n /**\n * Checks for validity without any native error popup message\n */\n public checkValidity(): boolean {\n return this._mixinCheckValidity();\n }\n\n /**\n * Returns the ValidityState object\n */\n public get validity(): ValidityState {\n return this._mixinGetValidity();\n }\n /**\n * Returns the validation message based on the ValidityState\n */\n public get validationMessage() {\n return this._mixinGetValidationMessage();\n }\n\n @watch(\"_isTouched\", { waitUntilFirstUpdate: true })\n _handleIsTouched() {\n if (this._isTouched) {\n this.invalid = !this.input.checkValidity();\n }\n }\n\n @watch(\"disabled\", { waitUntilFirstUpdate: true })\n _handleDisabledChange() {\n // Disabled form controls are always valid, so we need to recheck validity when the state changes\n this.setInvalid(false);\n this._disabledChildRadios();\n }\n\n private _disabledChildRadios() {\n if (this.disabled) {\n const radios = this._radios;\n radios.forEach(radio => (radio.disabled = this.disabled));\n }\n }\n\n render() {\n const defaultSlot = html`\n <slot\n class=\"radio-container\"\n @click=${this._handleRadioClick}\n @keydown=${this._handleKeyDown}\n @slotchange=${this._handleSlotChange}\n role=\"presentation\"\n ></slot>\n `;\n return html`\n <fieldset name=${this.name}>\n <div class=\"label-hint-container\">\n <label\n class=${classMap({\n \"form-label\": true,\n required: this.required\n })}\n >\n ${this.label}\n </label>\n ${this._renderHintText()}\n </div>\n ${defaultSlot}\n <input\n type=\"text\"\n class=\"radio-group-validation-input ${classMap({\n \"is-invalid\": this.hasFeedback && this.invalid\n })}\"\n ?required=${this.required}\n tabindex=\"-1\"\n @change=${(e: Event) => super._mixinHandleChange(e)}\n .value=${live(this.value)}\n aria-describedby=${this.invalid && this.hasFeedback ? \"radio-group-feedback\" : `${this._controlId}Help`}\n />\n ${this.invalid && this.hasFeedback\n ? html`\n <div class=\"invalid-feedback-container\">\n <slot name=\"invalidIcon\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\">\n <path\n d=\"M17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10ZM10 6.25C9.49805 6.25 9.10584 6.68339 9.15578 7.18285L9.48461 10.4711C9.51109 10.7359 9.7339 10.9375 10 10.9375C10.2661 10.9375 10.4889 10.7359 10.5154 10.4711L10.8442 7.18285C10.8942 6.68339 10.5019 6.25 10 6.25ZM10.0014 11.875C9.48368 11.875 9.06394 12.2947 9.06394 12.8125C9.06394 13.3303 9.48368 13.75 10.0014 13.75C10.5192 13.75 10.9389 13.3303 10.9389 12.8125C10.9389 12.2947 10.5192 11.875 10.0014 11.875Z\"\n fill=\"currentColor\"\n />\n </svg>\n </slot>\n <div id=\"radio-group-feedback\" class=\"invalid-feedback\">\n ${this.invalidFeedback ? this.invalidFeedback : this.input.validationMessage}\n </div>\n </div>\n `\n : nothing}\n </fieldset>\n `;\n }\n}\n\nexport default SgdsRadioGroup;\n"],"names":["radioGroupStyles"],"mappings":";;;;;;;;;;AAUA;;;;;;;;AAQG;MACU,cAAe,SAAQ,sBAAsB,CAAC,kBAAkB,CAAC,CAAA;AAA9E,IAAA,WAAA,GAAA;;;QAQW,IAAY,CAAA,YAAA,GAAG,EAAE,CAAC;;QAGE,IAAK,CAAA,KAAA,GAAG,EAAE,CAAC;;QAGG,IAAe,CAAA,eAAA,GAAG,EAAE,CAAC;;QAGpB,IAAW,CAAA,WAAA,GAAG,KAAK,CAAC;;QAGpB,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;QAY5C,IAAU,CAAA,UAAA,GAAG,KAAK,CAAC;KAiOrC;IA1OC,kBAAkB,GAAA;AAChB,QAAA,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAC5D,IAAI,CAAC,mBAAmB,EAAE,CAAC;KAC5B;IAED,oBAAoB,GAAA;AAClB,QAAA,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;KACvD;AAGD;;;AAGK;IACG,sBAAsB,GAAA;AAC5B,QAAA,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC;AAClD,QAAA,IAAI,CAAC,iBAAiB,CAAC,OAA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A,EAAA,cAAA,CAAA,SAAA,EAAA,oBAAA,EAAA,IAAA,CAAA,CAAA;AAED,UAAA,CAAA;IADC,KAAK,CAAC,SAAS,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;AAGhD,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,sBAAA,EAAA,IAAA,CAAA,CAAA;AAEgB,UAAA,CAAA;AAAhB,IAAA,KAAK,EAAE;AAA4B,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,YAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AA4C5B,UAAA,CAAA;AADP,IAAA,qBAAqB,EAAE;AACW,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,SAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AA0GnC,UAAA,CAAA;IADC,KAAK,CAAC,YAAY,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;AAKnD,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,kBAAA,EAAA,IAAA,CAAA,CAAA;AAGD,UAAA,CAAA;IADC,KAAK,CAAC,UAAU,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;AAKjD,CAAA,EAAA,cAAA,CAAA,SAAA,EAAA,uBAAA,EAAA,IAAA,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"sgds-radio-group.js","sources":["../../../src/components/Radio/sgds-radio-group.ts"],"sourcesContent":["import { html, nothing, PropertyValueMap } from \"lit\";\nimport { property, query, queryAssignedElements, state } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { live } from \"lit/directives/live.js\";\nimport FormControlElement from \"../../base/form-control-element\";\nimport { SgdsFormValidatorMixin } from \"../../utils/validatorMixin\";\nimport { watch } from \"../../utils/watch\";\nimport radioGroupStyles from \"./radio-group.css\";\nimport SgdsRadio from \"./sgds-radio\";\n\n/**\n * @summary RadioGroup group multiple radios so they function as a single form control.\n *\n * @slot default - The default slot where sgds-radio are placed.\n * @slot invalidIcon - The slot for invalid icon\n *\n * @event sgds-change - Emitted when the radio group's selected value changes.\n *\n */\nexport class SgdsRadioGroup extends SgdsFormValidatorMixin(FormControlElement) {\n static styles = [...FormControlElement.styles, radioGroupStyles];\n\n /**@internal */\n @query(\"slot:not([name])\") defaultSlot: HTMLSlotElement;\n\n /**@internal */\n @state() defaultValue = \"\";\n\n /** The selected value of the control. */\n @property({ reflect: true }) value = \"\";\n\n /**Feedback text for error state when validated */\n @property({ type: String, reflect: true }) invalidFeedback = \"\";\n\n /** Allows invalidFeedback, invalid and valid styles to be visible with the input */\n @property({ type: Boolean, reflect: true }) hasFeedback = false;\n\n /** Makes the input as a required field. */\n @property({ type: Boolean, reflect: true }) required = false;\n\n @watch(\"value\", { waitUntilFirstUpdate: true })\n _handleValueChange() {\n this.emit(\"sgds-change\", { detail: { value: this.value } });\n this._updateCheckedRadio();\n }\n @watch(\"invalid\", { waitUntilFirstUpdate: true })\n _handleInvalidChange() {\n this._radios.forEach(r => (r.invalid = this.invalid));\n }\n\n @state() private _isTouched = false;\n /**\n * radio requries a custom _mixinResetFormControl as the update of input value\n * requires to fire a reset event manually\n * */\n private _mixinResetFormControl() {\n this.value = this.input.value = this.defaultValue;\n this._updateInputValue(\"reset\");\n this._mixinResetValidity(this.input);\n }\n\n connectedCallback() {\n super.connectedCallback();\n this.defaultValue = this.value;\n this.addEventListener(\"sgds-blur\", () => {\n this._isTouched = true;\n });\n }\n\n firstUpdated(changedProperties: PropertyValueMap<this>) {\n super.firstUpdated(changedProperties);\n const radios = this._radios;\n radios.forEach((item, index) => {\n if (radios.length > 1) {\n switch (index) {\n case 0:\n item.setAttribute(\"first-of-type\", \"\");\n break;\n\n case radios.length - 1:\n item.setAttribute(\"last-of-type\", \"\");\n break;\n\n default:\n item.setAttribute(\"nth-of-type\", \"\");\n }\n }\n });\n if (this.value) {\n this._updateInputValue(\"change\");\n }\n }\n\n @queryAssignedElements()\n private _radios!: Array<SgdsRadio>;\n\n private _handleRadioClick(event: MouseEvent) {\n event.preventDefault();\n const target = event.target as SgdsRadio;\n\n if (target.disabled) {\n return;\n }\n\n this.value = target.value;\n\n this._updateInputValue();\n\n const radios = this._radios;\n\n radios.forEach(radio => {\n return (radio.checked = radio === target);\n });\n }\n /**\n * when input value is set programatically, need to manually dispatch a change event\n * In order to prevent race conditions and ensure sequence of events, set input's value here instead of binding to value prop of input\n */\n private _updateInputValue(eventName = \"change\") {\n this.input.value = this.value;\n this.input.dispatchEvent(new InputEvent(eventName));\n }\n\n private _handleKeyDown(event: KeyboardEvent) {\n if (![\"ArrowUp\", \"ArrowDown\", \"ArrowLeft\", \"ArrowRight\", \" \"].includes(event.key)) {\n return;\n }\n\n const radios = this._radios.filter(radio => !radio.disabled);\n const checkedRadio = radios.find(radio => radio.checked) ?? radios[0];\n //if eventkey is space, index increment is 0, if eventkey arrowup/arrowleft, index is -1, arrowright/arrowdown, index incr is 1\n const incr = event.key === \" \" ? 0 : [\"ArrowUp\", \"ArrowLeft\"].includes(event.key) ? -1 : 1;\n let index = radios.indexOf(checkedRadio) + incr;\n if (index < 0) {\n index = radios.length - 1;\n }\n if (index > radios.length - 1) {\n index = 0;\n }\n\n this._radios.forEach(radio => {\n radio.checked = false;\n radio.tabIndex = -1;\n });\n\n this.value = radios[index].value;\n this._updateInputValue();\n radios[index].checked = true;\n radios[index].tabIndex = 0;\n // preventDefault at the end to allow Tab\n event.preventDefault();\n }\n\n private _handleSlotChange() {\n const radios = this._radios;\n\n radios.forEach(radio => (radio.checked = radio.value === this.value));\n this._disabledChildRadios();\n if (!radios.some(radio => radio.checked)) {\n if (radios[0]) radios[0].tabIndex = 0;\n }\n }\n\n private _updateCheckedRadio() {\n const radios = this._radios;\n radios.forEach(radio => (radio.checked = radio.value === this.value));\n }\n\n protected _renderHintText() {\n const hintTextTemplate = html` <div id=\"${this._controlId}Help\" class=\"form-text\">${this.hintText}</div> `;\n return this.hintText && hintTextTemplate;\n }\n /**\n * Checks for validity. Under the hood, HTMLFormElement's reportValidity method calls this method to check for component's validity state\n * Note that the native error popup is prevented for SGDS form components by default. Instead the validation message shows up in the feedback container of SgdsInput\n */\n public reportValidity(): boolean {\n return this._mixinReportValidity();\n }\n /**\n * Checks for validity without any native error popup message\n */\n public checkValidity(): boolean {\n return this._mixinCheckValidity();\n }\n\n /**\n * Returns the ValidityState object\n */\n public get validity(): ValidityState {\n return this._mixinGetValidity();\n }\n /**\n * Returns the validation message based on the ValidityState\n */\n public get validationMessage() {\n return this._mixinGetValidationMessage();\n }\n\n @watch(\"_isTouched\", { waitUntilFirstUpdate: true })\n _handleIsTouched() {\n if (this._isTouched) {\n this.invalid = !this.input.checkValidity();\n }\n }\n\n @watch(\"disabled\", { waitUntilFirstUpdate: true })\n _handleDisabledChange() {\n // Disabled form controls are always valid, so we need to recheck validity when the state changes\n this.setInvalid(false);\n this._disabledChildRadios();\n }\n\n private _disabledChildRadios() {\n if (this.disabled) {\n const radios = this._radios;\n radios.forEach(radio => (radio.disabled = this.disabled));\n }\n }\n\n render() {\n const defaultSlot = html`\n <slot\n class=\"radio-container\"\n @click=${this._handleRadioClick}\n @keydown=${this._handleKeyDown}\n @slotchange=${this._handleSlotChange}\n role=\"presentation\"\n ></slot>\n `;\n return html`\n <fieldset name=${this.name}>\n <div class=\"label-hint-container\">\n <label\n class=${classMap({\n \"form-label\": true,\n required: this.required\n })}\n >\n ${this.label}\n </label>\n ${this._renderHintText()}\n </div>\n ${defaultSlot}\n <input\n type=\"text\"\n class=\"radio-group-validation-input ${classMap({\n \"is-invalid\": this.hasFeedback && this.invalid\n })}\"\n ?required=${this.required}\n tabindex=\"-1\"\n @change=${(e: Event) => super._mixinHandleChange(e)}\n .value=${live(this.value)}\n aria-describedby=${this.invalid && this.hasFeedback ? \"radio-group-feedback\" : `${this._controlId}Help`}\n />\n ${this.invalid && this.hasFeedback\n ? html`\n <div class=\"invalid-feedback-container\">\n <slot name=\"invalidIcon\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\">\n <path\n d=\"M17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10ZM10 6.25C9.49805 6.25 9.10584 6.68339 9.15578 7.18285L9.48461 10.4711C9.51109 10.7359 9.7339 10.9375 10 10.9375C10.2661 10.9375 10.4889 10.7359 10.5154 10.4711L10.8442 7.18285C10.8942 6.68339 10.5019 6.25 10 6.25ZM10.0014 11.875C9.48368 11.875 9.06394 12.2947 9.06394 12.8125C9.06394 13.3303 9.48368 13.75 10.0014 13.75C10.5192 13.75 10.9389 13.3303 10.9389 12.8125C10.9389 12.2947 10.5192 11.875 10.0014 11.875Z\"\n fill=\"currentColor\"\n />\n </svg>\n </slot>\n <div id=\"radio-group-feedback\" class=\"invalid-feedback\">\n ${this.invalidFeedback ? this.invalidFeedback : this.input.validationMessage}\n </div>\n </div>\n `\n : nothing}\n </fieldset>\n `;\n }\n}\n\nexport default SgdsRadioGroup;\n"],"names":["radioGroupStyles"],"mappings":";;;;;;;;;;AAUA;;;;;;;;AAQG;MACU,cAAe,SAAQ,sBAAsB,CAAC,kBAAkB,CAAC,CAAA;AAA9E,IAAA,WAAA,GAAA;;;QAOW,IAAY,CAAA,YAAA,GAAG,EAAE,CAAC;;QAGE,IAAK,CAAA,KAAA,GAAG,EAAE,CAAC;;QAGG,IAAe,CAAA,eAAA,GAAG,EAAE,CAAC;;QAGpB,IAAW,CAAA,WAAA,GAAG,KAAK,CAAC;;QAGpB,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;QAY5C,IAAU,CAAA,UAAA,GAAG,KAAK,CAAC;KAiOrC;IA1OC,kBAAkB,GAAA;AAChB,QAAA,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QA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* Copyright 2020 Google LLC
|
|
82
82
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
83
|
-
*/const We=()=>new qe;class qe{}const je=new WeakMap;const Ke=Ee(class extends Fe{render(e){return le}update(e,[t]){const i=t!==this._ref;return i&&void 0!==this._ref&&this._updateRefValue(void 0),(i||this._lastElementForRef!==this._element)&&(this._ref=t,this._context=e.options?.host,this._updateRefValue(this._element=e.element)),le}_updateRefValue(e){if(this.isConnected||(e=void 0),"function"==typeof this._ref){const t=this._context??globalThis;let i=je.get(t);void 0===i&&(i=new WeakMap,je.set(t,i)),void 0!==i.get(this._ref)&&this._ref.call(this._context,void 0),i.set(this._ref,e),void 0!==e&&this._ref.call(this._context,e)}else this._ref.value=e}get _lastElementForRef(){return"function"==typeof this._ref?je.get(this._context??globalThis)?.get(this._ref):this._ref?.value}disconnected(){this._lastElementForRef===this._element&&this._updateRefValue(void 0)}reconnected(){this._updateRefValue(this._element)}}),Je=Math.min,Ge=Math.max,Ye=Math.round,Xe=Math.floor,Qe=e=>({x:e,y:e}),et={left:"right",right:"left",bottom:"top",top:"bottom"},tt={start:"end",end:"start"};function it(e,t,i){return Ge(e,Je(t,i))}function lt(e,t){return"function"==typeof e?e(t):e}function at(e){return e.split("-")[0]}function nt(e){return e.split("-")[1]}function ot(e){return"x"===e?"y":"x"}function rt(e){return"y"===e?"height":"width"}const st=new Set(["top","bottom"]);function ct(e){return st.has(at(e))?"y":"x"}function dt(e){return ot(ct(e))}function ht(e,t,i){void 0===i&&(i=!1);const l=nt(e),a=dt(e),n=rt(a);let o="x"===a?l===(i?"end":"start")?"right":"left":"start"===l?"bottom":"top";return t.reference[n]>t.floating[n]&&(o=mt(o)),[o,mt(o)]}function vt(e){return e.replace(/start|end/g,e=>tt[e])}const ut=["left","right"],pt=["right","left"],gt=["top","bottom"],wt=["bottom","top"];function ft(e,t,i,l){const a=nt(e);let n=function(e,t,i){switch(e){case"top":case"bottom":return i?t?pt:ut:t?ut:pt;case"left":case"right":return t?gt:wt;default:return[]}}(at(e),"start"===i,l);return a&&(n=n.map(e=>e+"-"+a),t&&(n=n.concat(n.map(vt)))),n}function mt(e){return e.replace(/left|right|bottom|top/g,e=>et[e])}function xt(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function yt(e){const{x:t,y:i,width:l,height:a}=e;return{width:l,height:a,top:i,left:t,right:t+l,bottom:i+a,x:t,y:i}}function Zt(e,t,i){let{reference:l,floating:a}=e;const n=ct(t),o=dt(t),r=rt(o),s=at(t),c="y"===n,d=l.x+l.width/2-a.width/2,h=l.y+l.height/2-a.height/2,v=l[r]/2-a[r]/2;let u;switch(s){case"top":u={x:d,y:l.y-a.height};break;case"bottom":u={x:d,y:l.y+l.height};break;case"right":u={x:l.x+l.width,y:h};break;case"left":u={x:l.x-a.width,y:h};break;default:u={x:l.x,y:l.y}}switch(nt(t)){case"start":u[o]-=v*(i&&c?-1:1);break;case"end":u[o]+=v*(i&&c?-1:1)}return u}async function Ct(e,t){var i;void 0===t&&(t={});const{x:l,y:a,platform:n,rects:o,elements:r,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:v=!1,padding:u=0}=lt(t,e),p=xt(u),g=r[v?"floating"===h?"reference":"floating":h],w=yt(await n.getClippingRect({element:null==(i=await(null==n.isElement?void 0:n.isElement(g)))||i?g:g.contextElement||await(null==n.getDocumentElement?void 0:n.getDocumentElement(r.floating)),boundary:c,rootBoundary:d,strategy:s})),f="floating"===h?{x:l,y:a,width:o.floating.width,height:o.floating.height}:o.reference,m=await(null==n.getOffsetParent?void 0:n.getOffsetParent(r.floating)),x=await(null==n.isElement?void 0:n.isElement(m))&&await(null==n.getScale?void 0:n.getScale(m))||{x:1,y:1},y=yt(n.convertOffsetParentRelativeRectToViewportRelativeRect?await n.convertOffsetParentRelativeRectToViewportRelativeRect({elements:r,rect:f,offsetParent:m,strategy:s}):f);return{top:(w.top-y.top+p.top)/x.y,bottom:(y.bottom-w.bottom+p.bottom)/x.y,left:(w.left-y.left+p.left)/x.x,right:(y.right-w.right+p.right)/x.x}}const bt=new Set(["left","top"]);function Mt(){return"undefined"!=typeof window}function _t(e){return $t(e)?(e.nodeName||"").toLowerCase():"#document"}function Vt(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Ht(e){var t;return null==(t=($t(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function $t(e){return!!Mt()&&(e instanceof Node||e instanceof Vt(e).Node)}function Bt(e){return!!Mt()&&(e instanceof Element||e instanceof Vt(e).Element)}function St(e){return!!Mt()&&(e instanceof HTMLElement||e instanceof Vt(e).HTMLElement)}function kt(e){return!(!Mt()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Vt(e).ShadowRoot)}const Lt=new Set(["inline","contents"]);function At(e){const{overflow:t,overflowX:i,overflowY:l,display:a}=Wt(e);return/auto|scroll|overlay|hidden|clip/.test(t+l+i)&&!Lt.has(a)}const Et=new Set(["table","td","th"]);function It(e){return Et.has(_t(e))}const Pt=[":popover-open",":modal"];function Tt(e){return Pt.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const Rt=["transform","translate","scale","rotate","perspective"],Ot=["transform","translate","scale","rotate","perspective","filter"],zt=["paint","layout","strict","content"];function Dt(e){const t=Nt(),i=Bt(e)?Wt(e):e;return Rt.some(e=>!!i[e]&&"none"!==i[e])||!!i.containerType&&"normal"!==i.containerType||!t&&!!i.backdropFilter&&"none"!==i.backdropFilter||!t&&!!i.filter&&"none"!==i.filter||Ot.some(e=>(i.willChange||"").includes(e))||zt.some(e=>(i.contain||"").includes(e))}function Nt(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Ut=new Set(["html","body","#document"]);function Ft(e){return Ut.has(_t(e))}function Wt(e){return Vt(e).getComputedStyle(e)}function qt(e){return Bt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function jt(e){if("html"===_t(e))return e;const t=e.assignedSlot||e.parentNode||kt(e)&&e.host||Ht(e);return kt(t)?t.host:t}function Kt(e){const t=jt(e);return Ft(t)?e.ownerDocument?e.ownerDocument.body:e.body:St(t)&&At(t)?t:Kt(t)}function Jt(e,t,i){var l;void 0===t&&(t=[]),void 0===i&&(i=!0);const a=Kt(e),n=a===(null==(l=e.ownerDocument)?void 0:l.body),o=Vt(a);if(n){const e=Gt(o);return t.concat(o,o.visualViewport||[],At(a)?a:[],e&&i?Jt(e):[])}return t.concat(a,Jt(a,[],i))}function Gt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Yt(e){const t=Wt(e);let i=parseFloat(t.width)||0,l=parseFloat(t.height)||0;const a=St(e),n=a?e.offsetWidth:i,o=a?e.offsetHeight:l,r=Ye(i)!==n||Ye(l)!==o;return r&&(i=n,l=o),{width:i,height:l,$:r}}function Xt(e){return Bt(e)?e:e.contextElement}function Qt(e){const t=Xt(e);if(!St(t))return Qe(1);const i=t.getBoundingClientRect(),{width:l,height:a,$:n}=Yt(t);let o=(n?Ye(i.width):i.width)/l,r=(n?Ye(i.height):i.height)/a;return o&&Number.isFinite(o)||(o=1),r&&Number.isFinite(r)||(r=1),{x:o,y:r}}const ei=Qe(0);function ti(e){const t=Vt(e);return Nt()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:ei}function ii(e,t,i,l){void 0===t&&(t=!1),void 0===i&&(i=!1);const a=e.getBoundingClientRect(),n=Xt(e);let o=Qe(1);t&&(l?Bt(l)&&(o=Qt(l)):o=Qt(e));const r=function(e,t,i){return void 0===t&&(t=!1),!(!i||t&&i!==Vt(e))&&t}(n,i,l)?ti(n):Qe(0);let s=(a.left+r.x)/o.x,c=(a.top+r.y)/o.y,d=a.width/o.x,h=a.height/o.y;if(n){const e=Vt(n),t=l&&Bt(l)?Vt(l):l;let i=e,a=Gt(i);for(;a&&l&&t!==i;){const e=Qt(a),t=a.getBoundingClientRect(),l=Wt(a),n=t.left+(a.clientLeft+parseFloat(l.paddingLeft))*e.x,o=t.top+(a.clientTop+parseFloat(l.paddingTop))*e.y;s*=e.x,c*=e.y,d*=e.x,h*=e.y,s+=n,c+=o,i=Vt(a),a=Gt(i)}}return yt({width:d,height:h,x:s,y:c})}function li(e,t){const i=qt(e).scrollLeft;return t?t.left+i:ii(Ht(e)).left+i}function ai(e,t){const i=e.getBoundingClientRect();return{x:i.left+t.scrollLeft-li(e,i),y:i.top+t.scrollTop}}const ni=new Set(["absolute","fixed"]);function oi(e,t,i){let l;if("viewport"===t)l=function(e,t){const i=Vt(e),l=Ht(e),a=i.visualViewport;let n=l.clientWidth,o=l.clientHeight,r=0,s=0;if(a){n=a.width,o=a.height;const e=Nt();(!e||e&&"fixed"===t)&&(r=a.offsetLeft,s=a.offsetTop)}const c=li(l);if(c<=0){const e=l.ownerDocument,t=e.body,i=getComputedStyle(t),a="CSS1Compat"===e.compatMode&&parseFloat(i.marginLeft)+parseFloat(i.marginRight)||0,o=Math.abs(l.clientWidth-t.clientWidth-a);o<=25&&(n-=o)}else c<=25&&(n+=c);return{width:n,height:o,x:r,y:s}}(e,i);else if("document"===t)l=function(e){const t=Ht(e),i=qt(e),l=e.ownerDocument.body,a=Ge(t.scrollWidth,t.clientWidth,l.scrollWidth,l.clientWidth),n=Ge(t.scrollHeight,t.clientHeight,l.scrollHeight,l.clientHeight);let o=-i.scrollLeft+li(e);const r=-i.scrollTop;return"rtl"===Wt(l).direction&&(o+=Ge(t.clientWidth,l.clientWidth)-a),{width:a,height:n,x:o,y:r}}(Ht(e));else if(Bt(t))l=function(e,t){const i=ii(e,!0,"fixed"===t),l=i.top+e.clientTop,a=i.left+e.clientLeft,n=St(e)?Qt(e):Qe(1);return{width:e.clientWidth*n.x,height:e.clientHeight*n.y,x:a*n.x,y:l*n.y}}(t,i);else{const i=ti(e);l={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return yt(l)}function ri(e,t){const i=jt(e);return!(i===t||!Bt(i)||Ft(i))&&("fixed"===Wt(i).position||ri(i,t))}function si(e,t,i){const l=St(t),a=Ht(t),n="fixed"===i,o=ii(e,!0,n,t);let r={scrollLeft:0,scrollTop:0};const s=Qe(0);function c(){s.x=li(a)}if(l||!l&&!n)if(("body"!==_t(t)||At(a))&&(r=qt(t)),l){const e=ii(t,!0,n,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else a&&c();n&&!l&&a&&c();const d=!a||l||n?Qe(0):ai(a,r);return{x:o.left+r.scrollLeft-s.x-d.x,y:o.top+r.scrollTop-s.y-d.y,width:o.width,height:o.height}}function ci(e){return"static"===Wt(e).position}function di(e,t){if(!St(e)||"fixed"===Wt(e).position)return null;if(t)return t(e);let i=e.offsetParent;return Ht(e)===i&&(i=i.ownerDocument.body),i}function hi(e,t){const i=Vt(e);if(Tt(e))return i;if(!St(e)){let t=jt(e);for(;t&&!Ft(t);){if(Bt(t)&&!ci(t))return t;t=jt(t)}return i}let l=di(e,t);for(;l&&It(l)&&ci(l);)l=di(l,t);return l&&Ft(l)&&ci(l)&&!Dt(l)?i:l||function(e){let t=jt(e);for(;St(t)&&!Ft(t);){if(Dt(t))return t;if(Tt(t))return null;t=jt(t)}return null}(e)||i}const vi={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:i,offsetParent:l,strategy:a}=e;const n="fixed"===a,o=Ht(l),r=!!t&&Tt(t.floating);if(l===o||r&&n)return i;let s={scrollLeft:0,scrollTop:0},c=Qe(1);const d=Qe(0),h=St(l);if((h||!h&&!n)&&(("body"!==_t(l)||At(o))&&(s=qt(l)),St(l))){const e=ii(l);c=Qt(l),d.x=e.x+l.clientLeft,d.y=e.y+l.clientTop}const v=!o||h||n?Qe(0):ai(o,s);return{width:i.width*c.x,height:i.height*c.y,x:i.x*c.x-s.scrollLeft*c.x+d.x+v.x,y:i.y*c.y-s.scrollTop*c.y+d.y+v.y}},getDocumentElement:Ht,getClippingRect:function(e){let{element:t,boundary:i,rootBoundary:l,strategy:a}=e;const n=[..."clippingAncestors"===i?Tt(t)?[]:function(e,t){const i=t.get(e);if(i)return i;let l=Jt(e,[],!1).filter(e=>Bt(e)&&"body"!==_t(e)),a=null;const n="fixed"===Wt(e).position;let o=n?jt(e):e;for(;Bt(o)&&!Ft(o);){const t=Wt(o),i=Dt(o);i||"fixed"!==t.position||(a=null),(n?!i&&!a:!i&&"static"===t.position&&a&&ni.has(a.position)||At(o)&&!i&&ri(e,o))?l=l.filter(e=>e!==o):a=t,o=jt(o)}return t.set(e,l),l}(t,this._c):[].concat(i),l],o=n[0],r=n.reduce((e,i)=>{const l=oi(t,i,a);return e.top=Ge(l.top,e.top),e.right=Je(l.right,e.right),e.bottom=Je(l.bottom,e.bottom),e.left=Ge(l.left,e.left),e},oi(t,o,a));return{width:r.right-r.left,height:r.bottom-r.top,x:r.left,y:r.top}},getOffsetParent:hi,getElementRects:async function(e){const t=this.getOffsetParent||hi,i=this.getDimensions,l=await i(e.floating);return{reference:si(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:l.width,height:l.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:i}=Yt(e);return{width:t,height:i}},getScale:Qt,isElement:Bt,isRTL:function(e){return"rtl"===Wt(e).direction}};function ui(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function pi(e,t,i,l){void 0===l&&(l={});const{ancestorScroll:a=!0,ancestorResize:n=!0,elementResize:o="function"==typeof ResizeObserver,layoutShift:r="function"==typeof IntersectionObserver,animationFrame:s=!1}=l,c=Xt(e),d=a||n?[...c?Jt(c):[],...Jt(t)]:[];d.forEach(e=>{a&&e.addEventListener("scroll",i,{passive:!0}),n&&e.addEventListener("resize",i)});const h=c&&r?function(e,t){let i,l=null;const a=Ht(e);function n(){var e;clearTimeout(i),null==(e=l)||e.disconnect(),l=null}return function o(r,s){void 0===r&&(r=!1),void 0===s&&(s=1),n();const c=e.getBoundingClientRect(),{left:d,top:h,width:v,height:u}=c;if(r||t(),!v||!u)return;const p={rootMargin:-Xe(h)+"px "+-Xe(a.clientWidth-(d+v))+"px "+-Xe(a.clientHeight-(h+u))+"px "+-Xe(d)+"px",threshold:Ge(0,Je(1,s))||1};let g=!0;function w(t){const l=t[0].intersectionRatio;if(l!==s){if(!g)return o();l?o(!1,l):i=setTimeout(()=>{o(!1,1e-7)},1e3)}1!==l||ui(c,e.getBoundingClientRect())||o(),g=!1}try{l=new IntersectionObserver(w,{...p,root:a.ownerDocument})}catch(e){l=new IntersectionObserver(w,p)}l.observe(e)}(!0),n}(c,i):null;let v,u=-1,p=null;o&&(p=new ResizeObserver(e=>{let[l]=e;l&&l.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(u),u=requestAnimationFrame(()=>{var e;null==(e=p)||e.observe(t)})),i()}),c&&!s&&p.observe(c),p.observe(t));let g=s?ii(e):null;return s&&function t(){const l=ii(e);g&&!ui(g,l)&&i();g=l,v=requestAnimationFrame(t)}(),i(),()=>{var e;d.forEach(e=>{a&&e.removeEventListener("scroll",i),n&&e.removeEventListener("resize",i)}),null==h||h(),null==(e=p)||e.disconnect(),p=null,s&&cancelAnimationFrame(v)}}const gi=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var i,l;const{x:a,y:n,placement:o,middlewareData:r}=t,s=await async function(e,t){const{placement:i,platform:l,elements:a}=e,n=await(null==l.isRTL?void 0:l.isRTL(a.floating)),o=at(i),r=nt(i),s="y"===ct(i),c=bt.has(o)?-1:1,d=n&&s?-1:1,h=lt(t,e);let{mainAxis:v,crossAxis:u,alignmentAxis:p}="number"==typeof h?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return r&&"number"==typeof p&&(u="end"===r?-1*p:p),s?{x:u*d,y:v*c}:{x:v*c,y:u*d}}(t,e);return o===(null==(i=r.offset)?void 0:i.placement)&&null!=(l=r.arrow)&&l.alignmentOffset?{}:{x:a+s.x,y:n+s.y,data:{...s,placement:o}}}}},wi=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:i,y:l,placement:a}=t,{mainAxis:n=!0,crossAxis:o=!1,limiter:r={fn:e=>{let{x:t,y:i}=e;return{x:t,y:i}}},...s}=lt(e,t),c={x:i,y:l},d=await Ct(t,s),h=ct(at(a)),v=ot(h);let u=c[v],p=c[h];if(n){const e="y"===v?"bottom":"right";u=it(u+d["y"===v?"top":"left"],u,u-d[e])}if(o){const e="y"===h?"bottom":"right";p=it(p+d["y"===h?"top":"left"],p,p-d[e])}const g=r.fn({...t,[v]:u,[h]:p});return{...g,data:{x:g.x-i,y:g.y-l,enabled:{[v]:n,[h]:o}}}}}},fi=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var i,l;const{placement:a,middlewareData:n,rects:o,initialPlacement:r,platform:s,elements:c}=t,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:v,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...w}=lt(e,t);if(null!=(i=n.arrow)&&i.alignmentOffset)return{};const f=at(a),m=ct(r),x=at(r)===r,y=await(null==s.isRTL?void 0:s.isRTL(c.floating)),Z=v||(x||!g?[mt(r)]:function(e){const t=mt(e);return[vt(e),t,vt(t)]}(r)),C="none"!==p;!v&&C&&Z.push(...ft(r,g,p,y));const b=[r,...Z],M=await Ct(t,w),_=[];let V=(null==(l=n.flip)?void 0:l.overflows)||[];if(d&&_.push(M[f]),h){const e=ht(a,o,y);_.push(M[e[0]],M[e[1]])}if(V=[...V,{placement:a,overflows:_}],!_.every(e=>e<=0)){var H,$;const e=((null==(H=n.flip)?void 0:H.index)||0)+1,t=b[e];if(t){if(!("alignment"===h&&m!==ct(t))||V.every(e=>ct(e.placement)!==m||e.overflows[0]>0))return{data:{index:e,overflows:V},reset:{placement:t}}}let i=null==($=V.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:$.placement;if(!i)switch(u){case"bestFit":{var B;const e=null==(B=V.filter(e=>{if(C){const t=ct(e.placement);return t===m||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:B[0];e&&(i=e);break}case"initialPlacement":i=r}if(a!==i)return{reset:{placement:i}}}return{}}}},mi=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var i,l;const{placement:a,rects:n,platform:o,elements:r}=t,{apply:s=()=>{},...c}=lt(e,t),d=await Ct(t,c),h=at(a),v=nt(a),u="y"===ct(a),{width:p,height:g}=n.floating;let w,f;"top"===h||"bottom"===h?(w=h,f=v===(await(null==o.isRTL?void 0:o.isRTL(r.floating))?"start":"end")?"left":"right"):(f=h,w="end"===v?"top":"bottom");const m=g-d.top-d.bottom,x=p-d.left-d.right,y=Je(g-d[w],m),Z=Je(p-d[f],x),C=!t.middlewareData.shift;let b=y,M=Z;if(null!=(i=t.middlewareData.shift)&&i.enabled.x&&(M=x),null!=(l=t.middlewareData.shift)&&l.enabled.y&&(b=m),C&&!v){const e=Ge(d.left,0),t=Ge(d.right,0),i=Ge(d.top,0),l=Ge(d.bottom,0);u?M=p-2*(0!==e||0!==t?e+t:Ge(d.left,d.right)):b=g-2*(0!==i||0!==l?i+l:Ge(d.top,d.bottom))}await s({...t,availableWidth:M,availableHeight:b});const _=await o.getDimensions(r.floating);return p!==_.width||g!==_.height?{reset:{rects:!0}}:{}}}},xi=(e,t,i)=>{const l=new Map,a={platform:vi,...i},n={...a.platform,_c:l};return(async(e,t,i)=>{const{placement:l="bottom",strategy:a="absolute",middleware:n=[],platform:o}=i,r=n.filter(Boolean),s=await(null==o.isRTL?void 0:o.isRTL(t));let c=await o.getElementRects({reference:e,floating:t,strategy:a}),{x:d,y:h}=Zt(c,l,s),v=l,u={},p=0;for(let i=0;i<r.length;i++){const{name:n,fn:g}=r[i],{x:w,y:f,data:m,reset:x}=await g({x:d,y:h,initialPlacement:l,placement:v,strategy:a,middlewareData:u,rects:c,platform:o,elements:{reference:e,floating:t}});d=null!=w?w:d,h=null!=f?f:h,u={...u,[n]:{...u[n],...m}},x&&p<=50&&(p++,"object"==typeof x&&(x.placement&&(v=x.placement),x.rects&&(c=!0===x.rects?await o.getElementRects({reference:e,floating:t,strategy:a}):x.rects),({x:d,y:h}=Zt(c,v,s))),i=-1)}return{x:d,y:h,placement:v,strategy:a,middlewareData:u}})(e,t,{...a,platform:n})};var yi=r`:host([menuisopen]) .dropdown-menu{display:block}.dropdown-menu{background-clip:padding-box;background-color:var(--sgds-surface-default);border-radius:var(--sgds-border-radius-md);box-shadow:0 0 1px 0 hsla(0,0%,5%,.12),0 4px 8px 0 hsla(0,0%,5%,.12);color:var(--sgds-color-default);display:none;list-style:none;margin:0;max-height:var(--sgds-dimension-480);min-width:var(--sgds-dimension-280);overflow-y:auto;padding:var(--sgds-padding-xs) 0;position:absolute;text-align:left;z-index:1050}.nav-tabs .dropdown-menu{border-top-left-radius:0;border-top-right-radius:0;margin-top:calc(var(--sgds-nav-tabs-border-width)*-1)}@media (min-width:512px){.navbar-expand-sm .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:768px){.navbar-expand-md .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:1024px){.navbar-expand-lg .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:1280px){.navbar-expand-xl .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:1440px){.navbar-expand-xxl .navbar-nav .dropdown-menu{position:absolute}}.navbar-expand .navbar-nav .dropdown-menu{position:absolute}.sgds.navbar .dropdown-menu.megamenu{left:0;right:0;width:100%}.sgds.combobox>.dropdown-menu{min-width:100%}`,Zi=r`.invalid-feedback-container{display:flex;gap:var(--sgds-form-gap-sm)}.invalid-feedback,.invalid-feedback-container{color:var(--sgds-form-danger-color-default);line-height:var(--sgds-line-height-20)}.invalid-feedback{font-size:var(--sgds-font-size-14);font-weight:var(--sgds-font-weight-regular)}.valid-icon{color:var(--sgds-form-success-color-default)}`,Ci=r`.form-text{color:var(--sgds-form-color-subtle);font-size:var(--sgds-font-size-14);line-height:var(--sgds-line-height-20)}.form-text.disabled{opacity:var(--sgds-opacity-50)}`,bi=r`.form-control-container{display:flex;flex-direction:column;gap:var(--sgds-form-gap-md)}.form-control-group{align-items:center;background-color:var(--sgds-form-surface-default);border:var(--sgds-form-border-width-default) solid var(--sgds-border-color-default);border-radius:var(--input-border-radius,var(--sgds-form-border-radius-md));display:flex;gap:var(--sgds-form-gap-md);height:var(--sgds-dimension-48);justify-content:center;min-width:var(--sgds-dimension-256);padding:0 var(--sgds-form-padding-x);transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;width:-webkit-fill-available;width:-moz-available}.form-control{appearance:none;background-clip:padding-box;background:none;border:none;color:var(--sgds-form-color-default);display:block;flex-grow:1;font-size:var(--sgds-font-size-16);line-height:var(--sgds-line-height-24);outline:none;padding:0}.form-clearable{color:var(--sgds-color-subtle);cursor:pointer}@media (prefers-reduced-motion:reduce){.form-control-group{transition:none}}.form-control-group:not(.disabled):not(.is-invalid):not(.readonly):not(:focus-within):hover{outline:var(--sgds-form-border-width-thick) solid var(--sgds-border-color-emphasis);outline-offset:var(--sgds-form-outline-offset-focus)}.form-control-group:not(.disabled):not(.is-invalid):focus-within{outline:var(--sgds-form-outline-focus);outline-offset:var(--sgds-form-outline-offset-focus)}.form-control-container.disabled{opacity:var(--sgds-opacity-50)}.form-control-group.disabled{background-color:var(--sgds-form-surface-muted);cursor:not-allowed}.form-control-group.readonly{background-color:var(--sgds-form-surface-raised)}.form-control-group.is-invalid:not(.disabled){border:var(--sgds-form-border-width-default) solid var(--sgds-form-danger-border-color-default)}.form-control-group:not(.disabled).is-invalid:focus-within{outline:var(--sgds-border-width-2) solid var(--sgds-form-danger-color-default);outline-offset:var(--sgds-form-outline-offset-focus)}`;function Mi(e="",t=""){return`id-${Math.random().toString().substring(2,6)}-sgds-${e}-${t}`}class _i{constructor(e,t,i){(this.host=e).addController(this),this._internals=t,this.options=Object.assign({setInvalid:(e,t)=>{e.invalid=t},value:e=>e.value,input:e=>e.input},i)}hostConnected(){this.host.addEventListener("invalid",e=>this.handleInvalid(e))}hostDisconnected(){this.host.removeEventListener("invalid",e=>this.handleInvalid(e))}handleInvalid(e){e.preventDefault(),this.options.setInvalid(this.host,!0)}handleInput(e){const t=e.target;this.options.setInvalid(this.host,!1),this.validateInput(t)}handleChange(e){const t=e.target;this.validateInput(t),this.options.setInvalid(this.host,!this.checkValidity())}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}get willValidate(){return this._internals.willValidate}updateInvalidState(){this.options.setInvalid(this.host,!this.checkValidity())}resetValidity(){return this._internals.setValidity({})}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}setValidity(e,t,i){return this._internals.setValidity(e,t,i)}setFormValue(){const e=this.options.value(this.host);this._internals.setFormValue(e)}validateInput(e){if(this.options.input(this.host).disabled)return this._internals.setValidity({});const t=e.validity;if(t.valid)this._internals.setValidity({});else for(const i in t)t[i]&&(this.validationError=i.toString(),this._internals.setValidity({[this.validationError]:!0},e.validationMessage,e))}}const Vi=e=>{class i extends e{constructor(...e){var t;super(...e),this._isTouched=!1,this._internals=this.attachInternals(),null!==(t=this.inputValidationController)&&void 0!==t||(this.inputValidationController=new _i(this,this._internals))}async firstUpdated(e){super.firstUpdated(e),this.input=this.shadowRoot.querySelector("input")||await this.sgdsInput||this.shadowRoot.querySelector("textarea")||await this.sgdsDatepickerInput,this._mixinShouldSkipSgdsValidation()||(this._mixinSetFormValue(),this._mixinValidate(this.input))}formResetCallback(){this._mixinResetFormControl?this._mixinResetFormControl():(this.value=this.defaultValue,this._mixinResetValidity(this.input)),this._mixinSetFormValue()}_mixinHandleChange(e){this._mixinSetFormValue(),this.inputValidationController.handleChange(e)}_mixinHandleInputChange(e){this._mixinSetFormValue(),this.inputValidationController.handleInput(e)}_mixinResetValidity(e){this.inputValidationController.resetValidity(),this.inputValidationController.updateInvalidState(),this.inputValidationController.validateInput(e),this._isTouched&&(this._isTouched=!1)}_mixinValidate(e){this.inputValidationController.validateInput(e)}_mixinSetFormValue(){this.inputValidationController.setFormValue()}_mixinCheckValidity(){return this.inputValidationController.checkValidity()}_mixinReportValidity(){return this.inputValidationController.reportValidity()}_mixinGetValidity(){return this.inputValidationController.validity}_mixinGetValidationMessage(){return this.inputValidationController.validationMessage}_mixinSetValidity(e,t,i){return this.inputValidationController.setValidity(e,t,i)}_mixinShouldSkipSgdsValidation(){const e=this.closest("form");return(null==e?void 0:e.noValidate)||this.noValidate}}return t([ke("sgds-input")],i.prototype,"sgdsInput",void 0),t([ke("sgds-datepicker-input")],i.prototype,"sgdsDatepickerInput",void 0),i};var Hi=r`:host{-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);color:var(--sgds-body-color-default);font-family:var(--sgds-font-family-brand);font-size:var(--sgds-font-size-16);font-weight:var(--sgds-font-weight-regular);line-height:var(--sgds-line-height-24);margin:0;*,:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:disabled{cursor:not-allowed}@media (prefers-reduced-motion:no-preference){:root{scroll-behavior:smooth}}::slotted(a[target=_blank]):after,a[target=_blank]:after{background-color:currentColor;content:"/";display:inline-block;height:1em;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;vertical-align:top;width:1em}::slotted(svg){vertical-align:middle}}`;class $i extends Ze{emit(e,t){const i=new CustomEvent(e,Object.assign({bubbles:!0,cancelable:!1,composed:!0,detail:{}},t));return this.dispatchEvent(i),i}static define(e,t=this,i={}){if(customElements.get(e));else try{customElements.define(e,t,i)}catch(l){customElements.define(e,class extends t{},i)}}constructor(){super(),this.ssr=Boolean(this.shadowRoot),Object.entries(this.constructor.dependencies).forEach(([e,t])=>{this.constructor.define(e,t)})}firstUpdated(e){var t;super.firstUpdated(e),this.ssr&&(null===(t=this.shadowRoot)||void 0===t||t.querySelectorAll("slot").forEach(e=>{e.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1,cancelable:!1}))}))}}$i.styles=[Hi],$i.dependencies={},t([He({type:Boolean,reflect:!0})],$i.prototype,"ssr",void 0);class Bi extends $i{constructor(){super(...arguments),this.myDropdown=We(),this.dropdownMenuId=Mi("dropdown-menu","div"),this.noFlip=!1,this.menuAlignRight=!1,this.drop="down",this.floatingOpts={},this.menuIsOpen=!1,this.close="default",this.disabled=!1,this.readonly=!1,this.menuRef=We(),this._handleClickOutOfElement=e=>{this.menuIsOpen&&(e.composedPath().includes(this)||this.hideMenu(!0))}}connectedCallback(){super.connectedCallback(),"inside"!==this.close&&document.addEventListener("click",this._handleClickOutOfElement),this.addEventListener("keydown",this._handleKeyboardMenuEvent)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleClickOutOfElement),this.removeEventListener("keydown",this._handleKeyboardMenuEvent),this._cleanupAutoUpdate&&(this._cleanupAutoUpdate(),this._cleanupAutoUpdate=void 0)}firstUpdated(e){super.firstUpdated(e),this.menuIsOpen&&this.updateFloatingPosition()}async showMenu(){this.disabled||this.menuIsOpen||(this.menuIsOpen=!0,this.emit("sgds-show"),await this.updateFloatingPosition(),this.emit("sgds-after-show"),this.myDropdown.value&&this.menuRef.value&&(this._cleanupAutoUpdate=pi(this.myDropdown.value,this.menuRef.value,()=>this.updateFloatingPosition())))}hideMenu(e){this.menuIsOpen&&(this.emit("sgds-hide",{detail:{isOutside:e}}),this.menuIsOpen=!1,setTimeout(()=>this.emit("sgds-after-hide"),0),this._cleanupAutoUpdate&&(this._cleanupAutoUpdate(),this._cleanupAutoUpdate=void 0))}toggleMenu(){this.menuIsOpen?this.hideMenu():this.showMenu()}_handleKeyboardMenuEvent(e){if(!this.readonly)switch(e.key){case"ArrowDown":case"ArrowUp":e.preventDefault(),this.menuIsOpen||this.showMenu();break;case"Escape":this.hideMenu()}}mergeMiddleware(e,t){const i=e=>{var t;return(null==e?void 0:e.name)||(null===(t=null==e?void 0:e.constructor)||void 0===t?void 0:t.name)},l=t.map(i),a=e.map(e=>{const a=i(e),n=l.indexOf(a);return-1!==n?t[n]:e}).concat(t.filter(t=>!e.some(e=>i(e)===i(t))));return a}async updateFloatingPosition(){if(!this.myDropdown.value||!this.menuRef.value)return;let e="bottom-start";switch(this.drop){case"up":e=this.menuAlignRight?"top-end":"top-start";break;case"right":e="right-start";break;case"left":e="left-start";break;case"down":e=this.menuAlignRight?"bottom-end":"bottom-start";break;default:e="bottom-start"}const t=[gi(8),this.noFlip?void 0:fi(),wi()].filter(Boolean);let i=t;Array.isArray(this.floatingOpts.middleware)&&this.floatingOpts.middleware.length>0&&(i=this.mergeMiddleware(t,this.floatingOpts.middleware.filter(Boolean)));const l=Object.assign(Object.assign({strategy:"fixed",placement:e},this.floatingOpts),{middleware:i}),{x:a,y:n,strategy:o,placement:r}=await xi(this.myDropdown.value,this.menuRef.value,l);this.menuRef.value.setAttribute("data-placement",r),Object.assign(this.menuRef.value.style,{position:o,left:`${a}px`,top:`${n}px`})}}t([He({type:Boolean,state:!0})],Bi.prototype,"noFlip",void 0),t([He({type:Boolean,reflect:!0,state:!0})],Bi.prototype,"menuAlignRight",void 0),t([He({type:String,reflect:!0,state:!0})],Bi.prototype,"drop",void 0),t([He({type:Object})],Bi.prototype,"floatingOpts",void 0),t([He({type:Boolean,reflect:!0})],Bi.prototype,"menuIsOpen",void 0),t([He({type:Boolean,reflect:!0})],Bi.prototype,"disabled",void 0),t([He({type:Boolean,reflect:!0})],Bi.prototype,"readonly",void 0);class Si extends Bi{constructor(){super(...arguments),this.nextDropdownItemNo=0,this.prevDropdownItemNo=-1,this.hidden=!1}connectedCallback(){super.connectedCallback(),this.addEventListener("sgds-hide",this._resetMenu)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("sgds-hide",this._resetMenu)}firstUpdated(e){super.firstUpdated(e),this.addEventListener("keydown",this._handleKeyboardMenuItemsEvent)}handleSelectSlot(e){const t=this._getActiveMenuItems(),i=t.indexOf(e.target);this.nextDropdownItemNo=i+1,this.prevDropdownItemNo=i<=0?t.length-1:i-1;e.target.disabled||(this.emit("sgds-select"),"outside"!==this.close&&this.hideMenu())}_resetMenu(){this.nextDropdownItemNo=0,this.prevDropdownItemNo=-1;this._getMenuItems().forEach(e=>{var t;const i=null===(t=null==e?void 0:e.shadowRoot)||void 0===t?void 0:t.querySelector(".dropdown-item");i&&i.removeAttribute("tabindex")})}_handleKeyboardMenuItemsEvent(e){if(this.readonly)return;const t=this._getActiveMenuItems();if(0!==t.length)switch(e.key){case"ArrowDown":e.preventDefault(),this._setMenuItem(this.nextDropdownItemNo);break;case"ArrowUp":e.preventDefault(),this._setMenuItem(this.prevDropdownItemNo);break;case"Tab":if(!this.menuIsOpen)return;e.preventDefault(),e.shiftKey?this._setMenuItem(this.prevDropdownItemNo):this._setMenuItem(this.nextDropdownItemNo);break;case"Enter":t.includes(e.target)&&this.handleSelectSlot(e)}}_getMenuItems(){var e,t;if(this.shadowRoot.querySelector("slot#default")){return null===(e=this.shadowRoot.querySelector("slot#default"))||void 0===e?void 0:e.assignedElements({flatten:!0}).filter(e=>!e.classList.contains("empty-menu")&&!e.hasAttribute("hidden"))}if(null===(t=this.menu)||void 0===t?void 0:t.hasChildNodes()){return[...Array.from(this.menu.children)]}return[]}_getActiveMenuItems(){return this._getMenuItems().filter(e=>!e.disabled&&!e.hidden)}_setMenuItem(e){const t=this._getActiveMenuItems();if(0===t.length)return;const i=(e%t.length+t.length)%t.length,l=t[i];this.emit("i-sgds-option-focus",{detail:{option:l}}),this.nextDropdownItemNo=(i+1)%t.length,this.prevDropdownItemNo=(i-1+t.length)%t.length,t.forEach(e=>{const t=e.shadowRoot.querySelector(".dropdown-item");t.setAttribute("tabindex",e===l?"0":"-1"),e===l&&t.focus()})}}var ki,Li;Si.styles=Bi.styles,t([(ki="ul.dropdown-menu",(e,t,i)=>{const l=e=>{const i=e.renderRoot?.querySelector(ki)??null;if(null===i&&Li&&!e.hasUpdated){const e="object"==typeof t?t.name:t;Se("",`@query'd field ${JSON.stringify(String(e))} with the 'cache' flag set for selector '${ki}' has been accessed before the first update and returned null. This is expected if the renderRoot tree has not been provided beforehand (e.g. via Declarative Shadow DOM). Therefore the value hasn't been cached.`)}return i};if(Li){const{get:a,set:n}="object"==typeof t?e:i??(()=>{const e=Symbol(`${String(t)} (@query() cache)`);return{get(){return this[e]},set(t){this[e]=t}}})();return Be(e,t,{get(){let e=a.call(this);return void 0===e&&(e=l(this),(null!==e||this.hasUpdated)&&n.call(this,e)),e}})}return Be(e,t,{get(){return l(this)}})})],Si.prototype,"menu",void 0),t([$e()],Si.prototype,"nextDropdownItemNo",void 0),t([$e()],Si.prototype,"prevDropdownItemNo",void 0),t([He({type:Boolean,reflect:!0})],Si.prototype,"hidden",void 0);var Ai=r`.empty-menu,.loading-menu{padding:var(--sgds-padding-sm) var(--sgds-padding-lg,20px);pointer-events:none}.loading-menu{align-items:center;display:flex;gap:var(--sgds-gap-xs)}`;class Ei extends(Vi(Si)){constructor(){super(),this.label="",this.hintText="",this.autofocus=!1,this.disabled=!1,this.required=!1,this.loading=!1,this.value="",this.displayValue="",this.defaultValue="",this.hasFeedback=!1,this.invalidFeedback="",this.invalid=!1,this.menuList=[],this.selectedItems=[],this.filteredList=[],this._isTouched=!1,this._controlId=Mi("input"),this._labelId=Mi("label"),this.floatingOpts={middleware:[mi({apply({rects:e,elements:t}){t.floating.style.width=`${e.reference.width}px`}})]}}connectedCallback(){super.connectedCallback(),this.addEventListener("blur",async e=>{var t;const i=this.constructor.childName,l=(null===(t=e.relatedTarget)||void 0===t?void 0:t.tagName.toLowerCase())===i;this.invalid=!l&&!this._mixinReportValidity()})}reportValidity(){return this._mixinReportValidity()}checkValidity(){return this._mixinCheckValidity()}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}_renderFeedback(){return this.invalid&&this.hasFeedback?ee` <div class="invalid-feedback-container">
|
|
83
|
+
*/const We=()=>new qe;class qe{}const je=new WeakMap;const Ke=Ee(class extends Fe{render(e){return le}update(e,[t]){const i=t!==this._ref;return i&&void 0!==this._ref&&this._updateRefValue(void 0),(i||this._lastElementForRef!==this._element)&&(this._ref=t,this._context=e.options?.host,this._updateRefValue(this._element=e.element)),le}_updateRefValue(e){if(this.isConnected||(e=void 0),"function"==typeof this._ref){const t=this._context??globalThis;let i=je.get(t);void 0===i&&(i=new WeakMap,je.set(t,i)),void 0!==i.get(this._ref)&&this._ref.call(this._context,void 0),i.set(this._ref,e),void 0!==e&&this._ref.call(this._context,e)}else this._ref.value=e}get _lastElementForRef(){return"function"==typeof this._ref?je.get(this._context??globalThis)?.get(this._ref):this._ref?.value}disconnected(){this._lastElementForRef===this._element&&this._updateRefValue(void 0)}reconnected(){this._updateRefValue(this._element)}}),Je=Math.min,Ge=Math.max,Ye=Math.round,Xe=Math.floor,Qe=e=>({x:e,y:e}),et={left:"right",right:"left",bottom:"top",top:"bottom"},tt={start:"end",end:"start"};function it(e,t,i){return Ge(e,Je(t,i))}function lt(e,t){return"function"==typeof e?e(t):e}function at(e){return e.split("-")[0]}function nt(e){return e.split("-")[1]}function ot(e){return"x"===e?"y":"x"}function rt(e){return"y"===e?"height":"width"}const st=new Set(["top","bottom"]);function ct(e){return st.has(at(e))?"y":"x"}function dt(e){return ot(ct(e))}function ht(e,t,i){void 0===i&&(i=!1);const l=nt(e),a=dt(e),n=rt(a);let o="x"===a?l===(i?"end":"start")?"right":"left":"start"===l?"bottom":"top";return t.reference[n]>t.floating[n]&&(o=mt(o)),[o,mt(o)]}function vt(e){return e.replace(/start|end/g,e=>tt[e])}const ut=["left","right"],pt=["right","left"],gt=["top","bottom"],wt=["bottom","top"];function ft(e,t,i,l){const a=nt(e);let n=function(e,t,i){switch(e){case"top":case"bottom":return i?t?pt:ut:t?ut:pt;case"left":case"right":return t?gt:wt;default:return[]}}(at(e),"start"===i,l);return a&&(n=n.map(e=>e+"-"+a),t&&(n=n.concat(n.map(vt)))),n}function mt(e){return e.replace(/left|right|bottom|top/g,e=>et[e])}function xt(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function yt(e){const{x:t,y:i,width:l,height:a}=e;return{width:l,height:a,top:i,left:t,right:t+l,bottom:i+a,x:t,y:i}}function Zt(e,t,i){let{reference:l,floating:a}=e;const n=ct(t),o=dt(t),r=rt(o),s=at(t),c="y"===n,d=l.x+l.width/2-a.width/2,h=l.y+l.height/2-a.height/2,v=l[r]/2-a[r]/2;let u;switch(s){case"top":u={x:d,y:l.y-a.height};break;case"bottom":u={x:d,y:l.y+l.height};break;case"right":u={x:l.x+l.width,y:h};break;case"left":u={x:l.x-a.width,y:h};break;default:u={x:l.x,y:l.y}}switch(nt(t)){case"start":u[o]-=v*(i&&c?-1:1);break;case"end":u[o]+=v*(i&&c?-1:1)}return u}async function Ct(e,t){var i;void 0===t&&(t={});const{x:l,y:a,platform:n,rects:o,elements:r,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:v=!1,padding:u=0}=lt(t,e),p=xt(u),g=r[v?"floating"===h?"reference":"floating":h],w=yt(await n.getClippingRect({element:null==(i=await(null==n.isElement?void 0:n.isElement(g)))||i?g:g.contextElement||await(null==n.getDocumentElement?void 0:n.getDocumentElement(r.floating)),boundary:c,rootBoundary:d,strategy:s})),f="floating"===h?{x:l,y:a,width:o.floating.width,height:o.floating.height}:o.reference,m=await(null==n.getOffsetParent?void 0:n.getOffsetParent(r.floating)),x=await(null==n.isElement?void 0:n.isElement(m))&&await(null==n.getScale?void 0:n.getScale(m))||{x:1,y:1},y=yt(n.convertOffsetParentRelativeRectToViewportRelativeRect?await n.convertOffsetParentRelativeRectToViewportRelativeRect({elements:r,rect:f,offsetParent:m,strategy:s}):f);return{top:(w.top-y.top+p.top)/x.y,bottom:(y.bottom-w.bottom+p.bottom)/x.y,left:(w.left-y.left+p.left)/x.x,right:(y.right-w.right+p.right)/x.x}}const bt=new Set(["left","top"]);function Mt(){return"undefined"!=typeof window}function _t(e){return $t(e)?(e.nodeName||"").toLowerCase():"#document"}function Vt(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Ht(e){var t;return null==(t=($t(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function $t(e){return!!Mt()&&(e instanceof Node||e instanceof Vt(e).Node)}function Bt(e){return!!Mt()&&(e instanceof Element||e instanceof Vt(e).Element)}function St(e){return!!Mt()&&(e instanceof HTMLElement||e instanceof Vt(e).HTMLElement)}function kt(e){return!(!Mt()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Vt(e).ShadowRoot)}const Lt=new Set(["inline","contents"]);function At(e){const{overflow:t,overflowX:i,overflowY:l,display:a}=Wt(e);return/auto|scroll|overlay|hidden|clip/.test(t+l+i)&&!Lt.has(a)}const Et=new Set(["table","td","th"]);function It(e){return Et.has(_t(e))}const Pt=[":popover-open",":modal"];function Tt(e){return Pt.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const Rt=["transform","translate","scale","rotate","perspective"],Ot=["transform","translate","scale","rotate","perspective","filter"],zt=["paint","layout","strict","content"];function Dt(e){const t=Nt(),i=Bt(e)?Wt(e):e;return Rt.some(e=>!!i[e]&&"none"!==i[e])||!!i.containerType&&"normal"!==i.containerType||!t&&!!i.backdropFilter&&"none"!==i.backdropFilter||!t&&!!i.filter&&"none"!==i.filter||Ot.some(e=>(i.willChange||"").includes(e))||zt.some(e=>(i.contain||"").includes(e))}function Nt(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Ut=new Set(["html","body","#document"]);function Ft(e){return Ut.has(_t(e))}function Wt(e){return Vt(e).getComputedStyle(e)}function qt(e){return Bt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function jt(e){if("html"===_t(e))return e;const t=e.assignedSlot||e.parentNode||kt(e)&&e.host||Ht(e);return kt(t)?t.host:t}function Kt(e){const t=jt(e);return Ft(t)?e.ownerDocument?e.ownerDocument.body:e.body:St(t)&&At(t)?t:Kt(t)}function Jt(e,t,i){var l;void 0===t&&(t=[]),void 0===i&&(i=!0);const a=Kt(e),n=a===(null==(l=e.ownerDocument)?void 0:l.body),o=Vt(a);if(n){const e=Gt(o);return t.concat(o,o.visualViewport||[],At(a)?a:[],e&&i?Jt(e):[])}return t.concat(a,Jt(a,[],i))}function Gt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Yt(e){const t=Wt(e);let i=parseFloat(t.width)||0,l=parseFloat(t.height)||0;const a=St(e),n=a?e.offsetWidth:i,o=a?e.offsetHeight:l,r=Ye(i)!==n||Ye(l)!==o;return r&&(i=n,l=o),{width:i,height:l,$:r}}function Xt(e){return Bt(e)?e:e.contextElement}function Qt(e){const t=Xt(e);if(!St(t))return Qe(1);const i=t.getBoundingClientRect(),{width:l,height:a,$:n}=Yt(t);let o=(n?Ye(i.width):i.width)/l,r=(n?Ye(i.height):i.height)/a;return o&&Number.isFinite(o)||(o=1),r&&Number.isFinite(r)||(r=1),{x:o,y:r}}const ei=Qe(0);function ti(e){const t=Vt(e);return Nt()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:ei}function ii(e,t,i,l){void 0===t&&(t=!1),void 0===i&&(i=!1);const a=e.getBoundingClientRect(),n=Xt(e);let o=Qe(1);t&&(l?Bt(l)&&(o=Qt(l)):o=Qt(e));const r=function(e,t,i){return void 0===t&&(t=!1),!(!i||t&&i!==Vt(e))&&t}(n,i,l)?ti(n):Qe(0);let s=(a.left+r.x)/o.x,c=(a.top+r.y)/o.y,d=a.width/o.x,h=a.height/o.y;if(n){const e=Vt(n),t=l&&Bt(l)?Vt(l):l;let i=e,a=Gt(i);for(;a&&l&&t!==i;){const e=Qt(a),t=a.getBoundingClientRect(),l=Wt(a),n=t.left+(a.clientLeft+parseFloat(l.paddingLeft))*e.x,o=t.top+(a.clientTop+parseFloat(l.paddingTop))*e.y;s*=e.x,c*=e.y,d*=e.x,h*=e.y,s+=n,c+=o,i=Vt(a),a=Gt(i)}}return yt({width:d,height:h,x:s,y:c})}function li(e,t){const i=qt(e).scrollLeft;return t?t.left+i:ii(Ht(e)).left+i}function ai(e,t){const i=e.getBoundingClientRect();return{x:i.left+t.scrollLeft-li(e,i),y:i.top+t.scrollTop}}const ni=new Set(["absolute","fixed"]);function oi(e,t,i){let l;if("viewport"===t)l=function(e,t){const i=Vt(e),l=Ht(e),a=i.visualViewport;let n=l.clientWidth,o=l.clientHeight,r=0,s=0;if(a){n=a.width,o=a.height;const e=Nt();(!e||e&&"fixed"===t)&&(r=a.offsetLeft,s=a.offsetTop)}const c=li(l);if(c<=0){const e=l.ownerDocument,t=e.body,i=getComputedStyle(t),a="CSS1Compat"===e.compatMode&&parseFloat(i.marginLeft)+parseFloat(i.marginRight)||0,o=Math.abs(l.clientWidth-t.clientWidth-a);o<=25&&(n-=o)}else c<=25&&(n+=c);return{width:n,height:o,x:r,y:s}}(e,i);else if("document"===t)l=function(e){const t=Ht(e),i=qt(e),l=e.ownerDocument.body,a=Ge(t.scrollWidth,t.clientWidth,l.scrollWidth,l.clientWidth),n=Ge(t.scrollHeight,t.clientHeight,l.scrollHeight,l.clientHeight);let o=-i.scrollLeft+li(e);const r=-i.scrollTop;return"rtl"===Wt(l).direction&&(o+=Ge(t.clientWidth,l.clientWidth)-a),{width:a,height:n,x:o,y:r}}(Ht(e));else if(Bt(t))l=function(e,t){const i=ii(e,!0,"fixed"===t),l=i.top+e.clientTop,a=i.left+e.clientLeft,n=St(e)?Qt(e):Qe(1);return{width:e.clientWidth*n.x,height:e.clientHeight*n.y,x:a*n.x,y:l*n.y}}(t,i);else{const i=ti(e);l={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return yt(l)}function ri(e,t){const i=jt(e);return!(i===t||!Bt(i)||Ft(i))&&("fixed"===Wt(i).position||ri(i,t))}function si(e,t,i){const l=St(t),a=Ht(t),n="fixed"===i,o=ii(e,!0,n,t);let r={scrollLeft:0,scrollTop:0};const s=Qe(0);function c(){s.x=li(a)}if(l||!l&&!n)if(("body"!==_t(t)||At(a))&&(r=qt(t)),l){const e=ii(t,!0,n,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else a&&c();n&&!l&&a&&c();const d=!a||l||n?Qe(0):ai(a,r);return{x:o.left+r.scrollLeft-s.x-d.x,y:o.top+r.scrollTop-s.y-d.y,width:o.width,height:o.height}}function ci(e){return"static"===Wt(e).position}function di(e,t){if(!St(e)||"fixed"===Wt(e).position)return null;if(t)return t(e);let i=e.offsetParent;return Ht(e)===i&&(i=i.ownerDocument.body),i}function hi(e,t){const i=Vt(e);if(Tt(e))return i;if(!St(e)){let t=jt(e);for(;t&&!Ft(t);){if(Bt(t)&&!ci(t))return t;t=jt(t)}return i}let l=di(e,t);for(;l&&It(l)&&ci(l);)l=di(l,t);return l&&Ft(l)&&ci(l)&&!Dt(l)?i:l||function(e){let t=jt(e);for(;St(t)&&!Ft(t);){if(Dt(t))return t;if(Tt(t))return null;t=jt(t)}return null}(e)||i}const vi={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:i,offsetParent:l,strategy:a}=e;const n="fixed"===a,o=Ht(l),r=!!t&&Tt(t.floating);if(l===o||r&&n)return i;let s={scrollLeft:0,scrollTop:0},c=Qe(1);const d=Qe(0),h=St(l);if((h||!h&&!n)&&(("body"!==_t(l)||At(o))&&(s=qt(l)),St(l))){const e=ii(l);c=Qt(l),d.x=e.x+l.clientLeft,d.y=e.y+l.clientTop}const v=!o||h||n?Qe(0):ai(o,s);return{width:i.width*c.x,height:i.height*c.y,x:i.x*c.x-s.scrollLeft*c.x+d.x+v.x,y:i.y*c.y-s.scrollTop*c.y+d.y+v.y}},getDocumentElement:Ht,getClippingRect:function(e){let{element:t,boundary:i,rootBoundary:l,strategy:a}=e;const n=[..."clippingAncestors"===i?Tt(t)?[]:function(e,t){const i=t.get(e);if(i)return i;let l=Jt(e,[],!1).filter(e=>Bt(e)&&"body"!==_t(e)),a=null;const n="fixed"===Wt(e).position;let o=n?jt(e):e;for(;Bt(o)&&!Ft(o);){const t=Wt(o),i=Dt(o);i||"fixed"!==t.position||(a=null),(n?!i&&!a:!i&&"static"===t.position&&a&&ni.has(a.position)||At(o)&&!i&&ri(e,o))?l=l.filter(e=>e!==o):a=t,o=jt(o)}return t.set(e,l),l}(t,this._c):[].concat(i),l],o=n[0],r=n.reduce((e,i)=>{const l=oi(t,i,a);return e.top=Ge(l.top,e.top),e.right=Je(l.right,e.right),e.bottom=Je(l.bottom,e.bottom),e.left=Ge(l.left,e.left),e},oi(t,o,a));return{width:r.right-r.left,height:r.bottom-r.top,x:r.left,y:r.top}},getOffsetParent:hi,getElementRects:async function(e){const t=this.getOffsetParent||hi,i=this.getDimensions,l=await i(e.floating);return{reference:si(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:l.width,height:l.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:i}=Yt(e);return{width:t,height:i}},getScale:Qt,isElement:Bt,isRTL:function(e){return"rtl"===Wt(e).direction}};function ui(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function pi(e,t,i,l){void 0===l&&(l={});const{ancestorScroll:a=!0,ancestorResize:n=!0,elementResize:o="function"==typeof ResizeObserver,layoutShift:r="function"==typeof IntersectionObserver,animationFrame:s=!1}=l,c=Xt(e),d=a||n?[...c?Jt(c):[],...Jt(t)]:[];d.forEach(e=>{a&&e.addEventListener("scroll",i,{passive:!0}),n&&e.addEventListener("resize",i)});const h=c&&r?function(e,t){let i,l=null;const a=Ht(e);function n(){var e;clearTimeout(i),null==(e=l)||e.disconnect(),l=null}return function o(r,s){void 0===r&&(r=!1),void 0===s&&(s=1),n();const c=e.getBoundingClientRect(),{left:d,top:h,width:v,height:u}=c;if(r||t(),!v||!u)return;const p={rootMargin:-Xe(h)+"px "+-Xe(a.clientWidth-(d+v))+"px "+-Xe(a.clientHeight-(h+u))+"px "+-Xe(d)+"px",threshold:Ge(0,Je(1,s))||1};let g=!0;function w(t){const l=t[0].intersectionRatio;if(l!==s){if(!g)return o();l?o(!1,l):i=setTimeout(()=>{o(!1,1e-7)},1e3)}1!==l||ui(c,e.getBoundingClientRect())||o(),g=!1}try{l=new IntersectionObserver(w,{...p,root:a.ownerDocument})}catch(e){l=new IntersectionObserver(w,p)}l.observe(e)}(!0),n}(c,i):null;let v,u=-1,p=null;o&&(p=new ResizeObserver(e=>{let[l]=e;l&&l.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(u),u=requestAnimationFrame(()=>{var e;null==(e=p)||e.observe(t)})),i()}),c&&!s&&p.observe(c),p.observe(t));let g=s?ii(e):null;return s&&function t(){const l=ii(e);g&&!ui(g,l)&&i();g=l,v=requestAnimationFrame(t)}(),i(),()=>{var e;d.forEach(e=>{a&&e.removeEventListener("scroll",i),n&&e.removeEventListener("resize",i)}),null==h||h(),null==(e=p)||e.disconnect(),p=null,s&&cancelAnimationFrame(v)}}const gi=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var i,l;const{x:a,y:n,placement:o,middlewareData:r}=t,s=await async function(e,t){const{placement:i,platform:l,elements:a}=e,n=await(null==l.isRTL?void 0:l.isRTL(a.floating)),o=at(i),r=nt(i),s="y"===ct(i),c=bt.has(o)?-1:1,d=n&&s?-1:1,h=lt(t,e);let{mainAxis:v,crossAxis:u,alignmentAxis:p}="number"==typeof h?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return r&&"number"==typeof p&&(u="end"===r?-1*p:p),s?{x:u*d,y:v*c}:{x:v*c,y:u*d}}(t,e);return o===(null==(i=r.offset)?void 0:i.placement)&&null!=(l=r.arrow)&&l.alignmentOffset?{}:{x:a+s.x,y:n+s.y,data:{...s,placement:o}}}}},wi=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:i,y:l,placement:a}=t,{mainAxis:n=!0,crossAxis:o=!1,limiter:r={fn:e=>{let{x:t,y:i}=e;return{x:t,y:i}}},...s}=lt(e,t),c={x:i,y:l},d=await Ct(t,s),h=ct(at(a)),v=ot(h);let u=c[v],p=c[h];if(n){const e="y"===v?"bottom":"right";u=it(u+d["y"===v?"top":"left"],u,u-d[e])}if(o){const e="y"===h?"bottom":"right";p=it(p+d["y"===h?"top":"left"],p,p-d[e])}const g=r.fn({...t,[v]:u,[h]:p});return{...g,data:{x:g.x-i,y:g.y-l,enabled:{[v]:n,[h]:o}}}}}},fi=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var i,l;const{placement:a,middlewareData:n,rects:o,initialPlacement:r,platform:s,elements:c}=t,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:v,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...w}=lt(e,t);if(null!=(i=n.arrow)&&i.alignmentOffset)return{};const f=at(a),m=ct(r),x=at(r)===r,y=await(null==s.isRTL?void 0:s.isRTL(c.floating)),Z=v||(x||!g?[mt(r)]:function(e){const t=mt(e);return[vt(e),t,vt(t)]}(r)),C="none"!==p;!v&&C&&Z.push(...ft(r,g,p,y));const b=[r,...Z],M=await Ct(t,w),_=[];let V=(null==(l=n.flip)?void 0:l.overflows)||[];if(d&&_.push(M[f]),h){const e=ht(a,o,y);_.push(M[e[0]],M[e[1]])}if(V=[...V,{placement:a,overflows:_}],!_.every(e=>e<=0)){var H,$;const e=((null==(H=n.flip)?void 0:H.index)||0)+1,t=b[e];if(t){if(!("alignment"===h&&m!==ct(t))||V.every(e=>ct(e.placement)!==m||e.overflows[0]>0))return{data:{index:e,overflows:V},reset:{placement:t}}}let i=null==($=V.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:$.placement;if(!i)switch(u){case"bestFit":{var B;const e=null==(B=V.filter(e=>{if(C){const t=ct(e.placement);return t===m||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:B[0];e&&(i=e);break}case"initialPlacement":i=r}if(a!==i)return{reset:{placement:i}}}return{}}}},mi=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var i,l;const{placement:a,rects:n,platform:o,elements:r}=t,{apply:s=()=>{},...c}=lt(e,t),d=await Ct(t,c),h=at(a),v=nt(a),u="y"===ct(a),{width:p,height:g}=n.floating;let w,f;"top"===h||"bottom"===h?(w=h,f=v===(await(null==o.isRTL?void 0:o.isRTL(r.floating))?"start":"end")?"left":"right"):(f=h,w="end"===v?"top":"bottom");const m=g-d.top-d.bottom,x=p-d.left-d.right,y=Je(g-d[w],m),Z=Je(p-d[f],x),C=!t.middlewareData.shift;let b=y,M=Z;if(null!=(i=t.middlewareData.shift)&&i.enabled.x&&(M=x),null!=(l=t.middlewareData.shift)&&l.enabled.y&&(b=m),C&&!v){const e=Ge(d.left,0),t=Ge(d.right,0),i=Ge(d.top,0),l=Ge(d.bottom,0);u?M=p-2*(0!==e||0!==t?e+t:Ge(d.left,d.right)):b=g-2*(0!==i||0!==l?i+l:Ge(d.top,d.bottom))}await s({...t,availableWidth:M,availableHeight:b});const _=await o.getDimensions(r.floating);return p!==_.width||g!==_.height?{reset:{rects:!0}}:{}}}},xi=(e,t,i)=>{const l=new Map,a={platform:vi,...i},n={...a.platform,_c:l};return(async(e,t,i)=>{const{placement:l="bottom",strategy:a="absolute",middleware:n=[],platform:o}=i,r=n.filter(Boolean),s=await(null==o.isRTL?void 0:o.isRTL(t));let c=await o.getElementRects({reference:e,floating:t,strategy:a}),{x:d,y:h}=Zt(c,l,s),v=l,u={},p=0;for(let i=0;i<r.length;i++){const{name:n,fn:g}=r[i],{x:w,y:f,data:m,reset:x}=await g({x:d,y:h,initialPlacement:l,placement:v,strategy:a,middlewareData:u,rects:c,platform:o,elements:{reference:e,floating:t}});d=null!=w?w:d,h=null!=f?f:h,u={...u,[n]:{...u[n],...m}},x&&p<=50&&(p++,"object"==typeof x&&(x.placement&&(v=x.placement),x.rects&&(c=!0===x.rects?await o.getElementRects({reference:e,floating:t,strategy:a}):x.rects),({x:d,y:h}=Zt(c,v,s))),i=-1)}return{x:d,y:h,placement:v,strategy:a,middlewareData:u}})(e,t,{...a,platform:n})};var yi=r`:host([menuisopen]) .dropdown-menu{display:block}.dropdown-menu{background-clip:padding-box;background-color:var(--sgds-surface-default);border-radius:var(--sgds-border-radius-md);box-shadow:0 0 1px 0 hsla(0,0%,5%,.12),0 4px 8px 0 hsla(0,0%,5%,.12);color:var(--sgds-color-default);display:none;list-style:none;margin:0;max-height:var(--sgds-dimension-480);min-width:var(--sgds-dimension-280);overflow-y:auto;padding:var(--sgds-padding-xs) 0;position:absolute;text-align:left;z-index:1050}.nav-tabs .dropdown-menu{border-top-left-radius:0;border-top-right-radius:0;margin-top:calc(var(--sgds-nav-tabs-border-width)*-1)}@media (min-width:512px){.navbar-expand-sm .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:768px){.navbar-expand-md .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:1024px){.navbar-expand-lg .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:1280px){.navbar-expand-xl .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:1440px){.navbar-expand-xxl .navbar-nav .dropdown-menu{position:absolute}}.navbar-expand .navbar-nav .dropdown-menu{position:absolute}.sgds.navbar .dropdown-menu.megamenu{left:0;right:0;width:100%}.sgds.combobox>.dropdown-menu{min-width:100%}`,Zi=r`.invalid-feedback-container{display:flex;gap:var(--sgds-form-gap-sm)}.invalid-feedback,.invalid-feedback-container{color:var(--sgds-form-danger-color-default);line-height:var(--sgds-line-height-20)}.invalid-feedback{font-size:var(--sgds-font-size-14);font-weight:var(--sgds-font-weight-regular)}.valid-icon{color:var(--sgds-form-success-color-default)}`,Ci=r`.form-text{color:var(--sgds-form-color-subtle);font-size:var(--sgds-font-size-14);line-height:var(--sgds-line-height-20)}.form-text.disabled{opacity:var(--sgds-opacity-50)}`,bi=r`.form-control-container{display:flex;flex-direction:column;gap:var(--sgds-form-gap-md)}.form-control-group{align-items:center;background-color:var(--sgds-form-surface-default);border:var(--sgds-form-border-width-default) solid var(--sgds-border-color-default);border-radius:var(--input-border-radius,var(--sgds-form-border-radius-md));display:flex;gap:var(--sgds-form-gap-md);height:var(--sgds-dimension-48);justify-content:center;min-width:var(--sgds-dimension-256);padding:0 var(--sgds-form-padding-x);transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;width:-webkit-fill-available;width:-moz-available}.form-control{appearance:none;background-clip:padding-box;background:none;border:none;color:var(--sgds-form-color-default);display:block;flex-grow:1;font-size:var(--sgds-font-size-16);line-height:var(--sgds-line-height-24);outline:none;padding:0}.form-clearable{color:var(--sgds-color-subtle);cursor:pointer}@media (prefers-reduced-motion:reduce){.form-control-group{transition:none}}.form-control-group:not(.disabled):not(.is-invalid):not(.readonly):not(:focus-within):hover{outline:var(--sgds-form-border-width-thick) solid var(--sgds-border-color-emphasis);outline-offset:var(--sgds-form-outline-offset-focus)}.form-control-group:not(.disabled):not(.is-invalid):focus-within{outline:var(--sgds-form-outline-focus);outline-offset:var(--sgds-form-outline-offset-focus)}.form-control-container.disabled{opacity:var(--sgds-opacity-50)}.form-control-group.disabled{background-color:var(--sgds-form-surface-muted);cursor:not-allowed}.form-control-group.readonly{background-color:var(--sgds-form-surface-raised)}.form-control-group.is-invalid:not(.disabled){border:var(--sgds-form-border-width-default) solid var(--sgds-form-danger-border-color-default)}.form-control-group:not(.disabled).is-invalid:focus-within{outline:var(--sgds-border-width-2) solid var(--sgds-form-danger-color-default);outline-offset:var(--sgds-form-outline-offset-focus)}`;function Mi(e="",t=""){return`id-${Math.random().toString().substring(2,6)}-sgds-${e}-${t}`}class _i{constructor(e,t){(this.host=e).addController(this),this._internals=this.host.attachInternals(),this.options=Object.assign({setInvalid:(e,t)=>{e.invalid=t},value:e=>e.value,input:e=>e.input},t)}hostConnected(){this.host.addEventListener("invalid",e=>this.handleInvalid(e))}hostDisconnected(){this.host.removeEventListener("invalid",e=>this.handleInvalid(e))}handleInvalid(e){e.preventDefault(),this.options.setInvalid(this.host,!0)}handleInput(e){const t=e.target;this.options.setInvalid(this.host,!1),this.validateInput(t)}handleChange(e){const t=e.target;this.validateInput(t),this.options.setInvalid(this.host,!this.checkValidity())}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}get willValidate(){return this._internals.willValidate}updateInvalidState(){this.options.setInvalid(this.host,!this.checkValidity())}resetValidity(){return this._internals.setValidity({})}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}setValidity(e,t,i){return this._internals.setValidity(e,t,i)}setFormValue(){const e=this.options.value(this.host);this._internals.setFormValue(e)}validateInput(e){if(this.options.input(this.host).disabled)return this._internals.setValidity({});const t=e.validity;if(t.valid)this._internals.setValidity({});else for(const i in t)t[i]&&(this.validationError=i.toString(),this._internals.setValidity({[this.validationError]:!0},e.validationMessage,e))}}const Vi=e=>{class i extends e{constructor(){super(...arguments),this._isTouched=!1}connectedCallback(){var e;super.connectedCallback(),this._mixinShouldSkipSgdsValidation()||null!==(e=this.inputValidationController)&&void 0!==e||(this.inputValidationController=new _i(this))}async firstUpdated(e){super.firstUpdated(e),this.input=this.shadowRoot.querySelector("input")||await this.sgdsInput||this.shadowRoot.querySelector("textarea")||await this.sgdsDatepickerInput,this._mixinShouldSkipSgdsValidation()||(this._mixinSetFormValue(),this._mixinValidate(this.input))}formResetCallback(){this._mixinResetFormControl?this._mixinResetFormControl():(this.value=this.defaultValue,this._mixinResetValidity(this.input)),this._mixinSetFormValue()}_mixinHandleChange(e){this._mixinSetFormValue(),this.inputValidationController.handleChange(e)}_mixinHandleInputChange(e){this._mixinSetFormValue(),this.inputValidationController.handleInput(e)}_mixinResetValidity(e){this.inputValidationController.resetValidity(),this.inputValidationController.updateInvalidState(),this.inputValidationController.validateInput(e),this._isTouched&&(this._isTouched=!1)}_mixinValidate(e){this.inputValidationController.validateInput(e)}_mixinSetFormValue(){this.inputValidationController.setFormValue()}_mixinCheckValidity(){return this.inputValidationController.checkValidity()}_mixinReportValidity(){return this.inputValidationController.reportValidity()}_mixinGetValidity(){return this.inputValidationController.validity}_mixinGetValidationMessage(){return this.inputValidationController.validationMessage}_mixinSetValidity(e,t,i){return this.inputValidationController.setValidity(e,t,i)}_mixinShouldSkipSgdsValidation(){const e=this.closest("form");return(null==e?void 0:e.noValidate)||this.noValidate}}return i.formAssociated=!0,t([ke("sgds-input")],i.prototype,"sgdsInput",void 0),t([ke("sgds-datepicker-input")],i.prototype,"sgdsDatepickerInput",void 0),i};var Hi=r`:host{-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);color:var(--sgds-body-color-default);font-family:var(--sgds-font-family-brand);font-size:var(--sgds-font-size-16);font-weight:var(--sgds-font-weight-regular);line-height:var(--sgds-line-height-24);margin:0;*,:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:disabled{cursor:not-allowed}@media (prefers-reduced-motion:no-preference){:root{scroll-behavior:smooth}}::slotted(a[target=_blank]):after,a[target=_blank]:after{background-color:currentColor;content:"/";display:inline-block;height:1em;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;vertical-align:top;width:1em}::slotted(svg){vertical-align:middle}}`;class $i extends Ze{emit(e,t){const i=new CustomEvent(e,Object.assign({bubbles:!0,cancelable:!1,composed:!0,detail:{}},t));return this.dispatchEvent(i),i}static define(e,t=this,i={}){if(customElements.get(e));else try{customElements.define(e,t,i)}catch(l){customElements.define(e,class extends t{},i)}}constructor(){super(),this.ssr=Boolean(this.shadowRoot),Object.entries(this.constructor.dependencies).forEach(([e,t])=>{this.constructor.define(e,t)})}firstUpdated(e){var t;super.firstUpdated(e),this.ssr&&(null===(t=this.shadowRoot)||void 0===t||t.querySelectorAll("slot").forEach(e=>{e.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1,cancelable:!1}))}))}}$i.styles=[Hi],$i.dependencies={},t([He({type:Boolean,reflect:!0})],$i.prototype,"ssr",void 0);class Bi extends $i{constructor(){super(...arguments),this.myDropdown=We(),this.dropdownMenuId=Mi("dropdown-menu","div"),this.noFlip=!1,this.menuAlignRight=!1,this.drop="down",this.floatingOpts={},this.menuIsOpen=!1,this.close="default",this.disabled=!1,this.readonly=!1,this.menuRef=We(),this._handleClickOutOfElement=e=>{this.menuIsOpen&&(e.composedPath().includes(this)||this.hideMenu(!0))}}connectedCallback(){super.connectedCallback(),"inside"!==this.close&&document.addEventListener("click",this._handleClickOutOfElement),this.addEventListener("keydown",this._handleKeyboardMenuEvent)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleClickOutOfElement),this.removeEventListener("keydown",this._handleKeyboardMenuEvent),this._cleanupAutoUpdate&&(this._cleanupAutoUpdate(),this._cleanupAutoUpdate=void 0)}firstUpdated(e){super.firstUpdated(e),this.menuIsOpen&&this.updateFloatingPosition()}async showMenu(){this.disabled||this.menuIsOpen||(this.menuIsOpen=!0,this.emit("sgds-show"),await this.updateFloatingPosition(),this.emit("sgds-after-show"),this.myDropdown.value&&this.menuRef.value&&(this._cleanupAutoUpdate=pi(this.myDropdown.value,this.menuRef.value,()=>this.updateFloatingPosition())))}hideMenu(e){this.menuIsOpen&&(this.emit("sgds-hide",{detail:{isOutside:e}}),this.menuIsOpen=!1,setTimeout(()=>this.emit("sgds-after-hide"),0),this._cleanupAutoUpdate&&(this._cleanupAutoUpdate(),this._cleanupAutoUpdate=void 0))}toggleMenu(){this.menuIsOpen?this.hideMenu():this.showMenu()}_handleKeyboardMenuEvent(e){if(!this.readonly)switch(e.key){case"ArrowDown":case"ArrowUp":e.preventDefault(),this.menuIsOpen||this.showMenu();break;case"Escape":this.hideMenu()}}mergeMiddleware(e,t){const i=e=>{var t;return(null==e?void 0:e.name)||(null===(t=null==e?void 0:e.constructor)||void 0===t?void 0:t.name)},l=t.map(i),a=e.map(e=>{const a=i(e),n=l.indexOf(a);return-1!==n?t[n]:e}).concat(t.filter(t=>!e.some(e=>i(e)===i(t))));return a}async updateFloatingPosition(){if(!this.myDropdown.value||!this.menuRef.value)return;let e="bottom-start";switch(this.drop){case"up":e=this.menuAlignRight?"top-end":"top-start";break;case"right":e="right-start";break;case"left":e="left-start";break;case"down":e=this.menuAlignRight?"bottom-end":"bottom-start";break;default:e="bottom-start"}const t=[gi(8),this.noFlip?void 0:fi(),wi()].filter(Boolean);let i=t;Array.isArray(this.floatingOpts.middleware)&&this.floatingOpts.middleware.length>0&&(i=this.mergeMiddleware(t,this.floatingOpts.middleware.filter(Boolean)));const l=Object.assign(Object.assign({strategy:"fixed",placement:e},this.floatingOpts),{middleware:i}),{x:a,y:n,strategy:o,placement:r}=await xi(this.myDropdown.value,this.menuRef.value,l);this.menuRef.value.setAttribute("data-placement",r),Object.assign(this.menuRef.value.style,{position:o,left:`${a}px`,top:`${n}px`})}}t([He({type:Boolean,state:!0})],Bi.prototype,"noFlip",void 0),t([He({type:Boolean,reflect:!0,state:!0})],Bi.prototype,"menuAlignRight",void 0),t([He({type:String,reflect:!0,state:!0})],Bi.prototype,"drop",void 0),t([He({type:Object})],Bi.prototype,"floatingOpts",void 0),t([He({type:Boolean,reflect:!0})],Bi.prototype,"menuIsOpen",void 0),t([He({type:Boolean,reflect:!0})],Bi.prototype,"disabled",void 0),t([He({type:Boolean,reflect:!0})],Bi.prototype,"readonly",void 0);class Si extends Bi{constructor(){super(...arguments),this.nextDropdownItemNo=0,this.prevDropdownItemNo=-1,this.hidden=!1}connectedCallback(){super.connectedCallback(),this.addEventListener("sgds-hide",this._resetMenu)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("sgds-hide",this._resetMenu)}firstUpdated(e){super.firstUpdated(e),this.addEventListener("keydown",this._handleKeyboardMenuItemsEvent)}handleSelectSlot(e){const t=this._getActiveMenuItems(),i=t.indexOf(e.target);this.nextDropdownItemNo=i+1,this.prevDropdownItemNo=i<=0?t.length-1:i-1;e.target.disabled||(this.emit("sgds-select"),"outside"!==this.close&&this.hideMenu())}_resetMenu(){this.nextDropdownItemNo=0,this.prevDropdownItemNo=-1;this._getMenuItems().forEach(e=>{var t;const i=null===(t=null==e?void 0:e.shadowRoot)||void 0===t?void 0:t.querySelector(".dropdown-item");i&&i.removeAttribute("tabindex")})}_handleKeyboardMenuItemsEvent(e){if(this.readonly)return;const t=this._getActiveMenuItems();if(0!==t.length)switch(e.key){case"ArrowDown":e.preventDefault(),this._setMenuItem(this.nextDropdownItemNo);break;case"ArrowUp":e.preventDefault(),this._setMenuItem(this.prevDropdownItemNo);break;case"Tab":if(!this.menuIsOpen)return;e.preventDefault(),e.shiftKey?this._setMenuItem(this.prevDropdownItemNo):this._setMenuItem(this.nextDropdownItemNo);break;case"Enter":t.includes(e.target)&&this.handleSelectSlot(e)}}_getMenuItems(){var e,t;if(this.shadowRoot.querySelector("slot#default")){return null===(e=this.shadowRoot.querySelector("slot#default"))||void 0===e?void 0:e.assignedElements({flatten:!0}).filter(e=>!e.classList.contains("empty-menu")&&!e.hasAttribute("hidden"))}if(null===(t=this.menu)||void 0===t?void 0:t.hasChildNodes()){return[...Array.from(this.menu.children)]}return[]}_getActiveMenuItems(){return this._getMenuItems().filter(e=>!e.disabled&&!e.hidden)}_setMenuItem(e){const t=this._getActiveMenuItems();if(0===t.length)return;const i=(e%t.length+t.length)%t.length,l=t[i];this.emit("i-sgds-option-focus",{detail:{option:l}}),this.nextDropdownItemNo=(i+1)%t.length,this.prevDropdownItemNo=(i-1+t.length)%t.length,t.forEach(e=>{const t=e.shadowRoot.querySelector(".dropdown-item");t.setAttribute("tabindex",e===l?"0":"-1"),e===l&&t.focus()})}}var ki,Li;Si.styles=Bi.styles,t([(ki="ul.dropdown-menu",(e,t,i)=>{const l=e=>{const i=e.renderRoot?.querySelector(ki)??null;if(null===i&&Li&&!e.hasUpdated){const e="object"==typeof t?t.name:t;Se("",`@query'd field ${JSON.stringify(String(e))} with the 'cache' flag set for selector '${ki}' has been accessed before the first update and returned null. This is expected if the renderRoot tree has not been provided beforehand (e.g. via Declarative Shadow DOM). Therefore the value hasn't been cached.`)}return i};if(Li){const{get:a,set:n}="object"==typeof t?e:i??(()=>{const e=Symbol(`${String(t)} (@query() cache)`);return{get(){return this[e]},set(t){this[e]=t}}})();return Be(e,t,{get(){let e=a.call(this);return void 0===e&&(e=l(this),(null!==e||this.hasUpdated)&&n.call(this,e)),e}})}return Be(e,t,{get(){return l(this)}})})],Si.prototype,"menu",void 0),t([$e()],Si.prototype,"nextDropdownItemNo",void 0),t([$e()],Si.prototype,"prevDropdownItemNo",void 0),t([He({type:Boolean,reflect:!0})],Si.prototype,"hidden",void 0);var Ai=r`.empty-menu,.loading-menu{padding:var(--sgds-padding-sm) var(--sgds-padding-lg,20px);pointer-events:none}.loading-menu{align-items:center;display:flex;gap:var(--sgds-gap-xs)}`;class Ei extends(Vi(Si)){constructor(){super(),this.label="",this.hintText="",this.autofocus=!1,this.disabled=!1,this.required=!1,this.loading=!1,this.value="",this.displayValue="",this.defaultValue="",this.hasFeedback=!1,this.invalidFeedback="",this.invalid=!1,this.menuList=[],this.selectedItems=[],this.filteredList=[],this._isTouched=!1,this._controlId=Mi("input"),this._labelId=Mi("label"),this.floatingOpts={middleware:[mi({apply({rects:e,elements:t}){t.floating.style.width=`${e.reference.width}px`}})]}}connectedCallback(){super.connectedCallback(),this.addEventListener("blur",async e=>{var t;const i=this.constructor.childName,l=(null===(t=e.relatedTarget)||void 0===t?void 0:t.tagName.toLowerCase())===i;this.invalid=!l&&!this._mixinReportValidity()})}reportValidity(){return this._mixinReportValidity()}checkValidity(){return this._mixinCheckValidity()}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}_renderFeedback(){return this.invalid&&this.hasFeedback?ee` <div class="invalid-feedback-container">
|
|
84
84
|
<slot name="invalidIcon">
|
|
85
85
|
<sgds-icon name="exclamation-circle-fill" size="md"></sgds-icon>
|
|
86
86
|
</slot>
|
|
@@ -94,7 +94,7 @@ window.ShadyDOM?.inUse&&!0===window.ShadyDOM?.noPatch&&window.ShadyDOM.wrap;cons
|
|
|
94
94
|
class=${Pe({"form-label":!0,required:this.required})}
|
|
95
95
|
>${this.label}</label
|
|
96
96
|
>
|
|
97
|
-
`;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 ee` <div class="empty-menu">No options</div> `}_renderLoadingMenu(){return ee`<div class="loading-menu"><sgds-spinner size="xs" tone="brand"></sgds-spinner>Loading...</div>`}}Ei.
|
|
97
|
+
`;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 ee` <div class="empty-menu">No options</div> `}_renderLoadingMenu(){return ee`<div class="loading-menu"><sgds-spinner size="xs" tone="brand"></sgds-spinner>Loading...</div>`}}Ei.styles=[...Si.styles,yi,Ci,Zi,bi,Ai],t([He({reflect:!0})],Ei.prototype,"label",void 0),t([He({reflect:!0})],Ei.prototype,"hintText",void 0),t([He({reflect:!0})],Ei.prototype,"name",void 0),t([He({type:String,reflect:!0})],Ei.prototype,"placeholder",void 0),t([He({type:Boolean,reflect:!0})],Ei.prototype,"autofocus",void 0),t([He({type:Boolean,reflect:!0})],Ei.prototype,"disabled",void 0),t([He({type:Boolean,reflect:!0})],Ei.prototype,"required",void 0),t([He({type:Boolean,reflect:!0})],Ei.prototype,"loading",void 0),t([He({type:String,reflect:!0})],Ei.prototype,"value",void 0),t([$e()],Ei.prototype,"displayValue",void 0),t([((e="value")=>(t,i)=>{const l=t.constructor,a=l.prototype.attributeChangedCallback;l.prototype.attributeChangedCallback=function(t,n,o){var r;const s=l.getPropertyOptions(e);if(t===("string"==typeof s.attribute?s.attribute:e).toLowerCase()){const t=s.converter||C,l=("function"==typeof t?t:null!==(r=null==t?void 0:t.fromAttribute)&&void 0!==r?r:C.fromAttribute)(o,s.type);this[e]!==l&&(this[i]=l)}a.call(this,t,n,o)}})()],Ei.prototype,"defaultValue",void 0),t([He({type:Boolean,reflect:!0})],Ei.prototype,"hasFeedback",void 0),t([He({type:String,reflect:!0})],Ei.prototype,"invalidFeedback",void 0),t([He({type:Boolean,reflect:!0})],Ei.prototype,"invalid",void 0),t([He({type:Array})],Ei.prototype,"menuList",void 0),t([$e()],Ei.prototype,"selectedItems",void 0),t([$e()],Ei.prototype,"filteredList",void 0),t([ke("input.form-control")],Ei.prototype,"_input",void 0);const Ii={announcement:ee`
|
|
98
98
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
|
|
99
99
|
<path
|
|
100
100
|
fill="currentColor"
|