@xplortech/apollo-core 2.6.0 → 2.7.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 +737 -63
- package/build/style.css +5415 -1805
- package/dist/apollo-core/apollo-core.css +62 -22
- package/dist/apollo-core/apollo-core.esm.js +1 -1
- package/dist/apollo-core/{p-8a1affce.entry.js → p-084d26ed.entry.js} +1 -1
- package/dist/apollo-core/p-146d5d55.entry.js +1 -0
- package/dist/apollo-core/p-16742606.entry.js +1 -0
- package/dist/apollo-core/{p-42016063.entry.js → p-28d12fd3.entry.js} +1 -1
- package/dist/apollo-core/p-3eb5eb7c.entry.js +1 -0
- package/dist/apollo-core/p-4882f0bd.entry.js +1 -0
- package/dist/apollo-core/p-64b34268.entry.js +1 -0
- package/dist/apollo-core/p-6c956d4e.entry.js +1 -0
- package/dist/apollo-core/p-71b75f36.entry.js +1 -0
- package/dist/apollo-core/{p-02167464.entry.js → p-7eb86c63.entry.js} +1 -1
- package/dist/apollo-core/{p-1fd3dc87.entry.js → p-84254a24.entry.js} +1 -1
- package/dist/apollo-core/p-9f2a0321.entry.js +1 -0
- package/dist/apollo-core/{p-C_Z2nG0p.js → p-C7bgJs6C.js} +2 -2
- package/dist/apollo-core/p-cde83ab0.entry.js +1 -0
- package/dist/apollo-core/p-e7363036.entry.js +1 -0
- package/dist/cjs/apollo-core.cjs.js +3 -3
- package/dist/cjs/{index-DH6pgWru.js → index-BQ97-AWw.js} +18 -15
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/xpl-accordion.cjs.entry.js +3 -3
- package/dist/cjs/xpl-application-shell.cjs.entry.js +2 -2
- package/dist/cjs/{xpl-avatar_47.cjs.entry.js → xpl-avatar_61.cjs.entry.js} +6096 -1461
- package/dist/cjs/xpl-button-row.cjs.entry.js +2 -2
- package/dist/cjs/xpl-calendar.cjs.entry.js +2 -2
- package/dist/cjs/xpl-dynamic-table-cell.cjs.entry.js +3 -3
- package/dist/cjs/xpl-dynamic-table-row.cjs.entry.js +3 -3
- package/dist/cjs/xpl-dynamic-table.cjs.entry.js +2 -2
- package/dist/cjs/xpl-grid-item.cjs.entry.js +2 -2
- package/dist/cjs/xpl-grid.cjs.entry.js +2 -2
- package/dist/cjs/xpl-large-card.cjs.entry.js +2 -2
- package/dist/cjs/xpl-main-nav.cjs.entry.js +2 -2
- package/dist/cjs/xpl-toggle.cjs.entry.js +4 -4
- package/dist/cjs/xpl-toolbar.cjs.entry.js +3 -3
- package/dist/collection/collection-manifest.json +18 -7
- package/dist/collection/components/xpl-accordion/xpl-accordion.js +2 -2
- package/dist/collection/components/xpl-application-shell/xpl-application-shell.js +1 -1
- package/dist/collection/components/xpl-avatar/avatar.stories.js +122 -107
- package/dist/collection/components/xpl-avatar/xpl-avatar.js +249 -15
- package/dist/collection/components/xpl-backdrop/xpl-backdrop.js +1 -1
- package/dist/collection/components/xpl-badge/badge.stories.js +1 -33
- package/dist/collection/components/xpl-badge/xpl-badge.js +1 -1
- package/dist/collection/components/xpl-banner/xpl-banner.js +4 -3
- package/dist/collection/components/xpl-breadcrumbs/xpl-breadcrumb-item/xpl-breadcrumb-item.js +1 -1
- package/dist/collection/components/xpl-breadcrumbs/xpl-breadcrumbs/xpl-breadcrumbs.js +1 -1
- package/dist/collection/components/xpl-button/xpl-button.js +21 -3
- package/dist/collection/components/xpl-button-row/xpl-button-row.js +1 -1
- package/dist/collection/components/xpl-calendar/xpl-calendar.js +1 -1
- package/dist/collection/components/xpl-checkbox/xpl-checkbox.js +47 -25
- package/dist/collection/components/xpl-choicelist/xpl-choicelist.js +1 -1
- package/dist/collection/components/xpl-content-area/xpl-content-area.js +1 -1
- package/dist/collection/components/xpl-dashboard/xpl-dashboard.js +1 -1
- package/dist/collection/components/xpl-data-card/xpl-data-card.js +2 -2
- package/dist/collection/components/xpl-divider/xpl-divider.js +1 -1
- package/dist/collection/components/xpl-dropdown/xpl-dropdown-group/xpl-dropdown-group.js +1 -1
- package/dist/collection/components/xpl-dropdown/xpl-dropdown-heading/xpl-dropdown-heading.js +1 -1
- package/dist/collection/components/xpl-dropdown/xpl-dropdown-option/xpl-dropdown-option.js +2 -2
- package/dist/collection/components/xpl-dropdown/xpl-dropdown.js +2 -2
- package/dist/collection/components/xpl-dynamic-table/xpl-dynamic-table.js +1 -1
- package/dist/collection/components/xpl-dynamic-table-cell/xpl-dynamic-table-cell.js +2 -2
- package/dist/collection/components/xpl-dynamic-table-row/xpl-dynamic-table-row.js +2 -2
- package/dist/collection/components/xpl-grid/xpl-grid.js +1 -1
- package/dist/collection/components/xpl-grid-item/xpl-grid-item.js +1 -1
- package/dist/collection/components/xpl-header-accordion/xpl-header-accordion.js +46 -53
- package/dist/collection/components/xpl-icon/xpl-icon.js +2 -2
- package/dist/collection/components/xpl-input/input.stories.js +96 -1
- package/dist/collection/components/xpl-input/xpl-input-color/xpl-input-color.js +8 -8
- package/dist/collection/components/xpl-input/xpl-input-date/xpl-input-date.js +3 -3
- package/dist/collection/components/xpl-input/xpl-input-file/xpl-input-file.js +4 -4
- package/dist/collection/components/xpl-input/xpl-input-phone/xpl-input-phone.js +5 -5
- package/dist/collection/components/xpl-input/xpl-input-search/xpl-input-search.js +485 -0
- package/dist/collection/components/xpl-input/xpl-input-time/xpl-input-time.js +2 -2
- package/dist/collection/components/xpl-input/xpl-input.js +130 -18
- package/dist/collection/components/xpl-large-card/xpl-large-card.js +1 -1
- package/dist/collection/components/xpl-list/list.stories.js +300 -63
- package/dist/collection/components/xpl-list/xpl-list-item/xpl-list-item.js +818 -0
- package/dist/collection/components/xpl-list/xpl-list.js +579 -21
- package/dist/collection/components/xpl-main-nav/xpl-main-nav.js +1 -1
- package/dist/collection/components/xpl-modal/xpl-modal.js +1 -1
- package/dist/collection/components/xpl-nav-item/xpl-nav-item.js +2 -2
- package/dist/collection/components/xpl-pagination/xpl-pagination.js +3 -3
- package/dist/collection/components/xpl-panel/panel.stories.js +5 -3
- package/dist/collection/components/xpl-panel/xpl-panel.js +3 -3
- package/dist/collection/components/xpl-popover/xpl-popover.js +4 -4
- package/dist/collection/components/xpl-progress-bar/xpl-progress-bar.js +2 -2
- package/dist/collection/components/xpl-progress-indicator/progress-indicator.stories.js +118 -0
- package/dist/collection/components/xpl-progress-indicator/xpl-progress-indicator.js +171 -0
- package/dist/collection/components/xpl-radio/xpl-radio.js +3 -3
- package/dist/collection/components/xpl-secondary-nav/xpl-secondary-nav.js +1 -1
- package/dist/collection/components/xpl-select/xpl-select.js +6 -6
- package/dist/collection/components/xpl-side-nav/xpl-side-nav-item/xpl-side-nav-item.js +2 -2
- package/dist/collection/components/xpl-side-nav/xpl-side-nav.js +2 -2
- package/dist/collection/components/xpl-skeleton/xpl-skeleton.js +1 -1
- package/dist/collection/components/xpl-slideout/xpl-slideout.js +1 -1
- package/dist/collection/components/xpl-spotlight/spotlight.stories.js +385 -0
- package/dist/collection/components/xpl-spotlight/xpl-spotlight.js +1085 -0
- package/dist/collection/components/xpl-tab/xpl-tab.js +261 -8
- package/dist/collection/components/xpl-tab-panel/xpl-tab-panel.js +22 -15
- package/dist/collection/components/xpl-table/table.stories.js +319 -67
- package/dist/collection/components/xpl-table/utils/move-row-dom.js +50 -0
- package/dist/collection/components/xpl-table/utils/table-internal.js +58 -0
- package/dist/collection/components/xpl-table/xpl-table-body/xpl-table-body.js +7 -0
- package/dist/collection/components/xpl-table/xpl-table-cell/xpl-table-cell.js +155 -0
- package/dist/collection/components/xpl-table/xpl-table-footer/xpl-table-footer.js +7 -0
- package/dist/collection/components/xpl-table/xpl-table-footer-cell/xpl-table-footer-cell.js +37 -0
- package/dist/collection/components/xpl-table/xpl-table-header/table-header.stories.js +131 -0
- package/dist/collection/components/xpl-table/xpl-table-header/xpl-table-header.js +7 -0
- package/dist/collection/components/xpl-table/xpl-table-header-cell/table-header-cell.stories.js +105 -0
- package/dist/collection/components/xpl-table/xpl-table-header-cell/xpl-table-header-cell.js +402 -0
- package/dist/collection/components/xpl-table/xpl-table-row/xpl-table-row.js +121 -0
- package/dist/collection/components/xpl-table/xpl-table.js +1448 -143
- package/dist/collection/components/xpl-tabs/segment-control.stories.js +31 -0
- package/dist/collection/components/xpl-tabs/tabs.shared.js +156 -0
- package/dist/collection/components/xpl-tabs/tabs.stories.js +10 -60
- package/dist/collection/components/xpl-tabs/xpl-tabs.js +338 -62
- package/dist/collection/components/xpl-tag/tag.stories.js +153 -0
- package/dist/collection/components/xpl-tag/xpl-tag.js +312 -9
- package/dist/collection/components/xpl-toast/xpl-toast.js +2 -2
- package/dist/collection/components/xpl-toggle/xpl-toggle.js +3 -3
- package/dist/collection/components/xpl-toolbar/xpl-toolbar.js +2 -2
- package/dist/collection/components/xpl-tooltip/xpl-tooltip.js +1 -1
- package/dist/collection/components/xpl-top-nav/top-nav.stories.js +625 -0
- package/dist/collection/components/xpl-top-nav/xpl-nav-header-menu/xpl-nav-header-menu.js +122 -0
- package/dist/collection/components/xpl-top-nav/xpl-top-nav-item/xpl-top-nav-item.js +481 -0
- package/dist/collection/components/xpl-top-nav/xpl-top-nav.js +433 -0
- package/dist/collection/components/xpl-utility-bar/xpl-utility-bar.js +1 -1
- package/dist/collection/utils/lifecycle.js +79 -0
- package/dist/collection/utils/tab-a11y-ids.js +22 -0
- package/dist/components/floating-ui.dom.js +1 -0
- package/dist/components/index.js +1 -1
- package/dist/components/lifecycle.js +1 -0
- package/dist/components/tab-a11y-ids.js +1 -0
- package/dist/components/xpl-accordion.js +1 -1
- package/dist/components/xpl-application-shell.js +1 -1
- package/dist/components/xpl-avatar2.js +1 -1
- package/dist/components/xpl-backdrop2.js +1 -1
- package/dist/components/xpl-badge2.js +1 -1
- package/dist/components/xpl-banner.js +1 -1
- package/dist/components/xpl-breadcrumb-item.js +1 -1
- package/dist/components/xpl-breadcrumbs.js +1 -1
- package/dist/components/xpl-button-row.js +1 -1
- package/dist/components/xpl-button2.js +1 -1
- package/dist/components/xpl-calendar.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-divider2.js +1 -1
- package/dist/components/xpl-dropdown-group2.js +1 -1
- package/dist/components/xpl-dropdown-heading2.js +1 -1
- package/dist/components/xpl-dropdown-option2.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-icon2.js +1 -1
- package/dist/components/xpl-input-date2.js +1 -1
- package/dist/components/xpl-input-file2.js +1 -1
- package/dist/components/xpl-input-search.d.ts +11 -0
- package/dist/components/xpl-input-search.js +1 -0
- package/dist/components/xpl-input-search2.js +1 -0
- package/dist/components/xpl-input2.js +1 -1
- package/dist/components/xpl-large-card.js +1 -1
- package/dist/components/{xpl-progress.d.ts → xpl-list-item.d.ts} +4 -4
- package/dist/components/xpl-list-item.js +1 -0
- package/dist/components/xpl-list-item2.js +1 -0
- package/dist/components/xpl-list.js +1 -1
- package/dist/components/xpl-main-nav.js +1 -1
- package/dist/components/xpl-modal.js +1 -1
- package/dist/components/xpl-nav-header-menu.d.ts +11 -0
- package/dist/components/xpl-nav-header-menu.js +1 -0
- package/dist/components/xpl-nav-item.js +1 -1
- package/dist/components/xpl-pagination.js +1 -1
- package/dist/components/xpl-panel.js +1 -1
- package/dist/components/xpl-popover2.js +1 -1
- package/dist/components/xpl-progress-bar.js +1 -1
- package/dist/components/xpl-progress-indicator.d.ts +11 -0
- package/dist/components/xpl-progress-indicator.js +1 -0
- package/dist/components/xpl-radio2.js +1 -1
- package/dist/components/xpl-secondary-nav.js +1 -1
- package/dist/components/xpl-select2.js +1 -1
- package/dist/components/xpl-side-nav-item.js +1 -1
- package/dist/components/xpl-side-nav.js +1 -1
- package/dist/components/xpl-skeleton.js +1 -1
- package/dist/components/xpl-slideout.js +1 -1
- package/dist/components/xpl-spotlight.d.ts +11 -0
- package/dist/components/xpl-spotlight.js +1 -0
- package/dist/components/xpl-tab-panel.js +1 -1
- package/dist/components/xpl-tab.js +1 -1
- package/dist/components/xpl-table-body.d.ts +11 -0
- package/dist/components/xpl-table-body.js +1 -0
- package/dist/components/xpl-table-cell.d.ts +11 -0
- package/dist/components/xpl-table-cell.js +1 -0
- package/dist/components/xpl-table-cell2.js +1 -0
- package/dist/components/xpl-table-footer-cell.d.ts +11 -0
- package/dist/components/xpl-table-footer-cell.js +1 -0
- package/dist/components/xpl-table-footer-cell2.js +1 -0
- package/dist/components/xpl-table-footer.d.ts +11 -0
- package/dist/components/xpl-table-footer.js +1 -0
- package/dist/components/xpl-table-header-cell.js +1 -1
- package/dist/components/xpl-table-header-cell2.js +1 -0
- package/dist/components/xpl-table-header.js +1 -1
- package/dist/components/xpl-table-row.d.ts +11 -0
- package/dist/components/xpl-table-row.js +1 -0
- package/dist/components/xpl-table.js +1 -1
- package/dist/components/xpl-tabs.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-tooltip2.js +1 -1
- package/dist/components/xpl-top-nav-item.d.ts +11 -0
- package/dist/components/xpl-top-nav-item.js +1 -0
- package/dist/components/xpl-top-nav-item2.js +1 -0
- package/dist/components/xpl-top-nav.d.ts +11 -0
- package/dist/components/xpl-top-nav.js +1 -0
- package/dist/components/xpl-utility-bar.js +1 -1
- package/dist/docs/xpl-avatar/readme.md +289 -15
- package/dist/docs/xpl-badge/readme.md +14 -9
- package/dist/docs/xpl-banner/readme.md +48 -11
- package/dist/docs/xpl-button/readme.md +28 -18
- package/dist/docs/xpl-calendar/readme.md +1 -1
- package/dist/docs/xpl-checkbox/readme.md +19 -16
- package/dist/docs/xpl-divider/readme.md +6 -4
- package/dist/docs/xpl-dropdown/readme.md +1 -1
- package/dist/docs/xpl-dynamic-table/readme.md +22 -19
- package/dist/docs/xpl-dynamic-table-cell/readme.md +20 -18
- package/dist/docs/xpl-dynamic-table-row/readme.md +21 -19
- package/dist/docs/xpl-icon/readme.md +15 -3
- package/dist/docs/xpl-input/readme.md +66 -41
- package/dist/docs/xpl-input/xpl-input-color/readme.md +1 -0
- package/dist/docs/xpl-input/xpl-input-phone/readme.md +1 -0
- package/dist/docs/xpl-input/xpl-input-search/readme.md +175 -0
- package/dist/docs/xpl-input/xpl-input-time/readme.md +1 -0
- package/dist/docs/xpl-list/readme.md +320 -10
- package/dist/docs/xpl-list/xpl-list-item/readme.md +99 -0
- package/dist/docs/xpl-pagination/readme.md +1 -0
- package/dist/docs/xpl-panel/readme.md +108 -17
- package/dist/docs/xpl-popover/readme.md +2 -0
- package/dist/docs/xpl-progress-indicator/readme.md +234 -0
- package/dist/docs/xpl-radio/readme.md +6 -4
- package/dist/docs/xpl-select/readme.md +2 -1
- package/dist/docs/xpl-side-nav/readme.md +2 -2
- package/dist/docs/xpl-slideout/readme.md +1 -1
- package/dist/docs/xpl-spotlight/readme.md +235 -0
- package/dist/docs/xpl-tab/readme.md +43 -7
- package/dist/docs/xpl-tab-panel/readme.md +42 -0
- package/dist/docs/xpl-table/readme.md +110 -46
- package/dist/docs/xpl-table/xpl-table-body/readme.md +10 -0
- package/dist/docs/xpl-table/xpl-table-cell/readme.md +33 -0
- package/dist/docs/xpl-table/xpl-table-footer/readme.md +10 -0
- package/dist/docs/xpl-table/xpl-table-footer-cell/readme.md +30 -0
- package/dist/docs/{xpl-table-header → xpl-table/xpl-table-header}/readme.md +13 -13
- package/dist/docs/xpl-table/xpl-table-header-cell/readme.md +66 -0
- package/dist/docs/xpl-table/xpl-table-row/readme.md +19 -0
- package/dist/docs/xpl-tabs/readme.md +62 -8
- package/dist/docs/xpl-tag/readme.md +379 -4
- package/dist/docs/xpl-toast/readme.md +1 -1
- package/dist/docs/xpl-top-nav/readme.md +179 -0
- package/dist/docs/xpl-top-nav/xpl-nav-header-menu/readme.md +81 -0
- package/dist/docs/xpl-top-nav/xpl-top-nav-item/readme.md +87 -0
- package/dist/esm/apollo-core.js +4 -4
- package/dist/esm/{index-C_Z2nG0p.js → index-C7bgJs6C.js} +18 -16
- package/dist/esm/loader.js +3 -3
- package/dist/esm/xpl-accordion.entry.js +3 -3
- package/dist/esm/xpl-application-shell.entry.js +2 -2
- package/dist/esm/{xpl-avatar_47.entry.js → xpl-avatar_61.entry.js} +6082 -1461
- package/dist/esm/xpl-button-row.entry.js +2 -2
- package/dist/esm/xpl-calendar.entry.js +2 -2
- package/dist/esm/xpl-dynamic-table-cell.entry.js +3 -3
- package/dist/esm/xpl-dynamic-table-row.entry.js +3 -3
- package/dist/esm/xpl-dynamic-table.entry.js +2 -2
- package/dist/esm/xpl-grid-item.entry.js +2 -2
- package/dist/esm/xpl-grid.entry.js +2 -2
- package/dist/esm/xpl-large-card.entry.js +2 -2
- package/dist/esm/xpl-main-nav.entry.js +2 -2
- package/dist/esm/xpl-toggle.entry.js +4 -4
- package/dist/esm/xpl-toolbar.entry.js +3 -3
- package/dist/types/components/xpl-avatar/avatar.stories.d.ts +88 -29
- package/dist/types/components/xpl-avatar/xpl-avatar.d.ts +29 -2
- package/dist/types/components/xpl-badge/badge.stories.d.ts +0 -19
- package/dist/types/components/xpl-button/xpl-button.d.ts +7 -0
- package/dist/types/components/xpl-checkbox/xpl-checkbox.d.ts +4 -3
- package/dist/types/components/xpl-header-accordion/xpl-header-accordion.d.ts +9 -10
- package/dist/types/components/xpl-input/input.stories.d.ts +1 -0
- package/dist/types/components/xpl-input/xpl-input-search/xpl-input-search.d.ts +39 -0
- package/dist/types/components/xpl-input/xpl-input.d.ts +13 -5
- package/dist/types/components/xpl-list/list.stories.d.ts +299 -13
- package/dist/types/components/xpl-list/listitem.d.ts +13 -0
- package/dist/types/components/xpl-list/xpl-list-item/xpl-list-item.d.ts +71 -0
- package/dist/types/components/xpl-list/xpl-list.d.ts +55 -2
- package/dist/types/components/xpl-panel/panel.stories.d.ts +2 -0
- package/dist/types/components/xpl-progress-indicator/progress-indicator.stories.d.ts +62 -0
- package/dist/types/components/xpl-progress-indicator/xpl-progress-indicator.d.ts +11 -0
- package/dist/types/components/xpl-spotlight/spotlight.stories.d.ts +197 -0
- package/dist/types/components/xpl-spotlight/xpl-spotlight.d.ts +101 -0
- package/dist/types/components/xpl-tab/xpl-tab.d.ts +14 -1
- package/dist/types/components/xpl-tab-panel/xpl-tab-panel.d.ts +2 -1
- package/dist/types/components/xpl-table/table.stories.d.ts +161 -19
- package/dist/types/components/xpl-table/utils/move-row-dom.d.ts +3 -0
- package/dist/types/components/xpl-table/utils/table-internal.d.ts +8 -0
- package/dist/types/components/xpl-table/xpl-table-body/xpl-table-body.d.ts +3 -0
- package/dist/types/components/xpl-table/xpl-table-cell/xpl-table-cell.d.ts +11 -0
- package/dist/types/components/xpl-table/xpl-table-footer/xpl-table-footer.d.ts +3 -0
- package/dist/types/components/xpl-table/xpl-table-footer-cell/xpl-table-footer-cell.d.ts +4 -0
- package/dist/types/components/{xpl-table-header → xpl-table/xpl-table-header}/table-header.stories.d.ts +13 -16
- package/dist/types/components/{xpl-table-header-cell → xpl-table/xpl-table-header-cell}/table-header-cell.stories.d.ts +24 -20
- package/dist/types/components/xpl-table/xpl-table-header-cell/xpl-table-header-cell.d.ts +32 -0
- package/dist/types/components/xpl-table/xpl-table-row/xpl-table-row.d.ts +13 -0
- package/dist/types/components/xpl-table/xpl-table.d.ts +123 -21
- package/dist/types/components/xpl-tabs/segment-control.stories.d.ts +112 -0
- package/dist/types/components/xpl-tabs/tabs.shared.d.ts +156 -0
- package/dist/types/components/xpl-tabs/tabs.stories.d.ts +65 -12
- package/dist/types/components/xpl-tabs/xpl-tabs.d.ts +37 -18
- package/dist/types/components/xpl-tag/tag.stories.d.ts +65 -0
- package/dist/types/components/xpl-tag/xpl-tag.d.ts +36 -1
- package/dist/types/components/xpl-top-nav/top-nav.stories.d.ts +471 -0
- package/dist/types/components/xpl-top-nav/xpl-nav-header-menu/xpl-nav-header-menu.d.ts +18 -0
- package/dist/types/components/xpl-top-nav/xpl-top-nav-item/xpl-top-nav-item.d.ts +48 -0
- package/dist/types/components/xpl-top-nav/xpl-top-nav.d.ts +51 -0
- package/dist/types/components.d.ts +1888 -148
- package/dist/types/utils/lifecycle.d.ts +16 -0
- package/dist/types/utils/tab-a11y-ids.d.ts +4 -0
- package/package.json +3 -3
- package/dist/apollo-core/p-0bce3874.entry.js +0 -1
- package/dist/apollo-core/p-5549756c.entry.js +0 -1
- package/dist/apollo-core/p-56fa4941.entry.js +0 -1
- package/dist/apollo-core/p-76c324da.entry.js +0 -1
- package/dist/apollo-core/p-7a3224b4.entry.js +0 -1
- package/dist/apollo-core/p-7e924697.entry.js +0 -1
- package/dist/apollo-core/p-9efca9e1.entry.js +0 -1
- package/dist/apollo-core/p-b252b380.entry.js +0 -1
- package/dist/apollo-core/p-c91daac1.entry.js +0 -1
- package/dist/apollo-core/p-d9b62508.entry.js +0 -1
- package/dist/apollo-core/p-eaea16d1.entry.js +0 -1
- package/dist/apollo-core/p-eed13bca.entry.js +0 -1
- package/dist/apollo-core/p-f5af9539.entry.js +0 -1
- package/dist/cjs/xpl-list.cjs.entry.js +0 -32
- package/dist/cjs/xpl-table-header-cell.cjs.entry.js +0 -57
- package/dist/cjs/xpl-table-header.cjs.entry.js +0 -14
- package/dist/collection/components/xpl-progress/progress.stories.js +0 -106
- package/dist/collection/components/xpl-progress/xpl-progress.js +0 -60
- package/dist/collection/components/xpl-table-header/table-header.stories.js +0 -126
- package/dist/collection/components/xpl-table-header/xpl-table-header.js +0 -7
- package/dist/collection/components/xpl-table-header-cell/table-header-cell.stories.js +0 -75
- package/dist/collection/components/xpl-table-header-cell/xpl-table-header-cell.js +0 -188
- package/dist/components/xpl-progress.js +0 -1
- package/dist/docs/xpl-progress/readme.md +0 -22
- package/dist/docs/xpl-table-header-cell/readme.md +0 -47
- package/dist/esm/xpl-list.entry.js +0 -30
- package/dist/esm/xpl-table-header-cell.entry.js +0 -55
- package/dist/esm/xpl-table-header.entry.js +0 -12
- package/dist/types/components/xpl-progress/progress.stories.d.ts +0 -38
- package/dist/types/components/xpl-progress/xpl-progress.d.ts +0 -6
- package/dist/types/components/xpl-table-header-cell/xpl-table-header-cell.d.ts +0 -13
- /package/dist/types/components/{xpl-table-header → xpl-table/xpl-table-header}/xpl-table-header.d.ts +0 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface XplProgressIndicator extends Components.XplProgressIndicator, HTMLElement {}
|
|
4
|
+
export const XplProgressIndicator: {
|
|
5
|
+
prototype: XplProgressIndicator;
|
|
6
|
+
new (): XplProgressIndicator;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{proxyCustomElement as s,HTMLElement as t,h as e,Host as r,transformTag as i}from"@stencil/core/internal/client";import{d as o}from"./xpl-icon2.js";const c=s(class extends t{constructor(s){super(),!1!==s&&this.__registerHost(),this.currentStep=0,this.layout="horizontal",this.showLabels=!0,this.showNumbers=!0}validateCurrentStep(){if(!this.steps||0===this.steps.length)return;const s=this.steps.length;this.currentStep<0?this.currentStep=0:this.currentStep>s&&(this.currentStep=s)}renderStepContent(s,t){return t?e("xpl-icon",{icon:"check-2",size:20,class:"xpl-progress-indicator-step-checkmark"}):this.showNumbers?e("span",{class:"xpl-progress-indicator-step-number"},s+1):e("span",{class:"xpl-progress-indicator-step-dot"})}renderStep(s,t){const r=this.currentStep>t,i=this.currentStep===t,o="horizontal"===this.layout,c=e("div",{class:"xpl-progress-indicator-step-circle"},this.renderStepContent(t,r)),n=this.showLabels&&e("div",{class:"xpl-progress-indicator-step-text"},s),p=o?e("div",{class:"xpl-progress-indicator-step-content"},c,n):[c,n];return e("div",{class:{"xpl-progress-indicator-step":!0,"xpl-progress-indicator-step-active":i,"xpl-progress-indicator-step-finished":r},role:"listitem","aria-label":`${s}, ${r?"completed":i?"current":"upcoming"}`,"aria-current":i?"step":void 0},p)}render(){const s=this.steps||[],t=s.length;return e(r,{key:"44ac526c3954f688007573bf53c771b30518b9c7",class:{"xpl-progress-indicator":!0,"xpl-progress-indicator-horizontal":"horizontal"===this.layout,"xpl-progress-indicator-vertical":"vertical"===this.layout,"xpl-progress-indicator-no-labels":!this.showLabels},role:"group","aria-label":t>0?this.currentStep>=t?`Progress: all ${t} ${1===t?"step":"steps"} complete`:`Progress: step ${Math.min(this.currentStep+1,t)} of ${t}`:"Progress"},e("div",{key:"1ab86e3777ded2737ed5dd3c5ec759211a1087a7",class:"xpl-progress-indicator-container",role:"list"},s.map(((s,t)=>this.renderStep(s,t)))))}static get watchers(){return{steps:[{validateCurrentStep:0}],currentStep:[{validateCurrentStep:0}]}}},[0,"xpl-progress-indicator",{currentStep:[1026,"current-step"],layout:[1],showLabels:[4,"show-labels"],showNumbers:[4,"show-numbers"],steps:[16]},void 0,{steps:[{validateCurrentStep:0}],currentStep:[{validateCurrentStep:0}]}]),n=c,p=function(){"undefined"!=typeof customElements&&["xpl-progress-indicator","xpl-icon"].forEach((s=>{switch(s){case"xpl-progress-indicator":customElements.get(i(s))||customElements.define(i(s),c);break;case"xpl-icon":customElements.get(i(s))||o()}}))};export{n as XplProgressIndicator,p as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as s,createEvent as i,h as t,Host as
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as s,createEvent as i,h as t,Host as d,transformTag as a}from"@stencil/core/internal/client";import{v as l}from"./v4.js";const c=e(class extends s{constructor(e){super(),!1!==e&&this.__registerHost(),this.radioChange=i(this,"radioChange",7),this.id=l(),this.onChange=e=>{this.radioChange.emit(this.value?this.value:e.target.checked)}}render(){return t(d,{key:"a96ab55137fedbfe00d68b660bd2d935208dc6c6",class:{"xpl-checkbox-radio-container":!0,styled:this.styled,disabled:this.disabled}},t("input",{key:"ee385d0976d065fee4f72f75faea0ddbe33c0e81",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}),t("label",{key:"04e74e08a20b229f2d45b8fce80fa65ab3bf0954",class:{"xpl-label":!0,"xpl-label--disabled":this.disabled},htmlFor:this.id},t("slot",{key:"b9fe3e13de64776a9cc1afcd8f7c10f84be8c8bb"}),this.description&&t("small",{key:"6ecd217342fbfa9bb5022bb1298683ff87af1713",class:{"xpl-description":!0,"xpl-description--disabled":this.disabled}},this.description)))}},[260,"xpl-radio",{checked:[4],description:[1],disabled:[4],name:[1],value:[1],required:[4],styled:[4],id:[32]}]);function r(){"undefined"!=typeof customElements&&["xpl-radio"].forEach((e=>{"xpl-radio"===e&&(customElements.get(a(e))||customElements.define(a(e),c))}))}export{c as R,r as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as n,h as a,Host as s,transformTag as c}from"@stencil/core/internal/client";const t=e(class extends n{constructor(e){super(),!1!==e&&this.__registerHost()}render(){return a(s,{key:"bf9cbd4351297a28d6d98d3bf1e0612fac1f5136",class:"xpl-secondary-nav"},a("nav",{key:"764de50287c88f53f19005d50b177e85f71f7f43","aria-label":"Secondary Nav"},a("slot",{key:"d7fe629382a06f62dde9f08db082854e986ba406"})))}},[260,"xpl-secondary-nav"]),d=t,o=function(){"undefined"!=typeof customElements&&["xpl-secondary-nav"].forEach((e=>{"xpl-secondary-nav"===e&&(customElements.get(c(e))||customElements.define(c(e),t))}))};export{d as XplSecondaryNav,o as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as t,createEvent as s,h as i,Host as l,Fragment as o,transformTag as n}from"@stencil/core/internal/client";import{t as a}from"./index3.js";import{d
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as t,createEvent as s,h as i,Host as l,Fragment as o,transformTag as n}from"@stencil/core/internal/client";import{t as a}from"./index3.js";import{d}from"./xpl-dropdown2.js";import{d as h}from"./xpl-dropdown-group2.js";import{d as c}from"./xpl-dropdown-heading2.js";import{d as r}from"./xpl-dropdown-option2.js";import{d as p}from"./xpl-icon2.js";import{d as u}from"./xpl-tag2.js";import{v}from"./v4.js";function m(e){return e.label||e.value}function b(e){return e.reduce(((e,t)=>[...e,...t.groupName?t.options:[t]]),[])}const g=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.selectChange=s(this,"selectChange",7),this.changeEvent=s(this,"changeEvent",7),this.dropdownStateChange=s(this,"dropdownStateChange",7),this.triggerDropdown=s(this,"triggerDropdown",7),this.choices=[],this.selectIcon="chevron-down",this.mode="single",this.truncate=!0,this.active=!1,this.id=v(),this.keepFocus=!1,this.visibleChoices=1/0,this.choicesState=[],this.value=this.calculateValue(),this.dropdownOpenState=!1,this.container=null,this.dropdown=null,this.handleResizeThrottled=a((()=>{this.maybeTruncateChoices()}),250),this.handleTabKeyDown=e=>{"Tab"===e.key&&(this.keepFocus=!0)},this.handleTagRemove=e=>{const t=t=>(null==e?void 0:e.value)&&t.value===e.value||(null==e?void 0:e.label)&&t.label===e.label;this.choicesState=this.choicesState.map((e=>{var s;return Object.assign(Object.assign({},e),{isSelected:!t(e)&&e.isSelected,options:null===(s=e.options)||void 0===s?void 0:s.map((e=>Object.assign(Object.assign({},e),{isSelected:!t(e)&&e.isSelected})))})}))},this.handleDropdownScroll=e=>{const{scrollTop:t,scrollHeight:s,clientHeight:i}=this.dropdown.querySelector(".xpl-dropdown-list");(0===t&&e.deltaY<0||t+i>=s&&e.deltaY>0)&&e.preventDefault()}}onChoicesPropChanged(e){this.choicesState=this.initializeChoicesState()}onSelectedValuesPropChanged(){this.choicesState=this.initializeChoicesState()}onChoicesStateChanged(){this.update()}handleValueStateChange(e){this.selectChange.emit(e),this.changeEvent.emit("single"===this.mode?e:(null==e?void 0:e.length)?e.split("|"):[]),this.customDisplayValue&&null!==this.container&&(this.container.querySelectorAll(".custom-display-value").forEach((t=>{t.classList.toggle("display-active",e.length>0),t.classList.toggle("display-inactive",0===e.length)})),this.container.querySelectorAll(".placeholder").forEach((t=>{t.classList.toggle("placeholder-hidden",e.length>0)})))}onDropdownOpenStateChanged(e){this.dropdownStateChange.emit(e)}initializeChoicesState(){return this.choices.map((e=>{var t;const s="string"==typeof this.selectedValues?[this.selectedValues]:this.selectedValues;return Object.assign(Object.assign({},e),{isSelected:e.isSelected||(null==s?void 0:s.includes(e.value||e.label)),options:null===(t=e.options)||void 0===t?void 0:t.map((e=>Object.assign(Object.assign({},e),{isSelected:e.isSelected||(null==s?void 0:s.includes(e.value||e.label))})))})}))}maybeTruncateChoices(){var e,t;if("single"===this.mode||!this.truncate)return;const s=null===(e=this.container)||void 0===e?void 0:e.getBoundingClientRect().width;let i=0,l=0;const o=null===(t=b(this.choicesState))||void 0===t?void 0:t.filter((e=>e.isSelected));if(!o.length)return;const n=o.length;o.forEach(((e,t)=>(l+=function(e){const t=document.createElement("canvas").getContext("2d");return t.font="14px apple-system, system-ui, 'Segoe UI', Arial, Helvetica, Roboto, sans-serif",t.measureText(e).width+44}(m(o[t])),l>s-140||(i+=1),null))),i>=n&&(i=1/0),i<1&&(i=1),this.visibleChoices=i}closeDropdown(){var e;(null===(e=this.dropdown)||void 0===e?void 0:e.isOpen)&&(this.dropdown.isOpen=!1,this.active=!1)}calculateValue(){const e=b(this.choicesState).filter((e=>e.isSelected));return e.length?"single"===this.mode?e[0].value||e[0].label:e.map((e=>e.value||e.label)).join("|"):""}update(){this.value=this.calculateValue(),this.maybeTruncateChoices()}renderLabel(){return this.label||this.description?i("label",{class:{"xpl-label":!0,"xpl-label--disabled":this.disabled},htmlFor:this.id},this.label,this.description&&i("small",{class:{"xpl-description":!0,"xpl-description--disabled":this.disabled}},this.description)):null}renderSelectedTags(){let e=0;const t=b(this.choicesState).filter((e=>e.isSelected));return t.length?t.map(((s,l)=>e>=this.visibleChoices?null:(e+=1,i("xpl-tag",{onClose:()=>this.handleTagRemove(t[l])},m(t[l]))))):null}renderError(){return this.error?i("label",{class:"xpl-input-error",htmlFor:this.id},i("xpl-icon",{icon:"alert-circle"}),this.error):null}componentWillLoad(){this.choicesState=this.initializeChoicesState()}handleClickEvent(e){const t=e.target.closest(".xpl-select");null!==t&&t===this.container||this.closeDropdown()}handleKeyDown(e){var t;"Escape"===e.key&&(this.active||(null===(t=this.container)||void 0===t?void 0:t.contains(document.activeElement)))&&this.closeDropdown()}handleResize(){this.handleResizeThrottled()}componentDidLoad(){requestAnimationFrame((()=>{this.maybeTruncateChoices()}))}disconnectedCallback(){var e;null===(e=this.handleResizeThrottled)||void 0===e||e.cancel()}handleDropdownTrigger(){var e;const t=null!==(e=this.dropdown.isOpen)&&void 0!==e&&e,s=!t;this.triggerDropdown.emit({prevState:t,nextState:s}).defaultPrevented||this.disabled||(this.dropdownOpenState=s,this.dropdown.isOpen=s)}async reset(){this.closeDropdown(),this.choicesState=this.choicesState.map((e=>{var t;return Object.assign(Object.assign({},e),{isSelected:!1,options:null===(t=e.options)||void 0===t?void 0:t.map((e=>Object.assign(Object.assign({},e),{isSelected:!1})))})}))}render(){var e,t,s,n;const a=b(this.choicesState).filter((e=>e.isSelected)),d=(null===(e=a[0])||void 0===e?void 0:e.label)||(null===(t=a[0])||void 0===t?void 0:t.value),h=a.length>1&&this.visibleChoices<1/0&&this.truncate&&!this.customDisplayValue,c=`+ ${Math.abs(this.choicesState.filter((e=>e.isSelected)).length-this.visibleChoices)} more`;return i(l,{key:"c02b59988eee5073103958a24061c46aa286ea50",class:{"xpl-select":!0,"xpl-select--disabled":this.disabled,"xpl-select--no-truncate":!this.truncate,[null!==(s=this.classNames)&&void 0!==s?s:""]:!!this.classNames},onKeyDown:this.handleTabKeyDown,ref:e=>{this.container=e}},this.renderLabel(),i("div",{key:"189c9d2e3370876b6289ee16ee1b8927e5bfc0ee",class:{"xpl-input":!0,"xpl-input--disabled":this.disabled,"xpl-input--error":(null===(n=this.error)||void 0===n?void 0:n.length)>=0}},i("div",{key:"a8df7de958be97becd2a9f6a2db761702e2066c3",class:"xpl-input-wrapper"},i("button",{key:"f00119d930d49b241d5160bfe7a70ee56ac598d8",class:"xpl-select__trigger",disabled:this.disabled,id:this.id,onKeyDown:this.handleTabKeyDown,onClick:e=>{e.preventDefault(),this.handleDropdownTrigger()},type:"button"},i("div",{key:"141643ae007e8f5827d4aeb8fdd2a95b14b003ff",class:{"xpl-select-value":!0,"xpl-select-value--active":"multi"===this.mode&&this.value.length>0,"has-value":this.value.length>0}},(()=>this.customDisplayValue?i(o,null,i("div",{class:{"custom-display-value":!0,"custom-display-value--inactive":0===this.value.length}},i("slot",{name:"custom-display-value"})),i("span",{class:{"xpl-placeholder--hidden":this.value.length>0}},this.placeholder)):"single"===this.mode?d||this.placeholder:this.value.length>0?this.renderSelectedTags():this.placeholder)(),h&&c),i("xpl-icon",{key:"05f6ba660e21584017715d3afc14d7bd8b8d536a",class:"xpl-select__chevron-down",icon:this.selectIcon}))),!this.disabled&&i("xpl-dropdown",{key:"9a452cf4c62cca5ba4279ddd8da09c9d24797dcf",ref:e=>{this.dropdown=e},isOpen:this.dropdownOpenState,options:this.choicesState,selectedValues:this.selectedValues,mode:this.mode,triggerId:this.id,update:(e,{component:t})=>{const{options:s}=t;s&&s.length>0&&(this.choicesState=s)},onIsOpenChange:e=>{this.dropdownOpenState=e.detail},onWheel:this.handleDropdownScroll,anchorToTrigger:!0}),this.renderError()),i("input",{key:"d9d6cbc69fc5fc688b2dda6ea1ef99435d90fc94",type:"hidden",name:this.name,value:this.value}))}static get watchers(){return{choices:[{onChoicesPropChanged:0}],selectedValues:[{onSelectedValuesPropChanged:0}],choicesState:[{onChoicesStateChanged:0}],value:[{handleValueStateChange:0}],dropdownOpenState:[{onDropdownOpenStateChanged:0}]}}},[260,"xpl-select",{choices:[16],selectIcon:[1,"select-icon"],description:[1],disabled:[4],error:[1],label:[1],mode:[1],name:[1],placeholder:[1],truncate:[4],customDisplayValue:[4,"custom-display-value"],selectedValues:[1,"selected-values"],classNames:[1,"class-names"],active:[32],id:[32],keepFocus:[32],visibleChoices:[32],choicesState:[32],value:[32],dropdownOpenState:[32],reset:[64]},[[8,"click","handleClickEvent"],[8,"keydown","handleKeyDown"],[9,"resize","handleResize"]],{choices:[{onChoicesPropChanged:0}],selectedValues:[{onSelectedValuesPropChanged:0}],choicesState:[{onChoicesStateChanged:0}],value:[{handleValueStateChange:0}],dropdownOpenState:[{onDropdownOpenStateChanged:0}]}]);function x(){"undefined"!=typeof customElements&&["xpl-select","xpl-dropdown","xpl-dropdown-group","xpl-dropdown-heading","xpl-dropdown-option","xpl-icon","xpl-tag"].forEach((e=>{switch(e){case"xpl-select":customElements.get(n(e))||customElements.define(n(e),g);break;case"xpl-dropdown":customElements.get(n(e))||d();break;case"xpl-dropdown-group":customElements.get(n(e))||h();break;case"xpl-dropdown-heading":customElements.get(n(e))||c();break;case"xpl-dropdown-option":customElements.get(n(e))||r();break;case"xpl-icon":customElements.get(n(e))||p();break;case"xpl-tag":customElements.get(n(e))||u()}}))}export{g as S,x as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as i,HTMLElement as s,createEvent as e,h as t,Host as n,transformTag as l}from"@stencil/core/internal/client";import{d as
|
|
1
|
+
import{proxyCustomElement as i,HTMLElement as s,createEvent as e,h as t,Host as n,transformTag as l}from"@stencil/core/internal/client";import{d as h}from"./xpl-icon2.js";const a=i(class extends s{constructor(i){super(),!1!==i&&this.__registerHost(),this.expandedChange=e(this,"expandedChange",7),this.navClick=e(this,"navClick",7),this.disabled=!1,this.expanded=!1,this.hasChildren=!1,this.hidden=!1,this.link=!1,this.selected=!1,this.handleClick=()=>{this.disabled||(this.hasChildren?(this.expanded=!this.expanded,this.expandedChange.emit(this.expanded)):this.navClick.emit())}}syncLinkHasChildrenExclusivity(){this.enforceLinkExcludesHasChildren()}componentWillLoad(){this.syncLinkHasChildrenExclusivity()}componentWillRender(){this.syncLinkHasChildrenExclusivity()}enforceLinkExcludesHasChildren(){this.link&&(this.hasChildren&&(this.hasChildren=!1),this.el.hasAttribute("has-children")&&this.el.removeAttribute("has-children"))}render(){var i;const s={"xpl-side-nav-item__link":!0,expanded:this.expanded,selected:this.selected};return t(n,{key:"10318a2c26c650f5c5e2143c2fe1bde6a372f933",class:{"xpl-side-nav-item":!0,"xpl-side-nav-item--link-disabled":this.link&&this.disabled}},this.link?t("slot",null):t("button",{type:"button",class:s,"aria-current":this.selected?"page":void 0,"aria-expanded":this.hasChildren?this.expanded?"true":"false":void 0,onClick:this.handleClick,disabled:this.disabled},this.hasChildren&&t("span",{class:"xpl-side-nav-item__arrow "+(this.expanded?"expanded":"")},t("xpl-icon",{icon:"chevron-down",size:16})),!this.hasChildren&&t("span",{class:"xpl-side-nav-item__icon"},t("slot",{name:"icon"},this.icon?t("xpl-icon",{icon:this.icon,size:16}):null)),t("span",{class:"xpl-side-nav-item__label"},null!==(i=this.label)&&void 0!==i?i:"")),this.hasChildren&&!this.link&&t("div",{key:"ea6e431300ffe641e970c8cc49e7935858986685",class:"xpl-side-nav-item__children "+(this.expanded?"expanded":""),inert:!this.expanded||void 0},t("div",{key:"378a00e24a61911ce69ef6a50e69d47b496b5557",class:"xpl-side-nav-item__children-inner"},t("slot",{key:"b3ece8c8ddbf58693a370824c40fe3811828889a"}))))}get el(){return this}static get watchers(){return{hasChildren:[{syncLinkHasChildrenExclusivity:0}],link:[{syncLinkHasChildrenExclusivity:0}]}}},[260,"xpl-side-nav-item",{disabled:[516],expanded:[1540],hasChildren:[1540,"has-children"],hidden:[516],icon:[1],label:[1],link:[516],selected:[516]},void 0,{hasChildren:[{syncLinkHasChildrenExclusivity:0}],link:[{syncLinkHasChildrenExclusivity:0}]}]),c=a,d=function(){"undefined"!=typeof customElements&&["xpl-side-nav-item","xpl-icon"].forEach((i=>{switch(i){case"xpl-side-nav-item":customElements.get(l(i))||customElements.define(l(i),a);break;case"xpl-icon":customElements.get(l(i))||h()}}))};export{c as XplSideNavItem,d as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as a,h as
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as a,h as s,Host as c,transformTag as n}from"@stencil/core/internal/client";const t=e(class extends a{constructor(e){super(),!1!==e&&this.__registerHost()}render(){return s(c,{key:"bfa4c94a1718583020da6a8b1e9104788ce78ef1",class:{"xpl-side-nav":!0}},s("div",{key:"1788f206ed3bea01be9cfa74fbc54a54e664945c",class:"xpl-side-nav__wrapper"},s("nav",{key:"ccbcbc45566a77a9134279b486148f3444bdb0ea",class:"xpl-side-nav__content","aria-label":this.label},s("div",{key:"6aef4d3f8e0c037aeedfc45d8471978c635b3293",class:"xpl-side-nav__section"},s("slot",{key:"e4384164f138cae0135472428079b62924afbcdf",name:"section"})),s("div",{key:"9794ea9a4b566713d0adb0787ae2ab1ae171fa6e",class:"xpl-side-nav__footer"},s("slot",{key:"e20ff6d3795784ea11470b7287550c29c0984a65",name:"nav-footer"})))))}},[260,"xpl-side-nav",{label:[1]}]),l=t,d=function(){"undefined"!=typeof customElements&&["xpl-side-nav"].forEach((e=>{"xpl-side-nav"===e&&(customElements.get(n(e))||customElements.define(n(e),t))}))};export{l as XplSideNav,d as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as t,h as s,Host as l,transformTag as i}from"@stencil/core/internal/client";const n=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.shape="rectangle",this.size="custom"}render(){return s(l,{key:"
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as t,h as s,Host as l,transformTag as i}from"@stencil/core/internal/client";const n=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.shape="rectangle",this.size="custom"}render(){return s(l,{key:"4c0962c3339b49f2f89d07e4827e826089419c70",class:{"xpl-skeleton":!0,["xpl-skeleton--shape-"+this.shape]:!0,["xpl-skeleton--size-"+this.size]:!0,[this.classNames]:!!this.classNames,"xpl-skeleton--full-width":this.fullWidth},style:{width:this.width||void 0,height:this.height||void 0,margin:this.margin||void 0}})}},[0,"xpl-skeleton",{classNames:[1,"class-names"],fullWidth:[4,"full-width"],height:[1],width:[1],margin:[1],shape:[1],size:[1]}]),o=n,h=function(){"undefined"!=typeof customElements&&["xpl-skeleton"].forEach((e=>{"xpl-skeleton"===e&&(customElements.get(i(e))||customElements.define(i(e),n))}))};export{o as XplSkeleton,h as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as a,createEvent as c,h as t,Host as s,transformTag as d}from"@stencil/core/internal/client";import{d as o}from"./xpl-backdrop2.js";import{d as i}from"./xpl-button2.js";import{d as l}from"./xpl-divider2.js";import{d as r}from"./xpl-icon2.js";const b=e(class extends a{constructor(e){super(),!1!==e&&this.__registerHost(),this.isOpenChange=c(this,"isOpenChange",7),this.isOpen=!1,this.backdrop=!1,this.variant="default",this.showFooter=!0,this.handleClose=()=>{this.isOpen=!1}}watchPropHandler(e){this.isOpen=e,this.isOpenChange.emit(e)}handleScroll(){const e=this.el.querySelector(".content");e.scrollHeight>e.clientHeight?e.classList.add("has-shadow"):e.classList.remove("has-shadow")}componentDidLoad(){this.handleScroll()}render(){return t(s,{key:"01e702ef959cc596ae8fb140275d733c93c3b399",class:"xpl-slideout"},this.backdrop&&this.isOpen&&t("xpl-backdrop",{key:"4e82ee44b68eae102a4c4ef65e797ce23659d330",onClick:this.handleClose}),t("aside",{key:"1c718a30611bb6699f231a9e736c0521c248d65a",class:"slideout slideout--"+(!this.isOpen&&"closed")},t("header",{key:"c53419926fbe8ccc6616af39d021248b46f138a3",class:"header"},t("div",{key:"36e02fe5b7ff8d6920759ab793ead2be0f0811ac",class:"title"},t("slot",{key:"7932fd5e77edb89570ebd3fedc0346929582ec7b",name:"title"}),t("xpl-button",{key:"9772e880c9b132ba84ccf45c4793e0af70548866",class:"close-button","icon-only":!0,size:"sm",variant:"tertiary",onClick:this.handleClose},t("xpl-icon",{key:"91922e8aa02c30aa73ae1ea3d2b47daffd954616",icon:"x"}))),t("div",{key:"2f7065ba1da7f0ad805e16b69f4a316d5a1f9285",class:"subtitle"},t("slot",{key:"8edb8bdbdecd01abd2b7899d5c9897c91e625326",name:"subtitle"})),t("div",{key:"5945128002bb2103daac40d1f7457ebb97521002",class:"search"},t("slot",{key:"c4df975581beb16547a439a86f2a532c10fa4fa7",name:"search"}))),t("xpl-divider",{key:"3be4c74de14ca2380179798fe4ec0c9a758739af",tier:0,class:"divider top"}),t("article",{key:"2012ae1197acc41f530af8920b19752a248e2b40",class:"content",tabIndex:0},t("slot",{key:"e8a1cedda6cd48bb62dc42f00c9bdc8510d4f603",name:"content"})),this.showFooter&&t("footer",{key:"cfa5a41846485b879126a90f3a7346d6eb680776"},t("xpl-divider",{key:"bf05c9d85471b55dee25da790afb3cb642f1a86b",tier:0,class:"divider bottom"}),t("div",{key:"d109314ca745947f3337b06df73183ff277c89bb",class:"footer"},t("slot",{key:"cad183e788d3555a5366b19b4e01c3c90f7d9ae0",name:"tertiary"}),t("slot",{key:"c12294440fe8544e51197dfddbc01aaea506575a",name:"secondary"}),t("slot",{key:"7accdf8dc3cc9b6a416cf784ec081d70c1d0f1e9",name:"primary"})))))}get el(){return this}static get watchers(){return{isOpen:[{watchPropHandler:0}]}}},[260,"xpl-slideout",{isOpen:[1540,"is-open"],backdrop:[4],variant:[1],showFooter:[4,"show-footer"]},[[9,"scroll","handleScroll"]],{isOpen:[{watchPropHandler:0}]}]),n=b,f=function(){"undefined"!=typeof customElements&&["xpl-slideout","xpl-backdrop","xpl-button","xpl-divider","xpl-icon"].forEach((e=>{switch(e){case"xpl-slideout":customElements.get(d(e))||customElements.define(d(e),b);break;case"xpl-backdrop":customElements.get(d(e))||o();break;case"xpl-button":customElements.get(d(e))||i();break;case"xpl-divider":customElements.get(d(e))||l();break;case"xpl-icon":customElements.get(d(e))||r()}}))};export{n as XplSlideout,f as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface XplSpotlight extends Components.XplSpotlight, HTMLElement {}
|
|
4
|
+
export const XplSpotlight: {
|
|
5
|
+
prototype: XplSpotlight;
|
|
6
|
+
new (): XplSpotlight;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{proxyCustomElement as t,HTMLElement as i,createEvent as s,forceUpdate as o,h,Host as e,transformTag as n}from"@stencil/core/internal/client";import{c as l,a,o as r,f as c,s as p}from"./floating-ui.dom.js";import{d}from"./xpl-button2.js";import{d as u}from"./xpl-icon2.js";const g=".xpl-spotlight__dismiss button, .xpl-spotlight__actions button";let m=0;const v={"top-left":"top-start","top-right":"top-end","bottom-left":"bottom-start","bottom-right":"bottom-end"},x={top:"bottom-left","top-start":"bottom-left","top-end":"bottom-right",bottom:"top-left","bottom-start":"top-left","bottom-end":"top-right",left:"top-right","left-start":"top-right","left-end":"bottom-right",right:"top-left","right-start":"top-left","right-end":"bottom-left"},b=t(class t extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.dismiss=s(this,"dismiss",7),this.primaryAction=s(this,"primaryAction",7),this.secondaryAction=s(this,"secondaryAction",7),this.targetClick=s(this,"targetClick",7),this.cleanupAutoUpdate=null,this.enterVisibleFrameId=null,this.focusFrameId=null,this.hasCompletedInitialLoad=!1,this.headingId=(m+=1,"xpl-spotlight-heading-"+m),this.pendingEnterTransitionAfterAnchor=!1,this.pendingEnterVisible=!1,this.positioningGeneration=0,this.previousFocus=null,this.referenceEl=null,this.shouldMoveFocusOnRender=!1,this.shouldReinitializeAfterReconnect=!1,this.slotContentObserver=null,this.hasBodySlotContent=!1,this.hasFloatingPosition=!1,this.hasImageSlotContent=!1,this.hasTitleSlotContent=!1,this.isVisible=!1,this.resolvedAnchorPosition="top-left",this.actionLayout="default",this.anchorPosition="top-left",this.currentStep=1,this.isDismissible=!0,this.isOpen=!0,this.primaryActionLabel="Next",this.secondaryActionLabel="Back",this.showActions=!0,this.showImage=!0,this.showSteps=!0,this.totalSteps=1,this.emitDismiss=()=>{this.dismiss.emit()},this.handleDismissClick=()=>{this.emitDismiss()},this.handlePrimaryClick=()=>{this.primaryAction.emit()},this.handleSecondaryClick=()=>{this.secondaryAction.emit()},this.handleTargetClick=()=>{this.targetClick.emit()},this.syncTitleSlotIds=()=>{const t=this.getFirstTitleSlottedElement();t&&!t.id&&(t.id=this.headingId)},this.handleBodySlotChange=()=>{this.refreshBodySlotState()},this.handleTitleSlotChange=()=>{this.refreshTitleSlotState(),this.syncTitleSlotIds()},this.handleImageSlotChange=()=>{this.refreshImageSlotState()},this.handleSlotContentMutation=()=>{this.refreshBodySlotState(),this.refreshImageSlotState(),this.refreshTitleSlotState(),this.syncTitleSlotIds()},this.updatePosition=async t=>{var i,s,h,e,n,a;const d=this.positioningGeneration;try{const o=v[this.anchorPosition],{x:u,y:g,placement:m,middlewareData:b}=await l(t,this.el,{strategy:"fixed",placement:o,middleware:[r(12),c({crossAxis:!1}),p({padding:8})]});if(d!==this.positioningGeneration)return;this.el.style.left=u+"px",this.el.style.top=g+"px";const f=null!==(s=null===(i=b.shift)||void 0===i?void 0:i.x)&&void 0!==s?s:0,y=null!==(e=null===(h=b.shift)||void 0===h?void 0:h.y)&&void 0!==e?e:0;this.el.style.setProperty("--xpl-spotlight-shift-x",-f+"px"),this.el.style.setProperty("--xpl-spotlight-shift-y",-y+"px"),this.hasFloatingPosition=!0;const _=null!==(n=x[m])&&void 0!==n?n:x[null!==(a=m.split("-")[0])&&void 0!==a?a:""];this.resolvedAnchorPosition=null!=_?_:this.anchorPosition,this.pendingEnterTransitionAfterAnchor&&this.scheduleEnterTransition()}catch(t){if(d!==this.positioningGeneration)return;this.clearFloatingHostCoordinates(),this.isOpenEnabled&&(this.scheduleEnterTransition({skipAnchorWait:!0}),await o(this))}}}onAnchorPositionChange(){this.target&&this.referenceEl?this.updatePosition(this.referenceEl).catch((()=>{})):this.resolvedAnchorPosition=this.anchorPosition}onIsOpenChange(s){if(t.coerceBoolean(s))return this.previousFocus=document.activeElement instanceof i?document.activeElement:null,this.shouldMoveFocusOnRender=!0,this.isVisible=!1,this.refreshBodySlotState(),this.refreshTitleSlotState(),this.refreshImageSlotState(),this.target&&(this.cleanupAutoUpdate&&this.referenceEl&&this.el.ownerDocument.contains(this.referenceEl)?this.hasFloatingPosition=!1:this.startPositioning()),void this.scheduleEnterTransition();this.cancelEnterTransition(),this.cancelPendingFocusWait(),this.isVisible=!1,this.target||this.stopPositioning(),this.restoreFocus()}onTargetChange(){if(!this.target)return this.stopPositioning(),void(this.resolvedAnchorPosition=this.anchorPosition);this.startPositioning()}connectedCallback(){this.shouldReinitializeAfterReconnect&&(this.shouldReinitializeAfterReconnect=!1,this.startSlotContentObserver(),this.target&&this.startPositioning(),this.isOpenEnabled?(this.previousFocus=document.activeElement instanceof i?document.activeElement:null,this.shouldMoveFocusOnRender=!0,this.scheduleEnterTransition(),this.pendingEnterVisible&&Promise.resolve(o(this)).catch((()=>{}))):this.isVisible=!1)}disconnectedCallback(){this.cancelEnterTransition(),this.cancelPendingFocusWait(),this.stopSlotContentObserver(),this.stopPositioning(),this.hasCompletedInitialLoad&&(this.shouldReinitializeAfterReconnect=!0)}componentWillLoad(){this.resolvedAnchorPosition=this.anchorPosition,this.hasBodySlotContent=this.hasSlottedContent("body"),this.hasImageSlotContent=this.hasSlottedContent("image"),this.hasTitleSlotContent=this.hasSlottedContent("title"),this.isOpenEnabled&&(this.previousFocus=document.activeElement instanceof i?document.activeElement:null,this.target||(this.pendingEnterVisible=!0)),this.shouldMoveFocusOnRender=this.isOpenEnabled}componentDidLoad(){this.hasCompletedInitialLoad=!0,this.startSlotContentObserver(),this.target&&this.startPositioning(),this.isOpenEnabled?this.target&&(this.scheduleEnterTransition(),this.pendingEnterVisible&&Promise.resolve(o(this)).catch((()=>{}))):this.isVisible=!1}componentDidRender(){this.isOpenEnabled&&this.syncTitleSlotIds(),this.pendingEnterVisible&&this.isOpenEnabled&&(this.pendingEnterVisible=!1,this.enterVisibleFrameId=requestAnimationFrame((()=>{this.enterVisibleFrameId=null,this.isOpenEnabled&&(this.isVisible=!0)}))),this.shouldMoveFocusOnRender&&this.isOpenEnabled&&(this.shouldMoveFocusOnRender=!1,this.focusInitial())}handleKeyDown(t){"Escape"===t.key&&this.shouldHandleDismissKeyboardEvent()&&(t.preventDefault(),this.emitDismiss())}get effectiveTotalSteps(){return Math.max(1,this.totalSteps)}get effectiveCurrentStep(){return Math.min(this.effectiveTotalSteps,Math.max(1,this.currentStep))}get isDismissibleEnabled(){return t.coerceBoolean(this.isDismissible)}get isOpenEnabled(){return t.coerceBoolean(this.isOpen)}get isSingleActionLayout(){return"single"===this.actionLayout}get usesHiddenEdgeActions(){return"dual"===this.actionLayout}get isPrimaryStepActionDisabled(){return!this.usesHiddenEdgeActions&&this.showStepsEnabled&&this.effectiveCurrentStep>=this.effectiveTotalSteps}get isSecondaryStepActionDisabled(){return!this.usesHiddenEdgeActions&&this.showStepsEnabled&&this.effectiveCurrentStep<=1}get shouldShowPrimaryAction(){return!!this.isSingleActionLayout||!this.usesHiddenEdgeActions||!this.showStepsEnabled||this.effectiveCurrentStep<this.effectiveTotalSteps}get shouldShowSecondaryAction(){return!this.isSingleActionLayout&&(!this.usesHiddenEdgeActions||!this.showStepsEnabled||this.effectiveCurrentStep>1)}get hasRenderableFocusChrome(){return!!this.isDismissibleEnabled||!!this.showActionsEnabled&&(this.shouldShowPrimaryAction||this.shouldShowSecondaryAction)}get showActionsEnabled(){return t.coerceBoolean(this.showActions)}get showImageEnabled(){return t.coerceBoolean(this.showImage)}get showStepsEnabled(){return t.coerceBoolean(this.showSteps)}get headingPropHasText(){var t;return!!(null===(t=this.heading)||void 0===t?void 0:t.trim())}get bodyPropHasText(){var t;return!!(null===(t=this.body)||void 0===t?void 0:t.trim())}async focusInitial(){var t;if(null===(t=this.focusAbort)||void 0===t||t.abort(),this.focusAbort=new AbortController,!this.hasRenderableFocusChrome&&this.isOpenEnabled)return void(this.focusFrameId=requestAnimationFrame((()=>{this.focusFrameId=null,this.isOpenEnabled&&this.el.focus()})));const i=await function(t,i){var s;const o=t.querySelector(g);return o?Promise.resolve(o):(null===(s=null==i?void 0:i.signal)||void 0===s?void 0:s.aborted)?Promise.resolve(null):"undefined"==typeof MutationObserver?function(t,i){return new Promise((s=>{var o,h;if(null===(o=null==i?void 0:i.signal)||void 0===o?void 0:o.aborted)return void s(null);let e,n,l=0;const a=t=>{void 0!==e&&"undefined"!=typeof cancelAnimationFrame&&cancelAnimationFrame(e),void 0!==n&&clearTimeout(n),s(t)},r=()=>a(null);null===(h=null==i?void 0:i.signal)||void 0===h||h.addEventListener("abort",r,{once:!0});const c=t=>{"undefined"!=typeof requestAnimationFrame?e=requestAnimationFrame((()=>{e=void 0,t()})):n=setTimeout((()=>{n=void 0,t()}),0)},p=()=>{var s,o,h;if(null===(s=null==i?void 0:i.signal)||void 0===s?void 0:s.aborted)return void a(null);const e=t.querySelector(g);return e?(null===(o=null==i?void 0:i.signal)||void 0===o||o.removeEventListener("abort",r),void a(e)):(l+=1,l>=120?(null===(h=null==i?void 0:i.signal)||void 0===h||h.removeEventListener("abort",r),void a(null)):void c(p))};c(p)}))}(t,i):new Promise((s=>{var o;let h,e,n=!1;function l(t){n||(n=!0,e.disconnect(),void 0!==h&&clearTimeout(h),s(t))}e=new MutationObserver((()=>{const i=t.querySelector(g);i&&l(i)})),e.observe(t instanceof Node?t:document,{childList:!0,subtree:!0}),h=setTimeout((()=>l(null)),2500),null===(o=null==i?void 0:i.signal)||void 0===o||o.addEventListener("abort",(()=>{l(null)}),{once:!0})}))}(this.el,{signal:this.focusAbort.signal});i?i.focus():this.isOpenEnabled&&this.el.focus()}shouldHandleDismissKeyboardEvent(){if(!this.isDismissibleEnabled||!this.isOpenEnabled||!this.isVisible)return!1;const{activeElement:t}=document;return!!t&&(t===this.el||this.el.contains(t))}restoreFocus(){var t;(null===(t=this.previousFocus)||void 0===t?void 0:t.isConnected)&&this.previousFocus.focus()}cancelPendingFocusWait(){var t;null===(t=this.focusAbort)||void 0===t||t.abort(),null!=this.focusFrameId&&(cancelAnimationFrame(this.focusFrameId),this.focusFrameId=null)}cancelEnterTransition(){null!==this.enterVisibleFrameId&&(cancelAnimationFrame(this.enterVisibleFrameId),this.enterVisibleFrameId=null),this.pendingEnterVisible=!1}scheduleEnterTransition(t){this.cancelEnterTransition(),(null==t?void 0:t.skipAnchorWait)||!this.target||!this.referenceEl||this.hasFloatingPosition?(this.pendingEnterTransitionAfterAnchor=!1,this.pendingEnterVisible=!0):this.pendingEnterTransitionAfterAnchor=!0}getFirstTitleSlottedElement(){var t;const i=Array.from(this.el.children).find((t=>t.nodeType===Node.ELEMENT_NODE&&"title"===t.getAttribute("slot")));if(i)return i;const s=this.el.querySelector('slot[name="title"]');return s&&null!==(t=Array.from(s.assignedNodes({flatten:!0})).find((t=>t.nodeType===Node.ELEMENT_NODE)))&&void 0!==t?t:null}getDialogLabelId(){if(this.hasTitleSlotContent){const t=this.getFirstTitleSlottedElement();return(null==t?void 0:t.id)?t.id:this.headingId}if(this.headingPropHasText)return this.headingId}refreshBodySlotState(){const t=this.hasSlottedContent("body");this.hasBodySlotContent!==t&&(this.hasBodySlotContent=t)}refreshTitleSlotState(){const t=this.hasSlottedContent("title");this.hasTitleSlotContent!==t&&(this.hasTitleSlotContent=t)}static coerceBoolean(t){return"string"==typeof t?"false"!==t.trim().toLowerCase():!!t}refreshImageSlotState(){const t=this.hasSlottedContent("image");this.hasImageSlotContent!==t&&(this.hasImageSlotContent=t)}startSlotContentObserver(){"undefined"==typeof MutationObserver||this.slotContentObserver||(this.slotContentObserver=new MutationObserver(this.handleSlotContentMutation),this.slotContentObserver.observe(this.el,{attributes:!0,attributeFilter:["slot"],childList:!0,subtree:!0}))}stopSlotContentObserver(){var t;null===(t=this.slotContentObserver)||void 0===t||t.disconnect(),this.slotContentObserver=null}hasSlottedContent(t){const i=this.el.querySelector(`slot[name="${t}"]`),s=this.el.querySelector(`[slot="${t}"]`),o=Array.from(this.el.children).some((i=>i.getAttribute("slot")===t)),h=!!i&&i.assignedNodes({flatten:!0}).some((t=>{var i;return t.nodeType===Node.ELEMENT_NODE||t.nodeType===Node.TEXT_NODE&&(null===(i=t.textContent)||void 0===i?void 0:i.trim())}));return!(!s&&!o)||h}startPositioning(){if(!this.target)return;let t=null;try{t=this.el.ownerDocument.querySelector(this.target)}catch(t){return this.stopPositioning(),void(this.resolvedAnchorPosition=this.anchorPosition)}if(!t)return this.stopPositioning(),void(this.resolvedAnchorPosition=this.anchorPosition);this.detachFloatingUiListeners(),this.referenceEl=t,this.cleanupAutoUpdate=a(t,this.el,(()=>{this.updatePosition(t).catch((()=>{}))}))}detachFloatingUiListeners(){this.positioningGeneration+=1,this.cleanupAutoUpdate&&(this.cleanupAutoUpdate(),this.cleanupAutoUpdate=null)}resetFloatingHostPosition(){this.el.style.left="",this.el.style.top="",this.el.style.removeProperty("--xpl-spotlight-shift-x"),this.el.style.removeProperty("--xpl-spotlight-shift-y"),this.hasFloatingPosition=!1,this.pendingEnterTransitionAfterAnchor=!1,this.referenceEl=null}clearFloatingHostCoordinates(){this.el.style.left="",this.el.style.top="",this.el.style.removeProperty("--xpl-spotlight-shift-x"),this.el.style.removeProperty("--xpl-spotlight-shift-y"),this.hasFloatingPosition=!1,this.pendingEnterTransitionAfterAnchor=!1,this.resolvedAnchorPosition=this.anchorPosition}stopPositioning(){this.detachFloatingUiListeners(),this.resetFloatingHostPosition()}render(){if(!this.isOpenEnabled)return this.target?h(e,{class:{"xpl-spotlight":!0,"xpl-spotlight--target-only":!0,["xpl-spotlight--"+this.resolvedAnchorPosition]:!0,"xpl-spotlight--anchored":this.hasFloatingPosition}},h("button",{type:"button",class:"xpl-spotlight__target","aria-label":"Spotlight indicator",onClick:this.handleTargetClick},h("div",{class:"xpl-spotlight__target-outer"}),h("div",{class:"xpl-spotlight__target-inner"}))):h(e,{"aria-hidden":"true",class:{"xpl-spotlight":!0,"xpl-spotlight--closed":!0}});const{isSingleActionLayout:t,shouldShowPrimaryAction:i,shouldShowSecondaryAction:s,showActionsEnabled:o,showImageEnabled:n,showStepsEnabled:l}=this;return h(e,{class:{["xpl-spotlight--action-layout-"+this.actionLayout]:o,"xpl-spotlight":!0,["xpl-spotlight--"+this.resolvedAnchorPosition]:!0,"xpl-spotlight--anchored":this.hasFloatingPosition,"xpl-spotlight--no-image":!n,"xpl-spotlight--only-primary-action":o&&i&&!s,"xpl-spotlight--only-secondary-action":o&&s&&!i,"xpl-spotlight--visible":this.isVisible},role:"dialog","aria-modal":"false","aria-label":this.getDialogLabelId()?void 0:"Tour step","aria-labelledby":this.getDialogLabelId(),tabindex:-1},h("button",{type:"button",class:"xpl-spotlight__target","aria-label":"Spotlight indicator",onClick:this.handleTargetClick},h("div",{class:"xpl-spotlight__target-outer"}),h("div",{class:"xpl-spotlight__target-inner"})),this.isDismissibleEnabled&&h("div",{class:"xpl-spotlight__dismiss"},h("xpl-button",{variant:"secondary",size:"sm",iconOnly:!0,"aria-label":"Dismiss tour step",onClick:this.handleDismissClick},h("xpl-icon",{icon:"xmark",size:16}))),h("div",{class:"xpl-spotlight__frame"},h("div",{class:{"xpl-spotlight__image-container":!0,"xpl-spotlight__image-container--empty":!this.hasImageSlotContent,"xpl-spotlight__image-container--hidden":!n}},!this.hasImageSlotContent&&n&&h("div",{class:"xpl-spotlight__image-placeholder","aria-hidden":"true"},h("xpl-icon",{icon:"photo",size:24}),h("xpl-icon",{icon:"video",size:24})),h("slot",{name:"image",onSlotchange:this.handleImageSlotChange})),h("div",{class:"xpl-spotlight__content"},h("div",{class:"xpl-spotlight__header"},h("slot",{name:"title",onSlotchange:this.handleTitleSlotChange},!this.hasTitleSlotContent&&this.headingPropHasText&&h("span",{class:"xpl-spotlight__title",id:this.headingId},this.heading)),h("slot",{name:"body",onSlotchange:this.handleBodySlotChange},!this.hasBodySlotContent&&this.bodyPropHasText&&h("p",{class:"xpl-spotlight__body"},this.body))),o&&h("div",{class:{"xpl-spotlight__actions":!0,"xpl-spotlight__actions--dual":!t,"xpl-spotlight__actions--single":t,"xpl-spotlight__actions--with-steps":l,"xpl-spotlight__actions--only-primary":i&&!s,"xpl-spotlight__actions--only-secondary":s&&!i}},h("div",{class:"xpl-spotlight__action-slot xpl-spotlight__action-slot--secondary"},s&&h("xpl-button",{class:"xpl-spotlight__secondary-action",variant:"secondary",size:"default",disabled:this.isSecondaryStepActionDisabled,onClick:this.handleSecondaryClick},this.secondaryActionLabel)),l&&h("span",{class:"xpl-spotlight__step-text"},this.effectiveCurrentStep," of ",this.effectiveTotalSteps),h("div",{class:"xpl-spotlight__action-slot xpl-spotlight__action-slot--primary"},i&&h("xpl-button",{class:"xpl-spotlight__primary-action",variant:"primary",size:"default",disabled:this.isPrimaryStepActionDisabled,onClick:this.handlePrimaryClick},this.primaryActionLabel))))))}get el(){return this}static get watchers(){return{anchorPosition:[{onAnchorPositionChange:0}],isOpen:[{onIsOpenChange:0}],target:[{onTargetChange:0}]}}},[260,"xpl-spotlight",{actionLayout:[1,"action-layout"],anchorPosition:[1,"anchor-position"],body:[1],currentStep:[2,"current-step"],heading:[1],isDismissible:[4,"is-dismissible"],isOpen:[4,"is-open"],primaryActionLabel:[1,"primary-action-label"],secondaryActionLabel:[1,"secondary-action-label"],showActions:[4,"show-actions"],showImage:[4,"show-image"],showSteps:[4,"show-steps"],target:[1],totalSteps:[2,"total-steps"],hasBodySlotContent:[32],hasFloatingPosition:[32],hasImageSlotContent:[32],hasTitleSlotContent:[32],isVisible:[32],resolvedAnchorPosition:[32]},[[4,"keydown","handleKeyDown"]],{anchorPosition:[{onAnchorPositionChange:0}],isOpen:[{onIsOpenChange:0}],target:[{onTargetChange:0}]}]),f=b,y=function(){"undefined"!=typeof customElements&&["xpl-spotlight","xpl-button","xpl-icon"].forEach((t=>{switch(t){case"xpl-spotlight":customElements.get(n(t))||customElements.define(n(t),b);break;case"xpl-button":customElements.get(n(t))||d();break;case"xpl-icon":customElements.get(n(t))||u()}}))};export{f as XplSpotlight,y as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as t,h as
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as t,h as a,Host as s,transformTag as l}from"@stencil/core/internal/client";import{g as n,a as r,t as c}from"./tab-a11y-ids.js";const o=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.selected=!1}render(){var e;const t=n(this.el),l=null!==(e=this.target)&&void 0!==e?e:"",o=r(t,l),b=c(t,l);return a(s,{key:"4491f3466d26e462432843c382b0d0b5ab64e68b","aria-labelledby":b,class:{"xpl-tab-panel":!0,"xpl-tab-panel--selected":this.selected},id:o,role:"tabpanel"},a("slot",{key:"75b3da77cddb6e0a83b7cf41aa5e0aa30259b728"}))}get el(){return this}},[260,"xpl-tab-panel",{selected:[4],target:[1]}]),b=o,i=function(){"undefined"!=typeof customElements&&["xpl-tab-panel"].forEach((e=>{"xpl-tab-panel"===e&&(customElements.get(l(e))||customElements.define(l(e),o))}))};export{b as XplTabPanel,i as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as t,HTMLElement as
|
|
1
|
+
import{proxyCustomElement as t,HTMLElement as s,createEvent as e,h as i,Host as n,transformTag as a}from"@stencil/core/internal/client";import{g as l,t as o,a as r}from"./tab-a11y-ids.js";import{d as c}from"./xpl-button2.js";import{d as h}from"./xpl-icon2.js";const u=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.tabChange=e(this,"tabChange",7),this.disabled=!1,this.fullWidth=!1,this.groupDisabled=!1,this.iconPosition="start",this.selected=!1,this.variant="tabs",this.handleTabClick=()=>{this.effectivelyDisabled||this.tabChange.emit(this.target)}}async getFocusableElement(){return this.el.querySelector(this.isSegment?"xpl-button button":".xpl-tab__button")}async setTabIndex(t){const s=await this.getFocusableElement();s&&(s.tabIndex=t)}async focusTrigger(){const t=await this.getFocusableElement();null==t||t.focus()}get a11yIds(){var t;const s=l(this.el),e=null!==(t=this.target)&&void 0!==t?t:"";return{panelId:r(s,e),triggerId:o(s,e)}}get effectivelyDisabled(){return this.disabled||this.groupDisabled}get isSegment(){return"segment"===this.variant}render(){var t;const s=this.isSegment,{panelId:e,triggerId:a}=this.a11yIds,l=this.selected?"true":"false";return i(n,{class:{"xpl-tab":!0,"xpl-tab--selected":this.selected,"xpl-tab--segment":s,"xpl-tab--disabled":this.effectivelyDisabled}},s?i("xpl-button",{controlAttrs:{id:a,role:"tab","aria-controls":e,"aria-selected":l},disabled:this.effectivelyDisabled,fullWidth:this.fullWidth,icon:null!==(t=this.icon)&&void 0!==t?t:"",iconPosition:this.iconPosition,onClick:this.handleTabClick,size:"sm",type:"button",variant:this.selected?"primary":"tertiary"},i("slot",null)):i("button",{"aria-controls":e,"aria-selected":l,class:"xpl-tab__button",disabled:this.effectivelyDisabled,id:a,onClick:this.handleTabClick,role:"tab",type:"button"},i("slot",null)))}get el(){return this}},[260,"xpl-tab",{disabled:[516],fullWidth:[4,"full-width"],groupDisabled:[1540,"data-group-disabled"],icon:[513],iconPosition:[1,"icon-position"],selected:[4],target:[1],variant:[1],getFocusableElement:[64],setTabIndex:[64],focusTrigger:[64]}]),b=u,d=function(){"undefined"!=typeof customElements&&["xpl-tab","xpl-button","xpl-icon"].forEach((t=>{switch(t){case"xpl-tab":customElements.get(a(t))||customElements.define(a(t),u);break;case"xpl-button":customElements.get(a(t))||c();break;case"xpl-icon":customElements.get(a(t))||h()}}))};export{b as XplTab,d as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface XplTableBody extends Components.XplTableBody, HTMLElement {}
|
|
4
|
+
export const XplTableBody: {
|
|
5
|
+
prototype: XplTableBody;
|
|
6
|
+
new (): XplTableBody;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as t,h as c,Host as o,transformTag as l}from"@stencil/core/internal/client";const s=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost()}render(){return c(o,{key:"7320d9e105bbd49c3ce38b8c199b965a3863440c",role:"rowgroup",class:"xpl-table-body"},c("slot",{key:"3df8f5a49bca0c8b50126cb41e59e1209e57fc6b"}))}},[260,"xpl-table-body"]),b=s,n=function(){"undefined"!=typeof customElements&&["xpl-table-body"].forEach((e=>{"xpl-table-body"===e&&(customElements.get(l(e))||customElements.define(l(e),s))}))};export{b as XplTableBody,n as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface XplTableCell extends Components.XplTableCell, HTMLElement {}
|
|
4
|
+
export const XplTableCell: {
|
|
5
|
+
prototype: XplTableCell;
|
|
6
|
+
new (): XplTableCell;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{X as l,d as o}from"./xpl-table-cell2.js";const s=l,t=o;export{s as XplTableCell,t as defineCustomElement}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as l,h as t,Host as s,transformTag as a}from"@stencil/core/internal/client";const i=e(class extends l{constructor(e){super(),!1!==e&&this.__registerHost(),this.align="left",this.bold=!1,this.disabled=!1,this.underline=!1}onDisabledChange(){this.propagateDisabledToSlotted()}componentDidLoad(){this.propagateDisabledToSlotted()}propagateDisabledToSlotted(){const e=e=>{if(!function(e){switch(e.tagName){case"BUTTON":case"INPUT":case"SELECT":case"TEXTAREA":case"FIELDSET":case"OPTGROUP":case"OPTION":return!0;default:return!1}}(e))return;const l=e;l.disabled=this.disabled,this.disabled?l.setAttribute("disabled",""):l.removeAttribute("disabled")},l=t=>{Array.from(t.children).forEach((t=>{"XPL-TABLE"!==t.tagName&&(e(t),l(t))}))};l(this.el)}render(){return t(s,{key:"91700fc89eff07fc5c54474c12e3a02eb602c6c3",role:"gridcell",class:{"xpl-table-cell":!0,[`xpl-table-cell--align-${this.align}`]:!0,"xpl-table-cell--bold":this.bold,"xpl-table-cell--underline":this.underline,"xpl-table-cell--disabled":this.disabled}},t("slot",{key:"5e956de9f694db16d9f5ea89bda1ff05a15e9efa"}))}get el(){return this}static get watchers(){return{disabled:[{onDisabledChange:0}]}}},[260,"xpl-table-cell",{align:[1],bold:[4],disabled:[4],underline:[4]},void 0,{disabled:[{onDisabledChange:0}]}]);function c(){"undefined"!=typeof customElements&&["xpl-table-cell"].forEach((e=>{"xpl-table-cell"===e&&(customElements.get(a(e))||customElements.define(a(e),i))}))}export{i as X,c as d}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface XplTableFooterCell extends Components.XplTableFooterCell, HTMLElement {}
|
|
4
|
+
export const XplTableFooterCell: {
|
|
5
|
+
prototype: XplTableFooterCell;
|
|
6
|
+
new (): XplTableFooterCell;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{X as o,d as t}from"./xpl-table-footer-cell2.js";const e=o,l=t;export{e as XplTableFooterCell,l as defineCustomElement}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as l,h as t,Host as c,transformTag as o}from"@stencil/core/internal/client";const s=e(class extends l{constructor(e){super(),!1!==e&&this.__registerHost(),this.align="left"}render(){return t(c,{key:"452cb6ac0333ca57329341404343c290c63fc508",role:"gridcell",class:{"xpl-table-footer-cell":!0,[`xpl-table-footer-cell--align-${this.align}`]:!0}},t("slot",{key:"db6d5848f2aa009437317b9e71a47f0ca9245161"}))}},[260,"xpl-table-footer-cell",{align:[1]}]);function r(){"undefined"!=typeof customElements&&["xpl-table-footer-cell"].forEach((e=>{"xpl-table-footer-cell"===e&&(customElements.get(o(e))||customElements.define(o(e),s))}))}export{s as X,r as d}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface XplTableFooter extends Components.XplTableFooter, HTMLElement {}
|
|
4
|
+
export const XplTableFooter: {
|
|
5
|
+
prototype: XplTableFooter;
|
|
6
|
+
new (): XplTableFooter;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as t,h as o,Host as r,transformTag as l}from"@stencil/core/internal/client";const c=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost()}render(){return o(r,{key:"891052963f727f283783138363c9a925cb59140b",role:"rowgroup",class:"xpl-table-footer"},o("slot",{key:"df01f64a46ecd29380df26e053c2a6c246a22556"}))}},[260,"xpl-table-footer"]),s=c,n=function(){"undefined"!=typeof customElements&&["xpl-table-footer"].forEach((e=>{"xpl-table-footer"===e&&(customElements.get(l(e))||customElements.define(l(e),c))}))};export{s as XplTableFooter,n as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{T as e,d as a}from"./xpl-table-header-cell2.js";const l=e,o=a;export{l as XplTableHeaderCell,o as defineCustomElement}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as t,createEvent as l,h as s,Host as i,transformTag as a}from"@stencil/core/internal/client";import{d as c}from"./xpl-checkbox2.js";import{d as n}from"./xpl-icon2.js";const r=e=>{var t,l;if("xpl-table-header-cell"!==e.tagName.toLowerCase())return"auto";const s=e,i="string"==typeof s.columnWidth?s.columnWidth.trim():"",a=null!==(l=null===(t=e.getAttribute("column-width"))||void 0===t?void 0:t.trim())&&void 0!==l?l:"",c=i||a;if(c.length>0)return c;const n=s.width;if("number"==typeof n&&Number.isFinite(n)&&n>0)return`${Math.max(48,n)}px`;const r=e.getAttribute("width");if(null===r||""===r)return"auto";if(/^\s*\d+(\.\d+)?\s*$/.test(r)){const e=Number.parseFloat(r);return Number.isFinite(e)&&e>0?`${Math.max(48,e)}px`:"auto"}return r.trim()},h="data-xpl-selection-managed",o="data-xpl-row-reorder-managed",d=e=>{switch(e){case"asc":return"desc";case"desc":return null;default:return"asc"}},u=e=>{switch(e){case"asc":return"arrow-up";case"desc":return"arrow-down";default:return"dash"}},b=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.headerCheckboxChange=l(this,"headerCheckboxChange",7),this.headerSortChange=l(this,"headerSortChange",7),this.align="left",this.checked=!1,this.indeterminate=!1,this.label="",this.sortable=!1,this.type="label",this.onHeaderInnerCheckboxChange=e=>{const{detail:t}=e,l="boolean"==typeof t?t:Boolean(t);this.headerCheckboxChange.emit(l)},this.onSortActivate=e=>{if(e.preventDefault(),e.stopPropagation(),!this.sortable||"label"!==this.type)return;const t=this.getColumnIndex0(),l=this.getSortKeySlug();this.el.closest("xpl-table")||(this.sortDirection=d(this.sortDirection)),this.headerSortChange.emit({columnIndex:t,sortKey:l})}}watchColumnWidth(){this.notifyColumnWidthsChange()}watchWidth(){this.notifyColumnWidthsChange()}componentDidLoad(){this.notifyColumnWidthsChange()}notifyColumnWidthsChange(){this.el.dispatchEvent(new CustomEvent("xplTableColumnWidthsChange",{bubbles:!0,composed:!0}))}getColumnIndex0(){var e,t;return Array.from(null!==(t=null===(e=this.el.parentElement)||void 0===e?void 0:e.children)&&void 0!==t?t:[]).indexOf(this.el)}getSortKeySlug(){var e,t;const l=(null!==(t=null!==(e=this.sortKey)&&void 0!==e?e:this.label)&&void 0!==t?t:"").trim();return l.length>0?l.replace(/ /g,"-").toLowerCase():`column-${this.getColumnIndex0()}`}renderLabelContent(){if(this.sortable){const e="asc"===this.sortDirection?"arrow-up":"arrow-down",t="asc"===this.sortDirection||"desc"===this.sortDirection;return s("button",{type:"button",class:"xpl-table-header-cell__sort",onClick:this.onSortActivate},s("span",{class:"xpl-table-header-cell__text"},s("slot",null,this.label)),s("xpl-icon",{class:{"xpl-table-header-cell__sort-icon":!0,"xpl-table-header-cell__sort-icon--active":t,"xpl-table-header-cell__sort-icon--default":!t},icon:e,size:16}))}return s("span",{class:"xpl-table-header-cell__text"},s("slot",null,this.label))}render(){const e=this.getColumnIndex0()+1,t=`xpl-table-header-cell--align-${"checkbox"!==this.type&&"icon"!==this.type||"left"!==this.align?this.align:"center"}`,l="label"===this.type&&this.sortable?"asc"===this.sortDirection?"ascending":"desc"===this.sortDirection?"descending":"none":void 0;return s(i,{role:"columnheader","aria-colindex":e,class:{"xpl-table-header-cell":!0,[t]:!0,"xpl-table-header-cell--checkbox":"checkbox"===this.type,"xpl-table-header-cell--icon":"icon"===this.type,"xpl-table-header-cell--empty":"empty"===this.type,"xpl-table-header-cell--sortable":this.sortable&&"label"===this.type},"aria-checked":"checkbox"===this.type?this.indeterminate?"mixed":this.checked?"true":"false":void 0,"aria-sort":l},"empty"===this.type?null:(()=>{var e;switch(this.type){case"label":return this.renderLabelContent();case"checkbox":return s("xpl-checkbox",{ariaLabel:null!==(e=this.checkboxAriaLabel)&&void 0!==e?e:"Select all rows",checked:this.checked,indeterminate:this.indeterminate,onCheckboxChange:this.onHeaderInnerCheckboxChange});case"icon":return s("xpl-icon",{icon:this.icon,size:20});case"empty":return null;default:return""}})())}get el(){return this}static get watchers(){return{columnWidth:[{watchColumnWidth:0}],width:[{watchWidth:0}]}}},[260,"xpl-table-header-cell",{align:[1],checkboxAriaLabel:[1,"checkbox-aria-label"],checked:[4],columnWidth:[513,"column-width"],icon:[1],indeterminate:[4],label:[1],sortable:[4],sortDirection:[1537,"sort-direction"],sortKey:[1,"sort-key"],type:[1],width:[514]},void 0,{columnWidth:[{watchColumnWidth:0}],width:[{watchWidth:0}]}]);function p(){"undefined"!=typeof customElements&&["xpl-table-header-cell","xpl-checkbox","xpl-icon"].forEach((e=>{switch(e){case"xpl-table-header-cell":customElements.get(a(e))||customElements.define(a(e),b);break;case"xpl-checkbox":customElements.get(a(e))||c();break;case"xpl-icon":customElements.get(a(e))||n()}}))}export{o as R,h as S,b as T,u as a,d as c,p as d,r as g}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as t,h as
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as t,h as c,Host as r,transformTag as l}from"@stencil/core/internal/client";const s=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost()}render(){return c(r,{key:"70eac99819cc3acbbfb54607fc657fb27bd26b4b",role:"rowgroup",class:"xpl-table-header"},c("slot",{key:"9c46b25d247603f8c87a3994615bd45c617d9bb9"}))}},[260,"xpl-table-header"]),n=s,o=function(){"undefined"!=typeof customElements&&["xpl-table-header"].forEach((e=>{"xpl-table-header"===e&&(customElements.get(l(e))||customElements.define(l(e),s))}))};export{n as XplTableHeader,o as defineCustomElement}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface XplTableRow extends Components.XplTableRow, HTMLElement {}
|
|
4
|
+
export const XplTableRow: {
|
|
5
|
+
prototype: XplTableRow;
|
|
6
|
+
new (): XplTableRow;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as t,h as s,Host as i,transformTag as l}from"@stencil/core/internal/client";function a(e){return"XPL-TABLE-CELL"===e.nodeName}const o=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.disabled=!1,this.selected=!1}onDisabledChange(){this.propagateDisabledToCells()}connectedCallback(){"undefined"!=typeof MutationObserver&&(this.cellObserver=new MutationObserver((e=>{e.forEach((e=>{"childList"===e.type&&e.addedNodes.forEach((e=>{a(e)&&(e.disabled=this.disabled)}))}))})),this.cellObserver.observe(this.el,{childList:!0}))}disconnectedCallback(){var e;null===(e=this.cellObserver)||void 0===e||e.disconnect(),this.cellObserver=void 0}componentDidLoad(){this.propagateDisabledToCells()}propagateDisabledToCells(){Array.from(this.el.children).filter(a).forEach((e=>{e.disabled=this.disabled}))}render(){return s(i,{key:"4abcdcd80a317aec5d2a131d9e8d0331f434e989",role:"row",class:{"xpl-table-row":!0,"xpl-table-row--disabled":this.disabled,"xpl-table-row--selected":this.selected}},s("slot",{key:"b2530a240b2e4c7eb4fb4a7691a86242eb9aee16"}))}get el(){return this}static get watchers(){return{disabled:[{onDisabledChange:0}]}}},[260,"xpl-table-row",{disabled:[4],rowId:[513,"row-id"],selected:[4]},void 0,{disabled:[{onDisabledChange:0}]}]),n=o,d=function(){"undefined"!=typeof customElements&&["xpl-table-row"].forEach((e=>{"xpl-table-row"===e&&(customElements.get(l(e))||customElements.define(l(e),o))}))};export{n as XplTableRow,d as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as t,HTMLElement as s,createEvent as e,h as i,Host as h,transformTag as a}from"@stencil/core/internal/client";import{d as l}from"./xpl-icon2.js";const c=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.tableSelect=e(this,"tableSelect",7),this.sortChanged=e(this,"sortChanged",3),this.selectedValues=[],this.isSortable=!1,this.sortableColumns=[],this.areAllSelected=!1,this.hasScrolled=!1,this.sortTypeArray=[],this.selectAllValue=Math.random().toString(36).slice(2),this.selectAll=t=>{const{target:s}=t;if(!(s instanceof HTMLInputElement))return;const{checked:e}=s;this.areAllSelected=e,this.selected=this.selectedValues.length>0?Array.from(this.el.querySelectorAll("tbody td:first-child input")).map((t=>e?null==t?void 0:t.value:e)):this.selected.map((()=>e)),this.onChange()},this.selectOne=(t,s)=>{const{target:e}=t;if(!(e instanceof HTMLInputElement))return;const{checked:i,value:h}=e;this.areAllSelected=!1,this.selected=this.selected.map(((t,e)=>e!==s?t:this.selectedValues.length>0&&i?h:i)),this.onChange()},this.onChange=()=>{this.tableSelect.emit({selected:this.selected,areAllSelected:this.areAllSelected})},this.onScroll=()=>{this.hasScrolled=this.container.scrollLeft>0},this.sortBy=(t,s)=>{const e=(s,e)=>s[t].toLocaleLowerCase()<e[t].toLocaleLowerCase()?-1:s[t].toLocaleLowerCase()>e[t].toLocaleLowerCase()?1:0;switch(s[t]){case"asc":this.rowData.sort(((t,s)=>e(t,s)));break;case"desc":this.rowData.sort(((t,s)=>e(s,t)));break;default:this.rowData=this.data,this.sortTypeArray[t]=null}this.rowData=Array.from(this.rowData),this.render()},this.setData=()=>{this.rowData=void 0!==this.data?Array.from(this.data):[]},this.setFooterData=()=>{this.rowFooterData=void 0!==this.footer?Array.from(this.footer):[]}}handleSort(t,s,e,i){t.preventDefault(),t.stopPropagation(),s&&(this.sortTypeArray=this.sortTypeArray.map(((t,s)=>{if(s!==e)return null;switch(t){case"asc":return"desc";case"desc":return null;default:return"asc"}})),this.sortChanged.emit({colNum:e,colName:i,sortTypeArr:this.sortTypeArray}).defaultPrevented||this.sortBy(e,this.sortTypeArray))}watchData(){this.setData()}watchFooterData(){this.setFooterData()}watchColumns(){this.sortTypeArray=this.columns?this.columns.map((()=>null)):[]}componentWillLoad(){this.areAllSelected=!1,this.setData(),this.setFooterData(),this.selected=Array(this.rowData.length).fill(!1),this.sortTypeArray=this.columns?this.columns.map((()=>null)):[]}render(){var t;return!this.columns||this.sortTypeArray&&this.sortTypeArray.length===this.columns.length||(this.sortTypeArray=this.columns.map((()=>null))),i(h,{key:"eb52da2b523707a53c0bb414dda75197907e71af"},i("div",{key:"0f5bf430701ad905c4d918ee9039db52c19eb01c",class:"xpl-table-container",onScroll:this.onScroll,ref:t=>{this.container=t}},i("table",{key:"bdbb2c47a7bf119b46417118f334ba861960313d",class:{"xpl-table":!0,"xpl-table--striped":this.striped,"xpl-table--freeze":this.freeze,"xpl-table--has-scrolled":this.hasScrolled}},this.columns&&i("thead",{key:"a868be75efee1ec20d4845e8219a49ab1fae8aca"},this.columns.map(((t,s)=>{var e;const h=(t=>{switch(t){case"asc":return"arrow-up";case"desc":return"arrow-down";default:return"dash"}})(null===(e=this.sortTypeArray)||void 0===e?void 0:e[s]),a=!(!this.isSortable||!this.sortableColumns[s]);return i("th",null,i("label",{onClick:e=>this.handleSort(e,a,s,t.replace(/ /g,"-").toLowerCase()),class:a?"cursor-pointer":""},this.multiselect&&0===s&&i("input",{checked:this.areAllSelected,id:"__xpl-table-th",indeterminate:!this.areAllSelected&&this.selected.some((t=>t)),onClick:t=>{t.stopPropagation(),this.selectAll(t)},type:"checkbox",value:"select-all-"+this.selectAllValue}),t,a&&!!this.sortTypeArray[s]&&i("xpl-icon",{icon:h,size:16})))}))),i("tbody",{key:"8324eda16235ba66f2aa3bebc073a10a91a32518"},this.rowData.map(((t,s)=>i("tr",{class:this.selected&&this.selected[s]?"xpl-table-row-selected":""},t.map(((t,e)=>i("td",null,this.multiselect&&0===e?i("label",{htmlFor:"__xpl-table-row-"+s},i("input",{id:"__xpl-table-row-"+s,checked:!!this.selected[s],type:"checkbox",onChange:t=>this.selectOne(t,s),value:this.selectedValues.length>0?this.selectedValues[s]:"xpl-table-checkbox-"+s}),i("div",{innerHTML:t})):i("div",{innerHTML:t})))))))),(null===(t=this.rowFooterData)||void 0===t?void 0:t.length)>0&&i("tfoot",{key:"d3c55c0585359a28a51a8b0196c4e9841bc86919"},this.rowFooterData.map((t=>i("tr",null,t.map((t=>i("td",null,i("div",{innerHTML:t})))))))))))}get el(){return this}static get watchers(){return{data:[{watchData:0}],footer:[{watchFooterData:0}],columns:[{watchColumns:0}]}}},[0,"xpl-table",{columns:[16],data:[16],footer:[16],freeze:[4],multiselect:[4],striped:[4],selectedValues:[16],isSortable:[4,"is-sortable"],sortableColumns:[16],areAllSelected:[32],rowData:[32],rowFooterData:[32],hasScrolled:[32],selected:[32],sortTypeArray:[32]},void 0,{data:[{watchData:0}],footer:[{watchFooterData:0}],columns:[{watchColumns:0}]}]),r=c,o=function(){"undefined"!=typeof customElements&&["xpl-table","xpl-icon"].forEach((t=>{switch(t){case"xpl-table":customElements.get(a(t))||customElements.define(a(t),c);break;case"xpl-icon":customElements.get(a(t))||l()}}))};export{r as XplTable,o as defineCustomElement}
|
|
1
|
+
import{proxyCustomElement as t,HTMLElement as e,createEvent as l,h as r,Host as i,transformTag as s}from"@stencil/core/internal/client";import{T as o}from"./lifecycle.js";import{R as n,S as a,c as h,g as c,a as d,d as u}from"./xpl-table-header-cell2.js";import{d as p}from"./xpl-checkbox2.js";import{d as b}from"./xpl-icon2.js";import{d as x}from"./xpl-table-cell2.js";import{d as f}from"./xpl-table-footer-cell2.js";function w(t){const e=t.parentElement;if(!e)return null;const l=Array.from(e.children),r=l.indexOf(t);if(-1===r)return null;for(let t=r+1;t<l.length;t+=1){const e=l[t];if("xpl-table-row"===e.tagName.toLowerCase()&&!e.hasAttribute("hidden"))return e}return null}function v(t){return function(t){const e=t instanceof HTMLElement?t:null;if(!e)return null;const l=e.closest("xpl-table-row");return null!=l?l:null}(t)}function y(t){const l=("function"==typeof t.composedPath?t.composedPath():[]).find((t=>t instanceof e&&"xpl-table-row"===t.tagName.toLowerCase()));return null!=l?l:v(t.target)}const g=t(class t extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.rowOrderChange=l(this,"rowOrderChange",3),this.rowSelectionChange=l(this,"rowSelectionChange",3),this.sortChanged=l(this,"sortChanged",3),this.tableSelect=l(this,"tableSelect",7),this.columnWidthsToken="",this.lastEmittedRowSelectionKey="",this.selectAllValue=Math.random().toString(36).slice(2),this.draggedRow=null,this.pendingDragRow=null,this.pointerUpClearPending=null,this.reorderKeyboardTimers=new o,this.onReorderHandleKeydown=t=>{this.handleReorderHandleKeyDown(t)},this.areAllSelected=!1,this.colCount=0,this.hasScrolled=!1,this.keyboardReorderRowId=null,this.reorderLiveMessage="",this.rowData=[],this.rowFooterData=[],this.selected=[],this.selectedRowIds=[],this.sortTypeArray=[],this.isSortable=!1,this.selectedValues=[],this.sortableColumns=[],this.onGridScroll=t=>{this.hasScrolled=t.target.scrollLeft>0},this.selectAll=t=>{const{target:e}=t;if(!(e instanceof HTMLInputElement))return;const{checked:l}=e;this.areAllSelected=l,this.selected=this.selectedValues.length>0?Array.from(this.el.querySelectorAll("tbody td:first-child input")).map((t=>l?null==t?void 0:t.value:l)):this.selected.map((()=>l)),this.onSelectionChange()},this.selectOne=(t,e)=>{const{target:l}=t;if(!(l instanceof HTMLInputElement))return;const{checked:r,value:i}=l;this.areAllSelected=!1,this.selected=this.selected.map(((t,l)=>l!==e?t:this.selectedValues.length>0&&r?i:r)),this.onSelectionChange()},this.onSelectionChange=()=>{this.tableSelect.emit({selected:this.selected,areAllSelected:this.areAllSelected})},this.onLegacyScroll=()=>{this.hasScrolled=this.container.scrollLeft>0},this.sortBy=(t,e)=>{const l=(e,l)=>e[t].toLocaleLowerCase()<l[t].toLocaleLowerCase()?-1:e[t].toLocaleLowerCase()>l[t].toLocaleLowerCase()?1:0;switch(e[t]){case"asc":this.rowData.sort(((t,e)=>l(t,e)));break;case"desc":this.rowData.sort(((t,e)=>l(e,t)));break;default:this.rowData=this.data,this.sortTypeArray[t]=null}this.rowData=Array.from(this.rowData)},this.setData=()=>{this.rowData=void 0!==this.data?Array.from(this.data):[]},this.setFooterData=()=>{this.rowFooterData=void 0!==this.footer?Array.from(this.footer):[]}}watchColumns(){this.sortTypeArray=this.columns?this.columns.map((()=>null)):[]}watchData(){this.setData()}watchFooterData(){this.setFooterData()}watchReorderHandleIcon(){!this.isLegacyMode&&this.rowReorderable&&this.syncInjectedReorderHandleIcons()}watchReorderHandleIconKeyboard(){!this.isLegacyMode&&this.rowReorderable&&this.syncInjectedReorderHandleIcons()}watchRowReorderable(t){this.isLegacyMode||t||(this.keyboardReorderRowId=null,this.syncReorderHandleKeyboardA11y(null),this.removeManagedReorderCells(),this.draggedRow=null,this.pendingDragRow=null,this.clearPendingDragListeners(),this.reorderLiveMessage="",this.queryBodyRows().forEach((t=>{var e;t.removeAttribute("draggable"),null===(e=t.querySelector(".xpl-table__row-drag-handle"))||void 0===e||e.removeAttribute("draggable"),t.classList.remove("xpl-table-row--dragging","xpl-table-row--drag-over")})),this.colCount=0,this.columnWidthsToken="")}watchSelectable(t){this.isLegacyMode||t||(this.selectedRowIds=[],this.lastEmittedRowSelectionKey="",this.colCount=0,this.columnWidthsToken="",this.syncRowSelectedProps())}componentWillLoad(){this.isLegacyMode&&(this.areAllSelected=!1,this.setData(),this.setFooterData(),this.selected=Array(this.rowData.length).fill(!1),this.sortTypeArray=this.columns?this.columns.map((()=>null)):[])}componentDidLoad(){this.isLegacyMode||this.syncCompositionalLayout()}componentDidUpdate(){this.isLegacyMode||this.syncCompositionalLayout()}disconnectedCallback(){this.clearPendingDragListeners(),this.detachReorderHandleKeydownListeners(),this.reorderKeyboardTimers.dispose(),void 0!==this.reorderAnnounceRaf&&(cancelAnimationFrame(this.reorderAnnounceRaf),this.reorderAnnounceRaf=void 0)}handleHeaderCellColumnWidthsChange(t){if(this.isLegacyMode)return;const e=t.target;e instanceof Node&&this.el.contains(e)&&this.updateColumnWidths()}handleCompositionalCheckboxChange(l){var r,i;if(this.isLegacyMode||!this.selectable)return;if(!this.isEventFromThisTable(l.target))return;const s=null!==(i=null===(r=l.composedPath)||void 0===r?void 0:r.call(l))&&void 0!==i?i:[];let o=(s.length>0?s:[l.target].filter((t=>null!=t))).find((t=>t instanceof e&&"xpl-checkbox"===t.tagName.toLowerCase()));if(!o&&l.target&&"function"==typeof l.target.closest&&(o=l.target.closest("xpl-checkbox")),!o||!this.el.contains(o))return;const n=o.closest("xpl-table-row");if(!n||!this.isDirectChildBodyRow(n))return;const a=o.closest("xpl-table-cell");if(!a)return;const h=this.getSelectionColumnIndex();if(null===h)return;if(t.getBodyRowCells(n).indexOf(a)!==h)return;l.stopPropagation();const c=t.getRowIdForRow(n);if(!c||n.disabled)return;const d=o.querySelector('input[type="checkbox"]');if(!d)return;const{checked:u}=d;u?this.selectedRowIds.includes(c)||(this.selectedRowIds=[...this.selectedRowIds,c]):this.selectedRowIds=this.selectedRowIds.filter((t=>t!==c)),this.applyHeaderCheckboxState(),this.syncRowSelectedProps(),this.emitCompositionalSelection()}handleCompositionalHeaderCheckboxChange(l){var r,i;if(this.isLegacyMode||!this.selectable)return;if(!this.isEventFromThisTable(l.target))return;const s=null!==(i=null===(r=l.composedPath)||void 0===r?void 0:r.call(l))&&void 0!==i?i:[];let o=(s.length>0?s:[l.target].filter((t=>null!=t))).find((t=>t instanceof e&&"xpl-table-header-cell"===t.tagName.toLowerCase()&&"checkbox"===t.getAttribute("type")));if(!o&&l.target&&"function"==typeof l.target.closest&&(o=l.target.closest('xpl-table-header-cell[type="checkbox"]')),!o||!this.el.contains(o))return;if(!this.isCellInOurCompositionalHeader(o))return;if(!this.getCompositionalHeaderCells().includes(o))return;const n=!!l.detail,a=this.querySelectableBodyRows().map((e=>t.getRowIdForRow(e))).filter((t=>!!t));this.selectedRowIds=n?[...a]:[],this.applyBodyCheckboxStates(),this.syncRowSelectedProps(),this.emitCompositionalSelection()}handlePointerDownExitKeyboardReorder(t){if(this.isLegacyMode||!this.rowReorderable||null===this.keyboardReorderRowId)return;const e=t.target;if(!(e instanceof Node&&this.el.contains(e)))return;const l=e instanceof Element?e.closest("xpl-table-row"):null;l&&this.isDirectChildBodyRow(l)&&(this.keyboardReorderRowId=null,this.syncReorderHandleKeyboardA11y(null))}handleReorderHandleKeyDown(l){var r;if(this.isLegacyMode||!this.rowReorderable)return;const i="function"==typeof l.composedPath?l.composedPath():[];let s=(i.length>0?i:l.target?[l.target]:[]).find((t=>t instanceof e&&t.classList.contains("xpl-table__row-drag-handle")));if(!s&&l.target instanceof e&&l.target.classList.contains("xpl-table__row-drag-handle")&&(s=l.target),!s||!this.el.contains(s))return;const o=s.closest("xpl-table-row");if(!o||!this.isDirectChildBodyRow(o))return;const n=null!==(r=t.getRowIdForRow(o))&&void 0!==r?r:"";if(!n)return;const a=this.keyboardReorderRowId===n,h="Escape"===l.key||"Esc"===l.key||"Escape"===l.code||27===l.keyCode;o.disabled?h&&a&&(l.preventDefault(),this.keyboardReorderRowId=null,this.syncReorderHandleKeyboardA11y(null)):h?a&&(l.preventDefault(),this.keyboardReorderRowId=null,this.syncReorderHandleKeyboardA11y(null)):a?"ArrowUp"!==l.key&&"ArrowDown"!==l.key||(l.preventDefault(),this.performKeyboardRowReorder(n,"ArrowUp"===l.key?"up":"down")):"Enter"!==l.key&&" "!==l.key||(l.preventDefault(),this.keyboardReorderRowId=n,this.syncReorderHandleKeyboardA11y(n))}handleRowReorderPointerDown(t){if(this.isLegacyMode||!this.rowReorderable)return;const l=function(t){const l=("function"==typeof t.composedPath?t.composedPath():[]).find((t=>t instanceof e&&t.classList.contains("xpl-table__row-drag-handle")));return null!=l?l:null}(t);if(!l)return;if(l.closest("xpl-table")!==this.el)return;const r=v(l);if(!r||r.disabled)return;const i=this.getDirectChildTableSection("xpl-table-body");if(!i||r.parentElement!==i)return;this.clearPendingDragListeners(),this.pendingDragRow=r;const s=()=>{this.clearPendingDragListeners(),this.pendingDragRow=null};document.addEventListener("pointerup",s,!0),document.addEventListener("pointercancel",s,!0),this.pointerUpClearPending=()=>{document.removeEventListener("pointerup",s,!0),document.removeEventListener("pointercancel",s,!0)}}handleRowReorderDragStart(e){var l;if(this.isLegacyMode||!this.rowReorderable)return;const r=y(e);if(!r)return;if(r.closest("xpl-table")!==this.el)return;const i=this.getDirectChildTableSection("xpl-table-body");i&&r.parentElement===i&&(r.disabled||this.pendingDragRow!==r?e.preventDefault():(this.keyboardReorderRowId=null,this.syncReorderHandleKeyboardA11y(null),this.clearPendingDragListeners(),this.pendingDragRow=null,this.draggedRow=r,e.dataTransfer&&(e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",null!==(l=t.getRowIdForRow(r))&&void 0!==l?l:"")),r.classList.add("xpl-table-row--dragging")))}handleRowReorderDragEnd(t){if(this.isLegacyMode||!this.rowReorderable)return;const e=y(t);e&&e.closest("xpl-table")===this.el&&(e.classList.remove("xpl-table-row--dragging"),this.clearReorderDragOverClasses(),this.draggedRow=null)}handleRowReorderDragOver(t){if(this.isLegacyMode||!this.rowReorderable)return;const e=y(t);if(!e||e.closest("xpl-table")!==this.el)return;const l=this.getDirectChildTableSection("xpl-table-body");l&&e.parentElement===l&&!e.disabled&&(t.preventDefault(),t.dataTransfer&&(t.dataTransfer.dropEffect="move"))}handleRowReorderDragEnter(t){if(this.isLegacyMode||!this.rowReorderable)return;const e=y(t);if(!e||e.closest("xpl-table")!==this.el)return;const l=this.getDirectChildTableSection("xpl-table-body");l&&e.parentElement===l&&!e.disabled&&(t.preventDefault(),e.classList.add("xpl-table-row--drag-over"))}handleRowReorderDragLeave(t){if(this.isLegacyMode||!this.rowReorderable)return;const e=y(t);if(!e||e.closest("xpl-table")!==this.el)return;const l=t.relatedTarget;l&&e.contains(l)||e.classList.remove("xpl-table-row--drag-over")}handleRowReorderDrop(e){var l;if(this.isLegacyMode||!this.rowReorderable)return;e.preventDefault();const r=y(e);if(!r||r.closest("xpl-table")!==this.el)return;const i=this.getDirectChildTableSection("xpl-table-body");if(!i||r.parentElement!==i||r.disabled)return;const s=this.draggedRow;if(!s||s.disabled)return this.draggedRow=null,void this.clearReorderDragOverClasses();if(s===r)return void this.clearReorderDragOverClasses();const o=this.getVisibleBodyRowsForReorder(),n=o.indexOf(s),a=o.indexOf(r);if(-1===n||-1===a)return void this.clearReorderDragOverClasses();const h=n>a?"up":"down",c=null!==(l=t.getRowIdForRow(s))&&void 0!==l?l:"";!function(t,e,l){if(e===l||e.parentElement!==t)return;if(l.parentElement!==t)return;const r=Array.from(t.children).filter((t=>"xpl-table-row"===t.tagName.toLowerCase()&&!t.hasAttribute("hidden"))),i=r.indexOf(e),s=r.indexOf(l);if(-1!==i&&-1!==s&&i!==s)if(i<s){const r=w(l);t.insertBefore(e,r||null)}else t.insertBefore(e,l)}(i,s,r);const d=this.getVisibleBodyRowsForReorder().map((e=>{var l;return null!==(l=t.getRowIdForRow(e))&&void 0!==l?l:""}));this.rowOrderChange.emit({rowId:c,direction:h,orderedRowIds:d,fromIndex:n,toIndex:a}),this.announceRowReorder(c,d),this.clearReorderDragOverClasses(),this.selectable&&(this.applyBodyCheckboxStates(),this.applyHeaderCheckboxState(),this.syncRowSelectedProps()),this.updateColumnWidths()}get isLegacyMode(){return void 0!==this.columns||void 0!==this.data||void 0!==this.footer}ensureTableInstanceId(){this.tableInstanceId||(this.tableInstanceId="undefined"!=typeof crypto&&crypto.randomUUID?crypto.randomUUID():Math.random().toString(36).slice(2))}generateRowId(){return this.ensureTableInstanceId(),"undefined"!=typeof crypto&&crypto.randomUUID?`${this.tableInstanceId}-${crypto.randomUUID()}`:`${this.tableInstanceId}-${Math.random().toString(36).slice(2)}`}syncCompositionalLayout(){this.isLegacyMode||(this.rowReorderable?this.syncReorderColumn():this.removeManagedReorderCells(),this.selectable&&(this.ensureTableInstanceId(),this.pruneStaleSelectedRowIds(),this.ensureBodyRowIds(),this.applyBodyCheckboxStates(),this.applyHeaderCheckboxState(),this.syncRowSelectedProps()),this.rowReorderable&&this.selectable&&this.normalizeManagedColumnsOrder(),this.updateColumnWidths())}getDirectChildTableSection(t){var e;return null!==(e=Array.from(this.el.children).find((e=>e.tagName.toLowerCase()===t)))&&void 0!==e?e:null}isDirectChildBodyRow(t){const e=this.getDirectChildTableSection("xpl-table-body");return null!==e&&t.parentElement===e}isCellInOurCompositionalHeader(t){const e=t.closest("xpl-table-header");return null!==e&&e.parentElement===this.el}getSelectionColumnIndex(){const t=this.getCompositionalHeaderCells().findIndex((t=>"checkbox"===t.getAttribute("type")));return t>=0?t:null}static getBodyRowCells(t){return Array.from(t.children).filter((t=>"xpl-table-cell"===t.tagName.toLowerCase()))}queryBodyRows(){const t=this.getDirectChildTableSection("xpl-table-body");return t?Array.from(t.children).filter((t=>"xpl-table-row"===t.tagName.toLowerCase())):[]}querySelectableBodyRows(){return this.queryBodyRows().filter((t=>!t.disabled))}static getRowIdForRow(t){var e;return(null===(e=t.getAttribute("row-id"))||void 0===e?void 0:e.trim())||null}ensureBodyRowIds(){this.queryBodyRows().forEach((e=>{t.getRowIdForRow(e)||e.setAttribute("row-id",this.generateRowId())}))}removeManagedReorderCells(){this.el.querySelectorAll(`[${n}]`).forEach((t=>{var e;t instanceof Element&&t.closest("xpl-table")===this.el&&(null===(e=t.parentElement)||void 0===e||e.removeChild(t))}))}getSelectionSlotCellForReorderOrder(t){const e=this.getSelectionColumnIndex();if(null===e)return null;const l=Array.from(t.children)[e];if(!l)return null;const r=l.tagName.toLowerCase();return"xpl-table-header-cell"===r?"checkbox"===l.getAttribute("type")?l:null:"xpl-table-cell"===r?l.hasAttribute(a)||l.querySelector("xpl-checkbox")?l:null:"xpl-table-footer-cell"===r?l:null}normalizeManagedColumnsOrder(){var t;const e=t=>{const e=t.querySelector(`:scope > [${n}]`),l=this.getSelectionSlotCellForReorderOrder(t);if(!e||!l)return;const r=Array.from(t.children);r.indexOf(e)>r.indexOf(l)&&t.insertBefore(e,l)},l=null!==(t=Array.from(this.el.children).find((t=>"xpl-table-header"===t.tagName.toLowerCase())))&&void 0!==t?t:null;if(l){const t=Array.from(l.children).find((t=>"xpl-table-row"===t.tagName.toLowerCase()));e(null!=t?t:l)}this.queryBodyRows().forEach((t=>e(t)));const r=this.getDirectChildTableSection("xpl-table-footer");r&&Array.from(r.children).filter((t=>"xpl-table-row"===t.tagName.toLowerCase())).forEach((t=>e(t)))}syncReorderColumn(){this.rowReorderable&&!this.isLegacyMode&&(this.ensureBodyRowIds(),this.ensureHeaderReorderCell(),this.ensureBodyReorderCells(),this.ensureFooterReorderCells(),this.applyReorderRowDraggableState())}ensureHeaderReorderCell(){var t;const e=null!==(t=Array.from(this.el.children).find((t=>"xpl-table-header"===t.tagName.toLowerCase())))&&void 0!==t?t:null;if(!e)return;const l=Array.from(e.children).find((t=>"xpl-table-row"===t.tagName.toLowerCase())),r=null!=l?l:e;if(Array.from(r.children).some((t=>"xpl-table-header-cell"===t.tagName.toLowerCase()&&t.hasAttribute(n))))return;const i=document.createElement("xpl-table-header-cell");i.setAttribute(n,""),i.setAttribute("type","empty"),i.setAttribute("width","48"),i.setAttribute("align","center"),r.insertBefore(i,r.firstChild)}ensureBodyReorderCells(){this.queryBodyRows().forEach((e=>{var l;const r=Array.from(e.children).filter((t=>"xpl-table-cell"===t.tagName.toLowerCase()&&t.hasAttribute(n)));if(r.length>1)for(let t=1;t<r.length;t+=1)r[t].remove();let i=r[0];if(i)i.setAttribute("align","center");else{const r=document.createElement("xpl-table-cell");r.setAttribute(n,""),r.setAttribute("width","48"),r.setAttribute("align","center");const s=document.createElement("button");s.type="button",s.className="xpl-table__row-drag-handle",s.setAttribute("aria-label","Reorder row"),s.setAttribute("aria-pressed","false");const o=this.getResolvedIconForRow(null!==(l=t.getRowIdForRow(e))&&void 0!==l?l:"");if(o){const t=document.createElement("xpl-icon");t.setAttribute("icon",o),t.setAttribute("size","16"),s.appendChild(t)}r.appendChild(s),e.insertBefore(r,e.firstChild),i=r}const s=i.querySelector(".xpl-table__row-drag-handle");s&&(s.disabled=e.disabled)})),this.syncInjectedReorderHandleIcons(),this.attachReorderHandleKeydownListeners()}getResolvedIconForRow(t){var e,l;return null!==this.keyboardReorderRowId&&""!==t&&t===this.keyboardReorderRowId?""===this.reorderHandleIconKeyboard?null:null!==(e=this.reorderHandleIconKeyboard)&&void 0!==e?e:"caret-expand-y":""===this.reorderHandleIcon?null:null!==(l=this.reorderHandleIcon)&&void 0!==l?l:"grip-dots-vertical"}syncInjectedReorderHandleIcons(){this.queryBodyRows().forEach((e=>{var l;const r=e.querySelector(".xpl-table__row-drag-handle");if(!r)return;const i=null!==(l=t.getRowIdForRow(e))&&void 0!==l?l:"",s=this.getResolvedIconForRow(i);if(r.querySelectorAll("xpl-icon").forEach((t=>t.remove())),s){const t=document.createElement("xpl-icon");t.setAttribute("icon",s),t.setAttribute("size","16"),r.appendChild(t)}}))}syncReorderHandleKeyboardA11y(e){!this.isLegacyMode&&this.rowReorderable&&(this.queryBodyRows().forEach((l=>{var r;const i=l.querySelector(".xpl-table__row-drag-handle");if(!i)return;const s=null!==(r=t.getRowIdForRow(l))&&void 0!==r?r:"",o=null!==e&&s===e;i.classList.toggle("xpl-table__row-drag-handle--keyboard-mode",o),i.setAttribute("aria-pressed",o?"true":"false"),i.setAttribute("aria-label",o?"Press arrow up or down to reorder, Escape to exit":"Press Enter or Space to activate keyboard reorder mode, or drag to reorder")})),this.syncInjectedReorderHandleIcons())}attachReorderHandleKeydownListeners(){!this.isLegacyMode&&this.rowReorderable&&this.queryBodyRows().forEach((t=>{const e=t.querySelector(".xpl-table__row-drag-handle");e&&"true"!==e.dataset.xplReorderKbdBound&&(e.dataset.xplReorderKbdBound="true",e.addEventListener("keydown",this.onReorderHandleKeydown))}))}detachReorderHandleKeydownListeners(){this.el&&this.el.querySelectorAll('.xpl-table__row-drag-handle[data-xpl-reorder-kbd-bound="true"]').forEach((t=>{t.removeEventListener("keydown",this.onReorderHandleKeydown),delete t.dataset.xplReorderKbdBound}))}performKeyboardRowReorder(e,l){const r=this.getDirectChildTableSection("xpl-table-body");if(!r)return!1;const i=this.getVisibleBodyRowsForReorder(),s=i.findIndex((l=>t.getRowIdForRow(l)===e));if(-1===s)return!1;const o="up"===l?s-1:s+1;if(o<0||o>=i.length)return!1;const n=s,a=i[s],h=i[o];if("up"===l)r.insertBefore(a,h);else{const t=w(h);t?r.insertBefore(a,t):r.appendChild(a)}const c=this.getVisibleBodyRowsForReorder().map((e=>{var l;return null!==(l=t.getRowIdForRow(e))&&void 0!==l?l:""})),d=c.indexOf(e);return this.rowOrderChange.emit({rowId:e,direction:l,orderedRowIds:c,fromIndex:n,toIndex:d}),this.announceRowReorder(e,c),this.clearReorderDragOverClasses(),this.selectable&&(this.applyBodyCheckboxStates(),this.applyHeaderCheckboxState(),this.syncRowSelectedProps()),this.updateColumnWidths(),this.reorderKeyboardTimers.requestAnimationFrame((()=>{if(!this.el.isConnected)return;const l=this.getVisibleBodyRowsForReorder().find((l=>t.getRowIdForRow(l)===e)),r=null==l?void 0:l.querySelector(".xpl-table__row-drag-handle");null==r||r.focus()})),!0}ensureFooterReorderCells(){const t=this.getDirectChildTableSection("xpl-table-footer");t&&Array.from(t.children).filter((t=>"xpl-table-row"===t.tagName.toLowerCase())).forEach((t=>{if(Array.from(t.children).some((t=>"xpl-table-footer-cell"===t.tagName.toLowerCase()&&t.hasAttribute(n))))return;const e=document.createElement("xpl-table-footer-cell");e.setAttribute(n,""),e.setAttribute("width","48"),e.setAttribute("align","center"),t.insertBefore(e,t.firstChild)}))}static supportsSubgridBodyRow(){return"undefined"!=typeof CSS&&"function"==typeof CSS.supports&&CSS.supports("grid-template-columns","subgrid")}applyReorderRowDraggableState(){const e=t.supportsSubgridBodyRow();this.queryBodyRows().forEach((t=>{const l=t.querySelector(".xpl-table__row-drag-handle");null==l||l.removeAttribute("draggable"),t.removeAttribute("draggable"),this.rowReorderable&&!t.disabled&&l&&(e?t.setAttribute("draggable","true"):l.setAttribute("draggable","true"))}))}getVisibleBodyRowsForReorder(){return this.queryBodyRows().filter((t=>!t.hasAttribute("hidden")))}clearReorderDragOverClasses(){this.queryBodyRows().forEach((t=>t.classList.remove("xpl-table-row--drag-over")))}clearPendingDragListeners(){this.pointerUpClearPending&&(this.pointerUpClearPending(),this.pointerUpClearPending=null)}announceRowReorder(t,e){if(!this.rowReorderable||!t)return;const l=e.indexOf(t);l<0||(this.reorderLiveMessage="",void 0!==this.reorderAnnounceRaf&&cancelAnimationFrame(this.reorderAnnounceRaf),this.reorderAnnounceRaf=requestAnimationFrame((()=>{this.reorderAnnounceRaf=void 0,this.el.isConnected&&(this.reorderLiveMessage=`Row ${t}, now position ${l+1} of ${e.length}`)})))}pruneStaleSelectedRowIds(){const e=new Set(this.queryBodyRows().map((e=>t.getRowIdForRow(e))).filter((t=>!!t))),l=this.selectedRowIds.filter((t=>e.has(t)));l.length!==this.selectedRowIds.length&&(this.selectedRowIds=l,this.applyBodyCheckboxStates(),this.applyHeaderCheckboxState(),this.syncRowSelectedProps(),this.emitCompositionalSelection())}static getBodyRowCheckboxAriaLabel(e,l){var r,i;const s=t.getBodyRowCells(e),o=s.find(((t,e)=>(null===l||e!==l)&&!t.hasAttribute(n))),a=null!=o?o:s[0];if(!a)return"Select row";const h=null!==(i=null===(r=a.textContent)||void 0===r?void 0:r.replace(/\s+/g," ").trim())&&void 0!==i?i:"";return h?"Select row, "+(h.length>100?h.slice(0,100)+"…":h):"Select row"}applyBodyCheckboxStates(){const e=this.getSelectionColumnIndex();null!==e&&this.queryBodyRows().forEach((l=>{const r=t.getRowIdForRow(l),i=t.getBodyRowCells(l)[e],s=null==i?void 0:i.querySelector("xpl-checkbox");s&&r&&(s.checked=this.selectedRowIds.includes(r),s.disabled=l.disabled,s.value=r,s.setAttribute("aria-label",t.getBodyRowCheckboxAriaLabel(l,e)))}))}getHeaderCheckboxCell(){const t=this.getSelectionColumnIndex();if(null===t)return null;const e=this.getCompositionalHeaderCells()[t];return e&&"checkbox"===e.getAttribute("type")?e:null}applyHeaderCheckboxState(){const e=this.getHeaderCheckboxCell();if(!e)return;const l=this.querySelectableBodyRows().map((e=>t.getRowIdForRow(e))).filter((t=>!!t)),r=l.filter((t=>this.selectedRowIds.includes(t))).length,i=l.length>0&&r===l.length,s=r>0&&!i;e.checked=i,e.indeterminate=s}syncRowSelectedProps(){this.queryBodyRows().forEach((e=>{const l=t.getRowIdForRow(e),r=!!l&&this.selectedRowIds.includes(l);e.selected=r}))}emitCompositionalSelection(){const t=this.selectedRowIds,e=t.join("");e!==this.lastEmittedRowSelectionKey&&(this.lastEmittedRowSelectionKey=e,this.rowSelectionChange.emit({selectedRowIds:[...t]}))}isEventFromThisTable(t){if(null==t||"object"!=typeof t)return!1;const e="closest"in t&&"function"==typeof t.closest?t:"parentElement"in t?t.parentElement:null;return!!e&&e.closest("xpl-table")===this.el}static sortKeyFromHeaderCell(t,e){var l,r;const i=(null!==(r=null!==(l=t.sortKey)&&void 0!==l?l:t.label)&&void 0!==r?r:"").trim();return i.length>0?i.replace(/ /g,"-").toLowerCase():"column-"+e}handleCompositionalHeaderSort(e){var l;if(this.isLegacyMode)return;if(!this.isEventFromThisTable(e.target))return;const r=e.target,i=null!==(l=r.closest("xpl-table-header xpl-table-row"))&&void 0!==l?l:r.closest("xpl-table-row");if(!i||!this.el.contains(i))return;const s=Array.from(i.querySelectorAll("xpl-table-header-cell")),{columnIndex:o}=e.detail,n=s[o];if(!(null==n?void 0:n.sortable))return;const a=h(n.sortDirection);s.forEach(((t,e)=>{t.sortable&&(t.sortDirection=e===o?a:null)}));const c={};s.forEach(((e,l)=>{var r;const i=e;i.sortable&&(c[t.sortKeyFromHeaderCell(i,l)]=null!==(r=i.sortDirection)&&void 0!==r?r:null)}));const d=s.map((t=>{var e;return t.sortable&&null!==(e=t.sortDirection)&&void 0!==e?e:null})),u=t.sortKeyFromHeaderCell(s[o],o),p=Object.assign(Object.assign({},c),{colNum:o,colName:u,sortTypeArr:d});this.sortChanged.emit(p)}legacySortStatePayload(){var t;const e={};return(null===(t=this.columns)||void 0===t?void 0:t.length)?(this.columns.forEach(((t,l)=>{var r;const i=t.replace(/ /g,"-").toLowerCase();e[i]=null!==(r=this.sortTypeArray[l])&&void 0!==r?r:null})),e):e}legacySortChangedDetail(t){var e,l;const r=this.legacySortStatePayload(),i=(null!==(l=null===(e=this.columns)||void 0===e?void 0:e[t])&&void 0!==l?l:"").replace(/ /g,"-").toLowerCase();return Object.assign(Object.assign({},r),{colNum:t,colName:i,sortTypeArr:[...this.sortTypeArray]})}getCompositionalHeaderCells(){var t;const e=null!==(t=Array.from(this.el.children).find((t=>"xpl-table-header"===t.tagName.toLowerCase())))&&void 0!==t?t:null;if(!e)return[];const l=Array.from(e.children).find((t=>"xpl-table-row"===t.tagName.toLowerCase()));return Array.from((null!=l?l:e).children).filter((t=>"xpl-table-header-cell"===t.tagName.toLowerCase()))}updateColumnWidths(){const t=this.getCompositionalHeaderCells(),e=t.map((t=>c(t))).join(" "),l=t.length;l===this.colCount&&this.colCount>0&&this.columnWidthsToken===e||(this.el.style.setProperty("--column-widths",e),this.colCount=l,this.columnWidthsToken=e)}handleSort(t,e,l){t.preventDefault(),t.stopPropagation(),e&&(this.sortTypeArray=this.sortTypeArray.map(((t,e)=>{if(e!==l)return null;switch(t){case"asc":return"desc";case"desc":return null;default:return"asc"}})),this.sortChanged.emit(this.legacySortChangedDetail(l)).defaultPrevented||this.sortBy(l,this.sortTypeArray))}renderLegacy(){var t;return!this.columns||this.sortTypeArray&&this.sortTypeArray.length===this.columns.length||(this.sortTypeArray=this.columns.map((()=>null))),r(i,null,r("div",{class:"xpl-table-container",onScroll:this.onLegacyScroll,ref:t=>{this.container=t}},r("table",{class:{"xpl-table":!0,"xpl-table--legacy":!0,"xpl-table--striped":this.striped,"xpl-table--freeze":this.freeze,"xpl-table--has-scrolled":this.hasScrolled}},this.columns&&r("thead",null,this.columns.map(((t,e)=>{var l,i;const s=d(null!==(i=null===(l=this.sortTypeArray)||void 0===l?void 0:l[e])&&void 0!==i?i:null),o=!(!this.isSortable||!this.sortableColumns[e]);return r("th",null,r("label",{onClick:t=>this.handleSort(t,o,e),class:o?"cursor-pointer":""},this.multiselect&&0===e&&r("input",{checked:this.areAllSelected,id:"__xpl-table-th",indeterminate:!this.areAllSelected&&this.selected.some((t=>t)),onClick:t=>{t.stopPropagation(),this.selectAll(t)},type:"checkbox",value:"select-all-"+this.selectAllValue}),t,o&&!!this.sortTypeArray[e]&&r("xpl-icon",{icon:s,size:16})))}))),r("tbody",null,this.rowData.map(((t,e)=>r("tr",{class:this.selected&&this.selected[e]?"xpl-table-row-selected":""},t.map(((t,l)=>r("td",null,this.multiselect&&0===l?r("label",{htmlFor:"__xpl-table-row-"+e},r("input",{id:"__xpl-table-row-"+e,checked:!!this.selected[e],type:"checkbox",onChange:t=>this.selectOne(t,e),value:this.selectedValues.length>0?this.selectedValues[e]:"xpl-table-checkbox-"+e}),r("div",{innerHTML:t})):r("div",{innerHTML:t})))))))),(null===(t=this.rowFooterData)||void 0===t?void 0:t.length)>0&&r("tfoot",null,this.rowFooterData.map((t=>r("tr",null,t.map((t=>r("td",null,r("div",{innerHTML:t})))))))))))}renderCompositional(){const t=this.selectedRowIds.length;return r(i,{role:"grid","aria-label":this.label,"aria-colcount":this.colCount>0?this.colCount:void 0,class:{"xpl-table":!0,"xpl-table--striped":this.striped,"xpl-table--freeze":this.freeze,"xpl-table--has-scrolled":this.hasScrolled,"xpl-table--selectable":!!this.selectable,"xpl-table--selection-active":!!this.selectable&&this.selectedRowIds.length>0,"xpl-table--row-reorderable":!!this.rowReorderable},onScroll:this.onGridScroll},this.rowReorderable&&r("div",{class:"xpl-table__reorder-live","aria-live":"assertive","aria-atomic":"true"},this.reorderLiveMessage),this.selectable&&r("div",{class:{"xpl-toolbar":!0,hidden:0===t,"xpl-table__toolbar":!0}},r("div",{class:"toolbar"},r("p",{class:"selected-item-count"},t," Selected"),r("div",{class:"actions"},r("slot",{name:"toolbar-actions-left"}),r("slot",{name:"toolbar-actions-right"})))),r("slot",null))}render(){return this.isLegacyMode?this.renderLegacy():this.renderCompositional()}get el(){return this}static get watchers(){return{columns:[{watchColumns:0}],data:[{watchData:0}],footer:[{watchFooterData:0}],reorderHandleIcon:[{watchReorderHandleIcon:0}],reorderHandleIconKeyboard:[{watchReorderHandleIconKeyboard:0}],rowReorderable:[{watchRowReorderable:0}],selectable:[{watchSelectable:0}]}}},[260,"xpl-table",{columns:[16],data:[16],footer:[16],freeze:[4],isSortable:[4,"is-sortable"],label:[1],multiselect:[4],reorderHandleIcon:[1,"reorder-handle-icon"],reorderHandleIconKeyboard:[1,"reorder-handle-icon-keyboard"],rowReorderable:[4,"row-reorderable"],selectable:[4],selectedValues:[16],sortableColumns:[16],striped:[4],areAllSelected:[32],colCount:[32],hasScrolled:[32],keyboardReorderRowId:[32],reorderLiveMessage:[32],rowData:[32],rowFooterData:[32],selected:[32],selectedRowIds:[32],sortTypeArray:[32]},[[0,"xplTableColumnWidthsChange","handleHeaderCellColumnWidthsChange"],[0,"checkboxChange","handleCompositionalCheckboxChange"],[0,"headerCheckboxChange","handleCompositionalHeaderCheckboxChange"],[3,"pointerdown","handlePointerDownExitKeyboardReorder"],[3,"pointerdown","handleRowReorderPointerDown"],[3,"dragstart","handleRowReorderDragStart"],[3,"dragend","handleRowReorderDragEnd"],[2,"dragover","handleRowReorderDragOver"],[2,"dragenter","handleRowReorderDragEnter"],[3,"dragleave","handleRowReorderDragLeave"],[2,"drop","handleRowReorderDrop"],[0,"headerSortChange","handleCompositionalHeaderSort"]],{columns:[{watchColumns:0}],data:[{watchData:0}],footer:[{watchFooterData:0}],reorderHandleIcon:[{watchReorderHandleIcon:0}],reorderHandleIconKeyboard:[{watchReorderHandleIconKeyboard:0}],rowReorderable:[{watchRowReorderable:0}],selectable:[{watchSelectable:0}]}]),m=g,R=function(){"undefined"!=typeof customElements&&["xpl-table","xpl-checkbox","xpl-icon","xpl-table-cell","xpl-table-footer-cell","xpl-table-header-cell"].forEach((t=>{switch(t){case"xpl-table":customElements.get(s(t))||customElements.define(s(t),g);break;case"xpl-checkbox":customElements.get(s(t))||p();break;case"xpl-icon":customElements.get(s(t))||b();break;case"xpl-table-cell":customElements.get(s(t))||x();break;case"xpl-table-footer-cell":customElements.get(s(t))||f();break;case"xpl-table-header-cell":customElements.get(s(t))||u()}}))};export{m as XplTable,R as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as
|
|
1
|
+
import{proxyCustomElement as t,HTMLElement as s,createEvent as e,h as i,Host as n,transformTag as a}from"@stencil/core/internal/client";import{d as o}from"./xpl-dropdown2.js";import{d as l}from"./xpl-dropdown-group2.js";import{d as h}from"./xpl-dropdown-heading2.js";import{d}from"./xpl-dropdown-option2.js";import{d as r}from"./xpl-icon2.js";import{d as c}from"./xpl-select2.js";import{d as p}from"./xpl-tag2.js";let u=0;function b(t){var e,i;const n=t.querySelector("xpl-button button");if(n){const t=n.cloneNode(!0);if(t instanceof s){t.querySelectorAll(".xpl-button__icon, xpl-icon").forEach((t=>t.remove()));const s=null===(e=t.textContent)||void 0===e?void 0:e.replace(/\s+/g," ").trim();if(s)return s}}const a=t.querySelector(".xpl-tab__button");return a?Array.from(a.childNodes).filter((t=>t.nodeType===Node.TEXT_NODE)).map((t=>{var s;return(null!==(s=t.textContent)&&void 0!==s?s:"").trim()})).join(" "):null!==(i=t.getAttribute("target"))&&void 0!==i?i:""}const m=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.tabChange=e(this,"tabChange",7),this.tabHeadings=[],this.tabPanels=[],this.tablistKeydownBound=!1,this.activeBarPosition={left:0,width:0},this.choicesTick=1,this.isMobileSelectChange=!1,this.selectedValue="",this.disabled=!1,this.fullWidth=!1,this.type="tabs",this.handleTabChange=t=>{this.applySelection(t)},this.onTablistKeydown=async t=>{var s,e;if(this.disabled)return;const i=null===(e=null===(s=t.target)||void 0===s?void 0:s.closest)||void 0===e?void 0:e.call(s,"xpl-tab");if(!i||!this.tabHeadings.includes(i))return;const{key:n}=t;let a=!1,o=!1;this.isTablistRtl()?"ArrowLeft"===n||"ArrowDown"===n?a=!0:"ArrowRight"!==n&&"ArrowUp"!==n||(o=!0):"ArrowRight"===n||"ArrowDown"===n?a=!0:"ArrowLeft"!==n&&"ArrowUp"!==n||(o=!0);const l=a||o,h="Home"===n;if(!l&&!h&&"End"!==n)return;const d=this.getEnabledTabHeadingsSync();if(0===d.length)return;const r=d.indexOf(i);if(-1===r)return;let c;c=l?a?(r+1)%d.length:(r-1+d.length)%d.length:h?0:d.length-1;const p=d[c],u=null==p?void 0:p.getAttribute("target");if(!u)return;const b=i.getAttribute("target");t.preventDefault(),u!==b&&(this.applySelection(u),await p.focusTrigger(),this.tabChange.emit(u))}}onDisabledChanged(){this.syncGroupDisabledOnTabs(),this.disabled||this.syncRovingTabindex()}onFullWidthChanged(){this.syncFullWidthOnTabs()}onTypeChanged(){this.syncVariantOnTabs()}onValueChanged(t){this.applySelection(t)}connectedCallback(){this.el.hasAttribute("data-tabs-instance-id")||(u+=1,this.el.setAttribute("data-tabs-instance-id","xpl-tg-"+u)),"undefined"!=typeof MutationObserver&&(this.observer=new MutationObserver((()=>{this.collectTabs(!0)})),this.observer.observe(this.el,{childList:!0,subtree:!0}))}disconnectedCallback(){var t;null===(t=this.observer)||void 0===t||t.disconnect(),this.headingsContainerRef&&this.tablistKeydownBound&&(this.headingsContainerRef.removeEventListener("keydown",this.onTablistKeydown),this.tablistKeydownBound=!1),void 0!==this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=void 0)}componentWillLoad(){this.selectedValue=this.getDefaultValue()}componentDidLoad(){this.collectTabs(!1),this.attachTablistKeydown()}componentDidUpdate(){this.updateActiveBarPosition(),this.syncRovingTabindex()}componentDidRender(){!this.tablistKeydownBound&&this.headingsContainerRef&&this.attachTablistKeydown()}onWindowResize(){this.updateActiveBarPosition()}syncGroupDisabledOnTabs(){this.tabHeadings.forEach((t=>{this.disabled?t.setAttribute("data-group-disabled",""):t.removeAttribute("data-group-disabled")}))}applySelection(t){this.tabHeadings.forEach((s=>{t===s.getAttribute("target")?s.setAttribute("selected",""):s.removeAttribute("selected")})),this.tabPanels.forEach((s=>{t===s.getAttribute("target")?s.setAttribute("selected",""):s.removeAttribute("selected")})),this.syncGroupDisabledOnTabs(),void 0!==this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame((()=>{this.rafId=void 0,this.selectedValue=t,this.updateActiveBarPosition(),this.syncRovingTabindex()}))}isOwnedTabOrPanel(t){return t.closest("xpl-tabs")===this.el}collectTabs(t){this.tabHeadings=Array.from(this.el.querySelectorAll("xpl-tab")).filter((t=>this.isOwnedTabOrPanel(t))),this.tabPanels=Array.from(this.el.querySelectorAll("xpl-tab-panel")).filter((t=>this.isOwnedTabOrPanel(t))),this.syncVariantOnTabs(),this.syncFullWidthOnTabs(),this.applySelection(this.getDefaultValue()),t&&(this.choicesTick+=1)}syncVariantOnTabs(){this.tabHeadings.forEach((t=>{t.variant=this.type}))}syncFullWidthOnTabs(){this.tabHeadings.forEach((t=>{t.fullWidth=this.fullWidth}))}getDefaultValue(){var t,s;return this.value||(null===(s=null===(t=this.tabHeadings)||void 0===t?void 0:t[0])||void 0===s?void 0:s.getAttribute("target"))||""}async syncRovingTabindex(){this.disabled||await Promise.all(this.tabHeadings.map((async t=>{var s;const e=(null!==(s=t.getAttribute("target"))&&void 0!==s?s:"")===this.selectedValue;await t.setTabIndex(e?0:-1)})))}getEnabledTabHeadingsSync(){return this.tabHeadings.filter((t=>{if(this.disabled||t.hasAttribute("disabled"))return!1;const s=t.querySelector("segment"===t.variant?"xpl-button button":".xpl-tab__button");return!(!s||s.disabled)}))}attachTablistKeydown(){const t=this.headingsContainerRef;t&&!this.tablistKeydownBound&&(t.addEventListener("keydown",this.onTablistKeydown),this.tablistKeydownBound=!0)}isTablistRtl(){const t=this.headingsContainerRef;return!!t&&"rtl"===getComputedStyle(t).direction}renderChoices(){return this.tabHeadings.map((t=>{var s;const e=null!==(s=t.getAttribute("target"))&&void 0!==s?s:"",i=this.disabled||t.hasAttribute("disabled"),n="segment"===this.type&&t.getAttribute("icon")||void 0;return Object.assign({label:b(t),value:e,isDisabled:i},n?{icon:n}:{})}))}updateActiveBarPosition(){if("segment"===this.type)return;const t=this.tabHeadings.find((t=>t.getAttribute("target")===this.selectedValue));if(!this.headingsContainerRef||!t)return;const s=t.getBoundingClientRect(),e=this.headingsContainerRef.getBoundingClientRect(),i=s.left-e.left,n=s.width;this.activeBarPosition.left===i&&this.activeBarPosition.width===n||(this.activeBarPosition={left:i,width:n})}mobileSelectClassNames(){const t="xpl-tabs__mobile-select";return"segment"===this.type?t+" xpl-tabs__mobile-select--segment":t}render(){const t="segment"===this.type;return i(n,{key:"56e4284e5a8fd492ebedcc963ddc2218f75c58c6",class:{"xpl-tabs":!0,"xpl-tabs--full-width":this.fullWidth,"xpl-tabs--segment":t},"data-choices-tick":this.choicesTick},i("xpl-select",{key:"bd22e0a513a068915a206d48f8011cb779abdf44",classNames:this.mobileSelectClassNames(),choices:this.renderChoices(),disabled:this.disabled,selectedValues:this.selectedValue,onDropdownStateChange:t=>{t.detail&&(this.isMobileSelectChange=!0)},onChangeEvent:t=>{if(this.isMobileSelectChange){const s=""+t.detail;this.handleTabChange(s),this.tabChange.emit(s),this.isMobileSelectChange=!1}}}),i("nav",{key:"b56a5a8435cbba117f7b66711a4bad4a0df1b808","aria-orientation":"horizontal",class:"xpl-tabs__headings",role:"tablist",ref:t=>{this.headingsContainerRef=t},onTabChange:t=>{t.stopPropagation(),this.isMobileSelectChange=!1,this.handleTabChange(t.detail),this.tabChange.emit(t.detail)}},!t&&i("div",{key:"77c1c13e85a172da519e5081364808f8a873eb54",class:"xpl-tabs__active-bar",style:{transform:`translateX(${this.activeBarPosition.left}px)`,width:this.activeBarPosition.width+"px"}}),i("slot",{key:"24e4b6409fbfa26f859d64d4d37493a711006368",name:"heading"})),i("div",{key:"2a364d45d6377131c2809d25373bc90512f11307",class:"xpl-tabs__panels"},i("slot",{key:"59335370a20458fc36bfa33a2a117744ce4434fc",name:"panel"})))}get el(){return this}static get watchers(){return{disabled:[{onDisabledChanged:0}],fullWidth:[{onFullWidthChanged:0}],type:[{onTypeChanged:0}],value:[{onValueChanged:0}]}}},[260,"xpl-tabs",{disabled:[4],fullWidth:[4,"full-width"],type:[513],value:[1],activeBarPosition:[32],choicesTick:[32],isMobileSelectChange:[32],selectedValue:[32]},[[9,"resize","onWindowResize"]],{disabled:[{onDisabledChanged:0}],fullWidth:[{onFullWidthChanged:0}],type:[{onTypeChanged:0}],value:[{onValueChanged:0}]}]),g=m,f=function(){"undefined"!=typeof customElements&&["xpl-tabs","xpl-dropdown","xpl-dropdown-group","xpl-dropdown-heading","xpl-dropdown-option","xpl-icon","xpl-select","xpl-tag"].forEach((t=>{switch(t){case"xpl-tabs":customElements.get(a(t))||customElements.define(a(t),m);break;case"xpl-dropdown":customElements.get(a(t))||o();break;case"xpl-dropdown-group":customElements.get(a(t))||l();break;case"xpl-dropdown-heading":customElements.get(a(t))||h();break;case"xpl-dropdown-option":customElements.get(a(t))||d();break;case"xpl-icon":customElements.get(a(t))||r();break;case"xpl-select":customElements.get(a(t))||c();break;case"xpl-tag":customElements.get(a(t))||p()}}))};export{g as XplTabs,f as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as
|
|
1
|
+
import{proxyCustomElement as t,HTMLElement as s,createEvent as i,h as a,Host as e,transformTag as h}from"@stencil/core/internal/client";import{d as n}from"./xpl-icon2.js";const l=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.close=i(this,"close",7),this.tagDragEnd=i(this,"tagDragEnd",7),this.tagDragStart=i(this,"tagDragStart",7),this.tagRemove=i(this,"tagRemove",7),this.dismissAriaLabelSuffix="tag",this.isDragging=!1,this.disabled=!1,this.dismissible=!0,this.isDraggable=!1,this.size="default",this.handleTagClick=()=>{this.disabled||this.isDraggable||this.close.emit()},this.setDragPreviewToHost=t=>{if(t.dataTransfer)try{const s=this.el.getBoundingClientRect(),i=Math.max(0,t.clientX-s.left),a=Math.max(0,t.clientY-s.top);t.dataTransfer.setDragImage(this.el,i,a)}catch(t){}},this.handleContentKeyDown=t=>{this.disabled||"Enter"!==t.key&&" "!==t.key||t.preventDefault()},this.handleDismissClick=t=>{t.stopPropagation(),this.disabled||(this.close.emit(),this.tagRemove.emit())},this.handleDragStart=t=>{this.isDragging=!0,t.dataTransfer&&(t.dataTransfer.effectAllowed="move",this.setDragPreviewToHost(t),this.tagId&&t.dataTransfer.setData("application/x-tag-id",this.tagId),t.dataTransfer.setData("text/plain",this.getContentLabelText())),this.tagDragStart.emit({tagId:this.tagId,content:this.getContentLabelText(),originalEvent:t})},this.handleDragEnd=t=>{var s;this.isDragging=!1;const i="move"===(null===(s=t.dataTransfer)||void 0===s?void 0:s.dropEffect);this.tagDragEnd.emit({tagId:this.tagId,dropped:i,originalEvent:t})},this.handleDragOver=t=>{!this.disabled&&this.isDraggable&&(t.preventDefault(),t.dataTransfer&&(t.dataTransfer.dropEffect="move"))},this.handleDragEnter=t=>{!this.disabled&&this.isDraggable&&t.preventDefault()},this.handleHostDragStart=t=>{t.target===this.el&&this.isDraggable&&t.preventDefault()}}onDisabledChange(t){t&&this.isDragging&&(this.isDragging=!1)}onIsDraggableChange(t){!t&&this.isDragging&&(this.isDragging=!1)}componentDidRender(){queueMicrotask((()=>this.syncDismissAriaLabelSuffix()))}getContentLabelText(){var t,s;return(null!==(s=null===(t=this.el.querySelector(".xpl-tag__content"))||void 0===t?void 0:t.textContent)&&void 0!==s?s:"").trim()}syncDismissAriaLabelSuffix(){if(!this.el.isConnected)return;const t=this.getContentLabelText(),s=""===t?"tag":t;s!==this.dismissAriaLabelSuffix&&(this.dismissAriaLabelSuffix=s)}render(){const t=this.isDraggable&&!this.disabled;return a(e,{key:"117319681b3edca99c97361353fd1775a0b9b32f",class:{"xpl-tag":!0,"xpl-tag-container":!0,"xpl-tag--disabled":this.disabled,"xpl-tag--dismissible":this.dismissible,"xpl-tag--dragging":this.isDragging,"xpl-tag--draggable":t,"xpl-tag--sm":"sm"===this.size},onDragOver:t?this.handleDragOver:void 0,onDragEnter:t?this.handleDragEnter:void 0,onDragStart:this.isDraggable?this.handleHostDragStart:void 0},t?a("div",{class:"xpl-tag__content xpl-tag",role:"button",tabIndex:0,draggable:!0,"aria-grabbed":String(this.isDragging),onClick:this.handleTagClick,onKeyDown:this.handleContentKeyDown,onDragStart:this.handleDragStart,onDragEnd:this.handleDragEnd},a("slot",null)):a("button",{class:"xpl-tag__content xpl-tag",type:"button",disabled:this.disabled,onClick:this.handleTagClick},a("slot",null)),this.dismissible&&a("button",{key:"b1040693b482270dec9403a908bf3cacd5db49b8",class:"xpl-tag__dismiss xpl-tag__close",type:"button",draggable:!1,disabled:this.disabled,"aria-label":`Dismiss ${this.dismissAriaLabelSuffix}`,onClick:this.handleDismissClick},a("xpl-icon",{key:"ed0419c92f526424bb1b9cd43e93ba119348da07",icon:"xmark",size:10})))}get el(){return this}static get watchers(){return{disabled:[{onDisabledChange:0}],isDraggable:[{onIsDraggableChange:0}]}}},[260,"xpl-tag",{disabled:[4],dismissible:[4],isDraggable:[4,"is-draggable"],size:[1],tagId:[1,"tag-id"],dismissAriaLabelSuffix:[32],isDragging:[32]},void 0,{disabled:[{onDisabledChange:0}],isDraggable:[{onIsDraggableChange:0}]}]);function o(){"undefined"!=typeof customElements&&["xpl-tag","xpl-icon"].forEach((t=>{switch(t){case"xpl-tag":customElements.get(h(t))||customElements.define(h(t),l);break;case"xpl-icon":customElements.get(h(t))||n()}}))}export{l as T,o as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as t,HTMLElement as s,h as
|
|
1
|
+
import{proxyCustomElement as t,HTMLElement as s,h as e,Host as a,transformTag as i}from"@stencil/core/internal/client";import{d as c}from"./xpl-icon2.js";const o=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.variant="neutral",this.showIcon=!0,this.dismissable=!0,this.timeout=8e3,this.handleAnimationEnd=()=>{var t,s;(null===(t=this.el)||void 0===t?void 0:t.classList.contains("xpl-toast--dismissed"))&&(null===(s=this.el)||void 0===s||s.remove())},this.getIcon=()=>{switch(this.variant){case"warning":return e("xpl-icon",{size:24,icon:"alert-hex"});case"success":return e("xpl-icon",{size:24,icon:"check-circle"});default:return e("xpl-icon",{size:24,icon:"comment-alt"})}},this.dismiss=()=>{var t;null===(t=this.el)||void 0===t||t.classList.add("xpl-toast--dismissed")}}componentDidLoad(){this.actionSlot.children.length<1&&setTimeout((()=>{this.dismiss()}),this.timeout)}render(){var t;return e(a,{key:"c9abdb6db66a9dad0d6ed3d2e6d178ea34852c86",class:"xpl-toast xpl-toast--"+this.variant,onAnimationEnd:this.handleAnimationEnd},e("div",{key:"7057e31e0f25dab1ba8b093f1dca15e6f08c44e4",class:"xpl-toast__left"},this.showIcon&&e("div",{key:"7875c518753729ae39a7bb9f2051751924a0d558",class:"xpl-toast__icon xpl-toast__icon--"+this.variant},this.getIcon()),e("div",{key:"e38c7d0593c16f3dfa83bc4e521f89ee644b46d4",class:"xpl-toast__notification"},e("p",{key:"8186437158381780554d2509a806704c52450f8c",class:"xpl-toast__title"},e("slot",{key:"0aa8df0520c33b4576acfb1ad4750a72928b94d5",name:"title"})),""!==this.caption&&e("p",{key:"3a4ce8f73e498373344b8b692e624f177212a70a",class:"xpl-toast__caption"},null===(t=this.caption)||void 0===t?void 0:t.substring(0,85)))),e("div",{key:"636ff5b9476cea09d21b97f3e1b78860a6f10669",class:"xpl-toast__action",ref:t=>{this.actionSlot=t}},e("slot",{key:"733bc27fba998cdbb97cc1124d8449b539a0fc21",name:"action"})),this.dismissable&&e("div",{key:"8f555e8a02c8aed5095ab659a792e19c242dae98",class:"xpl-toast__close"},e("button",{key:"ca64c6cb98c4cda5d2dab208afef54db4832e103",tabIndex:0,onClick:this.dismiss},e("xpl-icon",{key:"bf00f852ecffd16504a8ec95f3f6630b1aa569c9",icon:"x"}))))}get el(){return this}},[260,"xpl-toast",{variant:[1],showIcon:[4,"show-icon"],caption:[1],dismissable:[4],timeout:[2]}]),n=o,l=function(){"undefined"!=typeof customElements&&["xpl-toast","xpl-icon"].forEach((t=>{switch(t){case"xpl-toast":customElements.get(i(t))||customElements.define(i(t),o);break;case"xpl-icon":customElements.get(i(t))||c()}}))};export{n as XplToast,l as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as t,h as l,Host as s,transformTag as i}from"@stencil/core/internal/client";import{v as a}from"./v4.js";const c=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.variant="default",this.id=a()}render(){let e="xpl-toggle-container";this.disabled&&(e+=" xpl-toggle-container--disabled");let t="xpl-toggle";return"small"===this.variant&&(t+=" xpl-toggle--small"),l(s,{key:"
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as t,h as l,Host as s,transformTag as i}from"@stencil/core/internal/client";import{v as a}from"./v4.js";const c=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.variant="default",this.id=a()}render(){let e="xpl-toggle-container";this.disabled&&(e+=" xpl-toggle-container--disabled");let t="xpl-toggle";return"small"===this.variant&&(t+=" xpl-toggle--small"),l(s,{key:"b501bb268b9fbc2756544b17481ae78ee3144960",class:e},(this.heading||this.description)&&l("label",{key:"34d2bb6e6c4538a863f333e8124fbde9ec2544cb",class:{"xpl-label":!0,"xpl-label--disabled":this.disabled},htmlFor:this.id},this.heading,this.description&&l("small",{key:"f9f5ff29d428e776566d0a12e62ab7efe311feb5",class:{"xpl-description":!0,"xpl-description--disabled":this.disabled}},this.description)),l("input",{key:"f9b1baf90d9336711ce1354a66770c7423551af8",class:t,type:"checkbox",checked:this.checked,disabled:this.disabled,id:this.id,name:this.name}),this.label&&l("label",{key:"49f803372904b5b87394a55c67f428401cd14379",htmlFor:this.id},this.label))}},[0,"xpl-toggle",{checked:[4],description:[1],disabled:[4],heading:[1],label:[1],name:[1],variant:[1],id:[32]}]),d=c,o=function(){"undefined"!=typeof customElements&&["xpl-toggle"].forEach((e=>{"xpl-toggle"===e&&(customElements.get(i(e))||customElements.define(i(e),c))}))};export{d as XplToggle,o as defineCustomElement}
|