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