@cscfi/csc-ui 1.2.0 → 1.2.2
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-badge_12.cjs.entry.js → c-autocomplete_16.cjs.entry.js} +1174 -52
- package/dist/cjs/c-autocomplete_16.cjs.entry.js.map +1 -0
- package/dist/cjs/{c-checkbox_2.cjs.entry.js → c-checkbox_3.cjs.entry.js} +14 -1
- package/dist/cjs/c-checkbox_3.cjs.entry.js.map +1 -0
- package/dist/cjs/c-csc-logo.cjs.entry.js +23 -0
- package/dist/cjs/c-csc-logo.cjs.entry.js.map +1 -0
- package/dist/cjs/c-main.cjs.entry.js +21 -0
- package/dist/cjs/c-main.cjs.entry.js.map +1 -0
- package/dist/cjs/c-menu_2.cjs.entry.js +2 -23
- package/dist/cjs/c-menu_2.cjs.entry.js.map +1 -1
- package/dist/cjs/c-row.cjs.entry.js +35 -0
- package/dist/cjs/c-row.cjs.entry.js.map +1 -0
- package/dist/cjs/c-slider.cjs.entry.js +6 -6
- package/dist/cjs/c-slider.cjs.entry.js.map +1 -1
- package/dist/cjs/c-toolbar.cjs.entry.js +21 -0
- package/dist/cjs/c-toolbar.cjs.entry.js.map +1 -0
- package/dist/cjs/csc-ui.cjs.js +1 -1
- package/dist/cjs/getScrollParent-5d488045.js +28 -0
- package/dist/cjs/getScrollParent-5d488045.js.map +1 -0
- package/dist/cjs/index-91ba22ab.js +14 -30
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/c-autocomplete/c-autocomplete.js +27 -3
- package/dist/collection/components/c-autocomplete/c-autocomplete.js.map +1 -1
- package/dist/collection/components/c-dropdown/c-dropdown.css +6 -1
- package/dist/collection/components/c-dropdown/c-dropdown.js +18 -19
- package/dist/collection/components/c-dropdown/c-dropdown.js.map +1 -1
- package/dist/collection/components/c-menu-items/c-menu-items.js +2 -23
- package/dist/collection/components/c-menu-items/c-menu-items.js.map +1 -1
- package/dist/collection/components/c-select/c-select.js +58 -23
- package/dist/collection/components/c-select/c-select.js.map +1 -1
- package/dist/collection/components/c-slider/c-slider.css +70 -68
- package/dist/collection/components/c-slider/c-slider.js +7 -7
- package/dist/collection/components/c-slider/c-slider.js.map +1 -1
- package/dist/collection/utils/getScrollParent.js +23 -0
- package/dist/collection/utils/getScrollParent.js.map +1 -0
- package/dist/collection/utils/index.js +2 -0
- package/dist/collection/utils/index.js.map +1 -0
- package/dist/components/c-autocomplete.js +28 -4
- package/dist/components/c-autocomplete.js.map +1 -1
- package/dist/components/c-dropdown2.js +19 -20
- package/dist/components/c-dropdown2.js.map +1 -1
- package/dist/components/c-menu-items2.js +2 -23
- package/dist/components/c-menu-items2.js.map +1 -1
- package/dist/components/c-select.js +59 -24
- package/dist/components/c-select.js.map +1 -1
- package/dist/components/c-slider.js +7 -7
- package/dist/components/c-slider.js.map +1 -1
- package/dist/components/getScrollParent.js +26 -0
- package/dist/components/getScrollParent.js.map +1 -0
- package/dist/csc-ui/csc-ui.esm.js +1 -1
- package/dist/csc-ui/csc-ui.esm.js.map +1 -1
- package/dist/csc-ui/p-040ed3e2.entry.js +2 -0
- package/dist/csc-ui/p-040ed3e2.entry.js.map +1 -0
- package/dist/csc-ui/{p-bf01d3ef.entry.js → p-1d6c84df.entry.js} +2 -2
- package/dist/csc-ui/p-39df362b.entry.js +2 -0
- package/dist/csc-ui/p-39df362b.entry.js.map +1 -0
- package/dist/csc-ui/{p-27904068.entry.js → p-3bb67f38.entry.js} +2 -2
- package/dist/csc-ui/p-3f0e51ff.js +2 -0
- package/dist/csc-ui/p-3f0e51ff.js.map +1 -0
- package/dist/csc-ui/{p-0569fc3e.entry.js → p-468d9583.entry.js} +2 -2
- package/dist/csc-ui/{p-16098e94.entry.js → p-56b1e1ea.entry.js} +2 -2
- package/dist/csc-ui/p-682782b1.entry.js +2 -0
- package/dist/csc-ui/p-682782b1.entry.js.map +1 -0
- package/dist/csc-ui/{p-958cf6ed.entry.js → p-6e046723.entry.js} +2 -2
- package/dist/csc-ui/p-9c5488fc.entry.js +2 -0
- package/dist/csc-ui/p-9c5488fc.entry.js.map +1 -0
- package/dist/csc-ui/{p-862486aa.entry.js → p-9c80f35e.entry.js} +2 -2
- package/dist/csc-ui/{p-873aa915.entry.js → p-ab62f9b5.entry.js} +2 -2
- package/dist/csc-ui/{p-45641e3d.entry.js → p-ae16b1f4.entry.js} +2 -2
- package/dist/csc-ui/{p-7af82ab9.entry.js → p-b0fa27b6.entry.js} +2 -2
- package/dist/csc-ui/{p-2a622e79.entry.js → p-b83651f8.entry.js} +2 -2
- package/dist/csc-ui/p-b83651f8.entry.js.map +1 -0
- package/dist/csc-ui/p-ba475561.entry.js +2 -0
- package/dist/csc-ui/p-ba475561.entry.js.map +1 -0
- package/dist/csc-ui/{p-64bcde03.entry.js → p-bda722d5.entry.js} +2 -2
- package/dist/csc-ui/{p-47ca0a95.entry.js → p-c8a7a751.entry.js} +2 -2
- package/dist/csc-ui/{p-c291cbe2.entry.js → p-ccef8a49.entry.js} +2 -2
- package/dist/csc-ui/p-ee753bac.entry.js +2 -0
- package/dist/csc-ui/p-ee753bac.entry.js.map +1 -0
- package/dist/csc-ui/{p-5461ca29.js → p-f24b9d97.js} +2 -2
- package/dist/csc-ui/p-fa83a615.entry.js +2 -0
- package/dist/csc-ui/p-fa83a615.entry.js.map +1 -0
- package/dist/esm/c-accordion-item.entry.js +1 -1
- package/dist/esm/c-alert.entry.js +1 -1
- package/dist/esm/{c-badge_12.entry.js → c-autocomplete_16.entry.js} +1168 -50
- package/dist/esm/c-autocomplete_16.entry.js.map +1 -0
- package/dist/esm/{c-checkbox_2.entry.js → c-checkbox_3.entry.js} +15 -3
- package/dist/esm/c-checkbox_3.entry.js.map +1 -0
- package/dist/esm/c-csc-logo.entry.js +19 -0
- package/dist/esm/c-csc-logo.entry.js.map +1 -0
- package/dist/esm/c-data-table.entry.js +1 -1
- package/dist/esm/c-main.entry.js +17 -0
- package/dist/esm/c-main.entry.js.map +1 -0
- package/dist/esm/c-menu_2.entry.js +3 -24
- package/dist/esm/c-menu_2.entry.js.map +1 -1
- package/dist/esm/c-navigation-button.entry.js +1 -1
- package/dist/esm/c-radio-group.entry.js +1 -1
- package/dist/esm/c-row.entry.js +31 -0
- package/dist/esm/c-row.entry.js.map +1 -0
- package/dist/esm/c-side-navigation-item.entry.js +1 -1
- package/dist/esm/c-side-navigation.entry.js +1 -1
- package/dist/esm/c-slider.entry.js +6 -6
- package/dist/esm/c-slider.entry.js.map +1 -1
- package/dist/esm/c-swiper.entry.js +1 -1
- package/dist/esm/c-tabs.entry.js +1 -1
- package/dist/esm/c-tag.entry.js +1 -1
- package/dist/esm/c-text-field.entry.js +1 -1
- package/dist/esm/c-toast.entry.js +1 -1
- package/dist/esm/c-toolbar.entry.js +17 -0
- package/dist/esm/c-toolbar.entry.js.map +1 -0
- package/dist/esm/csc-ui.js +1 -1
- package/dist/esm/getScrollParent-f876ad1b.js +26 -0
- package/dist/esm/getScrollParent-f876ad1b.js.map +1 -0
- package/dist/esm/index-47956d53.js +14 -30
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{mdi-e92c0e44.js → mdi-8656e74a.js} +2 -2
- package/dist/esm/{mdi-e92c0e44.js.map → mdi-8656e74a.js.map} +1 -1
- package/dist/types/components/c-autocomplete/c-autocomplete.d.ts +1 -0
- package/dist/types/components/c-dropdown/c-dropdown.d.ts +2 -1
- package/dist/types/components/c-menu-items/c-menu-items.d.ts +0 -1
- package/dist/types/components/c-select/c-select.d.ts +3 -0
- package/dist/types/components/c-slider/c-slider.d.ts +1 -1
- package/dist/types/components.d.ts +8 -8
- package/dist/types/utils/getScrollParent.d.ts +1 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/package.json +1 -1
- package/vscode-data.json +4 -4
- package/dist/cjs/c-autocomplete.cjs.entry.js +0 -251
- package/dist/cjs/c-autocomplete.cjs.entry.js.map +0 -1
- package/dist/cjs/c-badge_12.cjs.entry.js.map +0 -1
- package/dist/cjs/c-card-actions.cjs.entry.js +0 -28
- package/dist/cjs/c-card-actions.cjs.entry.js.map +0 -1
- package/dist/cjs/c-card-content.cjs.entry.js +0 -21
- package/dist/cjs/c-card-content.cjs.entry.js.map +0 -1
- package/dist/cjs/c-card-title.cjs.entry.js +0 -21
- package/dist/cjs/c-card-title.cjs.entry.js.map +0 -1
- package/dist/cjs/c-checkbox_2.cjs.entry.js.map +0 -1
- package/dist/cjs/c-dropdown_2.cjs.entry.js +0 -512
- package/dist/cjs/c-dropdown_2.cjs.entry.js.map +0 -1
- package/dist/cjs/c-message.cjs.entry.js +0 -67
- package/dist/cjs/c-message.cjs.entry.js.map +0 -1
- package/dist/cjs/c-option.cjs.entry.js +0 -25
- package/dist/cjs/c-option.cjs.entry.js.map +0 -1
- package/dist/cjs/c-select.cjs.entry.js +0 -276
- package/dist/cjs/c-select.cjs.entry.js.map +0 -1
- package/dist/csc-ui/p-019c6898.entry.js +0 -2
- package/dist/csc-ui/p-019c6898.entry.js.map +0 -1
- package/dist/csc-ui/p-0666f12d.entry.js +0 -2
- package/dist/csc-ui/p-0666f12d.entry.js.map +0 -1
- package/dist/csc-ui/p-088b9c5e.entry.js +0 -2
- package/dist/csc-ui/p-088b9c5e.entry.js.map +0 -1
- package/dist/csc-ui/p-2a622e79.entry.js.map +0 -1
- package/dist/csc-ui/p-4e1d8f5d.entry.js +0 -2
- package/dist/csc-ui/p-4e1d8f5d.entry.js.map +0 -1
- package/dist/csc-ui/p-6c5e538b.entry.js +0 -2
- package/dist/csc-ui/p-6c5e538b.entry.js.map +0 -1
- package/dist/csc-ui/p-bbe8423c.entry.js +0 -2
- package/dist/csc-ui/p-bbe8423c.entry.js.map +0 -1
- package/dist/csc-ui/p-bddd9153.entry.js +0 -2
- package/dist/csc-ui/p-bddd9153.entry.js.map +0 -1
- package/dist/csc-ui/p-d1089126.entry.js +0 -2
- package/dist/csc-ui/p-d1089126.entry.js.map +0 -1
- package/dist/csc-ui/p-d2fc8cb4.entry.js +0 -2
- package/dist/csc-ui/p-d2fc8cb4.entry.js.map +0 -1
- package/dist/csc-ui/p-ec167606.entry.js +0 -2
- package/dist/csc-ui/p-ec167606.entry.js.map +0 -1
- package/dist/csc-ui/p-f148aad1.entry.js +0 -2
- package/dist/csc-ui/p-f148aad1.entry.js.map +0 -1
- package/dist/esm/c-autocomplete.entry.js +0 -247
- package/dist/esm/c-autocomplete.entry.js.map +0 -1
- package/dist/esm/c-badge_12.entry.js.map +0 -1
- package/dist/esm/c-card-actions.entry.js +0 -24
- package/dist/esm/c-card-actions.entry.js.map +0 -1
- package/dist/esm/c-card-content.entry.js +0 -17
- package/dist/esm/c-card-content.entry.js.map +0 -1
- package/dist/esm/c-card-title.entry.js +0 -17
- package/dist/esm/c-card-title.entry.js.map +0 -1
- package/dist/esm/c-checkbox_2.entry.js.map +0 -1
- package/dist/esm/c-dropdown_2.entry.js +0 -507
- package/dist/esm/c-dropdown_2.entry.js.map +0 -1
- package/dist/esm/c-message.entry.js +0 -63
- package/dist/esm/c-message.entry.js.map +0 -1
- package/dist/esm/c-option.entry.js +0 -21
- package/dist/esm/c-option.entry.js.map +0 -1
- package/dist/esm/c-select.entry.js +0 -272
- package/dist/esm/c-select.entry.js.map +0 -1
- /package/dist/csc-ui/{p-bf01d3ef.entry.js.map → p-1d6c84df.entry.js.map} +0 -0
- /package/dist/csc-ui/{p-27904068.entry.js.map → p-3bb67f38.entry.js.map} +0 -0
- /package/dist/csc-ui/{p-0569fc3e.entry.js.map → p-468d9583.entry.js.map} +0 -0
- /package/dist/csc-ui/{p-16098e94.entry.js.map → p-56b1e1ea.entry.js.map} +0 -0
- /package/dist/csc-ui/{p-958cf6ed.entry.js.map → p-6e046723.entry.js.map} +0 -0
- /package/dist/csc-ui/{p-862486aa.entry.js.map → p-9c80f35e.entry.js.map} +0 -0
- /package/dist/csc-ui/{p-873aa915.entry.js.map → p-ab62f9b5.entry.js.map} +0 -0
- /package/dist/csc-ui/{p-45641e3d.entry.js.map → p-ae16b1f4.entry.js.map} +0 -0
- /package/dist/csc-ui/{p-7af82ab9.entry.js.map → p-b0fa27b6.entry.js.map} +0 -0
- /package/dist/csc-ui/{p-64bcde03.entry.js.map → p-bda722d5.entry.js.map} +0 -0
- /package/dist/csc-ui/{p-47ca0a95.entry.js.map → p-c8a7a751.entry.js.map} +0 -0
- /package/dist/csc-ui/{p-c291cbe2.entry.js.map → p-ccef8a49.entry.js.map} +0 -0
- /package/dist/csc-ui/{p-5461ca29.js.map → p-f24b9d97.js.map} +0 -0
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, h } from './index-47956d53.js';
|
|
2
|
-
|
|
3
|
-
const cCardContentCss = "html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit;-webkit-tap-highlight-color:transparent}:host{font-family:var(--c-font-family)}::-ms-reveal{display:none}:host{display:block;padding:0 var(--_c-card-gap, 24px)}.c-card-content{display:flex;flex-direction:column;gap:var(--_c-card-gap)}.c-card-content ::slotted(*){max-width:100%}";
|
|
4
|
-
|
|
5
|
-
const CCardContent = class {
|
|
6
|
-
constructor(hostRef) {
|
|
7
|
-
registerInstance(this, hostRef);
|
|
8
|
-
}
|
|
9
|
-
render() {
|
|
10
|
-
return (h("article", { class: "c-card-content" }, h("slot", null)));
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
CCardContent.style = cCardContentCss;
|
|
14
|
-
|
|
15
|
-
export { CCardContent as c_card_content };
|
|
16
|
-
|
|
17
|
-
//# sourceMappingURL=c-card-content.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"c-card-content.entry.js","mappings":";;AAAA,MAAM,eAAe,GAAG,yVAAyV;;MCUpW,YAAY;;;;EACvB,MAAM;IACJ,QACE,eAAS,KAAK,EAAC,gBAAgB,IAC7B,eAAa,CACL,EACV;GACH;;;;;;","names":[],"sources":["src/components/c-card-content/c-card-content.scss?tag=c-card-content&encapsulation=shadow","src/components/c-card-content/c-card-content.tsx"],"sourcesContent":[":host {\n display: block;\n padding: 0 var(--_c-card-gap, 24px);\n}\n\n.c-card-content {\n display: flex;\n flex-direction: column;\n gap: var(--_c-card-gap);\n\n ::slotted(*) {\n max-width: 100%;\n }\n}\n","import { Component, h } from '@stencil/core';\n/**\n * @parent c-card\n * @slot Default slot - Card contents\n */\n@Component({\n tag: 'c-card-content',\n styleUrl: 'c-card-content.scss',\n shadow: true,\n})\nexport class CCardContent {\n render() {\n return (\n <article class=\"c-card-content\">\n <slot></slot>\n </article>\n );\n }\n}\n"],"version":3}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, h } from './index-47956d53.js';
|
|
2
|
-
|
|
3
|
-
const cCardTitleCss = "html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit;-webkit-tap-highlight-color:transparent}:host{font-family:var(--c-font-family)}::-ms-reveal{display:none}:host{--_c-card-title-color:var(--c-card-title-color, var(--c-text-system));--_c-card-title-underline-color:var(--c-card-title-underline-color, var(--c-primary-600));color:var(--_c-card-title-color);padding-inline:var(--_c-card-gap, 24px);display:block;font-family:var(--c-font-family);font-size:1rem;font-weight:500;text-transform:uppercase}.c-card-title__underline{background-color:var(--_c-card-title-underline-color);border-radius:4px;height:4px;margin-top:10px;width:44px}";
|
|
4
|
-
|
|
5
|
-
const CCardTitle = class {
|
|
6
|
-
constructor(hostRef) {
|
|
7
|
-
registerInstance(this, hostRef);
|
|
8
|
-
}
|
|
9
|
-
render() {
|
|
10
|
-
return (h("header", { class: "c-card-title" }, h("slot", null), h("div", { class: "c-card-title__underline" })));
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
CCardTitle.style = cCardTitleCss;
|
|
14
|
-
|
|
15
|
-
export { CCardTitle as c_card_title };
|
|
16
|
-
|
|
17
|
-
//# sourceMappingURL=c-card-title.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"c-card-title.entry.js","mappings":";;AAAA,MAAM,aAAa,GAAG,yoBAAyoB;;MCUlpB,UAAU;;;;EACrB,MAAM;IACJ,QACE,cAAQ,KAAK,EAAC,cAAc,IAC1B,eAAa,EACb,WAAK,KAAK,EAAC,yBAAyB,GAAO,CACpC,EACT;GACH;;;;;;","names":[],"sources":["src/components/c-card-title/c-card-title.scss?tag=c-card-title&encapsulation=shadow","src/components/c-card-title/c-card-title.tsx"],"sourcesContent":[":host {\n /**\n * @prop --c-card-title-color: Card title color\n * @prop --c-card-title-underline-color: Card title underline color\n */\n --_c-card-title-color: var(--c-card-title-color, var(--c-text-system));\n --_c-card-title-underline-color: var(--c-card-title-underline-color, var(--c-primary-600));\n\n color: var(--_c-card-title-color);\n padding-inline: var(--_c-card-gap, 24px);\n display: block;\n font-family: var(--c-font-family);\n font-size: 1rem;\n font-weight: 500;\n text-transform: uppercase;\n}\n\n.c-card-title {\n &__underline {\n background-color: var(--_c-card-title-underline-color);\n border-radius: 4px;\n height: 4px;\n margin-top: 10px;\n width: 44px;\n }\n}\n","import { Component, h } from '@stencil/core';\n/**\n * @parent c-card\n * @slot Default slot - Card title text\n */\n@Component({\n tag: 'c-card-title',\n styleUrl: 'c-card-title.scss',\n shadow: true,\n})\nexport class CCardTitle {\n render() {\n return (\n <header class=\"c-card-title\">\n <slot></slot>\n <div class=\"c-card-title__underline\"></div>\n </header>\n );\n }\n}\n"],"version":3}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"c-checkbox.c-pagination.entry.js","mappings":";;;AAAA,MAAM,YAAY,GAAG,22GAA22G;;MCyBn3G,SAAS;;;;;;;;;;;IAwFZ,oBAAe,IACrB,WAAK,MAAM,EAAC,MAAM,EAAC,KAAK,EAAC,MAAM,EAAC,OAAO,EAAC,WAAW,IACjD,YAAM,CAAC,EAAE,cAAc,GAAI,CACvB,CACP,CAAC;mBAnFiC,KAAK;oBAKrB,KAAK;uBAKF,KAAK;gBAKZ,EAAE;yBAKO,KAAK;iBAKb,EAAE;oBAKC,KAAK;iBAKR,IAAI;sBAKC,gBAAgB;iBAMH,KAA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C,eAAe,CAAC,UAAU,CAAC,EAChD,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,CAC7B,EACL;GACH;EAED,MAAM;IACJ,MAAM,OAAO,GAAG;MACd,cAAc,EAAE,IAAI;MACpB,qBAAqB,EAAE,IAAI,CAAC,IAAI,KAAK,OAAO;MAC5C,sBAAsB,EAAE,IAAI,CAAC,MAAM;KACpC,CAAC;IAEF,QACE,EAAC,IAAI,IAAC,KAAK,EAAE,OAAO,IAClB,WAAK,IAAI,EAAC,YAAY,gBAAY,YAAY,IAC3C,CAAC,IAAI,CAAC,WAAW,KAChB,WAAK,KAAK,EAAC,uBAAuB,IAC/B,IAAI,CAAC,WAAW,EAAE,EACnB,YAAM,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,IAAG,IAAI,CAAC,SAAS,EAAE,CAAQ,CAC3D,CACP,EACA,IAAI,CAAC,wBAAwB,EAAE,CAC5B,CACD,EACP;GACH;;;;;;;;;","names":[],"sources":["src/components/c-checkbox/c-checkbox.scss?tag=c-checkbox&encapsulation=shadow","src/components/c-checkbox/c-checkbox.tsx","src/components/c-pagination/c-pagination.scss?tag=c-pagination&encapsulation=shadow","src/components/c-pagination/c-pagination.tsx"],"sourcesContent":[":host {\n /**\n * @prop --c-checkbox-background-color-hover: Checkbox hover background color\n * @prop --c-checkbox-color-active: Active checkbox color\n * @prop --c-checkbox-color-disabled: Disabled checkbox color\n * @prop --c-checkbox-color: Checkbox color\n */\n --_c-checkbox-background-color-hover: var(--c-checkbox-background-color-hover, rgba(var(--c-primary-rgb), 0.1));\n --_c-checkbox-color-active: var(--c-checkbox-color-active, var(--_c-checkbox-color));\n --_c-checkbox-color-disabled: var(--c-checkbox-color-disabled, var(--c-tertiary-500));\n --_c-checkbox-color: var(--c-checkbox-color, var(--c-primary-600));\n\n // private\n --_c-checkbox-color-error: var(--c-error-600);\n}\n\n.c-checkbox {\n $this: &;\n\n position: relative;\n width: fit-content;\n\n &__details {\n line-height: 1;\n padding: 0 12px;\n\n &.active {\n #{$this} {\n &__message {\n opacity: 1;\n transform: translateY(0);\n }\n }\n }\n }\n\n &__message {\n font-size: 12px;\n opacity: 0;\n transform: translateY(-4px);\n transition: all 0.2s cubic-bezier(0.25, 0.8, 0.5, 1);\n\n &--hint {\n color: var(--c-tertiary-500);\n }\n\n &--error {\n color: var(--_c-checkbox-color-error);\n }\n\n span {\n align-items: flex-start;\n color: currentColor;\n display: flex;\n gap: 4px;\n height: 16px;\n }\n\n svg {\n fill: currentColor;\n min-height: 16px;\n min-width: 16px;\n position: relative;\n top: -2px;\n }\n }\n\n &__label-content {\n padding-top: 10px;\n text-align: left;\n user-select: none;\n\n span.required {\n color: var(--c-error-600);\n }\n }\n\n &--disabled {\n --_c-checkbox-color: var(--_c-checkbox-color-disabled);\n --c-error-600: var(--_c-checkbox-color);\n --_c-checkbox-color-active: var(--_c-checkbox-color-disabled);\n\n color: var(--_c-checkbox-color);\n opacity: 0.75;\n\n .c-checkbox__label {\n cursor: default;\n }\n }\n\n &--error {\n --_c-checkbox-color: var(--c-error-600);\n --_c-checkbox-color-active: var(--_c-checkbox-color-error);\n\n color: var(--_c-checkbox-color-error);\n }\n\n input:focus {\n outline: none;\n }\n\n input:focus + .c-checkbox__label .ripple {\n outline: 2px var(--_c-checkbox-color-active) solid;\n }\n\n @supports selector(:focus-visible) {\n input:focus + .c-checkbox__label .ripple {\n outline: none;\n }\n }\n\n input:focus-visible + .c-checkbox__label .ripple {\n outline: 2px var(--_c-checkbox-color-active) solid;\n }\n\n &:not(.c-checkbox--disabled) {\n .ripple:hover {\n background-color: var(--_c-checkbox-background-color-hover);\n }\n }\n\n .visuallyhidden {\n border: 0;\n clip: rect(1px, 1px, 1px, 1px);\n height: 1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n width: 1px;\n }\n}\n\n.c-checkbox input:checked + .c-checkbox__label {\n .ripple::before {\n background: var(--_c-checkbox-color-active);\n border-color: var(--_c-checkbox-color-active);\n }\n\n .path {\n stroke: #ffffff;\n fill: #ffffff;\n stroke-dashoffset: 0;\n stroke-width: 13;\n stroke-linecap: round;\n stroke-linejoin: round;\n stroke-miterlimit: 10;\n }\n}\n\n.c-checkbox__label {\n cursor: pointer;\n display: flex;\n gap: 4px;\n position: relative;\n user-select: none;\n\n svg {\n height: 14px;\n left: 14px;\n position: absolute;\n top: 14px;\n width: 14px;\n }\n\n &--indeterminate .path {\n stroke-dasharray: 0 !important;\n stroke-dashoffset: 0 !important;\n stroke: transparent;\n }\n\n .ripple {\n border-radius: 50%;\n color: var(--_c-checkbox-color-active);\n display: grid;\n height: 42px;\n min-width: 42px;\n overflow: hidden;\n place-content: center;\n position: relative;\n transform: translateZ(0);\n width: 42px;\n\n &::before {\n border-radius: 2px;\n border: 2px solid var(--_c-checkbox-color);\n content: \"\";\n display: inline-block;\n height: 18px;\n left: 12px;\n position: absolute;\n top: 12px;\n transition: all 0.25s ease-out;\n vertical-align: middle;\n width: 18px;\n }\n }\n}\n","import {\n Component,\n Host,\n h,\n Listen,\n Prop,\n Event,\n EventEmitter,\n State,\n Watch,\n Element,\n AttachInternals,\n} from '@stencil/core';\nimport { mdiCloseCircle } from '@mdi/js';\n\n/**\n * @group Form\n * @slot Default slot - Default slot for the label\n */\n@Component({\n tag: 'c-checkbox',\n styleUrl: 'c-checkbox.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class CCheckbox {\n @Element() el: HTMLCCheckboxElement;\n\n // eslint-disable-next-line @stencil-community/own-props-must-be-private\n @AttachInternals() internals: ElementInternals;\n\n /**\n * If `true`, the checkbox is selected.\n */\n @Prop({ mutable: true }) checked = false;\n\n /**\n * Disable the checkbox\n */\n @Prop() disabled = 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 * Indeterminate state\n */\n @Prop() indeterminate = false;\n\n /**\n * Element label\n */\n @Prop() label = '';\n\n /**\n * Set as required\n */\n @Prop() required = false;\n\n /**\n * Set the validity of the input\n */\n @Prop() valid = true;\n\n /**\n * Custom validation message\n */\n @Prop() validation = 'Required field';\n\n /**\n * The input value\n * - Only used when the checkbox participates in a native `<form>`\n */\n @Prop() value: string | boolean = false;\n\n /**\n * The value when the checkbox is checked\n */\n @Prop() trueValue: boolean | string = true;\n\n /**\n * The value when the checkbox is unchecked\n */\n @Prop() falseValue: boolean | string = false;\n\n /**\n * Name of the input\n * - Only used when the checkbox participates in a native `<form>`\n */\n @Prop({ attribute: 'name' }) hostName: string;\n\n /**\n * Triggered when element is checked or unchecked\n */\n @Event({ bubbles: false }) changeValue: EventEmitter;\n\n @State() messageOptions = {\n show: false,\n type: 'hint',\n content: '',\n };\n\n private _container: HTMLDivElement;\n\n private _rippleElement: HTMLCRippleElement;\n\n private _validationIcon = (\n <svg height=\"16px\" width=\"16px\" viewBox=\"0 0 24 24\">\n <path d={mdiCloseCircle} />\n </svg>\n );\n\n @Watch('validation')\n onValidationMessageChange(message: string) {\n this.onValidChange(message.length === 0);\n }\n\n @Watch('valid')\n onValidChange(valid: boolean) {\n this._handleValidation(valid || this.valid);\n }\n\n @Listen('keydown', { passive: true })\n handleKeyDown(event: KeyboardEvent) {\n if (['Space'].includes(event.code)) {\n event.preventDefault();\n this._toggleState(event);\n }\n }\n\n componentWillLoad() {\n if (this.value === this.trueValue) {\n this.checked = true;\n }\n\n if (this.checked) {\n this.internals.setFormValue(this.value as string);\n }\n }\n\n componentDidLoad() {\n this._handleMessageOptions(this.valid);\n }\n\n private _handleMessageOptions(valid: boolean) {\n requestAnimationFrame(() => {\n this.messageOptions = {\n ...this.messageOptions,\n type: valid ? 'hint' : 'error',\n show: true,\n content: valid ? (\n <span>{this.hint}</span>\n ) : (\n <span>\n {this._validationIcon} {this.validation}\n </span>\n ),\n };\n });\n }\n\n private _handleValidation(valid: boolean, timeout = 200) {\n setTimeout(() => {\n this._handleMessageOptions(valid);\n }, timeout);\n }\n\n private _toggleState(event) {\n if (this.disabled) return;\n\n this._rippleElement.createRipple(event, this._container, true);\n\n this.checked = !this.checked;\n\n if (typeof this.value === 'string' && typeof this.trueValue === 'boolean') {\n this.changeValue.emit(this.value);\n\n this.internals.setFormValue(this.checked ? (this.value as string) : null);\n\n return;\n }\n\n this.changeValue.emit(this.checked ? this.trueValue : this.falseValue);\n }\n\n private _renderMessages() {\n if (this.hideDetails) return;\n\n const classes = {\n 'c-checkbox__details': true,\n active: this.messageOptions.show,\n };\n\n const messageClasses = {\n 'c-checkbox__message': true,\n [`c-checkbox__message--${this.messageOptions.type}`]: true,\n };\n\n return (\n <div class={classes}>\n <div class={messageClasses}>{this.messageOptions.content}</div>\n </div>\n );\n }\n\n render() {\n const wrapperClasses = {\n 'c-checkbox': true,\n 'c-checkbox--disabled': this.disabled,\n 'c-checkbox--error': this.messageOptions.type === 'error',\n };\n\n const labelClasses = {\n 'c-checkbox__label': true,\n 'c-checkbox__label--indeterminate': this.indeterminate,\n };\n\n const slotHasContent = !!this.el.childNodes.length;\n\n return (\n <Host>\n <div class={wrapperClasses}>\n <input\n class=\"visuallyhidden\"\n id=\"checkbox\"\n {...(!!this.hostName ? { name: this.hostName } : {})}\n type=\"checkbox\"\n aria-checked={this.checked.toString()}\n aria-disabled={this.disabled.toString()}\n checked={this.checked ? true : undefined}\n disabled={this.disabled}\n onChange={(event) => this._toggleState(event)}\n />\n\n <label class={labelClasses} htmlFor=\"checkbox\">\n <div\n class=\"ripple\"\n ref={(el) => (this._container = el as HTMLDivElement)}\n >\n <svg viewBox=\"0 0 100 100\">\n {!this.indeterminate && this.checked && (\n <path\n class=\"path\"\n d=\"M 12 52 l 24 24 l 47 -47 l -3 -3 l -44 44 l -21 -21 l -3 3\"\n />\n )}\n {this.indeterminate && (\n <path class=\"path\" d=\"M20 56 h60 v-8 h-60 z\" />\n )}\n </svg>\n\n <c-ripple ref={(el) => (this._rippleElement = el)}></c-ripple>\n </div>\n\n {(!!this.label || slotHasContent) && (\n <div class=\"c-checkbox__label-content\">\n {!!this.label ? this.label : <slot></slot>}\n {this.required && <span class=\"required\"> *</span>}\n </div>\n )}\n </label>\n </div>\n\n {this._renderMessages()}\n </Host>\n );\n }\n}\n",":host {\n /**\n * @prop --c-pagination-button-active-background-color: Active pagination button background color\n * @prop --c-pagination-button-active-background-color-hover: Active pagination button hover background color\n * @prop --c-pagination-button-active-text-color: Active pagination button text color\n * @prop --c-pagination-button-background-color: Pagination button background color\n * @prop --c-pagination-button-background-color-hover: Pagination button hover background color\n * @prop --c-pagination-button-text-color: Pagination button text color\n */\n --_c-pagination-button-active-background-color: var(--c-pagination-button-active-background-color, var(--c-primary-600));\n --_c-pagination-button-active-background-color-hover: var(--c-pagination-button-active-background-color-hover, var(--c-primary-400));\n --_c-pagination-button-active-text-color: var(--c-pagination-button-active-text-color, var(--c-white));\n --_c-pagination-button-background-color: var(--c-pagination-button-background-color, var(--c-transparent));\n --_c-pagination-button-background-color-hover: var(--c-pagination-button-background-color-hover, rgba(var(--c-primary-rgb), 0.1));\n --_c-pagination-button-text-color: var(--c-pagination-button-text-color, var(--_c-pagination-button-active-background-color));\n\n /**\n * @prop --c-pagination-menu-text-color: Pagination menu text color\n * @prop --c-pagination-menu-text-color-active: Active pagination menu text color\n * @prop --c-pagination-menu-background-color-hover: Pagination menu hover background color\n * @prop --c-pagination-menu-outline-color: Pagination menu outline color\n */\n --_c-pagination-menu-text-color: var(--c-pagination-menu-text-color, var(--c-text-system));\n --_c-pagination-menu-text-color-active: var(--c-pagination-menu-text-color-active, var(--c-primary-600));\n --_c-pagination-menu-background-color-hover: var(--c-pagination-menu-background-color-hover, var(--c-primary-200));\n --_c-pagination-menu-outline-color: var(--c-pagination-menu-outline-color, var(--c-primary-600));\n\n c-icon-button {\n --c-icon-button-background-color: var(--_c-pagination-button-active-background-color);\n --c-icon-button-background-color-hover: var(--_c-pagination-button-active-background-color-hover);\n --c-icon-button-text-color: var(--_c-pagination-button-active-text-color);\n --c-icon-button-text-background-color: var(--_c-pagination-button-background-color);\n --c-icon-button-text-background-color-hover: var(--_c-pagination-button-background-color-hover);\n --c-icon-button-text-text-color: var(--_c-pagination-button-text-color);\n }\n\n display: block;\n\n span {\n font-size: 14px;\n text-align: right;\n white-space: nowrap;\n }\n\n .range {\n min-width: 132px;\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\n:host(.c-pagination) {\n nav {\n align-items: center;\n display: flex;\n flex-wrap: wrap;\n gap: 0 24px;\n justify-content: center;\n width: 100%;\n }\n\n ul {\n align-items: center;\n display: flex;\n gap: 4px;\n justify-content: center;\n list-style: none;\n margin: 0;\n padding: 0;\n }\n\n .c-pagination__details {\n align-items: center;\n display: flex;\n flex-wrap: wrap;\n flex: auto;\n justify-content: space-between;\n }\n\n .c-pagination__items-per-page {\n color: var(--c-text-system);\n font-size: 14px;\n text-align: right;\n white-space: nowrap;\n display: flex;\n align-items: center;\n gap: 4px;\n }\n\n c-menu {\n --c-menu-text-color: var(--_c-pagination-menu-text-color);\n --c-menu-text-color-active: var(--_c-pagination-menu-text-color-active);\n --c-menu-background-color-hover: var(--_c-pagination-menu-background-color-hover);\n --c-menu-outline-color: var(--_c-pagination-menu-outline-color);\n }\n}\n\n:host(.c-pagination--simple) {\n ul {\n flex: 1;\n justify-content: flex-end;\n }\n}\n\n:host(.c-pagination--small) {\n ul {\n gap: 2px;\n }\n}\n","import {\n Component,\n h,\n Host,\n Prop,\n Event,\n EventEmitter,\n State,\n Watch,\n} from '@stencil/core';\nimport { mdiChevronLeft, mdiChevronRight, mdiDotsHorizontal } from '@mdi/js';\nimport { CMenuOption, CPaginationOptions } from '../../types';\n\n/**\n * @group Navigation\n */\n\n@Component({\n tag: 'c-pagination',\n styleUrl: 'c-pagination.scss',\n shadow: true,\n})\nexport class CPagination {\n /**\n * Object containing values that are needed for pagination.\n *\n * Note! startFrom and endTo are assigned automatically to the object based on other values\n */\n @Prop() value: CPaginationOptions = {\n itemCount: 0,\n };\n\n /**\n * Hide details (per page dropdown and the 'x - y of n pages' text)\n */\n @Prop() hideDetails = false;\n\n /**\n * Hide page number buttons\n */\n @Prop() simple = false;\n\n /**\n * Hide details (per page dropdown and the 'x - y of n pages' text)\n */\n @Prop() size: 'default' | 'small' = 'default';\n\n @State() private _currentPage;\n\n @State() private _itemsPerPage;\n\n @State() private _totalVisible;\n\n /**\n * Triggered when values are changed\n */\n @Event({ bubbles: false }) changeValue: EventEmitter<CPaginationOptions>;\n\n /**\n * Hide range indicator\n */\n @Prop() hideRange = false;\n\n /**\n * Items per page options\n */\n @Prop() itemsPerPageOptions: number[] = [5, 25, 50, 100];\n\n @State() tick = '';\n\n @Watch('value')\n valueHandler(value: CPaginationOptions, oldValue: CPaginationOptions) {\n if (this._isEqual(value, oldValue)) return;\n\n requestAnimationFrame(() => {\n this._setRange();\n });\n }\n\n private _isEqual(options1: CPaginationOptions, options2: CPaginationOptions) {\n const keys1 = Object.keys(options1 || {});\n const keys2 = Object.keys(options2 || {});\n\n if (keys1.length !== keys2.length) {\n return false;\n }\n\n for (const key of keys1) {\n if (options1[key] !== options2[key]) {\n return false;\n }\n }\n\n return true;\n }\n\n componentWillLoad() {\n this._setRange();\n }\n\n private _textContent = {\n itemsPerPageText: 'Items per page:',\n nextPage: 'Next page',\n prevPage: 'Previous page',\n };\n\n private _getText(key: string) {\n const source = this.value.textOverrides?.[key]\n ? this.value.textOverrides\n : this._textContent;\n\n return source[key];\n }\n\n private _setRange() {\n if (!this.value) return;\n\n this._currentPage = this.value.currentPage || 1;\n\n this._itemsPerPage = this.value.itemsPerPage || 25;\n\n this._totalVisible = this.value.totalVisible || 7;\n\n this.value.startFrom =\n this._currentPage * this._itemsPerPage - this._itemsPerPage;\n\n this.value.endTo = this._currentPage * this._itemsPerPage - 1;\n\n this.changeValue.emit(this.value);\n }\n\n private _buttons: HTMLLIElement[] = [];\n\n private _valueChangeHandler() {\n this.value.currentPage = this._currentPage;\n\n this.value.itemsPerPage = this._itemsPerPage;\n\n this._setRange();\n }\n\n private _renderMenu() {\n const itemsPerPageOptions: CMenuOption[] = this.itemsPerPageOptions.map(\n (i) => ({\n name: i.toString(),\n action: () => {\n this._itemsPerPage = i;\n this._currentPage = 1;\n this._valueChangeHandler();\n },\n }),\n );\n\n const onMenuClick = (event) => {\n event.stopPropagation();\n };\n\n return (\n <div class=\"c-pagination__items-per-page\">\n {this._getText('itemsPerPageText')}\n\n <c-menu items={itemsPerPageOptions} onClick={onMenuClick}>\n <div>\n <span class=\"items-per-page\">{this._itemsPerPage}</span>\n </div>\n </c-menu>\n </div>\n );\n }\n\n private _getTotalPages() {\n return Math.ceil(this.value.itemCount / this._itemsPerPage);\n }\n\n private _increasePageNumber = () => {\n if (this._currentPage < this._getTotalPages()) {\n this._currentPage += 1;\n this._valueChangeHandler();\n }\n };\n\n private _decreasePageNumber = () => {\n if (this._currentPage > 1) {\n this._currentPage -= 1;\n this._valueChangeHandler();\n }\n };\n\n private _setPage(number) {\n this._currentPage = number;\n this._valueChangeHandler();\n }\n\n private _getRange() {\n if (this.hideRange || !this.value.itemCount) return;\n\n const end = Math.min(\n this._currentPage * this._itemsPerPage,\n this.value.itemCount,\n );\n const start = this.value.startFrom + 1;\n\n const pageTextOverride = this.value.textOverrides?.pageText;\n\n let parsedPageTextOverride;\n\n if (pageTextOverride) {\n parsedPageTextOverride = pageTextOverride({\n start: start,\n end: end,\n count: this.value.itemCount,\n });\n }\n\n return pageTextOverride\n ? parsedPageTextOverride\n : `${start} - ${end} of ${this.value.itemCount} items`;\n }\n\n private _getArrowLeft(size) {\n return (\n <li>\n <c-icon-button\n aria-disabled={this.value.currentPage <= 1 ? 'true' : 'false'}\n aria-label={`${this._getText('prevPage')}`}\n disabled={this.value.currentPage <= 1}\n size={size}\n text\n onClick={this._decreasePageNumber}\n >\n <span class=\"visuallyhidden\">{this._getText('prevPage')}</span>\n\n <c-icon path={mdiChevronLeft}></c-icon>\n </c-icon-button>\n </li>\n );\n }\n\n private _getArrowRight(size) {\n return (\n <li>\n <c-icon-button\n aria-disabled={\n this.value.currentPage >= this._getTotalPages() ? 'true' : 'false'\n }\n aria-label={`${this._getText('nextPage')}`}\n disabled={this.value.currentPage >= this._getTotalPages()}\n size={size}\n text\n onClick={this._increasePageNumber}\n >\n <span class=\"visuallyhidden\">{this._getText('nextPage')}</span>\n\n <c-icon path={mdiChevronRight}></c-icon>\n </c-icon-button>\n </li>\n );\n }\n\n private _button(number, size) {\n const params = {\n text: this._currentPage !== number,\n onClick: () => this._setPage(number),\n size,\n };\n\n if (this._currentPage === number) {\n params['aria-current'] = 'page';\n }\n\n const pageOfTextOverride = this.value.textOverrides?.pageOfText;\n\n let parsedPageOfTextOverride;\n\n if (pageOfTextOverride) {\n parsedPageOfTextOverride = pageOfTextOverride({\n pageNumber: number,\n count: this._getTotalPages(),\n });\n }\n\n return (\n <li>\n <c-icon-button {...params}>\n <span\n aria-label={\n pageOfTextOverride\n ? parsedPageOfTextOverride\n : `page ${number} of ${this._getTotalPages()}`\n }\n >\n {number}\n </span>\n </c-icon-button>\n </li>\n );\n }\n\n private _addButton(number, size) {\n this._buttons.push(this._button(number, size));\n }\n\n private _addSeparator(size) {\n this._buttons.push(\n <li>\n <c-icon-button\n aria-disabled=\"true\"\n size={size}\n tabindex=\"-1\"\n role=\"separator\"\n disabled\n text\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\">\n <path d={mdiDotsHorizontal} />\n </svg>\n </c-icon-button>\n </li>,\n );\n }\n\n private _addButtons(buttonStart, buttonCount, size) {\n if (buttonStart > 1) {\n this._addButton(1, size);\n this._addSeparator(size);\n }\n\n for (let index = 1; index < buttonCount; index++) {\n this._addButton(buttonStart + index, size);\n }\n\n const allPagesVisible = this._getTotalPages() <= this._totalVisible;\n\n if (\n (this._currentPage < this._totalVisible - 1 ||\n this._currentPage < this._getTotalPages() - this._totalVisible + 4) &&\n !allPagesVisible\n ) {\n this._addSeparator(size);\n }\n }\n\n private _getPageButtons(size) {\n this._buttons = [];\n let buttonStart = 0;\n let buttonCount = this._getTotalPages() + 1;\n const morePagesThanVisible = this._getTotalPages() > this._totalVisible;\n\n if (morePagesThanVisible) {\n if (this._currentPage < this._totalVisible - 2) {\n buttonCount = this._totalVisible - 1;\n } else if (\n this._currentPage <\n this._getTotalPages() - this._totalVisible + 4\n ) {\n buttonStart = Math.ceil(this._currentPage - this._totalVisible / 2) + 1;\n buttonCount = this._totalVisible - 3;\n } else {\n buttonStart = this._getTotalPages() - this._totalVisible + 2;\n buttonCount = this._totalVisible - 2;\n }\n }\n\n this._addButtons(buttonStart, buttonCount, size);\n\n if (morePagesThanVisible) {\n this._buttons.push(this._button(this._getTotalPages(), size));\n }\n\n return this._buttons;\n }\n\n private _renderPaginationButtons() {\n if (!this.value.itemCount) return '';\n\n const buttonsize = this.size === 'small' ? 'x-small' : 'small';\n\n return (\n <ul>\n {this._getArrowLeft(buttonsize)}\n {!this.simple && this._getPageButtons(buttonsize)}\n {this._getArrowRight(buttonsize)}\n </ul>\n );\n }\n\n render() {\n const classes = {\n 'c-pagination': true,\n 'c-pagination--small': this.size === 'small',\n 'c-pagination--simple': this.simple,\n };\n\n return (\n <Host class={classes}>\n <nav role=\"navigation\" aria-label=\"pagination\">\n {!this.hideDetails && (\n <div class=\"c-pagination__details\">\n {this._renderMenu()}\n <span class={{ range: !this.simple }}>{this._getRange()}</span>\n </div>\n )}\n {this._renderPaginationButtons()}\n </nav>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -1,507 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-47956d53.js';
|
|
2
|
-
import { c as mdiAlert } from './mdi-e92c0e44.js';
|
|
3
|
-
|
|
4
|
-
const cDropdownCss = "html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit;-webkit-tap-highlight-color:transparent}:host{font-family:var(--c-font-family)}::-ms-reveal{display:none}:host(c-dropdown){--_c-dropdown-background-color:var(\n --c-dropdown-background-color,\n var(--c-white)\n );--_c-dropdown-background-color-hover:var(\n --c-dropdown-background-color-hover,\n var(--c-primary-200)\n );--_c-dropdown-text-color:var(--c-dropdown-text-color, var(--c-text-body));--_c-dropdown-text-color-active:var(\n --c-dropdown-text-color-active,\n var(--c-primary-600)\n );--_c-dropdown-font-size:14px;--_c-dropdown-height:42px;display:block;position:relative}:host(c-dropdown) mark{background-color:transparent;box-shadow:0 2px 0 0 var(--_c-dropdown-text-color-active);color:inherit}:host(c-dropdown) dialog{border-radius:4px;background-color:transparent;border:none;margin:-4px 0 0;overflow:visible;padding:4px 0 0;position:fixed}:host(c-dropdown) dialog::backdrop{display:none}:host(c-dropdown) dialog[open].mobile{background-color:var(--_c-dropdown-background-color);width:100vw;max-width:100vw;height:100vh;max-height:100svh;inset:0}:host(c-dropdown) dialog[open].mobile .input-top-wrapper{padding:8px}:host(c-dropdown) dialog .input-bottom-wrapper.active{padding-top:8px}:host(c-dropdown) .dummy{display:none}:host(c-dropdown) ul{background-color:var(--_c-dropdown-background-color);box-shadow:2px 4px 10px rgba(0, 0, 0, 0.1607843137);border-radius:4px;list-style:none;margin:0;outline:none;padding:0;pointer-events:auto;visibility:hidden;width:100%;height:max-content;overflow-y:scroll}:host(c-dropdown) ul.active{visibility:visible;animation:0.2s 1 fade-in cubic-bezier(0.25, 0.8, 0.5, 1)}:host(c-dropdown) ul.active.mobile{width:100vw;max-width:100vw;height:100vh;max-height:calc(100svh - 60px)}:host(c-dropdown) li{align-items:center;column-gap:12px;cursor:pointer;display:flex;flex-wrap:nowrap;font-size:var(--_c-dropdown-font-size);min-height:var(--_c-dropdown-height);outline:none;padding-left:10px;padding-right:10px;pointer-events:auto;white-space:nowrap;width:100%;border-radius:4px}:host(c-dropdown) li span,:host(c-dropdown) li c-option-value{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}:host(c-dropdown) li:not(.disabled):hover,:host(c-dropdown) li:not(.disabled):focus,:host(c-dropdown) li.active{background:var(--_c-dropdown-background-color-hover);color:var(--_c-dropdown-text-color-active);box-shadow:inset 0 0 0 1px var(--_c-dropdown-text-color-active)}:host(c-dropdown) li.disabled{background-color:rgba(var(--c-tertiary-rgb), 0.05);cursor:default;filter:grayscale(1) opacity(0.75)}:host(c-dropdown) .visuallyhidden{border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;overflow:hidden;padding:0;position:absolute;width:1px}@keyframes fade-in{from{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}";
|
|
5
|
-
|
|
6
|
-
const CDropdown = class {
|
|
7
|
-
constructor(hostRef) {
|
|
8
|
-
registerInstance(this, hostRef);
|
|
9
|
-
this.selectOption = createEvent(this, "selectOption", 7);
|
|
10
|
-
this.dropdownStateChange = createEvent(this, "dropdownStateChange", 7);
|
|
11
|
-
this._debounce = null;
|
|
12
|
-
this._isMobile = false;
|
|
13
|
-
this._listItems = [];
|
|
14
|
-
this._inputSize = {
|
|
15
|
-
height: 0,
|
|
16
|
-
width: 0,
|
|
17
|
-
};
|
|
18
|
-
this._openedOnTop = false;
|
|
19
|
-
this._hideDetails = false;
|
|
20
|
-
this.itemsPerPage = undefined;
|
|
21
|
-
this.parent = undefined;
|
|
22
|
-
this.items = undefined;
|
|
23
|
-
this.index = undefined;
|
|
24
|
-
this.hostId = undefined;
|
|
25
|
-
this.type = undefined;
|
|
26
|
-
this.itemType = undefined;
|
|
27
|
-
this.renderedList = null;
|
|
28
|
-
this.isOpen = false;
|
|
29
|
-
this.statusText = '';
|
|
30
|
-
}
|
|
31
|
-
optionsWatcher() {
|
|
32
|
-
requestAnimationFrame(() => {
|
|
33
|
-
this.renderedList = this._renderList();
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
stateWatcher() {
|
|
37
|
-
this.dropdownStateChange.emit(this.isOpen);
|
|
38
|
-
}
|
|
39
|
-
handleIndexChange(index) {
|
|
40
|
-
requestAnimationFrame(() => {
|
|
41
|
-
this._updateStatusText();
|
|
42
|
-
this._listItems.forEach((item, itemIndex) => {
|
|
43
|
-
item === null || item === void 0 ? void 0 : item.classList.toggle('active', index === itemIndex);
|
|
44
|
-
if (index === itemIndex) {
|
|
45
|
-
item === null || item === void 0 ? void 0 : item.focus();
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
async setStatusText(text) {
|
|
51
|
-
requestAnimationFrame(() => {
|
|
52
|
-
this.statusText = text;
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
async focusItem(index) {
|
|
56
|
-
requestAnimationFrame(() => {
|
|
57
|
-
var _a;
|
|
58
|
-
(_a = this._listItems[index]) === null || _a === void 0 ? void 0 : _a.focus();
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
async open() {
|
|
62
|
-
if (this._dialog.open)
|
|
63
|
-
return;
|
|
64
|
-
this._outsideClickFn = this._handleOutsideClick.bind(this);
|
|
65
|
-
window.addEventListener('click', this._outsideClickFn);
|
|
66
|
-
requestAnimationFrame(() => {
|
|
67
|
-
this.isOpen = true;
|
|
68
|
-
this._positionMenu();
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
async close() {
|
|
72
|
-
this._dialog.close();
|
|
73
|
-
this.isOpen = false;
|
|
74
|
-
this._inputElement.slot = 'default';
|
|
75
|
-
this._inputElement.hideDetails = this._hideDetails;
|
|
76
|
-
this._dummyElement.style.width = '0';
|
|
77
|
-
this._dummyElement.style.display = 'none';
|
|
78
|
-
this._dialog.style.width = '0';
|
|
79
|
-
window.removeEventListener('click', this._outsideClickFn);
|
|
80
|
-
}
|
|
81
|
-
_setIsMobile() {
|
|
82
|
-
this._isMobile = window.matchMedia('only screen and (max-width: 760px)').matches;
|
|
83
|
-
}
|
|
84
|
-
componentDidLoad() {
|
|
85
|
-
this._setIsMobile();
|
|
86
|
-
this._hideDetails = this.parent.hideDetails;
|
|
87
|
-
this._inputElement = this.el.querySelector('c-input');
|
|
88
|
-
this._resizeObserver = new ResizeObserver((entries) => {
|
|
89
|
-
requestAnimationFrame(() => {
|
|
90
|
-
if (!Array.isArray(entries) || !entries.length)
|
|
91
|
-
return;
|
|
92
|
-
this._setIsMobile();
|
|
93
|
-
if (!this._dialog.open)
|
|
94
|
-
return;
|
|
95
|
-
this.close();
|
|
96
|
-
});
|
|
97
|
-
});
|
|
98
|
-
this._resizeObserver.observe(window.document.body);
|
|
99
|
-
requestAnimationFrame(() => {
|
|
100
|
-
this.renderedList = this._renderList();
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
async selectItem(index) {
|
|
104
|
-
const item = this._listItems[index];
|
|
105
|
-
if (item.classList.contains('disabled')) {
|
|
106
|
-
return true;
|
|
107
|
-
}
|
|
108
|
-
this._listItems[index].click();
|
|
109
|
-
return false;
|
|
110
|
-
}
|
|
111
|
-
async updateList() {
|
|
112
|
-
requestAnimationFrame(() => {
|
|
113
|
-
this.renderedList = this._renderList();
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
_handleOutsideClick(event) {
|
|
117
|
-
if (!this.isOpen)
|
|
118
|
-
return;
|
|
119
|
-
if (!event.composedPath().includes(this._dialog)) {
|
|
120
|
-
this.close();
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
_highlightMatchingText(value) {
|
|
124
|
-
const { query } = this.parent;
|
|
125
|
-
if (this.parent.tagName === 'C-SELECT' || query === '')
|
|
126
|
-
return value;
|
|
127
|
-
const regex = new RegExp(query, 'gi');
|
|
128
|
-
const highlighted = value
|
|
129
|
-
.replace(/(<([^>]+)>)/gi, '')
|
|
130
|
-
.replace(regex, (match) => `<mark>${match}</mark>`);
|
|
131
|
-
return highlighted;
|
|
132
|
-
}
|
|
133
|
-
_getParentPosition() {
|
|
134
|
-
return this.parent.shadowRoot
|
|
135
|
-
.querySelector('.c-input__slot')
|
|
136
|
-
.getBoundingClientRect();
|
|
137
|
-
}
|
|
138
|
-
_positionMenu() {
|
|
139
|
-
const { innerWidth, innerHeight } = window;
|
|
140
|
-
this._dialog.style.width = 'auto';
|
|
141
|
-
this._dialog.style.opacity = '0';
|
|
142
|
-
this._dialog.showModal();
|
|
143
|
-
requestAnimationFrame(() => {
|
|
144
|
-
let inputSlot = 'input-top';
|
|
145
|
-
if (!this._isMobile) {
|
|
146
|
-
const { top: parentTop, width } = this._getParentPosition();
|
|
147
|
-
const inputSize = this.el.getBoundingClientRect();
|
|
148
|
-
this._inputSize = {
|
|
149
|
-
height: inputSize.height,
|
|
150
|
-
width: inputSize.width,
|
|
151
|
-
};
|
|
152
|
-
this._dialog.style.width = `${width}px`;
|
|
153
|
-
this._dialog.style.top = `${inputSize.top}px`;
|
|
154
|
-
this._dialog.style.bottom = 'auto';
|
|
155
|
-
this._dialog.style.left = `${inputSize.left}px`;
|
|
156
|
-
const { bottom, right, height } = this._dialog.getBoundingClientRect();
|
|
157
|
-
const isInView = {
|
|
158
|
-
x: right < innerWidth,
|
|
159
|
-
y: bottom < innerHeight,
|
|
160
|
-
};
|
|
161
|
-
const fitsOnTop = parentTop - height > 0;
|
|
162
|
-
if (!fitsOnTop && !isInView.y) {
|
|
163
|
-
this._dialog.style.maxHeight = `${parentTop}px`;
|
|
164
|
-
}
|
|
165
|
-
if (!isInView.y || this._openedOnTop) {
|
|
166
|
-
this._openedOnTop = true;
|
|
167
|
-
this._inputElement.hideDetails = true;
|
|
168
|
-
inputSlot = 'input-bottom';
|
|
169
|
-
this._dialog.style.top = 'auto';
|
|
170
|
-
this._dialog.style.bottom = `${innerHeight - inputSize.top - 44}px`;
|
|
171
|
-
this._inputElement.scrollIntoView();
|
|
172
|
-
}
|
|
173
|
-
this._dummyElement.style.width = `${this._getParentPosition().width}px`;
|
|
174
|
-
this._dummyElement.style.height = `${this._inputSize.height}px`;
|
|
175
|
-
this._dummyElement.style.display = 'block';
|
|
176
|
-
}
|
|
177
|
-
this._dummyElement.slot = 'default';
|
|
178
|
-
this._inputElement.slot = inputSlot;
|
|
179
|
-
this._inputElement.hideDetails = true;
|
|
180
|
-
this._dialog.style.opacity = '1';
|
|
181
|
-
const input = this.parent.shadowRoot.querySelector('input');
|
|
182
|
-
input.focus();
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
_emptyItem() {
|
|
186
|
-
const { query, loading } = this.parent;
|
|
187
|
-
if (!query || loading)
|
|
188
|
-
return;
|
|
189
|
-
return (h("li", null, h("c-icon", { path: mdiAlert, size: 18, color: "var(--c-warning-600)" }), "No suggestions found"));
|
|
190
|
-
}
|
|
191
|
-
_renderList() {
|
|
192
|
-
return this.itemType === 'option'
|
|
193
|
-
? this._renderOptionsList()
|
|
194
|
-
: this._renderItemsList();
|
|
195
|
-
}
|
|
196
|
-
_renderOptionsList() {
|
|
197
|
-
if (!this.items.length)
|
|
198
|
-
return this._emptyItem();
|
|
199
|
-
const options = Array.from(this.items);
|
|
200
|
-
this._listItems.length = 0;
|
|
201
|
-
return options.map((option, index) => {
|
|
202
|
-
const optionValue = option.querySelector('c-option-value');
|
|
203
|
-
if (optionValue) {
|
|
204
|
-
optionValue.innerHTML = this._highlightMatchingText(optionValue.textContent);
|
|
205
|
-
}
|
|
206
|
-
return (h("li", { ref: (el) => this._listItems.push(el), id: `${this.hostId}-option-${option.value}`, tabindex: "-1", role: "option", "aria-set-size": this.items.length.toString(), "aria-pos-in-set": (index + 1).toString(), "aria-selected": (!!option.selected).toString(), class: { disabled: !!option.disabled }, "data-name": option.name, onClick: (event) => {
|
|
207
|
-
if (option.disabled) {
|
|
208
|
-
event.preventDefault();
|
|
209
|
-
return;
|
|
210
|
-
}
|
|
211
|
-
this.selectOption.emit({ name: option.name, value: option.value });
|
|
212
|
-
}, innerHTML: option.outerHTML }));
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
|
-
_renderItemsList() {
|
|
216
|
-
if (!this.items.length)
|
|
217
|
-
return this._emptyItem();
|
|
218
|
-
this._listItems.length = 0;
|
|
219
|
-
return this.items.map((item, index) => {
|
|
220
|
-
return (h("li", { ref: (el) => this._listItems.push(el), id: `${this.hostId}-option-${item.value}`, tabindex: "-1", role: "option", "aria-set-size": this.items.length.toString(), "aria-pos-in-set": (index + 1).toString(), "aria-selected": (this.index === index).toString(), class: { disabled: !!item.disabled }, "data-name": item.name, onClick: (event) => {
|
|
221
|
-
if (item.disabled) {
|
|
222
|
-
event.preventDefault();
|
|
223
|
-
return;
|
|
224
|
-
}
|
|
225
|
-
this.selectOption.emit({ name: item.name, value: item.value });
|
|
226
|
-
} }, h("span", { innerHTML: this._highlightMatchingText(item.name) })));
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
_updateStatusText() {
|
|
230
|
-
if (this._debounce !== null) {
|
|
231
|
-
clearTimeout(this._debounce);
|
|
232
|
-
this._debounce = null;
|
|
233
|
-
}
|
|
234
|
-
this._debounce = window.setTimeout(() => {
|
|
235
|
-
var _a;
|
|
236
|
-
const selection = this._listItems[this.index];
|
|
237
|
-
const ending = !!this.items.length
|
|
238
|
-
? ', to navigate use up and down arrows'
|
|
239
|
-
: '';
|
|
240
|
-
const total = this._listItems.length;
|
|
241
|
-
const position = this.index + 1;
|
|
242
|
-
const isDisabled = !!((_a = selection === null || selection === void 0 ? void 0 : selection.classList) === null || _a === void 0 ? void 0 : _a.contains('disabled'));
|
|
243
|
-
const beginning = isDisabled ? 'Disabled option - ' : '';
|
|
244
|
-
let selectionText = !!selection
|
|
245
|
-
? `${beginning}${selection.dataset.name} - ${position} of ${total} is highlighted`
|
|
246
|
-
: null;
|
|
247
|
-
if (this.index === null && this.type === 'autocomplete') {
|
|
248
|
-
selectionText = this.items.length
|
|
249
|
-
? `${this.items.length} result${this.items.length !== 1 ? 's' : ''} available`
|
|
250
|
-
: 'No search results available';
|
|
251
|
-
}
|
|
252
|
-
this.statusText = `${selectionText || ending}`;
|
|
253
|
-
this._debounce = null;
|
|
254
|
-
}, 1400);
|
|
255
|
-
}
|
|
256
|
-
render() {
|
|
257
|
-
if (!this._isMobile &&
|
|
258
|
-
this._dialog &&
|
|
259
|
-
this.itemsPerPage &&
|
|
260
|
-
this.itemsPerPage > 0 &&
|
|
261
|
-
this.items.length > this.itemsPerPage) {
|
|
262
|
-
this._dialog.style.maxHeight = 42 * (this.itemsPerPage + 0.5) + 60 + 'px';
|
|
263
|
-
this._list.style.maxHeight = 42 * (this.itemsPerPage + 0.5) + 'px';
|
|
264
|
-
}
|
|
265
|
-
return (h(Host, null, h("slot", { name: "default" }), h("div", { class: "dummy", ref: (el) => (this._dummyElement = el) }), h("dialog", { tabindex: "-1", ref: (el) => (this._dialog = el), class: { mobile: this._isMobile }, onCancel: () => this.close() }, h("div", { id: 'announce-' + this.hostId, class: "visuallyhidden", "aria-live": "polite", "aria-atomic": "true" }, this.statusText), h("div", { class: "input-top-wrapper" }, h("slot", { name: "input-top" })), h("ul", { ref: (el) => (this._list = el), id: `${this.hostId}--results`, role: "listbox", "aria-expanded": this.isOpen.toString(), class: { active: this.isOpen, mobile: this._isMobile }, tabindex: "-1" }, this.renderedList), h("div", { class: { active: this._openedOnTop, 'input-bottom-wrapper': true } }, h("slot", { name: "input-bottom" })))));
|
|
266
|
-
}
|
|
267
|
-
get el() { return getElement(this); }
|
|
268
|
-
static get watchers() { return {
|
|
269
|
-
"items": ["optionsWatcher"],
|
|
270
|
-
"isOpen": ["stateWatcher"],
|
|
271
|
-
"index": ["handleIndexChange"]
|
|
272
|
-
}; }
|
|
273
|
-
};
|
|
274
|
-
CDropdown.style = cDropdownCss;
|
|
275
|
-
|
|
276
|
-
const cInputCss = "html{box-sizing:border-box}*,*: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)}";
|
|
277
|
-
|
|
278
|
-
const CInput = class {
|
|
279
|
-
constructor(hostRef) {
|
|
280
|
-
registerInstance(this, hostRef);
|
|
281
|
-
this.changeValue = createEvent(this, "changeValue", 3);
|
|
282
|
-
this.itemClick = createEvent(this, "itemClick", 3);
|
|
283
|
-
this.dropdownClose = createEvent(this, "dropdownClose", 3);
|
|
284
|
-
this._hasBlurred = false;
|
|
285
|
-
this._debounce = null;
|
|
286
|
-
this._observer = new IntersectionObserver((entries, observer) => {
|
|
287
|
-
entries.forEach((entry) => {
|
|
288
|
-
if (entry.isIntersecting) {
|
|
289
|
-
this._calculateElementWidths();
|
|
290
|
-
observer.unobserve(entry.target);
|
|
291
|
-
}
|
|
292
|
-
});
|
|
293
|
-
}, { threshold: 1 });
|
|
294
|
-
this._onBlur = () => {
|
|
295
|
-
setTimeout(() => {
|
|
296
|
-
if (!this.active) {
|
|
297
|
-
this.isFocused = false;
|
|
298
|
-
this._hasBlurred = true;
|
|
299
|
-
}
|
|
300
|
-
this._onReset();
|
|
301
|
-
}, 100);
|
|
302
|
-
};
|
|
303
|
-
this._onFocus = (click = true) => {
|
|
304
|
-
var _a, _b;
|
|
305
|
-
if (this.disabled)
|
|
306
|
-
return;
|
|
307
|
-
this.isFocused = true;
|
|
308
|
-
(_a = this.inputField) === null || _a === void 0 ? void 0 : _a.focus();
|
|
309
|
-
if (click) {
|
|
310
|
-
(_b = this.inputField) === null || _b === void 0 ? void 0 : _b.click();
|
|
311
|
-
if (this.variant === 'select') {
|
|
312
|
-
this.itemClick.emit();
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
if (this.inputField) {
|
|
316
|
-
this.inputField.placeholder =
|
|
317
|
-
!!this.value || !this.placeholder ? '' : this.placeholder;
|
|
318
|
-
}
|
|
319
|
-
};
|
|
320
|
-
this.active = false;
|
|
321
|
-
this.autofocus = false;
|
|
322
|
-
this.disabled = false;
|
|
323
|
-
this.form = false;
|
|
324
|
-
this.hideDetails = false;
|
|
325
|
-
this.hint = '';
|
|
326
|
-
this.hostId = undefined;
|
|
327
|
-
this.inputId = undefined;
|
|
328
|
-
this.items = undefined;
|
|
329
|
-
this.itemsPerPage = 6;
|
|
330
|
-
this.label = undefined;
|
|
331
|
-
this.max = null;
|
|
332
|
-
this.min = null;
|
|
333
|
-
this.name = undefined;
|
|
334
|
-
this.placeholder = undefined;
|
|
335
|
-
this.readonly = false;
|
|
336
|
-
this.required = false;
|
|
337
|
-
this.rows = 1;
|
|
338
|
-
this.shadow = false;
|
|
339
|
-
this.step = null;
|
|
340
|
-
this.type = undefined;
|
|
341
|
-
this.valid = true;
|
|
342
|
-
this.validate = false;
|
|
343
|
-
this.validateOnBlur = false;
|
|
344
|
-
this.validation = 'Required field';
|
|
345
|
-
this.value = undefined;
|
|
346
|
-
this.variant = 'text';
|
|
347
|
-
this.isFocused = false;
|
|
348
|
-
this.labelWidth = 0;
|
|
349
|
-
this.preSlotWidth = 0;
|
|
350
|
-
this.statusText = '';
|
|
351
|
-
this.currentIndex = null;
|
|
352
|
-
}
|
|
353
|
-
onValidChange() {
|
|
354
|
-
if (this.validateOnBlur && !this._hasBlurred)
|
|
355
|
-
return;
|
|
356
|
-
this._setAriaDescriptionId();
|
|
357
|
-
}
|
|
358
|
-
onValidationMessageChange() {
|
|
359
|
-
this._updateStatusText();
|
|
360
|
-
}
|
|
361
|
-
onValueChange(value) {
|
|
362
|
-
if (!value) {
|
|
363
|
-
this._onReset();
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
onPlaceholderChange(placeholder) {
|
|
367
|
-
if (placeholder)
|
|
368
|
-
this._onReset();
|
|
369
|
-
}
|
|
370
|
-
async reset() {
|
|
371
|
-
this._onReset();
|
|
372
|
-
}
|
|
373
|
-
componentDidLoad() {
|
|
374
|
-
var _a, _b, _c, _d;
|
|
375
|
-
if (this.autofocus) {
|
|
376
|
-
setTimeout(() => {
|
|
377
|
-
this._onFocus(false);
|
|
378
|
-
}, 500);
|
|
379
|
-
}
|
|
380
|
-
this._calculateElementWidths();
|
|
381
|
-
this._setAriaDescriptionId();
|
|
382
|
-
if (this.label) {
|
|
383
|
-
this._observer.observe(this._labelRef);
|
|
384
|
-
}
|
|
385
|
-
(_a = this.inputField) === null || _a === void 0 ? void 0 : _a.addEventListener('focus', () => this._onFocus(false));
|
|
386
|
-
(_b = this.inputField) === null || _b === void 0 ? void 0 : _b.addEventListener('blur', () => this._onBlur());
|
|
387
|
-
(_c = this.inputField) === null || _c === void 0 ? void 0 : _c.addEventListener('keypress', this._preventNonNumericalInput);
|
|
388
|
-
if (this.inputField) {
|
|
389
|
-
this.inputField.placeholder =
|
|
390
|
-
!!this.label || !this.placeholder ? '' : this.placeholder;
|
|
391
|
-
this.inputField.title = (_d = this.label) !== null && _d !== void 0 ? _d : this.placeholder;
|
|
392
|
-
requestAnimationFrame(() => {
|
|
393
|
-
const container = this.inputField.closest('.c-input-menu__input');
|
|
394
|
-
if (!container)
|
|
395
|
-
return;
|
|
396
|
-
container.dataset.placeholder = this.placeholder;
|
|
397
|
-
});
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
disconnectedCallback() {
|
|
401
|
-
var _a, _b, _c, _d;
|
|
402
|
-
(_a = this.inputField) === null || _a === void 0 ? void 0 : _a.removeEventListener('focus', () => this._onFocus(false));
|
|
403
|
-
(_b = this.inputField) === null || _b === void 0 ? void 0 : _b.removeEventListener('blur', () => this._onBlur());
|
|
404
|
-
(_c = this.inputField) === null || _c === void 0 ? void 0 : _c.removeEventListener('keypress', this._preventNonNumericalInput);
|
|
405
|
-
this._observer.disconnect();
|
|
406
|
-
(_d = this._dropdownElement) === null || _d === void 0 ? void 0 : _d.remove();
|
|
407
|
-
}
|
|
408
|
-
get isActive() {
|
|
409
|
-
return !!this.value || typeof this.value === 'boolean' || this.isFocused;
|
|
410
|
-
}
|
|
411
|
-
_setAriaDescriptionId() {
|
|
412
|
-
this.inputField.removeAttribute('aria-describedby');
|
|
413
|
-
let type = null;
|
|
414
|
-
if (this.valid && !this.value && this.hint) {
|
|
415
|
-
type = 'hint';
|
|
416
|
-
}
|
|
417
|
-
if (!this.valid) {
|
|
418
|
-
type = 'error';
|
|
419
|
-
}
|
|
420
|
-
if (type) {
|
|
421
|
-
this.inputField.setAttribute('aria-describedby', `${type}-${this.inputId}`);
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
_calculateElementWidths() {
|
|
425
|
-
this.labelWidth = !!this.label ? this._labelRef.scrollWidth * 0.75 + 6 : 0;
|
|
426
|
-
this.preSlotWidth = this.inputField.offsetLeft;
|
|
427
|
-
}
|
|
428
|
-
_onReset() {
|
|
429
|
-
if (this.inputField) {
|
|
430
|
-
if (!!this.placeholder &&
|
|
431
|
-
!this.value &&
|
|
432
|
-
(this.active || this.isFocused)) {
|
|
433
|
-
this.inputField.placeholder = this.placeholder;
|
|
434
|
-
return;
|
|
435
|
-
}
|
|
436
|
-
this.inputField.placeholder =
|
|
437
|
-
!this.label && !this.value && !!this.placeholder
|
|
438
|
-
? this.placeholder
|
|
439
|
-
: '';
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
_preventNonNumericalInput(event) {
|
|
443
|
-
if (this.type !== 'number')
|
|
444
|
-
return;
|
|
445
|
-
if (!event.key.match(/^[0-9,\.]+$/))
|
|
446
|
-
event.preventDefault();
|
|
447
|
-
}
|
|
448
|
-
_renderBorders() {
|
|
449
|
-
if (this.shadow)
|
|
450
|
-
return;
|
|
451
|
-
const classes = {
|
|
452
|
-
active: this.isActive || this.active,
|
|
453
|
-
};
|
|
454
|
-
return (h("fieldset", { "aria-hidden": "true" }, h("legend", { class: classes, style: {
|
|
455
|
-
'--_c-input-legend-width': this.labelWidth + 'px',
|
|
456
|
-
} }, h("span", { class: "notranslate" }))));
|
|
457
|
-
}
|
|
458
|
-
_renderLabel() {
|
|
459
|
-
if (!this.label)
|
|
460
|
-
return;
|
|
461
|
-
const classes = {
|
|
462
|
-
active: this.isActive,
|
|
463
|
-
};
|
|
464
|
-
return (h("label", { htmlFor: this.inputId, ref: (el) => (this._labelRef = el), class: classes }, this.label, this.required && h("span", null, "\u00A0*")));
|
|
465
|
-
}
|
|
466
|
-
get inputField() {
|
|
467
|
-
var _a;
|
|
468
|
-
return (_a = this.el) === null || _a === void 0 ? void 0 : _a.querySelector('.c-input__input');
|
|
469
|
-
}
|
|
470
|
-
_updateStatusText() {
|
|
471
|
-
if (this._debounce !== null) {
|
|
472
|
-
clearTimeout(this._debounce);
|
|
473
|
-
this._debounce = null;
|
|
474
|
-
}
|
|
475
|
-
this._debounce = window.setTimeout(() => {
|
|
476
|
-
this.statusText = this.valid ? '' : `Error: ${this.validation}`;
|
|
477
|
-
this._debounce = null;
|
|
478
|
-
}, 1400);
|
|
479
|
-
}
|
|
480
|
-
render() {
|
|
481
|
-
const containerClasses = {
|
|
482
|
-
'c-input': true,
|
|
483
|
-
'c-input--disabled': this.disabled,
|
|
484
|
-
'c-input--shadow': this.shadow,
|
|
485
|
-
'c-input--textarea': this.rows > 1,
|
|
486
|
-
'c-input--error': !this.valid,
|
|
487
|
-
'c-input--active': this.isFocused || this.active,
|
|
488
|
-
filled: !!this.value,
|
|
489
|
-
[`c-input--${this.variant}`]: true,
|
|
490
|
-
};
|
|
491
|
-
return (h(Host, { disabled: this.disabled }, h("div", { id: 'announce-' + this.inputId, class: "visuallyhidden", "aria-live": "polite", "aria-atomic": "true" }, this.statusText), h("div", { class: containerClasses }, h("div", { class: "c-input__control" }, h("div", { class: "c-input__slot", onClick: () => this._onFocus() }, this._renderBorders(), h("div", { class: "c-input__field", style: {
|
|
492
|
-
'--_c-input-label-position': this.preSlotWidth + 'px',
|
|
493
|
-
} }, h("slot", { name: "pre" }), this._renderLabel(), h("slot", null))), this.variant === 'select' && h("slot", { name: "dropdown" }), !this.hideDetails && (h("c-message", { hint: this.hint, inputId: this.inputId, valid: this.valid, validation: this.validation }))))));
|
|
494
|
-
}
|
|
495
|
-
get el() { return getElement(this); }
|
|
496
|
-
static get watchers() { return {
|
|
497
|
-
"valid": ["onValidChange"],
|
|
498
|
-
"validation": ["onValidationMessageChange"],
|
|
499
|
-
"value": ["onValueChange"],
|
|
500
|
-
"placeholder": ["onPlaceholderChange"]
|
|
501
|
-
}; }
|
|
502
|
-
};
|
|
503
|
-
CInput.style = cInputCss;
|
|
504
|
-
|
|
505
|
-
export { CDropdown as c_dropdown, CInput as c_input };
|
|
506
|
-
|
|
507
|
-
//# sourceMappingURL=c-dropdown_2.entry.js.map
|