@usecapsule/core-components 3.3.0-dev.0 → 3.3.0-dev.1
Sign up to get free protection for your applications and to get access to all the features.
- package/css/capsule-core.css +10 -25
- 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-0462f723.js +2 -0
- package/dist/capsule/p-0462f723.js.map +1 -0
- package/dist/capsule/p-05cb769b.entry.js +10 -0
- package/dist/capsule/{p-0e558c7f.entry.js.map → p-05cb769b.entry.js.map} +1 -1
- package/dist/capsule/p-0eea90f8.entry.js +2 -0
- package/dist/capsule/p-4203888d.entry.js +29 -0
- package/dist/capsule/p-4203888d.entry.js.map +1 -0
- package/dist/capsule/{p-1bd11889.entry.js → p-69c3c53b.entry.js} +2 -2
- package/dist/capsule/{p-1bd11889.entry.js.map → p-69c3c53b.entry.js.map} +1 -1
- package/dist/capsule/{p-5d62e610.entry.js → p-742bda0b.entry.js} +2 -2
- package/dist/capsule/p-c1aa1ffb.entry.js +2 -0
- package/dist/capsule/{p-5965b15e.entry.js.map → p-c1aa1ffb.entry.js.map} +1 -1
- package/dist/capsule/p-d351f076.entry.js +2 -0
- package/dist/capsule/p-d351f076.entry.js.map +1 -0
- package/dist/cjs/_commonjsHelpers-b3309d7b.js +12 -0
- package/dist/cjs/_commonjsHelpers-b3309d7b.js.map +1 -0
- package/dist/cjs/capsule.cjs.js +1 -1
- package/dist/cjs/{cpsl-alert_34.cjs.entry.js → cpsl-alert_33.cjs.entry.js} +13368 -16935
- package/dist/cjs/cpsl-alert_33.cjs.entry.js.map +1 -0
- package/dist/cjs/cpsl-animation.cjs.entry.js +2 -3
- package/dist/cjs/cpsl-animation.cjs.entry.js.map +1 -1
- package/dist/cjs/cpsl-hero.cjs.entry.js +6 -9
- 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 +12 -35
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/assets/icons/index.js +1 -21
- package/dist/collection/assets/icons/index.js.map +1 -1
- package/dist/collection/assets/icons/refresh.svg +3 -3
- package/dist/collection/collection-manifest.json +1 -2
- package/dist/collection/components/cpsl-alert/cpsl-alert.js +2 -2
- package/dist/collection/components/cpsl-alert/cpsl-alert.js.map +1 -1
- package/dist/collection/components/cpsl-button/cpsl-button.css +2 -89
- package/dist/collection/components/cpsl-button/cpsl-button.js +5 -6
- 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-card/cpsl-card.css +2 -5
- package/dist/collection/components/cpsl-code-input/cpsl-code-input.css +0 -3
- package/dist/collection/components/cpsl-code-input/cpsl-code-input.js +7 -11
- package/dist/collection/components/cpsl-code-input/cpsl-code-input.js.map +1 -1
- package/dist/collection/components/cpsl-divider/cpsl-divider.css +1 -2
- package/dist/collection/components/cpsl-drawer/cpsl-drawer.js +1 -1
- 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 +6 -1
- package/dist/collection/components/cpsl-file-upload/cpsl-file-upload.js.map +1 -1
- package/dist/collection/components/cpsl-hero/cpsl-hero.css +71 -136
- package/dist/collection/components/cpsl-hero/cpsl-hero.js +9 -63
- package/dist/collection/components/cpsl-hero/cpsl-hero.js.map +1 -1
- package/dist/collection/components/cpsl-icon/cpsl-icon.css +0 -8
- package/dist/collection/components/cpsl-icon/cpsl-icon.js +2 -2
- package/dist/collection/components/cpsl-identicon/cpsl-identicon.js +1 -1
- package/dist/collection/components/cpsl-info-box/cpsl-info-box.css +2 -1
- package/dist/collection/components/cpsl-info-box/cpsl-info-box.js +1 -1
- package/dist/collection/components/cpsl-input/cpsl-input.css +2 -21
- package/dist/collection/components/cpsl-input/cpsl-input.js +28 -100
- package/dist/collection/components/cpsl-input/cpsl-input.js.map +1 -1
- package/dist/collection/components/{cpsl-auth-modal/cpsl-auth-modal.css → cpsl-modal/cpsl-modal.css} +58 -33
- package/dist/collection/components/{cpsl-auth-modal/cpsl-auth-modal.js → cpsl-modal/cpsl-modal.js} +129 -11
- package/dist/collection/components/cpsl-modal/cpsl-modal.js.map +1 -0
- 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 +1 -1
- package/dist/collection/components/cpsl-overlay/cpsl-overlay.js +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 +0 -2
- package/dist/collection/components/cpsl-popover/cpsl-popover.js +11 -9
- package/dist/collection/components/cpsl-popover/cpsl-popover.js.map +1 -1
- package/dist/collection/components/cpsl-qr-code/cpsl-qr-code.css +3 -12
- package/dist/collection/components/cpsl-qr-code/cpsl-qr-code.js +23 -28
- 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 +0 -17
- package/dist/collection/components/cpsl-select/cpsl-select.js +5 -95
- 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 +8 -30
- package/dist/collection/components/cpsl-spinner/cpsl-spinner.js +7 -5
- 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 +1 -24
- 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 +9 -1
- package/dist/collection/components/cpsl-table/cpsl-table.js.map +1 -1
- package/dist/collection/components/cpsl-tabs/cpsl-tabs.css +4 -1
- package/dist/collection/components/cpsl-tabs/cpsl-tabs.js +4 -1
- package/dist/collection/components/cpsl-tabs/cpsl-tabs.js.map +1 -1
- package/dist/collection/components/cpsl-text/cpsl-text.css +0 -19
- package/dist/collection/components/cpsl-text/cpsl-text.js +4 -5
- package/dist/collection/components/cpsl-text/cpsl-text.js.map +1 -1
- package/dist/collection/components/cpsl-tile-button/cpsl-tile-button.css +1 -3
- 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 +3 -4
- package/dist/collection/utils/theme/generateBorderRadii.js.map +1 -1
- package/dist/collection/utils/theme/generatePalette.js +6 -22
- package/dist/collection/utils/theme/generatePalette.js.map +1 -1
- package/dist/collection/utils/theme/generateTheme.js +3 -9
- package/dist/collection/utils/theme/generateTheme.js.map +1 -1
- package/dist/collection/utils/theme/utils.js.map +1 -1
- package/dist/esm/_commonjsHelpers-1789f0cf.js +9 -0
- package/dist/esm/_commonjsHelpers-1789f0cf.js.map +1 -0
- package/dist/esm/capsule.js +1 -1
- package/dist/esm/{cpsl-alert_34.entry.js → cpsl-alert_33.entry.js} +13370 -16936
- package/dist/esm/cpsl-alert_33.entry.js.map +1 -0
- package/dist/esm/cpsl-animation.entry.js +1 -2
- package/dist/esm/cpsl-animation.entry.js.map +1 -1
- package/dist/esm/cpsl-hero.entry.js +7 -10
- 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 +12 -35
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/assets/icons/index.d.ts +0 -20
- package/dist/types/components/cpsl-button/cpsl-button.d.ts +2 -2
- package/dist/types/components/cpsl-hero/cpsl-hero.d.ts +3 -18
- package/dist/types/components/cpsl-input/cpsl-input.d.ts +3 -13
- package/dist/types/components/{cpsl-auth-modal/cpsl-auth-modal.d.ts → cpsl-modal/cpsl-modal.d.ts} +23 -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 +0 -1
- package/dist/types/components/cpsl-select/cpsl-select.d.ts +1 -22
- package/dist/types/components/cpsl-text/cpsl-text.d.ts +1 -1
- package/dist/types/components.d.ts +146 -222
- package/dist/types/interface.d.ts +0 -13
- package/dist/types/utils/theme/generateBorderRadii.d.ts +1 -1
- package/dist/types/utils/theme/generatePalette.d.ts +2 -4
- package/dist/types/utils/theme/generateTheme.d.ts +1 -1
- package/package.json +2 -3
- package/dist/capsule/p-0e558c7f.entry.js +0 -10
- package/dist/capsule/p-32cdf894.entry.js +0 -2
- package/dist/capsule/p-32cdf894.entry.js.map +0 -1
- package/dist/capsule/p-3b042fd1.entry.js +0 -2
- package/dist/capsule/p-5965b15e.entry.js +0 -2
- package/dist/capsule/p-60508b1e.entry.js +0 -20
- package/dist/capsule/p-60508b1e.entry.js.map +0 -1
- package/dist/cjs/cpsl-alert_34.cjs.entry.js.map +0 -1
- package/dist/collection/assets/icons/arrow-circle-broken-down-left.svg +0 -3
- package/dist/collection/assets/icons/bank.svg +0 -3
- package/dist/collection/assets/icons/credit-card.svg +0 -3
- package/dist/collection/assets/icons/dot.svg +0 -3
- package/dist/collection/assets/icons/download.svg +0 -3
- package/dist/collection/assets/icons/globe.svg +0 -3
- package/dist/collection/assets/icons/hero-alert-circle.svg +0 -3
- package/dist/collection/assets/icons/hero-checkmark-capsule.svg +0 -11
- package/dist/collection/assets/icons/hero-checkmark.svg +0 -3
- package/dist/collection/assets/icons/hero-external-connection.svg +0 -71
- package/dist/collection/assets/icons/link-external.svg +0 -3
- package/dist/collection/assets/icons/log-out.svg +0 -3
- package/dist/collection/assets/icons/moonpay-brand.svg +0 -10
- package/dist/collection/assets/icons/puzzle-piece.svg +0 -3
- package/dist/collection/assets/icons/qr-code-02.svg +0 -3
- package/dist/collection/assets/icons/qr-code.svg +0 -3
- package/dist/collection/assets/icons/search.svg +0 -3
- package/dist/collection/assets/icons/send.svg +0 -3
- package/dist/collection/assets/icons/shield.svg +0 -3
- package/dist/collection/assets/icons/stripe-brand.svg +0 -3
- package/dist/collection/components/cpsl-auth-modal/cpsl-auth-modal.js.map +0 -1
- package/dist/collection/components/cpsl-icon-group/cpsl-icon-group.css +0 -97
- package/dist/collection/components/cpsl-icon-group/cpsl-icon-group.js +0 -121
- package/dist/collection/components/cpsl-icon-group/cpsl-icon-group.js.map +0 -1
- package/dist/esm/cpsl-alert_34.entry.js.map +0 -1
- package/dist/types/components/cpsl-icon-group/cpsl-icon-group.d.ts +0 -20
- /package/dist/capsule/{p-3b042fd1.entry.js.map → p-0eea90f8.entry.js.map} +0 -0
- /package/dist/capsule/{p-5d62e610.entry.js.map → p-742bda0b.entry.js.map} +0 -0
@@ -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":"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,aAAa,MAAM,iBAAiB,CAAC;AAO5C,MAAM,OAAO,UAAU;;;;oBAiBG,GAAG;;IAE3B,gBAAgB;QACd,MAAM,SAAS,GAAG,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;QAEpE,SAAS,CAAC,SAAS,GAAG,EAAE,CAAC;QAEzB,MAAM,MAAM,GAAG,IAAI,aAAa,CAAC;YAC/B,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,IAAI,CAAC,GAAG;YACd,KAAK,EAAE,IAAI,CAAC,QAAQ;YACpB,MAAM,EAAE,IAAI,CAAC,IAAI;YACjB,KAAK,EAAE,IAAI,CAAC,IAAI;YAChB,SAAS,EAAE,EAAE,oBAAoB,EAAE,GAAG,EAAE;YACxC,iBAAiB,EAAE;gBACjB,KAAK,EAAE,aAAa;aACrB;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,MAAM;gBACZ,KAAK,EAAE,cAAc;aACtB;YACD,oBAAoB,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE;YAC/C,iBAAiB,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE;YAClC,YAAY,EAAE;gBACZ,WAAW,EAAE,WAAW;aACzB;SACF,CAAC,CAAC;QAEH,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAC3B,CAAC;IAED,MAAM;QACJ,OAAO,CACL,EAAC,IAAI;YACH,4DACE,EAAE,EAAC,cAAc,EACjB,KAAK,EAAC,cAAc,GAEpB,CACG,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, h, Element, Prop } from '@stencil/core';\nimport QRCodeStyling from 'qr-code-styling';\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 = 250;\n\n componentDidLoad() {\n const container = this.el.shadowRoot.getElementById('qr-container');\n\n container.innerHTML = '';\n\n const qrCode = new QRCodeStyling({\n type: 'svg',\n data: this.url,\n image: this.imageSrc,\n height: this.size,\n width: this.size,\n qrOptions: { errorCorrectionLevel: 'L' },\n backgroundOptions: {\n color: 'transparent',\n },\n dotsOptions: {\n type: 'dots',\n color: 'currentColor',\n },\n cornersSquareOptions: { type: 'extra-rounded' },\n cornersDotOptions: { type: 'dot' },\n imageOptions: {\n crossOrigin: 'anonymous',\n },\n });\n\n qrCode.append(container);\n }\n\n render() {\n return (\n <Host>\n <div\n id=\"qr-container\"\n class=\"qr-container\"\n // style={{ height: `${this.size - 10 ?? 240}px`, width: `${this.size - 10 ?? 240}px` }}\n />\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: '96a55091ded8f5437089b71617066f2312c8e496' }, h("input", { key: '0aed505c49051a99fbfc90225fd057cc0a1f525e', type: "radio", checked: this.checked }), h("span", { key: 'f44d22c6ac7152ca0760f17d810e4b3fe12ff78f', 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: '63ac746920b1acf41ea6083e67dd61c9b1f480f1' }, h("slot", { key: '35cf9026a0009abf96f990114afec3d509c81063' })));
|
5
5
|
}
|
6
6
|
static get is() { return "cpsl-row"; }
|
7
7
|
static get encapsulation() { return "shadow"; }
|
@@ -83,8 +83,6 @@
|
|
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;
|
88
86
|
display: flex;
|
89
87
|
flex-direction: column;
|
90
88
|
gap: 4px;
|
@@ -192,16 +190,11 @@ input.disabled {
|
|
192
190
|
.selected-container-content {
|
193
191
|
flex: 1;
|
194
192
|
}
|
195
|
-
.selected-container-content.hidden {
|
196
|
-
display: none;
|
197
|
-
}
|
198
193
|
|
199
194
|
.chevron {
|
200
195
|
transition: transform 0.3s ease;
|
201
196
|
transform: rotate(180deg);
|
202
197
|
--icon-color: var(--cpsl-color-text-disabled);
|
203
|
-
--height: var(--icon-height);
|
204
|
-
--width: var(--icon-width);
|
205
198
|
}
|
206
199
|
.chevron.open {
|
207
200
|
transform: rotate(0deg);
|
@@ -233,14 +226,4 @@ input.disabled {
|
|
233
226
|
.dropdown-inner {
|
234
227
|
overflow: auto;
|
235
228
|
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);
|
246
229
|
}
|
@@ -48,8 +48,6 @@ 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;
|
53
51
|
this.disabled = false;
|
54
52
|
this.dropdownMaxHeight = undefined;
|
55
53
|
this.errorText = undefined;
|
@@ -62,8 +60,6 @@ export class CpslSelect {
|
|
62
60
|
this.selectedValue = undefined;
|
63
61
|
this.showFormattedSelectedItem = undefined;
|
64
62
|
this.showOptionalLabel = false;
|
65
|
-
this.showSearch = false;
|
66
|
-
this.searchPlaceholder = undefined;
|
67
63
|
}
|
68
64
|
onValueChange() {
|
69
65
|
this.popoverEl.closePopover();
|
@@ -82,15 +78,14 @@ export class CpslSelect {
|
|
82
78
|
}
|
83
79
|
componentDidLoad() {
|
84
80
|
this.popoverEl = this.el.shadowRoot.querySelector(`cpsl-popover`);
|
85
|
-
this.anchorEl = this.
|
81
|
+
this.anchorEl = this.el.shadowRoot.getElementById('select-container');
|
86
82
|
this.selectItem();
|
87
83
|
}
|
88
84
|
render() {
|
89
|
-
var _a, _b, _c, _d
|
90
|
-
return (h(Host, { key: '
|
91
|
-
|
92
|
-
|
93
|
-
} }))), h("div", { key: 'c6977cc371d4fb6fce0162d983c53a15dce89590', class: "dropdown-inner", style: { maxHeight: `${this.dropdownMaxHeight}px` } }, h("slot", { key: 'b867d8f557e56105b7a5c7a5f84d26ef3fd25ac5', name: "items" }))))));
|
85
|
+
var _a, _b, _c, _d;
|
86
|
+
return (h(Host, { key: '50f16e4ffbc8ccd431d957e55dc07455eb5e5c9b', id: this.id, class: { 'disabled': this.disabled, 'focused': this.hasFocus, 'has-value': Boolean(this.selectedValue) } }, this.label && (h("label", { key: '47170480aec48780e1bb3b7b2a26b37fa8866f7e', class: "label", htmlFor: this.inputId }, this.label, this.required ? '*' : ' ', !this.required && this.showOptionalLabel ? h("span", { class: "optional-label" }, "(optional)") : '')), h("div", { key: '1636db18d4ec355ed48dee0105f26c543a2938b0', id: "select-container", class: { 'select-container': true, 'error-container': Boolean(this.errorText) }, onMouseDown: this.handleClick }, this.hasSelectedItem && this.showFormattedSelectedItem && h("slot", { key: 'a2c97abeb6bb7bba8d98dafb4076cfe0d3069a0a', name: "selected-item" }), h("div", { key: 'dc97728bb0f38408a66277a63b1109ab0bcc7dd3', class: "selected-container-content", id: "selected-container-content" }, (!this.hasSelectedItem || !this.showFormattedSelectedItem) && (h("cpsl-text", { key: 'd90420a0312ae7e6b2a44a738d3b6503328d5c28', class: { 'selected-text': true, 'placeholder': !this.selectedValue } }, !this.selectedValue
|
87
|
+
? ((_a = this.placeholder) !== null && _a !== void 0 ? _a : 'Select')
|
88
|
+
: ((_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: 'f8e82e83797286597bfef061e78f3768b10501c8', class: { 'chevron': true, 'open': this.popoverOpen, 'has-value': Boolean(this.selectedValue) }, icon: "chevronUp" }), h("input", { key: 'e834e3441fe01c9d8a0eecb87a97e3d7451e69fa', 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: 'ec6db31b7f9946c2901b7228bd48cb81c35c6d42', class: { 'helper-text-container': true, 'error-text': Boolean(this.errorText) } }, h("span", { key: '45a5695523c4d3b4b96771c766a853c6652910a9' }, (_d = this.errorText) !== null && _d !== void 0 ? _d : this.helperText))), h("cpsl-popover", { key: 'fb10a30be9d95efebca36301fb18cf98767a906b', autoWidth: false, trigger: this.id, preventBlur: this.hasFocus, disabled: this.disabled, anchorEl: this.anchorEl }, h("div", { key: '13f4a873f7e04d3bf97e8be07b13b6a9c74da366', class: "dropdown" }, h("div", { key: 'cc69d0f8ea88c6e8f83ef85a126b011fafdc9159', class: "dropdown-inner", style: { maxHeight: `${this.dropdownMaxHeight}px` } }, h("slot", { key: '67a9a69df08e585b81855ac0ca1b8dda17e1888c', name: "items" }))))));
|
94
89
|
}
|
95
90
|
static get is() { return "cpsl-select"; }
|
96
91
|
static get encapsulation() { return "shadow"; }
|
@@ -106,41 +101,6 @@ export class CpslSelect {
|
|
106
101
|
}
|
107
102
|
static get properties() {
|
108
103
|
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
|
-
},
|
144
104
|
"disabled": {
|
145
105
|
"type": "boolean",
|
146
106
|
"mutable": false,
|
@@ -346,41 +306,6 @@ export class CpslSelect {
|
|
346
306
|
"attribute": "show-optional-label",
|
347
307
|
"reflect": false,
|
348
308
|
"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
|
384
309
|
}
|
385
310
|
};
|
386
311
|
}
|
@@ -448,21 +373,6 @@ export class CpslSelect {
|
|
448
373
|
"resolved": "string",
|
449
374
|
"references": {}
|
450
375
|
}
|
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
|
-
}
|
466
376
|
}];
|
467
377
|
}
|
468
378
|
static get elementRef() { return "el"; }
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"cpsl-select.js","sourceRoot":"","sources":["../../../../src/components/cpsl-select/cpsl-select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAgB,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAO7G,MAAM,OAAO,UAAU;;QAGb,YAAO,GAAG,eAAe,QAAQ,EAAE,EAAE,CAAC;QA6ItC,WAAM,GAAG,CAAC,EAAc,EAAE,EAAE;YAClC,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;YAEtB,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,CAAC;YAE9B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACzB,CAAC,CAAC;QAEM,YAAO,GAAG,CAAC,EAAc,EAAE,EAAE;YACnC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;YAErB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC1B,CAAC,CAAC;QAEM,qBAAgB,GAAG,CAAC,EAAiB,EAAE,EAAE;YAC/C,IAAI,EAAE,CAAC,GAAG,KAAK,OAAO,EAAE,CAAC;gBACvB,EAAE,CAAC,cAAc,EAAE,CAAC;gBACpB,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,IAAI,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC;YACrD,CAAC;QACH,CAAC,CAAC;QAEM,eAAU,GAAG,GAAG,EAAE;YACxB,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,CAAgC,CAAC;YAEtG,K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F,CACO,CACV,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF;AAED,IAAI,QAAQ,GAAG,CAAC,CAAC","sourcesContent":["import { Component, Host, Element, h, Prop, State, EventEmitter, Event, Watch, Listen } from '@stencil/core';\n\n@Component({\n tag: 'cpsl-select',\n styleUrl: 'cpsl-select.scss',\n shadow: true,\n})\nexport class CpslSelect {\n @Element() el!: HTMLCpslSelectElement;\n private popoverEl!: HTMLCpslPopoverElement;\n private inputId = `cpsl-select-${inputIds++}`;\n\n @State() anchorEl!: HTMLElement;\n @State() hasFocus = false;\n @State() popoverOpen = false;\n @State() hasSelectedItem = false;\n\n /**\n * ID of element to anchor popover to.\n */\n @Prop() anchorElId?: string;\n\n /**\n * If `true` the popover container will use the width of the content, else it will be set to the width of the trigger.\n * Default is `false`\n */\n @Prop() autoWidth?: boolean = false;\n\n /**\n * If `true`, the user cannot interact with the input.\n */\n @Prop() disabled = false;\n\n /**\n * Set the max height of the dropdown.\n */\n @Prop() dropdownMaxHeight?: number;\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 * Format value for display when selected.\n */\n @Prop() formatValue?: (value: string) => 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 * ID of the element, must be unique for the popover trigger.\n */\n\n @Prop() id: string = `${this.inputId}-trigger`;\n\n /**\n * The label for the input.\n */\n @Prop() label?: string;\n\n /**\n * Placeholder to display if `selectedValue` is empty.\n */\n @Prop() placeholder?: string;\n\n /**\n * If `true`, the user must fill in a value before submitting a form.\n */\n @Prop() required = false;\n\n /**\n * Value of the selected item.\n */\n @Prop() selectedValue?: string;\n\n /**\n * Will show the formatted selected item (passed in the `selected-item` slot) in the select rather than the item value.\n */\n @Prop() showFormattedSelectedItem?: boolean;\n\n /**\n * If `true`, the label will display an \"optional\" tag.\n */\n @Prop() showOptionalLabel = false;\n\n /**\n * If `true`, the dropdown will contain a search field.\n */\n @Prop() showSearch = false;\n\n /**\n * Placeholder for the search field.\n */\n @Prop() searchPlaceholder?: string;\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 the value changes.\n */\n @Event() cpslSelectValueChange!: EventEmitter<string>;\n\n /**\n * Emitted when the search value changes.\n */\n @Event() cpslSearchChange!: EventEmitter<string>;\n\n @Watch('selectedValue')\n onValueChange() {\n this.popoverEl.closePopover();\n }\n\n @Watch('selectedValue')\n handleValueChange() {\n this.selectItem();\n }\n\n @Listen('cpslSelectItemClick')\n selectItemClickHandler(event: CustomEvent<string>) {\n this.cpslSelectValueChange.emit(event.detail);\n }\n\n @Listen('cpslOpen')\n onPopoverOpen() {\n this.popoverOpen = true;\n }\n\n @Listen('cpslClose')\n onPopoverClose() {\n this.popoverOpen = false;\n }\n\n componentDidLoad() {\n this.popoverEl = this.el.shadowRoot.querySelector(`cpsl-popover`) as HTMLCpslPopoverElement;\n this.anchorEl = this.anchorElId ? document.getElementById(this.anchorElId) : this.el.shadowRoot.getElementById('select-container');\n\n this.selectItem();\n }\n\n private onBlur = (ev: FocusEvent) => {\n this.hasFocus = false;\n\n this.popoverEl.closePopover();\n\n this.cpslBlur.emit(ev);\n };\n\n private onFocus = (ev: FocusEvent) => {\n this.hasFocus = true;\n\n this.cpslFocus.emit(ev);\n };\n\n private handleEnterPress = (ev: KeyboardEvent) => {\n if (ev.key === 'Enter') {\n ev.preventDefault();\n this.el.dispatchEvent(new MouseEvent('mousedown'));\n }\n };\n\n private selectItem = () => {\n const items = Array.from(this.el.querySelectorAll('cpsl-select-item')) as HTMLCpslSelectItemElement[];\n\n items.forEach(item => {\n if (item.value === this.selectedValue) {\n item.setAttribute('selected', 'true');\n this.hasSelectedItem = true;\n } else {\n item.setAttribute('selected', 'false');\n }\n });\n\n if (!this.selectedValue) {\n this.hasSelectedItem = false;\n }\n };\n\n private handleClickOutside = (event: MouseEvent) => {\n if (this.hasFocus && !this.el.contains(event.target as Node)) {\n this.hasFocus = false;\n window.removeEventListener('click', this.handleClickOutside);\n }\n };\n\n private handleClick = () => {\n if (!this.disabled) {\n this.hasFocus = true;\n window.addEventListener('click', this.handleClickOutside);\n }\n };\n\n render() {\n return (\n <Host id={this.id} class={{ 'disabled': this.disabled, 'focused': this.hasFocus, 'has-value': Boolean(this.selectedValue) }}>\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 id=\"select-container\" class={{ 'select-container': true, 'error-container': Boolean(this.errorText) }} onMouseDown={this.handleClick}>\n {this.hasSelectedItem && this.showFormattedSelectedItem && <slot name=\"selected-item\"></slot>}\n <div class={{ 'selected-container-content': true, 'hidden': this.showFormattedSelectedItem }} id=\"selected-container-content\" style={{}}>\n {(!this.hasSelectedItem || !this.showFormattedSelectedItem) && (\n <cpsl-text class={{ 'selected-text': true, 'placeholder': !this.selectedValue }}>\n {!this.selectedValue ? (this.placeholder ?? 'Select') : (this.formatValue?.(this.selectedValue) ?? this.selectedValue)}\n </cpsl-text>\n )}\n </div>\n <cpsl-icon class={{ 'chevron': true, 'open': this.popoverOpen, 'has-value': Boolean(this.selectedValue) }} icon=\"chevronUp\" />\n <input\n id={this.inputId}\n disabled={this.disabled}\n class={{ disabled: this.disabled }}\n value={this.selectedValue}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n onKeyPress={this.handleEnterPress}\n inputmode=\"none\"\n />\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 <cpsl-popover part=\"popover\" autoWidth={this.autoWidth} trigger={this.id} preventBlur={this.hasFocus} disabled={this.disabled} anchorEl={this.anchorEl}>\n <div part=\"dropdown\" class=\"dropdown\">\n {this.showSearch && (\n <div class=\"search-container\">\n <cpsl-input\n onClick={e => e.stopPropagation()}\n placeholder={this.searchPlaceholder ?? 'Search'}\n value=\"\"\n onCpslInput={e => {\n e.stopPropagation();\n this.cpslSearchChange.emit(e.detail.value);\n }}\n />\n </div>\n )}\n <div class=\"dropdown-inner\" style={{ maxHeight: `${this.dropdownMaxHeight}px` }}>\n <slot name=\"items\"></slot>\n </div>\n </div>\n </cpsl-popover>\n </Host>\n );\n }\n}\n\nlet inputIds = 0;\n"]}
|
1
|
+
{"version":3,"file":"cpsl-select.js","sourceRoot":"","sources":["../../../../src/components/cpsl-select/cpsl-select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAgB,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAO7G,MAAM,OAAO,UAAU;;QAGb,YAAO,GAAG,eAAe,QAAQ,EAAE,EAAE,CAAC;QAmHtC,WAAM,GAAG,CAAC,EAAc,EAAE,EAAE;YAClC,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;YAEtB,IAAI,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CACV,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF;AAED,IAAI,QAAQ,GAAG,CAAC,CAAC","sourcesContent":["import { Component, Host, Element, h, Prop, State, EventEmitter, Event, Watch, Listen } from '@stencil/core';\n\n@Component({\n tag: 'cpsl-select',\n styleUrl: 'cpsl-select.scss',\n shadow: true,\n})\nexport class CpslSelect {\n @Element() el!: HTMLCpslSelectElement;\n private popoverEl!: HTMLCpslPopoverElement;\n private inputId = `cpsl-select-${inputIds++}`;\n\n @State() anchorEl!: HTMLDivElement;\n @State() hasFocus = false;\n @State() popoverOpen = false;\n @State() hasSelectedItem = false;\n\n /**\n * If `true`, the user cannot interact with the input.\n */\n @Prop() disabled = false;\n\n /**\n * Set the max height of the dropdown.\n */\n @Prop() dropdownMaxHeight?: number;\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 * Format value for display when selected.\n */\n @Prop() formatValue?: (value: string) => 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 * ID of the element, must be unique for the popover trigger.\n */\n\n @Prop() id: string = `${this.inputId}-trigger`;\n\n /**\n * The label for the input.\n */\n @Prop() label?: string;\n\n /**\n * Placeholder to display if `selectedValue` is empty.\n */\n @Prop() placeholder?: string;\n\n /**\n * If `true`, the user must fill in a value before submitting a form.\n */\n @Prop() required = false;\n\n /**\n * Value of the selected item.\n */\n @Prop() selectedValue?: string;\n\n /**\n * Will show the formatted selected item (passed in the `selected-item` slot) in the select rather than the item value.\n */\n @Prop() showFormattedSelectedItem?: boolean;\n\n /**\n * If `true`, the label will display an \"optional\" tag.\n */\n @Prop() showOptionalLabel = false;\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 the value changes.\n */\n @Event() cpslSelectValueChange!: EventEmitter<string>;\n\n @Watch('selectedValue')\n onValueChange() {\n this.popoverEl.closePopover();\n }\n\n @Watch('selectedValue')\n handleValueChange() {\n this.selectItem();\n }\n\n @Listen('cpslSelectItemClick')\n selectItemClickHandler(event: CustomEvent<string>) {\n this.cpslSelectValueChange.emit(event.detail);\n }\n\n @Listen('cpslOpen')\n onPopoverOpen() {\n this.popoverOpen = true;\n }\n\n @Listen('cpslClose')\n onPopoverClose() {\n this.popoverOpen = false;\n }\n\n componentDidLoad() {\n this.popoverEl = this.el.shadowRoot.querySelector(`cpsl-popover`) as HTMLCpslPopoverElement;\n this.anchorEl = this.el.shadowRoot.getElementById('select-container') as HTMLDivElement;\n\n this.selectItem();\n }\n\n private onBlur = (ev: FocusEvent) => {\n this.hasFocus = false;\n\n this.popoverEl.closePopover();\n\n this.cpslBlur.emit(ev);\n };\n\n private onFocus = (ev: FocusEvent) => {\n this.hasFocus = true;\n\n this.cpslFocus.emit(ev);\n };\n\n private handleEnterPress = (ev: KeyboardEvent) => {\n if (ev.key === 'Enter') {\n ev.preventDefault();\n this.el.dispatchEvent(new MouseEvent('mousedown'));\n }\n };\n\n private selectItem = () => {\n const items = Array.from(this.el.querySelectorAll('cpsl-select-item')) as HTMLCpslSelectItemElement[];\n\n items.forEach(item => {\n if (item.value === this.selectedValue) {\n item.setAttribute('selected', 'true');\n this.hasSelectedItem = true;\n } else {\n item.setAttribute('selected', 'false');\n }\n });\n\n if (!this.selectedValue) {\n this.hasSelectedItem = false;\n }\n };\n\n private handleClickOutside = (event: MouseEvent) => {\n if (this.hasFocus && !this.el.contains(event.target as Node)) {\n this.hasFocus = false;\n window.removeEventListener('click', this.handleClickOutside);\n }\n };\n\n private handleClick = () => {\n if (!this.disabled) {\n this.hasFocus = true;\n window.addEventListener('click', this.handleClickOutside);\n }\n };\n\n render() {\n return (\n <Host\n id={this.id}\n class={{ 'disabled': this.disabled, 'focused': this.hasFocus, 'has-value': Boolean(this.selectedValue) }}\n >\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\n id=\"select-container\"\n class={{ 'select-container': true, 'error-container': Boolean(this.errorText) }}\n onMouseDown={this.handleClick}\n >\n {this.hasSelectedItem && this.showFormattedSelectedItem && <slot name=\"selected-item\"></slot>}\n <div class=\"selected-container-content\" id=\"selected-container-content\">\n {(!this.hasSelectedItem || !this.showFormattedSelectedItem) && (\n <cpsl-text class={{ 'selected-text': true, 'placeholder': !this.selectedValue }}>\n {!this.selectedValue\n ? (this.placeholder ?? 'Select')\n : (this.formatValue?.(this.selectedValue) ?? this.selectedValue)}\n </cpsl-text>\n )}\n </div>\n <cpsl-icon\n class={{ 'chevron': true, 'open': this.popoverOpen, 'has-value': Boolean(this.selectedValue) }}\n icon=\"chevronUp\"\n />\n <input\n id={this.inputId}\n disabled={this.disabled}\n class={{ disabled: this.disabled }}\n value={this.selectedValue}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n onKeyPress={this.handleEnterPress}\n inputmode=\"none\"\n />\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 <cpsl-popover\n autoWidth={false}\n trigger={this.id}\n preventBlur={this.hasFocus}\n disabled={this.disabled}\n anchorEl={this.anchorEl}\n >\n <div class=\"dropdown\">\n <div class=\"dropdown-inner\" style={{ maxHeight: `${this.dropdownMaxHeight}px` }}>\n <slot name=\"items\"></slot>\n </div>\n </div>\n </cpsl-popover>\n </Host>\n );\n }\n}\n\nlet inputIds = 0;\n"]}
|
@@ -8,7 +8,7 @@ export class CpslSelectItem {
|
|
8
8
|
this.value = undefined;
|
9
9
|
}
|
10
10
|
render() {
|
11
|
-
return (h(Host, { key: '
|
11
|
+
return (h(Host, { key: 'd85e6949e98e760b903a4bd3d2c02e000d15d466' }, h("div", { key: '548f93d1c69ee629a8ddba96d475d58d5ada93d1', class: "outer-container", onClick: this.handleItemClick }, h("div", { key: '47ba74f738353a4924410e0ec74289d23ba73756', class: { 'inner-container': true, 'selected': this.selected } }, h("slot", { key: 'ec50860e3996bbb673199d8d6d9df7aa7304b0e3' })))));
|
12
12
|
}
|
13
13
|
static get is() { return "cpsl-select-item"; }
|
14
14
|
static get encapsulation() { return "shadow"; }
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"cpsl-select-item.js","sourceRoot":"","sources":["../../../../src/components/cpsl-select-item/cpsl-select-item.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAgB,MAAM,eAAe,CAAC;AAO9E,MAAM,OAAO,cAAc;;QAiBjB,oBAAe,GAAG,GAAG,EAAE;YAC7B,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC5C,CAAC,CAAC;;;;IAEF,MAAM;QACJ,OAAO,CACL,EAAC,IAAI;YACH,4DAAK,
|
1
|
+
{"version":3,"file":"cpsl-select-item.js","sourceRoot":"","sources":["../../../../src/components/cpsl-select-item/cpsl-select-item.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAgB,MAAM,eAAe,CAAC;AAO9E,MAAM,OAAO,cAAc;;QAiBjB,oBAAe,GAAG,GAAG,EAAE;YAC7B,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC5C,CAAC,CAAC;;;;IAEF,MAAM;QACJ,OAAO,CACL,EAAC,IAAI;YACH,4DAAK,KAAK,EAAC,iBAAiB,EAAC,OAAO,EAAE,IAAI,CAAC,eAAe;gBACxD,4DAAK,KAAK,EAAE,EAAE,iBAAiB,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC,QAAQ,EAAE;oBAChE,8DAAa,CACT,CACF,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, Event, h, EventEmitter } from '@stencil/core';\n\n@Component({\n tag: 'cpsl-select-item',\n styleUrl: 'cpsl-select-item.scss',\n shadow: true,\n})\nexport class CpslSelectItem {\n /**\n * Whether the item is selected or not.\n */\n @Prop() selected?: boolean;\n\n /**\n * Value of the item.\n */\n @Prop() value: string;\n\n /**\n * Called when item is clicked.\n * @internal\n */\n @Event() cpslSelectItemClick: EventEmitter<string>;\n\n private handleItemClick = () => {\n this.cpslSelectItemClick.emit(this.value);\n };\n\n render() {\n return (\n <Host>\n <div class=\"outer-container\" onClick={this.handleItemClick}>\n <div class={{ 'inner-container': true, 'selected': this.selected }}>\n <slot></slot>\n </div>\n </div>\n </Host>\n );\n }\n}\n"]}
|
@@ -125,7 +125,7 @@ export class CpslSlideButton {
|
|
125
125
|
return this.el.shadowRoot.getElementById('end-icon');
|
126
126
|
}
|
127
127
|
render() {
|
128
|
-
return (h(Host, { key: '
|
128
|
+
return (h(Host, { key: '38abbc7fa26d82bf0f2c63494466d878f4cadae3' }, h("div", { key: '0cd53607002637a0da1e7d381746e96bbc45ad33', id: "slider-container", class: "slider-container" }, h("div", { key: 'a6947eb23b1ca7ca22b365483618ef074a71c34f', id: "start-slider-container-background", class: { 'start-slider-container-background': true, 'slider-container-background': true } }), h("div", { key: '897abd9fa09a132df76b0f007b9fa38bac25b235', id: "end-slider-container-background", class: { 'end-slider-container-background': true, 'slider-container-background': true } }), h("div", { key: 'db5025b01da708cceb2c29938029710811f259c9', id: "slider", class: { slider: true, disabled: this.disabled } }, h("cpsl-icon", { key: '63ac51986d1eb52937a14555fec9ae19106fe8c6', id: "start-icon", class: { 'start-icon': true, 'icon': true }, icon: this.startIcon }), h("cpsl-icon", { key: '23f63127aebdc87278c760644838a91332a44b28', id: "end-icon", class: { 'end-icon': true, 'icon': true }, icon: this.endIcon })), h("span", { key: '305f60cf83a49feb0e2f3d3e7655bfd5f53582db', id: "start-text", class: { 'start-text': true, 'disabled': this.disabled } }, this.startText), h("span", { key: '0753f4f241fb4ac34e619539e0a1ec1ade2892bc', id: "end-text", class: "end-text" }, this.endText))));
|
129
129
|
}
|
130
130
|
static get is() { return "cpsl-slide-button"; }
|
131
131
|
static get encapsulation() { return "shadow"; }
|
@@ -163,7 +163,7 @@ export class CpslSlideButton {
|
|
163
163
|
"mutable": false,
|
164
164
|
"complexType": {
|
165
165
|
"original": "IconType",
|
166
|
-
"resolved": "\"
|
166
|
+
"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\" | \"downloadCloud\" | \"dribbbleBrand\" | \"dribbble\" | \"earth\" | \"eyeOff\" | \"eye\" | \"facebookBrand\" | \"facebook\" | \"farcasterBrand\" | \"farcaster\" | \"figmaBrand\" | \"figma\" | \"file\" | \"githubBrand\" | \"github\" | \"googleBrand\" | \"google\" | \"helpCircle\" | \"heroEmail\" | \"heroLock\" | \"heroPasskey\" | \"heroPhone\" | \"heroWallet\" | \"home\" | \"image\" | \"infoCircle\" | \"instagramBrand\" | \"instagram\" | \"key\" | \"lightning01\" | \"lightning\" | \"linkedinBrand\" | \"linkedin\" | \"mail\" | \"menu\" | \"moreLoginOptions\" | \"phone\" | \"pintrestBrand\" | \"pintrest\" | \"plusCircle\" | \"rampNetworkBrand\" | \"rampNetwork\" | \"redditBrand\" | \"reddit\" | \"refresh\" | \"settings\" | \"signalBrand\" | \"signal\" | \"snapchatBrand\" | \"snapchat\" | \"stars\" | \"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\"",
|
167
167
|
"references": {
|
168
168
|
"IconType": {
|
169
169
|
"location": "import",
|
@@ -203,7 +203,7 @@ export class CpslSlideButton {
|
|
203
203
|
"mutable": false,
|
204
204
|
"complexType": {
|
205
205
|
"original": "IconType",
|
206
|
-
"resolved": "\"
|
206
|
+
"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\" | \"downloadCloud\" | \"dribbbleBrand\" | \"dribbble\" | \"earth\" | \"eyeOff\" | \"eye\" | \"facebookBrand\" | \"facebook\" | \"farcasterBrand\" | \"farcaster\" | \"figmaBrand\" | \"figma\" | \"file\" | \"githubBrand\" | \"github\" | \"googleBrand\" | \"google\" | \"helpCircle\" | \"heroEmail\" | \"heroLock\" | \"heroPasskey\" | \"heroPhone\" | \"heroWallet\" | \"home\" | \"image\" | \"infoCircle\" | \"instagramBrand\" | \"instagram\" | \"key\" | \"lightning01\" | \"lightning\" | \"linkedinBrand\" | \"linkedin\" | \"mail\" | \"menu\" | \"moreLoginOptions\" | \"phone\" | \"pintrestBrand\" | \"pintrest\" | \"plusCircle\" | \"rampNetworkBrand\" | \"rampNetwork\" | \"redditBrand\" | \"reddit\" | \"refresh\" | \"settings\" | \"signalBrand\" | \"signal\" | \"snapchatBrand\" | \"snapchat\" | \"stars\" | \"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\"",
|
207
207
|
"references": {
|
208
208
|
"IconType": {
|
209
209
|
"location": "import",
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"cpsl-slide-button.js","sourceRoot":"","sources":["../../../../src/components/cpsl-slide-button/cpsl-slide-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAgB,KAAK,EAAE,MAAM,eAAe,CAAC;AAQvF,MAAM,OAAO,eAAe;;;;;;;;IAiC1B,gBAAgB;QACd,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC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../../interface';\n\n@Component({\n tag: 'cpsl-slide-button',\n styleUrl: 'cpsl-slide-button.scss',\n shadow: true,\n})\nexport class CpslSlideButton {\n @Element() el!: HTMLCpslSlideButtonElement;\n\n /**\n * Whether or not the component is disabled. If true, the component will display the `startText`.\n */\n @Prop() disabled: boolean;\n\n /**\n * The name of the ending icon to show.\n */\n @Prop() endIcon: IconType;\n\n /**\n * The ending text.\n */\n @Prop() endText: string;\n\n /**\n * The name of the starting icon to show.\n */\n @Prop() startIcon: IconType;\n\n /**\n * The starting text.\n */\n @Prop() startText: string;\n\n /**\n * The `cpslComplete` event is fired when the slider is at the end.\n */\n @Event() cpslComplete!: EventEmitter<boolean>;\n\n componentDidLoad() {\n this.dragElement(this.el.shadowRoot.getElementById('slider'));\n }\n\n private dragElement(el: HTMLElement) {\n const pointerDown = (e: PointerEvent) => {\n pos3 = e.clientX;\n\n switch (e.pointerType) {\n case 'mouse':\n el.onmousedown = dragMouseDown;\n break;\n default:\n el.ontouchstart = dragTouchDown;\n }\n };\n\n const dragMouseDown = (e: MouseEvent) => {\n e.preventDefault();\n // get the mouse cursor position at startup:\n pos3 = e.clientX;\n document.onmouseup = closeDragElement;\n // call a function whenever the cursor moves:\n document.onmousemove = elementMouseDrag;\n };\n\n const dragTouchDown = (e: TouchEvent) => {\n e.preventDefault();\n const touchLocation = e.targetTouches[0];\n // get the mouse cursor position at startup:\n pos3 = touchLocation.clientX;\n document.ontouchend = closeDragElement;\n // call a function whenever the cursor moves:\n document.ontouchmove = elementTouchDrag;\n };\n\n const elementMouseDrag = (e: MouseEvent) => {\n e.preventDefault();\n // calculate the new cursor position:\n pos1 = pos3 - e.clientX;\n pos3 = e.clientX;\n // set the element's new position:\n finishElementDrag(pos1);\n };\n\n const elementTouchDrag = (e: TouchEvent) => {\n e.preventDefault();\n const touchLocation = e.targetTouches[0];\n // calculate the new cursor position:\n pos1 = pos3 - touchLocation.clientX;\n pos3 = touchLocation.clientX;\n // set the element's new position:\n finishElementDrag(pos1);\n };\n\n const finishElementDrag = (pos: number) => {\n const newPos = el.offsetLeft - pos;\n if (newPos >= minX && newPos <= maxX) {\n const newPosPercent = Math.max(Math.min(Math.round((newPos / maxX) * 100) / 100, 100), 0);\n\n startTextEl.style.opacity = `${(1 - newPosPercent * 2) * 100}%`;\n endTextEl.style.opacity = `${newPosPercent * 100}%`;\n\n startIconEl.style.opacity = `${(1 - newPosPercent * 2) * 100}%`;\n endIconEl.style.opacity = `${newPosPercent * 100}%`;\n\n endBackgroundEl.style.opacity = `${newPosPercent * 100}%`;\n\n el.style.left = `${newPos}px`;\n }\n };\n\n const closeDragElement = () => {\n if (el.offsetLeft + sliderHeight >= containerWidth - sliderHeight / 2) {\n el.style.left = `${maxX}px`;\n startTextEl.style.opacity = '0%';\n endTextEl.style.opacity = '100%';\n startIconEl.style.opacity = '0%';\n endIconEl.style.opacity = '100%';\n endBackgroundEl.style.opacity = '100%';\n this.cpslComplete.emit(true);\n } else {\n el.style.left = `${minX}px`;\n startTextEl.style.opacity = '100%';\n endTextEl.style.opacity = '0%';\n startIconEl.style.opacity = '100%';\n endIconEl.style.opacity = '0%';\n endBackgroundEl.style.opacity = '0%';\n }\n // stop moving when mouse button is released:\n document.onmouseup = null;\n document.onmousemove = null;\n document.ontouchend = null;\n document.ontouchmove = null;\n };\n\n const startIconEl = this.startIconEl;\n const endIconEl = this.endIconEl;\n const startTextEl = this.startTextEl;\n const endTextEl = this.endTextEl;\n const endBackgroundEl = this.endBackgroundEl;\n\n const sliderContainerEl = this.sliderContainerEl;\n const containerWidth = sliderContainerEl.clientWidth;\n\n const sliderHeight = el.getBoundingClientRect().height;\n\n // Offset min by 1 for 1px left padding\n const minX = 1;\n // Offset max by the slider width and 1px for padding\n const maxX = containerWidth - sliderHeight - 1;\n\n let pos1 = 0,\n pos3 = 0;\n\n el.onpointerdown = pointerDown;\n }\n\n private get sliderContainerEl() {\n return this.el.shadowRoot.getElementById('slider-container');\n }\n\n private get startTextEl() {\n return this.el.shadowRoot.getElementById('start-text');\n }\n\n private get endTextEl() {\n return this.el.shadowRoot.getElementById('end-text');\n }\n\n private get endBackgroundEl() {\n return this.el.shadowRoot.getElementById('end-slider-container-background');\n }\n\n private get startIconEl() {\n return this.el.shadowRoot.getElementById('start-icon');\n }\n\n private get endIconEl() {\n return this.el.shadowRoot.getElementById('end-icon');\n }\n\n render() {\n return (\n <Host>\n <div id=\"slider-container\" class=\"slider-container\">\n <div id=\"start-slider-container-background\" class={{ 'start-slider-container-background': true, 'slider-container-background': true }} />\n <div id=\"end-slider-container-background\" class={{ 'end-slider-container-background': true, 'slider-container-background': true }} />\n <div id=\"slider\" class={{ slider: true, disabled: this.disabled }}>\n <cpsl-icon id=\"start-icon\" class={{ 'start-icon': true, 'icon': true }} icon={this.startIcon} />\n <cpsl-icon id=\"end-icon\" class={{ 'end-icon': true, 'icon': true }} icon={this.endIcon} />\n </div>\n <span id=\"start-text\" class={{ 'start-text': true, 'disabled': this.disabled }}>\n {this.startText}\n </span>\n <span id=\"end-text\" class=\"end-text\">\n {this.endText}\n </span>\n </div>\n </Host>\n );\n }\n}\n"]}
|
1
|
+
{"version":3,"file":"cpsl-slide-button.js","sourceRoot":"","sources":["../../../../src/components/cpsl-slide-button/cpsl-slide-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAgB,KAAK,EAAE,MAAM,eAAe,CAAC;AAQvF,MAAM,OAAO,eAAe;;;;;;;;IAiC1B,gBAAgB;QACd,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC;IAChE,CAAC;IAEO,WAAW,CAAC,EAAe;QACjC,MAAM,WAAW,GAAG,CAAC,CAAe,EAAE,EAAE;YACtC,IAAI,GAAG,CAAC,CAAC,OAAO,CAAC;YAEjB,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAC;gBACtB,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A6B,EAAE,IAAI,EAAE,GACzF;gBACF,4DACE,EAAE,EAAC,iCAAiC,EACpC,KAAK,EAAE,EAAE,iCAAiC,EAAE,IAAI,EAAE,6BAA6B,EAAE,IAAI,EAAE,GACvF;gBACF,4DAAK,EAAE,EAAC,QAAQ,EAAC,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE;oBAC/D,kEAAW,EAAE,EAAC,YAAY,EAAC,KAAK,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,GAAI;oBAChG,kEAAW,EAAE,EAAC,UAAU,EAAC,KAAK,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,GAAI,CACtF;gBACN,6DAAM,EAAE,EAAC,YAAY,EAAC,KAAK,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC,QAAQ,EAAE,IAC3E,IAAI,CAAC,SAAS,CACV;gBACP,6DAAM,EAAE,EAAC,UAAU,EAAC,KAAK,EAAC,UAAU,IACjC,IAAI,CAAC,OAAO,CACR,CACH,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h, Element, EventEmitter, Event } from '@stencil/core';\nimport { IconType } from '../../interface';\n\n@Component({\n tag: 'cpsl-slide-button',\n styleUrl: 'cpsl-slide-button.scss',\n shadow: true,\n})\nexport class CpslSlideButton {\n @Element() el!: HTMLCpslSlideButtonElement;\n\n /**\n * Whether or not the component is disabled. If true, the component will display the `startText`.\n */\n @Prop() disabled: boolean;\n\n /**\n * The name of the ending icon to show.\n */\n @Prop() endIcon: IconType;\n\n /**\n * The ending text.\n */\n @Prop() endText: string;\n\n /**\n * The name of the starting icon to show.\n */\n @Prop() startIcon: IconType;\n\n /**\n * The starting text.\n */\n @Prop() startText: string;\n\n /**\n * The `cpslComplete` event is fired when the slider is at the end.\n */\n @Event() cpslComplete!: EventEmitter<boolean>;\n\n componentDidLoad() {\n this.dragElement(this.el.shadowRoot.getElementById('slider'));\n }\n\n private dragElement(el: HTMLElement) {\n const pointerDown = (e: PointerEvent) => {\n pos3 = e.clientX;\n\n switch (e.pointerType) {\n case 'mouse':\n el.onmousedown = dragMouseDown;\n break;\n default:\n el.ontouchstart = dragTouchDown;\n }\n };\n\n const dragMouseDown = (e: MouseEvent) => {\n e.preventDefault();\n // get the mouse cursor position at startup:\n pos3 = e.clientX;\n document.onmouseup = closeDragElement;\n // call a function whenever the cursor moves:\n document.onmousemove = elementMouseDrag;\n };\n\n const dragTouchDown = (e: TouchEvent) => {\n e.preventDefault();\n const touchLocation = e.targetTouches[0];\n // get the mouse cursor position at startup:\n pos3 = touchLocation.clientX;\n document.ontouchend = closeDragElement;\n // call a function whenever the cursor moves:\n document.ontouchmove = elementTouchDrag;\n };\n\n const elementMouseDrag = (e: MouseEvent) => {\n e.preventDefault();\n // calculate the new cursor position:\n pos1 = pos3 - e.clientX;\n pos3 = e.clientX;\n // set the element's new position:\n finishElementDrag(pos1);\n };\n\n const elementTouchDrag = (e: TouchEvent) => {\n e.preventDefault();\n const touchLocation = e.targetTouches[0];\n // calculate the new cursor position:\n pos1 = pos3 - touchLocation.clientX;\n pos3 = touchLocation.clientX;\n // set the element's new position:\n finishElementDrag(pos1);\n };\n\n const finishElementDrag = (pos: number) => {\n const newPos = el.offsetLeft - pos;\n if (newPos >= minX && newPos <= maxX) {\n const newPosPercent = Math.max(Math.min(Math.round((newPos / maxX) * 100) / 100, 100), 0);\n\n startTextEl.style.opacity = `${(1 - newPosPercent * 2) * 100}%`;\n endTextEl.style.opacity = `${newPosPercent * 100}%`;\n\n startIconEl.style.opacity = `${(1 - newPosPercent * 2) * 100}%`;\n endIconEl.style.opacity = `${newPosPercent * 100}%`;\n\n endBackgroundEl.style.opacity = `${newPosPercent * 100}%`;\n\n el.style.left = `${newPos}px`;\n }\n };\n\n const closeDragElement = () => {\n if (el.offsetLeft + sliderHeight >= containerWidth - sliderHeight / 2) {\n el.style.left = `${maxX}px`;\n startTextEl.style.opacity = '0%';\n endTextEl.style.opacity = '100%';\n startIconEl.style.opacity = '0%';\n endIconEl.style.opacity = '100%';\n endBackgroundEl.style.opacity = '100%';\n this.cpslComplete.emit(true);\n } else {\n el.style.left = `${minX}px`;\n startTextEl.style.opacity = '100%';\n endTextEl.style.opacity = '0%';\n startIconEl.style.opacity = '100%';\n endIconEl.style.opacity = '0%';\n endBackgroundEl.style.opacity = '0%';\n }\n // stop moving when mouse button is released:\n document.onmouseup = null;\n document.onmousemove = null;\n document.ontouchend = null;\n document.ontouchmove = null;\n };\n\n const startIconEl = this.startIconEl;\n const endIconEl = this.endIconEl;\n const startTextEl = this.startTextEl;\n const endTextEl = this.endTextEl;\n const endBackgroundEl = this.endBackgroundEl;\n\n const sliderContainerEl = this.sliderContainerEl;\n const containerWidth = sliderContainerEl.clientWidth;\n\n const sliderHeight = el.getBoundingClientRect().height;\n\n // Offset min by 1 for 1px left padding\n const minX = 1;\n // Offset max by the slider width and 1px for padding\n const maxX = containerWidth - sliderHeight - 1;\n\n let pos1 = 0,\n pos3 = 0;\n\n el.onpointerdown = pointerDown;\n }\n\n private get sliderContainerEl() {\n return this.el.shadowRoot.getElementById('slider-container');\n }\n\n private get startTextEl() {\n return this.el.shadowRoot.getElementById('start-text');\n }\n\n private get endTextEl() {\n return this.el.shadowRoot.getElementById('end-text');\n }\n\n private get endBackgroundEl() {\n return this.el.shadowRoot.getElementById('end-slider-container-background');\n }\n\n private get startIconEl() {\n return this.el.shadowRoot.getElementById('start-icon');\n }\n\n private get endIconEl() {\n return this.el.shadowRoot.getElementById('end-icon');\n }\n\n render() {\n return (\n <Host>\n <div id=\"slider-container\" class=\"slider-container\">\n <div\n id=\"start-slider-container-background\"\n class={{ 'start-slider-container-background': true, 'slider-container-background': true }}\n />\n <div\n id=\"end-slider-container-background\"\n class={{ 'end-slider-container-background': true, 'slider-container-background': true }}\n />\n <div id=\"slider\" class={{ slider: true, disabled: this.disabled }}>\n <cpsl-icon id=\"start-icon\" class={{ 'start-icon': true, 'icon': true }} icon={this.startIcon} />\n <cpsl-icon id=\"end-icon\" class={{ 'end-icon': true, 'icon': true }} icon={this.endIcon} />\n </div>\n <span id=\"start-text\" class={{ 'start-text': true, 'disabled': this.disabled }}>\n {this.startText}\n </span>\n <span id=\"end-text\" class=\"end-text\">\n {this.endText}\n </span>\n </div>\n </Host>\n );\n }\n}\n"]}
|
@@ -54,13 +54,18 @@
|
|
54
54
|
* }
|
55
55
|
*/
|
56
56
|
:host {
|
57
|
-
--
|
58
|
-
--
|
59
|
-
--background-color: var(--cpsl-color-background-0);
|
57
|
+
--path-color: var(--cpsl-color-spinner-path);
|
58
|
+
--circle-color: var(--cpsl-color-spinner-circle);
|
60
59
|
display: flex;
|
61
60
|
justify-content: center;
|
62
61
|
align-items: center;
|
63
62
|
}
|
63
|
+
:host path {
|
64
|
+
stroke: var(--path-color);
|
65
|
+
}
|
66
|
+
:host circle {
|
67
|
+
fill: var(--circle-color);
|
68
|
+
}
|
64
69
|
@keyframes spin {
|
65
70
|
0% {
|
66
71
|
-webkit-transform: rotate(0deg);
|
@@ -86,31 +91,4 @@
|
|
86
91
|
100% {
|
87
92
|
-webkit-transform: rotate(360deg);
|
88
93
|
}
|
89
|
-
}
|
90
|
-
|
91
|
-
.loader {
|
92
|
-
position: relative;
|
93
|
-
width: 100%;
|
94
|
-
aspect-ratio: 1;
|
95
|
-
background: conic-gradient(transparent, transparent 12%, var(--bar-color));
|
96
|
-
border-radius: 50%;
|
97
|
-
margin: auto;
|
98
|
-
animation: spin 0.8s cubic-bezier(0.3, 0.5, 0.5, 0.5) infinite;
|
99
|
-
}
|
100
|
-
.loader::before, .loader::after {
|
101
|
-
content: "";
|
102
|
-
position: absolute;
|
103
|
-
border-radius: inherit;
|
104
|
-
}
|
105
|
-
.loader::before {
|
106
|
-
top: 0;
|
107
|
-
left: 50%;
|
108
|
-
transform: translateX(-50%);
|
109
|
-
background: linear-gradient(to left, var(--bar-color) 50%, transparent 50%);
|
110
|
-
width: var(--bar-width);
|
111
|
-
aspect-ratio: 1;
|
112
|
-
}
|
113
|
-
.loader::after {
|
114
|
-
inset: var(--bar-width);
|
115
|
-
background: var(--background-color);
|
116
94
|
}
|
@@ -5,11 +5,13 @@ export class CpslSpinner {
|
|
5
5
|
this.speed = 1;
|
6
6
|
}
|
7
7
|
render() {
|
8
|
-
return (h(Host, { key: '
|
9
|
-
height: `${this.size}px`,
|
10
|
-
width: `${this.size}px`,
|
11
|
-
|
12
|
-
|
8
|
+
return (h(Host, { key: '752c92c025ab7c7a4402907f061fb461a5aa93e3', style: {
|
9
|
+
'height': `${this.size}px`,
|
10
|
+
'width': `${this.size}px`,
|
11
|
+
'animation': `spin ${this.speed}s linear infinite`,
|
12
|
+
'-webkit-animation': `spin ${this.speed}s linear infinite`,
|
13
|
+
'-moz-animation': `spin ${this.speed}s linear infinite`,
|
14
|
+
} }, h("svg", { key: 'b901d2e2d02065ebc1395a08ede303567c87fd7c', height: this.size, width: this.size, xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 54 54", fill: "none" }, h("path", { key: '20e62d27eaf461700683c863e24fca0457242fca', d: "M43.1586 17C39.8082 11.5978 33.8243 8 27 8C16.5066 8 8 16.5066 8 27C8 37.4934 16.5066 46 27 46C33.8242 46 39.8082 42.4022 43.1586 37", "stroke-width": "6", "stroke-linecap": "round" }), h("circle", { key: '7b7dca75545477fa6314bf1a8b315140c5b029f5', cx: "45", cy: "27", r: "5" }))));
|
13
15
|
}
|
14
16
|
static get is() { return "cpsl-spinner"; }
|
15
17
|
static get encapsulation() { return "shadow"; }
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"cpsl-spinner.js","sourceRoot":"","sources":["../../../../src/components/cpsl-spinner/cpsl-spinner.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAOzD,MAAM,OAAO,WAAW;;oBAKE,EAAE;qBAMD,CAAC;;IAE1B,MAAM;QACJ,OAAO,CACL,EAAC,IAAI,qDACH,KAAK,EAAE;gBACL,
|
1
|
+
{"version":3,"file":"cpsl-spinner.js","sourceRoot":"","sources":["../../../../src/components/cpsl-spinner/cpsl-spinner.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAOzD,MAAM,OAAO,WAAW;;oBAKE,EAAE;qBAMD,CAAC;;IAE1B,MAAM;QACJ,OAAO,CACL,EAAC,IAAI,qDACH,KAAK,EAAE;gBACL,QAAQ,EAAE,GAAG,IAAI,CAAC,IAAI,IAAI;gBAC1B,OAAO,EAAE,GAAG,IAAI,CAAC,IAAI,IAAI;gBACzB,WAAW,EAAE,QAAQ,IAAI,CAAC,KAAK,mBAAmB;gBAClD,mBAAmB,EAAE,QAAQ,IAAI,CAAC,KAAK,mBAAmB;gBAC1D,gBAAgB,EAAE,QAAQ,IAAI,CAAC,KAAK,mBAAmB;aACxD;YAED,4DAAK,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAC,4BAA4B,EAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM;gBAC1G,6DACE,CAAC,EAAC,sIAAsI,kBAC3H,GAAG,oBACD,OAAO,GACtB;gBACF,+DAAQ,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,CAAC,EAAC,GAAG,GAAG,CAC5B,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h } from '@stencil/core';\n\n@Component({\n tag: 'cpsl-spinner',\n styleUrl: 'cpsl-spinner.scss',\n shadow: true,\n})\nexport class CpslSpinner {\n /**\n * Size of the spinner in pixels.\n * Default is 50.\n */\n @Prop() size?: number = 54;\n\n /**\n * Rotation speed of the spinner in seconds.\n * Default is 1.\n */\n @Prop() speed?: number = 1;\n\n render() {\n return (\n <Host\n style={{\n 'height': `${this.size}px`,\n 'width': `${this.size}px`,\n 'animation': `spin ${this.speed}s linear infinite`,\n '-webkit-animation': `spin ${this.speed}s linear infinite`,\n '-moz-animation': `spin ${this.speed}s linear infinite`,\n }}\n >\n <svg height={this.size} width={this.size} xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 54 54\" fill=\"none\">\n <path\n d=\"M43.1586 17C39.8082 11.5978 33.8243 8 27 8C16.5066 8 8 16.5066 8 27C8 37.4934 16.5066 46 27 46C33.8242 46 39.8082 42.4022 43.1586 37\"\n stroke-width=\"6\"\n stroke-linecap=\"round\"\n />\n <circle cx=\"45\" cy=\"27\" r=\"5\" />\n </svg>\n </Host>\n );\n }\n}\n"]}
|
@@ -7,7 +7,7 @@ export class CpslSwitch {
|
|
7
7
|
this.checked = undefined;
|
8
8
|
}
|
9
9
|
render() {
|
10
|
-
return (h(Host, { key: '
|
10
|
+
return (h(Host, { key: '45035a28db5319aa2818d38513fb40da81314ff5' }, h("input", { key: 'b7a9c111c55c6791eaf881442e4c335765aa2616', type: "checkbox", checked: this.checked }), h("span", { key: '3bf7175289486bb65786b4522e57bf76119437e0', onClick: this.handleSwitchClick, class: { container: true, checked: this.checked } }, h("span", { key: '71484a1fa21a4619be68863f321248a1da000015', class: { thumb: true, checked: this.checked } }))));
|
11
11
|
}
|
12
12
|
static get is() { return "cpsl-switch"; }
|
13
13
|
static get encapsulation() { return "shadow"; }
|