@usecapsule/core-components 3.2.0-dev.1 → 3.3.0-dev.0
Sign up to get free protection for your applications and to get access to all the features.
- package/css/capsule-core.css +25 -10
- package/css/capsule-core.css.map +1 -1
- package/dist/capsule/capsule.esm.js +1 -1
- package/dist/capsule/capsule.esm.js.map +1 -1
- package/dist/capsule/index.esm.js +1 -1
- package/dist/capsule/index.esm.js.map +1 -1
- package/dist/capsule/{p-a6aaf3f4.entry.js → p-0e558c7f.entry.js} +3 -3
- package/dist/capsule/p-0e558c7f.entry.js.map +1 -0
- package/dist/capsule/{p-452b9998.entry.js → p-1bd11889.entry.js} +2 -2
- package/dist/capsule/p-1bd11889.entry.js.map +1 -0
- package/dist/capsule/p-32cdf894.entry.js +2 -0
- package/dist/capsule/p-32cdf894.entry.js.map +1 -0
- package/dist/capsule/p-3b042fd1.entry.js +2 -0
- package/dist/capsule/{p-6793ef7a.entry.js.map → p-3b042fd1.entry.js.map} +1 -1
- package/dist/capsule/{p-b976b6f0.entry.js → p-41bc3c58.entry.js} +2 -2
- package/dist/capsule/{p-b976b6f0.entry.js.map → p-41bc3c58.entry.js.map} +1 -1
- package/dist/capsule/p-5965b15e.entry.js +2 -0
- package/dist/capsule/{p-f6c74d69.entry.js.map → p-5965b15e.entry.js.map} +1 -1
- package/dist/capsule/{p-447d49b9.entry.js → p-5d62e610.entry.js} +2 -2
- package/dist/capsule/{p-447d49b9.entry.js.map → p-5d62e610.entry.js.map} +1 -1
- package/dist/capsule/p-60508b1e.entry.js +20 -0
- package/dist/capsule/p-60508b1e.entry.js.map +1 -0
- package/dist/capsule/{p-6dcaee48.entry.js → p-de2a16e4.entry.js} +2 -2
- package/dist/capsule/{p-6dcaee48.entry.js.map → p-de2a16e4.entry.js.map} +1 -1
- package/dist/capsule/p-e1255160.js.map +1 -1
- package/dist/capsule/p-f2393be6.js.map +1 -1
- package/dist/capsule/p-fa6b7678.js +3 -0
- package/dist/capsule/p-fa6b7678.js.map +1 -0
- package/dist/cjs/capsule.cjs.js +10 -10
- package/dist/cjs/capsule.cjs.js.map +1 -1
- package/dist/cjs/cpsl-alert_34.cjs.entry.js +17036 -13428
- package/dist/cjs/cpsl-alert_34.cjs.entry.js.map +1 -1
- package/dist/cjs/cpsl-animation.cjs.entry.js +8 -4
- package/dist/cjs/cpsl-animation.cjs.entry.js.map +1 -1
- package/dist/cjs/cpsl-col.cjs.entry.js +25 -6
- package/dist/cjs/cpsl-col.cjs.entry.js.map +1 -1
- package/dist/cjs/cpsl-grid.cjs.entry.js +3 -3
- package/dist/cjs/cpsl-hero.cjs.entry.js +38 -0
- package/dist/cjs/cpsl-hero.cjs.entry.js.map +1 -0
- package/dist/cjs/cpsl-identicon.cjs.entry.js +2 -2
- package/dist/cjs/cpsl-info-box.cjs.entry.js +3 -3
- package/dist/cjs/cpsl-info-box.cjs.entry.js.map +1 -1
- package/dist/cjs/cpsl-modal-v2.cjs.entry.js +3 -2
- package/dist/cjs/cpsl-modal-v2.cjs.entry.js.map +1 -1
- package/dist/cjs/cpsl-row.cjs.entry.js +2 -2
- package/dist/cjs/index-65f57499.js +1439 -0
- package/dist/cjs/index-65f57499.js.map +1 -0
- package/dist/cjs/index.cjs.js +47 -16
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/assets/icons/arrow-circle-broken-down-left.svg +3 -0
- package/dist/collection/assets/icons/bank.svg +3 -0
- package/dist/collection/assets/icons/credit-card.svg +3 -0
- package/dist/collection/assets/icons/dot.svg +3 -0
- package/dist/collection/assets/icons/download.svg +3 -0
- package/dist/collection/assets/icons/globe.svg +3 -0
- package/dist/collection/assets/icons/hero-alert-circle.svg +3 -0
- package/dist/collection/assets/icons/hero-checkmark-capsule.svg +11 -0
- package/dist/collection/assets/icons/hero-checkmark.svg +3 -0
- package/dist/collection/assets/icons/hero-external-connection.svg +71 -0
- package/dist/collection/assets/icons/index.js +21 -3
- package/dist/collection/assets/icons/index.js.map +1 -1
- package/dist/collection/assets/icons/link-external.svg +3 -0
- package/dist/collection/assets/icons/log-out.svg +3 -0
- package/dist/collection/assets/icons/moonpay-brand.svg +10 -0
- package/dist/collection/assets/icons/puzzle-piece.svg +3 -0
- package/dist/collection/assets/icons/qr-code-02.svg +3 -0
- package/dist/collection/assets/icons/qr-code.svg +3 -0
- package/dist/collection/assets/icons/refresh.svg +3 -3
- package/dist/collection/assets/icons/search.svg +3 -0
- package/dist/collection/assets/icons/send.svg +3 -0
- package/dist/collection/assets/icons/shield.svg +3 -0
- package/dist/collection/assets/icons/stripe-brand.svg +3 -0
- package/dist/collection/collection-manifest.json +4 -3
- package/dist/collection/components/cpsl-alert/cpsl-alert.js +3 -3
- package/dist/collection/components/cpsl-alert/cpsl-alert.js.map +1 -1
- package/dist/collection/components/cpsl-animation/cpsl-animation.js +4 -1
- package/dist/collection/components/cpsl-animation/cpsl-animation.js.map +1 -1
- package/dist/collection/components/cpsl-app-bar/cpsl-app-bar.js +5 -2
- package/dist/collection/components/cpsl-app-bar/cpsl-app-bar.js.map +1 -1
- package/dist/collection/components/{cpsl-modal/cpsl-modal.css → cpsl-auth-modal/cpsl-auth-modal.css} +33 -58
- package/dist/collection/components/{cpsl-modal/cpsl-modal.js → cpsl-auth-modal/cpsl-auth-modal.js} +13 -131
- package/dist/collection/components/cpsl-auth-modal/cpsl-auth-modal.js.map +1 -0
- package/dist/collection/components/cpsl-avatar/cpsl-avatar.js +1 -1
- package/dist/collection/components/cpsl-button/cpsl-button.css +89 -2
- package/dist/collection/components/cpsl-button/cpsl-button.js +9 -5
- package/dist/collection/components/cpsl-button/cpsl-button.js.map +1 -1
- package/dist/collection/components/cpsl-button-group/cpsl-button-group.js +2 -2
- package/dist/collection/components/cpsl-button-group/cpsl-button-group.js.map +1 -1
- package/dist/collection/components/cpsl-card/cpsl-card.css +5 -2
- package/dist/collection/components/cpsl-card/cpsl-card.js +1 -1
- package/dist/collection/components/cpsl-checkbox/cpsl-checkbox.js +1 -1
- package/dist/collection/components/cpsl-code-input/cpsl-code-input.css +3 -0
- package/dist/collection/components/cpsl-code-input/cpsl-code-input.js +13 -7
- package/dist/collection/components/cpsl-code-input/cpsl-code-input.js.map +1 -1
- package/dist/collection/components/cpsl-col/cpsl-col.js +21 -5
- package/dist/collection/components/cpsl-col/cpsl-col.js.map +1 -1
- package/dist/collection/components/cpsl-divider/cpsl-divider.css +2 -1
- package/dist/collection/components/cpsl-divider/cpsl-divider.js +1 -1
- package/dist/collection/components/cpsl-drawer/cpsl-drawer.js +3 -2
- package/dist/collection/components/cpsl-drawer/cpsl-drawer.js.map +1 -1
- package/dist/collection/components/cpsl-dropdown/cpsl-dropdown.js +1 -1
- package/dist/collection/components/cpsl-dropdown/cpsl-dropdown.js.map +1 -1
- package/dist/collection/components/cpsl-dropdown/dropdown-interface.js.map +1 -1
- package/dist/collection/components/cpsl-file-upload/cpsl-file-upload.js +5 -5
- package/dist/collection/components/cpsl-file-upload/cpsl-file-upload.js.map +1 -1
- package/dist/collection/components/cpsl-grid/cpsl-grid.js +2 -2
- package/dist/collection/components/cpsl-hero/cpsl-hero.css +136 -71
- package/dist/collection/components/cpsl-hero/cpsl-hero.js +64 -9
- package/dist/collection/components/cpsl-hero/cpsl-hero.js.map +1 -1
- package/dist/collection/components/cpsl-hero/cpsl-hero.stories.js.map +1 -1
- package/dist/collection/components/cpsl-icon/cpsl-icon.css +8 -0
- package/dist/collection/components/cpsl-icon/cpsl-icon.js +2 -2
- package/dist/collection/components/cpsl-icon/cpsl-icon.js.map +1 -1
- package/dist/collection/components/cpsl-icon-group/cpsl-icon-group.css +97 -0
- package/dist/collection/components/cpsl-icon-group/cpsl-icon-group.js +121 -0
- package/dist/collection/components/cpsl-icon-group/cpsl-icon-group.js.map +1 -0
- package/dist/collection/components/cpsl-identicon/cpsl-identicon.js +1 -1
- package/dist/collection/components/cpsl-identicon/cpsl-identicon.stories.js.map +1 -1
- package/dist/collection/components/cpsl-info-box/cpsl-info-box.css +1 -2
- package/dist/collection/components/cpsl-info-box/cpsl-info-box.js +1 -1
- package/dist/collection/components/cpsl-input/cpsl-input.css +21 -2
- package/dist/collection/components/cpsl-input/cpsl-input.js +117 -11
- package/dist/collection/components/cpsl-input/cpsl-input.js.map +1 -1
- package/dist/collection/components/cpsl-modal-v2/cpsl-modal-v2.js +2 -1
- package/dist/collection/components/cpsl-modal-v2/cpsl-modal-v2.js.map +1 -1
- package/dist/collection/components/cpsl-nav-button-group/cpsl-nav-button-group.js +2 -2
- package/dist/collection/components/cpsl-nav-button-group/cpsl-nav-button-group.js.map +1 -1
- package/dist/collection/components/cpsl-overlay/cpsl-overlay.js +2 -1
- package/dist/collection/components/cpsl-overlay/cpsl-overlay.js.map +1 -1
- package/dist/collection/components/cpsl-pagination/cpsl-pagination.js +1 -1
- package/dist/collection/components/cpsl-pagination/cpsl-pagination.js.map +1 -1
- package/dist/collection/components/cpsl-pill/cpsl-pill.js +1 -1
- package/dist/collection/components/cpsl-popover/cpsl-popover.css +2 -0
- package/dist/collection/components/cpsl-popover/cpsl-popover.js +16 -6
- package/dist/collection/components/cpsl-popover/cpsl-popover.js.map +1 -1
- package/dist/collection/components/cpsl-qr-code/cpsl-qr-code.css +12 -3
- package/dist/collection/components/cpsl-qr-code/cpsl-qr-code.js +28 -23
- package/dist/collection/components/cpsl-qr-code/cpsl-qr-code.js.map +1 -1
- package/dist/collection/components/cpsl-radio/cpsl-radio.js +1 -1
- package/dist/collection/components/cpsl-row/cpsl-row.js +1 -1
- package/dist/collection/components/cpsl-select/cpsl-select.css +17 -0
- package/dist/collection/components/cpsl-select/cpsl-select.js +96 -4
- package/dist/collection/components/cpsl-select/cpsl-select.js.map +1 -1
- package/dist/collection/components/cpsl-select-item/cpsl-select-item.js +1 -1
- package/dist/collection/components/cpsl-select-item/cpsl-select-item.js.map +1 -1
- package/dist/collection/components/cpsl-slide-button/cpsl-slide-button.js +14 -3
- package/dist/collection/components/cpsl-slide-button/cpsl-slide-button.js.map +1 -1
- package/dist/collection/components/cpsl-spinner/cpsl-spinner.css +30 -8
- package/dist/collection/components/cpsl-spinner/cpsl-spinner.js +5 -7
- package/dist/collection/components/cpsl-spinner/cpsl-spinner.js.map +1 -1
- package/dist/collection/components/cpsl-switch/cpsl-switch.js +1 -1
- package/dist/collection/components/cpsl-tab/cpsl-tab.css +24 -1
- package/dist/collection/components/cpsl-tab/cpsl-tab.js +1 -1
- package/dist/collection/components/cpsl-tab/cpsl-tab.js.map +1 -1
- package/dist/collection/components/cpsl-table/cpsl-table.js +3 -1
- package/dist/collection/components/cpsl-table/cpsl-table.js.map +1 -1
- package/dist/collection/components/cpsl-tabs/cpsl-tabs.css +1 -4
- package/dist/collection/components/cpsl-tabs/cpsl-tabs.js +5 -2
- package/dist/collection/components/cpsl-tabs/cpsl-tabs.js.map +1 -1
- package/dist/collection/components/cpsl-text/cpsl-text.css +19 -0
- package/dist/collection/components/cpsl-text/cpsl-text.js +7 -3
- package/dist/collection/components/cpsl-text/cpsl-text.js.map +1 -1
- package/dist/collection/components/cpsl-tile-button/cpsl-tile-button.css +3 -1
- package/dist/collection/components/cpsl-tile-button/cpsl-tile-button.js +2 -2
- package/dist/collection/interface.js.map +1 -1
- package/dist/collection/utils/media.js +3 -0
- package/dist/collection/utils/media.js.map +1 -1
- package/dist/collection/utils/theme/generateBorderRadii.js +4 -3
- package/dist/collection/utils/theme/generateBorderRadii.js.map +1 -1
- package/dist/collection/utils/theme/generateFont.js +1 -1
- package/dist/collection/utils/theme/generateFont.js.map +1 -1
- package/dist/collection/utils/theme/generatePalette.js +28 -9
- package/dist/collection/utils/theme/generatePalette.js.map +1 -1
- package/dist/collection/utils/theme/generateTheme.js +13 -3
- package/dist/collection/utils/theme/generateTheme.js.map +1 -1
- package/dist/collection/utils/theme/utils.js +1 -0
- package/dist/collection/utils/theme/utils.js.map +1 -1
- package/dist/esm/capsule.js +11 -11
- package/dist/esm/capsule.js.map +1 -1
- package/dist/esm/cpsl-alert_34.entry.js +17036 -13428
- package/dist/esm/cpsl-alert_34.entry.js.map +1 -1
- package/dist/esm/cpsl-animation.entry.js +7 -3
- package/dist/esm/cpsl-animation.entry.js.map +1 -1
- package/dist/esm/cpsl-col.entry.js +25 -6
- package/dist/esm/cpsl-col.entry.js.map +1 -1
- package/dist/esm/cpsl-grid.entry.js +3 -3
- package/dist/esm/cpsl-hero.entry.js +34 -0
- package/dist/esm/cpsl-hero.entry.js.map +1 -0
- package/dist/esm/cpsl-identicon.entry.js +2 -2
- package/dist/esm/cpsl-info-box.entry.js +3 -3
- package/dist/esm/cpsl-info-box.entry.js.map +1 -1
- package/dist/esm/cpsl-modal-v2.entry.js +3 -2
- package/dist/esm/cpsl-modal-v2.entry.js.map +1 -1
- package/dist/esm/cpsl-row.entry.js +2 -2
- package/dist/esm/index-91db3414.js +1408 -0
- package/dist/esm/index-91db3414.js.map +1 -0
- package/dist/esm/index.js +47 -16
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/loader/cdn.js +1 -3
- package/dist/loader/index.cjs.js +1 -3
- package/dist/loader/index.d.ts +3 -0
- package/dist/loader/index.es2017.js +1 -3
- package/dist/loader/index.js +1 -3
- package/dist/scripts/buildAssets.js +1 -1
- package/dist/types/assets/icons/index.d.ts +20 -2
- package/dist/types/components/cpsl-alert/cpsl-alert.d.ts +8 -0
- package/dist/types/components/cpsl-animation/cpsl-animation.d.ts +6 -0
- package/dist/types/components/cpsl-app-bar/cpsl-app-bar.d.ts +10 -0
- package/dist/types/components/cpsl-auth-modal/cpsl-auth-modal.d.ts +58 -0
- package/dist/types/components/cpsl-avatar/cpsl-avatar.d.ts +11 -0
- package/dist/types/components/cpsl-button/cpsl-button.d.ts +30 -1
- package/dist/types/components/cpsl-button-group/cpsl-button-group.d.ts +3 -0
- package/dist/types/components/cpsl-checkbox/cpsl-checkbox.d.ts +6 -0
- package/dist/types/components/cpsl-code-input/cpsl-code-input.d.ts +19 -0
- package/dist/types/components/cpsl-col/cpsl-col.d.ts +96 -0
- package/dist/types/components/cpsl-drawer/cpsl-drawer.d.ts +31 -0
- package/dist/types/components/cpsl-dropdown/cpsl-dropdown.d.ts +15 -0
- package/dist/types/components/cpsl-dropdown/dropdown-interface.d.ts +1 -1
- package/dist/types/components/cpsl-file-upload/cpsl-file-upload.d.ts +43 -0
- package/dist/types/components/cpsl-grid/cpsl-grid.d.ts +3 -0
- package/dist/types/components/cpsl-hero/cpsl-hero.d.ts +21 -1
- package/dist/types/components/cpsl-icon/cpsl-icon.d.ts +6 -0
- package/dist/types/components/cpsl-icon-group/cpsl-icon-group.d.ts +20 -0
- package/dist/types/components/cpsl-identicon/cpsl-identicon.d.ts +4 -0
- package/dist/types/components/cpsl-input/cpsl-input.d.ts +148 -0
- package/dist/types/components/cpsl-input/input-interface.d.ts +5 -0
- package/dist/types/components/cpsl-modal-v2/cpsl-modal-v2.d.ts +32 -0
- package/dist/types/components/cpsl-nav-button-group/cpsl-nav-button-group.d.ts +3 -0
- package/dist/types/components/cpsl-overlay/cpsl-overlay.d.ts +14 -0
- package/dist/types/components/cpsl-pagination/cpsl-pagination.d.ts +15 -0
- package/dist/types/components/cpsl-pill/cpsl-pill.d.ts +3 -0
- package/dist/types/components/cpsl-popover/cpsl-popover.d.ts +53 -0
- package/dist/types/components/cpsl-progress-indicator/cpsl-progress-indicator.d.ts +6 -0
- package/dist/types/components/cpsl-qr-code/cpsl-qr-code.d.ts +11 -0
- package/dist/types/components/cpsl-radio/cpsl-radio.d.ts +6 -0
- package/dist/types/components/cpsl-select/cpsl-select.d.ts +67 -1
- package/dist/types/components/cpsl-select-item/cpsl-select-item.d.ts +10 -0
- package/dist/types/components/cpsl-slide-button/cpsl-slide-button.d.ts +18 -0
- package/dist/types/components/cpsl-spinner/cpsl-spinner.d.ts +8 -0
- package/dist/types/components/cpsl-switch/cpsl-switch.d.ts +6 -0
- package/dist/types/components/cpsl-tab/cpsl-tab.d.ts +11 -0
- package/dist/types/components/cpsl-tabs/cpsl-tabs.d.ts +13 -0
- package/dist/types/components/cpsl-text/cpsl-text.d.ts +16 -1
- package/dist/types/components/cpsl-tile-button/cpsl-tile-button.d.ts +6 -0
- package/dist/types/components.d.ts +216 -118
- package/dist/types/interface.d.ts +13 -0
- package/dist/types/stencil-public-runtime.d.ts +3 -10
- package/dist/types/utils/theme/generatePalette.d.ts +4 -2
- package/dist/types/utils/theme/generateTheme.d.ts +5 -1
- package/package.json +6 -12
- package/readme.md +47 -2
- package/dist/capsule/p-0462f723.js +0 -2
- package/dist/capsule/p-0462f723.js.map +0 -1
- package/dist/capsule/p-303e6e89.entry.js +0 -29
- package/dist/capsule/p-303e6e89.entry.js.map +0 -1
- package/dist/capsule/p-452b9998.entry.js.map +0 -1
- package/dist/capsule/p-6793ef7a.entry.js +0 -2
- package/dist/capsule/p-7dde3172.js +0 -3
- package/dist/capsule/p-7dde3172.js.map +0 -1
- package/dist/capsule/p-a6aaf3f4.entry.js.map +0 -1
- package/dist/capsule/p-f6c74d69.entry.js +0 -2
- package/dist/cjs/_commonjsHelpers-b3309d7b.js +0 -12
- package/dist/cjs/_commonjsHelpers-b3309d7b.js.map +0 -1
- package/dist/cjs/index-528f7428.js +0 -2107
- package/dist/cjs/index-528f7428.js.map +0 -1
- package/dist/collection/assets/icons/double-arc.svg +0 -13
- package/dist/collection/assets/icons/single-arc.svg +0 -11
- package/dist/collection/components/cpsl-alert/test/cpsl-alert.e2e.js +0 -29
- package/dist/collection/components/cpsl-alert/test/cpsl-alert.e2e.js.map +0 -1
- package/dist/collection/components/cpsl-alert/test/cpsl-alert.spec.js +0 -37
- package/dist/collection/components/cpsl-alert/test/cpsl-alert.spec.js.map +0 -1
- package/dist/collection/components/cpsl-animation/test/cpsl-animation.e2e.js +0 -29
- package/dist/collection/components/cpsl-animation/test/cpsl-animation.e2e.js.map +0 -1
- package/dist/collection/components/cpsl-animation/test/cpsl-animation.spec.js +0 -37
- package/dist/collection/components/cpsl-animation/test/cpsl-animation.spec.js.map +0 -1
- package/dist/collection/components/cpsl-app-bar/test/cpsl-app-bar.e2e.js +0 -29
- package/dist/collection/components/cpsl-app-bar/test/cpsl-app-bar.e2e.js.map +0 -1
- package/dist/collection/components/cpsl-app-bar/test/cpsl-app-bar.spec.js +0 -37
- package/dist/collection/components/cpsl-app-bar/test/cpsl-app-bar.spec.js.map +0 -1
- package/dist/collection/components/cpsl-avatar/test/cpsl-avatar.e2e.js +0 -29
- package/dist/collection/components/cpsl-avatar/test/cpsl-avatar.e2e.js.map +0 -1
- package/dist/collection/components/cpsl-avatar/test/cpsl-avatar.spec.js +0 -37
- package/dist/collection/components/cpsl-avatar/test/cpsl-avatar.spec.js.map +0 -1
- package/dist/collection/components/cpsl-button/test/cpsl-button.e2e.js +0 -29
- package/dist/collection/components/cpsl-button/test/cpsl-button.e2e.js.map +0 -1
- package/dist/collection/components/cpsl-button/test/cpsl-button.spec.js +0 -37
- package/dist/collection/components/cpsl-button/test/cpsl-button.spec.js.map +0 -1
- package/dist/collection/components/cpsl-button-group/test/cpsl-button-group.e2e.js +0 -29
- package/dist/collection/components/cpsl-button-group/test/cpsl-button-group.e2e.js.map +0 -1
- package/dist/collection/components/cpsl-button-group/test/cpsl-button-group.spec.js +0 -37
- package/dist/collection/components/cpsl-button-group/test/cpsl-button-group.spec.js.map +0 -1
- package/dist/collection/components/cpsl-card/test/cpsl-card.e2e.js +0 -29
- package/dist/collection/components/cpsl-card/test/cpsl-card.e2e.js.map +0 -1
- package/dist/collection/components/cpsl-card/test/cpsl-card.spec.js +0 -37
- package/dist/collection/components/cpsl-card/test/cpsl-card.spec.js.map +0 -1
- package/dist/collection/components/cpsl-checkbox/test/cpsl-checkbox.e2e.js +0 -29
- package/dist/collection/components/cpsl-checkbox/test/cpsl-checkbox.e2e.js.map +0 -1
- package/dist/collection/components/cpsl-checkbox/test/cpsl-checkbox.spec.js +0 -37
- package/dist/collection/components/cpsl-checkbox/test/cpsl-checkbox.spec.js.map +0 -1
- package/dist/collection/components/cpsl-code-input/test/cpsl-code-input.e2e.js +0 -29
- package/dist/collection/components/cpsl-code-input/test/cpsl-code-input.e2e.js.map +0 -1
- package/dist/collection/components/cpsl-code-input/test/cpsl-code-input.spec.js +0 -37
- package/dist/collection/components/cpsl-code-input/test/cpsl-code-input.spec.js.map +0 -1
- package/dist/collection/components/cpsl-col/test/cpsl-col.e2e.js +0 -29
- package/dist/collection/components/cpsl-col/test/cpsl-col.e2e.js.map +0 -1
- package/dist/collection/components/cpsl-col/test/cpsl-col.spec.js +0 -37
- package/dist/collection/components/cpsl-col/test/cpsl-col.spec.js.map +0 -1
- package/dist/collection/components/cpsl-divider/test/cpsl-divider.e2e.js +0 -29
- package/dist/collection/components/cpsl-divider/test/cpsl-divider.e2e.js.map +0 -1
- package/dist/collection/components/cpsl-divider/test/cpsl-divider.spec.js +0 -37
- package/dist/collection/components/cpsl-divider/test/cpsl-divider.spec.js.map +0 -1
- package/dist/collection/components/cpsl-drawer/test/cpsl-drawer.e2e.js +0 -29
- package/dist/collection/components/cpsl-drawer/test/cpsl-drawer.e2e.js.map +0 -1
- package/dist/collection/components/cpsl-drawer/test/cpsl-drawer.spec.js +0 -37
- package/dist/collection/components/cpsl-drawer/test/cpsl-drawer.spec.js.map +0 -1
- package/dist/collection/components/cpsl-dropdown/test/cpsl-dropdown.e2e.js +0 -29
- package/dist/collection/components/cpsl-dropdown/test/cpsl-dropdown.e2e.js.map +0 -1
- package/dist/collection/components/cpsl-dropdown/test/cpsl-dropdown.spec.js +0 -37
- package/dist/collection/components/cpsl-dropdown/test/cpsl-dropdown.spec.js.map +0 -1
- package/dist/collection/components/cpsl-file-upload/test/cpsl-file-upload.e2e.js +0 -29
- package/dist/collection/components/cpsl-file-upload/test/cpsl-file-upload.e2e.js.map +0 -1
- package/dist/collection/components/cpsl-file-upload/test/cpsl-file-upload.spec.js +0 -37
- package/dist/collection/components/cpsl-file-upload/test/cpsl-file-upload.spec.js.map +0 -1
- package/dist/collection/components/cpsl-grid/test/cpsl-grid.e2e.js +0 -29
- package/dist/collection/components/cpsl-grid/test/cpsl-grid.e2e.js.map +0 -1
- package/dist/collection/components/cpsl-grid/test/cpsl-grid.spec.js +0 -37
- package/dist/collection/components/cpsl-grid/test/cpsl-grid.spec.js.map +0 -1
- package/dist/collection/components/cpsl-hero/test/cpsl-hero.e2e.js +0 -29
- package/dist/collection/components/cpsl-hero/test/cpsl-hero.e2e.js.map +0 -1
- package/dist/collection/components/cpsl-hero/test/cpsl-hero.spec.js +0 -37
- package/dist/collection/components/cpsl-hero/test/cpsl-hero.spec.js.map +0 -1
- package/dist/collection/components/cpsl-icon/test/cpsl-icon.e2e.js +0 -29
- package/dist/collection/components/cpsl-icon/test/cpsl-icon.e2e.js.map +0 -1
- package/dist/collection/components/cpsl-icon/test/cpsl-icon.spec.js +0 -37
- package/dist/collection/components/cpsl-icon/test/cpsl-icon.spec.js.map +0 -1
- package/dist/collection/components/cpsl-identicon/test/cpsl-identicon.e2e.js +0 -29
- package/dist/collection/components/cpsl-identicon/test/cpsl-identicon.e2e.js.map +0 -1
- package/dist/collection/components/cpsl-identicon/test/cpsl-identicon.spec.js +0 -37
- package/dist/collection/components/cpsl-identicon/test/cpsl-identicon.spec.js.map +0 -1
- package/dist/collection/components/cpsl-info-box/test/cpsl-info-box.e2e.js +0 -29
- package/dist/collection/components/cpsl-info-box/test/cpsl-info-box.e2e.js.map +0 -1
- package/dist/collection/components/cpsl-info-box/test/cpsl-info-box.spec.js +0 -37
- package/dist/collection/components/cpsl-info-box/test/cpsl-info-box.spec.js.map +0 -1
- package/dist/collection/components/cpsl-input/test/cpsl-input.e2e.js +0 -29
- package/dist/collection/components/cpsl-input/test/cpsl-input.e2e.js.map +0 -1
- package/dist/collection/components/cpsl-input/test/cpsl-input.spec.js +0 -37
- package/dist/collection/components/cpsl-input/test/cpsl-input.spec.js.map +0 -1
- package/dist/collection/components/cpsl-modal/cpsl-modal.js.map +0 -1
- package/dist/collection/components/cpsl-modal/test/cpsl-modal.e2e.js +0 -29
- package/dist/collection/components/cpsl-modal/test/cpsl-modal.e2e.js.map +0 -1
- package/dist/collection/components/cpsl-modal/test/cpsl-modal.spec.js +0 -37
- package/dist/collection/components/cpsl-modal/test/cpsl-modal.spec.js.map +0 -1
- package/dist/collection/components/cpsl-modal-v2/test/cpsl-modal-v2.e2e.js +0 -29
- package/dist/collection/components/cpsl-modal-v2/test/cpsl-modal-v2.e2e.js.map +0 -1
- package/dist/collection/components/cpsl-modal-v2/test/cpsl-modal-v2.spec.js +0 -37
- package/dist/collection/components/cpsl-modal-v2/test/cpsl-modal-v2.spec.js.map +0 -1
- package/dist/collection/components/cpsl-nav-button-group/test/cpsl-nav-button-group.e2e.js +0 -29
- package/dist/collection/components/cpsl-nav-button-group/test/cpsl-nav-button-group.e2e.js.map +0 -1
- package/dist/collection/components/cpsl-nav-button-group/test/cpsl-nav-button-group.spec.js +0 -37
- package/dist/collection/components/cpsl-nav-button-group/test/cpsl-nav-button-group.spec.js.map +0 -1
- package/dist/collection/components/cpsl-overlay/test/cpsl-overlay.e2e.js +0 -29
- package/dist/collection/components/cpsl-overlay/test/cpsl-overlay.e2e.js.map +0 -1
- package/dist/collection/components/cpsl-overlay/test/cpsl-overlay.spec.js +0 -37
- package/dist/collection/components/cpsl-overlay/test/cpsl-overlay.spec.js.map +0 -1
- package/dist/collection/components/cpsl-pagination/test/cpsl-pagination.e2e.js +0 -29
- package/dist/collection/components/cpsl-pagination/test/cpsl-pagination.e2e.js.map +0 -1
- package/dist/collection/components/cpsl-pagination/test/cpsl-pagination.spec.js +0 -37
- package/dist/collection/components/cpsl-pagination/test/cpsl-pagination.spec.js.map +0 -1
- package/dist/collection/components/cpsl-pill/test/cpsl-pill.e2e.js +0 -29
- package/dist/collection/components/cpsl-pill/test/cpsl-pill.e2e.js.map +0 -1
- package/dist/collection/components/cpsl-pill/test/cpsl-pill.spec.js +0 -37
- package/dist/collection/components/cpsl-pill/test/cpsl-pill.spec.js.map +0 -1
- package/dist/collection/components/cpsl-popover/test/cpsl-popover.e2e.js +0 -29
- package/dist/collection/components/cpsl-popover/test/cpsl-popover.e2e.js.map +0 -1
- package/dist/collection/components/cpsl-popover/test/cpsl-popover.spec.js +0 -37
- package/dist/collection/components/cpsl-popover/test/cpsl-popover.spec.js.map +0 -1
- package/dist/collection/components/cpsl-progress-indicator/test/cpsl-progress-indicator.e2e.js +0 -29
- package/dist/collection/components/cpsl-progress-indicator/test/cpsl-progress-indicator.e2e.js.map +0 -1
- package/dist/collection/components/cpsl-progress-indicator/test/cpsl-progress-indicator.spec.js +0 -37
- package/dist/collection/components/cpsl-progress-indicator/test/cpsl-progress-indicator.spec.js.map +0 -1
- package/dist/collection/components/cpsl-qr-code/test/cpsl-qr-code.e2e.js +0 -29
- package/dist/collection/components/cpsl-qr-code/test/cpsl-qr-code.e2e.js.map +0 -1
- package/dist/collection/components/cpsl-qr-code/test/cpsl-qr-code.spec.js +0 -37
- package/dist/collection/components/cpsl-qr-code/test/cpsl-qr-code.spec.js.map +0 -1
- package/dist/collection/components/cpsl-radio/test/cpsl-radio.e2e.js +0 -29
- package/dist/collection/components/cpsl-radio/test/cpsl-radio.e2e.js.map +0 -1
- package/dist/collection/components/cpsl-radio/test/cpsl-radio.spec.js +0 -37
- package/dist/collection/components/cpsl-radio/test/cpsl-radio.spec.js.map +0 -1
- package/dist/collection/components/cpsl-row/test/cpsl-row.e2e.js +0 -29
- package/dist/collection/components/cpsl-row/test/cpsl-row.e2e.js.map +0 -1
- package/dist/collection/components/cpsl-row/test/cpsl-row.spec.js +0 -37
- package/dist/collection/components/cpsl-row/test/cpsl-row.spec.js.map +0 -1
- package/dist/collection/components/cpsl-select/test/cpsl-select.e2e.js +0 -29
- package/dist/collection/components/cpsl-select/test/cpsl-select.e2e.js.map +0 -1
- package/dist/collection/components/cpsl-select/test/cpsl-select.spec.js +0 -37
- package/dist/collection/components/cpsl-select/test/cpsl-select.spec.js.map +0 -1
- package/dist/collection/components/cpsl-select-item/test/cpsl-select-item.e2e.js +0 -29
- package/dist/collection/components/cpsl-select-item/test/cpsl-select-item.e2e.js.map +0 -1
- package/dist/collection/components/cpsl-select-item/test/cpsl-select-item.spec.js +0 -37
- package/dist/collection/components/cpsl-select-item/test/cpsl-select-item.spec.js.map +0 -1
- package/dist/collection/components/cpsl-slide-button/test/cpsl-slide-button.e2e.js +0 -29
- package/dist/collection/components/cpsl-slide-button/test/cpsl-slide-button.e2e.js.map +0 -1
- package/dist/collection/components/cpsl-slide-button/test/cpsl-slide-button.spec.js +0 -37
- package/dist/collection/components/cpsl-slide-button/test/cpsl-slide-button.spec.js.map +0 -1
- package/dist/collection/components/cpsl-spinner/test/cpsl-spinner.e2e.js +0 -29
- package/dist/collection/components/cpsl-spinner/test/cpsl-spinner.e2e.js.map +0 -1
- package/dist/collection/components/cpsl-spinner/test/cpsl-spinner.spec.js +0 -37
- package/dist/collection/components/cpsl-spinner/test/cpsl-spinner.spec.js.map +0 -1
- package/dist/collection/components/cpsl-switch/test/cpsl-switch.e2e.js +0 -29
- package/dist/collection/components/cpsl-switch/test/cpsl-switch.e2e.js.map +0 -1
- package/dist/collection/components/cpsl-switch/test/cpsl-switch.spec.js +0 -37
- package/dist/collection/components/cpsl-switch/test/cpsl-switch.spec.js.map +0 -1
- package/dist/collection/components/cpsl-tab/test/cpsl-tab.e2e.js +0 -29
- package/dist/collection/components/cpsl-tab/test/cpsl-tab.e2e.js.map +0 -1
- package/dist/collection/components/cpsl-tab/test/cpsl-tab.spec.js +0 -37
- package/dist/collection/components/cpsl-tab/test/cpsl-tab.spec.js.map +0 -1
- package/dist/collection/components/cpsl-table/test/cpsl-table.e2e.js +0 -29
- package/dist/collection/components/cpsl-table/test/cpsl-table.e2e.js.map +0 -1
- package/dist/collection/components/cpsl-table/test/cpsl-table.spec.js +0 -37
- package/dist/collection/components/cpsl-table/test/cpsl-table.spec.js.map +0 -1
- package/dist/collection/components/cpsl-tabs/test/cpsl-tabs.e2e.js +0 -29
- package/dist/collection/components/cpsl-tabs/test/cpsl-tabs.e2e.js.map +0 -1
- package/dist/collection/components/cpsl-tabs/test/cpsl-tabs.spec.js +0 -37
- package/dist/collection/components/cpsl-tabs/test/cpsl-tabs.spec.js.map +0 -1
- package/dist/collection/components/cpsl-text/test/cpsl-text.e2e.js +0 -29
- package/dist/collection/components/cpsl-text/test/cpsl-text.e2e.js.map +0 -1
- package/dist/collection/components/cpsl-text/test/cpsl-text.spec.js +0 -37
- package/dist/collection/components/cpsl-text/test/cpsl-text.spec.js.map +0 -1
- package/dist/collection/components/cpsl-tile-button/test/cpsl-tile-button.e2e.js +0 -29
- package/dist/collection/components/cpsl-tile-button/test/cpsl-tile-button.e2e.js.map +0 -1
- package/dist/collection/components/cpsl-tile-button/test/cpsl-tile-button.spec.js +0 -37
- package/dist/collection/components/cpsl-tile-button/test/cpsl-tile-button.spec.js.map +0 -1
- package/dist/esm/_commonjsHelpers-1789f0cf.js +0 -9
- package/dist/esm/_commonjsHelpers-1789f0cf.js.map +0 -1
- package/dist/esm/index-b188f201.js +0 -2076
- package/dist/esm/index-b188f201.js.map +0 -1
- package/dist/esm/polyfills/core-js.js +0 -11
- 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/types/components/cpsl-modal/cpsl-modal.d.ts +0 -39
- /package/dist/types/Users/{briancorbin/Documents/Programming/Capsule/component-library/core → norwood/capsule-repos/web-sdk/packages/core-components}/.stencil/scripts/buildAssets.d.ts +0 -0
@@ -0,0 +1,121 @@
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
2
|
+
import { Icons } from "../../assets/icons";
|
3
|
+
function isOfTypeIconType(key) {
|
4
|
+
return Object.keys(Icons).includes(key);
|
5
|
+
}
|
6
|
+
export class CpslIconGroup {
|
7
|
+
constructor() {
|
8
|
+
this.isHovered = undefined;
|
9
|
+
this.expandFrom = 'right';
|
10
|
+
this.disabled = false;
|
11
|
+
this.icons = undefined;
|
12
|
+
}
|
13
|
+
componentDidLoad() {
|
14
|
+
this.el.addEventListener('mouseover', () => {
|
15
|
+
this.isHovered = true;
|
16
|
+
});
|
17
|
+
this.el.addEventListener('mouseout', () => {
|
18
|
+
this.isHovered = false;
|
19
|
+
});
|
20
|
+
}
|
21
|
+
disconnectedCallback() {
|
22
|
+
this.el.removeEventListener('mouseover', () => {
|
23
|
+
this.isHovered = true;
|
24
|
+
});
|
25
|
+
this.el.removeEventListener('mouseout', () => {
|
26
|
+
this.isHovered = false;
|
27
|
+
});
|
28
|
+
}
|
29
|
+
render() {
|
30
|
+
// If disabled remove all brand icons to ensure the disabled color is shown correctly
|
31
|
+
const icons = this.disabled ? this.icons.map(icon => icon.replace('Brand', '')) : this.icons;
|
32
|
+
return (h(Host, { key: '4c81ff12c46582623d226e8a7f3078ff279bc8ae' }, icons.map((icon, index) => {
|
33
|
+
const isIcon = isOfTypeIconType(icon);
|
34
|
+
return (h("span", { part: "icon-container", class: {
|
35
|
+
'icon-container': true,
|
36
|
+
'expanded': !this.disabled && this.isHovered && (this.expandFrom === 'right' ? index !== this.icons.length - 1 : index === 0),
|
37
|
+
'disabled': this.disabled,
|
38
|
+
}, style: { zIndex: `${this.icons.length - index}` } }, h("cpsl-icon", { key: icon, icon: isIcon ? icon : undefined, src: !isIcon ? icon : undefined })));
|
39
|
+
})));
|
40
|
+
}
|
41
|
+
static get is() { return "cpsl-icon-group"; }
|
42
|
+
static get encapsulation() { return "shadow"; }
|
43
|
+
static get originalStyleUrls() {
|
44
|
+
return {
|
45
|
+
"$": ["cpsl-icon-group.scss"]
|
46
|
+
};
|
47
|
+
}
|
48
|
+
static get styleUrls() {
|
49
|
+
return {
|
50
|
+
"$": ["cpsl-icon-group.css"]
|
51
|
+
};
|
52
|
+
}
|
53
|
+
static get properties() {
|
54
|
+
return {
|
55
|
+
"expandFrom": {
|
56
|
+
"type": "string",
|
57
|
+
"mutable": false,
|
58
|
+
"complexType": {
|
59
|
+
"original": "'left' | 'right'",
|
60
|
+
"resolved": "\"left\" | \"right\"",
|
61
|
+
"references": {}
|
62
|
+
},
|
63
|
+
"required": false,
|
64
|
+
"optional": false,
|
65
|
+
"docs": {
|
66
|
+
"tags": [],
|
67
|
+
"text": "The direction the icons should expand from"
|
68
|
+
},
|
69
|
+
"attribute": "expand-from",
|
70
|
+
"reflect": false,
|
71
|
+
"defaultValue": "'right'"
|
72
|
+
},
|
73
|
+
"disabled": {
|
74
|
+
"type": "boolean",
|
75
|
+
"mutable": false,
|
76
|
+
"complexType": {
|
77
|
+
"original": "boolean",
|
78
|
+
"resolved": "boolean",
|
79
|
+
"references": {}
|
80
|
+
},
|
81
|
+
"required": false,
|
82
|
+
"optional": false,
|
83
|
+
"docs": {
|
84
|
+
"tags": [],
|
85
|
+
"text": "If `true`, the user cannot interact with the input."
|
86
|
+
},
|
87
|
+
"attribute": "disabled",
|
88
|
+
"reflect": false,
|
89
|
+
"defaultValue": "false"
|
90
|
+
},
|
91
|
+
"icons": {
|
92
|
+
"type": "unknown",
|
93
|
+
"mutable": false,
|
94
|
+
"complexType": {
|
95
|
+
"original": "(IconType | string)[]",
|
96
|
+
"resolved": "string[]",
|
97
|
+
"references": {
|
98
|
+
"IconType": {
|
99
|
+
"location": "import",
|
100
|
+
"path": "../../interface",
|
101
|
+
"id": "src/interface.ts::IconType"
|
102
|
+
}
|
103
|
+
}
|
104
|
+
},
|
105
|
+
"required": false,
|
106
|
+
"optional": false,
|
107
|
+
"docs": {
|
108
|
+
"tags": [],
|
109
|
+
"text": "The name of the icons to display."
|
110
|
+
}
|
111
|
+
}
|
112
|
+
};
|
113
|
+
}
|
114
|
+
static get states() {
|
115
|
+
return {
|
116
|
+
"isHovered": {}
|
117
|
+
};
|
118
|
+
}
|
119
|
+
static get elementRef() { return "el"; }
|
120
|
+
}
|
121
|
+
//# sourceMappingURL=cpsl-icon-group.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"cpsl-icon-group.js","sourceRoot":"","sources":["../../../../src/components/cpsl-icon-group/cpsl-icon-group.tsx"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AAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;YACzB,MAAM,MAAM,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;YAEtC,OAAO,CACL,YACE,IAAI,EAAC,gBAAgB,EACrB,KAAK,EAAE;oBACL,gBAAgB,EAAE,IAAI;oBACtB,UAAU,EAAE,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,UAAU,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC;oBAC7H,UAAU,EAAE,IAAI,CAAC,QAAQ;iBAC1B,EACD,KAAK,EAAE,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,EAAE,EAAE;gBAEjD,iBAAW,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,GAAI,CACrF,CACR,CAAC;QACJ,CAAC,CAAC,CACG,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h, Element, State } from '@stencil/core';\nimport { IconType } from '../../interface';\nimport { Icons } from '../../assets/icons';\n\nfunction isOfTypeIconType(key: string): key is IconType {\n return Object.keys(Icons).includes(key);\n}\n\n@Component({\n tag: 'cpsl-icon-group',\n styleUrl: 'cpsl-icon-group.scss',\n shadow: true,\n})\nexport class CpslIconGroup {\n @Element() el!: HTMLCpslIconGroupElement;\n\n @State() isHovered: boolean;\n\n /**\n * The direction the icons should expand from\n */\n @Prop() expandFrom: 'left' | 'right' = 'right';\n\n /**\n * If `true`, the user cannot interact with the input.\n */\n @Prop() disabled = false;\n\n /**\n * The name of the icons to display.\n */\n @Prop() icons: (IconType | string)[];\n\n componentDidLoad() {\n this.el.addEventListener('mouseover', () => {\n this.isHovered = true;\n });\n this.el.addEventListener('mouseout', () => {\n this.isHovered = false;\n });\n }\n\n disconnectedCallback() {\n this.el.removeEventListener('mouseover', () => {\n this.isHovered = true;\n });\n this.el.removeEventListener('mouseout', () => {\n this.isHovered = false;\n });\n }\n\n render() {\n // If disabled remove all brand icons to ensure the disabled color is shown correctly\n const icons = this.disabled ? this.icons.map(icon => icon.replace('Brand', '')) : this.icons;\n\n return (\n <Host>\n {icons.map((icon, index) => {\n const isIcon = isOfTypeIconType(icon);\n\n return (\n <span\n part=\"icon-container\"\n class={{\n 'icon-container': true,\n 'expanded': !this.disabled && this.isHovered && (this.expandFrom === 'right' ? index !== this.icons.length - 1 : index === 0),\n 'disabled': this.disabled,\n }}\n style={{ zIndex: `${this.icons.length - index}` }}\n >\n <cpsl-icon key={icon} icon={isIcon ? icon : undefined} src={!isIcon ? icon : undefined} />\n </span>\n );\n })}\n </Host>\n );\n }\n}\n"]}
|
@@ -28,7 +28,7 @@ export class CpslIdenticon {
|
|
28
28
|
[shapeA, shapeB, shapeC, shapeD],
|
29
29
|
[rotationA, rotationB, rotationC, rotationD],
|
30
30
|
];
|
31
|
-
return (h(Host, { key: '
|
31
|
+
return (h(Host, { key: '39bcae00e3fd58ff94639fbb43c77fd942899e51', class: {
|
32
32
|
red: color === 'red',
|
33
33
|
orange: color === 'orange',
|
34
34
|
yellow: color === 'yellow',
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"cpsl-identicon.stories.js","sourceRoot":"","sources":["../../../../src/components/cpsl-identicon/cpsl-identicon.stories.
|
1
|
+
{"version":3,"file":"cpsl-identicon.stories.js","sourceRoot":"","sources":["../../../../src/components/cpsl-identicon/cpsl-identicon.stories.tsx"],"names":[],"mappings":"AAGA,MAAM,IAAI,GAA+C;IACvD,KAAK,EAAE,0BAA0B;IACjC,IAAI,EAAE,EAAE,IAAI,EAAE,wCAAwC,EAAE,IAAI,EAAE,EAAE,EAAE;IAClE,QAAQ,EAAE;QACR,IAAI,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;QACzB,IAAI,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;KAC5B;CACF,CAAC;AAEF,eAAe,IAAI,CAAC;AAIpB,MAAM,QAAQ,GAAU,IAAI,CAAC,EAAE,CAAC,wBAAwB,IAAI,CAAC,IAAI,IAAI,CAAC;AAEtE,MAAM,CAAC,MAAM,OAAO,GAAU,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC","sourcesContent":["import type { Meta, StoryFn } from '@storybook/html';\nimport { type CpslIdenticon } from './cpsl-identicon';\n\nconst meta: Meta<CpslIdenticon & { content?: string }> = {\n title: 'Components/CpslIdenticon',\n args: { hash: 'wruvbwic8932nc4u3cr9394n3cibj3892438cr', size: 40 },\n argTypes: {\n hash: { control: 'text' },\n size: { control: 'number' },\n },\n};\n\nexport default meta;\n\ntype Story = StoryFn<CpslIdenticon & { content?: string }>;\n\nconst Template: Story = args => `<cpsl-identicon hash=${args.hash}/>`;\n\nexport const Primary: Story = Template.bind({});\n"]}
|
@@ -71,7 +71,6 @@
|
|
71
71
|
padding-top: var(--box-padding-top);
|
72
72
|
padding-bottom: var(--box-padding-bottom);
|
73
73
|
display: flex;
|
74
|
-
background: var(--cpsl-color-background-
|
75
|
-
border: var(--box-border-width) solid var(--cpsl-color-input-border-placeholder);
|
74
|
+
background: var(--cpsl-color-background-4);
|
76
75
|
border-radius: var(--box-border-radius);
|
77
76
|
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
2
2
|
export class CpslInfoBox {
|
3
3
|
render() {
|
4
|
-
return (h(Host, { key: '
|
4
|
+
return (h(Host, { key: '363605fc58be1a71b771e4d839654c6198fb9988' }, h("div", { key: '7b56cdfbb5db9ee33d906a9235ffd89fce06962f', class: "info-box-container" }, h("slot", { key: '868bc4bdb1f1817d2f918a7c5a1c50582c4545f7' }))));
|
5
5
|
}
|
6
6
|
static get is() { return "cpsl-info-box"; }
|
7
7
|
static get encapsulation() { return "shadow"; }
|
@@ -73,6 +73,7 @@
|
|
73
73
|
--input-color: var(--cpsl-color-text-primary);
|
74
74
|
--input-placeholder-color: var(--cpsl-color-text-secondary);
|
75
75
|
--input-font-size: var(--cpsl-font-size-body-m);
|
76
|
+
--input-font-weight: 400;
|
76
77
|
--optional-label-color: var(--cpsl-color-text-secondary);
|
77
78
|
--label-color: var(--cpsl-color-text-primary);
|
78
79
|
--label-font-size: var(--cpsl-font-size-body-s);
|
@@ -84,13 +85,17 @@
|
|
84
85
|
--helper-text-icon-size: 16px;
|
85
86
|
--helper-text-font-size: var(--cpsl-font-size-body-xs);
|
86
87
|
--helper-text-margin-top: 0px;
|
87
|
-
--button-padding:
|
88
|
+
--button-padding: 8px;
|
88
89
|
display: flex;
|
89
90
|
flex-direction: column;
|
90
91
|
gap: 4px;
|
91
92
|
font-family: var(--cpsl-font-family, inherit);
|
92
93
|
}
|
93
94
|
|
95
|
+
:host(.contrast-text) {
|
96
|
+
--input-color: var(--cpsl-color-contrast);
|
97
|
+
}
|
98
|
+
|
94
99
|
:host(:not(.has-value)) {
|
95
100
|
--container-border-color: var(--cpsl-color-input-border-placeholder);
|
96
101
|
--input-color: var(--cpsl-color-text-secondary);
|
@@ -140,6 +145,7 @@
|
|
140
145
|
height: 100%;
|
141
146
|
box-sizing: border-box;
|
142
147
|
font-size: var(--input-font-size);
|
148
|
+
font-weight: var(--input-font-weight);
|
143
149
|
color: var(--input-color);
|
144
150
|
background: var(--input-background-color);
|
145
151
|
font-family: var(--cpsl-font-family, inherit);
|
@@ -151,6 +157,15 @@
|
|
151
157
|
color: var(--input-placeholder-color);
|
152
158
|
opacity: 1; /* Firefox */
|
153
159
|
}
|
160
|
+
.native-input::-moz-selection {
|
161
|
+
/* Code for Firefox */
|
162
|
+
color: var(--cpsl-color-text-inverted);
|
163
|
+
background: var(--cpsl-color-background-64);
|
164
|
+
}
|
165
|
+
.native-input::selection {
|
166
|
+
color: var(--cpsl-color-text-inverted);
|
167
|
+
background: var(--cpsl-color-background-64);
|
168
|
+
}
|
154
169
|
|
155
170
|
.label {
|
156
171
|
display: inline-block;
|
@@ -201,7 +216,11 @@
|
|
201
216
|
:host ::slotted(cpsl-button) {
|
202
217
|
width: calc(var(--container-height) - var(--button-padding) * 2);
|
203
218
|
height: calc(var(--container-height) - var(--button-padding) * 2);
|
204
|
-
--button-border-radius: calc(var(--container-border-radius) -
|
219
|
+
--button-border-radius: calc(var(--container-border-radius) - 4px);
|
220
|
+
--button-padding-top: 4px;
|
221
|
+
--button-padding-start: 4px;
|
222
|
+
--button-padding-end: 4px;
|
223
|
+
--button-padding-bottom: 4px;
|
205
224
|
}
|
206
225
|
:host slot[name=end]::slotted(cpsl-button) {
|
207
226
|
margin-right: calc((var(--container-padding-end) - var(--button-padding)) * -1);
|
@@ -1,11 +1,15 @@
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
2
|
+
import IMask from "imask/esm/imask";
|
3
|
+
import "imask/esm/masked/pattern";
|
2
4
|
export class CpslInput {
|
3
5
|
constructor() {
|
4
6
|
this.inputId = `cpsl-input-${inputIds++}`;
|
5
7
|
this.onInput = (ev) => {
|
8
|
+
var _a, _b, _c;
|
6
9
|
const input = ev.target;
|
10
|
+
(_a = this.maskedInput) === null || _a === void 0 ? void 0 : _a._onInput(ev);
|
7
11
|
if (Boolean(input)) {
|
8
|
-
this.value = input.value || '';
|
12
|
+
this.value = (_c = (_b = this.maskedInput) === null || _b === void 0 ? void 0 : _b.unmaskedValue) !== null && _c !== void 0 ? _c : (input.value || '');
|
9
13
|
input.value === '' ? this.disableSlots() : this.enableSlots();
|
10
14
|
}
|
11
15
|
this.emitInputChange(ev);
|
@@ -16,6 +20,10 @@ export class CpslInput {
|
|
16
20
|
this.onBlur = (ev) => {
|
17
21
|
this.hasFocus = false;
|
18
22
|
if (this.focusedValue !== this.value) {
|
23
|
+
/**
|
24
|
+
* Emits the `cpslChange` event when the input value
|
25
|
+
* is different than the value when the input was focused.
|
26
|
+
*/
|
19
27
|
this.emitValueChange(ev);
|
20
28
|
}
|
21
29
|
this.cpslBlur.emit(ev);
|
@@ -26,29 +34,40 @@ export class CpslInput {
|
|
26
34
|
this.cpslFocus.emit(ev);
|
27
35
|
};
|
28
36
|
this.onPaste = (ev) => {
|
29
|
-
var _a;
|
37
|
+
var _a, _b, _c, _d;
|
30
38
|
ev.stopPropagation();
|
31
39
|
ev.preventDefault();
|
32
40
|
const input = ev.target;
|
33
41
|
const pasteData = ((_a = ev.clipboardData) === null || _a === void 0 ? void 0 : _a.getData('text')) || '';
|
34
|
-
|
35
|
-
|
36
|
-
|
42
|
+
// Manually set the value & cursor position
|
43
|
+
const initialSelectionStart = input.selectionStart;
|
44
|
+
const newVal = `${input.value.slice(0, input.selectionStart)}${pasteData}${input.value.slice(input.selectionEnd, input.value.length)}`;
|
45
|
+
input.value = newVal;
|
46
|
+
// this.value = newVal;
|
47
|
+
input.selectionEnd = initialSelectionStart + pasteData.length;
|
48
|
+
(_b = this.maskedInput) === null || _b === void 0 ? void 0 : _b._onInput(Object.assign(Object.assign({}, ev), { target: input }));
|
49
|
+
this.value = (_d = (_c = this.maskedInput) === null || _c === void 0 ? void 0 : _c.unmaskedValue) !== null && _d !== void 0 ? _d : (input.value || '');
|
50
|
+
this.value === '' ? this.disableSlots() : this.enableSlots();
|
51
|
+
// Emit the cpslPaste event
|
37
52
|
this.cpslPaste.emit(ev);
|
53
|
+
// Emit the cpslChange event since the value was modified by paste
|
38
54
|
this.emitInputChange(ev);
|
39
55
|
};
|
40
56
|
this.focusInput = () => {
|
41
57
|
this.nativeInput.focus();
|
42
58
|
};
|
43
59
|
this.hasFocus = false;
|
60
|
+
this.maskedInput = undefined;
|
44
61
|
this.autocapitalize = 'off';
|
45
62
|
this.autocomplete = 'off';
|
46
63
|
this.autocorrect = 'off';
|
47
64
|
this.noAutoDisable = undefined;
|
48
65
|
this.autofocus = false;
|
49
66
|
this.disabled = false;
|
67
|
+
this.contrastText = false;
|
50
68
|
this.enterkeyhint = undefined;
|
51
69
|
this.errorText = undefined;
|
70
|
+
this.mask = undefined;
|
52
71
|
this.helperText = undefined;
|
53
72
|
this.inputmode = undefined;
|
54
73
|
this.label = undefined;
|
@@ -78,14 +97,48 @@ export class CpslInput {
|
|
78
97
|
this.enableSlots();
|
79
98
|
}
|
80
99
|
}
|
100
|
+
handleSetupMask() {
|
101
|
+
var _a, _b;
|
102
|
+
if (this.nativeInput) {
|
103
|
+
if (this.mask) {
|
104
|
+
if (this.maskedInput) {
|
105
|
+
this.maskedInput.updateOptions({
|
106
|
+
mask: this.mask,
|
107
|
+
});
|
108
|
+
}
|
109
|
+
else {
|
110
|
+
this.maskedInput = IMask(this.nativeInput, {
|
111
|
+
mask: this.mask,
|
112
|
+
definitions: {
|
113
|
+
// <any single char>: <same type as mask (RegExp, Function, etc.)>
|
114
|
+
// defaults are '0', 'a', '*'
|
115
|
+
'#': /[\d]/,
|
116
|
+
},
|
117
|
+
});
|
118
|
+
}
|
119
|
+
}
|
120
|
+
else {
|
121
|
+
(_a = this.maskedInput) === null || _a === void 0 ? void 0 : _a.destroy();
|
122
|
+
this.nativeInput.value = (_b = this.value) !== null && _b !== void 0 ? _b : '';
|
123
|
+
this.maskedInput = undefined;
|
124
|
+
}
|
125
|
+
}
|
126
|
+
}
|
127
|
+
handleValueChange() {
|
128
|
+
var _a;
|
129
|
+
if (!this.value) {
|
130
|
+
this.nativeInput.value = (_a = this.value) !== null && _a !== void 0 ? _a : '';
|
131
|
+
}
|
132
|
+
}
|
81
133
|
componentDidLoad() {
|
82
134
|
this.initButtons();
|
83
|
-
if (
|
135
|
+
if (this.value) {
|
84
136
|
this.enableSlots();
|
85
137
|
}
|
86
138
|
else {
|
87
139
|
this.disableSlots();
|
88
140
|
}
|
141
|
+
this.handleSetupMask();
|
89
142
|
}
|
90
143
|
disableSlots() {
|
91
144
|
var _a, _b;
|
@@ -114,12 +167,23 @@ export class CpslInput {
|
|
114
167
|
});
|
115
168
|
}
|
116
169
|
}
|
170
|
+
/**
|
171
|
+
* Emits a `cpslInput` event.
|
172
|
+
*/
|
117
173
|
emitInputChange(event) {
|
118
|
-
this.cpslInput.emit({ value: this.
|
174
|
+
this.cpslInput.emit({ value: this.value || '', event });
|
119
175
|
}
|
176
|
+
/**
|
177
|
+
* Emits a `cpslChange` event.
|
178
|
+
*
|
179
|
+
* This API should be called for user committed changes.
|
180
|
+
* This API should not be used for external value changes.
|
181
|
+
*/
|
120
182
|
emitValueChange(event) {
|
121
183
|
const { value } = this;
|
184
|
+
// Checks for both null and undefined values
|
122
185
|
const newValue = value == null ? value : value.toString();
|
186
|
+
// Emitting a value change should update the internal state for tracking the focused value
|
123
187
|
this.focusedValue = newValue;
|
124
188
|
this.cpslChange.emit({ value: newValue, event });
|
125
189
|
}
|
@@ -130,8 +194,8 @@ export class CpslInput {
|
|
130
194
|
return this.el.querySelector('[slot="end"]');
|
131
195
|
}
|
132
196
|
render() {
|
133
|
-
var _a;
|
134
|
-
return (h(Host, { key: '
|
197
|
+
var _a, _b;
|
198
|
+
return (h(Host, { key: '1eb8d3755e662a13cbbaf75b700631a6d6934004', class: { 'disabled': this.disabled, 'focused': this.hasFocus, 'has-value': Boolean(this.focusedValue) || Boolean(this.value), 'contrast-text': this.contrastText } }, this.label && (h("label", { key: '0560cd807a98a1723cfd95631305329e8ed6a8d1', class: "label", htmlFor: this.inputId }, this.label, this.required ? '*' : ' ', !this.required && this.showOptionalLabel ? h("span", { class: "optional-label" }, "(optional)") : '')), h("div", { key: 'd6d9a3afdea3aa69d448b8272a083a6f670421a7', class: { 'input-container': true, 'error-container': Boolean(this.errorText) } }, h("slot", { key: '28d274d72a481970b92e41cd3c31574f7f9c7069', name: "start" }), h("input", { key: '4d2ebafbff1b4a33e2c5f384e8adacab0f6a80ce', class: "native-input", part: "native-input", ref: input => (this.nativeInput = input), id: this.inputId, disabled: this.disabled, autoCapitalize: this.autocapitalize, autoComplete: this.autocomplete, autoCorrect: this.autocorrect, autoFocus: this.autofocus, enterKeyHint: this.enterkeyhint, inputMode: this.inputmode, min: this.min, max: this.max, minLength: this.minlength, maxLength: this.maxlength, multiple: this.multiple, name: this.name, pattern: this.pattern, placeholder: this.placeholder || '', readOnly: this.readonly, required: this.required, spellcheck: this.spellcheck, type: this.type, defaultValue: (_a = this.value) !== null && _a !== void 0 ? _a : '', onInput: this.onInput, onChange: this.onChange, onFocus: this.onFocus, onBlur: this.onBlur, onClick: this.focusInput, onPaste: this.onPaste }), h("slot", { key: 'd06db621a70b4f4c031c2d5c9bbe554d9212b625', name: "end" })), (this.errorText || this.helperText) && (h("div", { key: '4c92057fe59e91475c7398e1957f070b63e9e941', class: { 'helper-text-container': true, 'error-text': Boolean(this.errorText) } }, h("span", { key: 'cab25a4fbb41aa4a5837cc78cfd193184a0a138b' }, (_b = this.errorText) !== null && _b !== void 0 ? _b : this.helperText)))));
|
135
199
|
}
|
136
200
|
static get is() { return "cpsl-input"; }
|
137
201
|
static get encapsulation() { return "shadow"; }
|
@@ -260,6 +324,24 @@ export class CpslInput {
|
|
260
324
|
"reflect": false,
|
261
325
|
"defaultValue": "false"
|
262
326
|
},
|
327
|
+
"contrastText": {
|
328
|
+
"type": "boolean",
|
329
|
+
"mutable": false,
|
330
|
+
"complexType": {
|
331
|
+
"original": "boolean",
|
332
|
+
"resolved": "boolean",
|
333
|
+
"references": {}
|
334
|
+
},
|
335
|
+
"required": false,
|
336
|
+
"optional": false,
|
337
|
+
"docs": {
|
338
|
+
"tags": [],
|
339
|
+
"text": "If `true`, the input primary color will use the contrast value, not the primary text value."
|
340
|
+
},
|
341
|
+
"attribute": "contrast-text",
|
342
|
+
"reflect": false,
|
343
|
+
"defaultValue": "false"
|
344
|
+
},
|
263
345
|
"enterkeyhint": {
|
264
346
|
"type": "string",
|
265
347
|
"mutable": false,
|
@@ -294,6 +376,23 @@ export class CpslInput {
|
|
294
376
|
"attribute": "error-text",
|
295
377
|
"reflect": false
|
296
378
|
},
|
379
|
+
"mask": {
|
380
|
+
"type": "string",
|
381
|
+
"mutable": false,
|
382
|
+
"complexType": {
|
383
|
+
"original": "string",
|
384
|
+
"resolved": "string",
|
385
|
+
"references": {}
|
386
|
+
},
|
387
|
+
"required": false,
|
388
|
+
"optional": true,
|
389
|
+
"docs": {
|
390
|
+
"tags": [],
|
391
|
+
"text": "Mask string to apply to the input."
|
392
|
+
},
|
393
|
+
"attribute": "mask",
|
394
|
+
"reflect": false
|
395
|
+
},
|
297
396
|
"helperText": {
|
298
397
|
"type": "string",
|
299
398
|
"mutable": false,
|
@@ -576,7 +675,7 @@ export class CpslInput {
|
|
576
675
|
"mutable": false,
|
577
676
|
"complexType": {
|
578
677
|
"original": "IconType",
|
579
|
-
"resolved": "\"alertCircle\" | \"angelListBrand\" | \"angelList\" | \"appleBrand\" | \"apple\" | \"arrowNarrow\" | \"arrow\" | \"backupKit\" | \"brush\" | \"capsuleLogo\" | \"capsuleRingsDark\" | \"capsuleRings\" | \"capsule\" | \"checkCircle\" | \"check\" | \"chevronUp\" | \"clock\" | \"close\" | \"clubhouseBrand\" | \"clubhouse\" | \"copy\" | \"cube\" | \"decentBrand\" | \"decent\" | \"discordBrand\" | \"discord\" | \"
|
678
|
+
"resolved": "\"search\" | \"alertCircle\" | \"angelListBrand\" | \"angelList\" | \"appleBrand\" | \"apple\" | \"arrowCircleBrokenDownLeft\" | \"arrowNarrow\" | \"arrow\" | \"backupKit\" | \"bank\" | \"brush\" | \"capsuleLogo\" | \"capsuleRingsDark\" | \"capsuleRings\" | \"capsule\" | \"checkCircle\" | \"check\" | \"chevronUp\" | \"clock\" | \"close\" | \"clubhouseBrand\" | \"clubhouse\" | \"copy\" | \"creditCard\" | \"cube\" | \"decentBrand\" | \"decent\" | \"discordBrand\" | \"discord\" | \"dot\" | \"downloadCloud\" | \"download\" | \"dribbbleBrand\" | \"dribbble\" | \"earth\" | \"eyeOff\" | \"eye\" | \"facebookBrand\" | \"facebook\" | \"farcasterBrand\" | \"farcaster\" | \"figmaBrand\" | \"figma\" | \"file\" | \"githubBrand\" | \"github\" | \"globe\" | \"googleBrand\" | \"google\" | \"helpCircle\" | \"heroAlertCircle\" | \"heroCheckmarkCapsule\" | \"heroCheckmark\" | \"heroEmail\" | \"heroExternalConnection\" | \"heroLock\" | \"heroPasskey\" | \"heroPhone\" | \"heroWallet\" | \"home\" | \"image\" | \"infoCircle\" | \"instagramBrand\" | \"instagram\" | \"key\" | \"lightning01\" | \"lightning\" | \"linkExternal\" | \"linkedinBrand\" | \"linkedin\" | \"logOut\" | \"mail\" | \"menu\" | \"moonpayBrand\" | \"moreLoginOptions\" | \"phone\" | \"pintrestBrand\" | \"pintrest\" | \"plusCircle\" | \"puzzlePiece\" | \"qrCode02\" | \"qrCode\" | \"rampNetworkBrand\" | \"rampNetwork\" | \"redditBrand\" | \"reddit\" | \"refresh\" | \"send\" | \"settings\" | \"shield\" | \"signalBrand\" | \"signal\" | \"snapchatBrand\" | \"snapchat\" | \"stars\" | \"stripeBrand\" | \"telegramBrand\" | \"telegram\" | \"tikTokBrand\" | \"tikTok\" | \"tumblrBrand\" | \"tumblr\" | \"twitterBrand\" | \"twitter\" | \"wallet\" | \"x\" | \"youtubeBrand\" | \"youtube\" | \"AD\" | \"AE\" | \"AF\" | \"AG\" | \"AI\" | \"AL\" | \"AM\" | \"AO\" | \"AR\" | \"AS\" | \"AT\" | \"AU\" | \"AW\" | \"AX\" | \"AZ\" | \"BA\" | \"BB\" | \"BD\" | \"BE\" | \"BF\" | \"BG\" | \"BH\" | \"BI\" | \"BJ\" | \"BL\" | \"BM\" | \"BN\" | \"BO\" | \"BQ\" | \"BQ2\" | \"BQ3\" | \"BR\" | \"BS\" | \"BT\" | \"BW\" | \"BY\" | \"BZ\" | \"CA\" | \"CC\" | \"CD\" | \"CD2\" | \"CF\" | \"CH\" | \"CK\" | \"CL\" | \"CM\" | \"CN\" | \"CO\" | \"CR\" | \"CU\" | \"CW\" | \"CX\" | \"CY\" | \"CZ\" | \"DE\" | \"DJ\" | \"DK\" | \"DM\" | \"DO\" | \"DS\" | \"DZ\" | \"EC\" | \"EE\" | \"EG\" | \"EH\" | \"ER\" | \"ES\" | \"ET\" | \"FI\" | \"FJ\" | \"FK\" | \"FM\" | \"FO\" | \"FR\" | \"GA\" | \"GB2\" | \"GB\" | \"GD\" | \"GE\" | \"GG\" | \"GH\" | \"GI\" | \"GL\" | \"GM\" | \"GN\" | \"GQ\" | \"GR\" | \"GT\" | \"GU\" | \"GW\" | \"GY\" | \"HK\" | \"HN\" | \"HR\" | \"HT\" | \"HU\" | \"ID\" | \"IE\" | \"IL\" | \"IM\" | \"IN\" | \"IO\" | \"IQ\" | \"IR\" | \"IS\" | \"IT\" | \"JE\" | \"JM\" | \"JO\" | \"JP\" | \"KE\" | \"KG\" | \"KH\" | \"KI\" | \"KM\" | \"KN\" | \"KP\" | \"KR\" | \"KW\" | \"KY\" | \"KZ\" | \"LA\" | \"LB\" | \"LC\" | \"LI\" | \"LK\" | \"LR\" | \"LS\" | \"LT\" | \"LU\" | \"LV\" | \"LY\" | \"MA\" | \"MC\" | \"MD\" | \"ME\" | \"MG\" | \"MH\" | \"MK\" | \"ML\" | \"MM\" | \"MN\" | \"MO\" | \"MP\" | \"MQ\" | \"MR\" | \"MS\" | \"MT\" | \"MU\" | \"MV\" | \"MW\" | \"MX\" | \"MY\" | \"MZ\" | \"NA\" | \"NE\" | \"NF\" | \"NG\" | \"NI\" | \"NL\" | \"NO\" | \"NP\" | \"NR\" | \"NU\" | \"NZ\" | \"OM\" | \"PA\" | \"PE\" | \"PF\" | \"PG\" | \"PH\" | \"PK\" | \"PL\" | \"PN\" | \"PR\" | \"PS\" | \"PT\" | \"PW\" | \"PY\" | \"QA\" | \"RO\" | \"RS\" | \"RU\" | \"RW\" | \"SA\" | \"SB\" | \"SC\" | \"SE\" | \"SG\" | \"SI\" | \"SK\" | \"SL\" | \"SM\" | \"SN\" | \"SO\" | \"SR\" | \"SS\" | \"ST\" | \"SV\" | \"SX\" | \"SY\" | \"SZ\" | \"TC\" | \"TD\" | \"TG\" | \"TH\" | \"TJ\" | \"TK\" | \"TL\" | \"TM\" | \"TN\" | \"TO\" | \"TR\" | \"TT\" | \"TV\" | \"TW\" | \"TZ\" | \"UA\" | \"UG\" | \"US\" | \"UY\" | \"UZ\" | \"VC\" | \"VE\" | \"VG\" | \"VI\" | \"VN\" | \"VU\" | \"WS\" | \"YE\" | \"ZA\" | \"ZM\" | \"ZW\"",
|
580
679
|
"references": {
|
581
680
|
"IconType": {
|
582
681
|
"location": "import",
|
@@ -656,7 +755,8 @@ export class CpslInput {
|
|
656
755
|
}
|
657
756
|
static get states() {
|
658
757
|
return {
|
659
|
-
"hasFocus": {}
|
758
|
+
"hasFocus": {},
|
759
|
+
"maskedInput": {}
|
660
760
|
};
|
661
761
|
}
|
662
762
|
static get events() {
|
@@ -769,6 +869,12 @@ export class CpslInput {
|
|
769
869
|
return [{
|
770
870
|
"propName": "disabled",
|
771
871
|
"methodName": "handleDisable"
|
872
|
+
}, {
|
873
|
+
"propName": "mask",
|
874
|
+
"methodName": "handleSetupMask"
|
875
|
+
}, {
|
876
|
+
"propName": "value",
|
877
|
+
"methodName": "handleValueChange"
|
772
878
|
}];
|
773
879
|
}
|
774
880
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"cpsl-input.js","sourceRoot":"","sources":["../../../../src/components/cpsl-input/cpsl-input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAgB,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AASrG,MAAM,OAAO,SAAS;;QAIZ,YAAO,GAAG,cAAc,QAAQ,EAAE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AE,IAAI,EAAE,YAAY,EAAE,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE;gBAClF,gBAAO,MAAA,IAAI,CAAC,SAAS,mCAAI,IAAI,CAAC,UAAU,CAAQ,CAC5C,CACP,CACI,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF;AAED,IAAI,QAAQ,GAAG,CAAC,CAAC","sourcesContent":["import { Component, Host, Prop, h, Event, EventEmitter, State, Element, Watch } from '@stencil/core';\nimport { AutocompleteTypes, IconType, TextFieldTypes } from '../../interface';\nimport { InputChangeEventDetail, InputInputEventDetail } from './input-interface';\n\n@Component({\n tag: 'cpsl-input',\n styleUrl: 'cpsl-input.scss',\n shadow: true,\n})\nexport class CpslInput {\n private nativeInput?: HTMLInputElement;\n @Element() el!: HTMLCpslInputElement;\n\n private inputId = `cpsl-input-${inputIds++}`;\n /**\n * The value of the input when the input is focused.\n */\n private focusedValue?: string | number | null;\n\n @State() hasFocus = false;\n\n /**\n * Indicates whether and how the text value should be automatically capitalized as it is entered/edited by the user.\n * Available options: `\"off\"`, `\"none\"`, `\"on\"`, `\"sentences\"`, `\"words\"`, `\"characters\"`.\n */\n // eslint-disable-next-line @stencil-community/reserved-member-names\n @Prop() autocapitalize = 'off';\n\n /**\n * Indicates whether the value of the control can be automatically completed by the browser.\n */\n @Prop() autocomplete: AutocompleteTypes = 'off';\n\n /**\n * Whether auto correction should be enabled when the user is entering/editing the text value.\n */\n @Prop() autocorrect: 'on' | 'off' = 'off';\n\n /**\n * Whether to disable auto disabling of the slotted components.\n */\n @Prop() noAutoDisable: boolean;\n\n /**\n * Sets the [`autofocus` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus) on the native input element.\n *\n * This may not be sufficient for the element to be focused on page load.\n */\n // eslint-disable-next-line @stencil-community/reserved-member-names\n @Prop() autofocus = false;\n\n /**\n * If `true`, the user cannot interact with the input.\n */\n @Prop() disabled = false;\n\n /**\n * A hint to the browser for which enter key to display.\n * Possible values: `\"enter\"`, `\"done\"`, `\"go\"`, `\"next\"`,\n * `\"previous\"`, `\"search\"`, and `\"send\"`.\n */\n // eslint-disable-next-line @stencil-community/reserved-member-names\n @Prop() enterkeyhint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';\n\n /**\n * Error text to show below the input. If this is provided the input will enter an error state.\n */\n @Prop() errorText?: string;\n\n /**\n * Helper text to show below the input. If `\"errorText\"` is provided that will take precedence.\n */\n @Prop() helperText?: string;\n\n /**\n * A hint to the browser for which keyboard to display.\n * Possible values: `\"none\"`, `\"text\"`, `\"tel\"`, `\"url\"`,\n * `\"email\"`, `\"numeric\"`, `\"decimal\"`, and `\"search\"`.\n */\n // eslint-disable-next-line @stencil-community/reserved-member-names\n @Prop() inputmode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';\n\n /**\n * The label for the input.\n */\n @Prop() label?: string;\n\n /**\n * The maximum value, which must not be less than its minimum (min attribute) value.\n */\n @Prop() max?: string | number;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the maximum number of characters that the user can enter.\n */\n @Prop() maxlength?: number;\n\n /**\n * The minimum value, which must not be greater than its maximum (max attribute) value.\n */\n @Prop() min?: string | number;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the minimum number of characters that the user can enter.\n */\n @Prop() minlength?: number;\n\n /**\n * If `true`, the user can enter more than one value. This attribute applies when the type attribute is set to `\"email\"`, otherwise it is ignored.\n */\n @Prop() multiple?: boolean;\n\n /**\n * The name of the control, which is submitted with the form data.\n */\n @Prop() name: string = this.inputId;\n\n /**\n * A regular expression that the value is checked against. The pattern must match the entire value, not just some subset. Use the title attribute to describe the pattern to help the user. This attribute applies when the value of the type attribute is `\"text\"`, `\"search\"`, `\"tel\"`, `\"url\"`, `\"email\"`, `\"date\"`, or `\"password\"`, otherwise it is ignored. When the type attribute is `\"date\"`, `pattern` will only be used in browsers that do not support the `\"date\"` input type natively. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date for more information.\n */\n @Prop() pattern?: string;\n\n /**\n * Instructional text that shows before the input has a value.\n * This property applies only when the `type` property is set to `\"email\"`,\n * `\"number\"`, `\"password\"`, `\"search\"`, `\"tel\"`, `\"text\"`, or `\"url\"`, otherwise it is ignored.\n */\n @Prop() placeholder?: string;\n\n /**\n * If `true`, the user cannot modify the value.\n */\n @Prop() readonly = false;\n\n /**\n * If `true`, the user must fill in a value before submitting a form.\n */\n @Prop() required = false;\n\n /**\n * If `true`, the label will display an \"optional\" tag.\n */\n @Prop() showOptionalLabel = false;\n\n /**\n * If `true`, the element will have its spelling and grammar checked.\n */\n // eslint-disable-next-line @stencil-community/reserved-member-names\n @Prop() spellcheck = false;\n\n /**\n * The external source of the icon at the start of the input. If both `startIcon` and `startIconSrc` are provided, `startIcon` will be used.\n */\n @Prop() startIconSrc?: string;\n\n /**\n * The name of the icon at the start of the input. If both `startIcon` and `startIconSrc` are provided, `startIcon` will be used.\n */\n @Prop() startIcon?: IconType;\n\n /**\n * Works with the min and max attributes to limit the increments at which a value can be set.\n * Possible values are: `\"any\"` or a positive floating point number.\n */\n @Prop() step?: string;\n\n /**\n * The type of control to display. The default type is `text`.\n */\n @Prop() type: TextFieldTypes = 'text';\n\n /**\n * The value of the controlled input.\n */\n @Prop({ mutable: true }) value?: string;\n\n /**\n * The `cpslInput` event is fired each time the user modifies the input's value.\n * Unlike the `cpslChange` event, the `cpslInput` event is fired for each alteration\n * to the input's value. This typically happens for each keystroke as the user types.\n *\n * For elements that accept text input (`type=text`, `type=tel`, etc.), the interface\n * is [`InputEvent`](https://developer.mozilla.org/en-US/docs/Web/API/InputEvent); for others,\n * the interface is [`Event`](https://developer.mozilla.org/en-US/docs/Web/API/Event). If\n * the input is cleared on edit, the type is `null`.\n */\n @Event() cpslInput!: EventEmitter<InputInputEventDetail>;\n\n /**\n * The `cpslChange` event is fired when the user modifies the input's value.\n * Unlike the `cpslInput` event, the `cpslChange` event is only fired when changes\n * are committed, not as the user types.\n *\n * Depending on the way the users interacts with the element, the `cpslChange`\n * event fires at a different moment:\n * - When the element loses focus after its value has changed: for elements\n * where the user's interaction is typing.\n */\n @Event() cpslChange!: EventEmitter<InputChangeEventDetail>;\n\n /**\n * Emitted when the input loses focus.\n */\n @Event() cpslBlur!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the input has focus.\n */\n @Event() cpslFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when something has been paste into the input.\n */\n @Event() cpslPaste!: EventEmitter<ClipboardEvent>;\n\n @Watch('disabled')\n handleDisable() {\n if (this.disabled) {\n this.disableSlots();\n } else {\n this.enableSlots();\n }\n }\n\n /**\n * Update the native input element when the value changes\n */\n // @Watch('value')\n // protected valueChanged() {\n // const nativeInput = this.nativeInput;\n // const value = this.value;\n // if (nativeInput && nativeInput.value !== value) {\n // nativeInput.value = value;\n // }\n // Boolean(value) ? this.disableSlots() : this.enableSlots();\n // }\n\n componentDidLoad() {\n this.initButtons();\n if (Boolean(this.value)) {\n this.enableSlots();\n } else {\n this.disableSlots();\n }\n }\n\n private disableSlots() {\n if (!this.noAutoDisable) {\n this.endEl?.setAttribute('disabled', 'true');\n this.startEl?.setAttribute('disabled', 'true');\n }\n }\n\n private enableSlots() {\n this.endEl?.setAttribute('disabled', 'false');\n this.startEl?.setAttribute('disabled', 'false');\n }\n\n private initButtons() {\n if (this.endEl?.tagName === 'CPSL-BUTTON') {\n this.endEl.setAttribute('full-width', 'true');\n this.endEl.addEventListener('mousedown', e => {\n e.preventDefault();\n });\n }\n if (this.startEl?.tagName === 'CPSL-BUTTON') {\n this.startEl.setAttribute('full-width', 'true');\n this.startEl.addEventListener('mousedown', e => {\n e.preventDefault();\n });\n }\n }\n\n /**\n * Emits a `cpslInput` event.\n */\n private emitInputChange(event?: Event) {\n this.cpslInput.emit({ value: this.nativeInput.value, event });\n }\n\n /**\n * Emits a `cpslChange` event.\n *\n * This API should be called for user committed changes.\n * This API should not be used for external value changes.\n */\n private emitValueChange(event?: Event) {\n const { value } = this;\n // Checks for both null and undefined values\n const newValue = value == null ? value : value.toString();\n // Emitting a value change should update the internal state for tracking the focused value\n this.focusedValue = newValue;\n this.cpslChange.emit({ value: newValue, event });\n }\n\n private onInput = (ev: InputEvent) => {\n const input = ev.target as HTMLInputElement | null;\n if (Boolean(input)) {\n this.value = input.value || '';\n input.value === '' ? this.disableSlots() : this.enableSlots();\n }\n\n this.emitInputChange(ev);\n };\n\n private onChange = (ev: Event) => {\n this.emitValueChange(ev);\n };\n\n private onBlur = (ev: FocusEvent) => {\n this.hasFocus = false;\n\n if (this.focusedValue !== this.value) {\n /**\n * Emits the `cpslChange` event when the input value\n * is different than the value when the input was focused.\n */\n this.emitValueChange(ev);\n }\n\n this.cpslBlur.emit(ev);\n };\n\n private onFocus = (ev: FocusEvent) => {\n this.hasFocus = true;\n this.focusedValue = this.value;\n\n this.cpslFocus.emit(ev);\n };\n\n private onPaste = (ev: ClipboardEvent) => {\n ev.stopPropagation();\n ev.preventDefault();\n\n const input = ev.target as HTMLInputElement;\n const pasteData = ev.clipboardData?.getData('text') || '';\n\n // Manually set the value\n input.value = input.value + pasteData;\n this.value = this.value + pasteData;\n pasteData === '' ? this.disableSlots() : this.enableSlots();\n\n // Emit the cpslPaste event\n this.cpslPaste.emit(ev);\n\n // Emit the cpslChange event since the value was modified by paste\n this.emitInputChange(ev);\n };\n\n private focusInput = () => {\n this.nativeInput.focus();\n };\n\n private get startEl() {\n return this.el.querySelector('[slot=\"start\"]');\n }\n\n private get endEl() {\n return this.el.querySelector('[slot=\"end\"]');\n }\n\n render() {\n return (\n <Host class={{ 'disabled': this.disabled, 'focused': this.hasFocus, 'has-value': Boolean(this.focusedValue) || Boolean(this.value) }}>\n {this.label && (\n <label class=\"label\" htmlFor={this.inputId}>\n {this.label}\n {this.required ? '*' : ' '}\n {!this.required && this.showOptionalLabel ? <span class=\"optional-label\">(optional)</span> : ''}\n </label>\n )}\n <div class={{ 'input-container': true, 'error-container': Boolean(this.errorText) }}>\n <slot name=\"start\"></slot>\n <input\n class=\"native-input\"\n ref={input => (this.nativeInput = input)}\n id={this.inputId}\n disabled={this.disabled}\n autoCapitalize={this.autocapitalize}\n autoComplete={this.autocomplete}\n autoCorrect={this.autocorrect}\n autoFocus={this.autofocus}\n enterKeyHint={this.enterkeyhint}\n inputMode={this.inputmode}\n min={this.min}\n max={this.max}\n minLength={this.minlength}\n maxLength={this.maxlength}\n multiple={this.multiple}\n name={this.name}\n pattern={this.pattern}\n placeholder={this.placeholder || ''}\n readOnly={this.readonly}\n required={this.required}\n spellcheck={this.spellcheck}\n type={this.type}\n value={this.value}\n onInput={this.onInput}\n onChange={this.onChange}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n onClick={this.focusInput}\n onPaste={this.onPaste}\n />\n <slot name=\"end\"></slot>\n </div>\n {(this.errorText || this.helperText) && (\n <div class={{ 'helper-text-container': true, 'error-text': Boolean(this.errorText) }}>\n <span>{this.errorText ?? this.helperText}</span>\n </div>\n )}\n </Host>\n );\n }\n}\n\nlet inputIds = 0;\n"]}
|
1
|
+
{"version":3,"file":"cpsl-input.js","sourceRoot":"","sources":["../../../../src/components/cpsl-input/cpsl-input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAgB,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAGrG,OAAO,KAAK,MAAM,iBAAiB,CAAC;AAEpC,OAAO,0BAA0B,CAAC;AAOlC,MAAM,OAAO,SAAS;;QAIZ,YAAO,GAAG,cAAc,QAAQ,EAAE,EAAE,CAAC;QA2TrC,YAAO,GAAG,CAAC,EAAc,EAAE,EAAE;;YACnC,MAAM,KAAK,GAAG,EAAE,CAAC,MAAiC,CAAC;YAEnD,MAAA,IAAI,CAAC,WAAW,0CAAE,QAAQ,CAAC,EAAE,CAAC,CAAC;YAE/B,IAAI,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;gBACnB,IAAI,CAAC,KAAK,GAAG,MAAA,MAAA,IAAI,CAAC,WAAW,0CAAE,aAAa,mCAAI,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;gBACpE,KAAK,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YAChE,CAAC;YAED,IAAI,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;QAC3B,CAAC,CAAC;QAEM,aAAQ,GAAG,CAAC,EAAS,EAAE,EAAE;YAC/B,IAAI,CAAC,eAAe,CAAC,EA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,SAAS,mCAAI,IAAI,CAAC,UAAU,CAAQ,CAC5C,CACP,CACI,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF;AAED,IAAI,QAAQ,GAAG,CAAC,CAAC","sourcesContent":["import { Component, Host, Prop, h, Event, EventEmitter, State, Element, Watch } from '@stencil/core';\nimport { AutocompleteTypes, IconType, TextFieldTypes } from '../../interface';\nimport { InputChangeEventDetail, InputInputEventDetail } from './input-interface';\nimport IMask from 'imask/esm/imask';\nimport InputMask from 'imask/esm/controls/input';\nimport 'imask/esm/masked/pattern';\n\n@Component({\n tag: 'cpsl-input',\n styleUrl: 'cpsl-input.scss',\n shadow: true,\n})\nexport class CpslInput {\n private nativeInput?: HTMLInputElement;\n @Element() el!: HTMLCpslInputElement;\n\n private inputId = `cpsl-input-${inputIds++}`;\n /**\n * The value of the input when the input is focused.\n */\n private focusedValue?: string | number | null;\n\n @State() hasFocus = false;\n @State() maskedInput?: InputMask;\n\n /**\n * Indicates whether and how the text value should be automatically capitalized as it is entered/edited by the user.\n * Available options: `\"off\"`, `\"none\"`, `\"on\"`, `\"sentences\"`, `\"words\"`, `\"characters\"`.\n */\n\n @Prop() autocapitalize = 'off';\n\n /**\n * Indicates whether the value of the control can be automatically completed by the browser.\n */\n @Prop() autocomplete: AutocompleteTypes = 'off';\n\n /**\n * Whether auto correction should be enabled when the user is entering/editing the text value.\n */\n @Prop() autocorrect: 'on' | 'off' = 'off';\n\n /**\n * Whether to disable auto disabling of the slotted components.\n */\n @Prop() noAutoDisable: boolean;\n\n /**\n * Sets the [`autofocus` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus) on the native input element.\n *\n * This may not be sufficient for the element to be focused on page load.\n */\n\n @Prop() autofocus = false;\n\n /**\n * If `true`, the user cannot interact with the input.\n */\n @Prop() disabled = false;\n\n /**\n * If `true`, the input primary color will use the contrast value, not the primary text value.\n */\n @Prop() contrastText = false;\n\n /**\n * A hint to the browser for which enter key to display.\n * Possible values: `\"enter\"`, `\"done\"`, `\"go\"`, `\"next\"`,\n * `\"previous\"`, `\"search\"`, and `\"send\"`.\n */\n\n @Prop() enterkeyhint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';\n\n /**\n * Error text to show below the input. If this is provided the input will enter an error state.\n */\n @Prop() errorText?: string;\n\n /**\n * Mask string to apply to the input.\n */\n @Prop() mask?: string;\n\n /**\n * Helper text to show below the input. If `\"errorText\"` is provided that will take precedence.\n */\n @Prop() helperText?: string;\n\n /**\n * A hint to the browser for which keyboard to display.\n * Possible values: `\"none\"`, `\"text\"`, `\"tel\"`, `\"url\"`,\n * `\"email\"`, `\"numeric\"`, `\"decimal\"`, and `\"search\"`.\n */\n\n @Prop() inputmode?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';\n\n /**\n * The label for the input.\n */\n @Prop() label?: string;\n\n /**\n * The maximum value, which must not be less than its minimum (min attribute) value.\n */\n @Prop() max?: string | number;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the maximum number of characters that the user can enter.\n */\n @Prop() maxlength?: number;\n\n /**\n * The minimum value, which must not be greater than its maximum (max attribute) value.\n */\n @Prop() min?: string | number;\n\n /**\n * If the value of the type attribute is `text`, `email`, `search`, `password`, `tel`, or `url`, this attribute specifies the minimum number of characters that the user can enter.\n */\n @Prop() minlength?: number;\n\n /**\n * If `true`, the user can enter more than one value. This attribute applies when the type attribute is set to `\"email\"`, otherwise it is ignored.\n */\n @Prop() multiple?: boolean;\n\n /**\n * The name of the control, which is submitted with the form data.\n */\n @Prop() name: string = this.inputId;\n\n /**\n * A regular expression that the value is checked against. The pattern must match the entire value, not just some subset. Use the title attribute to describe the pattern to help the user. This attribute applies when the value of the type attribute is `\"text\"`, `\"search\"`, `\"tel\"`, `\"url\"`, `\"email\"`, `\"date\"`, or `\"password\"`, otherwise it is ignored. When the type attribute is `\"date\"`, `pattern` will only be used in browsers that do not support the `\"date\"` input type natively. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date for more information.\n */\n @Prop() pattern?: string;\n\n /**\n * Instructional text that shows before the input has a value.\n * This property applies only when the `type` property is set to `\"email\"`,\n * `\"number\"`, `\"password\"`, `\"search\"`, `\"tel\"`, `\"text\"`, or `\"url\"`, otherwise it is ignored.\n */\n @Prop() placeholder?: string;\n\n /**\n * If `true`, the user cannot modify the value.\n */\n @Prop() readonly = false;\n\n /**\n * If `true`, the user must fill in a value before submitting a form.\n */\n @Prop() required = false;\n\n /**\n * If `true`, the label will display an \"optional\" tag.\n */\n @Prop() showOptionalLabel = false;\n\n /**\n * If `true`, the element will have its spelling and grammar checked.\n */\n\n @Prop() spellcheck = false;\n\n /**\n * The external source of the icon at the start of the input. If both `startIcon` and `startIconSrc` are provided, `startIcon` will be used.\n */\n @Prop() startIconSrc?: string;\n\n /**\n * The name of the icon at the start of the input. If both `startIcon` and `startIconSrc` are provided, `startIcon` will be used.\n */\n @Prop() startIcon?: IconType;\n\n /**\n * Works with the min and max attributes to limit the increments at which a value can be set.\n * Possible values are: `\"any\"` or a positive floating point number.\n */\n @Prop() step?: string;\n\n /**\n * The type of control to display. The default type is `text`.\n */\n @Prop() type: TextFieldTypes = 'text';\n\n /**\n * The value of the controlled input.\n */\n @Prop({ mutable: true }) value?: string;\n\n /**\n * The `cpslInput` event is fired each time the user modifies the input's value.\n * Unlike the `cpslChange` event, the `cpslInput` event is fired for each alteration\n * to the input's value. This typically happens for each keystroke as the user types.\n *\n * For elements that accept text input (`type=text`, `type=tel`, etc.), the interface\n * is [`InputEvent`](https://developer.mozilla.org/en-US/docs/Web/API/InputEvent); for others,\n * the interface is [`Event`](https://developer.mozilla.org/en-US/docs/Web/API/Event). If\n * the input is cleared on edit, the type is `null`.\n */\n @Event() cpslInput!: EventEmitter<InputInputEventDetail>;\n\n /**\n * The `cpslChange` event is fired when the user modifies the input's value.\n * Unlike the `cpslInput` event, the `cpslChange` event is only fired when changes\n * are committed, not as the user types.\n *\n * Depending on the way the users interacts with the element, the `cpslChange`\n * event fires at a different moment:\n * - When the element loses focus after its value has changed: for elements\n * where the user's interaction is typing.\n */\n @Event() cpslChange!: EventEmitter<InputChangeEventDetail>;\n\n /**\n * Emitted when the input loses focus.\n */\n @Event() cpslBlur!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when the input has focus.\n */\n @Event() cpslFocus!: EventEmitter<FocusEvent>;\n\n /**\n * Emitted when something has been paste into the input.\n */\n @Event() cpslPaste!: EventEmitter<ClipboardEvent>;\n\n @Watch('disabled')\n handleDisable() {\n if (this.disabled) {\n this.disableSlots();\n } else {\n this.enableSlots();\n }\n }\n\n @Watch('mask')\n handleSetupMask() {\n if (this.nativeInput) {\n if (this.mask) {\n if (this.maskedInput) {\n this.maskedInput.updateOptions({\n mask: this.mask as any,\n });\n } else {\n this.maskedInput = IMask(this.nativeInput, {\n mask: this.mask,\n definitions: {\n // <any single char>: <same type as mask (RegExp, Function, etc.)>\n // defaults are '0', 'a', '*'\n '#': /[\\d]/,\n },\n });\n }\n } else {\n this.maskedInput?.destroy();\n this.nativeInput.value = this.value ?? '';\n this.maskedInput = undefined;\n }\n }\n }\n\n @Watch('value')\n handleValueChange() {\n if (!this.value) {\n this.nativeInput.value = this.value ?? '';\n }\n }\n\n componentDidLoad() {\n this.initButtons();\n if (this.value) {\n this.enableSlots();\n } else {\n this.disableSlots();\n }\n\n this.handleSetupMask();\n }\n\n private disableSlots() {\n if (!this.noAutoDisable) {\n this.endEl?.setAttribute('disabled', 'true');\n this.startEl?.setAttribute('disabled', 'true');\n }\n }\n\n private enableSlots() {\n this.endEl?.setAttribute('disabled', 'false');\n this.startEl?.setAttribute('disabled', 'false');\n }\n\n private initButtons() {\n if (this.endEl?.tagName === 'CPSL-BUTTON') {\n this.endEl.setAttribute('full-width', 'true');\n this.endEl.addEventListener('mousedown', e => {\n e.preventDefault();\n });\n }\n if (this.startEl?.tagName === 'CPSL-BUTTON') {\n this.startEl.setAttribute('full-width', 'true');\n this.startEl.addEventListener('mousedown', e => {\n e.preventDefault();\n });\n }\n }\n\n /**\n * Emits a `cpslInput` event.\n */\n private emitInputChange(event?: Event) {\n this.cpslInput.emit({ value: this.value || '', event });\n }\n\n /**\n * Emits a `cpslChange` event.\n *\n * This API should be called for user committed changes.\n * This API should not be used for external value changes.\n */\n private emitValueChange(event?: Event) {\n const { value } = this;\n // Checks for both null and undefined values\n const newValue = value == null ? value : value.toString();\n // Emitting a value change should update the internal state for tracking the focused value\n this.focusedValue = newValue;\n this.cpslChange.emit({ value: newValue, event });\n }\n\n private onInput = (ev: InputEvent) => {\n const input = ev.target as HTMLInputElement | null;\n\n this.maskedInput?._onInput(ev);\n\n if (Boolean(input)) {\n this.value = this.maskedInput?.unmaskedValue ?? (input.value || '');\n input.value === '' ? this.disableSlots() : this.enableSlots();\n }\n\n this.emitInputChange(ev);\n };\n\n private onChange = (ev: Event) => {\n this.emitValueChange(ev);\n };\n\n private onBlur = (ev: FocusEvent) => {\n this.hasFocus = false;\n\n if (this.focusedValue !== this.value) {\n /**\n * Emits the `cpslChange` event when the input value\n * is different than the value when the input was focused.\n */\n this.emitValueChange(ev);\n }\n\n this.cpslBlur.emit(ev);\n };\n\n private onFocus = (ev: FocusEvent) => {\n this.hasFocus = true;\n this.focusedValue = this.value;\n\n this.cpslFocus.emit(ev);\n };\n\n private onPaste = (ev: ClipboardEvent) => {\n ev.stopPropagation();\n ev.preventDefault();\n\n const input = ev.target as HTMLInputElement;\n const pasteData = ev.clipboardData?.getData('text') || '';\n\n // Manually set the value & cursor position\n const initialSelectionStart = input.selectionStart;\n const newVal = `${input.value.slice(0, input.selectionStart)}${pasteData}${input.value.slice(input.selectionEnd, input.value.length)}`;\n input.value = newVal;\n\n // this.value = newVal;\n input.selectionEnd = initialSelectionStart + pasteData.length;\n\n this.maskedInput?._onInput({ ...(ev as any), target: input });\n this.value = this.maskedInput?.unmaskedValue ?? (input.value || '');\n\n this.value === '' ? this.disableSlots() : this.enableSlots();\n\n // Emit the cpslPaste event\n this.cpslPaste.emit(ev);\n\n // Emit the cpslChange event since the value was modified by paste\n this.emitInputChange(ev);\n };\n\n private focusInput = () => {\n this.nativeInput.focus();\n };\n\n private get startEl() {\n return this.el.querySelector('[slot=\"start\"]');\n }\n\n private get endEl() {\n return this.el.querySelector('[slot=\"end\"]');\n }\n\n render() {\n return (\n <Host class={{ 'disabled': this.disabled, 'focused': this.hasFocus, 'has-value': Boolean(this.focusedValue) || Boolean(this.value), 'contrast-text': this.contrastText }}>\n {this.label && (\n <label class=\"label\" htmlFor={this.inputId}>\n {this.label}\n {this.required ? '*' : ' '}\n {!this.required && this.showOptionalLabel ? <span class=\"optional-label\">(optional)</span> : ''}\n </label>\n )}\n <div class={{ 'input-container': true, 'error-container': Boolean(this.errorText) }}>\n <slot name=\"start\"></slot>\n <input\n class=\"native-input\"\n part=\"native-input\"\n ref={input => (this.nativeInput = input)}\n id={this.inputId}\n disabled={this.disabled}\n autoCapitalize={this.autocapitalize}\n autoComplete={this.autocomplete}\n autoCorrect={this.autocorrect}\n autoFocus={this.autofocus}\n enterKeyHint={this.enterkeyhint}\n inputMode={this.inputmode}\n min={this.min}\n max={this.max}\n minLength={this.minlength}\n maxLength={this.maxlength}\n multiple={this.multiple}\n name={this.name}\n pattern={this.pattern}\n placeholder={this.placeholder || ''}\n readOnly={this.readonly}\n required={this.required}\n spellcheck={this.spellcheck}\n type={this.type}\n defaultValue={this.value ?? ''}\n onInput={this.onInput}\n onChange={this.onChange}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n onClick={this.focusInput}\n onPaste={this.onPaste}\n />\n <slot name=\"end\"></slot>\n </div>\n {(this.errorText || this.helperText) && (\n <div class={{ 'helper-text-container': true, 'error-text': Boolean(this.errorText) }}>\n <span>{this.errorText ?? this.helperText}</span>\n </div>\n )}\n </Host>\n );\n }\n}\n\nlet inputIds = 0;\n"]}
|
@@ -11,6 +11,7 @@ export class CpslModalV2 {
|
|
11
11
|
toggleHeight() {
|
12
12
|
if (!this.open) {
|
13
13
|
this.cpslModalExiting.emit();
|
14
|
+
// Animate out before setting display to none
|
14
15
|
setTimeout(() => {
|
15
16
|
this.el.style.display = 'none';
|
16
17
|
this.cpslModalExited.emit();
|
@@ -28,7 +29,7 @@ export class CpslModalV2 {
|
|
28
29
|
this.toggleHeight();
|
29
30
|
}
|
30
31
|
render() {
|
31
|
-
return (h(Host, { key: '
|
32
|
+
return (h(Host, { key: '2dca618fb17113f9c346e6e54684b50c5ac3f493', class: { 'open': this.open, 'elevated': this.elevated, 'no-overlay': this.noOverlay } }, !this.noOverlay && (h("cpsl-overlay", { key: 'f43f994363f20b0f4b43cfc61753f41ad41ecb63', zIndexOverride: this.zIndexOverride ? this.zIndexOverride : undefined, id: "overlay", open: this.open, enterTransitionDuration: this.enterTransitionDuration, exitTransitionDuration: this.exitTransitionDuration })), h("cpsl-card", { key: '02a53d032d3b95bd78843cf2d1d06a3cc11c4894', class: "card", style: { transitionDuration: this.open ? `${this.exitTransitionDuration}s` : `${this.enterTransitionDuration}s` } }, h("slot", { key: '3c246e9fb544c6ddcd2cec53c2b5e4362dab0a6a' }))));
|
32
33
|
}
|
33
34
|
static get is() { return "cpsl-modal-v2"; }
|
34
35
|
static get encapsulation() { return "shadow"; }
|