@cscfi/csc-ui 2.1.9 → 2.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/c-autocomplete_34.cjs.entry.js +1 -1
- package/dist/cjs/c-autocomplete_34.cjs.entry.js.map +1 -1
- package/dist/cjs/c-modal.cjs.entry.js +22 -15
- package/dist/cjs/c-modal.cjs.entry.js.map +1 -1
- package/dist/collection/components/c-input/c-input.css +1 -0
- package/dist/collection/components/c-modal/c-modal.js +22 -15
- package/dist/collection/components/c-modal/c-modal.js.map +1 -1
- package/dist/components/c-input2.js +1 -1
- package/dist/components/c-input2.js.map +1 -1
- package/dist/components/c-modal.js +22 -15
- package/dist/components/c-modal.js.map +1 -1
- package/dist/csc-ui/csc-ui.esm.js +1 -1
- package/dist/csc-ui/{p-f46709d0.entry.js → p-cf0bd039.entry.js} +2 -2
- package/dist/csc-ui/p-cf0bd039.entry.js.map +1 -0
- package/dist/csc-ui/p-e9ec927b.entry.js +2 -0
- package/dist/csc-ui/p-e9ec927b.entry.js.map +1 -0
- package/dist/esm/c-autocomplete_34.entry.js +1 -1
- package/dist/esm/c-autocomplete_34.entry.js.map +1 -1
- package/dist/esm/c-modal.entry.js +22 -15
- package/dist/esm/c-modal.entry.js.map +1 -1
- package/dist/types/components/c-modal/c-modal.d.ts +1 -0
- package/package.json +1 -1
- package/dist/csc-ui/p-aa6b6960.entry.js +0 -2
- package/dist/csc-ui/p-aa6b6960.entry.js.map +0 -1
- package/dist/csc-ui/p-f46709d0.entry.js.map +0 -1
|
@@ -11,31 +11,36 @@ const CModal = class {
|
|
|
11
11
|
index.registerInstance(this, hostRef);
|
|
12
12
|
this.changeValue = index.createEvent(this, "changeValue", 3);
|
|
13
13
|
this._debounce = null;
|
|
14
|
+
this._animationsDisabled = false;
|
|
14
15
|
this._handleShow = () => {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
this._dialog.
|
|
18
|
-
this._dialog.
|
|
16
|
+
var _a, _b, _c;
|
|
17
|
+
if (!this._animationsDisabled) {
|
|
18
|
+
(_a = this._dialog) === null || _a === void 0 ? void 0 : _a.addEventListener('animationend', this._onDialogOpened);
|
|
19
|
+
(_b = this._dialog) === null || _b === void 0 ? void 0 : _b.classList.add('opening');
|
|
19
20
|
}
|
|
21
|
+
(_c = this._dialog) === null || _c === void 0 ? void 0 : _c.showModal();
|
|
20
22
|
};
|
|
21
23
|
this._onDialogOpened = () => {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
24
|
+
var _a, _b;
|
|
25
|
+
(_a = this._dialog) === null || _a === void 0 ? void 0 : _a.removeEventListener('animationend', this._onDialogOpened);
|
|
26
|
+
(_b = this._dialog) === null || _b === void 0 ? void 0 : _b.classList.remove('opening');
|
|
26
27
|
};
|
|
27
28
|
this._handleClose = () => {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
this.
|
|
29
|
+
var _a, _b;
|
|
30
|
+
if (this._animationsDisabled) {
|
|
31
|
+
this._onDialogClosed();
|
|
32
|
+
return;
|
|
31
33
|
}
|
|
34
|
+
(_a = this._dialog) === null || _a === void 0 ? void 0 : _a.addEventListener('animationend', this._onDialogClosed);
|
|
35
|
+
(_b = this._dialog) === null || _b === void 0 ? void 0 : _b.classList.add('closing');
|
|
32
36
|
};
|
|
33
37
|
this._onDialogClosed = () => {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
this._dialog.
|
|
37
|
-
this._dialog.
|
|
38
|
+
var _a, _b, _c;
|
|
39
|
+
if (!this._animationsDisabled) {
|
|
40
|
+
(_a = this._dialog) === null || _a === void 0 ? void 0 : _a.removeEventListener('animationend', this._onDialogClosed);
|
|
41
|
+
(_b = this._dialog) === null || _b === void 0 ? void 0 : _b.classList.remove('closing');
|
|
38
42
|
}
|
|
43
|
+
(_c = this._dialog) === null || _c === void 0 ? void 0 : _c.close();
|
|
39
44
|
if (!document.fullscreenElement)
|
|
40
45
|
return;
|
|
41
46
|
document.exitFullscreen();
|
|
@@ -94,6 +99,8 @@ const CModal = class {
|
|
|
94
99
|
this.el.style.setProperty('--_c-modal-width', `${width}`);
|
|
95
100
|
}
|
|
96
101
|
componentDidLoad() {
|
|
102
|
+
const query = window.matchMedia('(prefers-reduced-motion: reduce)');
|
|
103
|
+
this._animationsDisabled = query.matches;
|
|
97
104
|
this._handleClickOutside();
|
|
98
105
|
if (this.value) {
|
|
99
106
|
this._handleShow();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"c-modal.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,SAAS,GAAG,ywCAAywC;;MCmB9wC,MAAM;;;;IAwCT,cAAS,GAAG,IAAI,CAAC;
|
|
1
|
+
{"file":"c-modal.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,SAAS,GAAG,ywCAAywC;;MCmB9wC,MAAM;;;;IAwCT,cAAS,GAAG,IAAI,CAAC;IAEjB,wBAAmB,GAAG,KAAK,CAAC;IAa5B,gBAAW,GAAG;;MACpB,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE;QAC7B,MAAA,IAAI,CAAC,OAAO,0CAAE,gBAAgB,CAAC,cAAc,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;QACrE,MAAA,IAAI,CAAC,OAAO,0CAAE,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;OACxC;MAED,MAAA,IAAI,CAAC,OAAO,0CAAE,SAAS,EAAE,CAAC;KAC3B,CAAC;IAEM,oBAAe,GAAG;;MACxB,MAAA,IAAI,CAAC,OAAO,0CAAE,mBAAmB,CAAC,cAAc,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;MACxE,MAAA,IAAI,CAAC,OAAO,0CAAE,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;KAC3C,CAAC;IAEM,iBAAY,GAAG;;MACrB,IAAI,IAAI,CAAC,mBAAmB,EAAE;QAC5B,IAAI,CAAC,eAAe,EAAE,CAAC;QAEvB,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,MAAM,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC,kCAAkC,CAAC,CAAC;IAEpE,IAAI,CAAC,mBAAmB,GAAG,KAAK,CAAC,OAAO,CAAC;IAEzC,IAAI,CAAC,mBAAmB,EAAE,CAAC;IAE3B,IAAI,IAAI,CAAC,KAAK,EAAE;MACd,IAAI,CAAC,WAAW,EAAE,CAAC;KACpB;GACF;EAED,MAAM;IACJ,MAAM,WAAW,GAAG;MAClB,SAAS,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE;KAC5B,CAAC;IAEF,MAAM,OAAO,GAAG;MACd,eAAe,EAAE,CAAC,IAAI,CAAC,mBAAmB;KAC3C,CAAC;IAEF,QACEA,oBACE,GAAG,EAAE,CAAC,EAAE,MAAM,IAAI,CAAC,OAAO,GAAG,EAAuB,CAAC,EACrD,KAAK,EAAE,WAAW,EAClB,KAAK,EAAE,OAAO,EACd,SAAS,EAAE,IAAI,CAAC,cAAc,IAE9BA,qBAAa,CACN,EACT;GACH;;;;;;;;;;","names":["h"],"sources":["src/components/c-modal/c-modal.scss?tag=c-modal&encapsulation=shadow","src/components/c-modal/c-modal.tsx"],"sourcesContent":["dialog {\n background-color: transparent;\n border: none;\n color: var(--c-text-body);\n inset: 0;\n margin: auto;\n max-width: calc(100% - 32px);\n overflow: visible;\n padding: 0;\n width: var(--_c-modal-width, 600px);\n\n &:not([open]) {\n pointer-events: none;\n opacity: 0;\n }\n\n &::backdrop {\n background-color: rgba(0, 0, 0, 0.5);\n }\n\n &.backdrop-blur {\n &::backdrop {\n backdrop-filter: blur(4px);\n }\n }\n}\n\n@media (prefers-reduced-motion: no-preference) {\n dialog {\n &.nudging {\n animation: dialog-nudge 0.15s cubic-bezier(0.25, 0.8, 0.25, 1) !important;\n }\n\n &.opening {\n animation: dialog-open 0.3s cubic-bezier(0.25, 0.8, 0.5, 1) forwards;\n\n &::backdrop {\n animation: backdrop-fadein 0.3s forwards;\n }\n }\n\n &.closing {\n animation: dialog-close 0.3s cubic-bezier(0.25, 0.8, 0.5, 1) forwards;\n\n &::backdrop {\n animation: backdrop-fadeout 0.3s forwards;\n }\n }\n }\n}\n\n@keyframes dialog-nudge {\n 0% {\n transform: scale(1);\n }\n\n 50% {\n transform: scale(1.03);\n }\n\n 100% {\n transform: scale(1);\n }\n}\n\n@keyframes dialog-open {\n from {\n transform: scale(0);\n }\n\n to {\n transform: scale(1);\n }\n}\n\n@keyframes dialog-close {\n to {\n transform: scale(0);\n }\n}\n\n@keyframes backdrop-fadein {\n from {\n opacity: 0;\n }\n\n to {\n opacity: 1;\n }\n}\n\n@keyframes backdrop-fadeout {\n from {\n opacity: 1;\n }\n\n to {\n opacity: 0;\n }\n}\n","import {\n Component,\n h,\n Prop,\n Event,\n EventEmitter,\n State,\n Watch,\n Element,\n} from '@stencil/core';\n\n/**\n * @group Popups\n */\n@Component({\n tag: 'c-modal',\n styleUrl: 'c-modal.scss',\n shadow: true,\n})\nexport class CModal {\n @Element() el: HTMLCModalElement;\n\n private _dialog?: HTMLDialogElement;\n\n /**\n * Is the modal visible\n */\n @Prop() value = false;\n\n /**\n * Dismissed when touching/clicking outside the content\n */\n @Prop() dismissable = false;\n\n /**\n * Width of the dialog. Numeric value is considered as pixel value (400 -> 400px)\n *\n */\n @Prop() width: string | number = 600;\n\n /**\n * Z-index of the modal\n */\n @Prop() zIndex = 10;\n\n /**\n * Disable backdrop blur effect\n */\n @Prop() disableBackdropBlur = false;\n\n /**\n * Triggered when value is changed\n */\n @Event({ bubbles: false }) changeValue: EventEmitter<boolean>;\n\n @State() innerValue = false;\n\n @State() animateModal = false;\n\n private _debounce = null;\n\n private _animationsDisabled = false;\n\n @Watch('value')\n onValueChange(value: boolean) {\n if (value) {\n this._handleShow();\n\n return;\n }\n\n this._handleClose();\n }\n\n private _handleShow = () => {\n if (!this._animationsDisabled) {\n this._dialog?.addEventListener('animationend', this._onDialogOpened);\n this._dialog?.classList.add('opening');\n }\n\n this._dialog?.showModal();\n };\n\n private _onDialogOpened = () => {\n this._dialog?.removeEventListener('animationend', this._onDialogOpened);\n this._dialog?.classList.remove('opening');\n };\n\n private _handleClose = () => {\n if (this._animationsDisabled) {\n this._onDialogClosed();\n\n return;\n }\n\n this._dialog?.addEventListener('animationend', this._onDialogClosed);\n this._dialog?.classList.add('closing');\n };\n\n private _onDialogClosed = () => {\n if (!this._animationsDisabled) {\n this._dialog?.removeEventListener('animationend', this._onDialogClosed);\n this._dialog?.classList.remove('closing');\n }\n\n this._dialog?.close();\n\n if (!document.fullscreenElement) return;\n\n document.exitFullscreen();\n };\n\n private _handleClickOutside = () => {\n this._dialog.addEventListener('click', (e) => {\n if (e.clientX === 0 && e.clientY === 0) return;\n\n const dialogDimensions = this._dialog.getBoundingClientRect();\n\n if (\n e.clientX < dialogDimensions.left ||\n e.clientX > dialogDimensions.right ||\n e.clientY < dialogDimensions.top ||\n e.clientY > dialogDimensions.bottom\n ) {\n if (!this.dismissable) {\n this._dialog.classList.add('nudging');\n\n if (this._debounce !== null) {\n clearTimeout(this._debounce);\n this._debounce = null;\n }\n\n this._debounce = window.setTimeout(() => {\n this._dialog.classList.remove('nudging');\n\n this._debounce = null;\n }, 150);\n\n return;\n }\n\n this._handleClose();\n this.changeValue.emit(false);\n }\n });\n };\n\n private _handleKeyDown = (e) => {\n if (e.keyCode === 27) {\n e.preventDefault();\n this._handleClose();\n this.changeValue.emit(false);\n }\n };\n\n componentWillLoad() {\n this.innerValue = this.value;\n\n const width = isNaN(this.width as number) ? this.width : `${this.width}px`;\n\n this.el.style.setProperty('--_c-modal-width', `${width}`);\n }\n\n componentDidLoad() {\n const query = window.matchMedia('(prefers-reduced-motion: reduce)');\n\n this._animationsDisabled = query.matches;\n\n this._handleClickOutside();\n\n if (this.value) {\n this._handleShow();\n }\n }\n\n render() {\n const dialogStyle = {\n 'z-index': `${this.zIndex}`,\n };\n\n const classes = {\n 'backdrop-blur': !this.disableBackdropBlur,\n };\n\n return (\n <dialog\n ref={(el) => (this._dialog = el as HTMLDialogElement)}\n style={dialogStyle}\n class={classes}\n onKeyDown={this._handleKeyDown}\n >\n <slot></slot>\n </dialog>\n );\n }\n}\n"],"version":3}
|
|
@@ -2,31 +2,36 @@ import { h, } from "@stencil/core";
|
|
|
2
2
|
export class CModal {
|
|
3
3
|
constructor() {
|
|
4
4
|
this._debounce = null;
|
|
5
|
+
this._animationsDisabled = false;
|
|
5
6
|
this._handleShow = () => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
this._dialog.
|
|
9
|
-
this._dialog.
|
|
7
|
+
var _a, _b, _c;
|
|
8
|
+
if (!this._animationsDisabled) {
|
|
9
|
+
(_a = this._dialog) === null || _a === void 0 ? void 0 : _a.addEventListener('animationend', this._onDialogOpened);
|
|
10
|
+
(_b = this._dialog) === null || _b === void 0 ? void 0 : _b.classList.add('opening');
|
|
10
11
|
}
|
|
12
|
+
(_c = this._dialog) === null || _c === void 0 ? void 0 : _c.showModal();
|
|
11
13
|
};
|
|
12
14
|
this._onDialogOpened = () => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
15
|
+
var _a, _b;
|
|
16
|
+
(_a = this._dialog) === null || _a === void 0 ? void 0 : _a.removeEventListener('animationend', this._onDialogOpened);
|
|
17
|
+
(_b = this._dialog) === null || _b === void 0 ? void 0 : _b.classList.remove('opening');
|
|
17
18
|
};
|
|
18
19
|
this._handleClose = () => {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
this.
|
|
20
|
+
var _a, _b;
|
|
21
|
+
if (this._animationsDisabled) {
|
|
22
|
+
this._onDialogClosed();
|
|
23
|
+
return;
|
|
22
24
|
}
|
|
25
|
+
(_a = this._dialog) === null || _a === void 0 ? void 0 : _a.addEventListener('animationend', this._onDialogClosed);
|
|
26
|
+
(_b = this._dialog) === null || _b === void 0 ? void 0 : _b.classList.add('closing');
|
|
23
27
|
};
|
|
24
28
|
this._onDialogClosed = () => {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
this._dialog.
|
|
28
|
-
this._dialog.
|
|
29
|
+
var _a, _b, _c;
|
|
30
|
+
if (!this._animationsDisabled) {
|
|
31
|
+
(_a = this._dialog) === null || _a === void 0 ? void 0 : _a.removeEventListener('animationend', this._onDialogClosed);
|
|
32
|
+
(_b = this._dialog) === null || _b === void 0 ? void 0 : _b.classList.remove('closing');
|
|
29
33
|
}
|
|
34
|
+
(_c = this._dialog) === null || _c === void 0 ? void 0 : _c.close();
|
|
30
35
|
if (!document.fullscreenElement)
|
|
31
36
|
return;
|
|
32
37
|
document.exitFullscreen();
|
|
@@ -85,6 +90,8 @@ export class CModal {
|
|
|
85
90
|
this.el.style.setProperty('--_c-modal-width', `${width}`);
|
|
86
91
|
}
|
|
87
92
|
componentDidLoad() {
|
|
93
|
+
const query = window.matchMedia('(prefers-reduced-motion: reduce)');
|
|
94
|
+
this._animationsDisabled = query.matches;
|
|
88
95
|
this._handleClickOutside();
|
|
89
96
|
if (this.value) {
|
|
90
97
|
this._handleShow();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"c-modal.js","sourceRoot":"","sources":["../../../../src/components/c-modal/c-modal.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,CAAC,EACD,IAAI,EACJ,KAAK,EAEL,KAAK,EACL,KAAK,EACL,OAAO,GACR,MAAM,eAAe,CAAC;AAUvB,MAAM,OAAO,MAAM;;IAwCT,cAAS,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"c-modal.js","sourceRoot":"","sources":["../../../../src/components/c-modal/c-modal.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,CAAC,EACD,IAAI,EACJ,KAAK,EAEL,KAAK,EACL,KAAK,EACL,OAAO,GACR,MAAM,eAAe,CAAC;AAUvB,MAAM,OAAO,MAAM;;IAwCT,cAAS,GAAG,IAAI,CAAC;IAEjB,wBAAmB,GAAG,KAAK,CAAC;IAa5B,gBAAW,GAAG,GAAG,EAAE;;MACzB,IAAI,C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E,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,GAAG,EAAuB,CAAC,EACrD,KAAK,EAAE,WAAW,EAClB,KAAK,EAAE,OAAO,EACd,SAAS,EAAE,IAAI,CAAC,cAAc;MAE9B,eAAa,CACN,CACV,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Component,\n h,\n Prop,\n Event,\n EventEmitter,\n State,\n Watch,\n Element,\n} from '@stencil/core';\n\n/**\n * @group Popups\n */\n@Component({\n tag: 'c-modal',\n styleUrl: 'c-modal.scss',\n shadow: true,\n})\nexport class CModal {\n @Element() el: HTMLCModalElement;\n\n private _dialog?: HTMLDialogElement;\n\n /**\n * Is the modal visible\n */\n @Prop() value = false;\n\n /**\n * Dismissed when touching/clicking outside the content\n */\n @Prop() dismissable = false;\n\n /**\n * Width of the dialog. Numeric value is considered as pixel value (400 -> 400px)\n *\n */\n @Prop() width: string | number = 600;\n\n /**\n * Z-index of the modal\n */\n @Prop() zIndex = 10;\n\n /**\n * Disable backdrop blur effect\n */\n @Prop() disableBackdropBlur = false;\n\n /**\n * Triggered when value is changed\n */\n @Event({ bubbles: false }) changeValue: EventEmitter<boolean>;\n\n @State() innerValue = false;\n\n @State() animateModal = false;\n\n private _debounce = null;\n\n private _animationsDisabled = false;\n\n @Watch('value')\n onValueChange(value: boolean) {\n if (value) {\n this._handleShow();\n\n return;\n }\n\n this._handleClose();\n }\n\n private _handleShow = () => {\n if (!this._animationsDisabled) {\n this._dialog?.addEventListener('animationend', this._onDialogOpened);\n this._dialog?.classList.add('opening');\n }\n\n this._dialog?.showModal();\n };\n\n private _onDialogOpened = () => {\n this._dialog?.removeEventListener('animationend', this._onDialogOpened);\n this._dialog?.classList.remove('opening');\n };\n\n private _handleClose = () => {\n if (this._animationsDisabled) {\n this._onDialogClosed();\n\n return;\n }\n\n this._dialog?.addEventListener('animationend', this._onDialogClosed);\n this._dialog?.classList.add('closing');\n };\n\n private _onDialogClosed = () => {\n if (!this._animationsDisabled) {\n this._dialog?.removeEventListener('animationend', this._onDialogClosed);\n this._dialog?.classList.remove('closing');\n }\n\n this._dialog?.close();\n\n if (!document.fullscreenElement) return;\n\n document.exitFullscreen();\n };\n\n private _handleClickOutside = () => {\n this._dialog.addEventListener('click', (e) => {\n if (e.clientX === 0 && e.clientY === 0) return;\n\n const dialogDimensions = this._dialog.getBoundingClientRect();\n\n if (\n e.clientX < dialogDimensions.left ||\n e.clientX > dialogDimensions.right ||\n e.clientY < dialogDimensions.top ||\n e.clientY > dialogDimensions.bottom\n ) {\n if (!this.dismissable) {\n this._dialog.classList.add('nudging');\n\n if (this._debounce !== null) {\n clearTimeout(this._debounce);\n this._debounce = null;\n }\n\n this._debounce = window.setTimeout(() => {\n this._dialog.classList.remove('nudging');\n\n this._debounce = null;\n }, 150);\n\n return;\n }\n\n this._handleClose();\n this.changeValue.emit(false);\n }\n });\n };\n\n private _handleKeyDown = (e) => {\n if (e.keyCode === 27) {\n e.preventDefault();\n this._handleClose();\n this.changeValue.emit(false);\n }\n };\n\n componentWillLoad() {\n this.innerValue = this.value;\n\n const width = isNaN(this.width as number) ? this.width : `${this.width}px`;\n\n this.el.style.setProperty('--_c-modal-width', `${width}`);\n }\n\n componentDidLoad() {\n const query = window.matchMedia('(prefers-reduced-motion: reduce)');\n\n this._animationsDisabled = query.matches;\n\n this._handleClickOutside();\n\n if (this.value) {\n this._handleShow();\n }\n }\n\n render() {\n const dialogStyle = {\n 'z-index': `${this.zIndex}`,\n };\n\n const classes = {\n 'backdrop-blur': !this.disableBackdropBlur,\n };\n\n return (\n <dialog\n ref={(el) => (this._dialog = el as HTMLDialogElement)}\n style={dialogStyle}\n class={classes}\n onKeyDown={this._handleKeyDown}\n >\n <slot></slot>\n </dialog>\n );\n }\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { d as defineCustomElement$1 } from './c-message2.js';
|
|
3
3
|
|
|
4
|
-
const cInputCss = "html{box-sizing:border-box}body{margin:0}*,*:before,*:after{box-sizing:inherit;-webkit-tap-highlight-color:transparent}:host{font-family:var(--c-font-family)}::-ms-reveal{display:none}:host(c-input){--_c-input-inactive-color:var(--c-tertiary-600);--_c-input-active-color:var(--c-primary-600);--_c-input-background-color:var(--c-transparent);--_c-input-text-color:var(--c-text-body);--_c-input-placeholder-color:var(--c-tertiary-500);--_c-input-shadow-active-color:var(--_c-input-active-color);--_c-input-shadow-background-color:var(--c-white);--_c-input-shadow-text-color:var(--_c-input-text-color);--_c-input-shadow-placeholder-color:var(--_c-input-placeholder-color);--_c-input-error-color:var(--c-error-600)}.visuallyhidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.c-input{--_c-input-border-width:1px;align-items:flex-start;border-radius:4px;display:flex;flex:1 1 auto;font-family:var(--c-font-family);font-size:16px;letter-spacing:normal;max-width:100%;text-align:left}.c-input input,.c-input select,.c-input textarea{background:none;border:0;display:inline-block;font-family:var(--c-font-family);font-size:16px;line-height:1;margin:0;padding:0;vertical-align:middle;white-space:normal}.c-input input,.c-input textarea{box-sizing:content-box;background-color:transparent;border:none;color:var(--_c-input-text-color);flex:1 1 auto;font-family:var(--c-font-family);font-size:16px;line-height:20px;max-width:100%;min-width:0;width:100%}.c-input input[type=checkbox],.c-input input[type=radio],.c-input select{box-sizing:border-box}.c-input input[type=search]{appearance:textfield;box-sizing:content-box}.c-input ::-webkit-search-decoration{display:none}.c-input textarea{margin-top:4px;min-height:44px;overflow:auto;padding:8px 12px 8px 0;resize:vertical;vertical-align:top}.c-input input{max-height:32px;padding:8px 0}.c-input input:focus,.c-input input:active,.c-input input[aria-expanded=true],.c-input textarea:focus,.c-input textarea:active{outline:none}.c-input .c-input__content{align-items:center;display:flex;width:100%}.c-input .c-input__content slot{display:none}.c-input .c-input__content c-icon-button{aspect-ratio:1;margin-right:-6px}.c-input__control{border-radius:inherit;color:currentColor;display:flex;flex-flow:column wrap;flex-grow:1;gap:8px;height:auto;min-width:0;width:100%;position:relative}.c-input__slot{align-items:stretch;background:transparent;border-radius:inherit;color:inherit;cursor:text;display:flex;min-height:44px;padding:0 12px;position:relative;transition:0.3s cubic-bezier(0.25, 0.8, 0.5, 1);width:100%}.c-input__field{align-items:center;display:flex;flex:1 1 auto;gap:8px;position:relative}.c-input__field input,.c-input__field textarea{flex:1;outline:0}.c-input__field label{font-size:16px;height:20px;left:0;letter-spacing:normal;line-height:20px;max-width:90%;min-height:8px;overflow:hidden;pointer-events:none;position:absolute;right:auto;text-overflow:ellipsis;top:12px;transform-origin:top left;transform:translateX(var(--_c-input-label-position)) translateY(0) scale(1);transition:0.3s cubic-bezier(0.25, 0.8, 0.5, 1) 0.08s;white-space:nowrap}.c-input__field label.active{transform:translateY(-18px) scale(0.75)}.c-input__field label span{color:var(--c-error-600)}.c-input--select input{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.c-input--select .c-input__slot{cursor:pointer}.c-input fieldset{background-color:var(--_c-input-background-color);border-collapse:collapse;border-color:var(--_c-input-inactive-color);border-radius:inherit;border-style:solid;border-width:var(--_c-input-border-width);inset:0;margin:0;padding:0 0 0 8px;pointer-events:none;position:absolute;transition-duration:0.15s;transition-property:color;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1)}.c-input fieldset legend{float:none;line-height:11px;margin-left:-1px;padding:0;text-align:left;transition:width 0.3s cubic-bezier(0.25, 0.8, 0.5, 1);width:0}.c-input fieldset legend.active{width:var(--_c-input-legend-width)}.c-input--shadow .c-input__slot{background-color:var(--_c-input-shadow-background-color);box-shadow:rgba(0, 0, 0, 0.15) 0 5px 15px 0}.c-input--shadow .c-input__slot input,.c-input--shadow .c-input__slot textarea{color:var(--_c-input-shadow-text-color)}.c-input--shadow .c-input__slot:focus-within{outline:2px var(--_c-input-active-color) solid}.c-input--shadow .c-input__slot:focus-within c-icon{--c-icon-color:var(--_c-input-shadow-active-color) !important}.c-input--shadow input::placeholder,.c-input--shadow textarea::placeholder{color:var(--_c-input-shadow-placeholder-color);opacity:1}.c-input--disabled input,.c-input--disabled textarea,.c-input--disabled fieldset,.c-input--disabled label{--_c-input-error-color:var(--c-tertiary-500);color:var(--c-tertiary-500)}.c-input--textarea .c-input__field{margin-right:-12px}.c-input ::placeholder{color:var(--_c-input-placeholder-color);opacity:1}.c-input:focus-within,.c-input--active,.c-input:not(.c-input--disabled):active{--_c-input-border-width:2px;color:var(--_c-input-active-color)}.c-input:focus-within fieldset,.c-input--active fieldset,.c-input:not(.c-input--disabled):active fieldset{border-color:var(--_c-input-active-color)}.c-input:focus-within label,.c-input--active label,.c-input:not(.c-input--disabled):active label{color:var(--_c-input-active-color);transform:translateX(0) translateY(-18px) scale(0.75)}.c-input:focus-within legend,.c-input--active legend,.c-input:not(.c-input--disabled):active legend{width:var(--_c-input-legend-width)}.c-input.active:not(.filled) .c-input-menu__input{position:relative}.c-input.active:not(.filled) .c-input-menu__input::after{display:flex;align-items:center;position:absolute;inset:0;content:attr(data-placeholder);pointer-events:none;color:var(--_c-input-placeholder-color)}.c-input--error{color:var(--c-error-600)}.c-input--error fieldset{border-color:var(--c-error-600) !important}.c-input--error label{color:var(--c-error-600) !important}.c-input--error:focus-within{color:var(--c-error-600)}";
|
|
4
|
+
const cInputCss = "html{box-sizing:border-box}body{margin:0}*,*:before,*:after{box-sizing:inherit;-webkit-tap-highlight-color:transparent}:host{font-family:var(--c-font-family)}::-ms-reveal{display:none}:host(c-input){--_c-input-inactive-color:var(--c-tertiary-600);--_c-input-active-color:var(--c-primary-600);--_c-input-background-color:var(--c-transparent);--_c-input-text-color:var(--c-text-body);--_c-input-placeholder-color:var(--c-tertiary-500);--_c-input-shadow-active-color:var(--_c-input-active-color);--_c-input-shadow-background-color:var(--c-white);--_c-input-shadow-text-color:var(--_c-input-text-color);--_c-input-shadow-placeholder-color:var(--_c-input-placeholder-color);--_c-input-error-color:var(--c-error-600)}.visuallyhidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.c-input{--_c-input-border-width:1px;align-items:flex-start;border-radius:4px;display:flex;flex:1 1 auto;font-family:var(--c-font-family);font-size:16px;letter-spacing:normal;max-width:100%;text-align:left}.c-input input,.c-input select,.c-input textarea{background:none;border:0;display:inline-block;font-family:var(--c-font-family);font-size:16px;line-height:1;margin:0;padding:0;vertical-align:middle;white-space:normal}.c-input input,.c-input textarea{box-sizing:content-box;background-color:transparent;border:none;color:var(--_c-input-text-color);flex:1 1 auto;font-family:var(--c-font-family);font-size:16px;line-height:20px;max-width:100%;min-width:0;width:100%}.c-input input[type=checkbox],.c-input input[type=radio],.c-input select{box-sizing:border-box}.c-input input[type=search]{appearance:textfield;box-sizing:content-box}.c-input ::-webkit-search-decoration{display:none}.c-input textarea{margin-top:4px;min-height:44px;overflow:auto;padding:8px 12px 8px 0;resize:vertical;vertical-align:top;white-space:pre-wrap}.c-input input{max-height:32px;padding:8px 0}.c-input input:focus,.c-input input:active,.c-input input[aria-expanded=true],.c-input textarea:focus,.c-input textarea:active{outline:none}.c-input .c-input__content{align-items:center;display:flex;width:100%}.c-input .c-input__content slot{display:none}.c-input .c-input__content c-icon-button{aspect-ratio:1;margin-right:-6px}.c-input__control{border-radius:inherit;color:currentColor;display:flex;flex-flow:column wrap;flex-grow:1;gap:8px;height:auto;min-width:0;width:100%;position:relative}.c-input__slot{align-items:stretch;background:transparent;border-radius:inherit;color:inherit;cursor:text;display:flex;min-height:44px;padding:0 12px;position:relative;transition:0.3s cubic-bezier(0.25, 0.8, 0.5, 1);width:100%}.c-input__field{align-items:center;display:flex;flex:1 1 auto;gap:8px;position:relative}.c-input__field input,.c-input__field textarea{flex:1;outline:0}.c-input__field label{font-size:16px;height:20px;left:0;letter-spacing:normal;line-height:20px;max-width:90%;min-height:8px;overflow:hidden;pointer-events:none;position:absolute;right:auto;text-overflow:ellipsis;top:12px;transform-origin:top left;transform:translateX(var(--_c-input-label-position)) translateY(0) scale(1);transition:0.3s cubic-bezier(0.25, 0.8, 0.5, 1) 0.08s;white-space:nowrap}.c-input__field label.active{transform:translateY(-18px) scale(0.75)}.c-input__field label span{color:var(--c-error-600)}.c-input--select input{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.c-input--select .c-input__slot{cursor:pointer}.c-input fieldset{background-color:var(--_c-input-background-color);border-collapse:collapse;border-color:var(--_c-input-inactive-color);border-radius:inherit;border-style:solid;border-width:var(--_c-input-border-width);inset:0;margin:0;padding:0 0 0 8px;pointer-events:none;position:absolute;transition-duration:0.15s;transition-property:color;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1)}.c-input fieldset legend{float:none;line-height:11px;margin-left:-1px;padding:0;text-align:left;transition:width 0.3s cubic-bezier(0.25, 0.8, 0.5, 1);width:0}.c-input fieldset legend.active{width:var(--_c-input-legend-width)}.c-input--shadow .c-input__slot{background-color:var(--_c-input-shadow-background-color);box-shadow:rgba(0, 0, 0, 0.15) 0 5px 15px 0}.c-input--shadow .c-input__slot input,.c-input--shadow .c-input__slot textarea{color:var(--_c-input-shadow-text-color)}.c-input--shadow .c-input__slot:focus-within{outline:2px var(--_c-input-active-color) solid}.c-input--shadow .c-input__slot:focus-within c-icon{--c-icon-color:var(--_c-input-shadow-active-color) !important}.c-input--shadow input::placeholder,.c-input--shadow textarea::placeholder{color:var(--_c-input-shadow-placeholder-color);opacity:1}.c-input--disabled input,.c-input--disabled textarea,.c-input--disabled fieldset,.c-input--disabled label{--_c-input-error-color:var(--c-tertiary-500);color:var(--c-tertiary-500)}.c-input--textarea .c-input__field{margin-right:-12px}.c-input ::placeholder{color:var(--_c-input-placeholder-color);opacity:1}.c-input:focus-within,.c-input--active,.c-input:not(.c-input--disabled):active{--_c-input-border-width:2px;color:var(--_c-input-active-color)}.c-input:focus-within fieldset,.c-input--active fieldset,.c-input:not(.c-input--disabled):active fieldset{border-color:var(--_c-input-active-color)}.c-input:focus-within label,.c-input--active label,.c-input:not(.c-input--disabled):active label{color:var(--_c-input-active-color);transform:translateX(0) translateY(-18px) scale(0.75)}.c-input:focus-within legend,.c-input--active legend,.c-input:not(.c-input--disabled):active legend{width:var(--_c-input-legend-width)}.c-input.active:not(.filled) .c-input-menu__input{position:relative}.c-input.active:not(.filled) .c-input-menu__input::after{display:flex;align-items:center;position:absolute;inset:0;content:attr(data-placeholder);pointer-events:none;color:var(--_c-input-placeholder-color)}.c-input--error{color:var(--c-error-600)}.c-input--error fieldset{border-color:var(--c-error-600) !important}.c-input--error label{color:var(--c-error-600) !important}.c-input--error:focus-within{color:var(--c-error-600)}";
|
|
5
5
|
|
|
6
6
|
const CInput = proxyCustomElement(class CInput extends HTMLElement {
|
|
7
7
|
constructor() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"c-input2.js","mappings":";;;AAAA,MAAM,SAAS,GAAG,06LAA06L;;MCsB/6L,MAAM;;;;;;;IA6LT,gBAAW,GAAG,KAAK,CAAC;IAIpB,cAAS,GAAG,IAAI,CAAC;IA0FjB,cAAS,GAAG,IAAI,oBAAoB,CAC1C,CAAC,OAAO,EAAE,QAAQ;MAChB,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK;QACpB,IAAI,KAAK,CAAC,cAAc,EAAE;UACxB,IAAI,CAAC,uBAAuB,EAAE,CAAC;UAC/B,QAAQ,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;SAClC;OACF,CAAC,CAAC;KACJ,EACD,EAAE,SAAS,EAAE,CAAC,EAAE,CACjB,CAAC;IAOM,YAAO,GAAG;MAEhB,UAAU,CAAC;QACT,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QAEvB,IAAI,CAAC,WAAW,GAAG,I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EAAC,IAAI,IAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAC3B,WACE,EAAE,EAAE,WAAW,GAAG,IAAI,CAAC,OAAO,EAC9B,KAAK,EAAC,gBAAgB,eACZ,QAAQ,iBACN,MAAM,IAEjB,IAAI,CAAC,UAAU,CACZ,EAEN,WAAK,KAAK,EAAE,gBAAgB,IAC1B,WAAK,KAAK,EAAC,kBAAkB,IAC3B,WAAK,KAAK,EAAC,eAAe,EAAC,OAAO,EAAE,MAAM,IAAI,CAAC,QAAQ,EAAE,IACtD,IAAI,CAAC,cAAc,EAAE,EAEtB,WACE,KAAK,EAAC,gBAAgB,EACtB,KAAK,EAAE;QACL,2BAA2B,EAAE,IAAI,CAAC,YAAY,GAAG,IAAI;OACtD,IAED,YAAM,IAAI,EAAC,KAAK,GAAQ,EAEvB,IAAI,CAAC,YAAY,EAAE,EAEpB,eAAa,CACT,CACF,EAEL,IAAI,CAAC,OAAO,KAAK,QAAQ,IAAI,YAAM,IAAI,EAAC,UAAU,GAAQ,EAE1D,CAAC,IAAI,CAAC,WAAW,KAChB,iBACE,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,UAAU,EAAE,IAAI,CAAC,UAAU,GAC3B,CACH,CACG,CACF,CACD,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/c-input/c-input.scss?tag=c-input","src/components/c-input/c-input.tsx"],"sourcesContent":[":host(c-input) {\n --_c-input-inactive-color: var(--c-tertiary-600);\n --_c-input-active-color: var(--c-primary-600);\n --_c-input-background-color: var(--c-transparent);\n --_c-input-text-color: var(--c-text-body);\n --_c-input-placeholder-color: var(--c-tertiary-500);\n --_c-input-shadow-active-color: var(--_c-input-active-color);\n --_c-input-shadow-background-color: var(--c-white);\n --_c-input-shadow-text-color: var(--_c-input-text-color);\n --_c-input-shadow-placeholder-color: var(--_c-input-placeholder-color);\n\n // private\n --_c-input-error-color: var(--c-error-600);\n}\n\n.visuallyhidden {\n border: 0;\n clip: rect(0 0 0 0);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n}\n\n.c-input {\n $this: &;\n\n --_c-input-border-width: 1px;\n\n align-items: flex-start;\n border-radius: 4px;\n display: flex;\n flex: 1 1 auto;\n font-family: var(--c-font-family);\n font-size: 16px;\n letter-spacing: normal;\n max-width: 100%;\n text-align: left;\n\n input,\n select,\n textarea {\n background: none;\n border: 0;\n display: inline-block;\n font-family: var(--c-font-family);\n font-size: 16px;\n line-height: 1;\n margin: 0;\n padding: 0;\n vertical-align: middle;\n white-space: normal;\n }\n\n input,\n textarea {\n box-sizing: content-box;\n background-color: transparent;\n border: none;\n color: var(--_c-input-text-color);\n flex: 1 1 auto;\n font-family: var(--c-font-family);\n font-size: 16px;\n line-height: 20px;\n max-width: 100%;\n min-width: 0;\n width: 100%;\n }\n\n input[type=\"checkbox\"],\n input[type=\"radio\"],\n select {\n box-sizing: border-box;\n }\n\n input[type=\"search\"] {\n appearance: textfield;\n box-sizing: content-box;\n }\n\n ::-webkit-search-decoration {\n display: none;\n }\n\n textarea {\n margin-top: 4px;\n min-height: 44px;\n overflow: auto;\n padding: 8px 12px 8px 0;\n resize: vertical;\n vertical-align: top;\n }\n\n input {\n max-height: 32px;\n padding: 8px 0;\n }\n\n input:focus,\n input:active,\n input[aria-expanded=\"true\"],\n textarea:focus,\n textarea:active {\n outline: none;\n }\n\n .c-input__content {\n align-items: center;\n display: flex;\n width: 100%;\n\n slot {\n display: none;\n }\n\n c-icon-button {\n aspect-ratio: 1;\n margin-right: -6px;\n }\n }\n\n &__control {\n border-radius: inherit;\n color: currentColor;\n display: flex;\n flex-flow: column wrap;\n flex-grow: 1;\n gap: 8px;\n height: auto;\n min-width: 0;\n width: 100%;\n position: relative;\n }\n\n &__slot {\n align-items: stretch;\n background: transparent;\n border-radius: inherit;\n color: inherit;\n cursor: text;\n display: flex;\n min-height: 44px;\n padding: 0 12px;\n position: relative;\n transition: 0.3s cubic-bezier(0.25, 0.8, 0.5, 1);\n width: 100%;\n }\n\n &__field {\n align-items: center;\n display: flex;\n flex: 1 1 auto;\n gap: 8px;\n position: relative;\n\n input,\n textarea {\n flex: 1;\n outline: 0;\n }\n\n label {\n font-size: 16px;\n height: 20px;\n left: 0;\n letter-spacing: normal;\n line-height: 20px;\n max-width: 90%;\n min-height: 8px;\n overflow: hidden;\n pointer-events: none;\n position: absolute;\n right: auto;\n text-overflow: ellipsis;\n top: 12px;\n transform-origin: top left;\n transform: translateX(var(--_c-input-label-position)) translateY(0)\n scale(1);\n transition: 0.3s cubic-bezier(0.25, 0.8, 0.5, 1) 0.08s;\n white-space: nowrap;\n\n &.active {\n transform: translateY(-18px) scale(0.75);\n }\n\n span {\n color: var(--c-error-600);\n }\n }\n }\n\n &--select {\n input {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .c-input__slot {\n cursor: pointer;\n }\n }\n\n fieldset {\n background-color: var(--_c-input-background-color);\n border-collapse: collapse;\n border-color: var(--_c-input-inactive-color);\n border-radius: inherit;\n border-style: solid;\n border-width: var(--_c-input-border-width);\n inset: 0;\n margin: 0;\n padding: 0 0 0 8px;\n pointer-events: none;\n position: absolute;\n transition-duration: 0.15s;\n transition-property: color;\n transition-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1);\n\n legend {\n float: none;\n line-height: 11px;\n margin-left: -1px;\n padding: 0;\n text-align: left;\n transition: width 0.3s cubic-bezier(0.25, 0.8, 0.5, 1);\n width: 0;\n\n &.active {\n width: var(--_c-input-legend-width);\n }\n }\n }\n\n &--shadow {\n #{$this} {\n &__slot {\n background-color: var(--_c-input-shadow-background-color);\n box-shadow: rgba(0, 0, 0, 0.15) 0 5px 15px 0;\n\n input,\n textarea {\n color: var(--_c-input-shadow-text-color);\n }\n\n &:focus-within {\n outline: 2px var(--_c-input-active-color) solid;\n\n c-icon {\n --c-icon-color: var(--_c-input-shadow-active-color) !important;\n }\n }\n }\n }\n\n input::placeholder,\n textarea::placeholder {\n color: var(--_c-input-shadow-placeholder-color);\n opacity: 1;\n }\n }\n\n &--disabled {\n input,\n textarea,\n fieldset,\n label {\n --_c-input-error-color: var(--c-tertiary-500);\n\n color: var(--c-tertiary-500);\n }\n }\n\n &--textarea {\n #{$this} {\n &__field {\n margin-right: -12px;\n }\n }\n }\n\n ::placeholder {\n color: var(--_c-input-placeholder-color);\n opacity: 1;\n }\n\n &:focus-within,\n &--active,\n &:not(.c-input--disabled):active {\n --_c-input-border-width: 2px;\n\n color: var(--_c-input-active-color);\n\n fieldset {\n border-color: var(--_c-input-active-color);\n }\n\n label {\n color: var(--_c-input-active-color);\n transform: translateX(0) translateY(-18px) scale(0.75);\n }\n\n legend {\n width: var(--_c-input-legend-width);\n }\n }\n\n &.active:not(.filled) {\n .c-input-menu__input {\n position: relative;\n\n &::after {\n display: flex;\n align-items: center;\n position: absolute;\n inset: 0;\n content: attr(data-placeholder);\n pointer-events: none;\n color: var(--_c-input-placeholder-color);\n }\n }\n }\n\n &--error {\n color: var(--c-error-600);\n\n fieldset {\n border-color: var(--c-error-600) !important;\n }\n\n label {\n color: var(--c-error-600) !important;\n }\n\n &:focus-within {\n color: var(--c-error-600);\n }\n }\n}\n","import {\n Component,\n Host,\n h,\n State,\n Prop,\n Event,\n EventEmitter,\n Element,\n Watch,\n Method,\n} from '@stencil/core';\nimport { CAutocompleteItem, CSelectItem } from '../../types';\n\n/**\n * @parent None\n */\n@Component({\n tag: 'c-input',\n styleUrl: 'c-input.scss',\n shadow: false,\n})\nexport class CInput {\n @Element() el!: HTMLCInputElement;\n\n /**\n * Active state\n */\n @Prop() active = false;\n\n /**\n * Auto focus the input\n */\n @Prop() autofocus = false;\n\n /**\n * Disable the input\n */\n @Prop() disabled = false;\n\n /**\n * Render a hidden input outside the shadow dom\n */\n @Prop() form = false;\n\n /**\n * Hide the hint and error messages\n */\n @Prop() hideDetails = false;\n\n /**\n * Hint text for the input\n */\n @Prop() hint = '';\n\n /**\n * Id of the input\n */\n @Prop({ attribute: 'id' }) hostId: string;\n\n /**\n * Id of the input element\n */\n @Prop() inputId: string;\n\n /**\n * Items for the dropdown\n */\n @Prop() items: CSelectItem[];\n\n /**\n * Items per page before adding scroll\n */\n @Prop() itemsPerPage = 6;\n\n /**\n * Label of the input\n */\n @Prop() label: string;\n\n /**\n * Maximum value on a numeric input\n */\n @Prop() max: number = null;\n\n /**\n * Minimum value on a numeric input\n */\n @Prop() min: number = null;\n\n /**\n * Name of the input\n */\n @Prop() name: string;\n\n /**\n * Placeholder of the input\n */\n @Prop() placeholder: string;\n\n /**\n * Mark as readonly\n */\n @Prop() readonly = false;\n\n /**\n * Set the input as required\n */\n @Prop() required = false;\n\n /**\n * Rows on the input\n */\n @Prop() rows = 1;\n\n /**\n * Shadow variant of the input\n */\n @Prop() shadow = false;\n\n /**\n * Step size on a numeric input\n */\n @Prop() step: number = null;\n\n /**\n * Type of the input\n */\n @Prop() type: string;\n\n /**\n * Set the validíty of the input\n */\n @Prop() valid = true;\n\n /**\n * Manual validation\n */\n @Prop() validate = false;\n\n /**\n * Validate the input on blur\n */\n @Prop() validateOnBlur = false;\n\n /**\n * Custom validation message\n */\n @Prop() validation = 'Required field';\n\n /**\n * Value of the input\n */\n @Prop() value: string | number | boolean | CSelectItem | CAutocompleteItem;\n\n /**\n * Variant\n */\n @Prop() variant: 'text' | 'select' = 'text';\n\n /**\n * Emit changes to the parent\n */\n @Event({ bubbles: false }) changeValue: EventEmitter;\n\n /**\n * Emit click to the parent\n * @private\n */\n @Event({ bubbles: false }) itemClick: EventEmitter;\n\n /**\n * Emit close to the parent\n * @private\n */\n @Event({ bubbles: false }) dropdownClose: EventEmitter;\n\n @State() isFocused = false;\n\n @State() labelWidth = 0;\n\n @State() preSlotWidth = 0;\n\n @State() statusText = '';\n\n @State() currentIndex: number = null;\n\n @Watch('valid')\n onValidChange() {\n if (this.validateOnBlur && !this._hasBlurred) return;\n\n this._setAriaDescriptionId();\n }\n\n @Watch('validation')\n onValidationMessageChange() {\n this._updateStatusText();\n }\n\n @Watch('value')\n onValueChange(value) {\n if (!value) {\n this._onReset();\n }\n }\n\n @Watch('placeholder')\n onPlaceholderChange(placeholder) {\n if (placeholder) this._onReset();\n }\n\n private _hasBlurred = false;\n\n private _labelRef: HTMLLabelElement;\n\n private _debounce = null;\n\n private _dropdownElement: HTMLCDropdownElement;\n\n /**\n * @private\n */\n @Method()\n async reset() {\n this._onReset();\n }\n\n componentDidLoad() {\n if (this.autofocus) {\n setTimeout(() => {\n this._onFocus(false);\n }, 500);\n }\n\n this._calculateElementWidths();\n this._setAriaDescriptionId();\n\n if (this.label) {\n this._observer.observe(this._labelRef);\n }\n\n this.inputField?.addEventListener('focus', () => this._onFocus(false));\n this.inputField?.addEventListener('blur', () => this._onBlur());\n this.inputField?.addEventListener(\n 'keypress',\n this._preventNonNumericalInput,\n );\n\n // hide the placeholder text initially if there is a label\n if (this.inputField) {\n this.inputField.placeholder =\n !!this.label || !this.placeholder ? '' : this.placeholder;\n\n this.inputField.title = this.label ?? this.placeholder;\n\n requestAnimationFrame(() => {\n const container = this.inputField.closest(\n '.c-input-menu__input',\n ) as HTMLDivElement;\n\n if (!container) return;\n\n container.dataset.placeholder = this.placeholder;\n });\n }\n }\n\n disconnectedCallback() {\n this.inputField?.removeEventListener('focus', () => this._onFocus(false));\n this.inputField?.removeEventListener('blur', () => this._onBlur());\n this.inputField?.removeEventListener(\n 'keypress',\n this._preventNonNumericalInput,\n );\n\n this._observer.disconnect();\n\n this._dropdownElement?.remove();\n }\n\n get isActive() {\n return !!this.value || typeof this.value === 'boolean' || this.isFocused;\n }\n\n private _setAriaDescriptionId() {\n this.inputField.removeAttribute('aria-describedby');\n\n let type = null;\n\n if (this.valid && !this.value && this.hint) {\n type = 'hint';\n }\n\n if (!this.valid) {\n type = 'error';\n }\n\n if (type) {\n this.inputField.setAttribute(\n 'aria-describedby',\n `${type}-${this.inputId}`,\n );\n }\n }\n\n private _observer = new IntersectionObserver(\n (entries, observer) => {\n entries.forEach((entry) => {\n if (entry.isIntersecting) {\n this._calculateElementWidths();\n observer.unobserve(entry.target);\n }\n });\n },\n { threshold: 1 },\n );\n\n private _calculateElementWidths() {\n this.labelWidth = !!this.label ? this._labelRef.scrollWidth * 0.75 + 6 : 0;\n this.preSlotWidth = this.inputField.offsetLeft;\n }\n\n private _onBlur = () => {\n // delay the blur event to prevent the label from 'flashing' on c-select selection\n setTimeout(() => {\n this.isFocused = false;\n\n this._hasBlurred = true;\n\n // show the label if there's no label or value\n this._onReset();\n }, 100);\n };\n\n private _onFocus = (click = true) => {\n if (this.disabled) return;\n\n this.isFocused = true;\n\n this.inputField?.focus();\n\n if (click) {\n this.inputField?.click();\n\n if (this.variant === 'select') {\n this.itemClick.emit();\n }\n }\n\n // show the label if there's no value\n if (this.inputField) {\n this.inputField.placeholder =\n !!this.value || !this.placeholder ? '' : this.placeholder;\n }\n };\n\n private _onReset() {\n if (this.inputField) {\n if (\n !!this.placeholder &&\n !this.value &&\n (this.active || this.isFocused)\n ) {\n this.inputField.placeholder = this.placeholder;\n\n return;\n }\n\n this.inputField.placeholder =\n !this.label && !this.value && !!this.placeholder\n ? this.placeholder\n : '';\n }\n }\n\n /**\n * Prevent non numeric values in the numeric fields\n */\n private _preventNonNumericalInput(event: KeyboardEvent) {\n if (this.type !== 'number') return;\n\n if (!event.key.match(/^[0-9,\\.-]+$/)) {\n event.preventDefault();\n }\n }\n\n private _renderBorders() {\n if (this.shadow) return;\n\n const classes = {\n active: this.isActive || this.active,\n };\n\n return (\n <fieldset aria-hidden=\"true\">\n <legend\n class={classes}\n style={{\n '--_c-input-legend-width': this.labelWidth + 'px',\n }}\n >\n <span class=\"notranslate\"></span>\n </legend>\n </fieldset>\n );\n }\n\n private _renderLabel() {\n if (!this.label) return;\n\n const classes = {\n active: this.isActive,\n };\n\n return (\n <label\n htmlFor={this.inputId}\n ref={(el) => (this._labelRef = el as HTMLLabelElement)}\n class={classes}\n >\n {this.label}\n {this.required && <span> *</span>}\n </label>\n );\n }\n\n get inputField() {\n return this.el?.querySelector('.c-input__input') as\n | HTMLInputElement\n | HTMLTextAreaElement;\n }\n\n private _updateStatusText() {\n if (this._debounce !== null) {\n clearTimeout(this._debounce);\n this._debounce = null;\n }\n\n this._debounce = window.setTimeout(() => {\n this.statusText = this.valid ? '' : `Error: ${this.validation}`;\n\n this._debounce = null;\n }, 1400);\n }\n\n render() {\n const containerClasses = {\n 'c-input': true,\n 'c-input--disabled': this.disabled,\n 'c-input--shadow': this.shadow,\n 'c-input--textarea': this.rows > 1,\n 'c-input--error': !this.valid,\n 'c-input--active': this.isFocused || this.active,\n filled: !!this.value,\n [`c-input--${this.variant}`]: true,\n };\n\n return (\n <Host disabled={this.disabled}>\n <div\n id={'announce-' + this.inputId}\n class=\"visuallyhidden\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n {this.statusText}\n </div>\n\n <div class={containerClasses}>\n <div class=\"c-input__control\">\n <div class=\"c-input__slot\" onClick={() => this._onFocus()}>\n {this._renderBorders()}\n\n <div\n class=\"c-input__field\"\n style={{\n '--_c-input-label-position': this.preSlotWidth + 'px',\n }}\n >\n <slot name=\"pre\"></slot>\n\n {this._renderLabel()}\n\n <slot></slot>\n </div>\n </div>\n\n {this.variant === 'select' && <slot name=\"dropdown\"></slot>}\n\n {!this.hideDetails && (\n <c-message\n hint={this.hint}\n inputId={this.inputId}\n valid={this.valid}\n validation={this.validation}\n />\n )}\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"c-input2.js","mappings":";;;AAAA,MAAM,SAAS,GAAG,+7LAA+7L;;MCsBp8L,MAAM;;;;;;;IA6LT,gBAAW,GAAG,KAAK,CAAC;IAIpB,cAAS,GAAG,IAAI,CAAC;IA0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I,CAAC,UAAU,GAC3B,CACH,CACG,CACF,CACD,EACP;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/c-input/c-input.scss?tag=c-input","src/components/c-input/c-input.tsx"],"sourcesContent":[":host(c-input) {\n --_c-input-inactive-color: var(--c-tertiary-600);\n --_c-input-active-color: var(--c-primary-600);\n --_c-input-background-color: var(--c-transparent);\n --_c-input-text-color: var(--c-text-body);\n --_c-input-placeholder-color: var(--c-tertiary-500);\n --_c-input-shadow-active-color: var(--_c-input-active-color);\n --_c-input-shadow-background-color: var(--c-white);\n --_c-input-shadow-text-color: var(--_c-input-text-color);\n --_c-input-shadow-placeholder-color: var(--_c-input-placeholder-color);\n\n // private\n --_c-input-error-color: var(--c-error-600);\n}\n\n.visuallyhidden {\n border: 0;\n clip: rect(0 0 0 0);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n}\n\n.c-input {\n $this: &;\n\n --_c-input-border-width: 1px;\n\n align-items: flex-start;\n border-radius: 4px;\n display: flex;\n flex: 1 1 auto;\n font-family: var(--c-font-family);\n font-size: 16px;\n letter-spacing: normal;\n max-width: 100%;\n text-align: left;\n\n input,\n select,\n textarea {\n background: none;\n border: 0;\n display: inline-block;\n font-family: var(--c-font-family);\n font-size: 16px;\n line-height: 1;\n margin: 0;\n padding: 0;\n vertical-align: middle;\n white-space: normal;\n }\n\n input,\n textarea {\n box-sizing: content-box;\n background-color: transparent;\n border: none;\n color: var(--_c-input-text-color);\n flex: 1 1 auto;\n font-family: var(--c-font-family);\n font-size: 16px;\n line-height: 20px;\n max-width: 100%;\n min-width: 0;\n width: 100%;\n }\n\n input[type=\"checkbox\"],\n input[type=\"radio\"],\n select {\n box-sizing: border-box;\n }\n\n input[type=\"search\"] {\n appearance: textfield;\n box-sizing: content-box;\n }\n\n ::-webkit-search-decoration {\n display: none;\n }\n\n textarea {\n margin-top: 4px;\n min-height: 44px;\n overflow: auto;\n padding: 8px 12px 8px 0;\n resize: vertical;\n vertical-align: top;\n white-space: pre-wrap;\n }\n\n input {\n max-height: 32px;\n padding: 8px 0;\n }\n\n input:focus,\n input:active,\n input[aria-expanded=\"true\"],\n textarea:focus,\n textarea:active {\n outline: none;\n }\n\n .c-input__content {\n align-items: center;\n display: flex;\n width: 100%;\n\n slot {\n display: none;\n }\n\n c-icon-button {\n aspect-ratio: 1;\n margin-right: -6px;\n }\n }\n\n &__control {\n border-radius: inherit;\n color: currentColor;\n display: flex;\n flex-flow: column wrap;\n flex-grow: 1;\n gap: 8px;\n height: auto;\n min-width: 0;\n width: 100%;\n position: relative;\n }\n\n &__slot {\n align-items: stretch;\n background: transparent;\n border-radius: inherit;\n color: inherit;\n cursor: text;\n display: flex;\n min-height: 44px;\n padding: 0 12px;\n position: relative;\n transition: 0.3s cubic-bezier(0.25, 0.8, 0.5, 1);\n width: 100%;\n }\n\n &__field {\n align-items: center;\n display: flex;\n flex: 1 1 auto;\n gap: 8px;\n position: relative;\n\n input,\n textarea {\n flex: 1;\n outline: 0;\n }\n\n label {\n font-size: 16px;\n height: 20px;\n left: 0;\n letter-spacing: normal;\n line-height: 20px;\n max-width: 90%;\n min-height: 8px;\n overflow: hidden;\n pointer-events: none;\n position: absolute;\n right: auto;\n text-overflow: ellipsis;\n top: 12px;\n transform-origin: top left;\n transform: translateX(var(--_c-input-label-position)) translateY(0)\n scale(1);\n transition: 0.3s cubic-bezier(0.25, 0.8, 0.5, 1) 0.08s;\n white-space: nowrap;\n\n &.active {\n transform: translateY(-18px) scale(0.75);\n }\n\n span {\n color: var(--c-error-600);\n }\n }\n }\n\n &--select {\n input {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .c-input__slot {\n cursor: pointer;\n }\n }\n\n fieldset {\n background-color: var(--_c-input-background-color);\n border-collapse: collapse;\n border-color: var(--_c-input-inactive-color);\n border-radius: inherit;\n border-style: solid;\n border-width: var(--_c-input-border-width);\n inset: 0;\n margin: 0;\n padding: 0 0 0 8px;\n pointer-events: none;\n position: absolute;\n transition-duration: 0.15s;\n transition-property: color;\n transition-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1);\n\n legend {\n float: none;\n line-height: 11px;\n margin-left: -1px;\n padding: 0;\n text-align: left;\n transition: width 0.3s cubic-bezier(0.25, 0.8, 0.5, 1);\n width: 0;\n\n &.active {\n width: var(--_c-input-legend-width);\n }\n }\n }\n\n &--shadow {\n #{$this} {\n &__slot {\n background-color: var(--_c-input-shadow-background-color);\n box-shadow: rgba(0, 0, 0, 0.15) 0 5px 15px 0;\n\n input,\n textarea {\n color: var(--_c-input-shadow-text-color);\n }\n\n &:focus-within {\n outline: 2px var(--_c-input-active-color) solid;\n\n c-icon {\n --c-icon-color: var(--_c-input-shadow-active-color) !important;\n }\n }\n }\n }\n\n input::placeholder,\n textarea::placeholder {\n color: var(--_c-input-shadow-placeholder-color);\n opacity: 1;\n }\n }\n\n &--disabled {\n input,\n textarea,\n fieldset,\n label {\n --_c-input-error-color: var(--c-tertiary-500);\n\n color: var(--c-tertiary-500);\n }\n }\n\n &--textarea {\n #{$this} {\n &__field {\n margin-right: -12px;\n }\n }\n }\n\n ::placeholder {\n color: var(--_c-input-placeholder-color);\n opacity: 1;\n }\n\n &:focus-within,\n &--active,\n &:not(.c-input--disabled):active {\n --_c-input-border-width: 2px;\n\n color: var(--_c-input-active-color);\n\n fieldset {\n border-color: var(--_c-input-active-color);\n }\n\n label {\n color: var(--_c-input-active-color);\n transform: translateX(0) translateY(-18px) scale(0.75);\n }\n\n legend {\n width: var(--_c-input-legend-width);\n }\n }\n\n &.active:not(.filled) {\n .c-input-menu__input {\n position: relative;\n\n &::after {\n display: flex;\n align-items: center;\n position: absolute;\n inset: 0;\n content: attr(data-placeholder);\n pointer-events: none;\n color: var(--_c-input-placeholder-color);\n }\n }\n }\n\n &--error {\n color: var(--c-error-600);\n\n fieldset {\n border-color: var(--c-error-600) !important;\n }\n\n label {\n color: var(--c-error-600) !important;\n }\n\n &:focus-within {\n color: var(--c-error-600);\n }\n }\n}\n","import {\n Component,\n Host,\n h,\n State,\n Prop,\n Event,\n EventEmitter,\n Element,\n Watch,\n Method,\n} from '@stencil/core';\nimport { CAutocompleteItem, CSelectItem } from '../../types';\n\n/**\n * @parent None\n */\n@Component({\n tag: 'c-input',\n styleUrl: 'c-input.scss',\n shadow: false,\n})\nexport class CInput {\n @Element() el!: HTMLCInputElement;\n\n /**\n * Active state\n */\n @Prop() active = false;\n\n /**\n * Auto focus the input\n */\n @Prop() autofocus = false;\n\n /**\n * Disable the input\n */\n @Prop() disabled = false;\n\n /**\n * Render a hidden input outside the shadow dom\n */\n @Prop() form = false;\n\n /**\n * Hide the hint and error messages\n */\n @Prop() hideDetails = false;\n\n /**\n * Hint text for the input\n */\n @Prop() hint = '';\n\n /**\n * Id of the input\n */\n @Prop({ attribute: 'id' }) hostId: string;\n\n /**\n * Id of the input element\n */\n @Prop() inputId: string;\n\n /**\n * Items for the dropdown\n */\n @Prop() items: CSelectItem[];\n\n /**\n * Items per page before adding scroll\n */\n @Prop() itemsPerPage = 6;\n\n /**\n * Label of the input\n */\n @Prop() label: string;\n\n /**\n * Maximum value on a numeric input\n */\n @Prop() max: number = null;\n\n /**\n * Minimum value on a numeric input\n */\n @Prop() min: number = null;\n\n /**\n * Name of the input\n */\n @Prop() name: string;\n\n /**\n * Placeholder of the input\n */\n @Prop() placeholder: string;\n\n /**\n * Mark as readonly\n */\n @Prop() readonly = false;\n\n /**\n * Set the input as required\n */\n @Prop() required = false;\n\n /**\n * Rows on the input\n */\n @Prop() rows = 1;\n\n /**\n * Shadow variant of the input\n */\n @Prop() shadow = false;\n\n /**\n * Step size on a numeric input\n */\n @Prop() step: number = null;\n\n /**\n * Type of the input\n */\n @Prop() type: string;\n\n /**\n * Set the validíty of the input\n */\n @Prop() valid = true;\n\n /**\n * Manual validation\n */\n @Prop() validate = false;\n\n /**\n * Validate the input on blur\n */\n @Prop() validateOnBlur = false;\n\n /**\n * Custom validation message\n */\n @Prop() validation = 'Required field';\n\n /**\n * Value of the input\n */\n @Prop() value: string | number | boolean | CSelectItem | CAutocompleteItem;\n\n /**\n * Variant\n */\n @Prop() variant: 'text' | 'select' = 'text';\n\n /**\n * Emit changes to the parent\n */\n @Event({ bubbles: false }) changeValue: EventEmitter;\n\n /**\n * Emit click to the parent\n * @private\n */\n @Event({ bubbles: false }) itemClick: EventEmitter;\n\n /**\n * Emit close to the parent\n * @private\n */\n @Event({ bubbles: false }) dropdownClose: EventEmitter;\n\n @State() isFocused = false;\n\n @State() labelWidth = 0;\n\n @State() preSlotWidth = 0;\n\n @State() statusText = '';\n\n @State() currentIndex: number = null;\n\n @Watch('valid')\n onValidChange() {\n if (this.validateOnBlur && !this._hasBlurred) return;\n\n this._setAriaDescriptionId();\n }\n\n @Watch('validation')\n onValidationMessageChange() {\n this._updateStatusText();\n }\n\n @Watch('value')\n onValueChange(value) {\n if (!value) {\n this._onReset();\n }\n }\n\n @Watch('placeholder')\n onPlaceholderChange(placeholder) {\n if (placeholder) this._onReset();\n }\n\n private _hasBlurred = false;\n\n private _labelRef: HTMLLabelElement;\n\n private _debounce = null;\n\n private _dropdownElement: HTMLCDropdownElement;\n\n /**\n * @private\n */\n @Method()\n async reset() {\n this._onReset();\n }\n\n componentDidLoad() {\n if (this.autofocus) {\n setTimeout(() => {\n this._onFocus(false);\n }, 500);\n }\n\n this._calculateElementWidths();\n this._setAriaDescriptionId();\n\n if (this.label) {\n this._observer.observe(this._labelRef);\n }\n\n this.inputField?.addEventListener('focus', () => this._onFocus(false));\n this.inputField?.addEventListener('blur', () => this._onBlur());\n this.inputField?.addEventListener(\n 'keypress',\n this._preventNonNumericalInput,\n );\n\n // hide the placeholder text initially if there is a label\n if (this.inputField) {\n this.inputField.placeholder =\n !!this.label || !this.placeholder ? '' : this.placeholder;\n\n this.inputField.title = this.label ?? this.placeholder;\n\n requestAnimationFrame(() => {\n const container = this.inputField.closest(\n '.c-input-menu__input',\n ) as HTMLDivElement;\n\n if (!container) return;\n\n container.dataset.placeholder = this.placeholder;\n });\n }\n }\n\n disconnectedCallback() {\n this.inputField?.removeEventListener('focus', () => this._onFocus(false));\n this.inputField?.removeEventListener('blur', () => this._onBlur());\n this.inputField?.removeEventListener(\n 'keypress',\n this._preventNonNumericalInput,\n );\n\n this._observer.disconnect();\n\n this._dropdownElement?.remove();\n }\n\n get isActive() {\n return !!this.value || typeof this.value === 'boolean' || this.isFocused;\n }\n\n private _setAriaDescriptionId() {\n this.inputField.removeAttribute('aria-describedby');\n\n let type = null;\n\n if (this.valid && !this.value && this.hint) {\n type = 'hint';\n }\n\n if (!this.valid) {\n type = 'error';\n }\n\n if (type) {\n this.inputField.setAttribute(\n 'aria-describedby',\n `${type}-${this.inputId}`,\n );\n }\n }\n\n private _observer = new IntersectionObserver(\n (entries, observer) => {\n entries.forEach((entry) => {\n if (entry.isIntersecting) {\n this._calculateElementWidths();\n observer.unobserve(entry.target);\n }\n });\n },\n { threshold: 1 },\n );\n\n private _calculateElementWidths() {\n this.labelWidth = !!this.label ? this._labelRef.scrollWidth * 0.75 + 6 : 0;\n this.preSlotWidth = this.inputField.offsetLeft;\n }\n\n private _onBlur = () => {\n // delay the blur event to prevent the label from 'flashing' on c-select selection\n setTimeout(() => {\n this.isFocused = false;\n\n this._hasBlurred = true;\n\n // show the label if there's no label or value\n this._onReset();\n }, 100);\n };\n\n private _onFocus = (click = true) => {\n if (this.disabled) return;\n\n this.isFocused = true;\n\n this.inputField?.focus();\n\n if (click) {\n this.inputField?.click();\n\n if (this.variant === 'select') {\n this.itemClick.emit();\n }\n }\n\n // show the label if there's no value\n if (this.inputField) {\n this.inputField.placeholder =\n !!this.value || !this.placeholder ? '' : this.placeholder;\n }\n };\n\n private _onReset() {\n if (this.inputField) {\n if (\n !!this.placeholder &&\n !this.value &&\n (this.active || this.isFocused)\n ) {\n this.inputField.placeholder = this.placeholder;\n\n return;\n }\n\n this.inputField.placeholder =\n !this.label && !this.value && !!this.placeholder\n ? this.placeholder\n : '';\n }\n }\n\n /**\n * Prevent non numeric values in the numeric fields\n */\n private _preventNonNumericalInput(event: KeyboardEvent) {\n if (this.type !== 'number') return;\n\n if (!event.key.match(/^[0-9,\\.-]+$/)) {\n event.preventDefault();\n }\n }\n\n private _renderBorders() {\n if (this.shadow) return;\n\n const classes = {\n active: this.isActive || this.active,\n };\n\n return (\n <fieldset aria-hidden=\"true\">\n <legend\n class={classes}\n style={{\n '--_c-input-legend-width': this.labelWidth + 'px',\n }}\n >\n <span class=\"notranslate\"></span>\n </legend>\n </fieldset>\n );\n }\n\n private _renderLabel() {\n if (!this.label) return;\n\n const classes = {\n active: this.isActive,\n };\n\n return (\n <label\n htmlFor={this.inputId}\n ref={(el) => (this._labelRef = el as HTMLLabelElement)}\n class={classes}\n >\n {this.label}\n {this.required && <span> *</span>}\n </label>\n );\n }\n\n get inputField() {\n return this.el?.querySelector('.c-input__input') as\n | HTMLInputElement\n | HTMLTextAreaElement;\n }\n\n private _updateStatusText() {\n if (this._debounce !== null) {\n clearTimeout(this._debounce);\n this._debounce = null;\n }\n\n this._debounce = window.setTimeout(() => {\n this.statusText = this.valid ? '' : `Error: ${this.validation}`;\n\n this._debounce = null;\n }, 1400);\n }\n\n render() {\n const containerClasses = {\n 'c-input': true,\n 'c-input--disabled': this.disabled,\n 'c-input--shadow': this.shadow,\n 'c-input--textarea': this.rows > 1,\n 'c-input--error': !this.valid,\n 'c-input--active': this.isFocused || this.active,\n filled: !!this.value,\n [`c-input--${this.variant}`]: true,\n };\n\n return (\n <Host disabled={this.disabled}>\n <div\n id={'announce-' + this.inputId}\n class=\"visuallyhidden\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n {this.statusText}\n </div>\n\n <div class={containerClasses}>\n <div class=\"c-input__control\">\n <div class=\"c-input__slot\" onClick={() => this._onFocus()}>\n {this._renderBorders()}\n\n <div\n class=\"c-input__field\"\n style={{\n '--_c-input-label-position': this.preSlotWidth + 'px',\n }}\n >\n <slot name=\"pre\"></slot>\n\n {this._renderLabel()}\n\n <slot></slot>\n </div>\n </div>\n\n {this.variant === 'select' && <slot name=\"dropdown\"></slot>}\n\n {!this.hideDetails && (\n <c-message\n hint={this.hint}\n inputId={this.inputId}\n valid={this.valid}\n validation={this.validation}\n />\n )}\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -9,31 +9,36 @@ const CModal$1 = proxyCustomElement(class CModal extends HTMLElement {
|
|
|
9
9
|
this.__attachShadow();
|
|
10
10
|
this.changeValue = createEvent(this, "changeValue", 3);
|
|
11
11
|
this._debounce = null;
|
|
12
|
+
this._animationsDisabled = false;
|
|
12
13
|
this._handleShow = () => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
this._dialog.
|
|
16
|
-
this._dialog.
|
|
14
|
+
var _a, _b, _c;
|
|
15
|
+
if (!this._animationsDisabled) {
|
|
16
|
+
(_a = this._dialog) === null || _a === void 0 ? void 0 : _a.addEventListener('animationend', this._onDialogOpened);
|
|
17
|
+
(_b = this._dialog) === null || _b === void 0 ? void 0 : _b.classList.add('opening');
|
|
17
18
|
}
|
|
19
|
+
(_c = this._dialog) === null || _c === void 0 ? void 0 : _c.showModal();
|
|
18
20
|
};
|
|
19
21
|
this._onDialogOpened = () => {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
22
|
+
var _a, _b;
|
|
23
|
+
(_a = this._dialog) === null || _a === void 0 ? void 0 : _a.removeEventListener('animationend', this._onDialogOpened);
|
|
24
|
+
(_b = this._dialog) === null || _b === void 0 ? void 0 : _b.classList.remove('opening');
|
|
24
25
|
};
|
|
25
26
|
this._handleClose = () => {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
this.
|
|
27
|
+
var _a, _b;
|
|
28
|
+
if (this._animationsDisabled) {
|
|
29
|
+
this._onDialogClosed();
|
|
30
|
+
return;
|
|
29
31
|
}
|
|
32
|
+
(_a = this._dialog) === null || _a === void 0 ? void 0 : _a.addEventListener('animationend', this._onDialogClosed);
|
|
33
|
+
(_b = this._dialog) === null || _b === void 0 ? void 0 : _b.classList.add('closing');
|
|
30
34
|
};
|
|
31
35
|
this._onDialogClosed = () => {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
this._dialog.
|
|
35
|
-
this._dialog.
|
|
36
|
+
var _a, _b, _c;
|
|
37
|
+
if (!this._animationsDisabled) {
|
|
38
|
+
(_a = this._dialog) === null || _a === void 0 ? void 0 : _a.removeEventListener('animationend', this._onDialogClosed);
|
|
39
|
+
(_b = this._dialog) === null || _b === void 0 ? void 0 : _b.classList.remove('closing');
|
|
36
40
|
}
|
|
41
|
+
(_c = this._dialog) === null || _c === void 0 ? void 0 : _c.close();
|
|
37
42
|
if (!document.fullscreenElement)
|
|
38
43
|
return;
|
|
39
44
|
document.exitFullscreen();
|
|
@@ -92,6 +97,8 @@ const CModal$1 = proxyCustomElement(class CModal extends HTMLElement {
|
|
|
92
97
|
this.el.style.setProperty('--_c-modal-width', `${width}`);
|
|
93
98
|
}
|
|
94
99
|
componentDidLoad() {
|
|
100
|
+
const query = window.matchMedia('(prefers-reduced-motion: reduce)');
|
|
101
|
+
this._animationsDisabled = query.matches;
|
|
95
102
|
this._handleClickOutside();
|
|
96
103
|
if (this.value) {
|
|
97
104
|
this._handleShow();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"c-modal.js","mappings":";;AAAA,MAAM,SAAS,GAAG,ywCAAywC;;MCmB9wCA,QAAM;;;;;;IAwCT,cAAS,GAAG,IAAI,CAAC;
|
|
1
|
+
{"file":"c-modal.js","mappings":";;AAAA,MAAM,SAAS,GAAG,ywCAAywC;;MCmB9wCA,QAAM;;;;;;IAwCT,cAAS,GAAG,IAAI,CAAC;IAEjB,wBAAmB,GAAG,KAAK,CAAC;IAa5B,gBAAW,GAAG;;MACpB,IAAI,CAAC,IAAI,CAAC,mBAA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al"],"sources":["src/components/c-modal/c-modal.scss?tag=c-modal&encapsulation=shadow","src/components/c-modal/c-modal.tsx"],"sourcesContent":["dialog {\n background-color: transparent;\n border: none;\n color: var(--c-text-body);\n inset: 0;\n margin: auto;\n max-width: calc(100% - 32px);\n overflow: visible;\n padding: 0;\n width: var(--_c-modal-width, 600px);\n\n &:not([open]) {\n pointer-events: none;\n opacity: 0;\n }\n\n &::backdrop {\n background-color: rgba(0, 0, 0, 0.5);\n }\n\n &.backdrop-blur {\n &::backdrop {\n backdrop-filter: blur(4px);\n }\n }\n}\n\n@media (prefers-reduced-motion: no-preference) {\n dialog {\n &.nudging {\n animation: dialog-nudge 0.15s cubic-bezier(0.25, 0.8, 0.25, 1) !important;\n }\n\n &.opening {\n animation: dialog-open 0.3s cubic-bezier(0.25, 0.8, 0.5, 1) forwards;\n\n &::backdrop {\n animation: backdrop-fadein 0.3s forwards;\n }\n }\n\n &.closing {\n animation: dialog-close 0.3s cubic-bezier(0.25, 0.8, 0.5, 1) forwards;\n\n &::backdrop {\n animation: backdrop-fadeout 0.3s forwards;\n }\n }\n }\n}\n\n@keyframes dialog-nudge {\n 0% {\n transform: scale(1);\n }\n\n 50% {\n transform: scale(1.03);\n }\n\n 100% {\n transform: scale(1);\n }\n}\n\n@keyframes dialog-open {\n from {\n transform: scale(0);\n }\n\n to {\n transform: scale(1);\n }\n}\n\n@keyframes dialog-close {\n to {\n transform: scale(0);\n }\n}\n\n@keyframes backdrop-fadein {\n from {\n opacity: 0;\n }\n\n to {\n opacity: 1;\n }\n}\n\n@keyframes backdrop-fadeout {\n from {\n opacity: 1;\n }\n\n to {\n opacity: 0;\n }\n}\n","import {\n Component,\n h,\n Prop,\n Event,\n EventEmitter,\n State,\n Watch,\n Element,\n} from '@stencil/core';\n\n/**\n * @group Popups\n */\n@Component({\n tag: 'c-modal',\n styleUrl: 'c-modal.scss',\n shadow: true,\n})\nexport class CModal {\n @Element() el: HTMLCModalElement;\n\n private _dialog?: HTMLDialogElement;\n\n /**\n * Is the modal visible\n */\n @Prop() value = false;\n\n /**\n * Dismissed when touching/clicking outside the content\n */\n @Prop() dismissable = false;\n\n /**\n * Width of the dialog. Numeric value is considered as pixel value (400 -> 400px)\n *\n */\n @Prop() width: string | number = 600;\n\n /**\n * Z-index of the modal\n */\n @Prop() zIndex = 10;\n\n /**\n * Disable backdrop blur effect\n */\n @Prop() disableBackdropBlur = false;\n\n /**\n * Triggered when value is changed\n */\n @Event({ bubbles: false }) changeValue: EventEmitter<boolean>;\n\n @State() innerValue = false;\n\n @State() animateModal = false;\n\n private _debounce = null;\n\n private _animationsDisabled = false;\n\n @Watch('value')\n onValueChange(value: boolean) {\n if (value) {\n this._handleShow();\n\n return;\n }\n\n this._handleClose();\n }\n\n private _handleShow = () => {\n if (!this._animationsDisabled) {\n this._dialog?.addEventListener('animationend', this._onDialogOpened);\n this._dialog?.classList.add('opening');\n }\n\n this._dialog?.showModal();\n };\n\n private _onDialogOpened = () => {\n this._dialog?.removeEventListener('animationend', this._onDialogOpened);\n this._dialog?.classList.remove('opening');\n };\n\n private _handleClose = () => {\n if (this._animationsDisabled) {\n this._onDialogClosed();\n\n return;\n }\n\n this._dialog?.addEventListener('animationend', this._onDialogClosed);\n this._dialog?.classList.add('closing');\n };\n\n private _onDialogClosed = () => {\n if (!this._animationsDisabled) {\n this._dialog?.removeEventListener('animationend', this._onDialogClosed);\n this._dialog?.classList.remove('closing');\n }\n\n this._dialog?.close();\n\n if (!document.fullscreenElement) return;\n\n document.exitFullscreen();\n };\n\n private _handleClickOutside = () => {\n this._dialog.addEventListener('click', (e) => {\n if (e.clientX === 0 && e.clientY === 0) return;\n\n const dialogDimensions = this._dialog.getBoundingClientRect();\n\n if (\n e.clientX < dialogDimensions.left ||\n e.clientX > dialogDimensions.right ||\n e.clientY < dialogDimensions.top ||\n e.clientY > dialogDimensions.bottom\n ) {\n if (!this.dismissable) {\n this._dialog.classList.add('nudging');\n\n if (this._debounce !== null) {\n clearTimeout(this._debounce);\n this._debounce = null;\n }\n\n this._debounce = window.setTimeout(() => {\n this._dialog.classList.remove('nudging');\n\n this._debounce = null;\n }, 150);\n\n return;\n }\n\n this._handleClose();\n this.changeValue.emit(false);\n }\n });\n };\n\n private _handleKeyDown = (e) => {\n if (e.keyCode === 27) {\n e.preventDefault();\n this._handleClose();\n this.changeValue.emit(false);\n }\n };\n\n componentWillLoad() {\n this.innerValue = this.value;\n\n const width = isNaN(this.width as number) ? this.width : `${this.width}px`;\n\n this.el.style.setProperty('--_c-modal-width', `${width}`);\n }\n\n componentDidLoad() {\n const query = window.matchMedia('(prefers-reduced-motion: reduce)');\n\n this._animationsDisabled = query.matches;\n\n this._handleClickOutside();\n\n if (this.value) {\n this._handleShow();\n }\n }\n\n render() {\n const dialogStyle = {\n 'z-index': `${this.zIndex}`,\n };\n\n const classes = {\n 'backdrop-blur': !this.disableBackdropBlur,\n };\n\n return (\n <dialog\n ref={(el) => (this._dialog = el as HTMLDialogElement)}\n style={dialogStyle}\n class={classes}\n onKeyDown={this._handleKeyDown}\n >\n <slot></slot>\n </dialog>\n );\n }\n}\n"],"version":3}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,b as a}from"./p-565ec8e4.js";export{s as setNonce}from"./p-565ec8e4.js";const t=()=>{const a=import.meta.url;const t={};if(a!==""){t.resourcesUrl=new URL(".",a).href}return e(t)};t().then((e=>a(JSON.parse('[["p-f216dda9",[[1,"c-data-table",{"data":[16],"externalData":[4,"external-data"],"headers":[16],"hideFooter":[4,"hide-footer"],"footerOptions":[16],"loading":[4],"loadingText":[1,"loading-text"],"noDataText":[1,"no-data-text"],"pagination":[1040],"selectable":[4],"singleSelection":[4,"single-selection"],"selectionProperty":[1,"selection-property"],"singleExpansion":[4,"single-expansion"],"sortBy":[1032,"sort-by"],"sortDirection":[1025,"sort-direction"],"stickyHeader":[4,"sticky-header"],"horizontalScrolling":[4,"horizontal-scrolling"],"_activeRows":[32],"_data":[32],"_isIndeterminate":[32],"_isPaginationSimple":[32],"_selections":[32],"hasOverflow":[32],"hiddenHeaders":[32],"initiallyHiddenHeaders":[32],"forceRender":[32],"breakpoints":[32],"markedFooterWidth":[32],"parentWidth":[32],"firstCellHidden":[32],"lastCellHidden":[32],"clearSelections":[64],"getData":[64]},null,{"hiddenHeaders":["onHiddenHeaderChange"],"data":["onDataChange"],"headers":["onHeaderChange"],"singleSelection":["onSingleSelectionChange"],"loading":["onLoadingChange"]}]]],["p-80cdd280",[[1,"c-tabs",{"value":[1032],"borderless":[4],"disableAnimation":[4,"disable-animation"],"justify":[1],"mobileBreakpoint":[2,"mobile-breakpoint"],"vertical":[4],"isOverflowing":[32],"isMobile":[32],"scrollOffset":[32]},[[1,"tabFocus","tabFocusHandler"],[1,"tabChange","tabChangeHandler"],[2,"keydown","handleKeyDown"],[2,"keyup","handleKeyUp"]],{"justify":["onJustificationChange"],"value":["onExternalValueChange"],"scrollOffset":["onScrollOffsetChange"]}]]],["p-aa307b78",[[1,"c-tag",{"active":[4],"block":[4],"fit":[4],"flat":[4],"closeable":[4],"badge":[8],"size":[1]}]]],["p-886f0d1d",[[4,"c-swiper",{"value":[1544],"elementId":[1,"id"],"isBeginning":[32],"isEnd":[32],"statusText":[32]},[[0,"changeValue","onTabClick"],[2,"keyup","handleKeyUp"]]]]],["p-bae44625",[[1,"c-toasts",{"absolute":[4],"horizontal":[1],"vertical":[1],"messages":[32],"addToast":[64],"removeToast":[64]}]]],["p-fc580f2c",[[1,"c-accordion-item",{"collapsable":[4],"heading":[1],"value":[8],"expanded":[4],"outlined":[4],"hasCustomHeader":[32],"hasIcon":[32]},[[2,"keydown","handleKeyDown"],[0,"changeValue","stop"]]]]],["p-0b41f178",[[1,"c-list-item",{"active":[4],"disabled":[4],"disabledByParent":[4,"disabled-by-parent"],"hoverable":[4],"ripple":[4],"href":[1],"target":[1]},null,{"active":["onActiveChange"]}]]],["p-e8bd7a76",[[1,"c-login-card-actions",{"align":[1],"justify":[1]}]]],["p-29b07261",[[1,"c-swiper-tab",{"disabled":[4],"active":[4],"label":[1],"hostId":[1,"id"],"setsize":[2],"position":[2],"value":[8]},[[1,"click","onTabClick"]]]]],["p-0471fd59",[[1,"c-tab",{"active":[4],"disabled":[4],"hostId":[1,"id"],"position":[2],"setsize":[2],"value":[8]},[[1,"focus","onTabFocus"],[1,"keydown","handleKeydown"]]]]],["p-a33ca657",[[1,"c-accordion",{"value":[1032],"mandatory":[4],"multiple":[4],"outlined":[4]},[[1,"itemChange","onAccordionItemChange"]],{"value":["watchPropHandler"]}]]],["p-7a7da729",[[1,"c-alert",{"type":[1]}]]],["p-da7c0754",[[1,"c-link",{"href":[1],"underline":[4],"target":[1],"weight":[1]}]]],["p-e922c869",[[0,"c-list",{"disabled":[4]},null,{"disabled":["onDisabledChange"]}]]],["p-231bc97b",[[1,"c-list-item-title",{"active":[4]}]]],["p-9dc5b5ac",[[1,"c-login-button",{"href":[1],"src":[1],"alt":[1]}]]],["p-54d44ab9",[[1,"c-login-buttons"]]],["p-4f568e1f",[[4,"c-login-card",{"backgroundPosition":[1,"background-position"],"mobileBreakpoint":[2,"mobile-breakpoint"],"overlay":[4],"overlayBlendMode":[1,"overlay-blend-mode"],"src":[1],"path":[32],"imageHeight":[32]}]]],["p-cb4bce81",[[1,"c-login-card-content"]]],["p-0394ebc7",[[1,"c-login-card-title"]]],["p-aa6b6960",[[1,"c-modal",{"value":[4],"dismissable":[4],"width":[8],"zIndex":[2,"z-index"],"disableBackdropBlur":[4,"disable-backdrop-blur"],"innerValue":[32],"animateModal":[32]},null,{"value":["onValueChange"]}]]],["p-b8fd106b",[[1,"c-option-value"]]],["p-2a104276",[[1,"c-progress-bar",{"value":[2],"hideDetails":[4,"hide-details"],"singleLine":[4,"single-line"],"label":[1],"indeterminate":[4]}]]],["p-18a7f4e9",[[1,"c-row",{"gap":[2],"nowrap":[4],"align":[1],"justify":[1]}]]],["p-52a3f4f8",[[1,"c-slider",{"hostId":[1,"id"],"hostName":[1,"name"],"ariaLabel":[1,"aria-label"],"max":[1],"min":[1],"step":[1],"value":[8],"unit":[1],"ticks":[4],"labels":[4],"disableTooltip":[4,"disable-tooltip"],"label":[1],"disabled":[4],"segments":[1],"trackPosition":[32],"tickPositions":[32]},null,{"segments":["onSegmentChange"],"value":["onValueChange"]}]]],["p-61e0e61f",[[1,"c-status",{"type":[1]}]]],["p-1aeab024",[[1,"c-step",{"complete":[4],"current":[4]}]]],["p-4dbc9e96",[[1,"c-steps",{"value":[8],"isMobile":[32],"label":[32]},null,{"value":["watchPropHandler"]}]]],["p-0e3cf775",[[1,"c-tab-buttons",{"value":[1032],"mandatory":[4],"tabs":[4],"size":[1],"hostDisabled":[4,"disabled"]},[[1,"tabFocus","tabFocusHandler"],[2,"keyup","handleKeyUp"],[1,"tabChange","onTabChange"]],{"value":["onValueChange"]}]]],["p-f71fcb7a",[[1,"c-tab-item",{"value":[8],"active":[4]}]]],["p-fadae1ab",[[1,"c-tab-items",{"value":[8],"disableAnimation":[4,"disable-animation"],"activeTab":[32]},[[1,"contentChange","tabContentChangeHandler"]],{"value":["onValueChange"]}]]],["p-0ad7a08a",[[1,"c-tags",{"size":[1]}]]],["p-f46709d0",[[65,"c-autocomplete",{"items":[16],"value":[8],"query":[1],"hostId":[1,"id"],"disabled":[4],"label":[1],"name":[1],"placeholder":[1],"hideDetails":[4,"hide-details"],"hint":[1],"loading":[4],"required":[4],"valid":[4],"validate":[4],"validateOnBlur":[4,"validate-on-blur"],"validation":[1],"shadow":[4],"returnObject":[4,"return-object"],"itemsPerPage":[2,"items-per-page"],"minimumQueryLength":[2,"minimum-query-length"],"minimumQueryLengthMessage":[1,"minimum-query-length-message"],"noMatchingItemsMessage":[1,"no-matching-items-message"],"optionElements":[32],"currentIndex":[32],"dropdownVisible":[32],"statusText":[32],"optionElementsExist":[32],"reset":[64]},[[0,"dropdownStateChange","onDropdownStateChange"],[0,"selectOption","onSelectOption"]],{"query":["handleQueryChange"]}],[65,"c-select",{"items":[16],"value":[8],"hostId":[1,"id"],"clearable":[4],"disabled":[4],"label":[1],"name":[1],"placeholder":[1],"hideDetails":[4,"hide-details"],"hint":[1],"loading":[4],"required":[4],"valid":[4],"validate":[4],"validateOnBlur":[4,"validate-on-blur"],"validation":[1],"shadow":[4],"returnObject":[4,"return-object"],"itemsPerPage":[2,"items-per-page"],"optionAsSelection":[4,"option-as-selection"],"optionElements":[32],"currentIndex":[32],"dropdownVisible":[32],"statusText":[32],"optionElementsExist":[32],"reset":[64]},[[1,"keydown","handleKeyDown"],[0,"dropdownStateChange","onDropdownStateChange"],[0,"selectOption","onSelectOption"]],{"value":["onValueChanged"]}],[1,"c-card",{"fullscreen":[4],"isFullscreen":[32],"exitFullscreen":[64],"enterFullscreen":[64]}],[1,"c-navigation-button"],[1,"c-side-navigation",{"styles":[16],"mobile":[4],"menuVisible":[1028,"menu-visible"]},[[0,"itemChange","handleChange"]]],[1,"c-side-navigation-item",{"active":[4],"href":[1],"target":[1],"loading":[4]},[[0,"itemChange","handleChange"]],{"active":["onActiveChange"]}],[1,"c-button",{"inverted":[4],"outlined":[4],"ghost":[4],"danger":[4],"grouped":[4],"text":[4],"loading":[4],"fit":[4],"noRadius":[4,"no-radius"],"type":[1],"disabled":[516],"value":[8],"hostId":[1,"id"],"size":[1],"href":[1],"target":[1],"tabs":[4]},[[1,"focus","onTabFocus"]]],[65,"c-radio-group",{"value":[1032],"hideDetails":[4,"hide-details"],"hint":[1],"inline":[4],"label":[1],"color":[1],"hostId":[1,"id"],"items":[16],"disabled":[4],"returnObject":[4,"return-object"],"required":[4],"valid":[4],"validation":[1]}],[1,"c-sub-navigation-item",{"active":[4],"focusable":[4],"href":[1],"target":[1],"loading":[4]}],[65,"c-text-field",{"autofocus":[4],"autocapitalize":[1],"autocorrect":[1],"autocomplete":[1],"disabled":[4],"hideDetails":[4,"hide-details"],"hint":[1],"hostId":[1,"id"],"trimWhitespace":[4,"trim-whitespace"],"label":[1],"max":[2],"min":[2],"name":[1],"placeholder":[1],"readonly":[4],"required":[4],"rows":[2],"shadow":[4],"step":[2],"type":[1],"valid":[4],"validate":[4],"validateOnBlur":[4,"validate-on-blur"],"validation":[1],"value":[1025],"isFocused":[32],"labelWidth":[32],"preSlotWidth":[32]}],[65,"c-otp-input",{"hideDetails":[4,"hide-details"],"hint":[1],"elementId":[1,"id"],"length":[2],"valid":[4],"validation":[1],"value":[1025],"statusText":[32],"reset":[64]},null,{"validation":["onValidationMessageChange"],"value":["onValueChange"]}],[1,"c-card-content"],[1,"c-card-title"],[1,"c-csc-logo",{"width":[2]}],[1,"c-main",{"disableLayout":[4,"disable-layout"]}],[1,"c-option",{"selected":[4],"disabled":[4],"name":[1],"value":[8]}],[1,"c-page",{"scrollIndicator":[4,"scroll-indicator"]}],[1,"c-radio",{"checked":[4],"disabled":[4],"value":[1]}],[1,"c-side-navigation-title"],[65,"c-switch",{"checked":[1028],"value":[8],"trueValue":[8,"true-value"],"falseValue":[8,"false-value"],"hostDisabled":[4,"disabled"],"hostId":[1,"id"],"required":[4],"hasLabel":[32]}],[4,"c-table",{"mobileBreakpoint":[2,"mobile-breakpoint"],"responsive":[4]}],[1,"c-toolbar"],[65,"c-checkbox",{"checked":[1028],"disabled":[4],"hideDetails":[4,"hide-details"],"hint":[1],"hostId":[1,"id"],"indeterminate":[4],"label":[1],"required":[4],"valid":[4],"validation":[1],"value":[8],"trueValue":[8,"true-value"],"falseValue":[8,"false-value"],"hostName":[1,"name"]},[[1,"keydown","handleKeyDown"]],{"value":["onValueChange"]}],[1,"c-card-actions",{"align":[1],"justify":[1]}],[1,"c-spacer"],[1,"c-dropdown",{"itemsPerPage":[2,"items-per-page"],"parent":[16],"items":[16],"index":[2],"hostId":[1,"id"],"type":[1],"itemType":[1,"item-type"],"renderedList":[32],"isOpen":[32],"statusText":[32],"setStatusText":[64],"focusItem":[64],"open":[64],"close":[64],"selectItem":[64],"updateList":[64]},null,{"items":["optionsWatcher"],"isOpen":["stateWatcher"],"index":["handleIndexChange"]}],[1,"c-loader",{"contentdelay":[2],"hide":[4],"size":[2],"width":[2]},null,{"hide":["onElementHide"]}],[4,"c-input",{"active":[4],"autofocus":[4],"disabled":[4],"form":[4],"hideDetails":[4,"hide-details"],"hint":[1],"hostId":[1,"id"],"inputId":[1,"input-id"],"items":[16],"itemsPerPage":[2,"items-per-page"],"label":[1],"max":[2],"min":[2],"name":[1],"placeholder":[1],"readonly":[4],"required":[4],"rows":[2],"shadow":[4],"step":[2],"type":[1],"valid":[4],"validate":[4],"validateOnBlur":[4,"validate-on-blur"],"validation":[1],"value":[8],"variant":[1],"isFocused":[32],"labelWidth":[32],"preSlotWidth":[32],"statusText":[32],"currentIndex":[32],"reset":[64]},null,{"valid":["onValidChange"],"validation":["onValidationMessageChange"],"value":["onValueChange"],"placeholder":["onPlaceholderChange"]}],[1,"c-message",{"hint":[1],"inputId":[1,"input-id"],"valid":[4],"validation":[1],"messageOptions":[32]},null,{"valid":["onValidChange"],"validation":["onValidationMessageChange"],"hint":["onHintMessageChange"]}],[1,"c-icon-button",{"badge":[1],"danger":[4],"loading":[4],"text":[4],"inverted":[4],"outlined":[4],"path":[1],"ghost":[4],"disabled":[4],"size":[1]}],[1,"c-badge"],[1,"c-icon",{"path":[1],"size":[2],"color":[1]}],[1,"c-spinner",{"color":[1],"size":[2],"width":[2]}],[1,"c-ripple",{"createRipple":[64]}]]],["p-33c354c4",[[1,"c-menu",{"items":[16],"contentClass":[1,"content-class"],"custom":[4],"small":[4],"flat":[4],"itemsPerPage":[2,"items-per-page"],"menuItemsComponent":[32],"menuWrapperComponent":[32],"currentIndex":[32],"active":[32]},[[2,"keydown","handleKeyDown"]]],[1,"c-menu-items",{"items":[16],"small":[4],"active":[4],"parentType":[1,"parent-type"],"parent":[16],"top":[2],"index":[2],"itemsPerPage":[2,"items-per-page"],"scrollingParent":[32],"isInView":[32],"currentIndex":[32]},[[2,"keydown","handleKeyDown"]],{"currentIndex":["onIndexChange"]}]]],["p-c9e04eb5",[[1,"c-pagination",{"value":[16],"hideDetails":[4,"hide-details"],"simple":[4],"size":[1],"hideRange":[4,"hide-range"],"_currentPage":[32],"_itemsPerPage":[32],"_pageSizes":[32],"_totalVisible":[32],"tick":[32]},null,{"value":["valueHandler"]}]]],["p-908b21bf",[[1,"c-toast",{"message":[16],"closeToast":[64]}]]]]'),e)));
|
|
1
|
+
import{p as e,b as a}from"./p-565ec8e4.js";export{s as setNonce}from"./p-565ec8e4.js";const t=()=>{const a=import.meta.url;const t={};if(a!==""){t.resourcesUrl=new URL(".",a).href}return e(t)};t().then((e=>a(JSON.parse('[["p-f216dda9",[[1,"c-data-table",{"data":[16],"externalData":[4,"external-data"],"headers":[16],"hideFooter":[4,"hide-footer"],"footerOptions":[16],"loading":[4],"loadingText":[1,"loading-text"],"noDataText":[1,"no-data-text"],"pagination":[1040],"selectable":[4],"singleSelection":[4,"single-selection"],"selectionProperty":[1,"selection-property"],"singleExpansion":[4,"single-expansion"],"sortBy":[1032,"sort-by"],"sortDirection":[1025,"sort-direction"],"stickyHeader":[4,"sticky-header"],"horizontalScrolling":[4,"horizontal-scrolling"],"_activeRows":[32],"_data":[32],"_isIndeterminate":[32],"_isPaginationSimple":[32],"_selections":[32],"hasOverflow":[32],"hiddenHeaders":[32],"initiallyHiddenHeaders":[32],"forceRender":[32],"breakpoints":[32],"markedFooterWidth":[32],"parentWidth":[32],"firstCellHidden":[32],"lastCellHidden":[32],"clearSelections":[64],"getData":[64]},null,{"hiddenHeaders":["onHiddenHeaderChange"],"data":["onDataChange"],"headers":["onHeaderChange"],"singleSelection":["onSingleSelectionChange"],"loading":["onLoadingChange"]}]]],["p-80cdd280",[[1,"c-tabs",{"value":[1032],"borderless":[4],"disableAnimation":[4,"disable-animation"],"justify":[1],"mobileBreakpoint":[2,"mobile-breakpoint"],"vertical":[4],"isOverflowing":[32],"isMobile":[32],"scrollOffset":[32]},[[1,"tabFocus","tabFocusHandler"],[1,"tabChange","tabChangeHandler"],[2,"keydown","handleKeyDown"],[2,"keyup","handleKeyUp"]],{"justify":["onJustificationChange"],"value":["onExternalValueChange"],"scrollOffset":["onScrollOffsetChange"]}]]],["p-aa307b78",[[1,"c-tag",{"active":[4],"block":[4],"fit":[4],"flat":[4],"closeable":[4],"badge":[8],"size":[1]}]]],["p-886f0d1d",[[4,"c-swiper",{"value":[1544],"elementId":[1,"id"],"isBeginning":[32],"isEnd":[32],"statusText":[32]},[[0,"changeValue","onTabClick"],[2,"keyup","handleKeyUp"]]]]],["p-bae44625",[[1,"c-toasts",{"absolute":[4],"horizontal":[1],"vertical":[1],"messages":[32],"addToast":[64],"removeToast":[64]}]]],["p-fc580f2c",[[1,"c-accordion-item",{"collapsable":[4],"heading":[1],"value":[8],"expanded":[4],"outlined":[4],"hasCustomHeader":[32],"hasIcon":[32]},[[2,"keydown","handleKeyDown"],[0,"changeValue","stop"]]]]],["p-0b41f178",[[1,"c-list-item",{"active":[4],"disabled":[4],"disabledByParent":[4,"disabled-by-parent"],"hoverable":[4],"ripple":[4],"href":[1],"target":[1]},null,{"active":["onActiveChange"]}]]],["p-e8bd7a76",[[1,"c-login-card-actions",{"align":[1],"justify":[1]}]]],["p-29b07261",[[1,"c-swiper-tab",{"disabled":[4],"active":[4],"label":[1],"hostId":[1,"id"],"setsize":[2],"position":[2],"value":[8]},[[1,"click","onTabClick"]]]]],["p-0471fd59",[[1,"c-tab",{"active":[4],"disabled":[4],"hostId":[1,"id"],"position":[2],"setsize":[2],"value":[8]},[[1,"focus","onTabFocus"],[1,"keydown","handleKeydown"]]]]],["p-a33ca657",[[1,"c-accordion",{"value":[1032],"mandatory":[4],"multiple":[4],"outlined":[4]},[[1,"itemChange","onAccordionItemChange"]],{"value":["watchPropHandler"]}]]],["p-7a7da729",[[1,"c-alert",{"type":[1]}]]],["p-da7c0754",[[1,"c-link",{"href":[1],"underline":[4],"target":[1],"weight":[1]}]]],["p-e922c869",[[0,"c-list",{"disabled":[4]},null,{"disabled":["onDisabledChange"]}]]],["p-231bc97b",[[1,"c-list-item-title",{"active":[4]}]]],["p-9dc5b5ac",[[1,"c-login-button",{"href":[1],"src":[1],"alt":[1]}]]],["p-54d44ab9",[[1,"c-login-buttons"]]],["p-4f568e1f",[[4,"c-login-card",{"backgroundPosition":[1,"background-position"],"mobileBreakpoint":[2,"mobile-breakpoint"],"overlay":[4],"overlayBlendMode":[1,"overlay-blend-mode"],"src":[1],"path":[32],"imageHeight":[32]}]]],["p-cb4bce81",[[1,"c-login-card-content"]]],["p-0394ebc7",[[1,"c-login-card-title"]]],["p-e9ec927b",[[1,"c-modal",{"value":[4],"dismissable":[4],"width":[8],"zIndex":[2,"z-index"],"disableBackdropBlur":[4,"disable-backdrop-blur"],"innerValue":[32],"animateModal":[32]},null,{"value":["onValueChange"]}]]],["p-b8fd106b",[[1,"c-option-value"]]],["p-2a104276",[[1,"c-progress-bar",{"value":[2],"hideDetails":[4,"hide-details"],"singleLine":[4,"single-line"],"label":[1],"indeterminate":[4]}]]],["p-18a7f4e9",[[1,"c-row",{"gap":[2],"nowrap":[4],"align":[1],"justify":[1]}]]],["p-52a3f4f8",[[1,"c-slider",{"hostId":[1,"id"],"hostName":[1,"name"],"ariaLabel":[1,"aria-label"],"max":[1],"min":[1],"step":[1],"value":[8],"unit":[1],"ticks":[4],"labels":[4],"disableTooltip":[4,"disable-tooltip"],"label":[1],"disabled":[4],"segments":[1],"trackPosition":[32],"tickPositions":[32]},null,{"segments":["onSegmentChange"],"value":["onValueChange"]}]]],["p-61e0e61f",[[1,"c-status",{"type":[1]}]]],["p-1aeab024",[[1,"c-step",{"complete":[4],"current":[4]}]]],["p-4dbc9e96",[[1,"c-steps",{"value":[8],"isMobile":[32],"label":[32]},null,{"value":["watchPropHandler"]}]]],["p-0e3cf775",[[1,"c-tab-buttons",{"value":[1032],"mandatory":[4],"tabs":[4],"size":[1],"hostDisabled":[4,"disabled"]},[[1,"tabFocus","tabFocusHandler"],[2,"keyup","handleKeyUp"],[1,"tabChange","onTabChange"]],{"value":["onValueChange"]}]]],["p-f71fcb7a",[[1,"c-tab-item",{"value":[8],"active":[4]}]]],["p-fadae1ab",[[1,"c-tab-items",{"value":[8],"disableAnimation":[4,"disable-animation"],"activeTab":[32]},[[1,"contentChange","tabContentChangeHandler"]],{"value":["onValueChange"]}]]],["p-0ad7a08a",[[1,"c-tags",{"size":[1]}]]],["p-cf0bd039",[[65,"c-autocomplete",{"items":[16],"value":[8],"query":[1],"hostId":[1,"id"],"disabled":[4],"label":[1],"name":[1],"placeholder":[1],"hideDetails":[4,"hide-details"],"hint":[1],"loading":[4],"required":[4],"valid":[4],"validate":[4],"validateOnBlur":[4,"validate-on-blur"],"validation":[1],"shadow":[4],"returnObject":[4,"return-object"],"itemsPerPage":[2,"items-per-page"],"minimumQueryLength":[2,"minimum-query-length"],"minimumQueryLengthMessage":[1,"minimum-query-length-message"],"noMatchingItemsMessage":[1,"no-matching-items-message"],"optionElements":[32],"currentIndex":[32],"dropdownVisible":[32],"statusText":[32],"optionElementsExist":[32],"reset":[64]},[[0,"dropdownStateChange","onDropdownStateChange"],[0,"selectOption","onSelectOption"]],{"query":["handleQueryChange"]}],[65,"c-select",{"items":[16],"value":[8],"hostId":[1,"id"],"clearable":[4],"disabled":[4],"label":[1],"name":[1],"placeholder":[1],"hideDetails":[4,"hide-details"],"hint":[1],"loading":[4],"required":[4],"valid":[4],"validate":[4],"validateOnBlur":[4,"validate-on-blur"],"validation":[1],"shadow":[4],"returnObject":[4,"return-object"],"itemsPerPage":[2,"items-per-page"],"optionAsSelection":[4,"option-as-selection"],"optionElements":[32],"currentIndex":[32],"dropdownVisible":[32],"statusText":[32],"optionElementsExist":[32],"reset":[64]},[[1,"keydown","handleKeyDown"],[0,"dropdownStateChange","onDropdownStateChange"],[0,"selectOption","onSelectOption"]],{"value":["onValueChanged"]}],[1,"c-card",{"fullscreen":[4],"isFullscreen":[32],"exitFullscreen":[64],"enterFullscreen":[64]}],[1,"c-navigation-button"],[1,"c-side-navigation",{"styles":[16],"mobile":[4],"menuVisible":[1028,"menu-visible"]},[[0,"itemChange","handleChange"]]],[1,"c-side-navigation-item",{"active":[4],"href":[1],"target":[1],"loading":[4]},[[0,"itemChange","handleChange"]],{"active":["onActiveChange"]}],[1,"c-button",{"inverted":[4],"outlined":[4],"ghost":[4],"danger":[4],"grouped":[4],"text":[4],"loading":[4],"fit":[4],"noRadius":[4,"no-radius"],"type":[1],"disabled":[516],"value":[8],"hostId":[1,"id"],"size":[1],"href":[1],"target":[1],"tabs":[4]},[[1,"focus","onTabFocus"]]],[65,"c-radio-group",{"value":[1032],"hideDetails":[4,"hide-details"],"hint":[1],"inline":[4],"label":[1],"color":[1],"hostId":[1,"id"],"items":[16],"disabled":[4],"returnObject":[4,"return-object"],"required":[4],"valid":[4],"validation":[1]}],[1,"c-sub-navigation-item",{"active":[4],"focusable":[4],"href":[1],"target":[1],"loading":[4]}],[65,"c-text-field",{"autofocus":[4],"autocapitalize":[1],"autocorrect":[1],"autocomplete":[1],"disabled":[4],"hideDetails":[4,"hide-details"],"hint":[1],"hostId":[1,"id"],"trimWhitespace":[4,"trim-whitespace"],"label":[1],"max":[2],"min":[2],"name":[1],"placeholder":[1],"readonly":[4],"required":[4],"rows":[2],"shadow":[4],"step":[2],"type":[1],"valid":[4],"validate":[4],"validateOnBlur":[4,"validate-on-blur"],"validation":[1],"value":[1025],"isFocused":[32],"labelWidth":[32],"preSlotWidth":[32]}],[65,"c-otp-input",{"hideDetails":[4,"hide-details"],"hint":[1],"elementId":[1,"id"],"length":[2],"valid":[4],"validation":[1],"value":[1025],"statusText":[32],"reset":[64]},null,{"validation":["onValidationMessageChange"],"value":["onValueChange"]}],[1,"c-card-content"],[1,"c-card-title"],[1,"c-csc-logo",{"width":[2]}],[1,"c-main",{"disableLayout":[4,"disable-layout"]}],[1,"c-option",{"selected":[4],"disabled":[4],"name":[1],"value":[8]}],[1,"c-page",{"scrollIndicator":[4,"scroll-indicator"]}],[1,"c-radio",{"checked":[4],"disabled":[4],"value":[1]}],[1,"c-side-navigation-title"],[65,"c-switch",{"checked":[1028],"value":[8],"trueValue":[8,"true-value"],"falseValue":[8,"false-value"],"hostDisabled":[4,"disabled"],"hostId":[1,"id"],"required":[4],"hasLabel":[32]}],[4,"c-table",{"mobileBreakpoint":[2,"mobile-breakpoint"],"responsive":[4]}],[1,"c-toolbar"],[65,"c-checkbox",{"checked":[1028],"disabled":[4],"hideDetails":[4,"hide-details"],"hint":[1],"hostId":[1,"id"],"indeterminate":[4],"label":[1],"required":[4],"valid":[4],"validation":[1],"value":[8],"trueValue":[8,"true-value"],"falseValue":[8,"false-value"],"hostName":[1,"name"]},[[1,"keydown","handleKeyDown"]],{"value":["onValueChange"]}],[1,"c-card-actions",{"align":[1],"justify":[1]}],[1,"c-spacer"],[1,"c-dropdown",{"itemsPerPage":[2,"items-per-page"],"parent":[16],"items":[16],"index":[2],"hostId":[1,"id"],"type":[1],"itemType":[1,"item-type"],"renderedList":[32],"isOpen":[32],"statusText":[32],"setStatusText":[64],"focusItem":[64],"open":[64],"close":[64],"selectItem":[64],"updateList":[64]},null,{"items":["optionsWatcher"],"isOpen":["stateWatcher"],"index":["handleIndexChange"]}],[1,"c-loader",{"contentdelay":[2],"hide":[4],"size":[2],"width":[2]},null,{"hide":["onElementHide"]}],[4,"c-input",{"active":[4],"autofocus":[4],"disabled":[4],"form":[4],"hideDetails":[4,"hide-details"],"hint":[1],"hostId":[1,"id"],"inputId":[1,"input-id"],"items":[16],"itemsPerPage":[2,"items-per-page"],"label":[1],"max":[2],"min":[2],"name":[1],"placeholder":[1],"readonly":[4],"required":[4],"rows":[2],"shadow":[4],"step":[2],"type":[1],"valid":[4],"validate":[4],"validateOnBlur":[4,"validate-on-blur"],"validation":[1],"value":[8],"variant":[1],"isFocused":[32],"labelWidth":[32],"preSlotWidth":[32],"statusText":[32],"currentIndex":[32],"reset":[64]},null,{"valid":["onValidChange"],"validation":["onValidationMessageChange"],"value":["onValueChange"],"placeholder":["onPlaceholderChange"]}],[1,"c-message",{"hint":[1],"inputId":[1,"input-id"],"valid":[4],"validation":[1],"messageOptions":[32]},null,{"valid":["onValidChange"],"validation":["onValidationMessageChange"],"hint":["onHintMessageChange"]}],[1,"c-icon-button",{"badge":[1],"danger":[4],"loading":[4],"text":[4],"inverted":[4],"outlined":[4],"path":[1],"ghost":[4],"disabled":[4],"size":[1]}],[1,"c-badge"],[1,"c-icon",{"path":[1],"size":[2],"color":[1]}],[1,"c-spinner",{"color":[1],"size":[2],"width":[2]}],[1,"c-ripple",{"createRipple":[64]}]]],["p-33c354c4",[[1,"c-menu",{"items":[16],"contentClass":[1,"content-class"],"custom":[4],"small":[4],"flat":[4],"itemsPerPage":[2,"items-per-page"],"menuItemsComponent":[32],"menuWrapperComponent":[32],"currentIndex":[32],"active":[32]},[[2,"keydown","handleKeyDown"]]],[1,"c-menu-items",{"items":[16],"small":[4],"active":[4],"parentType":[1,"parent-type"],"parent":[16],"top":[2],"index":[2],"itemsPerPage":[2,"items-per-page"],"scrollingParent":[32],"isInView":[32],"currentIndex":[32]},[[2,"keydown","handleKeyDown"]],{"currentIndex":["onIndexChange"]}]]],["p-c9e04eb5",[[1,"c-pagination",{"value":[16],"hideDetails":[4,"hide-details"],"simple":[4],"size":[1],"hideRange":[4,"hide-range"],"_currentPage":[32],"_itemsPerPage":[32],"_pageSizes":[32],"_totalVisible":[32],"tick":[32]},null,{"value":["valueHandler"]}]]],["p-908b21bf",[[1,"c-toast",{"message":[16],"closeToast":[64]}]]]]'),e)));
|
|
2
2
|
//# sourceMappingURL=csc-ui.esm.js.map
|