@rededor/cura 1.2.0 → 1.3.0
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/{app-globals-4d07f363.js → app-globals-f33ceef8.js} +32 -1
- package/dist/cjs/app-globals-f33ceef8.js.map +1 -0
- package/dist/cjs/cura-accordion_12.cjs.entry.js +39 -38
- package/dist/cjs/cura-accordion_12.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-alert.cjs.entry.js +3 -2
- package/dist/cjs/cura-alert.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-avatar.cjs.entry.js +1 -1
- package/dist/cjs/cura-badge-distance.cjs.entry.js +1 -1
- package/dist/cjs/cura-badge-number.cjs.entry.js +2 -2
- package/dist/cjs/cura-badge-number.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-button-outline.cjs.entry.js +1 -1
- package/dist/cjs/cura-button-select.cjs.entry.js +17 -9
- package/dist/cjs/cura-button-select.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-button-transparent.cjs.entry.js +1 -1
- package/dist/cjs/cura-calendar.cjs.entry.js +2 -2
- package/dist/cjs/cura-calendar.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-card.cjs.entry.js +1 -1
- package/dist/cjs/cura-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/cura-display.cjs.entry.js +1 -1
- package/dist/cjs/cura-dropdown-search-option-title.cjs.entry.js +1 -1
- package/dist/cjs/cura-dropdown-search-option.cjs.entry.js +2 -2
- package/dist/cjs/cura-dropdown-search.cjs.entry.js +21 -11
- package/dist/cjs/cura-dropdown-search.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-icons-view.cjs.entry.js +3 -3
- package/dist/cjs/cura-input-date.cjs.entry.js +45 -45
- package/dist/cjs/cura-input-date.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-loader-bar.cjs.entry.js +1 -1
- package/dist/cjs/cura-radio.cjs.entry.js +1 -1
- package/dist/cjs/cura-switch.cjs.entry.js +1 -1
- package/dist/cjs/cura-toast.cjs.entry.js +1 -1
- package/dist/cjs/cura-tooltip.cjs.entry.js +232 -0
- package/dist/cjs/cura-tooltip.cjs.entry.js.map +1 -0
- package/dist/cjs/cura.cjs.js +2 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/api/theme-presets/theme-presets.js +2 -0
- package/dist/collection/api/theme-presets/theme-presets.js.map +1 -1
- package/dist/collection/api/theme-presets/theme-richet.js +32 -0
- package/dist/collection/api/theme-presets/theme-richet.js.map +1 -0
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/accordion/cura-accordion/cura-accordion.css +0 -6
- package/dist/collection/components/accordion/cura-accordion/cura-accordion.js +41 -43
- package/dist/collection/components/accordion/cura-accordion/cura-accordion.js.map +1 -1
- package/dist/collection/components/accordion/cura-accordion/cura-accordion.stories.js +54 -36
- package/dist/collection/components/accordion/cura-accordion/cura-accordion.stories.js.map +1 -1
- package/dist/collection/components/accordion/cura-accordion-item/cura-accordion-item.css +61 -60
- package/dist/collection/components/accordion/cura-accordion-item/cura-accordion-item.js +41 -23
- package/dist/collection/components/accordion/cura-accordion-item/cura-accordion-item.js.map +1 -1
- package/dist/collection/components/badges/cura-badge-distance/cura-badge-distance.js +1 -1
- package/dist/collection/components/badges/cura-badge-number/cura-badge-number.css +0 -2
- package/dist/collection/components/badges/cura-badge-number/cura-badge-number.js +1 -1
- package/dist/collection/components/badges/cura-badge-number/cura-badge-number.js.map +1 -1
- package/dist/collection/components/buttons/cura-button/cura-button.js +1 -1
- package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.js +1 -1
- package/dist/collection/components/buttons/cura-button-select/cura-button-select.css +36 -2
- package/dist/collection/components/buttons/cura-button-select/cura-button-select.js +39 -11
- package/dist/collection/components/buttons/cura-button-select/cura-button-select.js.map +1 -1
- package/dist/collection/components/buttons/cura-button-select/cura-button-select.stories.js +18 -7
- package/dist/collection/components/buttons/cura-button-select/cura-button-select.stories.js.map +1 -1
- package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.js +1 -1
- package/dist/collection/components/cura-alert/cura-alert.css +25 -11
- package/dist/collection/components/cura-alert/cura-alert.js +2 -1
- package/dist/collection/components/cura-alert/cura-alert.js.map +1 -1
- package/dist/collection/components/cura-avatar/cura-avatar.js +1 -1
- package/dist/collection/components/cura-calendar/cura-calendar.css +1 -0
- package/dist/collection/components/cura-calendar/cura-calendar.js +1 -1
- package/dist/collection/components/cura-card/cura-card.js +1 -1
- package/dist/collection/components/cura-icon/cura-icon.js +1 -1
- package/dist/collection/components/cura-icons-view/cura-icons-view.js +3 -3
- package/dist/collection/components/cura-page-template/cura-page-template.js +1 -1
- package/dist/collection/components/cura-toast/cura-toast.js +1 -1
- package/dist/collection/components/cura-tooltip/cura-tooltip.css +159 -0
- package/dist/collection/components/cura-tooltip/cura-tooltip.js +397 -0
- package/dist/collection/components/cura-tooltip/cura-tooltip.js.map +1 -0
- package/dist/collection/components/cura-tooltip/cura-tooltip.stories.js +137 -0
- package/dist/collection/components/cura-tooltip/cura-tooltip.stories.js.map +1 -0
- package/dist/collection/components/forms/cura-checkbox/cura-checkbox.js +1 -1
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.js +2 -2
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option-title/cura-dropdown-search-option-title.js +1 -1
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.css +1 -1
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.js +20 -10
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.js.map +1 -1
- package/dist/collection/components/forms/cura-input-date/cura-input-date.css +15 -0
- package/dist/collection/components/forms/cura-input-date/cura-input-date.js +69 -68
- package/dist/collection/components/forms/cura-input-date/cura-input-date.js.map +1 -1
- package/dist/collection/components/forms/cura-input-date/cura-input-date.stories.js +29 -10
- package/dist/collection/components/forms/cura-input-date/cura-input-date.stories.js.map +1 -1
- package/dist/collection/components/forms/cura-input-text/cura-input-text.js +1 -1
- package/dist/collection/components/forms/cura-label/cura-label.js +1 -1
- package/dist/collection/components/forms/cura-radio/cura-radio.js +1 -1
- package/dist/collection/components/forms/cura-select/cura-select.js +3 -3
- package/dist/collection/components/forms/cura-select-options/cura-select-option.js +1 -1
- package/dist/collection/components/forms/cura-switch/cura-switch.js +1 -1
- package/dist/collection/components/loaders/cura-loader-bar/cura-loader-bar.js +1 -1
- package/dist/collection/components/loaders/cura-loader-circle/cura-loader-circle.js +1 -1
- package/dist/collection/components/text/cura-display/cura-display.js +1 -1
- package/dist/collection/components/text/cura-heading/cura-heading.css +5 -1
- package/dist/collection/components/text/cura-heading/cura-heading.js +7 -6
- package/dist/collection/components/text/cura-heading/cura-heading.js.map +1 -1
- package/dist/collection/components/text/cura-paragraph/cura-paragraph.js +1 -1
- package/dist/components/cura-accordion-item.js +19 -12
- package/dist/components/cura-accordion-item.js.map +1 -1
- package/dist/components/cura-accordion.js +14 -15
- package/dist/components/cura-accordion.js.map +1 -1
- package/dist/components/cura-alert.js +3 -2
- package/dist/components/cura-alert.js.map +1 -1
- package/dist/components/cura-avatar.js +1 -1
- package/dist/components/cura-badge-distance.js +1 -1
- package/dist/components/cura-badge-number2.js +2 -2
- package/dist/components/cura-badge-number2.js.map +1 -1
- package/dist/components/cura-button-outline.js +1 -1
- package/dist/components/cura-button-select.js +18 -9
- package/dist/components/cura-button-select.js.map +1 -1
- package/dist/components/cura-button-transparent2.js +1 -1
- package/dist/components/cura-button.js +1 -1
- package/dist/components/cura-calendar2.js +2 -2
- package/dist/components/cura-calendar2.js.map +1 -1
- package/dist/components/cura-card.js +1 -1
- package/dist/components/cura-checkbox.js +1 -1
- package/dist/components/cura-display.js +1 -1
- package/dist/components/cura-dropdown-search-option-title.js +1 -1
- package/dist/components/cura-dropdown-search-option.js +2 -2
- package/dist/components/cura-dropdown-search.js +21 -11
- package/dist/components/cura-dropdown-search.js.map +1 -1
- package/dist/components/cura-heading2.js +8 -7
- package/dist/components/cura-heading2.js.map +1 -1
- package/dist/components/cura-icon2.js +1 -1
- package/dist/components/cura-icons-view.js +3 -3
- package/dist/components/cura-input-date.js +54 -57
- package/dist/components/cura-input-date.js.map +1 -1
- package/dist/components/cura-label2.js +1 -1
- package/dist/components/cura-loader-bar2.js +1 -1
- package/dist/components/cura-loader-circle2.js +1 -1
- package/dist/components/cura-page-template.js +1 -1
- package/dist/components/cura-paragraph2.js +1 -1
- package/dist/components/cura-radio.js +1 -1
- package/dist/components/cura-select-option2.js +1 -1
- package/dist/components/cura-select2.js +3 -3
- package/dist/components/cura-switch.js +1 -1
- package/dist/components/cura-toast.js +1 -1
- package/dist/components/cura-tooltip.d.ts +11 -0
- package/dist/components/cura-tooltip.js +291 -0
- package/dist/components/cura-tooltip.js.map +1 -0
- package/dist/components/index.js +33 -0
- package/dist/components/index.js.map +1 -1
- package/dist/cura/cura.esm.js +1 -1
- package/dist/cura/cura.esm.js.map +1 -1
- package/dist/cura/{p-116a1cd6.entry.js → p-01e301d4.entry.js} +2 -2
- package/dist/cura/{p-c6508bd7.entry.js → p-022b22b6.entry.js} +2 -2
- package/dist/cura/p-0308cf6b.entry.js +2 -0
- package/dist/cura/p-0308cf6b.entry.js.map +1 -0
- package/dist/cura/p-22e921d9.entry.js +2 -0
- package/dist/cura/p-22e921d9.entry.js.map +1 -0
- package/dist/cura/p-2b9eadc7.entry.js +2 -0
- package/dist/cura/p-2b9eadc7.entry.js.map +1 -0
- package/dist/cura/{p-b2d5db22.entry.js → p-2c0f5497.entry.js} +2 -2
- package/dist/cura/p-5bb8302c.entry.js +2 -0
- package/dist/cura/p-5bb8302c.entry.js.map +1 -0
- package/dist/cura/{p-fcbf4311.entry.js → p-639c1b67.entry.js} +2 -2
- package/dist/cura/{p-2956f120.entry.js → p-7853ab16.entry.js} +2 -2
- package/dist/cura/{p-2956f120.entry.js.map → p-7853ab16.entry.js.map} +1 -1
- package/dist/cura/{p-41c3d47d.entry.js → p-81c66f2b.entry.js} +2 -2
- package/dist/cura/p-82b99090.js +2 -0
- package/dist/cura/p-82b99090.js.map +1 -0
- package/dist/cura/p-93525d68.entry.js +2 -0
- package/dist/cura/p-93525d68.entry.js.map +1 -0
- package/dist/cura/p-9991f7db.entry.js +2 -0
- package/dist/cura/p-9e3d26fe.entry.js +2 -0
- package/dist/cura/p-9e3d26fe.entry.js.map +1 -0
- package/dist/cura/{p-dcd2e5bb.entry.js → p-a7ecea4a.entry.js} +2 -2
- package/dist/cura/{p-33772510.entry.js → p-b0451cb3.entry.js} +2 -2
- package/dist/cura/{p-8f3db0fe.entry.js → p-b883e098.entry.js} +2 -2
- package/dist/cura/{p-907b3d12.entry.js → p-bfb5e9e1.entry.js} +2 -2
- package/dist/cura/{p-e5023e34.entry.js → p-c444e692.entry.js} +2 -2
- package/dist/cura/{p-fdce91a7.entry.js → p-d635501a.entry.js} +2 -2
- package/dist/cura/{p-fd083399.entry.js → p-df851816.entry.js} +2 -2
- package/dist/cura/{p-44e3325a.entry.js → p-e3d3bc3d.entry.js} +2 -2
- package/dist/cura/p-eda28278.entry.js +2 -0
- package/dist/cura/p-eda28278.entry.js.map +1 -0
- package/dist/esm/{app-globals-6ca7103d.js → app-globals-e54ee4c3.js} +32 -1
- package/dist/esm/app-globals-e54ee4c3.js.map +1 -0
- package/dist/esm/cura-accordion_12.entry.js +39 -38
- package/dist/esm/cura-accordion_12.entry.js.map +1 -1
- package/dist/esm/cura-alert.entry.js +3 -2
- package/dist/esm/cura-alert.entry.js.map +1 -1
- package/dist/esm/cura-avatar.entry.js +1 -1
- package/dist/esm/cura-badge-distance.entry.js +1 -1
- package/dist/esm/cura-badge-number.entry.js +2 -2
- package/dist/esm/cura-badge-number.entry.js.map +1 -1
- package/dist/esm/cura-button-outline.entry.js +1 -1
- package/dist/esm/cura-button-select.entry.js +17 -9
- package/dist/esm/cura-button-select.entry.js.map +1 -1
- package/dist/esm/cura-button-transparent.entry.js +1 -1
- package/dist/esm/cura-calendar.entry.js +2 -2
- package/dist/esm/cura-calendar.entry.js.map +1 -1
- package/dist/esm/cura-card.entry.js +1 -1
- package/dist/esm/cura-checkbox.entry.js +1 -1
- package/dist/esm/cura-display.entry.js +1 -1
- package/dist/esm/cura-dropdown-search-option-title.entry.js +1 -1
- package/dist/esm/cura-dropdown-search-option.entry.js +2 -2
- package/dist/esm/cura-dropdown-search.entry.js +21 -11
- package/dist/esm/cura-dropdown-search.entry.js.map +1 -1
- package/dist/esm/cura-icons-view.entry.js +3 -3
- package/dist/esm/cura-input-date.entry.js +45 -45
- package/dist/esm/cura-input-date.entry.js.map +1 -1
- package/dist/esm/cura-loader-bar.entry.js +1 -1
- package/dist/esm/cura-radio.entry.js +1 -1
- package/dist/esm/cura-switch.entry.js +1 -1
- package/dist/esm/cura-toast.entry.js +1 -1
- package/dist/esm/cura-tooltip.entry.js +228 -0
- package/dist/esm/cura-tooltip.entry.js.map +1 -0
- package/dist/esm/cura.js +2 -2
- package/dist/esm/loader.js +2 -2
- package/dist/types/api/theme-presets/theme-presets.d.ts +43 -0
- package/dist/types/api/theme-presets/theme-richet.d.ts +43 -0
- package/dist/types/components/accordion/cura-accordion/cura-accordion.d.ts +7 -3
- package/dist/types/components/accordion/cura-accordion/cura-accordion.stories.d.ts +38 -16
- package/dist/types/components/accordion/cura-accordion-item/cura-accordion-item.d.ts +8 -3
- package/dist/types/components/buttons/cura-button-select/cura-button-select.d.ts +2 -0
- package/dist/types/components/buttons/cura-button-select/cura-button-select.stories.d.ts +14 -0
- package/dist/types/components/cura-tooltip/cura-tooltip.d.ts +25 -0
- package/dist/types/components/cura-tooltip/cura-tooltip.stories.d.ts +119 -0
- package/dist/types/components/forms/cura-dropdown-search/cura-dropdown-search.d.ts +1 -0
- package/dist/types/components/forms/cura-input-date/cura-input-date.d.ts +19 -19
- package/dist/types/components/text/cura-heading/cura-heading.d.ts +1 -0
- package/dist/types/components.d.ts +75 -10
- package/package.json +2 -2
- package/dist/cjs/app-globals-4d07f363.js.map +0 -1
- package/dist/cura/p-0b7a7306.js +0 -2
- package/dist/cura/p-0b7a7306.js.map +0 -1
- package/dist/cura/p-2d267d23.entry.js +0 -2
- package/dist/cura/p-2d267d23.entry.js.map +0 -1
- package/dist/cura/p-4e14c01c.entry.js +0 -2
- package/dist/cura/p-b43b69f3.entry.js +0 -2
- package/dist/cura/p-b43b69f3.entry.js.map +0 -1
- package/dist/cura/p-be10b681.entry.js +0 -2
- package/dist/cura/p-be10b681.entry.js.map +0 -1
- package/dist/cura/p-cda24a1e.entry.js +0 -2
- package/dist/cura/p-cda24a1e.entry.js.map +0 -1
- package/dist/cura/p-e8bc6381.entry.js +0 -2
- package/dist/cura/p-e8bc6381.entry.js.map +0 -1
- package/dist/cura/p-ed97cf3c.entry.js +0 -2
- package/dist/cura/p-ed97cf3c.entry.js.map +0 -1
- package/dist/esm/app-globals-6ca7103d.js.map +0 -1
- /package/dist/cura/{p-116a1cd6.entry.js.map → p-01e301d4.entry.js.map} +0 -0
- /package/dist/cura/{p-c6508bd7.entry.js.map → p-022b22b6.entry.js.map} +0 -0
- /package/dist/cura/{p-b2d5db22.entry.js.map → p-2c0f5497.entry.js.map} +0 -0
- /package/dist/cura/{p-fcbf4311.entry.js.map → p-639c1b67.entry.js.map} +0 -0
- /package/dist/cura/{p-41c3d47d.entry.js.map → p-81c66f2b.entry.js.map} +0 -0
- /package/dist/cura/{p-4e14c01c.entry.js.map → p-9991f7db.entry.js.map} +0 -0
- /package/dist/cura/{p-dcd2e5bb.entry.js.map → p-a7ecea4a.entry.js.map} +0 -0
- /package/dist/cura/{p-33772510.entry.js.map → p-b0451cb3.entry.js.map} +0 -0
- /package/dist/cura/{p-8f3db0fe.entry.js.map → p-b883e098.entry.js.map} +0 -0
- /package/dist/cura/{p-907b3d12.entry.js.map → p-bfb5e9e1.entry.js.map} +0 -0
- /package/dist/cura/{p-e5023e34.entry.js.map → p-c444e692.entry.js.map} +0 -0
- /package/dist/cura/{p-fdce91a7.entry.js.map → p-d635501a.entry.js.map} +0 -0
- /package/dist/cura/{p-fd083399.entry.js.map → p-df851816.entry.js.map} +0 -0
- /package/dist/cura/{p-44e3325a.entry.js.map → p-e3d3bc3d.entry.js.map} +0 -0
|
@@ -43,7 +43,7 @@ const CuraCard = class {
|
|
|
43
43
|
return classes;
|
|
44
44
|
}
|
|
45
45
|
render() {
|
|
46
|
-
return (index.h(index.Host, { key: '
|
|
46
|
+
return (index.h(index.Host, { key: '72140d7ae467677c7acbdb3ff45fa84c9fe60fce', role: this.href ? 'link' : 'div' }, this.href ? (index.h("a", { class: this.getClasses(), target: this.target, style: this.styles, href: this.href }, index.h("slot", null))) : (index.h("div", { class: this.getClasses(), style: this.styles }, index.h("slot", null)))));
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
49
|
CuraCard.style = CuraCardStyle0;
|
|
@@ -164,7 +164,7 @@ const CuraCheckbox = class {
|
|
|
164
164
|
return index.h("cura-icon", { class: "icon", name: iconName, size: iconSize, color: iconColor });
|
|
165
165
|
}
|
|
166
166
|
render() {
|
|
167
|
-
return (index.h(index.Host, { key: '
|
|
167
|
+
return (index.h(index.Host, { key: '00334ec058edf0849cf30c65d2f9e2e2e051de96' }, index.h("div", { key: 'd7c7857afa27a033f0642369717eb3be406f9f27', class: this.getClasses(), style: this.styles, onClick: this.handleClick }, index.h("div", { key: 'aed0ec8155b2a5c0e3000b416afd6c5455c55f0e', class: "info" }, index.h("div", { key: 'd90166401c6946c508d2cace62976c2e7374689f', class: "label-wrapper" }, index.h("cura-label", { key: '7c0c5cc650db37f09127050333f49c5f4b4c7dc6', class: "label", weight: 'bold', size: this.size === 'large' ? 'medium' : 'xsmall', color: this.assignColor('label') }, this.label), this.required && index.h("cura-paragraph", { key: '3c1cd2dcad221f4d93bde959ca33273270f0fe45', lineHeight: '0%', marginBlock: '0', color: "error-base" }, "* ")), index.h("cura-label", { key: '3fd01d993596f36da00b3acfeef02f2a28340eae', color: this.assignColor('message'), size: "xsmall", class: "message" }, index.h("slot", { key: '2c106bd163a1b330a18061c0e99eb21c911d7da9' }))), index.h("div", { key: '2286927b31856a224049693295caa9e037695749', class: 'checkbox', tabIndex: this.ontabindex }, index.h("input", { key: '9bb8a436f1500d046a9b57972307cf5feff183d3', type: "checkbox", name: this.name, value: this.value, disabled: this.disabled, required: this.required, checked: this.checked, indeterminate: this.indeterminate }), this.getIcon()))));
|
|
168
168
|
}
|
|
169
169
|
static get formAssociated() { return true; }
|
|
170
170
|
get host() { return index.getElement(this); }
|
|
@@ -69,7 +69,7 @@ const CuraDisplay = class {
|
|
|
69
69
|
return tags[`${this.level}`] || tags['default'];
|
|
70
70
|
}
|
|
71
71
|
render() {
|
|
72
|
-
return (index.h(index.Host, { key: '
|
|
72
|
+
return (index.h(index.Host, { key: 'bf5c1121ffd1debb9b5763acdde1c7244b4afcc3', style: this.hostCSSProperties() }, this.getHeadingTag()));
|
|
73
73
|
}
|
|
74
74
|
get host() { return index.getElement(this); }
|
|
75
75
|
static get watchers() { return {
|
|
@@ -12,7 +12,7 @@ const CuraDropdownSearchOptionTitle = class {
|
|
|
12
12
|
index.registerInstance(this, hostRef);
|
|
13
13
|
}
|
|
14
14
|
render() {
|
|
15
|
-
return (index.h(index.Host, { key: '
|
|
15
|
+
return (index.h(index.Host, { key: 'e4929a8c5c1c1f11b3e51dc088b2dd506e1bdfa0', slot: "dropdown-search-option" }, index.h("cura-label", { key: '5bb5406c11a39a6a587737cf99eb1d2deb2ea0da', color: "neutral-dark", size: "xsmall", lineHeight: "16px", marginBlock: "0" }, index.h("slot", { key: 'c781e560b512d5362370e9855551b3e088ffbec1' }))));
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
18
|
CuraDropdownSearchOptionTitle.style = CuraDropdownSearchOptionTitleStyle0;
|
|
@@ -46,12 +46,12 @@ const CuraDropdownSearchOption = class {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
render() {
|
|
49
|
-
return (index.h(index.Host, { key: '
|
|
49
|
+
return (index.h(index.Host, { key: 'a084adaf6f89be71c8d5dc141705e7a71af353bb', slot: "dropdown-search-option" }, index.h("div", { key: '58ac361d8f16fdab8ef07d3be3f9c12a8c4b85ef', style: this.styles, class: {
|
|
50
50
|
"option-container": true,
|
|
51
51
|
hovered: this.selectable ? this.hovered : false,
|
|
52
52
|
selected: this.selected,
|
|
53
53
|
disabled: !this.selectable
|
|
54
|
-
} }, index.h("div", { key: '
|
|
54
|
+
} }, index.h("div", { key: '0a7f959582b45df5c30fbbd225fccfc93aa937f4', class: "content-container" }, index.h("div", { key: '74b8a9626430847bf9dfb32d5188303427d2fd28', class: "option-info", onClick: (e) => this.handleOptionClick(e) }, index.h("slot", { key: '1dba6e28939841569f290c9fb18d3b7595bac06a', name: "image" }), index.h("cura-heading", { key: 'f7722edfd7ab87f7d9bacf475d988a1e80af41ef', size: "xsmall", lineHeight: "16px", marginBlock: "0px", weight: "bold", color: "neutral-black" }, index.h("slot", { key: 'db0385e5e3d2c450ba9a96d75e7913d2fe913d98' }))), index.h("slot", { key: '734b467cfce5ce114b06a10e3a153723da7ad41d', name: "action" })))));
|
|
55
55
|
}
|
|
56
56
|
get hostElement() { return index.getElement(this); }
|
|
57
57
|
static get watchers() { return {
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-e6d728ec.js');
|
|
6
6
|
|
|
7
|
-
const curaDropdownSearchCss = ":host{display:block;width:100%;box-sizing:border-box}.dropdown{display:flex;position:relative;flex-direction:column;width:inherit}.dropdown .dropdown-search-list{z-index:1000}.dropdown-input-search{width:100%;display:flex;justify-content:center;align-items:center;background:transparent}.dropdown-input-search.dropdown-open ::part(cura-input-field){border-radius:4px 4px 0px 0px}.dropdown-input-search.dropdown-open ::slotted([slot=helperText]){display:none}.dropdown-input-search.dropdown-open cura-input-text ::slotted([slot=helperText]){display:none}.dropdown-search-list{position:absolute;top:calc(100% - 8px);width:100%;max-height:var(--dropdown-max-height);padding:12px 12px;margin:0;box-sizing:border-box;box-shadow:0px 4px 8px 0px var(--neutral-black-shadow, rgba(38, 38, 38, 0.16));border-radius:0px 0px 4px 4px;border-top:0 var(--neutral-light);border-right:2px solid var(--neutral-light);border-bottom:2px solid var(--neutral-light);border-left:2px solid var(--neutral-light);background-color:var(--neutral-purewhite);list-style:none;overflow-y:auto;display:none}.dropdown-search-list.visible{display:block}.dropdown-search-list-input-search{width:inherit;display:flex;justify-content:center;align-items:center;padding:16px 8px;border-bottom:2px solid var(--info-base);background-color:var(--neutral-purewhite)}.dropdown-search-list-input-search cura-input-text{width:inherit}.dropdown-search-list-input-search.error{background-color:var(--error-lighter);border-bottom:2px solid var(--error-dark)}.dropdown-mobile{position:fixed;top:1%;left:0;right:0;width:100%;z-index:10000}.dropdown-mobile .dropdown-input-search{display:flex;gap:4px;padding:12px 8px;background-color:var(--neutral-purewhite);border-bottom:2px solid var(--info-base);z-index:10000}.dropdown-mobile .dropdown-input-search cura-button-transparent{display:flex}.dropdown-mobile .dropdown-input-search.error{background-color:var(--error-lighter);border-bottom:2px solid var(--error-dark)}.dropdown-mobile .dropdown-input-search.dropdown-open{display:flex}.dropdown-mobile .dropdown-input-search.dropdown-open ::slotted([slot=helperText]){display:block}.dropdown-mobile .dropdown-search-list{position:static;width:100%;height:
|
|
7
|
+
const curaDropdownSearchCss = ":host{display:block;width:100%;box-sizing:border-box}.dropdown{display:flex;position:relative;flex-direction:column;width:inherit}.dropdown .dropdown-search-list{z-index:1000}.dropdown-input-search{width:100%;display:flex;justify-content:center;align-items:center;background:transparent}.dropdown-input-search.dropdown-open ::part(cura-input-field){border-radius:4px 4px 0px 0px}.dropdown-input-search.dropdown-open ::slotted([slot=helperText]){display:none}.dropdown-input-search.dropdown-open cura-input-text ::slotted([slot=helperText]){display:none}.dropdown-search-list{position:absolute;top:calc(100% - 8px);width:100%;max-height:var(--dropdown-max-height);padding:12px 12px;margin:0;box-sizing:border-box;box-shadow:0px 4px 8px 0px var(--neutral-black-shadow, rgba(38, 38, 38, 0.16));border-radius:0px 0px 4px 4px;border-top:0 var(--neutral-light);border-right:2px solid var(--neutral-light);border-bottom:2px solid var(--neutral-light);border-left:2px solid var(--neutral-light);background-color:var(--neutral-purewhite);list-style:none;overflow-y:auto;display:none}.dropdown-search-list.visible{display:block}.dropdown-search-list-input-search{width:inherit;display:flex;justify-content:center;align-items:center;padding:16px 8px;border-bottom:2px solid var(--info-base);background-color:var(--neutral-purewhite)}.dropdown-search-list-input-search cura-input-text{width:inherit}.dropdown-search-list-input-search.error{background-color:var(--error-lighter);border-bottom:2px solid var(--error-dark)}.dropdown-mobile{position:fixed;top:1%;left:0;right:0;width:100%;z-index:10000}.dropdown-mobile .dropdown-input-search{display:flex;gap:4px;padding:12px 8px;background-color:var(--neutral-purewhite);border-bottom:2px solid var(--info-base);z-index:10000}.dropdown-mobile .dropdown-input-search cura-button-transparent{display:flex}.dropdown-mobile .dropdown-input-search.error{background-color:var(--error-lighter);border-bottom:2px solid var(--error-dark)}.dropdown-mobile .dropdown-input-search.dropdown-open{display:flex}.dropdown-mobile .dropdown-input-search.dropdown-open ::slotted([slot=helperText]){display:block}.dropdown-mobile .dropdown-search-list{position:static;width:100%;height:calc(100vh - var(--dynamic-input-search-height, 0));max-height:none;padding:12px 12px;margin:0;box-sizing:border-box;box-shadow:none;border:none;background-color:var(--neutral-purewhite);list-style:none;overflow-y:auto;z-index:10000}";
|
|
8
8
|
const CuraDropdownSearchStyle0 = curaDropdownSearchCss;
|
|
9
9
|
|
|
10
10
|
const CuraDropdownSearch = class {
|
|
@@ -18,18 +18,20 @@ const CuraDropdownSearch = class {
|
|
|
18
18
|
var _a;
|
|
19
19
|
const isKeyboardOpen = window.innerHeight < window.screen.height * 0.8;
|
|
20
20
|
const dropdown = (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.dropdown-mobile');
|
|
21
|
-
if (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
if (dropdown) {
|
|
22
|
+
if (isKeyboardOpen) {
|
|
23
|
+
dropdown.style.position = 'absolute';
|
|
24
|
+
dropdown.style.bottom = `${window.screen.height - window.innerHeight}px`;
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
dropdown.style.position = 'fixed';
|
|
28
|
+
dropdown.style.bottom = '0';
|
|
29
|
+
}
|
|
28
30
|
}
|
|
29
31
|
window.scroll({
|
|
30
32
|
top: 0,
|
|
31
33
|
left: 0,
|
|
32
|
-
behavior:
|
|
34
|
+
behavior: 'smooth',
|
|
33
35
|
});
|
|
34
36
|
});
|
|
35
37
|
};
|
|
@@ -117,6 +119,7 @@ const CuraDropdownSearch = class {
|
|
|
117
119
|
componentDidRender() {
|
|
118
120
|
if (this.isDropdownOpen && this.isMobile) {
|
|
119
121
|
this.showOverlay();
|
|
122
|
+
this.getDropdownSearchListHeight();
|
|
120
123
|
}
|
|
121
124
|
else {
|
|
122
125
|
this.removeOverlay();
|
|
@@ -236,11 +239,18 @@ const CuraDropdownSearch = class {
|
|
|
236
239
|
handleOnFocus() {
|
|
237
240
|
this.isDropdownOpen = true;
|
|
238
241
|
}
|
|
242
|
+
getDropdownSearchListHeight() {
|
|
243
|
+
var _a;
|
|
244
|
+
const dropdownInputSearchElement = (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.dropdown-input-search');
|
|
245
|
+
if (dropdownInputSearchElement) {
|
|
246
|
+
this.host.style.setProperty('--dynamic-input-search-height', `${dropdownInputSearchElement.offsetHeight}px`);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
239
249
|
render() {
|
|
240
250
|
const isMobileDropdown = this.isMobile && this.isDropdownOpen;
|
|
241
|
-
return (index.h(index.Host, { key: '
|
|
251
|
+
return (index.h(index.Host, { key: '36a0df3dfbe9f164ccb41541fb5373b0e94c86bd', style: this.hostCSSProperties(), class: "dropdown-overlay" }, index.h("div", { key: 'e17cf1eec89b0346f49f497ffc6e5ea272fcd3eb', class: `dropdown ${isMobileDropdown ? 'dropdown-mobile' : ''}`, style: this.styles }, index.h("div", { key: 'eb33cc0c6abd4792cb18a4e55eaed913e4f75761', class: this.getClasses() }, this.isMobile && this.isDropdownOpen && (index.h("cura-button-transparent", { key: 'd837a3a15a89a9bd14260a32e3e218a3f53a18b1', fontColor: "dark", onClick: () => (this.isMobile = false), iconName: "arrowLeft", size: "medium", iconOnly: true, color: "primary" })), index.h("cura-input-text", { key: 'c8a02959ee1d637fde64fbcd8be238b7562f0790', disabled: this.disabled, label: this.label, part: "cura-input-field", mode: isMobileDropdown ? 'transparent' : 'default', required: this.required, hideErrorIcon: this.status === 'error', iconName: this.iconName || 'search', value: this.value, status: this.status, onValueChange: e => this.onValueChange(e.target.value), onInput: e => this.handleInputChange(e), onFocus: () => this.handleOnFocus(), onClick: () => (window.innerWidth < 768 ? (this.isMobile = true) : null), onBlur: () => {
|
|
242
252
|
this.handleOnBlur();
|
|
243
|
-
}, placeholder: this.placeholder, size: this.size, onKeyDown: this.handleKeyDown }, index.h("slot", { key: '
|
|
253
|
+
}, placeholder: this.placeholder, size: this.size, onKeyDown: this.handleKeyDown }, index.h("slot", { key: '9cc22d4cf269fee171456169b787be54a814189e', name: "helperText" }))), index.h("div", { key: '4a9ce1710312984d2af67ac3a04df504183caaf6', id: "dropdown-search-list", class: this.getDropdownClasses() }, index.h("slot", { key: 'afdeb4b938c3d6767e440f4b32316c45b2a5e86f', name: "dropdown-search-option", onSlotchange: this.handleSlotChange })))));
|
|
244
254
|
}
|
|
245
255
|
get host() { return index.getElement(this); }
|
|
246
256
|
static get watchers() { return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"cura-dropdown-search.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,qBAAqB,GAAG,s1EAAs1E,CAAC;AACr3E,iCAAe,qBAAqB;;MCMvB,kBAAkB;;;;;QAmHrB,mBAAc,GAA0B,IAAI,CAAC;QAK7C,wBAAm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IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,EACvC,OAAO,EAAE,MAAM,IAAI,CAAC,aAAa,EAAE,EACnC,OAAO,EAAE,OAAO,MAAM,CAAC,UAAU,GAAG,GAAG,IAAI,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,IAAI,CAAC,EACxE,MAAM,EAAE;gBACN,IAAI,CAAC,YAAY,EAAE,CAAC;aACrB,EACD,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,SAAS,EAAE,IAAI,CAAC,aAAa,IAE7BA,mEAAM,IAAI,EAAC,YAAY,GAAQ,CACf,CACd,EACNA,kEAAK,EAAE,EAAC,sBAAsB,EAAC,KAAK,EAAE,IAAI,CAAC,kBAAkB,EAAE,IAC7DA,mEAAM,IAAI,EAAC,wBAAwB,EAAC,YAAY,EAAE,IAAI,CAAC,gBAAgB,GAAS,CAC5E,CACF,CACD,EACP;KACH;;;;;;;;;;","names":["h","Host"],"sources":["src/components/forms/cura-dropdown-search/cura-dropdown-search.scss?tag=cura-dropdown-search&encapsulation=shadow","src/components/forms/cura-dropdown-search/cura-dropdown-search.tsx"],"sourcesContent":["@import '../../../scss/mixins/shadows.scss';\n\n:host {\n display: block;\n width: 100%;\n box-sizing: border-box;\n}\n\n.dropdown {\n display: flex;\n position: relative;\n\n flex-direction: column;\n width: inherit;\n\n .dropdown-search-list {\n z-index: 1000;\n }\n\n &-input-search {\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n background: transparent;\n\n\n &.dropdown-open {\n ::part(cura-input-field) {\n border-radius: 4px 4px 0px 0px;\n }\n ::slotted([slot='helperText']) {\n display: none;\n }\n\n cura-input-text {\n ::slotted([slot='helperText']) {\n display: none;\n }\n }\n }\n }\n\n &-search-list {\n position: absolute;\n top: calc(100% - 8px);\n width: 100%;\n max-height: var(--dropdown-max-height);\n padding: 12px 12px;\n margin: 0;\n box-sizing: border-box;\n @include shadow-level3(--neutral-black-shadow);\n border-radius: 0px 0px 4px 4px;\n border-top: 0 var(--neutral-light);\n border-right: 2px solid var(--neutral-light);\n border-bottom: 2px solid var(--neutral-light);\n border-left: 2px solid var(--neutral-light);\n background-color: var(--neutral-purewhite);\n list-style: none;\n overflow-y: auto;\n display: none;\n\n &.visible {\n display: block;\n }\n\n &-input-search {\n width: inherit;\n\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 16px 8px;\n border-bottom: 2px solid var(--info-base);\n background-color: var(--neutral-purewhite);\n\n cura-input-text {\n width: inherit;\n }\n\n &.error {\n background-color: var(--error-lighter);\n border-bottom: 2px solid var(--error-dark);\n }\n }\n }\n\n &-mobile {\n position: fixed;\n top: 1%;\n left: 0;\n right: 0;\n width: 100%;\n\n z-index: 10000;\n .dropdown-input-search {\n display: flex;\n gap: 4px;\n padding: 12px 8px;\n background-color: var(--neutral-purewhite);\n border-bottom: 2px solid var(--info-base);\n z-index: 10000;\n cura-button-transparent {\n display: flex;\n }\n &.error {\n background-color: var(--error-lighter);\n border-bottom: 2px solid var(--error-dark);\n }\n &.dropdown-open {\n display: flex;\n\n ::slotted([slot='helperText']) {\n display: block;\n }\n }\n }\n .dropdown-search-list {\n position: static;\n width: 100%;\n height: 100%;\n max-height: none;\n padding: 12px 12px;\n margin: 0;\n box-sizing: border-box;\n box-shadow: none;\n border: none;\n background-color: var(--neutral-purewhite);\n list-style: none;\n overflow-y: auto;\n z-index: 10000;\n }\n }\n}\n","import { Component, Host, Prop, State, Event, EventEmitter, Element, Watch, h } from '@stencil/core';\n\n@Component({\n tag: 'cura-dropdown-search',\n styleUrl: 'cura-dropdown-search.scss',\n shadow: true,\n})\nexport class CuraDropdownSearch {\n /**\n * Size of the dropdown search mode default: 'small', 'medium', or 'large' (default: 'large')\n */\n @Prop({ reflect: true, mutable: true }) size: 'small' | 'medium' | 'large' = 'large';\n\n /**\n * Define the status of the dropdown search.\n */\n @Prop({ reflect: true }) status: 'error' | 'default' = 'default';\n\n /**\n * Whether the select component is disabled.\n * Reflects as an attribute in the DOM.\n */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /**\n * The name of the dropdown search component.\n */\n @Prop({ reflect: true }) name: string;\n\n /**\n * Indicates if the dropdown search is required.\n */\n @Prop({ reflect: true, mutable: true }) required: boolean = false;\n\n /**\n * Indicates if the dropdown search is selected.\n */\n @Prop({ reflect: true, mutable: true }) selected: boolean = false;\n\n /**\n * The value of the dropdown search.\n */\n @Prop({ reflect: true, mutable: true }) value: string = '';\n\n /**\n * The placeholder text for the dropdown search.\n */\n @Prop({ reflect: true, mutable: true }) placeholder: string = '';\n\n /**\n * The label for the dropdown search.\n */\n @Prop({ reflect: true, mutable: true }) label: string = '';\n\n /**\n * Custom icon name. Default: search.\n */\n @Prop({ reflect: true }) iconName = 'search';\n\n /**\n * CSS max-height property for dropdown item.\n * Default to 630px\n */\n @Prop({ reflect: true }) dropdownMaxHeight = '630px';\n\n /**\n * Reference to the host element.\n */\n @Element() host: HTMLElement;\n\n /**\n * Indicates if the overlay is visible.\n */\n @State() overlayVisible: boolean = false;\n\n /**\n * Event emitted when the value changes.\n */\n @Event() valueChanged: EventEmitter<string>;\n\n /**\n * Indicates if the dropdown is open.\n */\n @State() isDropdownOpen: boolean = false;\n\n /**\n * Styles for the component.\n\n */\n @State() styles = {};\n\n /**\n * Indicates if the component is being viewed on a mobile device.\n */\n @State() isMobile: boolean = window.innerWidth < 768;\n\n /**\n * The mode of the dropdown search.\n */\n @State() mode: 'default' | 'transparent' = 'default';\n\n @Event() onselect: EventEmitter;\n\n @State() inputTextRef!: HTMLCuraInputTextElement;\n\n /**\n * Indicates if the input is on blur.\n */\n @State() isOnBlurInput: boolean = true;\n\n /**\n * The index of the currently hovered option.\n */\n @State() hoveredIndex: number = -1;\n\n /**\n * The options for the dropdown search.\n * @type {HTMLCuraDropdownSearchOptionElement[]}\n */\n\n weights;\n\n private overlayElement: HTMLDivElement | null = null;\n\n @State() options: HTMLCuraDropdownSearchOptionElement[] = [];\n\n\n private adjustInputPosition = () => {\n window.visualViewport.addEventListener('resize', () => {\n\n const isKeyboardOpen = window.innerHeight < window.screen.height * 0.8;\n const dropdown = this.host.shadowRoot?.querySelector('.dropdown-mobile') as HTMLInputElement;\n\n if (isKeyboardOpen) {\n dropdown.style.position = 'absolute';\n dropdown.style.bottom = `${window.screen.height - window.innerHeight}px`;\n } else {\n dropdown.style.position = 'fixed';\n dropdown.style.bottom = '0';\n }\n\n window.scroll({\n top: 0,\n left: 0,\n behavior: \"smooth\",\n });\n });\n };\n\n\n connectedCallback() {\n this.weights = window.CuraAPI.theme.fonts.getWeights();\n this.styles['--info-base'] = window.CuraAPI.theme.colors.getColor('info-base');\n this.styles['--neutral-purewhite'] = window.CuraAPI.theme.colors.getColor('neutral-purewhite');\n this.styles['--neutral-light'] = window.CuraAPI.theme.colors.getColor('neutral-light');\n this.styles['--neutral-dark'] = window.CuraAPI.theme.colors.getColor('neutral-dark');\n this.styles['--neutral-black-shadow'] = window.CuraAPI.theme.colors.getColor(`neutral-black`, 0.16);\n this.styles['--error-dark'] = window.CuraAPI.theme.colors.getColor('error-dark');\n this.styles['--error-lighter'] = window.CuraAPI.theme.colors.getColor('error-lighter');\n this.styles['--breakpoints'] = window.CuraAPI.theme.breakpoints.get();\n this.styles['--font-size'] = window.CuraAPI.theme.fonts.getSize();\n this.styles['--font-family'] = window.CuraAPI.theme.fonts.getFamily();\n this.styles['--font-weight-medium'] = this.weights.medium;\n\n\n }\n\n @Watch('value')\n onValueChange(newValue: string) {\n this.updateSelectedOption(newValue);\n this.valueChanged.emit(newValue);\n }\n\n componentWillLoad() {\n this.updateSelectedOption(this.value);\n }\n\n componentDidRender() {\n if (this.isDropdownOpen && this.isMobile) {\n this.showOverlay();\n } else {\n this.removeOverlay();\n }\n }\n componentDidLoad() {\n window.addEventListener('resize', this.handleResize);\n window.addEventListener('resize', this.adjustInputPosition);\n }\n\n disconnectedCallback() {\n window.removeEventListener('resize', this.handleResize);\n window.removeEventListener('resize', this.adjustInputPosition);\n\n }\n\n private showOverlay() {\n if (!this.overlayElement) {\n this.overlayElement = document.createElement('div');\n this.overlayElement.className = 'dropdown-overlay';\n this.overlayElement.style.position = 'fixed';\n this.overlayElement.style.top = '0';\n this.overlayElement.style.left = '0';\n this.overlayElement.style.width = '100%';\n this.overlayElement.style.height = '100%';\n this.overlayElement.style.zIndex = '9999';\n this.overlayElement.style.backgroundColor = 'white';\n document.body.appendChild(this.overlayElement);\n }\n }\n\n private removeOverlay() {\n if (this.overlayElement && this.overlayElement.parentNode === document.body) {\n document.body.removeChild(this.overlayElement);\n this.overlayElement = null;\n }\n }\n\n private handleSlotChange = () => {\n this.options = Array.from(this.host.querySelectorAll('cura-dropdown-search-option'));\n this.addClickListenersToOptions();\n this.updateHoveredIndex();\n };\n\n private addClickListenersToOptions() {\n this.options.forEach((option, index) => {\n option.addEventListener('optionSelected', () => this.onSelectedOption(index));\n });\n }\n\n private updateSelectedOption(value: string) {\n const selectedOptionIndex = this.options.findIndex(option => option.getAttribute('value') === value);\n this.hoveredIndex = selectedOptionIndex;\n this.updateOptionAttribute('hovered', this.hoveredIndex);\n this.updateOptionAttribute('selected', this.hoveredIndex);\n\n this.scrollIntoView();\n this.adjustInputPosition();\n\n }\n\n private handleInputChange = (event: Event) => {\n const input = event.target as HTMLInputElement;\n this.value = input.value;\n this.onValueChange(this.value);\n // this.valueChanged.emit(this.value);\n };\n\n private onSelectedOption(index: number) {\n const selectedOption = this.options[index];\n if (selectedOption.selectable) {\n const selectedValue = selectedOption.getAttribute('value') || selectedOption.textContent;\n\n this.value = selectedValue || '';\n this.updateSelectedOption(this.value);\n\n this.isDropdownOpen = false;\n this.isOnBlurInput = true;\n this.removeOverlay();\n }\n }\n\n private handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'ArrowDown') {\n event.preventDefault();\n this.moveHighlight(1);\n } else if (event.key === 'ArrowUp') {\n event.preventDefault();\n this.moveHighlight(-1);\n } else if (event.key === 'Enter') {\n event.preventDefault();\n if (this.hoveredIndex > -1) {\n this.handleOnBlur();\n this.onSelectedOption(this.hoveredIndex);\n }\n }\n };\n\n private moveHighlight(direction: number) {\n const visibleOptions = this.options;\n const newIndex = (this.hoveredIndex + direction + visibleOptions.length) % visibleOptions.length;\n this.hoveredIndex = newIndex;\n this.updateOptionAttribute('hovered', this.hoveredIndex);\n this.scrollIntoView();\n }\n\n private updateOptionAttribute(attribute: string, indexToUpdate: number) {\n this.options.forEach((option, index) => {\n (option as any)[attribute] = index === indexToUpdate;\n });\n }\n\n private updateHoveredIndex() {\n const visibleOptions = this.options;\n const currentValue = this.value;\n this.hoveredIndex = visibleOptions.findIndex(option => option.getAttribute('value') === currentValue);\n }\n\n private scrollIntoView() {\n const container = this.host.shadowRoot?.querySelector('.dropdown-search-list');\n const hoveredOption = this.options[this.hoveredIndex];\n\n if (container && hoveredOption) {\n const optionRect = hoveredOption.getBoundingClientRect();\n const containerRect = container.getBoundingClientRect();\n\n if (optionRect.bottom > containerRect.bottom) {\n container.scrollTop += optionRect.bottom - containerRect.bottom;\n }\n\n if (optionRect.top < containerRect.top) {\n container.scrollTop -= containerRect.top - optionRect.top;\n }\n }\n }\n\n private handleResize = () => {\n this.isMobile = window.innerWidth < 768;\n if (this.isDropdownOpen) {\n if (this.isMobile) {\n this.showOverlay();\n } else {\n this.removeOverlay();\n }\n }\n };\n\n handleOnBlur() {\n if (this.isOnBlurInput === true) {\n setTimeout(() => {\n this.isDropdownOpen = false;\n this.removeOverlay();\n }, 200);\n }\n }\n getClasses() {\n return {\n 'dropdown-input-search': true,\n 'dropdown-open': this.isDropdownOpen,\n 'disabled': this.disabled,\n [this.status]: true,\n };\n }\n\n getDropdownClasses() {\n return {\n 'dropdown-search-list': true,\n 'visible': this.options.length && this.isDropdownOpen ? true : false,\n };\n }\n\n hostCSSProperties() {\n return {\n '--dropdown-max-height': this.dropdownMaxHeight,\n };\n }\n\n handleOnFocus() {\n this.isDropdownOpen = true;\n }\n\n\n render() {\n const isMobileDropdown = this.isMobile && this.isDropdownOpen;\n return (\n <Host style={this.hostCSSProperties()} class=\"dropdown-overlay\">\n <div class={`dropdown ${isMobileDropdown ? 'dropdown-mobile' : ''}`} style={this.styles}>\n <div class={this.getClasses()}>\n {this.isMobile && this.isDropdownOpen && (\n <cura-button-transparent\n fontColor=\"dark\"\n onClick={() => (this.isMobile = false)}\n iconName=\"arrowLeft\"\n size=\"medium\"\n iconOnly\n color=\"primary\"\n ></cura-button-transparent>\n )}\n <cura-input-text\n disabled={this.disabled}\n label={this.label}\n part=\"cura-input-field\"\n mode={isMobileDropdown ? 'transparent' : 'default'}\n required={this.required}\n hideErrorIcon={this.status === 'error'}\n iconName={this.iconName || 'search'}\n value={this.value}\n status={this.status}\n onValueChange={e => this.onValueChange(e.target.value as string)}\n onInput={e => this.handleInputChange(e)}\n onFocus={() => this.handleOnFocus()}\n onClick={() => (window.innerWidth < 768 ? (this.isMobile = true) : null)}\n onBlur={() => {\n this.handleOnBlur();\n }}\n placeholder={this.placeholder}\n size={this.size}\n onKeyDown={this.handleKeyDown}\n >\n <slot name=\"helperText\"></slot>\n </cura-input-text>\n </div>\n <div id=\"dropdown-search-list\" class={this.getDropdownClasses()}>\n <slot name=\"dropdown-search-option\" onSlotchange={this.handleSlotChange}></slot>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"cura-dropdown-search.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,qBAAqB,GAAG,q4EAAq4E,CAAC;AACp6E,iCAAe,qBAAqB;;MCMvB,kBAAkB;;;;;QAmHrB,mBAAc,GAA0B,IAAI,CAAC;QAI7C,wBAAmB,GAAG;YAC5B,MAAM,CAAC,cAAc,CAAC,gBAAgB,CAAC,QAAQ,EAAE;;gBAC/C,MAAM,cAAc,GAAG,MAAM,CAAC,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC;gBACvE,MAAM,QAAQ,GAAG,MAAA,IAAI,CAAC,IA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AM,EACnB,aAAa,EAAE,CAAC,IAAI,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,KAAe,CAAC,EAChE,OAAO,EAAE,CAAC,IAAI,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,EACvC,OAAO,EAAE,MAAM,IAAI,CAAC,aAAa,EAAE,EACnC,OAAO,EAAE,OAAO,MAAM,CAAC,UAAU,GAAG,GAAG,IAAI,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,IAAI,CAAC,EACxE,MAAM,EAAE;gBACN,IAAI,CAAC,YAAY,EAAE,CAAC;aACrB,EACD,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,SAAS,EAAE,IAAI,CAAC,aAAa,IAE7BA,mEAAM,IAAI,EAAC,YAAY,GAAQ,CACf,CACd,EACNA,kEAAK,EAAE,EAAC,sBAAsB,EAAC,KAAK,EAAE,IAAI,CAAC,kBAAkB,EAAE,IAC7DA,mEAAM,IAAI,EAAC,wBAAwB,EAAC,YAAY,EAAE,IAAI,CAAC,gBAAgB,GAAS,CAC5E,CACF,CACD,EACP;KACH;;;;;;;;;;","names":["h","Host"],"sources":["src/components/forms/cura-dropdown-search/cura-dropdown-search.scss?tag=cura-dropdown-search&encapsulation=shadow","src/components/forms/cura-dropdown-search/cura-dropdown-search.tsx"],"sourcesContent":["@import '../../../scss/mixins/shadows.scss';\n\n:host {\n display: block;\n width: 100%;\n box-sizing: border-box;\n}\n\n.dropdown {\n display: flex;\n position: relative;\n\n flex-direction: column;\n width: inherit;\n\n .dropdown-search-list {\n z-index: 1000;\n }\n\n &-input-search {\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n background: transparent;\n\n\n &.dropdown-open {\n ::part(cura-input-field) {\n border-radius: 4px 4px 0px 0px;\n }\n ::slotted([slot='helperText']) {\n display: none;\n }\n\n cura-input-text {\n ::slotted([slot='helperText']) {\n display: none;\n }\n }\n }\n }\n\n &-search-list {\n position: absolute;\n top: calc(100% - 8px);\n width: 100%;\n max-height: var(--dropdown-max-height);\n padding: 12px 12px;\n margin: 0;\n box-sizing: border-box;\n @include shadow-level3(--neutral-black-shadow);\n border-radius: 0px 0px 4px 4px;\n border-top: 0 var(--neutral-light);\n border-right: 2px solid var(--neutral-light);\n border-bottom: 2px solid var(--neutral-light);\n border-left: 2px solid var(--neutral-light);\n background-color: var(--neutral-purewhite);\n list-style: none;\n overflow-y: auto;\n display: none;\n\n &.visible {\n display: block;\n }\n\n &-input-search {\n width: inherit;\n\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 16px 8px;\n border-bottom: 2px solid var(--info-base);\n background-color: var(--neutral-purewhite);\n\n cura-input-text {\n width: inherit;\n }\n\n &.error {\n background-color: var(--error-lighter);\n border-bottom: 2px solid var(--error-dark);\n }\n }\n }\n\n &-mobile {\n position: fixed;\n top: 1%;\n left: 0;\n right: 0;\n width: 100%;\n\n z-index: 10000;\n .dropdown-input-search {\n display: flex;\n gap: 4px;\n padding: 12px 8px;\n background-color: var(--neutral-purewhite);\n border-bottom: 2px solid var(--info-base);\n z-index: 10000;\n cura-button-transparent {\n display: flex;\n }\n &.error {\n background-color: var(--error-lighter);\n border-bottom: 2px solid var(--error-dark);\n }\n &.dropdown-open {\n display: flex;\n\n ::slotted([slot='helperText']) {\n display: block;\n }\n }\n }\n .dropdown-search-list {\n position: static;\n width: 100%;\n height: calc(100vh - var(--dynamic-input-search-height, 0));\n max-height: none;\n padding: 12px 12px;\n margin: 0;\n box-sizing: border-box;\n box-shadow: none;\n border: none;\n background-color: var(--neutral-purewhite);\n list-style: none;\n overflow-y: auto;\n z-index: 10000;\n }\n }\n}\n","import { Component, Host, Prop, State, Event, EventEmitter, Element, Watch, h } from '@stencil/core';\n\n@Component({\n tag: 'cura-dropdown-search',\n styleUrl: 'cura-dropdown-search.scss',\n shadow: true,\n})\nexport class CuraDropdownSearch {\n /**\n * Size of the dropdown search mode default: 'small', 'medium', or 'large' (default: 'large')\n */\n @Prop({ reflect: true, mutable: true }) size: 'small' | 'medium' | 'large' = 'large';\n\n /**\n * Define the status of the dropdown search.\n */\n @Prop({ reflect: true }) status: 'error' | 'default' = 'default';\n\n /**\n * Whether the select component is disabled.\n * Reflects as an attribute in the DOM.\n */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /**\n * The name of the dropdown search component.\n */\n @Prop({ reflect: true }) name: string;\n\n /**\n * Indicates if the dropdown search is required.\n */\n @Prop({ reflect: true, mutable: true }) required: boolean = false;\n\n /**\n * Indicates if the dropdown search is selected.\n */\n @Prop({ reflect: true, mutable: true }) selected: boolean = false;\n\n /**\n * The value of the dropdown search.\n */\n @Prop({ reflect: true, mutable: true }) value: string = '';\n\n /**\n * The placeholder text for the dropdown search.\n */\n @Prop({ reflect: true, mutable: true }) placeholder: string = '';\n\n /**\n * The label for the dropdown search.\n */\n @Prop({ reflect: true, mutable: true }) label: string = '';\n\n /**\n * Custom icon name. Default: search.\n */\n @Prop({ reflect: true }) iconName = 'search';\n\n /**\n * CSS max-height property for dropdown item.\n * Default to 630px\n */\n @Prop({ reflect: true }) dropdownMaxHeight = '630px';\n\n /**\n * Reference to the host element.\n */\n @Element() host: HTMLElement;\n\n /**\n * Indicates if the overlay is visible.\n */\n @State() overlayVisible: boolean = false;\n\n /**\n * Event emitted when the value changes.\n */\n @Event() valueChanged: EventEmitter<string>;\n\n /**\n * Indicates if the dropdown is open.\n */\n @State() isDropdownOpen: boolean = false;\n\n /**\n * Styles for the component.\n\n */\n @State() styles = {};\n\n /**\n * Indicates if the component is being viewed on a mobile device.\n */\n @State() isMobile: boolean = window.innerWidth < 768;\n\n /**\n * The mode of the dropdown search.\n */\n @State() mode: 'default' | 'transparent' = 'default';\n\n @Event() onselect: EventEmitter;\n\n @State() inputTextRef!: HTMLCuraInputTextElement;\n\n /**\n * Indicates if the input is on blur.\n */\n @State() isOnBlurInput: boolean = true;\n\n /**\n * The index of the currently hovered option.\n */\n @State() hoveredIndex: number = -1;\n\n /**\n * The options for the dropdown search.\n * @type {HTMLCuraDropdownSearchOptionElement[]}\n */\n\n weights;\n\n private overlayElement: HTMLDivElement | null = null;\n\n @State() options: HTMLCuraDropdownSearchOptionElement[] = [];\n\n private adjustInputPosition = () => {\n window.visualViewport.addEventListener('resize', () => {\n const isKeyboardOpen = window.innerHeight < window.screen.height * 0.8;\n const dropdown = this.host.shadowRoot?.querySelector('.dropdown-mobile') as HTMLInputElement;\n\n if (dropdown) {\n if (isKeyboardOpen) {\n dropdown.style.position = 'absolute';\n dropdown.style.bottom = `${window.screen.height - window.innerHeight}px`;\n } else {\n dropdown.style.position = 'fixed';\n dropdown.style.bottom = '0';\n }\n }\n\n window.scroll({\n top: 0,\n left: 0,\n behavior: 'smooth',\n });\n });\n };\n\n connectedCallback() {\n this.weights = window.CuraAPI.theme.fonts.getWeights();\n this.styles['--info-base'] = window.CuraAPI.theme.colors.getColor('info-base');\n this.styles['--neutral-purewhite'] = window.CuraAPI.theme.colors.getColor('neutral-purewhite');\n this.styles['--neutral-light'] = window.CuraAPI.theme.colors.getColor('neutral-light');\n this.styles['--neutral-dark'] = window.CuraAPI.theme.colors.getColor('neutral-dark');\n this.styles['--neutral-black-shadow'] = window.CuraAPI.theme.colors.getColor(`neutral-black`, 0.16);\n this.styles['--error-dark'] = window.CuraAPI.theme.colors.getColor('error-dark');\n this.styles['--error-lighter'] = window.CuraAPI.theme.colors.getColor('error-lighter');\n this.styles['--breakpoints'] = window.CuraAPI.theme.breakpoints.get();\n this.styles['--font-size'] = window.CuraAPI.theme.fonts.getSize();\n this.styles['--font-family'] = window.CuraAPI.theme.fonts.getFamily();\n this.styles['--font-weight-medium'] = this.weights.medium;\n }\n\n @Watch('value')\n onValueChange(newValue: string) {\n this.updateSelectedOption(newValue);\n this.valueChanged.emit(newValue);\n }\n\n componentWillLoad() {\n this.updateSelectedOption(this.value);\n }\n\n componentDidRender() {\n if (this.isDropdownOpen && this.isMobile) {\n this.showOverlay();\n this.getDropdownSearchListHeight();\n } else {\n this.removeOverlay();\n }\n }\n componentDidLoad() {\n window.addEventListener('resize', this.handleResize);\n window.addEventListener('resize', this.adjustInputPosition);\n }\n\n disconnectedCallback() {\n window.removeEventListener('resize', this.handleResize);\n window.removeEventListener('resize', this.adjustInputPosition);\n }\n\n private showOverlay() {\n if (!this.overlayElement) {\n this.overlayElement = document.createElement('div');\n this.overlayElement.className = 'dropdown-overlay';\n this.overlayElement.style.position = 'fixed';\n this.overlayElement.style.top = '0';\n this.overlayElement.style.left = '0';\n this.overlayElement.style.width = '100%';\n this.overlayElement.style.height = '100%';\n this.overlayElement.style.zIndex = '9999';\n this.overlayElement.style.backgroundColor = 'white';\n document.body.appendChild(this.overlayElement);\n }\n }\n\n private removeOverlay() {\n if (this.overlayElement && this.overlayElement.parentNode === document.body) {\n document.body.removeChild(this.overlayElement);\n this.overlayElement = null;\n }\n }\n\n private handleSlotChange = () => {\n this.options = Array.from(this.host.querySelectorAll('cura-dropdown-search-option'));\n this.addClickListenersToOptions();\n this.updateHoveredIndex();\n };\n\n private addClickListenersToOptions() {\n this.options.forEach((option, index) => {\n option.addEventListener('optionSelected', () => this.onSelectedOption(index));\n });\n }\n\n private updateSelectedOption(value: string) {\n const selectedOptionIndex = this.options.findIndex(option => option.getAttribute('value') === value);\n this.hoveredIndex = selectedOptionIndex;\n this.updateOptionAttribute('hovered', this.hoveredIndex);\n this.updateOptionAttribute('selected', this.hoveredIndex);\n\n this.scrollIntoView();\n this.adjustInputPosition();\n }\n\n private handleInputChange = (event: Event) => {\n const input = event.target as HTMLInputElement;\n this.value = input.value;\n this.onValueChange(this.value);\n // this.valueChanged.emit(this.value);\n };\n\n private onSelectedOption(index: number) {\n const selectedOption = this.options[index];\n if (selectedOption.selectable) {\n const selectedValue = selectedOption.getAttribute('value') || selectedOption.textContent;\n\n this.value = selectedValue || '';\n this.updateSelectedOption(this.value);\n\n this.isDropdownOpen = false;\n this.isOnBlurInput = true;\n this.removeOverlay();\n }\n }\n\n private handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'ArrowDown') {\n event.preventDefault();\n this.moveHighlight(1);\n } else if (event.key === 'ArrowUp') {\n event.preventDefault();\n this.moveHighlight(-1);\n } else if (event.key === 'Enter') {\n event.preventDefault();\n if (this.hoveredIndex > -1) {\n this.handleOnBlur();\n this.onSelectedOption(this.hoveredIndex);\n }\n }\n };\n\n private moveHighlight(direction: number) {\n const visibleOptions = this.options;\n const newIndex = (this.hoveredIndex + direction + visibleOptions.length) % visibleOptions.length;\n this.hoveredIndex = newIndex;\n this.updateOptionAttribute('hovered', this.hoveredIndex);\n this.scrollIntoView();\n }\n\n private updateOptionAttribute(attribute: string, indexToUpdate: number) {\n this.options.forEach((option, index) => {\n (option as any)[attribute] = index === indexToUpdate;\n });\n }\n\n private updateHoveredIndex() {\n const visibleOptions = this.options;\n const currentValue = this.value;\n this.hoveredIndex = visibleOptions.findIndex(option => option.getAttribute('value') === currentValue);\n }\n\n private scrollIntoView() {\n const container = this.host.shadowRoot?.querySelector('.dropdown-search-list');\n const hoveredOption = this.options[this.hoveredIndex];\n\n if (container && hoveredOption) {\n const optionRect = hoveredOption.getBoundingClientRect();\n const containerRect = container.getBoundingClientRect();\n\n if (optionRect.bottom > containerRect.bottom) {\n container.scrollTop += optionRect.bottom - containerRect.bottom;\n }\n\n if (optionRect.top < containerRect.top) {\n container.scrollTop -= containerRect.top - optionRect.top;\n }\n }\n }\n\n private handleResize = () => {\n this.isMobile = window.innerWidth < 768;\n if (this.isDropdownOpen) {\n if (this.isMobile) {\n this.showOverlay();\n } else {\n this.removeOverlay();\n }\n }\n };\n\n handleOnBlur() {\n if (this.isOnBlurInput === true) {\n setTimeout(() => {\n this.isDropdownOpen = false;\n this.removeOverlay();\n }, 200);\n }\n }\n getClasses() {\n return {\n 'dropdown-input-search': true,\n 'dropdown-open': this.isDropdownOpen,\n 'disabled': this.disabled,\n [this.status]: true,\n };\n }\n\n getDropdownClasses() {\n return {\n 'dropdown-search-list': true,\n 'visible': this.options.length && this.isDropdownOpen ? true : false,\n };\n }\n\n hostCSSProperties() {\n return {\n '--dropdown-max-height': this.dropdownMaxHeight,\n };\n }\n\n handleOnFocus() {\n this.isDropdownOpen = true;\n }\n\n getDropdownSearchListHeight() {\n const dropdownInputSearchElement = this.host.shadowRoot?.querySelector('.dropdown-input-search') as HTMLInputElement;\n if (dropdownInputSearchElement) {\n this.host.style.setProperty('--dynamic-input-search-height', `${dropdownInputSearchElement.offsetHeight}px`);\n }\n }\n\n render() {\n const isMobileDropdown = this.isMobile && this.isDropdownOpen;\n return (\n <Host style={this.hostCSSProperties()} class=\"dropdown-overlay\">\n <div class={`dropdown ${isMobileDropdown ? 'dropdown-mobile' : ''}`} style={this.styles}>\n <div class={this.getClasses()}>\n {this.isMobile && this.isDropdownOpen && (\n <cura-button-transparent\n fontColor=\"dark\"\n onClick={() => (this.isMobile = false)}\n iconName=\"arrowLeft\"\n size=\"medium\"\n iconOnly\n color=\"primary\"\n ></cura-button-transparent>\n )}\n <cura-input-text\n disabled={this.disabled}\n label={this.label}\n part=\"cura-input-field\"\n mode={isMobileDropdown ? 'transparent' : 'default'}\n required={this.required}\n hideErrorIcon={this.status === 'error'}\n iconName={this.iconName || 'search'}\n value={this.value}\n status={this.status}\n onValueChange={e => this.onValueChange(e.target.value as string)}\n onInput={e => this.handleInputChange(e)}\n onFocus={() => this.handleOnFocus()}\n onClick={() => (window.innerWidth < 768 ? (this.isMobile = true) : null)}\n onBlur={() => {\n this.handleOnBlur();\n }}\n placeholder={this.placeholder}\n size={this.size}\n onKeyDown={this.handleKeyDown}\n >\n <slot name=\"helperText\"></slot>\n </cura-input-text>\n </div>\n <div id=\"dropdown-search-list\" class={this.getDropdownClasses()}>\n <slot name=\"dropdown-search-option\" onSlotchange={this.handleSlotChange}></slot>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -24,9 +24,9 @@ const CuraIconsView = class {
|
|
|
24
24
|
this.sizes.unshift(this.sizes.pop());
|
|
25
25
|
}
|
|
26
26
|
render() {
|
|
27
|
-
return (index.h(index.Host, { key: '
|
|
28
|
-
index.h("div", { class: "size" }, index.h("cura-icon", { name: this.selected, size: size }), index.h("span", null, size)))), index.h("div", { key: '
|
|
29
|
-
index.h("div", { class: "size" }, index.h("cura-icon", { name: this.selected, size: size, color: "neutral-white" }), index.h("span", null, size))))), index.h("div", { key: '
|
|
27
|
+
return (index.h(index.Host, { key: '8852f24d59f30c812ac2e05be38bba10bccb1fd8' }, index.h("div", { key: '6b88398ca80b05a62681d7b6834d5d0f59d790fa', class: "iconDetail" }, index.h("cura-heading", { key: '5b3cab1aa26adc1b1b09dc3f3f5c0bd2ac394f89', size: "small", "margin-block": "0 24px" }, "Icon: ", index.h("b", { key: 'eb974ce78dd33e56cd2c6118c6c399f029660547' }, this.selected)), index.h("div", { key: '46d600bbf0903861f5c982b0e73c4757447d0324', class: "iconSizes" }, this.sizes.map(size => size === 'micro' && !curaIcon_definitions.microIcons.includes(this.selected) ? '' :
|
|
28
|
+
index.h("div", { class: "size" }, index.h("cura-icon", { name: this.selected, size: size }), index.h("span", null, size)))), index.h("div", { key: '973355e41f1a10405c8224461625215aedabe0e3', class: "iconSizes invert" }, this.sizes.map(size => size === 'micro' && !curaIcon_definitions.microIcons.includes(this.selected) ? '' :
|
|
29
|
+
index.h("div", { class: "size" }, index.h("cura-icon", { name: this.selected, size: size, color: "neutral-white" }), index.h("span", null, size))))), index.h("div", { key: 'acd2b60eb99238893fc97aa177e96f43a3c54bd1', class: "icons" }, iconsetdefaulticons.map(icon => index.h("div", { class: { icon: true, selected: icon === this.selected }, onClick: () => this.setSelected(icon) }, index.h("cura-icon", { name: icon, size: "32", color: icon === this.selected ? 'accent-dark' : 'neutral-dark' }), index.h("cura-label", { size: "xsmall", weight: icon === this.selected ? 'bold' : 'regular', color: icon === this.selected ? 'accent-dark' : 'neutral-dark' }, icon), !curaIcon_definitions.microIcons.includes(icon) ? '' :
|
|
30
30
|
index.h("cura-paragraph", { color: 'success-dark', size: "xsmall", "margin-block": "0px", "line-height": '100%' }, "MICRO"))))));
|
|
31
31
|
}
|
|
32
32
|
};
|
|
@@ -5,13 +5,14 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-e6d728ec.js');
|
|
6
6
|
const index$1 = require('./index-6dc29195.js');
|
|
7
7
|
|
|
8
|
-
const curaInputDateCss = ":host{display:block}.container{display:flex;flex-direction:column}.container .calendar{padding:0px calc(var(--base-spacing) * 3px);margin-top:-8px;border-radius:0px 0px 4px 4px;border-top:0px;border-right:2px solid #D4D4D4;border-bottom:2px solid #D4D4D4;border-left:2px solid #D4D4D4;box-shadow:0px 4px 8px 0px var(--neutral-black-shadow, rgba(38, 38, 38, 0.16))}";
|
|
8
|
+
const curaInputDateCss = ":host{display:block}.container{display:flex;flex-direction:column;position:relative}.container .calendar{padding:0px calc(var(--base-spacing) * 3px);margin-top:-8px;border-radius:0px 0px 4px 4px;border-top:0px;border-right:2px solid #D4D4D4;border-bottom:2px solid #D4D4D4;border-left:2px solid #D4D4D4;box-shadow:0px 4px 8px 0px var(--neutral-black-shadow, rgba(38, 38, 38, 0.16));position:absolute;top:100%;z-index:10;display:none;opacity:0;pointer-events:none}.container .calendar.visible{box-sizing:border-box;display:block;opacity:1;pointer-events:auto;width:100%;background-color:#fff}";
|
|
9
9
|
const CuraInputDateStyle0 = curaInputDateCss;
|
|
10
10
|
|
|
11
11
|
const CuraInputDate = class {
|
|
12
12
|
constructor(hostRef) {
|
|
13
13
|
index.registerInstance(this, hostRef);
|
|
14
14
|
this.dateChange = index.createEvent(this, "dateChange", 7);
|
|
15
|
+
this.statusInputChange = index.createEvent(this, "statusInputChange", 7);
|
|
15
16
|
this.label = '';
|
|
16
17
|
this.status = 'default';
|
|
17
18
|
this.size = 'medium';
|
|
@@ -26,17 +27,28 @@ const CuraInputDate = class {
|
|
|
26
27
|
this.isCalendarVisible = false;
|
|
27
28
|
this.dates = [];
|
|
28
29
|
this.value = '';
|
|
30
|
+
this.dateSettings = {
|
|
31
|
+
placeholder: null,
|
|
32
|
+
mask: 'date',
|
|
33
|
+
mode: 'single',
|
|
34
|
+
};
|
|
29
35
|
}
|
|
30
36
|
connectedCallback() {
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
this.styles
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
const { fonts, colors, spacing } = window.CuraAPI.theme;
|
|
38
|
+
const weights = fonts.getWeights();
|
|
39
|
+
this.styles = {
|
|
40
|
+
'--base-spacing': spacing.getSpacing(),
|
|
41
|
+
'--neutral-purewhite': colors.getColor('neutral-purewhite'),
|
|
42
|
+
'--neutral-lighter': colors.getColor('neutral-lighter'),
|
|
43
|
+
'--neutral-base': colors.getColor('neutral-base'),
|
|
44
|
+
'--font-size': fonts.getSize(),
|
|
45
|
+
'--font-color': fonts.getColor(),
|
|
46
|
+
'--font-family': fonts.getFamily(),
|
|
47
|
+
'--font-weight-regular': weights.regular,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
componentWillLoad() {
|
|
51
|
+
this.updateDateSettings();
|
|
40
52
|
}
|
|
41
53
|
/**
|
|
42
54
|
* Callback for form association
|
|
@@ -44,33 +56,21 @@ const CuraInputDate = class {
|
|
|
44
56
|
formAssociatedCallback(form) {
|
|
45
57
|
form.ariaLabel = this.label;
|
|
46
58
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
* either for a date range ('dd/mm/yyyy - dd/mm/yyyy') or a single date ('dd/mm/yyyy')
|
|
52
|
-
*/
|
|
53
|
-
setPlaceholder() {
|
|
54
|
-
if (this.placeholder) {
|
|
55
|
-
return this.placeholder;
|
|
59
|
+
updateDateSettings() {
|
|
60
|
+
const newSettings = this.getDateSettings(this.enableRangeDates);
|
|
61
|
+
if (this.shouldUpdateDateSettings(newSettings)) {
|
|
62
|
+
this.dateSettings = newSettings;
|
|
56
63
|
}
|
|
57
|
-
return this.enableRangeDates ? 'dd/mm/aaaa - dd/mm/aaaa' : 'dd/mm/aaaa';
|
|
58
64
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
return this.enableRangeDates ? 'dateRange' : 'date';
|
|
65
|
+
getDateSettings(isRange) {
|
|
66
|
+
return {
|
|
67
|
+
placeholder: this.placeholder || (isRange ? 'dd/mm/aaaa - dd/mm/aaaa' : 'dd/mm/aaaa'),
|
|
68
|
+
mask: isRange ? 'dateRange' : 'date',
|
|
69
|
+
mode: isRange ? 'range' : 'single',
|
|
70
|
+
};
|
|
66
71
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
*
|
|
70
|
-
* @returns {'range' | 'single'}
|
|
71
|
-
*/
|
|
72
|
-
setMode() {
|
|
73
|
-
return this.enableRangeDates ? 'range' : 'single';
|
|
72
|
+
shouldUpdateDateSettings(newSettings) {
|
|
73
|
+
return this.dateSettings.placeholder !== newSettings.placeholder || this.dateSettings.mask !== newSettings.mask || this.dateSettings.mode !== newSettings.mode;
|
|
74
74
|
}
|
|
75
75
|
handleClick(ev) {
|
|
76
76
|
if (this.el.contains(ev.target)) {
|
|
@@ -99,8 +99,7 @@ const CuraInputDate = class {
|
|
|
99
99
|
this.dateChange.emit(this.value);
|
|
100
100
|
}
|
|
101
101
|
else {
|
|
102
|
-
this.
|
|
103
|
-
this.dates = [];
|
|
102
|
+
this.resetDates();
|
|
104
103
|
}
|
|
105
104
|
}
|
|
106
105
|
else if (simpleDateRegex.test(inputValue)) {
|
|
@@ -113,8 +112,7 @@ const CuraInputDate = class {
|
|
|
113
112
|
this.dateChange.emit(this.value);
|
|
114
113
|
}
|
|
115
114
|
else {
|
|
116
|
-
this.
|
|
117
|
-
this.dates = [];
|
|
115
|
+
this.resetDates();
|
|
118
116
|
}
|
|
119
117
|
}
|
|
120
118
|
else {
|
|
@@ -127,6 +125,7 @@ const CuraInputDate = class {
|
|
|
127
125
|
this.status = 'default';
|
|
128
126
|
this.value = '';
|
|
129
127
|
this.dateChange.emit(this.value);
|
|
128
|
+
this.statusInputChange.emit(this.status);
|
|
130
129
|
}
|
|
131
130
|
}
|
|
132
131
|
isDateValid(date) {
|
|
@@ -148,9 +147,14 @@ const CuraInputDate = class {
|
|
|
148
147
|
const year = date.getFullYear();
|
|
149
148
|
return `${day}/${month}/${year}`;
|
|
150
149
|
}
|
|
150
|
+
resetDates() {
|
|
151
|
+
this.status = 'error';
|
|
152
|
+
this.dates = [];
|
|
153
|
+
this.statusInputChange.emit(this.status);
|
|
154
|
+
}
|
|
151
155
|
renderCalendarOrHelperText() {
|
|
152
156
|
if (this.isCalendarVisible) {
|
|
153
|
-
return (index.h("div", { class: "calendar" }, index.h("cura-calendar", { customDates: this.dates, mode: this.
|
|
157
|
+
return (index.h("div", { class: "calendar visible" }, index.h("cura-calendar", { customDates: this.dates, mode: this.dateSettings.mode, width: "100%", maxWidth: "400px", embedded: false, floating: false, disableFutureDates: this.disableFutureDates, disablePassDates: this.disablePassDates, onOnchangeday: e => {
|
|
154
158
|
const days = e.detail.days;
|
|
155
159
|
if (days.length === 1) {
|
|
156
160
|
this.value = this.parseDateToString(days[0]);
|
|
@@ -169,16 +173,12 @@ const CuraInputDate = class {
|
|
|
169
173
|
}
|
|
170
174
|
}
|
|
171
175
|
render() {
|
|
172
|
-
return (index.h(index.Host, { key: '
|
|
176
|
+
return (index.h(index.Host, { key: 'a85d8edd29146ca4068bb0fb5f718a5b6426638e' }, index.h("div", { key: '99a69b37f9370bdf242d0dc698f707f28cf0325a', class: "container", style: this.styles }, index.h("cura-input-text", { key: '5f5450f7390792c1188e17f48a9d04f4339fc156', label: this.label, name: this.name, status: this.status, value: this.value, onFocus: () => this.showCalendar(), size: this.size, "icon-name": this.iconName, placeholder: this.dateSettings.placeholder, "mask-preset": this.dateSettings.mask, "enable-selection-mode": true, onKeyUp: event => this.handleInputDates(event), autocomplete: "off", onValueChange: event => this.handleChangeDates(event) }, this.renderCalendarOrHelperText()))));
|
|
173
177
|
}
|
|
174
178
|
static get formAssociated() { return true; }
|
|
175
179
|
get el() { return index.getElement(this); }
|
|
176
180
|
static get watchers() { return {
|
|
177
|
-
"enableRangeDates": ["
|
|
178
|
-
"disableFutureDates": ["isDateValid", "renderCalendarOrHelperText"],
|
|
179
|
-
"disablePassDates": ["isDateValid"],
|
|
180
|
-
"dates": ["renderCalendarOrHelperText"],
|
|
181
|
-
"isCalendarVisible": ["renderCalendarOrHelperText"]
|
|
181
|
+
"enableRangeDates": ["updateDateSettings"]
|
|
182
182
|
}; }
|
|
183
183
|
};
|
|
184
184
|
CuraInputDate.style = CuraInputDateStyle0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"cura-input-date.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,gBAAgB,GAAG,8WAA8W,CAAC;AACxY,4BAAe,gBAAgB;;MCSlB,aAAa;;;;qBAMkB,EAAE;sBAKsC,SAAS;oBAKd,QAAQ;oBAK5C,EAAE;;;;;wBAyBiB,EAAE;2BAKP,IAAI;sBAQzC,EAAE;iCAEkB,KAAK;qBAElB,EAAE;qBAED,EAAE;;IAE5B,iBAAiB;QACf,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;QACxD,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;QAC1E,IAAI,CAAC,MAAM,CAAC,qBAAqB,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAC;QAC/F,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,QAA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,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;qBACtG;yBAAM;wBACL,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;qBACjB;oBACD,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;iBAClC,GACD,CACE,EACN;SACH;aAAM;YACL,OAAO,IAAI,CAAC,UAAU,CAAC;SACxB;KACF;IAED,MAAM;QACJ,QACEA,QAACC,UAAI,uDACHD,kEAAK,KAAK,EAAC,WAAW,EAAC,KAAK,EAAE,IAAI,CAAC,MAAM,IACvCA,8EACE,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,OAAO,EAAE,MAAM,IAAI,CAAC,YAAY,EAAE,EAClC,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,WAAW,EAAE,IAAI,CAAC,cAAc,EAAE,iBACrB,IAAI,CAAC,OAAO,EAAE,2BACJ,IAAI,EAC3B,OAAO,EAAE,KAAK,IAAI,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAC9C,YAAY,EAAC,KAAK,EAClB,aAAa,EAAE,KAAK,IAAI,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,IAEpD,IAAI,CAAC,0BAA0B,EAAE,CAClB,CACd,CACD,EACP;KACH;;;;;;;;;;;;;;;","names":["isBefore","isAfter","h","Host"],"sources":["src/components/forms/cura-input-date/cura-input-date.scss?tag=cura-input-date&encapsulation=shadow","src/components/forms/cura-input-date/cura-input-date.tsx"],"sourcesContent":["@import '../../../../src/scss/mixins/shadows.scss';\n@import '../../../../src/scss/mixins/spacing.scss';\n\n:host {\n display: block;\n}\n\n.container{\n display: flex;\n flex-direction: column;\n\n .calendar{\n padding: #{$spacing-none} #{$spacing-xxxs};\n margin-top: -8px;\n border-radius: 0px 0px 4px 4px;\n border-top: 0px;\n border-right: 2px solid #D4D4D4;\n border-bottom:2px solid #D4D4D4;\n border-left: 2px solid #D4D4D4;\n @include shadow-level3(--neutral-black-shadow);\n }\n}\n","import { Component, Element, Host, Listen, Prop, State, Watch, h, Event, EventEmitter } from '@stencil/core';\nimport { CuraInputTextCustomEvent } from '../../../components';\nimport { isAfter, isBefore } from 'date-fns';\n\n@Component({\n tag: 'cura-input-date',\n styleUrl: 'cura-input-date.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class CuraInputDate {\n @Element() el: HTMLElement;\n\n /**\n * Label text for the input date\n */\n @Prop({ reflect: true }) label?: string = '';\n\n /**\n * Indicates input status (default: default)\n */\n @Prop({ reflect: true, mutable: true }) status: 'error' | 'success' | 'default' = 'default';\n\n /**\n * Size of the input mode default: 'small', 'medium', or 'large' (default: 'medium')\n */\n @Prop({ reflect: true, mutable: true }) size: 'small' | 'medium' | 'large' = 'medium';\n\n /**\n * Name text for the input date\n */\n @Prop({ reflect: true }) name?: string = '';\n\n /**\n * Helper text displayed below the input\n */\n @Prop({ reflect: true, mutable: true }) helperText?: string;\n\n /**\n * Enables the date range selection mode, allowing users to select a period of dates\n */\n @Prop({ reflect: true, mutable: true }) enableRangeDates: boolean;\n\n /**\n * Controls whether future dates (dates before the current date) should be disabled\n */\n @Prop({ reflect: true, mutable: true }) disableFutureDates: boolean;\n\n /**\n * Controls whether past dates (dates before the current date) should be disabled\n */\n @Prop({ reflect: true, mutable: true }) disablePassDates: boolean;\n\n /**\n * Whether to display a cura icon (default: null)\n */\n @Prop({ reflect: true, mutable: true }) iconName?: string = '';\n\n /**\n * Placeholder text for the input\n */\n @Prop({ reflect: true }) placeholder?: string | null = null;\n\n /**\n * Emitted when the value of the input changes\n * @type {EventEmitter<string>}\n */\n @Event() dateChange: EventEmitter<string>;\n\n @State() styles = {};\n\n @State() isCalendarVisible: boolean = false;\n\n @State() dates: Date[] = [];\n\n @State() value?: string = '';\n\n connectedCallback() {\n const weights = window.CuraAPI.theme.fonts.getWeights();\n this.styles['--base-spacing'] = window.CuraAPI.theme.spacing.getSpacing();\n this.styles['--neutral-purewhite'] = window.CuraAPI.theme.colors.getColor(`neutral-purewhite`);\n this.styles['--neutral-lighter'] = window.CuraAPI.theme.colors.getColor(`neutral-lighter`);\n this.styles['--neutral-base'] = window.CuraAPI.theme.colors.getColor(`neutral-base`);\n this.styles['--font-size'] = window.CuraAPI.theme.fonts.getSize();\n this.styles['--font-color'] = window.CuraAPI.theme.fonts.getColor();\n this.styles['--font-family'] = window.CuraAPI.theme.fonts.getFamily();\n this.styles['--font-weight-regular'] = weights.regular;\n }\n\n /**\n * Callback for form association\n */\n formAssociatedCallback(form: { ariaLabel: string }) {\n form.ariaLabel = this.label;\n }\n\n /**\n * Formats the placeholder based on the enableRangeDates flag\n *\n * @returns {string} A string representing the placeholder format,\n * either for a date range ('dd/mm/yyyy - dd/mm/yyyy') or a single date ('dd/mm/yyyy')\n */\n @Watch('enableRangeDates')\n setPlaceholder(): string {\n if (this.placeholder) {\n return this.placeholder;\n }\n return this.enableRangeDates ? 'dd/mm/aaaa - dd/mm/aaaa' : 'dd/mm/aaaa';\n }\n\n /**\n * Sets the mask type based on the enableRangeDates flag\n *\n * @returns {string} The mask type, either 'dateRange' or 'date'\n */\n @Watch('enableRangeDates')\n setMask(): string {\n return this.enableRangeDates ? 'dateRange' : 'date';\n }\n\n /**\n * Sets the mode type based on the enableRangeDates flag\n *\n * @returns {'range' | 'single'}\n */\n @Watch('enableRangeDates')\n setMode(): 'range' | 'single' {\n return this.enableRangeDates ? 'range' : 'single';\n }\n\n @Listen('click', { target: 'window' })\n handleClick(ev: { target: Node }) {\n if (this.el.contains(ev.target)) {\n return;\n }\n this.hideCalendar();\n }\n\n hideCalendar() {\n this.isCalendarVisible = false;\n }\n\n showCalendar() {\n this.isCalendarVisible = true;\n }\n\n handleInputDates(event: any) {\n const inputValue = event.target.value;\n\n const dateRangeRegex = /^(\\d{2}\\/\\d{2}\\/\\d{4})\\s*-\\s*(\\d{2}\\/\\d{2}\\/\\d{4})$/;\n const simpleDateRegex = /^(\\d{2}\\/\\d{2}\\/\\d{4})$/;\n\n if (dateRangeRegex.test(inputValue)) {\n const matches = inputValue.match(dateRangeRegex);\n const startDate = this.parseStringToDate(matches[1]);\n const endDate = this.parseStringToDate(matches[2]);\n if (this.isDateValid(startDate) && this.isDateValid(endDate)) {\n this.status = 'default';\n this.dates = [startDate, endDate];\n this.value = `${this.parseDateToString(startDate)} - ${this.parseDateToString(endDate)}`;\n this.dateChange.emit(this.value);\n } else {\n this.status = 'error';\n this.dates = [];\n }\n } else if (simpleDateRegex.test(inputValue)) {\n const matches = inputValue.match(simpleDateRegex);\n const singleDate = this.parseStringToDate(matches[1]);\n if (this.isDateValid(singleDate)) {\n this.status = 'default';\n this.dates = [singleDate];\n this.value = this.parseDateToString(singleDate);\n this.dateChange.emit(this.value);\n } else {\n this.status = 'error';\n this.dates = [];\n }\n } else {\n this.dates = [];\n }\n }\n\n handleChangeDates(event: CuraInputTextCustomEvent<string | number>) {\n if (event.detail === '') {\n this.dates = [];\n this.status = 'default';\n this.value = '';\n this.dateChange.emit(this.value);\n }\n }\n\n @Watch('disableFutureDates')\n @Watch('disablePassDates')\n isDateValid(date: Date) {\n const today = new Date();\n today.setHours(0, 0, 0, 0);\n\n if (this.disablePassDates) return !isBefore(date, today);\n if (this.disableFutureDates) return !isAfter(date, today);\n return true;\n }\n\n parseStringToDate(dateString: string): Date {\n const [day, month, year] = dateString.split('/').map(Number);\n return new Date(year, month - 1, day);\n }\n\n parseDateToString(date: Date): string {\n const day = String(date.getDate()).padStart(2, '0');\n const month = String(date.getMonth() + 1).padStart(2, '0');\n const year = date.getFullYear();\n\n return `${day}/${month}/${year}`;\n }\n\n @Watch('dates')\n @Watch('isCalendarVisible')\n @Watch('disableFutureDates')\n renderCalendarOrHelperText() {\n if (this.isCalendarVisible) {\n return (\n <div class=\"calendar\">\n <cura-calendar\n customDates={this.dates}\n mode={this.setMode()}\n width=\"100%\"\n embedded={false}\n floating={false}\n disableFutureDates={this.disableFutureDates}\n disablePassDates={this.disablePassDates}\n onOnchangeday={e => {\n const days = e.detail.days;\n if (days.length === 1) {\n this.value = this.parseDateToString(days[0]);\n } else if (days.length > 0) {\n this.value = `${this.parseDateToString(days[0])} - ${this.parseDateToString(days[days.length - 1])}`;\n } else {\n this.value = '';\n }\n this.dateChange.emit(this.value);\n }}\n />\n </div>\n );\n } else {\n return this.helperText;\n }\n }\n\n render() {\n return (\n <Host>\n <div class=\"container\" style={this.styles}>\n <cura-input-text\n label={this.label}\n name={this.name}\n status={this.status}\n value={this.value}\n onFocus={() => this.showCalendar()}\n size={this.size}\n iconName={this.iconName}\n placeholder={this.setPlaceholder()}\n mask-preset={this.setMask()}\n enable-selection-mode={true}\n onKeyUp={event => this.handleInputDates(event)}\n autocomplete=\"off\"\n onValueChange={event => this.handleChangeDates(event)}\n >\n {this.renderCalendarOrHelperText()}\n </cura-input-text>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"cura-input-date.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,gBAAgB,GAAG,ilBAAilB,CAAC;AAC3mB,4BAAe,gBAAgB;;MCSlB,aAAa;;;;;qBAMkB,EAAE;sBAKsC,SAAS;oBAK7B,QAAQ;oBAK7B,EAAE;;;;;wBAyBE,EAAE;2BAKQ,IAAI;sBAczC,EAAE;iCAEkB,KAAK;qBAElB,EAAE;qBAED,EAAE;4BAEJ;YACtB,WAAW,EAAE,IAAI;YACjB,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,QAAQ;SACf;;IAED,iBAAiB;QACf,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC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ACxB,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC,WAAW,iBAC7B,IAAI,CAAC,YAAY,CAAC,IAAI,2BACZ,IAAI,EAC3B,OAAO,EAAE,KAAK,IAAI,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAC9C,YAAY,EAAC,KAAK,EAClB,aAAa,EAAE,KAAK,IAAI,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,IAEpD,IAAI,CAAC,0BAA0B,EAAE,CAClB,CACd,CACD,EACP;KACH;;;;;;;;;;;","names":["isBefore","isAfter","h","Host"],"sources":["src/components/forms/cura-input-date/cura-input-date.scss?tag=cura-input-date&encapsulation=shadow","src/components/forms/cura-input-date/cura-input-date.tsx"],"sourcesContent":["@import '../../../../src/scss/mixins/shadows.scss';\n@import '../../../../src/scss/mixins/spacing.scss';\n\n:host {\n display: block;\n}\n\n.container{\n display: flex;\n flex-direction: column;\n position: relative;\n\n .calendar{\n padding: #{$spacing-none} #{$spacing-xxxs};\n margin-top: -8px;\n border-radius: 0px 0px 4px 4px;\n border-top: 0px;\n border-right: 2px solid #D4D4D4;\n border-bottom:2px solid #D4D4D4;\n border-left: 2px solid #D4D4D4;\n @include shadow-level3(--neutral-black-shadow);\n position: absolute;\n top: 100%; \n z-index: 10; \n display: none; \n opacity: 0;\n pointer-events: none; \n }\n\n .calendar.visible {\n box-sizing: border-box;\n display: block;\n opacity: 1;\n pointer-events: auto; \n width: 100%;\n background-color: #fff;\n }\n}\n","import { Component, Element, Host, Listen, Prop, State, Watch, h, Event, EventEmitter } from '@stencil/core';\nimport { CuraInputTextCustomEvent } from '../../../components';\nimport { isAfter, isBefore } from 'date-fns';\n\n@Component({\n tag: 'cura-input-date',\n styleUrl: 'cura-input-date.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class CuraInputDate {\n @Element() el: HTMLElement;\n\n /**\n * Label text for the input date\n */\n @Prop({ reflect: true }) label?: string = '';\n\n /**\n * Indicates input status (default: default)\n */\n @Prop({ reflect: true, mutable: true }) status: 'error' | 'success' | 'default' = 'default';\n\n /**\n * Size of the input mode default: 'small', 'medium', or 'large' (default: 'medium')\n */\n @Prop({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium';\n\n /**\n * Name text for the input date\n */\n @Prop({ reflect: true }) name?: string = '';\n\n /**\n * Helper text displayed below the input\n */\n @Prop({ reflect: true }) helperText?: string;\n\n /**\n * Enables the date range selection mode, allowing users to select a period of dates\n */\n @Prop({ reflect: true }) enableRangeDates: boolean;\n\n /**\n * Controls whether future dates (dates before the current date) should be disabled\n */\n @Prop({ reflect: true }) disableFutureDates: boolean;\n\n /**\n * Controls whether past dates (dates before the current date) should be disabled\n */\n @Prop({ reflect: true }) disablePassDates: boolean;\n\n /**\n * Whether to display a cura icon (default: null)\n */\n @Prop({ reflect: true }) iconName?: string = '';\n\n /**\n * Placeholder text for the input\n */\n @Prop({ reflect: true }) placeholder?: string | null = null;\n\n /**\n * Emitted when the value of the input changes\n * @type {EventEmitter<string>}\n */\n @Event() dateChange: EventEmitter<string>;\n\n /**\n * Emitted when the value of the status changes\n * @type {EventEmitter<string>}\n */\n @Event() statusInputChange: EventEmitter<string>;\n\n @State() styles = {};\n\n @State() isCalendarVisible: boolean = false;\n\n @State() dates: Date[] = [];\n\n @State() value?: string = '';\n\n @State() dateSettings = {\n placeholder: null,\n mask: 'date',\n mode: 'single',\n };\n\n connectedCallback() {\n const { fonts, colors, spacing } = window.CuraAPI.theme;\n const weights = fonts.getWeights();\n\n this.styles = {\n '--base-spacing': spacing.getSpacing(),\n '--neutral-purewhite': colors.getColor('neutral-purewhite'),\n '--neutral-lighter': colors.getColor('neutral-lighter'),\n '--neutral-base': colors.getColor('neutral-base'),\n '--font-size': fonts.getSize(),\n '--font-color': fonts.getColor(),\n '--font-family': fonts.getFamily(),\n '--font-weight-regular': weights.regular,\n };\n }\n\n componentWillLoad() {\n this.updateDateSettings();\n }\n\n /**\n * Callback for form association\n */\n formAssociatedCallback(form: { ariaLabel: string }) {\n form.ariaLabel = this.label;\n }\n\n @Watch('enableRangeDates')\n updateDateSettings() {\n const newSettings = this.getDateSettings(this.enableRangeDates);\n\n if (this.shouldUpdateDateSettings(newSettings)) {\n this.dateSettings = newSettings;\n }\n }\n\n getDateSettings(isRange: boolean) {\n return {\n placeholder: this.placeholder || (isRange ? 'dd/mm/aaaa - dd/mm/aaaa' : 'dd/mm/aaaa'),\n mask: isRange ? 'dateRange' : 'date',\n mode: isRange ? 'range' : 'single',\n };\n }\n\n shouldUpdateDateSettings(newSettings: any) {\n return this.dateSettings.placeholder !== newSettings.placeholder || this.dateSettings.mask !== newSettings.mask || this.dateSettings.mode !== newSettings.mode;\n }\n\n @Listen('click', { target: 'window' })\n handleClick(ev: { target: Node }) {\n if (this.el.contains(ev.target)) {\n return;\n }\n this.hideCalendar();\n }\n\n hideCalendar() {\n this.isCalendarVisible = false;\n }\n\n showCalendar() {\n this.isCalendarVisible = true;\n }\n\n handleInputDates(event: any) {\n const inputValue = event.target.value;\n\n const dateRangeRegex = /^(\\d{2}\\/\\d{2}\\/\\d{4})\\s*-\\s*(\\d{2}\\/\\d{2}\\/\\d{4})$/;\n const simpleDateRegex = /^(\\d{2}\\/\\d{2}\\/\\d{4})$/;\n\n if (dateRangeRegex.test(inputValue)) {\n const matches = inputValue.match(dateRangeRegex);\n const startDate = this.parseStringToDate(matches[1]);\n const endDate = this.parseStringToDate(matches[2]);\n if (this.isDateValid(startDate) && this.isDateValid(endDate)) {\n this.status = 'default';\n this.dates = [startDate, endDate];\n this.value = `${this.parseDateToString(startDate)} - ${this.parseDateToString(endDate)}`;\n this.dateChange.emit(this.value);\n } else {\n this.resetDates();\n }\n } else if (simpleDateRegex.test(inputValue)) {\n const matches = inputValue.match(simpleDateRegex);\n const singleDate = this.parseStringToDate(matches[1]);\n if (this.isDateValid(singleDate)) {\n this.status = 'default';\n this.dates = [singleDate];\n this.value = this.parseDateToString(singleDate);\n this.dateChange.emit(this.value);\n } else {\n this.resetDates();\n }\n } else {\n this.dates = [];\n }\n }\n\n handleChangeDates(event: CuraInputTextCustomEvent<string | number>) {\n if (event.detail === '') {\n this.dates = [];\n this.status = 'default';\n this.value = '';\n this.dateChange.emit(this.value);\n this.statusInputChange.emit(this.status);\n }\n }\n\n isDateValid(date: Date) {\n const today = new Date();\n today.setHours(0, 0, 0, 0);\n\n if (this.disablePassDates) return !isBefore(date, today);\n if (this.disableFutureDates) return !isAfter(date, today);\n return true;\n }\n\n parseStringToDate(dateString: string): Date {\n const [day, month, year] = dateString.split('/').map(Number);\n return new Date(year, month - 1, day);\n }\n\n parseDateToString(date: Date): string {\n const day = String(date.getDate()).padStart(2, '0');\n const month = String(date.getMonth() + 1).padStart(2, '0');\n const year = date.getFullYear();\n\n return `${day}/${month}/${year}`;\n }\n\n resetDates() {\n this.status = 'error';\n this.dates = [];\n this.statusInputChange.emit(this.status);\n }\n\n renderCalendarOrHelperText() {\n if (this.isCalendarVisible) {\n return (\n <div class=\"calendar visible\">\n <cura-calendar\n customDates={this.dates}\n mode={this.dateSettings.mode as 'single' | 'range'}\n width=\"100%\"\n maxWidth=\"400px\"\n embedded={false}\n floating={false}\n disableFutureDates={this.disableFutureDates}\n disablePassDates={this.disablePassDates}\n onOnchangeday={e => {\n const days = e.detail.days;\n if (days.length === 1) {\n this.value = this.parseDateToString(days[0]);\n } else if (days.length > 0) {\n this.value = `${this.parseDateToString(days[0])} - ${this.parseDateToString(days[days.length - 1])}`;\n } else {\n this.value = '';\n }\n this.dateChange.emit(this.value);\n }}\n />\n </div>\n );\n } else {\n return this.helperText;\n }\n }\n\n render() {\n return (\n <Host>\n <div class=\"container\" style={this.styles}>\n <cura-input-text\n label={this.label}\n name={this.name}\n status={this.status}\n value={this.value}\n onFocus={() => this.showCalendar()}\n size={this.size}\n icon-name={this.iconName}\n placeholder={this.dateSettings.placeholder}\n mask-preset={this.dateSettings.mask}\n enable-selection-mode={true}\n onKeyUp={event => this.handleInputDates(event)}\n autocomplete=\"off\"\n onValueChange={event => this.handleChangeDates(event)}\n >\n {this.renderCalendarOrHelperText()}\n </cura-input-text>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -25,7 +25,7 @@ const CuraLoaderBar = class {
|
|
|
25
25
|
this.setProgress();
|
|
26
26
|
}
|
|
27
27
|
render() {
|
|
28
|
-
return (index.h(index.Host, { key: '
|
|
28
|
+
return (index.h(index.Host, { key: 'af0397ee6a031081a84200da4863752ccbf937ce' }, index.h("div", { key: '5e054c2b571053bdb58b415a6ca642a8bc0385f3', id: "progress-bar", class: "progress-bar", style: this.styles }, index.h("span", { key: '2463789bf8737e13b6b5a49a1af4e51ce1637176', class: "progress-bar-fill" }))));
|
|
29
29
|
}
|
|
30
30
|
setColor() {
|
|
31
31
|
this.styles = Object.assign(Object.assign({}, this.styles), { '--neutral-base': window.CuraAPI.theme.colors.getColor(`neutral-base`, 0.2), '--color-base': window.CuraAPI.theme.colors.getColor(this.color) });
|
|
@@ -137,7 +137,7 @@ const CuraRadio = class {
|
|
|
137
137
|
return statusColors[this.status][type];
|
|
138
138
|
}
|
|
139
139
|
render() {
|
|
140
|
-
return (index.h(index.Host, { key: '
|
|
140
|
+
return (index.h(index.Host, { key: 'a0d89eeaf13690af56498ab584c22082b071b851' }, index.h("div", { key: '17a7ffae366d1942cdf8daccb0693434468040f8', class: this.getClasses(), style: this.styles }, index.h("div", { key: '2a03b1cc6eb6c26227bff90ec40f1f739e543613', class: "info" }, index.h("div", { key: '63a3f9a9f99504fc5f0e824a6398d502c2d7bec7', class: "label-wrapper" }, index.h("cura-label", { key: 'cddaf7347318cba1cd480352cde13321b44cc244', class: "label", size: this.size === 'large' ? 'medium' : 'xsmall', color: this.assignColor('label') }, this.label), this.required && index.h("cura-paragraph", { key: 'b2f5f549427841feb97ba43e26930e62e7d8f432', lineHeight: '0%', marginBlock: '0', color: "error-base" }, "* ")), index.h("cura-label", { key: '7d32540fd194b86224189d2ba3da8da4cae9d2a9', color: this.assignColor('message'), size: "xsmall", class: "message" }, index.h("slot", { key: 'c4e8fa9a1fb18040da0038aa5ea7e6bcb0ee17bc' }))), index.h("input", { key: 'eaebe407c25af0bc72df251451a652fc6376ef9a', type: "radio", class: `radio ${this.size.toLocaleLowerCase()}`, name: this.name, value: this.value, required: this.required, tabIndex: this.ontabindex, disabled: this.disabled, checked: this.checked, onClick: this.handleClick }))));
|
|
141
141
|
}
|
|
142
142
|
static get formAssociated() { return true; }
|
|
143
143
|
get host() { return index.getElement(this); }
|
|
@@ -109,7 +109,7 @@ const CuraSwitch = class {
|
|
|
109
109
|
return classes;
|
|
110
110
|
}
|
|
111
111
|
render() {
|
|
112
|
-
return (index.h(index.Host, { key: '
|
|
112
|
+
return (index.h(index.Host, { key: '019642743001393249cba0ac937b861a0b309af3' }, index.h("div", { key: '32d6358af066b24b60fb2967891b0eda03027a25', class: this.getClasses(), style: this.styles }, index.h("div", { key: 'c29681689cbf04ee89afa793dd84f1a3c1198fb7', class: "info" }, index.h("cura-label", { key: '0865c7e0c45843769046039981382e4f7a9cf8cf', style: { textAlign: this.position === 'right' ? 'right' : 'left' }, class: "label", weight: "bold", size: this.size === 'large' ? 'medium' : 'xsmall', lineHeight: "125%", color: this.assignColor('neutral-white', 'neutral-black') }, this.label), index.h("cura-label", { key: 'b1fff87c188c2a1f306630a692c254dcacc5b03b', style: { textAlign: this.position === 'right' ? 'right' : 'left' }, color: this.assignColor('primary-lighter', 'neutral-dark'), size: "xsmall", class: "message" }, index.h("slot", { key: '553757a5022374bd10af67f4a0c449511203e2e6' }))), index.h("div", { key: 'a8babf17cdd9c8bb95225fce8501015859122ec6', onClick: this.toggleSwitch, class: "control" }, index.h("div", { key: '4828791117512af2526ed94b5981a0dab04b3e5c', class: `track ${this.size.toLowerCase()}` }, index.h("div", { key: '30a712271bcee777e9a3c79d04a2038db5b84869', class: `thumb ${this.size.toLowerCase()}`, tabIndex: this.ontabindex }))))));
|
|
113
113
|
}
|
|
114
114
|
static get formAssociated() { return true; }
|
|
115
115
|
static get watchers() { return {
|
|
@@ -31,7 +31,7 @@ const CuraToast = class {
|
|
|
31
31
|
this.setStyle();
|
|
32
32
|
}
|
|
33
33
|
render() {
|
|
34
|
-
return (index.h(index.Host, { key: '
|
|
34
|
+
return (index.h(index.Host, { key: 'eb867953a8c56ae385b1226686cbe1b1e9df4318' }, index.h("div", { key: 'c901632a6fb414c981b5c149fdd7081306ae1130', class: this.getClasses(), style: this.styles }, index.h("cura-icon", { key: '98c9a49501c71ee60c6ae1d783bba11d5bdce999', class: "default-icon", name: this.getNameIcon(), size: 16, color: `${this.type}-dark` }), index.h("div", { key: '19b2e0bd0d816e94f3b9d1f113f4b833e770cee3', class: "content" }, index.h("cura-heading", { key: '17ed67e5b531b45b94f8dbc7d65675f7a57308f9', level: 4, size: "xsmall", color: `${this.type}-dark`, weight: "bold", "margin-block": "0" }, this.label), index.h("cura-paragraph", { key: 'dd90e612d924dff9b3e9896dc29cef2541ae51af', color: `${this.type}-darker`, size: "xsmall", marginBlock: "0", lineHeight: "133.33%" }, index.h("slot", { key: '33cd9c1dd10ae6d3ebd857fab5c70ca7151f8a1b' })), index.h("slot", { key: '12d18bd482b957cdc5ee7a4fab20bdffe6bc647d', name: "actions" })), this.closeButton && index.h("cura-icon", { key: '3a83cdd43c6c11587013111c29673f916509b165', class: "close-icon", name: "close", size: 16, color: "error-dark", onClick: this.handleClose }), this.loader && !!this.autoCloseDelay && index.h("cura-loader-bar", { key: '13ec00fd7146119e9eab81ed6d52b1020d1eb1e8', color: `${this.type}-base`, progress: this.progress }))));
|
|
35
35
|
}
|
|
36
36
|
componentDidLoad() {
|
|
37
37
|
this.openContainer();
|