@trendyol/baklava 2.4.0-beta.9 → 3.0.0-beta.10
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/README.md +3 -3
- package/dist/assets/badge.svg +5 -0
- package/dist/assets/express.svg +3 -0
- package/dist/assets/express_delivery.svg +6 -0
- package/dist/assets/express_furniture.svg +6 -0
- package/dist/assets/medal.svg +2 -10
- package/dist/assets/sorting_asc.svg +4 -0
- package/dist/assets/sorting_desc.svg +4 -0
- package/dist/assets/translation.svg +3 -0
- package/dist/baklava-react.d.ts +85 -27
- package/dist/baklava-react.d.ts.map +1 -1
- package/dist/baklava-react.js +1 -1
- package/dist/baklava-react.js.map +3 -3
- package/dist/baklava-vue.d.ts +7 -0
- package/dist/baklava.d.ts +7 -0
- package/dist/baklava.d.ts.map +1 -1
- package/dist/baklava.js +1 -1
- package/dist/{chunk-AVMAZXZT.js → chunk-3IQYFKUZ.js} +2 -2
- package/dist/{chunk-SLY6IY2R.js → chunk-3QXRSN5E.js} +2 -2
- package/dist/{chunk-XQUQIQBO.js → chunk-57IOXMBV.js} +2 -2
- package/dist/chunk-6DJUQN3S.js +2 -0
- package/dist/chunk-6DJUQN3S.js.map +7 -0
- package/dist/chunk-6FHZDUYQ.js +16 -0
- package/dist/chunk-6FHZDUYQ.js.map +7 -0
- package/dist/{chunk-EPFBV6RC.js → chunk-6H54TTNK.js} +3 -3
- package/dist/chunk-6H54TTNK.js.map +7 -0
- package/dist/chunk-BHKJL7XR.js +63 -0
- package/dist/chunk-BHKJL7XR.js.map +7 -0
- package/dist/chunk-DNSU2ZXO.js +2 -0
- package/dist/chunk-DNSU2ZXO.js.map +7 -0
- package/dist/{chunk-RQG2GHCK.js → chunk-DR4D2GMR.js} +2 -2
- package/dist/{chunk-MNNOI75G.js → chunk-FPDUGGJ5.js} +2 -2
- package/dist/chunk-HBMVE2VJ.js +26 -0
- package/dist/chunk-HBMVE2VJ.js.map +7 -0
- package/dist/chunk-HBPBDC7T.js +95 -0
- package/dist/chunk-HBPBDC7T.js.map +7 -0
- package/dist/chunk-HMDGICS5.js +2 -0
- package/dist/chunk-HMDGICS5.js.map +7 -0
- package/dist/{chunk-PCREGBBF.js → chunk-HSVSMABT.js} +2 -2
- package/dist/{chunk-X5MXYPRD.js → chunk-HULHLSIH.js} +2 -2
- package/dist/chunk-HZ6A5QFC.js +2 -0
- package/dist/chunk-HZ6A5QFC.js.map +7 -0
- package/dist/{chunk-FJTTJ5ZT.js → chunk-IU67AS3O.js} +2 -2
- package/dist/chunk-IZ2LK5GK.js +2 -0
- package/dist/{chunk-RFUZBNM4.js → chunk-JZ3S4JFA.js} +2 -2
- package/dist/chunk-K3IALLEI.js +2 -0
- package/dist/chunk-K3IALLEI.js.map +7 -0
- package/dist/{chunk-JI2OEPG2.js → chunk-L6BUT2FV.js} +2 -2
- package/dist/{chunk-6UTBN2XX.js → chunk-LYOZ36IH.js} +2 -2
- package/dist/{chunk-KR6AUZ77.js → chunk-MACM4RPG.js} +2 -2
- package/dist/chunk-MG23TBA3.js +18 -0
- package/dist/chunk-MG23TBA3.js.map +7 -0
- package/dist/chunk-O665PNJ6.js +33 -0
- package/dist/chunk-O665PNJ6.js.map +7 -0
- package/dist/{chunk-5EFPA3CA.js → chunk-PLUCMBSD.js} +5 -5
- package/dist/chunk-PLUCMBSD.js.map +7 -0
- package/dist/{chunk-WA7DDIST.js → chunk-Q7LYRUYQ.js} +2 -2
- package/dist/chunk-QXFCLEZB.js +16 -0
- package/dist/chunk-QXFCLEZB.js.map +7 -0
- package/dist/chunk-TI6K2YFV.js +11 -0
- package/dist/chunk-TI6K2YFV.js.map +7 -0
- package/dist/chunk-UERDT3VQ.js +50 -0
- package/dist/chunk-UERDT3VQ.js.map +7 -0
- package/dist/chunk-VZDVVGEO.js +110 -0
- package/dist/chunk-VZDVVGEO.js.map +7 -0
- package/dist/chunk-WJ2RNEDL.js +8 -0
- package/dist/chunk-WJ2RNEDL.js.map +7 -0
- package/dist/chunk-XDCNO7EY.js +2 -0
- package/dist/chunk-XDCNO7EY.js.map +7 -0
- package/dist/chunk-XDUIVR6I.js +2 -0
- package/dist/chunk-XDUIVR6I.js.map +7 -0
- package/dist/{chunk-LWG2UXQG.js → chunk-XLRX2X2I.js} +2 -2
- package/dist/{chunk-VOYAVKU3.js → chunk-YCHZB54C.js} +2 -2
- package/dist/{chunk-L4XYDFNG.js → chunk-YML6L24Q.js} +3 -3
- package/dist/{chunk-L4XYDFNG.js.map → chunk-YML6L24Q.js.map} +2 -2
- package/dist/components/alert/bl-alert.d.ts +1 -1
- package/dist/components/alert/bl-alert.d.ts.map +1 -1
- package/dist/components/alert/bl-alert.js +1 -1
- package/dist/components/badge/bl-badge.d.ts +1 -1
- package/dist/components/badge/bl-badge.d.ts.map +1 -1
- package/dist/components/badge/bl-badge.js +1 -1
- package/dist/components/button/bl-button.d.ts +4 -4
- package/dist/components/button/bl-button.d.ts.map +1 -1
- package/dist/components/button/bl-button.js +1 -1
- package/dist/components/checkbox-group/bl-checkbox-group.js +1 -1
- package/dist/components/checkbox-group/checkbox/bl-checkbox.js +1 -1
- package/dist/components/dialog/bl-dialog.d.ts.map +1 -1
- package/dist/components/dialog/bl-dialog.js +1 -1
- package/dist/components/dialog/bl-dialog.stories.d.ts +1 -1
- package/dist/components/dialog/bl-dialog.stories.d.ts.map +1 -1
- package/dist/components/dialog/bl-dialog.stories.js +1 -1
- package/dist/components/drawer/bl-drawer.d.ts +6 -0
- package/dist/components/drawer/bl-drawer.d.ts.map +1 -1
- package/dist/components/drawer/bl-drawer.js +1 -1
- package/dist/components/dropdown/bl-dropdown.d.ts.map +1 -1
- package/dist/components/dropdown/bl-dropdown.js +1 -1
- package/dist/components/dropdown/group/bl-dropdown-group.js +1 -1
- package/dist/components/dropdown/item/bl-dropdown-item.d.ts +1 -0
- package/dist/components/dropdown/item/bl-dropdown-item.d.ts.map +1 -1
- package/dist/components/dropdown/item/bl-dropdown-item.js +1 -1
- package/dist/components/icon/bl-icon.js +1 -1
- package/dist/components/icon/icon-list.d.ts +2 -2
- package/dist/components/icon/icon-list.d.ts.map +1 -1
- package/dist/components/icon/icon-list.js +1 -1
- package/dist/components/icon/icon-list.js.map +2 -2
- package/dist/components/input/bl-input.d.ts +2 -2
- package/dist/components/input/bl-input.d.ts.map +1 -1
- package/dist/components/input/bl-input.js +1 -1
- package/dist/components/notification/bl-notification.d.ts +3 -3
- package/dist/components/notification/bl-notification.d.ts.map +1 -1
- package/dist/components/notification/bl-notification.js +1 -1
- package/dist/components/notification/bl-notification.stories.d.ts +2 -2
- package/dist/components/notification/bl-notification.stories.d.ts.map +1 -1
- package/dist/components/notification/bl-notification.stories.js +1 -1
- package/dist/components/notification/bl-notification.stories.js.map +1 -1
- package/dist/components/notification/card/bl-notification-card.d.ts +1 -1
- package/dist/components/notification/card/bl-notification-card.d.ts.map +1 -1
- package/dist/components/notification/card/bl-notification-card.js +1 -1
- package/dist/components/pagination/bl-pagination.d.ts +2 -2
- package/dist/components/pagination/bl-pagination.d.ts.map +1 -1
- package/dist/components/pagination/bl-pagination.js +1 -1
- package/dist/components/popover/bl-popover.d.ts +2 -2
- package/dist/components/popover/bl-popover.d.ts.map +1 -1
- package/dist/components/popover/bl-popover.js +1 -1
- package/dist/components/progress-indicator/bl-progress-indicator.d.ts +1 -1
- package/dist/components/progress-indicator/bl-progress-indicator.d.ts.map +1 -1
- package/dist/components/progress-indicator/bl-progress-indicator.js +1 -1
- package/dist/components/radio-group/bl-radio-group.js +1 -1
- package/dist/components/radio-group/radio/bl-radio.js +1 -1
- package/dist/components/select/bl-select.d.ts +11 -9
- package/dist/components/select/bl-select.d.ts.map +1 -1
- package/dist/components/select/bl-select.js +1 -1
- package/dist/components/select/option/bl-select-option.d.ts +4 -0
- package/dist/components/select/option/bl-select-option.d.ts.map +1 -1
- package/dist/components/select/option/bl-select-option.js +1 -1
- package/dist/components/split-button/bl-split-button.d.ts +103 -0
- package/dist/components/split-button/bl-split-button.d.ts.map +1 -0
- package/dist/components/split-button/bl-split-button.js +2 -0
- package/dist/components/split-button/bl-split-button.js.map +7 -0
- package/dist/components/split-button/bl-split-button.test.d.ts +2 -0
- package/dist/components/split-button/bl-split-button.test.d.ts.map +1 -0
- package/dist/components/switch/bl-switch.d.ts.map +1 -1
- package/dist/components/switch/bl-switch.js +1 -1
- package/dist/components/tab-group/bl-tab-group.js +1 -1
- package/dist/components/tab-group/tab/bl-tab.js +1 -1
- package/dist/components/tab-group/tab-panel/bl-tab-panel.js +1 -1
- package/dist/components/table/bl-table.d.ts +120 -0
- package/dist/components/table/bl-table.d.ts.map +1 -0
- package/dist/components/table/bl-table.js +2 -0
- package/dist/components/table/bl-table.js.map +7 -0
- package/dist/components/table/bl-table.test.d.ts +6 -0
- package/dist/components/table/bl-table.test.d.ts.map +1 -0
- package/dist/components/table/table-body/bl-table-body.d.ts +19 -0
- package/dist/components/table/table-body/bl-table-body.d.ts.map +1 -0
- package/dist/components/table/table-body/bl-table-body.js +2 -0
- package/dist/components/table/table-body/bl-table-body.js.map +7 -0
- package/dist/components/table/table-body/bl-table-body.test.d.ts +2 -0
- package/dist/components/table/table-body/bl-table-body.test.d.ts.map +1 -0
- package/dist/components/table/table-cell/bl-table-cell.d.ts +35 -0
- package/dist/components/table/table-cell/bl-table-cell.d.ts.map +1 -0
- package/dist/components/table/table-cell/bl-table-cell.js +2 -0
- package/dist/components/table/table-cell/bl-table-cell.js.map +7 -0
- package/dist/components/table/table-cell/bl-table-cell.test.d.ts +2 -0
- package/dist/components/table/table-cell/bl-table-cell.test.d.ts.map +1 -0
- package/dist/components/table/table-header/bl-table-header.d.ts +22 -0
- package/dist/components/table/table-header/bl-table-header.d.ts.map +1 -0
- package/dist/components/table/table-header/bl-table-header.js +2 -0
- package/dist/components/table/table-header/bl-table-header.js.map +7 -0
- package/dist/components/table/table-header/bl-table-header.test.d.ts +2 -0
- package/dist/components/table/table-header/bl-table-header.test.d.ts.map +1 -0
- package/dist/components/table/table-header-cell/bl-table-header-cell.d.ts +43 -0
- package/dist/components/table/table-header-cell/bl-table-header-cell.d.ts.map +1 -0
- package/dist/components/table/table-header-cell/bl-table-header-cell.js +2 -0
- package/dist/components/table/table-header-cell/bl-table-header-cell.js.map +7 -0
- package/dist/components/table/table-header-cell/bl-table-header-cell.test.d.ts +2 -0
- package/dist/components/table/table-header-cell/bl-table-header-cell.test.d.ts.map +1 -0
- package/dist/components/table/table-row/bl-table-row.d.ts +31 -0
- package/dist/components/table/table-row/bl-table-row.d.ts.map +1 -0
- package/dist/components/table/table-row/bl-table-row.js +2 -0
- package/dist/components/table/table-row/bl-table-row.js.map +7 -0
- package/dist/components/table/table-row/bl-table-row.test.d.ts +2 -0
- package/dist/components/table/table-row/bl-table-row.test.d.ts.map +1 -0
- package/dist/components/textarea/bl-textarea.d.ts +1 -1
- package/dist/components/textarea/bl-textarea.d.ts.map +1 -1
- package/dist/components/textarea/bl-textarea.js +1 -1
- package/dist/components/tooltip/bl-tooltip.d.ts +1 -1
- package/dist/components/tooltip/bl-tooltip.d.ts.map +1 -1
- package/dist/components/tooltip/bl-tooltip.js +1 -1
- package/dist/custom-elements.json +824 -43
- package/dist/generated/locale-codes.d.ts +14 -0
- package/dist/generated/locale-codes.d.ts.map +1 -0
- package/dist/generated/locale-codes.js +2 -0
- package/dist/generated/locale-codes.js.map +7 -0
- package/dist/generated/locales/tr.d.ts +9 -0
- package/dist/generated/locales/tr.d.ts.map +1 -0
- package/dist/generated/locales/tr.js +2 -0
- package/dist/generated/locales/tr.js.map +7 -0
- package/dist/localization.d.ts +4 -0
- package/dist/localization.d.ts.map +1 -0
- package/dist/localization.js +2 -0
- package/dist/localization.js.map +7 -0
- package/dist/utilities/icon-mock.d.ts +1 -1
- package/dist/utilities/icon-mock.d.ts.map +1 -1
- package/dist/utilities/style-to-px-converter.test.d.ts +2 -0
- package/dist/utilities/style-to-px-converter.test.d.ts.map +1 -0
- package/dist/utilities/style-to-px.converter.d.ts +2 -0
- package/dist/utilities/style-to-px.converter.d.ts.map +1 -0
- package/package.json +11 -7
- package/dist/chunk-5EFPA3CA.js.map +0 -7
- package/dist/chunk-AMAOGVPQ.js +0 -106
- package/dist/chunk-AMAOGVPQ.js.map +0 -7
- package/dist/chunk-BNACGMP2.js +0 -16
- package/dist/chunk-BNACGMP2.js.map +0 -7
- package/dist/chunk-CYCIT2TG.js +0 -2
- package/dist/chunk-DJOD4BTL.js +0 -2
- package/dist/chunk-DJOD4BTL.js.map +0 -7
- package/dist/chunk-EPFBV6RC.js.map +0 -7
- package/dist/chunk-FSFO7DCO.js +0 -50
- package/dist/chunk-FSFO7DCO.js.map +0 -7
- package/dist/chunk-HJWQ7Y3K.js +0 -5
- package/dist/chunk-HJWQ7Y3K.js.map +0 -7
- package/dist/chunk-JPRCBAHY.js +0 -23
- package/dist/chunk-JPRCBAHY.js.map +0 -7
- package/dist/chunk-KXWP6EDU.js +0 -26
- package/dist/chunk-KXWP6EDU.js.map +0 -7
- package/dist/chunk-MPKYBU46.js +0 -33
- package/dist/chunk-MPKYBU46.js.map +0 -7
- /package/dist/{chunk-AVMAZXZT.js.map → chunk-3IQYFKUZ.js.map} +0 -0
- /package/dist/{chunk-SLY6IY2R.js.map → chunk-3QXRSN5E.js.map} +0 -0
- /package/dist/{chunk-XQUQIQBO.js.map → chunk-57IOXMBV.js.map} +0 -0
- /package/dist/{chunk-RQG2GHCK.js.map → chunk-DR4D2GMR.js.map} +0 -0
- /package/dist/{chunk-MNNOI75G.js.map → chunk-FPDUGGJ5.js.map} +0 -0
- /package/dist/{chunk-PCREGBBF.js.map → chunk-HSVSMABT.js.map} +0 -0
- /package/dist/{chunk-X5MXYPRD.js.map → chunk-HULHLSIH.js.map} +0 -0
- /package/dist/{chunk-FJTTJ5ZT.js.map → chunk-IU67AS3O.js.map} +0 -0
- /package/dist/{chunk-CYCIT2TG.js.map → chunk-IZ2LK5GK.js.map} +0 -0
- /package/dist/{chunk-RFUZBNM4.js.map → chunk-JZ3S4JFA.js.map} +0 -0
- /package/dist/{chunk-JI2OEPG2.js.map → chunk-L6BUT2FV.js.map} +0 -0
- /package/dist/{chunk-6UTBN2XX.js.map → chunk-LYOZ36IH.js.map} +0 -0
- /package/dist/{chunk-KR6AUZ77.js.map → chunk-MACM4RPG.js.map} +0 -0
- /package/dist/{chunk-WA7DDIST.js.map → chunk-Q7LYRUYQ.js.map} +0 -0
- /package/dist/{chunk-LWG2UXQG.js.map → chunk-XLRX2X2I.js.map} +0 -0
- /package/dist/{chunk-VOYAVKU3.js.map → chunk-YCHZB54C.js.map} +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/components/dropdown/bl-dropdown.css", "../src/components/dropdown/bl-dropdown.ts", "../src/components/dropdown/item/bl-dropdown-item.css", "../src/components/dropdown/item/bl-dropdown-item.ts", "../src/components/split-button/bl-split-button.css", "../src/components/split-button/bl-split-button.ts"],
|
|
4
|
+
"sourcesContent": ["import {css} from 'lit';\nexport const styles = css`:host{position:relative;display:inline-block}:host([kind=\"neutral\"]) bl-popover{--bl-popover-border-color:var(--bl-color-neutral-darker)}:host([kind=\"success\"]) bl-popover{--bl-popover-border-color:var(--bl-color-success)}:host([kind=\"danger\"]) bl-popover{--bl-popover-border-color:var(--bl-color-danger)}.popover-content{display:flex;flex-direction:column;gap:var(--bl-size-xs)}`;\nexport default styles;\n", "import { LitElement, html, CSSResultGroup, TemplateResult } from \"lit\";\nimport { customElement, property, state, query } from \"lit/decorators.js\";\nimport { event, EventDispatcher } from \"../../utilities/event\";\nimport \"../button/bl-button\";\nimport BlButton, { ButtonSize, ButtonVariant, ButtonKind } from \"../button/bl-button\";\nimport BlPopover from \"../popover/bl-popover\";\nimport style from \"./bl-dropdown.css\";\nimport BlDropdownItem, { blDropdownItemTag } from \"./item/bl-dropdown-item\";\n\nexport const blDropdownTag = \"bl-dropdown\";\n\n/**\n * @tag bl-dropdown\n * @summary Baklava Dropdown component\n */\n@customElement(blDropdownTag)\nexport default class BlDropdown extends LitElement {\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n @query(\"bl-popover\")\n private _popover: BlPopover;\n\n @query(\"bl-button\")\n private _button: BlButton;\n\n @state() private _isPopoverOpen = false;\n\n /**\n * Sets the dropdown button label\n */\n @property({ type: String, reflect: true })\n label: string;\n\n /**\n * Sets the dropdown button variant\n */\n @property({ type: String, reflect: true })\n variant: ButtonVariant = \"primary\";\n\n /**\n * Sets the dropdown button kind\n */\n @property({ type: String, reflect: true })\n kind: ButtonKind = \"default\";\n\n /**\n * Sets the dropdown button size\n */\n @property({ type: String, reflect: true })\n size: ButtonSize = \"medium\";\n\n /**\n * Sets button as disabled\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Fires when dropdown opened\n */\n @event(\"bl-dropdown-open\") private onOpen: EventDispatcher<string>;\n\n /**\n * Fires when dropdown closed\n */\n @event(\"bl-dropdown-close\") private onClose: EventDispatcher<string>;\n\n connectedCallback() {\n super.connectedCallback();\n this.addEventListener(\"keydown\", this.handleKeyDown);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener(\"keydown\", this.handleKeyDown);\n }\n\n firstUpdated() {\n // `_button` will be undefined during the initial render.\n // To ensure proper rendering, we set `_popover.target` after the template has been created.\n this._popover.target = this._button;\n }\n\n get opened() {\n return this._isPopoverOpen;\n }\n\n private _handleClick() {\n !this._isPopoverOpen && !this.disabled ? this.open() : this.close();\n }\n\n private focusedOptionIndex = -1;\n\n private handleKeyDown(event: KeyboardEvent) {\n // Next action\n if ([\"ArrowDown\", \"ArrowRight\"].includes(event.key)) {\n this.focusedOptionIndex++;\n\n // Previous action\n } else if ([\"ArrowUp\", \"ArrowLeft\"].includes(event.key)) {\n this.focusedOptionIndex--;\n // Select action\n } else if (event.key === \"Escape\") {\n this.focusedOptionIndex = -1;\n this.close();\n return;\n } else {\n // Other keys are not our interest here\n return;\n }\n\n // Don't exceed array indexes\n this.focusedOptionIndex = Math.max(\n 0,\n Math.min(this.focusedOptionIndex, this.options.length - 1)\n );\n\n this.options[this.focusedOptionIndex].focus();\n\n event.preventDefault();\n }\n\n get options(): BlDropdownItem[] {\n return [...this.querySelectorAll(blDropdownItemTag)];\n }\n\n open() {\n this._isPopoverOpen = true;\n this._popover.show();\n this.onOpen(\"Dropdown opened!\");\n }\n\n close() {\n this._isPopoverOpen = false;\n this._popover.visible && this._popover.hide();\n this.onClose(\"Dropdown closed!\");\n }\n\n render(): TemplateResult {\n return html`<bl-button\n dropdown\n .active=${this.opened}\n ?disabled=${this.disabled}\n variant=\"${this.variant}\"\n kind=\"${this.kind}\"\n size=\"${this.size}\"\n @bl-click=\"${this._handleClick}\"\n >\n ${this.label}\n </bl-button>\n <bl-popover fit-size placement=\"bottom-start\" @bl-popover-hide=\"${this.close}\"\n ><div class=\"popover-content\">\n <slot></slot></div\n ></bl-popover> `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [blDropdownTag]: BlDropdown;\n }\n}\n", "import {css} from 'lit';\nexport const styles = css`:host{width:100%;--bl-button-display:block;--bl-button-justify:start}`;\nexport default styles;\n", "import { LitElement, html, CSSResultGroup, TemplateResult } from \"lit\";\nimport { customElement, property, query } from \"lit/decorators.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { event, EventDispatcher } from \"../../../utilities/event\";\nimport \"../../button/bl-button\";\nimport BlButton from \"../../button/bl-button\";\nimport { BaklavaIcon } from \"../../icon/icon-list\";\nimport type BlSplitButton from \"../../split-button/bl-split-button\";\nimport { blSplitButtonTag } from \"../../split-button/bl-split-button\";\nimport type BlDropdown from \"../bl-dropdown\";\nimport { blDropdownTag } from \"../bl-dropdown\";\nimport type BlDropdownGroup from \"../group/bl-dropdown-group\";\nimport { blDropdownGroupTag } from \"../group/bl-dropdown-group\";\nimport style from \"./bl-dropdown-item.css\";\n\nexport const blDropdownItemTag = \"bl-dropdown-item\";\n\n/**\n * @tag bl-dropdown-item\n * @summary Baklava Dropdown Item component\n */\n@customElement(blDropdownItemTag)\nexport default class BlDropdownItem extends LitElement {\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n /**\n * Sets the icon name. Shows icon with bl-icon component\n */\n\n @property({ type: String })\n icon?: BaklavaIcon;\n\n @event(\"bl-dropdown-item-click\") private onClick: EventDispatcher<string>;\n\n private _handleClick() {\n this.BlDropdownField?.close();\n this.BlSplitButtonField?.close();\n this.onClick(\"Action clicked!\");\n }\n\n @query(\"[role=menuitem]\") private menuElement: BlButton;\n\n /**\n * Focuses this action\n */\n focus() {\n this.menuElement.focus();\n }\n\n private BlDropdownGroupField: BlDropdownGroup | null;\n private BlDropdownField: BlDropdown | null;\n private BlSplitButtonField: BlSplitButton | null;\n\n connectedCallback(): void {\n super.connectedCallback();\n\n this.BlDropdownGroupField = this.closest<BlDropdownGroup>(blDropdownGroupTag);\n this.BlDropdownField = this.closest<BlDropdown>(blDropdownTag);\n this.BlSplitButtonField = this.closest<BlSplitButton>(blSplitButtonTag);\n\n if (!this.BlDropdownField && !this.BlDropdownGroupField && !this.BlSplitButtonField) {\n console.warn(\n `bl-dropdown-item is designed to be used inside a ${blDropdownGroupTag}, ${blDropdownTag} or ${blSplitButtonTag}`,\n this\n );\n }\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n }\n\n render(): TemplateResult {\n return html`<bl-button\n variant=\"tertiary\"\n kind=\"neutral\"\n icon=\"${ifDefined(this.icon)}\"\n role=\"menuitem\"\n @click=\"${this._handleClick}\"\n ><slot></slot>\n </bl-button>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [blDropdownItemTag]: BlDropdownItem;\n }\n}\n", "import {css} from 'lit';\nexport const styles = css`:host{position:relative;display:inline-block}:host([kind=\"neutral\"]) bl-popover{--bl-popover-border-color:var(--bl-color-neutral-darker)}:host([kind=\"success\"]) bl-popover{--bl-popover-border-color:var(--bl-color-success)}:host([kind=\"danger\"]) bl-popover{--bl-popover-border-color:var(--bl-color-danger)}.split-button-container{display:flex}.split-main-button{width:100%;--bl-border-radius-m:calc(var(--bl-size-xs) / 2) 0 0 calc(var(--bl-size-xs) / 2)}.split-main-button:focus{--bl-border-radius-l:calc(var(--bl-size-m) / 2) 0 0 calc(var(--bl-size-m) / 2)}.dropdown-button{--bl-border-radius-m:0 calc(var(--bl-size-xs) / 2) calc(var(--bl-size-xs) / 2) 0}.dropdown-button:focus{--bl-border-radius-l:0 calc(var(--bl-size-m) / 2) calc(var(--bl-size-m) / 2) 0}:host([variant=\"secondary\"]) .dropdown-button{left:-1px}:host([dropdown-disabled][variant=\"secondary\"]) .dropdown-button{left:0}.split-divider{display:block;height:var(--bl-size-2xl);width:1px;background-color:var(--bl-color-neutral-full)}:host([variant=\"secondary\"]) .split-divider{display:none}:host([size=\"small\"]) .split-divider{height:var(--bl-size-xl)}:host([size=\"large\"]) .split-divider{height:var(--bl-size-3xl)}:host([dropdown-disabled][disabled]) .split-divider{display:block;background-color:var(--bl-color-neutral-lighter)}`;\nexport default styles;\n", "import { CSSResultGroup, html, LitElement, TemplateResult } from \"lit\";\nimport { customElement, property, state, query } from \"lit/decorators.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { ReferenceElement } from \"@floating-ui/core\";\nimport { event, EventDispatcher } from \"../../utilities/event\";\nimport \"../button/bl-button\";\nimport { TargetType } from \"../button/bl-button\";\nimport { ButtonSize, ButtonVariant, ButtonKind } from \"../button/bl-button\";\nimport BlDropdownItem, { blDropdownItemTag } from \"../dropdown/item/bl-dropdown-item\";\nimport { BaklavaIcon } from \"../icon/icon-list\";\nimport BlPopover from \"../popover/bl-popover\";\nimport style from \"./bl-split-button.css\";\n\nexport const blSplitButtonTag = \"bl-split-button\";\n\n/**\n * @tag bl-split-button\n * @summary Baklava Split Button component\n */\n\n@customElement(blSplitButtonTag)\nexport default class BlSplitButton extends LitElement {\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n @query(\"#split-button-container\") private trigger: ReferenceElement;\n\n @query(\"bl-popover\")\n private _popover: BlPopover;\n\n @state() private _isPopoverOpen = false;\n\n /**\n * Sets the split button label\n */\n @property({ type: String, reflect: true })\n label: string;\n\n /**\n * Sets the split button variant\n */\n @property({ type: String, reflect: true })\n variant: Exclude<ButtonVariant, \"tertiary\"> = \"primary\";\n\n /**\n * Sets the split button kind\n */\n @property({ type: String, reflect: true })\n kind: ButtonKind = \"default\";\n\n /**\n * Sets the split button size\n */\n @property({ type: String, reflect: true })\n size: ButtonSize = \"medium\";\n\n /**\n * Set link url. If set, split main button will be rendered as anchor tag.\n */\n @property({ type: String, reflect: true })\n href: string;\n\n /**\n * Sets main button as disabled\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Sets loading state of button\n */\n @property({ type: Boolean, reflect: true })\n loading = false;\n\n /**\n * Sets the button label for loading status.\n */\n @property({ type: String, attribute: \"loading-label\" })\n loadingLabel: string;\n\n /**\n * Sets dropdown button as disabled\n */\n @property({ attribute: \"dropdown-disabled\", type: Boolean })\n dropdownDisabled = false;\n\n /**\n * Sets the icon name. Shows icon with bl-icon component\n */\n @property({ type: String })\n icon?: BaklavaIcon;\n\n /**\n * Sets the anchor target. Used when `href` is set.\n */\n @property({ type: String })\n target?: TargetType = \"_self\";\n\n /**\n * Sets the type of the button. Set `submit` to use button as the submitter of parent form.\n */\n @property({ type: String })\n type: \"submit\";\n\n /**\n * Sets button to get keyboard focus automatically\n */\n @property({ type: Boolean, reflect: true })\n autofocus = false;\n\n /**\n * Sets the associated form of the button. Use when `type` is set to `submit` and button is not inside the target form.\n */\n @property({ type: String })\n form: HTMLFormElement | string;\n\n /**\n * Fires when dropdown opened\n */\n @event(\"bl-dropdown-open\") private onOpen: EventDispatcher<string>;\n\n /**\n * Fires when dropdown closed\n */\n @event(\"bl-dropdown-close\") private onClose: EventDispatcher<string>;\n\n /**\n * Fires when main button click\n */\n @event(\"bl-click\") private onClick: EventDispatcher<string>;\n\n connectedCallback() {\n super.connectedCallback();\n\n this.addEventListener(\"keydown\", this.handleKeyDown);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n\n this.removeEventListener(\"keydown\", this.handleKeyDown);\n }\n\n firstUpdated() {\n // To ensure proper rendering, we set `_popover.target` after the template has been created.\n this._popover.target = this.trigger;\n }\n\n get opened() {\n return this._isPopoverOpen;\n }\n\n private _handleClick() {\n !this._isPopoverOpen && !this.dropdownDisabled ? this.open() : this.close();\n }\n\n private _handlePrimaryClick() {\n this.onClick(\"Click event fired!\");\n }\n\n private focusedOptionIndex = -1;\n\n private handleKeyDown(event: KeyboardEvent) {\n // Next action\n if (this._isPopoverOpen && [\"ArrowDown\", \"ArrowRight\"].includes(event.key)) {\n this.focusedOptionIndex++;\n // Previous action\n } else if (this._isPopoverOpen && [\"ArrowUp\", \"ArrowLeft\"].includes(event.key)) {\n this.focusedOptionIndex--;\n // Select action\n } else if (this._isPopoverOpen && event.key === \"Escape\") {\n this.focusedOptionIndex = -1;\n this.close();\n return;\n } else {\n // Other keys are not our interest here\n return;\n }\n\n // Don't exceed array indexes\n this.focusedOptionIndex = Math.max(\n 0,\n Math.min(this.focusedOptionIndex, this.options.length - 1)\n );\n\n this.options[this.focusedOptionIndex].focus();\n\n event.preventDefault();\n }\n\n get options(): BlDropdownItem[] {\n return [...this.querySelectorAll(blDropdownItemTag)];\n }\n\n open() {\n this._isPopoverOpen = true;\n this._popover.show();\n this.onOpen(\"Dropdown opened!\");\n }\n\n close() {\n if (!this._isPopoverOpen) {\n return;\n }\n\n this._isPopoverOpen = false;\n this._popover.visible && this._popover.hide();\n this.onClose(\"Dropdown closed!\");\n }\n\n render(): TemplateResult {\n return html` <div class=\"split-button-container\" id=\"split-button-container\">\n <bl-button\n id=\"split-main-button\"\n class=\"split-main-button\"\n variant=\"${this.variant}\"\n kind=\"${this.kind}\"\n size=\"${this.size}\"\n loading-label=\"${ifDefined(this.loadingLabel)}\"\n icon=\"${ifDefined(this.icon)}\"\n href=\"${ifDefined(this.type)}\"\n ?disabled=\"${this.disabled}\"\n ?loading=\"${this.loading}\"\n type=\"${this.type}\"\n target=\"${ifDefined(this.target)}\"\n form=\"${ifDefined(this.form)}\"\n ?autofocus=\"${this.autofocus}\"\n @bl-click=\"${this._handlePrimaryClick}\"\n >\n ${this.label}\n </bl-button>\n <div class=\"split-divider\"></div>\n <bl-button\n id=\"dropdown-button\"\n class=\"dropdown-button\"\n .active=\"${this.opened}\"\n icon=\"${this.opened ? \"arrow_up\" : \"arrow_down\"}\"\n ?disabled=\"${this.dropdownDisabled}\"\n variant=\"${this.variant}\"\n kind=\"${this.kind}\"\n size=\"${this.size}\"\n ?loading=\"${this.loading}\"\n label=\"split-dropdown-button\"\n @bl-click=\"${this._handleClick}\"\n >\n </bl-button>\n <bl-popover fit-size placement=\"bottom-start\" @bl-popover-hide=\"${this.close}\">\n <div class=\"popover-content\">\n <slot></slot>\n </div>\n </bl-popover>\n </div>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [blSplitButtonTag]: BlSplitButton;\n }\n}\n"],
|
|
5
|
+
"mappings": "8QACO,IAAMA,EAASC,+XACfC,EAAQF,ECOR,IAAMG,EAAgB,cAORC,EAArB,cAAwCC,CAAW,CAAnD,kCAWW,KAAQ,eAAiB,GAYlC,aAAyB,UAMzB,UAAmB,UAMnB,UAAmB,SAMnB,cAAW,GAoCX,KAAQ,mBAAqB,GA5E7B,WAAW,QAAyB,CAClC,MAAO,CAACC,CAAK,CACf,CAkDA,mBAAoB,CAClB,MAAM,kBAAkB,EACxB,KAAK,iBAAiB,UAAW,KAAK,aAAa,CACrD,CAEA,sBAAuB,CACrB,MAAM,qBAAqB,EAC3B,KAAK,oBAAoB,UAAW,KAAK,aAAa,CACxD,CAEA,cAAe,CAGb,KAAK,SAAS,OAAS,KAAK,OAC9B,CAEA,IAAI,QAAS,CACX,OAAO,KAAK,cACd,CAEQ,cAAe,CACrB,CAAC,KAAK,gBAAkB,CAAC,KAAK,SAAW,KAAK,KAAK,EAAI,KAAK,MA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", "BlDropdown", "s", "bl_dropdown_default", "event", "blDropdownItemTag", "x", "__decorateClass", "i", "t", "e", "styles", "i", "bl_dropdown_item_default", "blDropdownItemTag", "BlDropdownItem", "s", "bl_dropdown_item_default", "_a", "_b", "blDropdownGroupTag", "blDropdownTag", "blSplitButtonTag", "x", "l", "__decorateClass", "e", "event", "i", "styles", "i", "bl_split_button_default", "blSplitButtonTag", "BlSplitButton", "s", "bl_split_button_default", "event", "blDropdownItemTag", "x", "l", "__decorateClass", "i", "t", "e"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/generated/locale-codes.ts"],
|
|
4
|
+
"sourcesContent": ["// Do not modify this file by hand!\n// Re-generate this file by running lit-localize.\n\n/**\n * The locale code that templates in this source code are written in.\n */\nexport const sourceLocale = `en`;\n\n/**\n * The other locale codes that this application is localized into. Sorted\n * lexicographically.\n */\nexport const targetLocales = [\n `tr`,\n] as const;\n\n/**\n * All valid project locale codes. Sorted lexicographically.\n */\nexport const allLocales = [\n `en`,\n `tr`,\n] as const;\n"],
|
|
5
|
+
"mappings": "AAMO,IAAMA,EAAe,KAMfC,EAAgB,CAC3B,IACF,EAKaC,EAAa,CACxB,KACA,IACF",
|
|
6
|
+
"names": ["sourceLocale", "targetLocales", "allLocales"]
|
|
7
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as v}from"./chunk-AAGDUS7G.js";import{a as d}from"./chunk-
|
|
1
|
+
import{a as v}from"./chunk-AAGDUS7G.js";import{a as d}from"./chunk-XDUIVR6I.js";import{a as f}from"./chunk-DINNT5P2.js";import{a as o}from"./chunk-GRL4DWKG.js";import{a as c,b as r,e as m}from"./chunk-X2KXJYXQ.js";import{a as s,b as a,f as n}from"./chunk-4OT5AMS5.js";import{d as t}from"./chunk-IZ2LK5GK.js";var E=s`:host{display:flex;flex-direction:row}fieldset{border:none;padding:0}legend{font:var(--bl-font-title-3-medium);color:var(--bl-color-neutral-darker)}.options{display:flex;flex-flow:var(--bl-checkbox-direction, column) wrap;gap:var(--bl-size-m);margin-block:var(--bl-size-xs)}`,g=E;var u="bl-checkbox-group",p="bl-checkbox-group-change",l=class extends d(n){constructor(){super(...arguments);this.value=[];this.required=!1;this.focusedOptionIndex=0}static get styles(){return[g]}get options(){return[...this.querySelectorAll(h)]}get checkedOptions(){return this.options.filter(e=>e.checked).map(e=>e.value)}get availableOptions(){return this.options.filter(e=>!e.disabled)}connectedCallback(){super.connectedCallback(),this.tabIndex=0,this.addEventListener("focus",this.handleFocus),this.addEventListener("keydown",this.handleKeyDown)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("focus",this.handleFocus),this.removeEventListener("keydown",this.handleKeyDown)}updated(e){e.has("value")&&(this.setValue(this.checkedOptions.join(",")),this.onChange(this.value))}handleOptionChecked(){this.value=this.checkedOptions}handleKeyDown(e){if(["ArrowDown","ArrowRight"].includes(e.key))this.focusedOptionIndex++;else if(["ArrowUp","ArrowLeft"].includes(e.key))this.focusedOptionIndex--;else if(e.key==="Tab"){if(e.shiftKey?this.focusedOptionIndex--:this.focusedOptionIndex++,this.focusedOptionIndex===this.availableOptions.length){this.tabIndex=0,this.focusedOptionIndex=0;return}}else return;this.focusedOptionIndex=Math.max(0,Math.min(this.focusedOptionIndex,this.availableOptions.length-1)),this.availableOptions[this.focusedOptionIndex].focus(),e.preventDefault()}handleFocus(){this.availableOptions[this.focusedOptionIndex].focus()}render(){return a`<fieldset role="group" aria-labelledby="label" aria-required=${this.required}>
|
|
2
2
|
<legend id="label">${this.label}</legend>
|
|
3
3
|
<div class="options" @bl-checkbox-change=${this.handleOptionChecked}>
|
|
4
4
|
<slot></slot>
|
|
@@ -20,4 +20,4 @@ import{a as v}from"./chunk-AAGDUS7G.js";import{a as d}from"./chunk-DJOD4BTL.js";
|
|
|
20
20
|
<slot class="label"></slot>
|
|
21
21
|
</label>
|
|
22
22
|
`}};i.shadowRootOptions={...n.shadowRootOptions,delegatesFocus:!0},t([r({type:Boolean,reflect:!0})],i.prototype,"checked",2),t([r()],i.prototype,"value",2),t([r({type:Boolean,reflect:!0})],i.prototype,"required",2),t([r({type:Boolean,reflect:!0})],i.prototype,"disabled",2),t([r({type:Boolean,reflect:!0})],i.prototype,"indeterminate",2),t([o("bl-checkbox-change")],i.prototype,"onChange",2),t([o("bl-focus")],i.prototype,"onFocus",2),t([o("bl-blur")],i.prototype,"onBlur",2),t([m("[type=checkbox]")],i.prototype,"checkboxElement",2),i=t([c(h)],i);export{h as a,i as b,u as c,p as d,l as e};
|
|
23
|
-
//# sourceMappingURL=chunk-
|
|
23
|
+
//# sourceMappingURL=chunk-DR4D2GMR.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as k}from"./chunk-OSNB4BPE.js";import{a as $}from"./chunk-AAGDUS7G.js";import{a as z}from"./chunk-
|
|
1
|
+
import{b as k}from"./chunk-OSNB4BPE.js";import{a as $}from"./chunk-AAGDUS7G.js";import{a as z}from"./chunk-XDUIVR6I.js";import{a as w}from"./chunk-6LT7O7T2.js";import{a as s}from"./chunk-DINNT5P2.js";import{a as c}from"./chunk-GRL4DWKG.js";import{a as b,b as a,c as u,e as m}from"./chunk-X2KXJYXQ.js";import{a as f,b as y,c as x}from"./chunk-7GK5LKBV.js";import{a as v,b as d,c as g,f as p}from"./chunk-4OT5AMS5.js";import{d as r}from"./chunk-IZ2LK5GK.js";var C="important",I=" !"+C,S=y(class extends x{constructor(o){var l;if(super(o),o.type!==f.ATTRIBUTE||o.name!=="style"||((l=o.strings)===null||l===void 0?void 0:l.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(o){return Object.keys(o).reduce((l,e)=>{let i=o[e];return i==null?l:l+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}update(o,[l]){let{style:e}=o.element;if(this.ht===void 0){this.ht=new Set;for(let i in l)this.ht.add(i);return this.render(l)}this.ht.forEach(i=>{l[i]==null&&(this.ht.delete(i),i.includes("-")?e.removeProperty(i):e[i]="")});for(let i in l){let n=l[i];if(n!=null){this.ht.add(i);let h=typeof n=="string"&&n.endsWith(I);i.includes("-")||h?e.setProperty(i,h?n.slice(0,-11):n,h?C:""):e[i]=n}}return g}});var L=v`:host{display:inline-block;width:200px;position:relative}.wrapper{--row-count:1;--maxrow-count: ;--line-height:var(--bl-font-title-3-line-height);--scroll-height:var(--line-height);--padding-vertical:var(--bl-size-2xs);--padding-horizontal:var(--bl-size-xs);--label-padding:var(--bl-size-3xs);--border-size:1px;--default-scroll-height:calc((var(--row-count) * var(--line-height)) + var(--padding-vertical));--height:max(var(--scroll-height), var(--default-scroll-height));--input-font:var(--bl-font-body-text-2);--border-radius:var(--bl-size-3xs);--border-color:var(--bl-color-neutral-lighter);--background-color:var(--bl-color-neutral-full);display:flex;flex-direction:column;position:relative;gap:var(--bl-size-3xs)}.input-wrapper{border:solid var(--border-size) var(--border-color);border-radius:var(--border-radius);padding:0 calc(var(--padding-horizontal) - var(--label-padding) - var(--border-size));padding-top:var(--padding-vertical);display:flex;box-sizing:border-box;background-color:var(--background-color);margin:0;width:0;min-width:100%}textarea{--parent-padding:calc(var(--padding-horizontal) - var(--label-padding) - var(--border-size));width:100%;align-self:stretch;outline:none;font:var(--input-font);padding:0 calc(var(--padding-horizontal) - var(--border-size));padding-bottom:var(--padding-vertical);margin:0 calc(-1 * var(--parent-padding));border:none;border-radius:var(--border-radius);color:var(--bl-color-neutral-darker);resize:vertical;background-color:transparent;display:block}:host([size="large"]) .wrapper{--padding-vertical:var(--bl-size-xs);--padding-horizontal:var(--bl-size-m)}:host([size="small"]) .wrapper{--padding-vertical:var(--bl-size-3xs);--padding-horizontal:var(--bl-size-xs);--input-font:var(--bl-font-body-text-3);--line-height:var(--bl-font-title-4-line-height)}textarea:disabled{background-color:var(--bl-color-neutral-lightest);color:var(--bl-color-neutral-light);cursor:not-allowed}:host([disabled]) .wrapper{--background-color:var(--bl-color-neutral-lightest)}:host([expand]) textarea{overflow:hidden;resize:none;height:var(--height)}:host([expand][max-rows]) textarea{--maxrow-height:calc((var(--maxrow-count) * var(--line-height)) + var(--padding-vertical));overflow-y:scroll;height:min(var(--height), var(--maxrow-height))}.wrapper:focus-within{--border-color:var(--bl-color-primary)}.dirty.max-len-invalid,.dirty.invalid{--border-color:var(--bl-color-danger)}:host([label]) ::placeholder{color:transparent;transition:color ease-out 0.4s}.input-wrapper legend,label{padding:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}label{max-width:max-content;position:absolute;transition:all ease-in 0.1s;font:var(--bl-font-title-3-regular);top:var(--padding-vertical);left:var(--padding-horizontal);right:var(--padding-horizontal);pointer-events:none;color:var(--bl-color-neutral-light)}.input-wrapper legend{height:0;visibility:hidden;display:none}.input-wrapper legend span{padding:0 var(--label-padding);display:inline-block;opacity:0;visibility:visible}:where(.wrapper:focus-within, .wrapper.has-value) label{top:0;left:var(--padding-horizontal);transform:translateY(-50%);font:var(--bl-font-caption);color:var(--bl-color-neutral-dark);pointer-events:initial;z-index:var(--bl-index-base)}:host([label]) :where(.wrapper:focus-within, .wrapper.has-value) legend{max-width:100%;font:var(--bl-font-caption);display:block}:host ::placeholder,:host([label-fixed]) ::placeholder{color:var(--bl-color-neutral-light)}:host([label-fixed]) label{position:static;transition:none;transform:none;pointer-events:initial;font:var(--bl-font-caption);color:var(--bl-color-neutral-dark);background-color:initial;padding:0}:host([label-fixed]) legend{display:none}.hint{display:none;font:var(--bl-font-body-text-3)}:host([character-counter]) .hint,:host([help-text]) .hint,.dirty.invalid .hint{display:flex;gap:var(--bl-size-3xs)}.hint > *{margin:0;padding:0}.help-text,.invalid-text{flex:1}.counter-text{color:var(--bl-color-neutral-dark);margin-left:auto}:where(.max-len-invalid, .dirty.invalid) .hint > .counter-text{color:var(--bl-color-danger)}.dirty.invalid label{color:var(--bl-color-danger)}.invalid-text{display:none;color:var(--bl-color-danger)}.help-text{color:var(--bl-color-neutral-dark)}:where(.dirty.max-len-invalid, .dirty.invalid) .hint > .invalid-text{display:inline-block}.dirty.invalid .hint > .help-text{display:none}`,E=L;var t=class extends z(p){constructor(){super(...arguments);this.name="";this.required=!1;this.disabled=!1;this.expand=!1;this.size="medium";this.labelFixed=!1;this.characterCounter=!1;this.value="";this.rows=4;this.autofocus=!1;this.spellchecker="false";this.customScrollHeight=null;this.inputId=Math.random().toString(36).substring(2);this.onError=()=>{this.onInvalid(this.internals.validity)};this.dirty=!1}static get styles(){return[E]}connectedCallback(){var e;super.connectedCallback(),(e=this.internals.form)==null||e.addEventListener("submit",()=>{this.reportValidity()})}inputHandler(e){this.autoResize();let i=e.target.value;this.value=i,this.onInput(i)}changeHandler(e){let i=e.target.value;this.dirty=!0,this.value=i,this.onChange(i)}firstUpdated(){this.setValue(this.value),this.autoResize()}async updated(e){e.has("rows")&&this.autoResize(),e.has("value")&&(this.setValue(this.value),await this.validationComplete,this.requestUpdate())}reportValidity(){return this.dirty=!0,this.checkValidity()}valueChangedCallback(e){this.value=e}validityCallback(){var e;return this.customInvalidText||((e=this.validationTarget)==null?void 0:e.validationMessage)}autoResize(){if(!this.expand)return;this.validationTarget.style.height="auto";let e=this.validationTarget.scrollHeight;this.customScrollHeight=`${e}px`,this.validationTarget.style.removeProperty("height")}render(){let e=this.internals.validity.tooLong,i=this.checkValidity()?"":d`<p class="invalid-text">${this.validationMessage}</p>`,n=this.helpText?d`<p class="help-text">${this.helpText}</p>`:"",h=this.label?d`<label for="${this.inputId}">${this.label}</label>`:"",M=this.characterCounter&&this.maxlength?`${this.value.length}/${this.maxlength}`:this.characterCounter?`${this.value.length}`:"",R=this.characterCounter?d`<p class="counter-text">${M}</p>`:"",H={wrapper:!0,"has-value":this.value!==null&&this.value!=="",dirty:this.dirty,"max-len-invalid":e,invalid:!this.checkValidity()},V={"--row-count":`${this.rows}`,"--maxrow-count":this.maxRows?`${this.maxRows}`:null,"--scroll-height":this.customScrollHeight};return d`
|
|
2
2
|
<div style=${S(V)} class=${w(H)}>
|
|
3
3
|
${h}
|
|
4
4
|
<fieldset class="input-wrapper">
|
|
@@ -34,4 +34,4 @@ lit-html/directives/style-map.js:
|
|
|
34
34
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
35
35
|
*)
|
|
36
36
|
*/
|
|
37
|
-
//# sourceMappingURL=chunk-
|
|
37
|
+
//# sourceMappingURL=chunk-FPDUGGJ5.js.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import{a as l}from"./chunk-GRL4DWKG.js";import{a as p,b as n,c as b}from"./chunk-X2KXJYXQ.js";import{a as c,b as r,f as h}from"./chunk-4OT5AMS5.js";import{d as i}from"./chunk-IZ2LK5GK.js";var u=d=>{let o=d.match(/^(\d+(\.\d+)?)(.*)$/);if(!o)return null;let e=parseFloat(o[1]),a=o[3],s;switch(a){case"px":s=e;break;case"vw":s=e*window.innerWidth/100;break;case"%":s=e*window.innerWidth/100;break;default:s=null;break}return s};var v=c`.drawer{box-sizing:border-box;position:fixed;display:flex;top:0;right:-100%;bottom:0;width:var(--bl-drawer-current-width, 424px);padding:var(--bl-size-xl);padding-top:max(env(safe-area-inset-top), var(--bl-size-xl));padding-right:max(env(safe-area-inset-right), var(--bl-size-xl));padding-bottom:max(env(safe-area-inset-bottom), var(--bl-size-xl));background:var(--bl-color-neutral-full);box-shadow:var(--bl-size-xs) 0 var(--bl-size-2xl) rgba(0 0 0 / 50%);transition:right var(--bl-drawer-animation-duration, 0.25s);z-index:var(--bl-index-sticky)}:host([open]) .drawer{right:0}iframe{height:100%;width:100%;border:none}.container{display:flex;flex-direction:column;gap:var(--bl-size-xl);flex:1;width:100%}header{display:flex;justify-content:space-between;align-items:baseline;gap:var(--bl-size-2xs);background-color:white}header .header-buttons{display:flex;gap:var(--bl-size-xl);margin-left:auto}header h2{font:var(--bl-font-title-1-medium);color:var(--bl-color-neutral-darker);overflow:hidden;margin:0;padding:0}.content{flex:1;overflow-y:scroll}.iframe-content{flex:1}`,m=v;var t=class extends h{constructor(){super(...arguments);this.open=!1;this.width="424px";this.domExistence=!1}static get styles(){return[m]}connectedCallback(){super.connectedCallback(),window==null||window.addEventListener("bl-drawer-open",e=>{e.target!==this&&this.closeDrawer()}),this.resizeDrawerWidth(),window==null||window.addEventListener("resize",()=>this.resizeDrawerWidth()),window==null||window.addEventListener("load",()=>this.resizeDrawerWidth())}disconnectedCallback(){super.disconnectedCallback(),window==null||window.removeEventListener("resize",()=>this.resizeDrawerWidth()),window==null||window.addEventListener("load",()=>this.resizeDrawerWidth())}updated(e){e.has("open")&&this.toggleDialogHandler(),e.has("width")&&this.resizeDrawerWidth()}resizeDrawerWidth(){let e=u(this.width),a=!e||e<100?"424px":this.width;e&&((window==null?void 0:window.innerWidth)<e?this.style.setProperty("--bl-drawer-current-width","calc(100vw - 24px)"):this.style.setProperty("--bl-drawer-current-width",a))}toggleDialogHandler(){this.open?(this.domExistenceSchedule&&clearTimeout(this.domExistenceSchedule),this.domExistence=!0,this.onOpen("")):(this.domExistenceSchedule=window.setTimeout(()=>{this.domExistence=!1},1e3),this.onClose(""))}closeDrawer(){this.open=!1}renderContent(){let e=this.embedUrl?r`<iframe src=${this.embedUrl}></iframe>`:r`<slot></slot>`;return r`<section class=${this.embedUrl?"iframe-content":"content"}>
|
|
2
|
+
${e}
|
|
3
|
+
</section>`}renderContainer(){let e=this.caption?r`<h2 id="drawer-caption">${this.caption}</h2>`:"",a=this.externalLink?r`<bl-button
|
|
4
|
+
icon="external_link"
|
|
5
|
+
variant="tertiary"
|
|
6
|
+
kind="neutral"
|
|
7
|
+
size="small"
|
|
8
|
+
href="${this.externalLink}"
|
|
9
|
+
target="_blank"
|
|
10
|
+
></bl-button>`:"";return r`<div class="container">
|
|
11
|
+
<header>
|
|
12
|
+
${e}
|
|
13
|
+
<div class="header-buttons">
|
|
14
|
+
${a}
|
|
15
|
+
<bl-button
|
|
16
|
+
@click="${this.closeDrawer}"
|
|
17
|
+
icon="close"
|
|
18
|
+
size="small"
|
|
19
|
+
variant="tertiary"
|
|
20
|
+
kind="neutral"
|
|
21
|
+
></bl-button>
|
|
22
|
+
</div>
|
|
23
|
+
</header>
|
|
24
|
+
${this.renderContent()}
|
|
25
|
+
</div>`}render(){return this.domExistence?r`<div class="drawer">${this.renderContainer()}</div>`:r``}};i([n({type:Boolean,reflect:!0})],t.prototype,"open",2),i([n({type:String})],t.prototype,"caption",2),i([n({type:String,attribute:"embed-url"})],t.prototype,"embedUrl",2),i([n({type:String,attribute:"external-link"})],t.prototype,"externalLink",2),i([n({type:String,attribute:"width"})],t.prototype,"width",2),i([l("bl-drawer-open")],t.prototype,"onOpen",2),i([l("bl-drawer-close")],t.prototype,"onClose",2),i([b()],t.prototype,"domExistence",2),t=i([p("bl-drawer")],t);export{t as a};
|
|
26
|
+
//# sourceMappingURL=chunk-HBMVE2VJ.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/utilities/style-to-px.converter.ts", "../src/components/drawer/bl-drawer.css", "../src/components/drawer/bl-drawer.ts"],
|
|
4
|
+
"sourcesContent": ["export const styleToPixelConverter = (styleValue: string): number | null => {\n const match = styleValue.match(/^(\\d+(\\.\\d+)?)(.*)$/);\n\n if (!match) return null;\n\n const value = parseFloat(match[1]);\n const unit = match[3];\n\n let styleInPixel: number | null;\n\n switch (unit) {\n case \"px\":\n styleInPixel = value;\n break;\n case \"vw\":\n styleInPixel = (value * window.innerWidth) / 100;\n break;\n case \"%\":\n styleInPixel = (value * window.innerWidth) / 100;\n break;\n default:\n styleInPixel = null;\n break;\n }\n return styleInPixel;\n};\n", "import {css} from 'lit';\nexport const styles = css`.drawer{box-sizing:border-box;position:fixed;display:flex;top:0;right:-100%;bottom:0;width:var(--bl-drawer-current-width, 424px);padding:var(--bl-size-xl);padding-top:max(env(safe-area-inset-top), var(--bl-size-xl));padding-right:max(env(safe-area-inset-right), var(--bl-size-xl));padding-bottom:max(env(safe-area-inset-bottom), var(--bl-size-xl));background:var(--bl-color-neutral-full);box-shadow:var(--bl-size-xs) 0 var(--bl-size-2xl) rgba(0 0 0 / 50%);transition:right var(--bl-drawer-animation-duration, 0.25s);z-index:var(--bl-index-sticky)}:host([open]) .drawer{right:0}iframe{height:100%;width:100%;border:none}.container{display:flex;flex-direction:column;gap:var(--bl-size-xl);flex:1;width:100%}header{display:flex;justify-content:space-between;align-items:baseline;gap:var(--bl-size-2xs);background-color:white}header .header-buttons{display:flex;gap:var(--bl-size-xl);margin-left:auto}header h2{font:var(--bl-font-title-1-medium);color:var(--bl-color-neutral-darker);overflow:hidden;margin:0;padding:0}.content{flex:1;overflow-y:scroll}.iframe-content{flex:1}`;\nexport default styles;\n", "import { CSSResultGroup, html, LitElement, TemplateResult } from \"lit\";\nimport { PropertyValues } from \"lit\";\nimport { customElement, property, state } from \"lit/decorators.js\";\nimport { event, EventDispatcher } from \"../../utilities/event\";\nimport { styleToPixelConverter } from \"../../utilities/style-to-px.converter\";\nimport \"../button/bl-button\";\nimport style from \"./bl-drawer.css\";\n\n/**\n * @tag bl-drawer\n * @summary Baklava Drawer component\n *\n * @cssproperty [--bl-drawer-animation-duration=250ms] Drawer slide in animation duration\n */\n\n@customElement(\"bl-drawer\")\nexport default class BlDrawer extends LitElement {\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n /**\n * Sets drawer open-close status\n */\n @property({ type: Boolean, reflect: true })\n open = false;\n\n /**\n * Sets the drawer title\n */\n @property({ type: String })\n caption?: string;\n\n /**\n * Sets the drawer embed url for iframe\n */\n @property({ type: String, attribute: \"embed-url\" })\n embedUrl?: string;\n\n /**\n * Sets the drawer external link\n */\n @property({ type: String, attribute: \"external-link\" })\n externalLink?: string;\n\n /**\n * Sets the drawer width\n */\n @property({ type: String, attribute: \"width\" })\n width: string = \"424px\";\n\n /**\n * Fires when the drawer is opened\n */\n @event(\"bl-drawer-open\") private onOpen: EventDispatcher<string>;\n\n /**\n * Fires when the drawer is closed\n */\n @event(\"bl-drawer-close\") private onClose: EventDispatcher<string>;\n\n connectedCallback() {\n super.connectedCallback();\n window?.addEventListener(\"bl-drawer-open\", event => {\n if (event.target !== this) this.closeDrawer();\n });\n this.resizeDrawerWidth();\n\n window?.addEventListener(\"resize\", () => this.resizeDrawerWidth());\n window?.addEventListener(\"load\", () => this.resizeDrawerWidth());\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n window?.removeEventListener(\"resize\", () => this.resizeDrawerWidth());\n window?.addEventListener(\"load\", () => this.resizeDrawerWidth());\n }\n\n updated(changedProperties: PropertyValues<this>) {\n if (changedProperties.has(\"open\")) {\n this.toggleDialogHandler();\n }\n\n if (changedProperties.has(\"width\")) {\n this.resizeDrawerWidth();\n }\n }\n\n private domExistenceSchedule: number;\n\n private resizeDrawerWidth() {\n const drawerWidth = styleToPixelConverter(this.width);\n\n const newWidth = !drawerWidth || drawerWidth < 100 ? \"424px\" : this.width;\n\n if (drawerWidth) {\n if (window?.innerWidth < drawerWidth) {\n this.style.setProperty(\"--bl-drawer-current-width\", \"calc(100vw - 24px)\");\n } else {\n this.style.setProperty(\"--bl-drawer-current-width\", newWidth);\n }\n }\n }\n\n private toggleDialogHandler() {\n if (this.open) {\n if (this.domExistenceSchedule) {\n clearTimeout(this.domExistenceSchedule);\n }\n\n this.domExistence = true;\n // FIXME: Allow events without payload\n this.onOpen(\"\");\n } else {\n // Give some time for exit animation\n this.domExistenceSchedule = window.setTimeout(() => {\n this.domExistence = false;\n }, 1000);\n\n // FIXME: Allow events without payload\n this.onClose(\"\");\n }\n }\n\n @state() private domExistence = false;\n\n private closeDrawer() {\n this.open = false;\n }\n\n private renderContent() {\n const content = this.embedUrl\n ? html`<iframe src=${this.embedUrl}></iframe>`\n : html`<slot></slot>`;\n\n return html`<section class=${this.embedUrl ? \"iframe-content\" : \"content\"}>\n ${content}\n </section>`;\n }\n\n private renderContainer() {\n const title = this.caption ? html`<h2 id=\"drawer-caption\">${this.caption}</h2>` : \"\";\n const external_button = this.externalLink\n ? html`<bl-button\n icon=\"external_link\"\n variant=\"tertiary\"\n kind=\"neutral\"\n size=\"small\"\n href=\"${this.externalLink}\"\n target=\"_blank\"\n ></bl-button>`\n : \"\";\n\n return html`<div class=\"container\">\n <header>\n ${title}\n <div class=\"header-buttons\">\n ${external_button}\n <bl-button\n @click=\"${this.closeDrawer}\"\n icon=\"close\"\n size=\"small\"\n variant=\"tertiary\"\n kind=\"neutral\"\n ></bl-button>\n </div>\n </header>\n ${this.renderContent()}\n </div>`;\n }\n\n render(): TemplateResult {\n if (this.domExistence) {\n return html`<div class=\"drawer\">${this.renderContainer()}</div>`;\n } else {\n return html``;\n }\n }\n}\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bl-drawer\": BlDrawer;\n }\n}\n"],
|
|
5
|
+
"mappings": "4LAAO,IAAMA,EAAyBC,GAAsC,CAC1E,IAAMC,EAAQD,EAAW,MAAM,qBAAqB,EAEpD,GAAI,CAACC,EAAO,OAAO,KAEnB,IAAMC,EAAQ,WAAWD,EAAM,CAAC,CAAC,EAC3BE,EAAOF,EAAM,CAAC,EAEhBG,EAEJ,OAAQD,EAAM,CACZ,IAAK,KACHC,EAAeF,EACf,MACF,IAAK,KACHE,EAAgBF,EAAQ,OAAO,WAAc,IAC7C,MACF,IAAK,IACHE,EAAgBF,EAAQ,OAAO,WAAc,IAC7C,MACF,QACEE,EAAe,KACf,KACJ,CACA,OAAOA,CACT,ECxBO,IAAMC,EAASC,mjCACfC,EAAQF,ECcf,IAAqBG,EAArB,cAAsCC,CAAW,CAAjD,kCASE,UAAO,GAwBP,WAAgB,QA2EP,KAAQ,aAAe,GA3GhC,WAAW,QAAyB,CAClC,MAAO,CAACC,CAAK,CACf,CA0CA,mBAAoB,CAClB,MAAM,kBAAkB,EACxB,qBAAQ,iBAAiB,iBAAkBC,GAAS,CAC9CA,EAAM,SAAW,MAAM,KAAK,YAAY,CAC9C,GACA,KAAK,kB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EU,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAQnB,KAAK,cAAc;AAAA,WAEzB,CAEA,QAAyB,CACvB,OAAI,KAAK,aACAF,wBAA2B,KAAK,gBAAgB,UAEhDA,GAEX,CACF,EAzJEG,EAAA,CADCC,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GARvBb,EASnB,oBAMAY,EAAA,CADCC,EAAS,CAAE,KAAM,MAAO,CAAC,GAdPb,EAenB,uBAMAY,EAAA,CADCC,EAAS,CAAE,KAAM,OAAQ,UAAW,WAAY,CAAC,GApB/Bb,EAqBnB,wBAMAY,EAAA,CADCC,EAAS,CAAE,KAAM,OAAQ,UAAW,eAAgB,CAAC,GA1BnCb,EA2BnB,4BAMAY,EAAA,CADCC,EAAS,CAAE,KAAM,OAAQ,UAAW,OAAQ,CAAC,GAhC3Bb,EAiCnB,qBAKiCY,EAAA,CAAhCT,EAAM,gBAAgB,GAtCJH,EAsCc,sBAKCY,EAAA,CAAjCT,EAAM,iBAAiB,GA3CLH,EA2Ce,uBAiEjBY,EAAA,CAAhBE,EAAM,GA5GYd,EA4GF,4BA5GEA,EAArBY,EAAA,CADCC,EAAc,WAAW,GACLb",
|
|
6
|
+
"names": ["styleToPixelConverter", "styleValue", "match", "value", "unit", "styleInPixel", "styles", "i", "bl_drawer_default", "BlDrawer", "s", "bl_drawer_default", "event", "changedProperties", "drawerWidth", "styleToPixelConverter", "newWidth", "content", "x", "title", "external_button", "__decorateClass", "e", "t"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
var d="lit-localize-status";var E=class{constructor(t){this.__litLocalizeEventHandler=r=>{r.detail.status==="ready"&&this.host.requestUpdate()},this.host=t}hostConnected(){window.addEventListener(d,this.__litLocalizeEventHandler)}hostDisconnected(){window.removeEventListener(d,this.__litLocalizeEventHandler)}},V=e=>e.addController(new E(e)),I=V;var G=()=>(e,t)=>(e.addInitializer(I),e);var M=e=>typeof e!="string"&&"strTag"in e,p=(e,t,r)=>{let o=e[0];for(let n=1;n<e.length;n++)o+=t[r?r[n-1]:n-1],o+=e[n];return o};var u=e=>M(e)?p(e.strings,e.values):e;var R=u,w=!1;function L(e){if(w)throw new Error("lit-localize can only be configured once");R=e,w=!0}var f=class{constructor(){this.settled=!1,this.promise=new Promise((t,r)=>{this._resolve=t,this._reject=r})}resolve(t){this.settled=!0,this._resolve(t)}reject(t){this.settled=!0,this._reject(t)}};var a=[];for(let e=0;e<256;e++)a[e]=(e>>4&15).toString(16)+(e&15).toString(16);function A(e){let t=0,r=8997,o=0,n=33826,s=0,i=40164,c=0,m=52210;for(let _=0;_<e.length;_++)r^=e.charCodeAt(_),t=r*435,o=n*435,s=i*435,c=m*435,s+=r<<8,c+=n<<8,o+=t>>>16,r=t&65535,s+=o>>>16,n=o&65535,m=c+(s>>>16)&65535,i=s&65535;return a[m>>8]+a[m&255]+a[i>>8]+a[i&255]+a[n>>8]+a[n&255]+a[r>>8]+a[r&255]}var N="",U="h",W="s";function C(e,t){return(t?U:W)+A(typeof e=="string"?e:e.join(N))}var y=new WeakMap,j=new Map;function z(e,t,r){var o;if(e){let n=(o=r==null?void 0:r.id)!=null?o:q(t),s=e[n];if(s){if(typeof s=="string")return s;if("strTag"in s)return p(s.strings,t.values,s.values);{let i=y.get(s);return i===void 0&&(i=s.values,y.set(s,i)),{...s,values:i.map(c=>t.values[c])}}}}return u(t)}function q(e){let t=typeof e=="string"?e:e.strings,r=j.get(t);return r===void 0&&(r=C(t,typeof e!="string"&&!("strTag"in e)),j.set(t,r)),r}function T(e){window.dispatchEvent(new CustomEvent(d,{detail:e}))}var x="",g,H,v,S,P,l=new f;l.resolve();var h=0,Le=e=>(L((t,r)=>z(P,t,r)),x=H=e.sourceLocale,v=new Set(e.targetLocales),v.add(e.sourceLocale),S=e.loadLocale,{getLocale:O,setLocale:b}),O=()=>x,b=e=>{if(e===(g!=null?g:x))return l.promise;if(!v||!S)throw new Error("Internal error");if(!v.has(e))throw new Error("Invalid locale code");h++;let t=h;return g=e,l.settled&&(l=new f),T({status:"loading",loadingLocale:e}),(e===H?Promise.resolve({templates:void 0}):S(e)).then(o=>{h===t&&(x=e,g=void 0,P=o.templates,T({status:"ready",readyLocale:e}),l.resolve())},o=>{h===t&&(T({status:"error",errorLocale:e,errorMessage:o.toString()}),l.reject(o))}),l.promise};export{G as a,Le as b,R as c};
|
|
2
|
+
/*! Bundled license information:
|
|
3
|
+
|
|
4
|
+
@lit/localize/internal/locale-status-event.js:
|
|
5
|
+
(**
|
|
6
|
+
* @license
|
|
7
|
+
* Copyright 2021 Google LLC
|
|
8
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
+
*)
|
|
10
|
+
|
|
11
|
+
@lit/localize/internal/localized-controller.js:
|
|
12
|
+
(**
|
|
13
|
+
* @license
|
|
14
|
+
* Copyright 2021 Google LLC
|
|
15
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
16
|
+
*)
|
|
17
|
+
|
|
18
|
+
@lit/localize/internal/localized-decorator.js:
|
|
19
|
+
(**
|
|
20
|
+
* @license
|
|
21
|
+
* Copyright 2021 Google LLC
|
|
22
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
23
|
+
*)
|
|
24
|
+
|
|
25
|
+
@lit/localize/internal/str-tag.js:
|
|
26
|
+
(**
|
|
27
|
+
* @license
|
|
28
|
+
* Copyright 2021 Google LLC
|
|
29
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
30
|
+
*)
|
|
31
|
+
|
|
32
|
+
@lit/localize/internal/default-msg.js:
|
|
33
|
+
(**
|
|
34
|
+
* @license
|
|
35
|
+
* Copyright 2021 Google LLC
|
|
36
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
37
|
+
*)
|
|
38
|
+
|
|
39
|
+
@lit/localize/internal/types.js:
|
|
40
|
+
(**
|
|
41
|
+
* @license
|
|
42
|
+
* Copyright 2021 Google LLC
|
|
43
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
44
|
+
*)
|
|
45
|
+
|
|
46
|
+
@lit/localize/init/transform.js:
|
|
47
|
+
(**
|
|
48
|
+
* @license
|
|
49
|
+
* Copyright 2021 Google LLC
|
|
50
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
51
|
+
*)
|
|
52
|
+
|
|
53
|
+
@lit/localize/lit-localize.js:
|
|
54
|
+
(**
|
|
55
|
+
* @license
|
|
56
|
+
* Copyright 2020 Google LLC
|
|
57
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
58
|
+
*)
|
|
59
|
+
|
|
60
|
+
@lit/localize/internal/deferred.js:
|
|
61
|
+
(**
|
|
62
|
+
* @license
|
|
63
|
+
* Copyright 2020 Google LLC
|
|
64
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
65
|
+
*)
|
|
66
|
+
|
|
67
|
+
@lit/localize/internal/fnv1a64.js:
|
|
68
|
+
(**
|
|
69
|
+
* @license
|
|
70
|
+
* Copyright 2014 Travis Webb
|
|
71
|
+
* SPDX-License-Identifier: MIT
|
|
72
|
+
*)
|
|
73
|
+
|
|
74
|
+
@lit/localize/internal/id-generation.js:
|
|
75
|
+
(**
|
|
76
|
+
* @license
|
|
77
|
+
* Copyright 2020 Google LLC
|
|
78
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
79
|
+
*)
|
|
80
|
+
|
|
81
|
+
@lit/localize/internal/runtime-msg.js:
|
|
82
|
+
(**
|
|
83
|
+
* @license
|
|
84
|
+
* Copyright 2021 Google LLC
|
|
85
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
86
|
+
*)
|
|
87
|
+
|
|
88
|
+
@lit/localize/init/runtime.js:
|
|
89
|
+
(**
|
|
90
|
+
* @license
|
|
91
|
+
* Copyright 2021 Google LLC
|
|
92
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
93
|
+
*)
|
|
94
|
+
*/
|
|
95
|
+
//# sourceMappingURL=chunk-HBPBDC7T.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../node_modules/@lit/localize/src/internal/locale-status-event.ts", "../node_modules/@lit/localize/src/internal/localized-controller.ts", "../node_modules/@lit/localize/src/internal/localized-decorator.ts", "../node_modules/@lit/localize/src/internal/str-tag.ts", "../node_modules/@lit/localize/src/internal/default-msg.ts", "../node_modules/@lit/localize/src/lit-localize.ts", "../node_modules/@lit/localize/src/internal/deferred.ts", "../node_modules/@lit/localize/src/internal/fnv1a64.ts", "../node_modules/@lit/localize/src/internal/id-generation.ts", "../node_modules/@lit/localize/src/internal/runtime-msg.ts", "../node_modules/@lit/localize/src/init/runtime.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * Name of the event dispatched to `window` whenever a locale change starts,\n * finishes successfully, or fails. Only relevant to runtime mode.\n *\n * The `detail` of this event is an object with a `status` string that can be:\n * \"loading\", \"ready\", or \"error\", along with the relevant locale code, and\n * error message if applicable.\n *\n * You can listen for this event to know when your application should be\n * re-rendered following a locale change. See also the Localized mixin, which\n * automatically re-renders LitElement classes using this event.\n */\nexport const LOCALE_STATUS_EVENT = 'lit-localize-status';\n\n// Misfiring eslint rule\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\ndeclare global {\n interface WindowEventMap {\n [LOCALE_STATUS_EVENT]: CustomEvent<LocaleStatusEventDetail>;\n }\n}\n\n/**\n * The possible details of the \"lit-localize-status\" event.\n */\nexport type LocaleStatusEventDetail = LocaleLoading | LocaleReady | LocaleError;\n\n/**\n * Detail of the \"lit-localize-status\" event when a new locale has started to\n * load.\n *\n * A \"loading\" status can be followed by [1] another \"loading\" status (in the\n * case that a second locale is requested before the first one completed), [2] a\n * \"ready\" status, or [3] an \"error\" status.\n */\nexport interface LocaleLoading {\n status: 'loading';\n /** Code of the locale that has started loading. */\n loadingLocale: string;\n}\n\n/**\n * Detail of the \"lit-localize-status\" event when a new locale has successfully\n * loaded and is ready for rendering.\n *\n * A \"ready\" status can be followed only by a \"loading\" status.\n */\nexport interface LocaleReady {\n status: 'ready';\n /** Code of the locale that has successfully loaded. */\n readyLocale: string;\n}\n\n/**\n * Detail of the \"lit-localize-status\" event when a new locale failed to load.\n *\n * An \"error\" status can be followed only by a \"loading\" status.\n */\nexport interface LocaleError {\n status: 'error';\n /** Code of the locale that failed to load. */\n errorLocale: string;\n /** Error message from locale load failure. */\n errorMessage: string;\n}\n", "/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {LOCALE_STATUS_EVENT} from './locale-status-event.js';\n\nimport type {ReactiveController, ReactiveControllerHost} from 'lit';\n\nclass LocalizeController implements ReactiveController {\n host: ReactiveControllerHost;\n\n constructor(host: ReactiveControllerHost) {\n this.host = host;\n }\n\n private readonly __litLocalizeEventHandler = (\n event: WindowEventMap[typeof LOCALE_STATUS_EVENT]\n ) => {\n if (event.detail.status === 'ready') {\n this.host.requestUpdate();\n }\n };\n\n hostConnected() {\n window.addEventListener(\n LOCALE_STATUS_EVENT,\n this.__litLocalizeEventHandler\n );\n }\n\n hostDisconnected() {\n window.removeEventListener(\n LOCALE_STATUS_EVENT,\n this.__litLocalizeEventHandler\n );\n }\n}\n\n/**\n * Re-render the given LitElement whenever a new active locale has loaded.\n *\n * See also {@link localized} for the same functionality as a decorator.\n *\n * When using lit-localize in transform mode, calls to this function are\n * replaced with undefined.\n *\n * Usage:\n *\n * import {LitElement, html} from 'lit';\n * import {msg, updateWhenLocaleChanges} from '@lit/localize';\n *\n * class MyElement extends LitElement {\n * constructor() {\n * super();\n * updateWhenLocaleChanges(this);\n * }\n *\n * render() {\n * return html`<b>${msg('Hello World')}</b>`;\n * }\n * }\n */\nconst _updateWhenLocaleChanges = (host: ReactiveControllerHost) =>\n host.addController(new LocalizeController(host));\n\nexport const updateWhenLocaleChanges: typeof _updateWhenLocaleChanges & {\n _LIT_LOCALIZE_CONTROLLER_FN_?: never;\n} = _updateWhenLocaleChanges;\n", "/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {updateWhenLocaleChanges} from './localized-controller.js';\n\nimport type {ReactiveControllerHost} from 'lit';\n\n/**\n * Generates a public interface type that removes private and protected fields.\n * This allows accepting otherwise incompatible versions of the type (e.g. from\n * multiple copies of the same package in `node_modules`).\n */\nexport type Interface<T> = {\n [K in keyof T]: T[K];\n};\n\ntype ReactiveElementClass = {\n addInitializer(initializer: (element: ReactiveControllerHost) => void): void;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n new (...args: any[]): ReactiveControllerHost;\n};\n\nexport type LocalizedDecorator = {\n // legacy\n (cls: ReactiveElementClass): void;\n\n // standard\n (\n target: ReactiveElementClass,\n context: ClassDecoratorContext<ReactiveElementClass>\n ): void;\n};\n\n/**\n * Class decorator to enable re-rendering the given LitElement whenever a new\n * active locale has loaded.\n *\n * See also {@link updateWhenLocaleChanges} for the same functionality without\n * the use of decorators.\n *\n * When using lit-localize in transform mode, applications of this decorator are\n * removed.\n *\n * Usage:\n *\n * import {LitElement, html} from 'lit';\n * import {customElement} from 'lit/decorators.js';\n * import {msg, localized} from '@lit/localize';\n *\n * @localized()\n * @customElement('my-element')\n * class MyElement extends LitElement {\n * render() {\n * return html`<b>${msg('Hello World')}</b>`;\n * }\n * }\n */\nexport const localized: Localized =\n (): LocalizedDecorator =>\n (\n clazz: ReactiveElementClass,\n _context?: ClassDecoratorContext<ReactiveElementClass>\n ) => {\n clazz.addInitializer(updateWhenLocaleChanges);\n return clazz;\n };\n\ntype Localized = (() => LocalizedDecorator) & {\n // Used by the localize-tools transform to detect this decorator based\n // on type.\n _LIT_LOCALIZE_DECORATOR_?: never;\n};\n", "/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport type {TemplateLike} from './types.js';\n\nexport interface StrResult {\n strTag: true;\n strings: TemplateStringsArray;\n values: unknown[];\n}\n\n/**\n * Tag that allows expressions to be used in localized non-HTML template\n * strings.\n *\n * Example: msg(str`Hello ${this.user}!`);\n *\n * The Lit html tag can also be used for this purpose, but HTML will need to be\n * escaped, and there is a small overhead for HTML parsing.\n *\n * Untagged template strings with expressions aren't supported by lit-localize\n * because they don't allow for values to be captured at runtime.\n */\nconst _str = (\n strings: TemplateStringsArray,\n ...values: unknown[]\n): StrResult => ({\n strTag: true,\n strings,\n values,\n});\n\nexport const str: typeof _str & {_LIT_LOCALIZE_STR_?: never} = _str;\n\nexport const isStrTagged = (val: TemplateLike): val is StrResult =>\n typeof val !== 'string' && 'strTag' in val;\n\n/**\n * Render the result of a `str` tagged template to a string. Note we don't need\n * to do this for Lit templates, since Lit itself handles rendering.\n */\nexport const joinStringsAndValues = (\n strings: TemplateStringsArray,\n values: Readonly<unknown[]>,\n valueOrder?: number[]\n) => {\n let concat = strings[0];\n for (let i = 1; i < strings.length; i++) {\n concat += values[valueOrder ? valueOrder[i - 1] : i - 1];\n concat += strings[i];\n }\n return concat;\n};\n", "/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {isStrTagged, joinStringsAndValues} from './str-tag.js';\n\nimport type {MsgFn, TemplateLike} from './types.js';\n\n/**\n * Default identity msg implementation. Simply returns the input template with\n * no awareness of translations. If the template is str-tagged, returns it in\n * string form.\n */\nexport const defaultMsg = ((template: TemplateLike) =>\n isStrTagged(template)\n ? joinStringsAndValues(template.strings, template.values)\n : template) as MsgFn;\n", "/**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {defaultMsg} from './internal/default-msg.js';\n\nimport type {MsgFn} from './internal/types.js';\n\nexport * from './internal/locale-status-event.js';\nexport * from './internal/str-tag.js';\nexport * from './internal/types.js';\n\n// TODO(aomarks) In a future breaking version, remove these imports so that the\n// bulk of the code isn't included in bundles by default. In particular imagine\n// the component library use-case where msg() calls are made, but there is no\n// need to actually initialize any of the localization runtime.\nexport * from './internal/localized-controller.js';\nexport * from './internal/localized-decorator.js';\nexport * from './init/runtime.js';\nexport * from './init/transform.js';\n\n/**\n * Make a string or lit-html template localizable.\n *\n * @param template A string, a lit-html template, or a function that returns\n * either a string or lit-html template.\n * @param options Optional configuration object with the following properties:\n * - id: Optional project-wide unique identifier for this template. If\n * omitted, an id will be automatically generated from the template strings.\n * - desc: Optional description\n */\nexport let msg: MsgFn = defaultMsg;\n\nlet installed = false;\n\n/**\n * Internal only. Do not use this function.\n *\n * Installs an implementation of the msg function to replace the default\n * identity function. Throws if called more than once.\n *\n * @internal\n */\nexport function _installMsgImplementation(impl: MsgFn) {\n if (installed) {\n throw new Error('lit-localize can only be configured once');\n }\n msg = impl;\n installed = true;\n}\n", "/**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nexport class Deferred<T> {\n readonly promise: Promise<T>;\n private _resolve!: (value: T) => void;\n private _reject!: (error: Error) => void;\n settled = false;\n\n constructor() {\n this.promise = new Promise<T>((resolve, reject) => {\n this._resolve = resolve;\n this._reject = reject;\n });\n }\n\n resolve(value: T) {\n this.settled = true;\n this._resolve(value);\n }\n\n reject(error: Error) {\n this.settled = true;\n this._reject(error);\n }\n}\n", "/**\n * @license\n * Copyright 2014 Travis Webb\n * SPDX-License-Identifier: MIT\n */\n\n// This module is derived from the file:\n// https://github.com/tjwebb/fnv-plus/blob/1e2ce68a07cb7dd4c3c85364f3d8d96c95919474/index.js#L309\n//\n// Changes:\n// - Only the _hash64_1a_fast function is included.\n// - Removed loop unrolling.\n// - Converted to TypeScript ES module.\n// - var -> let/const\n//\n// TODO(aomarks) Upstream improvements to https://github.com/tjwebb/fnv-plus/.\n\nconst hl: string[] = [];\nfor (let i = 0; i < 256; i++) {\n hl[i] = ((i >> 4) & 15).toString(16) + (i & 15).toString(16);\n}\n\n/**\n * Perform a FNV-1A 64-bit hash of the given string (as UTF-16 code units), and\n * return a hexadecimal digest (left zero padded to 16 characters).\n *\n * @see {@link http://tools.ietf.org/html/draft-eastlake-fnv-06}\n */\nexport function fnv1a64(str: string) {\n let t0 = 0,\n v0 = 0x2325,\n t1 = 0,\n v1 = 0x8422,\n t2 = 0,\n v2 = 0x9ce4,\n t3 = 0,\n v3 = 0xcbf2;\n\n for (let i = 0; i < str.length; i++) {\n v0 ^= str.charCodeAt(i);\n t0 = v0 * 435;\n t1 = v1 * 435;\n t2 = v2 * 435;\n t3 = v3 * 435;\n t2 += v0 << 8;\n t3 += v1 << 8;\n t1 += t0 >>> 16;\n v0 = t0 & 65535;\n t2 += t1 >>> 16;\n v1 = t1 & 65535;\n v3 = (t3 + (t2 >>> 16)) & 65535;\n v2 = t2 & 65535;\n }\n\n return (\n hl[v3 >> 8] +\n hl[v3 & 255] +\n hl[v2 >> 8] +\n hl[v2 & 255] +\n hl[v1 >> 8] +\n hl[v1 & 255] +\n hl[v0 >> 8] +\n hl[v0 & 255]\n );\n}\n", "/**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {fnv1a64} from './fnv1a64.js';\n\n/**\n * Delimiter used between each template string component before hashing. Used to\n * prevent e.g. \"foobar\" and \"foo${baz}bar\" from sharing a hash.\n *\n * This is the \"record separator\" ASCII character.\n */\nexport const HASH_DELIMITER = '\\x1e';\n\n/**\n * Id prefix on html-tagged templates to distinguish e.g. `<b>x</b>` from\n * html`<b>x</b>`.\n */\nconst HTML_PREFIX = 'h';\n\n/**\n * Id prefix on plain string templates to distinguish e.g. `<b>x</b>` from\n * html`<b>x</b>`.\n */\nconst STRING_PREFIX = 's';\n\n/**\n * Generate a unique ID for a lit-localize message.\n *\n * Example:\n * Template: html`Hello <b>${who}</b>!`\n * Params: [\"Hello <b>\", \"</b>!\"], true\n * Output: h82ccc38d4d46eaa9\n *\n * The ID is constructed as:\n *\n * [0] Kind of template: [h]tml or [s]tring.\n * [1,16] 64-bit FNV-1a hash hex digest of the template strings, as UTF-16\n * code points, delineated by an ASCII \"record separator\" character.\n *\n * We choose FNV-1a because:\n *\n * 1. It's pretty fast (e.g. much faster than SHA-1).\n * 2. It's pretty small (0.25 KiB minified + brotli).\n * 3. We don't require cryptographic security, and 64 bits should give\n * sufficient collision resistance for any one application. Worst\n * case, we will always detect collisions during analysis.\n * 4. We can't use Web Crypto API (e.g. SHA-1), because it's asynchronous.\n * 5. It's a well known non-cryptographic hash with implementations in many\n * languages.\n * 6. There was an existing JavaScript implementation that doesn't require\n * BigInt, for IE11 compatibility.\n */\nexport function generateMsgId(\n strings: string | string[] | TemplateStringsArray,\n isHtmlTagged: boolean\n): string {\n return (\n (isHtmlTagged ? HTML_PREFIX : STRING_PREFIX) +\n fnv1a64(\n typeof strings === 'string' ? strings : strings.join(HASH_DELIMITER)\n )\n );\n}\n", "/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {defaultMsg} from './default-msg.js';\nimport {joinStringsAndValues} from './str-tag.js';\nimport {generateMsgId} from './id-generation.js';\n\nimport type {TemplateLike, MsgOptions, TemplateMap} from './types.js';\nimport type {TemplateResult} from 'lit';\n\nconst expressionOrders = new WeakMap<TemplateResult, number[]>();\nconst hashCache = new Map<TemplateStringsArray | string, string>();\n\nexport function runtimeMsg(\n templates: TemplateMap | undefined,\n template: TemplateLike,\n options: MsgOptions | undefined\n): string | TemplateResult {\n if (templates) {\n const id = options?.id ?? generateId(template);\n const localized = templates[id];\n if (localized) {\n if (typeof localized === 'string') {\n // E.g. \"Hello World!\"\n return localized;\n } else if ('strTag' in localized) {\n // E.g. str`Hello ${name}!`\n //\n // Localized templates have ${number} in place of real template\n // expressions. They can't have real template values, because the\n // variable scope would be wrong. The number tells us the index of the\n // source value to substitute in its place, because expressions can be\n // moved to a different position during translation.\n return joinStringsAndValues(\n localized.strings,\n // Cast `template` because its type wasn't automatically narrowed (but\n // we know it must be the same type as `localized`).\n (template as TemplateResult).values,\n localized.values as number[]\n );\n } else {\n // E.g. html`Hello <b>${name}</b>!`\n //\n // We have to keep our own mapping of expression ordering because we do\n // an in-place update of `values`, and otherwise we'd lose ordering for\n // subsequent renders.\n let order = expressionOrders.get(localized);\n if (order === undefined) {\n order = localized.values as number[];\n expressionOrders.set(localized, order);\n }\n return {\n ...localized,\n values: order.map((i) => (template as TemplateResult).values[i]),\n };\n }\n }\n }\n return defaultMsg(template);\n}\n\nfunction generateId(template: TemplateLike): string {\n const strings = typeof template === 'string' ? template : template.strings;\n let id = hashCache.get(strings);\n if (id === undefined) {\n id = generateMsgId(\n strings,\n typeof template !== 'string' && !('strTag' in template)\n );\n hashCache.set(strings, id);\n }\n return id;\n}\n", "/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {_installMsgImplementation} from '../lit-localize.js';\nimport {Deferred} from '../internal/deferred.js';\nimport {LOCALE_STATUS_EVENT} from '../internal/locale-status-event.js';\nimport {runtimeMsg} from '../internal/runtime-msg.js';\n\nimport type {LocaleStatusEventDetail} from '../internal/locale-status-event.js';\nimport type {\n LocaleModule,\n TemplateLike,\n TemplateMap,\n MsgFn,\n MsgOptions,\n} from '../internal/types.js';\n\n/**\n * Configuration parameters for lit-localize when in runtime mode.\n */\nexport interface RuntimeConfiguration {\n /**\n * Required locale code in which source templates in this project are written,\n * and the initial active locale.\n */\n sourceLocale: string;\n\n /**\n * Required locale codes that are supported by this project. Should not\n * include the `sourceLocale` code.\n */\n targetLocales: Iterable<string>;\n\n /**\n * Required function that returns the localized templates for the given locale\n * code.\n *\n * This function will only ever be called with a `locale` that is contained by\n * `targetLocales`.\n */\n loadLocale: (locale: string) => Promise<LocaleModule>;\n}\n\n/**\n * Dispatch a \"lit-localize-status\" event to `window` with the given detail.\n */\nfunction dispatchStatusEvent(detail: LocaleStatusEventDetail) {\n window.dispatchEvent(new CustomEvent(LOCALE_STATUS_EVENT, {detail}));\n}\n\nlet activeLocale = '';\nlet loadingLocale: string | undefined;\nlet sourceLocale: string | undefined;\nlet validLocales: Set<string> | undefined;\nlet loadLocale: ((locale: string) => Promise<LocaleModule>) | undefined;\nlet templates: TemplateMap | undefined;\nlet loading = new Deferred<void>();\n// The loading promise must be initially resolved, because that's what we should\n// return if the user immediately calls setLocale(sourceLocale).\nloading.resolve();\nlet requestId = 0;\n\n/**\n * Set configuration parameters for lit-localize when in runtime mode. Returns\n * an object with functions:\n *\n * - `getLocale`: Return the active locale code.\n * - `setLocale`: Set the active locale code.\n *\n * Throws if called more than once.\n */\nexport const configureLocalization: ((config: RuntimeConfiguration) => {\n getLocale: typeof getLocale;\n setLocale: typeof setLocale;\n}) & {\n _LIT_LOCALIZE_CONFIGURE_LOCALIZATION_?: never;\n} = (config: RuntimeConfiguration) => {\n _installMsgImplementation(((template: TemplateLike, options?: MsgOptions) =>\n runtimeMsg(templates, template, options)) as MsgFn);\n activeLocale = sourceLocale = config.sourceLocale;\n validLocales = new Set(config.targetLocales);\n validLocales.add(config.sourceLocale);\n loadLocale = config.loadLocale;\n return {getLocale, setLocale};\n};\n\n/**\n * Return the active locale code.\n */\nconst getLocale: (() => string) & {\n _LIT_LOCALIZE_GET_LOCALE_?: never;\n} = () => {\n return activeLocale;\n};\n\n/**\n * Set the active locale code, and begin loading templates for that locale using\n * the `loadLocale` function that was passed to `configureLocalization`. Returns\n * a promise that resolves when the next locale is ready to be rendered.\n *\n * Note that if a second call to `setLocale` is made while the first requested\n * locale is still loading, then the second call takes precedence, and the\n * promise returned from the first call will resolve when second locale is\n * ready. If you need to know whether a particular locale was loaded, check\n * `getLocale` after the promise resolves.\n *\n * Throws if the given locale is not contained by the configured `sourceLocale`\n * or `targetLocales`.\n */\nconst setLocale: ((newLocale: string) => Promise<void>) & {\n _LIT_LOCALIZE_SET_LOCALE_?: never;\n} = (newLocale: string) => {\n if (newLocale === (loadingLocale ?? activeLocale)) {\n return loading.promise;\n }\n if (!validLocales || !loadLocale) {\n throw new Error('Internal error');\n }\n if (!validLocales.has(newLocale)) {\n throw new Error('Invalid locale code');\n }\n requestId++;\n const thisRequestId = requestId;\n loadingLocale = newLocale;\n if (loading.settled) {\n loading = new Deferred();\n }\n dispatchStatusEvent({status: 'loading', loadingLocale: newLocale});\n const localePromise: Promise<Partial<LocaleModule>> =\n newLocale === sourceLocale\n ? // We could switch to the source locale synchronously, but we prefer to\n // queue it on a microtask so that switching locales is consistently\n // asynchronous.\n Promise.resolve({templates: undefined})\n : loadLocale(newLocale);\n localePromise.then(\n (mod) => {\n if (requestId === thisRequestId) {\n activeLocale = newLocale;\n loadingLocale = undefined;\n templates = mod.templates;\n dispatchStatusEvent({status: 'ready', readyLocale: newLocale});\n loading.resolve();\n }\n // Else another locale was requested in the meantime. Don't resolve or\n // reject, because the newer load call is going to use the same promise.\n // Note the user can call getLocale() after the promise resolves if they\n // need to check if the locale is still the one they expected to load.\n },\n (err) => {\n if (requestId === thisRequestId) {\n dispatchStatusEvent({\n status: 'error',\n errorLocale: newLocale,\n errorMessage: err.toString(),\n });\n loading.reject(err);\n }\n }\n );\n return loading.promise;\n};\n"],
|
|
5
|
+
"mappings": "AAkBO,IAAMA,EAAsB,sBCRnC,IAAMC,EAAN,KAAwB,CAGtB,YAAYC,EAA4B,CAIvB,KAAA,0BACfC,GACE,CACEA,EAAM,OAAO,SAAW,SAC1B,KAAK,KAAK,cAAa,CAE3B,EATE,KAAK,KAAOD,CACd,CAUA,eAAa,CACX,OAAO,iBACLE,EACA,KAAK,yBAAyB,CAElC,CAEA,kBAAgB,CACd,OAAO,oBACLA,EACA,KAAK,yBAAyB,CAElC,GA2BIC,EAA4BH,GAChCA,EAAK,cAAc,IAAID,EAAmBC,CAAI,CAAC,EAEpCI,EAETD,ECTG,IAAME,EACX,IACA,CACEC,EACAC,KAEAD,EAAM,eAAeE,CAAuB,EACrCF,GC9BJ,IAAMG,EAAeC,GAC1B,OAAOA,GAAQ,UAAY,WAAYA,EAM5BC,EAAuB,CAClCC,E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AO,CACFZ,IAAcU,IAChBrB,EAAoB,CAClB,OAAQ,QACR,YAAaoB,EACb,aAAcG,EAAI,SAAQ,EAC3B,EACDd,EAAQ,OAAOc,CAAG,EAEtB,CAAC,EAEId,EAAQ,OACjB",
|
|
6
|
+
"names": ["LOCALE_STATUS_EVENT", "LocalizeController", "host", "event", "LOCALE_STATUS_EVENT", "_updateWhenLocaleChanges", "updateWhenLocaleChanges", "localized", "clazz", "_context", "updateWhenLocaleChanges", "isStrTagged", "val", "joinStringsAndValues", "strings", "values", "valueOrder", "concat", "i", "defaultMsg", "template", "isStrTagged", "joinStringsAndValues", "msg", "defaultMsg", "installed", "_installMsgImplementation", "impl", "Deferred", "resolve", "reject", "value", "error", "hl", "i", "fnv1a64", "str", "t0", "v0", "t1", "v1", "t2", "v2", "t3", "v3", "HASH_DELIMITER", "HTML_PREFIX", "STRING_PREFIX", "generateMsgId", "strings", "isHtmlTagged", "fnv1a64", "expressionOrders", "hashCache", "runtimeMsg", "templates", "template", "options", "_a", "id", "generateId", "localized", "joinStringsAndValues", "order", "i", "defaultMsg", "strings", "generateMsgId", "dispatchStatusEvent", "detail", "LOCALE_STATUS_EVENT", "activeLocale", "loadingLocale", "sourceLocale", "validLocales", "loadLocale", "templates", "loading", "Deferred", "requestId", "configureLocalization", "config", "_installMsgImplementation", "template", "options", "runtimeMsg", "getLocale", "setLocale", "newLocale", "thisRequestId", "mod", "err"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as b}from"./chunk-K3IALLEI.js";import{a as d}from"./chunk-6DJUQN3S.js";import{a as i,b as a}from"./chunk-X2KXJYXQ.js";import{a as s,b as r,f as o}from"./chunk-4OT5AMS5.js";import{d as l}from"./chunk-IZ2LK5GK.js";var n=s`:host{display:table-row}:host([checked]),:host([checked]) ::slotted(bl-table-cell){background-color:var(--bl-color-primary-contrast)}:host([disabled]),:host([disabled]) ::slotted(bl-table-cell){background-color:var(--bl-color-neutral-lightest);color:var(--bl-color-neutral-light)}:host(:not([checked], [disabled]).__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__),:host(:not([checked], [disabled]):hover) ::slotted(bl-table-cell),:host(:not([checked], [disabled]):hover),:host(:not([checked], [disabled]):hover) ::slotted(bl-table-cell){background-color:var(--bl-color-tertiary-background)}:host ::slotted(*:first-child){border-left:none}:host ::slotted(*:last-child){border-right:none}:host(:first-child) ::slotted(bl-table-header-cell){border-top:none;border-right:none}:host(:first-child) ::slotted(bl-table-header-cell:first-child){border-top-left-radius:var(--bl-size-3xs)}:host(:first-child) ::slotted(bl-table-header-cell:last-child){border-top-right-radius:var(--bl-size-3xs);border-right:1px}:host(:last-child) ::slotted(bl-table-cell){border-bottom:none}:host(:first-child) ::slotted(bl-table-cell){border-top:none}:host(:last-child) ::slotted(bl-table-cell:first-child){border-bottom-left-radius:var(--bl-size-3xs)}:host(:last-child) ::slotted(bl-table-cell:last-child){border-bottom-right-radius:var(--bl-size-3xs)}:host([sticky-first-column]) ::slotted(bl-table-header-cell:first-child),:host([sticky-first-column]) ::slotted(bl-table-cell:first-child){position:sticky;z-index:2;left:0}:host([sticky-last-column]) ::slotted(bl-table-header-cell:last-child),:host([sticky-last-column]) ::slotted(bl-table-cell:last-child){position:sticky;z-index:2;right:0}`,c=n;var u="bl-table-row",e=class extends o{constructor(){super(...arguments);this.selectionKey=""}static get styles(){return[c]}connectedCallback(){super.connectedCallback(),!this.closest(d)&&!this.closest(b)&&console.warn("bl-table-row is designed to be used inside a bl-table-header or bl-table-body",this)}updated(t){super.updated(t),this.removeAttribute("checked"),this.removeAttribute("disabled"),this.removeAttribute("sticky-first-column"),this.removeAttribute("sticky-last-column"),this.stickyFirstColumn&&this.setAttribute("sticky-first-column","true"),this.stickyLastColumn&&this.setAttribute("sticky-last-column","true"),this.checked?this.setAttribute("checked","true"):this.disabled&&this.setAttribute("disabled","true"),t.has("selectionKey")&&this.updateComplete.then(()=>{Array.from(this.querySelectorAll("bl-table-header-cell,bl-table-cell")).map(h=>{h.requestUpdate()})})}get _table(){return this.closest("bl-table")}get _firstTableCell(){return this.querySelector("bl-table-cell")}get disabled(){var t;return!!((t=this._firstTableCell)!=null&&t.disabled)}get checked(){var t;return!!((t=this._table)!=null&&t.isRowSelected(this.selectionKey))}get stickyFirstColumn(){var t;return!!((t=this._table)!=null&&t.isFirstColumnSticky())}get stickyLastColumn(){var t;return!!((t=this._table)!=null&&t.isLastColumnSticky())}render(){return r`<slot></slot>`}};l([a({type:String,reflect:!0,attribute:"selection-key"})],e.prototype,"selectionKey",2),e=l([i(u)],e);export{u as a,e as b};
|
|
2
|
+
//# sourceMappingURL=chunk-HMDGICS5.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/components/table/table-row/bl-table-row.css", "../src/components/table/table-row/bl-table-row.ts"],
|
|
4
|
+
"sourcesContent": ["import {css} from 'lit';\nexport const styles = css`:host{display:table-row}:host([checked]),:host([checked]) ::slotted(bl-table-cell){background-color:var(--bl-color-primary-contrast)}:host([disabled]),:host([disabled]) ::slotted(bl-table-cell){background-color:var(--bl-color-neutral-lightest);color:var(--bl-color-neutral-light)}:host(:not([checked], [disabled]).__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__),:host(:not([checked], [disabled]):hover) ::slotted(bl-table-cell),:host(:not([checked], [disabled]):hover),:host(:not([checked], [disabled]):hover) ::slotted(bl-table-cell){background-color:var(--bl-color-tertiary-background)}:host ::slotted(*:first-child){border-left:none}:host ::slotted(*:last-child){border-right:none}:host(:first-child) ::slotted(bl-table-header-cell){border-top:none;border-right:none}:host(:first-child) ::slotted(bl-table-header-cell:first-child){border-top-left-radius:var(--bl-size-3xs)}:host(:first-child) ::slotted(bl-table-header-cell:last-child){border-top-right-radius:var(--bl-size-3xs);border-right:1px}:host(:last-child) ::slotted(bl-table-cell){border-bottom:none}:host(:first-child) ::slotted(bl-table-cell){border-top:none}:host(:last-child) ::slotted(bl-table-cell:first-child){border-bottom-left-radius:var(--bl-size-3xs)}:host(:last-child) ::slotted(bl-table-cell:last-child){border-bottom-right-radius:var(--bl-size-3xs)}:host([sticky-first-column]) ::slotted(bl-table-header-cell:first-child),:host([sticky-first-column]) ::slotted(bl-table-cell:first-child){position:sticky;z-index:2;left:0}:host([sticky-last-column]) ::slotted(bl-table-header-cell:last-child),:host([sticky-last-column]) ::slotted(bl-table-cell:last-child){position:sticky;z-index:2;right:0}`;\nexport default styles;\n", "import { html, LitElement, PropertyValues, TemplateResult } from \"lit\";\nimport { customElement, property } from \"lit/decorators.js\";\nimport { CSSResultGroup } from \"lit/development\";\nimport \"element-internals-polyfill\";\nimport \"../../checkbox-group/checkbox/bl-checkbox\";\nimport { blTableBodyTag } from \"../table-body/bl-table-body\";\nimport type BlTableBody from \"../table-body/bl-table-body\";\nimport BlTableCell from \"../table-cell/bl-table-cell\";\nimport BlTableHeaderCell from \"../table-header-cell/bl-table-header-cell\";\nimport { blTableHeaderTag } from \"../table-header/bl-table-header\";\nimport type BlTableHeader from \"../table-header/bl-table-header\";\nimport style from \"../table-row/bl-table-row.css\";\n\nexport const blTableRowTag = \"bl-table-row\";\n\n/**\n * @tag bl-table-row\n * @summary Baklava Table component\n */\n@customElement(blTableRowTag)\nexport default class BlTableRow extends LitElement {\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n /**\n * selection key for table row\n */\n @property({ type: String, reflect: true, attribute: \"selection-key\" })\n selectionKey: string = \"\";\n\n connectedCallback(): void {\n super.connectedCallback();\n if (\n !this.closest<BlTableHeader>(blTableHeaderTag) &&\n !this.closest<BlTableBody>(blTableBodyTag)\n ) {\n console.warn(\n \"bl-table-row is designed to be used inside a bl-table-header or bl-table-body\",\n this\n );\n }\n }\n\n updated(_changedProperties: PropertyValues) {\n super.updated(_changedProperties);\n this.removeAttribute(\"checked\");\n this.removeAttribute(\"disabled\");\n this.removeAttribute(\"sticky-first-column\");\n this.removeAttribute(\"sticky-last-column\");\n\n if (this.stickyFirstColumn) {\n this.setAttribute(\"sticky-first-column\", \"true\");\n }\n if (this.stickyLastColumn) {\n this.setAttribute(\"sticky-last-column\", \"true\");\n }\n if (this.checked) {\n this.setAttribute(\"checked\", \"true\");\n } else if (this.disabled) {\n this.setAttribute(\"disabled\", \"true\");\n }\n if (_changedProperties.has(\"selectionKey\")) {\n this.updateComplete.then(() => {\n Array.from(this.querySelectorAll(\"bl-table-header-cell,bl-table-cell\")).map(com => {\n (com as BlTableHeaderCell | BlTableCell).requestUpdate();\n });\n });\n }\n }\n\n private get _table() {\n return this.closest(\"bl-table\");\n }\n\n private get _firstTableCell() {\n return this.querySelector(\"bl-table-cell\");\n }\n get disabled() {\n return !!this._firstTableCell?.disabled;\n }\n\n get checked() {\n return !!this._table?.isRowSelected(this.selectionKey);\n }\n\n get stickyFirstColumn() {\n return !!this._table?.isFirstColumnSticky();\n }\n\n get stickyLastColumn() {\n return !!this._table?.isLastColumnSticky();\n }\n\n render(): TemplateResult {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [blTableRowTag]: BlTableRow;\n }\n}\n"],
|
|
5
|
+
"mappings": "6NACO,IAAMA,EAASC,koDACfC,EAAQF,ECWR,IAAMG,EAAgB,eAORC,EAArB,cAAwCC,CAAW,CAAnD,kCASE,kBAAuB,GARvB,WAAW,QAAyB,CAClC,MAAO,CAACC,CAAK,CACf,CAQA,mBAA0B,CACxB,MAAM,kBAAkB,EAEtB,CAAC,KAAK,QAAuBC,CAAgB,GAC7C,CAAC,KAAK,QAAqBC,CAAc,GAEzC,QAAQ,KACN,gFACA,IACF,CAEJ,CAEA,QAAQC,EAAoC,CAC1C,MAAM,QAAQA,CAAkB,EAChC,KAAK,gBAAgB,SAAS,EAC9B,KAAK,gBAAgB,UAAU,EAC/B,KAAK,gBAAgB,qBAAqB,EAC1C,KAAK,gBAAgB,oBAAoB,EAErC,KAAK,mBACP,KAAK,aAAa,sBAAuB,MAAM,EAE7C,KAAK,kBACP,KAAK,aAAa,qBAAsB,MAAM,EAE5C,KAAK,QACP,KAAK,aAAa,UAAW,MAAM,EAC1B,KAAK,UACd,KAAK,aAAa,WAAY,MAAM,EAElCA,EAAmB,IAAI,cAAc,GACvC,KAAK,eAAe,KAAK,IAAM,CAC7B,MAAM,KAAK,KAAK,iBAAiB,oCAAoC,CAAC,EAAE,IAAIC,GAAO,CAChFA,EAAwC,cAAc,CACzD,CAAC,CACH,CAAC,CAEL,CAEA,IAAY,QAAS,CACnB,OAAO,KAAK,QAAQ,UAAU,CAChC,CAEA,IAAY,iBAAkB,CAC5B,OAAO,KAAK,cAAc,eAAe,CAC3C,CACA,IAAI,UAAW,CA9EjB,IAAAC,EA+EI,MAAO,CAAC,GAACA,EAAA,KAAK,kBAAL,MAAAA,EAAsB,SACjC,CAEA,IAAI,SAAU,CAlFhB,IAAAA,EAmFI,MAAO,CAAC,GAACA,EAAA,KAAK,SAAL,MAAAA,EAAa,cAAc,KAAK,cAC3C,CAEA,IAAI,mBAAoB,CAtF1B,IAAAA,EAuFI,MAAO,CAAC,GAACA,EAAA,KAAK,SAAL,MAAAA,EAAa,sBACxB,CAEA,IAAI,kBAAmB,CA1FzB,IAAAA,EA2FI,MAAO,CAAC,GAACA,EAAA,KAAK,SAAL,MAAAA,EAAa,qBACxB,CAEA,QAAyB,CACvB,OAAOC,gBACT,CACF,EApEEC,EAAA,CADCC,EAAS,CAAE,KAAM,OAAQ,QAAS,GAAM,UAAW,eAAgB,CAAC,GARlDV,EASnB,4BATmBA,EAArBS,EAAA,CADCC,EAAcX,CAAa,GACPC",
|
|
6
|
+
"names": ["styles", "i", "bl_table_row_default", "blTableRowTag", "BlTableRow", "s", "bl_table_row_default", "blTableHeaderTag", "blTableBodyTag", "_changedProperties", "com", "_a", "x", "__decorateClass", "e"]
|
|
7
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{b as r}from"./chunk-4OT5AMS5.js";import{a as c,
|
|
1
|
+
import{b as r}from"./chunk-4OT5AMS5.js";import{a as c,c as l}from"./chunk-IZ2LK5GK.js";var a=c((s,i)=>{i.exports=function(o){let e=o||typeof window<"u"&&window;return!!(e&&(e.navigator.userAgent.match(/Chromatic/)||e.location.href.match(/chromatic=true/)))}});var n=l(a(),1),p=(t,o)=>(0,n.default)()?r`${o}
|
|
2
2
|
<div class="chromatic-wrapper">${t()}</div>`:r`${t()}`;var y=t=>p(t,r`<style>
|
|
3
3
|
#root-inner {
|
|
4
4
|
height: 600px;
|
|
5
5
|
}
|
|
6
6
|
</style>`);export{y as a};
|
|
7
|
-
//# sourceMappingURL=chunk-
|
|
7
|
+
//# sourceMappingURL=chunk-HSVSMABT.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as b}from"./chunk-ECPWEUBG.js";import{a as
|
|
1
|
+
import{a as b}from"./chunk-ECPWEUBG.js";import{a as v}from"./chunk-DINNT5P2.js";import{a as m}from"./chunk-GRL4DWKG.js";import{a as u,b as e}from"./chunk-X2KXJYXQ.js";import{a as d,b as n,f as p}from"./chunk-4OT5AMS5.js";import{d as a}from"./chunk-IZ2LK5GK.js";var y=d`:host{display:block}.alert{--padding:var(--bl-size-m);--main-color:var(--bl-color-info);--main-bg-color:var(--bl-color-info-contrast);position:relative;display:flex;align-items:flex-start;justify-content:space-between;background-color:var(--main-bg-color);color:var(--bl-color-neutral-darker);box-shadow:inset 0 0 0 1px var(--main-color);border-radius:var(--bl-border-radius-l);padding:calc(var(--padding) / 2) var(--padding);padding-right:calc(var(--padding) / 2)}.description{font:var(--bl-font-body-text-2)}.wrapper{display:flex;flex-flow:column;flex-wrap:wrap;justify-content:space-between;flex:auto}.content{display:flex;margin-right:var(--bl-size-2xs);flex:20 1 70%;padding:calc(var(--padding) / 2) 0}.icon{padding:calc(var(--padding) / 2) 0;margin-right:var(--bl-size-2xs);color:var(--main-color)}.text-content{display:flex;flex-direction:column}.caption{color:var(--bl-color-neutral-darker);font:var(--bl-font-title-3-medium)}.actions{display:none;flex-wrap:wrap;gap:var(--bl-size-m);padding:calc(var(--padding) / 2) 0}.close{--bl-color-neutral-lightest:transparent}.caption + .description{margin-top:var(--bl-size-2xs)}:host([closed]){display:none}:host([variant="success"]) .alert{--main-color:var(--bl-color-success);--main-bg-color:var(--bl-color-success-contrast)}:host([variant="warning"]) .alert{--main-color:var(--bl-color-warning);--main-bg-color:var(--bl-color-warning-contrast)}:host([variant="danger"]) .alert{--main-color:var(--bl-color-danger);--main-bg-color:var(--bl-color-danger-contrast)}`,f=y;var t=class extends p{constructor(){super(...arguments);this.variant="info";this.closable=!1;this.closed=!1}static get styles(){return[f]}open(){this.closed=!1}close(){this.closed=!0}get _hasAlertCaptionSlot(){return this.querySelector(':scope > [slot="caption"]')!==null}_closeHandler(){this.closed=!0,this.onClose(!0)}_predefinedIcons(){switch(this.variant){case"success":return"check_fill";case"danger":return"close_fill";default:return this.variant}}_getIcon(){if(this.icon)return this.icon===!0?this._predefinedIcons():this.icon}_initAlertActionSlot(i){let r=i.target;r.assignedElements({flatten:!0}).forEach(o=>{var l,c;if(o.tagName!=="BL-BUTTON"){(l=o.parentNode)==null||l.removeChild(o);return}((c=this.shadowRoot)==null?void 0:c.querySelector(".actions")).style.display="flex";let g=r.name==="action-secondary"?"secondary":"primary",h={info:"neutral",warning:"neutral",success:"success",danger:"danger"};o.setAttribute("variant",g),o.setAttribute("kind",h[this.variant]),o.setAttribute("size","medium"),o.removeAttribute("icon")})}render(){let i=this.caption||this._hasAlertCaptionSlot?n`<span class="caption">
|
|
2
2
|
<slot name="caption"> ${this.caption} </slot>
|
|
3
3
|
</span>`:null,r=this._getIcon()?n`<bl-icon class="icon" name=${v(this._getIcon())}></bl-icon>`:null,s=this.closable?n`<bl-button
|
|
4
4
|
class="close"
|
|
@@ -28,4 +28,4 @@ import{a as b}from"./chunk-ECPWEUBG.js";import{a as m}from"./chunk-GRL4DWKG.js";
|
|
|
28
28
|
${s}
|
|
29
29
|
</div>
|
|
30
30
|
`}};a([e({reflect:!0})],t.prototype,"variant",2),a([e()],t.prototype,"description",2),a([e({converter:b()})],t.prototype,"icon",2),a([e({type:Boolean,reflect:!0})],t.prototype,"closable",2),a([e()],t.prototype,"caption",2),a([e({type:Boolean,reflect:!0})],t.prototype,"closed",2),a([m("bl-close")],t.prototype,"onClose",2),t=a([u("bl-alert")],t);export{t as a};
|
|
31
|
-
//# sourceMappingURL=chunk-
|
|
31
|
+
//# sourceMappingURL=chunk-HULHLSIH.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(function(){"use strict";let m=new WeakMap,w=new WeakMap,g=new WeakMap,u=new WeakMap,x=new WeakMap,Q=new WeakMap,T=new WeakMap,f=new WeakMap,X=new WeakMap,b=new WeakMap,L=new WeakMap,N=new WeakMap,O=new WeakMap,R=new WeakMap,E=new WeakMap,v={ariaAtomic:"aria-atomic",ariaAutoComplete:"aria-autocomplete",ariaBusy:"aria-busy",ariaChecked:"aria-checked",ariaColCount:"aria-colcount",ariaColIndex:"aria-colindex",ariaColIndexText:"aria-colindextext",ariaColSpan:"aria-colspan",ariaCurrent:"aria-current",ariaDisabled:"aria-disabled",ariaExpanded:"aria-expanded",ariaHasPopup:"aria-haspopup",ariaHidden:"aria-hidden",ariaInvalid:"aria-invalid",ariaKeyShortcuts:"aria-keyshortcuts",ariaLabel:"aria-label",ariaLevel:"aria-level",ariaLive:"aria-live",ariaModal:"aria-modal",ariaMultiLine:"aria-multiline",ariaMultiSelectable:"aria-multiselectable",ariaOrientation:"aria-orientation",ariaPlaceholder:"aria-placeholder",ariaPosInSet:"aria-posinset",ariaPressed:"aria-pressed",ariaReadOnly:"aria-readonly",ariaRelevant:"aria-relevant",ariaRequired:"aria-required",ariaRoleDescription:"aria-roledescription",ariaRowCount:"aria-rowcount",ariaRowIndex:"aria-rowindex",ariaRowIndexText:"aria-rowindextext",ariaRowSpan:"aria-rowspan",ariaSelected:"aria-selected",ariaSetSize:"aria-setsize",ariaSort:"aria-sort",ariaValueMax:"aria-valuemax",ariaValueMin:"aria-valuemin",ariaValueNow:"aria-valuenow",ariaValueText:"aria-valuetext",role:"role"},Y=(e,t)=>{for(let a in v){t[a]=null;let r=null,i=v[a];Object.defineProperty(t,a,{get(){return r},set(s){r=s,e.isConnected?e.setAttribute(i,s):b.set(e,t)}})}};function H(e){let t=u.get(e),{form:a}=t;U(e,a,t),z(e,t.labels)}let D=(e,t=!1)=>{let a=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(s){return u.has(s)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}}),r=a.nextNode(),i=!t||e.disabled;for(;r;)r.formDisabledCallback&&i&&S(r,e.disabled),r=a.nextNode()},P={attributes:!0,attributeFilter:["disabled"]},W=new MutationObserver(e=>{for(let t of e){let a=t.target;a.constructor.formAssociated?S(a,a.hasAttribute("disabled")):a.localName==="fieldset"&&D(a)}});function F(e){e.forEach(t=>{let{addedNodes:a,removedNodes:r}=t,i=Array.from(a),s=Array.from(r);i.forEach(n=>{if(u.has(n)&&n.constructor.formAssociated&&H(n),b.has(n)){let l=b.get(n);Object.keys(v).filter(o=>l[o]!==null).forEach(o=>{n.setAttribute(v[o],l[o])}),b.delete(n)}if(E.has(n)){let l=E.get(n);n.setAttribute("internals-valid",l.validity.valid.toString()),n.setAttribute("internals-invalid",(!l.validity.valid).toString()),n.setAttribute("aria-invalid",(!l.validity.valid).toString()),E.delete(n)}if(n.localName==="form"){let l=f.get(n),d=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode(c){return u.has(c)&&!(l&&l.has(c))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}}),o=d.nextNode();for(;o;)H(o),o=d.nextNode()}n.localName==="fieldset"&&(W.observe(n,P),D(n,!0))}),s.forEach(n=>{let l=u.get(n);l&&g.get(l)&&_(l),T.has(n)&&T.get(n).disconnect()})})}function Z(e){e.forEach(t=>{let{removedNodes:a}=t;a.forEach(r=>{let i=O.get(t.target);u.has(r)&&q(r),i.disconnect()})})}let j=e=>{let t=new MutationObserver(Z);t.observe(e,{childList:!0}),O.set(e,t)};new MutationObserver(F);let C={childList:!0,subtree:!0},S=(e,t)=>{e.toggleAttribute("internals-disabled",t),t?e.setAttribute("aria-disabled","true"):e.removeAttribute("aria-disabled"),e.formDisabledCallback&&e.formDisabledCallback.apply(e,[t])},_=e=>{g.get(e).forEach(a=>{a.remove()}),g.set(e,[])},$=(e,t)=>{let a=document.createElement("input");return a.type="hidden",a.name=e.getAttribute("name"),e.after(a),g.get(t).push(a),a},tt=(e,t)=>{g.set(t,[]),W.observe(e,P)},z=(e,t)=>{if(t.length){Array.from(t).forEach(r=>r.addEventListener("click",e.click.bind(e)));let a=t[0].id;t[0].id||(a=`${t[0].htmlFor}_Label`,t[0].id=a),e.setAttribute("aria-labelledby",a)}},M=e=>{let t=Array.from(e.elements).filter(s=>!s.tagName.includes("-")&&s.validity).map(s=>s.validity.valid),a=f.get(e)||[],r=Array.from(a).filter(s=>s.isConnected).map(s=>u.get(s).validity.valid),i=[...t,...r].includes(!1);e.toggleAttribute("internals-invalid",i),e.toggleAttribute("internals-valid",!i)},et=e=>{M(I(e.target))},at=e=>{M(I(e.target))},rt=e=>{let t=":is(:is(button, input)[type=submit], button:not([type])):not([disabled])",a=`${t}:not([form])`;e.id&&(a+=`,${t}[form='${e.id}']`),e.addEventListener("click",r=>{if(r.target.closest(a)){let s=f.get(e);if(e.noValidate)return;s.size&&Array.from(s).reverse().map(d=>u.get(d).reportValidity()).includes(!1)&&r.preventDefault()}})},it=e=>{let t=f.get(e.target);t&&t.size&&t.forEach(a=>{a.constructor.formAssociated&&a.formResetCallback&&a.formResetCallback.apply(a)})},U=(e,t,a)=>{if(t){let r=f.get(t);if(r)r.add(e);else{let i=new Set;i.add(e),f.set(t,i),rt(t),t.addEventListener("reset",it),t.addEventListener("input",et),t.addEventListener("change",at)}Q.set(t,{ref:e,internals:a}),e.constructor.formAssociated&&e.formAssociatedCallback&&setTimeout(()=>{e.formAssociatedCallback.apply(e,[t])},0),M(t)}},I=e=>{let t=e.parentNode;return t&&t.tagName!=="FORM"&&(t=I(t)),t},h=(e,t,a=DOMException)=>{if(!e.constructor.formAssociated)throw new a(t)},K=(e,t,a)=>{let r=f.get(e);return r&&r.size&&r.forEach(i=>{u.get(i)[a]()||(t=!1)}),t},q=e=>{if(e.constructor.formAssociated){let t=u.get(e),{labels:a,form:r}=t;z(e,a),U(e,r,t)}};class nt{constructor(){this.badInput=!1,this.customError=!1,this.patternMismatch=!1,this.rangeOverflow=!1,this.rangeUnderflow=!1,this.stepMismatch=!1,this.tooLong=!1,this.tooShort=!1,this.typeMismatch=!1,this.valid=!0,this.valueMissing=!1,Object.seal(this)}}let st=e=>(e.badInput=!1,e.customError=!1,e.patternMismatch=!1,e.rangeOverflow=!1,e.rangeUnderflow=!1,e.stepMismatch=!1,e.tooLong=!1,e.tooShort=!1,e.typeMismatch=!1,e.valid=!0,e.valueMissing=!1,e),ot=(e,t,a)=>(e.valid=lt(t),Object.keys(t).forEach(r=>e[r]=t[r]),a&&M(a),e),lt=e=>{let t=!0;for(let a in e)a!=="valid"&&e[a]!==!1&&(t=!1);return t},V=new WeakMap;class k extends Set{static get isPolyfilled(){return!0}constructor(t){if(super(),!t||!t.tagName||t.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");V.set(this,t)}add(t){if(!/^--/.test(t)||typeof t!="string")throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${t} must start with '--'.`);let a=super.add(t),r=V.get(this);return r.toggleAttribute(`state${t}`,!0),r.part&&r.part.add(`state${t}`),a}clear(){for(let[t]of this.entries())this.delete(t);super.clear()}delete(t){let a=super.delete(t),r=V.get(this);return r.toggleAttribute(`state${t}`,!1),r.part&&r.part.remove(`state${t}`),a}}function B(e,t,a,r){if(a==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return a==="m"?r:a==="a"?r.call(e):r?r.value:t.get(e)}function ct(e,t,a,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(e,a):i?i.value=a:t.set(e,a),a}var y;class dt{constructor(t){y.set(this,void 0),ct(this,y,t,"f");for(let a=0;a<t.length;a++){let r=t[a];this[a]=r,r.hasAttribute("name")&&(this[r.getAttribute("name")]=r)}Object.freeze(this)}get length(){return B(this,y,"f").length}[(y=new WeakMap,Symbol.iterator)](){return B(this,y,"f")[Symbol.iterator]()}item(t){return this[t]==null?null:this[t]}namedItem(t){return this[t]==null?null:this[t]}}class G{static get isPolyfilled(){return!0}constructor(t){if(!t||!t.tagName||t.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");let a=t.getRootNode(),r=new nt;this.states=new k(t),m.set(this,t),w.set(this,r),u.set(t,this),Y(t,this),tt(t,this),Object.seal(this),q(t),a instanceof DocumentFragment&&j(a)}checkValidity(){let t=m.get(this);if(h(t,"Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;let a=w.get(this);if(!a.valid){let r=new Event("invalid",{bubbles:!1,cancelable:!0,composed:!1});t.dispatchEvent(r)}return a.valid}get form(){let t=m.get(this);h(t,"Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");let a;return t.constructor.formAssociated===!0&&(a=I(t)),a}get labels(){let t=m.get(this);h(t,"Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");let a=t.getAttribute("id"),r=t.getRootNode();return r&&a?r.querySelectorAll(`[for="${a}"]`):[]}reportValidity(){let t=m.get(this);if(h(t,"Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;let a=this.checkValidity(),r=N.get(this);if(r&&!t.constructor.formAssociated)throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");return!a&&r&&(t.focus(),r.focus()),a}setFormValue(t){let a=m.get(this);if(h(a,"Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."),_(this),t!=null&&!(t instanceof FormData)){if(a.getAttribute("name")){let r=$(a,this);r.value=t}}else t!=null&&t instanceof FormData&&Array.from(t).reverse().forEach(([r,i])=>{if(typeof i=="string"){let s=$(a,this);s.name=r,s.value=i}});X.set(a,t)}setValidity(t,a,r){let i=m.get(this);if(h(i,"Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!t)throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");N.set(this,r);let s=w.get(this),n={};for(let o in t)n[o]=t[o];Object.keys(n).length===0&&st(s);let l={...s,...n};delete l.valid;let{valid:d}=ot(s,l,this.form);if(!d&&!a)throw new DOMException("Failed to execute 'setValidity' on 'ElementInternals': The second argument should not be empty if one or more flags in the first argument are true.");x.set(this,d?"":a),i.isConnected?(i.toggleAttribute("internals-invalid",!d),i.toggleAttribute("internals-valid",d),i.setAttribute("aria-invalid",`${!d}`)):E.set(i,this)}get shadowRoot(){let t=m.get(this),a=L.get(t);return a||null}get validationMessage(){let t=m.get(this);return h(t,"Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."),x.get(this)}get validity(){let t=m.get(this);return h(t,"Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."),w.get(this)}get willValidate(){let t=m.get(this);return h(t,"Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element."),!(t.disabled||t.hasAttribute("disabled")||t.hasAttribute("readonly"))}}function ut(){if(!window.ElementInternals||!HTMLElement.prototype.attachInternals)return!1;class e extends HTMLElement{constructor(){super(),this.internals=this.attachInternals()}}let t=`element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g,"")}`;customElements.define(t,e);let a=new e;return["shadowRoot","form","willValidate","validity","validationMessage","labels","setFormValue","setValidity","checkValidity","reportValidity"].every(r=>r in a.internals)}if(ut()){if(!window.CustomStateSet){window.CustomStateSet=k;let e=HTMLElement.prototype.attachInternals;HTMLElement.prototype.attachInternals=function(...t){let a=e.call(this,t);return a.states=new k(this),a}}}else{let t=function(...o){let c=i.apply(this,o),p=new MutationObserver(F);return L.set(this,c),window.ShadyDOM?p.observe(this,C):p.observe(c,C),T.set(this,p),c},a=function(...o){let c=n.apply(this,o);return K(this,c,"checkValidity")},r=function(...o){let c=l.apply(this,o);return K(this,c,"reportValidity")};window.ElementInternals=G;let e=customElements.define;customElements.define=function(o,c,p){if(c.formAssociated){let A=c.prototype.connectedCallback;c.prototype.connectedCallback=function(){R.has(this)||(R.set(this,!0),this.hasAttribute("disabled")&&S(this,!0)),A!=null&&A.apply(this)}}e.apply(customElements,[o,c,p])},HTMLElement.prototype.attachInternals=function(){if(this.tagName){if(this.tagName.indexOf("-")===-1)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': Unable to attach ElementInternals to non-custom elements.")}else return{};if(u.has(this))throw new DOMException("DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");return new G(this)};let i=Element.prototype.attachShadow;Element.prototype.attachShadow=t,new MutationObserver(F).observe(document.documentElement,C);let n=HTMLFormElement.prototype.checkValidity;HTMLFormElement.prototype.checkValidity=a;let l=HTMLFormElement.prototype.reportValidity;HTMLFormElement.prototype.reportValidity=r;let{get:d}=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get(...o){let c=d.call(this,...o),p=Array.from(f.get(this)||[]);if(p.length===0)return c;let A=Array.from(c).concat(p).sort((J,mt)=>J.compareDocumentPosition?J.compareDocumentPosition(mt)&2?1:-1:0);return new dt(A)}}),window.CustomStateSet||(window.CustomStateSet=k)}})();
|
|
2
|
+
//# sourceMappingURL=chunk-HZ6A5QFC.js.map
|