@xplortech/apollo-core 3.0.0 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.typings/apollo-components.html-data.json +120 -14
- package/build/components/avatar.css +1 -1
- package/build/components/data-card.css +1 -1
- package/build/components/dropdown.css +1 -1
- package/build/components/input-time.css +1 -1
- package/build/components/large-card.css +1 -1
- package/build/components/list-item.css +1 -1
- package/build/components/modal.css +1 -1
- package/build/components/popover.css +1 -1
- package/build/components/side-nav.css +1 -1
- package/build/components/spotlight.css +1 -1
- package/build/components/table-cell-base.css +1 -0
- package/build/components/table-cell.css +1 -0
- package/build/components/table-footer-cell.css +1 -1
- package/build/components/table-header-cell.css +1 -1
- package/build/components/table.css +1 -1
- package/build/components/tag.css +1 -1
- package/build/components/toast.css +1 -1
- package/build/components/toggle.css +1 -1
- package/build/components/toolbar.css +1 -1
- package/build/components/tooltip.css +1 -1
- package/build/components/top-nav.css +1 -1
- package/build/components-manifest.json +19 -3
- package/build/core.css +1 -1
- package/build/style.css +1 -1
- package/build/variables/apollo.css +4 -0
- package/build/variables/field-edge.css +4 -0
- package/build/vendor/flatpickr.css +1 -1
- package/dist/apollo-core/apollo-core.css +1 -1
- package/dist/apollo-core/apollo-core.esm.js +1 -1
- package/dist/apollo-core/p-045a4538.entry.js +1 -0
- package/dist/apollo-core/{p-d443291f.entry.js → p-050a8bf2.entry.js} +1 -1
- package/dist/apollo-core/p-08767607.entry.js +1 -0
- package/dist/apollo-core/{p-149ddd12.entry.js → p-11914cd4.entry.js} +1 -1
- package/dist/apollo-core/{p-581b702c.entry.js → p-14e86de8.entry.js} +1 -1
- package/dist/apollo-core/p-194c0ccd.entry.js +1 -0
- package/dist/apollo-core/p-1c031055.entry.js +1 -0
- package/dist/apollo-core/p-24f7280a.entry.js +1 -0
- package/dist/apollo-core/{p-47bda204.entry.js → p-24fa8a03.entry.js} +1 -1
- package/dist/apollo-core/{p-91895c40.entry.js → p-2971e2ec.entry.js} +1 -1
- package/dist/apollo-core/{p-0958c719.entry.js → p-3417c1ce.entry.js} +1 -1
- package/dist/apollo-core/p-3713cd77.entry.js +1 -0
- package/dist/apollo-core/p-386851a2.entry.js +1 -0
- package/dist/apollo-core/p-3cd1238b.entry.js +1 -0
- package/dist/apollo-core/{p-b45179fb.entry.js → p-49531864.entry.js} +1 -1
- package/dist/apollo-core/p-4e3c6616.entry.js +1 -0
- package/dist/apollo-core/p-5b9fd96e.entry.js +1 -0
- package/dist/apollo-core/{p-cb5b15c2.entry.js → p-5bfac8fd.entry.js} +1 -1
- package/dist/apollo-core/p-5c3be343.entry.js +1 -0
- package/dist/apollo-core/p-5cbf5d42.entry.js +1 -0
- package/dist/apollo-core/p-5ec2b180.entry.js +1 -0
- package/dist/apollo-core/{p-790709c0.entry.js → p-64f5c129.entry.js} +1 -1
- package/dist/apollo-core/{p-28bce81a.entry.js → p-65f6b66c.entry.js} +1 -1
- package/dist/apollo-core/{p-d9070ae5.entry.js → p-715baae0.entry.js} +1 -1
- package/dist/apollo-core/p-72e0455f.entry.js +1 -0
- package/dist/apollo-core/p-7ac7fbc0.entry.js +1 -0
- package/dist/apollo-core/p-7d70e089.entry.js +1 -0
- package/dist/apollo-core/{p-d41b8f46.entry.js → p-7eb02cf3.entry.js} +1 -1
- package/dist/apollo-core/p-7f4463ff.entry.js +1 -0
- package/dist/apollo-core/p-808f3d9c.entry.js +1 -0
- package/dist/apollo-core/p-87582346.entry.js +1 -0
- package/dist/apollo-core/{p-2c995d80.entry.js → p-8f8f4759.entry.js} +1 -1
- package/dist/apollo-core/{p-5d9a593e.entry.js → p-907bc21e.entry.js} +1 -1
- package/dist/apollo-core/p-9905c77c.entry.js +1 -0
- package/dist/apollo-core/{p-54903322.entry.js → p-9d731673.entry.js} +1 -1
- package/dist/apollo-core/{p-2938ab4f.entry.js → p-9feaa8be.entry.js} +1 -1
- package/dist/apollo-core/p-O7gQjVdS.js +1 -0
- package/dist/apollo-core/p-a6ecca68.entry.js +1 -0
- package/dist/apollo-core/p-a789c272.entry.js +1 -0
- package/dist/apollo-core/{p-06a9a27b.entry.js → p-aeb2bcb8.entry.js} +1 -1
- package/dist/apollo-core/p-b3b4678b.entry.js +1 -0
- package/dist/apollo-core/{p-82812126.entry.js → p-b64ed46d.entry.js} +1 -1
- package/dist/apollo-core/{p-0368a1df.entry.js → p-bc821e69.entry.js} +1 -1
- package/dist/apollo-core/p-bd493c4a.entry.js +1 -0
- package/dist/apollo-core/p-bdcece21.entry.js +1 -0
- package/dist/apollo-core/{p-cdb5b5c4.entry.js → p-bfb7a83a.entry.js} +1 -1
- package/dist/apollo-core/{p-cdacfcd4.entry.js → p-c22f70f4.entry.js} +1 -1
- package/dist/apollo-core/{p-5730d96c.entry.js → p-c5bc3b2c.entry.js} +1 -1
- package/dist/apollo-core/{p-4ad79534.entry.js → p-ca83003e.entry.js} +1 -1
- package/dist/apollo-core/p-d3230277.entry.js +1 -0
- package/dist/apollo-core/p-d3ada7d0.entry.js +1 -0
- package/dist/apollo-core/{p-d0bc7c45.entry.js → p-d469bf5d.entry.js} +1 -1
- package/dist/apollo-core/p-d7f8ee34.entry.js +1 -0
- package/dist/apollo-core/p-d879c349.entry.js +1 -0
- package/dist/apollo-core/{p-2139f9f6.entry.js → p-df257cbf.entry.js} +1 -1
- package/dist/apollo-core/p-e09d8beb.entry.js +1 -0
- package/dist/apollo-core/p-e4d50301.entry.js +1 -0
- package/dist/apollo-core/{p-f3a2c79b.entry.js → p-ea9cdd65.entry.js} +1 -1
- package/dist/apollo-core/{p-ca4652b3.entry.js → p-eba654a3.entry.js} +1 -1
- package/dist/apollo-core/{p-4a2323b3.entry.js → p-ee68bed6.entry.js} +1 -1
- package/dist/apollo-core/{p-abdf199b.entry.js → p-f384a990.entry.js} +1 -1
- package/dist/apollo-core/{p-4d4acd1f.entry.js → p-f579e4b0.entry.js} +1 -1
- package/dist/apollo-core/{p-d724c419.entry.js → p-fcb17ff9.entry.js} +1 -1
- package/dist/apollo-core/{p-e2890eb1.entry.js → p-ff16f574.entry.js} +1 -1
- package/dist/cjs/apollo-core.cjs.js +1 -1
- package/dist/cjs/index-3cBvw409.js +8 -12
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/table-internal-DssCrBs_.js +67 -0
- package/dist/cjs/xpl-accordion.cjs.entry.js +2 -2
- package/dist/cjs/xpl-application-shell.cjs.entry.js +1 -1
- package/dist/cjs/xpl-avatar_3.cjs.entry.js +4 -4
- package/dist/cjs/xpl-backdrop.cjs.entry.js +1 -1
- package/dist/cjs/xpl-badge.cjs.entry.js +1 -1
- package/dist/cjs/xpl-banner.cjs.entry.js +2 -2
- package/dist/cjs/xpl-breadcrumb-item.cjs.entry.js +1 -1
- package/dist/cjs/xpl-breadcrumbs.cjs.entry.js +1 -1
- package/dist/cjs/xpl-button-row.cjs.entry.js +1 -1
- package/dist/cjs/xpl-button.cjs.entry.js +1 -1
- package/dist/cjs/xpl-calendar.cjs.entry.js +1 -1
- package/dist/cjs/xpl-checkbox.cjs.entry.js +3 -3
- package/dist/cjs/xpl-choicelist.cjs.entry.js +1 -1
- package/dist/cjs/xpl-content-area.cjs.entry.js +1 -1
- package/dist/cjs/xpl-dashboard.cjs.entry.js +1 -1
- package/dist/cjs/xpl-data-card.cjs.entry.js +2 -2
- package/dist/cjs/xpl-dropdown_4.cjs.entry.js +8 -8
- package/dist/cjs/xpl-dynamic-table-cell.cjs.entry.js +2 -2
- package/dist/cjs/xpl-dynamic-table-row.cjs.entry.js +2 -2
- package/dist/cjs/xpl-dynamic-table.cjs.entry.js +2 -2
- package/dist/cjs/xpl-grid-item.cjs.entry.js +1 -1
- package/dist/cjs/xpl-grid.cjs.entry.js +1 -1
- package/dist/cjs/xpl-header-accordion.cjs.entry.js +1 -1
- package/dist/cjs/xpl-icon.cjs.entry.js +2 -2
- package/dist/cjs/xpl-input-color.cjs.entry.js +8 -8
- package/dist/cjs/xpl-input-phone.cjs.entry.js +5 -5
- package/dist/cjs/xpl-input-time.cjs.entry.js +2 -2
- package/dist/cjs/xpl-input_4.cjs.entry.js +10 -10
- package/dist/cjs/xpl-large-card.cjs.entry.js +1 -1
- package/dist/cjs/xpl-list.cjs.entry.js +2 -2
- package/dist/cjs/xpl-main-nav.cjs.entry.js +1 -1
- package/dist/cjs/xpl-modal.cjs.entry.js +1 -1
- package/dist/cjs/xpl-nav-header-menu.cjs.entry.js +2 -2
- package/dist/cjs/xpl-nav-item.cjs.entry.js +2 -2
- package/dist/cjs/xpl-pagination.cjs.entry.js +4 -4
- package/dist/cjs/xpl-panel.cjs.entry.js +2 -2
- package/dist/cjs/xpl-popover.cjs.entry.js +4 -4
- package/dist/cjs/xpl-progress-bar.cjs.entry.js +2 -2
- package/dist/cjs/xpl-progress-indicator.cjs.entry.js +1 -1
- package/dist/cjs/xpl-secondary-nav.cjs.entry.js +1 -1
- package/dist/cjs/xpl-select_2.cjs.entry.js +8 -8
- package/dist/cjs/xpl-side-nav-header-item.cjs.entry.js +2 -2
- package/dist/cjs/xpl-side-nav-item.cjs.entry.js +2 -2
- package/dist/cjs/xpl-side-nav-section.cjs.entry.js +5 -5
- package/dist/cjs/xpl-side-nav.cjs.entry.js +2 -2
- package/dist/cjs/xpl-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/xpl-slideout.cjs.entry.js +1 -1
- package/dist/cjs/xpl-tab-panel.cjs.entry.js +2 -2
- package/dist/cjs/xpl-table-body.cjs.entry.js +1 -1
- package/dist/cjs/xpl-table-cell_3.cjs.entry.js +228 -0
- package/dist/cjs/xpl-table-footer.cjs.entry.js +1 -1
- package/dist/cjs/xpl-table-header.cjs.entry.js +1 -1
- package/dist/cjs/xpl-table-row.cjs.entry.js +43 -2
- package/dist/cjs/xpl-table.cjs.entry.js +1204 -80
- package/dist/cjs/xpl-tabs.cjs.entry.js +5 -5
- package/dist/cjs/xpl-toast.cjs.entry.js +2 -2
- package/dist/cjs/xpl-toggle.cjs.entry.js +3 -3
- package/dist/cjs/xpl-toolbar.cjs.entry.js +2 -2
- package/dist/cjs/xpl-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/xpl-top-nav-item.cjs.entry.js +2 -2
- package/dist/cjs/xpl-top-nav-menu.cjs.entry.js +2 -2
- package/dist/cjs/xpl-top-nav.cjs.entry.js +5 -5
- package/dist/cjs/xpl-utility-bar.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/xpl-accordion/xpl-accordion.js +2 -2
- package/dist/collection/components/xpl-application-shell/xpl-application-shell.js +1 -1
- package/dist/collection/components/xpl-backdrop/xpl-backdrop.js +1 -1
- package/dist/collection/components/xpl-badge/xpl-badge.js +1 -1
- package/dist/collection/components/xpl-banner/xpl-banner.js +2 -2
- package/dist/collection/components/xpl-breadcrumbs/xpl-breadcrumb-item/xpl-breadcrumb-item.js +1 -1
- package/dist/collection/components/xpl-breadcrumbs/xpl-breadcrumbs/xpl-breadcrumbs.js +1 -1
- package/dist/collection/components/xpl-button/xpl-button.js +1 -1
- package/dist/collection/components/xpl-button-row/xpl-button-row.js +1 -1
- package/dist/collection/components/xpl-calendar/xpl-calendar.js +1 -1
- package/dist/collection/components/xpl-checkbox/xpl-checkbox.js +3 -3
- package/dist/collection/components/xpl-choicelist/xpl-choicelist.js +1 -1
- package/dist/collection/components/xpl-content-area/xpl-content-area.js +1 -1
- package/dist/collection/components/xpl-dashboard/xpl-dashboard.js +1 -1
- package/dist/collection/components/xpl-data-card/xpl-data-card.js +2 -2
- package/dist/collection/components/xpl-divider/xpl-divider.js +1 -1
- package/dist/collection/components/xpl-dropdown/xpl-dropdown-group/xpl-dropdown-group.js +1 -1
- package/dist/collection/components/xpl-dropdown/xpl-dropdown-heading/xpl-dropdown-heading.js +1 -1
- package/dist/collection/components/xpl-dropdown/xpl-dropdown-option/xpl-dropdown-option.js +2 -2
- package/dist/collection/components/xpl-dropdown/xpl-dropdown.js +4 -4
- package/dist/collection/components/xpl-dynamic-table/xpl-dynamic-table.js +2 -2
- package/dist/collection/components/xpl-dynamic-table-cell/xpl-dynamic-table-cell.js +2 -2
- package/dist/collection/components/xpl-dynamic-table-row/xpl-dynamic-table-row.js +2 -2
- package/dist/collection/components/xpl-grid/xpl-grid.js +1 -1
- package/dist/collection/components/xpl-grid-item/xpl-grid-item.js +1 -1
- package/dist/collection/components/xpl-header-accordion/xpl-header-accordion.js +1 -1
- package/dist/collection/components/xpl-icon/xpl-icon.js +2 -2
- package/dist/collection/components/xpl-input/xpl-input-color/xpl-input-color.js +8 -8
- package/dist/collection/components/xpl-input/xpl-input-date/xpl-input-date.js +3 -3
- package/dist/collection/components/xpl-input/xpl-input-file/xpl-input-file.js +4 -4
- package/dist/collection/components/xpl-input/xpl-input-phone/xpl-input-phone.js +5 -5
- package/dist/collection/components/xpl-input/xpl-input-search/xpl-input-search.js +1 -1
- package/dist/collection/components/xpl-input/xpl-input-time/xpl-input-time.js +2 -2
- package/dist/collection/components/xpl-input/xpl-input.js +2 -2
- package/dist/collection/components/xpl-large-card/xpl-large-card.js +1 -1
- package/dist/collection/components/xpl-list/xpl-list.js +2 -2
- package/dist/collection/components/xpl-main-nav/xpl-main-nav.js +1 -1
- package/dist/collection/components/xpl-modal/xpl-modal.js +1 -1
- package/dist/collection/components/xpl-nav-item/xpl-nav-item.js +2 -2
- package/dist/collection/components/xpl-pagination/xpl-pagination.js +4 -4
- package/dist/collection/components/xpl-panel/xpl-panel.js +2 -2
- package/dist/collection/components/xpl-popover/xpl-popover.js +4 -4
- package/dist/collection/components/xpl-progress-bar/xpl-progress-bar.js +2 -2
- package/dist/collection/components/xpl-progress-indicator/xpl-progress-indicator.js +1 -1
- package/dist/collection/components/xpl-radio/xpl-radio.js +3 -3
- package/dist/collection/components/xpl-secondary-nav/xpl-secondary-nav.js +1 -1
- package/dist/collection/components/xpl-select/xpl-select.js +6 -6
- package/dist/collection/components/xpl-side-nav/xpl-side-nav-header-item/xpl-side-nav-header-item.js +2 -2
- package/dist/collection/components/xpl-side-nav/xpl-side-nav-item/xpl-side-nav-item.js +2 -2
- package/dist/collection/components/xpl-side-nav/xpl-side-nav-section/xpl-side-nav-section.js +5 -5
- package/dist/collection/components/xpl-side-nav/xpl-side-nav.js +2 -2
- package/dist/collection/components/xpl-skeleton/xpl-skeleton.js +1 -1
- package/dist/collection/components/xpl-slideout/xpl-slideout.js +1 -1
- package/dist/collection/components/xpl-tab-panel/xpl-tab-panel.js +2 -2
- package/dist/collection/components/xpl-table/utils/move-row-dom.js +50 -0
- package/dist/collection/components/xpl-table/utils/table-internal.js +57 -0
- package/dist/collection/components/xpl-table/xpl-table-body/xpl-table-body.js +1 -1
- package/dist/collection/components/xpl-table/xpl-table-cell/xpl-table-cell.js +167 -0
- package/dist/collection/components/xpl-table/xpl-table-footer/xpl-table-footer.js +1 -1
- package/dist/collection/components/xpl-table/xpl-table-footer-cell/xpl-table-footer-cell.js +2 -2
- package/dist/collection/components/xpl-table/xpl-table-header-cell/xpl-table-header-cell.js +402 -0
- package/dist/collection/components/xpl-table/xpl-table-row/xpl-table-row.js +44 -2
- package/dist/collection/components/xpl-table/xpl-table.js +1427 -116
- package/dist/collection/components/xpl-table-header/xpl-table-header.js +1 -1
- package/dist/collection/components/xpl-tabs/xpl-tabs.js +5 -5
- package/dist/collection/components/xpl-tag/xpl-tag.js +2 -2
- package/dist/collection/components/xpl-toast/xpl-toast.js +2 -2
- package/dist/collection/components/xpl-toggle/xpl-toggle.js +3 -3
- package/dist/collection/components/xpl-toolbar/xpl-toolbar.js +2 -2
- package/dist/collection/components/xpl-tooltip/xpl-tooltip.js +1 -1
- package/dist/collection/components/xpl-top-nav/xpl-nav-header-menu/xpl-nav-header-menu.js +2 -2
- package/dist/collection/components/xpl-top-nav/xpl-top-nav-item/xpl-top-nav-item.js +2 -2
- package/dist/collection/components/xpl-top-nav/xpl-top-nav-menu/xpl-top-nav-menu.js +2 -2
- package/dist/collection/components/xpl-top-nav/xpl-top-nav.js +5 -5
- package/dist/collection/components/xpl-utility-bar/xpl-utility-bar.js +1 -1
- package/dist/components/index.d.ts +3 -1
- package/dist/components/index.js +1 -1
- package/dist/components/{p-oIn1krdu.js → p-1D7CWIJ-.js} +1 -1
- package/dist/components/{p-xtOHikY0.js → p-2cJsJK3-.js} +1 -1
- package/dist/components/{p-DYmvElhR.js → p-8zrW9vEC.js} +1 -1
- package/dist/components/p-B56GeUtW.js +1 -0
- package/dist/components/p-B6YLKDUX.js +1 -0
- package/dist/components/{p-D--kzomA.js → p-B7aaJikj.js} +1 -1
- package/dist/components/{p-U0JYwf4c.js → p-BOm_p_mz.js} +1 -1
- package/dist/components/p-BZIZSovL.js +1 -0
- package/dist/components/{p-EfW0v54z.js → p-BtLC-jpk.js} +1 -1
- package/dist/components/{p-xFsB212F.js → p-Btb2UkLz.js} +1 -1
- package/dist/components/{p-DAb-txW3.js → p-C0AbGd4t.js} +1 -1
- package/dist/components/p-CFXvQqUO.js +1 -0
- package/dist/components/{p-l3EZ-agL.js → p-CQjJIHK6.js} +1 -1
- package/dist/components/{p-Chpgh5SL.js → p-CV5nn1zR.js} +1 -1
- package/dist/components/p-CdRmVtIN.js +1 -0
- package/dist/components/p-CgemLtmL.js +1 -0
- package/dist/components/p-CmbpWpb0.js +1 -0
- package/dist/components/p-CuVYRPvz.js +1 -0
- package/dist/components/{p-JyNpXfDe.js → p-D09sGbzs.js} +1 -1
- package/dist/components/{p-BdpZR4KO.js → p-DTh_zemx.js} +1 -1
- package/dist/components/{p-CiHTfk3E.js → p-DoVubWyd.js} +1 -1
- package/dist/components/p-Dp62sBqX.js +1 -0
- package/dist/components/p-DqgnC_vS.js +1 -0
- package/dist/components/p-DtV4i45B.js +1 -0
- package/dist/components/{p-wIU7KUhA.js → p-ohy3NrgH.js} +1 -1
- package/dist/components/xpl-accordion.js +1 -1
- package/dist/components/xpl-application-shell.js +1 -1
- package/dist/components/xpl-avatar.js +1 -1
- package/dist/components/xpl-backdrop.js +1 -1
- package/dist/components/xpl-badge.js +1 -1
- package/dist/components/xpl-banner.js +1 -1
- package/dist/components/xpl-breadcrumb-item.js +1 -1
- package/dist/components/xpl-breadcrumbs.js +1 -1
- package/dist/components/xpl-button-row.js +1 -1
- package/dist/components/xpl-button.js +1 -1
- package/dist/components/xpl-calendar.js +1 -1
- package/dist/components/xpl-checkbox.js +1 -1
- package/dist/components/xpl-choicelist.js +1 -1
- package/dist/components/xpl-content-area.js +1 -1
- package/dist/components/xpl-dashboard.js +1 -1
- package/dist/components/xpl-data-card.js +1 -1
- package/dist/components/xpl-divider.js +1 -1
- package/dist/components/xpl-dropdown-group.js +1 -1
- package/dist/components/xpl-dropdown-heading.js +1 -1
- package/dist/components/xpl-dropdown-option.js +1 -1
- package/dist/components/xpl-dropdown.js +1 -1
- package/dist/components/xpl-dynamic-table-cell.js +1 -1
- package/dist/components/xpl-dynamic-table-row.js +1 -1
- package/dist/components/xpl-dynamic-table.js +1 -1
- package/dist/components/xpl-grid-item.js +1 -1
- package/dist/components/xpl-grid.js +1 -1
- package/dist/components/xpl-header-accordion.js +1 -1
- package/dist/components/xpl-icon.js +1 -1
- package/dist/components/xpl-input-color.js +1 -1
- package/dist/components/xpl-input-date.js +1 -1
- package/dist/components/xpl-input-file.js +1 -1
- package/dist/components/xpl-input-phone.js +1 -1
- package/dist/components/xpl-input-search.js +1 -1
- package/dist/components/xpl-input-time.js +1 -1
- package/dist/components/xpl-input.js +1 -1
- package/dist/components/xpl-large-card.js +1 -1
- package/dist/components/xpl-list-item.js +1 -1
- package/dist/components/xpl-list.js +1 -1
- package/dist/components/xpl-main-nav.js +1 -1
- package/dist/components/xpl-modal.js +1 -1
- package/dist/components/xpl-nav-header-menu.js +1 -1
- package/dist/components/xpl-nav-item.js +1 -1
- package/dist/components/xpl-pagination.js +1 -1
- package/dist/components/xpl-panel.js +1 -1
- package/dist/components/xpl-popover.js +1 -1
- package/dist/components/xpl-progress-bar.js +1 -1
- package/dist/components/xpl-progress-indicator.js +1 -1
- package/dist/components/xpl-radio.js +1 -1
- package/dist/components/xpl-secondary-nav.js +1 -1
- package/dist/components/xpl-select.js +1 -1
- package/dist/components/xpl-side-nav-header-item.js +1 -1
- package/dist/components/xpl-side-nav-item.js +1 -1
- package/dist/components/xpl-side-nav-section.js +1 -1
- package/dist/components/xpl-side-nav.js +1 -1
- package/dist/components/xpl-skeleton.js +1 -1
- package/dist/components/xpl-slideout.js +1 -1
- package/dist/components/xpl-spotlight.js +1 -1
- package/dist/components/xpl-tab-panel.js +1 -1
- package/dist/components/xpl-tab.js +1 -1
- package/dist/components/xpl-table-body.js +1 -1
- package/dist/components/xpl-table-cell.d.ts +11 -0
- package/dist/components/xpl-table-cell.js +1 -0
- package/dist/components/xpl-table-footer-cell.js +1 -1
- package/dist/components/xpl-table-footer.js +1 -1
- package/dist/components/xpl-table-header-cell.js +1 -1
- package/dist/components/xpl-table-header.js +1 -1
- package/dist/components/xpl-table-row.js +1 -1
- package/dist/components/xpl-table.js +1 -1
- package/dist/components/xpl-tabs.js +1 -1
- package/dist/components/xpl-tag.js +1 -1
- package/dist/components/xpl-toast.js +1 -1
- package/dist/components/xpl-toggle.js +1 -1
- package/dist/components/xpl-toolbar.js +1 -1
- package/dist/components/xpl-tooltip.js +1 -1
- package/dist/components/xpl-top-nav-item.js +1 -1
- package/dist/components/xpl-top-nav-menu.js +1 -1
- package/dist/components/xpl-top-nav.js +1 -1
- package/dist/components/xpl-utility-bar.js +1 -1
- package/dist/docs/xpl-avatar/readme.md +1 -1
- package/dist/docs/xpl-checkbox/readme.md +1 -3
- package/dist/docs/xpl-data-card/readme.md +1 -1
- package/dist/docs/xpl-dynamic-table/readme.md +4 -1
- package/dist/docs/xpl-dynamic-table-cell/readme.md +2 -0
- package/dist/docs/xpl-dynamic-table-row/readme.md +2 -0
- package/dist/docs/xpl-icon/readme.md +1 -1
- package/dist/docs/xpl-input/xpl-input-time/readme.md +1 -1
- package/dist/docs/xpl-large-card/readme.md +1 -1
- package/dist/docs/xpl-modal/readme.md +2 -2
- package/dist/docs/xpl-popover/readme.md +1 -2
- package/dist/docs/xpl-slideout/readme.md +1 -1
- package/dist/docs/xpl-spotlight/readme.md +1 -0
- package/dist/docs/xpl-table/readme.md +178 -20
- package/dist/docs/xpl-table/xpl-table-body/readme.md +4 -4
- package/dist/docs/xpl-table/xpl-table-cell/readme.md +53 -0
- package/dist/docs/xpl-table/xpl-table-footer/readme.md +4 -4
- package/dist/docs/xpl-table/xpl-table-footer-cell/readme.md +24 -15
- package/dist/docs/xpl-table/xpl-table-header-cell/readme.md +84 -0
- package/dist/docs/xpl-table/xpl-table-row/readme.md +18 -14
- package/dist/docs/xpl-toast/readme.md +2 -2
- package/dist/docs/xpl-toggle/readme.md +1 -1
- package/dist/docs/xpl-toolbar/readme.md +5 -3
- package/dist/docs/xpl-tooltip/readme.md +1 -2
- package/dist/docs.json +776 -113
- package/dist/esm/apollo-core.js +1 -1
- package/dist/esm/index-ukZKsqqq.js +8 -12
- package/dist/esm/loader.js +1 -1
- package/dist/esm/table-internal-O7gQjVdS.js +59 -0
- package/dist/esm/xpl-accordion.entry.js +2 -2
- package/dist/esm/xpl-application-shell.entry.js +1 -1
- package/dist/esm/xpl-avatar_3.entry.js +4 -4
- package/dist/esm/xpl-backdrop.entry.js +1 -1
- package/dist/esm/xpl-badge.entry.js +1 -1
- package/dist/esm/xpl-banner.entry.js +2 -2
- package/dist/esm/xpl-breadcrumb-item.entry.js +1 -1
- package/dist/esm/xpl-breadcrumbs.entry.js +1 -1
- package/dist/esm/xpl-button-row.entry.js +1 -1
- package/dist/esm/xpl-button.entry.js +1 -1
- package/dist/esm/xpl-calendar.entry.js +1 -1
- package/dist/esm/xpl-checkbox.entry.js +3 -3
- package/dist/esm/xpl-choicelist.entry.js +1 -1
- package/dist/esm/xpl-content-area.entry.js +1 -1
- package/dist/esm/xpl-dashboard.entry.js +1 -1
- package/dist/esm/xpl-data-card.entry.js +2 -2
- package/dist/esm/xpl-dropdown_4.entry.js +8 -8
- package/dist/esm/xpl-dynamic-table-cell.entry.js +2 -2
- package/dist/esm/xpl-dynamic-table-row.entry.js +2 -2
- package/dist/esm/xpl-dynamic-table.entry.js +2 -2
- package/dist/esm/xpl-grid-item.entry.js +1 -1
- package/dist/esm/xpl-grid.entry.js +1 -1
- package/dist/esm/xpl-header-accordion.entry.js +1 -1
- package/dist/esm/xpl-icon.entry.js +2 -2
- package/dist/esm/xpl-input-color.entry.js +8 -8
- package/dist/esm/xpl-input-phone.entry.js +5 -5
- package/dist/esm/xpl-input-time.entry.js +2 -2
- package/dist/esm/xpl-input_4.entry.js +10 -10
- package/dist/esm/xpl-large-card.entry.js +1 -1
- package/dist/esm/xpl-list.entry.js +2 -2
- package/dist/esm/xpl-main-nav.entry.js +1 -1
- package/dist/esm/xpl-modal.entry.js +1 -1
- package/dist/esm/xpl-nav-header-menu.entry.js +2 -2
- package/dist/esm/xpl-nav-item.entry.js +2 -2
- package/dist/esm/xpl-pagination.entry.js +4 -4
- package/dist/esm/xpl-panel.entry.js +2 -2
- package/dist/esm/xpl-popover.entry.js +4 -4
- package/dist/esm/xpl-progress-bar.entry.js +2 -2
- package/dist/esm/xpl-progress-indicator.entry.js +1 -1
- package/dist/esm/xpl-secondary-nav.entry.js +1 -1
- package/dist/esm/xpl-select_2.entry.js +8 -8
- package/dist/esm/xpl-side-nav-header-item.entry.js +2 -2
- package/dist/esm/xpl-side-nav-item.entry.js +2 -2
- package/dist/esm/xpl-side-nav-section.entry.js +5 -5
- package/dist/esm/xpl-side-nav.entry.js +2 -2
- package/dist/esm/xpl-skeleton.entry.js +1 -1
- package/dist/esm/xpl-slideout.entry.js +1 -1
- package/dist/esm/xpl-tab-panel.entry.js +2 -2
- package/dist/esm/xpl-table-body.entry.js +1 -1
- package/dist/esm/xpl-table-cell_3.entry.js +224 -0
- package/dist/esm/xpl-table-footer.entry.js +1 -1
- package/dist/esm/xpl-table-header.entry.js +1 -1
- package/dist/esm/xpl-table-row.entry.js +44 -3
- package/dist/esm/xpl-table.entry.js +1204 -80
- package/dist/esm/xpl-tabs.entry.js +5 -5
- package/dist/esm/xpl-toast.entry.js +2 -2
- package/dist/esm/xpl-toggle.entry.js +3 -3
- package/dist/esm/xpl-toolbar.entry.js +2 -2
- package/dist/esm/xpl-tooltip.entry.js +1 -1
- package/dist/esm/xpl-top-nav-item.entry.js +2 -2
- package/dist/esm/xpl-top-nav-menu.entry.js +2 -2
- package/dist/esm/xpl-top-nav.entry.js +5 -5
- package/dist/esm/xpl-utility-bar.entry.js +1 -1
- package/dist/types/components/xpl-table/utils/move-row-dom.d.ts +3 -0
- package/dist/types/components/xpl-table/utils/table-internal.d.ts +8 -0
- package/dist/types/components/xpl-table/xpl-table-cell/xpl-table-cell.d.ts +11 -0
- package/dist/types/components/xpl-table/xpl-table-header-cell/xpl-table-header-cell.d.ts +33 -0
- package/dist/types/components/xpl-table/xpl-table-row/xpl-table-row.d.ts +7 -0
- package/dist/types/components/xpl-table/xpl-table.d.ts +126 -22
- package/dist/types/components.d.ts +238 -60
- package/hydrate/index.js +1669 -265
- package/hydrate/index.mjs +1669 -265
- package/package.json +7 -7
- package/dist/apollo-core/p-056a99e4.entry.js +0 -1
- package/dist/apollo-core/p-068e3532.entry.js +0 -1
- package/dist/apollo-core/p-0a0a6e43.entry.js +0 -1
- package/dist/apollo-core/p-1a94c2d9.entry.js +0 -1
- package/dist/apollo-core/p-2faa7b9c.entry.js +0 -1
- package/dist/apollo-core/p-30b1b700.entry.js +0 -1
- package/dist/apollo-core/p-32084caf.entry.js +0 -1
- package/dist/apollo-core/p-38586952.entry.js +0 -1
- package/dist/apollo-core/p-50fae269.entry.js +0 -1
- package/dist/apollo-core/p-60cb3cfb.entry.js +0 -1
- package/dist/apollo-core/p-722b145a.entry.js +0 -1
- package/dist/apollo-core/p-75e5bfe0.entry.js +0 -1
- package/dist/apollo-core/p-77fe3cc1.entry.js +0 -1
- package/dist/apollo-core/p-83bb7607.entry.js +0 -1
- package/dist/apollo-core/p-8664d88b.entry.js +0 -1
- package/dist/apollo-core/p-8a925e9d.entry.js +0 -1
- package/dist/apollo-core/p-9064badb.entry.js +0 -1
- package/dist/apollo-core/p-969d5cca.entry.js +0 -1
- package/dist/apollo-core/p-99a79cf4.entry.js +0 -1
- package/dist/apollo-core/p-ae8a5f66.entry.js +0 -1
- package/dist/apollo-core/p-af8ebf49.entry.js +0 -1
- package/dist/apollo-core/p-b29025b2.entry.js +0 -1
- package/dist/apollo-core/p-b5a61076.entry.js +0 -1
- package/dist/apollo-core/p-bf7d8e18.entry.js +0 -1
- package/dist/apollo-core/p-c48e4884.entry.js +0 -1
- package/dist/apollo-core/p-cc57f20d.entry.js +0 -1
- package/dist/apollo-core/p-dca48977.entry.js +0 -1
- package/dist/apollo-core/p-e1833287.entry.js +0 -1
- package/dist/apollo-core/p-e2b73b60.entry.js +0 -1
- package/dist/apollo-core/p-e7e445b0.entry.js +0 -1
- package/dist/apollo-core/p-f1c103ff.entry.js +0 -1
- package/dist/apollo-core/p-ffc2f0cf.entry.js +0 -1
- package/dist/cjs/xpl-table-footer-cell.cjs.entry.js +0 -18
- package/dist/cjs/xpl-table-header-cell.cjs.entry.js +0 -59
- package/dist/collection/components/xpl-table-header-cell/xpl-table-header-cell.js +0 -190
- package/dist/components/p-9VnxPQLs.js +0 -1
- package/dist/components/p-B2oLZUDD.js +0 -1
- package/dist/components/p-BYYFsuD3.js +0 -1
- package/dist/components/p-BZtxVB1R.js +0 -1
- package/dist/components/p-CnVGKN63.js +0 -1
- package/dist/components/p-Cz7zDaI4.js +0 -1
- package/dist/components/p-D4rv6CNJ.js +0 -1
- package/dist/components/p-YG9Jza0y.js +0 -1
- package/dist/docs/xpl-table-header-cell/readme.md +0 -47
- package/dist/esm/xpl-table-footer-cell.entry.js +0 -16
- package/dist/esm/xpl-table-header-cell.entry.js +0 -57
- package/dist/types/components/xpl-table-header-cell/xpl-table-header-cell.d.ts +0 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as t,H as e,d as i,h as s,c as n,t as a}from"./p-BSHdGbmH.js";import{d as o}from"./p-xtOHikY0.js";import{d as r}from"./p-CnVGKN63.js";import{d as h}from"./p-YG9Jza0y.js";import{d as l}from"./p-DAb-txW3.js";import{d as c}from"./p-l3EZ-agL.js";import{i as p}from"./p-Dqb1pIRo.js";import{d}from"./p-BZtxVB1R.js";import{d as u}from"./p-JyNpXfDe.js";import{d as m}from"./p-U0JYwf4c.js";import{v as f}from"./p-CK3_k8jD.js";import{d as b}from"./p-BdpZR4KO.js";const x=(t,e,i)=>{const s=(i/=100)*(e/=100),n=s*(1-Math.abs(t/60%2-1)),a=i-s;let o=0,r=0,h=0;return t<60?(o=s,r=n,h=0):t<120?(o=n,r=s,h=0):t<180?(o=0,r=s,h=n):t<240?(o=0,r=n,h=s):t<300?(o=n,r=0,h=s):(o=s,r=0,h=n),{r:Math.round(255*(o+a)),g:Math.round(255*(r+a)),b:Math.round(255*(h+a))}},g=(t,e,i)=>[t,e,i].map((t=>t.toString(16).padStart(2,"0"))).join(""),C=t=>{if(t.startsWith("#")){if(!/^#([a-fA-F\d]{6})$/.test(t))throw new Error("xpl-input-color: Only 6-digit hex format supported (e.g. #aabbcc)");const e=t.toLowerCase().slice(1),i=parseInt(e.slice(0,2),16),s=parseInt(e.slice(2,4),16),n=parseInt(e.slice(4,6),16);return{hex:e,r:i,g:s,b:n,a:1}}if(t.startsWith("rgba")||t.startsWith("rgb")){const e=t.match(/[\d.]+/g)?.map(Number);if(!e||e.length<3)throw new Error("xpl-input-color: Invalid rgba/rgb format");const[i,s,n,a=1]=e,o=t=>t.toString(16).padStart(2,"0");return{hex:`${o(i)}${o(s)}${o(n)}`.toLowerCase(),r:i,g:s,b:n,a}}if(t.startsWith("hsla")||t.startsWith("hsl")){const e=t.match(/[\d.]+/g)?.map(Number);if(!e||e.length<3)throw new Error("xpl-input-color: Invalid hsla/hsl format");const[i,s,n,a=1]=e,o=((t,e,i,s)=>{i/=100;const n=e=>(e+t/30)%12,a=(e/=100)*Math.min(i,1-i),o=t=>i-a*Math.max(-1,Math.min(n(t)-3,Math.min(9-n(t),1)));return`rgba(${Math.round(255*o(0))}, ${Math.round(255*o(8))}, ${Math.round(255*o(4))}, ${s})`})(i,s,n,a),r=o.match(/[\d.]+/g)?.map(Number);if(!r||r.length<3)throw new Error("xpl-input-color: Invalid hsla/hsl format");const[h,l,c]=r;return{hex:g(h,l,c).toLowerCase(),r:h,g:l,b:c,a}}throw new Error("xpl-input-color: Unsupported color format")},y=t=>t.a&&1!==t.a?`rgba(${t.r}, ${t.g}, ${t.b}, ${t.a})`:`#${t.hex}`,v=[{countryCode:"US",dialCode:"+1",name:"United States"},{countryCode:"CA",dialCode:"+1",name:"Canada"},{countryCode:"GB",dialCode:"+44",name:"United Kingdom"},{countryCode:"AU",dialCode:"+61",name:"Australia"},{countryCode:"DE",dialCode:"+49",name:"Germany"},{countryCode:"FR",dialCode:"+33",name:"France"},{countryCode:"ES",dialCode:"+34",name:"Spain"},{countryCode:"IT",dialCode:"+39",name:"Italy"},{countryCode:"NL",dialCode:"+31",name:"Netherlands"},{countryCode:"BE",dialCode:"+32",name:"Belgium"},{countryCode:"AT",dialCode:"+43",name:"Austria"},{countryCode:"CH",dialCode:"+41",name:"Switzerland"},{countryCode:"PL",dialCode:"+48",name:"Poland"},{countryCode:"IE",dialCode:"+353",name:"Ireland"},{countryCode:"PT",dialCode:"+351",name:"Portugal"},{countryCode:"SE",dialCode:"+46",name:"Sweden"},{countryCode:"NO",dialCode:"+47",name:"Norway"},{countryCode:"DK",dialCode:"+45",name:"Denmark"},{countryCode:"FI",dialCode:"+358",name:"Finland"},{countryCode:"NZ",dialCode:"+64",name:"New Zealand"},{countryCode:"JP",dialCode:"+81",name:"Japan"},{countryCode:"CN",dialCode:"+86",name:"China"},{countryCode:"IN",dialCode:"+91",name:"India"},{countryCode:"BR",dialCode:"+55",name:"Brazil"},{countryCode:"MX",dialCode:"+52",name:"Mexico"},{countryCode:"ZA",dialCode:"+27",name:"South Africa"},{countryCode:"SG",dialCode:"+65",name:"Singapore"},{countryCode:"HK",dialCode:"+852",name:"Hong Kong"},{countryCode:"KR",dialCode:"+82",name:"South Korea"}];function $(t){return v.find((e=>e.countryCode===t))}function k(t){return(t||"").replace(/\D/g,"")}function E(t){switch(t){case"US":case"CA":case"MX":case"JP":case"IN":case"KR":return 10;case"GB":case"DE":case"AT":case"CH":case"BR":case"CN":return 11;case"AU":case"FR":return 9;default:return 15}}function w(t,e){if(!t)return"";const i=t.replace(/\D/g,"");switch(e){case"US":case"CA":return function(t){const e=Math.min(t.length,10);return e<=3?t.slice(0,e):e<=6?`${t.slice(0,3)} ${t.slice(3,e)}`:`${t.slice(0,3)} ${t.slice(3,6)} ${t.slice(6,e)}`}(i);case"GB":return function(t){const e=Math.min(t.length,11);return e<=4?t.slice(0,e):e<=7?`${t.slice(0,4)} ${t.slice(4,e)}`:`${t.slice(0,4)} ${t.slice(4,7)} ${t.slice(7,e)}`}(i);case"AU":return function(t){const e=Math.min(t.length,9);return e<=1?t.slice(0,e):e<=4?`${t.slice(0,1)} ${t.slice(1,e)}`:e<=7?`${t.slice(0,1)} ${t.slice(1,4)} ${t.slice(4,e)}`:`${t.slice(0,1)} ${t.slice(1,4)} ${t.slice(4,7)} ${t.slice(7,e)}`}(i);case"DE":case"AT":case"CH":return function(t){const e=Math.min(t.length,11);return e<=3?t.slice(0,e):`${t.slice(0,3)} ${t.slice(3,e)}`}(i);case"FR":return function(t){const e=Math.min(t.length,9),i=[];let s=0;for(e>0&&(i.push(t.slice(0,1)),s=1);s<e&&s+2<=e;)i.push(t.slice(s,s+2)),s+=2;return s<e&&i.push(t.slice(s)),i.join(" ")}(i);case"BR":return function(t){const e=Math.min(t.length,11);return e<=2?e?`(${t}`:"":e<=6||7===e?`(${t.slice(0,2)}) ${t.slice(2,e)}`:`(${t.slice(0,2)}) ${t.slice(2,7)}-${t.slice(7,e)}`}(i);case"MX":return function(t){const e=Math.min(t.length,10);return e<=3?t.slice(0,e):e<=6?`${t.slice(0,3)} ${t.slice(3,e)}`:`${t.slice(0,3)} ${t.slice(3,6)} ${t.slice(6,e)}`}(i);case"JP":return function(t){const e=Math.min(t.length,10);return e<=3?t.slice(0,e):e<=7?`${t.slice(0,3)}-${t.slice(3,e)}`:`${t.slice(0,3)}-${t.slice(3,7)}-${t.slice(7,e)}`}(i);case"CN":return function(t){const e=Math.min(t.length,11);return e<=3?t.slice(0,e):e<=7?`${t.slice(0,3)} ${t.slice(3,e)}`:`${t.slice(0,3)} ${t.slice(3,7)} ${t.slice(7,e)}`}(i);case"IN":return function(t){const e=Math.min(t.length,10);return e<=5?t.slice(0,e):`${t.slice(0,5)} ${t.slice(5,e)}`}(i);case"KR":return function(t){const e=Math.min(t.length,10);return e<=3?t.slice(0,e):e<=7?`${t.slice(0,3)} ${t.slice(3,e)}`:`${t.slice(0,3)} ${t.slice(3,7)} ${t.slice(7,e)}`}(i);default:return function(t){const e=t.length;if(e<=3)return t;const i=[];let s=0;for(;s<e;){const n=e-s>=4?4:3;i.push(t.slice(s,s+n)),s+=n}return i.join(" ")}(i)}}function S(t){const[e,i]=t.split(":"),s=Number(e)>=12?"PM":"AM";return[(Number(e)%12||12).toString(),i,s]}const _=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.valueChange=i(this,"valueChange",7),this.hasErrorStateChanged=i(this,"hasErrorStateChanged",7),this.max="23:59",this.min="00:00",this.step=30,this.mode="single",this.timeFormat="24h",this.allowCustomOption=!1,this.showOptions=!1,this.options=[],this.handleInput=t=>{const e=t.target,i=e.value?.replace(/[^0-9:apmAPM]/g,"");this.value=i},this.handleFocus=()=>{this.showOptions=!0},this.handleBlur=()=>{const t=function(t){if(!t||""===t.trim()||0===t.replace(/[^0-9]/g,"").length)return null;let e=t.trim().toLowerCase();e=e.replace(/(\d)\s+(am|pm)/g,"$1$2"),/^\d{1,2}(am|pm)?$/.test(e)&&(e=e.replace(/(am|pm)?$/,":00$1")),/^\d{1,2}$/.test(e)&&(e=`${e}:00`),/^\d{1,2}:\d{1}$/.test(e)&&(e=`${e}0`);const[i,s]=e.split(":"),n=s.replace(/[^0-9]/g,""),a=e.includes("am");return e.includes("pm")||a?a?`${(Number(i)%12).toString().padStart(2,"0")}:${n}`:`${Number(i)%12+12}:${n}`:`${i.padStart(2,"0")}:${n}`}(this.value??"");this.value=t??void 0},this.handleClick=()=>{this.showOptions=!0}}onValueChange(t){this.valueChange.emit(t),this.updateState(t)}updateState(t){this.formattedValue=this.formatDisplayedTime(t),this.amPm=this.formatDisplayedAmPm(t),this.validateValue()}formatDisplayedTime(t){if(!t)return"";if("12h"===this.timeFormat&&t.includes(":")){const[e,i]=S(t);return`${e}:${i}`}return t}formatDisplayedAmPm(t){if(!t||"12h"!==this.timeFormat)return"";const[,,e]=S(t);return e}validateValue(){if(!this.value)return void(this.hasErrorState=this.required?"required":null);if(!this.value.includes(":")||this.value.trim().length<4||this.value.trim().length>5)return void(this.hasErrorState="Invalid time format, must be HH:MM");const t=String(this.min??"00:00"),e=String(this.max??"23:59");this.hasErrorState=this.value<t||this.value>e?"Out of range":this.allowCustomOption||this.options.some((t=>t.value===this.value))?null:"Invalid option"}onHasErrorStateChanged(t){this.hasErrorStateChanged.emit(t)}componentDidLoad(){"range"===this.mode&&console.warn("Range mode is not supported for time inputs at this time."),this.dropdown?.addEventListener("isOpenChange",(t=>{this.showOptions=t.detail}))}componentWillLoad(){this.options=this.getOptions(),this.value&&this.updateState(this.value)}getOptions(){return function(t,e,i,s){const n=t=>{const[e,i]=t.split(":").map(Number);return 60*e+i},a=n(e.toString()),o=n(i.toString()),r=[];for(let e=a;e<=o;e+=t)r.push((h=e,`${Math.floor(h/60).toString().padStart(2,"0")}:${(h%60).toString().padStart(2,"0")}`));var h;return r.map((t=>({label:"12h"===s?function(t){const[e,i,s]=S(t);return`${e}:${i} ${s}`}(t):t,value:t})))}(this.step,String(this.min??"00:00"),String(this.max??"23:59"),this.timeFormat??"24h").map((({label:t,value:e})=>({label:t,value:e,onClick:()=>{this.value=e,this.showOptions=!1}})))}render(){return s(n,{key:"5494cc0a537152b9d8dfa03e5281b21e6bb6eee2",class:{"xpl-input-time":!0,[`xpl-input-time--mode-${this.mode}`]:!0,"xpl-input-time--error":!!this.hasErrorState}},s("xpl-input",{key:"0d32784cd9fc8acacae1854a966bb426fa135fb5",pre:s("xpl-icon",{class:"xpl-input-time__clock-icon",icon:"clock",size:24}),post:"12h"===this.timeFormat?this.amPm||"AM":void 0,type:"text",_id:this.inputId,disabled:this.disabled,name:this.name,required:this.required,readonly:this.readonly,placeholder:this.placeholder,max:this.max,min:this.min,onInput:this.handleInput,value:this.formattedValue,onFocusEvent:this.handleFocus,onBlurEvent:this.handleBlur,onClick:this.handleClick}),!this.readonly&&!this.disabled&&s("xpl-dropdown",{key:"206c668ca8ee29ceffaf14f14acd90fb076fc0ae",options:this.options,isOpen:this.showOptions,ref:t=>{this.dropdown=t??void 0},class:"xpl-input-time__dropdown"}))}static get watchers(){return{value:[{onValueChange:0}],hasErrorState:[{onHasErrorStateChanged:0}]}}},[0,"xpl-input-time",{inputId:[1,"input-id"],disabled:[4],name:[1],required:[4],readonly:[4],value:[1537],placeholder:[1],max:[8],min:[8],step:[2],mode:[1],timeFormat:[1,"time-format"],allowCustomOption:[4,"allow-custom-option"],formattedValue:[32],hasErrorState:[32],showOptions:[32],options:[32],amPm:[32]},void 0,{value:[{onValueChange:0}],hasErrorState:[{onHasErrorStateChanged:0}]}]);function M(){"undefined"!=typeof customElements&&["xpl-input-time","xpl-dropdown","xpl-dropdown-group","xpl-dropdown-heading","xpl-dropdown-option","xpl-icon","xpl-input","xpl-input-color","xpl-input-date","xpl-input-file","xpl-input-phone","xpl-input-search","xpl-input-time"].forEach((t=>{switch(t){case"xpl-input-time":customElements.get(a(t))||customElements.define(a(t),_);break;case"xpl-dropdown":customElements.get(a(t))||o();break;case"xpl-dropdown-group":customElements.get(a(t))||r();break;case"xpl-dropdown-heading":customElements.get(a(t))||h();break;case"xpl-dropdown-option":customElements.get(a(t))||l();break;case"xpl-icon":customElements.get(a(t))||c();break;case"xpl-input":customElements.get(a(t))||P();break;case"xpl-input-color":customElements.get(a(t))||A();break;case"xpl-input-date":customElements.get(a(t))||d();break;case"xpl-input-file":customElements.get(a(t))||u();break;case"xpl-input-phone":customElements.get(a(t))||F();break;case"xpl-input-search":customElements.get(a(t))||m();break;case"xpl-input-time":customElements.get(a(t))||M()}}))}function I(t){return t.toLowerCase().replace(/ /g,"-")}const D=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.hasErrorStateChanged=i(this,"hasErrorStateChanged",7),this.valueChange=i(this,"valueChange",7),this.lastCursorRef=0,this.lastFormattedRef="",this.dropdownOpen=!1,this.hasErrorState=null,this.nationalNumber="",this.searchQuery="",this.triggerId=`xpl-input-phone-trigger-${f()}`,this.defaultCountry="US",this.isInternational=!0,this.handleTriggerClick=()=>{this.isEditable&&(this.dropdownOpen=!this.dropdownOpen)},this.handleNumberInput=t=>{const e=t.target,i=e.value||"";let s;if(this.lastCursorRef=e.selectionStart??0,this.lastFormattedRef=i,this.isInternational&&i.startsWith("+")){const t=k(i),e=this.effectiveDialCode.slice(1).replace(/\D/g,"");s=e&&t.startsWith(e)?t.slice(e.length):t}else s=k(i);const n=E(this.effectiveCountryCode);s.length>n&&(s=s.slice(0,n)),this.nationalNumber=s,this.emitValue(),e.value=this.displayValue},this.handleClear=()=>{this.nationalNumber="",this.emitValue(),this.inputEl?.focus()},this.handleDropdownUpdate=(t,{component:e})=>{const i=e??this.dropdownRef;if(!i)return;const{options:s}=i;if(s?.length){const t=s.reduce(((t,e)=>[...t,...e.groupName?e.options??[]:[e]]),[]).find((t=>t.isSelected));if(t?.value){const e=$(t.value);e&&(this.selectedCountry=e,this.emitValue(),this.inputEl?.focus())}}}}onDropdownOpenChange(t){t&&(this.searchQuery="")}onHasErrorStateChanged(t){this.hasErrorStateChanged.emit(t)}onValueChange(t){if(null==t||""===t){const t=$(this.defaultCountry??"US")||v[0];return this.selectedCountry=t,void(this.nationalNumber="")}const e=function(t){if(!t||!t.startsWith("+"))return null;const e=t.slice(1).replace(/\D/g,"");if(!e.length)return null;const i=[...v].sort(((t,e)=>e.dialCode.replace(/\D/g,"").length-t.dialCode.replace(/\D/g,"").length)).find((t=>{const i=t.dialCode.slice(1).replace(/\D/g,"");return e.startsWith(i)}));if(!i)return null;const s=i.dialCode.slice(1).replace(/\D/g,""),n=e.slice(s.length);return{dialCode:i.dialCode,nationalNumber:n}}(t);if(e)if(this.selectedCountry?.dialCode===e.dialCode)this.nationalNumber=e.nationalNumber;else{const t=$(this.defaultCountry??"US"),s=(t?.dialCode===e.dialCode?t:void 0)??(i=e.dialCode,v.find((t=>t.dialCode===i)));s&&(this.selectedCountry=s,this.nationalNumber=e.nationalNumber)}else this.selectedCountry||(this.selectedCountry=$(this.defaultCountry??"US")||v[0]);var i}componentWillLoad(){this.value?this.onValueChange(this.value):this.selectedCountry=$(this.defaultCountry??"US")||v[0]}componentDidUpdate(){if(this.inputEl&&this.lastFormattedRef&&"function"==typeof this.inputEl.setSelectionRange){const t=function(t,e,i){if(i>=t.length)return e.length;const s=k(t.slice(0,i)).length;let n=0,a=0;for(let t=0;t<e.length;t+=1){if(/\d/.test(e[t])&&(a+=1,a>=s)){n=t+(a===s?1:0);break}n=t+1}return Math.min(n,e.length)}(this.lastFormattedRef,this.displayValue,this.lastCursorRef);this.inputEl.setSelectionRange(t,t),this.lastFormattedRef=""}else this.inputEl&&this.lastFormattedRef&&(this.lastFormattedRef="")}get effectiveCountryCode(){return this.selectedCountry?.countryCode??this.defaultCountry??"US"}get effectiveDialCode(){return this.selectedCountry?.dialCode??"+1"}get isEditable(){return!this.disabled&&!this.readonly}get orderedCountries(){const t=this.preferredCountries||[],e=v.filter((e=>!t.includes(e.countryCode)));return[...t.map((t=>$(t))).filter((t=>void 0!==t)),...e]}get filteredCountries(){const t=this.searchQuery.trim().toLowerCase();return t?this.orderedCountries.filter((e=>e.name.toLowerCase().includes(t)||e.dialCode.includes(t)||e.countryCode.toLowerCase().includes(t))):this.orderedCountries}get displayValue(){return this.nationalNumber?w(this.nationalNumber,this.effectiveCountryCode):""}get effectivePlaceholder(){if(this.placeholder)return this.placeholder;const t=this.selectedCountry;return t?function(t){switch(t){case"US":case"CA":case"MX":default:return"000 000 0000";case"GB":return"0000 000 0000";case"AU":return"0 000 000 000";case"DE":case"AT":case"CH":return"000 0000000";case"FR":return"0 00 00 00 00";case"BR":return"00 00000 0000";case"JP":case"CN":case"KR":return"000 0000 0000";case"IN":return"00000 00000"}}(t.countryCode):""}get dropdownOptions(){return this.filteredCountries.map((t=>({icon:I(t.name),label:`${t.name} (${t.dialCode})`,value:t.countryCode,isSelected:this.selectedCountry?.countryCode===t.countryCode})))}get maxInputLength(){const t=E(this.effectiveCountryCode);return w("9".repeat(t),this.effectiveCountryCode).length}emitValue(){const t=this.nationalNumber?function(t,e){const i=(t.slice(1)+e).replace(/\D/g,"");return i.length?`+${i}`:""}(this.effectiveDialCode,this.nationalNumber):"";this.value=t||void 0,this.valueChange.emit(t||""),this.validate()}validate(){this.hasErrorState=!this.required||this.nationalNumber.trim()?null:"required"}render(){return s(n,{key:"124c8feabed1cf383f2eb65e77dd2517c96ea01c",class:{"xpl-input-phone":!0,"xpl-input-phone--error":!!this.hasErrorState||!!this.error,"xpl-input-phone--open":this.dropdownOpen,"xpl-input-phone--domestic":!this.isInternational}},s("div",{key:"6b2a17efd488aa18ac8dea1e86d12884ceb51e90",class:"xpl-input-wrapper"},this.isInternational&&s("button",{key:"d3f8e42841532f8c37a131545007af3213c1b9e0",type:"button",id:this.triggerId,class:"xpl-input-phone__trigger",disabled:this.disabled,"aria-haspopup":"listbox","aria-expanded":this.dropdownOpen?"true":"false","aria-label":"Select country",onClick:this.handleTriggerClick},this.selectedCountry?.name&&s("xpl-icon",{key:"cb52527ba28d95a93cba734bb6d1b3ab8e14a388",class:"xpl-input-phone__flag",icon:I(this.selectedCountry.name),size:24,"aria-hidden":"true"}),s("xpl-icon",{key:"7942dae0973871635b7b64e0697d8c25352ac3bf",class:"xpl-input-phone__trigger-icon",icon:"chevron-down",size:20,"aria-hidden":"true"})),s("div",{key:"24b810a9e03c7774ad6576cc9f03888d5da9d3aa",class:"xpl-input-phone__input-wrap"},this.isInternational&&s("span",{key:"eb7684aad427a10615c23326a2a2628a4a12fbb0",class:"xpl-input-phone__dial-code"},this.effectiveDialCode),s("input",{key:"8e429f156e36f101413e1d5168bb38a2ca9bdebf",ref:t=>{this.inputEl=t??void 0},type:"tel",id:this.inputId,class:"xpl-input-phone__input",name:this.name,disabled:this.disabled,readonly:this.readonly,required:this.required,"aria-invalid":this.hasErrorState||this.error?"true":"false",placeholder:this.effectivePlaceholder,autocomplete:this.isInternational?"tel-national":"tel",inputmode:"numeric",maxlength:this.maxInputLength,value:this.displayValue,onInput:this.handleNumberInput}),this.nationalNumber&&this.isEditable&&s("button",{key:"403e1b9e35a7bfd2ba356c16c4d5e9178541f876",type:"button",class:"xpl-input-phone__clear","aria-label":"Clear phone number",onClick:this.handleClear},s("xpl-icon",{key:"aee1381d3a7dcec64c708ecfa67266eef442850e",icon:"x-circle",size:16})))),this.isInternational&&this.isEditable&&s("xpl-dropdown",{key:"9d14a65f3ac538b4e420151927a0c349adf3688d",ref:t=>{this.dropdownRef=t??void 0},isOpen:this.dropdownOpen,triggerId:this.triggerId,anchorToTrigger:!0,closeOnSelect:!0,mode:"single",options:this.dropdownOptions,update:this.handleDropdownUpdate,onIsOpenChange:t=>{this.dropdownOpen=t.detail},"aria-label":"Country"},s("div",{key:"87006a8a90ef37032775247a387896f065ce5673",slot:"header",class:"xpl-input-phone__search-wrap"},s("xpl-input",{key:"26a99c318081e3215fa779191ee8a0f9c127489f",class:"xpl-input-phone__search",type:"text",label:"",placeholder:"Search",value:this.searchQuery,autocomplete:"off",onInputEvent:t=>{this.searchQuery=t.detail??""}},s("xpl-icon",{key:"4aee182e975ed805524ac93e3a34f055266b693b",slot:"pre",class:"xpl-input-phone__search-icon",icon:"magnifier",size:20})))))}get el(){return this}static get watchers(){return{dropdownOpen:[{onDropdownOpenChange:0}],hasErrorState:[{onHasErrorStateChanged:0}],value:[{onValueChange:0}]}}},[0,"xpl-input-phone",{defaultCountry:[1,"default-country"],disabled:[4],error:[4],inputId:[1,"input-id"],isInternational:[4,"is-international"],name:[1],placeholder:[1],preferredCountries:[16],readonly:[4],required:[4],value:[1537],dropdownOpen:[32],hasErrorState:[32],nationalNumber:[32],searchQuery:[32],selectedCountry:[32],triggerId:[32]},void 0,{dropdownOpen:[{onDropdownOpenChange:0}],hasErrorState:[{onHasErrorStateChanged:0}],value:[{onValueChange:0}]}]);function F(){"undefined"!=typeof customElements&&["xpl-input-phone","xpl-dropdown","xpl-dropdown-group","xpl-dropdown-heading","xpl-dropdown-option","xpl-icon","xpl-input","xpl-input-color","xpl-input-date","xpl-input-file","xpl-input-phone","xpl-input-search","xpl-input-time"].forEach((t=>{switch(t){case"xpl-input-phone":customElements.get(a(t))||customElements.define(a(t),D);break;case"xpl-dropdown":customElements.get(a(t))||o();break;case"xpl-dropdown-group":customElements.get(a(t))||r();break;case"xpl-dropdown-heading":customElements.get(a(t))||h();break;case"xpl-dropdown-option":customElements.get(a(t))||l();break;case"xpl-icon":customElements.get(a(t))||c();break;case"xpl-input":customElements.get(a(t))||P();break;case"xpl-input-color":customElements.get(a(t))||A();break;case"xpl-input-date":customElements.get(a(t))||d();break;case"xpl-input-file":customElements.get(a(t))||u();break;case"xpl-input-phone":customElements.get(a(t))||F();break;case"xpl-input-search":customElements.get(a(t))||m();break;case"xpl-input-time":customElements.get(a(t))||M()}}))}const N={hex:"",r:0,g:0,b:0,a:1},O=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.inputChange=i(this,"inputChange",7),this.hasErrorStateChanged=i(this,"hasErrorStateChanged",7),this.placeholder="Select color",this.eyeDropperSupported=!1,this.colorInputElements={},this.handleMove=t=>{const{slGrid:e}=this.colorInputElements;if(!e)return;const i=e.getBoundingClientRect(),s="touches"in t?t.touches[0].clientY:t.clientY,n=Math.max(0,Math.min(("touches"in t?t.touches[0].clientX:t.clientX)-i.left,i.width)),a=Math.max(0,Math.min(s-i.top,i.height)),o=n/i.width,r=a/i.height,h=x(this.hue,100,100),l=(255*(1-o)+o*h.r)*(1-r),c=(255*(1-o)+o*h.g)*(1-r),p=(255*(1-o)+o*h.b)*(1-r),d={r:Math.round(l),g:Math.round(c),b:Math.round(p),hex:g(Math.round(l),Math.round(c),Math.round(p)),a:this.colorValues.a};this.colorValues=d},this.startDrag=t=>{t.preventDefault(),this.handleMove(t),window.addEventListener("mousemove",this.handleMove),window.addEventListener("mouseup",this.stopDrag),window.addEventListener("touchmove",this.handleMove),window.addEventListener("touchend",this.stopDrag)},this.stopDrag=()=>{window.removeEventListener("mousemove",this.handleMove),window.removeEventListener("mouseup",this.stopDrag),window.removeEventListener("touchmove",this.handleMove),window.removeEventListener("touchend",this.stopDrag)},this.onHexInputChange=t=>{const e=t.detail?t.detail.trim().replace(/#/g,""):"";if(e){const[t,i,s]=(t=>{const e=t?.match(/\w\w/g);return e?e.map((t=>parseInt(t,16))):[0,0,0]})(e);this.colorValues={hex:e,r:t,g:i,b:s,a:this.colorValues.a??1}}else this.colorValues={...N}},this.onRgbaInputChange=(t,e)=>{const i=parseFloat(e.detail);if(Number.isNaN(i))return void(this.hasErrorState=`invalid value from ${t.name}: ${i}`);const s={...this.colorValues};switch(t.name){case"color-r-input":s.r=i;break;case"color-g-input":s.g=i;break;case"color-b-input":s.b=i;break;case"color-a-input":s.a=i;break;default:this.hasErrorState=`unhandled input: ${t.name}`}s.hex=g(s.r,s.g,s.b),this.colorValues=s},this.onSliderInputChange=t=>{const e=parseFloat(t.value);if(Number.isNaN(e))this.hasErrorState=`invalid value from ${t.name}: ${e}`;else switch(t.name){case"color-hue-slider":this.colorValues=C(`hsla(${e}, 100%, 50%, 1)`),this.hue=e;break;case"color-alpha-slider":this.colorValues={...this.colorValues,a:e};break;default:this.hasErrorState=`unhandled input: ${t.name}`}}}valueChanged(t){this.hasErrorState=this.required&&!t.hex?"required":null,this.inputChange.emit(t.hex?y(t):"")}onHasErrorStateChanged(t){this.hasErrorStateChanged.emit(t)}onValuePropChange(t){this.syncColorFromValue(t)}syncColorFromValue(t){if(t)try{this.colorValues=C(t),this.hue=(()=>{const t=this.colorValues.r/255,e=this.colorValues.g/255,i=this.colorValues.b/255,s=Math.max(t,e,i),n=Math.min(t,e,i),a=s-n;let o=0,r=0;const h=(s+n)/2;if(0!==a){switch(r=a/(1-Math.abs(2*h-1)),s){case t:o=(e-i)/a%6;break;case e:o=(i-t)/a+2;break;case i:o=(t-e)/a+4}o*=60,o<0&&(o+=360)}return{hue:Math.round(o),saturation:Math.round(100*r),lightness:Math.round(100*h)}})().hue}catch{this.hasErrorState="invalid color format",this.hue=0}else this.colorValues={...N},this.hasErrorState=null,this.hue=0}componentWillLoad(){this.syncColorFromValue(this.value)}componentDidLoad(){p()&&(this.eyeDropperSupported="EyeDropper"in window);const{r:t,g:e,b:i,a:s,hue:n,alpha:a,hex:o}=this.colorInputElements;o?.addEventListener("valueChange",(t=>{this.onHexInputChange(t),t.stopPropagation()})),[t,e,i,s].forEach((t=>{t?.addEventListener("valueChange",(e=>{this.onRgbaInputChange(t,e),e.stopPropagation()}))})),[n,a].forEach((t=>{t?.addEventListener("input",(()=>{this.onSliderInputChange(t)}))}))}async openEyeDropper(){try{const t=window.EyeDropper;if(!t)throw new Error("EyeDropper API is not available");const e=new t,i=await e.open();this.colorValues=C(i.sRGBHex)}catch(t){this.hasErrorState=`eyedropper cancelled or failed: ${t}`}}render(){const{r:t,g:e,b:i,a}=this.colorValues,o=x(this.hue,100,100),{x:r,y:h}=((t,e,i,s)=>{const{s:n,v:a}=((t,e,i,s)=>{t/=255,e/=255,i/=255;const n=Math.max(t,e,i),a=n-Math.min(t,e,i);let o=0;return o=0===a?0:n===t?(e-i)/a%6:n===e?(i-t)/a+2:(t-e)/a+4,o=Math.round(60*o),o<0&&(o+=360),{h:s??o,s:0===n?0:a/n,v:n}})(e.r,e.g,e.b,t);return{x:Math.round(n*i),y:Math.round((1-a)*s)}})(this.hue,{r:t,g:e,b:i},288,160),l={left:`${r}px`,top:`${h}px`,background:`rgb(${t}, ${e}, ${i})`};return s(n,{key:"2c4bff1c1b56afdc1b4192a2d7c1e0a1f5ebc073",class:"xpl-input-color"},s("xpl-popover",{key:"ba545a5022a532ef2fde8c795bee19f2680514c1",disabled:this.disabled,display:"menu"},s("div",{key:"180e066079da1a97ba31bcaf66d443df8a0c48ca",slot:"trigger"},s("div",{key:"c3cc0cb1484c4111b60b736b750571552437d0cf",class:{"xpl-input-color__display":!0,"xpl-input-color__display--disabled":!!this.disabled,"xpl-input-color__display--error":!!this.hasErrorState}},s("span",{key:"72aaff4e9a54da1f766d1de85bd58216c866a4b7",class:"xpl-input-color__color",style:{background:y(this.colorValues)}}),this.colorValues.hex?s("span",{class:"xpl-input-color__value"},y(this.colorValues)):s("span",{class:"xpl-input-color__placeholder"},this.placeholder),this.eyeDropperSupported&&!this.hideEyeDropper&&s("xpl-icon",{key:"f55cfde9a119e9f0de379bc1bfb5b5d4b53aa992",size:20,icon:"eye-dropper",class:"xpl-input-color__icon",onClick:t=>{t.stopPropagation(),this.openEyeDropper()}}))),s("div",{key:"f80f215000d3a906d65f7f6673c6d8eaabe3fc6d",class:"xpl-input-color__menu"},s("div",{key:"4701c99f8a528900c34005b7c26d9fa544b664d8",class:"xpl-input-color__sl-grid",ref:t=>{this.colorInputElements.slGrid=t??void 0},style:{background:["linear-gradient(to top, #000, #0000)","linear-gradient(to right, #fff, #fff0)",`rgb(${o.r} ${o.g} ${o.b})`].join(", ")},onMouseDown:this.startDrag,onTouchStart:this.startDrag},s("div",{key:"3e0ec5c0821dfed35190053f5e4f147cb7b55eb0",class:"xpl-input-color__sl-thumb",style:l})),s("div",{key:"1b278a13c88aa663a2b8217fbc3524ee213e0f3b",class:"xpl-input-color__grid"},s("input",{key:"5e35bdd6e7776848a2d2eb32a00deb3ec349c21d",type:"range",min:"0",max:"360",value:this.hue,class:"xpl-input-color__slider xpl-input-color__hue",name:"color-hue-slider",ref:t=>{this.colorInputElements.hue=t??void 0}}),s("input",{key:"1119341201878e5c8511fa3e241afba15eab6d9b",type:"range",min:"0",max:"1",step:"0.01",value:a,class:"xpl-input-color__slider xpl-input-color__alpha",name:"color-alpha-slider",ref:t=>{this.colorInputElements.alpha=t??void 0},style:{backgroundImage:[`linear-gradient(to right, rgb(${t} ${e} ${i} / 0) 0%, rgb(${t} ${e} ${i} / 1) 100%)`,"linear-gradient(45deg, #ccc 25%, transparent 25%)","linear-gradient(-45deg, #ccc 25%, transparent 25%)","linear-gradient(45deg, transparent 75%, #ccc 75%)","linear-gradient(-45deg, transparent 75%, #ccc 75%)"].join(", ")}}),s("div",{key:"3804928b107e92bddbc3afa3fa883caafddbd06b",class:"xpl-input-color__preview",style:{background:`rgba(${t}, ${e}, ${i}, ${a})`}})),s("div",{key:"86961ee31d82724a76f6598bd547c8e650e27f24",class:"xpl-input-color__inputs"},["hex","r","g","b","a"].map((t=>s("xpl-input",{key:t,label:t.toLocaleUpperCase(),name:`color-${t}-input`,placeholder:"hex"===t?"793EF7":"0",value:String(this.colorValues[t]),ref:e=>{this.colorInputElements[t]=e??void 0}})))))))}static get watchers(){return{colorValues:[{valueChanged:0}],hasErrorState:[{onHasErrorStateChanged:0}],value:[{onValuePropChange:0}]}}},[0,"xpl-input-color",{value:[1],placeholder:[1],disabled:[4],required:[4],hideEyeDropper:[4,"hide-eye-dropper"],hasErrorState:[32],colorValues:[32],eyeDropperSupported:[32],hue:[32]},void 0,{colorValues:[{valueChanged:0}],hasErrorState:[{onHasErrorStateChanged:0}],value:[{onValuePropChange:0}]}]);function A(){"undefined"!=typeof customElements&&["xpl-input-color","xpl-icon","xpl-input","xpl-input-color","xpl-input-date","xpl-input-file","xpl-input-phone","xpl-input-search","xpl-input-time","xpl-popover"].forEach((t=>{switch(t){case"xpl-input-color":customElements.get(a(t))||customElements.define(a(t),O);break;case"xpl-icon":customElements.get(a(t))||c();break;case"xpl-input":customElements.get(a(t))||P();break;case"xpl-input-color":customElements.get(a(t))||A();break;case"xpl-input-date":customElements.get(a(t))||d();break;case"xpl-input-file":customElements.get(a(t))||u();break;case"xpl-input-phone":customElements.get(a(t))||F();break;case"xpl-input-search":customElements.get(a(t))||m();break;case"xpl-input-time":customElements.get(a(t))||M();break;case"xpl-popover":customElements.get(a(t))||b()}}))}const V=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.blurEvent=i(this,"blurEvent",7),this.focusEvent=i(this,"focusEvent",7),this.inputEvent=i(this,"inputEvent",7),this.search=i(this,"search",7),this.valueChange=i(this,"valueChange",7),this.multiline=!1,this.dateFormat="Y-m-d",this.timeFormat="24h",this.allowCustomOption=!1,this.mode="single",this.accept="",this.multiple=!1,this.hideTriggerOnSelect=!1,this.hideFileNames=!1,this.hideAcceptText=!1,this.defaultCountry="US",this.isInternational=!0,this.ariaLabel="",this.type="text",this.handleChildValueChange=t=>{t.stopPropagation(),this.valueChange.emit(t.detail)},this.valueChanged=t=>{this.valueChange.emit(t.target.value)},this.characterCount=0,this.passwordVisible=!1,this.hasPreSlotContent=!1,this.handleBlur=t=>{this.blurEvent.emit(t)},this.handleFocus=t=>{this.focusEvent.emit(t)},this.handleInput=t=>{this.multiline&&this.updateCharacterCount();const{value:e}=t.target;this.inputEvent.emit(e)},this.handleSearchBlurForward=t=>{const{detail:e}=t;e&&(t.stopPropagation(),this.blurEvent.emit(e))},this.handleSearchCommit=t=>{t.stopPropagation(),this.search.emit(t.detail)},this.handleSearchFocusForward=t=>{const{detail:e}=t;e&&(t.stopPropagation(),this.focusEvent.emit(e))}}connectedCallback(){this.syncPreSlotContent(),this.connectPreSlotObserver()}disconnectedCallback(){void 0!==this.preSlotSyncTimeoutId&&(clearTimeout(this.preSlotSyncTimeoutId),this.preSlotSyncTimeoutId=void 0),this.disconnectPreSlotObserver()}componentWillLoad(){null!=this._id&&""!==this._id||(this._id=f()),this.multiline&&void 0!==this.maxCharacterCount&&(this.characterCount=void 0!==this.value?this.value.length:0),this.syncPreSlotContent()}componentWillRender(){this.disconnectPreSlotObserver()}componentDidRender(){this.schedulePreSlotSync()}async setFocus(){"search"!==this.type?this.input?.focus():await(this.searchInputRef?.setFocus())}connectPreSlotObserver(){this.disconnectPreSlotObserver(),this.multiline||"search"===this.type||"undefined"==typeof MutationObserver||(this.preSlotObserver=new MutationObserver((()=>{this.schedulePreSlotSync()})),this.preSlotObserver.observe(this.el,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["slot"]}))}disconnectPreSlotObserver(){this.preSlotObserver?.disconnect(),this.preSlotObserver=void 0}schedulePreSlotSync(){void 0!==this.preSlotSyncTimeoutId&&clearTimeout(this.preSlotSyncTimeoutId),this.preSlotSyncTimeoutId=setTimeout((()=>{this.preSlotSyncTimeoutId=void 0,this.el.isConnected&&(this.syncPreSlotContent(),this.connectPreSlotObserver())}),0)}syncPreSlotContent(){if(this.multiline||"search"===this.type)return;const t=Array.from(this.el.querySelectorAll('[slot="pre"]')).some((t=>t.closest("xpl-input")===this.el));t!==this.hasPreSlotContent&&(this.hasPreSlotContent=t)}updateCharacterCount(){this.characterCount=this.input?.value.length??0}renderInput(){switch(this.type){case"file":return s("xpl-input-file",{accept:this.accept,disabled:this.disabled,hideAcceptText:this.hideAcceptText,hideFileNames:this.hideFileNames,hideTriggerOnSelect:this.hideTriggerOnSelect,multiple:this.multiple,name:this.name,onInputChange:this.handleChildValueChange,_id:this._id},s("slot",{name:"trigger"}));case"color":return s("xpl-input-color",{disabled:this.disabled,value:this.value,placeholder:this.placeholder,required:this.required,hideEyeDropper:this.hideEyeDropper,onInputChange:this.handleChildValueChange});case"date":return s("xpl-input-date",{inputId:this._id,disabled:this.disabled,name:this.name,required:this.required,readonly:this.readonly,value:this.value,placeholder:this.placeholder,post:this.post,pre:this.pre,max:this.max,min:this.min,dateFormat:this.dateFormat,mode:this.mode,onValueChange:this.handleChildValueChange});case"time":return s("xpl-input-time",{inputId:this._id,disabled:this.disabled,name:this.name,required:this.required,readonly:this.readonly,value:this.value,placeholder:this.placeholder,max:this.max,min:this.min,step:this.step,mode:this.mode,timeFormat:this.timeFormat,allowCustomOption:this.allowCustomOption,onValueChange:this.handleChildValueChange});case"phone":return s("xpl-input-phone",{inputId:this._id,disabled:this.disabled,error:void 0!==this.error,name:this.name,required:this.required,readonly:this.readonly,value:this.value,placeholder:this.placeholder,defaultCountry:this.defaultCountry,preferredCountries:this.preferredCountries,isInternational:this.isInternational,onValueChange:this.handleChildValueChange});case"search":{const t=Boolean((this.label??"").trim()),e=void 0!==this.error,i=e&&(this.error?.length??0)>0;return s("xpl-input-search",{ariaLabel:(this.ariaLabel??"").trim()||"Search",autocomplete:this.autocomplete??"off",disabled:this.disabled,errorMessageId:i?`${this._id}-error`:void 0,hasError:e,hasVisibleLabel:t,inputId:this._id??"",name:this.name,onBlurEvent:this.handleSearchBlurForward,onFocusEvent:this.handleSearchFocusForward,onSearch:this.handleSearchCommit,onValueChange:this.handleChildValueChange,placeholder:this.placeholder??"Search",readonly:this.readonly,ref:t=>{this.searchInputRef=t??void 0},required:this.required,shape:this.shape??"rounded",value:this.value??""})}default:return s("div",{class:"xpl-input-wrapper"},!this.multiline&&s("label",{class:{"xpl-input-pre":!0,"xpl-input-pre--hidden":!this.pre&&!this.hasPreSlotContent},htmlFor:this._id},s("slot",{name:"pre"},this.pre)),this.multiline?s("textarea",{disabled:this.disabled,id:this._id,name:this.name,placeholder:this.placeholder,readonly:this.readonly,ref:t=>{this.input=t??void 0},required:this.required,onChange:this.valueChanged,onFocus:this.handleFocus,onBlur:this.handleBlur,onInput:this.handleInput},this.value):s("input",{autocomplete:this.autocomplete,disabled:this.disabled,id:this._id,max:this.max,min:this.min,name:this.name,placeholder:this.placeholder,readonly:this.readonly,ref:t=>{this.input=t??void 0},required:this.required,step:this.step,type:this.type,value:this.value,onChange:this.valueChanged,onFocus:this.handleFocus,onBlur:this.handleBlur,onInput:this.handleInput}),"password"===this.type&&s("button",{"aria-label":"Toggle password visibility",class:"xpl-input-password",onClick:()=>{this.passwordVisible=!this.passwordVisible},role:"presentation"},s("xpl-icon",{icon:this.passwordVisible?"eye-closed":"eye",size:24})),this.post&&!this.multiline&&s("label",{class:"xpl-input-post",htmlFor:this._id},this.post),this.multiline&&void 0!==this.maxCharacterCount&&s("span",{class:"xpl-input-characters"},this.characterCount,"/",this.maxCharacterCount))}}render(){let t=!1;return(void 0!==this.error||this.multiline&&void 0!==this.maxCharacterCount&&this.characterCount>this.maxCharacterCount)&&(t=!0),s(n,{key:"94a5e19a36756ac43ebbe6d3996a2ffbf475da24",class:{"xpl-input":!0,"xpl-input--disabled":!!this.disabled,"xpl-input--error":t,"xpl-input--readonly":!!this.readonly,[`xpl-input--${this.type}`]:!0}},this.label&&s("label",{key:"d41b5e5245483e2ea235c910f85cd6a21b100dec",class:"xpl-input-label",htmlFor:this._id},this.label,this.description&&s("small",{key:"c9d55823b8b97678b2f5f4374446c3693e6dceaa"},this.description)),this.renderInput(),(this.error?.length??0)>0&&s("label",{key:"20e5a1d2af06e571f0757aa60633438f79a6a17d",class:"xpl-input-error",htmlFor:this._id,id:`${this._id}-error`},s("xpl-icon",{key:"a193ee5f1d3e0d8479fa8dfd66ab27edeb400d30",icon:"circle-warning",size:16}),s("span",{key:"acf686fe036d1a1e9cb944ff773dda86e90ff39a"},this.error)))}get el(){return this}},[260,"xpl-input",{_id:[1],description:[1],disabled:[4],error:[1],label:[1],name:[1],required:[4],readonly:[4],value:[1],autocomplete:[1],placeholder:[1],post:[1],pre:[1],max:[8],min:[8],step:[2],multiline:[4],maxCharacterCount:[2,"max-character-count"],dateFormat:[1,"date-format"],timeFormat:[1,"time-format"],allowCustomOption:[4,"allow-custom-option"],mode:[1],accept:[1],multiple:[4],hideTriggerOnSelect:[4,"hide-trigger-on-select"],hideFileNames:[4,"hide-file-names"],hideAcceptText:[4,"hide-accept-text"],hideEyeDropper:[4,"hide-eye-dropper"],defaultCountry:[1,"default-country"],preferredCountries:[16],isInternational:[4,"is-international"],ariaLabel:[1,"aria-label"],shape:[1],type:[1],characterCount:[32],passwordVisible:[32],hasPreSlotContent:[32],setFocus:[64]}]);function P(){"undefined"!=typeof customElements&&["xpl-input","xpl-dropdown","xpl-dropdown-group","xpl-dropdown-heading","xpl-dropdown-option","xpl-icon","xpl-input","xpl-input-color","xpl-input-date","xpl-input-file","xpl-input-phone","xpl-input-search","xpl-input-time","xpl-popover"].forEach((t=>{switch(t){case"xpl-input":customElements.get(a(t))||customElements.define(a(t),V);break;case"xpl-dropdown":customElements.get(a(t))||o();break;case"xpl-dropdown-group":customElements.get(a(t))||r();break;case"xpl-dropdown-heading":customElements.get(a(t))||h();break;case"xpl-dropdown-option":customElements.get(a(t))||l();break;case"xpl-icon":customElements.get(a(t))||c();break;case"xpl-input":customElements.get(a(t))||P();break;case"xpl-input-color":customElements.get(a(t))||A();break;case"xpl-input-date":customElements.get(a(t))||d();break;case"xpl-input-file":customElements.get(a(t))||u();break;case"xpl-input-phone":customElements.get(a(t))||F();break;case"xpl-input-search":customElements.get(a(t))||m();break;case"xpl-input-time":customElements.get(a(t))||M();break;case"xpl-popover":customElements.get(a(t))||b()}}))}export{V as I,O as a,A as b,D as c,P as d,F as e,_ as f,M as g}
|
|
1
|
+
import{p as t,H as e,d as i,h as s,c as n,t as a}from"./p-BSHdGbmH.js";import{d as o}from"./p-2cJsJK3-.js";import{d as r}from"./p-BZIZSovL.js";import{d as h}from"./p-Dp62sBqX.js";import{d as l}from"./p-C0AbGd4t.js";import{d as c}from"./p-CQjJIHK6.js";import{i as p}from"./p-Dqb1pIRo.js";import{d}from"./p-CmbpWpb0.js";import{d as u}from"./p-D09sGbzs.js";import{d as m}from"./p-BOm_p_mz.js";import{v as b}from"./p-CK3_k8jD.js";import{d as f}from"./p-DTh_zemx.js";const x=(t,e,i)=>{const s=(i/=100)*(e/=100),n=s*(1-Math.abs(t/60%2-1)),a=i-s;let o=0,r=0,h=0;return t<60?(o=s,r=n,h=0):t<120?(o=n,r=s,h=0):t<180?(o=0,r=s,h=n):t<240?(o=0,r=n,h=s):t<300?(o=n,r=0,h=s):(o=s,r=0,h=n),{r:Math.round(255*(o+a)),g:Math.round(255*(r+a)),b:Math.round(255*(h+a))}},g=(t,e,i)=>[t,e,i].map((t=>t.toString(16).padStart(2,"0"))).join(""),C=t=>{if(t.startsWith("#")){if(!/^#([a-fA-F\d]{6})$/.test(t))throw new Error("xpl-input-color: Only 6-digit hex format supported (e.g. #aabbcc)");const e=t.toLowerCase().slice(1),i=parseInt(e.slice(0,2),16),s=parseInt(e.slice(2,4),16),n=parseInt(e.slice(4,6),16);return{hex:e,r:i,g:s,b:n,a:1}}if(t.startsWith("rgba")||t.startsWith("rgb")){const e=t.match(/[\d.]+/g)?.map(Number);if(!e||e.length<3)throw new Error("xpl-input-color: Invalid rgba/rgb format");const[i,s,n,a=1]=e,o=t=>t.toString(16).padStart(2,"0");return{hex:`${o(i)}${o(s)}${o(n)}`.toLowerCase(),r:i,g:s,b:n,a}}if(t.startsWith("hsla")||t.startsWith("hsl")){const e=t.match(/[\d.]+/g)?.map(Number);if(!e||e.length<3)throw new Error("xpl-input-color: Invalid hsla/hsl format");const[i,s,n,a=1]=e,o=((t,e,i,s)=>{i/=100;const n=e=>(e+t/30)%12,a=(e/=100)*Math.min(i,1-i),o=t=>i-a*Math.max(-1,Math.min(n(t)-3,Math.min(9-n(t),1)));return`rgba(${Math.round(255*o(0))}, ${Math.round(255*o(8))}, ${Math.round(255*o(4))}, ${s})`})(i,s,n,a),r=o.match(/[\d.]+/g)?.map(Number);if(!r||r.length<3)throw new Error("xpl-input-color: Invalid hsla/hsl format");const[h,l,c]=r;return{hex:g(h,l,c).toLowerCase(),r:h,g:l,b:c,a}}throw new Error("xpl-input-color: Unsupported color format")},y=t=>t.a&&1!==t.a?`rgba(${t.r}, ${t.g}, ${t.b}, ${t.a})`:`#${t.hex}`,v=[{countryCode:"US",dialCode:"+1",name:"United States"},{countryCode:"CA",dialCode:"+1",name:"Canada"},{countryCode:"GB",dialCode:"+44",name:"United Kingdom"},{countryCode:"AU",dialCode:"+61",name:"Australia"},{countryCode:"DE",dialCode:"+49",name:"Germany"},{countryCode:"FR",dialCode:"+33",name:"France"},{countryCode:"ES",dialCode:"+34",name:"Spain"},{countryCode:"IT",dialCode:"+39",name:"Italy"},{countryCode:"NL",dialCode:"+31",name:"Netherlands"},{countryCode:"BE",dialCode:"+32",name:"Belgium"},{countryCode:"AT",dialCode:"+43",name:"Austria"},{countryCode:"CH",dialCode:"+41",name:"Switzerland"},{countryCode:"PL",dialCode:"+48",name:"Poland"},{countryCode:"IE",dialCode:"+353",name:"Ireland"},{countryCode:"PT",dialCode:"+351",name:"Portugal"},{countryCode:"SE",dialCode:"+46",name:"Sweden"},{countryCode:"NO",dialCode:"+47",name:"Norway"},{countryCode:"DK",dialCode:"+45",name:"Denmark"},{countryCode:"FI",dialCode:"+358",name:"Finland"},{countryCode:"NZ",dialCode:"+64",name:"New Zealand"},{countryCode:"JP",dialCode:"+81",name:"Japan"},{countryCode:"CN",dialCode:"+86",name:"China"},{countryCode:"IN",dialCode:"+91",name:"India"},{countryCode:"BR",dialCode:"+55",name:"Brazil"},{countryCode:"MX",dialCode:"+52",name:"Mexico"},{countryCode:"ZA",dialCode:"+27",name:"South Africa"},{countryCode:"SG",dialCode:"+65",name:"Singapore"},{countryCode:"HK",dialCode:"+852",name:"Hong Kong"},{countryCode:"KR",dialCode:"+82",name:"South Korea"}];function $(t){return v.find((e=>e.countryCode===t))}function k(t){return(t||"").replace(/\D/g,"")}function E(t){switch(t){case"US":case"CA":case"MX":case"JP":case"IN":case"KR":return 10;case"GB":case"DE":case"AT":case"CH":case"BR":case"CN":return 11;case"AU":case"FR":return 9;default:return 15}}function w(t,e){if(!t)return"";const i=t.replace(/\D/g,"");switch(e){case"US":case"CA":return function(t){const e=Math.min(t.length,10);return e<=3?t.slice(0,e):e<=6?`${t.slice(0,3)} ${t.slice(3,e)}`:`${t.slice(0,3)} ${t.slice(3,6)} ${t.slice(6,e)}`}(i);case"GB":return function(t){const e=Math.min(t.length,11);return e<=4?t.slice(0,e):e<=7?`${t.slice(0,4)} ${t.slice(4,e)}`:`${t.slice(0,4)} ${t.slice(4,7)} ${t.slice(7,e)}`}(i);case"AU":return function(t){const e=Math.min(t.length,9);return e<=1?t.slice(0,e):e<=4?`${t.slice(0,1)} ${t.slice(1,e)}`:e<=7?`${t.slice(0,1)} ${t.slice(1,4)} ${t.slice(4,e)}`:`${t.slice(0,1)} ${t.slice(1,4)} ${t.slice(4,7)} ${t.slice(7,e)}`}(i);case"DE":case"AT":case"CH":return function(t){const e=Math.min(t.length,11);return e<=3?t.slice(0,e):`${t.slice(0,3)} ${t.slice(3,e)}`}(i);case"FR":return function(t){const e=Math.min(t.length,9),i=[];let s=0;for(e>0&&(i.push(t.slice(0,1)),s=1);s<e&&s+2<=e;)i.push(t.slice(s,s+2)),s+=2;return s<e&&i.push(t.slice(s)),i.join(" ")}(i);case"BR":return function(t){const e=Math.min(t.length,11);return e<=2?e?`(${t}`:"":e<=6||7===e?`(${t.slice(0,2)}) ${t.slice(2,e)}`:`(${t.slice(0,2)}) ${t.slice(2,7)}-${t.slice(7,e)}`}(i);case"MX":return function(t){const e=Math.min(t.length,10);return e<=3?t.slice(0,e):e<=6?`${t.slice(0,3)} ${t.slice(3,e)}`:`${t.slice(0,3)} ${t.slice(3,6)} ${t.slice(6,e)}`}(i);case"JP":return function(t){const e=Math.min(t.length,10);return e<=3?t.slice(0,e):e<=7?`${t.slice(0,3)}-${t.slice(3,e)}`:`${t.slice(0,3)}-${t.slice(3,7)}-${t.slice(7,e)}`}(i);case"CN":return function(t){const e=Math.min(t.length,11);return e<=3?t.slice(0,e):e<=7?`${t.slice(0,3)} ${t.slice(3,e)}`:`${t.slice(0,3)} ${t.slice(3,7)} ${t.slice(7,e)}`}(i);case"IN":return function(t){const e=Math.min(t.length,10);return e<=5?t.slice(0,e):`${t.slice(0,5)} ${t.slice(5,e)}`}(i);case"KR":return function(t){const e=Math.min(t.length,10);return e<=3?t.slice(0,e):e<=7?`${t.slice(0,3)} ${t.slice(3,e)}`:`${t.slice(0,3)} ${t.slice(3,7)} ${t.slice(7,e)}`}(i);default:return function(t){const e=t.length;if(e<=3)return t;const i=[];let s=0;for(;s<e;){const n=e-s>=4?4:3;i.push(t.slice(s,s+n)),s+=n}return i.join(" ")}(i)}}function S(t){const[e,i]=t.split(":"),s=Number(e)>=12?"PM":"AM";return[(Number(e)%12||12).toString(),i,s]}const _=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.valueChange=i(this,"valueChange",7),this.hasErrorStateChanged=i(this,"hasErrorStateChanged",7),this.max="23:59",this.min="00:00",this.step=30,this.mode="single",this.timeFormat="24h",this.allowCustomOption=!1,this.showOptions=!1,this.options=[],this.handleInput=t=>{const e=t.target,i=e.value?.replace(/[^0-9:apmAPM]/g,"");this.value=i},this.handleFocus=()=>{this.showOptions=!0},this.handleBlur=()=>{const t=function(t){if(!t||""===t.trim()||0===t.replace(/[^0-9]/g,"").length)return null;let e=t.trim().toLowerCase();e=e.replace(/(\d)\s+(am|pm)/g,"$1$2"),/^\d{1,2}(am|pm)?$/.test(e)&&(e=e.replace(/(am|pm)?$/,":00$1")),/^\d{1,2}$/.test(e)&&(e=`${e}:00`),/^\d{1,2}:\d{1}$/.test(e)&&(e=`${e}0`);const[i,s]=e.split(":"),n=s.replace(/[^0-9]/g,""),a=e.includes("am");return e.includes("pm")||a?a?`${(Number(i)%12).toString().padStart(2,"0")}:${n}`:`${Number(i)%12+12}:${n}`:`${i.padStart(2,"0")}:${n}`}(this.value??"");this.value=t??void 0},this.handleClick=()=>{this.showOptions=!0}}onValueChange(t){this.valueChange.emit(t),this.updateState(t)}updateState(t){this.formattedValue=this.formatDisplayedTime(t),this.amPm=this.formatDisplayedAmPm(t),this.validateValue()}formatDisplayedTime(t){if(!t)return"";if("12h"===this.timeFormat&&t.includes(":")){const[e,i]=S(t);return`${e}:${i}`}return t}formatDisplayedAmPm(t){if(!t||"12h"!==this.timeFormat)return"";const[,,e]=S(t);return e}validateValue(){if(!this.value)return void(this.hasErrorState=this.required?"required":null);if(!this.value.includes(":")||this.value.trim().length<4||this.value.trim().length>5)return void(this.hasErrorState="Invalid time format, must be HH:MM");const t=String(this.min??"00:00"),e=String(this.max??"23:59");this.hasErrorState=this.value<t||this.value>e?"Out of range":this.allowCustomOption||this.options.some((t=>t.value===this.value))?null:"Invalid option"}onHasErrorStateChanged(t){this.hasErrorStateChanged.emit(t)}componentDidLoad(){"range"===this.mode&&console.warn("Range mode is not supported for time inputs at this time."),this.dropdown?.addEventListener("isOpenChange",(t=>{this.showOptions=t.detail}))}componentWillLoad(){this.options=this.getOptions(),this.value&&this.updateState(this.value)}getOptions(){return function(t,e,i,s){const n=t=>{const[e,i]=t.split(":").map(Number);return 60*e+i},a=n(e.toString()),o=n(i.toString()),r=[];for(let e=a;e<=o;e+=t)r.push((h=e,`${Math.floor(h/60).toString().padStart(2,"0")}:${(h%60).toString().padStart(2,"0")}`));var h;return r.map((t=>({label:"12h"===s?function(t){const[e,i,s]=S(t);return`${e}:${i} ${s}`}(t):t,value:t})))}(this.step,String(this.min??"00:00"),String(this.max??"23:59"),this.timeFormat??"24h").map((({label:t,value:e})=>({label:t,value:e,onClick:()=>{this.value=e,this.showOptions=!1}})))}render(){return s(n,{key:"098ef69d355f6bdf03b4bfbab59956f84d5967b4",class:{"xpl-input-time":!0,[`xpl-input-time--mode-${this.mode}`]:!0,"xpl-input-time--error":!!this.hasErrorState}},s("xpl-input",{key:"e73a120a00a6f110e99e1a7d54bc75c024a2e1dc",pre:s("xpl-icon",{class:"xpl-input-time__clock-icon",icon:"clock",size:24}),post:"12h"===this.timeFormat?this.amPm||"AM":void 0,type:"text",_id:this.inputId,disabled:this.disabled,name:this.name,required:this.required,readonly:this.readonly,placeholder:this.placeholder,max:this.max,min:this.min,onInput:this.handleInput,value:this.formattedValue,onFocusEvent:this.handleFocus,onBlurEvent:this.handleBlur,onClick:this.handleClick}),!this.readonly&&!this.disabled&&s("xpl-dropdown",{key:"454de00fca4a891eaffc71738538425fa9f4e34f",options:this.options,isOpen:this.showOptions,ref:t=>{this.dropdown=t??void 0},class:"xpl-input-time__dropdown"}))}static get watchers(){return{value:[{onValueChange:0}],hasErrorState:[{onHasErrorStateChanged:0}]}}},[0,"xpl-input-time",{inputId:[1,"input-id"],disabled:[4],name:[1],required:[4],readonly:[4],value:[1537],placeholder:[1],max:[8],min:[8],step:[2],mode:[1],timeFormat:[1,"time-format"],allowCustomOption:[4,"allow-custom-option"],formattedValue:[32],hasErrorState:[32],showOptions:[32],options:[32],amPm:[32]},void 0,{value:[{onValueChange:0}],hasErrorState:[{onHasErrorStateChanged:0}]}]);function M(){"undefined"!=typeof customElements&&["xpl-input-time","xpl-dropdown","xpl-dropdown-group","xpl-dropdown-heading","xpl-dropdown-option","xpl-icon","xpl-input","xpl-input-color","xpl-input-date","xpl-input-file","xpl-input-phone","xpl-input-search","xpl-input-time"].forEach((t=>{switch(t){case"xpl-input-time":customElements.get(a(t))||customElements.define(a(t),_);break;case"xpl-dropdown":customElements.get(a(t))||o();break;case"xpl-dropdown-group":customElements.get(a(t))||r();break;case"xpl-dropdown-heading":customElements.get(a(t))||h();break;case"xpl-dropdown-option":customElements.get(a(t))||l();break;case"xpl-icon":customElements.get(a(t))||c();break;case"xpl-input":customElements.get(a(t))||P();break;case"xpl-input-color":customElements.get(a(t))||A();break;case"xpl-input-date":customElements.get(a(t))||d();break;case"xpl-input-file":customElements.get(a(t))||u();break;case"xpl-input-phone":customElements.get(a(t))||F();break;case"xpl-input-search":customElements.get(a(t))||m();break;case"xpl-input-time":customElements.get(a(t))||M()}}))}function I(t){return t.toLowerCase().replace(/ /g,"-")}const D=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.hasErrorStateChanged=i(this,"hasErrorStateChanged",7),this.valueChange=i(this,"valueChange",7),this.lastCursorRef=0,this.lastFormattedRef="",this.dropdownOpen=!1,this.hasErrorState=null,this.nationalNumber="",this.searchQuery="",this.triggerId=`xpl-input-phone-trigger-${b()}`,this.defaultCountry="US",this.isInternational=!0,this.handleTriggerClick=()=>{this.isEditable&&(this.dropdownOpen=!this.dropdownOpen)},this.handleNumberInput=t=>{const e=t.target,i=e.value||"";let s;if(this.lastCursorRef=e.selectionStart??0,this.lastFormattedRef=i,this.isInternational&&i.startsWith("+")){const t=k(i),e=this.effectiveDialCode.slice(1).replace(/\D/g,"");s=e&&t.startsWith(e)?t.slice(e.length):t}else s=k(i);const n=E(this.effectiveCountryCode);s.length>n&&(s=s.slice(0,n)),this.nationalNumber=s,this.emitValue(),e.value=this.displayValue},this.handleClear=()=>{this.nationalNumber="",this.emitValue(),this.inputEl?.focus()},this.handleDropdownUpdate=(t,{component:e})=>{const i=e??this.dropdownRef;if(!i)return;const{options:s}=i;if(s?.length){const t=s.reduce(((t,e)=>[...t,...e.groupName?e.options??[]:[e]]),[]).find((t=>t.isSelected));if(t?.value){const e=$(t.value);e&&(this.selectedCountry=e,this.emitValue(),this.inputEl?.focus())}}}}onDropdownOpenChange(t){t&&(this.searchQuery="")}onHasErrorStateChanged(t){this.hasErrorStateChanged.emit(t)}onValueChange(t){if(null==t||""===t){const t=$(this.defaultCountry??"US")||v[0];return this.selectedCountry=t,void(this.nationalNumber="")}const e=function(t){if(!t||!t.startsWith("+"))return null;const e=t.slice(1).replace(/\D/g,"");if(!e.length)return null;const i=[...v].sort(((t,e)=>e.dialCode.replace(/\D/g,"").length-t.dialCode.replace(/\D/g,"").length)).find((t=>{const i=t.dialCode.slice(1).replace(/\D/g,"");return e.startsWith(i)}));if(!i)return null;const s=i.dialCode.slice(1).replace(/\D/g,""),n=e.slice(s.length);return{dialCode:i.dialCode,nationalNumber:n}}(t);if(e)if(this.selectedCountry?.dialCode===e.dialCode)this.nationalNumber=e.nationalNumber;else{const t=$(this.defaultCountry??"US"),s=(t?.dialCode===e.dialCode?t:void 0)??(i=e.dialCode,v.find((t=>t.dialCode===i)));s&&(this.selectedCountry=s,this.nationalNumber=e.nationalNumber)}else this.selectedCountry||(this.selectedCountry=$(this.defaultCountry??"US")||v[0]);var i}componentWillLoad(){this.value?this.onValueChange(this.value):this.selectedCountry=$(this.defaultCountry??"US")||v[0]}componentDidUpdate(){if(this.inputEl&&this.lastFormattedRef&&"function"==typeof this.inputEl.setSelectionRange){const t=function(t,e,i){if(i>=t.length)return e.length;const s=k(t.slice(0,i)).length;let n=0,a=0;for(let t=0;t<e.length;t+=1){if(/\d/.test(e[t])&&(a+=1,a>=s)){n=t+(a===s?1:0);break}n=t+1}return Math.min(n,e.length)}(this.lastFormattedRef,this.displayValue,this.lastCursorRef);this.inputEl.setSelectionRange(t,t),this.lastFormattedRef=""}else this.inputEl&&this.lastFormattedRef&&(this.lastFormattedRef="")}get effectiveCountryCode(){return this.selectedCountry?.countryCode??this.defaultCountry??"US"}get effectiveDialCode(){return this.selectedCountry?.dialCode??"+1"}get isEditable(){return!this.disabled&&!this.readonly}get orderedCountries(){const t=this.preferredCountries||[],e=v.filter((e=>!t.includes(e.countryCode)));return[...t.map((t=>$(t))).filter((t=>void 0!==t)),...e]}get filteredCountries(){const t=this.searchQuery.trim().toLowerCase();return t?this.orderedCountries.filter((e=>e.name.toLowerCase().includes(t)||e.dialCode.includes(t)||e.countryCode.toLowerCase().includes(t))):this.orderedCountries}get displayValue(){return this.nationalNumber?w(this.nationalNumber,this.effectiveCountryCode):""}get effectivePlaceholder(){if(this.placeholder)return this.placeholder;const t=this.selectedCountry;return t?function(t){switch(t){case"US":case"CA":case"MX":default:return"000 000 0000";case"GB":return"0000 000 0000";case"AU":return"0 000 000 000";case"DE":case"AT":case"CH":return"000 0000000";case"FR":return"0 00 00 00 00";case"BR":return"00 00000 0000";case"JP":case"CN":case"KR":return"000 0000 0000";case"IN":return"00000 00000"}}(t.countryCode):""}get dropdownOptions(){return this.filteredCountries.map((t=>({icon:I(t.name),label:`${t.name} (${t.dialCode})`,value:t.countryCode,isSelected:this.selectedCountry?.countryCode===t.countryCode})))}get maxInputLength(){const t=E(this.effectiveCountryCode);return w("9".repeat(t),this.effectiveCountryCode).length}emitValue(){const t=this.nationalNumber?function(t,e){const i=(t.slice(1)+e).replace(/\D/g,"");return i.length?`+${i}`:""}(this.effectiveDialCode,this.nationalNumber):"";this.value=t||void 0,this.valueChange.emit(t||""),this.validate()}validate(){this.hasErrorState=!this.required||this.nationalNumber.trim()?null:"required"}render(){return s(n,{key:"c78f7ab5d5c6f6982356d7610fe32855d7f214c5",class:{"xpl-input-phone":!0,"xpl-input-phone--error":!!this.hasErrorState||!!this.error,"xpl-input-phone--open":this.dropdownOpen,"xpl-input-phone--domestic":!this.isInternational}},s("div",{key:"3b30f8755836376728336f769afeb714b9a3dfa9",class:"xpl-input-wrapper"},this.isInternational&&s("button",{key:"c83ff2255a465d7d5d233ce02a816845858594be",type:"button",id:this.triggerId,class:"xpl-input-phone__trigger",disabled:this.disabled,"aria-haspopup":"listbox","aria-expanded":this.dropdownOpen?"true":"false","aria-label":"Select country",onClick:this.handleTriggerClick},this.selectedCountry?.name&&s("xpl-icon",{key:"f0a62a5052b940f4a2212ed77929696e62b4825f",class:"xpl-input-phone__flag",icon:I(this.selectedCountry.name),size:24,"aria-hidden":"true"}),s("xpl-icon",{key:"68782b949fd1cf41a8b0883ad6caba18d9aa1ac5",class:"xpl-input-phone__trigger-icon",icon:"chevron-down",size:20,"aria-hidden":"true"})),s("div",{key:"6aa5f75f34b413bd8939d46c55b7cc42128db247",class:"xpl-input-phone__input-wrap"},this.isInternational&&s("span",{key:"81dc5727f8dca528f34994736c1a8a2223e8fe63",class:"xpl-input-phone__dial-code"},this.effectiveDialCode),s("input",{key:"d0faecadd4216bf6a7b79fc9623052e194900c15",ref:t=>{this.inputEl=t??void 0},type:"tel",id:this.inputId,class:"xpl-input-phone__input",name:this.name,disabled:this.disabled,readonly:this.readonly,required:this.required,"aria-invalid":this.hasErrorState||this.error?"true":"false",placeholder:this.effectivePlaceholder,autocomplete:this.isInternational?"tel-national":"tel",inputmode:"numeric",maxlength:this.maxInputLength,value:this.displayValue,onInput:this.handleNumberInput}),this.nationalNumber&&this.isEditable&&s("button",{key:"12a2e4ce8adb80ca4d6fca1c706c54db01d22101",type:"button",class:"xpl-input-phone__clear","aria-label":"Clear phone number",onClick:this.handleClear},s("xpl-icon",{key:"f1ae5e69258654e8ba5bf511755020e0d7d91088",icon:"x-circle",size:16})))),this.isInternational&&this.isEditable&&s("xpl-dropdown",{key:"d8a75cf0b95d9affae6e03292c011a73dcff98b4",ref:t=>{this.dropdownRef=t??void 0},isOpen:this.dropdownOpen,triggerId:this.triggerId,anchorToTrigger:!0,closeOnSelect:!0,mode:"single",options:this.dropdownOptions,update:this.handleDropdownUpdate,onIsOpenChange:t=>{this.dropdownOpen=t.detail},"aria-label":"Country"},s("div",{key:"b46a4a9985604720099c3212714804aee5a1f58b",slot:"header",class:"xpl-input-phone__search-wrap"},s("xpl-input",{key:"55bdc0f6ff4b1a1a2d17b5ba10849bcab472d7d8",class:"xpl-input-phone__search",type:"text",label:"",placeholder:"Search",value:this.searchQuery,autocomplete:"off",onInputEvent:t=>{this.searchQuery=t.detail??""}},s("xpl-icon",{key:"af0fd388d39e6d9bcac5a032c7c0cf5f192cc4d3",slot:"pre",class:"xpl-input-phone__search-icon",icon:"magnifier",size:20})))))}get el(){return this}static get watchers(){return{dropdownOpen:[{onDropdownOpenChange:0}],hasErrorState:[{onHasErrorStateChanged:0}],value:[{onValueChange:0}]}}},[0,"xpl-input-phone",{defaultCountry:[1,"default-country"],disabled:[4],error:[4],inputId:[1,"input-id"],isInternational:[4,"is-international"],name:[1],placeholder:[1],preferredCountries:[16],readonly:[4],required:[4],value:[1537],dropdownOpen:[32],hasErrorState:[32],nationalNumber:[32],searchQuery:[32],selectedCountry:[32],triggerId:[32]},void 0,{dropdownOpen:[{onDropdownOpenChange:0}],hasErrorState:[{onHasErrorStateChanged:0}],value:[{onValueChange:0}]}]);function F(){"undefined"!=typeof customElements&&["xpl-input-phone","xpl-dropdown","xpl-dropdown-group","xpl-dropdown-heading","xpl-dropdown-option","xpl-icon","xpl-input","xpl-input-color","xpl-input-date","xpl-input-file","xpl-input-phone","xpl-input-search","xpl-input-time"].forEach((t=>{switch(t){case"xpl-input-phone":customElements.get(a(t))||customElements.define(a(t),D);break;case"xpl-dropdown":customElements.get(a(t))||o();break;case"xpl-dropdown-group":customElements.get(a(t))||r();break;case"xpl-dropdown-heading":customElements.get(a(t))||h();break;case"xpl-dropdown-option":customElements.get(a(t))||l();break;case"xpl-icon":customElements.get(a(t))||c();break;case"xpl-input":customElements.get(a(t))||P();break;case"xpl-input-color":customElements.get(a(t))||A();break;case"xpl-input-date":customElements.get(a(t))||d();break;case"xpl-input-file":customElements.get(a(t))||u();break;case"xpl-input-phone":customElements.get(a(t))||F();break;case"xpl-input-search":customElements.get(a(t))||m();break;case"xpl-input-time":customElements.get(a(t))||M()}}))}const N={hex:"",r:0,g:0,b:0,a:1},O=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.inputChange=i(this,"inputChange",7),this.hasErrorStateChanged=i(this,"hasErrorStateChanged",7),this.placeholder="Select color",this.eyeDropperSupported=!1,this.colorInputElements={},this.handleMove=t=>{const{slGrid:e}=this.colorInputElements;if(!e)return;const i=e.getBoundingClientRect(),s="touches"in t?t.touches[0].clientY:t.clientY,n=Math.max(0,Math.min(("touches"in t?t.touches[0].clientX:t.clientX)-i.left,i.width)),a=Math.max(0,Math.min(s-i.top,i.height)),o=n/i.width,r=a/i.height,h=x(this.hue,100,100),l=(255*(1-o)+o*h.r)*(1-r),c=(255*(1-o)+o*h.g)*(1-r),p=(255*(1-o)+o*h.b)*(1-r),d={r:Math.round(l),g:Math.round(c),b:Math.round(p),hex:g(Math.round(l),Math.round(c),Math.round(p)),a:this.colorValues.a};this.colorValues=d},this.startDrag=t=>{t.preventDefault(),this.handleMove(t),window.addEventListener("mousemove",this.handleMove),window.addEventListener("mouseup",this.stopDrag),window.addEventListener("touchmove",this.handleMove),window.addEventListener("touchend",this.stopDrag)},this.stopDrag=()=>{window.removeEventListener("mousemove",this.handleMove),window.removeEventListener("mouseup",this.stopDrag),window.removeEventListener("touchmove",this.handleMove),window.removeEventListener("touchend",this.stopDrag)},this.onHexInputChange=t=>{const e=t.detail?t.detail.trim().replace(/#/g,""):"";if(e){const[t,i,s]=(t=>{const e=t?.match(/\w\w/g);return e?e.map((t=>parseInt(t,16))):[0,0,0]})(e);this.colorValues={hex:e,r:t,g:i,b:s,a:this.colorValues.a??1}}else this.colorValues={...N}},this.onRgbaInputChange=(t,e)=>{const i=parseFloat(e.detail);if(Number.isNaN(i))return void(this.hasErrorState=`invalid value from ${t.name}: ${i}`);const s={...this.colorValues};switch(t.name){case"color-r-input":s.r=i;break;case"color-g-input":s.g=i;break;case"color-b-input":s.b=i;break;case"color-a-input":s.a=i;break;default:this.hasErrorState=`unhandled input: ${t.name}`}s.hex=g(s.r,s.g,s.b),this.colorValues=s},this.onSliderInputChange=t=>{const e=parseFloat(t.value);if(Number.isNaN(e))this.hasErrorState=`invalid value from ${t.name}: ${e}`;else switch(t.name){case"color-hue-slider":this.colorValues=C(`hsla(${e}, 100%, 50%, 1)`),this.hue=e;break;case"color-alpha-slider":this.colorValues={...this.colorValues,a:e};break;default:this.hasErrorState=`unhandled input: ${t.name}`}}}valueChanged(t){this.hasErrorState=this.required&&!t.hex?"required":null,this.inputChange.emit(t.hex?y(t):"")}onHasErrorStateChanged(t){this.hasErrorStateChanged.emit(t)}onValuePropChange(t){this.syncColorFromValue(t)}syncColorFromValue(t){if(t)try{this.colorValues=C(t),this.hue=(()=>{const t=this.colorValues.r/255,e=this.colorValues.g/255,i=this.colorValues.b/255,s=Math.max(t,e,i),n=Math.min(t,e,i),a=s-n;let o=0,r=0;const h=(s+n)/2;if(0!==a){switch(r=a/(1-Math.abs(2*h-1)),s){case t:o=(e-i)/a%6;break;case e:o=(i-t)/a+2;break;case i:o=(t-e)/a+4}o*=60,o<0&&(o+=360)}return{hue:Math.round(o),saturation:Math.round(100*r),lightness:Math.round(100*h)}})().hue}catch{this.hasErrorState="invalid color format",this.hue=0}else this.colorValues={...N},this.hasErrorState=null,this.hue=0}componentWillLoad(){this.syncColorFromValue(this.value)}componentDidLoad(){p()&&(this.eyeDropperSupported="EyeDropper"in window);const{r:t,g:e,b:i,a:s,hue:n,alpha:a,hex:o}=this.colorInputElements;o?.addEventListener("valueChange",(t=>{this.onHexInputChange(t),t.stopPropagation()})),[t,e,i,s].forEach((t=>{t?.addEventListener("valueChange",(e=>{this.onRgbaInputChange(t,e),e.stopPropagation()}))})),[n,a].forEach((t=>{t?.addEventListener("input",(()=>{this.onSliderInputChange(t)}))}))}async openEyeDropper(){try{const t=window.EyeDropper;if(!t)throw new Error("EyeDropper API is not available");const e=new t,i=await e.open();this.colorValues=C(i.sRGBHex)}catch(t){this.hasErrorState=`eyedropper cancelled or failed: ${t}`}}render(){const{r:t,g:e,b:i,a}=this.colorValues,o=x(this.hue,100,100),{x:r,y:h}=((t,e,i,s)=>{const{s:n,v:a}=((t,e,i,s)=>{t/=255,e/=255,i/=255;const n=Math.max(t,e,i),a=n-Math.min(t,e,i);let o=0;return o=0===a?0:n===t?(e-i)/a%6:n===e?(i-t)/a+2:(t-e)/a+4,o=Math.round(60*o),o<0&&(o+=360),{h:s??o,s:0===n?0:a/n,v:n}})(e.r,e.g,e.b,t);return{x:Math.round(n*i),y:Math.round((1-a)*s)}})(this.hue,{r:t,g:e,b:i},288,160),l={left:`${r}px`,top:`${h}px`,background:`rgb(${t}, ${e}, ${i})`};return s(n,{key:"baf8bd36a33134bff8b2e1ce1a5d81a567f232b2",class:"xpl-input-color"},s("xpl-popover",{key:"e5bfd446e4b900371ee8ca7c7c321692079c66fb",disabled:this.disabled,display:"menu"},s("div",{key:"9d40ccbf649ba0be2884bbc7dec84d7c1e9ddbb7",slot:"trigger"},s("div",{key:"6b4474af2dab4be116728135214403af7189d99f",class:{"xpl-input-color__display":!0,"xpl-input-color__display--disabled":!!this.disabled,"xpl-input-color__display--error":!!this.hasErrorState}},s("span",{key:"9372da25358b453c5b89f324886c986153b9386b",class:"xpl-input-color__color",style:{background:y(this.colorValues)}}),this.colorValues.hex?s("span",{class:"xpl-input-color__value"},y(this.colorValues)):s("span",{class:"xpl-input-color__placeholder"},this.placeholder),this.eyeDropperSupported&&!this.hideEyeDropper&&s("xpl-icon",{key:"a37bf00e4a70cda5e59cecfc7f108601bbb15e8e",size:20,icon:"eye-dropper",class:"xpl-input-color__icon",onClick:t=>{t.stopPropagation(),this.openEyeDropper()}}))),s("div",{key:"e95b3755b47802b446de5d7e9c25d2238dea23ef",class:"xpl-input-color__menu"},s("div",{key:"9ecc94c286d9cd0a5e25c92eaea3a2dd9ee4394b",class:"xpl-input-color__sl-grid",ref:t=>{this.colorInputElements.slGrid=t??void 0},style:{background:["linear-gradient(to top, #000, #0000)","linear-gradient(to right, #fff, #fff0)",`rgb(${o.r} ${o.g} ${o.b})`].join(", ")},onMouseDown:this.startDrag,onTouchStart:this.startDrag},s("div",{key:"85b2e591be85db2a2d3d1bbe65ee276a857b92fa",class:"xpl-input-color__sl-thumb",style:l})),s("div",{key:"b9d7f2fdc49d73db488d62f21433558b5b0a09a7",class:"xpl-input-color__grid"},s("input",{key:"3c260f54bde2c26a7b5980082cabf54e2d42340e",type:"range",min:"0",max:"360",value:this.hue,class:"xpl-input-color__slider xpl-input-color__hue",name:"color-hue-slider",ref:t=>{this.colorInputElements.hue=t??void 0}}),s("input",{key:"ef8ef568a1487b618aeeb986904a5eeefabba300",type:"range",min:"0",max:"1",step:"0.01",value:a,class:"xpl-input-color__slider xpl-input-color__alpha",name:"color-alpha-slider",ref:t=>{this.colorInputElements.alpha=t??void 0},style:{backgroundImage:[`linear-gradient(to right, rgb(${t} ${e} ${i} / 0) 0%, rgb(${t} ${e} ${i} / 1) 100%)`,"linear-gradient(45deg, #ccc 25%, transparent 25%)","linear-gradient(-45deg, #ccc 25%, transparent 25%)","linear-gradient(45deg, transparent 75%, #ccc 75%)","linear-gradient(-45deg, transparent 75%, #ccc 75%)"].join(", ")}}),s("div",{key:"b4953565664df14ad483f30c45b6ae5e717e6a63",class:"xpl-input-color__preview",style:{background:`rgba(${t}, ${e}, ${i}, ${a})`}})),s("div",{key:"731a00aa7075efc1a19849a58e5a81c8837ab199",class:"xpl-input-color__inputs"},["hex","r","g","b","a"].map((t=>s("xpl-input",{key:t,label:t.toLocaleUpperCase(),name:`color-${t}-input`,placeholder:"hex"===t?"793EF7":"0",value:String(this.colorValues[t]),ref:e=>{this.colorInputElements[t]=e??void 0}})))))))}static get watchers(){return{colorValues:[{valueChanged:0}],hasErrorState:[{onHasErrorStateChanged:0}],value:[{onValuePropChange:0}]}}},[0,"xpl-input-color",{value:[1],placeholder:[1],disabled:[4],required:[4],hideEyeDropper:[4,"hide-eye-dropper"],hasErrorState:[32],colorValues:[32],eyeDropperSupported:[32],hue:[32]},void 0,{colorValues:[{valueChanged:0}],hasErrorState:[{onHasErrorStateChanged:0}],value:[{onValuePropChange:0}]}]);function A(){"undefined"!=typeof customElements&&["xpl-input-color","xpl-icon","xpl-input","xpl-input-color","xpl-input-date","xpl-input-file","xpl-input-phone","xpl-input-search","xpl-input-time","xpl-popover"].forEach((t=>{switch(t){case"xpl-input-color":customElements.get(a(t))||customElements.define(a(t),O);break;case"xpl-icon":customElements.get(a(t))||c();break;case"xpl-input":customElements.get(a(t))||P();break;case"xpl-input-color":customElements.get(a(t))||A();break;case"xpl-input-date":customElements.get(a(t))||d();break;case"xpl-input-file":customElements.get(a(t))||u();break;case"xpl-input-phone":customElements.get(a(t))||F();break;case"xpl-input-search":customElements.get(a(t))||m();break;case"xpl-input-time":customElements.get(a(t))||M();break;case"xpl-popover":customElements.get(a(t))||f()}}))}const V=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.blurEvent=i(this,"blurEvent",7),this.focusEvent=i(this,"focusEvent",7),this.inputEvent=i(this,"inputEvent",7),this.search=i(this,"search",7),this.valueChange=i(this,"valueChange",7),this.multiline=!1,this.dateFormat="Y-m-d",this.timeFormat="24h",this.allowCustomOption=!1,this.mode="single",this.accept="",this.multiple=!1,this.hideTriggerOnSelect=!1,this.hideFileNames=!1,this.hideAcceptText=!1,this.defaultCountry="US",this.isInternational=!0,this.ariaLabel="",this.type="text",this.handleChildValueChange=t=>{t.stopPropagation(),this.valueChange.emit(t.detail)},this.valueChanged=t=>{this.valueChange.emit(t.target.value)},this.characterCount=0,this.passwordVisible=!1,this.hasPreSlotContent=!1,this.handleBlur=t=>{this.blurEvent.emit(t)},this.handleFocus=t=>{this.focusEvent.emit(t)},this.handleInput=t=>{this.multiline&&this.updateCharacterCount();const{value:e}=t.target;this.inputEvent.emit(e)},this.handleSearchBlurForward=t=>{const{detail:e}=t;e&&(t.stopPropagation(),this.blurEvent.emit(e))},this.handleSearchCommit=t=>{t.stopPropagation(),this.search.emit(t.detail)},this.handleSearchFocusForward=t=>{const{detail:e}=t;e&&(t.stopPropagation(),this.focusEvent.emit(e))}}connectedCallback(){this.syncPreSlotContent(),this.connectPreSlotObserver()}disconnectedCallback(){void 0!==this.preSlotSyncTimeoutId&&(clearTimeout(this.preSlotSyncTimeoutId),this.preSlotSyncTimeoutId=void 0),this.disconnectPreSlotObserver()}componentWillLoad(){null!=this._id&&""!==this._id||(this._id=b()),this.multiline&&void 0!==this.maxCharacterCount&&(this.characterCount=void 0!==this.value?this.value.length:0),this.syncPreSlotContent()}componentWillRender(){this.disconnectPreSlotObserver()}componentDidRender(){this.schedulePreSlotSync()}async setFocus(){"search"!==this.type?this.input?.focus():await(this.searchInputRef?.setFocus())}connectPreSlotObserver(){this.disconnectPreSlotObserver(),this.multiline||"search"===this.type||"undefined"==typeof MutationObserver||(this.preSlotObserver=new MutationObserver((()=>{this.schedulePreSlotSync()})),this.preSlotObserver.observe(this.el,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["slot"]}))}disconnectPreSlotObserver(){this.preSlotObserver?.disconnect(),this.preSlotObserver=void 0}schedulePreSlotSync(){void 0!==this.preSlotSyncTimeoutId&&clearTimeout(this.preSlotSyncTimeoutId),this.preSlotSyncTimeoutId=setTimeout((()=>{this.preSlotSyncTimeoutId=void 0,this.el.isConnected&&(this.syncPreSlotContent(),this.connectPreSlotObserver())}),0)}syncPreSlotContent(){if(this.multiline||"search"===this.type)return;const t=Array.from(this.el.querySelectorAll('[slot="pre"]')).some((t=>t.closest("xpl-input")===this.el));t!==this.hasPreSlotContent&&(this.hasPreSlotContent=t)}updateCharacterCount(){this.characterCount=this.input?.value.length??0}renderInput(){switch(this.type){case"file":return s("xpl-input-file",{accept:this.accept,disabled:this.disabled,hideAcceptText:this.hideAcceptText,hideFileNames:this.hideFileNames,hideTriggerOnSelect:this.hideTriggerOnSelect,multiple:this.multiple,name:this.name,onInputChange:this.handleChildValueChange,_id:this._id},s("slot",{name:"trigger"}));case"color":return s("xpl-input-color",{disabled:this.disabled,value:this.value,placeholder:this.placeholder,required:this.required,hideEyeDropper:this.hideEyeDropper,onInputChange:this.handleChildValueChange});case"date":return s("xpl-input-date",{inputId:this._id,disabled:this.disabled,name:this.name,required:this.required,readonly:this.readonly,value:this.value,placeholder:this.placeholder,post:this.post,pre:this.pre,max:this.max,min:this.min,dateFormat:this.dateFormat,mode:this.mode,onValueChange:this.handleChildValueChange});case"time":return s("xpl-input-time",{inputId:this._id,disabled:this.disabled,name:this.name,required:this.required,readonly:this.readonly,value:this.value,placeholder:this.placeholder,max:this.max,min:this.min,step:this.step,mode:this.mode,timeFormat:this.timeFormat,allowCustomOption:this.allowCustomOption,onValueChange:this.handleChildValueChange});case"phone":return s("xpl-input-phone",{inputId:this._id,disabled:this.disabled,error:void 0!==this.error,name:this.name,required:this.required,readonly:this.readonly,value:this.value,placeholder:this.placeholder,defaultCountry:this.defaultCountry,preferredCountries:this.preferredCountries,isInternational:this.isInternational,onValueChange:this.handleChildValueChange});case"search":{const t=Boolean((this.label??"").trim()),e=void 0!==this.error,i=e&&(this.error?.length??0)>0;return s("xpl-input-search",{ariaLabel:(this.ariaLabel??"").trim()||"Search",autocomplete:this.autocomplete??"off",disabled:this.disabled,errorMessageId:i?`${this._id}-error`:void 0,hasError:e,hasVisibleLabel:t,inputId:this._id??"",name:this.name,onBlurEvent:this.handleSearchBlurForward,onFocusEvent:this.handleSearchFocusForward,onSearch:this.handleSearchCommit,onValueChange:this.handleChildValueChange,placeholder:this.placeholder??"Search",readonly:this.readonly,ref:t=>{this.searchInputRef=t??void 0},required:this.required,shape:this.shape??"rounded",value:this.value??""})}default:return s("div",{class:"xpl-input-wrapper"},!this.multiline&&s("label",{class:{"xpl-input-pre":!0,"xpl-input-pre--hidden":!this.pre&&!this.hasPreSlotContent},htmlFor:this._id},s("slot",{name:"pre"},this.pre)),this.multiline?s("textarea",{disabled:this.disabled,id:this._id,name:this.name,placeholder:this.placeholder,readonly:this.readonly,ref:t=>{this.input=t??void 0},required:this.required,onChange:this.valueChanged,onFocus:this.handleFocus,onBlur:this.handleBlur,onInput:this.handleInput},this.value):s("input",{autocomplete:this.autocomplete,disabled:this.disabled,id:this._id,max:this.max,min:this.min,name:this.name,placeholder:this.placeholder,readonly:this.readonly,ref:t=>{this.input=t??void 0},required:this.required,step:this.step,type:this.type,value:this.value,onChange:this.valueChanged,onFocus:this.handleFocus,onBlur:this.handleBlur,onInput:this.handleInput}),"password"===this.type&&s("button",{"aria-label":"Toggle password visibility",class:"xpl-input-password",onClick:()=>{this.passwordVisible=!this.passwordVisible},role:"presentation"},s("xpl-icon",{icon:this.passwordVisible?"eye-closed":"eye",size:24})),this.post&&!this.multiline&&s("label",{class:"xpl-input-post",htmlFor:this._id},this.post),this.multiline&&void 0!==this.maxCharacterCount&&s("span",{class:"xpl-input-characters"},this.characterCount,"/",this.maxCharacterCount))}}render(){let t=!1;return(void 0!==this.error||this.multiline&&void 0!==this.maxCharacterCount&&this.characterCount>this.maxCharacterCount)&&(t=!0),s(n,{key:"a276769b767bc7df63e2701697600c0ecbfa593e",class:{"xpl-input":!0,"xpl-input--disabled":!!this.disabled,"xpl-input--error":t,"xpl-input--readonly":!!this.readonly,[`xpl-input--${this.type}`]:!0}},this.label&&s("label",{key:"1686d1f5c9fc573929190bc1a04bf9efd2ad6957",class:"xpl-input-label",htmlFor:this._id},this.label,this.description&&s("small",{key:"1f74f68e8eeae5186e50ace2e96a9896b022fa30"},this.description)),this.renderInput(),(this.error?.length??0)>0&&s("label",{key:"2ee7de8b1dcb4cc27d7dcf8b34be66727ace1bfe",class:"xpl-input-error",htmlFor:this._id,id:`${this._id}-error`},s("xpl-icon",{key:"d3965b339f2d24dec0fdde367e76aacfefd25061",icon:"circle-warning",size:16}),s("span",{key:"b6269e3f122a53980438c21cfbda2e18b3c77a7e"},this.error)))}get el(){return this}},[260,"xpl-input",{_id:[1],description:[1],disabled:[4],error:[1],label:[1],name:[1],required:[4],readonly:[4],value:[1],autocomplete:[1],placeholder:[1],post:[1],pre:[1],max:[8],min:[8],step:[2],multiline:[4],maxCharacterCount:[2,"max-character-count"],dateFormat:[1,"date-format"],timeFormat:[1,"time-format"],allowCustomOption:[4,"allow-custom-option"],mode:[1],accept:[1],multiple:[4],hideTriggerOnSelect:[4,"hide-trigger-on-select"],hideFileNames:[4,"hide-file-names"],hideAcceptText:[4,"hide-accept-text"],hideEyeDropper:[4,"hide-eye-dropper"],defaultCountry:[1,"default-country"],preferredCountries:[16],isInternational:[4,"is-international"],ariaLabel:[1,"aria-label"],shape:[1],type:[1],characterCount:[32],passwordVisible:[32],hasPreSlotContent:[32],setFocus:[64]}]);function P(){"undefined"!=typeof customElements&&["xpl-input","xpl-dropdown","xpl-dropdown-group","xpl-dropdown-heading","xpl-dropdown-option","xpl-icon","xpl-input","xpl-input-color","xpl-input-date","xpl-input-file","xpl-input-phone","xpl-input-search","xpl-input-time","xpl-popover"].forEach((t=>{switch(t){case"xpl-input":customElements.get(a(t))||customElements.define(a(t),V);break;case"xpl-dropdown":customElements.get(a(t))||o();break;case"xpl-dropdown-group":customElements.get(a(t))||r();break;case"xpl-dropdown-heading":customElements.get(a(t))||h();break;case"xpl-dropdown-option":customElements.get(a(t))||l();break;case"xpl-icon":customElements.get(a(t))||c();break;case"xpl-input":customElements.get(a(t))||P();break;case"xpl-input-color":customElements.get(a(t))||A();break;case"xpl-input-date":customElements.get(a(t))||d();break;case"xpl-input-file":customElements.get(a(t))||u();break;case"xpl-input-phone":customElements.get(a(t))||F();break;case"xpl-input-search":customElements.get(a(t))||m();break;case"xpl-input-time":customElements.get(a(t))||M();break;case"xpl-popover":customElements.get(a(t))||f()}}))}export{V as I,O as a,A as b,D as c,P as d,F as e,_ as f,M as g}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as e,H as l,h as t,c as s,t as a}from"./p-BSHdGbmH.js";const d="data-xpl-table-cell-managed-disabled",i=e(class extends l{constructor(e){super(),!1!==e&&this.__registerHost(),this.align="left",this.bold=!1,this.disabled=!1,this.underline=!1}onDisabledChange(){this.propagateDisabledToSlotted()}componentDidLoad(){this.propagateDisabledToSlotted()}propagateDisabledToSlotted(){const e=e=>{if(!function(e){if("disabled"in e)return!0;switch(e.tagName){case"BUTTON":case"INPUT":case"SELECT":case"TEXTAREA":case"FIELDSET":case"OPTGROUP":case"OPTION":return!0;default:return!1}}(e))return;const l=e;if(this.disabled){if(l.disabled)return;return l.disabled=!0,l.setAttribute("disabled",""),void l.setAttribute(d,"")}l.hasAttribute(d)&&(l.disabled=!1,l.removeAttribute("disabled"),l.removeAttribute(d))},l=t=>{Array.from(t.children).forEach((t=>{"XPL-TABLE"!==t.tagName&&(e(t),l(t))}))};l(this.el)}render(){return t(s,{key:"f4e7639b0cb35eda08fdbb13cf1e0ddcb380cb7a",role:"gridcell",class:{"xpl-table-cell":!0,[`xpl-table-cell--align-${this.align}`]:!0,"xpl-table-cell--bold":this.bold,"xpl-table-cell--underline":this.underline,"xpl-table-cell--disabled":this.disabled}},t("slot",{key:"16d9a63cb992b9bbeb56500b5d6537b824336b40"}))}get el(){return this}static get watchers(){return{disabled:[{onDisabledChange:0}]}}},[260,"xpl-table-cell",{align:[1],bold:[4],disabled:[4],underline:[4]},void 0,{disabled:[{onDisabledChange:0}]}]);function n(){"undefined"!=typeof customElements&&["xpl-table-cell"].forEach((e=>{"xpl-table-cell"===e&&(customElements.get(a(e))||customElements.define(a(e),i))}))}export{i as X,n as d}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as t,p as e,H as o,c as s,t as l}from"./p-BSHdGbmH.js";const i=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"13"},t("path",{d:"M0.5 5h15l-7.5 7.5L0.5 5Z",fill:"white",stroke:"none",class:"xpl-tooltip-arrow__fill"}),t("path",{d:"M0.5 5 L8 12.5 L15.5 5",fill:"none",stroke:"black","stroke-width":"1",class:"xpl-tooltip-arrow__stroke"})),a=e(class extends o{constructor(t){super(),!1!==t&&this.__registerHost(),this.position="top-middle",this.hideArrow=!1}render(){return t(s,{key:"916a12e608a6e40c40ddfdbe40f12e115215758e"},t("div",{key:"2f6c39a146fb2ba830306933309ffad9e8919eab",class:"xpl-tooltip-container"},t("slot",{key:"39b1b2cf370620b96fd00b6343dc0896791ad510"}),t("div",{key:"34198d0f1184a3e05236a508e94531f503309691",class:`xpl-tooltip xpl-tooltip--${this.position}`},this.text,!this.hideArrow&&t("div",{key:"42f42b07b4f0ae6bd7cbd31837e4846a28ed4e72",class:"xpl-tooltip-arrow"},t(i,{key:"af8672da89cda34507e53906937e600400b26953"})))))}},[260,"xpl-tooltip",{text:[1],position:[1],hideArrow:[4,"hide-arrow"]}]);function d(){"undefined"!=typeof customElements&&["xpl-tooltip"].forEach((t=>{"xpl-tooltip"===t&&(customElements.get(l(t))||customElements.define(l(t),a))}))}export{a as T,d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as t,H as s,d as i,h as a,c as e,t as h}from"./p-BSHdGbmH.js";import{d as n}from"./p-
|
|
1
|
+
import{p as t,H as s,d as i,h as a,c as e,t as h}from"./p-BSHdGbmH.js";import{d as n}from"./p-CQjJIHK6.js";const g=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.close=i(this,"close",7),this.tagDragEnd=i(this,"tagDragEnd",7),this.tagDragStart=i(this,"tagDragStart",7),this.tagRemove=i(this,"tagRemove",7),this.dismissAriaLabelSuffix="tag",this.isDragging=!1,this.disabled=!1,this.dismissible=!0,this.isDraggable=!1,this.size="default",this.handleTagClick=()=>{this.disabled||this.isDraggable||this.close.emit()},this.setDragPreviewToHost=t=>{if(t.dataTransfer)try{const s=this.el.getBoundingClientRect(),i=Math.max(0,t.clientX-s.left),a=Math.max(0,t.clientY-s.top);t.dataTransfer.setDragImage(this.el,i,a)}catch{}},this.handleContentKeyDown=t=>{this.disabled||"Enter"!==t.key&&" "!==t.key||t.preventDefault()},this.handleDismissClick=t=>{t.stopPropagation(),this.disabled||(this.close.emit(),this.tagRemove.emit())},this.handleDragStart=t=>{this.isDragging=!0,t.dataTransfer&&(t.dataTransfer.effectAllowed="move",this.setDragPreviewToHost(t),this.tagId&&t.dataTransfer.setData("application/x-tag-id",this.tagId),t.dataTransfer.setData("text/plain",this.getContentLabelText())),this.tagDragStart.emit({tagId:this.tagId,content:this.getContentLabelText(),originalEvent:t})},this.handleDragEnd=t=>{this.isDragging=!1,this.tagDragEnd.emit({tagId:this.tagId,dropped:"move"===t.dataTransfer?.dropEffect,originalEvent:t})},this.handleDragOver=t=>{!this.disabled&&this.isDraggable&&(t.preventDefault(),t.dataTransfer&&(t.dataTransfer.dropEffect="move"))},this.handleDragEnter=t=>{!this.disabled&&this.isDraggable&&t.preventDefault()},this.handleHostDragStart=t=>{t.target===this.el&&this.isDraggable&&t.preventDefault()}}onDisabledChange(t){t&&this.isDragging&&(this.isDragging=!1)}onIsDraggableChange(t){!t&&this.isDragging&&(this.isDragging=!1)}componentDidRender(){queueMicrotask((()=>this.syncDismissAriaLabelSuffix()))}getContentLabelText(){return(this.el.querySelector(".xpl-tag__content")?.textContent??"").trim()}syncDismissAriaLabelSuffix(){if(!this.el.isConnected)return;const t=this.getContentLabelText(),s=""===t?"tag":t;s!==this.dismissAriaLabelSuffix&&(this.dismissAriaLabelSuffix=s)}render(){const t=this.isDraggable&&!this.disabled;return a(e,{key:"9a05e10e7fbc047112f740884e6ba40c773b472c",class:{"xpl-tag":!0,"xpl-tag-container":!0,"xpl-tag--disabled":this.disabled,"xpl-tag--dismissible":this.dismissible,"xpl-tag--dragging":this.isDragging,"xpl-tag--draggable":t,"xpl-tag--sm":"sm"===this.size},onDragOver:t?this.handleDragOver:void 0,onDragEnter:t?this.handleDragEnter:void 0,onDragStart:this.isDraggable?this.handleHostDragStart:void 0},t?a("div",{class:"xpl-tag__content xpl-tag",role:"button",tabIndex:0,draggable:!0,"aria-grabbed":String(this.isDragging),onClick:this.handleTagClick,onKeyDown:this.handleContentKeyDown,onDragStart:this.handleDragStart,onDragEnd:this.handleDragEnd},a("slot",null)):a("button",{class:"xpl-tag__content xpl-tag",type:"button",disabled:this.disabled,onClick:this.handleTagClick},a("slot",null)),this.dismissible&&a("button",{key:"37f7687aa9675c52cbd4390d66d63ced630904d0",class:"xpl-tag__dismiss xpl-tag__close",type:"button",draggable:!1,disabled:this.disabled,"aria-label":`Dismiss ${this.dismissAriaLabelSuffix}`,onClick:this.handleDismissClick},a("xpl-icon",{key:"104eac0362541d99c59e0fd6b18a5e1b2171030b",icon:"xmark",size:10})))}get el(){return this}static get watchers(){return{disabled:[{onDisabledChange:0}],isDraggable:[{onIsDraggableChange:0}]}}},[260,"xpl-tag",{disabled:[4],dismissible:[4],isDraggable:[4,"is-draggable"],size:[1],tagId:[1,"tag-id"],dismissAriaLabelSuffix:[32],isDragging:[32]},void 0,{disabled:[{onDisabledChange:0}],isDraggable:[{onIsDraggableChange:0}]}]);function l(){"undefined"!=typeof customElements&&["xpl-tag","xpl-icon"].forEach((t=>{switch(t){case"xpl-tag":customElements.get(h(t))||customElements.define(h(t),g);break;case"xpl-icon":customElements.get(h(t))||n()}}))}export{g as T,l as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as s,H as t,d as i,h as e,c as h,t as
|
|
1
|
+
import{p as s,H as t,d as i,h as e,c as h,t as r}from"./p-BSHdGbmH.js";import{d as a}from"./p-CQjJIHK6.js";const n=s(class extends t{constructor(s){super(),!1!==s&&this.__registerHost(),this.blurEvent=i(this,"blurEvent",7),this.focusEvent=i(this,"focusEvent",7),this.inputEvent=i(this,"inputEvent",7),this.search=i(this,"search",7),this.valueChange=i(this,"valueChange",7),this.hasAncestorForm=!1,this.ariaLabel="Search",this.autocomplete="off",this.disabled=!1,this.hasError=!1,this.hasVisibleLabel=!1,this.placeholder="Search",this.readonly=!1,this.required=!1,this.shape="rounded",this.value="",this.handleInnerFormSubmit=s=>{s.preventDefault(),this.disabled||this.readonly||this.emitSearchCommit(this.value.trim())},this.handleClear=s=>{s.preventDefault(),this.disabled||this.readonly||(this.value="",this.valueChange.emit(""),this.inputEvent.emit(""),this.inputEl?.focus())},this.handleInput=s=>{const t=s.target;this.value=t.value,this.valueChange.emit(t.value),this.inputEvent.emit(t.value)},this.handleKeyDown=s=>{"Enter"===s.key&&(this.disabled||this.readonly||s.target.form||(s.preventDefault(),this.emitSearchCommit(this.value.trim())))},this.handleFocus=s=>{this.focusEvent.emit(s)},this.handleBlur=s=>{this.blurEvent.emit(s)}}connectedCallback(){this.syncAncestorFormFlag()}async setFocus(){this.inputEl?.focus()}syncAncestorFormFlag(){const s=this.el,t=Boolean(s&&"function"==typeof s.closest&&s.closest("form"));this.hasAncestorForm!==t&&(this.hasAncestorForm=t)}get hasValue(){return void 0!==this.value&&this.value.length>0}get resolvedInputAriaLabel(){if(!this.hasVisibleLabel)return(this.ariaLabel??"").trim()||"Search"}get rendersInnerSearchForm(){return!this.hasAncestorForm}emitSearchCommit(s){this.search.emit(s)}renderShell(){const s=e("div",{class:"xpl-input-search__shell"},e("span",{class:"xpl-input-search__icon","aria-hidden":"true"},e("xpl-icon",{icon:"magnifier",size:20})),e("input",{"aria-describedby":this.hasError?this.errorMessageId:void 0,"aria-invalid":this.hasError?"true":void 0,"aria-label":this.resolvedInputAriaLabel,autocomplete:this.autocomplete,class:"xpl-input-search__input",disabled:this.disabled,id:this.inputId,name:this.name,onBlur:this.handleBlur,onFocus:this.handleFocus,onInput:this.handleInput,onKeyDown:this.handleKeyDown,placeholder:this.placeholder,readonly:this.readonly,ref:s=>{this.inputEl=s??void 0},required:this.required,role:"searchbox",type:"text",value:this.value}),e("button",{"aria-hidden":this.hasValue?void 0:"true","aria-label":"Clear search",class:"xpl-input-search__clear",disabled:this.disabled||this.readonly,onClick:this.handleClear,type:"button"},e("xpl-icon",{icon:"circle-xmark",size:16})));return this.rendersInnerSearchForm?e("form",{class:"xpl-input-search__form",onSubmit:this.handleInnerFormSubmit},s):s}render(){return e(h,{key:"90b29d51b36655d1dc5f7fa9b67edf6382cb90af",class:{"xpl-input-search":!0,"xpl-input-search--disabled":this.disabled,"xpl-input-search--error":this.hasError,"xpl-input-search--has-value":this.hasValue,"xpl-input-search--readonly":this.readonly,"xpl-input-search--shape-box":"box"===this.shape}},this.renderShell())}get el(){return this}},[0,"xpl-input-search",{ariaLabel:[1,"aria-label"],autocomplete:[1],disabled:[4],errorMessageId:[1,"error-message-id"],hasError:[4,"has-error"],hasVisibleLabel:[4,"has-visible-label"],inputId:[1,"input-id"],name:[1],placeholder:[1],readonly:[4],required:[4],shape:[1],value:[1025],hasAncestorForm:[32],setFocus:[64]}]);function l(){"undefined"!=typeof customElements&&["xpl-input-search","xpl-icon"].forEach((s=>{switch(s){case"xpl-input-search":customElements.get(r(s))||customElements.define(r(s),n);break;case"xpl-icon":customElements.get(r(s))||a()}}))}export{n as I,l as d}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as o,H as e,h as p,c as d,t as s}from"./p-BSHdGbmH.js";import{d as a}from"./p-Dp62sBqX.js";import{d as r}from"./p-C0AbGd4t.js";import{d as n}from"./p-CQjJIHK6.js";const t=o(class extends e{constructor(o){super(),!1!==o&&this.__registerHost()}render(){const{groupName:o,options:e}=this,s=e&&e.length&&e.map((({groupName:o,...e})=>o?p("xpl-dropdown-group",{label:o,...e}):p("xpl-dropdown-option",{...e})));return p(d,{key:"765c69b589275544bc312a60036a22345509b105",role:"group","aria-label":o},p("li",{key:"6dfa766bd675e0579e8608aa0b202f63e2be2635",class:"xpl-dropdown-list-item"},p("xpl-dropdown-heading",{key:"42cb1a573126edee7f1a01397988d6e9d952ead3",label:o}),p("ul",{key:"f443eba9c19554eea7997a47252816a39660d9a7",class:"xpl-dropdown-list"},s||p("slot",{key:"60d3bff8026d96197a3482cd7e58807cfc02df2b",name:"options"}))))}},[260,"xpl-dropdown-group",{groupName:[1,"label"],options:[16]}]);function l(){"undefined"!=typeof customElements&&["xpl-dropdown-group","xpl-dropdown-group","xpl-dropdown-heading","xpl-dropdown-option","xpl-icon"].forEach((o=>{switch(o){case"xpl-dropdown-group":customElements.get(s(o))||customElements.define(s(o),t);break;case"xpl-dropdown-group":customElements.get(s(o))||l();break;case"xpl-dropdown-heading":customElements.get(s(o))||a();break;case"xpl-dropdown-option":customElements.get(s(o))||r();break;case"xpl-icon":customElements.get(s(o))||n()}}))}export{t as D,l as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,H as t,d as s,h as i,F as n,c as o,t as l}from"./p-BSHdGbmH.js";import{t as a}from"./p-CzwViN3U.js";import{i as h}from"./p-Dqb1pIRo.js";import{d as c}from"./p-
|
|
1
|
+
import{p as e,H as t,d as s,h as i,F as n,c as o,t as l}from"./p-BSHdGbmH.js";import{t as a}from"./p-CzwViN3U.js";import{i as h}from"./p-Dqb1pIRo.js";import{d as c}from"./p-2cJsJK3-.js";import{d}from"./p-BZIZSovL.js";import{d as r}from"./p-Dp62sBqX.js";import{d as p}from"./p-C0AbGd4t.js";import{d as u}from"./p-CQjJIHK6.js";import{d as m}from"./p-B7aaJikj.js";import{v as f}from"./p-CK3_k8jD.js";let b;function g(e){return e.label||e.value||""}function x(e){return e.value||e.label||""}function v(e){return e.flatMap((e=>e.groupName&&e.options?e.options:[e]))}const w=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.selectChange=s(this,"selectChange",7),this.changeEvent=s(this,"changeEvent",7),this.dropdownStateChange=s(this,"dropdownStateChange",7),this.triggerDropdown=s(this,"triggerDropdown",7),this.choices=[],this.selectIcon="chevron-down",this.dropdownPlacement="bottom-start",this.mode="single",this.truncate=!0,this.active=!1,this.id=f(),this.keepFocus=!1,this.visibleChoices=1/0,this.choicesState=[],this.value=this.calculateValue(),this.dropdownOpenState=!1,this.container=null,this.dropdown=null,this.handleResizeThrottled=a((()=>{this.maybeTruncateChoices()}),250),this.handleTabKeyDown=e=>{"Tab"===e.key&&(this.keepFocus=!0)},this.handleTagRemove=e=>{const t=t=>e?.value&&t.value===e.value||e?.label&&t.label===e.label;this.choicesState=this.choicesState.map((e=>({...e,isSelected:!t(e)&&e.isSelected,options:e.options?.map((e=>({...e,isSelected:!t(e)&&e.isSelected})))})))},this.handleDropdownScroll=e=>{const t=this.dropdown?.querySelector(".xpl-dropdown-list");if(!t)return;const{scrollTop:s,scrollHeight:i,clientHeight:n}=t;(0===s&&e.deltaY<0||s+n>=i&&e.deltaY>0)&&e.preventDefault()}}onChoicesPropChanged(e){this.choicesState=this.initializeChoicesState()}onSelectedValuesPropChanged(){this.choicesState=this.initializeChoicesState()}onChoicesStateChanged(){this.update()}handleValueStateChange(e){this.selectChange.emit(e),this.changeEvent.emit("single"===this.mode?e:e?.length?e.split("|"):[]),this.customDisplayValue&&null!==this.container&&(this.container.querySelectorAll(".custom-display-value").forEach((t=>{t.classList.toggle("display-active",e.length>0),t.classList.toggle("display-inactive",0===e.length)})),this.container.querySelectorAll(".placeholder").forEach((t=>{t.classList.toggle("placeholder-hidden",e.length>0)})))}onDropdownOpenStateChanged(e){this.dropdownStateChange.emit(e)}initializeChoicesState(){return(this.choices??[]).map((e=>{const t="string"==typeof this.selectedValues?[this.selectedValues]:this.selectedValues;return{...e,isSelected:e.isSelected||!0===t?.includes(x(e)),options:e.options?.map((e=>({...e,isSelected:e.isSelected||!0===t?.includes(x(e))})))}}))}maybeTruncateChoices(){if(!h())return;if("single"===this.mode||!this.truncate)return;const e=this.container?.getBoundingClientRect().width;let t=0,s=0;const i=v(this.choicesState)?.filter((e=>e.isSelected));if(!i.length)return;const n=i.length;i.forEach(((n,o)=>(s+=function(e){const t=h()?(void 0===b&&(b=document.createElement("canvas").getContext("2d"),b&&(b.font="14px apple-system, system-ui, 'Segoe UI', Arial, Helvetica, Roboto, sans-serif")),b):null;return t?t.measureText(e).width+44:0}(g(i[o])),s>(e??0)-140||(t+=1),null))),t>=n&&(t=1/0),t<1&&(t=1),this.visibleChoices=t}closeDropdown(){this.dropdown?.isOpen&&(this.dropdown.isOpen=!1,this.active=!1)}calculateValue(){const e=v(this.choicesState).filter((e=>e.isSelected));return e.length?"single"===this.mode?x(e[0]):e.map((e=>x(e))).join("|"):""}update(){this.value=this.calculateValue(),this.maybeTruncateChoices()}renderLabel(){return this.label||this.description?i("label",{class:{"xpl-label":!0,"xpl-label--disabled":!!this.disabled},htmlFor:this.id},this.label,this.description&&i("small",{class:{"xpl-description":!0,"xpl-description--disabled":!!this.disabled}},this.description)):null}renderSelectedTags(){let e=0;const t=v(this.choicesState).filter((e=>e.isSelected));return t.length?t.map(((s,n)=>e>=this.visibleChoices?null:(e+=1,i("xpl-tag",{onClose:()=>this.handleTagRemove(t[n])},g(t[n]))))):null}renderError(){return this.error?i("label",{class:"xpl-input-error",htmlFor:this.id},i("xpl-icon",{icon:"circle-warning"}),this.error):null}componentWillLoad(){this.choicesState=this.initializeChoicesState()}handleClickEvent(e){const t=e.target.closest(".xpl-select");null!==t&&t===this.container||this.closeDropdown()}handleKeyDown(e){"Escape"===e.key&&(this.active||this.container?.contains(document.activeElement))&&this.closeDropdown()}handleResize(){this.handleResizeThrottled()}componentDidLoad(){void 0!==this.truncateRafId&&cancelAnimationFrame(this.truncateRafId),this.truncateRafId=requestAnimationFrame((()=>{this.truncateRafId=void 0,this.maybeTruncateChoices()}))}disconnectedCallback(){this.handleResizeThrottled?.cancel(),void 0!==this.truncateRafId&&(cancelAnimationFrame(this.truncateRafId),this.truncateRafId=void 0)}handleDropdownTrigger(){if(this.disabled)return;const e=this.dropdown?.isOpen??!1,t=!e;this.triggerDropdown.emit({prevState:e,nextState:t}).defaultPrevented||(this.dropdownOpenState=t,this.dropdown&&(this.dropdown.isOpen=t))}async reset(){this.closeDropdown(),this.choicesState=this.choicesState.map((e=>({...e,isSelected:!1,options:e.options?.map((e=>({...e,isSelected:!1})))})))}render(){const e=v(this.choicesState).filter((e=>e.isSelected)),t=e[0]?.label||e[0]?.value,s=e.length>1&&this.visibleChoices<1/0&&this.truncate&&!this.customDisplayValue,l=`+ ${Math.abs(this.choicesState.filter((e=>e.isSelected)).length-this.visibleChoices)} more`;return i(o,{key:"62414ef316ff722af90623136e62c5f875e0bfc4",class:{"xpl-select":!0,"xpl-select--disabled":!!this.disabled,"xpl-select--no-truncate":!this.truncate,[this.classNames??""]:!!this.classNames},onKeyDown:this.handleTabKeyDown,ref:e=>{this.container=e}},this.renderLabel(),i("div",{key:"482e2b4e6df0db28031f12f8eeca802f31c36b9b",class:{"xpl-input":!0,"xpl-input--disabled":!!this.disabled,"xpl-input--error":void 0!==this.error}},i("div",{key:"dba46fe22c91e80c4ef7cc279deffb5d054f6d82",class:"xpl-input-wrapper"},i("button",{key:"9c0ff42202efcfe30a21b599b30271412dd7bba5",class:"xpl-select__trigger",disabled:this.disabled,id:this.id,onKeyDown:this.handleTabKeyDown,onClick:e=>{e.preventDefault(),this.handleDropdownTrigger()},type:"button"},i("div",{key:"81a43dce597ffd11cb06595361cfd30cc33d24b1",class:{"xpl-select-value":!0,"xpl-select-value--active":"multi"===this.mode&&this.value.length>0,"has-value":this.value.length>0}},(()=>this.customDisplayValue?i(n,null,i("div",{class:{"custom-display-value":!0,"custom-display-value--inactive":0===this.value.length}},i("slot",{name:"custom-display-value"})),i("span",{class:{"xpl-placeholder--hidden":this.value.length>0}},this.placeholder)):"single"===this.mode?t||this.placeholder:this.value.length>0?this.renderSelectedTags():this.placeholder)(),s&&l),i("xpl-icon",{key:"6edc9dcc1ff869d5c715ca143d05e4caac8664f9",class:"xpl-select__chevron-down",icon:this.selectIcon??"chevron-down"}))),!this.disabled&&i("xpl-dropdown",{key:"999afef231d38e5ab4271359ccbd71d85ffb65b9",ref:e=>{this.dropdown=e??null},isOpen:this.dropdownOpenState,options:this.choicesState,selectedValues:this.selectedValues,mode:this.mode,triggerId:this.id,update:(e,{component:t})=>{const{options:s}=t;s&&s.length>0&&(this.choicesState=s)},onIsOpenChange:e=>{this.dropdownOpenState=e.detail},onWheel:this.handleDropdownScroll,anchorToTrigger:!0,flipFallbackPlacements:this.dropdownFlipFallbackPlacements,placement:this.dropdownPlacement}),this.renderError()),i("input",{key:"f3c1f01d5077af5ac0d2612ce4538ac861a33ac5",type:"hidden",name:this.name,value:this.value}))}static get watchers(){return{choices:[{onChoicesPropChanged:0}],selectedValues:[{onSelectedValuesPropChanged:0}],choicesState:[{onChoicesStateChanged:0}],value:[{handleValueStateChange:0}],dropdownOpenState:[{onDropdownOpenStateChanged:0}]}}},[260,"xpl-select",{choices:[16],selectIcon:[1,"select-icon"],description:[1],disabled:[4],dropdownFlipFallbackPlacements:[16],dropdownPlacement:[1,"dropdown-placement"],error:[1],label:[1],mode:[1],name:[1],placeholder:[1],truncate:[4],customDisplayValue:[4,"custom-display-value"],selectedValues:[1,"selected-values"],classNames:[1,"class-names"],active:[32],id:[32],keepFocus:[32],visibleChoices:[32],choicesState:[32],value:[32],dropdownOpenState:[32],reset:[64]},[[8,"click","handleClickEvent"],[8,"keydown","handleKeyDown"],[9,"resize","handleResize"]],{choices:[{onChoicesPropChanged:0}],selectedValues:[{onSelectedValuesPropChanged:0}],choicesState:[{onChoicesStateChanged:0}],value:[{handleValueStateChange:0}],dropdownOpenState:[{onDropdownOpenStateChanged:0}]}]);function C(){"undefined"!=typeof customElements&&["xpl-select","xpl-dropdown","xpl-dropdown-group","xpl-dropdown-heading","xpl-dropdown-option","xpl-icon","xpl-tag"].forEach((e=>{switch(e){case"xpl-select":customElements.get(l(e))||customElements.define(l(e),w);break;case"xpl-dropdown":customElements.get(l(e))||c();break;case"xpl-dropdown-group":customElements.get(l(e))||d();break;case"xpl-dropdown-heading":customElements.get(l(e))||r();break;case"xpl-dropdown-option":customElements.get(l(e))||p();break;case"xpl-icon":customElements.get(l(e))||u();break;case"xpl-tag":customElements.get(l(e))||m()}}))}export{w as S,C as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as t,H as s,d as i,h as e,c as n,t as o}from"./p-BSHdGbmH.js";import{T as h,i as r}from"./p-Dqb1pIRo.js";import{d as a}from"./p-l3EZ-agL.js";const l="(max-width: 767px)",p="hoverClose",d=t(class t extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.navItemClick=i(this,"navItemClick",7),this.openChange=i(this,"openChange",7),this.dropdownPanelId=`xpl-top-nav-item-dropdown-${Math.random().toString(36).slice(2,11)}`,this.hoverOpened=!1,this.timers=new h,this.hasActiveDescendant=!1,this.hasDropdown=!1,this.isLeadingIconSlotPresent=!1,this.isMobileViewport=!1,this.hostListitemRole=!1,this.isTrailingIconSlotPresent=!1,this.active=!1,this.icon="",this.open=!1,this.openMode="click",this.selected=!1,this.onDocClickCapture=t=>{if(!this.hasDropdown||!this.open)return;const s=t.target;s&&!this.el.contains(s)&&(this.open=!1)},this.onDocKeyDownCapture=t=>{this.hasDropdown&&this.open&&"Escape"===t.key&&(t.preventDefault(),t.stopPropagation(),this.open=!1,this.focusTriggerAfterEscape())},this.handleClick=t=>{if(this.hasDropdown){if(t.preventDefault(),t.stopPropagation(),this.timers.clearCoalesced(p),this.open&&this.hoverOpened&&this.hoverModeActive()&&t.detail>0)return;return this.hoverOpened=!1,void(this.open=!this.open)}this.navItemClick.emit(t)},this.handleKeyDown=t=>{if(null!=this.href&&!this.hasDropdown&&" "===t.key){t.preventDefault();const s=this.el.querySelector(".xpl-top-nav-item__inner");s?.click()}},this.onMobileViewportChange=()=>{this.isMobileViewport=this.mobileMq?.matches??!1},this.handleMouseEnter=()=>{this.hasDropdown&&this.hoverModeActive()&&(this.timers.clearCoalesced(p),this.open||(this.hoverOpened=!0,this.open=!0))},this.handleMouseLeave=()=>{this.hasDropdown&&this.open&&this.hoverOpened&&this.timers.scheduleCoalesced(p,(()=>{this.hoverOpened&&!this.el.contains(this.el.ownerDocument.activeElement)&&(this.open=!1)}),150)}}onHasDropdownChanged(){this.hasDropdown||(this.open=!1),this.syncDropdownDocListeners()}onOpenChanged(t){this.openChange.emit(t),t||(this.hoverOpened=!1),t&&this.hasDropdown&&this.broadcastCloseOtherDropdownHosts()}connectedCallback(){r()&&"function"==typeof window.matchMedia&&(this.hoverOpenMq=window.matchMedia("(hover: hover) and (pointer: fine) and (min-width: 768px)"),this.mobileMq=window.matchMedia(l),this.mobileMq.addEventListener("change",this.onMobileViewportChange),this.isMobileViewport=this.mobileMq.matches),this.syncHostListitemRole(),this.syncHasDropdownFromDom(),this.syncDropdownDocListeners(),this.connectDropdownSlotObserver()}disconnectedCallback(){this.timers.dispose(),this.hoverOpenMq=void 0,this.mobileMq?.removeEventListener("change",this.onMobileViewportChange),this.mobileMq=void 0,this.disconnectDropdownSlotObserver(),this.disconnectListitemContextObservers();const t=this.el.ownerDocument;t.removeEventListener("click",this.onDocClickCapture,!0),t.removeEventListener("keydown",this.onDocKeyDownCapture,!0)}componentWillLoad(){this.syncHostListitemRole(),this.syncHasDropdownFromDom()}componentWillRender(){this.disconnectDropdownSlotObserver(),this.disconnectListitemContextObservers()}componentDidRender(){this.schedulePostRenderTopNavItemWork()}handleCloseNavDropdownRequest(){this.hasDropdown&&this.open&&(this.open=!1)}async closeMenu(){this.hasDropdown&&(this.open=!1)}async openMenu(){this.hasDropdown&&(this.timers.clearCoalesced(p),this.hoverOpened=!1,this.open=!0)}async toggleMenu(){this.hasDropdown&&(this.open=!this.open)}scheduleHasDropdownSyncFromObserver(){this.timers.scheduleCoalesced("hasDropdownSync",(()=>{this.el.isConnected&&this.syncHasDropdownFromDom()}))}connectDropdownSlotObserver(){this.disconnectDropdownSlotObserver(),"undefined"!=typeof MutationObserver&&(this.dropdownSlotObserver=new MutationObserver((()=>{this.scheduleHasDropdownSyncFromObserver()})),this.dropdownSlotObserver.observe(this.el,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["slot"]}))}disconnectDropdownSlotObserver(){this.dropdownSlotObserver?.disconnect(),this.dropdownSlotObserver=void 0}disconnectListitemContextObservers(){this.parentListitemContextObserver?.disconnect(),this.parentListitemContextObserver=void 0,this.selfListitemContextObserver?.disconnect(),this.selfListitemContextObserver=void 0}connectListitemContextObservers(){if(this.disconnectListitemContextObservers(),"undefined"==typeof MutationObserver||!this.el.isConnected)return;this.selfListitemContextObserver=new MutationObserver((()=>{this.schedulePostRenderTopNavItemWork()})),this.selfListitemContextObserver.observe(this.el,{attributes:!0,attributeFilter:["class","slot"]});const t=this.el.parentElement;if(t){this.parentListitemContextObserver=new MutationObserver((()=>{this.schedulePostRenderTopNavItemWork()}));const s="xpl-top-nav"===t.tagName.toLowerCase()&&"left-aside"===this.el.getAttribute("slot")?t.querySelector(".xpl-top-nav__left-primary"):null;this.parentListitemContextObserver.observe(s??t,{attributes:!0,attributeFilter:["role"],subtree:!1})}}schedulePostRenderTopNavItemWork(){this.timers.scheduleCoalesced("postRender",(()=>{this.el.isConnected&&(this.syncHostListitemRole(),this.syncHasDropdownFromDom(),this.connectListitemContextObservers(),this.connectDropdownSlotObserver())}))}syncDropdownDocListeners(){if(!r())return;const t=this.el.ownerDocument;t.removeEventListener("click",this.onDocClickCapture,!0),t.removeEventListener("keydown",this.onDocKeyDownCapture,!0),this.hasDropdown&&(t.addEventListener("click",this.onDocClickCapture,!0),t.addEventListener("keydown",this.onDocKeyDownCapture,!0))}hasSlottedChildOwnedByThisHost(t){return Array.from(this.el.querySelectorAll(`[slot="${t}"]`)).some((t=>t.closest("xpl-top-nav-item")===this.el))}syncHasDropdownFromDom(){const t=null!=this.el.querySelector('[slot="dropdown"]');t!==this.hasDropdown&&(this.hasDropdown=t);const s=this.hasSlottedChildOwnedByThisHost("leading-icon");s!==this.isLeadingIconSlotPresent&&(this.isLeadingIconSlotPresent=s);const i=this.hasSlottedChildOwnedByThisHost("trailing-icon");i!==this.isTrailingIconSlotPresent&&(this.isTrailingIconSlotPresent=i);const e=!!t&&(null!==this.el.querySelector('[slot="dropdown"] .xpl-top-nav-item--active')||null!==this.el.querySelector('[slot="dropdown"] .xpl-top-nav-item--selected'));e!==this.hasActiveDescendant&&(this.hasActiveDescendant=e)}getNavDropdownBroadcastRoot(){return this.el.closest("xpl-top-nav-menu")??this.el.closest("xpl-nav-header-menu")??this.el.closest("xpl-top-nav")??this.el.ownerDocument}broadcastCloseOtherDropdownHosts(){this.getNavDropdownBroadcastRoot().querySelectorAll("xpl-top-nav-item").forEach((t=>{t!==this.el&&t.parentElement===this.el.parentElement&&t.dispatchEvent(new CustomEvent("_xplCloseNavDropdown",{bubbles:!1}))}))}hoverModeActive(){return"hover"===this.openMode&&(this.hoverOpenMq?.matches??!1)}focusTriggerAfterEscape(){this.timers.scheduleCoalesced("focusTriggerAfterEscape",(()=>{this.el.isConnected&&this.el.querySelector(".xpl-top-nav-item__inner")?.focus()}))}static isInternalRenderedHostChild(t){return t.classList.contains("xpl-top-nav-item__inner")||t.classList.contains("xpl-top-nav-item__dropdown")}hasNonDropdownLightDomChild(){return Array.from(this.el.childNodes).some((s=>{if(s.nodeType===Node.TEXT_NODE)return Boolean(s.textContent?.trim());if(s.nodeType===Node.ELEMENT_NODE){const i=s;if(t.isInternalRenderedHostChild(i))return!1;const e=i.getAttribute("slot");return null==e||""===e}return!1}))}getInnerAriaLabel(){if(this.label?.trim())return;if(this.hasNonDropdownLightDomChild())return;const t=this.itemAriaLabel?.trim();return t||(this.icon?.trim()||this.isLeadingIconSlotPresent?"Navigation item":void 0)}computeHostListitemRole(){const{el:t}=this;if(t.classList.contains("xpl-top-nav__brand"))return!1;if("right-aside-mobile"===t.getAttribute("slot"))return!1;const s=t.parentElement;return"list"===s?.getAttribute("role")||null!=s&&"xpl-nav-header-menu"===s.tagName.toLowerCase()||null!=s&&"xpl-top-nav-menu"===s.tagName.toLowerCase()||"left-aside"===t.getAttribute("slot")&&"xpl-top-nav"===s?.tagName.toLowerCase()&&null!=s.querySelector('.xpl-top-nav__left-primary[role="list"]')}syncHostListitemRole(){const t=this.computeHostListitemRole();this.hostListitemRole!==t&&(this.hostListitemRole=t)}renderLabelContent(){if(!this.label)return e("slot",null);const t=this.description?.trim();return t?e("span",{class:"xpl-top-nav-item__label-group"},e("span",{class:"xpl-top-nav-item__label",title:this.label},this.label),e("span",{class:"xpl-top-nav-item__description"},t)):e("span",{class:"xpl-top-nav-item__label",title:this.label},this.label)}renderLeading(){return this.isLeadingIconSlotPresent?e("span",{class:"xpl-top-nav-item__leading"},e("slot",{name:"leading-icon"})):this.icon?e("span",{class:"xpl-top-nav-item__leading"},e("xpl-icon",{size:16,icon:this.icon})):null}renderTrailing(){return this.isTrailingIconSlotPresent?e("span",{class:"xpl-top-nav-item__trailing"},e("slot",{name:"trailing-icon"})):this.hasDropdown?e("span",{class:"xpl-top-nav-item__trailing"},e("xpl-icon",{icon:this.isMobileViewport?"chevron-right":"chevron-down"})):null}renderInner(){const t=this.selected?"page":void 0,s=this.hasDropdown?this.open?"true":"false":void 0,i=this.getInnerAriaLabel(),n={class:"xpl-top-nav-item__inner",tabIndex:0,"aria-current":t,"aria-expanded":s,"aria-haspopup":this.hasDropdown?"true":void 0,"aria-controls":this.hasDropdown?this.dropdownPanelId:void 0,...i?{"aria-label":i}:{},onClick:this.handleClick,onKeyDown:this.handleKeyDown};return null==this.href||this.hasDropdown?e("button",{...n,type:"button"},this.renderLeading(),this.renderLabelContent(),this.renderTrailing()):e("a",{...n,href:this.href},this.renderLeading(),this.renderLabelContent(),this.renderTrailing())}render(){return e(n,{key:"f895d73fc0f4c07150e9cd1c34d7b78a338a2032",class:{"xpl-top-nav-item":!0,"xpl-top-nav-item--active":this.active,"xpl-top-nav-item--dropdown-open":this.hasDropdown&&this.open,"xpl-top-nav-item--has-active-descendant":this.hasActiveDescendant,"xpl-top-nav-item--has-dropdown":this.hasDropdown,"xpl-top-nav-item--selected":this.selected,dark:!0},onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,...this.hostListitemRole?{role:"listitem"}:{}},this.renderInner(),this.hasDropdown&&e("div",{key:"3ec121421a45b3e5ef00f3fe76be80c910759f02",id:this.dropdownPanelId,class:"xpl-top-nav-item__dropdown"},e("slot",{key:"715393a7ba3474c1afc9e0aa29276335537021e5",name:"dropdown"})))}get el(){return this}static get watchers(){return{hasDropdown:[{onHasDropdownChanged:0}],open:[{onOpenChanged:0}]}}},[260,"xpl-top-nav-item",{active:[516],description:[1],href:[1],icon:[1],itemAriaLabel:[1,"item-aria-label"],label:[1],open:[1540],openMode:[513,"open-mode"],selected:[516],hasActiveDescendant:[32],hasDropdown:[32],isLeadingIconSlotPresent:[32],isMobileViewport:[32],hostListitemRole:[32],isTrailingIconSlotPresent:[32],closeMenu:[64],openMenu:[64],toggleMenu:[64]},[[0,"_xplCloseNavDropdown","handleCloseNavDropdownRequest"]],{hasDropdown:[{onHasDropdownChanged:0}],open:[{onOpenChanged:0}]}]);function c(){"undefined"!=typeof customElements&&["xpl-top-nav-item","xpl-icon"].forEach((t=>{switch(t){case"xpl-top-nav-item":customElements.get(o(t))||customElements.define(o(t),d);break;case"xpl-icon":customElements.get(o(t))||a()}}))}export{d as T,l as a,c as d}
|
|
1
|
+
import{p as t,H as s,d as i,h as e,c as n,t as o}from"./p-BSHdGbmH.js";import{T as h,i as r}from"./p-Dqb1pIRo.js";import{d as a}from"./p-CQjJIHK6.js";const l="(max-width: 767px)",p="hoverClose",d=t(class t extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.navItemClick=i(this,"navItemClick",7),this.openChange=i(this,"openChange",7),this.dropdownPanelId=`xpl-top-nav-item-dropdown-${Math.random().toString(36).slice(2,11)}`,this.hoverOpened=!1,this.timers=new h,this.hasActiveDescendant=!1,this.hasDropdown=!1,this.isLeadingIconSlotPresent=!1,this.isMobileViewport=!1,this.hostListitemRole=!1,this.isTrailingIconSlotPresent=!1,this.active=!1,this.icon="",this.open=!1,this.openMode="click",this.selected=!1,this.onDocClickCapture=t=>{if(!this.hasDropdown||!this.open)return;const s=t.target;s&&!this.el.contains(s)&&(this.open=!1)},this.onDocKeyDownCapture=t=>{this.hasDropdown&&this.open&&"Escape"===t.key&&(t.preventDefault(),t.stopPropagation(),this.open=!1,this.focusTriggerAfterEscape())},this.handleClick=t=>{if(this.hasDropdown){if(t.preventDefault(),t.stopPropagation(),this.timers.clearCoalesced(p),this.open&&this.hoverOpened&&this.hoverModeActive()&&t.detail>0)return;return this.hoverOpened=!1,void(this.open=!this.open)}this.navItemClick.emit(t)},this.handleKeyDown=t=>{if(null!=this.href&&!this.hasDropdown&&" "===t.key){t.preventDefault();const s=this.el.querySelector(".xpl-top-nav-item__inner");s?.click()}},this.onMobileViewportChange=()=>{this.isMobileViewport=this.mobileMq?.matches??!1},this.handleMouseEnter=()=>{this.hasDropdown&&this.hoverModeActive()&&(this.timers.clearCoalesced(p),this.open||(this.hoverOpened=!0,this.open=!0))},this.handleMouseLeave=()=>{this.hasDropdown&&this.open&&this.hoverOpened&&this.timers.scheduleCoalesced(p,(()=>{this.hoverOpened&&!this.el.contains(this.el.ownerDocument.activeElement)&&(this.open=!1)}),150)}}onHasDropdownChanged(){this.hasDropdown||(this.open=!1),this.syncDropdownDocListeners()}onOpenChanged(t){this.openChange.emit(t),t||(this.hoverOpened=!1),t&&this.hasDropdown&&this.broadcastCloseOtherDropdownHosts()}connectedCallback(){r()&&"function"==typeof window.matchMedia&&(this.hoverOpenMq=window.matchMedia("(hover: hover) and (pointer: fine) and (min-width: 768px)"),this.mobileMq=window.matchMedia(l),this.mobileMq.addEventListener("change",this.onMobileViewportChange),this.isMobileViewport=this.mobileMq.matches),this.syncHostListitemRole(),this.syncHasDropdownFromDom(),this.syncDropdownDocListeners(),this.connectDropdownSlotObserver()}disconnectedCallback(){this.timers.dispose(),this.hoverOpenMq=void 0,this.mobileMq?.removeEventListener("change",this.onMobileViewportChange),this.mobileMq=void 0,this.disconnectDropdownSlotObserver(),this.disconnectListitemContextObservers();const t=this.el.ownerDocument;t.removeEventListener("click",this.onDocClickCapture,!0),t.removeEventListener("keydown",this.onDocKeyDownCapture,!0)}componentWillLoad(){this.syncHostListitemRole(),this.syncHasDropdownFromDom()}componentWillRender(){this.disconnectDropdownSlotObserver(),this.disconnectListitemContextObservers()}componentDidRender(){this.schedulePostRenderTopNavItemWork()}handleCloseNavDropdownRequest(){this.hasDropdown&&this.open&&(this.open=!1)}async closeMenu(){this.hasDropdown&&(this.open=!1)}async openMenu(){this.hasDropdown&&(this.timers.clearCoalesced(p),this.hoverOpened=!1,this.open=!0)}async toggleMenu(){this.hasDropdown&&(this.open=!this.open)}scheduleHasDropdownSyncFromObserver(){this.timers.scheduleCoalesced("hasDropdownSync",(()=>{this.el.isConnected&&this.syncHasDropdownFromDom()}))}connectDropdownSlotObserver(){this.disconnectDropdownSlotObserver(),"undefined"!=typeof MutationObserver&&(this.dropdownSlotObserver=new MutationObserver((()=>{this.scheduleHasDropdownSyncFromObserver()})),this.dropdownSlotObserver.observe(this.el,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["slot"]}))}disconnectDropdownSlotObserver(){this.dropdownSlotObserver?.disconnect(),this.dropdownSlotObserver=void 0}disconnectListitemContextObservers(){this.parentListitemContextObserver?.disconnect(),this.parentListitemContextObserver=void 0,this.selfListitemContextObserver?.disconnect(),this.selfListitemContextObserver=void 0}connectListitemContextObservers(){if(this.disconnectListitemContextObservers(),"undefined"==typeof MutationObserver||!this.el.isConnected)return;this.selfListitemContextObserver=new MutationObserver((()=>{this.schedulePostRenderTopNavItemWork()})),this.selfListitemContextObserver.observe(this.el,{attributes:!0,attributeFilter:["class","slot"]});const t=this.el.parentElement;if(t){this.parentListitemContextObserver=new MutationObserver((()=>{this.schedulePostRenderTopNavItemWork()}));const s="xpl-top-nav"===t.tagName.toLowerCase()&&"left-aside"===this.el.getAttribute("slot")?t.querySelector(".xpl-top-nav__left-primary"):null;this.parentListitemContextObserver.observe(s??t,{attributes:!0,attributeFilter:["role"],subtree:!1})}}schedulePostRenderTopNavItemWork(){this.timers.scheduleCoalesced("postRender",(()=>{this.el.isConnected&&(this.syncHostListitemRole(),this.syncHasDropdownFromDom(),this.connectListitemContextObservers(),this.connectDropdownSlotObserver())}))}syncDropdownDocListeners(){if(!r())return;const t=this.el.ownerDocument;t.removeEventListener("click",this.onDocClickCapture,!0),t.removeEventListener("keydown",this.onDocKeyDownCapture,!0),this.hasDropdown&&(t.addEventListener("click",this.onDocClickCapture,!0),t.addEventListener("keydown",this.onDocKeyDownCapture,!0))}hasSlottedChildOwnedByThisHost(t){return Array.from(this.el.querySelectorAll(`[slot="${t}"]`)).some((t=>t.closest("xpl-top-nav-item")===this.el))}syncHasDropdownFromDom(){const t=null!=this.el.querySelector('[slot="dropdown"]');t!==this.hasDropdown&&(this.hasDropdown=t);const s=this.hasSlottedChildOwnedByThisHost("leading-icon");s!==this.isLeadingIconSlotPresent&&(this.isLeadingIconSlotPresent=s);const i=this.hasSlottedChildOwnedByThisHost("trailing-icon");i!==this.isTrailingIconSlotPresent&&(this.isTrailingIconSlotPresent=i);const e=!!t&&(null!==this.el.querySelector('[slot="dropdown"] .xpl-top-nav-item--active')||null!==this.el.querySelector('[slot="dropdown"] .xpl-top-nav-item--selected'));e!==this.hasActiveDescendant&&(this.hasActiveDescendant=e)}getNavDropdownBroadcastRoot(){return this.el.closest("xpl-top-nav-menu")??this.el.closest("xpl-nav-header-menu")??this.el.closest("xpl-top-nav")??this.el.ownerDocument}broadcastCloseOtherDropdownHosts(){this.getNavDropdownBroadcastRoot().querySelectorAll("xpl-top-nav-item").forEach((t=>{t!==this.el&&t.parentElement===this.el.parentElement&&t.dispatchEvent(new CustomEvent("_xplCloseNavDropdown",{bubbles:!1}))}))}hoverModeActive(){return"hover"===this.openMode&&(this.hoverOpenMq?.matches??!1)}focusTriggerAfterEscape(){this.timers.scheduleCoalesced("focusTriggerAfterEscape",(()=>{this.el.isConnected&&this.el.querySelector(".xpl-top-nav-item__inner")?.focus()}))}static isInternalRenderedHostChild(t){return t.classList.contains("xpl-top-nav-item__inner")||t.classList.contains("xpl-top-nav-item__dropdown")}hasNonDropdownLightDomChild(){return Array.from(this.el.childNodes).some((s=>{if(s.nodeType===Node.TEXT_NODE)return Boolean(s.textContent?.trim());if(s.nodeType===Node.ELEMENT_NODE){const i=s;if(t.isInternalRenderedHostChild(i))return!1;const e=i.getAttribute("slot");return null==e||""===e}return!1}))}getInnerAriaLabel(){if(this.label?.trim())return;if(this.hasNonDropdownLightDomChild())return;const t=this.itemAriaLabel?.trim();return t||(this.icon?.trim()||this.isLeadingIconSlotPresent?"Navigation item":void 0)}computeHostListitemRole(){const{el:t}=this;if(t.classList.contains("xpl-top-nav__brand"))return!1;if("right-aside-mobile"===t.getAttribute("slot"))return!1;const s=t.parentElement;return"list"===s?.getAttribute("role")||null!=s&&"xpl-nav-header-menu"===s.tagName.toLowerCase()||null!=s&&"xpl-top-nav-menu"===s.tagName.toLowerCase()||"left-aside"===t.getAttribute("slot")&&"xpl-top-nav"===s?.tagName.toLowerCase()&&null!=s.querySelector('.xpl-top-nav__left-primary[role="list"]')}syncHostListitemRole(){const t=this.computeHostListitemRole();this.hostListitemRole!==t&&(this.hostListitemRole=t)}renderLabelContent(){if(!this.label)return e("slot",null);const t=this.description?.trim();return t?e("span",{class:"xpl-top-nav-item__label-group"},e("span",{class:"xpl-top-nav-item__label",title:this.label},this.label),e("span",{class:"xpl-top-nav-item__description"},t)):e("span",{class:"xpl-top-nav-item__label",title:this.label},this.label)}renderLeading(){return this.isLeadingIconSlotPresent?e("span",{class:"xpl-top-nav-item__leading"},e("slot",{name:"leading-icon"})):this.icon?e("span",{class:"xpl-top-nav-item__leading"},e("xpl-icon",{size:16,icon:this.icon})):null}renderTrailing(){return this.isTrailingIconSlotPresent?e("span",{class:"xpl-top-nav-item__trailing"},e("slot",{name:"trailing-icon"})):this.hasDropdown?e("span",{class:"xpl-top-nav-item__trailing"},e("xpl-icon",{icon:this.isMobileViewport?"chevron-right":"chevron-down"})):null}renderInner(){const t=this.selected?"page":void 0,s=this.hasDropdown?this.open?"true":"false":void 0,i=this.getInnerAriaLabel(),n={class:"xpl-top-nav-item__inner",tabIndex:0,"aria-current":t,"aria-expanded":s,"aria-haspopup":this.hasDropdown?"true":void 0,"aria-controls":this.hasDropdown?this.dropdownPanelId:void 0,...i?{"aria-label":i}:{},onClick:this.handleClick,onKeyDown:this.handleKeyDown};return null==this.href||this.hasDropdown?e("button",{...n,type:"button"},this.renderLeading(),this.renderLabelContent(),this.renderTrailing()):e("a",{...n,href:this.href},this.renderLeading(),this.renderLabelContent(),this.renderTrailing())}render(){return e(n,{key:"fe53cfd84cba8502089c4a3fae62dfed10c0cdf0",class:{"xpl-top-nav-item":!0,"xpl-top-nav-item--active":this.active,"xpl-top-nav-item--dropdown-open":this.hasDropdown&&this.open,"xpl-top-nav-item--has-active-descendant":this.hasActiveDescendant,"xpl-top-nav-item--has-dropdown":this.hasDropdown,"xpl-top-nav-item--selected":this.selected,dark:!0},onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,...this.hostListitemRole?{role:"listitem"}:{}},this.renderInner(),this.hasDropdown&&e("div",{key:"954f83c94bd56d9bd328212f2ecc070861b1fd54",id:this.dropdownPanelId,class:"xpl-top-nav-item__dropdown"},e("slot",{key:"4d830a9386f12026cd1a2ecb454bcb9df2202431",name:"dropdown"})))}get el(){return this}static get watchers(){return{hasDropdown:[{onHasDropdownChanged:0}],open:[{onOpenChanged:0}]}}},[260,"xpl-top-nav-item",{active:[516],description:[1],href:[1],icon:[1],itemAriaLabel:[1,"item-aria-label"],label:[1],open:[1540],openMode:[513,"open-mode"],selected:[516],hasActiveDescendant:[32],hasDropdown:[32],isLeadingIconSlotPresent:[32],isMobileViewport:[32],hostListitemRole:[32],isTrailingIconSlotPresent:[32],closeMenu:[64],openMenu:[64],toggleMenu:[64]},[[0,"_xplCloseNavDropdown","handleCloseNavDropdownRequest"]],{hasDropdown:[{onHasDropdownChanged:0}],open:[{onOpenChanged:0}]}]);function c(){"undefined"!=typeof customElements&&["xpl-top-nav-item","xpl-icon"].forEach((t=>{switch(t){case"xpl-top-nav-item":customElements.get(o(t))||customElements.define(o(t),d);break;case"xpl-icon":customElements.get(o(t))||a()}}))}export{d as T,l as a,c as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,H as t,h as s,c as o,t as i}from"./p-BSHdGbmH.js";import{d as n}from"./p-
|
|
1
|
+
import{p as e,H as t,h as s,c as o,t as i}from"./p-BSHdGbmH.js";import{d as n}from"./p-CQjJIHK6.js";const l=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.dropdown=null}componentWillLoad(){this.dropdown=this.hostElement.closest("xpl-dropdown")}handleClick(e){if(!this.dropdown)return;const{closeOnSelect:t,mode:s}=this.dropdown;e.x&&e.y&&(this.dropdown.handleSelect(e,{component:this}),"single"===s&&t&&(this.dropdown.isOpen=!1))}handleKeyup(e){if(!this.dropdown)return;const{dropdown:t}=this,{closeOnSelect:s,mode:o,selectOnFocus:i}=this.dropdown;if(i&&["ArrowDown","ArrowLeft","ArrowRight","ArrowUp","Tab"].includes(e.key)){const{activeElement:i}=document,n=i?.closest("xpl-dropdown-option")??null;return t.handleSelect(e,{component:{hostElement:n}}),void("single"===o&&s&&(this.dropdown.isOpen=!1))}["Escape","Enter"].includes(e.key)&&(t.handleSelect(e,{component:this}),("Escape"===e.key||this.dropdown.closeOnSelect&&"Enter"===e.key)&&(this.dropdown.isOpen=!1))}connectedCallback(){this.hostElement.addEventListener("click",this.handleClick.bind(this)),this.hostElement.addEventListener("keyup",this.handleKeyup.bind(this))}disconnectedCallback(){this.hostElement.removeEventListener("click",this.handleClick),this.hostElement.removeEventListener("keyup",this.handleKeyup)}render(){const{label:e,isSelected:t,isDisabled:i,value:n,subtitle:l,icon:d}=this;return s(o,{key:"3e8fe525f44d24414926664c8475344b3e57eb53",class:{"xpl-dropdown-option":!0,"xpl-dropdown-option--disabled":!!i,"xpl-dropdown-option--selected":!!t},role:"option","aria-checked":t,"aria-disabled":i,"aria-selected":t,value:n},s("li",{key:"4262100b3ea2e62575f8eaad8908d9379a8ea05c",class:"xpl-dropdown-list-item"},d&&s("xpl-icon",{key:"7505fcdc35b15b6e97a4753525cee7232244fa6e",class:"xpl-dropdown-list-item__icon",icon:d,size:20}),e||s("slot",{key:"35b00d7aa187a38b1f9d78425189764d9b8575d8",name:"option"}),l&&s("span",{key:"e1dac23f7e07df9e89c90625f48eeddbd8daf77a",class:"xpl-dropdown-list-item__subtitle"},l)))}get hostElement(){return this}},[260,"xpl-dropdown-option",{isDisabled:[516,"disabled"],label:[1],value:[1],subtitle:[1],icon:[1],isSelected:[4,"selected"]}]);function d(){"undefined"!=typeof customElements&&["xpl-dropdown-option","xpl-icon"].forEach((e=>{switch(e){case"xpl-dropdown-option":customElements.get(i(e))||customElements.define(i(e),l);break;case"xpl-icon":customElements.get(i(e))||n()}}))}export{l as D,d}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as e,H as s,h as t,c as d,t as a}from"./p-BSHdGbmH.js";const i={success:"green",warning:"yellow",inactive:"gray",error:"red"},l=e(class extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.bordered=!1,this.dotOnly=!1,this.shape="rounded",this.size="default",this.variant="purple"}get resolvedVariant(){return i[this.variant]??this.variant}render(){return t(d,{key:"88ec460410a79a749357fb0fcfce4393f1fbd119"},t("div",{key:"93dd43a12a7d18a95d6c6d242ac527017736cd38",class:{"xpl-badge--dot-only":!!this.dotOnly,"xpl-badge--dot-only-bordered":!!this.dotOnly&&!!this.bordered,"xpl-badge":!this.dotOnly,"xpl-badge--dot":!this.dotOnly&&!!this.dot,[`xpl-badge--${this.resolvedVariant}`]:!0,[`xpl-badge--size-${this.size}`]:!!this.size,[`xpl-badge--shape-${this.shape}`]:!this.dotOnly&&!!this.shape}},t("span",{key:"f399c751da8fc51c5a47672c39e1b618d29f1314",class:"xpl-badge__label"},t("slot",{key:"f3920fd097e95f0e550eafa40010b0ca3d4202d4"}))))}},[260,"xpl-badge",{bordered:[4],dot:[4],dotOnly:[4,"dot-only"],shape:[1],size:[1],variant:[1]}]);function r(){"undefined"!=typeof customElements&&["xpl-badge"].forEach((e=>{"xpl-badge"===e&&(customElements.get(a(e))||customElements.define(a(e),l))}))}export{l as B,r as d}
|