@xplortech/apollo-core 1.0.0-beta.8 → 2.4.2
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 +4396 -0
- package/README.md +57 -25
- package/build/style.css +4374 -3359
- package/dist/apollo-core/apollo-core.css +50 -24
- package/dist/apollo-core/apollo-core.esm.js +1 -1
- package/dist/apollo-core/p-0ac33b3a.entry.js +1 -0
- package/dist/apollo-core/p-23ef2717.entry.js +6 -0
- package/dist/apollo-core/p-31461db7.entry.js +1 -0
- package/dist/apollo-core/p-3b5f8989.entry.js +1 -0
- package/dist/apollo-core/p-4fab8172.entry.js +1 -0
- package/dist/apollo-core/p-576ce90f.entry.js +1 -0
- package/dist/apollo-core/p-5ec45742.entry.js +1 -0
- package/dist/apollo-core/p-7b7db57a.entry.js +1 -0
- package/dist/apollo-core/p-7f8e5cd0.entry.js +1 -0
- package/dist/apollo-core/p-812bb0e4.entry.js +1 -0
- package/dist/apollo-core/p-845eef0d.entry.js +1 -0
- package/dist/apollo-core/p-8c1f73ea.entry.js +1 -0
- package/dist/apollo-core/p-94209785.entry.js +1 -0
- package/dist/apollo-core/p-9853028c.entry.js +1 -0
- package/dist/apollo-core/p-9d65ece7.entry.js +1 -0
- package/dist/apollo-core/p-CH4yJ6Qx.js +1 -0
- package/dist/apollo-core/p-Cqlsd6nf.js +1 -0
- package/dist/apollo-core/p-DQuL1Twl.js +1 -0
- package/dist/apollo-core/p-DhZas3eX.js +2 -0
- package/dist/apollo-core/p-b1f4604d.entry.js +1 -0
- package/dist/apollo-core/p-be292555.entry.js +1 -0
- package/dist/cjs/apollo-core.cjs.js +15 -13
- package/dist/cjs/app-globals-V2Kpy_OQ.js +5 -0
- package/dist/{esm/xpl-input.entry.js → cjs/index-BvmWjxWc.js} +2 -94
- package/dist/cjs/index-D__N_vw2.js +2160 -0
- package/dist/cjs/loader.cjs.js +6 -15
- package/dist/cjs/{v4-14140ff3.js → v4-D4KzFnn8.js} +1 -11
- package/dist/cjs/xpl-accordion.cjs.entry.js +73 -0
- package/dist/cjs/xpl-application-shell.cjs.entry.js +41 -46
- package/dist/cjs/xpl-avatar_41.cjs.entry.js +5521 -0
- package/dist/cjs/xpl-button-row.cjs.entry.js +13 -18
- package/dist/cjs/xpl-calendar.cjs.entry.js +66 -0
- package/dist/cjs/xpl-dynamic-table-cell.cjs.entry.js +33 -0
- package/dist/cjs/xpl-dynamic-table-row.cjs.entry.js +37 -0
- package/dist/cjs/xpl-dynamic-table.cjs.entry.js +64 -0
- package/dist/cjs/xpl-grid-item.cjs.entry.js +16 -18
- package/dist/cjs/xpl-grid.cjs.entry.js +29 -28
- package/dist/cjs/xpl-large-card.cjs.entry.js +27 -0
- package/dist/cjs/xpl-list.cjs.entry.js +23 -30
- package/dist/cjs/xpl-main-nav.cjs.entry.js +18 -20
- package/dist/cjs/xpl-table-header-cell.cjs.entry.js +57 -0
- package/dist/cjs/xpl-table-header.cjs.entry.js +14 -0
- package/dist/cjs/xpl-toggle.cjs.entry.js +22 -30
- package/dist/cjs/xpl-toolbar.cjs.entry.js +28 -0
- package/dist/collection/collection-manifest.json +59 -32
- package/dist/collection/components/xpl-accordion/accordion.stories.js +76 -0
- package/dist/collection/components/xpl-accordion/xpl-accordion.js +236 -0
- package/dist/collection/components/xpl-application-shell/application-shell.stories.js +733 -0
- package/dist/collection/components/xpl-application-shell/xpl-application-shell.js +163 -158
- package/dist/collection/components/xpl-avatar/avatar.stories.js +128 -0
- package/dist/collection/components/xpl-avatar/xpl-avatar.js +171 -162
- package/dist/collection/components/xpl-backdrop/backdrop.stories.js +20 -0
- package/dist/collection/components/xpl-backdrop/xpl-backdrop.js +39 -37
- package/dist/collection/components/xpl-badge/badge.stories.js +48 -0
- package/dist/collection/components/xpl-badge/xpl-badge.js +52 -52
- package/dist/collection/components/xpl-breadcrumbs/breadcrumbs.stories.js +130 -0
- package/dist/collection/components/xpl-breadcrumbs/xpl-breadcrumb-item/xpl-breadcrumb-item.js +8 -12
- package/dist/collection/components/xpl-breadcrumbs/xpl-breadcrumbs/xpl-breadcrumbs.js +5 -8
- package/dist/collection/components/xpl-button/button.stories.js +133 -0
- package/dist/collection/components/xpl-button/xpl-button.js +272 -245
- package/dist/collection/components/xpl-button-row/button-row.stories.js +69 -0
- package/dist/collection/components/xpl-button-row/xpl-button-row.js +119 -116
- package/dist/collection/components/xpl-calendar/calendar.stories.js +59 -0
- package/dist/collection/components/xpl-calendar/xpl-calendar.js +224 -0
- package/dist/collection/components/xpl-checkbox/checkbox.stories.js +79 -0
- package/dist/collection/components/xpl-checkbox/xpl-checkbox.js +226 -193
- package/dist/collection/components/xpl-choicelist/choicelist.stories.js +134 -0
- package/dist/collection/components/xpl-choicelist/xpl-choicelist.js +220 -154
- package/dist/collection/components/xpl-content-area/content-area.stories.js +55 -0
- package/dist/collection/components/xpl-content-area/xpl-content-area.js +35 -33
- package/dist/collection/components/xpl-dashboard/dashboard.stories.js +48 -0
- package/dist/collection/components/xpl-dashboard/xpl-dashboard.js +7 -0
- package/dist/collection/components/xpl-data-card/data-card.stories.js +111 -0
- package/dist/collection/components/xpl-data-card/xpl-data-card.js +316 -0
- package/dist/collection/components/xpl-divider/divider.stories.js +32 -0
- package/dist/collection/components/xpl-divider/xpl-divider.js +30 -31
- package/dist/collection/components/xpl-dropdown/dropdown.stories.js +383 -0
- package/dist/collection/components/xpl-dropdown/xpl-dropdown-group/xpl-dropdown-group.js +68 -66
- package/dist/collection/components/xpl-dropdown/xpl-dropdown-heading/xpl-dropdown-heading.js +28 -29
- package/dist/collection/components/xpl-dropdown/xpl-dropdown-option/xpl-dropdown-option.js +148 -114
- package/dist/collection/components/xpl-dropdown/xpl-dropdown.js +438 -256
- package/dist/collection/components/xpl-dynamic-table/dynamic-table.stories.js +161 -0
- package/dist/collection/components/xpl-dynamic-table/xpl-dynamic-table.js +97 -0
- package/dist/collection/components/xpl-dynamic-table-cell/xpl-dynamic-table-cell.js +52 -0
- package/dist/collection/components/xpl-dynamic-table-row/xpl-dynamic-table-row.js +81 -0
- package/dist/{stories → collection/components/xpl-grid}/grid.stories.js +44 -68
- package/dist/collection/components/xpl-grid/xpl-grid.js +27 -24
- package/dist/collection/components/xpl-grid-item/xpl-grid-item.js +100 -92
- package/dist/collection/components/xpl-header-accordion/header-accordion.stories.js +48 -0
- package/dist/collection/components/xpl-header-accordion/xpl-header-accordion.js +200 -0
- package/dist/collection/components/xpl-icon/icons.stories.js +107 -0
- package/dist/collection/components/xpl-icon/xpl-icon.css +5 -0
- package/dist/collection/components/xpl-icon/xpl-icon.js +101 -0
- package/dist/collection/components/xpl-input/input.stories.js +531 -0
- package/dist/collection/components/xpl-input/xpl-input-color/color-utils.js +167 -0
- package/dist/collection/components/xpl-input/xpl-input-color/xpl-input-color.js +387 -0
- package/dist/collection/components/xpl-input/xpl-input-date/xpl-input-date.js +377 -0
- package/dist/collection/components/xpl-input/xpl-input-file/xpl-input-file.js +276 -0
- package/dist/collection/components/xpl-input/xpl-input-time/time-utils.js +63 -0
- package/dist/collection/components/xpl-input/xpl-input-time/xpl-input-time.js +425 -0
- package/dist/collection/components/xpl-input/xpl-input.js +729 -460
- package/dist/collection/components/xpl-large-card/large-card.stories.js +127 -0
- package/dist/collection/components/xpl-large-card/xpl-large-card.js +81 -0
- package/dist/collection/components/xpl-list/list.stories.js +148 -0
- package/dist/collection/components/xpl-list/xpl-list.js +51 -53
- package/dist/collection/components/xpl-main-nav/main-nav.stories.js +307 -0
- package/dist/collection/components/xpl-main-nav/xpl-main-nav.js +65 -63
- package/dist/collection/components/xpl-modal/modal.stories.js +87 -0
- package/dist/collection/components/xpl-modal/xpl-modal.js +139 -0
- package/dist/collection/components/xpl-nav-item/xpl-nav-item.js +63 -61
- package/dist/collection/components/xpl-pagination/pagination.stories.js +35 -0
- package/dist/collection/components/xpl-pagination/xpl-pagination.js +217 -172
- package/dist/collection/components/xpl-popover/popover.stories.js +164 -0
- package/dist/collection/components/xpl-popover/xpl-popover.js +346 -0
- package/dist/collection/components/xpl-progress/progress.stories.js +102 -0
- package/dist/collection/components/xpl-progress/xpl-progress.js +60 -0
- package/dist/collection/components/xpl-radio/radio.stories.js +91 -0
- package/dist/collection/components/xpl-radio/xpl-radio.js +188 -175
- package/dist/collection/components/xpl-secondary-nav/secondary-nav.stories.js +78 -0
- package/dist/collection/components/xpl-secondary-nav/xpl-secondary-nav.js +5 -5
- package/dist/collection/components/xpl-select/select.stories.js +293 -0
- package/dist/collection/components/xpl-select/xpl-select.js +660 -308
- package/dist/collection/components/xpl-skeleton/skeleton.stories.js +67 -0
- package/dist/collection/components/xpl-skeleton/xpl-skeleton.js +175 -0
- package/dist/collection/components/xpl-slideout/slideout.stories.js +103 -0
- package/dist/collection/components/xpl-slideout/xpl-slideout.js +150 -0
- package/dist/collection/components/xpl-tab/xpl-tab.js +77 -0
- package/dist/collection/components/xpl-tab-panel/xpl-tab-panel.js +56 -0
- package/dist/collection/components/xpl-table/table.stories.js +143 -0
- package/dist/collection/components/xpl-table/xpl-table.js +379 -214
- package/dist/collection/components/xpl-table-header/table-header.stories.js +122 -0
- package/dist/collection/components/xpl-table-header/xpl-table-header.js +7 -0
- package/dist/collection/components/xpl-table-header-cell/table-header-cell.stories.js +71 -0
- package/dist/collection/components/xpl-table-header-cell/xpl-table-header-cell.js +198 -0
- package/dist/collection/components/xpl-tabs/tabs.stories.js +77 -0
- package/dist/collection/components/xpl-tabs/xpl-tabs.js +206 -0
- package/dist/collection/components/xpl-tag/xpl-tag.js +27 -27
- package/dist/collection/components/xpl-toast/toast.stories.js +82 -0
- package/dist/collection/components/xpl-toast/xpl-toast.js +162 -0
- package/dist/collection/components/xpl-toggle/toggle.stories.js +84 -0
- package/dist/collection/components/xpl-toggle/xpl-toggle.js +165 -157
- package/dist/collection/components/xpl-toolbar/xpl-toolbar.js +56 -0
- package/dist/collection/components/xpl-tooltip/tooltip-arrow.js +2 -0
- package/dist/collection/components/xpl-tooltip/tooltip.stories.js +85 -0
- package/dist/collection/components/xpl-tooltip/xpl-tooltip.js +75 -0
- package/dist/collection/components/xpl-utility-bar/utility-bar.stories.js +87 -0
- package/dist/collection/components/xpl-utility-bar/xpl-utility-bar.js +89 -93
- package/dist/components/_commonjsHelpers.js +1 -0
- package/dist/components/index.d.ts +45 -0
- package/dist/components/index.js +1 -0
- package/dist/components/index2.js +1 -0
- package/dist/components/index3.js +1 -0
- package/dist/components/v4.js +1 -0
- package/dist/components/xpl-accordion.d.ts +11 -0
- package/dist/components/xpl-accordion.js +1 -0
- package/dist/components/xpl-application-shell.d.ts +11 -0
- package/dist/components/xpl-application-shell.js +1 -0
- package/dist/components/xpl-avatar.d.ts +11 -0
- package/dist/components/xpl-avatar.js +1 -0
- package/dist/components/xpl-avatar2.js +1 -0
- package/dist/components/xpl-backdrop.d.ts +11 -0
- package/dist/components/xpl-backdrop.js +1 -0
- package/dist/components/xpl-backdrop2.js +1 -0
- package/dist/components/xpl-badge.d.ts +11 -0
- package/dist/components/xpl-badge.js +1 -0
- package/dist/components/xpl-badge2.js +1 -0
- package/dist/components/xpl-breadcrumb-item.d.ts +11 -0
- package/dist/components/xpl-breadcrumb-item.js +1 -0
- package/dist/components/xpl-breadcrumbs.d.ts +11 -0
- package/dist/components/xpl-breadcrumbs.js +1 -0
- package/dist/components/xpl-button-row.d.ts +11 -0
- package/dist/components/xpl-button-row.js +1 -0
- package/dist/components/xpl-button.d.ts +11 -0
- package/dist/components/xpl-button.js +1 -0
- package/dist/components/xpl-button2.js +1 -0
- package/dist/components/xpl-calendar.d.ts +11 -0
- package/dist/components/xpl-calendar.js +1 -0
- package/dist/components/xpl-checkbox.d.ts +11 -0
- package/dist/components/xpl-checkbox.js +1 -0
- package/dist/components/xpl-checkbox2.js +1 -0
- package/dist/components/xpl-choicelist.d.ts +11 -0
- package/dist/components/xpl-choicelist.js +1 -0
- package/dist/components/xpl-content-area.d.ts +11 -0
- package/dist/components/xpl-content-area.js +1 -0
- package/dist/components/xpl-dashboard.d.ts +11 -0
- package/dist/components/xpl-dashboard.js +1 -0
- package/dist/components/xpl-data-card.d.ts +11 -0
- package/dist/components/xpl-data-card.js +1 -0
- package/dist/components/xpl-divider.d.ts +11 -0
- package/dist/components/xpl-divider.js +1 -0
- package/dist/components/xpl-divider2.js +1 -0
- package/dist/components/xpl-dropdown-group.d.ts +11 -0
- package/dist/components/xpl-dropdown-group.js +1 -0
- package/dist/components/xpl-dropdown-group2.js +1 -0
- package/dist/components/xpl-dropdown-heading.d.ts +11 -0
- package/dist/components/xpl-dropdown-heading.js +1 -0
- package/dist/components/xpl-dropdown-heading2.js +1 -0
- package/dist/components/xpl-dropdown-option.d.ts +11 -0
- package/dist/components/xpl-dropdown-option.js +1 -0
- package/dist/components/xpl-dropdown-option2.js +1 -0
- package/dist/components/xpl-dropdown.d.ts +11 -0
- package/dist/components/xpl-dropdown.js +1 -0
- package/dist/components/xpl-dropdown2.js +1 -0
- package/dist/components/xpl-dynamic-table-cell.d.ts +11 -0
- package/dist/components/xpl-dynamic-table-cell.js +1 -0
- package/dist/components/xpl-dynamic-table-row.d.ts +11 -0
- package/dist/components/xpl-dynamic-table-row.js +1 -0
- package/dist/components/xpl-dynamic-table.d.ts +11 -0
- package/dist/components/xpl-dynamic-table.js +1 -0
- package/dist/components/xpl-grid-item.d.ts +11 -0
- package/dist/components/xpl-grid-item.js +1 -0
- package/dist/components/xpl-grid.d.ts +11 -0
- package/dist/components/xpl-grid.js +1 -0
- package/dist/components/xpl-header-accordion.d.ts +11 -0
- package/dist/components/xpl-header-accordion.js +1 -0
- package/dist/components/xpl-icon.d.ts +11 -0
- package/dist/components/xpl-icon.js +1 -0
- package/dist/components/xpl-icon2.js +6 -0
- package/dist/components/xpl-input-color.d.ts +11 -0
- package/dist/components/xpl-input-color.js +1 -0
- package/dist/components/xpl-input-date.d.ts +11 -0
- package/dist/components/xpl-input-date.js +1 -0
- package/dist/components/xpl-input-date2.js +1 -0
- package/dist/components/xpl-input-file.d.ts +11 -0
- package/dist/components/xpl-input-file.js +1 -0
- package/dist/components/xpl-input-file2.js +1 -0
- package/dist/components/xpl-input-time.d.ts +11 -0
- package/dist/components/xpl-input-time.js +1 -0
- package/dist/components/xpl-input.d.ts +11 -0
- package/dist/components/xpl-input.js +1 -0
- package/dist/components/xpl-input2.js +1 -0
- package/dist/components/xpl-large-card.d.ts +11 -0
- package/dist/components/xpl-large-card.js +1 -0
- package/dist/components/xpl-list.d.ts +11 -0
- package/dist/components/xpl-list.js +1 -0
- package/dist/components/xpl-main-nav.d.ts +11 -0
- package/dist/components/xpl-main-nav.js +1 -0
- package/dist/components/xpl-modal.d.ts +11 -0
- package/dist/components/xpl-modal.js +1 -0
- package/dist/components/xpl-nav-item.d.ts +11 -0
- package/dist/components/xpl-nav-item.js +1 -0
- package/dist/components/xpl-pagination.d.ts +11 -0
- package/dist/components/xpl-pagination.js +1 -0
- package/dist/components/xpl-popover.d.ts +11 -0
- package/dist/components/xpl-popover.js +1 -0
- package/dist/components/xpl-popover2.js +1 -0
- package/dist/components/xpl-progress.d.ts +11 -0
- package/dist/components/xpl-progress.js +1 -0
- package/dist/components/xpl-radio.d.ts +11 -0
- package/dist/components/xpl-radio.js +1 -0
- package/dist/components/xpl-radio2.js +1 -0
- package/dist/components/xpl-secondary-nav.d.ts +11 -0
- package/dist/components/xpl-secondary-nav.js +1 -0
- package/dist/components/xpl-select.d.ts +11 -0
- package/dist/components/xpl-select.js +1 -0
- package/dist/components/xpl-select2.js +1 -0
- package/dist/components/xpl-skeleton.d.ts +11 -0
- package/dist/components/xpl-skeleton.js +1 -0
- package/dist/components/xpl-slideout.d.ts +11 -0
- package/dist/components/xpl-slideout.js +1 -0
- package/dist/components/xpl-tab-panel.d.ts +11 -0
- package/dist/components/xpl-tab-panel.js +1 -0
- package/dist/components/xpl-tab.d.ts +11 -0
- package/dist/components/xpl-tab.js +1 -0
- package/dist/components/xpl-table-header-cell.d.ts +11 -0
- package/dist/components/xpl-table-header-cell.js +1 -0
- package/dist/components/xpl-table-header.d.ts +11 -0
- package/dist/components/xpl-table-header.js +1 -0
- package/dist/components/xpl-table.d.ts +11 -0
- package/dist/components/xpl-table.js +1 -0
- package/dist/components/xpl-tabs.d.ts +11 -0
- package/dist/components/xpl-tabs.js +1 -0
- package/dist/components/xpl-tag.d.ts +11 -0
- package/dist/components/xpl-tag.js +1 -0
- package/dist/components/xpl-tag2.js +1 -0
- package/dist/components/xpl-toast.d.ts +11 -0
- package/dist/components/xpl-toast.js +1 -0
- package/dist/components/xpl-toggle.d.ts +11 -0
- package/dist/components/xpl-toggle.js +1 -0
- package/dist/components/xpl-toolbar.d.ts +11 -0
- package/dist/components/xpl-toolbar.js +1 -0
- package/dist/components/xpl-tooltip.d.ts +11 -0
- package/dist/components/xpl-tooltip.js +1 -0
- package/dist/components/xpl-tooltip2.js +1 -0
- package/dist/components/xpl-utility-bar.d.ts +11 -0
- package/dist/components/xpl-utility-bar.js +1 -0
- package/dist/css/typography.stories.js +144 -0
- package/dist/esm/apollo-core.js +15 -12
- package/dist/esm/app-globals-DQuL1Twl.js +3 -0
- package/dist/{cjs/xpl-input.cjs.entry.js → esm/index-CH4yJ6Qx.js} +1 -99
- package/dist/esm/index-DhZas3eX.js +2132 -0
- package/dist/esm/loader.js +7 -14
- package/dist/esm/{v4-929670b7.js → v4-Cqlsd6nf.js} +1 -11
- package/dist/esm/xpl-accordion.entry.js +71 -0
- package/dist/esm/xpl-application-shell.entry.js +41 -44
- package/dist/esm/xpl-avatar_41.entry.js +5479 -0
- package/dist/esm/xpl-button-row.entry.js +13 -16
- package/dist/esm/xpl-calendar.entry.js +64 -0
- package/dist/esm/xpl-dynamic-table-cell.entry.js +31 -0
- package/dist/esm/xpl-dynamic-table-row.entry.js +35 -0
- package/dist/esm/xpl-dynamic-table.entry.js +62 -0
- package/dist/esm/xpl-grid-item.entry.js +16 -16
- package/dist/esm/xpl-grid.entry.js +29 -26
- package/dist/esm/xpl-large-card.entry.js +25 -0
- package/dist/esm/xpl-list.entry.js +23 -28
- package/dist/esm/xpl-main-nav.entry.js +18 -18
- package/dist/esm/xpl-table-header-cell.entry.js +55 -0
- package/dist/esm/xpl-table-header.entry.js +12 -0
- package/dist/esm/xpl-toggle.entry.js +22 -28
- package/dist/esm/xpl-toolbar.entry.js +26 -0
- package/dist/types/components/xpl-accordion/accordion.stories.d.ts +37 -0
- package/dist/types/components/xpl-accordion/xpl-accordion.d.ts +16 -0
- package/dist/types/components/xpl-application-shell/application-shell.stories.d.ts +60 -0
- package/dist/types/components/xpl-application-shell/xpl-application-shell.d.ts +12 -27
- package/dist/types/components/xpl-avatar/avatar.stories.d.ts +75 -0
- package/dist/types/components/xpl-avatar/xpl-avatar.d.ts +9 -9
- package/dist/types/components/xpl-backdrop/backdrop.stories.d.ts +17 -0
- package/dist/types/components/xpl-backdrop/xpl-backdrop.d.ts +2 -6
- package/dist/types/components/xpl-badge/badge.stories.d.ts +44 -0
- package/dist/types/components/xpl-badge/xpl-badge.d.ts +3 -3
- package/dist/types/components/xpl-breadcrumbs/breadcrumbs.stories.d.ts +53 -0
- package/dist/types/components/xpl-breadcrumbs/xpl-breadcrumb-item/xpl-breadcrumb-item.d.ts +2 -5
- package/dist/types/components/xpl-breadcrumbs/xpl-breadcrumbs/xpl-breadcrumbs.d.ts +1 -4
- package/dist/types/components/xpl-button/button.stories.d.ts +92 -0
- package/dist/types/components/xpl-button/xpl-button.d.ts +14 -43
- package/dist/types/components/xpl-button-row/button-row.stories.d.ts +45 -0
- package/dist/types/components/xpl-button-row/xpl-button-row.d.ts +10 -32
- package/dist/types/components/xpl-calendar/calendar.stories.d.ts +58 -0
- package/dist/types/components/xpl-calendar/xpl-calendar.d.ts +18 -0
- package/dist/types/components/xpl-checkbox/checkbox.stories.d.ts +65 -0
- package/dist/types/components/xpl-checkbox/xpl-checkbox.d.ts +13 -13
- package/dist/types/components/xpl-choicelist/choice.d.ts +5 -4
- package/dist/types/components/xpl-choicelist/choicelist.stories.d.ts +40 -0
- package/dist/types/components/xpl-choicelist/xpl-choicelist.d.ts +16 -32
- package/dist/types/components/xpl-content-area/content-area.stories.d.ts +13 -0
- package/dist/types/components/xpl-content-area/xpl-content-area.d.ts +2 -5
- package/dist/types/components/xpl-dashboard/dashboard.stories.d.ts +31 -0
- package/dist/types/components/xpl-dashboard/xpl-dashboard.d.ts +3 -0
- package/dist/types/components/xpl-data-card/data-card.stories.d.ts +114 -0
- package/dist/types/components/xpl-data-card/xpl-data-card.d.ts +21 -0
- package/dist/types/components/xpl-divider/divider.stories.d.ts +37 -0
- package/dist/types/components/xpl-divider/xpl-divider.d.ts +2 -7
- package/dist/types/components/xpl-dropdown/dropdown-option.d.ts +12 -0
- package/dist/types/components/xpl-dropdown/dropdown.stories.d.ts +25 -0
- package/dist/types/components/xpl-dropdown/xpl-dropdown-group/xpl-dropdown-group.d.ts +4 -6
- package/dist/types/components/xpl-dropdown/xpl-dropdown-heading/xpl-dropdown-heading.d.ts +2 -3
- package/dist/types/components/xpl-dropdown/xpl-dropdown-option/xpl-dropdown-option.d.ts +13 -14
- package/dist/types/components/xpl-dropdown/xpl-dropdown.d.ts +34 -35
- package/dist/types/components/xpl-dynamic-table/dynamic-table.stories.d.ts +41 -0
- package/dist/types/components/xpl-dynamic-table/xpl-dynamic-table.d.ts +14 -0
- package/dist/types/components/xpl-dynamic-table-cell/xpl-dynamic-table-cell.d.ts +9 -0
- package/dist/types/components/xpl-dynamic-table-row/xpl-dynamic-table-row.d.ts +11 -0
- package/dist/types/components/xpl-grid/grid.stories.d.ts +133 -0
- package/dist/types/components/xpl-grid/xpl-grid.d.ts +3 -3
- package/dist/types/components/xpl-grid-item/xpl-grid-item.d.ts +5 -5
- package/dist/types/components/xpl-header-accordion/header-accordion.stories.d.ts +44 -0
- package/dist/types/components/xpl-header-accordion/xpl-header-accordion.d.ts +20 -0
- package/dist/types/components/xpl-icon/icons.stories.d.ts +54 -0
- package/dist/types/components/xpl-icon/xpl-icon.d.ts +8 -0
- package/dist/types/components/xpl-input/input.stories.d.ts +206 -0
- package/dist/types/components/xpl-input/xpl-input-color/color-utils.d.ts +41 -0
- package/dist/types/components/xpl-input/xpl-input-color/xpl-input-color.d.ts +30 -0
- package/dist/types/components/xpl-input/xpl-input-date/xpl-input-date.d.ts +30 -0
- package/dist/types/components/xpl-input/xpl-input-file/xpl-input-file.d.ts +24 -0
- package/dist/types/components/xpl-input/xpl-input-time/time-utils.d.ts +5 -0
- package/dist/types/components/xpl-input/xpl-input-time/xpl-input-time.d.ts +39 -0
- package/dist/types/components/xpl-input/xpl-input.d.ts +45 -85
- package/dist/types/components/xpl-large-card/large-card.stories.d.ts +71 -0
- package/dist/types/components/xpl-large-card/xpl-large-card.d.ts +8 -0
- package/dist/types/components/xpl-list/list.stories.d.ts +63 -0
- package/dist/types/components/xpl-list/listitem.d.ts +14 -14
- package/dist/types/components/xpl-list/xpl-list.d.ts +2 -26
- package/dist/types/components/xpl-main-nav/main-nav.stories.d.ts +13 -0
- package/dist/types/components/xpl-main-nav/xpl-main-nav.d.ts +6 -13
- package/dist/types/components/xpl-modal/modal.stories.d.ts +99 -0
- package/dist/types/components/xpl-modal/xpl-modal.d.ts +15 -0
- package/dist/types/components/xpl-nav-item/xpl-nav-item.d.ts +4 -10
- package/dist/types/components/xpl-pagination/pagination.stories.d.ts +35 -0
- package/dist/types/components/xpl-pagination/xpl-pagination.d.ts +19 -22
- package/dist/types/components/xpl-popover/popover.stories.d.ts +12 -0
- package/dist/types/components/xpl-popover/xpl-popover.d.ts +24 -0
- package/dist/types/components/xpl-progress/progress.stories.d.ts +34 -0
- package/dist/types/components/xpl-progress/xpl-progress.d.ts +6 -0
- package/dist/types/components/xpl-radio/radio.stories.d.ts +79 -0
- package/dist/types/components/xpl-radio/xpl-radio.d.ts +11 -11
- package/dist/types/components/xpl-secondary-nav/secondary-nav.stories.d.ts +5 -0
- package/dist/types/components/xpl-secondary-nav/xpl-secondary-nav.d.ts +1 -1
- package/dist/types/components/xpl-select/select.stories.d.ts +164 -0
- package/dist/types/components/xpl-select/xpl-select.d.ts +59 -55
- package/dist/types/components/xpl-skeleton/skeleton.stories.d.ts +26 -0
- package/dist/types/components/xpl-skeleton/xpl-skeleton.d.ts +10 -0
- package/dist/types/components/xpl-slideout/slideout.stories.d.ts +114 -0
- package/dist/types/components/xpl-slideout/xpl-slideout.d.ts +14 -0
- package/dist/types/components/xpl-tab/xpl-tab.d.ts +8 -0
- package/dist/types/components/xpl-tab-panel/xpl-tab-panel.d.ts +5 -0
- package/dist/types/components/xpl-table/table.stories.d.ts +84 -0
- package/dist/types/components/xpl-table/xpl-table.d.ts +37 -23
- package/dist/types/components/xpl-table-header/table-header.stories.d.ts +103 -0
- package/dist/types/components/xpl-table-header/xpl-table-header.d.ts +3 -0
- package/dist/types/components/xpl-table-header-cell/table-header-cell.stories.d.ts +55 -0
- package/dist/types/components/xpl-table-header-cell/xpl-table-header-cell.d.ts +14 -0
- package/dist/types/components/xpl-tabs/tabs.stories.d.ts +40 -0
- package/dist/types/components/xpl-tabs/xpl-tabs.d.ts +28 -0
- package/dist/types/components/xpl-tag/xpl-tag.d.ts +2 -2
- package/dist/types/components/xpl-toast/toast.stories.d.ts +62 -0
- package/dist/types/components/xpl-toast/xpl-toast.d.ts +14 -0
- package/dist/types/components/xpl-toggle/toggle.stories.d.ts +67 -0
- package/dist/types/components/xpl-toggle/xpl-toggle.d.ts +9 -21
- package/dist/types/components/xpl-toolbar/xpl-toolbar.d.ts +7 -0
- package/dist/types/components/xpl-tooltip/tooltip-arrow.d.ts +2 -0
- package/dist/types/components/xpl-tooltip/tooltip.stories.d.ts +39 -0
- package/dist/types/components/xpl-tooltip/xpl-tooltip.d.ts +6 -0
- package/dist/types/components/xpl-utility-bar/utility-bar.stories.d.ts +20 -0
- package/dist/types/components/xpl-utility-bar/xpl-utility-bar.d.ts +7 -17
- package/dist/types/components.d.ts +3060 -498
- package/dist/types/home/runner/work/apollo/apollo/packages/apollo-core/.stencil/css/typography.stories.d.ts +90 -0
- package/dist/types/stencil-public-runtime.d.ts +236 -34
- package/loader/cdn.js +1 -3
- package/loader/index.cjs.js +1 -3
- package/loader/index.d.ts +5 -2
- package/loader/index.es2017.js +1 -3
- package/loader/index.js +1 -3
- package/package.json +110 -61
- package/CHANGELOG.md +0 -106
- package/dist/apollo-core/p-10f00380.entry.js +0 -1
- package/dist/apollo-core/p-26ec64fe.entry.js +0 -1
- package/dist/apollo-core/p-2f90296c.js +0 -10
- package/dist/apollo-core/p-31acfdb4.entry.js +0 -1
- package/dist/apollo-core/p-4184ac44.entry.js +0 -1
- package/dist/apollo-core/p-4fa14839.entry.js +0 -1
- package/dist/apollo-core/p-55b87345.js +0 -2
- package/dist/apollo-core/p-63a6c98a.entry.js +0 -1
- package/dist/apollo-core/p-68c33b77.entry.js +0 -1
- package/dist/apollo-core/p-78d07caf.entry.js +0 -1
- package/dist/apollo-core/p-796957d3.entry.js +0 -1
- package/dist/apollo-core/p-88160d68.entry.js +0 -1
- package/dist/apollo-core/p-9ec318bb.entry.js +0 -1
- package/dist/apollo-core/p-a2a34e44.entry.js +0 -1
- package/dist/apollo-core/p-ad90fe4d.js +0 -1
- package/dist/apollo-core/p-beea2502.entry.js +0 -1
- package/dist/apollo-core/p-d499e43f.entry.js +0 -1
- package/dist/apollo-core/p-d8a3d94c.entry.js +0 -1
- package/dist/apollo-core/p-e047b446.entry.js +0 -1
- package/dist/cjs/index-2ab4832e.js +0 -2003
- package/dist/cjs/regular-872f5226.js +0 -16043
- package/dist/cjs/xpl-avatar_12.cjs.entry.js +0 -362
- package/dist/cjs/xpl-backdrop.cjs.entry.js +0 -21
- package/dist/cjs/xpl-choicelist.cjs.entry.js +0 -50
- package/dist/cjs/xpl-divider.cjs.entry.js +0 -19
- package/dist/cjs/xpl-dropdown-group_3.cjs.entry.js +0 -113
- package/dist/cjs/xpl-dropdown_2.cjs.entry.js +0 -121
- package/dist/cjs/xpl-pagination.cjs.entry.js +0 -79
- package/dist/cjs/xpl-select.cjs.entry.js +0 -610
- package/dist/collection/components/xpl-select/selectchoice.js +0 -1
- package/dist/custom-elements/index.d.ts +0 -219
- package/dist/custom-elements/index.js +0 -20353
- package/dist/esm/index-392b5b96.js +0 -1973
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/esm/regular-86225e9d.js +0 -16041
- package/dist/esm/xpl-avatar_12.entry.js +0 -347
- package/dist/esm/xpl-backdrop.entry.js +0 -17
- package/dist/esm/xpl-choicelist.entry.js +0 -46
- package/dist/esm/xpl-divider.entry.js +0 -15
- package/dist/esm/xpl-dropdown-group_3.entry.js +0 -107
- package/dist/esm/xpl-dropdown_2.entry.js +0 -116
- package/dist/esm/xpl-pagination.entry.js +0 -75
- package/dist/esm/xpl-select.entry.js +0 -606
- package/dist/stories/application-shell.stories.js +0 -776
- package/dist/stories/avatar.stories.js +0 -173
- package/dist/stories/backdrop.stories.js +0 -18
- package/dist/stories/badge.stories.js +0 -48
- package/dist/stories/breadcrumbs.stories.js +0 -117
- package/dist/stories/button-row.stories.js +0 -68
- package/dist/stories/button.stories.js +0 -122
- package/dist/stories/checkbox.stories.js +0 -78
- package/dist/stories/choicelist.stories.js +0 -112
- package/dist/stories/content-area.stories.js +0 -53
- package/dist/stories/divider.stories.js +0 -34
- package/dist/stories/dropdown.stories.js +0 -377
- package/dist/stories/input.stories.js +0 -268
- package/dist/stories/list.stories.js +0 -154
- package/dist/stories/main-nav.stories.js +0 -308
- package/dist/stories/pagination.stories.js +0 -84
- package/dist/stories/radio.stories.js +0 -68
- package/dist/stories/secondary-nav.stories.js +0 -76
- package/dist/stories/select.stories.js +0 -119
- package/dist/stories/table.stories.js +0 -107
- package/dist/stories/tabs.stories.js +0 -24
- package/dist/stories/toggle.stories.js +0 -84
- package/dist/stories/utility-bar.stories.js +0 -94
- package/dist/types/Users/fernandogelin/Xplor/apollo/.stencil/stories/application-shell.stories.d.ts +0 -71
- package/dist/types/Users/fernandogelin/Xplor/apollo/.stencil/stories/avatar.stories.d.ts +0 -91
- package/dist/types/Users/fernandogelin/Xplor/apollo/.stencil/stories/backdrop.stories.d.ts +0 -16
- package/dist/types/Users/fernandogelin/Xplor/apollo/.stencil/stories/badge.stories.d.ts +0 -48
- package/dist/types/Users/fernandogelin/Xplor/apollo/.stencil/stories/breadcrumbs.stories.d.ts +0 -53
- package/dist/types/Users/fernandogelin/Xplor/apollo/.stencil/stories/button-row.stories.d.ts +0 -49
- package/dist/types/Users/fernandogelin/Xplor/apollo/.stencil/stories/button.stories.d.ts +0 -91
- package/dist/types/Users/fernandogelin/Xplor/apollo/.stencil/stories/checkbox.stories.d.ts +0 -72
- package/dist/types/Users/fernandogelin/Xplor/apollo/.stencil/stories/choicelist.stories.d.ts +0 -41
- package/dist/types/Users/fernandogelin/Xplor/apollo/.stencil/stories/content-area.stories.d.ts +0 -29
- package/dist/types/Users/fernandogelin/Xplor/apollo/.stencil/stories/divider.stories.d.ts +0 -40
- package/dist/types/Users/fernandogelin/Xplor/apollo/.stencil/stories/dropdown.stories.d.ts +0 -135
- package/dist/types/Users/fernandogelin/Xplor/apollo/.stencil/stories/grid.stories.d.ts +0 -150
- package/dist/types/Users/fernandogelin/Xplor/apollo/.stencil/stories/input.stories.d.ts +0 -190
- package/dist/types/Users/fernandogelin/Xplor/apollo/.stencil/stories/list.stories.d.ts +0 -71
- package/dist/types/Users/fernandogelin/Xplor/apollo/.stencil/stories/main-nav.stories.d.ts +0 -30
- package/dist/types/Users/fernandogelin/Xplor/apollo/.stencil/stories/pagination.stories.d.ts +0 -0
- package/dist/types/Users/fernandogelin/Xplor/apollo/.stencil/stories/radio.stories.d.ts +0 -64
- package/dist/types/Users/fernandogelin/Xplor/apollo/.stencil/stories/secondary-nav.stories.d.ts +0 -16
- package/dist/types/Users/fernandogelin/Xplor/apollo/.stencil/stories/select.stories.d.ts +0 -74
- package/dist/types/Users/fernandogelin/Xplor/apollo/.stencil/stories/table.stories.d.ts +0 -49
- package/dist/types/Users/fernandogelin/Xplor/apollo/.stencil/stories/tabs.stories.d.ts +0 -0
- package/dist/types/Users/fernandogelin/Xplor/apollo/.stencil/stories/toggle.stories.d.ts +0 -74
- package/dist/types/Users/fernandogelin/Xplor/apollo/.stencil/stories/utility-bar.stories.d.ts +0 -20
- package/dist/types/components/xpl-dropdown/dropdownoption.d.ts +0 -10
- package/dist/types/components/xpl-select/selectchoice.d.ts +0 -4
- package/loader/package.json +0 -11
- /package/dist/collection/components/xpl-dropdown/{dropdownoption.js → dropdown-option.js} +0 -0
|
@@ -1,319 +1,671 @@
|
|
|
1
|
-
import { v4 as uuid } from
|
|
2
|
-
import {
|
|
3
|
-
import throttle from
|
|
1
|
+
import { v4 as uuid } from "uuid";
|
|
2
|
+
import { Fragment, h, Host, } from "@stencil/core";
|
|
3
|
+
import throttle from "lodash.throttle";
|
|
4
4
|
function tagWidth(text) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
const context = document.createElement('canvas').getContext('2d');
|
|
6
|
+
context.font = "14px apple-system, system-ui, 'Segoe UI', Arial, Helvetica, Roboto, sans-serif";
|
|
7
|
+
return context.measureText(text).width + 44;
|
|
8
|
+
}
|
|
9
|
+
function getDisplayValue(choice) {
|
|
10
|
+
return choice.label || choice.value;
|
|
11
|
+
}
|
|
12
|
+
function flattenChoices(choices) {
|
|
13
|
+
return choices.reduce((acc, curr) => [...acc, ...(curr.groupName ? curr.options : [curr])], []);
|
|
9
14
|
}
|
|
10
15
|
export class XplSelect {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
this.label = undefined;
|
|
17
|
-
this.mode = 'single';
|
|
18
|
-
this.placeholder = undefined;
|
|
19
|
-
this.truncate = true;
|
|
20
|
-
this.active = false;
|
|
21
|
-
this.id = uuid();
|
|
22
|
-
this.keepFocus = false;
|
|
23
|
-
this.selected = undefined;
|
|
24
|
-
this.value = '';
|
|
25
|
-
this.displayValue = '';
|
|
26
|
-
this.visibleChoices = Infinity;
|
|
27
|
-
}
|
|
28
|
-
componentWillLoad() {
|
|
29
|
-
this.selected =
|
|
30
|
-
this.choices && this.choices.length > 0
|
|
31
|
-
? this.choices.map(() => false)
|
|
32
|
-
: [];
|
|
33
|
-
window.addEventListener('click', (e) => {
|
|
34
|
-
const el = e.target;
|
|
35
|
-
const select = el.closest('.xpl-select');
|
|
36
|
-
if (select === null || select !== this.container) {
|
|
16
|
+
constructor() {
|
|
17
|
+
this.choices = [];
|
|
18
|
+
this.selectIcon = 'chevron-down';
|
|
19
|
+
this.mode = 'single';
|
|
20
|
+
this.truncate = true;
|
|
37
21
|
this.active = false;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
22
|
+
this.id = uuid();
|
|
23
|
+
this.keepFocus = false;
|
|
24
|
+
this.visibleChoices = Infinity;
|
|
25
|
+
this.choicesState = [];
|
|
26
|
+
this.value = this.calculateValue();
|
|
27
|
+
this.dropdownOpenState = false;
|
|
28
|
+
this.container = null;
|
|
29
|
+
this.dropdown = null;
|
|
30
|
+
this.handleResizeThrottled = throttle(() => {
|
|
31
|
+
this.maybeTruncateChoices();
|
|
32
|
+
}, 250);
|
|
33
|
+
this.handleTabKeyDown = (e) => {
|
|
34
|
+
if (e.key === 'Tab')
|
|
35
|
+
this.keepFocus = true;
|
|
36
|
+
};
|
|
37
|
+
this.handleTagRemove = (tagToRemove) => {
|
|
38
|
+
const isItemMatch = (item) => ((tagToRemove === null || tagToRemove === void 0 ? void 0 : tagToRemove.value) && item.value === tagToRemove.value) ||
|
|
39
|
+
((tagToRemove === null || tagToRemove === void 0 ? void 0 : tagToRemove.label) && item.label === tagToRemove.label);
|
|
40
|
+
this.choicesState = this.choicesState.map((choice) => {
|
|
41
|
+
var _a;
|
|
42
|
+
return (Object.assign(Object.assign({}, choice), { isSelected: isItemMatch(choice) ? false : choice.isSelected, options: (_a = choice.options) === null || _a === void 0 ? void 0 : _a.map((option) => (Object.assign(Object.assign({}, option), { isSelected: isItemMatch(option) ? false : option.isSelected }))) }));
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
this.handleDropdownScroll = (e) => {
|
|
46
|
+
const { scrollTop, scrollHeight, clientHeight } = this.dropdown.querySelector('.xpl-dropdown-list');
|
|
47
|
+
const atTop = scrollTop === 0;
|
|
48
|
+
const atBottom = scrollTop + clientHeight >= scrollHeight;
|
|
49
|
+
if ((atTop && e.deltaY < 0) || (atBottom && e.deltaY > 0)) {
|
|
50
|
+
e.preventDefault();
|
|
51
|
+
}
|
|
52
|
+
};
|
|
59
53
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
if (visibleChoices < 1)
|
|
63
|
-
visibleChoices = 1;
|
|
64
|
-
this.visibleChoices = visibleChoices;
|
|
65
|
-
}
|
|
66
|
-
flattenChoices() {
|
|
67
|
-
return this.choices.reduce((acc, curr) => [
|
|
68
|
-
...acc,
|
|
69
|
-
...(curr.groupName ? curr.options : [curr]),
|
|
70
|
-
], []);
|
|
71
|
-
}
|
|
72
|
-
getDisplayValue(i) {
|
|
73
|
-
return this.flattenChoices()[i].label || this.flattenChoices()[i].value;
|
|
74
|
-
}
|
|
75
|
-
getActualValue(i) {
|
|
76
|
-
return this.flattenChoices()[i].value || this.flattenChoices()[i].label;
|
|
77
|
-
}
|
|
78
|
-
update() {
|
|
79
|
-
this.selected = this.flattenChoices().map(({ isSelected }) => isSelected);
|
|
80
|
-
if (this.mode === 'single') {
|
|
81
|
-
const selected = this.selected.findIndex((v) => v);
|
|
82
|
-
this.value = selected >= 0 ? this.getActualValue(selected) : '';
|
|
83
|
-
this.displayValue =
|
|
84
|
-
selected >= 0 ? this.getDisplayValue(selected) : '';
|
|
54
|
+
onChoicesPropChanged(_choices) {
|
|
55
|
+
this.choicesState = this.initializeChoicesState();
|
|
85
56
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
.map((v, i) => {
|
|
89
|
-
return v ? this.getActualValue(i) : '';
|
|
90
|
-
})
|
|
91
|
-
.filter((v) => v.length > 0)
|
|
92
|
-
.join('|');
|
|
57
|
+
onSelectedValuesPropChanged() {
|
|
58
|
+
this.choicesState = this.initializeChoicesState();
|
|
93
59
|
}
|
|
94
|
-
|
|
95
|
-
render() {
|
|
96
|
-
let visibleChoices = 0;
|
|
97
|
-
return (h(Host, { class: {
|
|
98
|
-
'xpl-select': true,
|
|
99
|
-
'xpl-select--disabled': this.disabled,
|
|
100
|
-
'xpl-select--no-truncate': !this.truncate,
|
|
101
|
-
}, onKeyDown: (e) => {
|
|
102
|
-
if (e.key === 'Escape')
|
|
103
|
-
this.active = false;
|
|
104
|
-
}, ref: (el) => (this.container = el) }, this.label || this.description ? (h("label", { class: {
|
|
105
|
-
'xpl-label': true,
|
|
106
|
-
'xpl-label--disabled': this.disabled,
|
|
107
|
-
}, htmlFor: this.id }, this.label, this.description && (h("small", { class: {
|
|
108
|
-
'xpl-description': true,
|
|
109
|
-
'xpl-description--disabled': this.disabled,
|
|
110
|
-
} }, this.description)))) : null, h("div", { class: {
|
|
111
|
-
'xpl-input': true,
|
|
112
|
-
'xpl-input--disabled': this.disabled,
|
|
113
|
-
'xpl-input--error': this.error !== undefined,
|
|
114
|
-
} }, h("div", { class: "xpl-input-wrapper" }, h("div", { class: {
|
|
115
|
-
'xpl-select-value': true,
|
|
116
|
-
'xpl-select-value--active': this.mode === 'multi' &&
|
|
117
|
-
this.value.length > 0,
|
|
118
|
-
'has-value': this.value.length > 0,
|
|
119
|
-
} }, this.mode === 'single'
|
|
120
|
-
? this.displayValue || this.placeholder
|
|
121
|
-
: this.value.length > 0
|
|
122
|
-
? this.selected.map((v, i) => {
|
|
123
|
-
if (!v)
|
|
124
|
-
return null;
|
|
125
|
-
if (visibleChoices >= this.visibleChoices)
|
|
126
|
-
return null;
|
|
127
|
-
visibleChoices++;
|
|
128
|
-
return (h("xpl-tag", { onClose: () => {
|
|
129
|
-
this.flattenChoices().forEach((v, j) => {
|
|
130
|
-
if (i === j)
|
|
131
|
-
v.isSelected =
|
|
132
|
-
false;
|
|
133
|
-
});
|
|
134
|
-
const mapOptions = (option) => {
|
|
135
|
-
option.options =
|
|
136
|
-
option.groupName
|
|
137
|
-
? option.options.map(mapOptions)
|
|
138
|
-
: undefined;
|
|
139
|
-
return option;
|
|
140
|
-
};
|
|
141
|
-
this.choices =
|
|
142
|
-
this.choices.map(mapOptions);
|
|
143
|
-
this.update();
|
|
144
|
-
this.maybeTruncateChoices();
|
|
145
|
-
} }, this.getDisplayValue(i)));
|
|
146
|
-
})
|
|
147
|
-
: this.placeholder, this.visibleChoices < Infinity &&
|
|
148
|
-
`+ ${this.selected.filter((a) => a).length -
|
|
149
|
-
this.visibleChoices} more`), h("button", { disabled: this.disabled, id: this.id, onKeyDown: (e) => {
|
|
150
|
-
if (e.key === 'Tab')
|
|
151
|
-
this.keepFocus = true;
|
|
152
|
-
}, onClick: () => {
|
|
153
|
-
const { dropdown } = this;
|
|
154
|
-
if (!this.disabled)
|
|
155
|
-
dropdown.isOpen = !dropdown.isOpen;
|
|
156
|
-
} })), !this.disabled && (h("xpl-dropdown", { options: this.choices, mode: this.mode, triggerId: this.id, update: () => {
|
|
60
|
+
onChoicesStateChanged() {
|
|
157
61
|
this.update();
|
|
62
|
+
}
|
|
63
|
+
handleValueStateChange(newValue) {
|
|
64
|
+
this.selectChange.emit(newValue);
|
|
65
|
+
this.changeEvent.emit(this.mode === 'single' ? newValue : !(newValue === null || newValue === void 0 ? void 0 : newValue.length) ? [] : newValue.split('|'));
|
|
66
|
+
if (this.customDisplayValue && this.container !== null) {
|
|
67
|
+
const customDisplayElements = this.container.querySelectorAll('.custom-display-value');
|
|
68
|
+
customDisplayElements.forEach((el) => {
|
|
69
|
+
el.classList.toggle('display-active', newValue.length > 0);
|
|
70
|
+
el.classList.toggle('display-inactive', newValue.length === 0);
|
|
71
|
+
});
|
|
72
|
+
const placeholderElements = this.container.querySelectorAll('.placeholder');
|
|
73
|
+
placeholderElements.forEach((el) => {
|
|
74
|
+
el.classList.toggle('placeholder-hidden', newValue.length > 0);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
onDropdownOpenStateChanged(newValue) {
|
|
79
|
+
this.dropdownStateChange.emit(newValue);
|
|
80
|
+
}
|
|
81
|
+
initializeChoicesState() {
|
|
82
|
+
return this.choices.map((choice) => {
|
|
83
|
+
var _a;
|
|
84
|
+
const valueToCompare = typeof this.selectedValues === 'string'
|
|
85
|
+
? [this.selectedValues]
|
|
86
|
+
: this.selectedValues;
|
|
87
|
+
return Object.assign(Object.assign({}, choice), { isSelected: choice.isSelected || (valueToCompare === null || valueToCompare === void 0 ? void 0 : valueToCompare.includes(choice.value || choice.label)), options: (_a = choice.options) === null || _a === void 0 ? void 0 : _a.map((option) => (Object.assign(Object.assign({}, option), { isSelected: option.isSelected || (valueToCompare === null || valueToCompare === void 0 ? void 0 : valueToCompare.includes(option.value || option.label)) }))) });
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
maybeTruncateChoices() {
|
|
91
|
+
var _a, _b;
|
|
92
|
+
if (this.mode === 'single' || !this.truncate)
|
|
93
|
+
return;
|
|
94
|
+
const containerWidth = (_a = this.container) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().width;
|
|
95
|
+
let visibleChoices = 0;
|
|
96
|
+
let visibleChoicesWidth = 0;
|
|
97
|
+
const actualNumList = (_b = flattenChoices(this.choicesState)) === null || _b === void 0 ? void 0 : _b.filter((a) => a.isSelected);
|
|
98
|
+
if (!actualNumList.length)
|
|
99
|
+
return;
|
|
100
|
+
const actualNumSelected = actualNumList.length;
|
|
101
|
+
actualNumList.forEach((_, i) => {
|
|
102
|
+
visibleChoicesWidth += tagWidth(getDisplayValue(actualNumList[i]));
|
|
103
|
+
if (visibleChoicesWidth > containerWidth - 140) {
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
visibleChoices += 1;
|
|
107
|
+
return null;
|
|
108
|
+
});
|
|
109
|
+
if (visibleChoices >= actualNumSelected)
|
|
110
|
+
visibleChoices = Infinity;
|
|
111
|
+
if (visibleChoices < 1)
|
|
112
|
+
visibleChoices = 1;
|
|
113
|
+
this.visibleChoices = visibleChoices;
|
|
114
|
+
}
|
|
115
|
+
closeDropdown() {
|
|
116
|
+
var _a;
|
|
117
|
+
if (!((_a = this.dropdown) === null || _a === void 0 ? void 0 : _a.isOpen)) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
this.dropdown.isOpen = false;
|
|
121
|
+
this.active = false;
|
|
122
|
+
}
|
|
123
|
+
calculateValue() {
|
|
124
|
+
const selectedChoices = flattenChoices(this.choicesState).filter((choice) => choice.isSelected);
|
|
125
|
+
if (!selectedChoices.length) {
|
|
126
|
+
return '';
|
|
127
|
+
}
|
|
128
|
+
if (this.mode === 'single') {
|
|
129
|
+
return selectedChoices[0].value || selectedChoices[0].label;
|
|
130
|
+
}
|
|
131
|
+
return selectedChoices.map((choice) => choice.value || choice.label).join('|');
|
|
132
|
+
}
|
|
133
|
+
update() {
|
|
134
|
+
this.value = this.calculateValue();
|
|
158
135
|
this.maybeTruncateChoices();
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
136
|
+
}
|
|
137
|
+
renderLabel() {
|
|
138
|
+
if (!this.label && !this.description)
|
|
139
|
+
return null;
|
|
140
|
+
return (h("label", { class: {
|
|
141
|
+
'xpl-label': true,
|
|
142
|
+
'xpl-label--disabled': this.disabled,
|
|
143
|
+
}, htmlFor: this.id }, this.label, this.description && (h("small", { class: {
|
|
144
|
+
'xpl-description': true,
|
|
145
|
+
'xpl-description--disabled': this.disabled,
|
|
146
|
+
} }, this.description))));
|
|
147
|
+
}
|
|
148
|
+
renderSelectedTags() {
|
|
149
|
+
let visibleChoices = 0;
|
|
150
|
+
const selectedChoices = flattenChoices(this.choicesState).filter((choice) => choice.isSelected);
|
|
151
|
+
if (!selectedChoices.length) {
|
|
152
|
+
return null;
|
|
153
|
+
}
|
|
154
|
+
const tags = selectedChoices.map((_, i) => {
|
|
155
|
+
if (visibleChoices >= this.visibleChoices)
|
|
156
|
+
return null;
|
|
157
|
+
visibleChoices += 1;
|
|
158
|
+
return (h("xpl-tag", { onClose: () => this.handleTagRemove(selectedChoices[i]) }, getDisplayValue(selectedChoices[i])));
|
|
159
|
+
});
|
|
160
|
+
return tags;
|
|
161
|
+
}
|
|
162
|
+
renderError() {
|
|
163
|
+
if (this.error === undefined || this.error.length === 0)
|
|
164
|
+
return null;
|
|
165
|
+
return (h("label", { class: "xpl-input-error", htmlFor: this.id }, h("xpl-icon", { icon: "alert-circle" }), this.error));
|
|
166
|
+
}
|
|
167
|
+
componentWillLoad() {
|
|
168
|
+
this.choicesState = this.initializeChoicesState();
|
|
169
|
+
}
|
|
170
|
+
handleClickEvent(e) {
|
|
171
|
+
const el = e.target;
|
|
172
|
+
const select = el.closest('.xpl-select');
|
|
173
|
+
if (select === null || select !== this.container) {
|
|
174
|
+
this.closeDropdown();
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
handleKeyDown(e) {
|
|
178
|
+
var _a;
|
|
179
|
+
if (e.key === 'Escape' &&
|
|
180
|
+
(this.active || ((_a = this.container) === null || _a === void 0 ? void 0 : _a.contains(document.activeElement)))) {
|
|
181
|
+
this.closeDropdown();
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
handleResize() {
|
|
185
|
+
this.handleResizeThrottled();
|
|
186
|
+
}
|
|
187
|
+
componentDidLoad() {
|
|
188
|
+
requestAnimationFrame(() => {
|
|
189
|
+
this.maybeTruncateChoices();
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
disconnectedCallback() {
|
|
193
|
+
var _a;
|
|
194
|
+
(_a = this.handleResizeThrottled) === null || _a === void 0 ? void 0 : _a.cancel();
|
|
195
|
+
}
|
|
196
|
+
handleDropdownTrigger() {
|
|
197
|
+
var _a;
|
|
198
|
+
const prevState = (_a = this.dropdown.isOpen) !== null && _a !== void 0 ? _a : false;
|
|
199
|
+
const nextState = !prevState;
|
|
200
|
+
const e = this.triggerDropdown.emit({
|
|
201
|
+
prevState,
|
|
202
|
+
nextState,
|
|
203
|
+
});
|
|
204
|
+
if (!e.defaultPrevented && !this.disabled) {
|
|
205
|
+
this.dropdownOpenState = nextState;
|
|
206
|
+
this.dropdown.isOpen = nextState;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
async reset() {
|
|
210
|
+
this.closeDropdown();
|
|
211
|
+
this.choicesState = this.choicesState.map((choice) => {
|
|
212
|
+
var _a;
|
|
213
|
+
return (Object.assign(Object.assign({}, choice), { isSelected: false, options: (_a = choice.options) === null || _a === void 0 ? void 0 : _a.map((option) => (Object.assign(Object.assign({}, option), { isSelected: false }))) }));
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
render() {
|
|
217
|
+
var _a, _b, _c;
|
|
218
|
+
const selectedChoices = flattenChoices(this.choicesState).filter((choice) => choice.isSelected);
|
|
219
|
+
const displayedValue = ((_a = selectedChoices[0]) === null || _a === void 0 ? void 0 : _a.label) || ((_b = selectedChoices[0]) === null || _b === void 0 ? void 0 : _b.value);
|
|
220
|
+
const isTextTruncated = selectedChoices.length > 1 &&
|
|
221
|
+
this.visibleChoices < Infinity &&
|
|
222
|
+
this.truncate &&
|
|
223
|
+
!this.customDisplayValue;
|
|
224
|
+
const truncatedText = `+ ${Math.abs(this.choicesState.filter((a) => a.isSelected).length - this.visibleChoices)} more`;
|
|
225
|
+
return (h(Host, { key: '8ffd6b069df2b869abfa22ae5e41731a992abe36', class: {
|
|
226
|
+
'xpl-select': true,
|
|
227
|
+
'xpl-select--disabled': this.disabled,
|
|
228
|
+
'xpl-select--no-truncate': !this.truncate,
|
|
229
|
+
[(_c = this.classNames) !== null && _c !== void 0 ? _c : '']: !!this.classNames,
|
|
230
|
+
}, onKeyDown: this.handleTabKeyDown, ref: (el) => {
|
|
231
|
+
this.container = el;
|
|
232
|
+
} }, this.renderLabel(), h("div", { key: 'ed959919397c5c2ffc063957188e00a10feeed9a', class: {
|
|
233
|
+
'xpl-input': true,
|
|
234
|
+
'xpl-input--disabled': this.disabled,
|
|
235
|
+
'xpl-input--error': this.error !== undefined,
|
|
236
|
+
} }, h("div", { key: '266e7d99a66d66241ebe1d20375d0a270b8b6399', class: "xpl-input-wrapper" }, h("button", { key: 'cdb455539afb77ab76f729e8a21419d32c220a75', class: "xpl-select__trigger", disabled: this.disabled, id: this.id, onKeyDown: this.handleTabKeyDown, onClick: (e) => {
|
|
237
|
+
e.preventDefault();
|
|
238
|
+
this.handleDropdownTrigger();
|
|
239
|
+
}, type: "button" }, h("div", { key: 'db9e85fa588af2c35d3de960826c171bc02627af', class: {
|
|
240
|
+
'xpl-select-value': true,
|
|
241
|
+
'xpl-select-value--active': this.mode === 'multi' && this.value.length > 0,
|
|
242
|
+
'has-value': this.value.length > 0,
|
|
243
|
+
} }, (() => {
|
|
244
|
+
if (this.customDisplayValue) {
|
|
245
|
+
return (h(Fragment, null, h("div", { class: {
|
|
246
|
+
'custom-display-value': true,
|
|
247
|
+
'custom-display-value--inactive': this.value.length === 0,
|
|
248
|
+
} }, h("slot", { name: "custom-display-value" })), h("span", { class: {
|
|
249
|
+
'xpl-placeholder--hidden': this.value.length > 0,
|
|
250
|
+
} }, this.placeholder)));
|
|
251
|
+
}
|
|
252
|
+
if (this.mode === 'single') {
|
|
253
|
+
return displayedValue || this.placeholder;
|
|
174
254
|
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
"
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
255
|
+
if (this.value.length > 0) {
|
|
256
|
+
return this.renderSelectedTags();
|
|
257
|
+
}
|
|
258
|
+
return this.placeholder;
|
|
259
|
+
})(), isTextTruncated && truncatedText), h("xpl-icon", { key: 'ef3997f19a4e4bb4de12f826c736ef9afc4bd5c8', class: "xpl-select__chevron-down", icon: this.selectIcon }))), !this.disabled && (h("xpl-dropdown", { key: 'df29a0a21c11fa4c9a550a4339c6719793783404', ref: (el) => {
|
|
260
|
+
this.dropdown = el;
|
|
261
|
+
}, isOpen: this.dropdownOpenState, options: this.choicesState, selectedValues: this.selectedValues, mode: this.mode, triggerId: this.id, update: (_e, { component }) => {
|
|
262
|
+
const { options } = component;
|
|
263
|
+
if (options && options.length > 0) {
|
|
264
|
+
this.choicesState = options;
|
|
265
|
+
}
|
|
266
|
+
}, onIsOpenChange: (e) => {
|
|
267
|
+
this.dropdownOpenState = e.detail;
|
|
268
|
+
}, onWheel: this.handleDropdownScroll, anchorToTrigger: true })), this.renderError()), h("input", { key: '3e7f53a0d8e6d4e8028e1dc38d0e3661b76978f5', type: "hidden", name: this.name, value: this.value })));
|
|
269
|
+
}
|
|
270
|
+
static get is() { return "xpl-select"; }
|
|
271
|
+
static get properties() {
|
|
272
|
+
return {
|
|
273
|
+
"choices": {
|
|
274
|
+
"type": "unknown",
|
|
275
|
+
"mutable": false,
|
|
276
|
+
"complexType": {
|
|
277
|
+
"original": "DropdownItem[]",
|
|
278
|
+
"resolved": "Partial<DropdownOption & DropdownOptionGroup>[]",
|
|
279
|
+
"references": {
|
|
280
|
+
"DropdownItem": {
|
|
281
|
+
"location": "import",
|
|
282
|
+
"path": "../xpl-dropdown/dropdown-option",
|
|
283
|
+
"id": "src/components/components/xpl-dropdown/dropdown-option.ts::DropdownItem",
|
|
284
|
+
"referenceLocation": "DropdownItem"
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
"required": false,
|
|
289
|
+
"optional": true,
|
|
290
|
+
"docs": {
|
|
291
|
+
"tags": [],
|
|
292
|
+
"text": "An array of choices for the user to choose from.\nEach choice should be of the form:\n{\n label: string;\n href?: string;\n value?: string;\n isGroupHeading?: boolean;\n isSelected?: boolean;\n isDisabled?: boolean;\n options?: DropdownItem[];\n groupName?: string;\n}"
|
|
293
|
+
},
|
|
294
|
+
"getter": false,
|
|
295
|
+
"setter": false,
|
|
296
|
+
"defaultValue": "[]"
|
|
297
|
+
},
|
|
298
|
+
"selectIcon": {
|
|
299
|
+
"type": "string",
|
|
300
|
+
"mutable": false,
|
|
301
|
+
"complexType": {
|
|
302
|
+
"original": "IconName",
|
|
303
|
+
"resolved": "\"ai\" | \"alarm-clock\" | \"alert-circle\" | \"alert-hex\" | \"alert-triangle\" | \"apps\" | \"archive\" | \"arrow-down\" | \"arrow-down-right\" | \"arrow-left\" | \"arrow-right\" | \"arrow-up\" | \"arrow-up-right\" | \"award\" | \"bell\" | \"bell-slash\" | \"bookmark\" | \"bookmark-slash\" | \"briefcase\" | \"calendar\" | \"calendar-month\" | \"calendar-week\" | \"camera\" | \"cash-register\" | \"check\" | \"check-circle\" | \"check-circle-fill\" | \"chevron-down\" | \"chevron-left\" | \"chevron-right\" | \"chevron-up\" | \"chevrons-down\" | \"chevrons-left\" | \"chevrons-right\" | \"chevrons-up\" | \"circle-slash\" | \"clipboard\" | \"clock\" | \"code-square\" | \"comment\" | \"comment-alt\" | \"comment-check\" | \"comment-closed\" | \"comment-discussion\" | \"comment-minus\" | \"comment-plus\" | \"comment-x\" | \"compass\" | \"credit-card\" | \"dash\" | \"dollar-bill\" | \"dollar-sign\" | \"download\" | \"drag\" | \"dumbbells\" | \"duplicate\" | \"edit\" | \"expand\" | \"eye\" | \"eye-closed\" | \"eye-droper\" | \"file\" | \"flag\" | \"folder\" | \"gear\" | \"gift\" | \"globe\" | \"graph\" | \"graph-bar\" | \"grid\" | \"heart\" | \"home\" | \"image\" | \"info\" | \"kebab-horizontal\" | \"kebab-vertical\" | \"key\" | \"law\" | \"layers\" | \"left-align\" | \"light-bulb\" | \"line\" | \"link\" | \"link-external\" | \"list-ordered\" | \"list-unordered\" | \"loader\" | \"location\" | \"lock\" | \"mail\" | \"mail-check\" | \"mail-closed\" | \"mail-minus\" | \"mail-plus\" | \"mail-x\" | \"map\" | \"megaphone\" | \"minus-circle\" | \"moon\" | \"navigation\" | \"organization\" | \"package\" | \"paperclip\" | \"pencil\" | \"people\" | \"percent\" | \"person\" | \"person-add\" | \"person-circle\" | \"phone\" | \"phone-minus\" | \"phone-pause\" | \"phone-plus\" | \"phone-slash\" | \"phone-x\" | \"pie-chart\" | \"pin\" | \"pin-circle\" | \"pin-circle-filled\" | \"pin-filled\" | \"play\" | \"plus\" | \"plus-circle\" | \"printer\" | \"question\" | \"refresh-cw\" | \"repeat\" | \"right-align\" | \"rocket\" | \"rotate-ccw\" | \"rotate-cw\" | \"save\" | \"search\" | \"share\" | \"shopping-bag\" | \"shopping-cart\" | \"sign-in\" | \"sign-out\" | \"signature\" | \"sliders-h\" | \"sliders-v\" | \"sort\" | \"star\" | \"star-fill\" | \"star-half-fill\" | \"sun\" | \"tag\" | \"three-bars\" | \"time-reverse\" | \"tools\" | \"trashcan\" | \"triangle-down\" | \"triangle-left\" | \"triangle-right\" | \"triangle-up\" | \"trophy\" | \"unlock\" | \"upload\" | \"video-camera\" | \"x\" | \"x-circle\" | \"x-circle-fill\" | \"zoom-in\" | \"zoom-out\"",
|
|
304
|
+
"references": {
|
|
305
|
+
"IconName": {
|
|
306
|
+
"location": "local",
|
|
307
|
+
"path": "/home/runner/work/apollo/apollo/packages/apollo-core/src/components/components/xpl-select/xpl-select.tsx",
|
|
308
|
+
"id": "src/components/components/xpl-select/xpl-select.tsx::IconName"
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
},
|
|
312
|
+
"required": false,
|
|
313
|
+
"optional": true,
|
|
314
|
+
"docs": {
|
|
315
|
+
"tags": [],
|
|
316
|
+
"text": "The icon to display in the select trigger button."
|
|
317
|
+
},
|
|
318
|
+
"getter": false,
|
|
319
|
+
"setter": false,
|
|
320
|
+
"reflect": false,
|
|
321
|
+
"attribute": "select-icon",
|
|
322
|
+
"defaultValue": "'chevron-down'"
|
|
323
|
+
},
|
|
324
|
+
"description": {
|
|
325
|
+
"type": "string",
|
|
326
|
+
"mutable": false,
|
|
327
|
+
"complexType": {
|
|
328
|
+
"original": "string",
|
|
329
|
+
"resolved": "string",
|
|
330
|
+
"references": {}
|
|
331
|
+
},
|
|
332
|
+
"required": false,
|
|
333
|
+
"optional": true,
|
|
334
|
+
"docs": {
|
|
335
|
+
"tags": [],
|
|
336
|
+
"text": "Optional text that appears below the input label."
|
|
337
|
+
},
|
|
338
|
+
"getter": false,
|
|
339
|
+
"setter": false,
|
|
340
|
+
"reflect": false,
|
|
341
|
+
"attribute": "description"
|
|
342
|
+
},
|
|
343
|
+
"disabled": {
|
|
344
|
+
"type": "boolean",
|
|
345
|
+
"mutable": false,
|
|
346
|
+
"complexType": {
|
|
347
|
+
"original": "boolean",
|
|
348
|
+
"resolved": "boolean",
|
|
349
|
+
"references": {}
|
|
350
|
+
},
|
|
351
|
+
"required": false,
|
|
352
|
+
"optional": true,
|
|
353
|
+
"docs": {
|
|
354
|
+
"tags": [],
|
|
355
|
+
"text": "Whether the field is disabled"
|
|
356
|
+
},
|
|
357
|
+
"getter": false,
|
|
358
|
+
"setter": false,
|
|
359
|
+
"reflect": false,
|
|
360
|
+
"attribute": "disabled"
|
|
361
|
+
},
|
|
362
|
+
"error": {
|
|
363
|
+
"type": "string",
|
|
364
|
+
"mutable": false,
|
|
365
|
+
"complexType": {
|
|
366
|
+
"original": "string",
|
|
367
|
+
"resolved": "string",
|
|
368
|
+
"references": {}
|
|
369
|
+
},
|
|
370
|
+
"required": false,
|
|
371
|
+
"optional": true,
|
|
372
|
+
"docs": {
|
|
373
|
+
"tags": [],
|
|
374
|
+
"text": "If an empty string (attribute present with no value),\nwill display visually as an error. If a string is\nincluded, will display visually as an error and include\nthe value as an error message."
|
|
375
|
+
},
|
|
376
|
+
"getter": false,
|
|
377
|
+
"setter": false,
|
|
378
|
+
"reflect": false,
|
|
379
|
+
"attribute": "error"
|
|
380
|
+
},
|
|
381
|
+
"label": {
|
|
382
|
+
"type": "string",
|
|
383
|
+
"mutable": false,
|
|
384
|
+
"complexType": {
|
|
385
|
+
"original": "string",
|
|
386
|
+
"resolved": "string",
|
|
387
|
+
"references": {}
|
|
388
|
+
},
|
|
389
|
+
"required": false,
|
|
390
|
+
"optional": true,
|
|
391
|
+
"docs": {
|
|
392
|
+
"tags": [],
|
|
393
|
+
"text": "The label that appears above the select dropdown"
|
|
394
|
+
},
|
|
395
|
+
"getter": false,
|
|
396
|
+
"setter": false,
|
|
397
|
+
"reflect": false,
|
|
398
|
+
"attribute": "label"
|
|
399
|
+
},
|
|
400
|
+
"mode": {
|
|
401
|
+
"type": "string",
|
|
402
|
+
"mutable": false,
|
|
403
|
+
"complexType": {
|
|
404
|
+
"original": "'single' | 'multi'",
|
|
405
|
+
"resolved": "\"multi\" | \"single\"",
|
|
406
|
+
"references": {}
|
|
407
|
+
},
|
|
408
|
+
"required": false,
|
|
409
|
+
"optional": true,
|
|
410
|
+
"docs": {
|
|
411
|
+
"tags": [],
|
|
412
|
+
"text": "Whether to allow a single choice or multiple choices."
|
|
413
|
+
},
|
|
414
|
+
"getter": false,
|
|
415
|
+
"setter": false,
|
|
416
|
+
"reflect": false,
|
|
417
|
+
"attribute": "mode",
|
|
418
|
+
"defaultValue": "'single'"
|
|
419
|
+
},
|
|
420
|
+
"name": {
|
|
421
|
+
"type": "string",
|
|
422
|
+
"mutable": false,
|
|
423
|
+
"complexType": {
|
|
424
|
+
"original": "string",
|
|
425
|
+
"resolved": "string",
|
|
426
|
+
"references": {}
|
|
427
|
+
},
|
|
428
|
+
"required": false,
|
|
429
|
+
"optional": true,
|
|
430
|
+
"docs": {
|
|
431
|
+
"tags": [],
|
|
432
|
+
"text": "The name of the hidden input field that contains the selected option's value(s)"
|
|
433
|
+
},
|
|
434
|
+
"getter": false,
|
|
435
|
+
"setter": false,
|
|
436
|
+
"reflect": false,
|
|
437
|
+
"attribute": "name"
|
|
438
|
+
},
|
|
439
|
+
"placeholder": {
|
|
440
|
+
"type": "string",
|
|
441
|
+
"mutable": false,
|
|
442
|
+
"complexType": {
|
|
443
|
+
"original": "string",
|
|
444
|
+
"resolved": "string",
|
|
445
|
+
"references": {}
|
|
446
|
+
},
|
|
447
|
+
"required": false,
|
|
448
|
+
"optional": false,
|
|
449
|
+
"docs": {
|
|
450
|
+
"tags": [],
|
|
451
|
+
"text": "Placeholder text that appears when the field has no value"
|
|
452
|
+
},
|
|
453
|
+
"getter": false,
|
|
454
|
+
"setter": false,
|
|
455
|
+
"reflect": false,
|
|
456
|
+
"attribute": "placeholder"
|
|
457
|
+
},
|
|
458
|
+
"truncate": {
|
|
459
|
+
"type": "boolean",
|
|
460
|
+
"mutable": false,
|
|
461
|
+
"complexType": {
|
|
462
|
+
"original": "boolean",
|
|
463
|
+
"resolved": "boolean",
|
|
464
|
+
"references": {}
|
|
465
|
+
},
|
|
466
|
+
"required": false,
|
|
467
|
+
"optional": true,
|
|
468
|
+
"docs": {
|
|
469
|
+
"tags": [],
|
|
470
|
+
"text": "Only used in multi-choice selects. If `true`,\nbadges representing selections that would overflow the\ncontainer are replaced with \"+x more\" (where x is the\nnumber not shown). If `false`, the container's height will\nadjust to show all badges representing selections."
|
|
471
|
+
},
|
|
472
|
+
"getter": false,
|
|
473
|
+
"setter": false,
|
|
474
|
+
"reflect": false,
|
|
475
|
+
"attribute": "truncate",
|
|
476
|
+
"defaultValue": "true"
|
|
477
|
+
},
|
|
478
|
+
"customDisplayValue": {
|
|
479
|
+
"type": "boolean",
|
|
480
|
+
"mutable": false,
|
|
481
|
+
"complexType": {
|
|
482
|
+
"original": "boolean",
|
|
483
|
+
"resolved": "boolean",
|
|
484
|
+
"references": {}
|
|
485
|
+
},
|
|
486
|
+
"required": false,
|
|
487
|
+
"optional": true,
|
|
488
|
+
"docs": {
|
|
489
|
+
"tags": [],
|
|
490
|
+
"text": "If true, enables custom display value rendering via slot."
|
|
491
|
+
},
|
|
492
|
+
"getter": false,
|
|
493
|
+
"setter": false,
|
|
494
|
+
"reflect": false,
|
|
495
|
+
"attribute": "custom-display-value"
|
|
496
|
+
},
|
|
497
|
+
"selectedValues": {
|
|
498
|
+
"type": "string",
|
|
499
|
+
"mutable": false,
|
|
500
|
+
"complexType": {
|
|
501
|
+
"original": "string | string[]",
|
|
502
|
+
"resolved": "string | string[]",
|
|
503
|
+
"references": {}
|
|
504
|
+
},
|
|
505
|
+
"required": false,
|
|
506
|
+
"optional": true,
|
|
507
|
+
"docs": {
|
|
508
|
+
"tags": [],
|
|
509
|
+
"text": "The value(s) currently selected in the select component."
|
|
510
|
+
},
|
|
511
|
+
"getter": false,
|
|
512
|
+
"setter": false,
|
|
513
|
+
"reflect": false,
|
|
514
|
+
"attribute": "selected-values"
|
|
515
|
+
},
|
|
516
|
+
"classNames": {
|
|
517
|
+
"type": "string",
|
|
518
|
+
"mutable": false,
|
|
519
|
+
"complexType": {
|
|
520
|
+
"original": "string",
|
|
521
|
+
"resolved": "string",
|
|
522
|
+
"references": {}
|
|
523
|
+
},
|
|
524
|
+
"required": false,
|
|
525
|
+
"optional": true,
|
|
526
|
+
"docs": {
|
|
527
|
+
"tags": [],
|
|
528
|
+
"text": "The class name to apply to the select component."
|
|
529
|
+
},
|
|
530
|
+
"getter": false,
|
|
531
|
+
"setter": false,
|
|
532
|
+
"reflect": false,
|
|
533
|
+
"attribute": "class-names"
|
|
534
|
+
}
|
|
535
|
+
};
|
|
536
|
+
}
|
|
537
|
+
static get states() {
|
|
538
|
+
return {
|
|
539
|
+
"active": {},
|
|
540
|
+
"id": {},
|
|
541
|
+
"keepFocus": {},
|
|
542
|
+
"visibleChoices": {},
|
|
543
|
+
"choicesState": {},
|
|
544
|
+
"value": {},
|
|
545
|
+
"dropdownOpenState": {}
|
|
546
|
+
};
|
|
547
|
+
}
|
|
548
|
+
static get events() {
|
|
549
|
+
return [{
|
|
550
|
+
"method": "selectChange",
|
|
551
|
+
"name": "selectChange",
|
|
552
|
+
"bubbles": true,
|
|
553
|
+
"cancelable": true,
|
|
554
|
+
"composed": true,
|
|
555
|
+
"docs": {
|
|
556
|
+
"tags": [],
|
|
557
|
+
"text": "Emits the value of the selected option in the select menu on change"
|
|
558
|
+
},
|
|
559
|
+
"complexType": {
|
|
560
|
+
"original": "string",
|
|
561
|
+
"resolved": "string",
|
|
562
|
+
"references": {}
|
|
563
|
+
}
|
|
564
|
+
}, {
|
|
565
|
+
"method": "changeEvent",
|
|
566
|
+
"name": "changeEvent",
|
|
567
|
+
"bubbles": true,
|
|
568
|
+
"cancelable": true,
|
|
569
|
+
"composed": true,
|
|
570
|
+
"docs": {
|
|
571
|
+
"tags": [],
|
|
572
|
+
"text": "Emits the value of the selected option in the select menu on change"
|
|
573
|
+
},
|
|
574
|
+
"complexType": {
|
|
575
|
+
"original": "string | string[]",
|
|
576
|
+
"resolved": "string | string[]",
|
|
577
|
+
"references": {}
|
|
578
|
+
}
|
|
579
|
+
}, {
|
|
580
|
+
"method": "dropdownStateChange",
|
|
581
|
+
"name": "dropdownStateChange",
|
|
582
|
+
"bubbles": true,
|
|
583
|
+
"cancelable": true,
|
|
584
|
+
"composed": true,
|
|
585
|
+
"docs": {
|
|
586
|
+
"tags": [],
|
|
587
|
+
"text": "Emits when the dropdown opens or closes"
|
|
588
|
+
},
|
|
589
|
+
"complexType": {
|
|
590
|
+
"original": "boolean",
|
|
591
|
+
"resolved": "boolean",
|
|
592
|
+
"references": {}
|
|
593
|
+
}
|
|
594
|
+
}, {
|
|
595
|
+
"method": "triggerDropdown",
|
|
596
|
+
"name": "triggerDropdown",
|
|
597
|
+
"bubbles": true,
|
|
598
|
+
"cancelable": true,
|
|
599
|
+
"composed": true,
|
|
600
|
+
"docs": {
|
|
601
|
+
"tags": [],
|
|
602
|
+
"text": "Emits before the dropdown state changes, allowing listeners to prevent the default behavior.\nThe event detail contains the previous and new dropdown states."
|
|
603
|
+
},
|
|
604
|
+
"complexType": {
|
|
605
|
+
"original": "{\n prevState: boolean;\n nextState: boolean;\n }",
|
|
606
|
+
"resolved": "{ prevState: boolean; nextState: boolean; }",
|
|
607
|
+
"references": {}
|
|
608
|
+
}
|
|
609
|
+
}];
|
|
610
|
+
}
|
|
611
|
+
static get methods() {
|
|
612
|
+
return {
|
|
613
|
+
"reset": {
|
|
614
|
+
"complexType": {
|
|
615
|
+
"signature": "() => Promise<void>",
|
|
616
|
+
"parameters": [],
|
|
617
|
+
"references": {
|
|
618
|
+
"Promise": {
|
|
619
|
+
"location": "global",
|
|
620
|
+
"id": "global::Promise"
|
|
621
|
+
}
|
|
622
|
+
},
|
|
623
|
+
"return": "Promise<void>"
|
|
624
|
+
},
|
|
625
|
+
"docs": {
|
|
626
|
+
"text": "Resets the select component to its initial state with no selections.\nThis clears all selected values and returns the component to its default state.",
|
|
627
|
+
"tags": []
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
};
|
|
631
|
+
}
|
|
632
|
+
static get watchers() {
|
|
633
|
+
return [{
|
|
634
|
+
"propName": "choices",
|
|
635
|
+
"methodName": "onChoicesPropChanged"
|
|
636
|
+
}, {
|
|
637
|
+
"propName": "selectedValues",
|
|
638
|
+
"methodName": "onSelectedValuesPropChanged"
|
|
639
|
+
}, {
|
|
640
|
+
"propName": "choicesState",
|
|
641
|
+
"methodName": "onChoicesStateChanged"
|
|
642
|
+
}, {
|
|
643
|
+
"propName": "value",
|
|
644
|
+
"methodName": "handleValueStateChange"
|
|
645
|
+
}, {
|
|
646
|
+
"propName": "dropdownOpenState",
|
|
647
|
+
"methodName": "onDropdownOpenStateChanged"
|
|
648
|
+
}];
|
|
649
|
+
}
|
|
650
|
+
static get listeners() {
|
|
651
|
+
return [{
|
|
652
|
+
"name": "click",
|
|
653
|
+
"method": "handleClickEvent",
|
|
654
|
+
"target": "window",
|
|
655
|
+
"capture": false,
|
|
656
|
+
"passive": false
|
|
657
|
+
}, {
|
|
658
|
+
"name": "keydown",
|
|
659
|
+
"method": "handleKeyDown",
|
|
660
|
+
"target": "window",
|
|
661
|
+
"capture": false,
|
|
662
|
+
"passive": false
|
|
663
|
+
}, {
|
|
664
|
+
"name": "resize",
|
|
665
|
+
"method": "handleResize",
|
|
666
|
+
"target": "window",
|
|
667
|
+
"capture": false,
|
|
668
|
+
"passive": true
|
|
669
|
+
}];
|
|
670
|
+
}
|
|
319
671
|
}
|