@xplortech/apollo-core 2.5.0 → 2.6.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 +393 -26
- package/build/style.css +4224 -1016
- package/dist/apollo-core/apollo-core.css +18 -27
- package/dist/apollo-core/apollo-core.esm.js +1 -1
- package/dist/apollo-core/p-02167464.entry.js +1 -0
- package/dist/apollo-core/p-0bce3874.entry.js +1 -0
- package/dist/apollo-core/{p-0e1877a2.entry.js → p-1fd3dc87.entry.js} +1 -1
- package/dist/apollo-core/{p-0ac33b3a.entry.js → p-42016063.entry.js} +1 -1
- package/dist/apollo-core/p-5549756c.entry.js +1 -0
- package/dist/apollo-core/p-56fa4941.entry.js +1 -0
- package/dist/apollo-core/p-76c324da.entry.js +1 -0
- package/dist/apollo-core/p-7a3224b4.entry.js +1 -0
- package/dist/apollo-core/p-7e924697.entry.js +1 -0
- package/dist/apollo-core/{p-f4c2626d.entry.js → p-8a1affce.entry.js} +1 -1
- package/dist/apollo-core/p-9efca9e1.entry.js +1 -0
- package/dist/apollo-core/p-C_Z2nG0p.js +2 -0
- package/dist/apollo-core/p-b252b380.entry.js +1 -0
- package/dist/apollo-core/p-c91daac1.entry.js +1 -0
- package/dist/apollo-core/p-d9b62508.entry.js +1 -0
- package/dist/apollo-core/p-eaea16d1.entry.js +1 -0
- package/dist/apollo-core/p-eed13bca.entry.js +1 -0
- package/dist/apollo-core/{p-4fab8172.entry.js → p-f5af9539.entry.js} +1 -1
- package/dist/cjs/apollo-core.cjs.js +3 -3
- package/dist/cjs/{index-D__N_vw2.js → index-DH6pgWru.js} +137 -87
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/xpl-accordion.cjs.entry.js +5 -5
- package/dist/cjs/xpl-application-shell.cjs.entry.js +4 -4
- package/dist/cjs/{xpl-avatar_41.cjs.entry.js → xpl-avatar_47.cjs.entry.js} +2802 -272
- package/dist/cjs/xpl-button-row.cjs.entry.js +4 -4
- package/dist/cjs/xpl-calendar.cjs.entry.js +4 -4
- package/dist/cjs/xpl-dynamic-table-cell.cjs.entry.js +5 -5
- package/dist/cjs/xpl-dynamic-table-row.cjs.entry.js +5 -5
- package/dist/cjs/xpl-dynamic-table.cjs.entry.js +4 -4
- package/dist/cjs/xpl-grid-item.cjs.entry.js +4 -4
- package/dist/cjs/xpl-grid.cjs.entry.js +4 -4
- package/dist/cjs/xpl-large-card.cjs.entry.js +4 -4
- package/dist/cjs/xpl-list.cjs.entry.js +4 -4
- package/dist/cjs/xpl-main-nav.cjs.entry.js +4 -4
- package/dist/cjs/xpl-table-header-cell.cjs.entry.js +3 -3
- package/dist/cjs/xpl-table-header.cjs.entry.js +4 -4
- package/dist/cjs/xpl-toggle.cjs.entry.js +6 -6
- package/dist/cjs/xpl-toolbar.cjs.entry.js +5 -5
- package/dist/collection/collection-manifest.json +9 -2
- package/dist/collection/components/xpl-accordion/accordion.stories.js +4 -0
- package/dist/collection/components/xpl-accordion/xpl-accordion.js +3 -3
- package/dist/collection/components/xpl-application-shell/application-shell.stories.js +4 -0
- package/dist/collection/components/xpl-application-shell/xpl-application-shell.js +2 -2
- package/dist/collection/components/xpl-avatar/avatar.stories.js +4 -0
- package/dist/collection/components/xpl-avatar/xpl-avatar.js +3 -3
- package/dist/collection/components/xpl-backdrop/backdrop.stories.js +4 -0
- package/dist/collection/components/xpl-backdrop/xpl-backdrop.js +2 -2
- package/dist/collection/components/xpl-badge/badge.stories.js +108 -33
- package/dist/collection/components/xpl-badge/xpl-badge.js +122 -14
- package/dist/collection/components/xpl-banner/banner.stories.js +64 -0
- package/dist/collection/components/xpl-banner/xpl-banner.js +295 -0
- package/dist/collection/components/xpl-breadcrumbs/breadcrumbs.stories.js +4 -0
- package/dist/collection/components/xpl-breadcrumbs/xpl-breadcrumb-item/xpl-breadcrumb-item.js +2 -2
- package/dist/collection/components/xpl-breadcrumbs/xpl-breadcrumbs/xpl-breadcrumbs.js +2 -2
- package/dist/collection/components/xpl-button/button.stories.js +102 -98
- package/dist/collection/components/xpl-button/xpl-button.js +183 -93
- package/dist/collection/components/xpl-button-row/xpl-button-row.js +2 -2
- package/dist/collection/components/xpl-calendar/calendar.stories.js +4 -0
- package/dist/collection/components/xpl-calendar/xpl-calendar.js +2 -2
- package/dist/collection/components/xpl-checkbox/checkbox.stories.js +4 -0
- package/dist/collection/components/xpl-checkbox/xpl-checkbox.js +4 -4
- package/dist/collection/components/xpl-choicelist/choicelist.stories.js +4 -0
- package/dist/collection/components/xpl-choicelist/xpl-choicelist.js +2 -2
- package/dist/collection/components/xpl-content-area/xpl-content-area.js +2 -2
- package/dist/collection/components/xpl-dashboard/xpl-dashboard.js +2 -2
- package/dist/collection/components/xpl-data-card/data-card.stories.js +4 -0
- package/dist/collection/components/xpl-data-card/xpl-data-card.js +3 -3
- package/dist/collection/components/xpl-divider/divider.stories.js +4 -0
- package/dist/collection/components/xpl-divider/xpl-divider.js +2 -2
- package/dist/collection/components/xpl-dropdown/xpl-dropdown-group/xpl-dropdown-group.js +2 -2
- package/dist/collection/components/xpl-dropdown/xpl-dropdown-heading/xpl-dropdown-heading.js +2 -2
- package/dist/collection/components/xpl-dropdown/xpl-dropdown-option/xpl-dropdown-option.js +29 -4
- package/dist/collection/components/xpl-dropdown/xpl-dropdown.js +120 -79
- 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 +3 -3
- package/dist/collection/components/xpl-dynamic-table-row/xpl-dynamic-table-row.js +3 -3
- package/dist/collection/components/xpl-grid/xpl-grid.js +2 -2
- package/dist/collection/components/xpl-grid-item/xpl-grid-item.js +2 -2
- package/dist/collection/components/xpl-header-accordion/xpl-header-accordion.js +2 -2
- package/dist/collection/components/xpl-icon/xpl-icon.js +3 -3
- package/dist/collection/components/xpl-input/input.stories.js +75 -9
- package/dist/collection/components/xpl-input/xpl-input-color/xpl-input-color.js +9 -9
- package/dist/collection/components/xpl-input/xpl-input-date/xpl-input-date.js +55 -17
- package/dist/collection/components/xpl-input/xpl-input-file/xpl-input-file.js +5 -5
- package/dist/collection/components/xpl-input/xpl-input-phone/phone-country-data.js +58 -0
- package/dist/collection/components/xpl-input/xpl-input-phone/phone-format.js +219 -0
- package/dist/collection/components/xpl-input/xpl-input-phone/xpl-input-phone.js +469 -0
- package/dist/collection/components/xpl-input/xpl-input-time/xpl-input-time.js +3 -3
- package/dist/collection/components/xpl-input/xpl-input.js +101 -7
- package/dist/collection/components/xpl-large-card/large-card.stories.js +4 -0
- package/dist/collection/components/xpl-large-card/xpl-large-card.js +2 -2
- package/dist/collection/components/xpl-list/xpl-list.js +2 -2
- package/dist/collection/components/xpl-main-nav/xpl-main-nav.js +2 -2
- package/dist/collection/components/xpl-modal/modal.stories.js +4 -0
- package/dist/collection/components/xpl-modal/xpl-modal.js +2 -2
- package/dist/collection/components/xpl-nav-item/xpl-nav-item.js +3 -3
- package/dist/collection/components/xpl-pagination/pagination.stories.js +4 -0
- package/dist/collection/components/xpl-pagination/xpl-pagination.js +4 -4
- package/dist/collection/components/xpl-panel/panel.stories.js +51 -0
- package/dist/collection/components/xpl-panel/xpl-panel.js +60 -0
- package/dist/collection/components/xpl-popover/popover.stories.js +4 -0
- package/dist/collection/components/xpl-popover/xpl-popover.js +5 -5
- package/dist/collection/components/xpl-progress/xpl-progress.js +2 -2
- package/dist/collection/components/xpl-progress-bar/progress-bar.stories.js +96 -0
- package/dist/collection/components/xpl-progress-bar/xpl-progress-bar.js +158 -0
- package/dist/collection/components/xpl-radio/xpl-radio.js +4 -4
- package/dist/collection/components/xpl-secondary-nav/xpl-secondary-nav.js +2 -2
- package/dist/collection/components/xpl-select/xpl-select.js +7 -7
- package/dist/collection/components/xpl-side-nav/side-nav.stories.js +519 -0
- package/dist/collection/components/xpl-side-nav/xpl-side-nav-item/xpl-side-nav-item.js +259 -0
- package/dist/collection/components/xpl-side-nav/xpl-side-nav.js +32 -0
- package/dist/collection/components/xpl-skeleton/xpl-skeleton.js +2 -2
- package/dist/collection/components/xpl-slideout/xpl-slideout.js +2 -2
- package/dist/collection/components/xpl-tab/xpl-tab.js +3 -3
- package/dist/collection/components/xpl-tab-panel/xpl-tab-panel.js +3 -3
- package/dist/collection/components/xpl-table/xpl-table.js +6 -6
- package/dist/collection/components/xpl-table-header/xpl-table-header.js +2 -2
- package/dist/collection/components/xpl-table-header-cell/xpl-table-header-cell.js +1 -1
- package/dist/collection/components/xpl-tabs/xpl-tabs.js +6 -6
- package/dist/collection/components/xpl-tag/xpl-tag.js +3 -3
- package/dist/collection/components/xpl-toast/xpl-toast.js +3 -3
- package/dist/collection/components/xpl-toggle/xpl-toggle.js +4 -4
- package/dist/collection/components/xpl-toolbar/xpl-toolbar.js +3 -3
- package/dist/collection/components/xpl-tooltip/xpl-tooltip.js +2 -2
- package/dist/collection/components/xpl-utility-bar/xpl-utility-bar.js +2 -2
- package/dist/collection/utils/layout-ancestors.js +22 -0
- package/dist/components/index.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-avatar2.js +1 -1
- package/dist/components/xpl-backdrop.js +1 -1
- package/dist/components/xpl-backdrop2.js +1 -1
- package/dist/components/xpl-badge.js +1 -1
- package/dist/components/xpl-badge2.js +1 -1
- package/dist/components/xpl-banner.d.ts +11 -0
- package/dist/components/xpl-banner.js +1 -0
- 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-button2.js +1 -1
- package/dist/components/xpl-calendar.js +1 -1
- package/dist/components/xpl-checkbox.js +1 -1
- package/dist/components/xpl-checkbox2.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-divider2.js +1 -1
- package/dist/components/xpl-dropdown-group.js +1 -1
- package/dist/components/xpl-dropdown-group2.js +1 -1
- package/dist/components/xpl-dropdown-heading.js +1 -1
- package/dist/components/xpl-dropdown-heading2.js +1 -1
- package/dist/components/xpl-dropdown-option.js +1 -1
- package/dist/components/xpl-dropdown-option2.js +1 -1
- package/dist/components/xpl-dropdown.js +1 -1
- package/dist/components/xpl-dropdown2.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-icon2.js +1 -1
- package/dist/components/xpl-input-date.js +1 -1
- package/dist/components/xpl-input-date2.js +1 -1
- package/dist/components/xpl-input-file.js +1 -1
- package/dist/components/xpl-input-file2.js +1 -1
- package/dist/components/xpl-input-phone.d.ts +11 -0
- package/dist/components/xpl-input-phone.js +1 -0
- package/dist/components/xpl-input-time.js +1 -1
- package/dist/components/xpl-input.js +1 -1
- package/dist/components/xpl-input2.js +1 -1
- package/dist/components/xpl-large-card.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-item.js +1 -1
- package/dist/components/xpl-pagination.js +1 -1
- package/dist/components/xpl-panel.d.ts +11 -0
- package/dist/components/xpl-panel.js +1 -0
- package/dist/components/xpl-popover.js +1 -1
- package/dist/components/xpl-popover2.js +1 -1
- package/dist/components/xpl-progress-bar.d.ts +11 -0
- package/dist/components/xpl-progress-bar.js +1 -0
- package/dist/components/xpl-progress.js +1 -1
- package/dist/components/xpl-radio.js +1 -1
- package/dist/components/xpl-radio2.js +1 -1
- package/dist/components/xpl-secondary-nav.js +1 -1
- package/dist/components/xpl-select.js +1 -1
- package/dist/components/xpl-select2.js +1 -1
- package/dist/components/xpl-side-nav-item.d.ts +11 -0
- package/dist/components/xpl-side-nav-item.js +1 -0
- package/dist/components/xpl-side-nav.d.ts +11 -0
- package/dist/components/xpl-side-nav.js +1 -0
- package/dist/components/xpl-skeleton.js +1 -1
- package/dist/components/xpl-slideout.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-header.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-tag2.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-tooltip2.js +1 -1
- package/dist/components/xpl-utility-bar.js +1 -1
- package/dist/docs/xpl-accordion/readme.md +4 -0
- package/dist/docs/xpl-avatar/readme.md +5 -0
- package/dist/docs/xpl-backdrop/readme.md +1 -1
- package/dist/docs/xpl-badge/readme.md +97 -4
- package/dist/docs/xpl-banner/readme.md +166 -0
- package/dist/docs/xpl-button/readme.md +151 -14
- package/dist/docs/xpl-button-row/readme.md +1 -0
- package/dist/docs/xpl-calendar/readme.md +2 -1
- package/dist/docs/xpl-checkbox/readme.md +2 -0
- package/dist/docs/xpl-choicelist/readme.md +1 -0
- package/dist/docs/xpl-data-card/readme.md +2 -2
- package/dist/docs/xpl-divider/readme.md +1 -1
- package/dist/docs/xpl-dropdown/readme.md +14 -11
- package/dist/docs/xpl-dropdown/xpl-dropdown-group/readme.md +1 -0
- package/dist/docs/xpl-dropdown/xpl-dropdown-option/readme.md +6 -0
- package/dist/docs/xpl-icon/readme.md +12 -0
- package/dist/docs/xpl-input/readme.md +41 -31
- package/dist/docs/xpl-input/xpl-input-color/readme.md +4 -0
- package/dist/docs/xpl-input/xpl-input-phone/readme.md +167 -0
- package/dist/docs/xpl-input/xpl-input-time/readme.md +4 -0
- package/dist/docs/xpl-large-card/readme.md +1 -1
- package/dist/docs/xpl-modal/readme.md +3 -0
- package/dist/docs/xpl-pagination/readme.md +3 -0
- package/dist/docs/xpl-panel/readme.md +83 -0
- package/dist/docs/xpl-popover/readme.md +1 -1
- package/dist/docs/xpl-progress-bar/readme.md +145 -0
- package/dist/docs/xpl-select/readme.md +1 -0
- package/dist/docs/xpl-side-nav/readme.md +71 -0
- package/dist/docs/xpl-side-nav/xpl-side-nav-item/readme.md +115 -0
- package/dist/docs/xpl-slideout/readme.md +1 -0
- package/dist/docs/xpl-tabs/readme.md +1 -0
- package/dist/docs/xpl-toast/readme.md +55 -0
- package/dist/esm/apollo-core.js +4 -4
- package/dist/esm/{index-DhZas3eX.js → index-C_Z2nG0p.js} +137 -87
- package/dist/esm/loader.js +3 -3
- package/dist/esm/xpl-accordion.entry.js +5 -5
- package/dist/esm/xpl-application-shell.entry.js +4 -4
- package/dist/esm/{xpl-avatar_41.entry.js → xpl-avatar_47.entry.js} +2753 -229
- package/dist/esm/xpl-button-row.entry.js +4 -4
- package/dist/esm/xpl-calendar.entry.js +4 -4
- package/dist/esm/xpl-dynamic-table-cell.entry.js +5 -5
- package/dist/esm/xpl-dynamic-table-row.entry.js +5 -5
- package/dist/esm/xpl-dynamic-table.entry.js +4 -4
- package/dist/esm/xpl-grid-item.entry.js +4 -4
- package/dist/esm/xpl-grid.entry.js +4 -4
- package/dist/esm/xpl-large-card.entry.js +4 -4
- package/dist/esm/xpl-list.entry.js +4 -4
- package/dist/esm/xpl-main-nav.entry.js +4 -4
- package/dist/esm/xpl-table-header-cell.entry.js +3 -3
- package/dist/esm/xpl-table-header.entry.js +4 -4
- package/dist/esm/xpl-toggle.entry.js +6 -6
- package/dist/esm/xpl-toolbar.entry.js +5 -5
- package/dist/types/components/xpl-accordion/xpl-accordion.d.ts +1 -1
- package/dist/types/components/xpl-application-shell/application-shell.stories.d.ts +4 -0
- package/dist/types/components/xpl-application-shell/xpl-application-shell.d.ts +1 -1
- package/dist/types/components/xpl-avatar/avatar.stories.d.ts +4 -0
- package/dist/types/components/xpl-avatar/xpl-avatar.d.ts +1 -1
- package/dist/types/components/xpl-backdrop/backdrop.stories.d.ts +4 -0
- package/dist/types/components/xpl-backdrop/xpl-backdrop.d.ts +1 -1
- package/dist/types/components/xpl-badge/badge.stories.d.ts +66 -11
- package/dist/types/components/xpl-badge/xpl-badge.d.ts +9 -2
- package/dist/types/components/xpl-banner/banner.stories.d.ts +77 -0
- package/dist/types/components/xpl-banner/xpl-banner.d.ts +20 -0
- package/dist/types/components/xpl-breadcrumbs/breadcrumbs.stories.d.ts +4 -0
- package/dist/types/components/xpl-breadcrumbs/xpl-breadcrumb-item/xpl-breadcrumb-item.d.ts +1 -1
- package/dist/types/components/xpl-breadcrumbs/xpl-breadcrumbs/xpl-breadcrumbs.d.ts +1 -1
- package/dist/types/components/xpl-button/button.stories.d.ts +68 -30
- package/dist/types/components/xpl-button/xpl-button.d.ts +14 -8
- package/dist/types/components/xpl-button-row/xpl-button-row.d.ts +1 -1
- package/dist/types/components/xpl-calendar/calendar.stories.d.ts +4 -0
- package/dist/types/components/xpl-calendar/xpl-calendar.d.ts +1 -1
- package/dist/types/components/xpl-checkbox/checkbox.stories.d.ts +4 -0
- package/dist/types/components/xpl-checkbox/xpl-checkbox.d.ts +1 -1
- package/dist/types/components/xpl-choicelist/choicelist.stories.d.ts +4 -0
- package/dist/types/components/xpl-choicelist/xpl-choicelist.d.ts +1 -1
- package/dist/types/components/xpl-content-area/xpl-content-area.d.ts +1 -1
- package/dist/types/components/xpl-dashboard/xpl-dashboard.d.ts +1 -1
- package/dist/types/components/xpl-data-card/data-card.stories.d.ts +4 -0
- package/dist/types/components/xpl-data-card/xpl-data-card.d.ts +1 -1
- package/dist/types/components/xpl-divider/divider.stories.d.ts +4 -0
- package/dist/types/components/xpl-divider/xpl-divider.d.ts +1 -1
- package/dist/types/components/xpl-dropdown/dropdown-option.d.ts +1 -0
- package/dist/types/components/xpl-dropdown/dropdown.stories.d.ts +1 -1
- package/dist/types/components/xpl-dropdown/xpl-dropdown-group/xpl-dropdown-group.d.ts +1 -1
- package/dist/types/components/xpl-dropdown/xpl-dropdown-heading/xpl-dropdown-heading.d.ts +1 -1
- package/dist/types/components/xpl-dropdown/xpl-dropdown-option/xpl-dropdown-option.d.ts +3 -2
- package/dist/types/components/xpl-dropdown/xpl-dropdown.d.ts +11 -8
- package/dist/types/components/xpl-dynamic-table/xpl-dynamic-table.d.ts +1 -1
- package/dist/types/components/xpl-dynamic-table-cell/xpl-dynamic-table-cell.d.ts +1 -1
- package/dist/types/components/xpl-dynamic-table-row/xpl-dynamic-table-row.d.ts +1 -1
- package/dist/types/components/xpl-grid/xpl-grid.d.ts +1 -1
- package/dist/types/components/xpl-grid-item/xpl-grid-item.d.ts +1 -1
- package/dist/types/components/xpl-header-accordion/xpl-header-accordion.d.ts +1 -1
- package/dist/types/components/xpl-icon/xpl-icon.d.ts +1 -1
- package/dist/types/components/xpl-input/input.stories.d.ts +36 -7
- package/dist/types/components/xpl-input/xpl-input-color/xpl-input-color.d.ts +1 -1
- package/dist/types/components/xpl-input/xpl-input-date/xpl-input-date.d.ts +10 -3
- package/dist/types/components/xpl-input/xpl-input-file/xpl-input-file.d.ts +1 -1
- package/dist/types/components/xpl-input/xpl-input-phone/phone-country-data.d.ts +13 -0
- package/dist/types/components/xpl-input/xpl-input-phone/phone-format.d.ts +5 -0
- package/dist/types/components/xpl-input/xpl-input-phone/xpl-input-phone.d.ts +48 -0
- package/dist/types/components/xpl-input/xpl-input-time/xpl-input-time.d.ts +1 -1
- package/dist/types/components/xpl-input/xpl-input.d.ts +12 -2
- package/dist/types/components/xpl-large-card/large-card.stories.d.ts +4 -0
- package/dist/types/components/xpl-large-card/xpl-large-card.d.ts +1 -1
- package/dist/types/components/xpl-list/xpl-list.d.ts +1 -1
- package/dist/types/components/xpl-main-nav/xpl-main-nav.d.ts +1 -1
- package/dist/types/components/xpl-modal/modal.stories.d.ts +4 -0
- package/dist/types/components/xpl-modal/xpl-modal.d.ts +1 -1
- package/dist/types/components/xpl-nav-item/xpl-nav-item.d.ts +1 -1
- package/dist/types/components/xpl-pagination/pagination.stories.d.ts +4 -0
- package/dist/types/components/xpl-pagination/xpl-pagination.d.ts +1 -1
- package/dist/types/components/xpl-panel/panel.stories.d.ts +20 -0
- package/dist/types/components/xpl-panel/xpl-panel.d.ts +5 -0
- package/dist/types/components/xpl-popover/xpl-popover.d.ts +1 -1
- package/dist/types/components/xpl-progress/xpl-progress.d.ts +1 -1
- package/dist/types/components/xpl-progress-bar/progress-bar.stories.d.ts +73 -0
- package/dist/types/components/xpl-progress-bar/xpl-progress-bar.d.ts +15 -0
- package/dist/types/components/xpl-radio/xpl-radio.d.ts +1 -1
- package/dist/types/components/xpl-secondary-nav/xpl-secondary-nav.d.ts +1 -1
- package/dist/types/components/xpl-select/xpl-select.d.ts +1 -1
- package/dist/types/components/xpl-side-nav/side-nav.stories.d.ts +80 -0
- package/dist/types/components/xpl-side-nav/xpl-side-nav-item/xpl-side-nav-item.d.ts +20 -0
- package/dist/types/components/xpl-side-nav/xpl-side-nav.d.ts +4 -0
- package/dist/types/components/xpl-skeleton/xpl-skeleton.d.ts +1 -1
- package/dist/types/components/xpl-slideout/xpl-slideout.d.ts +1 -1
- package/dist/types/components/xpl-tab/xpl-tab.d.ts +1 -1
- package/dist/types/components/xpl-tab-panel/xpl-tab-panel.d.ts +1 -1
- package/dist/types/components/xpl-table/xpl-table.d.ts +1 -1
- package/dist/types/components/xpl-table-header/xpl-table-header.d.ts +1 -1
- package/dist/types/components/xpl-table-header-cell/xpl-table-header-cell.d.ts +1 -1
- package/dist/types/components/xpl-tabs/xpl-tabs.d.ts +2 -2
- package/dist/types/components/xpl-tag/xpl-tag.d.ts +1 -1
- package/dist/types/components/xpl-toast/xpl-toast.d.ts +1 -1
- package/dist/types/components/xpl-toggle/xpl-toggle.d.ts +1 -1
- package/dist/types/components/xpl-toolbar/xpl-toolbar.d.ts +1 -1
- package/dist/types/components/xpl-tooltip/xpl-tooltip.d.ts +1 -1
- package/dist/types/components/xpl-utility-bar/xpl-utility-bar.d.ts +1 -1
- package/dist/types/components.d.ts +1219 -178
- package/dist/types/stencil-public-runtime.d.ts +23 -2
- package/dist/types/utils/layout-ancestors.d.ts +2 -0
- package/package.json +41 -27
- package/dist/apollo-core/p-1c2e4034.entry.js +0 -1
- package/dist/apollo-core/p-3b5f8989.entry.js +0 -1
- package/dist/apollo-core/p-576ce90f.entry.js +0 -1
- package/dist/apollo-core/p-5ec45742.entry.js +0 -1
- package/dist/apollo-core/p-77f0fd4a.entry.js +0 -1
- package/dist/apollo-core/p-7b7db57a.entry.js +0 -1
- package/dist/apollo-core/p-7c22b842.entry.js +0 -1
- package/dist/apollo-core/p-7d245bf0.entry.js +0 -1
- package/dist/apollo-core/p-812bb0e4.entry.js +0 -1
- package/dist/apollo-core/p-845eef0d.entry.js +0 -1
- package/dist/apollo-core/p-9853028c.entry.js +0 -1
- package/dist/apollo-core/p-9d65ece7.entry.js +0 -1
- package/dist/apollo-core/p-DhZas3eX.js +0 -2
- package/dist/apollo-core/p-be292555.entry.js +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-DH6pgWru.js');
|
|
4
4
|
var v4 = require('./v4-D4KzFnn8.js');
|
|
5
5
|
var index$1 = require('./index-BvmWjxWc.js');
|
|
6
6
|
|
|
7
|
-
const
|
|
7
|
+
const Avatar = class {
|
|
8
8
|
constructor(hostRef) {
|
|
9
9
|
index.registerInstance(this, hostRef);
|
|
10
10
|
this.disabled = false;
|
|
@@ -15,18 +15,18 @@ const XplAvatar = class {
|
|
|
15
15
|
className += ` xpl-avatar--${this.size}`;
|
|
16
16
|
if (this.color)
|
|
17
17
|
className += ` xpl-avatar--${this.color}`;
|
|
18
|
-
const inner = (index.h("div", { key: '
|
|
19
|
-
return (index.h(index.Host, { key: '
|
|
18
|
+
const inner = (index.h("div", { key: '89234f18fd782f17c7e5cfac2235ba0d69b57014' }, this.src ? (index.h("img", { alt: this.name, src: this.src })) : (index.h("div", { class: "xpl-avatar__placeholder" }, index.h("slot", null))), this.status && index.h("div", { key: '908dbd9216d3addb0104517a67f2dd690201958d', class: `xpl-avatar__dot--${this.status}` })));
|
|
19
|
+
return (index.h(index.Host, { key: '94cb5838d77411b9690759634f4a1a71c79054b7' }, this.href && !this.disabled ? (index.h("a", { href: this.href, class: className, target: this.target }, inner)) : this.href && this.disabled ? (index.h("div", { class: `${className} xpl-avatar--disabled` }, inner)) : (index.h("div", { class: className }, inner))));
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
-
const
|
|
23
|
+
const Backdrop = class {
|
|
24
24
|
constructor(hostRef) {
|
|
25
25
|
index.registerInstance(this, hostRef);
|
|
26
26
|
this.relative = false;
|
|
27
27
|
}
|
|
28
28
|
render() {
|
|
29
|
-
return (index.h(index.Host, { key: '
|
|
29
|
+
return (index.h(index.Host, { key: '43941007f4e0ba73037eaff96cf8d000cee48b72', class: {
|
|
30
30
|
'xpl-backdrop': true,
|
|
31
31
|
'xpl-backdrop--fixed': !this.relative,
|
|
32
32
|
'xpl-backdrop--relative': this.relative,
|
|
@@ -34,21 +34,110 @@ const XplBackdrop = class {
|
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
-
const
|
|
37
|
+
const LEGACY_VARIANT_MAP = {
|
|
38
|
+
success: 'green',
|
|
39
|
+
warning: 'yellow',
|
|
40
|
+
inactive: 'gray',
|
|
41
|
+
error: 'red',
|
|
42
|
+
};
|
|
43
|
+
const Badge = class {
|
|
44
|
+
constructor(hostRef) {
|
|
45
|
+
index.registerInstance(this, hostRef);
|
|
46
|
+
this.bordered = false;
|
|
47
|
+
this.dotOnly = false;
|
|
48
|
+
this.shape = 'rounded';
|
|
49
|
+
this.size = 'default';
|
|
50
|
+
this.variant = 'purple';
|
|
51
|
+
}
|
|
52
|
+
get resolvedVariant() {
|
|
53
|
+
var _a;
|
|
54
|
+
return (_a = LEGACY_VARIANT_MAP[this.variant]) !== null && _a !== void 0 ? _a : this.variant;
|
|
55
|
+
}
|
|
56
|
+
render() {
|
|
57
|
+
const className = {
|
|
58
|
+
'xpl-badge--dot-only': this.dotOnly,
|
|
59
|
+
'xpl-badge--dot-only-bordered': this.dotOnly && this.bordered,
|
|
60
|
+
'xpl-badge': !this.dotOnly,
|
|
61
|
+
'xpl-badge--dot': !this.dotOnly && !!this.dot,
|
|
62
|
+
[`xpl-badge--${this.resolvedVariant}`]: true,
|
|
63
|
+
[`xpl-badge--size-${this.size}`]: !!this.size,
|
|
64
|
+
[`xpl-badge--shape-${this.shape}`]: !this.dotOnly && !!this.shape,
|
|
65
|
+
};
|
|
66
|
+
return (index.h(index.Host, { key: '9580be5811ecfd027b81edb1ca8f5f08c325d3b6' }, index.h("div", { key: '0223458a5e1210f28b8b77a2d5fbd16d0b302998', class: className }, index.h("slot", { key: 'ef0e6db8a9f33dfcea4739be2300b481e35c7f10' }))));
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const Banner = class {
|
|
38
71
|
constructor(hostRef) {
|
|
39
72
|
index.registerInstance(this, hostRef);
|
|
73
|
+
this.action = index.createEvent(this, "action", 7);
|
|
74
|
+
this.dismiss = index.createEvent(this, "dismiss", 7);
|
|
75
|
+
this.secondaryAction = index.createEvent(this, "secondaryAction", 7);
|
|
76
|
+
this.appearance = 'information';
|
|
77
|
+
this.hasIcon = true;
|
|
78
|
+
this.isDismissible = true;
|
|
79
|
+
this.isSection = false;
|
|
80
|
+
this.truncateDesc = false;
|
|
81
|
+
}
|
|
82
|
+
getIcon() {
|
|
83
|
+
switch (this.appearance) {
|
|
84
|
+
case 'positive':
|
|
85
|
+
return 'circle-check';
|
|
86
|
+
case 'warning':
|
|
87
|
+
return 'triangle-warning';
|
|
88
|
+
case 'error':
|
|
89
|
+
return 'octagon-warning';
|
|
90
|
+
default:
|
|
91
|
+
return 'circle-info';
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
getActionButtonState() {
|
|
95
|
+
if (this.isSection) {
|
|
96
|
+
if (this.appearance === 'positive') {
|
|
97
|
+
return 'success';
|
|
98
|
+
}
|
|
99
|
+
if (this.appearance === 'error') {
|
|
100
|
+
return 'warning';
|
|
101
|
+
}
|
|
102
|
+
return undefined;
|
|
103
|
+
}
|
|
104
|
+
return this.appearance === 'error' ? 'warning' : undefined;
|
|
105
|
+
}
|
|
106
|
+
getActionButtonVariant() {
|
|
107
|
+
if (this.isSection)
|
|
108
|
+
return 'subtle';
|
|
109
|
+
return this.appearance === 'error' ? 'primary' : 'subtle';
|
|
110
|
+
}
|
|
111
|
+
getAriaLabel() {
|
|
112
|
+
var _a;
|
|
113
|
+
if (this.isSection)
|
|
114
|
+
return ((_a = this.heading) === null || _a === void 0 ? void 0 : _a.trim()) || 'Section banner';
|
|
115
|
+
return {
|
|
116
|
+
information: 'Information banner',
|
|
117
|
+
positive: 'Positive banner',
|
|
118
|
+
warning: 'Warning banner',
|
|
119
|
+
error: 'Error banner',
|
|
120
|
+
}[this.appearance];
|
|
40
121
|
}
|
|
41
122
|
render() {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
123
|
+
var _a, _b, _c, _d;
|
|
124
|
+
const hasAction = !!((_a = this.actionText) === null || _a === void 0 ? void 0 : _a.trim());
|
|
125
|
+
const hasSecondaryAction = !!((_b = this.secondaryActionText) === null || _b === void 0 ? void 0 : _b.trim());
|
|
126
|
+
const actionVariant = this.getActionButtonVariant();
|
|
127
|
+
const actionState = this.getActionButtonState();
|
|
128
|
+
const isHeadingPresent = !!((_c = this.heading) === null || _c === void 0 ? void 0 : _c.trim());
|
|
129
|
+
const isDescPresent = !!((_d = this.description) === null || _d === void 0 ? void 0 : _d.trim());
|
|
130
|
+
return (index.h(index.Host, { key: '746ce028bdc07d1a645251aecf524f427d1d695b', class: {
|
|
131
|
+
'xpl-banner': true,
|
|
132
|
+
'xpl-banner--section': this.isSection,
|
|
133
|
+
[`xpl-banner--${this.appearance}`]: true,
|
|
134
|
+
'xpl-banner--truncate-desc': this.truncateDesc,
|
|
135
|
+
'xpl-banner--no-icon': this.isSection && !this.hasIcon,
|
|
136
|
+
}, role: "region", "aria-label": this.getAriaLabel() }, (!this.isSection || this.hasIcon) && (index.h("div", { key: 'fec752fe9822b480c2140c9b4520c2fcf71e4077', class: "xpl-banner__icon", "aria-hidden": "true" }, index.h("xpl-icon", { key: '1ce49bf4735edf985eaf055312cbd0bec8c76e96', icon: this.getIcon(), size: 24 }))), index.h("div", { key: '9f1b38f386c4151d25ed7ddb4770d39ae915760d', class: "xpl-banner__body" }, isHeadingPresent && index.h("p", { key: 'd1e2301d3174bf9bddec53aec75760c2f18899b8', class: "xpl-banner__heading" }, this.heading), isDescPresent && (index.h("p", { key: '4d7104cb455bc6f000244c6a66d87fe642488a22', class: "xpl-banner__description", title: this.truncateDesc ? this.description : undefined }, this.description))), (hasAction || hasSecondaryAction) && (index.h("div", { key: 'e3d3dd32d98399be0c1ed702ccc67e65c9d12236', class: "xpl-banner__actions" }, hasAction && (index.h("xpl-button", { key: '2410dbb9ea6c910e4cb8ace3a40378e10971060d', size: "xs", variant: actionVariant, state: actionState, onClick: () => this.action.emit() }, this.actionText)), hasSecondaryAction && (index.h("xpl-button", { key: 'db600c5b7e955b466f5928c05dbd9da467317aaa', size: "xs", variant: actionVariant, state: actionState, onClick: () => this.secondaryAction.emit() }, this.secondaryActionText)))), this.isDismissible && (index.h("button", { key: 'fe896518f7f3544a60dd1a125d4139985817c0d2', class: "xpl-banner__dismiss", type: "button", "aria-label": `Dismiss ${this.isSection ? 'section ' : ''}banner`, onClick: () => this.dismiss.emit() }, index.h("xpl-icon", { key: '98453bbd9485027c030f4fdc7af349c0e23aa405', icon: "xmark", size: 24, "aria-hidden": "true" })))));
|
|
48
137
|
}
|
|
49
138
|
};
|
|
50
139
|
|
|
51
|
-
const
|
|
140
|
+
const BreadcrumbItem = class {
|
|
52
141
|
constructor(hostRef) {
|
|
53
142
|
index.registerInstance(this, hostRef);
|
|
54
143
|
this.chevron = `<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="chevron-right" class="svg-inline--fa fa-chevron-right fa-w-10" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">
|
|
@@ -57,25 +146,31 @@ const XplBreadcrumbItem = class {
|
|
|
57
146
|
`;
|
|
58
147
|
}
|
|
59
148
|
render() {
|
|
60
|
-
return (index.h(index.Host, { key: '
|
|
149
|
+
return (index.h(index.Host, { key: 'ea9a888676dc9f7ef3a8ebdb194905d1e4350e2a', class: "xpl-breadcrumb-item", role: "listitem" }, index.h("li", { key: '3de2d04b006232bcdeca19c8cd300939bdfd160d', role: "none" }, index.h("slot", { key: 'ce28e3cce466682d576e026978f2f715cc8f2c84' })), index.h("span", { key: '862d5979885f27e002852d0e933b0003a6a8c9f3', innerHTML: this.chevron })));
|
|
61
150
|
}
|
|
62
151
|
};
|
|
63
152
|
|
|
64
|
-
const
|
|
153
|
+
const Breadcrumbs = class {
|
|
65
154
|
constructor(hostRef) {
|
|
66
155
|
index.registerInstance(this, hostRef);
|
|
67
156
|
}
|
|
68
157
|
render() {
|
|
69
|
-
return (index.h(index.Host, { key: '
|
|
158
|
+
return (index.h(index.Host, { key: 'b2d3bc77d1cc55f20c15af6b3526c10ee5737d23' }, index.h("nav", { key: '576a7d126a4df07c275fef5a412b549f5fc7bf45', class: "xpl-breadcrumbs", "aria-label": "Breadcrumb" }, index.h("ol", { key: '000ab463d675d42a67f3f484fe3d38ac7be1d60e', role: "list" }, index.h("slot", { key: '5f5895a835a4d572bd5566c1e8a4b9b83373f372' })))));
|
|
70
159
|
}
|
|
71
160
|
};
|
|
72
161
|
|
|
73
|
-
const
|
|
162
|
+
const Button = class {
|
|
74
163
|
constructor(hostRef) {
|
|
75
164
|
index.registerInstance(this, hostRef);
|
|
165
|
+
this.disabled = false;
|
|
166
|
+
this.fullWidth = false;
|
|
167
|
+
this.icon = '';
|
|
168
|
+
this.iconOnly = false;
|
|
169
|
+
this.iconPosition = 'start';
|
|
170
|
+
this.isLoading = false;
|
|
171
|
+
this.sentiment = 'neutral';
|
|
76
172
|
this.size = 'default';
|
|
77
173
|
this.variant = 'primary';
|
|
78
|
-
this.state = 'neutral';
|
|
79
174
|
}
|
|
80
175
|
componentDidRender() {
|
|
81
176
|
const attrs = this.el.attributes;
|
|
@@ -88,29 +183,49 @@ const XplButton = class {
|
|
|
88
183
|
return false;
|
|
89
184
|
})
|
|
90
185
|
.reduce((acc, k) => (Object.assign(Object.assign({}, acc), { [attrs[k].name]: attrs[k].value })), {});
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
186
|
+
const button = this.el.querySelector('button');
|
|
187
|
+
if (button) {
|
|
188
|
+
Object.keys(dataAttrs).forEach((k) => {
|
|
189
|
+
button.setAttribute(k, dataAttrs[k]);
|
|
190
|
+
this.el.removeAttribute(k);
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
renderIcon() {
|
|
195
|
+
if (this.icon) {
|
|
196
|
+
return index.h("xpl-icon", { icon: this.icon });
|
|
197
|
+
}
|
|
198
|
+
return null;
|
|
199
|
+
}
|
|
200
|
+
handleLoadingState(e) {
|
|
201
|
+
if (this.isLoading) {
|
|
202
|
+
e.preventDefault();
|
|
203
|
+
e.stopPropagation();
|
|
204
|
+
e.stopImmediatePropagation();
|
|
205
|
+
}
|
|
96
206
|
}
|
|
97
207
|
render() {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
208
|
+
return (index.h(index.Host, { key: 'b4658d7608d4ec84a4bbb36e8989bf66cd0358a2', class: {
|
|
209
|
+
'xpl-button': true,
|
|
210
|
+
[`xpl-button--${this.size}`]: true,
|
|
211
|
+
[`xpl-button--${this.variant}`]: true,
|
|
212
|
+
[`xpl-button--${this.state ? this.state : this.sentiment}`]: true,
|
|
213
|
+
[this.icon ? `xpl-button__icon-position--${this.iconPosition}` : '']: !!this.icon,
|
|
214
|
+
'xpl-button--full-width': this.fullWidth,
|
|
215
|
+
'xpl-button--icon-only': this.iconOnly,
|
|
216
|
+
'xpl-button--disabled': this.disabled,
|
|
217
|
+
'xpl-button--loading': this.isLoading && !this.link,
|
|
218
|
+
} }, this.link ? (index.h("slot", null)) : (index.h("button", { disabled: this.disabled, onClick: (e) => this.handleLoadingState(e), type: this.isLoading &&
|
|
219
|
+
(this.type === 'submit' ||
|
|
220
|
+
this.type === 'reset' ||
|
|
221
|
+
this.type === undefined)
|
|
222
|
+
? 'button'
|
|
223
|
+
: this.type, name: this.name, value: this.value, form: this.form, "aria-busy": this.isLoading ? 'true' : undefined }, this.icon && index.h("span", { class: "xpl-button__icon" }, this.renderIcon()), index.h("slot", null), this.isLoading && (index.h("span", { class: "xpl-button__loading-overlay", "aria-hidden": "true" }, index.h("span", { class: "xpl-button__loading-spinner" }, index.h("xpl-icon", { icon: "loader-4" }))))))));
|
|
109
224
|
}
|
|
110
225
|
get el() { return index.getElement(this); }
|
|
111
226
|
};
|
|
112
227
|
|
|
113
|
-
const
|
|
228
|
+
const Checkbox = class {
|
|
114
229
|
constructor(hostRef) {
|
|
115
230
|
index.registerInstance(this, hostRef);
|
|
116
231
|
this.checkboxChange = index.createEvent(this, "checkboxChange", 7);
|
|
@@ -126,21 +241,21 @@ const XplCheckbox = class {
|
|
|
126
241
|
};
|
|
127
242
|
}
|
|
128
243
|
render() {
|
|
129
|
-
return (index.h(index.Host, { key: '
|
|
244
|
+
return (index.h(index.Host, { key: '8d2ec8544cf2baad3e82b489c678fda63e22da06', class: {
|
|
130
245
|
'xpl-checkbox-radio-container': true,
|
|
131
246
|
styled: this.styled,
|
|
132
247
|
disabled: this.disabled,
|
|
133
|
-
} }, index.h("input", { key: '
|
|
248
|
+
} }, index.h("input", { key: '632db707a6611ef8f89edaa36af95746a9e5d8fd', class: "xpl-checkbox", type: "checkbox", checked: this.checked, "data-id": this.dataId, disabled: this.disabled, id: this.id, indeterminate: this.indeterminate, onChange: this.onChange, name: this.name, required: this.required, value: this.value }), index.h("label", { key: '80949092498866a3eba442760c28ba57540f69ba', class: {
|
|
134
249
|
'xpl-label': true,
|
|
135
250
|
'xpl-label--disabled': this.disabled,
|
|
136
|
-
}, htmlFor: this.id }, index.h("slot", { key: '
|
|
251
|
+
}, htmlFor: this.id }, index.h("slot", { key: '343779750455548397d8c887101ac8cf8eb25fcc' }), this.description && (index.h("small", { key: '12d5e2d154f1a99d7afe5a9bafdf5ebdcb40f1dd', class: {
|
|
137
252
|
'xpl-description': true,
|
|
138
253
|
'xpl-description--disabled': this.disabled,
|
|
139
254
|
} }, this.description)))));
|
|
140
255
|
}
|
|
141
256
|
};
|
|
142
257
|
|
|
143
|
-
const
|
|
258
|
+
const Choicelist = class {
|
|
144
259
|
constructor(hostRef) {
|
|
145
260
|
index.registerInstance(this, hostRef);
|
|
146
261
|
this.choicelistChange = index.createEvent(this, "choicelistChange", 7);
|
|
@@ -178,7 +293,7 @@ const XplChoicelist = class {
|
|
|
178
293
|
this.onChoicesPropChange(this.choices);
|
|
179
294
|
}
|
|
180
295
|
render() {
|
|
181
|
-
return (index.h(index.Host, { key: '
|
|
296
|
+
return (index.h(index.Host, { key: 'c6a7762863d6d19c1a9d72cfcc14e1d6e0f02850', class: "xpl-choicelist-container" }, this.heading !== undefined || this.description !== undefined ? (index.h("div", { class: "xpl-choicelist-heading" }, this.heading && index.h("h3", null, this.heading), this.description && index.h("p", null, this.description))) : null, this.choices && (index.h("ul", { key: 'a7f81d04dea87b90b86548e9eceeb802e0f4f57f', class: {
|
|
182
297
|
'xpl-choicelist': true,
|
|
183
298
|
'xpl-choicelist--styled': this.styled,
|
|
184
299
|
} }, this.choices.map((choice, i) => {
|
|
@@ -201,26 +316,26 @@ const XplChoicelist = class {
|
|
|
201
316
|
}; }
|
|
202
317
|
};
|
|
203
318
|
|
|
204
|
-
const
|
|
319
|
+
const ContentArea = class {
|
|
205
320
|
constructor(hostRef) {
|
|
206
321
|
index.registerInstance(this, hostRef);
|
|
207
322
|
this.size = 'wide';
|
|
208
323
|
}
|
|
209
324
|
render() {
|
|
210
|
-
return (index.h(index.Host, { key: '
|
|
325
|
+
return (index.h(index.Host, { key: '5ce34f544fa975f9cbd46defced08033bb1eef9b' }, index.h("main", { key: '3e4b262bc54788d50b6b329936f7aee1c1f6be69', class: `xpl-content-area-wrapper xpl-content-area-wrapper__${this.size}` }, index.h("div", { key: '5e4f9fa89830360f151c89ebb787d525c3c0940e', class: "xpl-content-area" }, index.h("slot", { key: 'e22c2759aa45d4a99c92541073abf011d34474f9' })))));
|
|
211
326
|
}
|
|
212
327
|
};
|
|
213
328
|
|
|
214
|
-
const
|
|
329
|
+
const Dashboard = class {
|
|
215
330
|
constructor(hostRef) {
|
|
216
331
|
index.registerInstance(this, hostRef);
|
|
217
332
|
}
|
|
218
333
|
render() {
|
|
219
|
-
return (index.h(index.Host, { key: '
|
|
334
|
+
return (index.h(index.Host, { key: 'aa4f209d95236a7e2c3e6f6915c989a110202c80' }, index.h("dl", { key: '890e6fb69af3154ee47c1b40498ed37c5d8a6a1a', class: "xpl-dashboard" }, index.h("slot", { key: 'e4a47f80f873cf53844283e47c59f174fc79fda0' }))));
|
|
220
335
|
}
|
|
221
336
|
};
|
|
222
337
|
|
|
223
|
-
const
|
|
338
|
+
const DataCard = class {
|
|
224
339
|
constructor(hostRef) {
|
|
225
340
|
index.registerInstance(this, hostRef);
|
|
226
341
|
this.leadingIcon = true;
|
|
@@ -253,8 +368,8 @@ const XplDataCard = class {
|
|
|
253
368
|
: this.smallStatVariant === 'negative'
|
|
254
369
|
? 'arrow-down-right'
|
|
255
370
|
: 'dash';
|
|
256
|
-
return (index.h(index.Host, { key: '
|
|
257
|
-
(this.tooltipTextSmallStat ? (index.h("xpl-tooltip", { text: this.tooltipTextSmallStat }, index.h("div", { class: "xpl-data-card-stat xpl-data-card-stat--small" }, index.h("xpl-icon", { icon: this.smallStatIcon, size: 16 }), this.smallStat))) : (index.h("div", { class: "xpl-data-card-stat xpl-data-card-stat--small" }, index.h("xpl-icon", { icon: this.smallStatIcon, size: 16 }), this.smallStat)))), !!this.detail && index.h("span", { key: '
|
|
371
|
+
return (index.h(index.Host, { key: 'c9a108ce28ed8904ef2f39f8d28e3becdd3da427', role: "group", class: `xpl-data-card ${this.link ? 'xpl-data-card__link' : ''}`, tabindex: "0" }, index.h("dt", { key: '376323f4f00a84b903b31d3b72b21d83f86cb8d7', class: headerClasses }, index.h("header", { key: '7385e8fac7f9eb6f8f9c9235f7de8395de376510' }, !!this.leadingIcon && this.icon && (index.h("span", { key: 'bd43a5ad7f0d4c3afacd83b0d77b00fbfbbc9bfe', class: `xpl-data-card__icon--${this.variant}` }, index.h("xpl-icon", { key: '914e9897881a07fd0a76eaa24f7b862e0d2237d8', icon: this.icon, "background-color": bgColorHue, size: 20 }))), index.h("slot", { key: 'dc317fbb7055845149737d3699d39759b42be5a4', name: "title" }, this.name)), this.link && (index.h("span", { key: 'ea569e40ee3e746073c1dee3e1be98af63cda682', class: "xpl-data-card__header-arrow" }, index.h("xpl-icon", { key: '4da084735e560701a8407ec044b9e6d8ea9d5a1f', icon: "chevron-right", size: 16 })))), index.h("dd", { key: '218fd7271e49509d9b29484ba7becb3237fae283', class: "xpl-data-card__body" }, index.h("div", { key: 'e8a723a5d2742c42b681cbde6ca880a9833301ba', class: "xpl-data-card__left" }, index.h("span", { key: '9b9cfbc7ff6d1cb81d867e044766559e07f0bee9', class: "xpl-data-card-stat xpl-data-card-stat--long" }, this.stat), this.tooltipTextStat ? (index.h("xpl-tooltip", { text: this.tooltipTextStat }, index.h("div", { class: "xpl-data-card-stat xpl-data-card-stat--short" }, this.shortStat ? this.shortStat : this.stat))) : (index.h("div", { class: "xpl-data-card-stat xpl-data-card-stat--short" }, index.h("abbr", { title: this.stat }, this.shortStat ? this.shortStat : this.stat))), this.smallStatVariant ? (this.tooltipTextSmallStat ? (index.h("xpl-tooltip", { text: this.tooltipTextSmallStat }, index.h("div", { class: `xpl-data-card-stat xpl-data-card-stat--small ${this.smallStatVariant}` }, index.h("xpl-icon", { icon: smallStatIcon, size: 16 }), this.smallStat))) : (index.h("div", { class: `xpl-data-card-stat xpl-data-card-stat--small ${this.smallStatVariant}` }, index.h("xpl-icon", { icon: smallStatIcon, size: 16 }), this.smallStat))) : (this.smallStatIcon &&
|
|
372
|
+
(this.tooltipTextSmallStat ? (index.h("xpl-tooltip", { text: this.tooltipTextSmallStat }, index.h("div", { class: "xpl-data-card-stat xpl-data-card-stat--small" }, index.h("xpl-icon", { icon: this.smallStatIcon, size: 16 }), this.smallStat))) : (index.h("div", { class: "xpl-data-card-stat xpl-data-card-stat--small" }, index.h("xpl-icon", { icon: this.smallStatIcon, size: 16 }), this.smallStat)))), !!this.detail && index.h("span", { key: 'f6236b30f5fababdb27dfb0767b0b9f230019e87', class: "xpl-data-card__detail" }, this.detail)), hasContentSlot && (index.h("div", { key: '614af9eb3f33fde8d489fe547a2f0e833f6e9655', class: "xpl-data-card__right" }, index.h("slot", { key: 'd71b6775e27537744ca4bee20c530b5aa1e6e830', name: contentSlot }))))));
|
|
258
373
|
}
|
|
259
374
|
get el() { return index.getElement(this); }
|
|
260
375
|
static get watchers() { return {
|
|
@@ -267,17 +382,1633 @@ const XplDataCard = class {
|
|
|
267
382
|
}; }
|
|
268
383
|
};
|
|
269
384
|
|
|
270
|
-
const
|
|
385
|
+
const Divider = class {
|
|
271
386
|
constructor(hostRef) {
|
|
272
387
|
index.registerInstance(this, hostRef);
|
|
273
388
|
}
|
|
274
389
|
render() {
|
|
275
390
|
let className = 'xpl-divider';
|
|
276
391
|
className += ` xpl-divider--${this.tier}`;
|
|
277
|
-
return (index.h(index.Host, { key: '
|
|
392
|
+
return (index.h(index.Host, { key: 'cdafb808588e7baf9271997503dea7b53597b15f', class: className }, index.h("span", { key: '119067065dc21dd71b25ba81b5d83232f4953ebc' }, index.h("slot", { key: '8cc9077442f20703efc50094056cb7d15782252a' }))));
|
|
278
393
|
}
|
|
279
394
|
};
|
|
280
395
|
|
|
396
|
+
/**
|
|
397
|
+
* Custom positioning reference element.
|
|
398
|
+
* @see https://floating-ui.com/docs/virtual-elements
|
|
399
|
+
*/
|
|
400
|
+
|
|
401
|
+
const sides = ['top', 'right', 'bottom', 'left'];
|
|
402
|
+
const min = Math.min;
|
|
403
|
+
const max = Math.max;
|
|
404
|
+
const round = Math.round;
|
|
405
|
+
const floor = Math.floor;
|
|
406
|
+
const createCoords = v => ({
|
|
407
|
+
x: v,
|
|
408
|
+
y: v
|
|
409
|
+
});
|
|
410
|
+
const oppositeSideMap = {
|
|
411
|
+
left: 'right',
|
|
412
|
+
right: 'left',
|
|
413
|
+
bottom: 'top',
|
|
414
|
+
top: 'bottom'
|
|
415
|
+
};
|
|
416
|
+
function evaluate(value, param) {
|
|
417
|
+
return typeof value === 'function' ? value(param) : value;
|
|
418
|
+
}
|
|
419
|
+
function getSide(placement) {
|
|
420
|
+
return placement.split('-')[0];
|
|
421
|
+
}
|
|
422
|
+
function getAlignment(placement) {
|
|
423
|
+
return placement.split('-')[1];
|
|
424
|
+
}
|
|
425
|
+
function getOppositeAxis(axis) {
|
|
426
|
+
return axis === 'x' ? 'y' : 'x';
|
|
427
|
+
}
|
|
428
|
+
function getAxisLength(axis) {
|
|
429
|
+
return axis === 'y' ? 'height' : 'width';
|
|
430
|
+
}
|
|
431
|
+
function getSideAxis(placement) {
|
|
432
|
+
const firstChar = placement[0];
|
|
433
|
+
return firstChar === 't' || firstChar === 'b' ? 'y' : 'x';
|
|
434
|
+
}
|
|
435
|
+
function getAlignmentAxis(placement) {
|
|
436
|
+
return getOppositeAxis(getSideAxis(placement));
|
|
437
|
+
}
|
|
438
|
+
function getAlignmentSides(placement, rects, rtl) {
|
|
439
|
+
if (rtl === void 0) {
|
|
440
|
+
rtl = false;
|
|
441
|
+
}
|
|
442
|
+
const alignment = getAlignment(placement);
|
|
443
|
+
const alignmentAxis = getAlignmentAxis(placement);
|
|
444
|
+
const length = getAxisLength(alignmentAxis);
|
|
445
|
+
let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
|
|
446
|
+
if (rects.reference[length] > rects.floating[length]) {
|
|
447
|
+
mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
|
|
448
|
+
}
|
|
449
|
+
return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
|
|
450
|
+
}
|
|
451
|
+
function getExpandedPlacements(placement) {
|
|
452
|
+
const oppositePlacement = getOppositePlacement(placement);
|
|
453
|
+
return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
|
|
454
|
+
}
|
|
455
|
+
function getOppositeAlignmentPlacement(placement) {
|
|
456
|
+
return placement.includes('start') ? placement.replace('start', 'end') : placement.replace('end', 'start');
|
|
457
|
+
}
|
|
458
|
+
const lrPlacement = ['left', 'right'];
|
|
459
|
+
const rlPlacement = ['right', 'left'];
|
|
460
|
+
const tbPlacement = ['top', 'bottom'];
|
|
461
|
+
const btPlacement = ['bottom', 'top'];
|
|
462
|
+
function getSideList(side, isStart, rtl) {
|
|
463
|
+
switch (side) {
|
|
464
|
+
case 'top':
|
|
465
|
+
case 'bottom':
|
|
466
|
+
if (rtl) return isStart ? rlPlacement : lrPlacement;
|
|
467
|
+
return isStart ? lrPlacement : rlPlacement;
|
|
468
|
+
case 'left':
|
|
469
|
+
case 'right':
|
|
470
|
+
return isStart ? tbPlacement : btPlacement;
|
|
471
|
+
default:
|
|
472
|
+
return [];
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
|
|
476
|
+
const alignment = getAlignment(placement);
|
|
477
|
+
let list = getSideList(getSide(placement), direction === 'start', rtl);
|
|
478
|
+
if (alignment) {
|
|
479
|
+
list = list.map(side => side + "-" + alignment);
|
|
480
|
+
if (flipAlignment) {
|
|
481
|
+
list = list.concat(list.map(getOppositeAlignmentPlacement));
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
return list;
|
|
485
|
+
}
|
|
486
|
+
function getOppositePlacement(placement) {
|
|
487
|
+
const side = getSide(placement);
|
|
488
|
+
return oppositeSideMap[side] + placement.slice(side.length);
|
|
489
|
+
}
|
|
490
|
+
function expandPaddingObject(padding) {
|
|
491
|
+
return {
|
|
492
|
+
top: 0,
|
|
493
|
+
right: 0,
|
|
494
|
+
bottom: 0,
|
|
495
|
+
left: 0,
|
|
496
|
+
...padding
|
|
497
|
+
};
|
|
498
|
+
}
|
|
499
|
+
function getPaddingObject(padding) {
|
|
500
|
+
return typeof padding !== 'number' ? expandPaddingObject(padding) : {
|
|
501
|
+
top: padding,
|
|
502
|
+
right: padding,
|
|
503
|
+
bottom: padding,
|
|
504
|
+
left: padding
|
|
505
|
+
};
|
|
506
|
+
}
|
|
507
|
+
function rectToClientRect(rect) {
|
|
508
|
+
const {
|
|
509
|
+
x,
|
|
510
|
+
y,
|
|
511
|
+
width,
|
|
512
|
+
height
|
|
513
|
+
} = rect;
|
|
514
|
+
return {
|
|
515
|
+
width,
|
|
516
|
+
height,
|
|
517
|
+
top: y,
|
|
518
|
+
left: x,
|
|
519
|
+
right: x + width,
|
|
520
|
+
bottom: y + height,
|
|
521
|
+
x,
|
|
522
|
+
y
|
|
523
|
+
};
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
527
|
+
let {
|
|
528
|
+
reference,
|
|
529
|
+
floating
|
|
530
|
+
} = _ref;
|
|
531
|
+
const sideAxis = getSideAxis(placement);
|
|
532
|
+
const alignmentAxis = getAlignmentAxis(placement);
|
|
533
|
+
const alignLength = getAxisLength(alignmentAxis);
|
|
534
|
+
const side = getSide(placement);
|
|
535
|
+
const isVertical = sideAxis === 'y';
|
|
536
|
+
const commonX = reference.x + reference.width / 2 - floating.width / 2;
|
|
537
|
+
const commonY = reference.y + reference.height / 2 - floating.height / 2;
|
|
538
|
+
const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
|
|
539
|
+
let coords;
|
|
540
|
+
switch (side) {
|
|
541
|
+
case 'top':
|
|
542
|
+
coords = {
|
|
543
|
+
x: commonX,
|
|
544
|
+
y: reference.y - floating.height
|
|
545
|
+
};
|
|
546
|
+
break;
|
|
547
|
+
case 'bottom':
|
|
548
|
+
coords = {
|
|
549
|
+
x: commonX,
|
|
550
|
+
y: reference.y + reference.height
|
|
551
|
+
};
|
|
552
|
+
break;
|
|
553
|
+
case 'right':
|
|
554
|
+
coords = {
|
|
555
|
+
x: reference.x + reference.width,
|
|
556
|
+
y: commonY
|
|
557
|
+
};
|
|
558
|
+
break;
|
|
559
|
+
case 'left':
|
|
560
|
+
coords = {
|
|
561
|
+
x: reference.x - floating.width,
|
|
562
|
+
y: commonY
|
|
563
|
+
};
|
|
564
|
+
break;
|
|
565
|
+
default:
|
|
566
|
+
coords = {
|
|
567
|
+
x: reference.x,
|
|
568
|
+
y: reference.y
|
|
569
|
+
};
|
|
570
|
+
}
|
|
571
|
+
switch (getAlignment(placement)) {
|
|
572
|
+
case 'start':
|
|
573
|
+
coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
|
|
574
|
+
break;
|
|
575
|
+
case 'end':
|
|
576
|
+
coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
|
|
577
|
+
break;
|
|
578
|
+
}
|
|
579
|
+
return coords;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
/**
|
|
583
|
+
* Resolves with an object of overflow side offsets that determine how much the
|
|
584
|
+
* element is overflowing a given clipping boundary on each side.
|
|
585
|
+
* - positive = overflowing the boundary by that number of pixels
|
|
586
|
+
* - negative = how many pixels left before it will overflow
|
|
587
|
+
* - 0 = lies flush with the boundary
|
|
588
|
+
* @see https://floating-ui.com/docs/detectOverflow
|
|
589
|
+
*/
|
|
590
|
+
async function detectOverflow(state, options) {
|
|
591
|
+
var _await$platform$isEle;
|
|
592
|
+
if (options === void 0) {
|
|
593
|
+
options = {};
|
|
594
|
+
}
|
|
595
|
+
const {
|
|
596
|
+
x,
|
|
597
|
+
y,
|
|
598
|
+
platform,
|
|
599
|
+
rects,
|
|
600
|
+
elements,
|
|
601
|
+
strategy
|
|
602
|
+
} = state;
|
|
603
|
+
const {
|
|
604
|
+
boundary = 'clippingAncestors',
|
|
605
|
+
rootBoundary = 'viewport',
|
|
606
|
+
elementContext = 'floating',
|
|
607
|
+
altBoundary = false,
|
|
608
|
+
padding = 0
|
|
609
|
+
} = evaluate(options, state);
|
|
610
|
+
const paddingObject = getPaddingObject(padding);
|
|
611
|
+
const altContext = elementContext === 'floating' ? 'reference' : 'floating';
|
|
612
|
+
const element = elements[altBoundary ? altContext : elementContext];
|
|
613
|
+
const clippingClientRect = rectToClientRect(await platform.getClippingRect({
|
|
614
|
+
element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
|
|
615
|
+
boundary,
|
|
616
|
+
rootBoundary,
|
|
617
|
+
strategy
|
|
618
|
+
}));
|
|
619
|
+
const rect = elementContext === 'floating' ? {
|
|
620
|
+
x,
|
|
621
|
+
y,
|
|
622
|
+
width: rects.floating.width,
|
|
623
|
+
height: rects.floating.height
|
|
624
|
+
} : rects.reference;
|
|
625
|
+
const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
|
|
626
|
+
const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
|
|
627
|
+
x: 1,
|
|
628
|
+
y: 1
|
|
629
|
+
} : {
|
|
630
|
+
x: 1,
|
|
631
|
+
y: 1
|
|
632
|
+
};
|
|
633
|
+
const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
634
|
+
elements,
|
|
635
|
+
rect,
|
|
636
|
+
offsetParent,
|
|
637
|
+
strategy
|
|
638
|
+
}) : rect);
|
|
639
|
+
return {
|
|
640
|
+
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
641
|
+
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
642
|
+
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
643
|
+
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
644
|
+
};
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
// Maximum number of resets that can occur before bailing to avoid infinite reset loops.
|
|
648
|
+
const MAX_RESET_COUNT = 50;
|
|
649
|
+
|
|
650
|
+
/**
|
|
651
|
+
* Computes the `x` and `y` coordinates that will place the floating element
|
|
652
|
+
* next to a given reference element.
|
|
653
|
+
*
|
|
654
|
+
* This export does not have any `platform` interface logic. You will need to
|
|
655
|
+
* write one for the platform you are using Floating UI with.
|
|
656
|
+
*/
|
|
657
|
+
const computePosition$1 = async (reference, floating, config) => {
|
|
658
|
+
const {
|
|
659
|
+
placement = 'bottom',
|
|
660
|
+
strategy = 'absolute',
|
|
661
|
+
middleware = [],
|
|
662
|
+
platform
|
|
663
|
+
} = config;
|
|
664
|
+
const platformWithDetectOverflow = platform.detectOverflow ? platform : {
|
|
665
|
+
...platform,
|
|
666
|
+
detectOverflow
|
|
667
|
+
};
|
|
668
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
|
|
669
|
+
let rects = await platform.getElementRects({
|
|
670
|
+
reference,
|
|
671
|
+
floating,
|
|
672
|
+
strategy
|
|
673
|
+
});
|
|
674
|
+
let {
|
|
675
|
+
x,
|
|
676
|
+
y
|
|
677
|
+
} = computeCoordsFromPlacement(rects, placement, rtl);
|
|
678
|
+
let statefulPlacement = placement;
|
|
679
|
+
let resetCount = 0;
|
|
680
|
+
const middlewareData = {};
|
|
681
|
+
for (let i = 0; i < middleware.length; i++) {
|
|
682
|
+
const currentMiddleware = middleware[i];
|
|
683
|
+
if (!currentMiddleware) {
|
|
684
|
+
continue;
|
|
685
|
+
}
|
|
686
|
+
const {
|
|
687
|
+
name,
|
|
688
|
+
fn
|
|
689
|
+
} = currentMiddleware;
|
|
690
|
+
const {
|
|
691
|
+
x: nextX,
|
|
692
|
+
y: nextY,
|
|
693
|
+
data,
|
|
694
|
+
reset
|
|
695
|
+
} = await fn({
|
|
696
|
+
x,
|
|
697
|
+
y,
|
|
698
|
+
initialPlacement: placement,
|
|
699
|
+
placement: statefulPlacement,
|
|
700
|
+
strategy,
|
|
701
|
+
middlewareData,
|
|
702
|
+
rects,
|
|
703
|
+
platform: platformWithDetectOverflow,
|
|
704
|
+
elements: {
|
|
705
|
+
reference,
|
|
706
|
+
floating
|
|
707
|
+
}
|
|
708
|
+
});
|
|
709
|
+
x = nextX != null ? nextX : x;
|
|
710
|
+
y = nextY != null ? nextY : y;
|
|
711
|
+
middlewareData[name] = {
|
|
712
|
+
...middlewareData[name],
|
|
713
|
+
...data
|
|
714
|
+
};
|
|
715
|
+
if (reset && resetCount < MAX_RESET_COUNT) {
|
|
716
|
+
resetCount++;
|
|
717
|
+
if (typeof reset === 'object') {
|
|
718
|
+
if (reset.placement) {
|
|
719
|
+
statefulPlacement = reset.placement;
|
|
720
|
+
}
|
|
721
|
+
if (reset.rects) {
|
|
722
|
+
rects = reset.rects === true ? await platform.getElementRects({
|
|
723
|
+
reference,
|
|
724
|
+
floating,
|
|
725
|
+
strategy
|
|
726
|
+
}) : reset.rects;
|
|
727
|
+
}
|
|
728
|
+
({
|
|
729
|
+
x,
|
|
730
|
+
y
|
|
731
|
+
} = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
|
|
732
|
+
}
|
|
733
|
+
i = -1;
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
return {
|
|
737
|
+
x,
|
|
738
|
+
y,
|
|
739
|
+
placement: statefulPlacement,
|
|
740
|
+
strategy,
|
|
741
|
+
middlewareData
|
|
742
|
+
};
|
|
743
|
+
};
|
|
744
|
+
|
|
745
|
+
/**
|
|
746
|
+
* Optimizes the visibility of the floating element by flipping the `placement`
|
|
747
|
+
* in order to keep it in view when the preferred placement(s) will overflow the
|
|
748
|
+
* clipping boundary. Alternative to `autoPlacement`.
|
|
749
|
+
* @see https://floating-ui.com/docs/flip
|
|
750
|
+
*/
|
|
751
|
+
const flip$1 = function (options) {
|
|
752
|
+
if (options === void 0) {
|
|
753
|
+
options = {};
|
|
754
|
+
}
|
|
755
|
+
return {
|
|
756
|
+
name: 'flip',
|
|
757
|
+
options,
|
|
758
|
+
async fn(state) {
|
|
759
|
+
var _middlewareData$arrow, _middlewareData$flip;
|
|
760
|
+
const {
|
|
761
|
+
placement,
|
|
762
|
+
middlewareData,
|
|
763
|
+
rects,
|
|
764
|
+
initialPlacement,
|
|
765
|
+
platform,
|
|
766
|
+
elements
|
|
767
|
+
} = state;
|
|
768
|
+
const {
|
|
769
|
+
mainAxis: checkMainAxis = true,
|
|
770
|
+
crossAxis: checkCrossAxis = true,
|
|
771
|
+
fallbackPlacements: specifiedFallbackPlacements,
|
|
772
|
+
fallbackStrategy = 'bestFit',
|
|
773
|
+
fallbackAxisSideDirection = 'none',
|
|
774
|
+
flipAlignment = true,
|
|
775
|
+
...detectOverflowOptions
|
|
776
|
+
} = evaluate(options, state);
|
|
777
|
+
|
|
778
|
+
// If a reset by the arrow was caused due to an alignment offset being
|
|
779
|
+
// added, we should skip any logic now since `flip()` has already done its
|
|
780
|
+
// work.
|
|
781
|
+
// https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643
|
|
782
|
+
if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
783
|
+
return {};
|
|
784
|
+
}
|
|
785
|
+
const side = getSide(placement);
|
|
786
|
+
const initialSideAxis = getSideAxis(initialPlacement);
|
|
787
|
+
const isBasePlacement = getSide(initialPlacement) === initialPlacement;
|
|
788
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
789
|
+
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
|
|
790
|
+
const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';
|
|
791
|
+
if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
|
|
792
|
+
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
793
|
+
}
|
|
794
|
+
const placements = [initialPlacement, ...fallbackPlacements];
|
|
795
|
+
const overflow = await platform.detectOverflow(state, detectOverflowOptions);
|
|
796
|
+
const overflows = [];
|
|
797
|
+
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
798
|
+
if (checkMainAxis) {
|
|
799
|
+
overflows.push(overflow[side]);
|
|
800
|
+
}
|
|
801
|
+
if (checkCrossAxis) {
|
|
802
|
+
const sides = getAlignmentSides(placement, rects, rtl);
|
|
803
|
+
overflows.push(overflow[sides[0]], overflow[sides[1]]);
|
|
804
|
+
}
|
|
805
|
+
overflowsData = [...overflowsData, {
|
|
806
|
+
placement,
|
|
807
|
+
overflows
|
|
808
|
+
}];
|
|
809
|
+
|
|
810
|
+
// One or more sides is overflowing.
|
|
811
|
+
if (!overflows.every(side => side <= 0)) {
|
|
812
|
+
var _middlewareData$flip2, _overflowsData$filter;
|
|
813
|
+
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
|
|
814
|
+
const nextPlacement = placements[nextIndex];
|
|
815
|
+
if (nextPlacement) {
|
|
816
|
+
const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false;
|
|
817
|
+
if (!ignoreCrossAxisOverflow ||
|
|
818
|
+
// We leave the current main axis only if every placement on that axis
|
|
819
|
+
// overflows the main axis.
|
|
820
|
+
overflowsData.every(d => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {
|
|
821
|
+
// Try next placement and re-run the lifecycle.
|
|
822
|
+
return {
|
|
823
|
+
data: {
|
|
824
|
+
index: nextIndex,
|
|
825
|
+
overflows: overflowsData
|
|
826
|
+
},
|
|
827
|
+
reset: {
|
|
828
|
+
placement: nextPlacement
|
|
829
|
+
}
|
|
830
|
+
};
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
// First, find the candidates that fit on the mainAxis side of overflow,
|
|
835
|
+
// then find the placement that fits the best on the main crossAxis side.
|
|
836
|
+
let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
|
|
837
|
+
|
|
838
|
+
// Otherwise fallback.
|
|
839
|
+
if (!resetPlacement) {
|
|
840
|
+
switch (fallbackStrategy) {
|
|
841
|
+
case 'bestFit':
|
|
842
|
+
{
|
|
843
|
+
var _overflowsData$filter2;
|
|
844
|
+
const placement = (_overflowsData$filter2 = overflowsData.filter(d => {
|
|
845
|
+
if (hasFallbackAxisSideDirection) {
|
|
846
|
+
const currentSideAxis = getSideAxis(d.placement);
|
|
847
|
+
return currentSideAxis === initialSideAxis ||
|
|
848
|
+
// Create a bias to the `y` side axis due to horizontal
|
|
849
|
+
// reading directions favoring greater width.
|
|
850
|
+
currentSideAxis === 'y';
|
|
851
|
+
}
|
|
852
|
+
return true;
|
|
853
|
+
}).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
|
|
854
|
+
if (placement) {
|
|
855
|
+
resetPlacement = placement;
|
|
856
|
+
}
|
|
857
|
+
break;
|
|
858
|
+
}
|
|
859
|
+
case 'initialPlacement':
|
|
860
|
+
resetPlacement = initialPlacement;
|
|
861
|
+
break;
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
if (placement !== resetPlacement) {
|
|
865
|
+
return {
|
|
866
|
+
reset: {
|
|
867
|
+
placement: resetPlacement
|
|
868
|
+
}
|
|
869
|
+
};
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
return {};
|
|
873
|
+
}
|
|
874
|
+
};
|
|
875
|
+
};
|
|
876
|
+
|
|
877
|
+
function getSideOffsets(overflow, rect) {
|
|
878
|
+
return {
|
|
879
|
+
top: overflow.top - rect.height,
|
|
880
|
+
right: overflow.right - rect.width,
|
|
881
|
+
bottom: overflow.bottom - rect.height,
|
|
882
|
+
left: overflow.left - rect.width
|
|
883
|
+
};
|
|
884
|
+
}
|
|
885
|
+
function isAnySideFullyClipped(overflow) {
|
|
886
|
+
return sides.some(side => overflow[side] >= 0);
|
|
887
|
+
}
|
|
888
|
+
/**
|
|
889
|
+
* Provides data to hide the floating element in applicable situations, such as
|
|
890
|
+
* when it is not in the same clipping context as the reference element.
|
|
891
|
+
* @see https://floating-ui.com/docs/hide
|
|
892
|
+
*/
|
|
893
|
+
const hide$1 = function (options) {
|
|
894
|
+
if (options === void 0) {
|
|
895
|
+
options = {};
|
|
896
|
+
}
|
|
897
|
+
return {
|
|
898
|
+
name: 'hide',
|
|
899
|
+
options,
|
|
900
|
+
async fn(state) {
|
|
901
|
+
const {
|
|
902
|
+
rects,
|
|
903
|
+
platform
|
|
904
|
+
} = state;
|
|
905
|
+
const {
|
|
906
|
+
strategy = 'referenceHidden',
|
|
907
|
+
...detectOverflowOptions
|
|
908
|
+
} = evaluate(options, state);
|
|
909
|
+
switch (strategy) {
|
|
910
|
+
case 'referenceHidden':
|
|
911
|
+
{
|
|
912
|
+
const overflow = await platform.detectOverflow(state, {
|
|
913
|
+
...detectOverflowOptions,
|
|
914
|
+
elementContext: 'reference'
|
|
915
|
+
});
|
|
916
|
+
const offsets = getSideOffsets(overflow, rects.reference);
|
|
917
|
+
return {
|
|
918
|
+
data: {
|
|
919
|
+
referenceHiddenOffsets: offsets,
|
|
920
|
+
referenceHidden: isAnySideFullyClipped(offsets)
|
|
921
|
+
}
|
|
922
|
+
};
|
|
923
|
+
}
|
|
924
|
+
case 'escaped':
|
|
925
|
+
{
|
|
926
|
+
const overflow = await platform.detectOverflow(state, {
|
|
927
|
+
...detectOverflowOptions,
|
|
928
|
+
altBoundary: true
|
|
929
|
+
});
|
|
930
|
+
const offsets = getSideOffsets(overflow, rects.floating);
|
|
931
|
+
return {
|
|
932
|
+
data: {
|
|
933
|
+
escapedOffsets: offsets,
|
|
934
|
+
escaped: isAnySideFullyClipped(offsets)
|
|
935
|
+
}
|
|
936
|
+
};
|
|
937
|
+
}
|
|
938
|
+
default:
|
|
939
|
+
{
|
|
940
|
+
return {};
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
}
|
|
944
|
+
};
|
|
945
|
+
};
|
|
946
|
+
|
|
947
|
+
const originSides = /*#__PURE__*/new Set(['left', 'top']);
|
|
948
|
+
|
|
949
|
+
// For type backwards-compatibility, the `OffsetOptions` type was also
|
|
950
|
+
// Derivable.
|
|
951
|
+
|
|
952
|
+
async function convertValueToCoords(state, options) {
|
|
953
|
+
const {
|
|
954
|
+
placement,
|
|
955
|
+
platform,
|
|
956
|
+
elements
|
|
957
|
+
} = state;
|
|
958
|
+
const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
|
|
959
|
+
const side = getSide(placement);
|
|
960
|
+
const alignment = getAlignment(placement);
|
|
961
|
+
const isVertical = getSideAxis(placement) === 'y';
|
|
962
|
+
const mainAxisMulti = originSides.has(side) ? -1 : 1;
|
|
963
|
+
const crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
964
|
+
const rawValue = evaluate(options, state);
|
|
965
|
+
|
|
966
|
+
// eslint-disable-next-line prefer-const
|
|
967
|
+
let {
|
|
968
|
+
mainAxis,
|
|
969
|
+
crossAxis,
|
|
970
|
+
alignmentAxis
|
|
971
|
+
} = typeof rawValue === 'number' ? {
|
|
972
|
+
mainAxis: rawValue,
|
|
973
|
+
crossAxis: 0,
|
|
974
|
+
alignmentAxis: null
|
|
975
|
+
} : {
|
|
976
|
+
mainAxis: rawValue.mainAxis || 0,
|
|
977
|
+
crossAxis: rawValue.crossAxis || 0,
|
|
978
|
+
alignmentAxis: rawValue.alignmentAxis
|
|
979
|
+
};
|
|
980
|
+
if (alignment && typeof alignmentAxis === 'number') {
|
|
981
|
+
crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
|
|
982
|
+
}
|
|
983
|
+
return isVertical ? {
|
|
984
|
+
x: crossAxis * crossAxisMulti,
|
|
985
|
+
y: mainAxis * mainAxisMulti
|
|
986
|
+
} : {
|
|
987
|
+
x: mainAxis * mainAxisMulti,
|
|
988
|
+
y: crossAxis * crossAxisMulti
|
|
989
|
+
};
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
/**
|
|
993
|
+
* Modifies the placement by translating the floating element along the
|
|
994
|
+
* specified axes.
|
|
995
|
+
* A number (shorthand for `mainAxis` or distance), or an axes configuration
|
|
996
|
+
* object may be passed.
|
|
997
|
+
* @see https://floating-ui.com/docs/offset
|
|
998
|
+
*/
|
|
999
|
+
const offset$1 = function (options) {
|
|
1000
|
+
if (options === void 0) {
|
|
1001
|
+
options = 0;
|
|
1002
|
+
}
|
|
1003
|
+
return {
|
|
1004
|
+
name: 'offset',
|
|
1005
|
+
options,
|
|
1006
|
+
async fn(state) {
|
|
1007
|
+
var _middlewareData$offse, _middlewareData$arrow;
|
|
1008
|
+
const {
|
|
1009
|
+
x,
|
|
1010
|
+
y,
|
|
1011
|
+
placement,
|
|
1012
|
+
middlewareData
|
|
1013
|
+
} = state;
|
|
1014
|
+
const diffCoords = await convertValueToCoords(state, options);
|
|
1015
|
+
|
|
1016
|
+
// If the placement is the same and the arrow caused an alignment offset
|
|
1017
|
+
// then we don't need to change the positioning coordinates.
|
|
1018
|
+
if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
1019
|
+
return {};
|
|
1020
|
+
}
|
|
1021
|
+
return {
|
|
1022
|
+
x: x + diffCoords.x,
|
|
1023
|
+
y: y + diffCoords.y,
|
|
1024
|
+
data: {
|
|
1025
|
+
...diffCoords,
|
|
1026
|
+
placement
|
|
1027
|
+
}
|
|
1028
|
+
};
|
|
1029
|
+
}
|
|
1030
|
+
};
|
|
1031
|
+
};
|
|
1032
|
+
|
|
1033
|
+
/**
|
|
1034
|
+
* Provides data that allows you to change the size of the floating element —
|
|
1035
|
+
* for instance, prevent it from overflowing the clipping boundary or match the
|
|
1036
|
+
* width of the reference element.
|
|
1037
|
+
* @see https://floating-ui.com/docs/size
|
|
1038
|
+
*/
|
|
1039
|
+
const size$1 = function (options) {
|
|
1040
|
+
if (options === void 0) {
|
|
1041
|
+
options = {};
|
|
1042
|
+
}
|
|
1043
|
+
return {
|
|
1044
|
+
name: 'size',
|
|
1045
|
+
options,
|
|
1046
|
+
async fn(state) {
|
|
1047
|
+
var _state$middlewareData, _state$middlewareData2;
|
|
1048
|
+
const {
|
|
1049
|
+
placement,
|
|
1050
|
+
rects,
|
|
1051
|
+
platform,
|
|
1052
|
+
elements
|
|
1053
|
+
} = state;
|
|
1054
|
+
const {
|
|
1055
|
+
apply = () => {},
|
|
1056
|
+
...detectOverflowOptions
|
|
1057
|
+
} = evaluate(options, state);
|
|
1058
|
+
const overflow = await platform.detectOverflow(state, detectOverflowOptions);
|
|
1059
|
+
const side = getSide(placement);
|
|
1060
|
+
const alignment = getAlignment(placement);
|
|
1061
|
+
const isYAxis = getSideAxis(placement) === 'y';
|
|
1062
|
+
const {
|
|
1063
|
+
width,
|
|
1064
|
+
height
|
|
1065
|
+
} = rects.floating;
|
|
1066
|
+
let heightSide;
|
|
1067
|
+
let widthSide;
|
|
1068
|
+
if (side === 'top' || side === 'bottom') {
|
|
1069
|
+
heightSide = side;
|
|
1070
|
+
widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';
|
|
1071
|
+
} else {
|
|
1072
|
+
widthSide = side;
|
|
1073
|
+
heightSide = alignment === 'end' ? 'top' : 'bottom';
|
|
1074
|
+
}
|
|
1075
|
+
const maximumClippingHeight = height - overflow.top - overflow.bottom;
|
|
1076
|
+
const maximumClippingWidth = width - overflow.left - overflow.right;
|
|
1077
|
+
const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);
|
|
1078
|
+
const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);
|
|
1079
|
+
const noShift = !state.middlewareData.shift;
|
|
1080
|
+
let availableHeight = overflowAvailableHeight;
|
|
1081
|
+
let availableWidth = overflowAvailableWidth;
|
|
1082
|
+
if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) {
|
|
1083
|
+
availableWidth = maximumClippingWidth;
|
|
1084
|
+
}
|
|
1085
|
+
if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) {
|
|
1086
|
+
availableHeight = maximumClippingHeight;
|
|
1087
|
+
}
|
|
1088
|
+
if (noShift && !alignment) {
|
|
1089
|
+
const xMin = max(overflow.left, 0);
|
|
1090
|
+
const xMax = max(overflow.right, 0);
|
|
1091
|
+
const yMin = max(overflow.top, 0);
|
|
1092
|
+
const yMax = max(overflow.bottom, 0);
|
|
1093
|
+
if (isYAxis) {
|
|
1094
|
+
availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));
|
|
1095
|
+
} else {
|
|
1096
|
+
availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1099
|
+
await apply({
|
|
1100
|
+
...state,
|
|
1101
|
+
availableWidth,
|
|
1102
|
+
availableHeight
|
|
1103
|
+
});
|
|
1104
|
+
const nextDimensions = await platform.getDimensions(elements.floating);
|
|
1105
|
+
if (width !== nextDimensions.width || height !== nextDimensions.height) {
|
|
1106
|
+
return {
|
|
1107
|
+
reset: {
|
|
1108
|
+
rects: true
|
|
1109
|
+
}
|
|
1110
|
+
};
|
|
1111
|
+
}
|
|
1112
|
+
return {};
|
|
1113
|
+
}
|
|
1114
|
+
};
|
|
1115
|
+
};
|
|
1116
|
+
|
|
1117
|
+
function hasWindow() {
|
|
1118
|
+
return typeof window !== 'undefined';
|
|
1119
|
+
}
|
|
1120
|
+
function getNodeName(node) {
|
|
1121
|
+
if (isNode(node)) {
|
|
1122
|
+
return (node.nodeName || '').toLowerCase();
|
|
1123
|
+
}
|
|
1124
|
+
// Mocked nodes in testing environments may not be instances of Node. By
|
|
1125
|
+
// returning `#document` an infinite loop won't occur.
|
|
1126
|
+
// https://github.com/floating-ui/floating-ui/issues/2317
|
|
1127
|
+
return '#document';
|
|
1128
|
+
}
|
|
1129
|
+
function getWindow(node) {
|
|
1130
|
+
var _node$ownerDocument;
|
|
1131
|
+
return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
|
|
1132
|
+
}
|
|
1133
|
+
function getDocumentElement(node) {
|
|
1134
|
+
var _ref;
|
|
1135
|
+
return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
|
|
1136
|
+
}
|
|
1137
|
+
function isNode(value) {
|
|
1138
|
+
if (!hasWindow()) {
|
|
1139
|
+
return false;
|
|
1140
|
+
}
|
|
1141
|
+
return value instanceof Node || value instanceof getWindow(value).Node;
|
|
1142
|
+
}
|
|
1143
|
+
function isElement(value) {
|
|
1144
|
+
if (!hasWindow()) {
|
|
1145
|
+
return false;
|
|
1146
|
+
}
|
|
1147
|
+
return value instanceof Element || value instanceof getWindow(value).Element;
|
|
1148
|
+
}
|
|
1149
|
+
function isHTMLElement(value) {
|
|
1150
|
+
if (!hasWindow()) {
|
|
1151
|
+
return false;
|
|
1152
|
+
}
|
|
1153
|
+
return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
|
|
1154
|
+
}
|
|
1155
|
+
function isShadowRoot(value) {
|
|
1156
|
+
if (!hasWindow() || typeof ShadowRoot === 'undefined') {
|
|
1157
|
+
return false;
|
|
1158
|
+
}
|
|
1159
|
+
return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
|
|
1160
|
+
}
|
|
1161
|
+
function isOverflowElement(element) {
|
|
1162
|
+
const {
|
|
1163
|
+
overflow,
|
|
1164
|
+
overflowX,
|
|
1165
|
+
overflowY,
|
|
1166
|
+
display
|
|
1167
|
+
} = getComputedStyle$1(element);
|
|
1168
|
+
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== 'inline' && display !== 'contents';
|
|
1169
|
+
}
|
|
1170
|
+
function isTableElement(element) {
|
|
1171
|
+
return /^(table|td|th)$/.test(getNodeName(element));
|
|
1172
|
+
}
|
|
1173
|
+
function isTopLayer(element) {
|
|
1174
|
+
try {
|
|
1175
|
+
if (element.matches(':popover-open')) {
|
|
1176
|
+
return true;
|
|
1177
|
+
}
|
|
1178
|
+
} catch (_e) {
|
|
1179
|
+
// no-op
|
|
1180
|
+
}
|
|
1181
|
+
try {
|
|
1182
|
+
return element.matches(':modal');
|
|
1183
|
+
} catch (_e) {
|
|
1184
|
+
return false;
|
|
1185
|
+
}
|
|
1186
|
+
}
|
|
1187
|
+
const willChangeRe = /transform|translate|scale|rotate|perspective|filter/;
|
|
1188
|
+
const containRe = /paint|layout|strict|content/;
|
|
1189
|
+
const isNotNone = value => !!value && value !== 'none';
|
|
1190
|
+
let isWebKitValue;
|
|
1191
|
+
function isContainingBlock(elementOrCss) {
|
|
1192
|
+
const css = isElement(elementOrCss) ? getComputedStyle$1(elementOrCss) : elementOrCss;
|
|
1193
|
+
|
|
1194
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
1195
|
+
// https://drafts.csswg.org/css-transforms-2/#individual-transforms
|
|
1196
|
+
return isNotNone(css.transform) || isNotNone(css.translate) || isNotNone(css.scale) || isNotNone(css.rotate) || isNotNone(css.perspective) || !isWebKit() && (isNotNone(css.backdropFilter) || isNotNone(css.filter)) || willChangeRe.test(css.willChange || '') || containRe.test(css.contain || '');
|
|
1197
|
+
}
|
|
1198
|
+
function getContainingBlock(element) {
|
|
1199
|
+
let currentNode = getParentNode(element);
|
|
1200
|
+
while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
1201
|
+
if (isContainingBlock(currentNode)) {
|
|
1202
|
+
return currentNode;
|
|
1203
|
+
} else if (isTopLayer(currentNode)) {
|
|
1204
|
+
return null;
|
|
1205
|
+
}
|
|
1206
|
+
currentNode = getParentNode(currentNode);
|
|
1207
|
+
}
|
|
1208
|
+
return null;
|
|
1209
|
+
}
|
|
1210
|
+
function isWebKit() {
|
|
1211
|
+
if (isWebKitValue == null) {
|
|
1212
|
+
isWebKitValue = typeof CSS !== 'undefined' && CSS.supports && CSS.supports('-webkit-backdrop-filter', 'none');
|
|
1213
|
+
}
|
|
1214
|
+
return isWebKitValue;
|
|
1215
|
+
}
|
|
1216
|
+
function isLastTraversableNode(node) {
|
|
1217
|
+
return /^(html|body|#document)$/.test(getNodeName(node));
|
|
1218
|
+
}
|
|
1219
|
+
function getComputedStyle$1(element) {
|
|
1220
|
+
return getWindow(element).getComputedStyle(element);
|
|
1221
|
+
}
|
|
1222
|
+
function getNodeScroll(element) {
|
|
1223
|
+
if (isElement(element)) {
|
|
1224
|
+
return {
|
|
1225
|
+
scrollLeft: element.scrollLeft,
|
|
1226
|
+
scrollTop: element.scrollTop
|
|
1227
|
+
};
|
|
1228
|
+
}
|
|
1229
|
+
return {
|
|
1230
|
+
scrollLeft: element.scrollX,
|
|
1231
|
+
scrollTop: element.scrollY
|
|
1232
|
+
};
|
|
1233
|
+
}
|
|
1234
|
+
function getParentNode(node) {
|
|
1235
|
+
if (getNodeName(node) === 'html') {
|
|
1236
|
+
return node;
|
|
1237
|
+
}
|
|
1238
|
+
const result =
|
|
1239
|
+
// Step into the shadow DOM of the parent of a slotted node.
|
|
1240
|
+
node.assignedSlot ||
|
|
1241
|
+
// DOM Element detected.
|
|
1242
|
+
node.parentNode ||
|
|
1243
|
+
// ShadowRoot detected.
|
|
1244
|
+
isShadowRoot(node) && node.host ||
|
|
1245
|
+
// Fallback.
|
|
1246
|
+
getDocumentElement(node);
|
|
1247
|
+
return isShadowRoot(result) ? result.host : result;
|
|
1248
|
+
}
|
|
1249
|
+
function getNearestOverflowAncestor(node) {
|
|
1250
|
+
const parentNode = getParentNode(node);
|
|
1251
|
+
if (isLastTraversableNode(parentNode)) {
|
|
1252
|
+
return node.ownerDocument ? node.ownerDocument.body : node.body;
|
|
1253
|
+
}
|
|
1254
|
+
if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
|
|
1255
|
+
return parentNode;
|
|
1256
|
+
}
|
|
1257
|
+
return getNearestOverflowAncestor(parentNode);
|
|
1258
|
+
}
|
|
1259
|
+
function getOverflowAncestors(node, list, traverseIframes) {
|
|
1260
|
+
var _node$ownerDocument2;
|
|
1261
|
+
if (list === void 0) {
|
|
1262
|
+
list = [];
|
|
1263
|
+
}
|
|
1264
|
+
if (traverseIframes === void 0) {
|
|
1265
|
+
traverseIframes = true;
|
|
1266
|
+
}
|
|
1267
|
+
const scrollableAncestor = getNearestOverflowAncestor(node);
|
|
1268
|
+
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
|
|
1269
|
+
const win = getWindow(scrollableAncestor);
|
|
1270
|
+
if (isBody) {
|
|
1271
|
+
const frameElement = getFrameElement(win);
|
|
1272
|
+
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
|
|
1273
|
+
} else {
|
|
1274
|
+
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
1275
|
+
}
|
|
1276
|
+
}
|
|
1277
|
+
function getFrameElement(win) {
|
|
1278
|
+
return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1281
|
+
function getCssDimensions(element) {
|
|
1282
|
+
const css = getComputedStyle$1(element);
|
|
1283
|
+
// In testing environments, the `width` and `height` properties are empty
|
|
1284
|
+
// strings for SVG elements, returning NaN. Fallback to `0` in this case.
|
|
1285
|
+
let width = parseFloat(css.width) || 0;
|
|
1286
|
+
let height = parseFloat(css.height) || 0;
|
|
1287
|
+
const hasOffset = isHTMLElement(element);
|
|
1288
|
+
const offsetWidth = hasOffset ? element.offsetWidth : width;
|
|
1289
|
+
const offsetHeight = hasOffset ? element.offsetHeight : height;
|
|
1290
|
+
const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
|
|
1291
|
+
if (shouldFallback) {
|
|
1292
|
+
width = offsetWidth;
|
|
1293
|
+
height = offsetHeight;
|
|
1294
|
+
}
|
|
1295
|
+
return {
|
|
1296
|
+
width,
|
|
1297
|
+
height,
|
|
1298
|
+
$: shouldFallback
|
|
1299
|
+
};
|
|
1300
|
+
}
|
|
1301
|
+
|
|
1302
|
+
function unwrapElement(element) {
|
|
1303
|
+
return !isElement(element) ? element.contextElement : element;
|
|
1304
|
+
}
|
|
1305
|
+
|
|
1306
|
+
function getScale(element) {
|
|
1307
|
+
const domElement = unwrapElement(element);
|
|
1308
|
+
if (!isHTMLElement(domElement)) {
|
|
1309
|
+
return createCoords(1);
|
|
1310
|
+
}
|
|
1311
|
+
const rect = domElement.getBoundingClientRect();
|
|
1312
|
+
const {
|
|
1313
|
+
width,
|
|
1314
|
+
height,
|
|
1315
|
+
$
|
|
1316
|
+
} = getCssDimensions(domElement);
|
|
1317
|
+
let x = ($ ? round(rect.width) : rect.width) / width;
|
|
1318
|
+
let y = ($ ? round(rect.height) : rect.height) / height;
|
|
1319
|
+
|
|
1320
|
+
// 0, NaN, or Infinity should always fallback to 1.
|
|
1321
|
+
|
|
1322
|
+
if (!x || !Number.isFinite(x)) {
|
|
1323
|
+
x = 1;
|
|
1324
|
+
}
|
|
1325
|
+
if (!y || !Number.isFinite(y)) {
|
|
1326
|
+
y = 1;
|
|
1327
|
+
}
|
|
1328
|
+
return {
|
|
1329
|
+
x,
|
|
1330
|
+
y
|
|
1331
|
+
};
|
|
1332
|
+
}
|
|
1333
|
+
|
|
1334
|
+
const noOffsets = /*#__PURE__*/createCoords(0);
|
|
1335
|
+
function getVisualOffsets(element) {
|
|
1336
|
+
const win = getWindow(element);
|
|
1337
|
+
if (!isWebKit() || !win.visualViewport) {
|
|
1338
|
+
return noOffsets;
|
|
1339
|
+
}
|
|
1340
|
+
return {
|
|
1341
|
+
x: win.visualViewport.offsetLeft,
|
|
1342
|
+
y: win.visualViewport.offsetTop
|
|
1343
|
+
};
|
|
1344
|
+
}
|
|
1345
|
+
function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
|
|
1346
|
+
if (isFixed === void 0) {
|
|
1347
|
+
isFixed = false;
|
|
1348
|
+
}
|
|
1349
|
+
if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
|
|
1350
|
+
return false;
|
|
1351
|
+
}
|
|
1352
|
+
return isFixed;
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
|
|
1356
|
+
if (includeScale === void 0) {
|
|
1357
|
+
includeScale = false;
|
|
1358
|
+
}
|
|
1359
|
+
if (isFixedStrategy === void 0) {
|
|
1360
|
+
isFixedStrategy = false;
|
|
1361
|
+
}
|
|
1362
|
+
const clientRect = element.getBoundingClientRect();
|
|
1363
|
+
const domElement = unwrapElement(element);
|
|
1364
|
+
let scale = createCoords(1);
|
|
1365
|
+
if (includeScale) {
|
|
1366
|
+
if (offsetParent) {
|
|
1367
|
+
if (isElement(offsetParent)) {
|
|
1368
|
+
scale = getScale(offsetParent);
|
|
1369
|
+
}
|
|
1370
|
+
} else {
|
|
1371
|
+
scale = getScale(element);
|
|
1372
|
+
}
|
|
1373
|
+
}
|
|
1374
|
+
const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
|
|
1375
|
+
let x = (clientRect.left + visualOffsets.x) / scale.x;
|
|
1376
|
+
let y = (clientRect.top + visualOffsets.y) / scale.y;
|
|
1377
|
+
let width = clientRect.width / scale.x;
|
|
1378
|
+
let height = clientRect.height / scale.y;
|
|
1379
|
+
if (domElement) {
|
|
1380
|
+
const win = getWindow(domElement);
|
|
1381
|
+
const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
|
|
1382
|
+
let currentWin = win;
|
|
1383
|
+
let currentIFrame = getFrameElement(currentWin);
|
|
1384
|
+
while (currentIFrame && offsetParent && offsetWin !== currentWin) {
|
|
1385
|
+
const iframeScale = getScale(currentIFrame);
|
|
1386
|
+
const iframeRect = currentIFrame.getBoundingClientRect();
|
|
1387
|
+
const css = getComputedStyle$1(currentIFrame);
|
|
1388
|
+
const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
|
|
1389
|
+
const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
|
|
1390
|
+
x *= iframeScale.x;
|
|
1391
|
+
y *= iframeScale.y;
|
|
1392
|
+
width *= iframeScale.x;
|
|
1393
|
+
height *= iframeScale.y;
|
|
1394
|
+
x += left;
|
|
1395
|
+
y += top;
|
|
1396
|
+
currentWin = getWindow(currentIFrame);
|
|
1397
|
+
currentIFrame = getFrameElement(currentWin);
|
|
1398
|
+
}
|
|
1399
|
+
}
|
|
1400
|
+
return rectToClientRect({
|
|
1401
|
+
width,
|
|
1402
|
+
height,
|
|
1403
|
+
x,
|
|
1404
|
+
y
|
|
1405
|
+
});
|
|
1406
|
+
}
|
|
1407
|
+
|
|
1408
|
+
// If <html> has a CSS width greater than the viewport, then this will be
|
|
1409
|
+
// incorrect for RTL.
|
|
1410
|
+
function getWindowScrollBarX(element, rect) {
|
|
1411
|
+
const leftScroll = getNodeScroll(element).scrollLeft;
|
|
1412
|
+
if (!rect) {
|
|
1413
|
+
return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
|
|
1414
|
+
}
|
|
1415
|
+
return rect.left + leftScroll;
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
function getHTMLOffset(documentElement, scroll) {
|
|
1419
|
+
const htmlRect = documentElement.getBoundingClientRect();
|
|
1420
|
+
const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);
|
|
1421
|
+
const y = htmlRect.top + scroll.scrollTop;
|
|
1422
|
+
return {
|
|
1423
|
+
x,
|
|
1424
|
+
y
|
|
1425
|
+
};
|
|
1426
|
+
}
|
|
1427
|
+
|
|
1428
|
+
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
1429
|
+
let {
|
|
1430
|
+
elements,
|
|
1431
|
+
rect,
|
|
1432
|
+
offsetParent,
|
|
1433
|
+
strategy
|
|
1434
|
+
} = _ref;
|
|
1435
|
+
const isFixed = strategy === 'fixed';
|
|
1436
|
+
const documentElement = getDocumentElement(offsetParent);
|
|
1437
|
+
const topLayer = elements ? isTopLayer(elements.floating) : false;
|
|
1438
|
+
if (offsetParent === documentElement || topLayer && isFixed) {
|
|
1439
|
+
return rect;
|
|
1440
|
+
}
|
|
1441
|
+
let scroll = {
|
|
1442
|
+
scrollLeft: 0,
|
|
1443
|
+
scrollTop: 0
|
|
1444
|
+
};
|
|
1445
|
+
let scale = createCoords(1);
|
|
1446
|
+
const offsets = createCoords(0);
|
|
1447
|
+
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
1448
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
1449
|
+
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
1450
|
+
scroll = getNodeScroll(offsetParent);
|
|
1451
|
+
}
|
|
1452
|
+
if (isOffsetParentAnElement) {
|
|
1453
|
+
const offsetRect = getBoundingClientRect(offsetParent);
|
|
1454
|
+
scale = getScale(offsetParent);
|
|
1455
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
1456
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
1457
|
+
}
|
|
1458
|
+
}
|
|
1459
|
+
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
|
|
1460
|
+
return {
|
|
1461
|
+
width: rect.width * scale.x,
|
|
1462
|
+
height: rect.height * scale.y,
|
|
1463
|
+
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,
|
|
1464
|
+
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y
|
|
1465
|
+
};
|
|
1466
|
+
}
|
|
1467
|
+
|
|
1468
|
+
function getClientRects(element) {
|
|
1469
|
+
return Array.from(element.getClientRects());
|
|
1470
|
+
}
|
|
1471
|
+
|
|
1472
|
+
// Gets the entire size of the scrollable document area, even extending outside
|
|
1473
|
+
// of the `<html>` and `<body>` rect bounds if horizontally scrollable.
|
|
1474
|
+
function getDocumentRect(element) {
|
|
1475
|
+
const html = getDocumentElement(element);
|
|
1476
|
+
const scroll = getNodeScroll(element);
|
|
1477
|
+
const body = element.ownerDocument.body;
|
|
1478
|
+
const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
|
|
1479
|
+
const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
|
|
1480
|
+
let x = -scroll.scrollLeft + getWindowScrollBarX(element);
|
|
1481
|
+
const y = -scroll.scrollTop;
|
|
1482
|
+
if (getComputedStyle$1(body).direction === 'rtl') {
|
|
1483
|
+
x += max(html.clientWidth, body.clientWidth) - width;
|
|
1484
|
+
}
|
|
1485
|
+
return {
|
|
1486
|
+
width,
|
|
1487
|
+
height,
|
|
1488
|
+
x,
|
|
1489
|
+
y
|
|
1490
|
+
};
|
|
1491
|
+
}
|
|
1492
|
+
|
|
1493
|
+
// Safety check: ensure the scrollbar space is reasonable in case this
|
|
1494
|
+
// calculation is affected by unusual styles.
|
|
1495
|
+
// Most scrollbars leave 15-18px of space.
|
|
1496
|
+
const SCROLLBAR_MAX = 25;
|
|
1497
|
+
function getViewportRect(element, strategy) {
|
|
1498
|
+
const win = getWindow(element);
|
|
1499
|
+
const html = getDocumentElement(element);
|
|
1500
|
+
const visualViewport = win.visualViewport;
|
|
1501
|
+
let width = html.clientWidth;
|
|
1502
|
+
let height = html.clientHeight;
|
|
1503
|
+
let x = 0;
|
|
1504
|
+
let y = 0;
|
|
1505
|
+
if (visualViewport) {
|
|
1506
|
+
width = visualViewport.width;
|
|
1507
|
+
height = visualViewport.height;
|
|
1508
|
+
const visualViewportBased = isWebKit();
|
|
1509
|
+
if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {
|
|
1510
|
+
x = visualViewport.offsetLeft;
|
|
1511
|
+
y = visualViewport.offsetTop;
|
|
1512
|
+
}
|
|
1513
|
+
}
|
|
1514
|
+
const windowScrollbarX = getWindowScrollBarX(html);
|
|
1515
|
+
// <html> `overflow: hidden` + `scrollbar-gutter: stable` reduces the
|
|
1516
|
+
// visual width of the <html> but this is not considered in the size
|
|
1517
|
+
// of `html.clientWidth`.
|
|
1518
|
+
if (windowScrollbarX <= 0) {
|
|
1519
|
+
const doc = html.ownerDocument;
|
|
1520
|
+
const body = doc.body;
|
|
1521
|
+
const bodyStyles = getComputedStyle(body);
|
|
1522
|
+
const bodyMarginInline = doc.compatMode === 'CSS1Compat' ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
|
|
1523
|
+
const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);
|
|
1524
|
+
if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) {
|
|
1525
|
+
width -= clippingStableScrollbarWidth;
|
|
1526
|
+
}
|
|
1527
|
+
} else if (windowScrollbarX <= SCROLLBAR_MAX) {
|
|
1528
|
+
// If the <body> scrollbar is on the left, the width needs to be extended
|
|
1529
|
+
// by the scrollbar amount so there isn't extra space on the right.
|
|
1530
|
+
width += windowScrollbarX;
|
|
1531
|
+
}
|
|
1532
|
+
return {
|
|
1533
|
+
width,
|
|
1534
|
+
height,
|
|
1535
|
+
x,
|
|
1536
|
+
y
|
|
1537
|
+
};
|
|
1538
|
+
}
|
|
1539
|
+
|
|
1540
|
+
// Returns the inner client rect, subtracting scrollbars if present.
|
|
1541
|
+
function getInnerBoundingClientRect(element, strategy) {
|
|
1542
|
+
const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
|
|
1543
|
+
const top = clientRect.top + element.clientTop;
|
|
1544
|
+
const left = clientRect.left + element.clientLeft;
|
|
1545
|
+
const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
|
|
1546
|
+
const width = element.clientWidth * scale.x;
|
|
1547
|
+
const height = element.clientHeight * scale.y;
|
|
1548
|
+
const x = left * scale.x;
|
|
1549
|
+
const y = top * scale.y;
|
|
1550
|
+
return {
|
|
1551
|
+
width,
|
|
1552
|
+
height,
|
|
1553
|
+
x,
|
|
1554
|
+
y
|
|
1555
|
+
};
|
|
1556
|
+
}
|
|
1557
|
+
function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
|
|
1558
|
+
let rect;
|
|
1559
|
+
if (clippingAncestor === 'viewport') {
|
|
1560
|
+
rect = getViewportRect(element, strategy);
|
|
1561
|
+
} else if (clippingAncestor === 'document') {
|
|
1562
|
+
rect = getDocumentRect(getDocumentElement(element));
|
|
1563
|
+
} else if (isElement(clippingAncestor)) {
|
|
1564
|
+
rect = getInnerBoundingClientRect(clippingAncestor, strategy);
|
|
1565
|
+
} else {
|
|
1566
|
+
const visualOffsets = getVisualOffsets(element);
|
|
1567
|
+
rect = {
|
|
1568
|
+
x: clippingAncestor.x - visualOffsets.x,
|
|
1569
|
+
y: clippingAncestor.y - visualOffsets.y,
|
|
1570
|
+
width: clippingAncestor.width,
|
|
1571
|
+
height: clippingAncestor.height
|
|
1572
|
+
};
|
|
1573
|
+
}
|
|
1574
|
+
return rectToClientRect(rect);
|
|
1575
|
+
}
|
|
1576
|
+
function hasFixedPositionAncestor(element, stopNode) {
|
|
1577
|
+
const parentNode = getParentNode(element);
|
|
1578
|
+
if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {
|
|
1579
|
+
return false;
|
|
1580
|
+
}
|
|
1581
|
+
return getComputedStyle$1(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
|
|
1582
|
+
}
|
|
1583
|
+
|
|
1584
|
+
// A "clipping ancestor" is an `overflow` element with the characteristic of
|
|
1585
|
+
// clipping (or hiding) child elements. This returns all clipping ancestors
|
|
1586
|
+
// of the given element up the tree.
|
|
1587
|
+
function getClippingElementAncestors(element, cache) {
|
|
1588
|
+
const cachedResult = cache.get(element);
|
|
1589
|
+
if (cachedResult) {
|
|
1590
|
+
return cachedResult;
|
|
1591
|
+
}
|
|
1592
|
+
let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');
|
|
1593
|
+
let currentContainingBlockComputedStyle = null;
|
|
1594
|
+
const elementIsFixed = getComputedStyle$1(element).position === 'fixed';
|
|
1595
|
+
let currentNode = elementIsFixed ? getParentNode(element) : element;
|
|
1596
|
+
|
|
1597
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
|
|
1598
|
+
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
1599
|
+
const computedStyle = getComputedStyle$1(currentNode);
|
|
1600
|
+
const currentNodeIsContaining = isContainingBlock(currentNode);
|
|
1601
|
+
if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
|
|
1602
|
+
currentContainingBlockComputedStyle = null;
|
|
1603
|
+
}
|
|
1604
|
+
const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && (currentContainingBlockComputedStyle.position === 'absolute' || currentContainingBlockComputedStyle.position === 'fixed') || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
|
|
1605
|
+
if (shouldDropCurrentNode) {
|
|
1606
|
+
// Drop non-containing blocks.
|
|
1607
|
+
result = result.filter(ancestor => ancestor !== currentNode);
|
|
1608
|
+
} else {
|
|
1609
|
+
// Record last containing block for next iteration.
|
|
1610
|
+
currentContainingBlockComputedStyle = computedStyle;
|
|
1611
|
+
}
|
|
1612
|
+
currentNode = getParentNode(currentNode);
|
|
1613
|
+
}
|
|
1614
|
+
cache.set(element, result);
|
|
1615
|
+
return result;
|
|
1616
|
+
}
|
|
1617
|
+
|
|
1618
|
+
// Gets the maximum area that the element is visible in due to any number of
|
|
1619
|
+
// clipping ancestors.
|
|
1620
|
+
function getClippingRect(_ref) {
|
|
1621
|
+
let {
|
|
1622
|
+
element,
|
|
1623
|
+
boundary,
|
|
1624
|
+
rootBoundary,
|
|
1625
|
+
strategy
|
|
1626
|
+
} = _ref;
|
|
1627
|
+
const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
|
|
1628
|
+
const clippingAncestors = [...elementClippingAncestors, rootBoundary];
|
|
1629
|
+
const firstRect = getClientRectFromClippingAncestor(element, clippingAncestors[0], strategy);
|
|
1630
|
+
let top = firstRect.top;
|
|
1631
|
+
let right = firstRect.right;
|
|
1632
|
+
let bottom = firstRect.bottom;
|
|
1633
|
+
let left = firstRect.left;
|
|
1634
|
+
for (let i = 1; i < clippingAncestors.length; i++) {
|
|
1635
|
+
const rect = getClientRectFromClippingAncestor(element, clippingAncestors[i], strategy);
|
|
1636
|
+
top = max(rect.top, top);
|
|
1637
|
+
right = min(rect.right, right);
|
|
1638
|
+
bottom = min(rect.bottom, bottom);
|
|
1639
|
+
left = max(rect.left, left);
|
|
1640
|
+
}
|
|
1641
|
+
return {
|
|
1642
|
+
width: right - left,
|
|
1643
|
+
height: bottom - top,
|
|
1644
|
+
x: left,
|
|
1645
|
+
y: top
|
|
1646
|
+
};
|
|
1647
|
+
}
|
|
1648
|
+
|
|
1649
|
+
function getDimensions(element) {
|
|
1650
|
+
const {
|
|
1651
|
+
width,
|
|
1652
|
+
height
|
|
1653
|
+
} = getCssDimensions(element);
|
|
1654
|
+
return {
|
|
1655
|
+
width,
|
|
1656
|
+
height
|
|
1657
|
+
};
|
|
1658
|
+
}
|
|
1659
|
+
|
|
1660
|
+
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
1661
|
+
const isOffsetParentAnElement = isHTMLElement(offsetParent);
|
|
1662
|
+
const documentElement = getDocumentElement(offsetParent);
|
|
1663
|
+
const isFixed = strategy === 'fixed';
|
|
1664
|
+
const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
|
|
1665
|
+
let scroll = {
|
|
1666
|
+
scrollLeft: 0,
|
|
1667
|
+
scrollTop: 0
|
|
1668
|
+
};
|
|
1669
|
+
const offsets = createCoords(0);
|
|
1670
|
+
|
|
1671
|
+
// If the <body> scrollbar appears on the left (e.g. RTL systems). Use
|
|
1672
|
+
// Firefox with layout.scrollbar.side = 3 in about:config to test this.
|
|
1673
|
+
function setLeftRTLScrollbarOffset() {
|
|
1674
|
+
offsets.x = getWindowScrollBarX(documentElement);
|
|
1675
|
+
}
|
|
1676
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
|
1677
|
+
if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
|
|
1678
|
+
scroll = getNodeScroll(offsetParent);
|
|
1679
|
+
}
|
|
1680
|
+
if (isOffsetParentAnElement) {
|
|
1681
|
+
const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
|
|
1682
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
1683
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
1684
|
+
} else if (documentElement) {
|
|
1685
|
+
setLeftRTLScrollbarOffset();
|
|
1686
|
+
}
|
|
1687
|
+
}
|
|
1688
|
+
if (isFixed && !isOffsetParentAnElement && documentElement) {
|
|
1689
|
+
setLeftRTLScrollbarOffset();
|
|
1690
|
+
}
|
|
1691
|
+
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
|
|
1692
|
+
const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
|
|
1693
|
+
const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
|
|
1694
|
+
return {
|
|
1695
|
+
x,
|
|
1696
|
+
y,
|
|
1697
|
+
width: rect.width,
|
|
1698
|
+
height: rect.height
|
|
1699
|
+
};
|
|
1700
|
+
}
|
|
1701
|
+
|
|
1702
|
+
function isStaticPositioned(element) {
|
|
1703
|
+
return getComputedStyle$1(element).position === 'static';
|
|
1704
|
+
}
|
|
1705
|
+
|
|
1706
|
+
function getTrueOffsetParent(element, polyfill) {
|
|
1707
|
+
if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {
|
|
1708
|
+
return null;
|
|
1709
|
+
}
|
|
1710
|
+
if (polyfill) {
|
|
1711
|
+
return polyfill(element);
|
|
1712
|
+
}
|
|
1713
|
+
let rawOffsetParent = element.offsetParent;
|
|
1714
|
+
|
|
1715
|
+
// Firefox returns the <html> element as the offsetParent if it's non-static,
|
|
1716
|
+
// while Chrome and Safari return the <body> element. The <body> element must
|
|
1717
|
+
// be used to perform the correct calculations even if the <html> element is
|
|
1718
|
+
// non-static.
|
|
1719
|
+
if (getDocumentElement(element) === rawOffsetParent) {
|
|
1720
|
+
rawOffsetParent = rawOffsetParent.ownerDocument.body;
|
|
1721
|
+
}
|
|
1722
|
+
return rawOffsetParent;
|
|
1723
|
+
}
|
|
1724
|
+
|
|
1725
|
+
// Gets the closest ancestor positioned element. Handles some edge cases,
|
|
1726
|
+
// such as table ancestors and cross browser bugs.
|
|
1727
|
+
function getOffsetParent(element, polyfill) {
|
|
1728
|
+
const win = getWindow(element);
|
|
1729
|
+
if (isTopLayer(element)) {
|
|
1730
|
+
return win;
|
|
1731
|
+
}
|
|
1732
|
+
if (!isHTMLElement(element)) {
|
|
1733
|
+
let svgOffsetParent = getParentNode(element);
|
|
1734
|
+
while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
|
|
1735
|
+
if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
|
|
1736
|
+
return svgOffsetParent;
|
|
1737
|
+
}
|
|
1738
|
+
svgOffsetParent = getParentNode(svgOffsetParent);
|
|
1739
|
+
}
|
|
1740
|
+
return win;
|
|
1741
|
+
}
|
|
1742
|
+
let offsetParent = getTrueOffsetParent(element, polyfill);
|
|
1743
|
+
while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {
|
|
1744
|
+
offsetParent = getTrueOffsetParent(offsetParent, polyfill);
|
|
1745
|
+
}
|
|
1746
|
+
if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {
|
|
1747
|
+
return win;
|
|
1748
|
+
}
|
|
1749
|
+
return offsetParent || getContainingBlock(element) || win;
|
|
1750
|
+
}
|
|
1751
|
+
|
|
1752
|
+
const getElementRects = async function (data) {
|
|
1753
|
+
const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
|
|
1754
|
+
const getDimensionsFn = this.getDimensions;
|
|
1755
|
+
const floatingDimensions = await getDimensionsFn(data.floating);
|
|
1756
|
+
return {
|
|
1757
|
+
reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
|
|
1758
|
+
floating: {
|
|
1759
|
+
x: 0,
|
|
1760
|
+
y: 0,
|
|
1761
|
+
width: floatingDimensions.width,
|
|
1762
|
+
height: floatingDimensions.height
|
|
1763
|
+
}
|
|
1764
|
+
};
|
|
1765
|
+
};
|
|
1766
|
+
|
|
1767
|
+
function isRTL(element) {
|
|
1768
|
+
return getComputedStyle$1(element).direction === 'rtl';
|
|
1769
|
+
}
|
|
1770
|
+
|
|
1771
|
+
const platform = {
|
|
1772
|
+
convertOffsetParentRelativeRectToViewportRelativeRect,
|
|
1773
|
+
getDocumentElement,
|
|
1774
|
+
getClippingRect,
|
|
1775
|
+
getOffsetParent,
|
|
1776
|
+
getElementRects,
|
|
1777
|
+
getClientRects,
|
|
1778
|
+
getDimensions,
|
|
1779
|
+
getScale,
|
|
1780
|
+
isElement,
|
|
1781
|
+
isRTL
|
|
1782
|
+
};
|
|
1783
|
+
|
|
1784
|
+
function rectsAreEqual(a, b) {
|
|
1785
|
+
return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
|
|
1786
|
+
}
|
|
1787
|
+
|
|
1788
|
+
// https://samthor.au/2021/observing-dom/
|
|
1789
|
+
function observeMove(element, onMove) {
|
|
1790
|
+
let io = null;
|
|
1791
|
+
let timeoutId;
|
|
1792
|
+
const root = getDocumentElement(element);
|
|
1793
|
+
function cleanup() {
|
|
1794
|
+
var _io;
|
|
1795
|
+
clearTimeout(timeoutId);
|
|
1796
|
+
(_io = io) == null || _io.disconnect();
|
|
1797
|
+
io = null;
|
|
1798
|
+
}
|
|
1799
|
+
function refresh(skip, threshold) {
|
|
1800
|
+
if (skip === void 0) {
|
|
1801
|
+
skip = false;
|
|
1802
|
+
}
|
|
1803
|
+
if (threshold === void 0) {
|
|
1804
|
+
threshold = 1;
|
|
1805
|
+
}
|
|
1806
|
+
cleanup();
|
|
1807
|
+
const elementRectForRootMargin = element.getBoundingClientRect();
|
|
1808
|
+
const {
|
|
1809
|
+
left,
|
|
1810
|
+
top,
|
|
1811
|
+
width,
|
|
1812
|
+
height
|
|
1813
|
+
} = elementRectForRootMargin;
|
|
1814
|
+
if (!skip) {
|
|
1815
|
+
onMove();
|
|
1816
|
+
}
|
|
1817
|
+
if (!width || !height) {
|
|
1818
|
+
return;
|
|
1819
|
+
}
|
|
1820
|
+
const insetTop = floor(top);
|
|
1821
|
+
const insetRight = floor(root.clientWidth - (left + width));
|
|
1822
|
+
const insetBottom = floor(root.clientHeight - (top + height));
|
|
1823
|
+
const insetLeft = floor(left);
|
|
1824
|
+
const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
|
|
1825
|
+
const options = {
|
|
1826
|
+
rootMargin,
|
|
1827
|
+
threshold: max(0, min(1, threshold)) || 1
|
|
1828
|
+
};
|
|
1829
|
+
let isFirstUpdate = true;
|
|
1830
|
+
function handleObserve(entries) {
|
|
1831
|
+
const ratio = entries[0].intersectionRatio;
|
|
1832
|
+
if (ratio !== threshold) {
|
|
1833
|
+
if (!isFirstUpdate) {
|
|
1834
|
+
return refresh();
|
|
1835
|
+
}
|
|
1836
|
+
if (!ratio) {
|
|
1837
|
+
// If the reference is clipped, the ratio is 0. Throttle the refresh
|
|
1838
|
+
// to prevent an infinite loop of updates.
|
|
1839
|
+
timeoutId = setTimeout(() => {
|
|
1840
|
+
refresh(false, 1e-7);
|
|
1841
|
+
}, 1000);
|
|
1842
|
+
} else {
|
|
1843
|
+
refresh(false, ratio);
|
|
1844
|
+
}
|
|
1845
|
+
}
|
|
1846
|
+
if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
|
|
1847
|
+
// It's possible that even though the ratio is reported as 1, the
|
|
1848
|
+
// element is not actually fully within the IntersectionObserver's root
|
|
1849
|
+
// area anymore. This can happen under performance constraints. This may
|
|
1850
|
+
// be a bug in the browser's IntersectionObserver implementation. To
|
|
1851
|
+
// work around this, we compare the element's bounding rect now with
|
|
1852
|
+
// what it was at the time we created the IntersectionObserver. If they
|
|
1853
|
+
// are not equal then the element moved, so we refresh.
|
|
1854
|
+
refresh();
|
|
1855
|
+
}
|
|
1856
|
+
isFirstUpdate = false;
|
|
1857
|
+
}
|
|
1858
|
+
|
|
1859
|
+
// Older browsers don't support a `document` as the root and will throw an
|
|
1860
|
+
// error.
|
|
1861
|
+
try {
|
|
1862
|
+
io = new IntersectionObserver(handleObserve, {
|
|
1863
|
+
...options,
|
|
1864
|
+
// Handle <iframe>s
|
|
1865
|
+
root: root.ownerDocument
|
|
1866
|
+
});
|
|
1867
|
+
} catch (_e) {
|
|
1868
|
+
io = new IntersectionObserver(handleObserve, options);
|
|
1869
|
+
}
|
|
1870
|
+
io.observe(element);
|
|
1871
|
+
}
|
|
1872
|
+
refresh(true);
|
|
1873
|
+
return cleanup;
|
|
1874
|
+
}
|
|
1875
|
+
|
|
1876
|
+
/**
|
|
1877
|
+
* Automatically updates the position of the floating element when necessary.
|
|
1878
|
+
* Should only be called when the floating element is mounted on the DOM or
|
|
1879
|
+
* visible on the screen.
|
|
1880
|
+
* @returns cleanup function that should be invoked when the floating element is
|
|
1881
|
+
* removed from the DOM or hidden from the screen.
|
|
1882
|
+
* @see https://floating-ui.com/docs/autoUpdate
|
|
1883
|
+
*/
|
|
1884
|
+
function autoUpdate(reference, floating, update, options) {
|
|
1885
|
+
if (options === void 0) {
|
|
1886
|
+
options = {};
|
|
1887
|
+
}
|
|
1888
|
+
const {
|
|
1889
|
+
ancestorScroll = true,
|
|
1890
|
+
ancestorResize = true,
|
|
1891
|
+
elementResize = typeof ResizeObserver === 'function',
|
|
1892
|
+
layoutShift = typeof IntersectionObserver === 'function',
|
|
1893
|
+
animationFrame = false
|
|
1894
|
+
} = options;
|
|
1895
|
+
const referenceEl = unwrapElement(reference);
|
|
1896
|
+
const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...(floating ? getOverflowAncestors(floating) : [])] : [];
|
|
1897
|
+
ancestors.forEach(ancestor => {
|
|
1898
|
+
ancestorScroll && ancestor.addEventListener('scroll', update, {
|
|
1899
|
+
passive: true
|
|
1900
|
+
});
|
|
1901
|
+
ancestorResize && ancestor.addEventListener('resize', update);
|
|
1902
|
+
});
|
|
1903
|
+
const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
|
|
1904
|
+
let reobserveFrame = -1;
|
|
1905
|
+
let resizeObserver = null;
|
|
1906
|
+
if (elementResize) {
|
|
1907
|
+
resizeObserver = new ResizeObserver(_ref => {
|
|
1908
|
+
let [firstEntry] = _ref;
|
|
1909
|
+
if (firstEntry && firstEntry.target === referenceEl && resizeObserver && floating) {
|
|
1910
|
+
// Prevent update loops when using the `size` middleware.
|
|
1911
|
+
// https://github.com/floating-ui/floating-ui/issues/1740
|
|
1912
|
+
resizeObserver.unobserve(floating);
|
|
1913
|
+
cancelAnimationFrame(reobserveFrame);
|
|
1914
|
+
reobserveFrame = requestAnimationFrame(() => {
|
|
1915
|
+
var _resizeObserver;
|
|
1916
|
+
(_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
|
|
1917
|
+
});
|
|
1918
|
+
}
|
|
1919
|
+
update();
|
|
1920
|
+
});
|
|
1921
|
+
if (referenceEl && !animationFrame) {
|
|
1922
|
+
resizeObserver.observe(referenceEl);
|
|
1923
|
+
}
|
|
1924
|
+
if (floating) {
|
|
1925
|
+
resizeObserver.observe(floating);
|
|
1926
|
+
}
|
|
1927
|
+
}
|
|
1928
|
+
let frameId;
|
|
1929
|
+
let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
|
|
1930
|
+
if (animationFrame) {
|
|
1931
|
+
frameLoop();
|
|
1932
|
+
}
|
|
1933
|
+
function frameLoop() {
|
|
1934
|
+
const nextRefRect = getBoundingClientRect(reference);
|
|
1935
|
+
if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {
|
|
1936
|
+
update();
|
|
1937
|
+
}
|
|
1938
|
+
prevRefRect = nextRefRect;
|
|
1939
|
+
frameId = requestAnimationFrame(frameLoop);
|
|
1940
|
+
}
|
|
1941
|
+
update();
|
|
1942
|
+
return () => {
|
|
1943
|
+
var _resizeObserver2;
|
|
1944
|
+
ancestors.forEach(ancestor => {
|
|
1945
|
+
ancestorScroll && ancestor.removeEventListener('scroll', update);
|
|
1946
|
+
ancestorResize && ancestor.removeEventListener('resize', update);
|
|
1947
|
+
});
|
|
1948
|
+
cleanupIo == null || cleanupIo();
|
|
1949
|
+
(_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
|
|
1950
|
+
resizeObserver = null;
|
|
1951
|
+
if (animationFrame) {
|
|
1952
|
+
cancelAnimationFrame(frameId);
|
|
1953
|
+
}
|
|
1954
|
+
};
|
|
1955
|
+
}
|
|
1956
|
+
|
|
1957
|
+
/**
|
|
1958
|
+
* Modifies the placement by translating the floating element along the
|
|
1959
|
+
* specified axes.
|
|
1960
|
+
* A number (shorthand for `mainAxis` or distance), or an axes configuration
|
|
1961
|
+
* object may be passed.
|
|
1962
|
+
* @see https://floating-ui.com/docs/offset
|
|
1963
|
+
*/
|
|
1964
|
+
const offset = offset$1;
|
|
1965
|
+
|
|
1966
|
+
/**
|
|
1967
|
+
* Optimizes the visibility of the floating element by flipping the `placement`
|
|
1968
|
+
* in order to keep it in view when the preferred placement(s) will overflow the
|
|
1969
|
+
* clipping boundary. Alternative to `autoPlacement`.
|
|
1970
|
+
* @see https://floating-ui.com/docs/flip
|
|
1971
|
+
*/
|
|
1972
|
+
const flip = flip$1;
|
|
1973
|
+
|
|
1974
|
+
/**
|
|
1975
|
+
* Provides data that allows you to change the size of the floating element —
|
|
1976
|
+
* for instance, prevent it from overflowing the clipping boundary or match the
|
|
1977
|
+
* width of the reference element.
|
|
1978
|
+
* @see https://floating-ui.com/docs/size
|
|
1979
|
+
*/
|
|
1980
|
+
const size = size$1;
|
|
1981
|
+
|
|
1982
|
+
/**
|
|
1983
|
+
* Provides data to hide the floating element in applicable situations, such as
|
|
1984
|
+
* when it is not in the same clipping context as the reference element.
|
|
1985
|
+
* @see https://floating-ui.com/docs/hide
|
|
1986
|
+
*/
|
|
1987
|
+
const hide = hide$1;
|
|
1988
|
+
|
|
1989
|
+
/**
|
|
1990
|
+
* Computes the `x` and `y` coordinates that will place the floating element
|
|
1991
|
+
* next to a given reference element.
|
|
1992
|
+
*/
|
|
1993
|
+
const computePosition = (reference, floating, options) => {
|
|
1994
|
+
// This caches the expensive `getClippingElementAncestors` function so that
|
|
1995
|
+
// multiple lifecycle resets re-use the same result. It only lives for a
|
|
1996
|
+
// single call. If other functions become expensive, we can add them as well.
|
|
1997
|
+
const cache = new Map();
|
|
1998
|
+
const mergedOptions = {
|
|
1999
|
+
platform,
|
|
2000
|
+
...options
|
|
2001
|
+
};
|
|
2002
|
+
const platformWithCache = {
|
|
2003
|
+
...mergedOptions.platform,
|
|
2004
|
+
_c: cache
|
|
2005
|
+
};
|
|
2006
|
+
return computePosition$1(reference, floating, {
|
|
2007
|
+
...mergedOptions,
|
|
2008
|
+
platform: platformWithCache
|
|
2009
|
+
});
|
|
2010
|
+
};
|
|
2011
|
+
|
|
281
2012
|
var __rest$1 = (undefined && undefined.__rest) || function (s, e) {
|
|
282
2013
|
var t = {};
|
|
283
2014
|
for (var p in s)
|
|
@@ -290,7 +2021,7 @@ var __rest$1 = (undefined && undefined.__rest) || function (s, e) {
|
|
|
290
2021
|
}
|
|
291
2022
|
return t;
|
|
292
2023
|
};
|
|
293
|
-
const
|
|
2024
|
+
const Dropdown = class {
|
|
294
2025
|
constructor(hostRef) {
|
|
295
2026
|
index.registerInstance(this, hostRef);
|
|
296
2027
|
this.isOpenChange = index.createEvent(this, "isOpenChange", 7);
|
|
@@ -299,41 +2030,61 @@ const XplDropdown = class {
|
|
|
299
2030
|
this.mode = 'single';
|
|
300
2031
|
this.anchorToTrigger = false;
|
|
301
2032
|
this.selectOnFocus = false;
|
|
302
|
-
this.
|
|
303
|
-
this.updateDropdownPosition = () => {
|
|
2033
|
+
this.cleanupAutoUpdate = null;
|
|
2034
|
+
this.updateDropdownPosition = async (triggerEl) => {
|
|
304
2035
|
var _a;
|
|
305
|
-
|
|
2036
|
+
const { x, y, placement, middlewareData } = await computePosition(triggerEl, this.hostElement, {
|
|
2037
|
+
strategy: 'fixed',
|
|
2038
|
+
placement: 'bottom-start',
|
|
2039
|
+
middleware: [
|
|
2040
|
+
offset(4),
|
|
2041
|
+
flip(),
|
|
2042
|
+
size({
|
|
2043
|
+
apply: ({ availableHeight, rects }) => {
|
|
2044
|
+
const listEl = this.hostElement.querySelector('.xpl-dropdown-list');
|
|
2045
|
+
let usedBeforeList = 0;
|
|
2046
|
+
if (listEl) {
|
|
2047
|
+
const children = Array.from(this.hostElement.children);
|
|
2048
|
+
const listIndex = children.indexOf(listEl);
|
|
2049
|
+
children.slice(0, listIndex).forEach((child) => {
|
|
2050
|
+
if (child instanceof HTMLElement) {
|
|
2051
|
+
usedBeforeList += child.offsetHeight;
|
|
2052
|
+
}
|
|
2053
|
+
});
|
|
2054
|
+
}
|
|
2055
|
+
const cs = getComputedStyle(this.hostElement);
|
|
2056
|
+
const hostVerticalChrome = parseFloat(cs.paddingTop) +
|
|
2057
|
+
parseFloat(cs.paddingBottom) +
|
|
2058
|
+
parseFloat(cs.borderTopWidth) +
|
|
2059
|
+
parseFloat(cs.borderBottomWidth);
|
|
2060
|
+
const cssMaxHeight = listEl
|
|
2061
|
+
? parseFloat(getComputedStyle(listEl).getPropertyValue('--xpl-dropdown-list-max-height'))
|
|
2062
|
+
: Infinity;
|
|
2063
|
+
const listMaxHeight = Math.min(cssMaxHeight, Math.max(0, availableHeight - usedBeforeList - hostVerticalChrome));
|
|
2064
|
+
Object.assign(this.hostElement.style, {
|
|
2065
|
+
width: `${rects.reference.width}px`,
|
|
2066
|
+
});
|
|
2067
|
+
if (listEl) {
|
|
2068
|
+
listEl.style.maxHeight = `${listMaxHeight}px`;
|
|
2069
|
+
}
|
|
2070
|
+
},
|
|
2071
|
+
}),
|
|
2072
|
+
hide(),
|
|
2073
|
+
],
|
|
2074
|
+
});
|
|
2075
|
+
if (!this.cleanupAutoUpdate)
|
|
306
2076
|
return;
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
if (!triggerRect) {
|
|
2077
|
+
if ((_a = middlewareData.hide) === null || _a === void 0 ? void 0 : _a.referenceHidden) {
|
|
2078
|
+
this.isOpen = false;
|
|
310
2079
|
return;
|
|
311
2080
|
}
|
|
312
|
-
const
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
left: ${triggerRect.left}px;
|
|
320
|
-
width: ${triggerRect.width}px;
|
|
321
|
-
bottom: ${viewportHeight - triggerRect.top}px;
|
|
322
|
-
top: auto;
|
|
323
|
-
`;
|
|
324
|
-
this.hostElement.classList.add('xpl-dropdown--above');
|
|
325
|
-
this.hostElement.classList.remove('xpl-dropdown--below');
|
|
326
|
-
}
|
|
327
|
-
else {
|
|
328
|
-
this.hostElement.style.cssText = `
|
|
329
|
-
left: ${triggerRect.left}px;
|
|
330
|
-
width: ${triggerRect.width}px;
|
|
331
|
-
top: ${triggerRect.bottom}px;
|
|
332
|
-
bottom: auto;
|
|
333
|
-
`;
|
|
334
|
-
this.hostElement.classList.add('xpl-dropdown--below');
|
|
335
|
-
this.hostElement.classList.remove('xpl-dropdown--above');
|
|
336
|
-
}
|
|
2081
|
+
const isAbove = placement.startsWith('top');
|
|
2082
|
+
Object.assign(this.hostElement.style, {
|
|
2083
|
+
left: `${x}px`,
|
|
2084
|
+
top: `${y}px`,
|
|
2085
|
+
});
|
|
2086
|
+
this.hostElement.classList.toggle('xpl-dropdown--above', isAbove);
|
|
2087
|
+
this.hostElement.classList.toggle('xpl-dropdown--below', !isAbove);
|
|
337
2088
|
};
|
|
338
2089
|
this.handleClickOutside = ({ target }) => {
|
|
339
2090
|
const { triggerId } = this;
|
|
@@ -350,6 +2101,16 @@ const XplDropdown = class {
|
|
|
350
2101
|
}
|
|
351
2102
|
};
|
|
352
2103
|
}
|
|
2104
|
+
onAnchorToTriggerChanged() {
|
|
2105
|
+
if (this.isOpen) {
|
|
2106
|
+
this.startPositioning();
|
|
2107
|
+
}
|
|
2108
|
+
}
|
|
2109
|
+
onTriggerIdChanged() {
|
|
2110
|
+
if (this.isOpen) {
|
|
2111
|
+
this.startPositioning();
|
|
2112
|
+
}
|
|
2113
|
+
}
|
|
353
2114
|
onSelectedValuesChanged(newValues, initialRender = false) {
|
|
354
2115
|
if (this.options && this.options.length > 0) {
|
|
355
2116
|
const flatOptions = this.options.reduce((acc, curr) => [...acc, ...(curr.groupName ? curr.options : [curr])], []);
|
|
@@ -375,14 +2136,31 @@ const XplDropdown = class {
|
|
|
375
2136
|
}
|
|
376
2137
|
onIsOpenStateChange(newValue) {
|
|
377
2138
|
this.isOpenChange.emit(newValue);
|
|
2139
|
+
if (newValue) {
|
|
2140
|
+
this.startPositioning();
|
|
2141
|
+
}
|
|
2142
|
+
else {
|
|
2143
|
+
this.stopPositioning();
|
|
2144
|
+
}
|
|
378
2145
|
}
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
2146
|
+
connectedCallback() {
|
|
2147
|
+
document.addEventListener('mousedown', this.handleClickOutside);
|
|
2148
|
+
document.addEventListener('keydown', this.handleKeyDown);
|
|
2149
|
+
}
|
|
2150
|
+
disconnectedCallback() {
|
|
2151
|
+
document.removeEventListener('mousedown', this.handleClickOutside);
|
|
2152
|
+
document.removeEventListener('keydown', this.handleKeyDown);
|
|
2153
|
+
this.stopPositioning();
|
|
2154
|
+
}
|
|
2155
|
+
componentWillLoad() {
|
|
2156
|
+
this.handleSelect = this.handleSelect.bind(this);
|
|
2157
|
+
if (this.selectedValues) {
|
|
2158
|
+
this.onSelectedValuesChanged(this.selectedValues, true);
|
|
382
2159
|
}
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
2160
|
+
}
|
|
2161
|
+
componentDidLoad() {
|
|
2162
|
+
if (this.isOpen)
|
|
2163
|
+
this.startPositioning();
|
|
386
2164
|
}
|
|
387
2165
|
async handleSelect(e, { component }) {
|
|
388
2166
|
const { hostElement, mode, options, update } = this;
|
|
@@ -421,22 +2199,30 @@ const XplDropdown = class {
|
|
|
421
2199
|
if (update)
|
|
422
2200
|
update(e, { component: this });
|
|
423
2201
|
}
|
|
424
|
-
|
|
425
|
-
this.
|
|
426
|
-
|
|
427
|
-
this.onSelectedValuesChanged(this.selectedValues, true);
|
|
2202
|
+
startPositioning() {
|
|
2203
|
+
if (!this.anchorToTrigger || !this.triggerId) {
|
|
2204
|
+
return;
|
|
428
2205
|
}
|
|
2206
|
+
const triggerEl = document.getElementById(this.triggerId);
|
|
2207
|
+
if (!triggerEl)
|
|
2208
|
+
return;
|
|
2209
|
+
this.stopPositioning();
|
|
2210
|
+
this.cleanupAutoUpdate = autoUpdate(triggerEl, this.hostElement, () => {
|
|
2211
|
+
this.updateDropdownPosition(triggerEl);
|
|
2212
|
+
});
|
|
429
2213
|
}
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
this.
|
|
2214
|
+
stopPositioning() {
|
|
2215
|
+
var _a;
|
|
2216
|
+
if (this.cleanupAutoUpdate) {
|
|
2217
|
+
this.cleanupAutoUpdate();
|
|
2218
|
+
this.cleanupAutoUpdate = null;
|
|
2219
|
+
}
|
|
2220
|
+
this.hostElement.style.left = '';
|
|
2221
|
+
this.hostElement.style.top = '';
|
|
2222
|
+
this.hostElement.style.width = '';
|
|
2223
|
+
(_a = this.hostElement
|
|
2224
|
+
.querySelector('.xpl-dropdown-list')) === null || _a === void 0 ? void 0 : _a.style.removeProperty('max-height');
|
|
2225
|
+
this.hostElement.classList.remove('xpl-dropdown--above', 'xpl-dropdown--below');
|
|
440
2226
|
}
|
|
441
2227
|
render() {
|
|
442
2228
|
const { isOpen } = this;
|
|
@@ -447,15 +2233,21 @@ const XplDropdown = class {
|
|
|
447
2233
|
var { groupName, options: opts, subtitle } = _a, properties = __rest$1(_a, ["groupName", "options", "subtitle"]);
|
|
448
2234
|
return groupName ? (index.h("xpl-dropdown-group", Object.assign({ groupName: groupName, options: opts }, properties))) : (index.h("xpl-dropdown-option", Object.assign({ subtitle: subtitle }, properties)));
|
|
449
2235
|
});
|
|
450
|
-
return (index.h(index.Host, { key: '
|
|
2236
|
+
return (index.h(index.Host, { key: '9951124106d4123d98db2b9bdc906f51d145c5e6', "aria-expanded": isOpen ? 'true' : 'false', class: {
|
|
451
2237
|
'xpl-dropdown': true,
|
|
452
2238
|
'xpl-dropdown--multi': mode === 'multi',
|
|
453
2239
|
'xpl-dropdown--open': isOpen,
|
|
454
2240
|
'xpl-dropdown--anchor-to-trigger': this.anchorToTrigger,
|
|
455
|
-
}, role: "listbox" }, index.h("ul", { key: '
|
|
2241
|
+
}, role: "listbox" }, index.h("slot", { key: '61b8daf20ef87a8ae7bad8fa494c104d58cc61f8', name: "header" }), index.h("ul", { key: 'ac14c8acf2927b931d4c74673af5f12f5d9514c1', class: "xpl-dropdown-list" }, mappedOptions || index.h("slot", { key: 'c820c142bdb64ec4189dd5869d71d4339dc97814', name: "options" }))));
|
|
456
2242
|
}
|
|
457
2243
|
get hostElement() { return index.getElement(this); }
|
|
458
2244
|
static get watchers() { return {
|
|
2245
|
+
"anchorToTrigger": [{
|
|
2246
|
+
"onAnchorToTriggerChanged": 0
|
|
2247
|
+
}],
|
|
2248
|
+
"triggerId": [{
|
|
2249
|
+
"onTriggerIdChanged": 0
|
|
2250
|
+
}],
|
|
459
2251
|
"selectedValues": [{
|
|
460
2252
|
"onSelectedValuesChanged": 0
|
|
461
2253
|
}],
|
|
@@ -477,7 +2269,7 @@ var __rest = (undefined && undefined.__rest) || function (s, e) {
|
|
|
477
2269
|
}
|
|
478
2270
|
return t;
|
|
479
2271
|
};
|
|
480
|
-
const
|
|
2272
|
+
const DropdownGroup = class {
|
|
481
2273
|
constructor(hostRef) {
|
|
482
2274
|
index.registerInstance(this, hostRef);
|
|
483
2275
|
}
|
|
@@ -489,20 +2281,20 @@ const XplDropdownGroup = class {
|
|
|
489
2281
|
var { groupName: optsGroupName } = _a, properties = __rest(_a, ["groupName"]);
|
|
490
2282
|
return optsGroupName ? (index.h("xpl-dropdown-group", Object.assign({ label: optsGroupName }, properties))) : (index.h("xpl-dropdown-option", Object.assign({}, properties)));
|
|
491
2283
|
});
|
|
492
|
-
return (index.h(index.Host, { key: '
|
|
2284
|
+
return (index.h(index.Host, { key: 'fae7d1999fae7148c2d19e14676b8c7a6f9c7810', role: "group", "aria-label": groupName }, index.h("li", { key: '8696234c09cce33be47e6481d757c2209d1fe04e', class: "xpl-dropdown-list-item" }, index.h("xpl-dropdown-heading", { key: 'ce4fc6f2b00f58302075e180170f52e333aab08b', label: groupName }), index.h("ul", { key: 'a9015c5ebaaa4ec3858769ad9aaf3f06d806bdbe', class: "xpl-dropdown-list" }, mappedOptions || index.h("slot", { key: '2f4bb9a76f1371c4dc0405b2652bc616fa4bb835', name: "options" })))));
|
|
493
2285
|
}
|
|
494
2286
|
};
|
|
495
2287
|
|
|
496
|
-
const
|
|
2288
|
+
const DropdownHeading = class {
|
|
497
2289
|
constructor(hostRef) {
|
|
498
2290
|
index.registerInstance(this, hostRef);
|
|
499
2291
|
}
|
|
500
2292
|
render() {
|
|
501
|
-
return (index.h(index.Host, { key: '
|
|
2293
|
+
return (index.h(index.Host, { key: '8f7d858ca1ee011e03b069948b1c948c7693725f', class: { 'xpl-dropdown-heading': true }, role: "presentation" }, index.h("span", { key: '56679ee9d35a995a72249f4494983652bacf0832' }, this.label || index.h("slot", { key: '3e657744c62647b42d249379927fab9ca9a258f6', name: "heading" }))));
|
|
502
2294
|
}
|
|
503
2295
|
};
|
|
504
2296
|
|
|
505
|
-
const
|
|
2297
|
+
const DropdownOptionCpnt = class {
|
|
506
2298
|
constructor(hostRef) {
|
|
507
2299
|
index.registerInstance(this, hostRef);
|
|
508
2300
|
}
|
|
@@ -510,6 +2302,9 @@ const XplDropdownOption = class {
|
|
|
510
2302
|
this.dropdown = this.hostElement.closest('xpl-dropdown');
|
|
511
2303
|
}
|
|
512
2304
|
handleClick(ev) {
|
|
2305
|
+
if (!this.dropdown) {
|
|
2306
|
+
return;
|
|
2307
|
+
}
|
|
513
2308
|
const { closeOnSelect, mode } = this.dropdown;
|
|
514
2309
|
if (ev.x && ev.y) {
|
|
515
2310
|
this.dropdown.handleSelect(ev, { component: this });
|
|
@@ -518,6 +2313,9 @@ const XplDropdownOption = class {
|
|
|
518
2313
|
}
|
|
519
2314
|
}
|
|
520
2315
|
handleKeyup(ev) {
|
|
2316
|
+
if (!this.dropdown) {
|
|
2317
|
+
return;
|
|
2318
|
+
}
|
|
521
2319
|
const { dropdown } = this;
|
|
522
2320
|
const navigationKeys = ['ArrowDown', 'ArrowLeft', 'ArrowRight', 'ArrowUp', 'Tab'];
|
|
523
2321
|
const { closeOnSelect, mode, selectOnFocus } = this.dropdown;
|
|
@@ -548,17 +2346,17 @@ const XplDropdownOption = class {
|
|
|
548
2346
|
this.hostElement.removeEventListener('keyup', this.handleKeyup);
|
|
549
2347
|
}
|
|
550
2348
|
render() {
|
|
551
|
-
const { label, isSelected, isDisabled, value, subtitle } = this;
|
|
552
|
-
return (index.h(index.Host, { key: '
|
|
2349
|
+
const { label, isSelected, isDisabled, value, subtitle, icon } = this;
|
|
2350
|
+
return (index.h(index.Host, { key: '207cafd793f52598fdbbe3104ff0207261e086c4', class: {
|
|
553
2351
|
'xpl-dropdown-option': true,
|
|
554
2352
|
'xpl-dropdown-option--disabled': isDisabled,
|
|
555
2353
|
'xpl-dropdown-option--selected': isSelected,
|
|
556
|
-
}, role: "option", "aria-checked": isSelected, "aria-disabled": isDisabled, "aria-selected": isSelected, value: value }, index.h("li", { key: '
|
|
2354
|
+
}, role: "option", "aria-checked": isSelected, "aria-disabled": isDisabled, "aria-selected": isSelected, value: value }, index.h("li", { key: '7e836b82c325050338eff79f23855f55c696f38c', class: "xpl-dropdown-list-item" }, icon && (index.h("xpl-icon", { key: '7b59e353bf038e1db478fab923c07e60d0e1a828', class: "xpl-dropdown-list-item__icon", icon: icon, size: 20 })), label || index.h("slot", { key: 'aad23fec3435e7cd7e36a57d49e178177d7da7fa', name: "option" }), subtitle && index.h("span", { key: '96fee61dbd072dacf783e164a93fd8dd626e3e53', class: "xpl-dropdown-list-item__subtitle" }, subtitle))));
|
|
557
2355
|
}
|
|
558
2356
|
get hostElement() { return index.getElement(this); }
|
|
559
2357
|
};
|
|
560
2358
|
|
|
561
|
-
const
|
|
2359
|
+
const HeaderAccordion = class {
|
|
562
2360
|
constructor(hostRef) {
|
|
563
2361
|
index.registerInstance(this, hostRef);
|
|
564
2362
|
this.initialExpanded = false;
|
|
@@ -628,7 +2426,7 @@ const XplHeaderAccordion = class {
|
|
|
628
2426
|
this.applyBorderRadiusToLastRow();
|
|
629
2427
|
}
|
|
630
2428
|
render() {
|
|
631
|
-
return (index.h(index.Host, { key: '
|
|
2429
|
+
return (index.h(index.Host, { key: '511ce0498294e0064e94ff14b847f75260c6c7cf', class: "xpl-header-accordion" }, index.h("div", { key: '75550adfe2cff80c32e3fe73bfba5888a4bfc91d', class: `header-accordion header-accordion--${this.expanded ? 'expanded' : 'collapsed'}` }, this.hasCheckbox && (index.h("xpl-checkbox", { key: 'd46601b19497594f44b4633228a6f020f29c8914', class: "xpl-header-accordion__parent-checkbox", checked: this.parentChecked, disabled: this.disabled, indeterminate: this.parentIndeterminate, onCheckboxChange: (event) => this.handleParentCheckboxChange(event.detail) })), index.h("button", { key: 'b15087f6e34cd0d31e77d5c3b35640b7734ed556', "aria-expanded": this.expanded, "aria-controls": this.contentId, class: "toggle-area", onClick: this.toggleAccordion, type: "button" }, index.h("slot", { key: '8f655d108a016212852f0a7138fa82ea386ed26a', name: "title" }), index.h("xpl-icon", { key: 'abe7fb2fe4a19db7bcd2cbed7fec903cbeeaee4d', size: 16, icon: "chevron-down", class: this.expanded && 'rotate' }))), index.h("div", { key: 'e86c0a67e94b24f4c39386e8f728de34242e7344', id: this.contentId, role: "region", class: !this.expanded ? 'content--hidden' : 'content--shown' }, index.h("slot", { key: 'a86303b3cf41724f65e10db14d0f6464c68d49c2', name: "content" }))));
|
|
632
2430
|
}
|
|
633
2431
|
get el() { return index.getElement(this); }
|
|
634
2432
|
static get watchers() { return {
|
|
@@ -7047,19 +8845,19 @@ var require$$0 = {
|
|
|
7047
8845
|
heights: {
|
|
7048
8846
|
"16": {
|
|
7049
8847
|
width: 16,
|
|
7050
|
-
path: "<g fill=\"currentColor\"><path fill=\"currentColor\" d=\"M12.48 3.56h-8.94a1.56 1.56 0 0 0-1.32 2.39l4.47 7.05c0.29 0.45 0.78 0.72 1.32 0.73s1.03-0.27 1.32-0.73l4.47-7.05a1.56 1.56 0
|
|
8848
|
+
path: "<g fill=\"currentColor\"><path fill=\"currentColor\" d=\"M12.48 3.56h-8.94a1.56 1.56 0 0 0-1.32 2.39l4.47 7.05c0.29 0.45 0.78 0.72 1.32 0.73s1.03-0.27 1.32-0.73l4.47-7.05a1.56 1.56 0 0 0-1.32-2.39z\"></path></g>"
|
|
7051
8849
|
},
|
|
7052
8850
|
"20": {
|
|
7053
8851
|
width: 20,
|
|
7054
|
-
path: "<g fill=\"currentColor\"><path fill=\"currentColor\" d=\"M15.57 4.44h-11.16a1.94 1.94 0 0 0-1.64 2.98l5.58 8.8c0.36 0.56 0.97 0.9 1.64 0.9s1.28-0.34 1.64-0.9l5.58-8.8a1.94 1.94 0
|
|
8852
|
+
path: "<g fill=\"currentColor\"><path fill=\"currentColor\" d=\"M15.57 4.44h-11.16a1.94 1.94 0 0 0-1.64 2.98l5.58 8.8c0.36 0.56 0.97 0.9 1.64 0.9s1.28-0.34 1.64-0.9l5.58-8.8a1.94 1.94 0 0 0-1.64-2.98z\"></path></g>"
|
|
7055
8853
|
},
|
|
7056
8854
|
"24": {
|
|
7057
8855
|
width: 24,
|
|
7058
|
-
path: "<g fill=\"currentColor\"><path fill=\"currentColor\" d=\"M18.65 5.32h-13.36a2.33 2.33 0 0 0-1.97 3.57l6.68 10.54c0.43 0.68 1.16 1.08 1.97 1.08s1.54-0.4 1.97-1.08l6.68-10.54a2.33 2.33 0
|
|
8856
|
+
path: "<g fill=\"currentColor\"><path fill=\"currentColor\" d=\"M18.65 5.32h-13.36a2.33 2.33 0 0 0-1.97 3.57l6.68 10.54c0.43 0.68 1.16 1.08 1.97 1.08s1.54-0.4 1.97-1.08l6.68-10.54a2.33 2.33 0 0 0-1.97-3.57z\"></path></g>"
|
|
7059
8857
|
},
|
|
7060
8858
|
"32": {
|
|
7061
8859
|
width: 32,
|
|
7062
|
-
path: "<g fill=\"currentColor\"><path fill=\"currentColor\" d=\"M24.96 7.12h-17.88a3.11 3.11 0 0 0-2.63 4.78l8.94 14.11c0.57 0.91 1.56 1.45 2.63 1.44s2.06-0.54 2.63-1.44l8.95-14.11a3.11 3.11 0
|
|
8860
|
+
path: "<g fill=\"currentColor\"><path fill=\"currentColor\" d=\"M24.96 7.12h-17.88a3.11 3.11 0 0 0-2.63 4.78l8.94 14.11c0.57 0.91 1.56 1.45 2.63 1.44s2.06-0.54 2.63-1.44l8.95-14.11a3.11 3.11 0 0 0-2.64-4.78z\"></path></g>"
|
|
7063
8861
|
}
|
|
7064
8862
|
}
|
|
7065
8863
|
},
|
|
@@ -7086,19 +8884,19 @@ var require$$0 = {
|
|
|
7086
8884
|
heights: {
|
|
7087
8885
|
"16": {
|
|
7088
8886
|
width: 16,
|
|
7089
|
-
path: "<g fill=\"currentColor\"><path fill=\"currentColor\" d=\"M8.93 2.3c-0.41-0.61-1.43-0.61-1.84 0l-2.09 3.08a1.11 1.11 0 0 0 0.92 1.74h4.18a1.11 1.11 0
|
|
8887
|
+
path: "<g fill=\"currentColor\"><path fill=\"currentColor\" d=\"M8.93 2.3c-0.41-0.61-1.43-0.61-1.84 0l-2.09 3.08a1.11 1.11 0 0 0 0.92 1.74h4.18a1.11 1.11 0 0 0 0.92-1.74l-2.09-3.08z\"></path><path fill=\"currentColor\" d=\"M10.1 8.9h-4.18a1.11 1.11 0 0 0-0.92 1.74l2.09 3.08a1.11 1.11 0 0 0 1.84 0l2.09-3.08a1.11 1.11 0 0 0-0.92-1.74z\"></path></g>"
|
|
7090
8888
|
},
|
|
7091
8889
|
"20": {
|
|
7092
8890
|
width: 20,
|
|
7093
|
-
path: "<g fill=\"currentColor\"><path fill=\"currentColor\" d=\"M11.14 2.86c-0.52-0.76-1.78-0.76-2.3 0l-2.61 3.85a1.39 1.39 0 0 0 1.15 2.17h5.22a1.39 1.39 0
|
|
8891
|
+
path: "<g fill=\"currentColor\"><path fill=\"currentColor\" d=\"M11.14 2.86c-0.52-0.76-1.78-0.76-2.3 0l-2.61 3.85a1.39 1.39 0 0 0 1.15 2.17h5.22a1.39 1.39 0 0 0 1.15-2.17l-2.61-3.85z\"></path><path fill=\"currentColor\" d=\"M12.6 11.1h-5.22a1.39 1.39 0 0 0-1.15 2.17l2.61 3.85a1.39 1.39 0 0 0 2.3 0l2.61-3.85a1.39 1.39 0 0 0-1.15-2.17z\"></path></g>"
|
|
7094
8892
|
},
|
|
7095
8893
|
"24": {
|
|
7096
8894
|
width: 24,
|
|
7097
|
-
path: "<g fill=\"currentColor\"><path fill=\"currentColor\" d=\"M13.35 3.43c-0.62-0.92-2.13-0.92-2.76 0l-3.12 4.62a1.66 1.66 0 0 0 1.38 2.59h6.24a1.66 1.66 0
|
|
8895
|
+
path: "<g fill=\"currentColor\"><path fill=\"currentColor\" d=\"M13.35 3.43c-0.62-0.92-2.13-0.92-2.76 0l-3.12 4.62a1.66 1.66 0 0 0 1.38 2.59h6.24a1.66 1.66 0 0 0 1.38-2.59l-3.12-4.62z\"></path><path fill=\"currentColor\" d=\"M15.09 13.3h-6.24a1.66 1.66 0 0 0-1.38 2.59l3.12 4.62a1.66 1.66 0 0 0 2.76 0l3.12-4.62a1.66 1.66 0 0 0-1.38-2.59z\"></path></g>"
|
|
7098
8896
|
},
|
|
7099
8897
|
"32": {
|
|
7100
8898
|
width: 32,
|
|
7101
|
-
path: "<g fill=\"currentColor\"><path fill=\"currentColor\" d=\"M17.86 4.59c-0.83-1.22-2.86-1.22-3.68 0l-4.18 6.18a2.22 2.22 0 0 0 1.84 3.47h8.36a2.22 2.22 0
|
|
8899
|
+
path: "<g fill=\"currentColor\"><path fill=\"currentColor\" d=\"M17.86 4.59c-0.83-1.22-2.86-1.22-3.68 0l-4.18 6.18a2.22 2.22 0 0 0 1.84 3.47h8.36a2.22 2.22 0 0 0 1.84-3.47l-4.18-6.18z\"></path><path fill=\"currentColor\" d=\"M20.2 17.8h-8.36a2.22 2.22 0 0 0-1.84 3.47l4.18 6.18a2.22 2.22 0 0 0 3.68 0l4.18-6.18a2.22 2.22 0 0 0-1.84-3.47z\"></path></g>"
|
|
7102
8900
|
}
|
|
7103
8901
|
}
|
|
7104
8902
|
},
|
|
@@ -7177,19 +8975,19 @@ var require$$0 = {
|
|
|
7177
8975
|
heights: {
|
|
7178
8976
|
"16": {
|
|
7179
8977
|
width: 16,
|
|
7180
|
-
path: "<g fill=\"currentColor\"><path fill=\"currentColor\" d=\"M9.33 3.02c-0.29-0.45-0.78-0.72-1.32-0.73s-1.03 0.27-1.32 0.73l-4.47 7.05a1.56 1.56 0
|
|
8978
|
+
path: "<g fill=\"currentColor\"><path fill=\"currentColor\" d=\"M9.33 3.02c-0.29-0.45-0.78-0.72-1.32-0.73s-1.03 0.27-1.32 0.73l-4.47 7.05a1.56 1.56 0 0 0 1.32 2.39h8.94a1.56 1.56 0 0 0 1.32-2.39l-4.47-7.05z\"></path></g>"
|
|
7181
8979
|
},
|
|
7182
8980
|
"20": {
|
|
7183
8981
|
width: 20,
|
|
7184
|
-
path: "<g fill=\"currentColor\"><path fill=\"currentColor\" d=\"M11.63 3.76c-0.36-0.56-0.97-0.9-1.64-0.9s-1.28 0.34-1.64 0.9l-5.58 8.8a1.94 1.94 0
|
|
8982
|
+
path: "<g fill=\"currentColor\"><path fill=\"currentColor\" d=\"M11.63 3.76c-0.36-0.56-0.97-0.9-1.64-0.9s-1.28 0.34-1.64 0.9l-5.58 8.8a1.94 1.94 0 0 0 1.64 2.98h11.16a1.94 1.94 0 0 0 1.64-2.98l-5.58-8.8z\"></path></g>"
|
|
7185
8983
|
},
|
|
7186
8984
|
"24": {
|
|
7187
8985
|
width: 24,
|
|
7188
|
-
path: "<g fill=\"currentColor\"><path fill=\"currentColor\" d=\"M13.94 4.51c-0.43-0.68-1.16-1.08-1.97-1.08s-1.54 0.4-1.97 1.08l-6.68 10.54a2.33 2.33 0
|
|
8986
|
+
path: "<g fill=\"currentColor\"><path fill=\"currentColor\" d=\"M13.94 4.51c-0.43-0.68-1.16-1.08-1.97-1.08s-1.54 0.4-1.97 1.08l-6.68 10.54a2.33 2.33 0 0 0 1.97 3.57h13.36a2.33 2.33 0 0 0 1.97-3.57l-6.68-10.54z\"></path></g>"
|
|
7189
8987
|
},
|
|
7190
8988
|
"32": {
|
|
7191
8989
|
width: 32,
|
|
7192
|
-
path: "<g fill=\"currentColor\"><path fill=\"currentColor\" d=\"M18.65 6.03c-0.57-0.91-1.56-1.45-2.63-1.44s-2.06 0.54-2.63 1.44l-8.95 14.11a3.11 3.11 0
|
|
8990
|
+
path: "<g fill=\"currentColor\"><path fill=\"currentColor\" d=\"M18.65 6.03c-0.57-0.91-1.56-1.45-2.63-1.44s-2.06 0.54-2.63 1.44l-8.95 14.11a3.11 3.11 0 0 0 2.64 4.78h17.88a3.11 3.11 0 0 0 2.63-4.78l-8.94-14.11z\"></path></g>"
|
|
7193
8991
|
}
|
|
7194
8992
|
}
|
|
7195
8993
|
},
|
|
@@ -13527,7 +15325,7 @@ var apolloIcons = /*@__PURE__*/getDefaultExportFromCjs(apolloIconsExports);
|
|
|
13527
15325
|
|
|
13528
15326
|
const xplIconCss = () => `.xpl-icon{align-items:center;display:grid;justify-content:center}`;
|
|
13529
15327
|
|
|
13530
|
-
const
|
|
15328
|
+
const Icon = class {
|
|
13531
15329
|
constructor(hostRef) {
|
|
13532
15330
|
index.registerInstance(this, hostRef);
|
|
13533
15331
|
}
|
|
@@ -13546,15 +15344,15 @@ const XplIcon = class {
|
|
|
13546
15344
|
let wrapperClasses = 'xpl-icon__wrapper ';
|
|
13547
15345
|
if (this.backgroundColor)
|
|
13548
15346
|
wrapperClasses += `xpl-icon__wrapper--with-background xpl-icon__wrapper--with-background--${this.backgroundColor}`;
|
|
13549
|
-
return (index.h(index.Host, { key: '
|
|
15347
|
+
return (index.h(index.Host, { key: 'c622a660e3ed7d9dce7dc08a868360ffc43f2f8d' }, index.h("figure", { key: 'c12f8de568fa6e652914fbc894a1269f6085d880', class: wrapperClasses }, index.h("span", { key: 'a8386f0d0fc3848a36b5120dd5f24356c403d0f5', "aria-label": this.icon, role: "img", class: "xpl-icon", style: {
|
|
13550
15348
|
width: `${options.width}px`,
|
|
13551
15349
|
height: `${options.height}px`,
|
|
13552
|
-
}, innerHTML: (_a = apolloIcons.getIcon(this.icon)) === null || _a === void 0 ? void 0 : _a.toSVG(options) }), index.h("figcaption", { key: '
|
|
15350
|
+
}, innerHTML: (_a = apolloIcons.getIcon(this.icon)) === null || _a === void 0 ? void 0 : _a.toSVG(options) }), index.h("figcaption", { key: '4d56222dc219feedd1e8e2c957ca01728a845b56' }, this.icon, " icon"))));
|
|
13553
15351
|
}
|
|
13554
15352
|
};
|
|
13555
|
-
|
|
15353
|
+
Icon.style = xplIconCss();
|
|
13556
15354
|
|
|
13557
|
-
const
|
|
15355
|
+
const Input = class {
|
|
13558
15356
|
constructor(hostRef) {
|
|
13559
15357
|
index.registerInstance(this, hostRef);
|
|
13560
15358
|
this.focusEvent = index.createEvent(this, "focusEvent", 7);
|
|
@@ -13571,6 +15369,8 @@ const XplInput = class {
|
|
|
13571
15369
|
this.hideTriggerOnSelect = false;
|
|
13572
15370
|
this.hideFileNames = false;
|
|
13573
15371
|
this.hideAcceptText = false;
|
|
15372
|
+
this.defaultCountry = 'US';
|
|
15373
|
+
this.isInternational = true;
|
|
13574
15374
|
this.type = 'text';
|
|
13575
15375
|
this.valueChanged = (event) => {
|
|
13576
15376
|
const target = event.target;
|
|
@@ -13578,6 +15378,7 @@ const XplInput = class {
|
|
|
13578
15378
|
};
|
|
13579
15379
|
this.characterCount = 0;
|
|
13580
15380
|
this.passwordVisible = false;
|
|
15381
|
+
this.hasPreSlotContent = false;
|
|
13581
15382
|
this.handleFocus = (ev) => {
|
|
13582
15383
|
this.focusEvent.emit(ev);
|
|
13583
15384
|
};
|
|
@@ -13591,16 +15392,40 @@ const XplInput = class {
|
|
|
13591
15392
|
const { value } = ev.target;
|
|
13592
15393
|
this.inputEvent.emit(value);
|
|
13593
15394
|
};
|
|
15395
|
+
this.syncPreSlotContent = () => {
|
|
15396
|
+
const hasSlotted = this.hasDirectPreSlotChild();
|
|
15397
|
+
if (hasSlotted !== this.hasPreSlotContent) {
|
|
15398
|
+
this.hasPreSlotContent = hasSlotted;
|
|
15399
|
+
}
|
|
15400
|
+
};
|
|
13594
15401
|
}
|
|
13595
15402
|
updateCharacterCount() {
|
|
13596
15403
|
this.characterCount = this.input.value.length;
|
|
13597
15404
|
}
|
|
15405
|
+
hasDirectPreSlotChild() {
|
|
15406
|
+
return Array.from(this.el.children).some((child) => child.getAttribute('slot') === 'pre');
|
|
15407
|
+
}
|
|
13598
15408
|
componentWillLoad() {
|
|
13599
15409
|
if (this._id === undefined || this._id === null || this._id === '')
|
|
13600
15410
|
this._id = v4.v4();
|
|
13601
15411
|
if (this.multiline && this.maxCharacterCount !== undefined) {
|
|
13602
15412
|
this.characterCount = this.value !== undefined ? this.value.length : 0;
|
|
13603
15413
|
}
|
|
15414
|
+
if (!this.multiline) {
|
|
15415
|
+
this.hasPreSlotContent = this.hasDirectPreSlotChild();
|
|
15416
|
+
}
|
|
15417
|
+
}
|
|
15418
|
+
componentDidLoad() {
|
|
15419
|
+
if (this.multiline)
|
|
15420
|
+
return;
|
|
15421
|
+
if (typeof MutationObserver !== 'undefined') {
|
|
15422
|
+
this.preSlotObserver = new MutationObserver(this.syncPreSlotContent);
|
|
15423
|
+
this.preSlotObserver.observe(this.el, { childList: true });
|
|
15424
|
+
}
|
|
15425
|
+
}
|
|
15426
|
+
disconnectedCallback() {
|
|
15427
|
+
var _a;
|
|
15428
|
+
(_a = this.preSlotObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
13604
15429
|
}
|
|
13605
15430
|
renderInput() {
|
|
13606
15431
|
switch (this.type) {
|
|
@@ -13612,8 +15437,13 @@ const XplInput = class {
|
|
|
13612
15437
|
return (index.h("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 }));
|
|
13613
15438
|
case 'time':
|
|
13614
15439
|
return (index.h("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 }));
|
|
15440
|
+
case 'phone':
|
|
15441
|
+
return (index.h("xpl-input-phone", { inputId: this._id, disabled: this.disabled, name: this.name, required: this.required, readonly: this.readonly, value: this.value, placeholder: this.placeholder, defaultCountry: this.defaultCountry, preferredCountries: this.preferredCountries, isInternational: this.isInternational }));
|
|
13615
15442
|
default:
|
|
13616
|
-
return (index.h("div", { class: "xpl-input-wrapper" },
|
|
15443
|
+
return (index.h("div", { class: "xpl-input-wrapper" }, !this.multiline && (index.h("label", { class: {
|
|
15444
|
+
'xpl-input-pre': true,
|
|
15445
|
+
'xpl-input-pre--hidden': !this.pre && !this.hasPreSlotContent,
|
|
15446
|
+
}, htmlFor: this._id }, index.h("slot", { name: "pre" }, this.pre))), !this.multiline ? (index.h("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: (el) => {
|
|
13617
15447
|
this.input = el;
|
|
13618
15448
|
}, required: this.required, step: this.step, type: this.type, value: this.value, onChange: this.valueChanged, onFocus: this.handleFocus, onBlur: this.handleBlur, onInput: this.handleInput })) : (index.h("textarea", { disabled: this.disabled, id: this._id, name: this.name, placeholder: this.placeholder, readonly: this.readonly, ref: (el) => {
|
|
13619
15449
|
this.input = el;
|
|
@@ -13633,14 +15463,15 @@ const XplInput = class {
|
|
|
13633
15463
|
this.characterCount > this.maxCharacterCount) {
|
|
13634
15464
|
hasError = true;
|
|
13635
15465
|
}
|
|
13636
|
-
return (index.h(index.Host, { key: '
|
|
15466
|
+
return (index.h(index.Host, { key: 'c0d3b87b9dca0c4f75c15accb6542d270a43f3d3', class: {
|
|
13637
15467
|
'xpl-input': true,
|
|
13638
15468
|
'xpl-input--disabled': this.disabled,
|
|
13639
15469
|
'xpl-input--error': hasError,
|
|
13640
15470
|
'xpl-input--readonly': this.readonly,
|
|
13641
15471
|
[`xpl-input--${this.type}`]: true,
|
|
13642
|
-
} }, this.label && (index.h("label", { key: '
|
|
15472
|
+
} }, this.label && (index.h("label", { key: '1842998b20424a952ff618ed15d611d59d2e9eba', class: "xpl-input-label", htmlFor: this._id }, this.label, this.description && index.h("small", { key: 'ccfe57e608f789d643d2219091922cf259971b12' }, this.description))), this.renderInput(), ((_a = this.error) === null || _a === void 0 ? void 0 : _a.length) > 0 && (index.h("label", { key: '3a3147f7e1be2d1f109a400baf005289bb37d60f', class: "xpl-input-error", htmlFor: this._id }, index.h("xpl-icon", { key: 'b4960e9243db0126ca5d6d3b3226c551927c2f39', icon: "alert-circle", size: 16 }), index.h("span", { key: 'd8f524d135f664c876ae83594e113967bb933cca' }, this.error)))));
|
|
13643
15473
|
}
|
|
15474
|
+
get el() { return index.getElement(this); }
|
|
13644
15475
|
};
|
|
13645
15476
|
|
|
13646
15477
|
const hslaToRgba = (hue, saturation, lightness, alpha) => {
|
|
@@ -13817,7 +15648,7 @@ const fallbackColorValues = {
|
|
|
13817
15648
|
b: 0,
|
|
13818
15649
|
a: 1,
|
|
13819
15650
|
};
|
|
13820
|
-
const
|
|
15651
|
+
const InputColor = class {
|
|
13821
15652
|
constructor(hostRef) {
|
|
13822
15653
|
index.registerInstance(this, hostRef);
|
|
13823
15654
|
this.inputChange = index.createEvent(this, "inputChange", 7);
|
|
@@ -14006,16 +15837,16 @@ const XplInputColor = class {
|
|
|
14006
15837
|
top: `${y}px`,
|
|
14007
15838
|
background: `rgb(${r}, ${g}, ${b})`,
|
|
14008
15839
|
};
|
|
14009
|
-
return (index.h(index.Host, { key: '
|
|
15840
|
+
return (index.h(index.Host, { key: 'a8cdba9ff504fbeaf7b21167b778d8cf00216a1a', class: "xpl-input-color" }, index.h("xpl-popover", { key: '535497f6aba0e7e9e65b894cd8c62cebe8ad3dd5', disabled: this.disabled, display: "menu" }, index.h("div", { key: '436c51111938bbbef99698b94bd5c3123bc0b42d', slot: "trigger" }, index.h("div", { key: '09e8f57c0d1a35d1b0a5785ebb141db62c3db4d2', class: {
|
|
14010
15841
|
'xpl-input-color__display': true,
|
|
14011
15842
|
'xpl-input-color__display--disabled': this.disabled,
|
|
14012
15843
|
'xpl-input-color__display--error': !!this.hasErrorState,
|
|
14013
|
-
} }, index.h("span", { key: '
|
|
15844
|
+
} }, index.h("span", { key: '76da6216e95d48dd5cdbb890e7fe14cf1be85c6b', class: "xpl-input-color__color", style: {
|
|
14014
15845
|
background: objectToStringColor(this.colorValues),
|
|
14015
|
-
} }), this.colorValues.hex ? (index.h("span", { class: "xpl-input-color__value" }, objectToStringColor(this.colorValues))) : (index.h("span", { class: "xpl-input-color__placeholder" }, this.placeholder)), this.eyeDropperSupported && !this.hideEyeDropper && (index.h("xpl-icon", { key: '
|
|
15846
|
+
} }), this.colorValues.hex ? (index.h("span", { class: "xpl-input-color__value" }, objectToStringColor(this.colorValues))) : (index.h("span", { class: "xpl-input-color__placeholder" }, this.placeholder)), this.eyeDropperSupported && !this.hideEyeDropper && (index.h("xpl-icon", { key: 'c4a560be47d17c98f353c0e324c0f9025f535fae', size: 20, icon: "eye-dropper", class: "xpl-input-color__icon", onClick: (e) => {
|
|
14016
15847
|
e.stopPropagation();
|
|
14017
15848
|
this.openEyeDropper();
|
|
14018
|
-
} })))), index.h("div", { key: '
|
|
15849
|
+
} })))), index.h("div", { key: '844a66fa0523b133ce3e2b6d83e395254e9b513f', class: "xpl-input-color__menu" }, index.h("div", { key: 'c687aaa94b122258e09cffabcc5029905ddccb27', class: "xpl-input-color__sl-grid", ref: (el) => {
|
|
14019
15850
|
this.colorInputElements.slGrid = el;
|
|
14020
15851
|
}, style: {
|
|
14021
15852
|
background: [
|
|
@@ -14023,9 +15854,9 @@ const XplInputColor = class {
|
|
|
14023
15854
|
`linear-gradient(to right, #fff, #fff0)`,
|
|
14024
15855
|
`rgb(${hueBaseColor.r} ${hueBaseColor.g} ${hueBaseColor.b})`,
|
|
14025
15856
|
].join(', '),
|
|
14026
|
-
}, onMouseDown: this.startDrag, onTouchStart: this.startDrag }, index.h("div", { key: '
|
|
15857
|
+
}, onMouseDown: this.startDrag, onTouchStart: this.startDrag }, index.h("div", { key: '7e65660cef09fc5ae0c9dc0d49fe7769ad15b55a', class: "xpl-input-color__sl-thumb", style: slThumbStyle })), index.h("div", { key: '5e76247d0d59fca5500416ddeaca53784dc42209', class: "xpl-input-color__grid" }, index.h("input", { key: '5b891dd55f6d4f5d1242d142c9af8a3af496e398', type: "range", min: "0", max: "360", value: this.hue, class: "xpl-input-color__slider xpl-input-color__hue", name: "color-hue-slider", ref: (el) => {
|
|
14027
15858
|
this.colorInputElements.hue = el;
|
|
14028
|
-
} }), index.h("input", { key: '
|
|
15859
|
+
} }), index.h("input", { key: 'ae20b7cbfa6303c6615afee0fc35d0dda3bc1f70', 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: (el) => {
|
|
14029
15860
|
this.colorInputElements.alpha = el;
|
|
14030
15861
|
}, style: {
|
|
14031
15862
|
backgroundImage: [
|
|
@@ -14035,9 +15866,9 @@ const XplInputColor = class {
|
|
|
14035
15866
|
`linear-gradient(45deg, transparent 75%, #ccc 75%)`,
|
|
14036
15867
|
`linear-gradient(-45deg, transparent 75%, #ccc 75%)`,
|
|
14037
15868
|
].join(', '),
|
|
14038
|
-
} }), index.h("div", { key: '
|
|
15869
|
+
} }), index.h("div", { key: 'c4b884401f5324e37e09637785a2148ef5c99112', class: "xpl-input-color__preview", style: {
|
|
14039
15870
|
background: `rgba(${r}, ${g}, ${b}, ${a})`,
|
|
14040
|
-
} })), index.h("div", { key: '
|
|
15871
|
+
} })), index.h("div", { key: '5d8eff1bf9e51bd44116c01e3bfd016414662d92', class: "xpl-input-color__inputs" }, Object.entries(this.colorInputElements)
|
|
14041
15872
|
.filter(([key]) => ['hex', 'r', 'g', 'b', 'a'].includes(key))
|
|
14042
15873
|
.map(([key]) => (index.h("xpl-input", { key: key, label: key.toLocaleUpperCase(), name: `color-${key}-input`, placeholder: key === 'hex' ? '793EF7' : '0', value: this.colorValues[key], ref: (elRef) => {
|
|
14043
15874
|
this.colorInputElements[key] = elRef;
|
|
@@ -14056,10 +15887,33 @@ const XplInputColor = class {
|
|
|
14056
15887
|
}; }
|
|
14057
15888
|
};
|
|
14058
15889
|
|
|
15890
|
+
function isInsideFixedPosition(element) {
|
|
15891
|
+
let el = element.parentElement;
|
|
15892
|
+
while (el && el !== document.body && el !== document.documentElement) {
|
|
15893
|
+
if (getComputedStyle(el).position === 'fixed') {
|
|
15894
|
+
return true;
|
|
15895
|
+
}
|
|
15896
|
+
el = el.parentElement;
|
|
15897
|
+
}
|
|
15898
|
+
return false;
|
|
15899
|
+
}
|
|
15900
|
+
function getNearestScrollableAncestor(element) {
|
|
15901
|
+
let el = element.parentElement;
|
|
15902
|
+
while (el && el !== document.body && el !== document.documentElement) {
|
|
15903
|
+
const style = getComputedStyle(el);
|
|
15904
|
+
const overflow = style.overflow + style.overflowX + style.overflowY;
|
|
15905
|
+
if (/auto|scroll/.test(overflow)) {
|
|
15906
|
+
return el;
|
|
15907
|
+
}
|
|
15908
|
+
el = el.parentElement;
|
|
15909
|
+
}
|
|
15910
|
+
return undefined;
|
|
15911
|
+
}
|
|
15912
|
+
|
|
14059
15913
|
const arrowSvg = (rotate = false) => `<svg width="8" height="12" viewBox="0 0 8 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="${rotate
|
|
14060
15914
|
? 'M0.557948 5.6813L6.06209 0.132167C6.23831 -0.0440556 6.52327 -0.0440556 6.69949 0.132167L7.44187 0.874551C7.61809 1.05077 7.61809 1.33573 7.44187 1.51195L2.99882 6L7.44187 10.488C7.61809 10.6643 7.61809 10.9492 7.44187 11.1254L6.69949 11.8678C6.52327 12.0441 6.23831 12.0441 6.06209 11.8678L0.557948 6.3187C0.381726 6.14248 0.381726 5.85752 0.557948 5.6813Z'
|
|
14061
15915
|
: 'M7.44187 6.3187L1.93773 11.8678C1.76151 12.0441 1.47655 12.0441 1.30033 11.8678L0.557948 11.1254C0.381726 10.9492 0.381726 10.6643 0.557948 10.488L5.001 6L0.557948 1.51195C0.381726 1.33573 0.381726 1.05077 0.557948 0.874551L1.30033 0.132167C1.47655 -0.0440556 1.76151 -0.0440556 1.93773 0.132167L7.44187 5.6813C7.6181 5.85752 7.6181 6.14248 7.44187 6.3187Z'}" /></svg>`;
|
|
14062
|
-
const
|
|
15916
|
+
const InputDate = class {
|
|
14063
15917
|
constructor(hostRef) {
|
|
14064
15918
|
index.registerInstance(this, hostRef);
|
|
14065
15919
|
this.valueChange = index.createEvent(this, "valueChange", 7);
|
|
@@ -14067,6 +15921,7 @@ const XplInputDate = class {
|
|
|
14067
15921
|
this.rangeSelected = index.createEvent(this, "rangeSelected", 7);
|
|
14068
15922
|
this.dateFormat = 'Y-m-d';
|
|
14069
15923
|
this.mode = 'single';
|
|
15924
|
+
this.flatpickrStaticLayout = false;
|
|
14070
15925
|
this.valueChanged = (event) => {
|
|
14071
15926
|
const target = event.target;
|
|
14072
15927
|
this.valueChange.emit(target.value);
|
|
@@ -14079,17 +15934,31 @@ const XplInputDate = class {
|
|
|
14079
15934
|
var _a;
|
|
14080
15935
|
(_a = this.flatpickrInstance) === null || _a === void 0 ? void 0 : _a.setDate(newValue);
|
|
14081
15936
|
}
|
|
14082
|
-
|
|
14083
|
-
|
|
14084
|
-
|
|
14085
|
-
|
|
14086
|
-
|
|
14087
|
-
|
|
14088
|
-
|
|
14089
|
-
|
|
14090
|
-
|
|
14091
|
-
|
|
14092
|
-
|
|
15937
|
+
connectedCallback() {
|
|
15938
|
+
queueMicrotask(() => this.ensureFlatpickr());
|
|
15939
|
+
}
|
|
15940
|
+
disconnectedCallback() {
|
|
15941
|
+
var _a;
|
|
15942
|
+
(_a = this.flatpickrInstance) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
15943
|
+
this.flatpickrInstance = undefined;
|
|
15944
|
+
this.flatpickrStaticLayout = false;
|
|
15945
|
+
this.unwrapStaleFlatpickrWrapper();
|
|
15946
|
+
}
|
|
15947
|
+
componentDidRender() {
|
|
15948
|
+
this.ensureFlatpickr();
|
|
15949
|
+
}
|
|
15950
|
+
ensureFlatpickr() {
|
|
15951
|
+
if (this.flatpickrInstance || !this.input || !this.el.isConnected) {
|
|
15952
|
+
return;
|
|
15953
|
+
}
|
|
15954
|
+
this.unwrapStaleFlatpickrWrapper();
|
|
15955
|
+
this.initFlatpickr();
|
|
15956
|
+
}
|
|
15957
|
+
initFlatpickr() {
|
|
15958
|
+
const insideFixed = isInsideFixedPosition(this.el);
|
|
15959
|
+
this.flatpickrInstance = index$1.flatpickr(this.input, Object.assign(Object.assign({ allowInput: true }, (insideFixed
|
|
15960
|
+
? { static: true }
|
|
15961
|
+
: { appendTo: getNearestScrollableAncestor(this.el) })), { dateFormat: this.dateFormat, defaultDate: this.value, maxDate: this.max, minDate: this.min, mode: this.mode, nextArrow: arrowSvg(), prevArrow: arrowSvg(true), onClose: (selectedDates) => {
|
|
14093
15962
|
const minRequiredDates = !this.required ? 0 : this.mode === 'single' ? 1 : 2;
|
|
14094
15963
|
this.hasErrorState = selectedDates.length < minRequiredDates ? 'required' : null;
|
|
14095
15964
|
if (selectedDates.length === 2) {
|
|
@@ -14099,20 +15968,41 @@ const XplInputDate = class {
|
|
|
14099
15968
|
end,
|
|
14100
15969
|
});
|
|
14101
15970
|
}
|
|
14102
|
-
}
|
|
15971
|
+
} }));
|
|
15972
|
+
queueMicrotask(() => {
|
|
15973
|
+
if (this.flatpickrStaticLayout !== insideFixed) {
|
|
15974
|
+
this.flatpickrStaticLayout = insideFixed;
|
|
15975
|
+
}
|
|
14103
15976
|
});
|
|
14104
15977
|
}
|
|
15978
|
+
unwrapStaleFlatpickrWrapper() {
|
|
15979
|
+
const { input } = this;
|
|
15980
|
+
const wrapper = input === null || input === void 0 ? void 0 : input.parentElement;
|
|
15981
|
+
if (!(wrapper === null || wrapper === void 0 ? void 0 : wrapper.classList.contains('flatpickr-wrapper'))) {
|
|
15982
|
+
return;
|
|
15983
|
+
}
|
|
15984
|
+
const parent = wrapper.parentElement;
|
|
15985
|
+
if (!parent) {
|
|
15986
|
+
return;
|
|
15987
|
+
}
|
|
15988
|
+
while (wrapper.firstChild) {
|
|
15989
|
+
parent.insertBefore(wrapper.firstChild, wrapper);
|
|
15990
|
+
}
|
|
15991
|
+
parent.removeChild(wrapper);
|
|
15992
|
+
}
|
|
14105
15993
|
render() {
|
|
14106
|
-
return (index.h(index.Host, { key: '
|
|
15994
|
+
return (index.h(index.Host, { key: '35f91387097b7fd5bdc59ff8608c3700470ff367', class: {
|
|
14107
15995
|
'xpl-input-date': true,
|
|
14108
15996
|
[`xpl-input-date--mode-${this.mode}`]: true,
|
|
14109
15997
|
'xpl-input-date--error': !!this.hasErrorState,
|
|
14110
|
-
|
|
15998
|
+
'xpl-input-date--flatpickr-static': this.flatpickrStaticLayout,
|
|
15999
|
+
} }, index.h("div", { key: '7f561dba2b2aa7d308d0029a20ace5d918368afc', class: "xpl-input-wrapper" }, this.pre && (index.h("label", { key: '2e87d6e22a2a69db7e91c69fb3d59f81d8358e52', class: "xpl-input-pre", htmlFor: this.inputId }, this.pre)), index.h("input", { key: '53d05e6b6b637e298f31cb1f2b9c56d9d597688f', type: "date", id: this.inputId, disabled: this.disabled, name: this.name, required: this.required, readonly: this.readonly, placeholder: this.placeholder, max: this.max, min: this.min, ref: (el) => {
|
|
14111
16000
|
this.input = el;
|
|
14112
16001
|
}, onChange: (event) => {
|
|
14113
16002
|
this.valueChanged(event);
|
|
14114
|
-
} }), index.h("xpl-icon", { key: '
|
|
16003
|
+
} }), index.h("xpl-icon", { key: '45c1d48fe6a312855cf3bd90e139d060821c4ba4', class: "xpl-input-calendar", icon: "calendar-month", size: 24 }), this.post && (index.h("label", { key: '037657e9a3cecc054d95b6fd835b58885eef8042', class: "xpl-input-post", htmlFor: this.inputId }, this.post)))));
|
|
14115
16004
|
}
|
|
16005
|
+
get el() { return index.getElement(this); }
|
|
14116
16006
|
static get watchers() { return {
|
|
14117
16007
|
"hasErrorState": [{
|
|
14118
16008
|
"onHasErrorStateChanged": 0
|
|
@@ -14123,7 +16013,7 @@ const XplInputDate = class {
|
|
|
14123
16013
|
}; }
|
|
14124
16014
|
};
|
|
14125
16015
|
|
|
14126
|
-
const
|
|
16016
|
+
const InputFile = class {
|
|
14127
16017
|
constructor(hostRef) {
|
|
14128
16018
|
index.registerInstance(this, hostRef);
|
|
14129
16019
|
this.inputChange = index.createEvent(this, "inputChange", 7);
|
|
@@ -14159,18 +16049,18 @@ const XplInputFile = class {
|
|
|
14159
16049
|
}
|
|
14160
16050
|
render() {
|
|
14161
16051
|
var _a, _b;
|
|
14162
|
-
return (index.h(index.Host, { key: '
|
|
16052
|
+
return (index.h(index.Host, { key: '87df3edce40c74988426ba9fcef4bc3f5740c56b', class: {
|
|
14163
16053
|
'xpl-input-file': true,
|
|
14164
16054
|
'xpl-input-file--hide-trigger-on-select': this.hideTriggerOnSelect,
|
|
14165
16055
|
'xpl-input-file--disabled': this.disabled,
|
|
14166
|
-
} }, index.h("span", { key: '
|
|
16056
|
+
} }, index.h("span", { key: '11e4c220751ce3f06fd15a741a1f8b81d98c18bc', class: {
|
|
14167
16057
|
'xpl-input-file__trigger-wrapper': true,
|
|
14168
16058
|
'xpl-input-file__trigger-wrapper--hidden': this.hideTriggerOnSelect && ((_a = this.files) === null || _a === void 0 ? void 0 : _a.length) > 0,
|
|
14169
|
-
}, role: "button", tabIndex: 0, onClick: this.openFileDialog }, index.h("slot", { key: '
|
|
16059
|
+
}, role: "button", tabIndex: 0, onClick: this.openFileDialog }, index.h("slot", { key: '6daba4f9e520c12a791bfd18f2894e55f0da86f4', name: "trigger" })), ((_b = this.files) === null || _b === void 0 ? void 0 : _b.length) > 0 && !this.hideFileNames && (index.h("ul", { key: '3459f9c3e8618962c02f1e25e6b80f63fe4d593d', class: "xpl-input-file__file-list" }, this.files.map((file, fileIndex) => (index.h("li", { class: "xpl-input-file__file-item" }, index.h("span", { class: "xpl-text-callout" }, file.name), index.h("xpl-icon", { icon: "x-circle", size: 24, onClick: (e) => {
|
|
14170
16060
|
e.preventDefault();
|
|
14171
16061
|
e.stopPropagation();
|
|
14172
16062
|
this.onRemoveFileByIndex(fileIndex);
|
|
14173
|
-
}, class: "xpl-input-file__remove-icon" })))))), this.accept && !this.hideAcceptText && (index.h("span", { key: '
|
|
16063
|
+
}, class: "xpl-input-file__remove-icon" })))))), this.accept && !this.hideAcceptText && (index.h("span", { key: '2c8646cd5ef7e235e75c68bf4832ce1d9c578493', class: "xpl-input-file__accept xpl-text-caption" }, "Accepted file types: ", this.accept)), index.h("input", { key: 'd303ac9e074e8031ed2d695cc85eef32ef40f058', onChange: this.handleFileChange, type: "file", ref: (el) => {
|
|
14174
16064
|
this.fileInput = el;
|
|
14175
16065
|
}, hidden: true, accept: this.accept, multiple: this.multiple, name: this.name })));
|
|
14176
16066
|
}
|
|
@@ -14182,6 +16072,512 @@ const XplInputFile = class {
|
|
|
14182
16072
|
}; }
|
|
14183
16073
|
};
|
|
14184
16074
|
|
|
16075
|
+
const PHONE_COUNTRIES = [
|
|
16076
|
+
{ countryCode: 'US', dialCode: '+1', name: 'United States' },
|
|
16077
|
+
{ countryCode: 'CA', dialCode: '+1', name: 'Canada' },
|
|
16078
|
+
{ countryCode: 'GB', dialCode: '+44', name: 'United Kingdom' },
|
|
16079
|
+
{ countryCode: 'AU', dialCode: '+61', name: 'Australia' },
|
|
16080
|
+
{ countryCode: 'DE', dialCode: '+49', name: 'Germany' },
|
|
16081
|
+
{ countryCode: 'FR', dialCode: '+33', name: 'France' },
|
|
16082
|
+
{ countryCode: 'ES', dialCode: '+34', name: 'Spain' },
|
|
16083
|
+
{ countryCode: 'IT', dialCode: '+39', name: 'Italy' },
|
|
16084
|
+
{ countryCode: 'NL', dialCode: '+31', name: 'Netherlands' },
|
|
16085
|
+
{ countryCode: 'BE', dialCode: '+32', name: 'Belgium' },
|
|
16086
|
+
{ countryCode: 'AT', dialCode: '+43', name: 'Austria' },
|
|
16087
|
+
{ countryCode: 'CH', dialCode: '+41', name: 'Switzerland' },
|
|
16088
|
+
{ countryCode: 'PL', dialCode: '+48', name: 'Poland' },
|
|
16089
|
+
{ countryCode: 'IE', dialCode: '+353', name: 'Ireland' },
|
|
16090
|
+
{ countryCode: 'PT', dialCode: '+351', name: 'Portugal' },
|
|
16091
|
+
{ countryCode: 'SE', dialCode: '+46', name: 'Sweden' },
|
|
16092
|
+
{ countryCode: 'NO', dialCode: '+47', name: 'Norway' },
|
|
16093
|
+
{ countryCode: 'DK', dialCode: '+45', name: 'Denmark' },
|
|
16094
|
+
{ countryCode: 'FI', dialCode: '+358', name: 'Finland' },
|
|
16095
|
+
{ countryCode: 'NZ', dialCode: '+64', name: 'New Zealand' },
|
|
16096
|
+
{ countryCode: 'JP', dialCode: '+81', name: 'Japan' },
|
|
16097
|
+
{ countryCode: 'CN', dialCode: '+86', name: 'China' },
|
|
16098
|
+
{ countryCode: 'IN', dialCode: '+91', name: 'India' },
|
|
16099
|
+
{ countryCode: 'BR', dialCode: '+55', name: 'Brazil' },
|
|
16100
|
+
{ countryCode: 'MX', dialCode: '+52', name: 'Mexico' },
|
|
16101
|
+
{ countryCode: 'ZA', dialCode: '+27', name: 'South Africa' },
|
|
16102
|
+
{ countryCode: 'SG', dialCode: '+65', name: 'Singapore' },
|
|
16103
|
+
{ countryCode: 'HK', dialCode: '+852', name: 'Hong Kong' },
|
|
16104
|
+
{ countryCode: 'KR', dialCode: '+82', name: 'South Korea' },
|
|
16105
|
+
];
|
|
16106
|
+
function getCountryByCode(countryCode) {
|
|
16107
|
+
return PHONE_COUNTRIES.find((c) => c.countryCode === countryCode);
|
|
16108
|
+
}
|
|
16109
|
+
function getCountryByDialCode(dialCode) {
|
|
16110
|
+
return PHONE_COUNTRIES.find((c) => c.dialCode === dialCode);
|
|
16111
|
+
}
|
|
16112
|
+
function parseE164(value) {
|
|
16113
|
+
if (!value || !value.startsWith('+'))
|
|
16114
|
+
return null;
|
|
16115
|
+
const digits = value.slice(1).replace(/\D/g, '');
|
|
16116
|
+
if (!digits.length)
|
|
16117
|
+
return null;
|
|
16118
|
+
const sorted = [...PHONE_COUNTRIES].sort((a, b) => b.dialCode.replace(/\D/g, '').length - a.dialCode.replace(/\D/g, '').length);
|
|
16119
|
+
const matchedCountry = sorted.find((country) => {
|
|
16120
|
+
const codeDigits = country.dialCode.slice(1).replace(/\D/g, '');
|
|
16121
|
+
return digits.startsWith(codeDigits);
|
|
16122
|
+
});
|
|
16123
|
+
if (!matchedCountry)
|
|
16124
|
+
return null;
|
|
16125
|
+
const codeDigits = matchedCountry.dialCode.slice(1).replace(/\D/g, '');
|
|
16126
|
+
const nationalNumber = digits.slice(codeDigits.length);
|
|
16127
|
+
return { dialCode: matchedCountry.dialCode, nationalNumber };
|
|
16128
|
+
}
|
|
16129
|
+
function toE164(dialCode, nationalNumber) {
|
|
16130
|
+
const digits = (dialCode.slice(1) + nationalNumber).replace(/\D/g, '');
|
|
16131
|
+
return digits.length ? `+${digits}` : '';
|
|
16132
|
+
}
|
|
16133
|
+
|
|
16134
|
+
function digitsOnly(value) {
|
|
16135
|
+
return (value || '').replace(/\D/g, '');
|
|
16136
|
+
}
|
|
16137
|
+
function getMaxNationalNumberLength(countryCode) {
|
|
16138
|
+
switch (countryCode) {
|
|
16139
|
+
case 'US':
|
|
16140
|
+
case 'CA':
|
|
16141
|
+
case 'MX':
|
|
16142
|
+
case 'JP':
|
|
16143
|
+
case 'IN':
|
|
16144
|
+
case 'KR':
|
|
16145
|
+
return 10;
|
|
16146
|
+
case 'GB':
|
|
16147
|
+
case 'DE':
|
|
16148
|
+
case 'AT':
|
|
16149
|
+
case 'CH':
|
|
16150
|
+
case 'BR':
|
|
16151
|
+
case 'CN':
|
|
16152
|
+
return 11;
|
|
16153
|
+
case 'AU':
|
|
16154
|
+
case 'FR':
|
|
16155
|
+
return 9;
|
|
16156
|
+
default:
|
|
16157
|
+
return 15;
|
|
16158
|
+
}
|
|
16159
|
+
}
|
|
16160
|
+
function getPlaceholderPattern(countryCode) {
|
|
16161
|
+
switch (countryCode) {
|
|
16162
|
+
case 'US':
|
|
16163
|
+
case 'CA':
|
|
16164
|
+
return '000 000 0000';
|
|
16165
|
+
case 'GB':
|
|
16166
|
+
return '0000 000 0000';
|
|
16167
|
+
case 'AU':
|
|
16168
|
+
return '0 000 000 000';
|
|
16169
|
+
case 'DE':
|
|
16170
|
+
case 'AT':
|
|
16171
|
+
case 'CH':
|
|
16172
|
+
return '000 0000000';
|
|
16173
|
+
case 'FR':
|
|
16174
|
+
return '0 00 00 00 00';
|
|
16175
|
+
case 'BR':
|
|
16176
|
+
return '00 00000 0000';
|
|
16177
|
+
case 'MX':
|
|
16178
|
+
return '000 000 0000';
|
|
16179
|
+
case 'JP':
|
|
16180
|
+
return '000 0000 0000';
|
|
16181
|
+
case 'CN':
|
|
16182
|
+
return '000 0000 0000';
|
|
16183
|
+
case 'IN':
|
|
16184
|
+
return '00000 00000';
|
|
16185
|
+
case 'KR':
|
|
16186
|
+
return '000 0000 0000';
|
|
16187
|
+
default:
|
|
16188
|
+
return '000 000 0000';
|
|
16189
|
+
}
|
|
16190
|
+
}
|
|
16191
|
+
function formatUSCA(d) {
|
|
16192
|
+
const len = Math.min(d.length, 10);
|
|
16193
|
+
if (len <= 3)
|
|
16194
|
+
return d.slice(0, len);
|
|
16195
|
+
if (len <= 6)
|
|
16196
|
+
return `${d.slice(0, 3)} ${d.slice(3, len)}`;
|
|
16197
|
+
return `${d.slice(0, 3)} ${d.slice(3, 6)} ${d.slice(6, len)}`;
|
|
16198
|
+
}
|
|
16199
|
+
function formatGB(d) {
|
|
16200
|
+
const len = Math.min(d.length, 11);
|
|
16201
|
+
if (len <= 4)
|
|
16202
|
+
return d.slice(0, len);
|
|
16203
|
+
if (len <= 7)
|
|
16204
|
+
return `${d.slice(0, 4)} ${d.slice(4, len)}`;
|
|
16205
|
+
return `${d.slice(0, 4)} ${d.slice(4, 7)} ${d.slice(7, len)}`;
|
|
16206
|
+
}
|
|
16207
|
+
function formatAU(d) {
|
|
16208
|
+
const len = Math.min(d.length, 9);
|
|
16209
|
+
if (len <= 1)
|
|
16210
|
+
return d.slice(0, len);
|
|
16211
|
+
if (len <= 4)
|
|
16212
|
+
return `${d.slice(0, 1)} ${d.slice(1, len)}`;
|
|
16213
|
+
if (len <= 7)
|
|
16214
|
+
return `${d.slice(0, 1)} ${d.slice(1, 4)} ${d.slice(4, len)}`;
|
|
16215
|
+
return `${d.slice(0, 1)} ${d.slice(1, 4)} ${d.slice(4, 7)} ${d.slice(7, len)}`;
|
|
16216
|
+
}
|
|
16217
|
+
function formatDE(d) {
|
|
16218
|
+
const len = Math.min(d.length, 11);
|
|
16219
|
+
if (len <= 3)
|
|
16220
|
+
return d.slice(0, len);
|
|
16221
|
+
return `${d.slice(0, 3)} ${d.slice(3, len)}`;
|
|
16222
|
+
}
|
|
16223
|
+
function formatFR(d) {
|
|
16224
|
+
const len = Math.min(d.length, 9);
|
|
16225
|
+
const parts = [];
|
|
16226
|
+
let i = 0;
|
|
16227
|
+
if (len > 0) {
|
|
16228
|
+
parts.push(d.slice(0, 1));
|
|
16229
|
+
i = 1;
|
|
16230
|
+
}
|
|
16231
|
+
while (i < len && i + 2 <= len) {
|
|
16232
|
+
parts.push(d.slice(i, i + 2));
|
|
16233
|
+
i += 2;
|
|
16234
|
+
}
|
|
16235
|
+
if (i < len)
|
|
16236
|
+
parts.push(d.slice(i));
|
|
16237
|
+
return parts.join(' ');
|
|
16238
|
+
}
|
|
16239
|
+
function formatBR(d) {
|
|
16240
|
+
const len = Math.min(d.length, 11);
|
|
16241
|
+
if (len <= 2)
|
|
16242
|
+
return len ? `(${d}` : '';
|
|
16243
|
+
if (len <= 6)
|
|
16244
|
+
return `(${d.slice(0, 2)}) ${d.slice(2, len)}`;
|
|
16245
|
+
if (len === 7)
|
|
16246
|
+
return `(${d.slice(0, 2)}) ${d.slice(2, len)}`;
|
|
16247
|
+
return `(${d.slice(0, 2)}) ${d.slice(2, 7)}-${d.slice(7, len)}`;
|
|
16248
|
+
}
|
|
16249
|
+
function formatMX(d) {
|
|
16250
|
+
const len = Math.min(d.length, 10);
|
|
16251
|
+
if (len <= 3)
|
|
16252
|
+
return d.slice(0, len);
|
|
16253
|
+
if (len <= 6)
|
|
16254
|
+
return `${d.slice(0, 3)} ${d.slice(3, len)}`;
|
|
16255
|
+
return `${d.slice(0, 3)} ${d.slice(3, 6)} ${d.slice(6, len)}`;
|
|
16256
|
+
}
|
|
16257
|
+
function formatJP(d) {
|
|
16258
|
+
const len = Math.min(d.length, 10);
|
|
16259
|
+
if (len <= 3)
|
|
16260
|
+
return d.slice(0, len);
|
|
16261
|
+
if (len <= 7)
|
|
16262
|
+
return `${d.slice(0, 3)}-${d.slice(3, len)}`;
|
|
16263
|
+
return `${d.slice(0, 3)}-${d.slice(3, 7)}-${d.slice(7, len)}`;
|
|
16264
|
+
}
|
|
16265
|
+
function formatCN(d) {
|
|
16266
|
+
const len = Math.min(d.length, 11);
|
|
16267
|
+
if (len <= 3)
|
|
16268
|
+
return d.slice(0, len);
|
|
16269
|
+
if (len <= 7)
|
|
16270
|
+
return `${d.slice(0, 3)} ${d.slice(3, len)}`;
|
|
16271
|
+
return `${d.slice(0, 3)} ${d.slice(3, 7)} ${d.slice(7, len)}`;
|
|
16272
|
+
}
|
|
16273
|
+
function formatIN(d) {
|
|
16274
|
+
const len = Math.min(d.length, 10);
|
|
16275
|
+
if (len <= 5)
|
|
16276
|
+
return d.slice(0, len);
|
|
16277
|
+
return `${d.slice(0, 5)} ${d.slice(5, len)}`;
|
|
16278
|
+
}
|
|
16279
|
+
function formatKR(d) {
|
|
16280
|
+
const len = Math.min(d.length, 10);
|
|
16281
|
+
if (len <= 3)
|
|
16282
|
+
return d.slice(0, len);
|
|
16283
|
+
if (len <= 7)
|
|
16284
|
+
return `${d.slice(0, 3)} ${d.slice(3, len)}`;
|
|
16285
|
+
return `${d.slice(0, 3)} ${d.slice(3, 7)} ${d.slice(7, len)}`;
|
|
16286
|
+
}
|
|
16287
|
+
function formatGeneric(d) {
|
|
16288
|
+
const len = d.length;
|
|
16289
|
+
if (len <= 3)
|
|
16290
|
+
return d;
|
|
16291
|
+
const groups = [];
|
|
16292
|
+
let i = 0;
|
|
16293
|
+
while (i < len) {
|
|
16294
|
+
const take = len - i >= 4 ? 4 : 3;
|
|
16295
|
+
groups.push(d.slice(i, i + take));
|
|
16296
|
+
i += take;
|
|
16297
|
+
}
|
|
16298
|
+
return groups.join(' ');
|
|
16299
|
+
}
|
|
16300
|
+
function formatNationalNumber(digits, countryCode) {
|
|
16301
|
+
if (!digits)
|
|
16302
|
+
return '';
|
|
16303
|
+
const d = digits.replace(/\D/g, '');
|
|
16304
|
+
switch (countryCode) {
|
|
16305
|
+
case 'US':
|
|
16306
|
+
case 'CA':
|
|
16307
|
+
return formatUSCA(d);
|
|
16308
|
+
case 'GB':
|
|
16309
|
+
return formatGB(d);
|
|
16310
|
+
case 'AU':
|
|
16311
|
+
return formatAU(d);
|
|
16312
|
+
case 'DE':
|
|
16313
|
+
case 'AT':
|
|
16314
|
+
case 'CH':
|
|
16315
|
+
return formatDE(d);
|
|
16316
|
+
case 'FR':
|
|
16317
|
+
return formatFR(d);
|
|
16318
|
+
case 'BR':
|
|
16319
|
+
return formatBR(d);
|
|
16320
|
+
case 'MX':
|
|
16321
|
+
return formatMX(d);
|
|
16322
|
+
case 'JP':
|
|
16323
|
+
return formatJP(d);
|
|
16324
|
+
case 'CN':
|
|
16325
|
+
return formatCN(d);
|
|
16326
|
+
case 'IN':
|
|
16327
|
+
return formatIN(d);
|
|
16328
|
+
case 'KR':
|
|
16329
|
+
return formatKR(d);
|
|
16330
|
+
default:
|
|
16331
|
+
return formatGeneric(d);
|
|
16332
|
+
}
|
|
16333
|
+
}
|
|
16334
|
+
function getCursorPositionAfterFormat(prevFormatted, nextFormatted, prevCursor) {
|
|
16335
|
+
if (prevCursor >= prevFormatted.length) {
|
|
16336
|
+
return nextFormatted.length;
|
|
16337
|
+
}
|
|
16338
|
+
const digitsBeforeCursor = digitsOnly(prevFormatted.slice(0, prevCursor)).length;
|
|
16339
|
+
let newPos = 0;
|
|
16340
|
+
let count = 0;
|
|
16341
|
+
for (let i = 0; i < nextFormatted.length; i += 1) {
|
|
16342
|
+
if (/\d/.test(nextFormatted[i])) {
|
|
16343
|
+
count += 1;
|
|
16344
|
+
if (count >= digitsBeforeCursor) {
|
|
16345
|
+
newPos = i + (count === digitsBeforeCursor ? 1 : 0);
|
|
16346
|
+
break;
|
|
16347
|
+
}
|
|
16348
|
+
}
|
|
16349
|
+
newPos = i + 1;
|
|
16350
|
+
}
|
|
16351
|
+
return Math.min(newPos, nextFormatted.length);
|
|
16352
|
+
}
|
|
16353
|
+
|
|
16354
|
+
function getCountryIconName(countryName) {
|
|
16355
|
+
return countryName.toLowerCase().replace(/ /g, '-');
|
|
16356
|
+
}
|
|
16357
|
+
const InputPhone = class {
|
|
16358
|
+
constructor(hostRef) {
|
|
16359
|
+
index.registerInstance(this, hostRef);
|
|
16360
|
+
this.hasErrorStateChanged = index.createEvent(this, "hasErrorStateChanged", 7);
|
|
16361
|
+
this.valueChange = index.createEvent(this, "valueChange", 7);
|
|
16362
|
+
this.lastCursorRef = 0;
|
|
16363
|
+
this.lastFormattedRef = '';
|
|
16364
|
+
this.dropdownOpen = false;
|
|
16365
|
+
this.hasErrorState = null;
|
|
16366
|
+
this.nationalNumber = '';
|
|
16367
|
+
this.searchQuery = '';
|
|
16368
|
+
this.triggerId = `xpl-input-phone-trigger-${v4.v4()}`;
|
|
16369
|
+
this.defaultCountry = 'US';
|
|
16370
|
+
this.isInternational = true;
|
|
16371
|
+
this.handleTriggerClick = () => {
|
|
16372
|
+
if (!this.isEditable)
|
|
16373
|
+
return;
|
|
16374
|
+
this.dropdownOpen = !this.dropdownOpen;
|
|
16375
|
+
};
|
|
16376
|
+
this.handleNumberInput = (ev) => {
|
|
16377
|
+
var _a;
|
|
16378
|
+
const target = ev.target;
|
|
16379
|
+
const raw = target.value || '';
|
|
16380
|
+
this.lastCursorRef = (_a = target.selectionStart) !== null && _a !== void 0 ? _a : 0;
|
|
16381
|
+
this.lastFormattedRef = raw;
|
|
16382
|
+
let nationalDigits;
|
|
16383
|
+
if (this.isInternational && raw.startsWith('+')) {
|
|
16384
|
+
const fullDigits = digitsOnly(raw);
|
|
16385
|
+
const dialDigits = this.effectiveDialCode.slice(1).replace(/\D/g, '');
|
|
16386
|
+
nationalDigits =
|
|
16387
|
+
dialDigits && fullDigits.startsWith(dialDigits)
|
|
16388
|
+
? fullDigits.slice(dialDigits.length)
|
|
16389
|
+
: fullDigits;
|
|
16390
|
+
}
|
|
16391
|
+
else {
|
|
16392
|
+
nationalDigits = digitsOnly(raw);
|
|
16393
|
+
}
|
|
16394
|
+
const maxLength = getMaxNationalNumberLength(this.effectiveCountryCode);
|
|
16395
|
+
if (nationalDigits.length > maxLength) {
|
|
16396
|
+
nationalDigits = nationalDigits.slice(0, maxLength);
|
|
16397
|
+
}
|
|
16398
|
+
this.nationalNumber = nationalDigits;
|
|
16399
|
+
this.emitValue();
|
|
16400
|
+
target.value = this.displayValue;
|
|
16401
|
+
};
|
|
16402
|
+
this.handleClear = () => {
|
|
16403
|
+
var _a;
|
|
16404
|
+
this.nationalNumber = '';
|
|
16405
|
+
this.emitValue();
|
|
16406
|
+
(_a = this.inputEl) === null || _a === void 0 ? void 0 : _a.focus();
|
|
16407
|
+
};
|
|
16408
|
+
this.handleDropdownUpdate = (_e, { component }) => {
|
|
16409
|
+
var _a;
|
|
16410
|
+
const dropdown = component !== null && component !== void 0 ? component : this.dropdownRef;
|
|
16411
|
+
if (!dropdown)
|
|
16412
|
+
return;
|
|
16413
|
+
const { options } = dropdown;
|
|
16414
|
+
if (options === null || options === void 0 ? void 0 : options.length) {
|
|
16415
|
+
const flat = options.reduce((acc, curr) => { var _a; return [...acc, ...(curr.groupName ? ((_a = curr.options) !== null && _a !== void 0 ? _a : []) : [curr])]; }, []);
|
|
16416
|
+
const selected = flat.find((o) => o.isSelected);
|
|
16417
|
+
if (selected === null || selected === void 0 ? void 0 : selected.value) {
|
|
16418
|
+
const country = getCountryByCode(selected.value);
|
|
16419
|
+
if (country) {
|
|
16420
|
+
this.selectedCountry = country;
|
|
16421
|
+
this.emitValue();
|
|
16422
|
+
(_a = this.inputEl) === null || _a === void 0 ? void 0 : _a.focus();
|
|
16423
|
+
}
|
|
16424
|
+
}
|
|
16425
|
+
}
|
|
16426
|
+
};
|
|
16427
|
+
}
|
|
16428
|
+
onDropdownOpenChange(isOpen) {
|
|
16429
|
+
if (isOpen) {
|
|
16430
|
+
this.searchQuery = '';
|
|
16431
|
+
}
|
|
16432
|
+
}
|
|
16433
|
+
onHasErrorStateChanged(newValue) {
|
|
16434
|
+
this.hasErrorStateChanged.emit(newValue);
|
|
16435
|
+
}
|
|
16436
|
+
onValueChange(newValue) {
|
|
16437
|
+
var _a, _b;
|
|
16438
|
+
if (newValue == null || newValue === '') {
|
|
16439
|
+
const country = getCountryByCode(this.defaultCountry) || PHONE_COUNTRIES[0];
|
|
16440
|
+
this.selectedCountry = country;
|
|
16441
|
+
this.nationalNumber = '';
|
|
16442
|
+
return;
|
|
16443
|
+
}
|
|
16444
|
+
const parsed = parseE164(newValue);
|
|
16445
|
+
if (parsed) {
|
|
16446
|
+
if (((_a = this.selectedCountry) === null || _a === void 0 ? void 0 : _a.dialCode) === parsed.dialCode) {
|
|
16447
|
+
this.nationalNumber = parsed.nationalNumber;
|
|
16448
|
+
}
|
|
16449
|
+
else {
|
|
16450
|
+
const defaultForCode = getCountryByCode(this.defaultCountry);
|
|
16451
|
+
const country = (_b = ((defaultForCode === null || defaultForCode === void 0 ? void 0 : defaultForCode.dialCode) === parsed.dialCode ? defaultForCode : undefined)) !== null && _b !== void 0 ? _b : getCountryByDialCode(parsed.dialCode);
|
|
16452
|
+
if (country) {
|
|
16453
|
+
this.selectedCountry = country;
|
|
16454
|
+
this.nationalNumber = parsed.nationalNumber;
|
|
16455
|
+
}
|
|
16456
|
+
}
|
|
16457
|
+
}
|
|
16458
|
+
else if (!this.selectedCountry) {
|
|
16459
|
+
this.selectedCountry = getCountryByCode(this.defaultCountry) || PHONE_COUNTRIES[0];
|
|
16460
|
+
}
|
|
16461
|
+
}
|
|
16462
|
+
componentWillLoad() {
|
|
16463
|
+
if (this.value) {
|
|
16464
|
+
this.onValueChange(this.value);
|
|
16465
|
+
}
|
|
16466
|
+
else {
|
|
16467
|
+
this.selectedCountry = getCountryByCode(this.defaultCountry) || PHONE_COUNTRIES[0];
|
|
16468
|
+
}
|
|
16469
|
+
}
|
|
16470
|
+
componentDidUpdate() {
|
|
16471
|
+
if (this.inputEl &&
|
|
16472
|
+
this.lastFormattedRef &&
|
|
16473
|
+
typeof this.inputEl.setSelectionRange === 'function') {
|
|
16474
|
+
const newFormatted = this.displayValue;
|
|
16475
|
+
const newCursor = getCursorPositionAfterFormat(this.lastFormattedRef, newFormatted, this.lastCursorRef);
|
|
16476
|
+
this.inputEl.setSelectionRange(newCursor, newCursor);
|
|
16477
|
+
this.lastFormattedRef = '';
|
|
16478
|
+
}
|
|
16479
|
+
else if (this.inputEl && this.lastFormattedRef) {
|
|
16480
|
+
this.lastFormattedRef = '';
|
|
16481
|
+
}
|
|
16482
|
+
}
|
|
16483
|
+
get effectiveCountryCode() {
|
|
16484
|
+
var _a, _b, _c;
|
|
16485
|
+
return (_c = (_b = (_a = this.selectedCountry) === null || _a === void 0 ? void 0 : _a.countryCode) !== null && _b !== void 0 ? _b : this.defaultCountry) !== null && _c !== void 0 ? _c : 'US';
|
|
16486
|
+
}
|
|
16487
|
+
get effectiveDialCode() {
|
|
16488
|
+
var _a, _b;
|
|
16489
|
+
return (_b = (_a = this.selectedCountry) === null || _a === void 0 ? void 0 : _a.dialCode) !== null && _b !== void 0 ? _b : '+1';
|
|
16490
|
+
}
|
|
16491
|
+
get isEditable() {
|
|
16492
|
+
return !this.disabled && !this.readonly;
|
|
16493
|
+
}
|
|
16494
|
+
get orderedCountries() {
|
|
16495
|
+
const preferred = this.preferredCountries || [];
|
|
16496
|
+
const rest = PHONE_COUNTRIES.filter((c) => !preferred.includes(c.countryCode));
|
|
16497
|
+
return [...preferred.map((code) => getCountryByCode(code)).filter(Boolean), ...rest];
|
|
16498
|
+
}
|
|
16499
|
+
get filteredCountries() {
|
|
16500
|
+
const q = this.searchQuery.trim().toLowerCase();
|
|
16501
|
+
if (!q)
|
|
16502
|
+
return this.orderedCountries;
|
|
16503
|
+
return this.orderedCountries.filter((c) => c.name.toLowerCase().includes(q) ||
|
|
16504
|
+
c.dialCode.includes(q) ||
|
|
16505
|
+
c.countryCode.toLowerCase().includes(q));
|
|
16506
|
+
}
|
|
16507
|
+
get displayValue() {
|
|
16508
|
+
if (!this.nationalNumber)
|
|
16509
|
+
return '';
|
|
16510
|
+
return formatNationalNumber(this.nationalNumber, this.effectiveCountryCode);
|
|
16511
|
+
}
|
|
16512
|
+
get effectivePlaceholder() {
|
|
16513
|
+
if (this.placeholder)
|
|
16514
|
+
return this.placeholder;
|
|
16515
|
+
const country = this.selectedCountry;
|
|
16516
|
+
if (!country)
|
|
16517
|
+
return '';
|
|
16518
|
+
return getPlaceholderPattern(country.countryCode);
|
|
16519
|
+
}
|
|
16520
|
+
get dropdownOptions() {
|
|
16521
|
+
return this.filteredCountries.map((c) => {
|
|
16522
|
+
var _a;
|
|
16523
|
+
return ({
|
|
16524
|
+
icon: getCountryIconName(c.name),
|
|
16525
|
+
label: `${c.name} (${c.dialCode})`,
|
|
16526
|
+
value: c.countryCode,
|
|
16527
|
+
isSelected: ((_a = this.selectedCountry) === null || _a === void 0 ? void 0 : _a.countryCode) === c.countryCode,
|
|
16528
|
+
});
|
|
16529
|
+
});
|
|
16530
|
+
}
|
|
16531
|
+
get maxInputLength() {
|
|
16532
|
+
const maxNationalDigits = getMaxNationalNumberLength(this.effectiveCountryCode);
|
|
16533
|
+
return formatNationalNumber('9'.repeat(maxNationalDigits), this.effectiveCountryCode)
|
|
16534
|
+
.length;
|
|
16535
|
+
}
|
|
16536
|
+
emitValue() {
|
|
16537
|
+
const e164 = this.nationalNumber ? toE164(this.effectiveDialCode, this.nationalNumber) : '';
|
|
16538
|
+
this.value = e164 || undefined;
|
|
16539
|
+
this.valueChange.emit(e164 || '');
|
|
16540
|
+
this.validate();
|
|
16541
|
+
}
|
|
16542
|
+
validate() {
|
|
16543
|
+
if (this.required && !this.nationalNumber.trim()) {
|
|
16544
|
+
this.hasErrorState = 'required';
|
|
16545
|
+
return;
|
|
16546
|
+
}
|
|
16547
|
+
this.hasErrorState = null;
|
|
16548
|
+
}
|
|
16549
|
+
render() {
|
|
16550
|
+
var _a;
|
|
16551
|
+
return (index.h(index.Host, { key: 'e966930ecc1ce026b03daf50902ee783d469af03', class: {
|
|
16552
|
+
'xpl-input-phone': true,
|
|
16553
|
+
'xpl-input-phone--error': !!this.hasErrorState,
|
|
16554
|
+
'xpl-input-phone--open': this.dropdownOpen,
|
|
16555
|
+
'xpl-input-phone--domestic': !this.isInternational,
|
|
16556
|
+
} }, index.h("div", { key: 'd594d5345f30bd1165662930abee8b4214b2640d', class: "xpl-input-wrapper" }, this.isInternational && (index.h("button", { key: '64842282265b03cce24e5d80386ea3f56c36b5ad', 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 }, ((_a = this.selectedCountry) === null || _a === void 0 ? void 0 : _a.name) && (index.h("xpl-icon", { key: '00b0b9e477d285cc3e1c61becfbc056511d99ea2', class: "xpl-input-phone__flag", icon: getCountryIconName(this.selectedCountry.name), size: 24, "aria-hidden": "true" })), index.h("xpl-icon", { key: '9cc394beb1573e00e0eca641bfa8590a5837ff48', class: "xpl-input-phone__trigger-icon", icon: "chevron-down", size: 20, "aria-hidden": "true" }))), index.h("div", { key: 'ade974ac878f7c7bc3aa07f613a3005283d86819', class: "xpl-input-phone__input-wrap" }, this.isInternational && (index.h("span", { key: 'f4907b6f5919184dad42bac3a1071b2bbfe71a06', class: "xpl-input-phone__dial-code" }, this.effectiveDialCode)), index.h("input", { key: '89dce440dba56953574a05eda46862b4f24f84f8', ref: (el) => {
|
|
16557
|
+
this.inputEl = el;
|
|
16558
|
+
}, 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 ? '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 && (index.h("button", { key: '21e63c5dad2d73c8969e71c10cae9c507da8574a', type: "button", class: "xpl-input-phone__clear", "aria-label": "Clear phone number", onClick: this.handleClear }, index.h("xpl-icon", { key: 'ef1044fd8cc939db7281a8e68e72c54effb55101', icon: "x-circle", size: 16 }))))), this.isInternational && this.isEditable && (index.h("xpl-dropdown", { key: '0de330a03e99bdc73af073ad5b20a7b817192307', ref: (el) => {
|
|
16559
|
+
this.dropdownRef = el;
|
|
16560
|
+
}, isOpen: this.dropdownOpen, triggerId: this.triggerId, anchorToTrigger: true, closeOnSelect: true, mode: "single", options: this.dropdownOptions, update: this.handleDropdownUpdate, onIsOpenChange: (e) => {
|
|
16561
|
+
this.dropdownOpen = e.detail;
|
|
16562
|
+
}, "aria-label": "Country" }, index.h("div", { key: '6055decf8f631611786fc8720b17cf84341ef316', slot: "header", class: "xpl-input-phone__search-wrap" }, index.h("xpl-input", { key: '6c53dbde79069dc000214f22d29b17e568fde19f', class: "xpl-input-phone__search", type: "text", label: "", placeholder: "Search", value: this.searchQuery, autocomplete: "off", onInputEvent: (e) => {
|
|
16563
|
+
var _a;
|
|
16564
|
+
this.searchQuery = (_a = e.detail) !== null && _a !== void 0 ? _a : '';
|
|
16565
|
+
} }, index.h("xpl-icon", { key: 'cb57543146d6f874849d518aea4c01f670e4afa4', slot: "pre", class: "xpl-input-phone__search-icon", icon: "magnifier", size: 20 })))))));
|
|
16566
|
+
}
|
|
16567
|
+
get el() { return index.getElement(this); }
|
|
16568
|
+
static get watchers() { return {
|
|
16569
|
+
"dropdownOpen": [{
|
|
16570
|
+
"onDropdownOpenChange": 0
|
|
16571
|
+
}],
|
|
16572
|
+
"hasErrorState": [{
|
|
16573
|
+
"onHasErrorStateChanged": 0
|
|
16574
|
+
}],
|
|
16575
|
+
"value": [{
|
|
16576
|
+
"onValueChange": 0
|
|
16577
|
+
}]
|
|
16578
|
+
}; }
|
|
16579
|
+
};
|
|
16580
|
+
|
|
14185
16581
|
function format12Hour(time) {
|
|
14186
16582
|
const [hours, minutes] = time.split(':');
|
|
14187
16583
|
const ampm = Number(hours) >= 12 ? 'PM' : 'AM';
|
|
@@ -14246,7 +16642,7 @@ function generateTimeOptions(step, min, max, timeFormat) {
|
|
|
14246
16642
|
});
|
|
14247
16643
|
}
|
|
14248
16644
|
|
|
14249
|
-
const
|
|
16645
|
+
const InputTime = class {
|
|
14250
16646
|
constructor(hostRef) {
|
|
14251
16647
|
index.registerInstance(this, hostRef);
|
|
14252
16648
|
this.valueChange = index.createEvent(this, "valueChange", 7);
|
|
@@ -14354,11 +16750,11 @@ const XplInputTime = class {
|
|
|
14354
16750
|
}));
|
|
14355
16751
|
}
|
|
14356
16752
|
render() {
|
|
14357
|
-
return (index.h(index.Host, { key: '
|
|
16753
|
+
return (index.h(index.Host, { key: '2dfd50560c047646807e49c2263454286b607a35', class: {
|
|
14358
16754
|
'xpl-input-time': true,
|
|
14359
16755
|
[`xpl-input-time--mode-${this.mode}`]: true,
|
|
14360
16756
|
'xpl-input-time--error': !!this.hasErrorState,
|
|
14361
|
-
} }, index.h("xpl-input", { key: '
|
|
16757
|
+
} }, index.h("xpl-input", { key: '5ebb2d5031efae40beae3ac0cf2a40bed5b96ae5', pre: index.h("xpl-icon", { class: "xpl-input-time__clock-icon", icon: "clock", size: 24 }), post: this.timeFormat === '12h' ? this.amPm || 'AM' : null, 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 && (index.h("xpl-dropdown", { key: '313ee3020ddf2710e82756f1bc0e260b8959ef9e', options: this.options, isOpen: this.showOptions, ref: (el) => {
|
|
14362
16758
|
this.dropdown = el;
|
|
14363
16759
|
}, class: "xpl-input-time__dropdown" }))));
|
|
14364
16760
|
}
|
|
@@ -14372,7 +16768,7 @@ const XplInputTime = class {
|
|
|
14372
16768
|
}; }
|
|
14373
16769
|
};
|
|
14374
16770
|
|
|
14375
|
-
const
|
|
16771
|
+
const Modal = class {
|
|
14376
16772
|
constructor(hostRef) {
|
|
14377
16773
|
index.registerInstance(this, hostRef);
|
|
14378
16774
|
this.modalClosed = index.createEvent(this, "modalClosed", 7);
|
|
@@ -14419,7 +16815,7 @@ const XplModal = class {
|
|
|
14419
16815
|
}
|
|
14420
16816
|
}
|
|
14421
16817
|
render() {
|
|
14422
|
-
return (index.h(index.Host, { key: '
|
|
16818
|
+
return (index.h(index.Host, { key: '54638721a2e8f0928bf9a3c2c4b40b3d4ad54db2', class: "xpl-modal" }, this.isOpen && index.h("xpl-backdrop", { key: '910ca79829054343c67906d7514a0d34b37832d0' }), index.h("dialog", { key: 'e284d70e8d190e64cb2b8df9a3ae327e7d2b0c00', class: `xpl-modal__dialog xpl-modal-size--${this.size} xpl-modal--${this.isOpen ? 'is-open' : 'is-closed'}` }, index.h("div", { key: '42f86b8a9ef1cec791aa8b10458db11130d74839', class: "xpl-modal__header" }, index.h("div", { key: '1884139c12c8d06d23454d4840a32fb8a464dd7b', class: "xpl-modal__title" }, this.variant === 'warning' && (index.h("xpl-icon", { key: '5211e56c773f787a7f0a78b45fcf64b2c6eeb44f', size: 20, icon: "alert-triangle", class: "xpl-modal__alert-icon" })), index.h("slot", { key: '64287ebfac58f8f4c7e0133fb7f1d12781d12126', name: "title" }), index.h("xpl-button", { key: 'd10c9ab2f4c9df1b7e830da76414849a1191beaf', type: "button", class: "xpl-modal__close-button", "icon-only": true, size: "sm", variant: "tertiary", onClick: this.handleDialogClose }, index.h("xpl-icon", { key: '55fc8bce80a2a65d522fb3d91b0689ffdb245ed0', icon: "x" }))), index.h("div", { key: '17474a7e0561833a34b8c21319943ff8bde044f3', class: "xpl-modal__subtitle" }, index.h("slot", { key: '5b482ed4b113f17906e4d1106426ae567c937a4e', name: "subtitle" }))), index.h("div", { key: '85e702a36d347ef2b941f5c590504433798020a0', class: "xpl-modal__body" }, index.h("slot", { key: 'a5b9cc60582a82126e000ec9b74aee9376e37253', name: "body" })), index.h("div", { key: 'cff53f9aec109cff62835a9e13d168e434baec73', class: "xpl-modal__footer" }, index.h("slot", { key: 'cafc86918fca71f085c1e8d9c88f244bd5230f78', name: "tertiary" }), index.h("slot", { key: 'a0fbe836ebe814c85571514bb53316429e1e65e1', name: "secondary" }), index.h("slot", { key: 'cbf2a03c2d032fc32d1b0ecd319df7383085cfd3', name: "primary" })))));
|
|
14423
16819
|
}
|
|
14424
16820
|
get element() { return index.getElement(this); }
|
|
14425
16821
|
static get watchers() { return {
|
|
@@ -14429,7 +16825,7 @@ const XplModal = class {
|
|
|
14429
16825
|
}; }
|
|
14430
16826
|
};
|
|
14431
16827
|
|
|
14432
|
-
const
|
|
16828
|
+
const NavItem = class {
|
|
14433
16829
|
constructor(hostRef) {
|
|
14434
16830
|
index.registerInstance(this, hostRef);
|
|
14435
16831
|
this.navOpen = index.createEvent(this, "navOpen", 7);
|
|
@@ -14441,15 +16837,15 @@ const XplNavItem = class {
|
|
|
14441
16837
|
}
|
|
14442
16838
|
}
|
|
14443
16839
|
render() {
|
|
14444
|
-
return (index.h(index.Host, { key: '
|
|
16840
|
+
return (index.h(index.Host, { key: '7e852a7daf95bc3f9b4c87bad07504496b6a5863', class: "xpl-nav-item", role: "listitem", onClick: () => {
|
|
14445
16841
|
if (this.navControl) {
|
|
14446
16842
|
this.onNavToggle();
|
|
14447
16843
|
}
|
|
14448
|
-
} }, index.h("slot", { key: '
|
|
16844
|
+
} }, index.h("slot", { key: 'a88118864c2bdc808b7de975a530b77916b3750f', name: "link" }, index.h("slot", { key: '91d6a9c350e5de8c6221587795d43e1c315bb8cc', name: "icon" }), index.h("slot", { key: 'e37e0ee23226eb03200b12092e11a7ae47800abf' }))));
|
|
14449
16845
|
}
|
|
14450
16846
|
};
|
|
14451
16847
|
|
|
14452
|
-
const
|
|
16848
|
+
const Pagination = class {
|
|
14453
16849
|
constructor(hostRef) {
|
|
14454
16850
|
index.registerInstance(this, hostRef);
|
|
14455
16851
|
this.pageChange = index.createEvent(this, "pageChange", 7);
|
|
@@ -14512,19 +16908,19 @@ const XplPagination = class {
|
|
|
14512
16908
|
render() {
|
|
14513
16909
|
const disablePrev = this.currentPage <= 1;
|
|
14514
16910
|
const disableNext = this.currentPage >= this.totalPages;
|
|
14515
|
-
return (index.h(index.Host, { key: '
|
|
16911
|
+
return (index.h(index.Host, { key: 'a4b8f4ddd9b29563f64282e5728119e1552e5358', class: `xpl-pagination xpl-pagination__${this.withPageControl ? 'with' : 'no'}-page-control` }, this.withPageControl && (index.h("div", { key: '00c0d20d2bc57eebd82105ebafe08a5696496b16', class: "xpl-pagination__rows-per-page" }, index.h("label", { key: '1b28a926bbaa4b888217941bb0bf2d897d79dfbc', class: "xpl-pagination__rows-label" }, "Rows per page:"), index.h("xpl-select", { key: 'f8265a8d87986cfc0afbfcd9d783d767748a8957', class: "xpl-pagination__rows-per-page-select", choices: this.rowsPerPageOptionsArray.map((option) => ({
|
|
14516
16912
|
label: option.toString(),
|
|
14517
16913
|
value: option.toString(),
|
|
14518
16914
|
isSelected: option === this.selectedRowsPerPage,
|
|
14519
16915
|
})), ref: (el) => {
|
|
14520
16916
|
this.rowsPerPageSelectRef = el;
|
|
14521
|
-
} }))), index.h("div", { key: '
|
|
16917
|
+
} }))), index.h("div", { key: '1444d9005878427c44a573d4f6dd1d674b677228', class: "xpl-pagination__pager" }, index.h("button", { key: '08b98f8c1983543dad93c53d7c71d1aa71b4a45a', class: "xpl-pagination__pager-button xpl-pagination__pager-button-prev", disabled: disablePrev, onClick: this.handlePrevPage, "aria-label": "Previous Page", tabindex: "0" }, index.h("xpl-icon", { key: 'dcc26fcb7be5f525b4767d0860766f3a216a93e4', icon: "arrow-left", size: 20 })), index.h("xpl-select", { key: '7ba55fb451e26b31aba360876d8ee3b2bb423e19', class: "xpl-pagination__page-select", choices: Array.from({ length: this.totalPages }, (_, index) => ({
|
|
14522
16918
|
label: `Page ${index + 1}`,
|
|
14523
16919
|
value: (index + 1).toString(),
|
|
14524
16920
|
isSelected: index + 1 === this.currentPage,
|
|
14525
16921
|
})), "custom-display-value": true, ref: (el) => {
|
|
14526
16922
|
this.pageSelectRef = el;
|
|
14527
|
-
} }, index.h("div", { key: '
|
|
16923
|
+
} }, index.h("div", { key: '9c8adc967a098d954477d9032f6d22a0192948e0', slot: "custom-display-value" }, `${this.currentPage} of ${this.totalPages}`)), index.h("button", { key: '73b5bcbe7ce988c7f5f12ec4ea179bb879f39919', class: "xpl-pagination__pager-button xpl-pagination__pager-button-next", disabled: disableNext, onClick: this.handleNextPage, "aria-label": "Next Page", tabindex: "0" }, index.h("xpl-icon", { key: 'fb95a3807dc37c419195b2c88c2d8dc39b183880', icon: "arrow-right", size: 20 })))));
|
|
14528
16924
|
}
|
|
14529
16925
|
static get watchers() { return {
|
|
14530
16926
|
"currentPage": [{
|
|
@@ -14536,6 +16932,22 @@ const XplPagination = class {
|
|
|
14536
16932
|
}; }
|
|
14537
16933
|
};
|
|
14538
16934
|
|
|
16935
|
+
const XplPanel = class {
|
|
16936
|
+
constructor(hostRef) {
|
|
16937
|
+
index.registerInstance(this, hostRef);
|
|
16938
|
+
this.accent = 'none';
|
|
16939
|
+
this.padding = 'default';
|
|
16940
|
+
}
|
|
16941
|
+
render() {
|
|
16942
|
+
const hasAccent = this.accent !== 'none';
|
|
16943
|
+
return (index.h(index.Host, { key: 'a247ab70a6b062022146b88d95b382f879cb8ee7', class: {
|
|
16944
|
+
'xpl-panel': true,
|
|
16945
|
+
[`xpl-panel--accent-${this.accent}`]: hasAccent,
|
|
16946
|
+
[`xpl-panel--padding-${this.padding}`]: true,
|
|
16947
|
+
} }, hasAccent && index.h("div", { key: '100febab4991a83e7463198331253fe7c7425a1d', class: "xpl-panel__accent" }), index.h("div", { key: 'c0758ab1d25675236ab15f052f45a29432021019', class: "xpl-panel__content" }, index.h("slot", { key: '948ec6423935f7ae825f78a89b456f72a66819a8' }))));
|
|
16948
|
+
}
|
|
16949
|
+
};
|
|
16950
|
+
|
|
14539
16951
|
/**
|
|
14540
16952
|
* lodash (Custom Build) <https://lodash.com/>
|
|
14541
16953
|
* Build: `lodash modularize exports="npm" -o ./`
|
|
@@ -14987,7 +17399,7 @@ function requireLodash_throttle () {
|
|
|
14987
17399
|
var lodash_throttleExports = requireLodash_throttle();
|
|
14988
17400
|
var throttle = /*@__PURE__*/getDefaultExportFromCjs(lodash_throttleExports);
|
|
14989
17401
|
|
|
14990
|
-
const
|
|
17402
|
+
const Popover = class {
|
|
14991
17403
|
constructor(hostRef) {
|
|
14992
17404
|
index.registerInstance(this, hostRef);
|
|
14993
17405
|
this.isOpenChange = index.createEvent(this, "isOpenChange", 7);
|
|
@@ -15195,16 +17607,16 @@ const XplPopover = class {
|
|
|
15195
17607
|
});
|
|
15196
17608
|
}
|
|
15197
17609
|
render() {
|
|
15198
|
-
return (index.h(index.Host, { key: '
|
|
17610
|
+
return (index.h(index.Host, { key: '5ed2eca6cac15c5009d0a5440f4a1f1e4dce8260' }, index.h("div", { key: 'f396004504407a1215e76187be06a27e56bd4a49', class: {
|
|
15199
17611
|
'xpl-popover': true,
|
|
15200
17612
|
[`xpl-popover--${this.actualPosition}`]: true,
|
|
15201
17613
|
'xpl-popover--is-open': this.isOpenState,
|
|
15202
|
-
} }, index.h("span", { key: '
|
|
17614
|
+
} }, index.h("span", { key: '23ac1ebf38617b2a9bd91a1ccfe37d212191f76c', role: "button", tabindex: "0", "aria-haspopup": "dialog", "aria-expanded": this.isOpenState ? 'true' : 'false', onClick: this.togglePopover, ref: (el) => {
|
|
15203
17615
|
this.triggerRef = el;
|
|
15204
|
-
} }, index.h("slot", { key: '
|
|
17616
|
+
} }, index.h("slot", { key: 'ee427ff33db360b11719a886ad724a2bceb64eed', name: "trigger" })), this.display === 'arrow' && (index.h("div", { key: '27fb57c24abdf3eecb6aae0a96f9b6256ee593a3', class: "xpl-popover__arrow" }, index.h("svg", { key: '3456fa0239edafe272047446d3aed0ebd4490275', width: "17", height: "14", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { key: 'e5de57c7cbf5301548af4eb5f79d14acc459d0a8', d: "M0 5h15l-7.5 7.5L0 5Z", fill: "white", stroke: "none", class: "arrow-fill" }), index.h("path", { key: '784f569c0baf0f6fdfad6bda1a36e6ee43293dce', d: "M0 5 L7.5 12.5 L15 5", fill: "none", stroke: "black", "stroke-width": "1", class: "arrow-stroke" })))), index.h("div", { key: '6ca95b76529ddfa681d4b11a30dceaaa4a3a10c4', class: {
|
|
15205
17617
|
'xpl-popover__content': true,
|
|
15206
17618
|
[`xpl-popover__content--display-${this.display}`]: true,
|
|
15207
|
-
}, ref: (el) => (this.contentRef = el) }, index.h("slot", { key: '
|
|
17619
|
+
}, ref: (el) => (this.contentRef = el) }, index.h("slot", { key: '75c6768b7e10ac698d54bdc30d052a6c0e98bd75' })))));
|
|
15208
17620
|
}
|
|
15209
17621
|
get el() { return index.getElement(this); }
|
|
15210
17622
|
static get watchers() { return {
|
|
@@ -15217,7 +17629,7 @@ const XplPopover = class {
|
|
|
15217
17629
|
}; }
|
|
15218
17630
|
};
|
|
15219
17631
|
|
|
15220
|
-
const
|
|
17632
|
+
const Progress = class {
|
|
15221
17633
|
constructor(hostRef) {
|
|
15222
17634
|
index.registerInstance(this, hostRef);
|
|
15223
17635
|
this.currentStep = 0;
|
|
@@ -15232,11 +17644,47 @@ const XplProgress = class {
|
|
|
15232
17644
|
render() {
|
|
15233
17645
|
const className = 'xpl-progress';
|
|
15234
17646
|
const steps = this.steps || [];
|
|
15235
|
-
return (index.h(index.Host, { key: '
|
|
17647
|
+
return (index.h(index.Host, { key: '13245e4ec2137ea46a325fb6d8d70c41be0307f1', class: className }, index.h("div", { key: 'd88e32dd9227ee388a7a6688863ce0a44354701c', class: "xpl-progress-container" }, steps.map((step, index$1) => (index.h("div", { class: `xpl-progress-step ${this.getCircleClass(index$1)}` }, index.h("div", { class: "xpl-progress-step-content" }, index.h("div", { class: "xpl-progress-step-circle" }, index$1 + 1), index.h("div", { class: "xpl-progress-step-text" }, step))))))));
|
|
17648
|
+
}
|
|
17649
|
+
};
|
|
17650
|
+
|
|
17651
|
+
const ProgressBar = class {
|
|
17652
|
+
constructor(hostRef) {
|
|
17653
|
+
index.registerInstance(this, hostRef);
|
|
17654
|
+
this.max = 100;
|
|
17655
|
+
this.size = 'lg';
|
|
17656
|
+
this.value = 0;
|
|
17657
|
+
this.variant = 'default';
|
|
17658
|
+
}
|
|
17659
|
+
get clampedValue() {
|
|
17660
|
+
return Math.max(0, Math.min(this.max, this.value));
|
|
17661
|
+
}
|
|
17662
|
+
get isComplete() {
|
|
17663
|
+
return this.value >= this.max && this.variant === 'default';
|
|
17664
|
+
}
|
|
17665
|
+
get isError() {
|
|
17666
|
+
return this.variant === 'error';
|
|
17667
|
+
}
|
|
17668
|
+
get isSuccess() {
|
|
17669
|
+
return this.variant === 'success' || this.isComplete;
|
|
17670
|
+
}
|
|
17671
|
+
get showStatusIcon() {
|
|
17672
|
+
return this.isSuccess || this.isError;
|
|
17673
|
+
}
|
|
17674
|
+
get isIndeterminate() {
|
|
17675
|
+
return this.variant === 'indeterminate';
|
|
17676
|
+
}
|
|
17677
|
+
render() {
|
|
17678
|
+
return (index.h(index.Host, { key: 'e07eee1ea1614d68190290be2ad16df663337215', class: {
|
|
17679
|
+
'xpl-progress-bar': true,
|
|
17680
|
+
[`xpl-progress-bar--${this.size}`]: true,
|
|
17681
|
+
[`xpl-progress-bar--${this.variant}`]: true,
|
|
17682
|
+
'xpl-progress-bar--complete': this.isComplete,
|
|
17683
|
+
} }, index.h("div", { key: 'e46025a05d42e0c275444f1057c8ee9827ce4d15', class: "xpl-progress-bar__wrapper" }, (this.label || this.showStatusIcon) && (index.h("div", { key: 'afc59b2fb32d9ac60afda9a40544121da045b237', class: "xpl-progress-bar__header" }, this.label && index.h("div", { key: '39d7add736c856c43bdecb61d083cf537e4da454', class: "xpl-progress-bar__label" }, this.label), this.showStatusIcon && (index.h("div", { key: '4e54b04a314136cdae066f7b48a8449b20a8daff', class: "xpl-progress-bar__icon" }, this.isError ? (index.h("xpl-icon", { icon: "circle-xmark-1" })) : (index.h("xpl-icon", { icon: "circle-check-1" })))))), index.h("div", { key: '6950cefcd5e90be2362201ae830bae73293b275a', class: "xpl-progress-bar__row" }, this.isIndeterminate ? (index.h("div", { class: "xpl-progress-bar__track xpl-progress-bar__track--indeterminate", role: "progressbar", "aria-label": this.label || 'Progress' }, index.h("div", { class: "xpl-progress-bar__indeterminate" }))) : (index.h("progress", { class: "xpl-progress-bar__progress", value: this.clampedValue, max: this.max, "aria-label": this.label || 'Progress' }))), this.helperText && (index.h("div", { key: 'e56af1b27ff6201a1eaa5cca7160c963a0fca529', class: "xpl-progress-bar__helper" }, this.helperText)))));
|
|
15236
17684
|
}
|
|
15237
17685
|
};
|
|
15238
17686
|
|
|
15239
|
-
const
|
|
17687
|
+
const Radio = class {
|
|
15240
17688
|
constructor(hostRef) {
|
|
15241
17689
|
index.registerInstance(this, hostRef);
|
|
15242
17690
|
this.radioChange = index.createEvent(this, "radioChange", 7);
|
|
@@ -15252,26 +17700,26 @@ const XplRadio = class {
|
|
|
15252
17700
|
};
|
|
15253
17701
|
}
|
|
15254
17702
|
render() {
|
|
15255
|
-
return (index.h(index.Host, { key: '
|
|
17703
|
+
return (index.h(index.Host, { key: 'c5b11522a1b9b21adf40318ff7f74f2ff76aa3c2', class: {
|
|
15256
17704
|
'xpl-checkbox-radio-container': true,
|
|
15257
17705
|
styled: this.styled,
|
|
15258
17706
|
disabled: this.disabled,
|
|
15259
|
-
} }, index.h("input", { key: '
|
|
17707
|
+
} }, index.h("input", { key: '950a769704369e2084834876242cb44d1609a166', class: "xpl-radio", type: "radio", checked: this.checked, disabled: this.disabled, id: this.id, name: this.name, required: this.required, onChange: this.onChange, value: this.value }), index.h("label", { key: '09f34b6e4a60d2c63e94734599b46f2ce1fc9a90', class: {
|
|
15260
17708
|
'xpl-label': true,
|
|
15261
17709
|
'xpl-label--disabled': this.disabled,
|
|
15262
|
-
}, htmlFor: this.id }, index.h("slot", { key: '
|
|
17710
|
+
}, htmlFor: this.id }, index.h("slot", { key: '2552eb83722cdf2e4b9d1a691fe2712d16e0fb84' }), this.description && (index.h("small", { key: '3bc230b6c18922aee661033b1ea5a1bc72384aac', class: {
|
|
15263
17711
|
'xpl-description': true,
|
|
15264
17712
|
'xpl-description--disabled': this.disabled,
|
|
15265
17713
|
} }, this.description)))));
|
|
15266
17714
|
}
|
|
15267
17715
|
};
|
|
15268
17716
|
|
|
15269
|
-
const
|
|
17717
|
+
const SecondaryNav = class {
|
|
15270
17718
|
constructor(hostRef) {
|
|
15271
17719
|
index.registerInstance(this, hostRef);
|
|
15272
17720
|
}
|
|
15273
17721
|
render() {
|
|
15274
|
-
return (index.h(index.Host, { key: '
|
|
17722
|
+
return (index.h(index.Host, { key: '3b015722c6fb8cf3cafb0c85054fab81a8362209', class: "xpl-secondary-nav" }, index.h("nav", { key: 'ffc4e57cc2ebdf792196477ff01d6b1f03da567f', "aria-label": "Secondary Nav" }, index.h("slot", { key: 'b15b8bcadf7faa41f155e11dcd9f2e11231efbc4' }))));
|
|
15275
17723
|
}
|
|
15276
17724
|
};
|
|
15277
17725
|
|
|
@@ -15286,7 +17734,7 @@ function getDisplayValue(choice) {
|
|
|
15286
17734
|
function flattenChoices(choices) {
|
|
15287
17735
|
return choices.reduce((acc, curr) => [...acc, ...(curr.groupName ? curr.options : [curr])], []);
|
|
15288
17736
|
}
|
|
15289
|
-
const
|
|
17737
|
+
const Select = class {
|
|
15290
17738
|
constructor(hostRef) {
|
|
15291
17739
|
index.registerInstance(this, hostRef);
|
|
15292
17740
|
this.selectChange = index.createEvent(this, "selectChange", 7);
|
|
@@ -15501,21 +17949,21 @@ const XplSelect = class {
|
|
|
15501
17949
|
this.truncate &&
|
|
15502
17950
|
!this.customDisplayValue;
|
|
15503
17951
|
const truncatedText = `+ ${Math.abs(this.choicesState.filter((a) => a.isSelected).length - this.visibleChoices)} more`;
|
|
15504
|
-
return (index.h(index.Host, { key: '
|
|
17952
|
+
return (index.h(index.Host, { key: '5c6008a31abe121ac946c9c5fc23721d28df86eb', class: {
|
|
15505
17953
|
'xpl-select': true,
|
|
15506
17954
|
'xpl-select--disabled': this.disabled,
|
|
15507
17955
|
'xpl-select--no-truncate': !this.truncate,
|
|
15508
17956
|
[(_c = this.classNames) !== null && _c !== void 0 ? _c : '']: !!this.classNames,
|
|
15509
17957
|
}, onKeyDown: this.handleTabKeyDown, ref: (el) => {
|
|
15510
17958
|
this.container = el;
|
|
15511
|
-
} }, this.renderLabel(), index.h("div", { key: '
|
|
17959
|
+
} }, this.renderLabel(), index.h("div", { key: 'f2de31e5b84fe2fdffa1e2b35ec611a4842a8323', class: {
|
|
15512
17960
|
'xpl-input': true,
|
|
15513
17961
|
'xpl-input--disabled': this.disabled,
|
|
15514
17962
|
'xpl-input--error': ((_d = this.error) === null || _d === void 0 ? void 0 : _d.length) >= 0,
|
|
15515
|
-
} }, index.h("div", { key: '
|
|
17963
|
+
} }, index.h("div", { key: '8a2192b28d75c56261f7a104ad02c76d49fb8787', class: "xpl-input-wrapper" }, index.h("button", { key: 'bb881153cd7cdbf4e43c40a96dfba8d95ca94aa6', class: "xpl-select__trigger", disabled: this.disabled, id: this.id, onKeyDown: this.handleTabKeyDown, onClick: (e) => {
|
|
15516
17964
|
e.preventDefault();
|
|
15517
17965
|
this.handleDropdownTrigger();
|
|
15518
|
-
}, type: "button" }, index.h("div", { key: '
|
|
17966
|
+
}, type: "button" }, index.h("div", { key: '1518f2ef57c7eeaa0fedc1832222a0345c4c46ab', class: {
|
|
15519
17967
|
'xpl-select-value': true,
|
|
15520
17968
|
'xpl-select-value--active': this.mode === 'multi' && this.value.length > 0,
|
|
15521
17969
|
'has-value': this.value.length > 0,
|
|
@@ -15535,7 +17983,7 @@ const XplSelect = class {
|
|
|
15535
17983
|
return this.renderSelectedTags();
|
|
15536
17984
|
}
|
|
15537
17985
|
return this.placeholder;
|
|
15538
|
-
})(), isTextTruncated && truncatedText), index.h("xpl-icon", { key: '
|
|
17986
|
+
})(), isTextTruncated && truncatedText), index.h("xpl-icon", { key: 'f37a879df93e5078a4b1a4950291a3bf65d81f43', class: "xpl-select__chevron-down", icon: this.selectIcon }))), !this.disabled && (index.h("xpl-dropdown", { key: '920d7d4e1916613b0056e6da80e055e7cf94fba6', ref: (el) => {
|
|
15539
17987
|
this.dropdown = el;
|
|
15540
17988
|
}, isOpen: this.dropdownOpenState, options: this.choicesState, selectedValues: this.selectedValues, mode: this.mode, triggerId: this.id, update: (_e, { component }) => {
|
|
15541
17989
|
const { options } = component;
|
|
@@ -15544,7 +17992,7 @@ const XplSelect = class {
|
|
|
15544
17992
|
}
|
|
15545
17993
|
}, onIsOpenChange: (e) => {
|
|
15546
17994
|
this.dropdownOpenState = e.detail;
|
|
15547
|
-
}, onWheel: this.handleDropdownScroll, anchorToTrigger: true })), this.renderError()), index.h("input", { key: '
|
|
17995
|
+
}, onWheel: this.handleDropdownScroll, anchorToTrigger: true })), this.renderError()), index.h("input", { key: '0137e17e78152e2ebc600156896df9a4c691f18a', type: "hidden", name: this.name, value: this.value })));
|
|
15548
17996
|
}
|
|
15549
17997
|
static get watchers() { return {
|
|
15550
17998
|
"choices": [{
|
|
@@ -15565,14 +18013,90 @@ const XplSelect = class {
|
|
|
15565
18013
|
}; }
|
|
15566
18014
|
};
|
|
15567
18015
|
|
|
15568
|
-
const
|
|
18016
|
+
const SideNav = class {
|
|
18017
|
+
constructor(hostRef) {
|
|
18018
|
+
index.registerInstance(this, hostRef);
|
|
18019
|
+
}
|
|
18020
|
+
render() {
|
|
18021
|
+
return (index.h(index.Host, { key: '4c498e4a5ab9c93d2ba984fd973af77c871cb916', class: {
|
|
18022
|
+
'xpl-side-nav': true,
|
|
18023
|
+
} }, index.h("div", { key: 'ef7455c11a5dd27c7a8317f4b441fc3d29eea341', class: "xpl-side-nav__wrapper" }, index.h("nav", { key: '11752dfaacd360fd1c6e20f253967236f1032d68', class: "xpl-side-nav__content", "aria-label": this.label }, index.h("div", { key: '1a94c00b7cc8297707a11aca19a816769e98dbfc', class: "xpl-side-nav__section" }, index.h("slot", { key: 'a3aaa6c108806c68bcb8af692ad6fd0edcae7870', name: "section" })), index.h("div", { key: 'b6454f9ba4f795666b33c7eea70f3514cdf168b3', class: "xpl-side-nav__footer" }, index.h("slot", { key: 'f00b452ff6c732d95fa58962800d2d1f606c4c17', name: "nav-footer" }))))));
|
|
18024
|
+
}
|
|
18025
|
+
};
|
|
18026
|
+
|
|
18027
|
+
const SideNavItem = class {
|
|
18028
|
+
constructor(hostRef) {
|
|
18029
|
+
index.registerInstance(this, hostRef);
|
|
18030
|
+
this.expandedChange = index.createEvent(this, "expandedChange", 7);
|
|
18031
|
+
this.navClick = index.createEvent(this, "navClick", 7);
|
|
18032
|
+
this.disabled = false;
|
|
18033
|
+
this.expanded = false;
|
|
18034
|
+
this.hasChildren = false;
|
|
18035
|
+
this.hidden = false;
|
|
18036
|
+
this.link = false;
|
|
18037
|
+
this.selected = false;
|
|
18038
|
+
this.handleClick = () => {
|
|
18039
|
+
if (this.disabled)
|
|
18040
|
+
return;
|
|
18041
|
+
if (this.hasChildren) {
|
|
18042
|
+
this.expanded = !this.expanded;
|
|
18043
|
+
this.expandedChange.emit(this.expanded);
|
|
18044
|
+
}
|
|
18045
|
+
else {
|
|
18046
|
+
this.navClick.emit();
|
|
18047
|
+
}
|
|
18048
|
+
};
|
|
18049
|
+
}
|
|
18050
|
+
syncLinkHasChildrenExclusivity() {
|
|
18051
|
+
this.enforceLinkExcludesHasChildren();
|
|
18052
|
+
}
|
|
18053
|
+
componentWillLoad() {
|
|
18054
|
+
this.syncLinkHasChildrenExclusivity();
|
|
18055
|
+
}
|
|
18056
|
+
componentWillRender() {
|
|
18057
|
+
this.syncLinkHasChildrenExclusivity();
|
|
18058
|
+
}
|
|
18059
|
+
enforceLinkExcludesHasChildren() {
|
|
18060
|
+
if (!this.link)
|
|
18061
|
+
return;
|
|
18062
|
+
if (this.hasChildren) {
|
|
18063
|
+
this.hasChildren = false;
|
|
18064
|
+
}
|
|
18065
|
+
if (this.el.hasAttribute('has-children')) {
|
|
18066
|
+
this.el.removeAttribute('has-children');
|
|
18067
|
+
}
|
|
18068
|
+
}
|
|
18069
|
+
render() {
|
|
18070
|
+
var _a;
|
|
18071
|
+
const linkClass = {
|
|
18072
|
+
'xpl-side-nav-item__link': true,
|
|
18073
|
+
expanded: this.expanded,
|
|
18074
|
+
selected: this.selected,
|
|
18075
|
+
};
|
|
18076
|
+
return (index.h(index.Host, { key: '10e32dc7b6e7e942ab11153a7311ee2401370a08', class: {
|
|
18077
|
+
'xpl-side-nav-item': true,
|
|
18078
|
+
'xpl-side-nav-item--link-disabled': this.link && this.disabled,
|
|
18079
|
+
} }, this.link ? (index.h("slot", null)) : (index.h("button", { type: "button", class: linkClass, "aria-current": this.selected ? 'page' : undefined, "aria-expanded": this.hasChildren ? (this.expanded ? 'true' : 'false') : undefined, onClick: this.handleClick, disabled: this.disabled }, this.hasChildren && (index.h("span", { class: `xpl-side-nav-item__arrow ${this.expanded ? 'expanded' : ''}` }, index.h("xpl-icon", { icon: "chevron-down", size: 16 }))), !this.hasChildren && (index.h("span", { class: "xpl-side-nav-item__icon" }, index.h("slot", { name: "icon" }, this.icon ? (index.h("xpl-icon", { icon: this.icon, size: 16 })) : null))), index.h("span", { class: "xpl-side-nav-item__label" }, (_a = this.label) !== null && _a !== void 0 ? _a : ''))), this.hasChildren && !this.link && (index.h("div", { key: '32d07c601edd88297854bf88749411276e8cb51b', class: `xpl-side-nav-item__children ${this.expanded ? 'expanded' : ''}`, inert: !this.expanded ? true : undefined }, index.h("div", { key: 'bbaac77c9c89e7b494cf7693185f0c358f6a7136', class: "xpl-side-nav-item__children-inner" }, index.h("slot", { key: '811067dca2ee2a73d896d1b45b899b9a8b27e7d6' }))))));
|
|
18080
|
+
}
|
|
18081
|
+
get el() { return index.getElement(this); }
|
|
18082
|
+
static get watchers() { return {
|
|
18083
|
+
"hasChildren": [{
|
|
18084
|
+
"syncLinkHasChildrenExclusivity": 0
|
|
18085
|
+
}],
|
|
18086
|
+
"link": [{
|
|
18087
|
+
"syncLinkHasChildrenExclusivity": 0
|
|
18088
|
+
}]
|
|
18089
|
+
}; }
|
|
18090
|
+
};
|
|
18091
|
+
|
|
18092
|
+
const Skeleton = class {
|
|
15569
18093
|
constructor(hostRef) {
|
|
15570
18094
|
index.registerInstance(this, hostRef);
|
|
15571
18095
|
this.shape = 'rectangle';
|
|
15572
18096
|
this.size = 'custom';
|
|
15573
18097
|
}
|
|
15574
18098
|
render() {
|
|
15575
|
-
return (index.h(index.Host, { key: '
|
|
18099
|
+
return (index.h(index.Host, { key: '86862cc926d5e915e303d274f0e837f364be6c08', class: {
|
|
15576
18100
|
'xpl-skeleton': true,
|
|
15577
18101
|
[`xpl-skeleton--shape-${this.shape}`]: true,
|
|
15578
18102
|
[`xpl-skeleton--size-${this.size}`]: true,
|
|
@@ -15586,7 +18110,7 @@ const XplSkeleton = class {
|
|
|
15586
18110
|
}
|
|
15587
18111
|
};
|
|
15588
18112
|
|
|
15589
|
-
const
|
|
18113
|
+
const Slideout = class {
|
|
15590
18114
|
constructor(hostRef) {
|
|
15591
18115
|
index.registerInstance(this, hostRef);
|
|
15592
18116
|
this.isOpenChange = index.createEvent(this, "isOpenChange", 7);
|
|
@@ -15615,7 +18139,7 @@ const XplSlideout = class {
|
|
|
15615
18139
|
this.handleScroll();
|
|
15616
18140
|
}
|
|
15617
18141
|
render() {
|
|
15618
|
-
return (index.h(index.Host, { key: '
|
|
18142
|
+
return (index.h(index.Host, { key: 'b2628014184ba329999545fe940adcb175b89dfd', class: "xpl-slideout" }, this.backdrop && this.isOpen && (index.h("xpl-backdrop", { key: '3f243b5af61aee13d375874ddb6a974608405e05', onClick: this.handleClose })), index.h("aside", { key: '781804a784efad6f6e9d9d0ee09dd46b99800707', class: `slideout slideout--${!this.isOpen && 'closed'}` }, index.h("header", { key: '35bf26acb7f45fc60d9447093d00c263c5c6a074', class: "header" }, index.h("div", { key: '939262fd0caf93059c022bc827cf1ebf31cf0505', class: "title" }, index.h("slot", { key: 'd0434f317394c1e6aca52de73cb1645605b70a2c', name: "title" }), index.h("xpl-button", { key: '091d2454db101c318a6c5b42a5650d698e318a46', class: "close-button", "icon-only": true, size: "sm", variant: "tertiary", onClick: this.handleClose }, index.h("xpl-icon", { key: '161a7bd05ce6864cd3b72a9a523c0f6e39d95cfb', icon: "x" }))), index.h("div", { key: '554153d17ba38df8b86534f4b59cb74c31553c0e', class: "subtitle" }, index.h("slot", { key: '649d87c4dea7e87c8c860d81b337c5c284d4aab1', name: "subtitle" })), index.h("div", { key: '2fe24ec6b15e48da8b61f0601342e52f83dd52d7', class: "search" }, index.h("slot", { key: '2ca9723ce317d1981485dcc923fff44c885eb814', name: "search" }))), index.h("xpl-divider", { key: 'c11b01177de43cafc6cf6f59c8807027dd202cfb', tier: 0, class: "divider top" }), index.h("article", { key: '12030211ebdfcc232e02e383d6ce9d64349882bc', class: "content", tabIndex: 0 }, index.h("slot", { key: 'b6af6c47722c8a1820ff94c052788b95736622b7', name: "content" })), this.showFooter && (index.h("footer", { key: '151c779df75a16947353701df695967686e9e07b' }, index.h("xpl-divider", { key: '773e0ce1051ac5a2f67864c5b4a6bd8120b3c270', tier: 0, class: "divider bottom" }), index.h("div", { key: 'e2ed12c38474a0102fdc24063bae95e4e36c43f7', class: "footer" }, index.h("slot", { key: '06f346214acfd3351adb9fca113466b1f95e5b9c', name: "tertiary" }), index.h("slot", { key: '1afb8a2250cd62a752a9bd60decade017a7ae58e', name: "secondary" }), index.h("slot", { key: '18f8b40b550b38eb44c765dd3cdbca44000032b8', name: "primary" })))))));
|
|
15619
18143
|
}
|
|
15620
18144
|
get el() { return index.getElement(this); }
|
|
15621
18145
|
static get watchers() { return {
|
|
@@ -15625,7 +18149,7 @@ const XplSlideout = class {
|
|
|
15625
18149
|
}; }
|
|
15626
18150
|
};
|
|
15627
18151
|
|
|
15628
|
-
const
|
|
18152
|
+
const Tab = class {
|
|
15629
18153
|
constructor(hostRef) {
|
|
15630
18154
|
index.registerInstance(this, hostRef);
|
|
15631
18155
|
this.tabChange = index.createEvent(this, "tabChange", 7);
|
|
@@ -15635,23 +18159,23 @@ const XplTab = class {
|
|
|
15635
18159
|
};
|
|
15636
18160
|
}
|
|
15637
18161
|
render() {
|
|
15638
|
-
return (index.h(index.Host, { key: '
|
|
18162
|
+
return (index.h(index.Host, { key: '1450ace89b692fe55c0d72baf719fc523b3f5cdd', class: {
|
|
15639
18163
|
'xpl-tab': true,
|
|
15640
18164
|
'xpl-tab--selected': this.selected,
|
|
15641
|
-
} }, index.h("button", { key: '
|
|
18165
|
+
} }, index.h("button", { key: '6bd68b6eb3cf05bbd21b17cbd6fba58ba2ca3a7c', onClick: this.handleTabClick, class: "xpl-tab__button", role: "tab", "aria-controls": this.target }, index.h("slot", { key: '5d54ca80925a7dd6ace6486e4dd6978d268ad584' }))));
|
|
15642
18166
|
}
|
|
15643
18167
|
};
|
|
15644
18168
|
|
|
15645
|
-
const
|
|
18169
|
+
const TabPanel = class {
|
|
15646
18170
|
constructor(hostRef) {
|
|
15647
18171
|
index.registerInstance(this, hostRef);
|
|
15648
18172
|
this.selected = false;
|
|
15649
18173
|
}
|
|
15650
18174
|
render() {
|
|
15651
|
-
return (index.h(index.Host, { key: '
|
|
18175
|
+
return (index.h(index.Host, { key: '7266510f84437902c1ecfdfe19abd6f1a9ac09e2', class: {
|
|
15652
18176
|
'xpl-tab-panel': true,
|
|
15653
18177
|
'xpl-tab-panel--selected': this.selected,
|
|
15654
|
-
}, role: "tabpanel", "aria-labelledby": this.target }, index.h("slot", { key: '
|
|
18178
|
+
}, role: "tabpanel", "aria-labelledby": this.target }, index.h("slot", { key: '7aa5c5633d7f06f521699f30539dcb505703db64' })));
|
|
15655
18179
|
}
|
|
15656
18180
|
};
|
|
15657
18181
|
|
|
@@ -15665,7 +18189,7 @@ const getIconType = (sortType) => {
|
|
|
15665
18189
|
return 'dash';
|
|
15666
18190
|
}
|
|
15667
18191
|
};
|
|
15668
|
-
const
|
|
18192
|
+
const Table = class {
|
|
15669
18193
|
constructor(hostRef) {
|
|
15670
18194
|
index.registerInstance(this, hostRef);
|
|
15671
18195
|
this.tableSelect = index.createEvent(this, "tableSelect", 7);
|
|
@@ -15791,14 +18315,14 @@ const XplTable = class {
|
|
|
15791
18315
|
(!this.sortTypeArray || this.sortTypeArray.length !== this.columns.length)) {
|
|
15792
18316
|
this.sortTypeArray = this.columns.map(() => null);
|
|
15793
18317
|
}
|
|
15794
|
-
return (index.h(index.Host, { key: '
|
|
18318
|
+
return (index.h(index.Host, { key: 'eb52da2b523707a53c0bb414dda75197907e71af' }, index.h("div", { key: '0f5bf430701ad905c4d918ee9039db52c19eb01c', class: "xpl-table-container", onScroll: this.onScroll, ref: (el) => {
|
|
15795
18319
|
this.container = el;
|
|
15796
|
-
} }, index.h("table", { key: '
|
|
18320
|
+
} }, index.h("table", { key: 'bdbb2c47a7bf119b46417118f334ba861960313d', class: {
|
|
15797
18321
|
'xpl-table': true,
|
|
15798
18322
|
'xpl-table--striped': this.striped,
|
|
15799
18323
|
'xpl-table--freeze': this.freeze,
|
|
15800
18324
|
'xpl-table--has-scrolled': this.hasScrolled,
|
|
15801
|
-
} }, this.columns && (index.h("thead", { key: '
|
|
18325
|
+
} }, this.columns && (index.h("thead", { key: 'a868be75efee1ec20d4845e8219a49ab1fae8aca' }, this.columns.map((column, i) => {
|
|
15802
18326
|
var _a;
|
|
15803
18327
|
const iconType = getIconType((_a = this.sortTypeArray) === null || _a === void 0 ? void 0 : _a[i]);
|
|
15804
18328
|
const isColumnSortable = !!(this.isSortable && this.sortableColumns[i]);
|
|
@@ -15807,11 +18331,11 @@ const XplTable = class {
|
|
|
15807
18331
|
e.stopPropagation();
|
|
15808
18332
|
this.selectAll(e);
|
|
15809
18333
|
}, type: "checkbox", value: `select-all-${this.selectAllValue}` })), column, isColumnSortable && !!this.sortTypeArray[i] && (index.h("xpl-icon", { icon: iconType, size: 16 })))));
|
|
15810
|
-
}))), index.h("tbody", { key: '
|
|
18334
|
+
}))), index.h("tbody", { key: '8324eda16235ba66f2aa3bebc073a10a91a32518' }, this.rowData.map((row, rowNum) => (index.h("tr", { class: this.selected && this.selected[rowNum]
|
|
15811
18335
|
? 'xpl-table-row-selected'
|
|
15812
18336
|
: '' }, row.map((cell, i) => (index.h("td", null, this.multiselect && i === 0 ? (index.h("label", { htmlFor: `__xpl-table-row-${rowNum}` }, index.h("input", { id: `__xpl-table-row-${rowNum}`, checked: !!this.selected[rowNum], type: "checkbox", onChange: (e) => this.selectOne(e, rowNum), value: this.selectedValues.length > 0
|
|
15813
18337
|
? this.selectedValues[rowNum]
|
|
15814
|
-
: `xpl-table-checkbox-${rowNum}` }), index.h("div", { innerHTML: cell }))) : (index.h("div", { innerHTML: cell }))))))))), ((_a = this.rowFooterData) === null || _a === void 0 ? void 0 : _a.length) > 0 && (index.h("tfoot", { key: '
|
|
18338
|
+
: `xpl-table-checkbox-${rowNum}` }), index.h("div", { innerHTML: cell }))) : (index.h("div", { innerHTML: cell }))))))))), ((_a = this.rowFooterData) === null || _a === void 0 ? void 0 : _a.length) > 0 && (index.h("tfoot", { key: 'd3c55c0585359a28a51a8b0196c4e9841bc86919' }, this.rowFooterData.map((row) => (index.h("tr", null, row.map((cell) => (index.h("td", null, index.h("div", { innerHTML: cell })))))))))))));
|
|
15815
18339
|
}
|
|
15816
18340
|
get el() { return index.getElement(this); }
|
|
15817
18341
|
static get watchers() { return {
|
|
@@ -15827,7 +18351,7 @@ const XplTable = class {
|
|
|
15827
18351
|
}; }
|
|
15828
18352
|
};
|
|
15829
18353
|
|
|
15830
|
-
const
|
|
18354
|
+
const Tabs = class {
|
|
15831
18355
|
constructor(hostRef) {
|
|
15832
18356
|
index.registerInstance(this, hostRef);
|
|
15833
18357
|
this.tabChange = index.createEvent(this, "tabChange", 7);
|
|
@@ -15924,10 +18448,10 @@ const XplTabs = class {
|
|
|
15924
18448
|
this.collectTabs();
|
|
15925
18449
|
}
|
|
15926
18450
|
render() {
|
|
15927
|
-
return (index.h(index.Host, { key: '
|
|
18451
|
+
return (index.h(index.Host, { key: '0f74359ee1e50de711500ed4d91a7f305a0c8b43', class: {
|
|
15928
18452
|
'xpl-tabs': true,
|
|
15929
18453
|
'xpl-tabs--full-width': this.fullWidth,
|
|
15930
|
-
} }, index.h("xpl-select", { key: '
|
|
18454
|
+
} }, index.h("xpl-select", { key: '9315829ad692ec8b80fe00f588974ed8f1b5dbc9', classNames: "xpl-tabs__mobile-select", choices: this.renderChoices(), selectedValues: this.selectedValue, onDropdownStateChange: (event) => {
|
|
15931
18455
|
if (event.detail) {
|
|
15932
18456
|
this.isMobileSelectChange = true;
|
|
15933
18457
|
}
|
|
@@ -15938,15 +18462,15 @@ const XplTabs = class {
|
|
|
15938
18462
|
this.tabChange.emit(selectedValue);
|
|
15939
18463
|
this.isMobileSelectChange = false;
|
|
15940
18464
|
}
|
|
15941
|
-
} }), index.h("nav", { key: '
|
|
18465
|
+
} }), index.h("nav", { key: '7abdf0d065f25c78b393ec9808fe7f44c84bfb27', class: "xpl-tabs__headings", role: "tablist", ref: (el) => {
|
|
15942
18466
|
this.headingsContainerRef = el;
|
|
15943
18467
|
}, onTabChange: (event) => {
|
|
15944
18468
|
this.isMobileSelectChange = false;
|
|
15945
18469
|
this.handleTabChange(event.detail);
|
|
15946
|
-
} }, index.h("div", { key: '
|
|
18470
|
+
} }, index.h("div", { key: 'de5157e6ce7914060f25e9b21bd8051a1437f92a', class: "xpl-tabs__active-bar", style: {
|
|
15947
18471
|
transform: `translateX(${this.activeBarPosition.left}px)`,
|
|
15948
18472
|
width: `${this.activeBarPosition.width}px`,
|
|
15949
|
-
} }), index.h("slot", { key: '
|
|
18473
|
+
} }), index.h("slot", { key: 'fc61c457e2a4eb10609b97e911b9ddbb2a64757f', name: "heading" })), index.h("div", { key: 'd6187a0de12b34f61ad10a602085d4525c2850ca', class: "xpl-tabs__panels" }, index.h("slot", { key: 'c5cf20e4677ee9f998c115d472cfc1cd5e5fa1fd', name: "panel" }))));
|
|
15950
18474
|
}
|
|
15951
18475
|
get el() { return index.getElement(this); }
|
|
15952
18476
|
static get watchers() { return {
|
|
@@ -15956,21 +18480,21 @@ const XplTabs = class {
|
|
|
15956
18480
|
}; }
|
|
15957
18481
|
};
|
|
15958
18482
|
|
|
15959
|
-
const
|
|
18483
|
+
const Tag = class {
|
|
15960
18484
|
constructor(hostRef) {
|
|
15961
18485
|
index.registerInstance(this, hostRef);
|
|
15962
18486
|
this.close = index.createEvent(this, "close", 7);
|
|
15963
18487
|
}
|
|
15964
18488
|
render() {
|
|
15965
|
-
return (index.h(index.Host, { key: '
|
|
18489
|
+
return (index.h(index.Host, { key: '6a2aaaef81c317bb30ebfc20266581205db73ce2', class: "xpl-tag-container" }, index.h("button", { key: '2aaae9dd6bbdb13db531cf249baa96bfa15aff55', class: "xpl-tag", onClick: () => {
|
|
15966
18490
|
this.close.emit();
|
|
15967
|
-
} }, index.h("slot", { key: '
|
|
18491
|
+
} }, index.h("slot", { key: 'cd56059cee54af39ce61e7560e00e013646c648f' })), index.h("button", { key: 'd529f61e40d097db2832e550e0f0b05c8ccc9179', class: "xpl-tag__close", onClick: () => {
|
|
15968
18492
|
this.close.emit();
|
|
15969
18493
|
} }, "\u00D7")));
|
|
15970
18494
|
}
|
|
15971
18495
|
};
|
|
15972
18496
|
|
|
15973
|
-
const
|
|
18497
|
+
const Toast = class {
|
|
15974
18498
|
constructor(hostRef) {
|
|
15975
18499
|
index.registerInstance(this, hostRef);
|
|
15976
18500
|
this.variant = 'neutral';
|
|
@@ -16007,27 +18531,27 @@ const XplToast = class {
|
|
|
16007
18531
|
}
|
|
16008
18532
|
render() {
|
|
16009
18533
|
var _a;
|
|
16010
|
-
return (index.h(index.Host, { key: '
|
|
18534
|
+
return (index.h(index.Host, { key: 'b8a25651f1dd57f9f574cd6401877295a6ca7101', class: `xpl-toast xpl-toast--${this.variant}`, onAnimationEnd: this.handleAnimationEnd }, index.h("div", { key: '20adfa314269787a9a03e793a1b74b9c5fb47585', class: "xpl-toast__left" }, this.showIcon && (index.h("div", { key: 'e3346cee07a34c61ed825966c59c9c8ac30f6302', class: `xpl-toast__icon xpl-toast__icon--${this.variant}` }, this.getIcon())), index.h("div", { key: 'e85cc1925897c34079e73a9d094c681c835548f4', class: "xpl-toast__notification" }, index.h("p", { key: '467fc15e4d26f240d735ddc957218bb7ab508dab', class: "xpl-toast__title" }, index.h("slot", { key: '3b339cd7b382043919139e83679e7033d63c3196', name: "title" })), this.caption !== '' && (index.h("p", { key: '675f42d92a7bd0527416e5eb77a56a7319d8f9a5', class: "xpl-toast__caption" }, (_a = this.caption) === null || _a === void 0 ? void 0 : _a.substring(0, 85))))), index.h("div", { key: '1904c868cba4f3178b0470b7381c23925a732a16', class: "xpl-toast__action", ref: (el) => {
|
|
16011
18535
|
this.actionSlot = el;
|
|
16012
|
-
} }, index.h("slot", { key: '
|
|
18536
|
+
} }, index.h("slot", { key: '33c8ef7761d07e4d38b2a2a73c058f6769bc7a44', name: "action" })), this.dismissable && (index.h("div", { key: '3d67f14c2704a6b054be63ad35a9bd3d5355b4ca', class: "xpl-toast__close" }, index.h("button", { key: '345b314745b40b2c802b0221ea64d90bd5c36b38', tabIndex: 0, onClick: this.dismiss }, index.h("xpl-icon", { key: '39634fb5cc157a05b05d2245d66fc23d96a1c790', icon: "x" }))))));
|
|
16013
18537
|
}
|
|
16014
18538
|
get el() { return index.getElement(this); }
|
|
16015
18539
|
};
|
|
16016
18540
|
|
|
16017
18541
|
const TooltipArrow = () => (index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "17", height: "14" }, index.h("g", { filter: "url(#a)" }, index.h("path", { d: "M0 5h15l-7.5 7.5L0 5Z" })), index.h("defs", null, index.h("filter", { id: "a", width: "20", height: "8.171", x: ".5", y: "5", "color-interpolation-filters": "sRGB", filterUnits: "userSpaceOnUse" }, index.h("feFlood", { "flood-opacity": "0", result: "BackgroundImageFix" }), index.h("feColorMatrix", { in: "SourceAlpha", result: "hardAlpha", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" }), index.h("feOffset", { dy: "1" }), index.h("feComposite", { in2: "hardAlpha", operator: "out" }), index.h("feColorMatrix", { values: "0 0 0 0 0.882353 0 0 0 0 0.886275 0 0 0 0 0.909804 0 0 0 1 0" }), index.h("feBlend", { in2: "BackgroundImageFix", result: "effect1_dropShadow_20073_3067" }), index.h("feBlend", { in: "SourceGraphic", in2: "effect1_dropShadow_20073_3067", result: "shape" })))));
|
|
16018
18542
|
|
|
16019
|
-
const
|
|
18543
|
+
const Tooltip = class {
|
|
16020
18544
|
constructor(hostRef) {
|
|
16021
18545
|
index.registerInstance(this, hostRef);
|
|
16022
18546
|
this.position = 'top-middle';
|
|
16023
18547
|
this.hideArrow = false;
|
|
16024
18548
|
}
|
|
16025
18549
|
render() {
|
|
16026
|
-
return (index.h(index.Host, { key: '
|
|
18550
|
+
return (index.h(index.Host, { key: '849e02776ea70de89a5bd3c133df6205ff3265b3' }, index.h("div", { key: '98947c9ece90e6ebcbf90c23cd2e1c0902ae59d5', class: "xpl-tooltip-container" }, index.h("slot", { key: 'a24df50f2081fcc4ef70c685933fab1420eb850a' }), index.h("div", { key: 'be1a1832cdf428f2d368258b3a784e7b27589a97', class: `xpl-tooltip xpl-tooltip--${this.position}` }, this.text), !this.hideArrow && (index.h("div", { key: '43241958db2b8fec0993040f7321bca7d5a163e6', class: "xpl-tooltip-arrow" }, index.h(TooltipArrow, { key: '34359c7bec6b7ee0616eac8961e9941b60c7d321' }))))));
|
|
16027
18551
|
}
|
|
16028
18552
|
};
|
|
16029
18553
|
|
|
16030
|
-
const
|
|
18554
|
+
const UtilityBar = class {
|
|
16031
18555
|
constructor(hostRef) {
|
|
16032
18556
|
index.registerInstance(this, hostRef);
|
|
16033
18557
|
this.navOpen = index.createEvent(this, "navOpen", 7);
|
|
@@ -16041,48 +18565,54 @@ const XplUtilityBar = class {
|
|
|
16041
18565
|
this.open = this.isNavOpenAtStartup !== undefined ? this.isNavOpenAtStartup : this.open;
|
|
16042
18566
|
}
|
|
16043
18567
|
render() {
|
|
16044
|
-
return (index.h(index.Host, { key: '
|
|
16045
|
-
}
|
|
16046
|
-
};
|
|
16047
|
-
|
|
16048
|
-
exports.xpl_avatar =
|
|
16049
|
-
exports.xpl_backdrop =
|
|
16050
|
-
exports.xpl_badge =
|
|
16051
|
-
exports.
|
|
16052
|
-
exports.
|
|
16053
|
-
exports.
|
|
16054
|
-
exports.
|
|
16055
|
-
exports.
|
|
16056
|
-
exports.
|
|
16057
|
-
exports.
|
|
16058
|
-
exports.
|
|
16059
|
-
exports.
|
|
16060
|
-
exports.
|
|
16061
|
-
exports.
|
|
16062
|
-
exports.
|
|
16063
|
-
exports.
|
|
16064
|
-
exports.
|
|
16065
|
-
exports.
|
|
16066
|
-
exports.
|
|
16067
|
-
exports.
|
|
16068
|
-
exports.
|
|
16069
|
-
exports.
|
|
16070
|
-
exports.
|
|
16071
|
-
exports.
|
|
16072
|
-
exports.
|
|
16073
|
-
exports.
|
|
16074
|
-
exports.
|
|
16075
|
-
exports.
|
|
16076
|
-
exports.
|
|
16077
|
-
exports.
|
|
16078
|
-
exports.
|
|
16079
|
-
exports.
|
|
16080
|
-
exports.
|
|
16081
|
-
exports.
|
|
16082
|
-
exports.
|
|
16083
|
-
exports.
|
|
16084
|
-
exports.
|
|
16085
|
-
exports.
|
|
16086
|
-
exports.
|
|
16087
|
-
exports.
|
|
16088
|
-
exports.
|
|
18568
|
+
return (index.h(index.Host, { key: 'b32ed07473f48009a3a6e76ba1a51fe156b19f1c' }, index.h("nav", { key: '7a98d494b15c5af7e8e0089ab64806c04d394381', "aria-label": "utility navigation bar", class: "xpl-utility-bar" }, this.navControl ? (index.h("div", null, index.h("button", { class: "xpl-utility-bar__nav-control", onClick: () => this.onNavToggle() }, index.h("xpl-icon", { class: "xpl-utility-nav__bars", icon: "three-bars" })), index.h("slot", { name: "aside" }))) : (index.h("slot", { name: "aside" })), index.h("slot", { key: 'd5f62631648bcd858b26a6500e2506e6f40d5c99', name: "main" }))));
|
|
18569
|
+
}
|
|
18570
|
+
};
|
|
18571
|
+
|
|
18572
|
+
exports.xpl_avatar = Avatar;
|
|
18573
|
+
exports.xpl_backdrop = Backdrop;
|
|
18574
|
+
exports.xpl_badge = Badge;
|
|
18575
|
+
exports.xpl_banner = Banner;
|
|
18576
|
+
exports.xpl_breadcrumb_item = BreadcrumbItem;
|
|
18577
|
+
exports.xpl_breadcrumbs = Breadcrumbs;
|
|
18578
|
+
exports.xpl_button = Button;
|
|
18579
|
+
exports.xpl_checkbox = Checkbox;
|
|
18580
|
+
exports.xpl_choicelist = Choicelist;
|
|
18581
|
+
exports.xpl_content_area = ContentArea;
|
|
18582
|
+
exports.xpl_dashboard = Dashboard;
|
|
18583
|
+
exports.xpl_data_card = DataCard;
|
|
18584
|
+
exports.xpl_divider = Divider;
|
|
18585
|
+
exports.xpl_dropdown = Dropdown;
|
|
18586
|
+
exports.xpl_dropdown_group = DropdownGroup;
|
|
18587
|
+
exports.xpl_dropdown_heading = DropdownHeading;
|
|
18588
|
+
exports.xpl_dropdown_option = DropdownOptionCpnt;
|
|
18589
|
+
exports.xpl_header_accordion = HeaderAccordion;
|
|
18590
|
+
exports.xpl_icon = Icon;
|
|
18591
|
+
exports.xpl_input = Input;
|
|
18592
|
+
exports.xpl_input_color = InputColor;
|
|
18593
|
+
exports.xpl_input_date = InputDate;
|
|
18594
|
+
exports.xpl_input_file = InputFile;
|
|
18595
|
+
exports.xpl_input_phone = InputPhone;
|
|
18596
|
+
exports.xpl_input_time = InputTime;
|
|
18597
|
+
exports.xpl_modal = Modal;
|
|
18598
|
+
exports.xpl_nav_item = NavItem;
|
|
18599
|
+
exports.xpl_pagination = Pagination;
|
|
18600
|
+
exports.xpl_panel = XplPanel;
|
|
18601
|
+
exports.xpl_popover = Popover;
|
|
18602
|
+
exports.xpl_progress = Progress;
|
|
18603
|
+
exports.xpl_progress_bar = ProgressBar;
|
|
18604
|
+
exports.xpl_radio = Radio;
|
|
18605
|
+
exports.xpl_secondary_nav = SecondaryNav;
|
|
18606
|
+
exports.xpl_select = Select;
|
|
18607
|
+
exports.xpl_side_nav = SideNav;
|
|
18608
|
+
exports.xpl_side_nav_item = SideNavItem;
|
|
18609
|
+
exports.xpl_skeleton = Skeleton;
|
|
18610
|
+
exports.xpl_slideout = Slideout;
|
|
18611
|
+
exports.xpl_tab = Tab;
|
|
18612
|
+
exports.xpl_tab_panel = TabPanel;
|
|
18613
|
+
exports.xpl_table = Table;
|
|
18614
|
+
exports.xpl_tabs = Tabs;
|
|
18615
|
+
exports.xpl_tag = Tag;
|
|
18616
|
+
exports.xpl_toast = Toast;
|
|
18617
|
+
exports.xpl_tooltip = Tooltip;
|
|
18618
|
+
exports.xpl_utility_bar = UtilityBar;
|