@xplortech/apollo-core 2.4.3 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.typings/apollo-components.html-data.json +1257 -3360
- package/build/style.css +4227 -1019
- package/dist/apollo-core/apollo-core.css +18 -27
- package/dist/apollo-core/apollo-core.esm.js +1 -1
- package/dist/apollo-core/p-02167464.entry.js +1 -0
- package/dist/apollo-core/p-0bce3874.entry.js +1 -0
- package/dist/apollo-core/{p-8c1f73ea.entry.js → p-1fd3dc87.entry.js} +1 -1
- package/dist/apollo-core/{p-0ac33b3a.entry.js → p-42016063.entry.js} +1 -1
- package/dist/apollo-core/{p-31461db7.entry.js → p-5549756c.entry.js} +1 -1
- package/dist/apollo-core/p-56fa4941.entry.js +1 -0
- package/dist/apollo-core/p-76c324da.entry.js +1 -0
- package/dist/apollo-core/p-7a3224b4.entry.js +1 -0
- package/dist/apollo-core/p-7e924697.entry.js +1 -0
- package/dist/apollo-core/{p-b1f4604d.entry.js → p-8a1affce.entry.js} +1 -1
- package/dist/apollo-core/p-9efca9e1.entry.js +1 -0
- package/dist/apollo-core/p-C_Z2nG0p.js +2 -0
- package/dist/apollo-core/p-b252b380.entry.js +1 -0
- package/dist/apollo-core/p-c91daac1.entry.js +1 -0
- package/dist/apollo-core/p-d9b62508.entry.js +1 -0
- package/dist/apollo-core/p-eaea16d1.entry.js +1 -0
- package/dist/apollo-core/p-eed13bca.entry.js +1 -0
- package/dist/apollo-core/{p-4fab8172.entry.js → p-f5af9539.entry.js} +1 -1
- package/dist/cjs/apollo-core.cjs.js +3 -3
- package/dist/cjs/{index-D__N_vw2.js → index-DH6pgWru.js} +137 -87
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/xpl-accordion.cjs.entry.js +5 -5
- package/dist/cjs/xpl-application-shell.cjs.entry.js +4 -4
- package/dist/cjs/xpl-avatar_47.cjs.entry.js +18618 -0
- package/dist/cjs/xpl-button-row.cjs.entry.js +4 -4
- package/dist/cjs/xpl-calendar.cjs.entry.js +4 -4
- package/dist/cjs/xpl-dynamic-table-cell.cjs.entry.js +5 -5
- package/dist/cjs/xpl-dynamic-table-row.cjs.entry.js +5 -5
- package/dist/cjs/xpl-dynamic-table.cjs.entry.js +4 -4
- package/dist/cjs/xpl-grid-item.cjs.entry.js +4 -4
- package/dist/cjs/xpl-grid.cjs.entry.js +4 -4
- package/dist/cjs/xpl-large-card.cjs.entry.js +4 -4
- package/dist/cjs/xpl-list.cjs.entry.js +4 -4
- package/dist/cjs/xpl-main-nav.cjs.entry.js +4 -4
- package/dist/cjs/xpl-table-header-cell.cjs.entry.js +3 -3
- package/dist/cjs/xpl-table-header.cjs.entry.js +4 -4
- package/dist/cjs/xpl-toggle.cjs.entry.js +6 -6
- package/dist/cjs/xpl-toolbar.cjs.entry.js +5 -5
- package/dist/collection/collection-manifest.json +10 -3
- package/dist/collection/components/xpl-accordion/accordion.stories.js +4 -0
- package/dist/collection/components/xpl-accordion/xpl-accordion.js +3 -3
- package/dist/collection/components/xpl-application-shell/application-shell.stories.js +4 -0
- package/dist/collection/components/xpl-application-shell/xpl-application-shell.js +2 -2
- package/dist/collection/components/xpl-avatar/avatar.stories.js +4 -0
- package/dist/collection/components/xpl-avatar/xpl-avatar.js +3 -3
- package/dist/collection/components/xpl-backdrop/backdrop.stories.js +4 -0
- package/dist/collection/components/xpl-backdrop/xpl-backdrop.js +2 -2
- package/dist/collection/components/xpl-badge/badge.stories.js +108 -33
- package/dist/collection/components/xpl-badge/xpl-badge.js +122 -14
- package/dist/collection/components/xpl-banner/banner.stories.js +64 -0
- package/dist/collection/components/xpl-banner/xpl-banner.js +295 -0
- package/dist/collection/components/xpl-breadcrumbs/breadcrumbs.stories.js +4 -0
- package/dist/collection/components/xpl-breadcrumbs/xpl-breadcrumb-item/xpl-breadcrumb-item.js +2 -2
- package/dist/collection/components/xpl-breadcrumbs/xpl-breadcrumbs/xpl-breadcrumbs.js +2 -2
- package/dist/collection/components/xpl-button/button.stories.js +102 -98
- package/dist/collection/components/xpl-button/xpl-button.js +183 -93
- package/dist/collection/components/xpl-button-row/xpl-button-row.js +2 -2
- package/dist/collection/components/xpl-calendar/calendar.stories.js +4 -0
- package/dist/collection/components/xpl-calendar/xpl-calendar.js +2 -2
- package/dist/collection/components/xpl-checkbox/checkbox.stories.js +4 -0
- package/dist/collection/components/xpl-checkbox/xpl-checkbox.js +4 -4
- package/dist/collection/components/xpl-choicelist/choicelist.stories.js +4 -0
- package/dist/collection/components/xpl-choicelist/xpl-choicelist.js +2 -2
- package/dist/collection/components/xpl-content-area/xpl-content-area.js +2 -2
- package/dist/collection/components/xpl-dashboard/xpl-dashboard.js +2 -2
- package/dist/collection/components/xpl-data-card/data-card.stories.js +4 -0
- package/dist/collection/components/xpl-data-card/xpl-data-card.js +12 -26
- package/dist/collection/components/xpl-divider/divider.stories.js +4 -0
- package/dist/collection/components/xpl-divider/xpl-divider.js +2 -2
- package/dist/collection/components/xpl-dropdown/dropdown.stories.js +4 -0
- package/dist/collection/components/xpl-dropdown/xpl-dropdown-group/xpl-dropdown-group.js +2 -2
- package/dist/collection/components/xpl-dropdown/xpl-dropdown-heading/xpl-dropdown-heading.js +2 -2
- package/dist/collection/components/xpl-dropdown/xpl-dropdown-option/xpl-dropdown-option.js +29 -4
- package/dist/collection/components/xpl-dropdown/xpl-dropdown.js +120 -79
- package/dist/collection/components/xpl-dynamic-table/dynamic-table.stories.js +4 -0
- package/dist/collection/components/xpl-dynamic-table/xpl-dynamic-table.js +2 -2
- package/dist/collection/components/xpl-dynamic-table-cell/xpl-dynamic-table-cell.js +3 -3
- package/dist/collection/components/xpl-dynamic-table-row/xpl-dynamic-table-row.js +3 -3
- package/dist/collection/components/xpl-grid/xpl-grid.js +2 -2
- package/dist/collection/components/xpl-grid-item/xpl-grid-item.js +2 -2
- package/dist/collection/components/xpl-header-accordion/header-accordion.stories.js +4 -0
- package/dist/collection/components/xpl-header-accordion/xpl-header-accordion.js +2 -2
- package/dist/collection/components/xpl-icon/icon-types.js +1 -0
- package/dist/collection/components/xpl-icon/icons.stories.js +47 -12
- package/dist/collection/components/xpl-icon/xpl-icon.js +14 -16
- package/dist/collection/components/xpl-input/input.stories.js +79 -9
- package/dist/collection/components/xpl-input/xpl-input-color/xpl-input-color.js +9 -9
- package/dist/collection/components/xpl-input/xpl-input-date/xpl-input-date.js +55 -17
- package/dist/collection/components/xpl-input/xpl-input-file/xpl-input-file.js +5 -5
- package/dist/collection/components/xpl-input/xpl-input-phone/phone-country-data.js +58 -0
- package/dist/collection/components/xpl-input/xpl-input-phone/phone-format.js +219 -0
- package/dist/collection/components/xpl-input/xpl-input-phone/xpl-input-phone.js +469 -0
- package/dist/collection/components/xpl-input/xpl-input-time/xpl-input-time.js +3 -3
- package/dist/collection/components/xpl-input/xpl-input.js +101 -7
- package/dist/collection/components/xpl-large-card/large-card.stories.js +4 -0
- package/dist/collection/components/xpl-large-card/xpl-large-card.js +2 -2
- package/dist/collection/components/xpl-list/list.stories.js +4 -0
- package/dist/collection/components/xpl-list/xpl-list.js +2 -2
- package/dist/collection/components/xpl-main-nav/xpl-main-nav.js +2 -2
- package/dist/collection/components/xpl-modal/modal.stories.js +4 -0
- package/dist/collection/components/xpl-modal/xpl-modal.js +2 -2
- package/dist/collection/components/xpl-nav-item/xpl-nav-item.js +3 -3
- package/dist/collection/components/xpl-pagination/pagination.stories.js +4 -0
- package/dist/collection/components/xpl-pagination/xpl-pagination.js +4 -4
- package/dist/collection/components/xpl-panel/panel.stories.js +51 -0
- package/dist/collection/components/xpl-panel/xpl-panel.js +60 -0
- package/dist/collection/components/xpl-popover/popover.stories.js +4 -0
- package/dist/collection/components/xpl-popover/xpl-popover.js +5 -5
- package/dist/collection/components/xpl-progress/progress.stories.js +4 -0
- package/dist/collection/components/xpl-progress/xpl-progress.js +2 -2
- package/dist/collection/components/xpl-progress-bar/progress-bar.stories.js +96 -0
- package/dist/collection/components/xpl-progress-bar/xpl-progress-bar.js +158 -0
- package/dist/collection/components/xpl-radio/radio.stories.js +4 -0
- package/dist/collection/components/xpl-radio/xpl-radio.js +4 -4
- package/dist/collection/components/xpl-secondary-nav/xpl-secondary-nav.js +2 -2
- package/dist/collection/components/xpl-select/select.stories.js +4 -0
- package/dist/collection/components/xpl-select/xpl-select.js +11 -17
- package/dist/collection/components/xpl-side-nav/side-nav.stories.js +519 -0
- package/dist/collection/components/xpl-side-nav/xpl-side-nav-item/xpl-side-nav-item.js +259 -0
- package/dist/collection/components/xpl-side-nav/xpl-side-nav.js +32 -0
- package/dist/collection/components/xpl-skeleton/skeleton.stories.js +4 -0
- package/dist/collection/components/xpl-skeleton/xpl-skeleton.js +2 -2
- package/dist/collection/components/xpl-slideout/slideout.stories.js +6 -0
- package/dist/collection/components/xpl-slideout/xpl-slideout.js +2 -2
- package/dist/collection/components/xpl-tab/xpl-tab.js +3 -3
- package/dist/collection/components/xpl-tab-panel/xpl-tab-panel.js +3 -3
- package/dist/collection/components/xpl-table/table.stories.js +4 -0
- package/dist/collection/components/xpl-table/xpl-table.js +6 -6
- package/dist/collection/components/xpl-table-header/table-header.stories.js +4 -0
- package/dist/collection/components/xpl-table-header/xpl-table-header.js +2 -2
- package/dist/collection/components/xpl-table-header-cell/table-header-cell.stories.js +4 -0
- package/dist/collection/components/xpl-table-header-cell/xpl-table-header-cell.js +6 -16
- package/dist/collection/components/xpl-tabs/tabs.stories.js +4 -0
- package/dist/collection/components/xpl-tabs/xpl-tabs.js +6 -6
- package/dist/collection/components/xpl-tag/xpl-tag.js +3 -3
- package/dist/collection/components/xpl-toast/toast.stories.js +4 -0
- package/dist/collection/components/xpl-toast/xpl-toast.js +3 -3
- package/dist/collection/components/xpl-toggle/toggle.stories.js +4 -0
- package/dist/collection/components/xpl-toggle/xpl-toggle.js +4 -4
- package/dist/collection/components/xpl-toolbar/xpl-toolbar.js +3 -3
- package/dist/collection/components/xpl-tooltip/tooltip.stories.js +4 -0
- package/dist/collection/components/xpl-tooltip/xpl-tooltip.js +2 -2
- package/dist/collection/components/xpl-utility-bar/xpl-utility-bar.js +2 -2
- package/dist/collection/utils/layout-ancestors.js +22 -0
- package/dist/components/index.js +1 -1
- package/dist/components/xpl-accordion.js +1 -1
- package/dist/components/xpl-application-shell.js +1 -1
- package/dist/components/xpl-avatar.js +1 -1
- package/dist/components/xpl-avatar2.js +1 -1
- package/dist/components/xpl-backdrop.js +1 -1
- package/dist/components/xpl-backdrop2.js +1 -1
- package/dist/components/xpl-badge.js +1 -1
- package/dist/components/xpl-badge2.js +1 -1
- package/dist/components/xpl-banner.d.ts +11 -0
- package/dist/components/xpl-banner.js +1 -0
- package/dist/components/xpl-breadcrumb-item.js +1 -1
- package/dist/components/xpl-breadcrumbs.js +1 -1
- package/dist/components/xpl-button-row.js +1 -1
- package/dist/components/xpl-button.js +1 -1
- package/dist/components/xpl-button2.js +1 -1
- package/dist/components/xpl-calendar.js +1 -1
- package/dist/components/xpl-checkbox.js +1 -1
- package/dist/components/xpl-checkbox2.js +1 -1
- package/dist/components/xpl-choicelist.js +1 -1
- package/dist/components/xpl-content-area.js +1 -1
- package/dist/components/xpl-dashboard.js +1 -1
- package/dist/components/xpl-data-card.js +1 -1
- package/dist/components/xpl-divider.js +1 -1
- package/dist/components/xpl-divider2.js +1 -1
- package/dist/components/xpl-dropdown-group.js +1 -1
- package/dist/components/xpl-dropdown-group2.js +1 -1
- package/dist/components/xpl-dropdown-heading.js +1 -1
- package/dist/components/xpl-dropdown-heading2.js +1 -1
- package/dist/components/xpl-dropdown-option.js +1 -1
- package/dist/components/xpl-dropdown-option2.js +1 -1
- package/dist/components/xpl-dropdown.js +1 -1
- package/dist/components/xpl-dropdown2.js +1 -1
- package/dist/components/xpl-dynamic-table-cell.js +1 -1
- package/dist/components/xpl-dynamic-table-row.js +1 -1
- package/dist/components/xpl-dynamic-table.js +1 -1
- package/dist/components/xpl-grid-item.js +1 -1
- package/dist/components/xpl-grid.js +1 -1
- package/dist/components/xpl-header-accordion.js +1 -1
- package/dist/components/xpl-icon.js +1 -1
- package/dist/components/xpl-icon2.js +1 -6
- package/dist/components/xpl-input-date.js +1 -1
- package/dist/components/xpl-input-date2.js +1 -1
- package/dist/components/xpl-input-file.js +1 -1
- package/dist/components/xpl-input-file2.js +1 -1
- package/dist/components/xpl-input-phone.d.ts +11 -0
- package/dist/components/xpl-input-phone.js +1 -0
- package/dist/components/xpl-input-time.js +1 -1
- package/dist/components/xpl-input.js +1 -1
- package/dist/components/xpl-input2.js +1 -1
- package/dist/components/xpl-large-card.js +1 -1
- package/dist/components/xpl-list.js +1 -1
- package/dist/components/xpl-main-nav.js +1 -1
- package/dist/components/xpl-modal.js +1 -1
- package/dist/components/xpl-nav-item.js +1 -1
- package/dist/components/xpl-pagination.js +1 -1
- package/dist/components/xpl-panel.d.ts +11 -0
- package/dist/components/xpl-panel.js +1 -0
- package/dist/components/xpl-popover.js +1 -1
- package/dist/components/xpl-popover2.js +1 -1
- package/dist/components/xpl-progress-bar.d.ts +11 -0
- package/dist/components/xpl-progress-bar.js +1 -0
- package/dist/components/xpl-progress.js +1 -1
- package/dist/components/xpl-radio.js +1 -1
- package/dist/components/xpl-radio2.js +1 -1
- package/dist/components/xpl-secondary-nav.js +1 -1
- package/dist/components/xpl-select.js +1 -1
- package/dist/components/xpl-select2.js +1 -1
- package/dist/components/xpl-side-nav-item.d.ts +11 -0
- package/dist/components/xpl-side-nav-item.js +1 -0
- package/dist/components/xpl-side-nav.d.ts +11 -0
- package/dist/components/xpl-side-nav.js +1 -0
- package/dist/components/xpl-skeleton.js +1 -1
- package/dist/components/xpl-slideout.js +1 -1
- package/dist/components/xpl-tab-panel.js +1 -1
- package/dist/components/xpl-tab.js +1 -1
- package/dist/components/xpl-table-header.js +1 -1
- package/dist/components/xpl-table.js +1 -1
- package/dist/components/xpl-tabs.js +1 -1
- package/dist/components/xpl-tag.js +1 -1
- package/dist/components/xpl-tag2.js +1 -1
- package/dist/components/xpl-toast.js +1 -1
- package/dist/components/xpl-toggle.js +1 -1
- package/dist/components/xpl-toolbar.js +1 -1
- package/dist/components/xpl-tooltip.js +1 -1
- package/dist/components/xpl-tooltip2.js +1 -1
- package/dist/components/xpl-utility-bar.js +1 -1
- package/dist/docs/xpl-accordion/readme.md +66 -0
- package/dist/docs/xpl-application-shell/readme.md +33 -0
- package/dist/docs/xpl-avatar/readme.md +40 -0
- package/dist/docs/xpl-backdrop/readme.md +34 -0
- package/dist/docs/xpl-badge/readme.md +122 -0
- package/dist/docs/xpl-banner/readme.md +166 -0
- package/dist/docs/xpl-breadcrumbs/xpl-breadcrumb-item/readme.md +19 -0
- package/dist/docs/xpl-breadcrumbs/xpl-breadcrumbs/readme.md +22 -0
- package/dist/docs/xpl-button/readme.md +181 -0
- package/dist/docs/xpl-button-row/readme.md +42 -0
- package/dist/docs/xpl-calendar/readme.md +49 -0
- package/dist/docs/xpl-checkbox/readme.md +49 -0
- package/dist/docs/xpl-choicelist/readme.md +44 -0
- package/dist/docs/xpl-content-area/readme.md +17 -0
- package/dist/docs/xpl-dashboard/readme.md +10 -0
- package/dist/docs/xpl-data-card/readme.md +54 -0
- package/dist/docs/xpl-divider/readme.md +30 -0
- package/dist/docs/xpl-dropdown/readme.md +83 -0
- package/dist/docs/xpl-dropdown/xpl-dropdown-group/readme.md +40 -0
- package/dist/docs/xpl-dropdown/xpl-dropdown-heading/readme.md +30 -0
- package/dist/docs/xpl-dropdown/xpl-dropdown-option/readme.md +42 -0
- package/dist/docs/xpl-dynamic-table/readme.md +19 -0
- package/dist/docs/xpl-dynamic-table-cell/readme.md +18 -0
- package/dist/docs/xpl-dynamic-table-row/readme.md +19 -0
- package/dist/docs/xpl-grid/readme.md +10 -0
- package/dist/docs/xpl-grid-item/readme.md +20 -0
- package/dist/docs/xpl-header-accordion/readme.md +39 -0
- package/dist/docs/xpl-icon/readme.md +92 -0
- package/dist/docs/xpl-input/readme.md +100 -0
- package/dist/docs/xpl-input/xpl-input-color/readme.md +65 -0
- package/dist/docs/xpl-input/xpl-input-date/readme.md +56 -0
- package/dist/docs/xpl-input/xpl-input-file/readme.md +79 -0
- package/dist/docs/xpl-input/xpl-input-phone/readme.md +167 -0
- package/dist/docs/xpl-input/xpl-input-time/readme.md +73 -0
- package/dist/docs/xpl-large-card/readme.md +40 -0
- package/dist/docs/xpl-list/readme.md +34 -0
- package/dist/docs/xpl-main-nav/readme.md +28 -0
- package/dist/docs/xpl-modal/readme.md +58 -0
- package/dist/docs/xpl-nav-item/readme.md +24 -0
- package/dist/docs/xpl-pagination/readme.md +55 -0
- package/dist/docs/xpl-panel/readme.md +83 -0
- package/dist/docs/xpl-popover/readme.md +48 -0
- package/dist/docs/xpl-progress/readme.md +22 -0
- package/dist/docs/xpl-progress-bar/readme.md +145 -0
- package/dist/docs/xpl-radio/readme.md +43 -0
- package/dist/docs/xpl-secondary-nav/readme.md +10 -0
- package/dist/docs/xpl-select/readme.md +89 -0
- package/dist/docs/xpl-side-nav/readme.md +71 -0
- package/dist/docs/xpl-side-nav/xpl-side-nav-item/readme.md +115 -0
- package/dist/docs/xpl-skeleton/readme.md +31 -0
- package/dist/docs/xpl-slideout/readme.md +47 -0
- package/dist/docs/xpl-tab/readme.md +25 -0
- package/dist/docs/xpl-tab-panel/readme.md +18 -0
- package/dist/docs/xpl-table/readme.md +46 -0
- package/dist/docs/xpl-table-header/readme.md +13 -0
- package/dist/docs/xpl-table-header-cell/readme.md +47 -0
- package/dist/docs/xpl-tabs/readme.md +55 -0
- package/dist/docs/xpl-tag/readme.md +30 -0
- package/dist/docs/xpl-toast/readme.md +97 -0
- package/dist/docs/xpl-toggle/readme.md +23 -0
- package/dist/docs/xpl-toolbar/readme.md +18 -0
- package/dist/docs/xpl-tooltip/readme.md +35 -0
- package/dist/docs/xpl-utility-bar/readme.md +55 -0
- package/dist/esm/apollo-core.js +4 -4
- package/dist/esm/{index-DhZas3eX.js → index-C_Z2nG0p.js} +137 -87
- package/dist/esm/loader.js +3 -3
- package/dist/esm/xpl-accordion.entry.js +5 -5
- package/dist/esm/xpl-application-shell.entry.js +4 -4
- package/dist/esm/xpl-avatar_47.entry.js +18570 -0
- package/dist/esm/xpl-button-row.entry.js +4 -4
- package/dist/esm/xpl-calendar.entry.js +4 -4
- package/dist/esm/xpl-dynamic-table-cell.entry.js +5 -5
- package/dist/esm/xpl-dynamic-table-row.entry.js +5 -5
- package/dist/esm/xpl-dynamic-table.entry.js +4 -4
- package/dist/esm/xpl-grid-item.entry.js +4 -4
- package/dist/esm/xpl-grid.entry.js +4 -4
- package/dist/esm/xpl-large-card.entry.js +4 -4
- package/dist/esm/xpl-list.entry.js +4 -4
- package/dist/esm/xpl-main-nav.entry.js +4 -4
- package/dist/esm/xpl-table-header-cell.entry.js +3 -3
- package/dist/esm/xpl-table-header.entry.js +4 -4
- package/dist/esm/xpl-toggle.entry.js +6 -6
- package/dist/esm/xpl-toolbar.entry.js +5 -5
- package/dist/types/components/xpl-accordion/xpl-accordion.d.ts +1 -1
- package/dist/types/components/xpl-application-shell/application-shell.stories.d.ts +4 -0
- package/dist/types/components/xpl-application-shell/xpl-application-shell.d.ts +1 -1
- package/dist/types/components/xpl-avatar/avatar.stories.d.ts +4 -0
- package/dist/types/components/xpl-avatar/xpl-avatar.d.ts +1 -1
- package/dist/types/components/xpl-backdrop/backdrop.stories.d.ts +4 -0
- package/dist/types/components/xpl-backdrop/xpl-backdrop.d.ts +1 -1
- package/dist/types/components/xpl-badge/badge.stories.d.ts +66 -11
- package/dist/types/components/xpl-badge/xpl-badge.d.ts +9 -2
- package/dist/types/components/xpl-banner/banner.stories.d.ts +77 -0
- package/dist/types/components/xpl-banner/xpl-banner.d.ts +20 -0
- package/dist/types/components/xpl-breadcrumbs/breadcrumbs.stories.d.ts +4 -0
- package/dist/types/components/xpl-breadcrumbs/xpl-breadcrumb-item/xpl-breadcrumb-item.d.ts +1 -1
- package/dist/types/components/xpl-breadcrumbs/xpl-breadcrumbs/xpl-breadcrumbs.d.ts +1 -1
- package/dist/types/components/xpl-button/button.stories.d.ts +68 -30
- package/dist/types/components/xpl-button/xpl-button.d.ts +14 -8
- package/dist/types/components/xpl-button-row/xpl-button-row.d.ts +1 -1
- package/dist/types/components/xpl-calendar/calendar.stories.d.ts +4 -0
- package/dist/types/components/xpl-calendar/xpl-calendar.d.ts +1 -1
- package/dist/types/components/xpl-checkbox/checkbox.stories.d.ts +4 -0
- package/dist/types/components/xpl-checkbox/xpl-checkbox.d.ts +1 -1
- package/dist/types/components/xpl-choicelist/choicelist.stories.d.ts +4 -0
- package/dist/types/components/xpl-choicelist/xpl-choicelist.d.ts +1 -1
- package/dist/types/components/xpl-content-area/xpl-content-area.d.ts +1 -1
- package/dist/types/components/xpl-dashboard/xpl-dashboard.d.ts +1 -1
- package/dist/types/components/xpl-data-card/data-card.stories.d.ts +4 -0
- package/dist/types/components/xpl-data-card/xpl-data-card.d.ts +3 -4
- package/dist/types/components/xpl-divider/divider.stories.d.ts +4 -0
- package/dist/types/components/xpl-divider/xpl-divider.d.ts +1 -1
- package/dist/types/components/xpl-dropdown/dropdown-option.d.ts +1 -0
- package/dist/types/components/xpl-dropdown/dropdown.stories.d.ts +1 -1
- package/dist/types/components/xpl-dropdown/xpl-dropdown-group/xpl-dropdown-group.d.ts +1 -1
- package/dist/types/components/xpl-dropdown/xpl-dropdown-heading/xpl-dropdown-heading.d.ts +1 -1
- package/dist/types/components/xpl-dropdown/xpl-dropdown-option/xpl-dropdown-option.d.ts +3 -2
- package/dist/types/components/xpl-dropdown/xpl-dropdown.d.ts +11 -8
- package/dist/types/components/xpl-dynamic-table/dynamic-table.stories.d.ts +4 -0
- package/dist/types/components/xpl-dynamic-table/xpl-dynamic-table.d.ts +1 -1
- package/dist/types/components/xpl-dynamic-table-cell/xpl-dynamic-table-cell.d.ts +1 -1
- package/dist/types/components/xpl-dynamic-table-row/xpl-dynamic-table-row.d.ts +1 -1
- package/dist/types/components/xpl-grid/xpl-grid.d.ts +1 -1
- package/dist/types/components/xpl-grid-item/xpl-grid-item.d.ts +1 -1
- package/dist/types/components/xpl-header-accordion/header-accordion.stories.d.ts +4 -0
- package/dist/types/components/xpl-header-accordion/xpl-header-accordion.d.ts +1 -1
- package/dist/types/components/xpl-icon/icon-types.d.ts +2 -0
- package/dist/types/components/xpl-icon/xpl-icon.d.ts +2 -4
- package/dist/types/components/xpl-input/input.stories.d.ts +40 -7
- package/dist/types/components/xpl-input/xpl-input-color/xpl-input-color.d.ts +1 -1
- package/dist/types/components/xpl-input/xpl-input-date/xpl-input-date.d.ts +10 -3
- package/dist/types/components/xpl-input/xpl-input-file/xpl-input-file.d.ts +1 -1
- package/dist/types/components/xpl-input/xpl-input-phone/phone-country-data.d.ts +13 -0
- package/dist/types/components/xpl-input/xpl-input-phone/phone-format.d.ts +5 -0
- package/dist/types/components/xpl-input/xpl-input-phone/xpl-input-phone.d.ts +48 -0
- package/dist/types/components/xpl-input/xpl-input-time/xpl-input-time.d.ts +1 -1
- package/dist/types/components/xpl-input/xpl-input.d.ts +12 -2
- package/dist/types/components/xpl-large-card/large-card.stories.d.ts +4 -0
- package/dist/types/components/xpl-large-card/xpl-large-card.d.ts +1 -1
- package/dist/types/components/xpl-list/list.stories.d.ts +4 -0
- package/dist/types/components/xpl-list/xpl-list.d.ts +1 -1
- package/dist/types/components/xpl-main-nav/xpl-main-nav.d.ts +1 -1
- package/dist/types/components/xpl-modal/modal.stories.d.ts +4 -0
- package/dist/types/components/xpl-modal/xpl-modal.d.ts +1 -1
- package/dist/types/components/xpl-nav-item/xpl-nav-item.d.ts +1 -1
- package/dist/types/components/xpl-pagination/pagination.stories.d.ts +4 -0
- package/dist/types/components/xpl-pagination/xpl-pagination.d.ts +1 -1
- package/dist/types/components/xpl-panel/panel.stories.d.ts +20 -0
- package/dist/types/components/xpl-panel/xpl-panel.d.ts +5 -0
- package/dist/types/components/xpl-popover/xpl-popover.d.ts +1 -1
- package/dist/types/components/xpl-progress/progress.stories.d.ts +4 -0
- package/dist/types/components/xpl-progress/xpl-progress.d.ts +1 -1
- package/dist/types/components/xpl-progress-bar/progress-bar.stories.d.ts +73 -0
- package/dist/types/components/xpl-progress-bar/xpl-progress-bar.d.ts +15 -0
- package/dist/types/components/xpl-radio/radio.stories.d.ts +4 -0
- package/dist/types/components/xpl-radio/xpl-radio.d.ts +1 -1
- package/dist/types/components/xpl-secondary-nav/xpl-secondary-nav.d.ts +1 -1
- package/dist/types/components/xpl-select/select.stories.d.ts +4 -0
- package/dist/types/components/xpl-select/xpl-select.d.ts +2 -4
- package/dist/types/components/xpl-side-nav/side-nav.stories.d.ts +80 -0
- package/dist/types/components/xpl-side-nav/xpl-side-nav-item/xpl-side-nav-item.d.ts +20 -0
- package/dist/types/components/xpl-side-nav/xpl-side-nav.d.ts +4 -0
- package/dist/types/components/xpl-skeleton/xpl-skeleton.d.ts +1 -1
- package/dist/types/components/xpl-slideout/slideout.stories.d.ts +6 -0
- package/dist/types/components/xpl-slideout/xpl-slideout.d.ts +1 -1
- package/dist/types/components/xpl-tab/xpl-tab.d.ts +1 -1
- package/dist/types/components/xpl-tab-panel/xpl-tab-panel.d.ts +1 -1
- package/dist/types/components/xpl-table/table.stories.d.ts +4 -0
- package/dist/types/components/xpl-table/xpl-table.d.ts +1 -1
- package/dist/types/components/xpl-table-header/table-header.stories.d.ts +4 -0
- package/dist/types/components/xpl-table-header/xpl-table-header.d.ts +1 -1
- package/dist/types/components/xpl-table-header-cell/table-header-cell.stories.d.ts +4 -0
- package/dist/types/components/xpl-table-header-cell/xpl-table-header-cell.d.ts +2 -3
- package/dist/types/components/xpl-tabs/tabs.stories.d.ts +4 -0
- package/dist/types/components/xpl-tabs/xpl-tabs.d.ts +2 -2
- package/dist/types/components/xpl-tag/xpl-tag.d.ts +1 -1
- package/dist/types/components/xpl-toast/toast.stories.d.ts +4 -0
- package/dist/types/components/xpl-toast/xpl-toast.d.ts +1 -1
- package/dist/types/components/xpl-toggle/toggle.stories.d.ts +4 -0
- package/dist/types/components/xpl-toggle/xpl-toggle.d.ts +1 -1
- package/dist/types/components/xpl-toolbar/xpl-toolbar.d.ts +1 -1
- package/dist/types/components/xpl-tooltip/tooltip.stories.d.ts +4 -0
- package/dist/types/components/xpl-tooltip/xpl-tooltip.d.ts +1 -1
- package/dist/types/components/xpl-utility-bar/xpl-utility-bar.d.ts +1 -1
- package/dist/types/components.d.ts +1210 -173
- package/dist/types/stencil-public-runtime.d.ts +23 -2
- package/dist/types/utils/layout-ancestors.d.ts +2 -0
- package/package.json +45 -28
- package/dist/apollo-core/p-3b5f8989.entry.js +0 -1
- package/dist/apollo-core/p-576ce90f.entry.js +0 -1
- package/dist/apollo-core/p-5c0236db.entry.js +0 -6
- package/dist/apollo-core/p-5ec45742.entry.js +0 -1
- package/dist/apollo-core/p-7b7db57a.entry.js +0 -1
- package/dist/apollo-core/p-7f8e5cd0.entry.js +0 -1
- package/dist/apollo-core/p-812bb0e4.entry.js +0 -1
- package/dist/apollo-core/p-845eef0d.entry.js +0 -1
- package/dist/apollo-core/p-94209785.entry.js +0 -1
- package/dist/apollo-core/p-9853028c.entry.js +0 -1
- package/dist/apollo-core/p-9d65ece7.entry.js +0 -1
- package/dist/apollo-core/p-DhZas3eX.js +0 -2
- package/dist/apollo-core/p-be292555.entry.js +0 -1
- package/dist/cjs/xpl-avatar_41.cjs.entry.js +0 -5522
- package/dist/esm/xpl-avatar_41.entry.js +0 -5480
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
|
-
export class
|
|
2
|
+
export class HeaderAccordion {
|
|
3
3
|
constructor() {
|
|
4
4
|
this.initialExpanded = false;
|
|
5
5
|
this.disabled = false;
|
|
@@ -68,7 +68,7 @@ export class XplHeaderAccordion {
|
|
|
68
68
|
this.applyBorderRadiusToLastRow();
|
|
69
69
|
}
|
|
70
70
|
render() {
|
|
71
|
-
return (h(Host, { key: '
|
|
71
|
+
return (h(Host, { key: '511ce0498294e0064e94ff14b847f75260c6c7cf', class: "xpl-header-accordion" }, h("div", { key: '75550adfe2cff80c32e3fe73bfba5888a4bfc91d', class: `header-accordion header-accordion--${this.expanded ? 'expanded' : 'collapsed'}` }, this.hasCheckbox && (h("xpl-checkbox", { key: 'd46601b19497594f44b4633228a6f020f29c8914', class: "xpl-header-accordion__parent-checkbox", checked: this.parentChecked, disabled: this.disabled, indeterminate: this.parentIndeterminate, onCheckboxChange: (event) => this.handleParentCheckboxChange(event.detail) })), h("button", { key: 'b15087f6e34cd0d31e77d5c3b35640b7734ed556', "aria-expanded": this.expanded, "aria-controls": this.contentId, class: "toggle-area", onClick: this.toggleAccordion, type: "button" }, h("slot", { key: '8f655d108a016212852f0a7138fa82ea386ed26a', name: "title" }), h("xpl-icon", { key: 'abe7fb2fe4a19db7bcd2cbed7fec903cbeeaee4d', size: 16, icon: "chevron-down", class: this.expanded && 'rotate' }))), h("div", { key: 'e86c0a67e94b24f4c39386e8f728de34242e7344', id: this.contentId, role: "region", class: !this.expanded ? 'content--hidden' : 'content--shown' }, h("slot", { key: 'a86303b3cf41724f65e10db14d0f6464c68d49c2', name: "content" }))));
|
|
72
72
|
}
|
|
73
73
|
static get is() { return "xpl-header-accordion"; }
|
|
74
74
|
static get properties() {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,16 @@
|
|
|
1
|
-
import
|
|
1
|
+
import apolloIcons from "@xplortech/apollo-icons";
|
|
2
|
+
const iconNames = Object.keys(apolloIcons);
|
|
3
|
+
const allTags = new Set();
|
|
4
|
+
iconNames.forEach((name) => {
|
|
5
|
+
var _a;
|
|
6
|
+
const keywords = ((_a = apolloIcons[name]) === null || _a === void 0 ? void 0 : _a.keywords) || [];
|
|
7
|
+
keywords.forEach((keyword) => allTags.add(keyword));
|
|
8
|
+
});
|
|
9
|
+
const tagToIconsMap = {};
|
|
10
|
+
allTags.forEach((tag) => {
|
|
11
|
+
const iconsWithTag = apolloIcons.getIconsByTag(tag);
|
|
12
|
+
tagToIconsMap[tag] = iconsWithTag.map((icon) => icon.symbol);
|
|
13
|
+
});
|
|
2
14
|
export default {
|
|
3
15
|
title: 'Components/Icons',
|
|
4
16
|
argTypes: {
|
|
@@ -11,30 +23,53 @@ export default {
|
|
|
11
23
|
},
|
|
12
24
|
};
|
|
13
25
|
export const Icons = ({ size, color }) => `
|
|
14
|
-
<xpl-input placeholder="Search icons..." id="icon-search"></xpl-input>
|
|
26
|
+
<xpl-input placeholder="Search icons by name or tag..." id="icon-search"></xpl-input>
|
|
15
27
|
<script>
|
|
16
28
|
const iconSearch = document.getElementById('icon-search');
|
|
29
|
+
// Tag-to-icons mapping built using getIconsByTag from @xplortech/apollo-icons
|
|
30
|
+
const tagToIconsMap = ${JSON.stringify(tagToIconsMap)};
|
|
31
|
+
|
|
32
|
+
// Helper function to get icons matching a tag (mirrors getIconsByTag behavior)
|
|
33
|
+
function getIconsByTag(tag) {
|
|
34
|
+
const searchTag = tag.toLowerCase();
|
|
35
|
+
const matchingIcons = new Set();
|
|
36
|
+
Object.entries(tagToIconsMap).forEach(([tagKey, icons]) => {
|
|
37
|
+
if (tagKey.toLowerCase().includes(searchTag)) {
|
|
38
|
+
icons.forEach(icon => matchingIcons.add(icon));
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
return Array.from(matchingIcons);
|
|
42
|
+
}
|
|
43
|
+
|
|
17
44
|
iconSearch.addEventListener('inputEvent', (event) => {
|
|
18
|
-
const search = event.detail;
|
|
19
|
-
const filteredIcons = ${JSON.stringify(Object.keys(data))}.filter(icon => icon.includes(search));
|
|
45
|
+
const search = event.detail.toLowerCase();
|
|
20
46
|
const items = document.querySelectorAll('#where-icons-go .item-container');
|
|
21
47
|
const noSearchResults = document.querySelector('.no-search-results');
|
|
48
|
+
let visibleCount = 0;
|
|
49
|
+
|
|
50
|
+
// Get icons that match by tag using getIconsByTag
|
|
51
|
+
const iconsMatchingTag = getIconsByTag(search);
|
|
52
|
+
|
|
22
53
|
items.forEach(item => {
|
|
23
|
-
|
|
54
|
+
const iconName = item.querySelector('.icon-name').textContent;
|
|
55
|
+
|
|
56
|
+
// Match by icon name or by tag (using getIconsByTag results)
|
|
57
|
+
const matchesName = iconName.toLowerCase().includes(search);
|
|
58
|
+
const matchesTag = iconsMatchingTag.includes(iconName);
|
|
59
|
+
|
|
60
|
+
if (matchesName || matchesTag) {
|
|
24
61
|
item.style.display = 'block';
|
|
62
|
+
visibleCount++;
|
|
25
63
|
} else {
|
|
26
64
|
item.style.display = 'none';
|
|
27
65
|
}
|
|
28
66
|
});
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
} else {
|
|
32
|
-
noSearchResults.style.display = 'none';
|
|
33
|
-
}
|
|
67
|
+
|
|
68
|
+
noSearchResults.style.display = visibleCount === 0 ? 'block' : 'none';
|
|
34
69
|
});
|
|
35
70
|
</script>
|
|
36
71
|
<div class="where-icons-go" id="where-icons-go" style="color: ${color};">
|
|
37
|
-
${
|
|
72
|
+
${iconNames
|
|
38
73
|
.map((icon) => `<div class="item-container">
|
|
39
74
|
<xpl-tooltip text="Click to copy" >
|
|
40
75
|
<div class="item" onclick="navigator.clipboard.writeText('<xpl-icon icon="${icon}"></xpl-icon>')">
|
|
@@ -69,7 +104,7 @@ Icon.argTypes = {
|
|
|
69
104
|
type: { name: 'string', required: true },
|
|
70
105
|
},
|
|
71
106
|
icon: {
|
|
72
|
-
options:
|
|
107
|
+
options: iconNames,
|
|
73
108
|
control: {
|
|
74
109
|
type: 'select',
|
|
75
110
|
},
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
|
-
import
|
|
3
|
-
export class
|
|
2
|
+
import apolloIcons from "@xplortech/apollo-icons";
|
|
3
|
+
export class Icon {
|
|
4
4
|
render() {
|
|
5
|
+
var _a;
|
|
5
6
|
let options = {};
|
|
6
7
|
if (this.size !== undefined) {
|
|
7
8
|
if (typeof this.size === 'number') {
|
|
@@ -15,10 +16,10 @@ export class XplIcon {
|
|
|
15
16
|
let wrapperClasses = 'xpl-icon__wrapper ';
|
|
16
17
|
if (this.backgroundColor)
|
|
17
18
|
wrapperClasses += `xpl-icon__wrapper--with-background xpl-icon__wrapper--with-background--${this.backgroundColor}`;
|
|
18
|
-
return (h(Host, { key: '
|
|
19
|
+
return (h(Host, { key: 'c622a660e3ed7d9dce7dc08a868360ffc43f2f8d' }, h("figure", { key: 'c12f8de568fa6e652914fbc894a1269f6085d880', class: wrapperClasses }, h("span", { key: 'a8386f0d0fc3848a36b5120dd5f24356c403d0f5', "aria-label": this.icon, role: "img", class: "xpl-icon", style: {
|
|
19
20
|
width: `${options.width}px`,
|
|
20
21
|
height: `${options.height}px`,
|
|
21
|
-
}, innerHTML:
|
|
22
|
+
}, innerHTML: (_a = apolloIcons.getIcon(this.icon)) === null || _a === void 0 ? void 0 : _a.toSVG(options) }), h("figcaption", { key: '4d56222dc219feedd1e8e2c957ca01728a845b56' }, this.icon, " icon"))));
|
|
22
23
|
}
|
|
23
24
|
static get is() { return "xpl-icon"; }
|
|
24
25
|
static get originalStyleUrls() {
|
|
@@ -37,21 +38,18 @@ export class XplIcon {
|
|
|
37
38
|
"type": "string",
|
|
38
39
|
"mutable": false,
|
|
39
40
|
"complexType": {
|
|
40
|
-
"original": "
|
|
41
|
-
"resolved": "
|
|
42
|
-
"references": {
|
|
43
|
-
"IconName": {
|
|
44
|
-
"location": "local",
|
|
45
|
-
"path": "/home/runner/work/apollo/apollo/packages/apollo-core/src/components/components/xpl-icon/xpl-icon.tsx",
|
|
46
|
-
"id": "src/components/components/xpl-icon/xpl-icon.tsx::IconName"
|
|
47
|
-
}
|
|
48
|
-
}
|
|
41
|
+
"original": "string",
|
|
42
|
+
"resolved": "string",
|
|
43
|
+
"references": {}
|
|
49
44
|
},
|
|
50
|
-
"required":
|
|
45
|
+
"required": true,
|
|
51
46
|
"optional": false,
|
|
52
47
|
"docs": {
|
|
53
|
-
"tags": [
|
|
54
|
-
|
|
48
|
+
"tags": [{
|
|
49
|
+
"name": "property",
|
|
50
|
+
"text": "{string}\n\nSee [available icons](./ICONS.md) for the complete list,\nor view the [Storybook icon gallery](?path=/story/components-icons--icons)."
|
|
51
|
+
}],
|
|
52
|
+
"text": "Name of icon."
|
|
55
53
|
},
|
|
56
54
|
"getter": false,
|
|
57
55
|
"setter": false,
|
|
@@ -32,20 +32,14 @@ export default {
|
|
|
32
32
|
type: { name: 'string', required: false },
|
|
33
33
|
},
|
|
34
34
|
type: {
|
|
35
|
-
options: ['text', 'number', 'file', 'password', 'date', 'time', 'color'],
|
|
35
|
+
options: ['text', 'number', 'file', 'password', 'date', 'time', 'color', 'phone'],
|
|
36
36
|
control: {
|
|
37
37
|
type: 'select',
|
|
38
38
|
},
|
|
39
39
|
},
|
|
40
|
-
timeFormat: {
|
|
41
|
-
control: {
|
|
42
|
-
type: 'select',
|
|
43
|
-
},
|
|
44
|
-
options: ['12h', '24h'],
|
|
45
|
-
},
|
|
46
40
|
},
|
|
47
41
|
};
|
|
48
|
-
export const Input = ({ label, description, disabled, error, errorMessage, pre, post, type }) => {
|
|
42
|
+
export const Input = ({ label, description, disabled, error, errorMessage, pre, post, type, defaultCountry, isInternational, }) => {
|
|
49
43
|
let attrs = '';
|
|
50
44
|
if (label)
|
|
51
45
|
attrs += ` label="${label}"`;
|
|
@@ -60,7 +54,11 @@ export const Input = ({ label, description, disabled, error, errorMessage, pre,
|
|
|
60
54
|
if (post)
|
|
61
55
|
attrs += ` post="${post}"`;
|
|
62
56
|
if (type !== 'text')
|
|
63
|
-
attrs += ` type
|
|
57
|
+
attrs += ` type="${type}"`;
|
|
58
|
+
if (type === 'phone' && defaultCountry)
|
|
59
|
+
attrs += ` default-country="${defaultCountry}"`;
|
|
60
|
+
if (type === 'phone' && isInternational === false)
|
|
61
|
+
attrs += ` is-international="false"`;
|
|
64
62
|
return `<xpl-input${attrs} name="input-name" placeholder="Placeholder"></xpl-input>`;
|
|
65
63
|
};
|
|
66
64
|
Input.args = {
|
|
@@ -72,6 +70,20 @@ Input.args = {
|
|
|
72
70
|
pre: '',
|
|
73
71
|
post: '',
|
|
74
72
|
type: 'text',
|
|
73
|
+
defaultCountry: 'US',
|
|
74
|
+
isInternational: true,
|
|
75
|
+
};
|
|
76
|
+
Input.argTypes = {
|
|
77
|
+
defaultCountry: {
|
|
78
|
+
control: { type: 'text' },
|
|
79
|
+
description: 'Default country (ISO code) for phone input',
|
|
80
|
+
if: { arg: 'type', eq: 'phone' },
|
|
81
|
+
},
|
|
82
|
+
isInternational: {
|
|
83
|
+
control: { type: 'boolean' },
|
|
84
|
+
description: 'Enables international mode with country selector. When false, locked to defaultCountry with no picker.',
|
|
85
|
+
if: { arg: 'type', eq: 'phone' },
|
|
86
|
+
},
|
|
75
87
|
};
|
|
76
88
|
Input.parameters = {
|
|
77
89
|
layout: 'centered',
|
|
@@ -109,6 +121,10 @@ Input.parameters = {
|
|
|
109
121
|
return output;
|
|
110
122
|
})(Input.args),
|
|
111
123
|
},
|
|
124
|
+
design: {
|
|
125
|
+
type: 'figma',
|
|
126
|
+
url: 'https://www.figma.com/design/MjjYek73MFnHmVNdm45Sd1/Apollo-Web?node-id=16215-5412&p=f&t=vVY2x58f7oPprNSr-11',
|
|
127
|
+
},
|
|
112
128
|
};
|
|
113
129
|
export const Multiline = ({ label, description, disabled, error, errorMessage, maxCharacterCount, }) => {
|
|
114
130
|
let attrs = ' multiline';
|
|
@@ -302,6 +318,12 @@ Timepicker.args = {
|
|
|
302
318
|
max: '18:00',
|
|
303
319
|
type: 'time',
|
|
304
320
|
};
|
|
321
|
+
Timepicker.argTypes = {
|
|
322
|
+
timeFormat: {
|
|
323
|
+
control: { type: 'select' },
|
|
324
|
+
options: ['12h', '24h'],
|
|
325
|
+
},
|
|
326
|
+
};
|
|
305
327
|
Timepicker.parameters = {
|
|
306
328
|
layout: 'centered',
|
|
307
329
|
'web-component': {
|
|
@@ -529,3 +551,51 @@ Color.parameters = {
|
|
|
529
551
|
})(Color.args),
|
|
530
552
|
},
|
|
531
553
|
};
|
|
554
|
+
export const Phone = ({ label, description, placeholder, disabled, defaultCountry, isInternational, value, }) => {
|
|
555
|
+
let attrs = ` type="phone" label="${label}" name="phone" placeholder="${placeholder}"`;
|
|
556
|
+
if (description)
|
|
557
|
+
attrs += ` description="${description}"`;
|
|
558
|
+
if (disabled)
|
|
559
|
+
attrs += ` disabled`;
|
|
560
|
+
if (defaultCountry)
|
|
561
|
+
attrs += ` default-country="${defaultCountry}"`;
|
|
562
|
+
if (isInternational === false)
|
|
563
|
+
attrs += ` is-international="false"`;
|
|
564
|
+
if (value)
|
|
565
|
+
attrs += ` value="${value}"`;
|
|
566
|
+
return `<xpl-input${attrs}></xpl-input>`;
|
|
567
|
+
};
|
|
568
|
+
Phone.args = {
|
|
569
|
+
defaultCountry: 'US',
|
|
570
|
+
description: 'Enter your phone number with country code',
|
|
571
|
+
disabled: false,
|
|
572
|
+
error: false,
|
|
573
|
+
errorMessage: '',
|
|
574
|
+
isInternational: true,
|
|
575
|
+
label: 'Phone number',
|
|
576
|
+
placeholder: 'Enter number',
|
|
577
|
+
value: '+0000000000',
|
|
578
|
+
};
|
|
579
|
+
Phone.argTypes = {
|
|
580
|
+
isInternational: {
|
|
581
|
+
control: { type: 'boolean' },
|
|
582
|
+
description: 'Enables international mode with country selector. When false, locked to defaultCountry with no picker.',
|
|
583
|
+
},
|
|
584
|
+
};
|
|
585
|
+
Phone.parameters = {
|
|
586
|
+
layout: 'centered',
|
|
587
|
+
'web-component': {
|
|
588
|
+
render: Phone(Phone.args),
|
|
589
|
+
},
|
|
590
|
+
html: {
|
|
591
|
+
render: (() => `
|
|
592
|
+
<div class="xpl-input">
|
|
593
|
+
<label class="xpl-input-label" for="phone-id">${Phone.args.label}</label>
|
|
594
|
+
${Phone.args.description ? `<small>${Phone.args.description}</small>` : ''}
|
|
595
|
+
<div class="xpl-input-wrapper xpl-input-phone">
|
|
596
|
+
<button type="button" class="xpl-input-phone__trigger" aria-haspopup="listbox">+1</button>
|
|
597
|
+
<input type="tel" id="phone-id" name="phone" placeholder="${Phone.args.placeholder}" class="xpl-input-phone__input" />
|
|
598
|
+
</div>
|
|
599
|
+
</div>`)(),
|
|
600
|
+
},
|
|
601
|
+
};
|
|
@@ -7,7 +7,7 @@ const fallbackColorValues = {
|
|
|
7
7
|
b: 0,
|
|
8
8
|
a: 1,
|
|
9
9
|
};
|
|
10
|
-
export class
|
|
10
|
+
export class InputColor {
|
|
11
11
|
constructor() {
|
|
12
12
|
this.placeholder = 'Select color';
|
|
13
13
|
this.eyeDropperSupported = 'EyeDropper' in window;
|
|
@@ -193,16 +193,16 @@ export class XplInputColor {
|
|
|
193
193
|
top: `${y}px`,
|
|
194
194
|
background: `rgb(${r}, ${g}, ${b})`,
|
|
195
195
|
};
|
|
196
|
-
return (h(Host, { key: '
|
|
196
|
+
return (h(Host, { key: 'a8cdba9ff504fbeaf7b21167b778d8cf00216a1a', class: "xpl-input-color" }, h("xpl-popover", { key: '535497f6aba0e7e9e65b894cd8c62cebe8ad3dd5', disabled: this.disabled, display: "menu" }, h("div", { key: '436c51111938bbbef99698b94bd5c3123bc0b42d', slot: "trigger" }, h("div", { key: '09e8f57c0d1a35d1b0a5785ebb141db62c3db4d2', class: {
|
|
197
197
|
'xpl-input-color__display': true,
|
|
198
198
|
'xpl-input-color__display--disabled': this.disabled,
|
|
199
199
|
'xpl-input-color__display--error': !!this.hasErrorState,
|
|
200
|
-
} }, h("span", { key: '
|
|
200
|
+
} }, h("span", { key: '76da6216e95d48dd5cdbb890e7fe14cf1be85c6b', class: "xpl-input-color__color", style: {
|
|
201
201
|
background: objectToStringColor(this.colorValues),
|
|
202
|
-
} }), this.colorValues.hex ? (h("span", { class: "xpl-input-color__value" }, objectToStringColor(this.colorValues))) : (h("span", { class: "xpl-input-color__placeholder" }, this.placeholder)), this.eyeDropperSupported && !this.hideEyeDropper && (h("xpl-icon", { key: '
|
|
202
|
+
} }), this.colorValues.hex ? (h("span", { class: "xpl-input-color__value" }, objectToStringColor(this.colorValues))) : (h("span", { class: "xpl-input-color__placeholder" }, this.placeholder)), this.eyeDropperSupported && !this.hideEyeDropper && (h("xpl-icon", { key: 'c4a560be47d17c98f353c0e324c0f9025f535fae', size: 20, icon: "eye-dropper", class: "xpl-input-color__icon", onClick: (e) => {
|
|
203
203
|
e.stopPropagation();
|
|
204
204
|
this.openEyeDropper();
|
|
205
|
-
} })))), h("div", { key: '
|
|
205
|
+
} })))), h("div", { key: '844a66fa0523b133ce3e2b6d83e395254e9b513f', class: "xpl-input-color__menu" }, h("div", { key: 'c687aaa94b122258e09cffabcc5029905ddccb27', class: "xpl-input-color__sl-grid", ref: (el) => {
|
|
206
206
|
this.colorInputElements.slGrid = el;
|
|
207
207
|
}, style: {
|
|
208
208
|
background: [
|
|
@@ -210,9 +210,9 @@ export class XplInputColor {
|
|
|
210
210
|
`linear-gradient(to right, #fff, #fff0)`,
|
|
211
211
|
`rgb(${hueBaseColor.r} ${hueBaseColor.g} ${hueBaseColor.b})`,
|
|
212
212
|
].join(', '),
|
|
213
|
-
}, onMouseDown: this.startDrag, onTouchStart: this.startDrag }, h("div", { key: '
|
|
213
|
+
}, onMouseDown: this.startDrag, onTouchStart: this.startDrag }, h("div", { key: '7e65660cef09fc5ae0c9dc0d49fe7769ad15b55a', class: "xpl-input-color__sl-thumb", style: slThumbStyle })), h("div", { key: '5e76247d0d59fca5500416ddeaca53784dc42209', class: "xpl-input-color__grid" }, h("input", { key: '5b891dd55f6d4f5d1242d142c9af8a3af496e398', type: "range", min: "0", max: "360", value: this.hue, class: "xpl-input-color__slider xpl-input-color__hue", name: "color-hue-slider", ref: (el) => {
|
|
214
214
|
this.colorInputElements.hue = el;
|
|
215
|
-
} }), h("input", { key: '
|
|
215
|
+
} }), h("input", { key: 'ae20b7cbfa6303c6615afee0fc35d0dda3bc1f70', type: "range", min: "0", max: "1", step: "0.01", value: a, class: "xpl-input-color__slider xpl-input-color__alpha", name: "color-alpha-slider", ref: (el) => {
|
|
216
216
|
this.colorInputElements.alpha = el;
|
|
217
217
|
}, style: {
|
|
218
218
|
backgroundImage: [
|
|
@@ -222,9 +222,9 @@ export class XplInputColor {
|
|
|
222
222
|
`linear-gradient(45deg, transparent 75%, #ccc 75%)`,
|
|
223
223
|
`linear-gradient(-45deg, transparent 75%, #ccc 75%)`,
|
|
224
224
|
].join(', '),
|
|
225
|
-
} }), h("div", { key: '
|
|
225
|
+
} }), h("div", { key: 'c4b884401f5324e37e09637785a2148ef5c99112', class: "xpl-input-color__preview", style: {
|
|
226
226
|
background: `rgba(${r}, ${g}, ${b}, ${a})`,
|
|
227
|
-
} })), h("div", { key: '
|
|
227
|
+
} })), h("div", { key: '5d8eff1bf9e51bd44116c01e3bfd016414662d92', class: "xpl-input-color__inputs" }, Object.entries(this.colorInputElements)
|
|
228
228
|
.filter(([key]) => ['hex', 'r', 'g', 'b', 'a'].includes(key))
|
|
229
229
|
.map(([key]) => (h("xpl-input", { key: key, label: key.toLocaleUpperCase(), name: `color-${key}-input`, placeholder: key === 'hex' ? '793EF7' : '0', value: this.colorValues[key], ref: (elRef) => {
|
|
230
230
|
this.colorInputElements[key] = elRef;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { Host, h } from "@stencil/core";
|
|
1
|
+
import { Host, h, } from "@stencil/core";
|
|
2
2
|
import flatpickr from "flatpickr";
|
|
3
|
+
import { getNearestScrollableAncestor, isInsideFixedPosition, } from "../../../utils/layout-ancestors";
|
|
3
4
|
const arrowSvg = (rotate = false) => `<svg width="8" height="12" viewBox="0 0 8 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="${rotate
|
|
4
5
|
? 'M0.557948 5.6813L6.06209 0.132167C6.23831 -0.0440556 6.52327 -0.0440556 6.69949 0.132167L7.44187 0.874551C7.61809 1.05077 7.61809 1.33573 7.44187 1.51195L2.99882 6L7.44187 10.488C7.61809 10.6643 7.61809 10.9492 7.44187 11.1254L6.69949 11.8678C6.52327 12.0441 6.23831 12.0441 6.06209 11.8678L0.557948 6.3187C0.381726 6.14248 0.381726 5.85752 0.557948 5.6813Z'
|
|
5
6
|
: 'M7.44187 6.3187L1.93773 11.8678C1.76151 12.0441 1.47655 12.0441 1.30033 11.8678L0.557948 11.1254C0.381726 10.9492 0.381726 10.6643 0.557948 10.488L5.001 6L0.557948 1.51195C0.381726 1.33573 0.381726 1.05077 0.557948 0.874551L1.30033 0.132167C1.47655 -0.0440556 1.76151 -0.0440556 1.93773 0.132167L7.44187 5.6813C7.6181 5.85752 7.6181 6.14248 7.44187 6.3187Z'}" /></svg>`;
|
|
6
|
-
export class
|
|
7
|
+
export class InputDate {
|
|
7
8
|
constructor() {
|
|
8
9
|
this.dateFormat = 'Y-m-d';
|
|
9
10
|
this.mode = 'single';
|
|
11
|
+
this.flatpickrStaticLayout = false;
|
|
10
12
|
this.valueChanged = (event) => {
|
|
11
13
|
const target = event.target;
|
|
12
14
|
this.valueChange.emit(target.value);
|
|
@@ -19,17 +21,31 @@ export class XplInputDate {
|
|
|
19
21
|
var _a;
|
|
20
22
|
(_a = this.flatpickrInstance) === null || _a === void 0 ? void 0 : _a.setDate(newValue);
|
|
21
23
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
24
|
+
connectedCallback() {
|
|
25
|
+
queueMicrotask(() => this.ensureFlatpickr());
|
|
26
|
+
}
|
|
27
|
+
disconnectedCallback() {
|
|
28
|
+
var _a;
|
|
29
|
+
(_a = this.flatpickrInstance) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
30
|
+
this.flatpickrInstance = undefined;
|
|
31
|
+
this.flatpickrStaticLayout = false;
|
|
32
|
+
this.unwrapStaleFlatpickrWrapper();
|
|
33
|
+
}
|
|
34
|
+
componentDidRender() {
|
|
35
|
+
this.ensureFlatpickr();
|
|
36
|
+
}
|
|
37
|
+
ensureFlatpickr() {
|
|
38
|
+
if (this.flatpickrInstance || !this.input || !this.el.isConnected) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
this.unwrapStaleFlatpickrWrapper();
|
|
42
|
+
this.initFlatpickr();
|
|
43
|
+
}
|
|
44
|
+
initFlatpickr() {
|
|
45
|
+
const insideFixed = isInsideFixedPosition(this.el);
|
|
46
|
+
this.flatpickrInstance = flatpickr(this.input, Object.assign(Object.assign({ allowInput: true }, (insideFixed
|
|
47
|
+
? { static: true }
|
|
48
|
+
: { appendTo: getNearestScrollableAncestor(this.el) })), { dateFormat: this.dateFormat, defaultDate: this.value, maxDate: this.max, minDate: this.min, mode: this.mode, nextArrow: arrowSvg(), prevArrow: arrowSvg(true), onClose: (selectedDates) => {
|
|
33
49
|
const minRequiredDates = !this.required ? 0 : this.mode === 'single' ? 1 : 2;
|
|
34
50
|
this.hasErrorState = selectedDates.length < minRequiredDates ? 'required' : null;
|
|
35
51
|
if (selectedDates.length === 2) {
|
|
@@ -39,19 +55,39 @@ export class XplInputDate {
|
|
|
39
55
|
end,
|
|
40
56
|
});
|
|
41
57
|
}
|
|
42
|
-
}
|
|
58
|
+
} }));
|
|
59
|
+
queueMicrotask(() => {
|
|
60
|
+
if (this.flatpickrStaticLayout !== insideFixed) {
|
|
61
|
+
this.flatpickrStaticLayout = insideFixed;
|
|
62
|
+
}
|
|
43
63
|
});
|
|
44
64
|
}
|
|
65
|
+
unwrapStaleFlatpickrWrapper() {
|
|
66
|
+
const { input } = this;
|
|
67
|
+
const wrapper = input === null || input === void 0 ? void 0 : input.parentElement;
|
|
68
|
+
if (!(wrapper === null || wrapper === void 0 ? void 0 : wrapper.classList.contains('flatpickr-wrapper'))) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
const parent = wrapper.parentElement;
|
|
72
|
+
if (!parent) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
while (wrapper.firstChild) {
|
|
76
|
+
parent.insertBefore(wrapper.firstChild, wrapper);
|
|
77
|
+
}
|
|
78
|
+
parent.removeChild(wrapper);
|
|
79
|
+
}
|
|
45
80
|
render() {
|
|
46
|
-
return (h(Host, { key: '
|
|
81
|
+
return (h(Host, { key: '35f91387097b7fd5bdc59ff8608c3700470ff367', class: {
|
|
47
82
|
'xpl-input-date': true,
|
|
48
83
|
[`xpl-input-date--mode-${this.mode}`]: true,
|
|
49
84
|
'xpl-input-date--error': !!this.hasErrorState,
|
|
50
|
-
|
|
85
|
+
'xpl-input-date--flatpickr-static': this.flatpickrStaticLayout,
|
|
86
|
+
} }, h("div", { key: '7f561dba2b2aa7d308d0029a20ace5d918368afc', class: "xpl-input-wrapper" }, this.pre && (h("label", { key: '2e87d6e22a2a69db7e91c69fb3d59f81d8358e52', class: "xpl-input-pre", htmlFor: this.inputId }, this.pre)), h("input", { key: '53d05e6b6b637e298f31cb1f2b9c56d9d597688f', type: "date", id: this.inputId, disabled: this.disabled, name: this.name, required: this.required, readonly: this.readonly, placeholder: this.placeholder, max: this.max, min: this.min, ref: (el) => {
|
|
51
87
|
this.input = el;
|
|
52
88
|
}, onChange: (event) => {
|
|
53
89
|
this.valueChanged(event);
|
|
54
|
-
} }), h("xpl-icon", { key: '
|
|
90
|
+
} }), h("xpl-icon", { key: '45c1d48fe6a312855cf3bd90e139d060821c4ba4', class: "xpl-input-calendar", icon: "calendar-month", size: 24 }), this.post && (h("label", { key: '037657e9a3cecc054d95b6fd835b58885eef8042', class: "xpl-input-post", htmlFor: this.inputId }, this.post)))));
|
|
55
91
|
}
|
|
56
92
|
static get is() { return "xpl-input-date"; }
|
|
57
93
|
static get properties() {
|
|
@@ -309,6 +345,7 @@ export class XplInputDate {
|
|
|
309
345
|
}
|
|
310
346
|
static get states() {
|
|
311
347
|
return {
|
|
348
|
+
"flatpickrStaticLayout": {},
|
|
312
349
|
"hasErrorState": {}
|
|
313
350
|
};
|
|
314
351
|
}
|
|
@@ -365,6 +402,7 @@ export class XplInputDate {
|
|
|
365
402
|
}
|
|
366
403
|
}];
|
|
367
404
|
}
|
|
405
|
+
static get elementRef() { return "el"; }
|
|
368
406
|
static get watchers() {
|
|
369
407
|
return [{
|
|
370
408
|
"propName": "hasErrorState",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Host, h, } from "@stencil/core";
|
|
2
|
-
export class
|
|
2
|
+
export class InputFile {
|
|
3
3
|
constructor() {
|
|
4
4
|
this.accept = '';
|
|
5
5
|
this.multiple = false;
|
|
@@ -33,18 +33,18 @@ export class XplInputFile {
|
|
|
33
33
|
}
|
|
34
34
|
render() {
|
|
35
35
|
var _a, _b;
|
|
36
|
-
return (h(Host, { key: '
|
|
36
|
+
return (h(Host, { key: '87df3edce40c74988426ba9fcef4bc3f5740c56b', class: {
|
|
37
37
|
'xpl-input-file': true,
|
|
38
38
|
'xpl-input-file--hide-trigger-on-select': this.hideTriggerOnSelect,
|
|
39
39
|
'xpl-input-file--disabled': this.disabled,
|
|
40
|
-
} }, h("span", { key: '
|
|
40
|
+
} }, h("span", { key: '11e4c220751ce3f06fd15a741a1f8b81d98c18bc', class: {
|
|
41
41
|
'xpl-input-file__trigger-wrapper': true,
|
|
42
42
|
'xpl-input-file__trigger-wrapper--hidden': this.hideTriggerOnSelect && ((_a = this.files) === null || _a === void 0 ? void 0 : _a.length) > 0,
|
|
43
|
-
}, role: "button", tabIndex: 0, onClick: this.openFileDialog }, h("slot", { key: '
|
|
43
|
+
}, role: "button", tabIndex: 0, onClick: this.openFileDialog }, h("slot", { key: '6daba4f9e520c12a791bfd18f2894e55f0da86f4', name: "trigger" })), ((_b = this.files) === null || _b === void 0 ? void 0 : _b.length) > 0 && !this.hideFileNames && (h("ul", { key: '3459f9c3e8618962c02f1e25e6b80f63fe4d593d', class: "xpl-input-file__file-list" }, this.files.map((file, fileIndex) => (h("li", { class: "xpl-input-file__file-item" }, h("span", { class: "xpl-text-callout" }, file.name), h("xpl-icon", { icon: "x-circle", size: 24, onClick: (e) => {
|
|
44
44
|
e.preventDefault();
|
|
45
45
|
e.stopPropagation();
|
|
46
46
|
this.onRemoveFileByIndex(fileIndex);
|
|
47
|
-
}, class: "xpl-input-file__remove-icon" })))))), this.accept && !this.hideAcceptText && (h("span", { key: '
|
|
47
|
+
}, class: "xpl-input-file__remove-icon" })))))), this.accept && !this.hideAcceptText && (h("span", { key: '2c8646cd5ef7e235e75c68bf4832ce1d9c578493', class: "xpl-input-file__accept xpl-text-caption" }, "Accepted file types: ", this.accept)), h("input", { key: 'd303ac9e074e8031ed2d695cc85eef32ef40f058', onChange: this.handleFileChange, type: "file", ref: (el) => {
|
|
48
48
|
this.fileInput = el;
|
|
49
49
|
}, hidden: true, accept: this.accept, multiple: this.multiple, name: this.name })));
|
|
50
50
|
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export const PHONE_COUNTRIES = [
|
|
2
|
+
{ countryCode: 'US', dialCode: '+1', name: 'United States' },
|
|
3
|
+
{ countryCode: 'CA', dialCode: '+1', name: 'Canada' },
|
|
4
|
+
{ countryCode: 'GB', dialCode: '+44', name: 'United Kingdom' },
|
|
5
|
+
{ countryCode: 'AU', dialCode: '+61', name: 'Australia' },
|
|
6
|
+
{ countryCode: 'DE', dialCode: '+49', name: 'Germany' },
|
|
7
|
+
{ countryCode: 'FR', dialCode: '+33', name: 'France' },
|
|
8
|
+
{ countryCode: 'ES', dialCode: '+34', name: 'Spain' },
|
|
9
|
+
{ countryCode: 'IT', dialCode: '+39', name: 'Italy' },
|
|
10
|
+
{ countryCode: 'NL', dialCode: '+31', name: 'Netherlands' },
|
|
11
|
+
{ countryCode: 'BE', dialCode: '+32', name: 'Belgium' },
|
|
12
|
+
{ countryCode: 'AT', dialCode: '+43', name: 'Austria' },
|
|
13
|
+
{ countryCode: 'CH', dialCode: '+41', name: 'Switzerland' },
|
|
14
|
+
{ countryCode: 'PL', dialCode: '+48', name: 'Poland' },
|
|
15
|
+
{ countryCode: 'IE', dialCode: '+353', name: 'Ireland' },
|
|
16
|
+
{ countryCode: 'PT', dialCode: '+351', name: 'Portugal' },
|
|
17
|
+
{ countryCode: 'SE', dialCode: '+46', name: 'Sweden' },
|
|
18
|
+
{ countryCode: 'NO', dialCode: '+47', name: 'Norway' },
|
|
19
|
+
{ countryCode: 'DK', dialCode: '+45', name: 'Denmark' },
|
|
20
|
+
{ countryCode: 'FI', dialCode: '+358', name: 'Finland' },
|
|
21
|
+
{ countryCode: 'NZ', dialCode: '+64', name: 'New Zealand' },
|
|
22
|
+
{ countryCode: 'JP', dialCode: '+81', name: 'Japan' },
|
|
23
|
+
{ countryCode: 'CN', dialCode: '+86', name: 'China' },
|
|
24
|
+
{ countryCode: 'IN', dialCode: '+91', name: 'India' },
|
|
25
|
+
{ countryCode: 'BR', dialCode: '+55', name: 'Brazil' },
|
|
26
|
+
{ countryCode: 'MX', dialCode: '+52', name: 'Mexico' },
|
|
27
|
+
{ countryCode: 'ZA', dialCode: '+27', name: 'South Africa' },
|
|
28
|
+
{ countryCode: 'SG', dialCode: '+65', name: 'Singapore' },
|
|
29
|
+
{ countryCode: 'HK', dialCode: '+852', name: 'Hong Kong' },
|
|
30
|
+
{ countryCode: 'KR', dialCode: '+82', name: 'South Korea' },
|
|
31
|
+
];
|
|
32
|
+
export function getCountryByCode(countryCode) {
|
|
33
|
+
return PHONE_COUNTRIES.find((c) => c.countryCode === countryCode);
|
|
34
|
+
}
|
|
35
|
+
export function getCountryByDialCode(dialCode) {
|
|
36
|
+
return PHONE_COUNTRIES.find((c) => c.dialCode === dialCode);
|
|
37
|
+
}
|
|
38
|
+
export function parseE164(value) {
|
|
39
|
+
if (!value || !value.startsWith('+'))
|
|
40
|
+
return null;
|
|
41
|
+
const digits = value.slice(1).replace(/\D/g, '');
|
|
42
|
+
if (!digits.length)
|
|
43
|
+
return null;
|
|
44
|
+
const sorted = [...PHONE_COUNTRIES].sort((a, b) => b.dialCode.replace(/\D/g, '').length - a.dialCode.replace(/\D/g, '').length);
|
|
45
|
+
const matchedCountry = sorted.find((country) => {
|
|
46
|
+
const codeDigits = country.dialCode.slice(1).replace(/\D/g, '');
|
|
47
|
+
return digits.startsWith(codeDigits);
|
|
48
|
+
});
|
|
49
|
+
if (!matchedCountry)
|
|
50
|
+
return null;
|
|
51
|
+
const codeDigits = matchedCountry.dialCode.slice(1).replace(/\D/g, '');
|
|
52
|
+
const nationalNumber = digits.slice(codeDigits.length);
|
|
53
|
+
return { dialCode: matchedCountry.dialCode, nationalNumber };
|
|
54
|
+
}
|
|
55
|
+
export function toE164(dialCode, nationalNumber) {
|
|
56
|
+
const digits = (dialCode.slice(1) + nationalNumber).replace(/\D/g, '');
|
|
57
|
+
return digits.length ? `+${digits}` : '';
|
|
58
|
+
}
|