@xplortech/apollo-core 2.6.0 → 2.7.1
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 +626 -35
- package/build/style.css +5949 -3070
- package/dist/apollo-core/apollo-core.css +29 -19
- package/dist/apollo-core/apollo-core.esm.js +1 -1
- package/dist/apollo-core/p-0bf50890.entry.js +1 -0
- package/dist/apollo-core/p-1947e7a8.entry.js +1 -0
- package/dist/apollo-core/p-27928cb0.entry.js +1 -0
- package/dist/apollo-core/{p-5549756c.entry.js → p-34438721.entry.js} +1 -1
- package/dist/apollo-core/p-35c2f72d.entry.js +1 -0
- package/dist/apollo-core/p-368c81f1.entry.js +1 -0
- package/dist/apollo-core/{p-f5af9539.entry.js → p-36ba29da.entry.js} +1 -1
- package/dist/apollo-core/p-406b27a8.entry.js +1 -0
- package/dist/apollo-core/p-5d63b4ce.entry.js +1 -0
- package/dist/apollo-core/{p-02167464.entry.js → p-6a15f1e0.entry.js} +1 -1
- package/dist/apollo-core/p-8d692d05.entry.js +1 -0
- package/dist/apollo-core/{p-C_Z2nG0p.js → p-C7bgJs6C.js} +2 -2
- package/dist/apollo-core/{p-42016063.entry.js → p-b61d7952.entry.js} +1 -1
- package/dist/apollo-core/{p-8a1affce.entry.js → p-ca127ee8.entry.js} +1 -1
- package/dist/apollo-core/p-d1c9c233.entry.js +1 -0
- package/dist/apollo-core/p-dc205893.entry.js +1 -0
- package/dist/apollo-core/p-e2a5d41c.entry.js +1 -0
- package/dist/cjs/apollo-core.cjs.js +3 -3
- package/dist/cjs/{index-DH6pgWru.js → index-BQ97-AWw.js} +18 -7
- 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_54.cjs.entry.js} +3726 -536
- 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-table-header-cell.cjs.entry.js +1 -1
- package/dist/cjs/xpl-table-header.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 +11 -5
- 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 +25 -3
- package/dist/collection/components/xpl-choicelist/xpl-choicelist.js +1 -1
- package/dist/collection/components/xpl-content-area/xpl-content-area.js +1 -1
- package/dist/collection/components/xpl-dashboard/xpl-dashboard.js +1 -1
- package/dist/collection/components/xpl-data-card/xpl-data-card.js +2 -2
- package/dist/collection/components/xpl-divider/xpl-divider.js +1 -1
- package/dist/collection/components/xpl-dropdown/xpl-dropdown-group/xpl-dropdown-group.js +1 -1
- package/dist/collection/components/xpl-dropdown/xpl-dropdown-heading/xpl-dropdown-heading.js +1 -1
- package/dist/collection/components/xpl-dropdown/xpl-dropdown-option/xpl-dropdown-option.js +2 -2
- package/dist/collection/components/xpl-dropdown/xpl-dropdown.js +77 -7
- 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 +1 -1
- 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/pagination.stories.js +18 -0
- package/dist/collection/components/xpl-pagination/xpl-pagination.js +7 -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 +58 -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/xpl-table.js +5 -5
- package/dist/collection/components/xpl-table-header/xpl-table-header.js +1 -1
- 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/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-header.js +1 -1
- 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 +12 -11
- package/dist/docs/xpl-divider/readme.md +6 -4
- package/dist/docs/xpl-dropdown/readme.md +14 -12
- package/dist/docs/xpl-icon/readme.md +14 -2
- 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 +19 -16
- 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-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 -8
- 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_54.entry.js} +3719 -536
- 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-table-header-cell.entry.js +1 -1
- package/dist/esm/xpl-table-header.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 +2 -1
- package/dist/types/components/xpl-dropdown/xpl-dropdown.d.ts +5 -0
- 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-pagination/pagination.stories.d.ts +13 -0
- 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-select/xpl-select.d.ts +3 -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-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 +1521 -83
- package/dist/types/utils/lifecycle.d.ts +16 -0
- package/dist/types/utils/tab-a11y-ids.d.ts +4 -0
- package/package.json +12 -3
- package/dist/apollo-core/p-0bce3874.entry.js +0 -1
- package/dist/apollo-core/p-1fd3dc87.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/cjs/xpl-list.cjs.entry.js +0 -32
- package/dist/collection/components/xpl-progress/progress.stories.js +0 -106
- package/dist/collection/components/xpl-progress/xpl-progress.js +0 -60
- package/dist/components/xpl-progress.js +0 -1
- package/dist/docs/xpl-progress/readme.md +0 -22
- package/dist/esm/xpl-list.entry.js +0 -30
- package/dist/types/components/xpl-progress/progress.stories.d.ts +0 -38
- package/dist/types/components/xpl-progress/xpl-progress.d.ts +0 -6
|
@@ -0,0 +1,818 @@
|
|
|
1
|
+
import { Fragment, Host, h, } from "@stencil/core";
|
|
2
|
+
function emptyXplListItemSlotPresence() {
|
|
3
|
+
return {
|
|
4
|
+
actions: false,
|
|
5
|
+
avatar: false,
|
|
6
|
+
badges: false,
|
|
7
|
+
details: false,
|
|
8
|
+
errorText: false,
|
|
9
|
+
metadata: false,
|
|
10
|
+
stackedExtra1: false,
|
|
11
|
+
stackedExtra2: false,
|
|
12
|
+
stackedExtra3: false,
|
|
13
|
+
titleBadge: false,
|
|
14
|
+
title: false,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export class XplListItem {
|
|
18
|
+
constructor() {
|
|
19
|
+
this.dragFromHandle = false;
|
|
20
|
+
this.slotPresence = emptyXplListItemSlotPresence();
|
|
21
|
+
this.isKeyboardMode = false;
|
|
22
|
+
this.disabled = false;
|
|
23
|
+
this.error = false;
|
|
24
|
+
this.hidden = false;
|
|
25
|
+
this.keyboardActive = false;
|
|
26
|
+
this.reorderable = false;
|
|
27
|
+
this.selectable = false;
|
|
28
|
+
this.selected = false;
|
|
29
|
+
this.showDivider = false;
|
|
30
|
+
this.handleDragStart = (e) => {
|
|
31
|
+
if (this.disabled) {
|
|
32
|
+
e.preventDefault();
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
if (!this.dragFromHandle) {
|
|
36
|
+
e.preventDefault();
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
this.detachDragHandlePointerReleaseListeners();
|
|
40
|
+
if (e.dataTransfer) {
|
|
41
|
+
e.dataTransfer.effectAllowed = 'move';
|
|
42
|
+
e.dataTransfer.setData('text/plain', this.itemId || this.el.id || '');
|
|
43
|
+
}
|
|
44
|
+
const wrapper = this.el.querySelector('.xpl-list-item__wrapper');
|
|
45
|
+
wrapper === null || wrapper === void 0 ? void 0 : wrapper.classList.add('dragging');
|
|
46
|
+
this.itemDragStart.emit({ itemId: this.itemId, item: this.el });
|
|
47
|
+
};
|
|
48
|
+
this.handleDrop = (e) => {
|
|
49
|
+
if (this.disabled) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
e.preventDefault();
|
|
53
|
+
this.detachDragHandlePointerReleaseListeners();
|
|
54
|
+
this.dragFromHandle = false;
|
|
55
|
+
this.itemDrop.emit({ itemId: this.itemId, item: this.el });
|
|
56
|
+
};
|
|
57
|
+
this.handleDragOver = (e) => {
|
|
58
|
+
if (this.disabled) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
e.preventDefault();
|
|
62
|
+
if (e.dataTransfer && this.reorderable) {
|
|
63
|
+
e.dataTransfer.dropEffect = 'move';
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
this.handleDragEnter = (e) => {
|
|
67
|
+
if (this.disabled) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
e.preventDefault();
|
|
71
|
+
const wrapper = this.el.querySelector('.xpl-list-item__wrapper');
|
|
72
|
+
wrapper === null || wrapper === void 0 ? void 0 : wrapper.classList.add('drag-over');
|
|
73
|
+
};
|
|
74
|
+
this.handleDragLeave = (e) => {
|
|
75
|
+
if (this.disabled) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const wrapper = this.el.querySelector('.xpl-list-item__wrapper');
|
|
79
|
+
if (wrapper && !wrapper.contains(e.relatedTarget)) {
|
|
80
|
+
wrapper.classList.remove('drag-over');
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
this.handleDragEnd = () => {
|
|
84
|
+
this.detachDragHandlePointerReleaseListeners();
|
|
85
|
+
this.dragFromHandle = false;
|
|
86
|
+
const wrapper = this.el.querySelector('.xpl-list-item__wrapper');
|
|
87
|
+
wrapper === null || wrapper === void 0 ? void 0 : wrapper.classList.remove('dragging', 'drag-over');
|
|
88
|
+
const parent = this.el.parentElement;
|
|
89
|
+
if (parent) {
|
|
90
|
+
Array.from(parent.children).forEach((sibling) => {
|
|
91
|
+
if (sibling.tagName.toLowerCase() !== 'xpl-list-item') {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
const siblingWrapper = sibling.querySelector('.xpl-list-item__wrapper');
|
|
95
|
+
siblingWrapper === null || siblingWrapper === void 0 ? void 0 : siblingWrapper.classList.remove('drag-over');
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
this.itemDragEnd.emit({ itemId: this.itemId, item: this.el });
|
|
99
|
+
};
|
|
100
|
+
this.handleDragHandleMouseDown = () => {
|
|
101
|
+
if (this.disabled) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
this.detachDragHandlePointerReleaseListeners();
|
|
105
|
+
this.dragFromHandle = true;
|
|
106
|
+
const onPointerEnd = () => {
|
|
107
|
+
this.detachDragHandlePointerReleaseListeners();
|
|
108
|
+
this.dragFromHandle = false;
|
|
109
|
+
};
|
|
110
|
+
document.addEventListener('pointerup', onPointerEnd, true);
|
|
111
|
+
document.addEventListener('pointercancel', onPointerEnd, true);
|
|
112
|
+
this.dragHandlePointerReleaseCleanup = () => {
|
|
113
|
+
document.removeEventListener('pointerup', onPointerEnd, true);
|
|
114
|
+
document.removeEventListener('pointercancel', onPointerEnd, true);
|
|
115
|
+
};
|
|
116
|
+
this.el.dispatchEvent(new CustomEvent('xplListItemReorder', {
|
|
117
|
+
bubbles: true,
|
|
118
|
+
composed: true,
|
|
119
|
+
detail: { exitKeyboardMode: true },
|
|
120
|
+
}));
|
|
121
|
+
};
|
|
122
|
+
this.preventRowLinkNavigation = (ev) => {
|
|
123
|
+
if (this.href) {
|
|
124
|
+
ev.preventDefault();
|
|
125
|
+
ev.stopPropagation();
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
this.handleMouseDown = () => {
|
|
129
|
+
if (this.isKeyboardMode) {
|
|
130
|
+
this.el.dispatchEvent(new CustomEvent('xplListItemReorder', {
|
|
131
|
+
bubbles: true,
|
|
132
|
+
composed: true,
|
|
133
|
+
detail: {
|
|
134
|
+
itemId: this.itemId,
|
|
135
|
+
exitKeyboardMode: true,
|
|
136
|
+
},
|
|
137
|
+
}));
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
this.handleDragHandleKeyDown = (e) => {
|
|
141
|
+
if (this.disabled) {
|
|
142
|
+
if (e.key === 'Escape' && this.isKeyboardMode) {
|
|
143
|
+
e.preventDefault();
|
|
144
|
+
this.el.dispatchEvent(new CustomEvent('xplListItemReorder', {
|
|
145
|
+
bubbles: true,
|
|
146
|
+
composed: true,
|
|
147
|
+
detail: {
|
|
148
|
+
itemId: this.itemId,
|
|
149
|
+
exitKeyboardMode: true,
|
|
150
|
+
},
|
|
151
|
+
}));
|
|
152
|
+
}
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
if (e.key === 'Escape') {
|
|
156
|
+
if (this.isKeyboardMode) {
|
|
157
|
+
e.preventDefault();
|
|
158
|
+
this.el.dispatchEvent(new CustomEvent('xplListItemReorder', {
|
|
159
|
+
bubbles: true,
|
|
160
|
+
composed: true,
|
|
161
|
+
detail: {
|
|
162
|
+
itemId: this.itemId,
|
|
163
|
+
exitKeyboardMode: true,
|
|
164
|
+
},
|
|
165
|
+
}));
|
|
166
|
+
}
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
if (this.isKeyboardMode) {
|
|
170
|
+
if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {
|
|
171
|
+
e.preventDefault();
|
|
172
|
+
this.el.dispatchEvent(new CustomEvent('xplListItemReorder', {
|
|
173
|
+
bubbles: true,
|
|
174
|
+
composed: true,
|
|
175
|
+
detail: {
|
|
176
|
+
direction: e.key === 'ArrowUp' ? 'up' : 'down',
|
|
177
|
+
item: this.el,
|
|
178
|
+
itemId: this.itemId,
|
|
179
|
+
keyboardMode: true,
|
|
180
|
+
},
|
|
181
|
+
}));
|
|
182
|
+
}
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
186
|
+
e.preventDefault();
|
|
187
|
+
this.el.dispatchEvent(new CustomEvent('xplListItemReorder', {
|
|
188
|
+
bubbles: true,
|
|
189
|
+
composed: true,
|
|
190
|
+
detail: {
|
|
191
|
+
item: this.el,
|
|
192
|
+
itemId: this.itemId,
|
|
193
|
+
keyboardMode: true,
|
|
194
|
+
},
|
|
195
|
+
}));
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
this.handleRadioChange = () => {
|
|
199
|
+
if (!this.disabled) {
|
|
200
|
+
this.itemSelect.emit({ itemId: this.itemId });
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
this.handleRadioClick = (ev) => {
|
|
204
|
+
if (this.href) {
|
|
205
|
+
ev.stopPropagation();
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
handleItemChange() {
|
|
210
|
+
this.updateSlotPresence();
|
|
211
|
+
}
|
|
212
|
+
handleKeyboardActiveChange(newValue) {
|
|
213
|
+
this.isKeyboardMode = newValue;
|
|
214
|
+
}
|
|
215
|
+
handleSelectedChange(newValue) {
|
|
216
|
+
const radio = this.el.querySelector('.xpl-list-item__selectable input[type="radio"]');
|
|
217
|
+
if (radio instanceof HTMLInputElement && radio.checked !== newValue) {
|
|
218
|
+
radio.checked = newValue;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
handleTitleBadgeVariantChange() {
|
|
222
|
+
this.updateSlotPresence();
|
|
223
|
+
}
|
|
224
|
+
connectedCallback() {
|
|
225
|
+
this.el.addEventListener('mousedown', this.handleMouseDown, true);
|
|
226
|
+
}
|
|
227
|
+
disconnectedCallback() {
|
|
228
|
+
this.el.removeEventListener('mousedown', this.handleMouseDown, true);
|
|
229
|
+
this.detachDragHandlePointerReleaseListeners();
|
|
230
|
+
}
|
|
231
|
+
componentWillLoad() {
|
|
232
|
+
this.updateSlotPresence();
|
|
233
|
+
this.isKeyboardMode = !!this.keyboardActive;
|
|
234
|
+
const attrItemId = this.el.getAttribute('item-id');
|
|
235
|
+
if (attrItemId && !this.itemId) {
|
|
236
|
+
this.itemId = attrItemId;
|
|
237
|
+
}
|
|
238
|
+
if (this.el.id && !this.itemId) {
|
|
239
|
+
this.itemId = this.el.id;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
componentDidRender() {
|
|
243
|
+
this.syncReorderDragHandleA11y();
|
|
244
|
+
}
|
|
245
|
+
handleSlotChange() {
|
|
246
|
+
this.updateSlotPresence();
|
|
247
|
+
}
|
|
248
|
+
updateSlotPresence() {
|
|
249
|
+
const attrVariant = this.el.getAttribute('title-badge-variant') ||
|
|
250
|
+
this.el.getAttribute('titlebadgevariant');
|
|
251
|
+
this.slotPresence = {
|
|
252
|
+
actions: this.hasSlot('actions'),
|
|
253
|
+
avatar: this.hasSlot('avatar'),
|
|
254
|
+
badges: this.hasSlot('badges'),
|
|
255
|
+
details: this.hasSlot('details'),
|
|
256
|
+
errorText: this.hasSlot('error-text'),
|
|
257
|
+
metadata: this.hasSlot('metadata'),
|
|
258
|
+
stackedExtra1: this.hasSlot('stacked-extra-1'),
|
|
259
|
+
stackedExtra2: this.hasSlot('stacked-extra-2'),
|
|
260
|
+
stackedExtra3: this.hasSlot('stacked-extra-3'),
|
|
261
|
+
title: this.hasSlot('title'),
|
|
262
|
+
titleBadge: !!((this.titleBadgeVariant && String(this.titleBadgeVariant).length > 0) ||
|
|
263
|
+
(attrVariant && attrVariant.length > 0)),
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
detachDragHandlePointerReleaseListeners() {
|
|
267
|
+
if (this.dragHandlePointerReleaseCleanup) {
|
|
268
|
+
this.dragHandlePointerReleaseCleanup();
|
|
269
|
+
this.dragHandlePointerReleaseCleanup = undefined;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
hasSlot(name) {
|
|
273
|
+
const hasDirectChildWithSlot = Array.from(this.el.children).some((c) => c.getAttribute('slot') === name);
|
|
274
|
+
if (hasDirectChildWithSlot) {
|
|
275
|
+
return true;
|
|
276
|
+
}
|
|
277
|
+
const slotEl = Array.from(this.el.querySelectorAll(`slot[name="${name}"]`)).find((s) => s.closest('xpl-list-item') === this.el);
|
|
278
|
+
if (slotEl && typeof slotEl.assignedNodes === 'function') {
|
|
279
|
+
return slotEl.assignedNodes({ flatten: true }).length > 0;
|
|
280
|
+
}
|
|
281
|
+
return false;
|
|
282
|
+
}
|
|
283
|
+
getTitleSlotAccessibleText() {
|
|
284
|
+
var _a;
|
|
285
|
+
const directTitle = Array.from(this.el.children).find((c) => c.getAttribute('slot') === 'title');
|
|
286
|
+
if (directTitle) {
|
|
287
|
+
return (_a = directTitle.textContent) !== null && _a !== void 0 ? _a : undefined;
|
|
288
|
+
}
|
|
289
|
+
const slotEl = Array.from(this.el.querySelectorAll('slot[name="title"]')).find((s) => s.closest('xpl-list-item') === this.el);
|
|
290
|
+
if (slotEl && typeof slotEl.assignedNodes === 'function') {
|
|
291
|
+
const combined = slotEl
|
|
292
|
+
.assignedNodes({ flatten: true })
|
|
293
|
+
.map((node) => {
|
|
294
|
+
var _a, _b;
|
|
295
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
|
296
|
+
return (_a = node.textContent) !== null && _a !== void 0 ? _a : '';
|
|
297
|
+
}
|
|
298
|
+
if (node.nodeType === Node.ELEMENT_NODE) {
|
|
299
|
+
return (_b = node.textContent) !== null && _b !== void 0 ? _b : '';
|
|
300
|
+
}
|
|
301
|
+
return '';
|
|
302
|
+
})
|
|
303
|
+
.join('')
|
|
304
|
+
.trim();
|
|
305
|
+
return combined || undefined;
|
|
306
|
+
}
|
|
307
|
+
return undefined;
|
|
308
|
+
}
|
|
309
|
+
getRowIdForAccessibleLabel() {
|
|
310
|
+
var _a, _b, _c;
|
|
311
|
+
const fromProp = (_a = this.itemId) === null || _a === void 0 ? void 0 : _a.trim();
|
|
312
|
+
if (fromProp) {
|
|
313
|
+
return fromProp;
|
|
314
|
+
}
|
|
315
|
+
const fromAttr = (_b = this.el.getAttribute('item-id')) === null || _b === void 0 ? void 0 : _b.trim();
|
|
316
|
+
if (fromAttr) {
|
|
317
|
+
return fromAttr;
|
|
318
|
+
}
|
|
319
|
+
const fromId = (_c = this.el.id) === null || _c === void 0 ? void 0 : _c.trim();
|
|
320
|
+
if (fromId) {
|
|
321
|
+
return fromId;
|
|
322
|
+
}
|
|
323
|
+
return '';
|
|
324
|
+
}
|
|
325
|
+
getSelectableRadioLabel() {
|
|
326
|
+
var _a;
|
|
327
|
+
const rowId = this.getRowIdForAccessibleLabel();
|
|
328
|
+
if (this.slotPresence.title) {
|
|
329
|
+
const titleText = (_a = this.getTitleSlotAccessibleText()) === null || _a === void 0 ? void 0 : _a.trim();
|
|
330
|
+
if (titleText) {
|
|
331
|
+
return titleText;
|
|
332
|
+
}
|
|
333
|
+
if (rowId) {
|
|
334
|
+
return `Select ${rowId}`;
|
|
335
|
+
}
|
|
336
|
+
return 'Select list item';
|
|
337
|
+
}
|
|
338
|
+
if (rowId) {
|
|
339
|
+
return `Select ${rowId}`;
|
|
340
|
+
}
|
|
341
|
+
return 'Select list item';
|
|
342
|
+
}
|
|
343
|
+
renderLegacyAvatarCell() {
|
|
344
|
+
if (!this.item.avatar || typeof this.item.avatar !== 'string') {
|
|
345
|
+
return null;
|
|
346
|
+
}
|
|
347
|
+
return this.item.avatar.slice(0, 1) === '/' || this.item.avatar.slice(0, 4) === 'http' ? (h("xpl-avatar", { src: this.item.avatar, name: this.item.title })) : (h("xpl-avatar", { name: this.item.title }, this.item.avatar));
|
|
348
|
+
}
|
|
349
|
+
renderPropBasedItem() {
|
|
350
|
+
const { item } = this;
|
|
351
|
+
const hasRight = item.avatars || item.badges || item.subtext;
|
|
352
|
+
const Tag = item.href ? 'a' : 'div';
|
|
353
|
+
const linkProps = item.href ? { href: item.href } : {};
|
|
354
|
+
return (h(Host, { role: "listitem", class: {
|
|
355
|
+
'xpl-list-item': true,
|
|
356
|
+
'xpl-list-item--error': this.error,
|
|
357
|
+
'xpl-list-item--disabled': this.disabled,
|
|
358
|
+
}, hidden: this.hidden }, this.renderLegacyAvatarCell(), h(Tag, Object.assign({ class: "xpl-list-item-content" }, linkProps), h("div", { class: "xpl-list-left" }, h("div", null, h("h4", null, item.title), item.metadata && (h("ul", { class: "xpl-list-item-metadata" }, item.metadata.map((d) => {
|
|
359
|
+
if (typeof d === 'string') {
|
|
360
|
+
return h("li", null, d);
|
|
361
|
+
}
|
|
362
|
+
return (h("li", null, h("xpl-icon", { icon: d.icon }), " ", d.text));
|
|
363
|
+
}))))), hasRight && (h("div", { class: "xpl-list-right" }, item.subtext && (h("div", { class: "xpl-list-item-subtext" }, item.subtext)), item.avatars && (h("div", { class: "xpl-avatar-group xpl-avatar-group--s" }, item.avatars.map((a) => (h("img", { src: a, alt: "" }))))), item.badges &&
|
|
364
|
+
item.badges.map((b) => {
|
|
365
|
+
if (typeof b === 'string') {
|
|
366
|
+
return h("xpl-badge", null, b);
|
|
367
|
+
}
|
|
368
|
+
return (h("xpl-badge", { dot: b.dot, variant: b.variant }, b.text));
|
|
369
|
+
}))), item.href ? (h("span", { class: "xpl-list-item__link-chevron", "aria-hidden": "true" }, h("xpl-icon", { icon: "chevron-right", size: 12 }))) : null)));
|
|
370
|
+
}
|
|
371
|
+
renderTitleBadge() {
|
|
372
|
+
if (!this.slotPresence.titleBadge) {
|
|
373
|
+
return null;
|
|
374
|
+
}
|
|
375
|
+
const variant = (this.titleBadgeVariant ||
|
|
376
|
+
this.el.getAttribute('title-badge-variant') ||
|
|
377
|
+
this.el.getAttribute('titlebadgevariant') ||
|
|
378
|
+
'purple');
|
|
379
|
+
return (h("div", { class: "xpl-list-item__title-badge" }, h("xpl-badge", { dotOnly: true, size: "small", variant: variant })));
|
|
380
|
+
}
|
|
381
|
+
renderSlotBasedItem() {
|
|
382
|
+
var _a;
|
|
383
|
+
const hasRightSideContent = this.slotPresence.details || this.slotPresence.badges || this.slotPresence.actions;
|
|
384
|
+
const hasStackedContent = this.slotPresence.title ||
|
|
385
|
+
this.slotPresence.metadata ||
|
|
386
|
+
this.slotPresence.stackedExtra1 ||
|
|
387
|
+
this.slotPresence.stackedExtra2 ||
|
|
388
|
+
this.slotPresence.stackedExtra3;
|
|
389
|
+
const radioGroupName = this.radioName || this.el.getAttribute('radio-name') || '';
|
|
390
|
+
const reorderActive = this.reorderable && !this.disabled;
|
|
391
|
+
const wrapperClass = 'xpl-list-item__wrapper';
|
|
392
|
+
const dragSurfaceProps = {
|
|
393
|
+
draggable: reorderActive,
|
|
394
|
+
onDragStart: this.handleDragStart,
|
|
395
|
+
onDragOver: this.handleDragOver,
|
|
396
|
+
onDragEnter: this.handleDragEnter,
|
|
397
|
+
onDragLeave: this.handleDragLeave,
|
|
398
|
+
onDrop: this.handleDrop,
|
|
399
|
+
onDragEnd: this.handleDragEnd,
|
|
400
|
+
};
|
|
401
|
+
const rowBody = (h(Fragment, null, reorderActive && (h("div", { class: "xpl-list-item__reorderable" }, h("xpl-button", { class: {
|
|
402
|
+
'xpl-list-item__drag-handle': true,
|
|
403
|
+
'xpl-list-item__drag-handle--keyboard-mode': this.isKeyboardMode,
|
|
404
|
+
}, type: "button", variant: "tertiary", sentiment: "neutral", iconOnly: true, icon: this.isKeyboardMode ? 'caret-expand-y' : 'grip-dots-vertical', disabled: this.disabled, onClick: this.preventRowLinkNavigation, onMouseDown: this.handleDragHandleMouseDown, onKeyDown: this.handleDragHandleKeyDown }))), this.selectable && radioGroupName ? (h("div", { class: "xpl-list-item__selectable", onClick: this.handleRadioClick }, h("xpl-radio", { checked: this.selected, disabled: this.disabled, name: radioGroupName, value: (_a = this.itemId) !== null && _a !== void 0 ? _a : '', onRadioChange: this.handleRadioChange }, this.getSelectableRadioLabel()))) : null, this.slotPresence.avatar && (h("div", { class: "xpl-list-item__avatar", onClick: this.preventRowLinkNavigation }, h("slot", { name: "avatar" }))), hasStackedContent && (h("div", { class: "xpl-list-item__stacked" }, (this.slotPresence.title || this.slotPresence.titleBadge) && (h("div", { class: "xpl-list-item__title-row" }, h("div", { class: "xpl-list-item__title-wrapper" }, this.renderTitleBadge(), h("slot", { name: "title" })))), this.showDivider && h("xpl-divider", null), this.slotPresence.metadata && (h("div", { class: "xpl-list-item__metadata-row" }, h("slot", { name: "metadata" }))), this.slotPresence.stackedExtra1 && (h("div", { class: "xpl-list-item__stacked-extra-1" }, h("slot", { name: "stacked-extra-1" }))), this.slotPresence.stackedExtra2 && (h("div", { class: "xpl-list-item__stacked-extra-2" }, h("slot", { name: "stacked-extra-2" }))), this.slotPresence.stackedExtra3 && (h("div", { class: "xpl-list-item__stacked-extra-3" }, h("slot", { name: "stacked-extra-3" }))))), hasRightSideContent && (h("div", { class: "xpl-list-item__right" }, this.slotPresence.details && (h("div", { class: "xpl-list-item__details" }, h("slot", { name: "details" }))), this.slotPresence.badges && (h("div", { class: "xpl-list-item__badges" }, h("slot", { name: "badges" }))), this.slotPresence.actions && (h("div", { class: "xpl-list-item__actions", onClick: this.preventRowLinkNavigation }, h("slot", { name: "actions" }))))), this.href ? (h("span", { class: "xpl-list-item__link-chevron", "aria-hidden": "true" }, h("xpl-icon", { icon: "chevron-right", size: 12 }))) : null));
|
|
405
|
+
return (h(Host, { class: {
|
|
406
|
+
'xpl-list-item': true,
|
|
407
|
+
'xpl-list-item--error': this.error || this.slotPresence.errorText,
|
|
408
|
+
'xpl-list-item--disabled': this.disabled,
|
|
409
|
+
'xpl-list-item--slot-based': true,
|
|
410
|
+
'xpl-list-item--selected': this.selected,
|
|
411
|
+
}, hidden: this.hidden }, this.href ? (h("div", { role: "listitem", class: "xpl-list-item__listitem-shell" }, h("a", Object.assign({ class: wrapperClass, href: this.href }, dragSurfaceProps), rowBody))) : (h("div", Object.assign({ role: "listitem", class: wrapperClass }, dragSurfaceProps), rowBody)), this.slotPresence.errorText && (h("div", { class: "xpl-list-item__error-text" }, h("xpl-icon", { icon: "circle-warning", size: 16 }), h("slot", { name: "error-text" })))));
|
|
412
|
+
}
|
|
413
|
+
syncReorderDragHandleA11y() {
|
|
414
|
+
if (!this.reorderable || this.disabled) {
|
|
415
|
+
return;
|
|
416
|
+
}
|
|
417
|
+
const host = this.el.querySelector('xpl-button.xpl-list-item__drag-handle');
|
|
418
|
+
const nativeBtn = host === null || host === void 0 ? void 0 : host.querySelector('button');
|
|
419
|
+
if (!nativeBtn) {
|
|
420
|
+
return;
|
|
421
|
+
}
|
|
422
|
+
const label = this.isKeyboardMode
|
|
423
|
+
? 'Press arrow up or down to reorder, Escape to exit'
|
|
424
|
+
: 'Press Enter or Space to activate keyboard reorder mode, or drag to reorder';
|
|
425
|
+
nativeBtn.setAttribute('aria-label', label);
|
|
426
|
+
nativeBtn.setAttribute('aria-pressed', this.isKeyboardMode ? 'true' : 'false');
|
|
427
|
+
}
|
|
428
|
+
render() {
|
|
429
|
+
if (this.hidden) {
|
|
430
|
+
return h(Host, { hidden: true });
|
|
431
|
+
}
|
|
432
|
+
if (this.item) {
|
|
433
|
+
return this.renderPropBasedItem();
|
|
434
|
+
}
|
|
435
|
+
return this.renderSlotBasedItem();
|
|
436
|
+
}
|
|
437
|
+
static get is() { return "xpl-list-item"; }
|
|
438
|
+
static get properties() {
|
|
439
|
+
return {
|
|
440
|
+
"disabled": {
|
|
441
|
+
"type": "boolean",
|
|
442
|
+
"mutable": false,
|
|
443
|
+
"complexType": {
|
|
444
|
+
"original": "boolean",
|
|
445
|
+
"resolved": "boolean",
|
|
446
|
+
"references": {}
|
|
447
|
+
},
|
|
448
|
+
"required": false,
|
|
449
|
+
"optional": true,
|
|
450
|
+
"docs": {
|
|
451
|
+
"tags": [],
|
|
452
|
+
"text": "Whether the item is disabled."
|
|
453
|
+
},
|
|
454
|
+
"getter": false,
|
|
455
|
+
"setter": false,
|
|
456
|
+
"reflect": false,
|
|
457
|
+
"attribute": "disabled",
|
|
458
|
+
"defaultValue": "false"
|
|
459
|
+
},
|
|
460
|
+
"error": {
|
|
461
|
+
"type": "boolean",
|
|
462
|
+
"mutable": false,
|
|
463
|
+
"complexType": {
|
|
464
|
+
"original": "boolean",
|
|
465
|
+
"resolved": "boolean",
|
|
466
|
+
"references": {}
|
|
467
|
+
},
|
|
468
|
+
"required": false,
|
|
469
|
+
"optional": true,
|
|
470
|
+
"docs": {
|
|
471
|
+
"tags": [],
|
|
472
|
+
"text": "Whether to show the item in an error state."
|
|
473
|
+
},
|
|
474
|
+
"getter": false,
|
|
475
|
+
"setter": false,
|
|
476
|
+
"reflect": false,
|
|
477
|
+
"attribute": "error",
|
|
478
|
+
"defaultValue": "false"
|
|
479
|
+
},
|
|
480
|
+
"hidden": {
|
|
481
|
+
"type": "boolean",
|
|
482
|
+
"mutable": false,
|
|
483
|
+
"complexType": {
|
|
484
|
+
"original": "boolean",
|
|
485
|
+
"resolved": "boolean",
|
|
486
|
+
"references": {}
|
|
487
|
+
},
|
|
488
|
+
"required": false,
|
|
489
|
+
"optional": false,
|
|
490
|
+
"docs": {
|
|
491
|
+
"tags": [],
|
|
492
|
+
"text": "When true, the row is not shown and does not participate in visible-only list behavior\n(e.g. `orderChange` / `orderedItemIds`, reorder targets). Use for filtering, conditional\ndisplay, or keeping stable `item-id` while the row is off-screen. See `xpl-list` readme\n\u201CHidden rows\u201D.\n\n**Accessibility:** Renders an empty host with the native `hidden` attribute only (no\n`role=\"listitem\"`), consistent with the row not participating as a list item while hidden."
|
|
493
|
+
},
|
|
494
|
+
"getter": false,
|
|
495
|
+
"setter": false,
|
|
496
|
+
"reflect": false,
|
|
497
|
+
"attribute": "hidden",
|
|
498
|
+
"defaultValue": "false"
|
|
499
|
+
},
|
|
500
|
+
"href": {
|
|
501
|
+
"type": "string",
|
|
502
|
+
"mutable": false,
|
|
503
|
+
"complexType": {
|
|
504
|
+
"original": "string",
|
|
505
|
+
"resolved": "string",
|
|
506
|
+
"references": {}
|
|
507
|
+
},
|
|
508
|
+
"required": false,
|
|
509
|
+
"optional": true,
|
|
510
|
+
"docs": {
|
|
511
|
+
"tags": [],
|
|
512
|
+
"text": "URL for link behavior. When provided, the entire row becomes clickable.\nClicks on `actions` or `avatar` slots are prevented from triggering navigation."
|
|
513
|
+
},
|
|
514
|
+
"getter": false,
|
|
515
|
+
"setter": false,
|
|
516
|
+
"reflect": false,
|
|
517
|
+
"attribute": "href"
|
|
518
|
+
},
|
|
519
|
+
"item": {
|
|
520
|
+
"type": "unknown",
|
|
521
|
+
"mutable": false,
|
|
522
|
+
"complexType": {
|
|
523
|
+
"original": "ListItem",
|
|
524
|
+
"resolved": "ListItem",
|
|
525
|
+
"references": {
|
|
526
|
+
"ListItem": {
|
|
527
|
+
"location": "import",
|
|
528
|
+
"path": "../listitem",
|
|
529
|
+
"id": "src/components/components/xpl-list/listitem.ts::ListItem",
|
|
530
|
+
"referenceLocation": "ListItem"
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
},
|
|
534
|
+
"required": false,
|
|
535
|
+
"optional": true,
|
|
536
|
+
"docs": {
|
|
537
|
+
"tags": [],
|
|
538
|
+
"text": "Optional item data for prop-based rendering.\nWhen provided, this takes precedence over slotted content\nand renders using the legacy ListItem interface.\n**Deprecated.** Prefer slot-based composition (named slots on `xpl-list-item`)."
|
|
539
|
+
},
|
|
540
|
+
"getter": false,
|
|
541
|
+
"setter": false
|
|
542
|
+
},
|
|
543
|
+
"itemId": {
|
|
544
|
+
"type": "string",
|
|
545
|
+
"mutable": true,
|
|
546
|
+
"complexType": {
|
|
547
|
+
"original": "string",
|
|
548
|
+
"resolved": "string",
|
|
549
|
+
"references": {}
|
|
550
|
+
},
|
|
551
|
+
"required": false,
|
|
552
|
+
"optional": true,
|
|
553
|
+
"docs": {
|
|
554
|
+
"tags": [],
|
|
555
|
+
"text": "Unique identifier for this item. Used for selection and drag/drop.\nMutable so the host can sync from `item-id` / `id` in `componentWillLoad` without breaking one-way data flow."
|
|
556
|
+
},
|
|
557
|
+
"getter": false,
|
|
558
|
+
"setter": false,
|
|
559
|
+
"reflect": false,
|
|
560
|
+
"attribute": "item-id"
|
|
561
|
+
},
|
|
562
|
+
"keyboardActive": {
|
|
563
|
+
"type": "boolean",
|
|
564
|
+
"mutable": false,
|
|
565
|
+
"complexType": {
|
|
566
|
+
"original": "boolean",
|
|
567
|
+
"resolved": "boolean",
|
|
568
|
+
"references": {}
|
|
569
|
+
},
|
|
570
|
+
"required": false,
|
|
571
|
+
"optional": true,
|
|
572
|
+
"docs": {
|
|
573
|
+
"tags": [],
|
|
574
|
+
"text": "When set by the parent, indicates this item is the active keyboard reorder item."
|
|
575
|
+
},
|
|
576
|
+
"getter": false,
|
|
577
|
+
"setter": false,
|
|
578
|
+
"reflect": false,
|
|
579
|
+
"attribute": "keyboard-active",
|
|
580
|
+
"defaultValue": "false"
|
|
581
|
+
},
|
|
582
|
+
"radioName": {
|
|
583
|
+
"type": "string",
|
|
584
|
+
"mutable": false,
|
|
585
|
+
"complexType": {
|
|
586
|
+
"original": "string",
|
|
587
|
+
"resolved": "string",
|
|
588
|
+
"references": {}
|
|
589
|
+
},
|
|
590
|
+
"required": false,
|
|
591
|
+
"optional": true,
|
|
592
|
+
"docs": {
|
|
593
|
+
"tags": [],
|
|
594
|
+
"text": "Name attribute for radio inputs (shared across selectable items in a list)."
|
|
595
|
+
},
|
|
596
|
+
"getter": false,
|
|
597
|
+
"setter": false,
|
|
598
|
+
"reflect": false,
|
|
599
|
+
"attribute": "radio-name"
|
|
600
|
+
},
|
|
601
|
+
"reorderable": {
|
|
602
|
+
"type": "boolean",
|
|
603
|
+
"mutable": false,
|
|
604
|
+
"complexType": {
|
|
605
|
+
"original": "boolean",
|
|
606
|
+
"resolved": "boolean",
|
|
607
|
+
"references": {}
|
|
608
|
+
},
|
|
609
|
+
"required": false,
|
|
610
|
+
"optional": true,
|
|
611
|
+
"docs": {
|
|
612
|
+
"tags": [],
|
|
613
|
+
"text": "Whether this item is reorderable (shows a drag handle in **slot-based** layout).\nWhen the deprecated `item` prop is used, legacy markup has **no** reorder handle even if this is true."
|
|
614
|
+
},
|
|
615
|
+
"getter": false,
|
|
616
|
+
"setter": false,
|
|
617
|
+
"reflect": false,
|
|
618
|
+
"attribute": "reorderable",
|
|
619
|
+
"defaultValue": "false"
|
|
620
|
+
},
|
|
621
|
+
"selectable": {
|
|
622
|
+
"type": "boolean",
|
|
623
|
+
"mutable": false,
|
|
624
|
+
"complexType": {
|
|
625
|
+
"original": "boolean",
|
|
626
|
+
"resolved": "boolean",
|
|
627
|
+
"references": {}
|
|
628
|
+
},
|
|
629
|
+
"required": false,
|
|
630
|
+
"optional": true,
|
|
631
|
+
"docs": {
|
|
632
|
+
"tags": [],
|
|
633
|
+
"text": "Whether this item is selectable (shows `xpl-radio` in a shared group)."
|
|
634
|
+
},
|
|
635
|
+
"getter": false,
|
|
636
|
+
"setter": false,
|
|
637
|
+
"reflect": false,
|
|
638
|
+
"attribute": "selectable",
|
|
639
|
+
"defaultValue": "false"
|
|
640
|
+
},
|
|
641
|
+
"selected": {
|
|
642
|
+
"type": "boolean",
|
|
643
|
+
"mutable": false,
|
|
644
|
+
"complexType": {
|
|
645
|
+
"original": "boolean",
|
|
646
|
+
"resolved": "boolean",
|
|
647
|
+
"references": {}
|
|
648
|
+
},
|
|
649
|
+
"required": false,
|
|
650
|
+
"optional": true,
|
|
651
|
+
"docs": {
|
|
652
|
+
"tags": [],
|
|
653
|
+
"text": "Whether this item is selected (radio checked state)."
|
|
654
|
+
},
|
|
655
|
+
"getter": false,
|
|
656
|
+
"setter": false,
|
|
657
|
+
"reflect": false,
|
|
658
|
+
"attribute": "selected",
|
|
659
|
+
"defaultValue": "false"
|
|
660
|
+
},
|
|
661
|
+
"showDivider": {
|
|
662
|
+
"type": "boolean",
|
|
663
|
+
"mutable": false,
|
|
664
|
+
"complexType": {
|
|
665
|
+
"original": "boolean",
|
|
666
|
+
"resolved": "boolean",
|
|
667
|
+
"references": {}
|
|
668
|
+
},
|
|
669
|
+
"required": false,
|
|
670
|
+
"optional": true,
|
|
671
|
+
"docs": {
|
|
672
|
+
"tags": [],
|
|
673
|
+
"text": "Whether to show a divider below the item."
|
|
674
|
+
},
|
|
675
|
+
"getter": false,
|
|
676
|
+
"setter": false,
|
|
677
|
+
"reflect": false,
|
|
678
|
+
"attribute": "show-divider",
|
|
679
|
+
"defaultValue": "false"
|
|
680
|
+
},
|
|
681
|
+
"titleBadgeVariant": {
|
|
682
|
+
"type": "string",
|
|
683
|
+
"mutable": false,
|
|
684
|
+
"complexType": {
|
|
685
|
+
"original": "BadgeVariantProp",
|
|
686
|
+
"resolved": "\"blue\" | \"error\" | \"gray\" | \"green\" | \"inactive\" | \"orange\" | \"purple\" | \"red\" | \"success\" | \"warning\" | \"yellow\"",
|
|
687
|
+
"references": {
|
|
688
|
+
"BadgeVariantProp": {
|
|
689
|
+
"location": "import",
|
|
690
|
+
"path": "../../xpl-badge/xpl-badge",
|
|
691
|
+
"id": "src/components/components/xpl-badge/xpl-badge.tsx::BadgeVariantProp",
|
|
692
|
+
"referenceLocation": "BadgeVariantProp"
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
},
|
|
696
|
+
"required": false,
|
|
697
|
+
"optional": true,
|
|
698
|
+
"docs": {
|
|
699
|
+
"tags": [],
|
|
700
|
+
"text": "Optional badge to display next to the title (dot badge).\nOnly used when `item` prop is not provided (slot mode).\nMatches `xpl-badge` variant values (e.g. purple, green, red)."
|
|
701
|
+
},
|
|
702
|
+
"getter": false,
|
|
703
|
+
"setter": false,
|
|
704
|
+
"reflect": false,
|
|
705
|
+
"attribute": "title-badge-variant"
|
|
706
|
+
}
|
|
707
|
+
};
|
|
708
|
+
}
|
|
709
|
+
static get states() {
|
|
710
|
+
return {
|
|
711
|
+
"slotPresence": {},
|
|
712
|
+
"isKeyboardMode": {}
|
|
713
|
+
};
|
|
714
|
+
}
|
|
715
|
+
static get events() {
|
|
716
|
+
return [{
|
|
717
|
+
"method": "itemDragEnd",
|
|
718
|
+
"name": "itemDragEnd",
|
|
719
|
+
"bubbles": true,
|
|
720
|
+
"cancelable": true,
|
|
721
|
+
"composed": true,
|
|
722
|
+
"docs": {
|
|
723
|
+
"tags": [],
|
|
724
|
+
"text": "Emitted when a drag operation ends on this item (after drop or cancel)."
|
|
725
|
+
},
|
|
726
|
+
"complexType": {
|
|
727
|
+
"original": "{ itemId?: string; item: HTMLElement }",
|
|
728
|
+
"resolved": "{ itemId?: string; item: HTMLElement; }",
|
|
729
|
+
"references": {
|
|
730
|
+
"HTMLElement": {
|
|
731
|
+
"location": "global",
|
|
732
|
+
"id": "global::HTMLElement"
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
}, {
|
|
737
|
+
"method": "itemDragStart",
|
|
738
|
+
"name": "itemDragStart",
|
|
739
|
+
"bubbles": true,
|
|
740
|
+
"cancelable": true,
|
|
741
|
+
"composed": true,
|
|
742
|
+
"docs": {
|
|
743
|
+
"tags": [],
|
|
744
|
+
"text": "Emitted when drag starts on this item."
|
|
745
|
+
},
|
|
746
|
+
"complexType": {
|
|
747
|
+
"original": "{ itemId?: string; item: HTMLElement }",
|
|
748
|
+
"resolved": "{ itemId?: string; item: HTMLElement; }",
|
|
749
|
+
"references": {
|
|
750
|
+
"HTMLElement": {
|
|
751
|
+
"location": "global",
|
|
752
|
+
"id": "global::HTMLElement"
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
}, {
|
|
757
|
+
"method": "itemDrop",
|
|
758
|
+
"name": "itemDrop",
|
|
759
|
+
"bubbles": true,
|
|
760
|
+
"cancelable": true,
|
|
761
|
+
"composed": true,
|
|
762
|
+
"docs": {
|
|
763
|
+
"tags": [],
|
|
764
|
+
"text": "Emitted when an item is dropped on this item."
|
|
765
|
+
},
|
|
766
|
+
"complexType": {
|
|
767
|
+
"original": "{ itemId?: string; item: HTMLElement }",
|
|
768
|
+
"resolved": "{ itemId?: string; item: HTMLElement; }",
|
|
769
|
+
"references": {
|
|
770
|
+
"HTMLElement": {
|
|
771
|
+
"location": "global",
|
|
772
|
+
"id": "global::HTMLElement"
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
}, {
|
|
777
|
+
"method": "itemSelect",
|
|
778
|
+
"name": "itemSelect",
|
|
779
|
+
"bubbles": true,
|
|
780
|
+
"cancelable": true,
|
|
781
|
+
"composed": true,
|
|
782
|
+
"docs": {
|
|
783
|
+
"tags": [],
|
|
784
|
+
"text": "Emitted when the item is selected (radio change)."
|
|
785
|
+
},
|
|
786
|
+
"complexType": {
|
|
787
|
+
"original": "{ itemId?: string }",
|
|
788
|
+
"resolved": "{ itemId?: string; }",
|
|
789
|
+
"references": {}
|
|
790
|
+
}
|
|
791
|
+
}];
|
|
792
|
+
}
|
|
793
|
+
static get elementRef() { return "el"; }
|
|
794
|
+
static get watchers() {
|
|
795
|
+
return [{
|
|
796
|
+
"propName": "item",
|
|
797
|
+
"methodName": "handleItemChange"
|
|
798
|
+
}, {
|
|
799
|
+
"propName": "keyboardActive",
|
|
800
|
+
"methodName": "handleKeyboardActiveChange"
|
|
801
|
+
}, {
|
|
802
|
+
"propName": "selected",
|
|
803
|
+
"methodName": "handleSelectedChange"
|
|
804
|
+
}, {
|
|
805
|
+
"propName": "titleBadgeVariant",
|
|
806
|
+
"methodName": "handleTitleBadgeVariantChange"
|
|
807
|
+
}];
|
|
808
|
+
}
|
|
809
|
+
static get listeners() {
|
|
810
|
+
return [{
|
|
811
|
+
"name": "slotchange",
|
|
812
|
+
"method": "handleSlotChange",
|
|
813
|
+
"target": undefined,
|
|
814
|
+
"capture": false,
|
|
815
|
+
"passive": false
|
|
816
|
+
}];
|
|
817
|
+
}
|
|
818
|
+
}
|