@govtechsg/sgds-web-component 3.14.1-rc.0 → 3.15.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/dropdown-element.d.ts +2 -0
- package/base/dropdown-element.js +8 -2
- package/base/dropdown-element.js.map +1 -1
- package/components/Accordion/index.umd.min.js +8 -8
- package/components/Accordion/index.umd.min.js.map +1 -1
- package/components/Accordion/sgds-accordion.d.ts +1 -2
- package/components/Accordion/sgds-accordion.js +2 -3
- package/components/Accordion/sgds-accordion.js.map +1 -1
- package/components/Breadcrumb/index.umd.min.js +1 -1
- package/components/Breadcrumb/index.umd.min.js.map +1 -1
- package/components/ComboBox/index.umd.min.js +24 -24
- package/components/ComboBox/index.umd.min.js.map +1 -1
- package/components/ComboBox/sgds-combo-box.js +2 -2
- package/components/ComboBox/sgds-combo-box.js.map +1 -1
- package/components/Datepicker/datepicker.js +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.js +1 -1
- package/components/Datepicker/sgds-datepicker.js.map +1 -1
- package/components/Dropdown/dropdown-menu.js +1 -1
- package/components/Dropdown/index.umd.min.js +1 -1
- package/components/Dropdown/index.umd.min.js.map +1 -1
- package/components/Dropdown/sgds-dropdown.js +1 -1
- package/components/Dropdown/sgds-dropdown.js.map +1 -1
- package/components/Mainnav/index.umd.min.js +8 -8
- package/components/Mainnav/index.umd.min.js.map +1 -1
- package/components/Mainnav/sgds-mainnav.d.ts +3 -1
- package/components/Mainnav/sgds-mainnav.js +9 -5
- package/components/Mainnav/sgds-mainnav.js.map +1 -1
- package/components/OverflowMenu/index.umd.min.js +1 -1
- package/components/OverflowMenu/index.umd.min.js.map +1 -1
- package/components/Select/index.umd.min.js +7 -7
- package/components/Select/index.umd.min.js.map +1 -1
- package/components/Select/sgds-select.js +2 -2
- package/components/Select/sgds-select.js.map +1 -1
- package/components/index.d.ts +0 -1
- package/components/index.js +0 -1
- package/components/index.js.map +1 -1
- package/components/index.umd.min.js +77 -130
- package/components/index.umd.min.js.map +1 -1
- package/css/fouc.css +0 -4
- package/css/sgds.css +2 -2
- package/css/utility.css +29 -18
- package/index.d.ts +0 -1
- package/index.js +0 -1
- package/index.js.map +1 -1
- package/index.umd.min.js +65 -196
- package/index.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/react/base/dropdown-element.cjs.js +8 -2
- package/react/base/dropdown-element.cjs.js.map +1 -1
- package/react/base/dropdown-element.js +8 -2
- package/react/base/dropdown-element.js.map +1 -1
- package/react/components/Accordion/sgds-accordion.cjs.js +2 -3
- package/react/components/Accordion/sgds-accordion.cjs.js.map +1 -1
- package/react/components/Accordion/sgds-accordion.js +2 -3
- package/react/components/Accordion/sgds-accordion.js.map +1 -1
- package/react/components/ComboBox/sgds-combo-box.cjs.js +2 -2
- package/react/components/ComboBox/sgds-combo-box.cjs.js.map +1 -1
- package/react/components/ComboBox/sgds-combo-box.js +2 -2
- package/react/components/ComboBox/sgds-combo-box.js.map +1 -1
- package/react/components/Datepicker/datepicker.cjs.js +1 -1
- package/react/components/Datepicker/datepicker.js +1 -1
- package/react/components/Datepicker/sgds-datepicker.cjs.js +1 -1
- package/react/components/Datepicker/sgds-datepicker.cjs.js.map +1 -1
- package/react/components/Datepicker/sgds-datepicker.js +1 -1
- package/react/components/Datepicker/sgds-datepicker.js.map +1 -1
- package/react/components/Dropdown/dropdown-menu.cjs.js +1 -1
- package/react/components/Dropdown/dropdown-menu.js +1 -1
- package/react/components/Dropdown/sgds-dropdown.cjs.js +1 -1
- package/react/components/Dropdown/sgds-dropdown.cjs.js.map +1 -1
- package/react/components/Dropdown/sgds-dropdown.js +1 -1
- package/react/components/Dropdown/sgds-dropdown.js.map +1 -1
- package/react/components/Mainnav/sgds-mainnav.cjs.js +9 -5
- package/react/components/Mainnav/sgds-mainnav.cjs.js.map +1 -1
- package/react/components/Mainnav/sgds-mainnav.js +9 -5
- package/react/components/Mainnav/sgds-mainnav.js.map +1 -1
- package/react/components/Select/sgds-select.cjs.js +2 -2
- package/react/components/Select/sgds-select.cjs.js.map +1 -1
- package/react/components/Select/sgds-select.js +2 -2
- package/react/components/Select/sgds-select.js.map +1 -1
- package/react/index.cjs.js +48 -56
- package/react/index.cjs.js.map +1 -1
- package/react/index.d.ts +0 -4
- package/react/index.js +0 -4
- package/react/index.js.map +1 -1
- package/themes/responsive.css +18 -0
- package/base/sidebar-element.d.ts +0 -112
- package/base/sidebar-element.js +0 -281
- package/base/sidebar-element.js.map +0 -1
- package/components/Sidebar/index.d.ts +0 -16
- package/components/Sidebar/index.js +0 -10
- package/components/Sidebar/index.js.map +0 -1
- package/components/Sidebar/index.umd.min.js +0 -2501
- package/components/Sidebar/index.umd.min.js.map +0 -1
- package/components/Sidebar/sgds-sidebar-group.d.ts +0 -51
- package/components/Sidebar/sgds-sidebar-group.js +0 -124
- package/components/Sidebar/sgds-sidebar-group.js.map +0 -1
- package/components/Sidebar/sgds-sidebar-item.d.ts +0 -25
- package/components/Sidebar/sgds-sidebar-item.js +0 -73
- package/components/Sidebar/sgds-sidebar-item.js.map +0 -1
- package/components/Sidebar/sgds-sidebar-section.d.ts +0 -56
- package/components/Sidebar/sgds-sidebar-section.js +0 -125
- package/components/Sidebar/sgds-sidebar-section.js.map +0 -1
- package/components/Sidebar/sgds-sidebar.d.ts +0 -156
- package/components/Sidebar/sgds-sidebar.js +0 -412
- package/components/Sidebar/sgds-sidebar.js.map +0 -1
- package/components/Sidebar/sidebar-context.d.ts +0 -51
- package/components/Sidebar/sidebar-context.js +0 -45
- package/components/Sidebar/sidebar-context.js.map +0 -1
- package/components/Sidebar/sidebar-item.js +0 -6
- package/components/Sidebar/sidebar-item.js.map +0 -1
- package/components/Sidebar/sidebar-section.js +0 -6
- package/components/Sidebar/sidebar-section.js.map +0 -1
- package/components/Sidebar/sidebar.js +0 -6
- package/components/Sidebar/sidebar.js.map +0 -1
- package/react/base/sidebar-element.cjs.js +0 -286
- package/react/base/sidebar-element.cjs.js.map +0 -1
- package/react/base/sidebar-element.js +0 -282
- package/react/base/sidebar-element.js.map +0 -1
- package/react/components/Sidebar/sgds-sidebar-group.cjs.js +0 -130
- package/react/components/Sidebar/sgds-sidebar-group.cjs.js.map +0 -1
- package/react/components/Sidebar/sgds-sidebar-group.js +0 -125
- package/react/components/Sidebar/sgds-sidebar-group.js.map +0 -1
- package/react/components/Sidebar/sgds-sidebar-item.cjs.js +0 -79
- package/react/components/Sidebar/sgds-sidebar-item.cjs.js.map +0 -1
- package/react/components/Sidebar/sgds-sidebar-item.js +0 -74
- package/react/components/Sidebar/sgds-sidebar-item.js.map +0 -1
- package/react/components/Sidebar/sgds-sidebar-section.cjs.js +0 -131
- package/react/components/Sidebar/sgds-sidebar-section.cjs.js.map +0 -1
- package/react/components/Sidebar/sgds-sidebar-section.js +0 -126
- package/react/components/Sidebar/sgds-sidebar-section.js.map +0 -1
- package/react/components/Sidebar/sgds-sidebar.cjs.js +0 -418
- package/react/components/Sidebar/sgds-sidebar.cjs.js.map +0 -1
- package/react/components/Sidebar/sgds-sidebar.js +0 -413
- package/react/components/Sidebar/sgds-sidebar.js.map +0 -1
- package/react/components/Sidebar/sidebar-context.cjs.js +0 -54
- package/react/components/Sidebar/sidebar-context.cjs.js.map +0 -1
- package/react/components/Sidebar/sidebar-context.js +0 -46
- package/react/components/Sidebar/sidebar-context.js.map +0 -1
- package/react/components/Sidebar/sidebar-item.cjs.js +0 -11
- package/react/components/Sidebar/sidebar-item.cjs.js.map +0 -1
- package/react/components/Sidebar/sidebar-item.js +0 -7
- package/react/components/Sidebar/sidebar-item.js.map +0 -1
- package/react/components/Sidebar/sidebar-section.cjs.js +0 -11
- package/react/components/Sidebar/sidebar-section.cjs.js.map +0 -1
- package/react/components/Sidebar/sidebar-section.js +0 -7
- package/react/components/Sidebar/sidebar-section.js.map +0 -1
- package/react/components/Sidebar/sidebar.cjs.js +0 -11
- package/react/components/Sidebar/sidebar.cjs.js.map +0 -1
- package/react/components/Sidebar/sidebar.js +0 -7
- package/react/components/Sidebar/sidebar.js.map +0 -1
- package/react/sidebar/index.cjs.js +0 -42
- package/react/sidebar/index.cjs.js.map +0 -1
- package/react/sidebar/index.d.ts +0 -2
- package/react/sidebar/index.js +0 -18
- package/react/sidebar/index.js.map +0 -1
- package/react/sidebar-group/index.cjs.js +0 -40
- package/react/sidebar-group/index.cjs.js.map +0 -1
- package/react/sidebar-group/index.d.ts +0 -2
- package/react/sidebar-group/index.js +0 -16
- package/react/sidebar-group/index.js.map +0 -1
- package/react/sidebar-item/index.cjs.js +0 -40
- package/react/sidebar-item/index.cjs.js.map +0 -1
- package/react/sidebar-item/index.d.ts +0 -2
- package/react/sidebar-item/index.js +0 -16
- package/react/sidebar-item/index.js.map +0 -1
- package/react/sidebar-section/index.cjs.js +0 -40
- package/react/sidebar-section/index.cjs.js.map +0 -1
- package/react/sidebar-section/index.d.ts +0 -2
- package/react/sidebar-section/index.js +0 -16
- package/react/sidebar-section/index.js.map +0 -1
|
@@ -92,8 +92,8 @@ class SgdsComboBox extends SelectElement {
|
|
|
92
92
|
this.appendChild(comboBoxOption);
|
|
93
93
|
});
|
|
94
94
|
this._setupValidation(this.menuList);
|
|
95
|
-
if (this.menuIsOpen
|
|
96
|
-
this.
|
|
95
|
+
if (this.menuIsOpen) {
|
|
96
|
+
await this.updateFloatingPosition();
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
async _handleDefaultSlotChange(e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sgds-combo-box.js","sources":["../../../src/components/ComboBox/sgds-combo-box.ts"],"sourcesContent":["import { live } from \"lit/directives/live.js\";\nimport { html, nothing, PropertyValueMap, TemplateResult } from \"lit\";\nimport { property, queryAssignedElements, queryAsync, state } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\n\nimport { ref } from \"lit/directives/ref.js\";\nimport { SelectElement, SgdsOptionData } from \"../../base/select-element\";\nimport { watch } from \"../../utils/watch\";\nimport { SgdsBadge } from \"../Badge/sgds-badge\";\nimport SgdsIcon from \"../Icon/sgds-icon\";\nimport comboBoxStyle from \"./combo-box.css\";\nimport formTextControlStyle from \"../../styles/form-text-control.css\";\nimport { SgdsComboBoxOption } from \"./sgds-combo-box-option\";\n\nimport { repeat } from \"lit/directives/repeat.js\";\nimport SgdsSpinner from \"../Spinner/sgds-spinner\";\n\n/**\n * Each item in the ComboBox has a label to display\n * and a value (the actual data / ID).\n */\ntype SgdsComboBoxOptionData = SgdsOptionData;\n\nexport interface ISgdsComboBoxInputEventDetail {\n displayValue: string;\n}\n\n/**\n * @summary ComboBox component is used for users to make one or more selections from a list through user input, keyboard or mouse actions\n *\n * @slot default - default slot to pass in sgds-combo-box-option\n *\n * @event sgds-select - Emitted when the combo box's selected value changes.\n * @event sgds-change - Emitted when the combo box's value changes.\n * @event sgds-input - Emitted when user input is received and its value changes. `event.detail = { displayValue }`\n * @event sgds-focus - Emitted when user input is focused.\n * @event sgds-blur - Emitted when user input is blurred.\n */\nexport class SgdsComboBox extends SelectElement {\n static styles = [...SelectElement.styles, formTextControlStyle, comboBoxStyle];\n static childName = \"sgds-combo-box-option\";\n /** @internal */\n static dependencies = {\n [SgdsComboBox.childName]: SgdsComboBoxOption,\n \"sgds-icon\": SgdsIcon,\n \"sgds-badge\": SgdsBadge,\n \"sgds-spinner\": SgdsSpinner\n };\n\n /** If true, renders multiple checkbox selection items. If false, single-select. */\n @property({ type: Boolean, reflect: true }) multiSelect = false;\n\n /** If true, renders badge that fills width of combobox */\n @property({ type: Boolean, reflect: true }) badgeFullWidth = false;\n\n /** If true, a clear button will be enabled on focus */\n @property({ type: Boolean, reflect: true }) clearable = false;\n\n /** Enables the asynchronous behaviour of a combo box. When true, filterFunction is ignored and filtering is done remotely. */\n @property({ type: Boolean, reflect: true }) async = false;\n\n /** When filtering remotely and there are no results, set this to true to enable no options feedback on the menu. Applicable for async combo box only. */\n @property({ type: Boolean, reflect: true }) emptyMenuAsync = false;\n\n /** The function used to filter the menu list, given the user's input value. */\n @property()\n filterFunction: (inputValue: string, item: SgdsComboBoxOptionData) => boolean = (inputValue, item) => {\n return item.label.toLowerCase().startsWith(inputValue.toLowerCase());\n };\n\n @queryAsync(\"input#multi-select-input-tracker\") private _multiSelectInput: Promise<HTMLInputElement>;\n\n @queryAssignedElements({ flatten: true, selector: \"sgds-combo-box-option\" })\n protected options: SgdsComboBoxOption[];\n\n @state() private optionList: SgdsComboBoxOptionData[] = [];\n @state() private emptyMenuAfterFiltering = false;\n\n // Used to show and hide the clear button\n @state() protected isFocused = false;\n\n connectedCallback(): void {\n super.connectedCallback();\n\n this.addEventListener(\"focus\", async () => {\n this.isFocused = true;\n });\n\n this.addEventListener(\"blur\", async () => {\n this.isFocused = false;\n });\n\n this.addEventListener(\"keydown\", (e: KeyboardEvent) => {\n if (\n e.key === \"Enter\" &&\n (e.target as HTMLElement).shadowRoot?.querySelector(\".form-clearable\")?.matches(\":focus\")\n ) {\n this._handleClear();\n }\n });\n\n this.addEventListener(\"sgds-hide\", async (e: CustomEvent) => {\n if (!e.detail.isOutside) {\n const sgdsInput = await this._input;\n sgdsInput.focus();\n }\n\n this.options.forEach(o => o.removeAttribute(\"hidden\"));\n // reset emptyMenu state\n this.emptyMenuAfterFiltering = false;\n });\n }\n\n async firstUpdated(changedProperties: PropertyValueMap<this>) {\n super.firstUpdated(changedProperties);\n if (this.async) this.filterFunction = () => true;\n this.menuList.forEach(o => {\n const comboBoxOption = document.createElement(\"sgds-combo-box-option\") as SgdsComboBoxOption;\n comboBoxOption.innerText = o.label;\n comboBoxOption.value = o.value;\n comboBoxOption.checkbox = this.multiSelect;\n comboBoxOption.active = this.value.includes(o.value);\n this.appendChild(comboBoxOption);\n });\n this._setupValidation(this.menuList);\n\n if (this.menuIsOpen && !this.readonly) {\n this.showMenu();\n }\n }\n\n protected async _handleDefaultSlotChange(e: Event) {\n const assignedElements = (e.target as HTMLSlotElement).assignedElements({\n flatten: true\n }) as ComboBoxOptionWithFlag[];\n\n assignedElements.forEach(option => {\n // Handling of click events\n if (option.hasAttribute(\"disabled\")) return false;\n if (option.clickEventAdded) return false;\n option.addEventListener(\"click\", (evt: PointerEvent) => {\n evt.preventDefault();\n const optionTarget = evt.target as SgdsComboBoxOption;\n\n if (this.multiSelect) {\n optionTarget.active ? this._handleItemUnselect(evt) : this._handleItemSelected(evt);\n } else {\n this._handleItemSelected(evt);\n }\n\n return false;\n });\n option.clickEventAdded = true;\n option.addEventListener(\"keydown\", (evt: KeyboardEvent) => {\n if (evt.key === \"Enter\") {\n this.close = \"outside\";\n const optionTarget = evt.target as SgdsComboBoxOption;\n optionTarget.click();\n }\n });\n });\n\n /** this will trigger _updateValueAndDisplayValue */\n await this.updateComplete;\n this.optionList = await this._getMenuListFromOptions(assignedElements);\n this._setupValidation(this.optionList);\n }\n\n private async _setupValidation(list: SgdsComboBoxOptionData[]) {\n if (this.value && list.length > 0) {\n const valueArray = this.value.split(\";\");\n const initialSelectedItem = list.filter(({ value }) => valueArray.includes(value));\n this.selectedItems = [...initialSelectedItem, ...this.selectedItems];\n\n if (!this.multiSelect) {\n this.displayValue = initialSelectedItem[0]?.label;\n }\n }\n /** We want to run validation regardless of value or list present */\n this.multiSelect ? (this.input = await this._multiSelectInput) : (this.input = await this._input);\n this._mixinValidate(this.input);\n }\n\n @watch(\"value\", { waitUntilFirstUpdate: true })\n async _handleValueChange() {\n // when value change, always emit a change event\n this.emit(\"sgds-change\");\n this.options.forEach(o => o.removeAttribute(\"hidden\"));\n\n if (this.value) {\n this.emit(\"sgds-select\");\n }\n\n const sgdsInput = await this._input;\n this._mixinSetFormValue();\n\n if (this.multiSelect) {\n this._mixinValidate(this.input);\n } else {\n this._mixinValidate(sgdsInput);\n }\n\n // When value is updated by user and it doesn't map to selectedItems, we should re-map selectedItems\n const selectedItemVal = this.selectedItems.map(val => val.value).join(\";\");\n if (selectedItemVal !== this.value) {\n this._updateValueAndDisplayValue(this.optionList);\n }\n\n if (!this._isTouched && this.value === \"\") return;\n this.invalid = !this._mixinReportValidity();\n }\n\n @watch(\"optionList\", { waitUntilFirstUpdate: true })\n _handleOptionListChange() {\n this._updateValueAndDisplayValue(this.optionList);\n }\n\n @watch(\"menuList\", { waitUntilFirstUpdate: true })\n _handleMenuListChange() {\n const newMenu = this.menuList.map(o => {\n const comboBoxOption = document.createElement(\"sgds-combo-box-option\") as SgdsComboBoxOption;\n comboBoxOption.innerText = o.label;\n comboBoxOption.value = o.value;\n comboBoxOption.checkbox = this.multiSelect;\n comboBoxOption.active = this.value.includes(o.value);\n return comboBoxOption;\n });\n\n this.replaceChildren(...newMenu);\n }\n\n private _updateValueAndDisplayValue(list: SgdsComboBoxOptionData[]) {\n const valueArray = this.value.split(\";\");\n const initialSelectedItem = list.filter(({ value }) => valueArray.includes(value));\n this.selectedItems = [...initialSelectedItem];\n // When the new filtered items don't match value we update it\n const updatedValue = initialSelectedItem.map(item => item.value).join(\";\");\n if (updatedValue !== this.value) {\n this.value = updatedValue;\n }\n // Disabling this condition for async combobox so that the display value in the input will not clear when menu options changes\n if (!this.multiSelect && !this.async) {\n this.displayValue = initialSelectedItem[0]?.label || \"\";\n }\n\n this.options.forEach(o => (o.active = valueArray.includes(o.value)));\n }\n\n // Called each time the user types in the <sgds-input>, we set .value and show the menu\n protected async _handleInputChange(e: CustomEvent) {\n const input = e.target as HTMLInputElement;\n this.displayValue = input.value;\n this.emit<ISgdsComboBoxInputEventDetail>(\"sgds-input\", { detail: { displayValue: this.displayValue } });\n this.invalid = false;\n this.showMenu();\n // reset menu list when displayValue is cleared\n if (this.displayValue === \"\" && !this.multiSelect) {\n this.selectedItems = [];\n this.value = this.selectedItems.join(\";\");\n this.options.forEach(o => (o.active = false));\n }\n // There is a race condition in certain situations where this.optionList is not fully updated during slotchange\n // Hence instead of using this.optionList, we have to perform a query on the <sgds-combo-box-option> elements\n const optionList = this.options.map(o => ({ value: o.value, label: o.textContent.trim() }));\n this.filteredList = optionList.filter(item => this.filterFunction(this.displayValue, item));\n\n // Filtering for slots\n this.emptyMenuAfterFiltering = this.filteredList.length === 0;\n const filteredValues = this.filteredList.map(l => l.value);\n\n this.options.forEach(o => {\n if (!filteredValues.includes(o.value)) {\n o.hidden = true;\n } else {\n o.hidden = false;\n }\n });\n }\n\n /**\n * Called whenever an <sgds-combo-box-option> dispatches sgds-select\"\n */\n protected async _handleItemSelected(e: Event) {\n const itemEl = e.target as SgdsComboBoxOption;\n if (itemEl.disabled) return;\n\n const itemLabel = itemEl.textContent?.trim() ?? \"\";\n const itemValueAttr = itemEl.getAttribute(\"value\") ?? itemLabel;\n const foundItem = this.filteredList.find(i => i.value.toString() === itemValueAttr) || {\n label: itemLabel,\n value: itemValueAttr\n };\n\n if (this.multiSelect) {\n if (!this.selectedItems.some(i => i.value === foundItem.value)) {\n this.selectedItems = [...this.selectedItems, foundItem];\n }\n\n this.value = this.selectedItems.map(i => i.value).join(\";\");\n itemEl.active = true;\n } else {\n // Single-select\n // Only update active states if a new item is selected\n if (this.selectedItems.length === 0 || this.selectedItems[0].value !== foundItem.value) {\n // Remove active from all options\n this.options.forEach(o => (o.active = false));\n itemEl.active = true;\n\n this.selectedItems = [foundItem];\n this.value = foundItem.value.toString();\n this.displayValue = foundItem.label;\n this.hideMenu();\n }\n }\n }\n\n private _handleItemUnselect(e: Event) {\n const itemEl = e.target as SgdsComboBoxOption;\n if (itemEl.disabled) return;\n\n itemEl.removeAttribute(\"active\");\n const itemLabel = itemEl.textContent?.trim() ?? \"\";\n const itemValueAttr = itemEl.getAttribute(\"value\") ?? itemLabel;\n const foundItem = this.filteredList.find(i => i.value.toString() === itemValueAttr) || {\n label: itemLabel,\n value: itemValueAttr\n };\n\n this.selectedItems = this.selectedItems.filter(i => i.value !== foundItem.value);\n this.value = this.selectedItems.map(i => i.value).join(\";\");\n }\n\n private async _handleBadgeDismissed(e: CustomEvent, item: SgdsComboBoxOptionData) {\n e.preventDefault();\n const removedValue = item.value;\n this.options?.forEach(o => (o.value === removedValue ? (o.active = false) : null));\n this.selectedItems = this.selectedItems.filter(i => i.value !== item.value);\n this.value = this.selectedItems.map(i => i.value).join(\";\");\n }\n\n private async _handleMultiSelectKeyDown(e: KeyboardEvent) {\n // Only do this in multi-select mode\n if (!this.multiSelect) {\n return;\n }\n\n if (e.key === \"Backspace\" && this.multiSelect) {\n if (this.displayValue.trim() === \"\" && this.selectedItems.length > 0) {\n const removedValue = this.selectedItems[this.selectedItems.length - 1].value;\n this.options?.forEach(o => (o.value === removedValue ? (o.active = false) : null));\n this.selectedItems = this.selectedItems.slice(0, -1);\n this.value = this.selectedItems.map(i => i.value).join(\";\");\n }\n }\n }\n\n protected _handleFocus() {\n this.emit(\"sgds-focus\");\n }\n\n protected async _handleInputBlur(e: Event) {\n e.preventDefault();\n\n this.emit(\"sgds-blur\");\n\n if (this.multiSelect) {\n const displayValueMatchedSelectedItems = this.selectedItems.filter(({ label }) => this.displayValue === label);\n if (displayValueMatchedSelectedItems.length <= 0) {\n this.displayValue = \"\";\n }\n } else {\n // Single select\n if (this.selectedItems.length > 0) {\n this.displayValue = this.selectedItems[0].label;\n } else {\n this.displayValue = \"\";\n }\n }\n }\n\n // For clearing the value\n protected async _handleClear() {\n this.value = this.displayValue = \"\";\n this.options?.forEach(o => (o.active = false));\n\n const sgdsInput = await this._input;\n sgdsInput.focus();\n this.showMenu();\n }\n\n /** For form reset */\n protected async _mixinResetFormControl() {\n this.value = this.defaultValue;\n if (!this.multiSelect) {\n //reset menu\n this.options.forEach(o => {\n o.active = o.value === this.value;\n });\n const initialOption = this.options.filter(o => o.value === this.value);\n if (initialOption.length <= 0) {\n this.displayValue = \"\";\n } else {\n this.displayValue = initialOption[0].textContent.trim();\n }\n this._mixinResetValidity(await this._input);\n } else {\n const valueArray = this.value.split(\";\");\n // reset menu\n this.options.forEach(o => {\n o.active = valueArray.includes(o.value);\n });\n const initialOption = this.options.filter(o => valueArray.includes(o.value));\n this.selectedItems = initialOption.map(o => ({ value: o.value, label: o.textContent.trim() }));\n this._mixinResetValidity(await this._multiSelectInput);\n }\n }\n\n /** Template for the suffix icon */\n protected suffixIconTemplate: TemplateResult = html`<sgds-icon\n name=${this.menuIsOpen ? \"chevron-up\" : \"chevron-down\"}\n size=\"md\"\n ></sgds-icon>`;\n\n protected prefixIconTemplate: TemplateResult = html`${nothing}`;\n /**\n * Used `repeat` helper from Lit to render instead of .map:\n * The reassigning of value is affecting the truncation on badge as it is not triggering the slot change event.\n *\n * To compare this to lit-html's default handling for lists, consider reversing a large list of names:\n * For a list created using Array.map, lit-html maintains the DOM nodes for the list items, but reassigns the values\n * For a list created using repeat, the repeat directive reorders the existing DOM nodes, so the nodes representing the first list item move to the last position.\n */\n protected _renderInput(showClearButton: boolean): TemplateResult {\n const wantFeedbackStyle = this.hasFeedback;\n const showButton = showClearButton;\n\n return html`\n <div\n ${ref(this.myDropdown)}\n class=\"form-control-group ${classMap({\n disabled: this.disabled,\n readonly: this.readonly,\n \"is-invalid\": this.invalid && wantFeedbackStyle\n })}\"\n @click=${this._handleClick}\n >\n ${this.prefixIconTemplate}\n <div class=\"combobox-input-container\">\n ${this.multiSelect\n ? html`\n ${repeat(\n this.selectedItems,\n item => item.value,\n item =>\n html`<sgds-badge\n outlined\n variant=\"neutral\"\n show\n ?dismissible=${!(this.readonly || this.disabled)}\n ?fullwidth=${this.badgeFullWidth}\n @sgds-hide=${e => this._handleBadgeDismissed(e, item)}\n >${item.label}</sgds-badge\n >`\n )}\n `\n : nothing}\n <input\n class=\"form-control\"\n type=\"text\"\n id=${this._controlId}\n name=${ifDefined(this.name)}\n placeholder=${ifDefined(this.placeholder)}\n aria-invalid=${this.invalid ? \"true\" : \"false\"}\n ?autofocus=${this.autofocus}\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n ?required=${this.required}\n .value=${this.displayValue ? this.displayValue.trim() : \"\"}\n @input=${this._handleInputChange}\n @blur=${this._handleInputBlur}\n @focus=${this._handleFocus}\n aria-describedby=${ifDefined(this.invalid && this.hasFeedback ? `${this._controlId}-invalid` : undefined)}\n aria-labelledby=\"${this._labelId} ${this._controlId}Help ${this.invalid && this.hasFeedback\n ? `${this._controlId}-invalid`\n : \"\"}\"\n />\n </div>\n\n ${showButton\n ? html`\n <sgds-icon\n id=${`${this._controlId}-combobox-clear-button`}\n tabindex=\"0\"\n class=\"form-clearable\"\n name=\"xcircle-fill\"\n size=\"md\"\n @click=${this._handleClear}\n aria-label=\"Clear selections\"\n role=\"button\"\n ></sgds-icon>\n `\n : nothing}\n ${this.suffixIconTemplate}\n </div>\n `;\n }\n\n protected _renderFeedbackMenu() {\n if (this.loading) {\n return this._renderLoadingMenu();\n }\n // When async, the filtering is done by remote server, so we do not check for emptyMenu of combobox filterFunction\n if (this.async) {\n return this.emptyMenuAsync || this.optionList.length === 0 ? this._renderEmptyMenu() : nothing;\n } else {\n return this.optionList.length === 0 || // no options at all\n (this.emptyMenuAfterFiltering && this.optionList.length > 0) // check if filtering results in empty menu\n ? this._renderEmptyMenu()\n : nothing;\n }\n }\n\n render() {\n const showClearButton =\n (this.isFocused || this.menuIsOpen) && this.value !== \"\" && this.clearable && !this.readonly;\n return html`\n <div\n class=${classMap({ \"form-control-container\": true, disabled: this.disabled, combobox: true })}\n @keydown=${this._handleMultiSelectKeyDown}\n >\n ${this._renderLabel()}\n <!-- The input -->\n ${this._renderInput(showClearButton)} ${this._renderFeedback()}\n\n <ul id=${this.dropdownMenuId} class=\"dropdown-menu\" part=\"menu\" tabindex=\"-1\" ${ref(this.menuRef)}>\n <slot\n id=\"default\"\n class=${classMap({ \"d-none\": this.loading || this.emptyMenuAsync || this.optionList.length === 0 })}\n @slotchange=${this._handleDefaultSlotChange}\n ></slot>\n ${this._renderFeedbackMenu()}\n </ul>\n </div>\n\n <!-- Required an input element for constraint validation -->\n ${this.multiSelect\n ? html`<input\n .value=${live(this.value)}\n id=\"multi-select-input-tracker\"\n class=\"visually-hidden\"\n ?required=${this.required}\n tabindex=\"-1\"\n />`\n : nothing}\n `;\n }\n}\n\ninterface ComboBoxOptionWithFlag extends SgdsComboBoxOption {\n clickEventAdded?: boolean;\n}\n\nexport default SgdsComboBox;\n\n//TODO:\n// Replace this.optionList ?\n// During slotchange event _handleDefaultSlotChange, we try to populate this.optionList to obtain value attribute and textContent as label from <sgds-combo-box-option>\n// However, it has race conditions in certain situation like nextjs, where the last option's label (essentially the slot of <sgds-combo-box-option>) may not be available immediately.\n// To circumvent this, I avoid relying on this.optionList to perform filterFunction onInput handler and query this.options directly at the point of user typing.\n// To prevent confusion, this.optionList should ideally be removed in future iterations\n"],"names":["formTextControlStyle","comboBoxStyle"],"mappings":";;;;;;;;;;;;;;;;;AA4BA;;;;;;;;;;AAUG;AACG,MAAO,YAAa,SAAQ,aAAa,CAAA;AAA/C,IAAA,WAAA,GAAA;;;QAY8C,IAAW,CAAA,WAAA,GAAG,KAAK,CAAC;;QAGpB,IAAc,CAAA,cAAA,GAAG,KAAK,CAAC;;QAGvB,IAAS,CAAA,SAAA,GAAG,KAAK,CAAC;;QAGlB,IAAK,CAAA,KAAA,GAAG,KAAK,CAAC;;QAGd,IAAc,CAAA,cAAA,GAAG,KAAK,CAAC;;AAInE,QAAA,IAAA,CAAA,cAAc,GAAkE,CAAC,UAAU,EAAE,IAAI,KAAI;AACnG,YAAA,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,CAAC;AACvE,SAAC,CAAC;QAOe,IAAU,CAAA,UAAA,GAA6B,EAAE,CAAC;QAC1C,IAAuB,CAAA,uBAAA,GAAG,KAAK,CAAC;;QAG9B,IAAS,CAAA,SAAA,GAAG,KAAK,CAAC;;QAmV3B,IAAkB,CAAA,kBAAA,GAAmB,IAAI,CAAA,CAAA;WAC1C,IAAI,CAAC,UAAU,GAAG,YAAY,GAAG,cAAc,CAAA;;gBAE1C,CAAC;AAEL,QAAA,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YAAA,CAAA,SAAA,EAAA,YAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAC1C,UAAA,CAAA;AAAhB,IAAA,KAAK,EAAE;AAAyC,CAAA,EAAA,YAAA,CAAA,SAAA,EAAA,yBAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAG9B,UAAA,CAAA;AAAlB,IAAA,KAAK,EAAE;AAA6B,CAAA,EAAA,YAAA,CAAA,SAAA,EAAA,WAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAyG/B,UAAA,CAAA;IADL,KAAK,CAAC,OAAO,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;AA2B9C,CAAA,EAAA,YAAA,CAAA,SAAA,EAAA,oBAAA,EAAA,IAAA,CAAA,CAAA;AAGD,UAAA,CAAA;IADC,KAAK,CAAC,YAAY,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;AAGnD,CAAA,EAAA,YAAA,CAAA,SAAA,EAAA,yBAAA,EAAA,IAAA,CAAA,CAAA;AAGD,UAAA,CAAA;IADC,KAAK,CAAC,UAAU,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;AAYjD,CAAA,EAAA,YAAA,CAAA,SAAA,EAAA,uBAAA,EAAA,IAAA,CAAA,CAAA;AA+UH;AACA;AACA;AACA;AACA;AACA;;;;"}
|
|
1
|
+
{"version":3,"file":"sgds-combo-box.js","sources":["../../../src/components/ComboBox/sgds-combo-box.ts"],"sourcesContent":["import { live } from \"lit/directives/live.js\";\nimport { html, nothing, PropertyValueMap, TemplateResult } from \"lit\";\nimport { property, queryAssignedElements, queryAsync, state } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\n\nimport { ref } from \"lit/directives/ref.js\";\nimport { SelectElement, SgdsOptionData } from \"../../base/select-element\";\nimport { watch } from \"../../utils/watch\";\nimport { SgdsBadge } from \"../Badge/sgds-badge\";\nimport SgdsIcon from \"../Icon/sgds-icon\";\nimport comboBoxStyle from \"./combo-box.css\";\nimport formTextControlStyle from \"../../styles/form-text-control.css\";\nimport { SgdsComboBoxOption } from \"./sgds-combo-box-option\";\n\nimport { repeat } from \"lit/directives/repeat.js\";\nimport SgdsSpinner from \"../Spinner/sgds-spinner\";\n\n/**\n * Each item in the ComboBox has a label to display\n * and a value (the actual data / ID).\n */\ntype SgdsComboBoxOptionData = SgdsOptionData;\n\nexport interface ISgdsComboBoxInputEventDetail {\n displayValue: string;\n}\n\n/**\n * @summary ComboBox component is used for users to make one or more selections from a list through user input, keyboard or mouse actions\n *\n * @slot default - default slot to pass in sgds-combo-box-option\n *\n * @event sgds-select - Emitted when the combo box's selected value changes.\n * @event sgds-change - Emitted when the combo box's value changes.\n * @event sgds-input - Emitted when user input is received and its value changes. `event.detail = { displayValue }`\n * @event sgds-focus - Emitted when user input is focused.\n * @event sgds-blur - Emitted when user input is blurred.\n */\nexport class SgdsComboBox extends SelectElement {\n static styles = [...SelectElement.styles, formTextControlStyle, comboBoxStyle];\n static childName = \"sgds-combo-box-option\";\n /** @internal */\n static dependencies = {\n [SgdsComboBox.childName]: SgdsComboBoxOption,\n \"sgds-icon\": SgdsIcon,\n \"sgds-badge\": SgdsBadge,\n \"sgds-spinner\": SgdsSpinner\n };\n\n /** If true, renders multiple checkbox selection items. If false, single-select. */\n @property({ type: Boolean, reflect: true }) multiSelect = false;\n\n /** If true, renders badge that fills width of combobox */\n @property({ type: Boolean, reflect: true }) badgeFullWidth = false;\n\n /** If true, a clear button will be enabled on focus */\n @property({ type: Boolean, reflect: true }) clearable = false;\n\n /** Enables the asynchronous behaviour of a combo box. When true, filterFunction is ignored and filtering is done remotely. */\n @property({ type: Boolean, reflect: true }) async = false;\n\n /** When filtering remotely and there are no results, set this to true to enable no options feedback on the menu. Applicable for async combo box only. */\n @property({ type: Boolean, reflect: true }) emptyMenuAsync = false;\n\n /** The function used to filter the menu list, given the user's input value. */\n @property()\n filterFunction: (inputValue: string, item: SgdsComboBoxOptionData) => boolean = (inputValue, item) => {\n return item.label.toLowerCase().startsWith(inputValue.toLowerCase());\n };\n\n @queryAsync(\"input#multi-select-input-tracker\") private _multiSelectInput: Promise<HTMLInputElement>;\n\n @queryAssignedElements({ flatten: true, selector: \"sgds-combo-box-option\" })\n protected options: SgdsComboBoxOption[];\n\n @state() private optionList: SgdsComboBoxOptionData[] = [];\n @state() private emptyMenuAfterFiltering = false;\n\n // Used to show and hide the clear button\n @state() protected isFocused = false;\n\n connectedCallback(): void {\n super.connectedCallback();\n\n this.addEventListener(\"focus\", async () => {\n this.isFocused = true;\n });\n\n this.addEventListener(\"blur\", async () => {\n this.isFocused = false;\n });\n\n this.addEventListener(\"keydown\", (e: KeyboardEvent) => {\n if (\n e.key === \"Enter\" &&\n (e.target as HTMLElement).shadowRoot?.querySelector(\".form-clearable\")?.matches(\":focus\")\n ) {\n this._handleClear();\n }\n });\n\n this.addEventListener(\"sgds-hide\", async (e: CustomEvent) => {\n if (!e.detail.isOutside) {\n const sgdsInput = await this._input;\n sgdsInput.focus();\n }\n\n this.options.forEach(o => o.removeAttribute(\"hidden\"));\n // reset emptyMenu state\n this.emptyMenuAfterFiltering = false;\n });\n }\n\n async firstUpdated(changedProperties: PropertyValueMap<this>) {\n super.firstUpdated(changedProperties);\n if (this.async) this.filterFunction = () => true;\n this.menuList.forEach(o => {\n const comboBoxOption = document.createElement(\"sgds-combo-box-option\") as SgdsComboBoxOption;\n comboBoxOption.innerText = o.label;\n comboBoxOption.value = o.value;\n comboBoxOption.checkbox = this.multiSelect;\n comboBoxOption.active = this.value.includes(o.value);\n this.appendChild(comboBoxOption);\n });\n this._setupValidation(this.menuList);\n if (this.menuIsOpen) {\n await this.updateFloatingPosition();\n }\n }\n\n protected async _handleDefaultSlotChange(e: Event) {\n const assignedElements = (e.target as HTMLSlotElement).assignedElements({\n flatten: true\n }) as ComboBoxOptionWithFlag[];\n\n assignedElements.forEach(option => {\n // Handling of click events\n if (option.hasAttribute(\"disabled\")) return false;\n if (option.clickEventAdded) return false;\n option.addEventListener(\"click\", (evt: PointerEvent) => {\n evt.preventDefault();\n const optionTarget = evt.target as SgdsComboBoxOption;\n\n if (this.multiSelect) {\n optionTarget.active ? this._handleItemUnselect(evt) : this._handleItemSelected(evt);\n } else {\n this._handleItemSelected(evt);\n }\n\n return false;\n });\n option.clickEventAdded = true;\n option.addEventListener(\"keydown\", (evt: KeyboardEvent) => {\n if (evt.key === \"Enter\") {\n this.close = \"outside\";\n const optionTarget = evt.target as SgdsComboBoxOption;\n optionTarget.click();\n }\n });\n });\n\n /** this will trigger _updateValueAndDisplayValue */\n await this.updateComplete;\n this.optionList = await this._getMenuListFromOptions(assignedElements);\n this._setupValidation(this.optionList);\n }\n\n private async _setupValidation(list: SgdsComboBoxOptionData[]) {\n if (this.value && list.length > 0) {\n const valueArray = this.value.split(\";\");\n const initialSelectedItem = list.filter(({ value }) => valueArray.includes(value));\n this.selectedItems = [...initialSelectedItem, ...this.selectedItems];\n\n if (!this.multiSelect) {\n this.displayValue = initialSelectedItem[0]?.label;\n }\n }\n /** We want to run validation regardless of value or list present */\n this.multiSelect ? (this.input = await this._multiSelectInput) : (this.input = await this._input);\n this._mixinValidate(this.input);\n }\n\n @watch(\"value\", { waitUntilFirstUpdate: true })\n async _handleValueChange() {\n // when value change, always emit a change event\n this.emit(\"sgds-change\");\n this.options.forEach(o => o.removeAttribute(\"hidden\"));\n\n if (this.value) {\n this.emit(\"sgds-select\");\n }\n\n const sgdsInput = await this._input;\n this._mixinSetFormValue();\n\n if (this.multiSelect) {\n this._mixinValidate(this.input);\n } else {\n this._mixinValidate(sgdsInput);\n }\n\n // When value is updated by user and it doesn't map to selectedItems, we should re-map selectedItems\n const selectedItemVal = this.selectedItems.map(val => val.value).join(\";\");\n if (selectedItemVal !== this.value) {\n this._updateValueAndDisplayValue(this.optionList);\n }\n\n if (!this._isTouched && this.value === \"\") return;\n this.invalid = !this._mixinReportValidity();\n }\n\n @watch(\"optionList\", { waitUntilFirstUpdate: true })\n _handleOptionListChange() {\n this._updateValueAndDisplayValue(this.optionList);\n }\n\n @watch(\"menuList\", { waitUntilFirstUpdate: true })\n _handleMenuListChange() {\n const newMenu = this.menuList.map(o => {\n const comboBoxOption = document.createElement(\"sgds-combo-box-option\") as SgdsComboBoxOption;\n comboBoxOption.innerText = o.label;\n comboBoxOption.value = o.value;\n comboBoxOption.checkbox = this.multiSelect;\n comboBoxOption.active = this.value.includes(o.value);\n return comboBoxOption;\n });\n\n this.replaceChildren(...newMenu);\n }\n\n private _updateValueAndDisplayValue(list: SgdsComboBoxOptionData[]) {\n const valueArray = this.value.split(\";\");\n const initialSelectedItem = list.filter(({ value }) => valueArray.includes(value));\n this.selectedItems = [...initialSelectedItem];\n // When the new filtered items don't match value we update it\n const updatedValue = initialSelectedItem.map(item => item.value).join(\";\");\n if (updatedValue !== this.value) {\n this.value = updatedValue;\n }\n // Disabling this condition for async combobox so that the display value in the input will not clear when menu options changes\n if (!this.multiSelect && !this.async) {\n this.displayValue = initialSelectedItem[0]?.label || \"\";\n }\n\n this.options.forEach(o => (o.active = valueArray.includes(o.value)));\n }\n\n // Called each time the user types in the <sgds-input>, we set .value and show the menu\n protected async _handleInputChange(e: CustomEvent) {\n const input = e.target as HTMLInputElement;\n this.displayValue = input.value;\n this.emit<ISgdsComboBoxInputEventDetail>(\"sgds-input\", { detail: { displayValue: this.displayValue } });\n this.invalid = false;\n this.showMenu();\n // reset menu list when displayValue is cleared\n if (this.displayValue === \"\" && !this.multiSelect) {\n this.selectedItems = [];\n this.value = this.selectedItems.join(\";\");\n this.options.forEach(o => (o.active = false));\n }\n // There is a race condition in certain situations where this.optionList is not fully updated during slotchange\n // Hence instead of using this.optionList, we have to perform a query on the <sgds-combo-box-option> elements\n const optionList = this.options.map(o => ({ value: o.value, label: o.textContent.trim() }));\n this.filteredList = optionList.filter(item => this.filterFunction(this.displayValue, item));\n\n // Filtering for slots\n this.emptyMenuAfterFiltering = this.filteredList.length === 0;\n const filteredValues = this.filteredList.map(l => l.value);\n\n this.options.forEach(o => {\n if (!filteredValues.includes(o.value)) {\n o.hidden = true;\n } else {\n o.hidden = false;\n }\n });\n }\n\n /**\n * Called whenever an <sgds-combo-box-option> dispatches sgds-select\"\n */\n protected async _handleItemSelected(e: Event) {\n const itemEl = e.target as SgdsComboBoxOption;\n if (itemEl.disabled) return;\n\n const itemLabel = itemEl.textContent?.trim() ?? \"\";\n const itemValueAttr = itemEl.getAttribute(\"value\") ?? itemLabel;\n const foundItem = this.filteredList.find(i => i.value.toString() === itemValueAttr) || {\n label: itemLabel,\n value: itemValueAttr\n };\n\n if (this.multiSelect) {\n if (!this.selectedItems.some(i => i.value === foundItem.value)) {\n this.selectedItems = [...this.selectedItems, foundItem];\n }\n\n this.value = this.selectedItems.map(i => i.value).join(\";\");\n itemEl.active = true;\n } else {\n // Single-select\n // Only update active states if a new item is selected\n if (this.selectedItems.length === 0 || this.selectedItems[0].value !== foundItem.value) {\n // Remove active from all options\n this.options.forEach(o => (o.active = false));\n itemEl.active = true;\n\n this.selectedItems = [foundItem];\n this.value = foundItem.value.toString();\n this.displayValue = foundItem.label;\n this.hideMenu();\n }\n }\n }\n\n private _handleItemUnselect(e: Event) {\n const itemEl = e.target as SgdsComboBoxOption;\n if (itemEl.disabled) return;\n\n itemEl.removeAttribute(\"active\");\n const itemLabel = itemEl.textContent?.trim() ?? \"\";\n const itemValueAttr = itemEl.getAttribute(\"value\") ?? itemLabel;\n const foundItem = this.filteredList.find(i => i.value.toString() === itemValueAttr) || {\n label: itemLabel,\n value: itemValueAttr\n };\n\n this.selectedItems = this.selectedItems.filter(i => i.value !== foundItem.value);\n this.value = this.selectedItems.map(i => i.value).join(\";\");\n }\n\n private async _handleBadgeDismissed(e: CustomEvent, item: SgdsComboBoxOptionData) {\n e.preventDefault();\n const removedValue = item.value;\n this.options?.forEach(o => (o.value === removedValue ? (o.active = false) : null));\n this.selectedItems = this.selectedItems.filter(i => i.value !== item.value);\n this.value = this.selectedItems.map(i => i.value).join(\";\");\n }\n\n private async _handleMultiSelectKeyDown(e: KeyboardEvent) {\n // Only do this in multi-select mode\n if (!this.multiSelect) {\n return;\n }\n\n if (e.key === \"Backspace\" && this.multiSelect) {\n if (this.displayValue.trim() === \"\" && this.selectedItems.length > 0) {\n const removedValue = this.selectedItems[this.selectedItems.length - 1].value;\n this.options?.forEach(o => (o.value === removedValue ? (o.active = false) : null));\n this.selectedItems = this.selectedItems.slice(0, -1);\n this.value = this.selectedItems.map(i => i.value).join(\";\");\n }\n }\n }\n\n protected _handleFocus() {\n this.emit(\"sgds-focus\");\n }\n\n protected async _handleInputBlur(e: Event) {\n e.preventDefault();\n\n this.emit(\"sgds-blur\");\n\n if (this.multiSelect) {\n const displayValueMatchedSelectedItems = this.selectedItems.filter(({ label }) => this.displayValue === label);\n if (displayValueMatchedSelectedItems.length <= 0) {\n this.displayValue = \"\";\n }\n } else {\n // Single select\n if (this.selectedItems.length > 0) {\n this.displayValue = this.selectedItems[0].label;\n } else {\n this.displayValue = \"\";\n }\n }\n }\n\n // For clearing the value\n protected async _handleClear() {\n this.value = this.displayValue = \"\";\n this.options?.forEach(o => (o.active = false));\n\n const sgdsInput = await this._input;\n sgdsInput.focus();\n this.showMenu();\n }\n\n /** For form reset */\n protected async _mixinResetFormControl() {\n this.value = this.defaultValue;\n if (!this.multiSelect) {\n //reset menu\n this.options.forEach(o => {\n o.active = o.value === this.value;\n });\n const initialOption = this.options.filter(o => o.value === this.value);\n if (initialOption.length <= 0) {\n this.displayValue = \"\";\n } else {\n this.displayValue = initialOption[0].textContent.trim();\n }\n this._mixinResetValidity(await this._input);\n } else {\n const valueArray = this.value.split(\";\");\n // reset menu\n this.options.forEach(o => {\n o.active = valueArray.includes(o.value);\n });\n const initialOption = this.options.filter(o => valueArray.includes(o.value));\n this.selectedItems = initialOption.map(o => ({ value: o.value, label: o.textContent.trim() }));\n this._mixinResetValidity(await this._multiSelectInput);\n }\n }\n\n /** Template for the suffix icon */\n protected suffixIconTemplate: TemplateResult = html`<sgds-icon\n name=${this.menuIsOpen ? \"chevron-up\" : \"chevron-down\"}\n size=\"md\"\n ></sgds-icon>`;\n\n protected prefixIconTemplate: TemplateResult = html`${nothing}`;\n /**\n * Used `repeat` helper from Lit to render instead of .map:\n * The reassigning of value is affecting the truncation on badge as it is not triggering the slot change event.\n *\n * To compare this to lit-html's default handling for lists, consider reversing a large list of names:\n * For a list created using Array.map, lit-html maintains the DOM nodes for the list items, but reassigns the values\n * For a list created using repeat, the repeat directive reorders the existing DOM nodes, so the nodes representing the first list item move to the last position.\n */\n protected _renderInput(showClearButton: boolean): TemplateResult {\n const wantFeedbackStyle = this.hasFeedback;\n const showButton = showClearButton;\n\n return html`\n <div\n ${ref(this.myDropdown)}\n class=\"form-control-group ${classMap({\n disabled: this.disabled,\n readonly: this.readonly,\n \"is-invalid\": this.invalid && wantFeedbackStyle\n })}\"\n @click=${this._handleClick}\n >\n ${this.prefixIconTemplate}\n <div class=\"combobox-input-container\">\n ${this.multiSelect\n ? html`\n ${repeat(\n this.selectedItems,\n item => item.value,\n item =>\n html`<sgds-badge\n outlined\n variant=\"neutral\"\n show\n ?dismissible=${!(this.readonly || this.disabled)}\n ?fullwidth=${this.badgeFullWidth}\n @sgds-hide=${e => this._handleBadgeDismissed(e, item)}\n >${item.label}</sgds-badge\n >`\n )}\n `\n : nothing}\n <input\n class=\"form-control\"\n type=\"text\"\n id=${this._controlId}\n name=${ifDefined(this.name)}\n placeholder=${ifDefined(this.placeholder)}\n aria-invalid=${this.invalid ? \"true\" : \"false\"}\n ?autofocus=${this.autofocus}\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n ?required=${this.required}\n .value=${this.displayValue ? this.displayValue.trim() : \"\"}\n @input=${this._handleInputChange}\n @blur=${this._handleInputBlur}\n @focus=${this._handleFocus}\n aria-describedby=${ifDefined(this.invalid && this.hasFeedback ? `${this._controlId}-invalid` : undefined)}\n aria-labelledby=\"${this._labelId} ${this._controlId}Help ${this.invalid && this.hasFeedback\n ? `${this._controlId}-invalid`\n : \"\"}\"\n />\n </div>\n\n ${showButton\n ? html`\n <sgds-icon\n id=${`${this._controlId}-combobox-clear-button`}\n tabindex=\"0\"\n class=\"form-clearable\"\n name=\"xcircle-fill\"\n size=\"md\"\n @click=${this._handleClear}\n aria-label=\"Clear selections\"\n role=\"button\"\n ></sgds-icon>\n `\n : nothing}\n ${this.suffixIconTemplate}\n </div>\n `;\n }\n\n protected _renderFeedbackMenu() {\n if (this.loading) {\n return this._renderLoadingMenu();\n }\n // When async, the filtering is done by remote server, so we do not check for emptyMenu of combobox filterFunction\n if (this.async) {\n return this.emptyMenuAsync || this.optionList.length === 0 ? this._renderEmptyMenu() : nothing;\n } else {\n return this.optionList.length === 0 || // no options at all\n (this.emptyMenuAfterFiltering && this.optionList.length > 0) // check if filtering results in empty menu\n ? this._renderEmptyMenu()\n : nothing;\n }\n }\n\n render() {\n const showClearButton =\n (this.isFocused || this.menuIsOpen) && this.value !== \"\" && this.clearable && !this.readonly;\n return html`\n <div\n class=${classMap({ \"form-control-container\": true, disabled: this.disabled, combobox: true })}\n @keydown=${this._handleMultiSelectKeyDown}\n >\n ${this._renderLabel()}\n <!-- The input -->\n ${this._renderInput(showClearButton)} ${this._renderFeedback()}\n\n <ul id=${this.dropdownMenuId} class=\"dropdown-menu\" part=\"menu\" tabindex=\"-1\" ${ref(this.menuRef)}>\n <slot\n id=\"default\"\n class=${classMap({ \"d-none\": this.loading || this.emptyMenuAsync || this.optionList.length === 0 })}\n @slotchange=${this._handleDefaultSlotChange}\n ></slot>\n ${this._renderFeedbackMenu()}\n </ul>\n </div>\n\n <!-- Required an input element for constraint validation -->\n ${this.multiSelect\n ? html`<input\n .value=${live(this.value)}\n id=\"multi-select-input-tracker\"\n class=\"visually-hidden\"\n ?required=${this.required}\n tabindex=\"-1\"\n />`\n : nothing}\n `;\n }\n}\n\ninterface ComboBoxOptionWithFlag extends SgdsComboBoxOption {\n clickEventAdded?: boolean;\n}\n\nexport default SgdsComboBox;\n\n//TODO:\n// Replace this.optionList ?\n// During slotchange event _handleDefaultSlotChange, we try to populate this.optionList to obtain value attribute and textContent as label from <sgds-combo-box-option>\n// However, it has race conditions in certain situation like nextjs, where the last option's label (essentially the slot of <sgds-combo-box-option>) may not be available immediately.\n// To circumvent this, I avoid relying on this.optionList to perform filterFunction onInput handler and query this.options directly at the point of user typing.\n// To prevent confusion, this.optionList should ideally be removed in future iterations\n"],"names":["formTextControlStyle","comboBoxStyle"],"mappings":";;;;;;;;;;;;;;;;;AA4BA;;;;;;;;;;AAUG;AACG,MAAO,YAAa,SAAQ,aAAa,CAAA;AAA/C,IAAA,WAAA,GAAA;;;QAY8C,IAAW,CAAA,WAAA,GAAG,KAAK,CAAC;;QAGpB,IAAc,CAAA,cAAA,GAAG,KAAK,CAAC;;QAGvB,IAAS,CAAA,SAAA,GAAG,KAAK,CAAC;;QAGlB,IAAK,CAAA,KAAA,GAAG,KAAK,CAAC;;QAGd,IAAc,CAAA,cAAA,GAAG,KAAK,CAAC;;AAInE,QAAA,IAAA,CAAA,cAAc,GAAkE,CAAC,UAAU,EAAE,IAAI,KAAI;AACnG,YAAA,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,CAAC;AACvE,SAAC,CAAC;QAOe,IAAU,CAAA,UAAA,GAA6B,EAAE,CAAC;QAC1C,IAAuB,CAAA,uBAAA,GAAG,KAAK,CAAC;;QAG9B,IAAS,CAAA,SAAA,GAAG,KAAK,CAAC;;QAkV3B,IAAkB,CAAA,kBAAA,GAAmB,IAAI,CAAA,CAAA;WAC1C,IAAI,CAAC,UAAU,GAAG,YAAY,GAAG,cAAc,CAAA;;gBAE1C,CAAC;AAEL,QAAA,IAAA,CAAA,kBAAkB,GAAmB,IAAI,CAAA,CAAG,EAAA,OAAO,EAAE,CAAC;KAqIjE;IA1dC,iBAAiB,GAAA;QACf,KAAK,CAAC,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,CAAA,SAAA,EAAA,yBAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAG9B,UAAA,CAAA;AAAlB,IAAA,KAAK,EAAE;AAA6B,CAAA,EAAA,YAAA,CAAA,SAAA,EAAA,WAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAwG/B,UAAA,CAAA;IADL,KAAK,CAAC,OAAO,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;AA2B9C,CAAA,EAAA,YAAA,CAAA,SAAA,EAAA,oBAAA,EAAA,IAAA,CAAA,CAAA;AAGD,UAAA,CAAA;IADC,KAAK,CAAC,YAAY,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;AAGnD,CAAA,EAAA,YAAA,CAAA,SAAA,EAAA,yBAAA,EAAA,IAAA,CAAA,CAAA;AAGD,UAAA,CAAA;IADC,KAAK,CAAC,UAAU,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;AAYjD,CAAA,EAAA,YAAA,CAAA,SAAA,EAAA,uBAAA,EAAA,IAAA,CAAA,CAAA;AA+UH;AACA;AACA;AACA;AACA;AACA;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
2
|
|
|
3
|
-
var css_248z = css`:host{--datepicker-theme-color:var(--sgds-primary);--datepicker-hover-bg:var(--sgds-primary-100);--datepicker-bg:#fff;--datepicker-close-btn-bg:var(--datepicker-theme-color);--datepicker-close-btn-hover-bg:var(--sgds-primary-700);--datepicker-close-btn-color:#fff;--datepicker-selected-date-bg:var(--sgds-primary);--datepicker-selected-date-color:#fff;font-size:var(--sgds-font-size-14)}:host([menuisopen]) .dropdown-menu{background-color:var(--sgds-form-surface-default);display:flex;flex-direction:column;gap:var(--sgds-form-gap-sm);overflow:unset;padding:var(--sgds-form-padding-y) var(--sgds-form-padding-x);width:var(--sgds-dimension-320)}.dropdown{display:flex;height:100%}sgds-datepicker-input{--input-border-radius:var(--sgds-form-border-radius-md) 0 0 var(--sgds-form-border-radius-md);flex:1;margin-right:0}sgds-icon-button{--btn-border-radius:0 var(--sgds-form-border-radius-md) var(--sgds-form-border-radius-md) 0}.datepicker-container{display:flex}.calendar-btn:not(.with-hint-text){align-self:center}.calendar-btn:not(.with-hint-text).with-label{align-self:end;margin-top:calc(var(--sgds-line-height-24) - var(--sgds-line-height-20))}.calendar-btn.with-hint-text.with-label{align-self:center;margin-top:calc(var(--sgds-line-height-24) - var(--sgds-line-height-20))}`;
|
|
3
|
+
var css_248z = css`:host{--datepicker-theme-color:var(--sgds-primary);--datepicker-hover-bg:var(--sgds-primary-100);--datepicker-bg:#fff;--datepicker-close-btn-bg:var(--datepicker-theme-color);--datepicker-close-btn-hover-bg:var(--sgds-primary-700);--datepicker-close-btn-color:#fff;--datepicker-selected-date-bg:var(--sgds-primary);--datepicker-selected-date-color:#fff;font-size:var(--sgds-font-size-14)}:host([menuisopen]:not([disabled]):not([readonly])) .dropdown-menu{background-color:var(--sgds-form-surface-default);display:flex;flex-direction:column;gap:var(--sgds-form-gap-sm);overflow:unset;padding:var(--sgds-form-padding-y) var(--sgds-form-padding-x);width:var(--sgds-dimension-320)}.dropdown{display:flex;height:100%}sgds-datepicker-input{--input-border-radius:var(--sgds-form-border-radius-md) 0 0 var(--sgds-form-border-radius-md);flex:1;margin-right:0}sgds-icon-button{--btn-border-radius:0 var(--sgds-form-border-radius-md) var(--sgds-form-border-radius-md) 0}.datepicker-container{display:flex}.calendar-btn:not(.with-hint-text){align-self:center}.calendar-btn:not(.with-hint-text).with-label{align-self:end;margin-top:calc(var(--sgds-line-height-24) - var(--sgds-line-height-20))}.calendar-btn.with-hint-text.with-label{align-self:center;margin-top:calc(var(--sgds-line-height-24) - var(--sgds-line-height-20))}`;
|
|
4
4
|
|
|
5
5
|
export { css_248z as default };
|
|
6
6
|
//# sourceMappingURL=datepicker.js.map
|
|
@@ -67,7 +67,7 @@ class extends Ii{constructor(t){if(super(t),t.type!==Hi&&t.type!==Ei&&t.type!==$
|
|
|
67
67
|
* @license
|
|
68
68
|
* Copyright 2020 Google LLC
|
|
69
69
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
70
|
-
*/const ji=()=>new Gi;class Gi{}const Ki=new WeakMap;const Qi=Ti(class extends Wi{render(t){return ii}update(t,[e]){const i=e!==this._ref;return i&&void 0!==this._ref&&this._updateRefValue(void 0),(i||this._lastElementForRef!==this._element)&&(this._ref=e,this._context=t.options?.host,this._updateRefValue(this._element=t.element)),ii}_updateRefValue(t){if(this.isConnected||(t=void 0),"function"==typeof this._ref){const e=this._context??globalThis;let i=Ki.get(e);void 0===i&&(i=new WeakMap,Ki.set(e,i)),void 0!==i.get(this._ref)&&this._ref.call(this._context,void 0),i.set(this._ref,t),void 0!==t&&this._ref.call(this._context,t)}else this._ref.value=t}get _lastElementForRef(){return"function"==typeof this._ref?Ki.get(this._context??globalThis)?.get(this._ref):this._ref?.value}disconnected(){this._lastElementForRef===this._element&&this._updateRefValue(void 0)}reconnected(){this._updateRefValue(this._element)}}),Xi=Math.min,Ji=Math.max,ta=Math.round,ea=Math.floor,ia=t=>({x:t,y:t}),aa={left:"right",right:"left",bottom:"top",top:"bottom"},sa={start:"end",end:"start"};function na(t,e,i){return Ji(t,Xi(e,i))}function ra(t,e){return"function"==typeof t?t(e):t}function oa(t){return t.split("-")[0]}function la(t){return t.split("-")[1]}function ca(t){return"x"===t?"y":"x"}function da(t){return"y"===t?"height":"width"}const ha=new Set(["top","bottom"]);function ua(t){return ha.has(oa(t))?"y":"x"}function pa(t){return ca(ua(t))}function ga(t,e,i){void 0===i&&(i=!1);const a=la(t),s=pa(t),n=da(s);let r="x"===s?a===(i?"end":"start")?"right":"left":"start"===a?"bottom":"top";return e.reference[n]>e.floating[n]&&(r=xa(r)),[r,xa(r)]}function va(t){return t.replace(/start|end/g,t=>sa[t])}const fa=["left","right"],ma=["right","left"],wa=["top","bottom"],ya=["bottom","top"];function ba(t,e,i,a){const s=la(t);let n=function(t,e,i){switch(t){case"top":case"bottom":return i?e?ma:fa:e?fa:ma;case"left":case"right":return e?wa:ya;default:return[]}}(oa(t),"start"===i,a);return s&&(n=n.map(t=>t+"-"+s),e&&(n=n.concat(n.map(va)))),n}function xa(t){return t.replace(/left|right|bottom|top/g,t=>aa[t])}function _a(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function Ca(t){const{x:e,y:i,width:a,height:s}=t;return{width:a,height:s,top:i,left:e,right:e+a,bottom:i+s,x:e,y:i}}function ka(t,e,i){let{reference:a,floating:s}=t;const n=ua(e),r=pa(e),o=da(r),l=oa(e),c="y"===n,d=a.x+a.width/2-s.width/2,h=a.y+a.height/2-s.height/2,u=a[o]/2-s[o]/2;let p;switch(l){case"top":p={x:d,y:a.y-s.height};break;case"bottom":p={x:d,y:a.y+a.height};break;case"right":p={x:a.x+a.width,y:h};break;case"left":p={x:a.x-s.width,y:h};break;default:p={x:a.x,y:a.y}}switch(la(e)){case"start":p[r]-=u*(i&&c?-1:1);break;case"end":p[r]+=u*(i&&c?-1:1)}return p}async function Ma(t,e){var i;void 0===e&&(e={});const{x:a,y:s,platform:n,rects:r,elements:o,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:u=!1,padding:p=0}=ra(e,t),g=_a(p),v=o[u?"floating"===h?"reference":"floating":h],f=Ca(await n.getClippingRect({element:null==(i=await(null==n.isElement?void 0:n.isElement(v)))||i?v:v.contextElement||await(null==n.getDocumentElement?void 0:n.getDocumentElement(o.floating)),boundary:c,rootBoundary:d,strategy:l})),m="floating"===h?{x:a,y:s,width:r.floating.width,height:r.floating.height}:r.reference,w=await(null==n.getOffsetParent?void 0:n.getOffsetParent(o.floating)),y=await(null==n.isElement?void 0:n.isElement(w))&&await(null==n.getScale?void 0:n.getScale(w))||{x:1,y:1},b=Ca(n.convertOffsetParentRelativeRectToViewportRelativeRect?await n.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:m,offsetParent:w,strategy:l}):m);return{top:(f.top-b.top+g.top)/y.y,bottom:(b.bottom-f.bottom+g.bottom)/y.y,left:(f.left-b.left+g.left)/y.x,right:(b.right-f.right+g.right)/y.x}}const Za=new Set(["left","top"]);function Va(){return"undefined"!=typeof window}function Sa(t){return Ba(t)?(t.nodeName||"").toLowerCase():"#document"}function Da(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function Aa(t){var e;return null==(e=(Ba(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function Ba(t){return!!Va()&&(t instanceof Node||t instanceof Da(t).Node)}function Ea(t){return!!Va()&&(t instanceof Element||t instanceof Da(t).Element)}function Fa(t){return!!Va()&&(t instanceof HTMLElement||t instanceof Da(t).HTMLElement)}function Ha(t){return!(!Va()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof Da(t).ShadowRoot)}const $a=new Set(["inline","contents"]);function Ta(t){const{overflow:e,overflowX:i,overflowY:a,display:s}=ja(t);return/auto|scroll|overlay|hidden|clip/.test(e+a+i)&&!$a.has(s)}const Ia=new Set(["table","td","th"]);function Pa(t){return Ia.has(Sa(t))}const La=[":popover-open",":modal"];function Ra(t){return La.some(e=>{try{return t.matches(e)}catch(t){return!1}})}const Oa=["transform","translate","scale","rotate","perspective"],Ya=["transform","translate","scale","rotate","perspective","filter"],Na=["paint","layout","strict","content"];function za(t){const e=Ua(),i=Ea(t)?ja(t):t;return Oa.some(t=>!!i[t]&&"none"!==i[t])||!!i.containerType&&"normal"!==i.containerType||!e&&!!i.backdropFilter&&"none"!==i.backdropFilter||!e&&!!i.filter&&"none"!==i.filter||Ya.some(t=>(i.willChange||"").includes(t))||Na.some(t=>(i.contain||"").includes(t))}function Ua(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const qa=new Set(["html","body","#document"]);function Wa(t){return qa.has(Sa(t))}function ja(t){return Da(t).getComputedStyle(t)}function Ga(t){return Ea(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Ka(t){if("html"===Sa(t))return t;const e=t.assignedSlot||t.parentNode||Ha(t)&&t.host||Aa(t);return Ha(e)?e.host:e}function Qa(t){const e=Ka(t);return Wa(e)?t.ownerDocument?t.ownerDocument.body:t.body:Fa(e)&&Ta(e)?e:Qa(e)}function Xa(t,e,i){var a;void 0===e&&(e=[]),void 0===i&&(i=!0);const s=Qa(t),n=s===(null==(a=t.ownerDocument)?void 0:a.body),r=Da(s);if(n){const t=Ja(r);return e.concat(r,r.visualViewport||[],Ta(s)?s:[],t&&i?Xa(t):[])}return e.concat(s,Xa(s,[],i))}function Ja(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function ts(t){const e=ja(t);let i=parseFloat(e.width)||0,a=parseFloat(e.height)||0;const s=Fa(t),n=s?t.offsetWidth:i,r=s?t.offsetHeight:a,o=ta(i)!==n||ta(a)!==r;return o&&(i=n,a=r),{width:i,height:a,$:o}}function es(t){return Ea(t)?t:t.contextElement}function is(t){const e=es(t);if(!Fa(e))return ia(1);const i=e.getBoundingClientRect(),{width:a,height:s,$:n}=ts(e);let r=(n?ta(i.width):i.width)/a,o=(n?ta(i.height):i.height)/s;return r&&Number.isFinite(r)||(r=1),o&&Number.isFinite(o)||(o=1),{x:r,y:o}}const as=ia(0);function ss(t){const e=Da(t);return Ua()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:as}function ns(t,e,i,a){void 0===e&&(e=!1),void 0===i&&(i=!1);const s=t.getBoundingClientRect(),n=es(t);let r=ia(1);e&&(a?Ea(a)&&(r=is(a)):r=is(t));const o=function(t,e,i){return void 0===e&&(e=!1),!(!i||e&&i!==Da(t))&&e}(n,i,a)?ss(n):ia(0);let l=(s.left+o.x)/r.x,c=(s.top+o.y)/r.y,d=s.width/r.x,h=s.height/r.y;if(n){const t=Da(n),e=a&&Ea(a)?Da(a):a;let i=t,s=Ja(i);for(;s&&a&&e!==i;){const t=is(s),e=s.getBoundingClientRect(),a=ja(s),n=e.left+(s.clientLeft+parseFloat(a.paddingLeft))*t.x,r=e.top+(s.clientTop+parseFloat(a.paddingTop))*t.y;l*=t.x,c*=t.y,d*=t.x,h*=t.y,l+=n,c+=r,i=Da(s),s=Ja(i)}}return Ca({width:d,height:h,x:l,y:c})}function rs(t,e){const i=Ga(t).scrollLeft;return e?e.left+i:ns(Aa(t)).left+i}function os(t,e){const i=t.getBoundingClientRect();return{x:i.left+e.scrollLeft-rs(t,i),y:i.top+e.scrollTop}}const ls=new Set(["absolute","fixed"]);function cs(t,e,i){let a;if("viewport"===e)a=function(t,e){const i=Da(t),a=Aa(t),s=i.visualViewport;let n=a.clientWidth,r=a.clientHeight,o=0,l=0;if(s){n=s.width,r=s.height;const t=Ua();(!t||t&&"fixed"===e)&&(o=s.offsetLeft,l=s.offsetTop)}const c=rs(a);if(c<=0){const t=a.ownerDocument,e=t.body,i=getComputedStyle(e),s="CSS1Compat"===t.compatMode&&parseFloat(i.marginLeft)+parseFloat(i.marginRight)||0,r=Math.abs(a.clientWidth-e.clientWidth-s);r<=25&&(n-=r)}else c<=25&&(n+=c);return{width:n,height:r,x:o,y:l}}(t,i);else if("document"===e)a=function(t){const e=Aa(t),i=Ga(t),a=t.ownerDocument.body,s=Ji(e.scrollWidth,e.clientWidth,a.scrollWidth,a.clientWidth),n=Ji(e.scrollHeight,e.clientHeight,a.scrollHeight,a.clientHeight);let r=-i.scrollLeft+rs(t);const o=-i.scrollTop;return"rtl"===ja(a).direction&&(r+=Ji(e.clientWidth,a.clientWidth)-s),{width:s,height:n,x:r,y:o}}(Aa(t));else if(Ea(e))a=function(t,e){const i=ns(t,!0,"fixed"===e),a=i.top+t.clientTop,s=i.left+t.clientLeft,n=Fa(t)?is(t):ia(1);return{width:t.clientWidth*n.x,height:t.clientHeight*n.y,x:s*n.x,y:a*n.y}}(e,i);else{const i=ss(t);a={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Ca(a)}function ds(t,e){const i=Ka(t);return!(i===e||!Ea(i)||Wa(i))&&("fixed"===ja(i).position||ds(i,e))}function hs(t,e,i){const a=Fa(e),s=Aa(e),n="fixed"===i,r=ns(t,!0,n,e);let o={scrollLeft:0,scrollTop:0};const l=ia(0);function c(){l.x=rs(s)}if(a||!a&&!n)if(("body"!==Sa(e)||Ta(s))&&(o=Ga(e)),a){const t=ns(e,!0,n,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else s&&c();n&&!a&&s&&c();const d=!s||a||n?ia(0):os(s,o);return{x:r.left+o.scrollLeft-l.x-d.x,y:r.top+o.scrollTop-l.y-d.y,width:r.width,height:r.height}}function us(t){return"static"===ja(t).position}function ps(t,e){if(!Fa(t)||"fixed"===ja(t).position)return null;if(e)return e(t);let i=t.offsetParent;return Aa(t)===i&&(i=i.ownerDocument.body),i}function gs(t,e){const i=Da(t);if(Ra(t))return i;if(!Fa(t)){let e=Ka(t);for(;e&&!Wa(e);){if(Ea(e)&&!us(e))return e;e=Ka(e)}return i}let a=ps(t,e);for(;a&&Pa(a)&&us(a);)a=ps(a,e);return a&&Wa(a)&&us(a)&&!za(a)?i:a||function(t){let e=Ka(t);for(;Fa(e)&&!Wa(e);){if(za(e))return e;if(Ra(e))return null;e=Ka(e)}return null}(t)||i}const vs={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:i,offsetParent:a,strategy:s}=t;const n="fixed"===s,r=Aa(a),o=!!e&&Ra(e.floating);if(a===r||o&&n)return i;let l={scrollLeft:0,scrollTop:0},c=ia(1);const d=ia(0),h=Fa(a);if((h||!h&&!n)&&(("body"!==Sa(a)||Ta(r))&&(l=Ga(a)),Fa(a))){const t=ns(a);c=is(a),d.x=t.x+a.clientLeft,d.y=t.y+a.clientTop}const u=!r||h||n?ia(0):os(r,l);return{width:i.width*c.x,height:i.height*c.y,x:i.x*c.x-l.scrollLeft*c.x+d.x+u.x,y:i.y*c.y-l.scrollTop*c.y+d.y+u.y}},getDocumentElement:Aa,getClippingRect:function(t){let{element:e,boundary:i,rootBoundary:a,strategy:s}=t;const n=[..."clippingAncestors"===i?Ra(e)?[]:function(t,e){const i=e.get(t);if(i)return i;let a=Xa(t,[],!1).filter(t=>Ea(t)&&"body"!==Sa(t)),s=null;const n="fixed"===ja(t).position;let r=n?Ka(t):t;for(;Ea(r)&&!Wa(r);){const e=ja(r),i=za(r);i||"fixed"!==e.position||(s=null),(n?!i&&!s:!i&&"static"===e.position&&s&&ls.has(s.position)||Ta(r)&&!i&&ds(t,r))?a=a.filter(t=>t!==r):s=e,r=Ka(r)}return e.set(t,a),a}(e,this._c):[].concat(i),a],r=n[0],o=n.reduce((t,i)=>{const a=cs(e,i,s);return t.top=Ji(a.top,t.top),t.right=Xi(a.right,t.right),t.bottom=Xi(a.bottom,t.bottom),t.left=Ji(a.left,t.left),t},cs(e,r,s));return{width:o.right-o.left,height:o.bottom-o.top,x:o.left,y:o.top}},getOffsetParent:gs,getElementRects:async function(t){const e=this.getOffsetParent||gs,i=this.getDimensions,a=await i(t.floating);return{reference:hs(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:i}=ts(t);return{width:e,height:i}},getScale:is,isElement:Ea,isRTL:function(t){return"rtl"===ja(t).direction}};function fs(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function ms(t,e,i,a){void 0===a&&(a={});const{ancestorScroll:s=!0,ancestorResize:n=!0,elementResize:r="function"==typeof ResizeObserver,layoutShift:o="function"==typeof IntersectionObserver,animationFrame:l=!1}=a,c=es(t),d=s||n?[...c?Xa(c):[],...Xa(e)]:[];d.forEach(t=>{s&&t.addEventListener("scroll",i,{passive:!0}),n&&t.addEventListener("resize",i)});const h=c&&o?function(t,e){let i,a=null;const s=Aa(t);function n(){var t;clearTimeout(i),null==(t=a)||t.disconnect(),a=null}return function r(o,l){void 0===o&&(o=!1),void 0===l&&(l=1),n();const c=t.getBoundingClientRect(),{left:d,top:h,width:u,height:p}=c;if(o||e(),!u||!p)return;const g={rootMargin:-ea(h)+"px "+-ea(s.clientWidth-(d+u))+"px "+-ea(s.clientHeight-(h+p))+"px "+-ea(d)+"px",threshold:Ji(0,Xi(1,l))||1};let v=!0;function f(e){const a=e[0].intersectionRatio;if(a!==l){if(!v)return r();a?r(!1,a):i=setTimeout(()=>{r(!1,1e-7)},1e3)}1!==a||fs(c,t.getBoundingClientRect())||r(),v=!1}try{a=new IntersectionObserver(f,{...g,root:s.ownerDocument})}catch(t){a=new IntersectionObserver(f,g)}a.observe(t)}(!0),n}(c,i):null;let u,p=-1,g=null;r&&(g=new ResizeObserver(t=>{let[a]=t;a&&a.target===c&&g&&(g.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var t;null==(t=g)||t.observe(e)})),i()}),c&&!l&&g.observe(c),g.observe(e));let v=l?ns(t):null;return l&&function e(){const a=ns(t);v&&!fs(v,a)&&i();v=a,u=requestAnimationFrame(e)}(),i(),()=>{var t;d.forEach(t=>{s&&t.removeEventListener("scroll",i),n&&t.removeEventListener("resize",i)}),null==h||h(),null==(t=g)||t.disconnect(),g=null,l&&cancelAnimationFrame(u)}}const ws=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var i,a;const{x:s,y:n,placement:r,middlewareData:o}=e,l=await async function(t,e){const{placement:i,platform:a,elements:s}=t,n=await(null==a.isRTL?void 0:a.isRTL(s.floating)),r=oa(i),o=la(i),l="y"===ua(i),c=Za.has(r)?-1:1,d=n&&l?-1:1,h=ra(e,t);let{mainAxis:u,crossAxis:p,alignmentAxis:g}="number"==typeof h?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return o&&"number"==typeof g&&(p="end"===o?-1*g:g),l?{x:p*d,y:u*c}:{x:u*c,y:p*d}}(e,t);return r===(null==(i=o.offset)?void 0:i.placement)&&null!=(a=o.arrow)&&a.alignmentOffset?{}:{x:s+l.x,y:n+l.y,data:{...l,placement:r}}}}},ys=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:i,y:a,placement:s}=e,{mainAxis:n=!0,crossAxis:r=!1,limiter:o={fn:t=>{let{x:e,y:i}=t;return{x:e,y:i}}},...l}=ra(t,e),c={x:i,y:a},d=await Ma(e,l),h=ua(oa(s)),u=ca(h);let p=c[u],g=c[h];if(n){const t="y"===u?"bottom":"right";p=na(p+d["y"===u?"top":"left"],p,p-d[t])}if(r){const t="y"===h?"bottom":"right";g=na(g+d["y"===h?"top":"left"],g,g-d[t])}const v=o.fn({...e,[u]:p,[h]:g});return{...v,data:{x:v.x-i,y:v.y-a,enabled:{[u]:n,[h]:r}}}}}},bs=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var i,a;const{placement:s,middlewareData:n,rects:r,initialPlacement:o,platform:l,elements:c}=e,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:u,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:v=!0,...f}=ra(t,e);if(null!=(i=n.arrow)&&i.alignmentOffset)return{};const m=oa(s),w=ua(o),y=oa(o)===o,b=await(null==l.isRTL?void 0:l.isRTL(c.floating)),x=u||(y||!v?[xa(o)]:function(t){const e=xa(t);return[va(t),e,va(e)]}(o)),_="none"!==g;!u&&_&&x.push(...ba(o,v,g,b));const C=[o,...x],k=await Ma(e,f),M=[];let Z=(null==(a=n.flip)?void 0:a.overflows)||[];if(d&&M.push(k[m]),h){const t=ga(s,r,b);M.push(k[t[0]],k[t[1]])}if(Z=[...Z,{placement:s,overflows:M}],!M.every(t=>t<=0)){var V,S;const t=((null==(V=n.flip)?void 0:V.index)||0)+1,e=C[t];if(e){if(!("alignment"===h&&w!==ua(e))||Z.every(t=>ua(t.placement)!==w||t.overflows[0]>0))return{data:{index:t,overflows:Z},reset:{placement:e}}}let i=null==(S=Z.filter(t=>t.overflows[0]<=0).sort((t,e)=>t.overflows[1]-e.overflows[1])[0])?void 0:S.placement;if(!i)switch(p){case"bestFit":{var D;const t=null==(D=Z.filter(t=>{if(_){const e=ua(t.placement);return e===w||"y"===e}return!0}).map(t=>[t.placement,t.overflows.filter(t=>t>0).reduce((t,e)=>t+e,0)]).sort((t,e)=>t[1]-e[1])[0])?void 0:D[0];t&&(i=t);break}case"initialPlacement":i=o}if(s!==i)return{reset:{placement:i}}}return{}}}},xs=(t,e,i)=>{const a=new Map,s={platform:vs,...i},n={...s.platform,_c:a};return(async(t,e,i)=>{const{placement:a="bottom",strategy:s="absolute",middleware:n=[],platform:r}=i,o=n.filter(Boolean),l=await(null==r.isRTL?void 0:r.isRTL(e));let c=await r.getElementRects({reference:t,floating:e,strategy:s}),{x:d,y:h}=ka(c,a,l),u=a,p={},g=0;for(let i=0;i<o.length;i++){const{name:n,fn:v}=o[i],{x:f,y:m,data:w,reset:y}=await v({x:d,y:h,initialPlacement:a,placement:u,strategy:s,middlewareData:p,rects:c,platform:r,elements:{reference:t,floating:e}});d=null!=f?f:d,h=null!=m?m:h,p={...p,[n]:{...p[n],...w}},y&&g<=50&&(g++,"object"==typeof y&&(y.placement&&(u=y.placement),y.rects&&(c=!0===y.rects?await r.getElementRects({reference:t,floating:e,strategy:s}):y.rects),({x:d,y:h}=ka(c,u,l))),i=-1)}return{x:d,y:h,placement:u,strategy:s,middlewareData:p}})(t,e,{...s,platform:n})};var _s=re`: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 Cs extends bi{emit(t,e){const i=new CustomEvent(t,Object.assign({bubbles:!0,cancelable:!1,composed:!0,detail:{}},e));return this.dispatchEvent(i),i}static define(t,e=this,i={}){if(customElements.get(t));else try{customElements.define(t,e,i)}catch(a){customElements.define(t,class extends e{},i)}}constructor(){super(),this.ssr=Boolean(this.shadowRoot),Object.entries(this.constructor.dependencies).forEach(([t,e])=>{this.constructor.define(t,e)})}firstUpdated(t){var e;super.firstUpdated(t),this.ssr&&(null===(e=this.shadowRoot)||void 0===e||e.querySelectorAll("slot").forEach(t=>{t.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1,cancelable:!1}))}))}}function ks(t="",e=""){return`id-${Math.random().toString().substring(2,6)}-sgds-${t}-${e}`}Cs.styles=[_s],Cs.dependencies={},t([Zi({type:Boolean,reflect:!0})],Cs.prototype,"ssr",void 0);class Ms extends Cs{constructor(){super(...arguments),this.myDropdown=ji(),this.dropdownMenuId=ks("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=ji(),this._handleClickOutOfElement=t=>{this.menuIsOpen&&(t.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(t){super.firstUpdated(t),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=ms(this.myDropdown.value,this.menuRef.value,()=>this.updateFloatingPosition())))}hideMenu(t){this.menuIsOpen&&(this.emit("sgds-hide",{detail:{isOutside:t}}),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(t){if(!this.readonly)switch(t.key){case"ArrowDown":case"ArrowUp":t.preventDefault(),this.menuIsOpen||this.showMenu();break;case"Escape":this.hideMenu()}}mergeMiddleware(t,e){const i=t=>{var e;return(null==t?void 0:t.name)||(null===(e=null==t?void 0:t.constructor)||void 0===e?void 0:e.name)},a=e.map(i),s=t.map(t=>{const s=i(t),n=a.indexOf(s);return-1!==n?e[n]:t}).concat(e.filter(e=>!t.some(t=>i(t)===i(e))));return s}async updateFloatingPosition(){if(!this.myDropdown.value||!this.menuRef.value)return;let t="bottom-start";switch(this.drop){case"up":t=this.menuAlignRight?"top-end":"top-start";break;case"right":t="right-start";break;case"left":t="left-start";break;case"down":t=this.menuAlignRight?"bottom-end":"bottom-start";break;default:t="bottom-start"}const e=[ws(8),this.noFlip?void 0:bs(),ys()].filter(Boolean);let i=e;Array.isArray(this.floatingOpts.middleware)&&this.floatingOpts.middleware.length>0&&(i=this.mergeMiddleware(e,this.floatingOpts.middleware.filter(Boolean)));const a=Object.assign(Object.assign({strategy:"fixed",placement:t},this.floatingOpts),{middleware:i}),{x:s,y:n,strategy:r,placement:o}=await xs(this.myDropdown.value,this.menuRef.value,a);this.menuRef.value.setAttribute("data-placement",o),Object.assign(this.menuRef.value.style,{position:r,left:`${s}px`,top:`${n}px`})}}t([Zi({type:Boolean,state:!0})],Ms.prototype,"noFlip",void 0),t([Zi({type:Boolean,reflect:!0,state:!0})],Ms.prototype,"menuAlignRight",void 0),t([Zi({type:String,reflect:!0,state:!0})],Ms.prototype,"drop",void 0),t([Zi({type:Object})],Ms.prototype,"floatingOpts",void 0),t([Zi({type:Boolean,reflect:!0})],Ms.prototype,"menuIsOpen",void 0),t([Zi({type:Boolean,reflect:!0})],Ms.prototype,"disabled",void 0),t([Zi({type:Boolean,reflect:!0})],Ms.prototype,"readonly",void 0);const Zs={"DD/MM/YYYY":{imPattern:"`dd{/}`mm{/}`yyyy",imRangePattern:"`dd{/}`mm{/}`yyyy - `DD{/}`MM{/}`YYYY",fnsPattern:"dd/MM/yyyy"},"MM/DD/YYYY":{imPattern:"`mm{/}`dd{/}`yyyy",imRangePattern:"`mm{/}`dd{/}`yyyy - `MM{/}`DD{/}`YYYY",fnsPattern:"MM/dd/yyyy"},"YYYY/MM/DD":{imPattern:"`yyyy{/}`mm{/}`dd",imRangePattern:"`yyyy{/}`mm{/}`dd - `YYYY{/}`MM{/}`DD",fnsPattern:"yyyy/MM/dd"}},Vs=t=>{const e=t.getMonth(),i=t.getFullYear(),a=t.getDate(),s=new Date(i,e+1),n=tt(s);return p(t)&&n<a?et(s):new Date(i,e+1,a)},Ss=t=>{const e=t.getMonth(),i=t.getFullYear(),a=t.getDate(),s=new Date(i,e-1),n=tt(s);return p(t)&&n<a?et(s):new Date(i,e-1,a)},Ds=t=>{const e=new Date(t);return e.setHours(12),e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0),e};function As(t,e){const i=Object.assign({waitUntilFirstUpdate:!1},e);return(e,a)=>{const{update:s}=e;if(t in e){const n=t;e.update=function(t){if(t.has(n)){const e=t.get(n),s=this[n];e!==s&&(i.waitUntilFirstUpdate&&!this.hasUpdated||this[a](e,s))}s.call(this,t)}}}}
|
|
70
|
+
*/const ji=()=>new Gi;class Gi{}const Ki=new WeakMap;const Qi=Ti(class extends Wi{render(t){return ii}update(t,[e]){const i=e!==this._ref;return i&&void 0!==this._ref&&this._updateRefValue(void 0),(i||this._lastElementForRef!==this._element)&&(this._ref=e,this._context=t.options?.host,this._updateRefValue(this._element=t.element)),ii}_updateRefValue(t){if(this.isConnected||(t=void 0),"function"==typeof this._ref){const e=this._context??globalThis;let i=Ki.get(e);void 0===i&&(i=new WeakMap,Ki.set(e,i)),void 0!==i.get(this._ref)&&this._ref.call(this._context,void 0),i.set(this._ref,t),void 0!==t&&this._ref.call(this._context,t)}else this._ref.value=t}get _lastElementForRef(){return"function"==typeof this._ref?Ki.get(this._context??globalThis)?.get(this._ref):this._ref?.value}disconnected(){this._lastElementForRef===this._element&&this._updateRefValue(void 0)}reconnected(){this._updateRefValue(this._element)}}),Xi=Math.min,Ji=Math.max,ta=Math.round,ea=Math.floor,ia=t=>({x:t,y:t}),aa={left:"right",right:"left",bottom:"top",top:"bottom"},sa={start:"end",end:"start"};function na(t,e,i){return Ji(t,Xi(e,i))}function ra(t,e){return"function"==typeof t?t(e):t}function oa(t){return t.split("-")[0]}function la(t){return t.split("-")[1]}function ca(t){return"x"===t?"y":"x"}function da(t){return"y"===t?"height":"width"}const ha=new Set(["top","bottom"]);function ua(t){return ha.has(oa(t))?"y":"x"}function pa(t){return ca(ua(t))}function ga(t,e,i){void 0===i&&(i=!1);const a=la(t),s=pa(t),n=da(s);let r="x"===s?a===(i?"end":"start")?"right":"left":"start"===a?"bottom":"top";return e.reference[n]>e.floating[n]&&(r=xa(r)),[r,xa(r)]}function va(t){return t.replace(/start|end/g,t=>sa[t])}const fa=["left","right"],ma=["right","left"],wa=["top","bottom"],ya=["bottom","top"];function ba(t,e,i,a){const s=la(t);let n=function(t,e,i){switch(t){case"top":case"bottom":return i?e?ma:fa:e?fa:ma;case"left":case"right":return e?wa:ya;default:return[]}}(oa(t),"start"===i,a);return s&&(n=n.map(t=>t+"-"+s),e&&(n=n.concat(n.map(va)))),n}function xa(t){return t.replace(/left|right|bottom|top/g,t=>aa[t])}function _a(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function Ca(t){const{x:e,y:i,width:a,height:s}=t;return{width:a,height:s,top:i,left:e,right:e+a,bottom:i+s,x:e,y:i}}function ka(t,e,i){let{reference:a,floating:s}=t;const n=ua(e),r=pa(e),o=da(r),l=oa(e),c="y"===n,d=a.x+a.width/2-s.width/2,h=a.y+a.height/2-s.height/2,u=a[o]/2-s[o]/2;let p;switch(l){case"top":p={x:d,y:a.y-s.height};break;case"bottom":p={x:d,y:a.y+a.height};break;case"right":p={x:a.x+a.width,y:h};break;case"left":p={x:a.x-s.width,y:h};break;default:p={x:a.x,y:a.y}}switch(la(e)){case"start":p[r]-=u*(i&&c?-1:1);break;case"end":p[r]+=u*(i&&c?-1:1)}return p}async function Ma(t,e){var i;void 0===e&&(e={});const{x:a,y:s,platform:n,rects:r,elements:o,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:u=!1,padding:p=0}=ra(e,t),g=_a(p),v=o[u?"floating"===h?"reference":"floating":h],f=Ca(await n.getClippingRect({element:null==(i=await(null==n.isElement?void 0:n.isElement(v)))||i?v:v.contextElement||await(null==n.getDocumentElement?void 0:n.getDocumentElement(o.floating)),boundary:c,rootBoundary:d,strategy:l})),m="floating"===h?{x:a,y:s,width:r.floating.width,height:r.floating.height}:r.reference,w=await(null==n.getOffsetParent?void 0:n.getOffsetParent(o.floating)),y=await(null==n.isElement?void 0:n.isElement(w))&&await(null==n.getScale?void 0:n.getScale(w))||{x:1,y:1},b=Ca(n.convertOffsetParentRelativeRectToViewportRelativeRect?await n.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:m,offsetParent:w,strategy:l}):m);return{top:(f.top-b.top+g.top)/y.y,bottom:(b.bottom-f.bottom+g.bottom)/y.y,left:(f.left-b.left+g.left)/y.x,right:(b.right-f.right+g.right)/y.x}}const Za=new Set(["left","top"]);function Va(){return"undefined"!=typeof window}function Sa(t){return Ba(t)?(t.nodeName||"").toLowerCase():"#document"}function Da(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function Aa(t){var e;return null==(e=(Ba(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function Ba(t){return!!Va()&&(t instanceof Node||t instanceof Da(t).Node)}function Ea(t){return!!Va()&&(t instanceof Element||t instanceof Da(t).Element)}function Fa(t){return!!Va()&&(t instanceof HTMLElement||t instanceof Da(t).HTMLElement)}function Ha(t){return!(!Va()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof Da(t).ShadowRoot)}const $a=new Set(["inline","contents"]);function Ta(t){const{overflow:e,overflowX:i,overflowY:a,display:s}=ja(t);return/auto|scroll|overlay|hidden|clip/.test(e+a+i)&&!$a.has(s)}const Ia=new Set(["table","td","th"]);function Pa(t){return Ia.has(Sa(t))}const La=[":popover-open",":modal"];function Ra(t){return La.some(e=>{try{return t.matches(e)}catch(t){return!1}})}const Oa=["transform","translate","scale","rotate","perspective"],Ya=["transform","translate","scale","rotate","perspective","filter"],Na=["paint","layout","strict","content"];function za(t){const e=Ua(),i=Ea(t)?ja(t):t;return Oa.some(t=>!!i[t]&&"none"!==i[t])||!!i.containerType&&"normal"!==i.containerType||!e&&!!i.backdropFilter&&"none"!==i.backdropFilter||!e&&!!i.filter&&"none"!==i.filter||Ya.some(t=>(i.willChange||"").includes(t))||Na.some(t=>(i.contain||"").includes(t))}function Ua(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const qa=new Set(["html","body","#document"]);function Wa(t){return qa.has(Sa(t))}function ja(t){return Da(t).getComputedStyle(t)}function Ga(t){return Ea(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Ka(t){if("html"===Sa(t))return t;const e=t.assignedSlot||t.parentNode||Ha(t)&&t.host||Aa(t);return Ha(e)?e.host:e}function Qa(t){const e=Ka(t);return Wa(e)?t.ownerDocument?t.ownerDocument.body:t.body:Fa(e)&&Ta(e)?e:Qa(e)}function Xa(t,e,i){var a;void 0===e&&(e=[]),void 0===i&&(i=!0);const s=Qa(t),n=s===(null==(a=t.ownerDocument)?void 0:a.body),r=Da(s);if(n){const t=Ja(r);return e.concat(r,r.visualViewport||[],Ta(s)?s:[],t&&i?Xa(t):[])}return e.concat(s,Xa(s,[],i))}function Ja(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function ts(t){const e=ja(t);let i=parseFloat(e.width)||0,a=parseFloat(e.height)||0;const s=Fa(t),n=s?t.offsetWidth:i,r=s?t.offsetHeight:a,o=ta(i)!==n||ta(a)!==r;return o&&(i=n,a=r),{width:i,height:a,$:o}}function es(t){return Ea(t)?t:t.contextElement}function is(t){const e=es(t);if(!Fa(e))return ia(1);const i=e.getBoundingClientRect(),{width:a,height:s,$:n}=ts(e);let r=(n?ta(i.width):i.width)/a,o=(n?ta(i.height):i.height)/s;return r&&Number.isFinite(r)||(r=1),o&&Number.isFinite(o)||(o=1),{x:r,y:o}}const as=ia(0);function ss(t){const e=Da(t);return Ua()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:as}function ns(t,e,i,a){void 0===e&&(e=!1),void 0===i&&(i=!1);const s=t.getBoundingClientRect(),n=es(t);let r=ia(1);e&&(a?Ea(a)&&(r=is(a)):r=is(t));const o=function(t,e,i){return void 0===e&&(e=!1),!(!i||e&&i!==Da(t))&&e}(n,i,a)?ss(n):ia(0);let l=(s.left+o.x)/r.x,c=(s.top+o.y)/r.y,d=s.width/r.x,h=s.height/r.y;if(n){const t=Da(n),e=a&&Ea(a)?Da(a):a;let i=t,s=Ja(i);for(;s&&a&&e!==i;){const t=is(s),e=s.getBoundingClientRect(),a=ja(s),n=e.left+(s.clientLeft+parseFloat(a.paddingLeft))*t.x,r=e.top+(s.clientTop+parseFloat(a.paddingTop))*t.y;l*=t.x,c*=t.y,d*=t.x,h*=t.y,l+=n,c+=r,i=Da(s),s=Ja(i)}}return Ca({width:d,height:h,x:l,y:c})}function rs(t,e){const i=Ga(t).scrollLeft;return e?e.left+i:ns(Aa(t)).left+i}function os(t,e){const i=t.getBoundingClientRect();return{x:i.left+e.scrollLeft-rs(t,i),y:i.top+e.scrollTop}}const ls=new Set(["absolute","fixed"]);function cs(t,e,i){let a;if("viewport"===e)a=function(t,e){const i=Da(t),a=Aa(t),s=i.visualViewport;let n=a.clientWidth,r=a.clientHeight,o=0,l=0;if(s){n=s.width,r=s.height;const t=Ua();(!t||t&&"fixed"===e)&&(o=s.offsetLeft,l=s.offsetTop)}const c=rs(a);if(c<=0){const t=a.ownerDocument,e=t.body,i=getComputedStyle(e),s="CSS1Compat"===t.compatMode&&parseFloat(i.marginLeft)+parseFloat(i.marginRight)||0,r=Math.abs(a.clientWidth-e.clientWidth-s);r<=25&&(n-=r)}else c<=25&&(n+=c);return{width:n,height:r,x:o,y:l}}(t,i);else if("document"===e)a=function(t){const e=Aa(t),i=Ga(t),a=t.ownerDocument.body,s=Ji(e.scrollWidth,e.clientWidth,a.scrollWidth,a.clientWidth),n=Ji(e.scrollHeight,e.clientHeight,a.scrollHeight,a.clientHeight);let r=-i.scrollLeft+rs(t);const o=-i.scrollTop;return"rtl"===ja(a).direction&&(r+=Ji(e.clientWidth,a.clientWidth)-s),{width:s,height:n,x:r,y:o}}(Aa(t));else if(Ea(e))a=function(t,e){const i=ns(t,!0,"fixed"===e),a=i.top+t.clientTop,s=i.left+t.clientLeft,n=Fa(t)?is(t):ia(1);return{width:t.clientWidth*n.x,height:t.clientHeight*n.y,x:s*n.x,y:a*n.y}}(e,i);else{const i=ss(t);a={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Ca(a)}function ds(t,e){const i=Ka(t);return!(i===e||!Ea(i)||Wa(i))&&("fixed"===ja(i).position||ds(i,e))}function hs(t,e,i){const a=Fa(e),s=Aa(e),n="fixed"===i,r=ns(t,!0,n,e);let o={scrollLeft:0,scrollTop:0};const l=ia(0);function c(){l.x=rs(s)}if(a||!a&&!n)if(("body"!==Sa(e)||Ta(s))&&(o=Ga(e)),a){const t=ns(e,!0,n,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else s&&c();n&&!a&&s&&c();const d=!s||a||n?ia(0):os(s,o);return{x:r.left+o.scrollLeft-l.x-d.x,y:r.top+o.scrollTop-l.y-d.y,width:r.width,height:r.height}}function us(t){return"static"===ja(t).position}function ps(t,e){if(!Fa(t)||"fixed"===ja(t).position)return null;if(e)return e(t);let i=t.offsetParent;return Aa(t)===i&&(i=i.ownerDocument.body),i}function gs(t,e){const i=Da(t);if(Ra(t))return i;if(!Fa(t)){let e=Ka(t);for(;e&&!Wa(e);){if(Ea(e)&&!us(e))return e;e=Ka(e)}return i}let a=ps(t,e);for(;a&&Pa(a)&&us(a);)a=ps(a,e);return a&&Wa(a)&&us(a)&&!za(a)?i:a||function(t){let e=Ka(t);for(;Fa(e)&&!Wa(e);){if(za(e))return e;if(Ra(e))return null;e=Ka(e)}return null}(t)||i}const vs={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:i,offsetParent:a,strategy:s}=t;const n="fixed"===s,r=Aa(a),o=!!e&&Ra(e.floating);if(a===r||o&&n)return i;let l={scrollLeft:0,scrollTop:0},c=ia(1);const d=ia(0),h=Fa(a);if((h||!h&&!n)&&(("body"!==Sa(a)||Ta(r))&&(l=Ga(a)),Fa(a))){const t=ns(a);c=is(a),d.x=t.x+a.clientLeft,d.y=t.y+a.clientTop}const u=!r||h||n?ia(0):os(r,l);return{width:i.width*c.x,height:i.height*c.y,x:i.x*c.x-l.scrollLeft*c.x+d.x+u.x,y:i.y*c.y-l.scrollTop*c.y+d.y+u.y}},getDocumentElement:Aa,getClippingRect:function(t){let{element:e,boundary:i,rootBoundary:a,strategy:s}=t;const n=[..."clippingAncestors"===i?Ra(e)?[]:function(t,e){const i=e.get(t);if(i)return i;let a=Xa(t,[],!1).filter(t=>Ea(t)&&"body"!==Sa(t)),s=null;const n="fixed"===ja(t).position;let r=n?Ka(t):t;for(;Ea(r)&&!Wa(r);){const e=ja(r),i=za(r);i||"fixed"!==e.position||(s=null),(n?!i&&!s:!i&&"static"===e.position&&s&&ls.has(s.position)||Ta(r)&&!i&&ds(t,r))?a=a.filter(t=>t!==r):s=e,r=Ka(r)}return e.set(t,a),a}(e,this._c):[].concat(i),a],r=n[0],o=n.reduce((t,i)=>{const a=cs(e,i,s);return t.top=Ji(a.top,t.top),t.right=Xi(a.right,t.right),t.bottom=Xi(a.bottom,t.bottom),t.left=Ji(a.left,t.left),t},cs(e,r,s));return{width:o.right-o.left,height:o.bottom-o.top,x:o.left,y:o.top}},getOffsetParent:gs,getElementRects:async function(t){const e=this.getOffsetParent||gs,i=this.getDimensions,a=await i(t.floating);return{reference:hs(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:i}=ts(t);return{width:e,height:i}},getScale:is,isElement:Ea,isRTL:function(t){return"rtl"===ja(t).direction}};function fs(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function ms(t,e,i,a){void 0===a&&(a={});const{ancestorScroll:s=!0,ancestorResize:n=!0,elementResize:r="function"==typeof ResizeObserver,layoutShift:o="function"==typeof IntersectionObserver,animationFrame:l=!1}=a,c=es(t),d=s||n?[...c?Xa(c):[],...Xa(e)]:[];d.forEach(t=>{s&&t.addEventListener("scroll",i,{passive:!0}),n&&t.addEventListener("resize",i)});const h=c&&o?function(t,e){let i,a=null;const s=Aa(t);function n(){var t;clearTimeout(i),null==(t=a)||t.disconnect(),a=null}return function r(o,l){void 0===o&&(o=!1),void 0===l&&(l=1),n();const c=t.getBoundingClientRect(),{left:d,top:h,width:u,height:p}=c;if(o||e(),!u||!p)return;const g={rootMargin:-ea(h)+"px "+-ea(s.clientWidth-(d+u))+"px "+-ea(s.clientHeight-(h+p))+"px "+-ea(d)+"px",threshold:Ji(0,Xi(1,l))||1};let v=!0;function f(e){const a=e[0].intersectionRatio;if(a!==l){if(!v)return r();a?r(!1,a):i=setTimeout(()=>{r(!1,1e-7)},1e3)}1!==a||fs(c,t.getBoundingClientRect())||r(),v=!1}try{a=new IntersectionObserver(f,{...g,root:s.ownerDocument})}catch(t){a=new IntersectionObserver(f,g)}a.observe(t)}(!0),n}(c,i):null;let u,p=-1,g=null;r&&(g=new ResizeObserver(t=>{let[a]=t;a&&a.target===c&&g&&(g.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var t;null==(t=g)||t.observe(e)})),i()}),c&&!l&&g.observe(c),g.observe(e));let v=l?ns(t):null;return l&&function e(){const a=ns(t);v&&!fs(v,a)&&i();v=a,u=requestAnimationFrame(e)}(),i(),()=>{var t;d.forEach(t=>{s&&t.removeEventListener("scroll",i),n&&t.removeEventListener("resize",i)}),null==h||h(),null==(t=g)||t.disconnect(),g=null,l&&cancelAnimationFrame(u)}}const ws=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var i,a;const{x:s,y:n,placement:r,middlewareData:o}=e,l=await async function(t,e){const{placement:i,platform:a,elements:s}=t,n=await(null==a.isRTL?void 0:a.isRTL(s.floating)),r=oa(i),o=la(i),l="y"===ua(i),c=Za.has(r)?-1:1,d=n&&l?-1:1,h=ra(e,t);let{mainAxis:u,crossAxis:p,alignmentAxis:g}="number"==typeof h?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return o&&"number"==typeof g&&(p="end"===o?-1*g:g),l?{x:p*d,y:u*c}:{x:u*c,y:p*d}}(e,t);return r===(null==(i=o.offset)?void 0:i.placement)&&null!=(a=o.arrow)&&a.alignmentOffset?{}:{x:s+l.x,y:n+l.y,data:{...l,placement:r}}}}},ys=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:i,y:a,placement:s}=e,{mainAxis:n=!0,crossAxis:r=!1,limiter:o={fn:t=>{let{x:e,y:i}=t;return{x:e,y:i}}},...l}=ra(t,e),c={x:i,y:a},d=await Ma(e,l),h=ua(oa(s)),u=ca(h);let p=c[u],g=c[h];if(n){const t="y"===u?"bottom":"right";p=na(p+d["y"===u?"top":"left"],p,p-d[t])}if(r){const t="y"===h?"bottom":"right";g=na(g+d["y"===h?"top":"left"],g,g-d[t])}const v=o.fn({...e,[u]:p,[h]:g});return{...v,data:{x:v.x-i,y:v.y-a,enabled:{[u]:n,[h]:r}}}}}},bs=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var i,a;const{placement:s,middlewareData:n,rects:r,initialPlacement:o,platform:l,elements:c}=e,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:u,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:v=!0,...f}=ra(t,e);if(null!=(i=n.arrow)&&i.alignmentOffset)return{};const m=oa(s),w=ua(o),y=oa(o)===o,b=await(null==l.isRTL?void 0:l.isRTL(c.floating)),x=u||(y||!v?[xa(o)]:function(t){const e=xa(t);return[va(t),e,va(e)]}(o)),_="none"!==g;!u&&_&&x.push(...ba(o,v,g,b));const C=[o,...x],k=await Ma(e,f),M=[];let Z=(null==(a=n.flip)?void 0:a.overflows)||[];if(d&&M.push(k[m]),h){const t=ga(s,r,b);M.push(k[t[0]],k[t[1]])}if(Z=[...Z,{placement:s,overflows:M}],!M.every(t=>t<=0)){var V,S;const t=((null==(V=n.flip)?void 0:V.index)||0)+1,e=C[t];if(e){if(!("alignment"===h&&w!==ua(e))||Z.every(t=>ua(t.placement)!==w||t.overflows[0]>0))return{data:{index:t,overflows:Z},reset:{placement:e}}}let i=null==(S=Z.filter(t=>t.overflows[0]<=0).sort((t,e)=>t.overflows[1]-e.overflows[1])[0])?void 0:S.placement;if(!i)switch(p){case"bestFit":{var D;const t=null==(D=Z.filter(t=>{if(_){const e=ua(t.placement);return e===w||"y"===e}return!0}).map(t=>[t.placement,t.overflows.filter(t=>t>0).reduce((t,e)=>t+e,0)]).sort((t,e)=>t[1]-e[1])[0])?void 0:D[0];t&&(i=t);break}case"initialPlacement":i=o}if(s!==i)return{reset:{placement:i}}}return{}}}},xs=(t,e,i)=>{const a=new Map,s={platform:vs,...i},n={...s.platform,_c:a};return(async(t,e,i)=>{const{placement:a="bottom",strategy:s="absolute",middleware:n=[],platform:r}=i,o=n.filter(Boolean),l=await(null==r.isRTL?void 0:r.isRTL(e));let c=await r.getElementRects({reference:t,floating:e,strategy:s}),{x:d,y:h}=ka(c,a,l),u=a,p={},g=0;for(let i=0;i<o.length;i++){const{name:n,fn:v}=o[i],{x:f,y:m,data:w,reset:y}=await v({x:d,y:h,initialPlacement:a,placement:u,strategy:s,middlewareData:p,rects:c,platform:r,elements:{reference:t,floating:e}});d=null!=f?f:d,h=null!=m?m:h,p={...p,[n]:{...p[n],...w}},y&&g<=50&&(g++,"object"==typeof y&&(y.placement&&(u=y.placement),y.rects&&(c=!0===y.rects?await r.getElementRects({reference:t,floating:e,strategy:s}):y.rects),({x:d,y:h}=ka(c,u,l))),i=-1)}return{x:d,y:h,placement:u,strategy:s,middlewareData:p}})(t,e,{...s,platform:n})};var _s=re`: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 Cs extends bi{emit(t,e){const i=new CustomEvent(t,Object.assign({bubbles:!0,cancelable:!1,composed:!0,detail:{}},e));return this.dispatchEvent(i),i}static define(t,e=this,i={}){if(customElements.get(t));else try{customElements.define(t,e,i)}catch(a){customElements.define(t,class extends e{},i)}}constructor(){super(),this.ssr=Boolean(this.shadowRoot),Object.entries(this.constructor.dependencies).forEach(([t,e])=>{this.constructor.define(t,e)})}firstUpdated(t){var e;super.firstUpdated(t),this.ssr&&(null===(e=this.shadowRoot)||void 0===e||e.querySelectorAll("slot").forEach(t=>{t.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1,cancelable:!1}))}))}}function ks(t="",e=""){return`id-${Math.random().toString().substring(2,6)}-sgds-${t}-${e}`}Cs.styles=[_s],Cs.dependencies={},t([Zi({type:Boolean,reflect:!0})],Cs.prototype,"ssr",void 0);class Ms extends Cs{constructor(){super(...arguments),this.myDropdown=ji(),this.dropdownMenuId=ks("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=ji(),this._handleClickOutOfElement=t=>{this.menuIsOpen&&(t.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(t){super.firstUpdated(t),this.menuIsOpen&&requestAnimationFrame(async()=>{await this.updateFloatingPosition(),this._startAutoUpdate()})}async showMenu(){this.disabled||this.menuIsOpen||(this.menuIsOpen=!0,this.emit("sgds-show"),await this.updateFloatingPosition(),this.emit("sgds-after-show"),this._startAutoUpdate())}_startAutoUpdate(){this.myDropdown.value&&this.menuRef.value&&(this._cleanupAutoUpdate=ms(this.myDropdown.value,this.menuRef.value,()=>this.updateFloatingPosition()))}hideMenu(t){this.menuIsOpen&&(this.emit("sgds-hide",{detail:{isOutside:t}}),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(t){if(!this.readonly)switch(t.key){case"ArrowDown":case"ArrowUp":t.preventDefault(),this.menuIsOpen||this.showMenu();break;case"Escape":this.hideMenu()}}mergeMiddleware(t,e){const i=t=>{var e;return(null==t?void 0:t.name)||(null===(e=null==t?void 0:t.constructor)||void 0===e?void 0:e.name)},a=e.map(i),s=t.map(t=>{const s=i(t),n=a.indexOf(s);return-1!==n?e[n]:t}).concat(e.filter(e=>!t.some(t=>i(t)===i(e))));return s}async updateFloatingPosition(){if(!this.myDropdown.value||!this.menuRef.value)return;let t="bottom-start";switch(this.drop){case"up":t=this.menuAlignRight?"top-end":"top-start";break;case"right":t="right-start";break;case"left":t="left-start";break;case"down":t=this.menuAlignRight?"bottom-end":"bottom-start";break;default:t="bottom-start"}const e=[ws(8),this.noFlip?void 0:bs(),ys()].filter(Boolean);let i=e;Array.isArray(this.floatingOpts.middleware)&&this.floatingOpts.middleware.length>0&&(i=this.mergeMiddleware(e,this.floatingOpts.middleware.filter(Boolean)));const a=Object.assign(Object.assign({strategy:"fixed",placement:t},this.floatingOpts),{middleware:i}),{x:s,y:n,strategy:r,placement:o}=await xs(this.myDropdown.value,this.menuRef.value,a);this.menuRef.value.setAttribute("data-placement",o),Object.assign(this.menuRef.value.style,{position:r,left:`${s}px`,top:`${n}px`})}}t([Zi({type:Boolean,state:!0})],Ms.prototype,"noFlip",void 0),t([Zi({type:Boolean,reflect:!0,state:!0})],Ms.prototype,"menuAlignRight",void 0),t([Zi({type:String,reflect:!0,state:!0})],Ms.prototype,"drop",void 0),t([Zi({type:Object})],Ms.prototype,"floatingOpts",void 0),t([Zi({type:Boolean,reflect:!0})],Ms.prototype,"menuIsOpen",void 0),t([Zi({type:Boolean,reflect:!0})],Ms.prototype,"disabled",void 0),t([Zi({type:Boolean,reflect:!0})],Ms.prototype,"readonly",void 0);const Zs={"DD/MM/YYYY":{imPattern:"`dd{/}`mm{/}`yyyy",imRangePattern:"`dd{/}`mm{/}`yyyy - `DD{/}`MM{/}`YYYY",fnsPattern:"dd/MM/yyyy"},"MM/DD/YYYY":{imPattern:"`mm{/}`dd{/}`yyyy",imRangePattern:"`mm{/}`dd{/}`yyyy - `MM{/}`DD{/}`YYYY",fnsPattern:"MM/dd/yyyy"},"YYYY/MM/DD":{imPattern:"`yyyy{/}`mm{/}`dd",imRangePattern:"`yyyy{/}`mm{/}`dd - `YYYY{/}`MM{/}`DD",fnsPattern:"yyyy/MM/dd"}},Vs=t=>{const e=t.getMonth(),i=t.getFullYear(),a=t.getDate(),s=new Date(i,e+1),n=tt(s);return p(t)&&n<a?et(s):new Date(i,e+1,a)},Ss=t=>{const e=t.getMonth(),i=t.getFullYear(),a=t.getDate(),s=new Date(i,e-1),n=tt(s);return p(t)&&n<a?et(s):new Date(i,e-1,a)},Ds=t=>{const e=new Date(t);return e.setHours(12),e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0),e};function As(t,e){const i=Object.assign({waitUntilFirstUpdate:!1},e);return(e,a)=>{const{update:s}=e;if(t in e){const n=t;e.update=function(t){if(t.has(n)){const e=t.get(n),s=this[n];e!==s&&(i.waitUntilFirstUpdate&&!this.hasUpdated||this[a](e,s))}s.call(this,t)}}}}
|
|
71
71
|
/**
|
|
72
72
|
* @license
|
|
73
73
|
* Copyright 2018 Google LLC
|
|
@@ -103,7 +103,7 @@ class extends Ii{constructor(t){if(super(t),t.type!==Hi&&t.type!==Ei&&t.type!==$
|
|
|
103
103
|
<slot name="rightIcon"></slot>`}
|
|
104
104
|
|
|
105
105
|
</${e}>
|
|
106
|
-
`}}Us.styles=[...Rs.styles,Ns,zs],t([Zi({type:String,reflect:!0})],Us.prototype,"type",void 0),t([Zi({type:String,reflect:!0})],Us.prototype,"form",void 0),t([Zi({type:String,reflect:!0,attribute:"formaction"})],Us.prototype,"formAction",void 0),t([Zi({type:String,reflect:!0,attribute:"formmethod"})],Us.prototype,"formMethod",void 0),t([Zi({attribute:"formnovalidate",type:Boolean,reflect:!0})],Us.prototype,"formNoValidate",void 0),t([Zi({type:String,reflect:!0,attribute:"formtarget"})],Us.prototype,"formTarget",void 0),t([Zi({type:Boolean,reflect:!0})],Us.prototype,"fullWidth",void 0),t([Zi({type:Boolean})],Us.prototype,"hasLeftIconSlot",void 0),t([Zi({type:Boolean})],Us.prototype,"hasRightIconSlot",void 0);var qs=re`: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%}`,Ws=re`.datepicker-body{color:var(--sgds-form-color-default);display:flex;justify-content:center}table{border-collapse:collapse;text-align:center}.monthpicker,.yearpicker{display:grid;grid-template-columns:repeat(3,6rem);grid-template-rows:repeat(4,2.5rem)}button.month,button.year{background-color:transparent;border:0;border-radius:var(--sgds-form-border-radius-sm);line-height:var(--sgds-line-height-20);padding:0;position:relative}button.month.active:not(.selected-ends),button.year.active:not(.selected-ends),td[data-day].active:not(.selected-ends){background-color:var(--sgds-primary-surface-translucent);border-radius:0;cursor:pointer}button.month:hover:not(.active),button.year:hover:not(.active),td[data-day]:hover:not(.disabled):not(.selected-ends):not(.active){background-color:var(--sgds-bg-translucent-subtle);cursor:pointer}button.month:focus:not(.active),button.year:focus:not(.active),td[data-day]:focus:not(.disabled):not(.selected-ends):not(.active){background-color:var(--sgds-bg-translucent-subtle)}button.month:focus-visible,button.year:focus-visible,td[data-day]:focus-visible{outline:var(--sgds-form-outline-focus);outline-offset:var(--sgds-form-outline-offset-focus)}button.month.active:not(.selected-ends):focus,button.year.active:not(.selected-ends):focus,td[data-day].active:not(.selected-ends):focus{border-radius:var(--sgds-form-border-radius-sm)}button.year.active{background-color:var(--sgds-primary-surface-translucent);cursor:pointer}td,th{border-radius:var(--sgds-form-border-radius-sm);height:var(--sgds-form-height-lg);line-height:var(--sgds-line-height-20);padding:0;position:relative;width:var(--sgds-form-width-md)}th{font-weight:var(--sgds-font-weight-semibold)}td[data-day]{cursor:pointer}button.month.active.selected-ends,button.year.active.selected-ends,td[data-day].active.selected-ends{background-color:var(--sgds-form-primary-surface-default);color:var(--sgds-form-color-fixed-light)}button.month.active.selected-ends:focus,button.month.active.selected-ends:hover,button.year.active.selected-ends:focus,button.year.active.selected-ends:hover,td[data-day].active.selected-ends:focus,td[data-day].active.selected-ends:hover{background-color:var(--sgds-form-primary-surface-emphasis)}td[data-day].disabled{cursor:not-allowed;opacity:var(--sgds-opacity-50)}.today{align-items:center;display:flex;flex-direction:column;justify-content:center}.today:after{background-color:var(--sgds-form-primary-surface-default);bottom:6px;content:".";line-height:4px;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' fill='none'%3E%3Ccircle cx='2' cy='2' r='2' fill='%235A42C0'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' fill='none'%3E%3Ccircle cx='2' cy='2' r='2' fill='%235A42C0'/%3E%3C/svg%3E");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;position:absolute;width:4px}.today.active.selected-ends:after{background-color:var(--sgds-form-color-inverse)}`;const js=new Date,Gs={ArrowUp:{days:-7,months:-3,years:-3},ArrowDown:{days:7,months:3,years:3},ArrowRight:{days:1,months:1,years:1},ArrowLeft:{days:-1,months:-1,years:-1}};class Ks extends Cs{constructor(){super(...arguments),this.selectedDate=[],this.mode="single"}focusOnCalendar(t){t.blur(),this._focusOnCalendarCell()}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this._handleKeyPress),this.addEventListener("blur",t=>t.stopPropagation())}updated(){3===this.focusedTabIndex&&this._focusOnCalendarCell()}_updateFocusedDate(){this.focusedDate=Ds(this.displayDate),this.focusedDate.getFullYear()<1900&&this.focusedDate.setFullYear(1900)}_setFocusedDate(t){const e=this.focusedDate.getDate(),i=this.focusedDate.getMonth(),a=this.focusedDate.getFullYear();switch(this.view){case"days":{const s=Ds(new Date(a,i,e+t));(it(s,new Date(0,0,1,12))||st(s,new Date(0,0,1,12)))&&(this.focusedDate=s);break}case"months":{const s=Ds(new Date(a,i+t,e));(it(s,new Date(0,0,1,12))||st(s,new Date(0,0,1,12)))&&(this.focusedDate=s);break}case"years":{const s=Ds(new Date(a+t,i,e));s.getFullYear()>=1900&&(this.focusedDate=s);break}}}_handleEnterDateKeyboard(t){const e=t.composedPath()[0];if(!e.classList.contains("disabled"))switch(this.view){case"days":this._onClickDay(t);break;case"months":{const{month:t}=e.dataset;this._onClickMonth(parseInt(t));break}case"years":{const{year:t}=e.dataset;this._onClickYear(parseInt(t))}}}_handleKeyPress(t){if("Enter"===t.key)return t.preventDefault(),void this._handleEnterDateKeyboard(t);if("Tab"===t.key){const t=this._getFocusedTarget();return void(3!==this.focusedTabIndex&&t.blur())}if(t.key.includes("Arrow")){t.preventDefault(),this._blurCalendarCell();const e=Gs[t.key][this.view];this._setFocusedDate(e),this._focusOnCalendarCell()}}_generateIncrementDates(){const t=Ds(this.selectedDate[0]);if(this.selectedDate.length<2)return[t];const e=Ds(this.selectedDate[1]),i=[];if(t.getTime()<e.getTime())for(let a=t;a<=e;a.setDate(a.getDate()+1))i.push(new Date(a));else for(let a=e;a<=t;a.setDate(a.getDate()+1))i.push(new Date(a));return i}_onClickDay(t){const{day:e,date:i}=t.composedPath()[0].dataset,a=new Date(this.displayDate);if(a.setDate(parseInt(e)),"click"===t.type&&(this.focusedDate=Ds(new Date(i))),"single"===this.mode)this.selectedDate=[a],this.emit("sgds-selectdates",{detail:this.selectedDate});else if("range"===this.mode){const t=[...this.selectedDate];0!==t.length&&2!==t.length||(t.length=0),t.push(a),this.selectedDate=t,this.emit("sgds-selectdates",{detail:this.selectedDate})}const s=this.minDate?Ds(new Date(this.minDate)):null,n=this.maxDate?Ds(new Date(this.maxDate)):null,r=Ds(a);(s&&r<s||n&&r>n)&&(t.stopPropagation(),t.preventDefault())}_onClickMonth(t,e=this.focusedDate.getFullYear()){const i=new Date(this.displayDate);this.view="days",i.setMonth(t),i.setFullYear(e),this.displayDate=i,this.emit("sgds-view",{detail:this.view}),this.emit("sgds-selectmonth",{detail:this.displayDate})}_onClickYear(t){const e=new Date(this.displayDate);e.setFullYear(t),this.displayDate=e,this.view="months",this.emit("sgds-view",{detail:this.view}),this.emit("sgds-selectyear",{detail:this.displayDate})}_getFocusedTarget(){const t={days:`td[data-date="${this.focusedDate.toISOString()}"]`,months:`button[data-month="${this.focusedDate.getMonth()}"][data-year="${this.focusedDate.getFullYear()}"]`,years:`button[data-year="${this.focusedDate.getFullYear()}"]`}[this.view];return this.shadowRoot.querySelector(`${t}`)}_blurCalendarCell(){const t=this._getFocusedTarget();t.setAttribute("tabindex","-1"),t.blur()}_focusOnCalendarCell(){const t=this._getFocusedTarget();t?(t.setAttribute("tabindex","3"),t.focus(),this.emit("sgds-update-focus",{detail:this.focusedDate})):this.emit("sgds-change-calendar",{detail:this.focusedDate})}_generateDays(){const t=this.selectedDate.map(t=>Ds(t)),e=this._generateIncrementDates(),i=this.minDate?Ds(new Date(this.minDate)):null,a=this.maxDate?Ds(new Date(this.maxDate)):null,s=this.displayDate.getFullYear(),n=this.displayDate.getMonth(),r=new Date(s,n,1).getDay();let o=Ks.daysInMonth[n];1===n&&(s%4==0&&s%100!=0||s%400==0)&&(o=29);const l=[];let c=1;for(let d=0;d<9;d++){const h=[];for(let l=0;l<=6;l++)if(c<=o&&(d>0||l>=r)){const r=new Date(s,n,c,12,0,0,0),o=r.toISOString(),d=i&&Date.parse(o)<Date.parse(i.toISOString()),u=a&&Date.parse(o)>Date.parse(a.toISOString()),p=d||u?void 0:this._onClickDay,g=js.getMonth()===this.displayDate.getMonth(),v=js.getFullYear()===this.displayDate.getFullYear(),f=js.getDate()===c,m=t.length>0&&e.some(t=>Date.parse(o)===Date.parse(t.toISOString())),w=t.length>0&&e[0].toISOString()===o,y=t.length>1&&e[e.length-1].toISOString()===o,b=""+(f&&g&&v?"Today's date, ":"")+X(r,"PPPP");h.push(Je`<td
|
|
106
|
+
`}}Us.styles=[...Rs.styles,Ns,zs],t([Zi({type:String,reflect:!0})],Us.prototype,"type",void 0),t([Zi({type:String,reflect:!0})],Us.prototype,"form",void 0),t([Zi({type:String,reflect:!0,attribute:"formaction"})],Us.prototype,"formAction",void 0),t([Zi({type:String,reflect:!0,attribute:"formmethod"})],Us.prototype,"formMethod",void 0),t([Zi({attribute:"formnovalidate",type:Boolean,reflect:!0})],Us.prototype,"formNoValidate",void 0),t([Zi({type:String,reflect:!0,attribute:"formtarget"})],Us.prototype,"formTarget",void 0),t([Zi({type:Boolean,reflect:!0})],Us.prototype,"fullWidth",void 0),t([Zi({type:Boolean})],Us.prototype,"hasLeftIconSlot",void 0),t([Zi({type:Boolean})],Us.prototype,"hasRightIconSlot",void 0);var qs=re`:host([menuisopen]:not([disabled]):not([readonly])) .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%}`,Ws=re`.datepicker-body{color:var(--sgds-form-color-default);display:flex;justify-content:center}table{border-collapse:collapse;text-align:center}.monthpicker,.yearpicker{display:grid;grid-template-columns:repeat(3,6rem);grid-template-rows:repeat(4,2.5rem)}button.month,button.year{background-color:transparent;border:0;border-radius:var(--sgds-form-border-radius-sm);line-height:var(--sgds-line-height-20);padding:0;position:relative}button.month.active:not(.selected-ends),button.year.active:not(.selected-ends),td[data-day].active:not(.selected-ends){background-color:var(--sgds-primary-surface-translucent);border-radius:0;cursor:pointer}button.month:hover:not(.active),button.year:hover:not(.active),td[data-day]:hover:not(.disabled):not(.selected-ends):not(.active){background-color:var(--sgds-bg-translucent-subtle);cursor:pointer}button.month:focus:not(.active),button.year:focus:not(.active),td[data-day]:focus:not(.disabled):not(.selected-ends):not(.active){background-color:var(--sgds-bg-translucent-subtle)}button.month:focus-visible,button.year:focus-visible,td[data-day]:focus-visible{outline:var(--sgds-form-outline-focus);outline-offset:var(--sgds-form-outline-offset-focus)}button.month.active:not(.selected-ends):focus,button.year.active:not(.selected-ends):focus,td[data-day].active:not(.selected-ends):focus{border-radius:var(--sgds-form-border-radius-sm)}button.year.active{background-color:var(--sgds-primary-surface-translucent);cursor:pointer}td,th{border-radius:var(--sgds-form-border-radius-sm);height:var(--sgds-form-height-lg);line-height:var(--sgds-line-height-20);padding:0;position:relative;width:var(--sgds-form-width-md)}th{font-weight:var(--sgds-font-weight-semibold)}td[data-day]{cursor:pointer}button.month.active.selected-ends,button.year.active.selected-ends,td[data-day].active.selected-ends{background-color:var(--sgds-form-primary-surface-default);color:var(--sgds-form-color-fixed-light)}button.month.active.selected-ends:focus,button.month.active.selected-ends:hover,button.year.active.selected-ends:focus,button.year.active.selected-ends:hover,td[data-day].active.selected-ends:focus,td[data-day].active.selected-ends:hover{background-color:var(--sgds-form-primary-surface-emphasis)}td[data-day].disabled{cursor:not-allowed;opacity:var(--sgds-opacity-50)}.today{align-items:center;display:flex;flex-direction:column;justify-content:center}.today:after{background-color:var(--sgds-form-primary-surface-default);bottom:6px;content:".";line-height:4px;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' fill='none'%3E%3Ccircle cx='2' cy='2' r='2' fill='%235A42C0'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' fill='none'%3E%3Ccircle cx='2' cy='2' r='2' fill='%235A42C0'/%3E%3C/svg%3E");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;position:absolute;width:4px}.today.active.selected-ends:after{background-color:var(--sgds-form-color-inverse)}`;const js=new Date,Gs={ArrowUp:{days:-7,months:-3,years:-3},ArrowDown:{days:7,months:3,years:3},ArrowRight:{days:1,months:1,years:1},ArrowLeft:{days:-1,months:-1,years:-1}};class Ks extends Cs{constructor(){super(...arguments),this.selectedDate=[],this.mode="single"}focusOnCalendar(t){t.blur(),this._focusOnCalendarCell()}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this._handleKeyPress),this.addEventListener("blur",t=>t.stopPropagation())}updated(){3===this.focusedTabIndex&&this._focusOnCalendarCell()}_updateFocusedDate(){this.focusedDate=Ds(this.displayDate),this.focusedDate.getFullYear()<1900&&this.focusedDate.setFullYear(1900)}_setFocusedDate(t){const e=this.focusedDate.getDate(),i=this.focusedDate.getMonth(),a=this.focusedDate.getFullYear();switch(this.view){case"days":{const s=Ds(new Date(a,i,e+t));(it(s,new Date(0,0,1,12))||st(s,new Date(0,0,1,12)))&&(this.focusedDate=s);break}case"months":{const s=Ds(new Date(a,i+t,e));(it(s,new Date(0,0,1,12))||st(s,new Date(0,0,1,12)))&&(this.focusedDate=s);break}case"years":{const s=Ds(new Date(a+t,i,e));s.getFullYear()>=1900&&(this.focusedDate=s);break}}}_handleEnterDateKeyboard(t){const e=t.composedPath()[0];if(!e.classList.contains("disabled"))switch(this.view){case"days":this._onClickDay(t);break;case"months":{const{month:t}=e.dataset;this._onClickMonth(parseInt(t));break}case"years":{const{year:t}=e.dataset;this._onClickYear(parseInt(t))}}}_handleKeyPress(t){if("Enter"===t.key)return t.preventDefault(),void this._handleEnterDateKeyboard(t);if("Tab"===t.key){const t=this._getFocusedTarget();return void(3!==this.focusedTabIndex&&t.blur())}if(t.key.includes("Arrow")){t.preventDefault(),this._blurCalendarCell();const e=Gs[t.key][this.view];this._setFocusedDate(e),this._focusOnCalendarCell()}}_generateIncrementDates(){const t=Ds(this.selectedDate[0]);if(this.selectedDate.length<2)return[t];const e=Ds(this.selectedDate[1]),i=[];if(t.getTime()<e.getTime())for(let a=t;a<=e;a.setDate(a.getDate()+1))i.push(new Date(a));else for(let a=e;a<=t;a.setDate(a.getDate()+1))i.push(new Date(a));return i}_onClickDay(t){const{day:e,date:i}=t.composedPath()[0].dataset,a=new Date(this.displayDate);if(a.setDate(parseInt(e)),"click"===t.type&&(this.focusedDate=Ds(new Date(i))),"single"===this.mode)this.selectedDate=[a],this.emit("sgds-selectdates",{detail:this.selectedDate});else if("range"===this.mode){const t=[...this.selectedDate];0!==t.length&&2!==t.length||(t.length=0),t.push(a),this.selectedDate=t,this.emit("sgds-selectdates",{detail:this.selectedDate})}const s=this.minDate?Ds(new Date(this.minDate)):null,n=this.maxDate?Ds(new Date(this.maxDate)):null,r=Ds(a);(s&&r<s||n&&r>n)&&(t.stopPropagation(),t.preventDefault())}_onClickMonth(t,e=this.focusedDate.getFullYear()){const i=new Date(this.displayDate);this.view="days",i.setMonth(t),i.setFullYear(e),this.displayDate=i,this.emit("sgds-view",{detail:this.view}),this.emit("sgds-selectmonth",{detail:this.displayDate})}_onClickYear(t){const e=new Date(this.displayDate);e.setFullYear(t),this.displayDate=e,this.view="months",this.emit("sgds-view",{detail:this.view}),this.emit("sgds-selectyear",{detail:this.displayDate})}_getFocusedTarget(){const t={days:`td[data-date="${this.focusedDate.toISOString()}"]`,months:`button[data-month="${this.focusedDate.getMonth()}"][data-year="${this.focusedDate.getFullYear()}"]`,years:`button[data-year="${this.focusedDate.getFullYear()}"]`}[this.view];return this.shadowRoot.querySelector(`${t}`)}_blurCalendarCell(){const t=this._getFocusedTarget();t.setAttribute("tabindex","-1"),t.blur()}_focusOnCalendarCell(){const t=this._getFocusedTarget();t?(t.setAttribute("tabindex","3"),t.focus(),this.emit("sgds-update-focus",{detail:this.focusedDate})):this.emit("sgds-change-calendar",{detail:this.focusedDate})}_generateDays(){const t=this.selectedDate.map(t=>Ds(t)),e=this._generateIncrementDates(),i=this.minDate?Ds(new Date(this.minDate)):null,a=this.maxDate?Ds(new Date(this.maxDate)):null,s=this.displayDate.getFullYear(),n=this.displayDate.getMonth(),r=new Date(s,n,1).getDay();let o=Ks.daysInMonth[n];1===n&&(s%4==0&&s%100!=0||s%400==0)&&(o=29);const l=[];let c=1;for(let d=0;d<9;d++){const h=[];for(let l=0;l<=6;l++)if(c<=o&&(d>0||l>=r)){const r=new Date(s,n,c,12,0,0,0),o=r.toISOString(),d=i&&Date.parse(o)<Date.parse(i.toISOString()),u=a&&Date.parse(o)>Date.parse(a.toISOString()),p=d||u?void 0:this._onClickDay,g=js.getMonth()===this.displayDate.getMonth(),v=js.getFullYear()===this.displayDate.getFullYear(),f=js.getDate()===c,m=t.length>0&&e.some(t=>Date.parse(o)===Date.parse(t.toISOString())),w=t.length>0&&e[0].toISOString()===o,y=t.length>1&&e[e.length-1].toISOString()===o,b=""+(f&&g&&v?"Today's date, ":"")+X(r,"PPPP");h.push(Je`<td
|
|
107
107
|
key=${l}
|
|
108
108
|
data-date=${o}
|
|
109
109
|
data-day=${c}
|
|
@@ -2527,7 +2527,7 @@ class extends Ii{constructor(t){if(super(t),t.type!==Hi&&t.type!==Ei&&t.type!==$
|
|
|
2527
2527
|
</div>
|
|
2528
2528
|
${this._renderFeedback()}
|
|
2529
2529
|
</div>
|
|
2530
|
-
`}}wr.styles=[...fr.styles,mr],t([Zi({type:String})],wr.prototype,"minDate",void 0),t([Zi({type:String})],wr.prototype,"maxDate",void 0),t([Zi({type:String,reflect:!0})],wr.prototype,"mode",void 0),t([Bi("input")],wr.prototype,"shadowInput",void 0);var yr,br,xr=re`:host{--datepicker-theme-color:var(--sgds-primary);--datepicker-hover-bg:var(--sgds-primary-100);--datepicker-bg:#fff;--datepicker-close-btn-bg:var(--datepicker-theme-color);--datepicker-close-btn-hover-bg:var(--sgds-primary-700);--datepicker-close-btn-color:#fff;--datepicker-selected-date-bg:var(--sgds-primary);--datepicker-selected-date-color:#fff;font-size:var(--sgds-font-size-14)}:host([menuisopen]) .dropdown-menu{background-color:var(--sgds-form-surface-default);display:flex;flex-direction:column;gap:var(--sgds-form-gap-sm);overflow:unset;padding:var(--sgds-form-padding-y) var(--sgds-form-padding-x);width:var(--sgds-dimension-320)}.dropdown{display:flex;height:100%}sgds-datepicker-input{--input-border-radius:var(--sgds-form-border-radius-md) 0 0 var(--sgds-form-border-radius-md);flex:1;margin-right:0}sgds-icon-button{--btn-border-radius:0 var(--sgds-form-border-radius-md) var(--sgds-form-border-radius-md) 0}.datepicker-container{display:flex}.calendar-btn:not(.with-hint-text){align-self:center}.calendar-btn:not(.with-hint-text).with-label{align-self:end;margin-top:calc(var(--sgds-line-height-24) - var(--sgds-line-height-20))}.calendar-btn.with-hint-text.with-label{align-self:center;margin-top:calc(var(--sgds-line-height-24) - var(--sgds-line-height-20))}`;class _r extends(gr(Ms)){constructor(){super(),this.required=!1,this.disabled=!1,this.value="",this.initialValue=[],this.dateFormat="DD/MM/YYYY",this.minDate="",this.maxDate="",this.mode="single",this.hasFeedback=!1,this.label="",this.hintText="",this.noFlip=!1,this.drop="down",this.defaultValue="",this.invalid=!1,this.view="days",this.selectedDateRange=[],this.focusedTabIndex=3,this.initialDisplayDate=new Date,this._makeInputValueString=(t,e,i)=>{if(!t&&!e)return this.value;const a=t=>X(t,Zs[i].fnsPattern);switch(this.mode){case"single":t&&(this.value=a(t));break;case"range":t&&e&&(this.value=`${a(t)} - ${a(e)}`),t&&!e&&(this.value=`${a(t)} - ${this.dateFormat}`)}return this.value},this._dialogAriaLabels={days:"Choose date",months:"Choose month",years:"Choose year"},this.floatingOpts={placement:"bottom-end"}}isValueEmpty(){return""===this.value||"DD/MM/YYYY"===this.value||"DD/MM/YYYY - DD/MM/YYYY"===this.value}reportValidity(){return this._mixinReportValidity()}checkValidity(){return this._mixinCheckValidity()}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}async connectedCallback(){if(super.connectedCallback(),this.addEventListener("sgds-view",this._handleViewChanged),this.addEventListener("sgds-change-calendar",this._handleDateChanged),this.addEventListener("sgds-update-focus",this._handleFocusDateChanged),this.addEventListener("sgds-selectmonth",this._handleSelectMonth),this.addEventListener("sgds-selectyear",this._handleSelectYear),this.addEventListener("sgds-selectdates",this._handleSelectDatesAndClose),this.addEventListener("sgds-selectdates-input",this._handleSelectDatesInput),this.addEventListener("sgds-empty-input",this._handleEmptyInput),this.addEventListener("keydown",this._handleTab),this.addEventListener("sgds-hide",this._handleCloseMenu),this.addEventListener("sgds-show",this._handleOpenMenu),this.addEventListener("blur",this._mixinCheckValidity),this.initialValue=this.value?this.value.split(" - ").map(t=>t.trim()):this.initialValue,this.initialDisplayDate=this.displayDate||new Date,this.initialValue&&this.initialValue.length>0){const t=new RegExp(this._getDateFormatRegex()),e=this.initialValue.filter(e=>!t.test(e));if(e.length>0)return console.error("Invalid date format in initialValue:",e);{const t=this.initialValue.map(t=>Ds(Jt(t,Zs[this.dateFormat].fnsPattern,new Date)));this._handleSelectDates(t)}}else this.displayDate=this.initialDisplayDate}async firstUpdated(t){if(super.firstUpdated(t),this.menuIsOpen){const t=await this.datepickerInputAsync;this.
|
|
2530
|
+
`}}wr.styles=[...fr.styles,mr],t([Zi({type:String})],wr.prototype,"minDate",void 0),t([Zi({type:String})],wr.prototype,"maxDate",void 0),t([Zi({type:String,reflect:!0})],wr.prototype,"mode",void 0),t([Bi("input")],wr.prototype,"shadowInput",void 0);var yr,br,xr=re`:host{--datepicker-theme-color:var(--sgds-primary);--datepicker-hover-bg:var(--sgds-primary-100);--datepicker-bg:#fff;--datepicker-close-btn-bg:var(--datepicker-theme-color);--datepicker-close-btn-hover-bg:var(--sgds-primary-700);--datepicker-close-btn-color:#fff;--datepicker-selected-date-bg:var(--sgds-primary);--datepicker-selected-date-color:#fff;font-size:var(--sgds-font-size-14)}:host([menuisopen]:not([disabled]):not([readonly])) .dropdown-menu{background-color:var(--sgds-form-surface-default);display:flex;flex-direction:column;gap:var(--sgds-form-gap-sm);overflow:unset;padding:var(--sgds-form-padding-y) var(--sgds-form-padding-x);width:var(--sgds-dimension-320)}.dropdown{display:flex;height:100%}sgds-datepicker-input{--input-border-radius:var(--sgds-form-border-radius-md) 0 0 var(--sgds-form-border-radius-md);flex:1;margin-right:0}sgds-icon-button{--btn-border-radius:0 var(--sgds-form-border-radius-md) var(--sgds-form-border-radius-md) 0}.datepicker-container{display:flex}.calendar-btn:not(.with-hint-text){align-self:center}.calendar-btn:not(.with-hint-text).with-label{align-self:end;margin-top:calc(var(--sgds-line-height-24) - var(--sgds-line-height-20))}.calendar-btn.with-hint-text.with-label{align-self:center;margin-top:calc(var(--sgds-line-height-24) - var(--sgds-line-height-20))}`;class _r extends(gr(Ms)){constructor(){super(),this.required=!1,this.disabled=!1,this.value="",this.initialValue=[],this.dateFormat="DD/MM/YYYY",this.minDate="",this.maxDate="",this.mode="single",this.hasFeedback=!1,this.label="",this.hintText="",this.noFlip=!1,this.drop="down",this.defaultValue="",this.invalid=!1,this.view="days",this.selectedDateRange=[],this.focusedTabIndex=3,this.initialDisplayDate=new Date,this._makeInputValueString=(t,e,i)=>{if(!t&&!e)return this.value;const a=t=>X(t,Zs[i].fnsPattern);switch(this.mode){case"single":t&&(this.value=a(t));break;case"range":t&&e&&(this.value=`${a(t)} - ${a(e)}`),t&&!e&&(this.value=`${a(t)} - ${this.dateFormat}`)}return this.value},this._dialogAriaLabels={days:"Choose date",months:"Choose month",years:"Choose year"},this.floatingOpts={placement:"bottom-end"}}isValueEmpty(){return""===this.value||"DD/MM/YYYY"===this.value||"DD/MM/YYYY - DD/MM/YYYY"===this.value}reportValidity(){return this._mixinReportValidity()}checkValidity(){return this._mixinCheckValidity()}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}async connectedCallback(){if(super.connectedCallback(),this.addEventListener("sgds-view",this._handleViewChanged),this.addEventListener("sgds-change-calendar",this._handleDateChanged),this.addEventListener("sgds-update-focus",this._handleFocusDateChanged),this.addEventListener("sgds-selectmonth",this._handleSelectMonth),this.addEventListener("sgds-selectyear",this._handleSelectYear),this.addEventListener("sgds-selectdates",this._handleSelectDatesAndClose),this.addEventListener("sgds-selectdates-input",this._handleSelectDatesInput),this.addEventListener("sgds-empty-input",this._handleEmptyInput),this.addEventListener("keydown",this._handleTab),this.addEventListener("sgds-hide",this._handleCloseMenu),this.addEventListener("sgds-show",this._handleOpenMenu),this.addEventListener("blur",this._mixinCheckValidity),this.initialValue=this.value?this.value.split(" - ").map(t=>t.trim()):this.initialValue,this.initialDisplayDate=this.displayDate||new Date,this.initialValue&&this.initialValue.length>0){const t=new RegExp(this._getDateFormatRegex()),e=this.initialValue.filter(e=>!t.test(e));if(e.length>0)return console.error("Invalid date format in initialValue:",e);{const t=this.initialValue.map(t=>Ds(Jt(t,Zs[this.dateFormat].fnsPattern,new Date)));this._handleSelectDates(t)}}else this.displayDate=this.initialDisplayDate}async firstUpdated(t){if(super.firstUpdated(t),this.menuIsOpen){const t=await this.datepickerInputAsync;await this.updateFloatingPosition();(await this.calendar).focusOnCalendar(t)}}_getDateFormatRegex(){return this.dateFormat.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace("MM","\\d{2}").replace("DD","\\d{2}").replace("YYYY","\\d{4}").replace("/","\\/")}_handleTab(t){if(!this.menuIsOpen)return;const e=Array(4);t.shiftKey&&"Tab"===t.key?(t.preventDefault(),this.focusedTabIndex=(this.focusedTabIndex-1+e.length)%e.length):"Tab"===t.key&&(t.preventDefault(),this.focusedTabIndex=(this.focusedTabIndex+1+e.length)%e.length)}_handleValueChange(){this.emit("sgds-change-date")}async _handleCloseMenu(){if((await this.datepickerInputAsync).focus(),0===this.selectedDateRange.length)this.displayDate=this.initialDisplayDate;else{const t=this.selectedDateRange.length;this.displayDate=this.selectedDateRange[t-1];(await this.calendar)._updateFocusedDate()}}async _handleOpenMenu(){const t=await this.calendar,e=await this.datepickerInputAsync;t.focusOnCalendar(e)}_handleSelectDatesInput(t){this._handleSelectDates(t.detail)}async _handleSelectDates(t){t.sort((t,e)=>t.getTime()-e.getTime()),this.displayDate=t[0],this.focusedDate=t[0],this.selectedDateRange=t;const e=this._makeInputValueString(this.selectedDateRange[0],this.selectedDateRange[1],this.dateFormat);this.value=e;(await this.datepickerInputAsync).updateMaskValue(),this._manageInternalsValid()}async _handleSelectDatesAndClose(t){await this._handleSelectDates(t.detail),("range"===this.mode&&2===this.selectedDateRange.length||"single"===this.mode&&1===this.selectedDateRange.length)&&this.hideMenu()}_handleViewChanged(t){this.view=t.detail}_handleDateChanged(t){this.displayDate=t.detail}_handleFocusDateChanged(t){this.focusedDate=t.detail}_handleSelectMonth(t){this.displayDate=t.detail}_handleSelectYear(t){this.displayDate=t.detail}async _handleInvalidInput(){this.selectedDateRange=[],this.displayDate=this.initialDisplayDate,this.invalid=!0,this._manageInternalsBadInput()}async _handleEmptyInput(){this.required&&this._manageEmptyInput()}async _resetDatepicker(t=""){this.displayDate=this.initialDisplayDate,this.selectedDateRange=[],this.value=t,this.view="days";const e=await this.datepickerInputAsync;e.setInvalid(!1),e.destroyInputMask(),await e.applyInputMask(),this._mixinResetValidity(e),this.isValueEmpty()&&this._handleEmptyInput()}_manageInternalsBadInput(){this._mixinSetValidity({badInput:!0},"Invalid date input",this.datepickerInput)}_manageEmptyInput(){this._mixinSetValidity({valueMissing:!0},"Please fill in this field",this.datepickerInput)}_manageInternalsValid(){this._mixinSetValidity({}),this.invalid=this.datepickerInput.invalid=!1,this._mixinSetFormValue()}async _mixinResetFormControl(){this._resetDatepicker(this.defaultValue)}async _handleInputMaskChange(t){this.value=t.detail,this.isValueEmpty()&&this._resetDatepicker()}render(){return Je`
|
|
2531
2531
|
<div class="datepicker-container">
|
|
2532
2532
|
<sgds-datepicker-input
|
|
2533
2533
|
.value=${Ri(this.value)}
|