@usecapsule/core-components 3.2.0 → 3.3.1-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-0e558c7f.entry.js +10 -0
- package/dist/capsule/{p-05cb769b.entry.js.map → p-0e558c7f.entry.js.map} +1 -1
- package/dist/capsule/{p-dc4591d5.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-5965b15e.entry.js +2 -0
- package/dist/capsule/{p-c1aa1ffb.entry.js.map → p-5965b15e.entry.js.map} +1 -1
- package/dist/capsule/{p-742bda0b.entry.js → p-5d62e610.entry.js} +2 -2
- package/dist/capsule/p-60508b1e.entry.js +20 -0
- package/dist/capsule/p-60508b1e.entry.js.map +1 -0
- package/dist/cjs/capsule.cjs.js +1 -1
- package/dist/cjs/{cpsl-alert_33.cjs.entry.js → cpsl-alert_34.cjs.entry.js} +17025 -13458
- package/dist/cjs/cpsl-alert_34.cjs.entry.js.map +1 -0
- package/dist/cjs/cpsl-animation.cjs.entry.js +3 -2
- package/dist/cjs/cpsl-animation.cjs.entry.js.map +1 -1
- package/dist/cjs/cpsl-hero.cjs.entry.js +9 -6
- package/dist/cjs/cpsl-hero.cjs.entry.js.map +1 -1
- package/dist/cjs/cpsl-identicon.cjs.entry.js +1 -1
- package/dist/cjs/cpsl-info-box.cjs.entry.js +2 -2
- package/dist/cjs/cpsl-info-box.cjs.entry.js.map +1 -1
- package/dist/cjs/cpsl-modal-v2.cjs.entry.js +1 -1
- package/dist/cjs/cpsl-modal-v2.cjs.entry.js.map +1 -1
- package/dist/cjs/cpsl-row.cjs.entry.js +1 -1
- package/dist/cjs/index-65f57499.js +2 -2
- package/dist/cjs/index.cjs.js +40 -17
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- 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 -1
- 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 +2 -1
- 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-app-bar/cpsl-app-bar.js +3 -3
- 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-button/cpsl-button.css +89 -2
- package/dist/collection/components/cpsl-button/cpsl-button.js +6 -5
- package/dist/collection/components/cpsl-button/cpsl-button.js.map +1 -1
- package/dist/collection/components/cpsl-button/cpsl-button.stories.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-code-input/cpsl-code-input.css +3 -0
- package/dist/collection/components/cpsl-code-input/cpsl-code-input.js +11 -7
- package/dist/collection/components/cpsl-code-input/cpsl-code-input.js.map +1 -1
- package/dist/collection/components/cpsl-divider/cpsl-divider.css +2 -1
- package/dist/collection/components/cpsl-drawer/cpsl-drawer.js +2 -2
- package/dist/collection/components/cpsl-drawer/cpsl-drawer.js.map +1 -1
- package/dist/collection/components/cpsl-dropdown/cpsl-dropdown.js +2 -2
- package/dist/collection/components/cpsl-dropdown/cpsl-dropdown.js.map +1 -1
- package/dist/collection/components/cpsl-file-upload/cpsl-file-upload.js +5 -10
- package/dist/collection/components/cpsl-file-upload/cpsl-file-upload.js.map +1 -1
- package/dist/collection/components/cpsl-hero/cpsl-hero.css +136 -71
- package/dist/collection/components/cpsl-hero/cpsl-hero.js +63 -9
- package/dist/collection/components/cpsl-hero/cpsl-hero.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-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 +100 -28
- package/dist/collection/components/cpsl-input/cpsl-input.js.map +1 -1
- package/dist/collection/components/cpsl-modal-v2/cpsl-modal-v2.js +1 -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 +1 -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-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 +12 -14
- 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 -6
- 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 +3 -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 +1 -9
- 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 +2 -5
- 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 +5 -4
- 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/theme/generateBorderRadii.js +5 -4
- 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 +25 -9
- package/dist/collection/utils/theme/generatePalette.js.map +1 -1
- package/dist/collection/utils/theme/generateTheme.js +9 -3
- package/dist/collection/utils/theme/generateTheme.js.map +1 -1
- package/dist/collection/utils/theme/utils.js.map +1 -1
- package/dist/esm/capsule.js +1 -1
- package/dist/esm/{cpsl-alert_33.entry.js → cpsl-alert_34.entry.js} +17026 -13460
- package/dist/esm/cpsl-alert_34.entry.js.map +1 -0
- package/dist/esm/cpsl-animation.entry.js +2 -1
- package/dist/esm/cpsl-animation.entry.js.map +1 -1
- package/dist/esm/cpsl-hero.entry.js +10 -7
- package/dist/esm/cpsl-hero.entry.js.map +1 -1
- package/dist/esm/cpsl-identicon.entry.js +1 -1
- package/dist/esm/cpsl-info-box.entry.js +2 -2
- package/dist/esm/cpsl-info-box.entry.js.map +1 -1
- package/dist/esm/cpsl-modal-v2.entry.js +1 -1
- package/dist/esm/cpsl-modal-v2.entry.js.map +1 -1
- package/dist/esm/cpsl-row.entry.js +1 -1
- package/dist/esm/index-91db3414.js +2 -2
- package/dist/esm/index.js +40 -17
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/assets/icons/index.d.ts +20 -0
- package/dist/types/components/{cpsl-modal/cpsl-modal.d.ts → cpsl-auth-modal/cpsl-auth-modal.d.ts} +3 -23
- package/dist/types/components/cpsl-button/cpsl-button.d.ts +2 -2
- package/dist/types/components/cpsl-hero/cpsl-hero.d.ts +18 -3
- package/dist/types/components/cpsl-icon-group/cpsl-icon-group.d.ts +20 -0
- package/dist/types/components/cpsl-input/cpsl-input.d.ts +13 -3
- package/dist/types/components/cpsl-popover/cpsl-popover.d.ts +2 -2
- package/dist/types/components/cpsl-qr-code/cpsl-qr-code.d.ts +1 -0
- package/dist/types/components/cpsl-select/cpsl-select.d.ts +22 -1
- package/dist/types/components/cpsl-text/cpsl-text.d.ts +1 -1
- package/dist/types/components.d.ts +222 -146
- package/dist/types/interface.d.ts +13 -0
- package/dist/types/utils/theme/generateBorderRadii.d.ts +1 -1
- package/dist/types/utils/theme/generatePalette.d.ts +4 -2
- package/dist/types/utils/theme/generateTheme.d.ts +1 -1
- package/package.json +4 -3
- package/dist/capsule/p-0462f723.js +0 -2
- package/dist/capsule/p-0462f723.js.map +0 -1
- package/dist/capsule/p-05cb769b.entry.js +0 -10
- package/dist/capsule/p-0eea90f8.entry.js +0 -2
- package/dist/capsule/p-7233228e.entry.js +0 -29
- package/dist/capsule/p-7233228e.entry.js.map +0 -1
- package/dist/capsule/p-c1aa1ffb.entry.js +0 -2
- package/dist/capsule/p-d351f076.entry.js +0 -2
- package/dist/capsule/p-d351f076.entry.js.map +0 -1
- package/dist/capsule/p-dc4591d5.entry.js.map +0 -1
- package/dist/cjs/_commonjsHelpers-b3309d7b.js +0 -12
- package/dist/cjs/_commonjsHelpers-b3309d7b.js.map +0 -1
- package/dist/cjs/cpsl-alert_33.cjs.entry.js.map +0 -1
- package/dist/collection/components/cpsl-modal/cpsl-modal.js.map +0 -1
- package/dist/esm/_commonjsHelpers-1789f0cf.js +0 -9
- package/dist/esm/_commonjsHelpers-1789f0cf.js.map +0 -1
- package/dist/esm/cpsl-alert_33.entry.js.map +0 -1
- /package/dist/capsule/{p-0eea90f8.entry.js.map → p-3b042fd1.entry.js.map} +0 -0
- /package/dist/capsule/{p-742bda0b.entry.js.map → p-5d62e610.entry.js.map} +0 -0
@@ -20,7 +20,7 @@ export class CpslNavButtonGroup {
|
|
20
20
|
item.setAttribute('full-width', 'true');
|
21
21
|
this.selectItem();
|
22
22
|
});
|
23
|
-
if (
|
23
|
+
if ((_a = this.otherSlots) === null || _a === void 0 ? void 0 : _a.length) {
|
24
24
|
console.error('cpsl-button is the only valid child of cpsl-nav-button-group');
|
25
25
|
this.otherSlots.forEach(item => item.remove());
|
26
26
|
}
|
@@ -32,7 +32,7 @@ export class CpslNavButtonGroup {
|
|
32
32
|
return this.el.querySelectorAll('&> *:not(cpsl-button)');
|
33
33
|
}
|
34
34
|
render() {
|
35
|
-
return (h(Host, { key: '
|
35
|
+
return (h(Host, { key: '9bd4edd8429e52b060d64fc5cf707c3ee3c26dd4' }, h("slot", { key: 'c035504b8795331c35de8bacab0b252ad4facc0d' })));
|
36
36
|
}
|
37
37
|
static get is() { return "cpsl-nav-button-group"; }
|
38
38
|
static get encapsulation() { return "shadow"; }
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"cpsl-nav-button-group.js","sourceRoot":"","sources":["../../../../src/components/cpsl-nav-button-group/cpsl-nav-button-group.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAOzE,MAAM,OAAO,kBAAkB;;;;IAS7B,UAAU;QACR,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YAC9B,IAAI,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC,UAAU,EAAE,CAAC;gBAChC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YACjC,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;YACpC,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAED,mBAAmB;;QACjB,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YAC9B,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;YACxC,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;YACxC,IAAI,CAAC,UAAU,EAAE,CAAC;QACpB,CAAC,CAAC,CAAC;QAEH,IAAI,
|
1
|
+
{"version":3,"file":"cpsl-nav-button-group.js","sourceRoot":"","sources":["../../../../src/components/cpsl-nav-button-group/cpsl-nav-button-group.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAOzE,MAAM,OAAO,kBAAkB;;;;IAS7B,UAAU;QACR,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YAC9B,IAAI,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC,UAAU,EAAE,CAAC;gBAChC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YACjC,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;YACpC,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAED,mBAAmB;;QACjB,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YAC9B,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;YACxC,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;YACxC,IAAI,CAAC,UAAU,EAAE,CAAC;QACpB,CAAC,CAAC,CAAC;QAEH,IAAI,MAAA,IAAI,CAAC,UAAU,0CAAE,MAAM,EAAE,CAAC;YAC5B,OAAO,CAAC,KAAK,CAAC,8DAA8D,CAAC,CAAC;YAC9E,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;QACjD,CAAC;IACH,CAAC;IAED,IAAY,WAAW;QACrB,OAAO,IAAI,CAAC,EAAE,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC;IACjD,CAAC;IAED,IAAY,UAAU;QACpB,OAAO,IAAI,CAAC,EAAE,CAAC,gBAAgB,CAAC,uBAAuB,CAAC,CAAC;IAC3D,CAAC;IACD,MAAM;QACJ,OAAO,CACL,EAAC,IAAI;YACH,8DAAa,CACR,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Element, Prop, Watch, h } from '@stencil/core';\n\n@Component({\n tag: 'cpsl-nav-button-group',\n styleUrl: 'cpsl-nav-button-group.scss',\n shadow: true,\n})\nexport class CpslNavButtonGroup {\n @Element() el!: HTMLCpslNavButtonGroupElement;\n\n /**\n * The id of the selected button.\n */\n @Prop() selectedId?: string;\n\n @Watch('selectedId')\n selectItem() {\n this.buttonSlots.forEach(item => {\n if (item.id === this.selectedId) {\n item.classList.add('selected');\n } else {\n item.classList.remove('selected');\n }\n });\n }\n\n componentWillRender() {\n this.buttonSlots.forEach(item => {\n item.setAttribute('variant', 'primary');\n item.setAttribute('full-width', 'true');\n this.selectItem();\n });\n\n if (this.otherSlots?.length) {\n console.error('cpsl-button is the only valid child of cpsl-nav-button-group');\n this.otherSlots.forEach(item => item.remove());\n }\n }\n\n private get buttonSlots() {\n return this.el.querySelectorAll('cpsl-button');\n }\n\n private get otherSlots() {\n return this.el.querySelectorAll('&> *:not(cpsl-button)');\n }\n render() {\n return (\n <Host>\n <slot></slot>\n </Host>\n );\n }\n}\n"]}
|
@@ -28,7 +28,7 @@ export class CpslOverlay {
|
|
28
28
|
}
|
29
29
|
}
|
30
30
|
render() {
|
31
|
-
return (h(Host, { key: '
|
31
|
+
return (h(Host, { key: 'c3a05ed63108fbe8354b5cd3bb1c08d02cf39a60', style: this.zIndexOverride ? { zIndex: `${this.zIndexOverride}` } : {} }, h("slot", { key: '6b57f3341e2f11611cbd1fe44fb3088c8e3a434a' })));
|
32
32
|
}
|
33
33
|
static get is() { return "cpsl-overlay"; }
|
34
34
|
static get encapsulation() { return "shadow"; }
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"cpsl-overlay.js","sourceRoot":"","sources":["../../../../src/components/cpsl-overlay/cpsl-overlay.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,IAAI,MAAM,MAAM,CAAC;AAOxB,MAAM,OAAO,WAAW;;uCAOqB,GAAG;sCAMJ,GAAG;;;;IAa7C,YAAY;QACV,IAAI,CAAC,IAAI;YACP,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,uBAAuB,EAAE,EAAE,CAAC,CAAC,E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CAAC;YACtH,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACrD,CAAC;IACH,CAAC;IAED,MAAM;QACJ,OAAO,CACL,EAAC,IAAI,qDAAC,KAAK,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE;YAC1E,8DAAa,CACR,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h, Element, Watch } from '@stencil/core';\nimport gsap from 'gsap';\n\n@Component({\n tag: 'cpsl-overlay',\n styleUrl: 'cpsl-overlay.scss',\n shadow: true,\n})\nexport class CpslOverlay {\n @Element() el!: HTMLCpslOverlayElement;\n\n /**\n * Duration in seconds of the fade out animation.\n * Default is .5.\n */\n @Prop() enterTransitionDuration?: number = 0.5;\n\n /**\n * Duration in seconds of the fade out animation.\n * Default is .5.\n */\n @Prop() exitTransitionDuration?: number = 0.5;\n\n /**\n * Whether or not to show the overlay.\n */\n @Prop() open: boolean;\n\n /**\n * Override z-index.\n */\n @Prop() zIndexOverride?: number;\n\n @Watch('open')\n toggleHeight() {\n this.open\n ? gsap.timeline({ defaults: { duration: this.enterTransitionDuration } }).to(this.el, { display: 'block', opacity: 1 })\n : gsap.timeline({ defaults: { duration: this.exitTransitionDuration } }).to(this.el, { display: 'none', opacity: 0 });\n\n if (this.open) {\n document.documentElement.style.overflow = 'hidden';\n } else {\n // Setting a timeout here to prevent modal from shifting when the scroll bar appears\n setTimeout(() => {\n document.documentElement.style.overflow = 'auto';\n }, this.exitTransitionDuration * 1000);\n }\n }\n\n componentDidLoad() {\n if (this.open) {\n gsap.timeline({ defaults: { duration: this.enterTransitionDuration } }).to(this.el, { display: 'block', opacity: 1 });\n document.documentElement.style.overflow = 'hidden';\n }\n }\n\n render() {\n return (\n <Host style={this.zIndexOverride ? { zIndex: `${this.zIndexOverride}` } : {}}>\n <slot></slot>\n </Host>\n );\n }\n}\n"]}
|
@@ -71,7 +71,7 @@ export class CpslPagination {
|
|
71
71
|
filteredPages.push(this.totalPages - 1);
|
72
72
|
}
|
73
73
|
}
|
74
|
-
return (h(Host, { key: '
|
74
|
+
return (h(Host, { key: '89d002fff30667f081dcb91e3380b3d452860bf9' }, h("cpsl-button-group", { key: '169546258dbb7bcf29f4914f77e677f1addcc400', selectedId: `${this.currentPage}` }, h("cpsl-button", { key: 'fb523b4e254412493b0f7c86be13a05eed38efff', class: "arrow-button", onClick: this.handlePrevClick }, h("cpsl-icon", { key: 'c455f7f3b349e6c43ec5f5da3a2b76630bb1c73f', class: { 'icon': true, 'start-icon': true }, icon: "arrowNarrow" })), filteredPages.map(page => (h("cpsl-button", { key: page, variant: "secondary", fullWidth: true, id: `${page}`, onClick: this.handlePageClick(page) }, h("cpsl-text", { variant: "bodyS" }, page + 1)))), h("cpsl-button", { key: '52c54082f971199a7a5a231f11a2fb3f063c2b9e', class: "arrow-button", onClick: this.handleNextClick }, h("cpsl-icon", { key: '300954f69d40f4077bdc1e77f46d66c99f7c7ac0', class: "icon", icon: "arrowNarrow" })))));
|
75
75
|
}
|
76
76
|
static get is() { return "cpsl-pagination"; }
|
77
77
|
static get encapsulation() { return "shadow"; }
|
@@ -4,7 +4,7 @@ export class CpslPill {
|
|
4
4
|
this.text = undefined;
|
5
5
|
}
|
6
6
|
render() {
|
7
|
-
return (h(Host, { key: '
|
7
|
+
return (h(Host, { key: 'db0f2db5e1ae046fb4498c5fa2974f56d461ca46' }, h("div", { key: 'a1f1fb791f0b228073008c2f864574f5d4cb47db', class: "pill-container" }, h("span", { key: 'd64c09db81a3c7f4ded1559fbc8351204cd71bb5' }, this.text))));
|
8
8
|
}
|
9
9
|
static get is() { return "cpsl-pill"; }
|
10
10
|
static get encapsulation() { return "shadow"; }
|
@@ -23,14 +23,14 @@ export class CpslPopover {
|
|
23
23
|
this.triggerClicked = false;
|
24
24
|
this.configureTriggerInteraction = () => {
|
25
25
|
const { trigger, triggerAction, destroyTriggerInteraction } = this;
|
26
|
-
if (
|
26
|
+
if (destroyTriggerInteraction) {
|
27
27
|
destroyTriggerInteraction();
|
28
28
|
}
|
29
29
|
if (trigger === undefined) {
|
30
30
|
return;
|
31
31
|
}
|
32
32
|
this.triggerEl = document.getElementById(trigger);
|
33
|
-
if (!
|
33
|
+
if (!this.triggerEl) {
|
34
34
|
console.error(`A trigger element with the ID "${trigger}" was not found in the DOM.`, this.el);
|
35
35
|
return;
|
36
36
|
}
|
@@ -91,7 +91,7 @@ export class CpslPopover {
|
|
91
91
|
this.setPosition = () => {
|
92
92
|
var _a;
|
93
93
|
const anchorEl = (_a = this.anchorEl) !== null && _a !== void 0 ? _a : this.triggerEl;
|
94
|
-
if (
|
94
|
+
if (anchorEl) {
|
95
95
|
const windowWidth = window.innerWidth;
|
96
96
|
const windowHeight = window.innerHeight;
|
97
97
|
const elWidth = this.el.clientWidth;
|
@@ -194,10 +194,12 @@ export class CpslPopover {
|
|
194
194
|
if (this.open) {
|
195
195
|
window.addEventListener('click', this.handleClickOutside);
|
196
196
|
window.addEventListener('scroll', () => this.setPosition(), true);
|
197
|
+
window.addEventListener('resize', () => this.setPosition(), true);
|
197
198
|
}
|
198
199
|
else {
|
199
200
|
window.removeEventListener('click', this.handleClickOutside);
|
200
|
-
window.
|
201
|
+
window.removeEventListener('scroll', () => this.setPosition(), true);
|
202
|
+
window.removeEventListener('resize', () => this.setPosition(), true);
|
201
203
|
}
|
202
204
|
}
|
203
205
|
componentDidLoad() {
|
@@ -209,7 +211,7 @@ export class CpslPopover {
|
|
209
211
|
}
|
210
212
|
render() {
|
211
213
|
var _a;
|
212
|
-
return (h(Host, { key: '
|
214
|
+
return (h(Host, { key: '338d4a705c7bcd6a5ac6e1db38d7c077b8125dcb', class: {
|
213
215
|
'open': this.open,
|
214
216
|
'transform-h-left': this.transformOriginHorizontal === 'left',
|
215
217
|
'transform-h-center': this.transformOriginHorizontal === 'center',
|
@@ -217,11 +219,7 @@ export class CpslPopover {
|
|
217
219
|
'transform-v-top': this.transformOriginVertical === 'top',
|
218
220
|
'transform-v-center': this.transformOriginVertical === 'center',
|
219
221
|
'transform-v-bottom': this.transformOriginVertical === 'bottom',
|
220
|
-
}, style: {
|
221
|
-
top: `${this.positionY}px`,
|
222
|
-
left: `${this.positionX}px`,
|
223
|
-
width: this.autoWidth ? 'auto' : `${(_a = this.triggerEl) === null || _a === void 0 ? void 0 : _a.clientWidth}px`,
|
224
|
-
} }, h("div", { key: '4cb74feb1ddb1157deb138c22b4ebd6fe423f163', id: "container", class: { container: true, open: this.open } }, h("slot", { key: '498c0f9f4e7770ec4b8bd3a4d50be843e0b9445c' }))));
|
222
|
+
}, style: { top: `${this.positionY}px`, left: `${this.positionX}px`, width: !this.open ? '0px' : this.autoWidth ? 'auto' : `${(_a = this.triggerEl) === null || _a === void 0 ? void 0 : _a.clientWidth}px` } }, h("div", { key: 'dcd6ed99f039f905fe72850ff7943a7d8afc8335', id: "container", class: { container: true, open: this.open } }, h("slot", { key: '39e0e5f281f261e1828f82f30ead2728a10f92ac' }))));
|
225
223
|
}
|
226
224
|
static get is() { return "cpsl-popover"; }
|
227
225
|
static get encapsulation() { return "shadow"; }
|
@@ -455,8 +453,8 @@ export class CpslPopover {
|
|
455
453
|
"text": "Emitted when the popover opens."
|
456
454
|
},
|
457
455
|
"complexType": {
|
458
|
-
"original": "
|
459
|
-
"resolved": "
|
456
|
+
"original": "void",
|
457
|
+
"resolved": "void",
|
460
458
|
"references": {}
|
461
459
|
}
|
462
460
|
}, {
|
@@ -470,8 +468,8 @@ export class CpslPopover {
|
|
470
468
|
"text": "Emitted when the popover closes."
|
471
469
|
},
|
472
470
|
"complexType": {
|
473
|
-
"original": "
|
474
|
-
"resolved": "
|
471
|
+
"original": "void",
|
472
|
+
"resolved": "void",
|
475
473
|
"references": {}
|
476
474
|
}
|
477
475
|
}];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"cpsl-popover.js","sourceRoot":"","sources":["../../../../src/components/cpsl-popover/cpsl-popover.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAgB,MAAM,eAAe,CAAC;AAQ7G,MAAM,OAAO,WAAW;;QAOd,mBAAc,GAAG,KAAK,CAAC;QAqHvB,gCAA2B,GAAG,GAAG,EAAE;YACzC,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,yBAAyB,EAAE,GAAG,IAAI,CAAC;YAEnE,IAAI,OAAO,CAAC,yBAAyB,CAAC,EAAE,CAAC;gBACvC,yBAAyB,EAAE,CAAC;YAC9B,CAAC;YAED,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;gBAC1B,OAAO;YACT,CAAC;YAED,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;YAClD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;gBAC7B,OAAO,CAAC,KAAK,CAAC,kCAAkC,OAAO,6BAA6B,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;gBAC/F,OAAO;YACT,CAAC;YAED,IAAI,gBAAgB,GAA0B,EAAE,CAAC;YACjD;;;;eAIG;YACH,QAAQ,aAAa,EAAE,CAAC;gBACtB,KAAK,OAAO;oBACV,gBAAgB,GAAG;wBACjB;4BACE,SAAS,EAAE,YAAY;4BACvB,QAAQ,EAAE,GAAS,EAAE;gCACnB,IAAI,CAAC,OAAO,EAAE,CAAC;4BACjB,CAAC,CAAA;yBACF;wBACD;4BACE,SAAS,EAAE,YAAY;4BACvB,QAAQ,EAAE,GAAG,EAAE;gCACb,IAAI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;;;;CACF","sourcesContent":["import { Component, Host, Prop, State, Watch, Element, h, Method, Event, EventEmitter } from '@stencil/core';\nimport { InteractionCallback } from '../../interface';\n\n@Component({\n tag: 'cpsl-popover',\n styleUrl: 'cpsl-popover.scss',\n shadow: true,\n})\nexport class CpslPopover {\n private triggerEl?: HTMLElement | null;\n private destroyTriggerInteraction?: () => void;\n\n @Element() el!: HTMLCpslPopoverElement;\n\n @State() open = false;\n private triggerClicked = false;\n @State() positionX?: number;\n @State() positionY?: number;\n\n /**\n * ID for the element that the popover anchors to.\n */\n @Prop() anchorEl?: HTMLElement;\n\n /**\n * Vertical anchor origin.\n * Options are: `\"left\"`, `\"center\"`, `\"right\"`.\n * Default is: `\"left\"`.\n */\n @Prop() anchorOriginHorizontal?: 'left' | 'center' | 'right' = 'left';\n\n /**\n * Vertical anchor origin.\n * Options are: `\"top\"`, `\"center\"`, `\"bottom\"`.\n * Default is: `\"bottom\"`.\n */\n @Prop() anchorOriginVertical?: 'top' | 'center' | 'bottom' = 'bottom';\n\n /**\n * If `true` the container will use the width of the content, else it will be set to the width of the trigger.\n * Default is `true`\n */\n // eslint-disable-next-line @stencil-community/ban-default-true\n @Prop() autoWidth?: boolean = true;\n\n /**\n * Whether or not to disable to popover.\n */\n @Prop() disabled: boolean;\n\n /**\n * Used internally to prevent select from blurring unintentionally.\n */\n @Prop() preventBlur: boolean;\n\n /**\n * Vertical transformation origin.\n * Options are: `\"left\"`, `\"center\"`, `\"right\"`.\n * Default is: `\"left\"`.\n */\n @Prop() transformOriginHorizontal?: 'left' | 'center' | 'right' = 'left';\n\n /**\n * Vertical transformation origin.\n * Options are: `\"top\"`, `\"center\"`, `\"bottom\"`.\n * Default is: `\"bottom\"`.\n */\n @Prop() transformOriginVertical?: 'top' | 'center' | 'bottom' = 'top';\n\n /**\n * Which trigger causes the popover to open.\n * Options are: `\"click\"`, `\"hover\"`.\n * Default is: `\"click\"`.\n */\n @Prop() triggerAction: 'click' | 'hover' = 'click';\n\n /**\n * ID for the element that triggers the popover to open.\n */\n @Prop() trigger: string;\n\n /**\n * Padding from edge of window for the popover container.\n */\n @Prop() windowPadding?: number = 16;\n\n /**\n * Emitted when the popover opens.\n */\n @Event() cpslOpen!: EventEmitter;\n\n /**\n * Emitted when the popover closes.\n */\n @Event() cpslClose!: EventEmitter;\n\n /**\n * Call to close the popover manually.\n */\n @Method()\n async closePopover() {\n this.close();\n }\n\n @Watch('trigger')\n @Watch('triggerAction')\n @Watch('preventBlur')\n onTriggerChange() {\n this.configureTriggerInteraction();\n }\n\n @Watch('anchorOriginHorizontal')\n @Watch('anchorOriginVertical')\n onAnchorChange() {\n this.setPosition();\n }\n\n @Watch('open')\n onOpenChange() {\n if (this.open) {\n window.addEventListener('click', this.handleClickOutside);\n window.addEventListener('scroll', () => this.setPosition(), true);\n } else {\n window.removeEventListener('click', this.handleClickOutside);\n window.addEventListener('scroll', () => this.setPosition());\n }\n }\n\n componentDidLoad() {\n this.configureTriggerInteraction();\n }\n\n private configureTriggerInteraction = () => {\n const { trigger, triggerAction, destroyTriggerInteraction } = this;\n\n if (Boolean(destroyTriggerInteraction)) {\n destroyTriggerInteraction();\n }\n\n if (trigger === undefined) {\n return;\n }\n\n this.triggerEl = document.getElementById(trigger);\n if (!Boolean(this.triggerEl)) {\n console.error(`A trigger element with the ID \"${trigger}\" was not found in the DOM.`, this.el);\n return;\n }\n\n let triggerCallbacks: InteractionCallback[] = [];\n /**\n * Based upon the kind of trigger interaction\n * the user wants, we setup the correct event\n * listeners.\n */\n switch (triggerAction) {\n case 'hover':\n triggerCallbacks = [\n {\n eventName: 'mouseenter',\n callback: async () => {\n this.present();\n },\n },\n {\n eventName: 'mouseleave',\n callback: () => {\n if (!this.containerEl.matches(':hover')) {\n this.close();\n } else {\n this.containerEl.addEventListener('mouseleave', () => {\n this.close();\n });\n }\n },\n },\n {\n eventName: 'click',\n callback: (ev: Event) => ev.stopPropagation(),\n },\n ];\n\n break;\n case 'click':\n default:\n triggerCallbacks = [\n {\n eventName: 'mousedown',\n callback: e => {\n if (this.preventBlur) {\n e.preventDefault();\n }\n this.present();\n },\n },\n ];\n break;\n }\n\n triggerCallbacks.forEach(({ eventName, callback }) => this.triggerEl.addEventListener(eventName, callback));\n\n this.destroyTriggerInteraction = () => {\n triggerCallbacks.forEach(({ eventName, callback }) => this.triggerEl.removeEventListener(eventName, callback));\n };\n };\n\n private setPosition = () => {\n const anchorEl = this.anchorEl ?? this.triggerEl;\n if (Boolean(anchorEl)) {\n const windowWidth = window.innerWidth;\n const windowHeight = window.innerHeight;\n const elWidth = this.el.clientWidth;\n const elHeight = this.el.clientHeight;\n const { top, left, height, width } = anchorEl.getBoundingClientRect();\n\n switch (this.anchorOriginHorizontal) {\n case 'left': {\n this.positionX = left;\n break;\n }\n case 'center': {\n this.positionX = left + width / 2;\n break;\n }\n case 'right': {\n this.positionX = left + width;\n break;\n }\n }\n\n switch (this.anchorOriginVertical) {\n case 'top': {\n this.positionY = top;\n break;\n }\n case 'center': {\n this.positionY = top + height / 2;\n break;\n }\n case 'bottom': {\n this.positionY = top + height;\n break;\n }\n }\n\n if (this.positionY < this.windowPadding) {\n this.positionY = this.windowPadding;\n }\n if (this.positionY + elHeight > windowHeight - 16) {\n this.positionY = windowHeight - this.windowPadding - elHeight;\n }\n\n if (this.positionX < this.windowPadding) {\n this.positionX = this.windowPadding;\n }\n if (this.positionX + elWidth > windowWidth - 16) {\n this.positionX = windowWidth - this.windowPadding - elWidth;\n }\n }\n };\n\n private handleClickOutside = (event: MouseEvent) => {\n if (!this.triggerClicked && this.triggerEl.contains(event.target as Node)) {\n this.triggerClicked = true;\n return;\n }\n if (this.open && !this.el.contains(event.target as Node)) {\n event.preventDefault();\n this.close();\n }\n };\n\n private present = () => {\n if (!this.open && !this.disabled) {\n this.open = true;\n this.cpslOpen.emit();\n this.setPosition();\n }\n };\n\n private close = () => {\n this.open = false;\n this.triggerClicked = false;\n this.cpslClose.emit();\n };\n\n get containerEl() {\n return this.el?.shadowRoot?.getElementById('container');\n }\n\n render() {\n return (\n <Host\n class={{\n 'open': this.open,\n 'transform-h-left': this.transformOriginHorizontal === 'left',\n 'transform-h-center': this.transformOriginHorizontal === 'center',\n 'transform-h-right': this.transformOriginHorizontal === 'right',\n 'transform-v-top': this.transformOriginVertical === 'top',\n 'transform-v-center': this.transformOriginVertical === 'center',\n 'transform-v-bottom': this.transformOriginVertical === 'bottom',\n }}\n style={{\n top: `${this.positionY}px`,\n left: `${this.positionX}px`,\n width: this.autoWidth ? 'auto' : `${this.triggerEl?.clientWidth}px`,\n }}\n >\n <div id=\"container\" class={{ container: true, open: this.open }}>\n <slot></slot>\n </div>\n </Host>\n );\n }\n}\n"]}
|
1
|
+
{"version":3,"file":"cpsl-popover.js","sourceRoot":"","sources":["../../../../src/components/cpsl-popover/cpsl-popover.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAgB,MAAM,eAAe,CAAC;AAQ7G,MAAM,OAAO,WAAW;;QAOd,mBAAc,GAAG,KAAK,CAAC;QAuHvB,gCAA2B,GAAG,GAAG,EAAE;YACzC,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,yBAAyB,EAAE,GAAG,IAAI,CAAC;YAEnE,IAAI,yBAAyB,EAAE,CAAC;gBAC9B,yBAAyB,EAAE,CAAC;YAC9B,CAAC;YAED,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;gBAC1B,OAAO;YACT,CAAC;YAED,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;YAClD,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;gBACpB,OAAO,CAAC,KAAK,CAAC,kCAAkC,OAAO,6BAA6B,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;gBAC/F,OAAO;YACT,CAAC;YAED,IA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AC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAA,IAAI,CAAC,SAAS,0CAAE,WAAW,IAAI,EAAE;YAE5J,4DAAK,EAAE,EAAC,WAAW,EAAC,KAAK,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE;gBAC7D,8DAAa,CACT,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, State, Watch, Element, h, Method, Event, EventEmitter } from '@stencil/core';\nimport { InteractionCallback } from '../../interface';\n\n@Component({\n tag: 'cpsl-popover',\n styleUrl: 'cpsl-popover.scss',\n shadow: true,\n})\nexport class CpslPopover {\n private triggerEl?: HTMLElement | null;\n private destroyTriggerInteraction?: () => void;\n\n @Element() el!: HTMLCpslPopoverElement;\n\n @State() open = false;\n private triggerClicked = false;\n @State() positionX?: number;\n @State() positionY?: number;\n\n /**\n * ID for the element that the popover anchors to.\n */\n @Prop() anchorEl?: HTMLElement;\n\n /**\n * Vertical anchor origin.\n * Options are: `\"left\"`, `\"center\"`, `\"right\"`.\n * Default is: `\"left\"`.\n */\n @Prop() anchorOriginHorizontal?: 'left' | 'center' | 'right' = 'left';\n\n /**\n * Vertical anchor origin.\n * Options are: `\"top\"`, `\"center\"`, `\"bottom\"`.\n * Default is: `\"bottom\"`.\n */\n @Prop() anchorOriginVertical?: 'top' | 'center' | 'bottom' = 'bottom';\n\n /**\n * If `true` the container will use the width of the content, else it will be set to the width of the trigger.\n * Default is `true`\n */\n // eslint-disable-next-line @stencil-community/ban-default-true\n @Prop() autoWidth?: boolean = true;\n\n /**\n * Whether or not to disable to popover.\n */\n @Prop() disabled: boolean;\n\n /**\n * Used internally to prevent select from blurring unintentionally.\n */\n @Prop() preventBlur: boolean;\n\n /**\n * Vertical transformation origin.\n * Options are: `\"left\"`, `\"center\"`, `\"right\"`.\n * Default is: `\"left\"`.\n */\n @Prop() transformOriginHorizontal?: 'left' | 'center' | 'right' = 'left';\n\n /**\n * Vertical transformation origin.\n * Options are: `\"top\"`, `\"center\"`, `\"bottom\"`.\n * Default is: `\"bottom\"`.\n */\n @Prop() transformOriginVertical?: 'top' | 'center' | 'bottom' = 'top';\n\n /**\n * Which trigger causes the popover to open.\n * Options are: `\"click\"`, `\"hover\"`.\n * Default is: `\"click\"`.\n */\n @Prop() triggerAction: 'click' | 'hover' = 'click';\n\n /**\n * ID for the element that triggers the popover to open.\n */\n @Prop() trigger: string;\n\n /**\n * Padding from edge of window for the popover container.\n */\n @Prop() windowPadding?: number = 16;\n\n /**\n * Emitted when the popover opens.\n */\n @Event() cpslOpen!: EventEmitter<void>;\n\n /**\n * Emitted when the popover closes.\n */\n @Event() cpslClose!: EventEmitter<void>;\n\n /**\n * Call to close the popover manually.\n */\n @Method()\n async closePopover() {\n this.close();\n }\n\n @Watch('trigger')\n @Watch('triggerAction')\n @Watch('preventBlur')\n onTriggerChange() {\n this.configureTriggerInteraction();\n }\n\n @Watch('anchorOriginHorizontal')\n @Watch('anchorOriginVertical')\n onAnchorChange() {\n this.setPosition();\n }\n\n @Watch('open')\n onOpenChange() {\n if (this.open) {\n window.addEventListener('click', this.handleClickOutside);\n window.addEventListener('scroll', () => this.setPosition(), true);\n window.addEventListener('resize', () => this.setPosition(), true);\n } else {\n window.removeEventListener('click', this.handleClickOutside);\n window.removeEventListener('scroll', () => this.setPosition(), true);\n window.removeEventListener('resize', () => this.setPosition(), true);\n }\n }\n\n componentDidLoad() {\n this.configureTriggerInteraction();\n }\n\n private configureTriggerInteraction = () => {\n const { trigger, triggerAction, destroyTriggerInteraction } = this;\n\n if (destroyTriggerInteraction) {\n destroyTriggerInteraction();\n }\n\n if (trigger === undefined) {\n return;\n }\n\n this.triggerEl = document.getElementById(trigger);\n if (!this.triggerEl) {\n console.error(`A trigger element with the ID \"${trigger}\" was not found in the DOM.`, this.el);\n return;\n }\n\n let triggerCallbacks: InteractionCallback[] = [];\n /**\n * Based upon the kind of trigger interaction\n * the user wants, we setup the correct event\n * listeners.\n */\n switch (triggerAction) {\n case 'hover':\n triggerCallbacks = [\n {\n eventName: 'mouseenter',\n callback: async () => {\n this.present();\n },\n },\n {\n eventName: 'mouseleave',\n callback: () => {\n if (!this.containerEl.matches(':hover')) {\n this.close();\n } else {\n this.containerEl.addEventListener('mouseleave', () => {\n this.close();\n });\n }\n },\n },\n {\n eventName: 'click',\n callback: (ev: Event) => ev.stopPropagation(),\n },\n ];\n\n break;\n case 'click':\n default:\n triggerCallbacks = [\n {\n eventName: 'mousedown',\n callback: e => {\n if (this.preventBlur) {\n e.preventDefault();\n }\n this.present();\n },\n },\n ];\n break;\n }\n\n triggerCallbacks.forEach(({ eventName, callback }) => this.triggerEl.addEventListener(eventName, callback));\n\n this.destroyTriggerInteraction = () => {\n triggerCallbacks.forEach(({ eventName, callback }) => this.triggerEl.removeEventListener(eventName, callback));\n };\n };\n\n private setPosition = () => {\n const anchorEl = this.anchorEl ?? this.triggerEl;\n if (anchorEl) {\n const windowWidth = window.innerWidth;\n const windowHeight = window.innerHeight;\n const elWidth = this.el.clientWidth;\n const elHeight = this.el.clientHeight;\n const { top, left, height, width } = anchorEl.getBoundingClientRect();\n\n switch (this.anchorOriginHorizontal) {\n case 'left': {\n this.positionX = left;\n break;\n }\n case 'center': {\n this.positionX = left + width / 2;\n break;\n }\n case 'right': {\n this.positionX = left + width;\n break;\n }\n }\n\n switch (this.anchorOriginVertical) {\n case 'top': {\n this.positionY = top;\n break;\n }\n case 'center': {\n this.positionY = top + height / 2;\n break;\n }\n case 'bottom': {\n this.positionY = top + height;\n break;\n }\n }\n\n if (this.positionY < this.windowPadding) {\n this.positionY = this.windowPadding;\n }\n if (this.positionY + elHeight > windowHeight - 16) {\n this.positionY = windowHeight - this.windowPadding - elHeight;\n }\n\n if (this.positionX < this.windowPadding) {\n this.positionX = this.windowPadding;\n }\n if (this.positionX + elWidth > windowWidth - 16) {\n this.positionX = windowWidth - this.windowPadding - elWidth;\n }\n }\n };\n\n private handleClickOutside = (event: MouseEvent) => {\n if (!this.triggerClicked && this.triggerEl.contains(event.target as Node)) {\n this.triggerClicked = true;\n return;\n }\n if (this.open && !this.el.contains(event.target as Node)) {\n event.preventDefault();\n this.close();\n }\n };\n\n private present = () => {\n if (!this.open && !this.disabled) {\n this.open = true;\n this.cpslOpen.emit();\n this.setPosition();\n }\n };\n\n private close = () => {\n this.open = false;\n this.triggerClicked = false;\n this.cpslClose.emit();\n };\n\n get containerEl() {\n return this.el?.shadowRoot?.getElementById('container');\n }\n\n render() {\n return (\n <Host\n class={{\n 'open': this.open,\n 'transform-h-left': this.transformOriginHorizontal === 'left',\n 'transform-h-center': this.transformOriginHorizontal === 'center',\n 'transform-h-right': this.transformOriginHorizontal === 'right',\n 'transform-v-top': this.transformOriginVertical === 'top',\n 'transform-v-center': this.transformOriginVertical === 'center',\n 'transform-v-bottom': this.transformOriginVertical === 'bottom',\n }}\n style={{ top: `${this.positionY}px`, left: `${this.positionX}px`, width: !this.open ? '0px' : this.autoWidth ? 'auto' : `${this.triggerEl?.clientWidth}px` }}\n >\n <div id=\"container\" class={{ container: true, open: this.open }}>\n <slot></slot>\n </div>\n </Host>\n );\n }\n}\n"]}
|
@@ -58,8 +58,12 @@
|
|
58
58
|
--qr-background-color: var(--cpsl-color-qr-background);
|
59
59
|
--qr-border-color: var(--cpsl-color-qr-border);
|
60
60
|
--qr-border-radius: var(--cpsl-border-radius-qr-code);
|
61
|
-
--qr-border-width:
|
62
|
-
--qr-box-shadow: 0px
|
61
|
+
--qr-border-width: 0px;
|
62
|
+
--qr-box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.06);
|
63
|
+
--qr-padding-top: 12px;
|
64
|
+
--qr-padding-end: 12px;
|
65
|
+
--qr-padding-bottom: 12px;
|
66
|
+
--qr-padding-start: 12px;
|
63
67
|
display: inline-block;
|
64
68
|
}
|
65
69
|
|
@@ -70,7 +74,7 @@
|
|
70
74
|
padding-inline-end: var(--qr-padding-end);
|
71
75
|
padding-top: var(--qr-padding-top);
|
72
76
|
padding-bottom: var(--qr-padding-bottom);
|
73
|
-
|
77
|
+
box-sizing: border-box;
|
74
78
|
color: var(--qr-color);
|
75
79
|
border-style: solid;
|
76
80
|
border-width: var(--qr-border-width);
|
@@ -78,4 +82,9 @@
|
|
78
82
|
border-radius: var(--qr-border-radius);
|
79
83
|
background: var(--qr-background-color);
|
80
84
|
box-shadow: var(--qr-box-shadow);
|
85
|
+
}
|
86
|
+
|
87
|
+
.qr-code {
|
88
|
+
width: 100%;
|
89
|
+
height: 100%;
|
81
90
|
}
|
@@ -1,38 +1,43 @@
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
2
|
-
import
|
2
|
+
import QrCodeWithLogo from "qrcode-with-logos";
|
3
3
|
export class CpslQrCode {
|
4
4
|
constructor() {
|
5
5
|
this.url = undefined;
|
6
6
|
this.imageSrc = undefined;
|
7
|
-
this.size =
|
7
|
+
this.size = 286;
|
8
8
|
}
|
9
9
|
componentDidLoad() {
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
color: 'transparent',
|
21
|
-
},
|
10
|
+
new QrCodeWithLogo({
|
11
|
+
content: this.url,
|
12
|
+
width: 1000,
|
13
|
+
image: this.imgEl,
|
14
|
+
logo: this.imageSrc
|
15
|
+
? {
|
16
|
+
src: this.imageSrc,
|
17
|
+
borderRadius: 16,
|
18
|
+
}
|
19
|
+
: '',
|
22
20
|
dotsOptions: {
|
23
|
-
type: '
|
24
|
-
|
21
|
+
type: 'dot',
|
22
|
+
},
|
23
|
+
cornersOptions: {
|
24
|
+
type: 'rounded',
|
25
|
+
radius: {
|
26
|
+
inner: 8,
|
27
|
+
outer: 32,
|
28
|
+
},
|
25
29
|
},
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
crossOrigin: 'anonymous',
|
30
|
+
nodeQrCodeOptions: {
|
31
|
+
margin: 0,
|
32
|
+
errorCorrectionLevel: 'M',
|
30
33
|
},
|
31
34
|
});
|
32
|
-
|
35
|
+
}
|
36
|
+
get imgEl() {
|
37
|
+
return this.el.shadowRoot.getElementById('qr-code');
|
33
38
|
}
|
34
39
|
render() {
|
35
|
-
return (h(Host, { key: '
|
40
|
+
return (h(Host, { key: '29a0c108792b0c2640c63846baa5ad20f4098a24' }, h("div", { key: 'e4568804cd28026a4c5507b85a0646327e8353b7', id: "qr-container", class: "qr-container", style: { width: `${this.size}px`, height: `${this.size}px` } }, h("img", { key: 'eb86fd0c8262bfba16177c954c1725cdbab6e69d', id: "qr-code", class: "qr-code" }))));
|
36
41
|
}
|
37
42
|
static get is() { return "cpsl-qr-code"; }
|
38
43
|
static get encapsulation() { return "shadow"; }
|
@@ -98,7 +103,7 @@ export class CpslQrCode {
|
|
98
103
|
},
|
99
104
|
"attribute": "size",
|
100
105
|
"reflect": false,
|
101
|
-
"defaultValue": "
|
106
|
+
"defaultValue": "286"
|
102
107
|
}
|
103
108
|
};
|
104
109
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"cpsl-qr-code.js","sourceRoot":"","sources":["../../../../src/components/cpsl-qr-code/cpsl-qr-code.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,
|
1
|
+
{"version":3,"file":"c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C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, h, Element, Prop } from '@stencil/core';\nimport QrCodeWithLogo from 'qrcode-with-logos';\n\n@Component({\n tag: 'cpsl-qr-code',\n styleUrl: 'cpsl-qr-code.scss',\n shadow: true,\n})\nexport class CpslQrCode {\n @Element() el!: HTMLCpslQrCodeElement;\n\n /**\n * URL for the QR code to link to.\n */\n @Prop() url: string;\n\n /**\n * Source for the center image of the QR code.\n */\n @Prop() imageSrc?: string;\n\n /**\n * Size of the QR code in pixels.\n * Default is 250.\n */\n @Prop() size?: number = 286;\n\n componentDidLoad() {\n new QrCodeWithLogo({\n content: this.url,\n width: 1000,\n image: this.imgEl,\n logo: this.imageSrc\n ? {\n src: this.imageSrc,\n borderRadius: 16,\n }\n : '',\n dotsOptions: {\n type: 'dot',\n },\n cornersOptions: {\n type: 'rounded',\n radius: {\n inner: 8,\n outer: 32,\n },\n },\n nodeQrCodeOptions: {\n margin: 0,\n errorCorrectionLevel: 'M',\n },\n });\n }\n\n private get imgEl(): HTMLImageElement {\n return this.el.shadowRoot.getElementById('qr-code') as HTMLImageElement;\n }\n\n render() {\n return (\n <Host>\n <div id=\"qr-container\" class=\"qr-container\" style={{ width: `${this.size}px`, height: `${this.size}px` }}>\n <img id=\"qr-code\" class=\"qr-code\" />\n </div>\n </Host>\n );\n }\n}\n"]}
|
@@ -9,7 +9,7 @@ export class CpslRadio {
|
|
9
9
|
this.checked = undefined;
|
10
10
|
}
|
11
11
|
render() {
|
12
|
-
return (h(Host, { key: '
|
12
|
+
return (h(Host, { key: '2e2c99a0aaff88bc8c70b41eedc3b808c7c347ae' }, h("input", { key: '19522b1db8b3a6392689be69b747711179187e0a', type: "radio", checked: this.checked }), h("span", { key: '360fd7451b7bf0429b03748dcd8fb9bac30b0e43', onClick: this.handleRadioClick, class: { container: true, checked: this.checked } })));
|
13
13
|
}
|
14
14
|
static get is() { return "cpsl-radio"; }
|
15
15
|
static get encapsulation() { return "shadow"; }
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
2
2
|
export class CpslRow {
|
3
3
|
render() {
|
4
|
-
return (h(Host, { key: '
|
4
|
+
return (h(Host, { key: '7d5564c003a58e6a530361c0a7a6ee026746c322' }, h("slot", { key: 'b493ac66dc1709116a6ac1507eeed82fbb8305bd' })));
|
5
5
|
}
|
6
6
|
static get is() { return "cpsl-row"; }
|
7
7
|
static get encapsulation() { return "shadow"; }
|
@@ -83,6 +83,8 @@
|
|
83
83
|
--helper-text-icon-size: 16px;
|
84
84
|
--helper-text-font-size: var(--cpsl-font-size-body-xs);
|
85
85
|
--helper-text-margin-top: 0px;
|
86
|
+
--icon-height: 24px;
|
87
|
+
--icon-width: 24px;
|
86
88
|
display: flex;
|
87
89
|
flex-direction: column;
|
88
90
|
gap: 4px;
|
@@ -190,11 +192,16 @@ input.disabled {
|
|
190
192
|
.selected-container-content {
|
191
193
|
flex: 1;
|
192
194
|
}
|
195
|
+
.selected-container-content.hidden {
|
196
|
+
display: none;
|
197
|
+
}
|
193
198
|
|
194
199
|
.chevron {
|
195
200
|
transition: transform 0.3s ease;
|
196
201
|
transform: rotate(180deg);
|
197
202
|
--icon-color: var(--cpsl-color-text-disabled);
|
203
|
+
--height: var(--icon-height);
|
204
|
+
--width: var(--icon-width);
|
198
205
|
}
|
199
206
|
.chevron.open {
|
200
207
|
transform: rotate(0deg);
|
@@ -226,4 +233,14 @@ input.disabled {
|
|
226
233
|
.dropdown-inner {
|
227
234
|
overflow: auto;
|
228
235
|
scrollbar-width: thin;
|
236
|
+
}
|
237
|
+
.dropdown-inner ::slotted(cpsl-input) {
|
238
|
+
padding: 8px;
|
239
|
+
}
|
240
|
+
|
241
|
+
.search-container {
|
242
|
+
position: sticky;
|
243
|
+
top: 0px;
|
244
|
+
padding: 8px;
|
245
|
+
background-color: var(--cpsl-color-select-surface-default);
|
229
246
|
}
|
@@ -28,7 +28,7 @@ export class CpslSelect {
|
|
28
28
|
item.setAttribute('selected', 'false');
|
29
29
|
}
|
30
30
|
});
|
31
|
-
if (!
|
31
|
+
if (!this.selectedValue) {
|
32
32
|
this.hasSelectedItem = false;
|
33
33
|
}
|
34
34
|
};
|
@@ -48,6 +48,8 @@ export class CpslSelect {
|
|
48
48
|
this.hasFocus = false;
|
49
49
|
this.popoverOpen = false;
|
50
50
|
this.hasSelectedItem = false;
|
51
|
+
this.anchorElId = undefined;
|
52
|
+
this.autoWidth = false;
|
51
53
|
this.disabled = false;
|
52
54
|
this.dropdownMaxHeight = undefined;
|
53
55
|
this.errorText = undefined;
|
@@ -60,6 +62,8 @@ export class CpslSelect {
|
|
60
62
|
this.selectedValue = undefined;
|
61
63
|
this.showFormattedSelectedItem = undefined;
|
62
64
|
this.showOptionalLabel = false;
|
65
|
+
this.showSearch = false;
|
66
|
+
this.searchPlaceholder = undefined;
|
63
67
|
}
|
64
68
|
onValueChange() {
|
65
69
|
this.popoverEl.closePopover();
|
@@ -78,14 +82,15 @@ export class CpslSelect {
|
|
78
82
|
}
|
79
83
|
componentDidLoad() {
|
80
84
|
this.popoverEl = this.el.shadowRoot.querySelector(`cpsl-popover`);
|
81
|
-
this.anchorEl = this.el.shadowRoot.getElementById('select-container');
|
85
|
+
this.anchorEl = this.anchorElId ? document.getElementById(this.anchorElId) : this.el.shadowRoot.getElementById('select-container');
|
82
86
|
this.selectItem();
|
83
87
|
}
|
84
88
|
render() {
|
85
|
-
var _a, _b, _c, _d;
|
86
|
-
return (h(Host, { key: '
|
87
|
-
|
88
|
-
|
89
|
+
var _a, _b, _c, _d, _e;
|
90
|
+
return (h(Host, { key: '72be0f8b2d2eb537dc174bdc74aafa9b3c5a80e6', id: this.id, class: { 'disabled': this.disabled, 'focused': this.hasFocus, 'has-value': Boolean(this.selectedValue) } }, this.label && (h("label", { key: '95a25acd1fad10b5ce01be175f5469468dbe5cdb', class: "label", htmlFor: this.inputId }, this.label, this.required ? '*' : ' ', !this.required && this.showOptionalLabel ? h("span", { class: "optional-label" }, "(optional)") : '')), h("div", { key: '1f19b97f0d973264a9fa4c814b43095249496431', id: "select-container", class: { 'select-container': true, 'error-container': Boolean(this.errorText) }, onMouseDown: this.handleClick }, this.hasSelectedItem && this.showFormattedSelectedItem && h("slot", { key: '325527b35284e3058551175b2c392be1557a1a5e', name: "selected-item" }), h("div", { key: '4da5f55d383ee4725f81bd6d9d174c9231d74f1a', class: { 'selected-container-content': true, 'hidden': this.showFormattedSelectedItem }, id: "selected-container-content", style: {} }, (!this.hasSelectedItem || !this.showFormattedSelectedItem) && (h("cpsl-text", { key: 'bc83e992888ae73bc863d96ef11d2b849a6f60f8', class: { 'selected-text': true, 'placeholder': !this.selectedValue } }, !this.selectedValue ? ((_a = this.placeholder) !== null && _a !== void 0 ? _a : 'Select') : ((_c = (_b = this.formatValue) === null || _b === void 0 ? void 0 : _b.call(this, this.selectedValue)) !== null && _c !== void 0 ? _c : this.selectedValue)))), h("cpsl-icon", { key: 'f96b40c6101c561b1e7cc605f157697209dd1e59', class: { 'chevron': true, 'open': this.popoverOpen, 'has-value': Boolean(this.selectedValue) }, icon: "chevronUp" }), h("input", { key: '8f660d9215da0960eb4ca37292fd4c400b65de77', id: this.inputId, disabled: this.disabled, class: { disabled: this.disabled }, value: this.selectedValue, onFocus: this.onFocus, onBlur: this.onBlur, onKeyPress: this.handleEnterPress, inputmode: "none" })), (this.errorText || this.helperText) && (h("div", { key: '26eacb913e1d727ada026ef75a9d7d96478bae9b', class: { 'helper-text-container': true, 'error-text': Boolean(this.errorText) } }, h("span", { key: '3ec7937586e52f0858c2e4595596349d8ae4a57d' }, (_d = this.errorText) !== null && _d !== void 0 ? _d : this.helperText))), h("cpsl-popover", { key: '746e0d3b68f1f550c44cdb00f1a846209b34957d', part: "popover", autoWidth: this.autoWidth, trigger: this.id, preventBlur: this.hasFocus, disabled: this.disabled, anchorEl: this.anchorEl }, h("div", { key: 'c1ec487ab2857c0613f3748123d25da32793a008', part: "dropdown", class: "dropdown" }, this.showSearch && (h("div", { key: '342450b93fa5b20d7663c8390ed006921e77b9d4', class: "search-container" }, h("cpsl-input", { key: 'a72472c811025a6d60e4c9bebe37fe7b56707f5d', onClick: e => e.stopPropagation(), placeholder: (_e = this.searchPlaceholder) !== null && _e !== void 0 ? _e : 'Search', value: "", onCpslInput: e => {
|
91
|
+
e.stopPropagation();
|
92
|
+
this.cpslSearchChange.emit(e.detail.value);
|
93
|
+
} }))), h("div", { key: 'c6977cc371d4fb6fce0162d983c53a15dce89590', class: "dropdown-inner", style: { maxHeight: `${this.dropdownMaxHeight}px` } }, h("slot", { key: 'b867d8f557e56105b7a5c7a5f84d26ef3fd25ac5', name: "items" }))))));
|
89
94
|
}
|
90
95
|
static get is() { return "cpsl-select"; }
|
91
96
|
static get encapsulation() { return "shadow"; }
|
@@ -101,6 +106,41 @@ export class CpslSelect {
|
|
101
106
|
}
|
102
107
|
static get properties() {
|
103
108
|
return {
|
109
|
+
"anchorElId": {
|
110
|
+
"type": "string",
|
111
|
+
"mutable": false,
|
112
|
+
"complexType": {
|
113
|
+
"original": "string",
|
114
|
+
"resolved": "string",
|
115
|
+
"references": {}
|
116
|
+
},
|
117
|
+
"required": false,
|
118
|
+
"optional": true,
|
119
|
+
"docs": {
|
120
|
+
"tags": [],
|
121
|
+
"text": "ID of element to anchor popover to."
|
122
|
+
},
|
123
|
+
"attribute": "anchor-el-id",
|
124
|
+
"reflect": false
|
125
|
+
},
|
126
|
+
"autoWidth": {
|
127
|
+
"type": "boolean",
|
128
|
+
"mutable": false,
|
129
|
+
"complexType": {
|
130
|
+
"original": "boolean",
|
131
|
+
"resolved": "boolean",
|
132
|
+
"references": {}
|
133
|
+
},
|
134
|
+
"required": false,
|
135
|
+
"optional": true,
|
136
|
+
"docs": {
|
137
|
+
"tags": [],
|
138
|
+
"text": "If `true` the popover container will use the width of the content, else it will be set to the width of the trigger.\nDefault is `false`"
|
139
|
+
},
|
140
|
+
"attribute": "auto-width",
|
141
|
+
"reflect": false,
|
142
|
+
"defaultValue": "false"
|
143
|
+
},
|
104
144
|
"disabled": {
|
105
145
|
"type": "boolean",
|
106
146
|
"mutable": false,
|
@@ -306,6 +346,41 @@ export class CpslSelect {
|
|
306
346
|
"attribute": "show-optional-label",
|
307
347
|
"reflect": false,
|
308
348
|
"defaultValue": "false"
|
349
|
+
},
|
350
|
+
"showSearch": {
|
351
|
+
"type": "boolean",
|
352
|
+
"mutable": false,
|
353
|
+
"complexType": {
|
354
|
+
"original": "boolean",
|
355
|
+
"resolved": "boolean",
|
356
|
+
"references": {}
|
357
|
+
},
|
358
|
+
"required": false,
|
359
|
+
"optional": false,
|
360
|
+
"docs": {
|
361
|
+
"tags": [],
|
362
|
+
"text": "If `true`, the dropdown will contain a search field."
|
363
|
+
},
|
364
|
+
"attribute": "show-search",
|
365
|
+
"reflect": false,
|
366
|
+
"defaultValue": "false"
|
367
|
+
},
|
368
|
+
"searchPlaceholder": {
|
369
|
+
"type": "string",
|
370
|
+
"mutable": false,
|
371
|
+
"complexType": {
|
372
|
+
"original": "string",
|
373
|
+
"resolved": "string",
|
374
|
+
"references": {}
|
375
|
+
},
|
376
|
+
"required": false,
|
377
|
+
"optional": true,
|
378
|
+
"docs": {
|
379
|
+
"tags": [],
|
380
|
+
"text": "Placeholder for the search field."
|
381
|
+
},
|
382
|
+
"attribute": "search-placeholder",
|
383
|
+
"reflect": false
|
309
384
|
}
|
310
385
|
};
|
311
386
|
}
|
@@ -373,6 +448,21 @@ export class CpslSelect {
|
|
373
448
|
"resolved": "string",
|
374
449
|
"references": {}
|
375
450
|
}
|
451
|
+
}, {
|
452
|
+
"method": "cpslSearchChange",
|
453
|
+
"name": "cpslSearchChange",
|
454
|
+
"bubbles": true,
|
455
|
+
"cancelable": true,
|
456
|
+
"composed": true,
|
457
|
+
"docs": {
|
458
|
+
"tags": [],
|
459
|
+
"text": "Emitted when the search value changes."
|
460
|
+
},
|
461
|
+
"complexType": {
|
462
|
+
"original": "string",
|
463
|
+
"resolved": "string",
|
464
|
+
"references": {}
|
465
|
+
}
|
376
466
|
}];
|
377
467
|
}
|
378
468
|
static get elementRef() { return "el"; }
|