@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,75 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, H as Host } from './index-392b5b96.js';
|
|
2
|
-
|
|
3
|
-
const XplPagination = class {
|
|
4
|
-
constructor(hostRef) {
|
|
5
|
-
registerInstance(this, hostRef);
|
|
6
|
-
this.page = createEvent(this, "page", 7);
|
|
7
|
-
/**
|
|
8
|
-
* Private `_goto` method respects the `waitForCallback` prop --
|
|
9
|
-
* it will always emit the `page` event, but won't actually update
|
|
10
|
-
* the state of what the current page is, leaving that to the caller
|
|
11
|
-
* to update once (presumably) some other data has loaded.
|
|
12
|
-
*/
|
|
13
|
-
this._goto = (n) => {
|
|
14
|
-
this.page.emit(n);
|
|
15
|
-
if (!this.waitForCallback) {
|
|
16
|
-
this.current = n;
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
this.goPrev = () => {
|
|
20
|
-
if (this.current > 1)
|
|
21
|
-
this._goto(this.current - 1);
|
|
22
|
-
};
|
|
23
|
-
this.goNext = () => {
|
|
24
|
-
const numPages = Math.ceil(this.total / this.perPage);
|
|
25
|
-
if (this.current < numPages)
|
|
26
|
-
this._goto(this.current + 1);
|
|
27
|
-
};
|
|
28
|
-
this.total = undefined;
|
|
29
|
-
this.perPage = undefined;
|
|
30
|
-
this.waitForCallback = undefined;
|
|
31
|
-
this.current = 1;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Calling `goto` with a page number (which should probably be
|
|
35
|
-
* taken from the `page` event) updates the pagination's state
|
|
36
|
-
* and re-renders it, showing the appropriate buttons given the current page.
|
|
37
|
-
* @param n
|
|
38
|
-
*/
|
|
39
|
-
async goto(n) {
|
|
40
|
-
this.current = n;
|
|
41
|
-
}
|
|
42
|
-
render() {
|
|
43
|
-
const numPages = Math.ceil(this.total / this.perPage);
|
|
44
|
-
let showing = [1];
|
|
45
|
-
if (numPages < 7)
|
|
46
|
-
showing = [1, 2, 3, 4, 5, 6];
|
|
47
|
-
if (this.current <= 3 || this.current >= numPages - 2) {
|
|
48
|
-
showing = [1, 2, 3, '...', numPages - 2, numPages - 1, numPages];
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
showing = [
|
|
52
|
-
1,
|
|
53
|
-
'...',
|
|
54
|
-
this.current - 1,
|
|
55
|
-
this.current,
|
|
56
|
-
this.current + 1,
|
|
57
|
-
'...',
|
|
58
|
-
numPages,
|
|
59
|
-
];
|
|
60
|
-
}
|
|
61
|
-
const showingFirst = (this.current - 1) * this.perPage + 1;
|
|
62
|
-
const showingLast = Math.min(showingFirst + this.perPage - 1, this.total);
|
|
63
|
-
return (h(Host, null, h("div", { class: "xpl-pagination" }, h("div", null, h("p", null, "Showing ", h("span", null, showingFirst), " to", ' ', h("span", null, showingLast), " of", ' ', h("span", null, this.total), " results")), h("div", null, h("nav", { "aria-label": "Pagination" }, h("button", { onClick: this.goPrev, class: "xpl-pagination-prev" }, h("span", null, "Previous"), h("svg", { viewBox: "0 0 20 20", "aria-hidden": "true" }, h("path", { "fill-rule": "evenodd", d: "M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z", "clip-rule": "evenodd" }))), showing.map((n) => {
|
|
64
|
-
if (n === '...') {
|
|
65
|
-
return (h("span", { class: "xpl-pagination-ellipsis" }, "..."));
|
|
66
|
-
}
|
|
67
|
-
if (n === this.current) {
|
|
68
|
-
return (h("button", { "aria-current": "page", class: "xpl-pagination-current" }, n));
|
|
69
|
-
}
|
|
70
|
-
return (h("button", { onClick: () => this._goto(n) }, n));
|
|
71
|
-
}), h("button", { onClick: this.goNext, class: "xpl-pagination-next" }, h("span", null, "Next"), h("svg", { viewBox: "0 0 20 20", "aria-hidden": "true" }, h("path", { "fill-rule": "evenodd", d: "M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z", "clip-rule": "evenodd" }))))))));
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
export { XplPagination as xpl_pagination };
|
|
@@ -1,606 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host } from './index-392b5b96.js';
|
|
2
|
-
import { v as v4 } from './v4-929670b7.js';
|
|
3
|
-
|
|
4
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* lodash (Custom Build) <https://lodash.com/>
|
|
8
|
-
* Build: `lodash modularize exports="npm" -o ./`
|
|
9
|
-
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
|
|
10
|
-
* Released under MIT license <https://lodash.com/license>
|
|
11
|
-
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
12
|
-
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
/** Used as the `TypeError` message for "Functions" methods. */
|
|
16
|
-
var FUNC_ERROR_TEXT = 'Expected a function';
|
|
17
|
-
|
|
18
|
-
/** Used as references for various `Number` constants. */
|
|
19
|
-
var NAN = 0 / 0;
|
|
20
|
-
|
|
21
|
-
/** `Object#toString` result references. */
|
|
22
|
-
var symbolTag = '[object Symbol]';
|
|
23
|
-
|
|
24
|
-
/** Used to match leading and trailing whitespace. */
|
|
25
|
-
var reTrim = /^\s+|\s+$/g;
|
|
26
|
-
|
|
27
|
-
/** Used to detect bad signed hexadecimal string values. */
|
|
28
|
-
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
|
|
29
|
-
|
|
30
|
-
/** Used to detect binary string values. */
|
|
31
|
-
var reIsBinary = /^0b[01]+$/i;
|
|
32
|
-
|
|
33
|
-
/** Used to detect octal string values. */
|
|
34
|
-
var reIsOctal = /^0o[0-7]+$/i;
|
|
35
|
-
|
|
36
|
-
/** Built-in method references without a dependency on `root`. */
|
|
37
|
-
var freeParseInt = parseInt;
|
|
38
|
-
|
|
39
|
-
/** Detect free variable `global` from Node.js. */
|
|
40
|
-
var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
41
|
-
|
|
42
|
-
/** Detect free variable `self`. */
|
|
43
|
-
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
44
|
-
|
|
45
|
-
/** Used as a reference to the global object. */
|
|
46
|
-
var root = freeGlobal || freeSelf || Function('return this')();
|
|
47
|
-
|
|
48
|
-
/** Used for built-in method references. */
|
|
49
|
-
var objectProto = Object.prototype;
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Used to resolve the
|
|
53
|
-
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
54
|
-
* of values.
|
|
55
|
-
*/
|
|
56
|
-
var objectToString = objectProto.toString;
|
|
57
|
-
|
|
58
|
-
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
59
|
-
var nativeMax = Math.max,
|
|
60
|
-
nativeMin = Math.min;
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Gets the timestamp of the number of milliseconds that have elapsed since
|
|
64
|
-
* the Unix epoch (1 January 1970 00:00:00 UTC).
|
|
65
|
-
*
|
|
66
|
-
* @static
|
|
67
|
-
* @memberOf _
|
|
68
|
-
* @since 2.4.0
|
|
69
|
-
* @category Date
|
|
70
|
-
* @returns {number} Returns the timestamp.
|
|
71
|
-
* @example
|
|
72
|
-
*
|
|
73
|
-
* _.defer(function(stamp) {
|
|
74
|
-
* console.log(_.now() - stamp);
|
|
75
|
-
* }, _.now());
|
|
76
|
-
* // => Logs the number of milliseconds it took for the deferred invocation.
|
|
77
|
-
*/
|
|
78
|
-
var now = function() {
|
|
79
|
-
return root.Date.now();
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Creates a debounced function that delays invoking `func` until after `wait`
|
|
84
|
-
* milliseconds have elapsed since the last time the debounced function was
|
|
85
|
-
* invoked. The debounced function comes with a `cancel` method to cancel
|
|
86
|
-
* delayed `func` invocations and a `flush` method to immediately invoke them.
|
|
87
|
-
* Provide `options` to indicate whether `func` should be invoked on the
|
|
88
|
-
* leading and/or trailing edge of the `wait` timeout. The `func` is invoked
|
|
89
|
-
* with the last arguments provided to the debounced function. Subsequent
|
|
90
|
-
* calls to the debounced function return the result of the last `func`
|
|
91
|
-
* invocation.
|
|
92
|
-
*
|
|
93
|
-
* **Note:** If `leading` and `trailing` options are `true`, `func` is
|
|
94
|
-
* invoked on the trailing edge of the timeout only if the debounced function
|
|
95
|
-
* is invoked more than once during the `wait` timeout.
|
|
96
|
-
*
|
|
97
|
-
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
|
|
98
|
-
* until to the next tick, similar to `setTimeout` with a timeout of `0`.
|
|
99
|
-
*
|
|
100
|
-
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
|
|
101
|
-
* for details over the differences between `_.debounce` and `_.throttle`.
|
|
102
|
-
*
|
|
103
|
-
* @static
|
|
104
|
-
* @memberOf _
|
|
105
|
-
* @since 0.1.0
|
|
106
|
-
* @category Function
|
|
107
|
-
* @param {Function} func The function to debounce.
|
|
108
|
-
* @param {number} [wait=0] The number of milliseconds to delay.
|
|
109
|
-
* @param {Object} [options={}] The options object.
|
|
110
|
-
* @param {boolean} [options.leading=false]
|
|
111
|
-
* Specify invoking on the leading edge of the timeout.
|
|
112
|
-
* @param {number} [options.maxWait]
|
|
113
|
-
* The maximum time `func` is allowed to be delayed before it's invoked.
|
|
114
|
-
* @param {boolean} [options.trailing=true]
|
|
115
|
-
* Specify invoking on the trailing edge of the timeout.
|
|
116
|
-
* @returns {Function} Returns the new debounced function.
|
|
117
|
-
* @example
|
|
118
|
-
*
|
|
119
|
-
* // Avoid costly calculations while the window size is in flux.
|
|
120
|
-
* jQuery(window).on('resize', _.debounce(calculateLayout, 150));
|
|
121
|
-
*
|
|
122
|
-
* // Invoke `sendMail` when clicked, debouncing subsequent calls.
|
|
123
|
-
* jQuery(element).on('click', _.debounce(sendMail, 300, {
|
|
124
|
-
* 'leading': true,
|
|
125
|
-
* 'trailing': false
|
|
126
|
-
* }));
|
|
127
|
-
*
|
|
128
|
-
* // Ensure `batchLog` is invoked once after 1 second of debounced calls.
|
|
129
|
-
* var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
|
|
130
|
-
* var source = new EventSource('/stream');
|
|
131
|
-
* jQuery(source).on('message', debounced);
|
|
132
|
-
*
|
|
133
|
-
* // Cancel the trailing debounced invocation.
|
|
134
|
-
* jQuery(window).on('popstate', debounced.cancel);
|
|
135
|
-
*/
|
|
136
|
-
function debounce(func, wait, options) {
|
|
137
|
-
var lastArgs,
|
|
138
|
-
lastThis,
|
|
139
|
-
maxWait,
|
|
140
|
-
result,
|
|
141
|
-
timerId,
|
|
142
|
-
lastCallTime,
|
|
143
|
-
lastInvokeTime = 0,
|
|
144
|
-
leading = false,
|
|
145
|
-
maxing = false,
|
|
146
|
-
trailing = true;
|
|
147
|
-
|
|
148
|
-
if (typeof func != 'function') {
|
|
149
|
-
throw new TypeError(FUNC_ERROR_TEXT);
|
|
150
|
-
}
|
|
151
|
-
wait = toNumber(wait) || 0;
|
|
152
|
-
if (isObject(options)) {
|
|
153
|
-
leading = !!options.leading;
|
|
154
|
-
maxing = 'maxWait' in options;
|
|
155
|
-
maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
|
|
156
|
-
trailing = 'trailing' in options ? !!options.trailing : trailing;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
function invokeFunc(time) {
|
|
160
|
-
var args = lastArgs,
|
|
161
|
-
thisArg = lastThis;
|
|
162
|
-
|
|
163
|
-
lastArgs = lastThis = undefined;
|
|
164
|
-
lastInvokeTime = time;
|
|
165
|
-
result = func.apply(thisArg, args);
|
|
166
|
-
return result;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
function leadingEdge(time) {
|
|
170
|
-
// Reset any `maxWait` timer.
|
|
171
|
-
lastInvokeTime = time;
|
|
172
|
-
// Start the timer for the trailing edge.
|
|
173
|
-
timerId = setTimeout(timerExpired, wait);
|
|
174
|
-
// Invoke the leading edge.
|
|
175
|
-
return leading ? invokeFunc(time) : result;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
function remainingWait(time) {
|
|
179
|
-
var timeSinceLastCall = time - lastCallTime,
|
|
180
|
-
timeSinceLastInvoke = time - lastInvokeTime,
|
|
181
|
-
result = wait - timeSinceLastCall;
|
|
182
|
-
|
|
183
|
-
return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
function shouldInvoke(time) {
|
|
187
|
-
var timeSinceLastCall = time - lastCallTime,
|
|
188
|
-
timeSinceLastInvoke = time - lastInvokeTime;
|
|
189
|
-
|
|
190
|
-
// Either this is the first call, activity has stopped and we're at the
|
|
191
|
-
// trailing edge, the system time has gone backwards and we're treating
|
|
192
|
-
// it as the trailing edge, or we've hit the `maxWait` limit.
|
|
193
|
-
return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
|
|
194
|
-
(timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
function timerExpired() {
|
|
198
|
-
var time = now();
|
|
199
|
-
if (shouldInvoke(time)) {
|
|
200
|
-
return trailingEdge(time);
|
|
201
|
-
}
|
|
202
|
-
// Restart the timer.
|
|
203
|
-
timerId = setTimeout(timerExpired, remainingWait(time));
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
function trailingEdge(time) {
|
|
207
|
-
timerId = undefined;
|
|
208
|
-
|
|
209
|
-
// Only invoke if we have `lastArgs` which means `func` has been
|
|
210
|
-
// debounced at least once.
|
|
211
|
-
if (trailing && lastArgs) {
|
|
212
|
-
return invokeFunc(time);
|
|
213
|
-
}
|
|
214
|
-
lastArgs = lastThis = undefined;
|
|
215
|
-
return result;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
function cancel() {
|
|
219
|
-
if (timerId !== undefined) {
|
|
220
|
-
clearTimeout(timerId);
|
|
221
|
-
}
|
|
222
|
-
lastInvokeTime = 0;
|
|
223
|
-
lastArgs = lastCallTime = lastThis = timerId = undefined;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
function flush() {
|
|
227
|
-
return timerId === undefined ? result : trailingEdge(now());
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
function debounced() {
|
|
231
|
-
var time = now(),
|
|
232
|
-
isInvoking = shouldInvoke(time);
|
|
233
|
-
|
|
234
|
-
lastArgs = arguments;
|
|
235
|
-
lastThis = this;
|
|
236
|
-
lastCallTime = time;
|
|
237
|
-
|
|
238
|
-
if (isInvoking) {
|
|
239
|
-
if (timerId === undefined) {
|
|
240
|
-
return leadingEdge(lastCallTime);
|
|
241
|
-
}
|
|
242
|
-
if (maxing) {
|
|
243
|
-
// Handle invocations in a tight loop.
|
|
244
|
-
timerId = setTimeout(timerExpired, wait);
|
|
245
|
-
return invokeFunc(lastCallTime);
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
if (timerId === undefined) {
|
|
249
|
-
timerId = setTimeout(timerExpired, wait);
|
|
250
|
-
}
|
|
251
|
-
return result;
|
|
252
|
-
}
|
|
253
|
-
debounced.cancel = cancel;
|
|
254
|
-
debounced.flush = flush;
|
|
255
|
-
return debounced;
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
/**
|
|
259
|
-
* Creates a throttled function that only invokes `func` at most once per
|
|
260
|
-
* every `wait` milliseconds. The throttled function comes with a `cancel`
|
|
261
|
-
* method to cancel delayed `func` invocations and a `flush` method to
|
|
262
|
-
* immediately invoke them. Provide `options` to indicate whether `func`
|
|
263
|
-
* should be invoked on the leading and/or trailing edge of the `wait`
|
|
264
|
-
* timeout. The `func` is invoked with the last arguments provided to the
|
|
265
|
-
* throttled function. Subsequent calls to the throttled function return the
|
|
266
|
-
* result of the last `func` invocation.
|
|
267
|
-
*
|
|
268
|
-
* **Note:** If `leading` and `trailing` options are `true`, `func` is
|
|
269
|
-
* invoked on the trailing edge of the timeout only if the throttled function
|
|
270
|
-
* is invoked more than once during the `wait` timeout.
|
|
271
|
-
*
|
|
272
|
-
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
|
|
273
|
-
* until to the next tick, similar to `setTimeout` with a timeout of `0`.
|
|
274
|
-
*
|
|
275
|
-
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
|
|
276
|
-
* for details over the differences between `_.throttle` and `_.debounce`.
|
|
277
|
-
*
|
|
278
|
-
* @static
|
|
279
|
-
* @memberOf _
|
|
280
|
-
* @since 0.1.0
|
|
281
|
-
* @category Function
|
|
282
|
-
* @param {Function} func The function to throttle.
|
|
283
|
-
* @param {number} [wait=0] The number of milliseconds to throttle invocations to.
|
|
284
|
-
* @param {Object} [options={}] The options object.
|
|
285
|
-
* @param {boolean} [options.leading=true]
|
|
286
|
-
* Specify invoking on the leading edge of the timeout.
|
|
287
|
-
* @param {boolean} [options.trailing=true]
|
|
288
|
-
* Specify invoking on the trailing edge of the timeout.
|
|
289
|
-
* @returns {Function} Returns the new throttled function.
|
|
290
|
-
* @example
|
|
291
|
-
*
|
|
292
|
-
* // Avoid excessively updating the position while scrolling.
|
|
293
|
-
* jQuery(window).on('scroll', _.throttle(updatePosition, 100));
|
|
294
|
-
*
|
|
295
|
-
* // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
|
|
296
|
-
* var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
|
|
297
|
-
* jQuery(element).on('click', throttled);
|
|
298
|
-
*
|
|
299
|
-
* // Cancel the trailing throttled invocation.
|
|
300
|
-
* jQuery(window).on('popstate', throttled.cancel);
|
|
301
|
-
*/
|
|
302
|
-
function throttle(func, wait, options) {
|
|
303
|
-
var leading = true,
|
|
304
|
-
trailing = true;
|
|
305
|
-
|
|
306
|
-
if (typeof func != 'function') {
|
|
307
|
-
throw new TypeError(FUNC_ERROR_TEXT);
|
|
308
|
-
}
|
|
309
|
-
if (isObject(options)) {
|
|
310
|
-
leading = 'leading' in options ? !!options.leading : leading;
|
|
311
|
-
trailing = 'trailing' in options ? !!options.trailing : trailing;
|
|
312
|
-
}
|
|
313
|
-
return debounce(func, wait, {
|
|
314
|
-
'leading': leading,
|
|
315
|
-
'maxWait': wait,
|
|
316
|
-
'trailing': trailing
|
|
317
|
-
});
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
/**
|
|
321
|
-
* Checks if `value` is the
|
|
322
|
-
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
|
323
|
-
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
|
324
|
-
*
|
|
325
|
-
* @static
|
|
326
|
-
* @memberOf _
|
|
327
|
-
* @since 0.1.0
|
|
328
|
-
* @category Lang
|
|
329
|
-
* @param {*} value The value to check.
|
|
330
|
-
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
|
331
|
-
* @example
|
|
332
|
-
*
|
|
333
|
-
* _.isObject({});
|
|
334
|
-
* // => true
|
|
335
|
-
*
|
|
336
|
-
* _.isObject([1, 2, 3]);
|
|
337
|
-
* // => true
|
|
338
|
-
*
|
|
339
|
-
* _.isObject(_.noop);
|
|
340
|
-
* // => true
|
|
341
|
-
*
|
|
342
|
-
* _.isObject(null);
|
|
343
|
-
* // => false
|
|
344
|
-
*/
|
|
345
|
-
function isObject(value) {
|
|
346
|
-
var type = typeof value;
|
|
347
|
-
return !!value && (type == 'object' || type == 'function');
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
/**
|
|
351
|
-
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
352
|
-
* and has a `typeof` result of "object".
|
|
353
|
-
*
|
|
354
|
-
* @static
|
|
355
|
-
* @memberOf _
|
|
356
|
-
* @since 4.0.0
|
|
357
|
-
* @category Lang
|
|
358
|
-
* @param {*} value The value to check.
|
|
359
|
-
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
|
360
|
-
* @example
|
|
361
|
-
*
|
|
362
|
-
* _.isObjectLike({});
|
|
363
|
-
* // => true
|
|
364
|
-
*
|
|
365
|
-
* _.isObjectLike([1, 2, 3]);
|
|
366
|
-
* // => true
|
|
367
|
-
*
|
|
368
|
-
* _.isObjectLike(_.noop);
|
|
369
|
-
* // => false
|
|
370
|
-
*
|
|
371
|
-
* _.isObjectLike(null);
|
|
372
|
-
* // => false
|
|
373
|
-
*/
|
|
374
|
-
function isObjectLike(value) {
|
|
375
|
-
return !!value && typeof value == 'object';
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
/**
|
|
379
|
-
* Checks if `value` is classified as a `Symbol` primitive or object.
|
|
380
|
-
*
|
|
381
|
-
* @static
|
|
382
|
-
* @memberOf _
|
|
383
|
-
* @since 4.0.0
|
|
384
|
-
* @category Lang
|
|
385
|
-
* @param {*} value The value to check.
|
|
386
|
-
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
|
|
387
|
-
* @example
|
|
388
|
-
*
|
|
389
|
-
* _.isSymbol(Symbol.iterator);
|
|
390
|
-
* // => true
|
|
391
|
-
*
|
|
392
|
-
* _.isSymbol('abc');
|
|
393
|
-
* // => false
|
|
394
|
-
*/
|
|
395
|
-
function isSymbol(value) {
|
|
396
|
-
return typeof value == 'symbol' ||
|
|
397
|
-
(isObjectLike(value) && objectToString.call(value) == symbolTag);
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
/**
|
|
401
|
-
* Converts `value` to a number.
|
|
402
|
-
*
|
|
403
|
-
* @static
|
|
404
|
-
* @memberOf _
|
|
405
|
-
* @since 4.0.0
|
|
406
|
-
* @category Lang
|
|
407
|
-
* @param {*} value The value to process.
|
|
408
|
-
* @returns {number} Returns the number.
|
|
409
|
-
* @example
|
|
410
|
-
*
|
|
411
|
-
* _.toNumber(3.2);
|
|
412
|
-
* // => 3.2
|
|
413
|
-
*
|
|
414
|
-
* _.toNumber(Number.MIN_VALUE);
|
|
415
|
-
* // => 5e-324
|
|
416
|
-
*
|
|
417
|
-
* _.toNumber(Infinity);
|
|
418
|
-
* // => Infinity
|
|
419
|
-
*
|
|
420
|
-
* _.toNumber('3.2');
|
|
421
|
-
* // => 3.2
|
|
422
|
-
*/
|
|
423
|
-
function toNumber(value) {
|
|
424
|
-
if (typeof value == 'number') {
|
|
425
|
-
return value;
|
|
426
|
-
}
|
|
427
|
-
if (isSymbol(value)) {
|
|
428
|
-
return NAN;
|
|
429
|
-
}
|
|
430
|
-
if (isObject(value)) {
|
|
431
|
-
var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
|
|
432
|
-
value = isObject(other) ? (other + '') : other;
|
|
433
|
-
}
|
|
434
|
-
if (typeof value != 'string') {
|
|
435
|
-
return value === 0 ? value : +value;
|
|
436
|
-
}
|
|
437
|
-
value = value.replace(reTrim, '');
|
|
438
|
-
var isBinary = reIsBinary.test(value);
|
|
439
|
-
return (isBinary || reIsOctal.test(value))
|
|
440
|
-
? freeParseInt(value.slice(2), isBinary ? 2 : 8)
|
|
441
|
-
: (reIsBadHex.test(value) ? NAN : +value);
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
var lodash_throttle = throttle;
|
|
445
|
-
|
|
446
|
-
function tagWidth(text) {
|
|
447
|
-
const context = document.createElement('canvas').getContext('2d');
|
|
448
|
-
context.font =
|
|
449
|
-
"14px apple-system, system-ui, 'Segoe UI', Arial, Helvetica, Roboto, sans-serif";
|
|
450
|
-
return context.measureText(text).width + 44; // = text + l/r padding + margin-right
|
|
451
|
-
}
|
|
452
|
-
const XplSelect = class {
|
|
453
|
-
constructor(hostRef) {
|
|
454
|
-
registerInstance(this, hostRef);
|
|
455
|
-
this.choices = [];
|
|
456
|
-
this.description = undefined;
|
|
457
|
-
this.disabled = undefined;
|
|
458
|
-
this.error = undefined;
|
|
459
|
-
this.label = undefined;
|
|
460
|
-
this.mode = 'single';
|
|
461
|
-
this.placeholder = undefined;
|
|
462
|
-
this.truncate = true;
|
|
463
|
-
this.active = false;
|
|
464
|
-
this.id = v4();
|
|
465
|
-
this.keepFocus = false;
|
|
466
|
-
this.selected = undefined;
|
|
467
|
-
this.value = '';
|
|
468
|
-
this.displayValue = '';
|
|
469
|
-
this.visibleChoices = Infinity;
|
|
470
|
-
}
|
|
471
|
-
componentWillLoad() {
|
|
472
|
-
this.selected =
|
|
473
|
-
this.choices && this.choices.length > 0
|
|
474
|
-
? this.choices.map(() => false)
|
|
475
|
-
: [];
|
|
476
|
-
window.addEventListener('click', (e) => {
|
|
477
|
-
const el = e.target;
|
|
478
|
-
const select = el.closest('.xpl-select');
|
|
479
|
-
if (select === null || select !== this.container) {
|
|
480
|
-
this.active = false;
|
|
481
|
-
}
|
|
482
|
-
});
|
|
483
|
-
window.addEventListener('resize', lodash_throttle(() => {
|
|
484
|
-
this.maybeTruncateChoices();
|
|
485
|
-
}, 250));
|
|
486
|
-
}
|
|
487
|
-
componentDidLoad() {
|
|
488
|
-
this.dropdown = this.container.querySelector('xpl-dropdown');
|
|
489
|
-
}
|
|
490
|
-
maybeTruncateChoices() {
|
|
491
|
-
if (this.mode === 'single' || !this.truncate)
|
|
492
|
-
return;
|
|
493
|
-
const containerWidth = this.container.getBoundingClientRect().width;
|
|
494
|
-
let visibleChoices = 0;
|
|
495
|
-
let visibleChoicesWidth = 0;
|
|
496
|
-
const actualNumSelected = this.selected.filter((a) => a).length;
|
|
497
|
-
for (let i = 0; i < actualNumSelected; i++) {
|
|
498
|
-
visibleChoicesWidth += tagWidth(this.getDisplayValue(i));
|
|
499
|
-
if (visibleChoicesWidth > containerWidth - 140)
|
|
500
|
-
break;
|
|
501
|
-
visibleChoices++;
|
|
502
|
-
}
|
|
503
|
-
if (visibleChoices >= actualNumSelected)
|
|
504
|
-
visibleChoices = Infinity;
|
|
505
|
-
if (visibleChoices < 1)
|
|
506
|
-
visibleChoices = 1;
|
|
507
|
-
this.visibleChoices = visibleChoices;
|
|
508
|
-
}
|
|
509
|
-
flattenChoices() {
|
|
510
|
-
return this.choices.reduce((acc, curr) => [
|
|
511
|
-
...acc,
|
|
512
|
-
...(curr.groupName ? curr.options : [curr]),
|
|
513
|
-
], []);
|
|
514
|
-
}
|
|
515
|
-
getDisplayValue(i) {
|
|
516
|
-
return this.flattenChoices()[i].label || this.flattenChoices()[i].value;
|
|
517
|
-
}
|
|
518
|
-
getActualValue(i) {
|
|
519
|
-
return this.flattenChoices()[i].value || this.flattenChoices()[i].label;
|
|
520
|
-
}
|
|
521
|
-
update() {
|
|
522
|
-
this.selected = this.flattenChoices().map(({ isSelected }) => isSelected);
|
|
523
|
-
if (this.mode === 'single') {
|
|
524
|
-
const selected = this.selected.findIndex((v) => v);
|
|
525
|
-
this.value = selected >= 0 ? this.getActualValue(selected) : '';
|
|
526
|
-
this.displayValue =
|
|
527
|
-
selected >= 0 ? this.getDisplayValue(selected) : '';
|
|
528
|
-
}
|
|
529
|
-
else if (this.mode === 'multi') {
|
|
530
|
-
this.value = this.selected
|
|
531
|
-
.map((v, i) => {
|
|
532
|
-
return v ? this.getActualValue(i) : '';
|
|
533
|
-
})
|
|
534
|
-
.filter((v) => v.length > 0)
|
|
535
|
-
.join('|');
|
|
536
|
-
}
|
|
537
|
-
}
|
|
538
|
-
render() {
|
|
539
|
-
let visibleChoices = 0;
|
|
540
|
-
return (h(Host, { class: {
|
|
541
|
-
'xpl-select': true,
|
|
542
|
-
'xpl-select--disabled': this.disabled,
|
|
543
|
-
'xpl-select--no-truncate': !this.truncate,
|
|
544
|
-
}, onKeyDown: (e) => {
|
|
545
|
-
if (e.key === 'Escape')
|
|
546
|
-
this.active = false;
|
|
547
|
-
}, ref: (el) => (this.container = el) }, this.label || this.description ? (h("label", { class: {
|
|
548
|
-
'xpl-label': true,
|
|
549
|
-
'xpl-label--disabled': this.disabled,
|
|
550
|
-
}, htmlFor: this.id }, this.label, this.description && (h("small", { class: {
|
|
551
|
-
'xpl-description': true,
|
|
552
|
-
'xpl-description--disabled': this.disabled,
|
|
553
|
-
} }, this.description)))) : null, h("div", { class: {
|
|
554
|
-
'xpl-input': true,
|
|
555
|
-
'xpl-input--disabled': this.disabled,
|
|
556
|
-
'xpl-input--error': this.error !== undefined,
|
|
557
|
-
} }, h("div", { class: "xpl-input-wrapper" }, h("div", { class: {
|
|
558
|
-
'xpl-select-value': true,
|
|
559
|
-
'xpl-select-value--active': this.mode === 'multi' &&
|
|
560
|
-
this.value.length > 0,
|
|
561
|
-
'has-value': this.value.length > 0,
|
|
562
|
-
} }, this.mode === 'single'
|
|
563
|
-
? this.displayValue || this.placeholder
|
|
564
|
-
: this.value.length > 0
|
|
565
|
-
? this.selected.map((v, i) => {
|
|
566
|
-
if (!v)
|
|
567
|
-
return null;
|
|
568
|
-
if (visibleChoices >= this.visibleChoices)
|
|
569
|
-
return null;
|
|
570
|
-
visibleChoices++;
|
|
571
|
-
return (h("xpl-tag", { onClose: () => {
|
|
572
|
-
this.flattenChoices().forEach((v, j) => {
|
|
573
|
-
if (i === j)
|
|
574
|
-
v.isSelected =
|
|
575
|
-
false;
|
|
576
|
-
});
|
|
577
|
-
const mapOptions = (option) => {
|
|
578
|
-
option.options =
|
|
579
|
-
option.groupName
|
|
580
|
-
? option.options.map(mapOptions)
|
|
581
|
-
: undefined;
|
|
582
|
-
return option;
|
|
583
|
-
};
|
|
584
|
-
this.choices =
|
|
585
|
-
this.choices.map(mapOptions);
|
|
586
|
-
this.update();
|
|
587
|
-
this.maybeTruncateChoices();
|
|
588
|
-
} }, this.getDisplayValue(i)));
|
|
589
|
-
})
|
|
590
|
-
: this.placeholder, this.visibleChoices < Infinity &&
|
|
591
|
-
`+ ${this.selected.filter((a) => a).length -
|
|
592
|
-
this.visibleChoices} more`), h("button", { disabled: this.disabled, id: this.id, onKeyDown: (e) => {
|
|
593
|
-
if (e.key === 'Tab')
|
|
594
|
-
this.keepFocus = true;
|
|
595
|
-
}, onClick: () => {
|
|
596
|
-
const { dropdown } = this;
|
|
597
|
-
if (!this.disabled)
|
|
598
|
-
dropdown.isOpen = !dropdown.isOpen;
|
|
599
|
-
} })), !this.disabled && (h("xpl-dropdown", { options: this.choices, mode: this.mode, triggerId: this.id, update: () => {
|
|
600
|
-
this.update();
|
|
601
|
-
this.maybeTruncateChoices();
|
|
602
|
-
} })), this.error !== undefined && this.error.length > 0 && (h("label", { class: "xpl-input-error", htmlFor: this.id }, h("svg", { width: "10", height: "11", viewBox: "0 0 10 11", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { d: "M9.84375 5.25C9.84375 2.59375 7.65625 0.40625 5 0.40625C2.32422 0.40625 0.15625 2.59375 0.15625 5.25C0.15625 7.92578 2.32422 10.0938 5 10.0938C7.65625 10.0938 9.84375 7.92578 9.84375 5.25ZM5 6.22656C5.48828 6.22656 5.89844 6.63672 5.89844 7.125C5.89844 7.63281 5.48828 8.02344 5 8.02344C4.49219 8.02344 4.10156 7.63281 4.10156 7.125C4.10156 6.63672 4.49219 6.22656 5 6.22656ZM4.14062 3.00391C4.12109 2.86719 4.23828 2.75 4.375 2.75H5.60547C5.74219 2.75 5.85938 2.86719 5.83984 3.00391L5.70312 5.66016C5.68359 5.79688 5.58594 5.875 5.46875 5.875H4.51172C4.39453 5.875 4.29688 5.79688 4.27734 5.66016L4.14062 3.00391Z" })), this.error))), h("input", { type: "hidden", value: this.value })));
|
|
603
|
-
}
|
|
604
|
-
};
|
|
605
|
-
|
|
606
|
-
export { XplSelect as xpl_select };
|