@rededor/cura 1.5.0 → 1.6.0-alpha.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-57c5b283.js → app-globals-5a7ddb39.js} +21 -2
- package/dist/cjs/app-globals-5a7ddb39.js.map +1 -0
- package/dist/cjs/{cura-accordion_12.cjs.entry.js → cura-accordion_18.cjs.entry.js} +689 -50
- package/dist/cjs/cura-accordion_18.cjs.entry.js.map +1 -0
- package/dist/cjs/cura-alert.cjs.entry.js +2 -2
- package/dist/cjs/cura-alert.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-badge-counter.cjs.entry.js +2 -2
- package/dist/cjs/cura-badge-counter.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-badge-dot.cjs.entry.js +2 -2
- package/dist/cjs/cura-badge-dot.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-badge-pill.cjs.entry.js +2 -2
- package/dist/cjs/cura-badge-pill.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-button-outline.cjs.entry.js +2 -2
- package/dist/cjs/cura-button-outline.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-button-select.cjs.entry.js +2 -2
- package/dist/cjs/cura-button-select.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-calendar.cjs.entry.js +1 -1
- package/dist/cjs/cura-card.cjs.entry.js +1 -1
- package/dist/cjs/cura-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/cura-display.cjs.entry.js +2 -2
- package/dist/cjs/cura-dropdown-search-not-found.cjs.entry.js +28 -0
- package/dist/cjs/cura-dropdown-search-not-found.cjs.entry.js.map +1 -0
- package/dist/cjs/cura-dropdown-search-option-title.cjs.entry.js +2 -2
- package/dist/cjs/cura-dropdown-search-option.cjs.entry.js +4 -4
- package/dist/cjs/cura-dropdown-search-option.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-dropdown-search.cjs.entry.js +3 -3
- package/dist/cjs/cura-icons-view.cjs.entry.js +2 -2
- package/dist/cjs/cura-input-date.cjs.entry.js +3 -3
- package/dist/cjs/cura-input-date.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-loader-bar.cjs.entry.js +2 -2
- package/dist/cjs/cura-modal.cjs.entry.js +3 -3
- package/dist/cjs/cura-modal.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-progress-bar_2.cjs.entry.js +3 -3
- package/dist/cjs/cura-radio.cjs.entry.js +2 -2
- package/dist/cjs/cura-stepper.cjs.entry.js +2 -2
- package/dist/cjs/cura-switch.cjs.entry.js +2 -2
- package/dist/cjs/{cura-theme-module-14544f5f.js → cura-theme-module-a100c643.js} +9 -78
- package/dist/cjs/cura-theme-module-a100c643.js.map +1 -0
- package/dist/cjs/cura-toast.cjs.entry.js +2 -2
- package/dist/cjs/cura-tooltip.cjs.entry.js +3 -3
- package/dist/cjs/cura-tooltip.cjs.entry.js.map +1 -1
- package/dist/cjs/cura.cjs.js +5 -4
- package/dist/cjs/cura.cjs.js.map +1 -1
- package/dist/cjs/{index-e6d728ec.js → index-12d54921.js} +19 -2
- package/dist/cjs/index-12d54921.js.map +1 -0
- package/dist/cjs/index.cjs.js +2 -1
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +5 -4
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/cjs/static-4e83652c.js +76 -0
- package/dist/cjs/static-4e83652c.js.map +1 -0
- package/dist/collection/api/cura-api.js +19 -0
- package/dist/collection/api/cura-api.js.map +1 -1
- package/dist/collection/api/cura-api.type.js.map +1 -1
- package/dist/collection/collection-manifest.json +4 -0
- package/dist/collection/components/accordion/cura-accordion/cura-accordion.js +2 -2
- package/dist/collection/components/accordion/cura-accordion/cura-accordion.js.map +1 -1
- package/dist/collection/components/accordion/cura-accordion-item/cura-accordion-item.css +6 -6
- package/dist/collection/components/badges/cura-badge-counter/cura-badge-counter.css +8 -8
- package/dist/collection/components/badges/cura-badge-distance/cura-badge-distance.css +5 -5
- package/dist/collection/components/badges/cura-badge-dot/cura-badge-dot.css +4 -4
- package/dist/collection/components/badges/cura-badge-pill/cura-badge-pill.css +6 -6
- package/dist/collection/components/buttons/cura-button/cura-button.css +15 -15
- package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.css +15 -15
- package/dist/collection/components/buttons/cura-button-select/cura-button-select.css +12 -12
- package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.css +15 -15
- package/dist/collection/components/cura-alert/cura-alert.css +5 -5
- package/dist/collection/components/cura-dropdown-search-new/cura-dropdown-search-category/cura-dropdown-search-category.css +61 -0
- package/dist/collection/components/cura-dropdown-search-new/cura-dropdown-search-category/cura-dropdown-search-category.js +28 -0
- package/dist/collection/components/cura-dropdown-search-new/cura-dropdown-search-category/cura-dropdown-search-category.js.map +1 -0
- package/dist/collection/components/cura-dropdown-search-new/cura-dropdown-search-category/cura-dropdown-search-category.stories.js +37 -0
- package/dist/collection/components/cura-dropdown-search-new/cura-dropdown-search-category/cura-dropdown-search-category.stories.js.map +1 -0
- package/dist/collection/components/cura-dropdown-search-new/cura-dropdown-search-new.css +138 -0
- package/dist/collection/components/cura-dropdown-search-new/cura-dropdown-search-new.js +592 -0
- package/dist/collection/components/cura-dropdown-search-new/cura-dropdown-search-new.js.map +1 -0
- package/dist/collection/components/cura-dropdown-search-new/cura-dropdown-search-new.stories.js +278 -0
- package/dist/collection/components/cura-dropdown-search-new/cura-dropdown-search-new.stories.js.map +1 -0
- package/dist/collection/components/cura-dropdown-search-new/cura-dropdown-search-not-found/cura-dropdown-search-not-found.css +62 -0
- package/dist/collection/components/cura-dropdown-search-new/cura-dropdown-search-not-found/cura-dropdown-search-not-found.js +44 -0
- package/dist/collection/components/cura-dropdown-search-new/cura-dropdown-search-not-found/cura-dropdown-search-not-found.js.map +1 -0
- package/dist/collection/components/cura-dropdown-search-new/cura-dropdown-search-not-found/cura-dropdown-search-not-found.stories.js +38 -0
- package/dist/collection/components/cura-dropdown-search-new/cura-dropdown-search-not-found/cura-dropdown-search-not-found.stories.js.map +1 -0
- package/dist/collection/components/cura-dropdown-search-new/cura-dropdown-search-option-new/cura-dropdown-search-option-new.css +121 -0
- package/dist/collection/components/cura-dropdown-search-new/cura-dropdown-search-option-new/cura-dropdown-search-option-new.js +183 -0
- package/dist/collection/components/cura-dropdown-search-new/cura-dropdown-search-option-new/cura-dropdown-search-option-new.js.map +1 -0
- package/dist/collection/components/cura-dropdown-search-new/cura-dropdown-search-option-new/cura-dropdown-search-option-new.stories.js +85 -0
- package/dist/collection/components/cura-dropdown-search-new/cura-dropdown-search-option-new/cura-dropdown-search-option-new.stories.js.map +1 -0
- package/dist/collection/components/cura-icon/cura-icon.js +1 -1
- package/dist/collection/components/cura-icons-view/cura-icons-view.js +1 -1
- package/dist/collection/components/cura-modal/cura-modal.css +11 -11
- package/dist/collection/components/cura-modal/cura-modal.js +1 -1
- package/dist/collection/components/cura-page-template/cura-page-template.js +1 -1
- package/dist/collection/components/cura-stepper/cura-progress-bar/cura-progress-bar.js +1 -1
- package/dist/collection/components/cura-stepper/cura-stepper-item/cura-stepper-item.js +1 -1
- package/dist/collection/components/cura-stepper/cura-stepper.js +1 -1
- package/dist/collection/components/cura-toast/cura-toast.js +1 -1
- package/dist/collection/components/cura-tooltip/cura-tooltip.css +12 -12
- package/dist/collection/components/cura-tooltip/cura-tooltip.js +1 -1
- 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.css +5 -5
- 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.js +2 -2
- package/dist/collection/components/forms/cura-input-date/cura-input-date.css +3 -3
- package/dist/collection/components/forms/cura-input-date/cura-input-date.js +1 -1
- package/dist/collection/components/forms/cura-input-text/cura-input-text.css +4 -0
- package/dist/collection/components/forms/cura-input-text/cura-input-text.js +65 -11
- package/dist/collection/components/forms/cura-input-text/cura-input-text.js.map +1 -1
- package/dist/collection/components/forms/cura-label/cura-label.js +6 -5
- package/dist/collection/components/forms/cura-label/cura-label.js.map +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 +7 -6
- package/dist/collection/components/text/cura-heading/cura-heading.js +4 -19
- package/dist/collection/components/text/cura-heading/cura-heading.js.map +1 -1
- package/dist/collection/components/text/cura-paragraph/cura-paragraph.css +7 -7
- package/dist/collection/components/text/cura-paragraph/cura-paragraph.js +6 -20
- package/dist/collection/components/text/cura-paragraph/cura-paragraph.js.map +1 -1
- package/dist/collection/utils/FixedElementScrollBehavior.js +54 -0
- package/dist/collection/utils/FixedElementScrollBehavior.js.map +1 -0
- package/dist/collection/utils/utils.js +38 -0
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/components/cura-accordion-item.js +1 -1
- package/dist/components/cura-accordion-item.js.map +1 -1
- package/dist/components/cura-accordion.js +2 -2
- package/dist/components/cura-accordion.js.map +1 -1
- package/dist/components/cura-alert.js +1 -1
- package/dist/components/cura-alert.js.map +1 -1
- package/dist/components/cura-badge-counter2.js +1 -1
- package/dist/components/cura-badge-counter2.js.map +1 -1
- package/dist/components/cura-badge-distance.js +1 -1
- package/dist/components/cura-badge-distance.js.map +1 -1
- package/dist/components/cura-badge-dot.js +1 -1
- package/dist/components/cura-badge-dot.js.map +1 -1
- package/dist/components/cura-badge-pill2.js +1 -1
- package/dist/components/cura-badge-pill2.js.map +1 -1
- package/dist/components/cura-button-outline.js +1 -1
- package/dist/components/cura-button-outline.js.map +1 -1
- package/dist/components/cura-button-select.js +1 -1
- package/dist/components/cura-button-select.js.map +1 -1
- package/dist/components/cura-button-transparent2.js +1 -1
- package/dist/components/cura-button-transparent2.js.map +1 -1
- package/dist/components/cura-button.js +1 -1
- package/dist/components/cura-button.js.map +1 -1
- package/dist/components/cura-checkbox.js +1 -1
- package/dist/components/cura-display.js +1 -1
- package/dist/components/cura-dropdown-search-category.d.ts +11 -0
- package/dist/components/cura-dropdown-search-category.js +49 -0
- package/dist/components/cura-dropdown-search-category.js.map +1 -0
- package/dist/components/cura-dropdown-search-new.d.ts +11 -0
- package/dist/components/cura-dropdown-search-new.js +406 -0
- package/dist/components/cura-dropdown-search-new.js.map +1 -0
- package/dist/components/cura-dropdown-search-not-found.d.ts +11 -0
- package/dist/components/cura-dropdown-search-not-found.js +48 -0
- package/dist/components/cura-dropdown-search-not-found.js.map +1 -0
- package/dist/components/cura-dropdown-search-option-new.d.ts +11 -0
- package/dist/components/cura-dropdown-search-option-new.js +81 -0
- package/dist/components/cura-dropdown-search-option-new.js.map +1 -0
- package/dist/components/cura-dropdown-search-option-title.js +1 -1
- package/dist/components/cura-dropdown-search-option.js +3 -3
- package/dist/components/cura-dropdown-search-option.js.map +1 -1
- package/dist/components/cura-dropdown-search.js +2 -2
- package/dist/components/cura-heading2.js +4 -17
- package/dist/components/cura-heading2.js.map +1 -1
- package/dist/components/cura-icon2.js +1 -1
- package/dist/components/cura-icons-view.js +1 -1
- package/dist/components/cura-input-date.js +2 -2
- package/dist/components/cura-input-date.js.map +1 -1
- package/dist/components/cura-input-text2.js +132 -7
- package/dist/components/cura-input-text2.js.map +1 -1
- package/dist/components/cura-label2.js +6 -5
- package/dist/components/cura-label2.js.map +1 -1
- package/dist/components/cura-loader-bar2.js +1 -1
- package/dist/components/cura-loader-circle2.js +1 -1
- package/dist/components/cura-modal.js +2 -2
- package/dist/components/cura-modal.js.map +1 -1
- package/dist/components/cura-page-template.js +1 -1
- package/dist/components/cura-paragraph2.js +7 -19
- package/dist/components/cura-paragraph2.js.map +1 -1
- package/dist/components/cura-progress-bar2.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-stepper-item2.js +1 -1
- package/dist/components/cura-stepper.js +1 -1
- package/dist/components/cura-switch.js +1 -1
- package/dist/components/cura-toast.js +1 -1
- package/dist/components/cura-tooltip.js +2 -2
- package/dist/components/cura-tooltip.js.map +1 -1
- package/dist/components/index.js +28 -71
- 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/index.esm.js +1 -1
- package/dist/cura/index.esm.js.map +1 -1
- package/dist/cura/p-02717e7d.entry.js +2 -0
- package/dist/cura/{p-629c34fe.entry.js.map → p-02717e7d.entry.js.map} +1 -1
- package/dist/cura/p-0a391c03.entry.js +2 -0
- package/dist/cura/{p-dbab7864.entry.js.map → p-0a391c03.entry.js.map} +1 -1
- package/dist/cura/p-18af52e4.entry.js +2 -0
- package/dist/cura/{p-4aefe237.entry.js.map → p-18af52e4.entry.js.map} +1 -1
- package/dist/cura/p-1b201271.js +2 -0
- package/dist/cura/p-1b201271.js.map +1 -0
- package/dist/cura/{p-3030774e.entry.js → p-24cd591e.entry.js} +2 -2
- package/dist/cura/p-24d9f1f4.entry.js +2 -0
- package/dist/cura/p-24d9f1f4.entry.js.map +1 -0
- package/dist/cura/{p-ec7876d3.entry.js → p-2afb14e9.entry.js} +2 -2
- package/dist/cura/{p-3c0931d3.entry.js → p-3576b633.entry.js} +2 -2
- package/dist/cura/p-46994182.entry.js +2 -0
- package/dist/cura/p-500f1256.entry.js +2 -0
- package/dist/cura/{p-545e8e55.entry.js.map → p-500f1256.entry.js.map} +1 -1
- package/dist/cura/{p-7f25f4dc.entry.js → p-5afb630e.entry.js} +2 -2
- package/dist/cura/{p-bd99ef4c.entry.js → p-6243742a.entry.js} +2 -2
- package/dist/cura/p-635c0f4d.entry.js +2 -0
- package/dist/cura/p-86d317f3.entry.js +2 -0
- package/dist/cura/p-86d317f3.entry.js.map +1 -0
- package/dist/cura/{p-ee8db3dc.entry.js → p-9214ee88.entry.js} +2 -2
- package/dist/cura/{p-70adcf7b.entry.js → p-9dd47ec6.entry.js} +2 -2
- package/dist/cura/p-af3ac476.js +3 -0
- package/dist/cura/p-af3ac476.js.map +1 -0
- package/dist/cura/{p-f30270f0.entry.js → p-b1d6ee8d.entry.js} +2 -2
- package/dist/cura/{p-bce10f9b.entry.js → p-bfaf9964.entry.js} +2 -2
- package/dist/cura/p-c0f445b5.entry.js +2 -0
- package/dist/cura/{p-8622c492.entry.js.map → p-c0f445b5.entry.js.map} +1 -1
- package/dist/cura/{p-d13e3295.entry.js → p-d227469a.entry.js} +2 -2
- package/dist/cura/p-d25142cd.entry.js +2 -0
- package/dist/cura/{p-529332d3.entry.js.map → p-d25142cd.entry.js.map} +1 -1
- package/dist/cura/p-d2da92d9.entry.js +2 -0
- package/dist/cura/{p-6b627841.entry.js.map → p-d2da92d9.entry.js.map} +1 -1
- package/dist/cura/p-daf9feac.js +2 -0
- package/dist/cura/p-daf9feac.js.map +1 -0
- package/dist/cura/p-e98a1ad2.entry.js +2 -0
- package/dist/cura/{p-b3e93e74.entry.js.map → p-e98a1ad2.entry.js.map} +1 -1
- package/dist/cura/p-ec4996c2.js +2 -0
- package/dist/cura/p-ec4996c2.js.map +1 -0
- package/dist/cura/p-ee7328a5.entry.js +2 -0
- package/dist/cura/{p-235ac0b4.entry.js.map → p-ee7328a5.entry.js.map} +1 -1
- package/dist/cura/{p-f96b0923.entry.js → p-f1098b41.entry.js} +2 -2
- package/dist/cura/p-fc9584dd.entry.js +2 -0
- package/dist/cura/{p-a4a1f6c6.entry.js.map → p-fc9584dd.entry.js.map} +1 -1
- package/dist/esm/{app-globals-036c3b80.js → app-globals-83a601d0.js} +21 -2
- package/dist/esm/app-globals-83a601d0.js.map +1 -0
- package/dist/esm/{cura-accordion_12.entry.js → cura-accordion_18.entry.js} +684 -51
- package/dist/esm/cura-accordion_18.entry.js.map +1 -0
- package/dist/esm/cura-alert.entry.js +2 -2
- package/dist/esm/cura-alert.entry.js.map +1 -1
- package/dist/esm/cura-badge-counter.entry.js +2 -2
- package/dist/esm/cura-badge-counter.entry.js.map +1 -1
- package/dist/esm/cura-badge-dot.entry.js +2 -2
- package/dist/esm/cura-badge-dot.entry.js.map +1 -1
- package/dist/esm/cura-badge-pill.entry.js +2 -2
- package/dist/esm/cura-badge-pill.entry.js.map +1 -1
- package/dist/esm/cura-button-outline.entry.js +2 -2
- package/dist/esm/cura-button-outline.entry.js.map +1 -1
- package/dist/esm/cura-button-select.entry.js +2 -2
- package/dist/esm/cura-button-select.entry.js.map +1 -1
- package/dist/esm/cura-calendar.entry.js +1 -1
- package/dist/esm/cura-card.entry.js +1 -1
- package/dist/esm/cura-checkbox.entry.js +2 -2
- package/dist/esm/cura-display.entry.js +2 -2
- package/dist/esm/cura-dropdown-search-not-found.entry.js +24 -0
- package/dist/esm/cura-dropdown-search-not-found.entry.js.map +1 -0
- package/dist/esm/cura-dropdown-search-option-title.entry.js +2 -2
- package/dist/esm/cura-dropdown-search-option.entry.js +4 -4
- package/dist/esm/cura-dropdown-search-option.entry.js.map +1 -1
- package/dist/esm/cura-dropdown-search.entry.js +3 -3
- package/dist/esm/cura-icons-view.entry.js +2 -2
- package/dist/esm/cura-input-date.entry.js +3 -3
- package/dist/esm/cura-input-date.entry.js.map +1 -1
- package/dist/esm/cura-loader-bar.entry.js +2 -2
- package/dist/esm/cura-modal.entry.js +3 -3
- package/dist/esm/cura-modal.entry.js.map +1 -1
- package/dist/esm/cura-progress-bar_2.entry.js +3 -3
- package/dist/esm/cura-radio.entry.js +2 -2
- package/dist/esm/cura-stepper.entry.js +2 -2
- package/dist/esm/cura-switch.entry.js +2 -2
- package/dist/esm/{cura-theme-module-b23f8ac8.js → cura-theme-module-59e8e460.js} +3 -72
- package/dist/esm/cura-theme-module-59e8e460.js.map +1 -0
- package/dist/esm/cura-toast.entry.js +2 -2
- package/dist/esm/cura-tooltip.entry.js +3 -3
- package/dist/esm/cura-tooltip.entry.js.map +1 -1
- package/dist/esm/cura.js +6 -5
- package/dist/esm/cura.js.map +1 -1
- package/dist/esm/{index-747aad85.js → index-717b36df.js} +19 -2
- package/dist/esm/index-717b36df.js.map +1 -0
- package/dist/esm/index.js +2 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +6 -5
- package/dist/esm/loader.js.map +1 -1
- package/dist/esm/static-061aa850.js +74 -0
- package/dist/esm/static-061aa850.js.map +1 -0
- package/dist/types/api/cura-api.d.ts +1 -0
- package/dist/types/api/cura-api.type.d.ts +1 -1
- package/dist/types/components/cura-dropdown-search-new/cura-dropdown-search-category/cura-dropdown-search-category.d.ts +6 -0
- package/dist/types/components/cura-dropdown-search-new/cura-dropdown-search-category/cura-dropdown-search-category.stories.d.ts +27 -0
- package/dist/types/components/cura-dropdown-search-new/cura-dropdown-search-new.d.ts +127 -0
- package/dist/types/components/cura-dropdown-search-new/cura-dropdown-search-new.stories.d.ts +186 -0
- package/dist/types/components/cura-dropdown-search-new/cura-dropdown-search-not-found/cura-dropdown-search-not-found.d.ts +6 -0
- package/dist/types/components/cura-dropdown-search-new/cura-dropdown-search-not-found/cura-dropdown-search-not-found.stories.d.ts +27 -0
- package/dist/types/components/cura-dropdown-search-new/cura-dropdown-search-option-new/cura-dropdown-search-option-new.d.ts +44 -0
- package/dist/types/components/cura-dropdown-search-new/cura-dropdown-search-option-new/cura-dropdown-search-option-new.stories.d.ts +72 -0
- package/dist/types/components/forms/cura-input-text/cura-input-text.d.ts +12 -4
- package/dist/types/components/forms/cura-label/cura-label.d.ts +1 -0
- package/dist/types/components/text/cura-heading/cura-heading.d.ts +2 -3
- package/dist/types/components/text/cura-paragraph/cura-paragraph.d.ts +2 -2
- package/dist/types/components.d.ts +264 -9
- package/dist/types/utils/FixedElementScrollBehavior.d.ts +12 -0
- package/dist/types/utils/utils.d.ts +5 -0
- package/package.json +2 -2
- package/dist/cjs/app-globals-57c5b283.js.map +0 -1
- package/dist/cjs/cura-accordion_12.cjs.entry.js.map +0 -1
- package/dist/cjs/cura-avatar.cjs.entry.js +0 -68
- package/dist/cjs/cura-avatar.cjs.entry.js.map +0 -1
- package/dist/cjs/cura-badge-distance.cjs.entry.js +0 -46
- package/dist/cjs/cura-badge-distance.cjs.entry.js.map +0 -1
- package/dist/cjs/cura-button-transparent.cjs.entry.js +0 -107
- package/dist/cjs/cura-button-transparent.cjs.entry.js.map +0 -1
- package/dist/cjs/cura-theme-module-14544f5f.js.map +0 -1
- package/dist/cjs/index-e6d728ec.js.map +0 -1
- package/dist/cura/p-1051a947.js +0 -2
- package/dist/cura/p-1051a947.js.map +0 -1
- package/dist/cura/p-164ddb46.entry.js +0 -2
- package/dist/cura/p-164ddb46.entry.js.map +0 -1
- package/dist/cura/p-235ac0b4.entry.js +0 -2
- package/dist/cura/p-4aefe237.entry.js +0 -2
- package/dist/cura/p-529332d3.entry.js +0 -2
- package/dist/cura/p-545e8e55.entry.js +0 -2
- package/dist/cura/p-557b90c4.entry.js +0 -2
- package/dist/cura/p-57ad7c56.entry.js +0 -2
- package/dist/cura/p-57ad7c56.entry.js.map +0 -1
- package/dist/cura/p-629c34fe.entry.js +0 -2
- package/dist/cura/p-62a3056f.entry.js +0 -2
- package/dist/cura/p-62a3056f.entry.js.map +0 -1
- package/dist/cura/p-6624108e.entry.js +0 -2
- package/dist/cura/p-6b627841.entry.js +0 -2
- package/dist/cura/p-8622c492.entry.js +0 -2
- package/dist/cura/p-935eeb7b.entry.js +0 -2
- package/dist/cura/p-935eeb7b.entry.js.map +0 -1
- package/dist/cura/p-a4a1f6c6.entry.js +0 -2
- package/dist/cura/p-b3e93e74.entry.js +0 -2
- package/dist/cura/p-d21364b2.js +0 -2
- package/dist/cura/p-d21364b2.js.map +0 -1
- package/dist/cura/p-dbab7864.entry.js +0 -2
- package/dist/cura/p-fd5ed6b0.js +0 -3
- package/dist/cura/p-fd5ed6b0.js.map +0 -1
- package/dist/esm/app-globals-036c3b80.js.map +0 -1
- package/dist/esm/cura-accordion_12.entry.js.map +0 -1
- package/dist/esm/cura-avatar.entry.js +0 -64
- package/dist/esm/cura-avatar.entry.js.map +0 -1
- package/dist/esm/cura-badge-distance.entry.js +0 -42
- package/dist/esm/cura-badge-distance.entry.js.map +0 -1
- package/dist/esm/cura-button-transparent.entry.js +0 -103
- package/dist/esm/cura-button-transparent.entry.js.map +0 -1
- package/dist/esm/cura-theme-module-b23f8ac8.js.map +0 -1
- package/dist/esm/index-747aad85.js.map +0 -1
- /package/dist/cura/{p-3030774e.entry.js.map → p-24cd591e.entry.js.map} +0 -0
- /package/dist/cura/{p-ec7876d3.entry.js.map → p-2afb14e9.entry.js.map} +0 -0
- /package/dist/cura/{p-3c0931d3.entry.js.map → p-3576b633.entry.js.map} +0 -0
- /package/dist/cura/{p-6624108e.entry.js.map → p-46994182.entry.js.map} +0 -0
- /package/dist/cura/{p-7f25f4dc.entry.js.map → p-5afb630e.entry.js.map} +0 -0
- /package/dist/cura/{p-bd99ef4c.entry.js.map → p-6243742a.entry.js.map} +0 -0
- /package/dist/cura/{p-557b90c4.entry.js.map → p-635c0f4d.entry.js.map} +0 -0
- /package/dist/cura/{p-ee8db3dc.entry.js.map → p-9214ee88.entry.js.map} +0 -0
- /package/dist/cura/{p-70adcf7b.entry.js.map → p-9dd47ec6.entry.js.map} +0 -0
- /package/dist/cura/{p-f30270f0.entry.js.map → p-b1d6ee8d.entry.js.map} +0 -0
- /package/dist/cura/{p-bce10f9b.entry.js.map → p-bfaf9964.entry.js.map} +0 -0
- /package/dist/cura/{p-d13e3295.entry.js.map → p-d227469a.entry.js.map} +0 -0
- /package/dist/cura/{p-f96b0923.entry.js.map → p-f1098b41.entry.js.map} +0 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
|
|
3
|
+
const curaDropdownSearchOptionNewCss = ":host{display:block;box-sizing:border-box}:host .component-container{box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;display:flex;align-items:center;justify-content:flex-start;min-height:calc(var(--cura-spacing-base) * 10px);padding:0 calc(var(--cura-spacing-base) * 1px);border-bottom:1px solid var(--neutral-light);transition:background-color 0.15s linear}:host .component-container:not(.selected):not(.not-selectable):has(.selectable-container:hover),:host .component-container:not(.selected):not(.not-selectable).highlighted{background-color:var(--neutral-white)}:host .selectable-container{flex:1;display:flex;align-items:center;justify-content:flex-start;padding:calc(var(--cura-spacing-base) * 3px) 0;min-height:calc(var(--cura-spacing-base) * 10px);gap:calc(var(--cura-spacing-base) * 1px);cursor:pointer}:host .selectable-container .content{flex:1;align-items:center;justify-content:flex-end;padding-right:calc(var(--cura-spacing-base) * 1px)}:host .selectable-container ::slotted(cura-icon){--color:var(--neutral-dark) !important;margin:0 10px}:host .selectable-container ::slotted(cura-avatar){margin:0 calc(var(--cura-spacing-base) * 1px)}:host .selectable-container ::slotted(cura-heading),:host .selectable-container ::slotted(cura-paragraph){--margin-block:0 !important;--color-spot:var(--primary) !important}:host .selectable-container ::slotted(cura-heading){--color-body:var(--neutral-black) !important}:host .selectable-container ::slotted(cura-paragraph){--color-body:var(--neutral-dark) !important}:host .selected{background-color:var(--primary-lighter-50);border-bottom-color:var(--primary-light)}:host .selected .selectable-container{cursor:default}:host .selected .selectable-container ::slotted(cura-icon){--color:var(--primary) !important}:host .selected .selectable-container ::slotted(cura-heading){--color-body:var(--primary) !important}:host .actions-container{display:flex}:host .actions-container ::slotted(*){padding-left:calc(var(--cura-spacing-base) * 1px)}:host .not-selectable .selectable-container{cursor:default}:host(:last-child) .component-container{border-bottom:none !important}";
|
|
4
|
+
const CuraDropdownSearchOptionNewStyle0 = curaDropdownSearchOptionNewCss;
|
|
5
|
+
|
|
6
|
+
const CuraDropdownSearchOptionNew$1 = /*@__PURE__*/ proxyCustomElement(class CuraDropdownSearchOptionNew extends HTMLElement {
|
|
7
|
+
constructor() {
|
|
8
|
+
super();
|
|
9
|
+
this.__registerHost();
|
|
10
|
+
this.__attachShadow();
|
|
11
|
+
this.actionclick = createEvent(this, "actionclick", 7);
|
|
12
|
+
this.selectoption = createEvent(this, "selectoption", 7);
|
|
13
|
+
this.styles = {};
|
|
14
|
+
this.theme = window.CuraAPI.theme;
|
|
15
|
+
this.value = undefined;
|
|
16
|
+
this.optionid = undefined;
|
|
17
|
+
this.selectable = true;
|
|
18
|
+
this.selected = false;
|
|
19
|
+
this.highlighted = false;
|
|
20
|
+
}
|
|
21
|
+
connectedCallback() {
|
|
22
|
+
this.styles = {
|
|
23
|
+
'--neutral-light': this.theme.colors.getColor('neutral-light'),
|
|
24
|
+
'--neutral-white': this.theme.colors.getColor('neutral-white'),
|
|
25
|
+
'--neutral-dark': this.theme.colors.getColor('neutral-dark'),
|
|
26
|
+
'--neutral-black': this.theme.colors.getColor('neutral-black'),
|
|
27
|
+
'--primary-lighter-50': this.theme.colors.getColor('primary-lighter', .5),
|
|
28
|
+
'--primary-light': this.theme.colors.getColor('primary-light'),
|
|
29
|
+
'--primary': this.theme.colors.getColor('primary-base')
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
handleSelect() {
|
|
33
|
+
if (this.selectable) {
|
|
34
|
+
this.selectoption.emit(this.optionid);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
this.actionclick.emit();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
handleActionsClick() {
|
|
41
|
+
this.actionclick.emit();
|
|
42
|
+
}
|
|
43
|
+
getClasses() {
|
|
44
|
+
return {
|
|
45
|
+
'component-container': true,
|
|
46
|
+
'selected': this.selected,
|
|
47
|
+
'highlighted': this.highlighted,
|
|
48
|
+
'not-selectable': !this.selectable
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
render() {
|
|
52
|
+
return (h(Host, { key: '270721328007e38163582a288da503001dfd28f7' }, h("div", { key: 'bbcfeca78e0cfb86d3bdcf5d23a25c27ba2bd0ed', class: this.getClasses(), style: this.styles }, h("div", { key: '86774ca830346536a6591310c42c3806abed7273', class: "selectable-container", onClick: () => this.handleSelect() }, h("slot", { key: '2fe370d3a1cd2df9226634cc0a6812b4131de60e', name: 'image' }), h("div", { key: 'ebafc4dcffdc7bf44414605424b4e86400f87602', class: "content" }, h("slot", { key: '2666ee970d53d21dd04c58fea2725163e936d96d' }))), h("div", { key: '55f0cdbd76d03921722796e1b261500dce39ada5', class: "actions-container", onClick: () => this.handleActionsClick() }, h("slot", { key: '34528c19855eca4ecd151310959d8a496deb152b', name: 'actions' })))));
|
|
53
|
+
}
|
|
54
|
+
static get style() { return CuraDropdownSearchOptionNewStyle0; }
|
|
55
|
+
}, [1, "cura-dropdown-search-option-new", {
|
|
56
|
+
"value": [1],
|
|
57
|
+
"optionid": [1],
|
|
58
|
+
"selectable": [516],
|
|
59
|
+
"selected": [516],
|
|
60
|
+
"highlighted": [516]
|
|
61
|
+
}]);
|
|
62
|
+
function defineCustomElement$1() {
|
|
63
|
+
if (typeof customElements === "undefined") {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
const components = ["cura-dropdown-search-option-new"];
|
|
67
|
+
components.forEach(tagName => { switch (tagName) {
|
|
68
|
+
case "cura-dropdown-search-option-new":
|
|
69
|
+
if (!customElements.get(tagName)) {
|
|
70
|
+
customElements.define(tagName, CuraDropdownSearchOptionNew$1);
|
|
71
|
+
}
|
|
72
|
+
break;
|
|
73
|
+
} });
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const CuraDropdownSearchOptionNew = CuraDropdownSearchOptionNew$1;
|
|
77
|
+
const defineCustomElement = defineCustomElement$1;
|
|
78
|
+
|
|
79
|
+
export { Cura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QAChB,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;KACzB;IAED,UAAU;QACR,OAAO;YACL,qBAAqB,EAAE,IAAI;YAC3B,UAAU,EAAE,IAAI,CAAC,QAAQ;YACzB,aAAa,EAAE,IAAI,CAAC,WAAW;YAC/B,gBAAgB,EAAE,CAAC,IAAI,CAAC,UAAU;SACnC,CAAA;KACF;IAED,MAAM;QACJ,QACE,EAAC,IAAI,uDACH,4DAAK,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,IAC/C,4DAAK,KAAK,EAAC,sBAAsB,EAAC,OAAO,EAAG,MAAM,IAAI,CAAC,YAAY,EAAE,IACnE,6DAAM,IAAI,EAAC,OAAO,GAAQ,EAC1B,4DAAK,KAAK,EAAC,SAAS,IAClB,8DAAa,CACT,CACF,EACN,4DAAK,KAAK,EAAC,mBAAmB,EAAC,OAAO,EAAG,MAAM,IAAI,CAAC,kBAAkB,EAAE,IACtE,6DAAM,IAAI,EAAC,SAAS,GAAQ,CACxB,CACF,CACD,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["CuraDropdownSearchOptionNew"],"sources":["src/components/cura-dropdown-search-new/cura-dropdown-search-option-new/cura-dropdown-search-option-new.scss?tag=cura-dropdown-search-option-new&encapsulation=shadow","src/components/cura-dropdown-search-new/cura-dropdown-search-option-new/cura-dropdown-search-option-new.tsx"],"sourcesContent":["@import '../../../scss/mixins/spacing.scss';\n@import '../../../scss/mixins/dropdown-search-options.scss';\n\n:host {\n @include host-component();\n\n .component-container {\n @include component-container();\n transition: background-color .15s linear;\n }\n\n .component-container:not(.selected):not(.not-selectable):has(.selectable-container:hover),\n .component-container:not(.selected):not(.not-selectable).highlighted {\n background-color: var(--neutral-white);\n }\n\n .selectable-container {\n flex: 1;\n display: flex;\n align-items: center;\n justify-content: flex-start;\n padding: #{$spacing-xxxs} 0;\n min-height: #{$spacing-l};\n gap: #{$spacing-tiny};\n cursor: pointer;\n\n .content {\n flex: 1;\n align-items: center;\n justify-content: flex-end;\n padding-right: #{$spacing-tiny};\n }\n\n ::slotted(cura-icon) {\n --color: var(--neutral-dark) !important;\n margin: 0 10px;\n }\n ::slotted(cura-avatar) {\n margin: 0 #{$spacing-tiny};\n }\n ::slotted(cura-heading),\n ::slotted(cura-paragraph) {\n --margin-block: 0 !important;\n --color-spot: var(--primary) !important;\n }\n ::slotted(cura-heading) {\n --color-body: var(--neutral-black) !important;\n }\n ::slotted(cura-paragraph) {\n --color-body: var(--neutral-dark) !important;\n }\n }\n\n .selected {\n background-color: var(--primary-lighter-50);\n border-bottom-color: var(--primary-light);\n\n .selectable-container {\n cursor: default;\n\n ::slotted(cura-icon) {\n --color: var(--primary) !important;\n }\n ::slotted(cura-heading) {\n --color-body: var(--primary) !important;\n }\n }\n }\n\n .actions-container {\n display: flex;\n\n ::slotted(*) {\n padding-left: #{$spacing-tiny};\n }\n }\n\n .not-selectable {\n .selectable-container {\n cursor: default;\n }\n }\n}\n\n:host(:last-child) {\n @include host-last-child();\n}\n","import { Component, Host, h, Prop, Event, EventEmitter } from '@stencil/core';\n\n@Component({\n tag: 'cura-dropdown-search-option-new',\n styleUrl: 'cura-dropdown-search-option-new.scss',\n shadow: true,\n})\nexport class CuraDropdownSearchOptionNew {\n\n /**\n * Required. The value for item term reference.\n * This will set the value of the seaarch field when the option is selected.\n */\n @Prop() value!: string;\n /**\n * Required. The unique identifier for the option.\n * This will reference the option element for the parent.\n */\n @Prop() optionid!: string;\n /**\n * Enable selection for this option.\n * Default is true.\n */\n @Prop({reflect: true}) selectable: boolean = true;\n /**\n * Selected state.\n * This will be managed by the parent component.\n * Default is false.\n */\n @Prop({reflect: true}) selected: boolean = false;\n /**\n * Highlighted state.\n * This will be managed by the parent component.\n * Default is false.\n */\n @Prop({reflect: true}) highlighted: boolean = false;\n\n @Event() actionclick: EventEmitter<any>;\n @Event() selectoption: EventEmitter<string>;\n\n styles = {};\n theme = window.CuraAPI.theme;\n\n connectedCallback() {\n this.styles = {\n '--neutral-light': this.theme.colors.getColor('neutral-light'),\n '--neutral-white': this.theme.colors.getColor('neutral-white'),\n '--neutral-dark': this.theme.colors.getColor('neutral-dark'),\n '--neutral-black': this.theme.colors.getColor('neutral-black'),\n '--primary-lighter-50': this.theme.colors.getColor('primary-lighter', .5),\n '--primary-light': this.theme.colors.getColor('primary-light'),\n '--primary': this.theme.colors.getColor('primary-base')\n };\n }\n\n handleSelect() {\n if( this.selectable ) {\n this.selectoption.emit(this.optionid);\n } else {\n this.actionclick.emit();\n }\n }\n\n handleActionsClick() {\n this.actionclick.emit();\n }\n\n getClasses() {\n return {\n 'component-container': true,\n 'selected': this.selected,\n 'highlighted': this.highlighted,\n 'not-selectable': !this.selectable\n }\n }\n\n render() {\n return (\n <Host>\n <div class={this.getClasses()} style={this.styles}>\n <div class=\"selectable-container\" onClick={ () => this.handleSelect() }>\n <slot name='image'></slot>\n <div class=\"content\">\n <slot></slot>\n </div>\n </div>\n <div class=\"actions-container\" onClick={ () => this.handleActionsClick() }>\n <slot name='actions'></slot>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -11,7 +11,7 @@ const CuraDropdownSearchOptionTitle$1 = /*@__PURE__*/ proxyCustomElement(class C
|
|
|
11
11
|
this.__attachShadow();
|
|
12
12
|
}
|
|
13
13
|
render() {
|
|
14
|
-
return (h(Host, { key: '
|
|
14
|
+
return (h(Host, { key: '4782e0381a903b7b71851e7ccee12ef94a3343ab', slot: "dropdown-search-option" }, h("cura-label", { key: '4f287507290fc374eef609a3c18e1fc9ba970ae7', color: "neutral-dark", size: "xsmall", lineHeight: "16px", marginBlock: "0" }, h("slot", { key: 'a5d129e76e15613b8983acd2034808803cbf1f38' }))));
|
|
15
15
|
}
|
|
16
16
|
static get style() { return CuraDropdownSearchOptionTitleStyle0; }
|
|
17
17
|
}, [1, "cura-dropdown-search-option-title"]);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { d as defineCustomElement$2 } from './cura-heading2.js';
|
|
3
3
|
|
|
4
|
-
const curaDropdownSearchOptionCss = ":host{display:block;box-sizing:border-box;width:100%}:host(:last-of-type) .content-container{border-bottom:none}.option-container{width:100%;display:flex}.option-container:hover:not(.disabled):not(.selected) .content-container{background-color:var(--neutral-white)}.option-container.selected .content-container{background-color:var(--primary-lighter)}.option-container.disabled{cursor:default}.content-container{display:flex;width:100%;box-sizing:border-box;padding:calc(var(--
|
|
4
|
+
const curaDropdownSearchOptionCss = ":host{display:block;box-sizing:border-box;width:100%}:host(:last-of-type) .content-container{border-bottom:none}.option-container{width:100%;display:flex}.option-container:hover:not(.disabled):not(.selected) .content-container{background-color:var(--neutral-white)}.option-container.selected .content-container{background-color:var(--primary-lighter)}.option-container.disabled{cursor:default}.content-container{display:flex;width:100%;box-sizing:border-box;padding:calc(var(--cura-spacing-base) * 2px) calc(var(--cura-spacing-base) * 1px);background-color:var(--neutral-purewhite);border-bottom:1px solid var(--neutral-light)}.content-container ::slotted(div[slot=action]){display:flex;justify-content:end}.option-info{width:100%;display:flex;align-items:center;align-content:center;justify-content:center;gap:calc(var(--cura-spacing-base) * 2px);flex-direction:row;box-sizing:border-box;cursor:pointer}.option-info cura-heading{width:100%;margin-block:0px}.option-info ::slotted(div[slot=image]){min-width:calc(var(--cura-spacing-base) * 8px);display:flex;justify-content:center;align-items:center}";
|
|
5
5
|
const CuraDropdownSearchOptionStyle0 = curaDropdownSearchOptionCss;
|
|
6
6
|
|
|
7
7
|
const CuraDropdownSearchOption$1 = /*@__PURE__*/ proxyCustomElement(class CuraDropdownSearchOption extends HTMLElement {
|
|
@@ -45,12 +45,12 @@ const CuraDropdownSearchOption$1 = /*@__PURE__*/ proxyCustomElement(class CuraDr
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
render() {
|
|
48
|
-
return (h(Host, { key: '
|
|
48
|
+
return (h(Host, { key: '81c4404d784d2038823d84bf2b4beef53a874644', slot: "dropdown-search-option" }, h("div", { key: '476757ab00466607c2ab01a2b5a82da4c45087af', style: this.styles, class: {
|
|
49
49
|
"option-container": true,
|
|
50
50
|
hovered: this.selectable ? this.hovered : false,
|
|
51
51
|
selected: this.selected,
|
|
52
52
|
disabled: !this.selectable
|
|
53
|
-
} }, h("div", { key: '
|
|
53
|
+
} }, h("div", { key: '2a35edbe88ed99587972e0e657250867cb6ba814', class: "content-container" }, h("div", { key: '5bb136c9c5386d6c40985a86bc7e2e85c239110e', class: "option-info", onClick: (e) => this.handleOptionClick(e) }, h("slot", { key: 'f5ad44434728cb3879819f6016fcf9927354c05f', name: "image" }), h("cura-heading", { key: '43fa2a1c1a206f6bd1b0f52f5bc536cbb98bbe56', size: "xsmall", lineHeight: "16px", marginBlock: "0px", weight: "bold", color: "neutral-black" }, h("slot", { key: '197963392c5cef12d29dfbe312f4359b950de9f3' }))), h("slot", { key: '146144af1e1a5d1a18eb2aceaa71b749a4c61ba6', name: "action" })))));
|
|
54
54
|
}
|
|
55
55
|
get hostElement() { return this; }
|
|
56
56
|
static get watchers() { return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"cura-dropdown-search-option.js","mappings":";;;AAAA,MAAM,2BAA2B,GAAG,
|
|
1
|
+
{"file":"cura-dropdown-search-option.js","mappings":";;;AAAA,MAAM,2BAA2B,GAAG,8kCAA8kC,CAAC;AACnnC,uCAAe,2BAA2B;;MCM7BA,0BAAwB;;;;;;QAyC3B,sBAAiB,GAAG,CAAC,CAAQ;YACnC,IAAI,IAAI,CAAC,UAAU,EAAE;gBACnB,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC;gBAC/B,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBACrC,IAAI,CAAC,eAAe,EAAE,CAAC;aACxB;iBAAM;gBACL,CAAC,CAAC,c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AAI,EAAC,wBAAwB,IACjC,4DACE,KAAK,EAAE,IAAI,CAAC,MAAM,EAClB,KAAK,EAAE;gBACL,kBAAkB,EAAE,IAAI;gBACxB,OAAO,EAAE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,OAAO,GAAG,KAAK;gBAC/C,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,QAAQ,EAAE,CAAC,IAAI,CAAC,UAAU;aAC3B,IACD,4DAAK,KAAK,EAAC,mBAAmB,IAC5B,4DAAK,KAAK,EAAC,aAAa,EAAC,OAAO,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,IAChE,6DAAM,IAAI,EAAC,OAAO,GAAQ,EAC1B,qEAAc,IAAI,EAAC,QAAQ,EAAC,UAAU,EAAC,MAAM,EAAC,WAAW,EAAC,KAAK,EAAC,MAAM,EAAC,MAAM,EAAC,KAAK,EAAC,eAAe,IACjG,8DAAa,CACA,CACX,EACN,6DAAM,IAAI,EAAC,QAAQ,GAAQ,CACvB,CACF,CACD,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["CuraDropdownSearchOption"],"sources":["src/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.scss?tag=cura-dropdown-search-option&encapsulation=shadow","src/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.tsx"],"sourcesContent":["@import \"../../../../scss/mixins/spacing.scss\";\n\n:host {\n display: block;\n box-sizing: border-box;\n width: 100%;\n}\n\n:host(:last-of-type) .content-container {\n border-bottom: none;\n}\n\n.option-container {\n width: 100%;\n display: flex;\n\n &:hover:not(.disabled):not(.selected) .content-container {\n background-color: var(--neutral-white);\n }\n\n &.selected .content-container {\n background-color: var(--primary-lighter);\n }\n\n &.disabled {\n cursor: default;\n }\n}\n\n.content-container {\n display: flex;\n width: 100%;\n box-sizing: border-box;\n padding: #{$spacing-mini} #{$spacing-tiny};\n background-color: var(--neutral-purewhite);\n border-bottom: 1px solid var(--neutral-light);\n\n ::slotted(div[slot='action']) {\n display: flex;\n justify-content: end;\n }\n}\n\n.option-info {\n width: 100%;\n display: flex;\n align-items: center;\n align-content: center;\n justify-content: center;\n gap: #{$spacing-mini};\n flex-direction: row;\n box-sizing: border-box;\n cursor: pointer;\n\n cura-heading {\n width: 100%;\n margin-block: 0px;\n }\n\n ::slotted(div[slot='image']) {\n min-width: #{$spacing-m};\n display: flex;\n justify-content: center;\n align-items: center;\n }\n}\n","import { Component, Element, Event, EventEmitter, Host, Prop, State, Watch, h } from '@stencil/core';\n\n@Component({\n tag: 'cura-dropdown-search-option',\n styleUrl: 'cura-dropdown-search-option.scss',\n shadow: true,\n})\nexport class CuraDropdownSearchOption {\n /**\n * The value of the dropdown search option.\n */\n @Prop({ reflect: true }) value: string;\n\n /**\n * Indicates if the dropdown search option is selected.\n */\n @Prop({ reflect: true, mutable: true }) selected: boolean = false;\n\n /**\n * Indicates if the dropdown search is selectable.\n */\n @Prop({ reflect: true }) selectable: boolean = true;\n\n /**\n * Indicates if the dropdown search option is hovered.\n */\n @Prop({ reflect: true, mutable: true }) hovered: boolean = false;\n\n @State() styles = {};\n\n /**\n * Event emitted when the option is selected.\n */\n @Event() optionSelected: EventEmitter<string>;\n\n @Element() hostElement: HTMLElement;\n\n weights;\n\n connectedCallback() {\n this.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-light'] = window.CuraAPI.theme.colors.getColor(`neutral-light`);\n this.styles['--neutral-white'] = window.CuraAPI.theme.colors.getColor(`neutral-white`);\n this.styles['--primary-lighter'] = window.CuraAPI.theme.colors.getColor(`primary-lighter`, 50);\n }\n\n private handleOptionClick = (e: Event) => {\n if (this.selectable) {\n this.selected = !this.selected;\n this.optionSelected.emit(this.value);\n this.updateIconColor();\n } else {\n e.preventDefault();\n e.stopImmediatePropagation();\n }\n };\n\n componentDidLoad() {\n this.updateIconColor();\n }\n\n @Watch('selected')\n private updateIconColor() {\n const iconElement = this.hostElement.querySelector('[slot=\"image\"] cura-icon');\n if (iconElement) {\n iconElement.setAttribute('color', this.selected ? 'primary' : 'neutral-dark');\n }\n }\n\n render() {\n return (\n <Host slot=\"dropdown-search-option\">\n <div\n style={this.styles}\n class={{\n \"option-container\": true,\n hovered: this.selectable ? this.hovered : false,\n selected: this.selected,\n disabled: !this.selectable\n }}>\n <div class=\"content-container\">\n <div class=\"option-info\" onClick={(e) => this.handleOptionClick(e)}>\n <slot name=\"image\"></slot>\n <cura-heading size=\"xsmall\" lineHeight=\"16px\" marginBlock=\"0px\" weight=\"bold\" color=\"neutral-black\">\n <slot></slot>\n </cura-heading>\n </div>\n <slot name=\"action\"></slot>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
|
@@ -272,9 +272,9 @@ const CuraDropdownSearch$1 = /*@__PURE__*/ proxyCustomElement(class CuraDropdown
|
|
|
272
272
|
}
|
|
273
273
|
render() {
|
|
274
274
|
const isMobileDropdown = this.isMobile && this.isDropdownOpen;
|
|
275
|
-
return (h(Host, { key: '
|
|
275
|
+
return (h(Host, { key: '8e47b4652a5f7143b9f9d8704105624debd5ab86', style: this.hostCSSProperties(), class: "dropdown-overlay" }, h("div", { key: 'a5c9a6878be61268fb2a6fe5f42c3811aaa25e92', class: `dropdown ${isMobileDropdown ? 'dropdown-mobile' : ''}`, style: this.styles }, h("div", { key: 'c10d5a2793e7961370f63b124eb8538c0fe161a2', class: this.getClasses() }, this.isMobile && this.isDropdownOpen && (h("cura-button-transparent", { key: 'a5d8233857277aa56c7d4d8048c8d8199635f117', fontColor: "dark", onClick: () => this.handleGoBack(), iconName: "arrowLeft", size: "medium", iconOnly: true, color: "primary" })), h("cura-input-text", { key: '1f780e794a2e42fa4771f9f6f5cb04f44d5d17d3', 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: () => {
|
|
276
276
|
this.handleOnBlur();
|
|
277
|
-
}, placeholder: this.placeholder, size: this.size, onKeyDown: this.handleKeyDown }, h("slot", { key: '
|
|
277
|
+
}, placeholder: this.placeholder, size: this.size, onKeyDown: this.handleKeyDown }, h("slot", { key: '87882a490816c64d8780ce4a02b975034e111473', name: "helperText" }))), h("div", { key: 'b0120ab7c2db1a5dcc071e4b79f9aac7d50ae998', id: "dropdown-search-list", class: this.getDropdownClasses() }, h("slot", { key: 'b780c4b317c6aa557a6be5fe3d4c957d943b92c8', name: "dropdown-search-option", onSlotchange: this.handleSlotChange })))));
|
|
278
278
|
}
|
|
279
279
|
get host() { return this; }
|
|
280
280
|
static get watchers() { return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
|
|
3
|
-
const curaHeadingCss = ":host{display:block;font-size:var(--font-size-base)}:host h1,:host h2,:host h3,:host h4,:host h5,:host h6{font-family:var(--font-family);font-size:1.714em;font-weight:var(--font-weight-regular);color:var(--color-body);line-height:var(--line-height);margin-block:var(--margin-block);letter-spacing:0px}:host h1.bold-weight,:host h2.bold-weight,:host h3.bold-weight,:host h4.bold-weight,:host h5.bold-weight,:host h6.bold-weight{font-weight:var(--font-weight-medium)}:host h1.large,:host h2.large,:host h3.large,:host h4.large,:host h5.large,:host h6.large{font-size:2.071em;letter-spacing:-0.58px}:host h1.small,:host h2.small,:host h3.small,:host h4.small,:host h5.small,:host h6.small{font-size:1.214em;line-height:calc(var(--line-height) + 20%)}:host h1.small.bold-weight,:host h1.small ::slotted(b),:host h1.small ::slotted(strong),:host h2.small.bold-weight,:host h2.small ::slotted(b),:host h2.small ::slotted(strong),:host h3.small.bold-weight,:host h3.small ::slotted(b),:host h3.small ::slotted(strong),:host h4.small.bold-weight,:host h4.small ::slotted(b),:host h4.small ::slotted(strong),:host h5.small.bold-weight,:host h5.small ::slotted(b),:host h5.small ::slotted(strong),:host h6.small.bold-weight,:host h6.small ::slotted(b),:host h6.small ::slotted(strong){font-weight:var(--font-weight-bold)}:host h1.xsmall,:host h2.xsmall,:host h3.xsmall,:host h4.xsmall,:host h5.xsmall,:host h6.xsmall{font-size:0.
|
|
3
|
+
const curaHeadingCss = ":host{display:block;font-size:var(--font-size-base)}:host h1,:host h2,:host h3,:host h4,:host h5,:host h6{font-family:var(--font-family);font-size:1.714em;font-weight:var(--font-weight-regular);color:var(--color-body);line-height:var(--line-height);margin-block:var(--margin-block);letter-spacing:0px}:host h1.bold-weight,:host h2.bold-weight,:host h3.bold-weight,:host h4.bold-weight,:host h5.bold-weight,:host h6.bold-weight{font-weight:var(--font-weight-medium)}:host h1.large,:host h2.large,:host h3.large,:host h4.large,:host h5.large,:host h6.large{font-size:2.071em;letter-spacing:-0.58px}:host h1.small,:host h2.small,:host h3.small,:host h4.small,:host h5.small,:host h6.small{font-size:1.214em;line-height:calc(var(--line-height) + 20%)}:host h1.small.bold-weight,:host h1.small ::slotted(b),:host h1.small ::slotted(strong),:host h2.small.bold-weight,:host h2.small ::slotted(b),:host h2.small ::slotted(strong),:host h3.small.bold-weight,:host h3.small ::slotted(b),:host h3.small ::slotted(strong),:host h4.small.bold-weight,:host h4.small ::slotted(b),:host h4.small ::slotted(strong),:host h5.small.bold-weight,:host h5.small ::slotted(b),:host h5.small ::slotted(strong),:host h6.small.bold-weight,:host h6.small ::slotted(b),:host h6.small ::slotted(strong){font-weight:var(--font-weight-bold)}:host h1.xsmall,:host h2.xsmall,:host h3.xsmall,:host h4.xsmall,:host h5.xsmall,:host h6.xsmall{font-size:0.8571428571em;font-weight:var(--font-weight-medium);letter-spacing:0.6px}:host h1.xsmall.bold-weight,:host h1.xsmall ::slotted(b),:host h1.xsmall ::slotted(strong),:host h2.xsmall.bold-weight,:host h2.xsmall ::slotted(b),:host h2.xsmall ::slotted(strong),:host h3.xsmall.bold-weight,:host h3.xsmall ::slotted(b),:host h3.xsmall ::slotted(strong),:host h4.xsmall.bold-weight,:host h4.xsmall ::slotted(b),:host h4.xsmall ::slotted(strong),:host h5.xsmall.bold-weight,:host h5.xsmall ::slotted(b),:host h5.xsmall ::slotted(strong),:host h6.xsmall.bold-weight,:host h6.xsmall ::slotted(b),:host h6.xsmall ::slotted(strong){font-weight:var(--font-weight-bold)}@media (min-width: 769px) and (max-width: 1920px){:host h1,:host h2,:host h3,:host h4,:host h5,:host h6{font-size:2em}:host h1.large,:host h2.large,:host h3.large,:host h4.large,:host h5.large,:host h6.large{font-size:2.357em;letter-spacing:-0.66px}:host h1.small,:host h2.small,:host h3.small,:host h4.small,:host h5.small,:host h6.small{font-size:1.357em}:host h1.xsmall,:host h2.xsmall,:host h3.xsmall,:host h4.xsmall,:host h5.xsmall,:host h6.xsmall{font-size:0.8571428571em;line-height:calc(var(--line-height) + 3%);letter-spacing:0.72px}}@media (min-width: 1921px){:host h1,:host h2,:host h3,:host h4,:host h5,:host h6{font-size:2.5em;line-height:calc(var(--line-height) + 5%);letter-spacing:-0.82px}:host h1.large,:host h2.large,:host h3.large,:host h4.large,:host h5.large,:host h6.large{font-size:2.929em}:host h1.small,:host h2.small,:host h3.small,:host h4.small,:host h5.small,:host h6.small{font-size:1.714em;line-height:calc(var(--line-height) + 30%);letter-spacing:0%}:host h1.xsmall,:host h2.xsmall,:host h3.xsmall,:host h4.xsmall,:host h5.xsmall,:host h6.xsmall{font-size:1em;line-height:calc(var(--line-height) + 12.857%);letter-spacing:0.28px}}:host ::slotted(b),:host ::slotted(strong){font-weight:var(--font-weight-medium)}:host ::slotted(a){font-weight:var(--font-weight-bold);color:var(--color-spot);text-underline-offset:10%;cursor:pointer}:host ::slotted(u){text-underline-offset:10%}:host ::slotted(abbr){color:var(--color-spot);text-decoration:underline dashed 1px var(--color-spot);text-underline-offset:10%;cursor:default}:host ::slotted(i){font-weight:var(--font-weight-medium)}:host ::slotted(em){color:var(--color-spot);font-weight:var(--font-weight-bold);font-style:normal}";
|
|
4
4
|
const CuraHeadingStyle0 = curaHeadingCss;
|
|
5
5
|
|
|
6
6
|
const CuraHeading = /*@__PURE__*/ proxyCustomElement(class CuraHeading extends HTMLElement {
|
|
@@ -18,12 +18,8 @@ const CuraHeading = /*@__PURE__*/ proxyCustomElement(class CuraHeading extends H
|
|
|
18
18
|
this.lineHeight = '130%';
|
|
19
19
|
this.styles = {};
|
|
20
20
|
}
|
|
21
|
-
handleChangeColor() {
|
|
22
|
-
this.setColors();
|
|
23
|
-
}
|
|
24
21
|
connectedCallback() {
|
|
25
22
|
this.setFontProperties();
|
|
26
|
-
this.setColors();
|
|
27
23
|
}
|
|
28
24
|
getClasses() {
|
|
29
25
|
const classes = {};
|
|
@@ -51,11 +47,9 @@ const CuraHeading = /*@__PURE__*/ proxyCustomElement(class CuraHeading extends H
|
|
|
51
47
|
'--font-size-base': this.fontSizeBase,
|
|
52
48
|
'--line-height': this.lineHeight,
|
|
53
49
|
'--color-body': fontColor || this.theme.colors.getColor('neutral-darker'),
|
|
50
|
+
'--color-spot': this.theme.colors.getColor(`${this.spotColor}`)
|
|
54
51
|
};
|
|
55
52
|
}
|
|
56
|
-
setColors() {
|
|
57
|
-
this.styles = Object.assign(Object.assign({}, this.styles), { '--color-link': this.theme.colors.getColor(`${this.spotColor}`) });
|
|
58
|
-
}
|
|
59
53
|
getHeadingTag() {
|
|
60
54
|
const tags = {
|
|
61
55
|
'1': h("h1", { style: this.styles, class: this.getClasses() }, h("slot", null)),
|
|
@@ -69,26 +63,19 @@ const CuraHeading = /*@__PURE__*/ proxyCustomElement(class CuraHeading extends H
|
|
|
69
63
|
return tags[`${this.level}`] || tags['default'];
|
|
70
64
|
}
|
|
71
65
|
render() {
|
|
72
|
-
return (h(Host, { key: '
|
|
66
|
+
return (h(Host, { key: '4391dea57899c00ccd536f007f3054c162957fad', style: this.hostCSSProperties() }, this.getHeadingTag()));
|
|
73
67
|
}
|
|
74
68
|
get host() { return this; }
|
|
75
|
-
static get watchers() { return {
|
|
76
|
-
"color": ["handleChangeColor"],
|
|
77
|
-
"spotColor": ["handleChangeColor"]
|
|
78
|
-
}; }
|
|
79
69
|
static get style() { return CuraHeadingStyle0; }
|
|
80
70
|
}, [1, "cura-heading", {
|
|
81
71
|
"level": [514],
|
|
82
72
|
"size": [513],
|
|
83
73
|
"weight": [513],
|
|
84
74
|
"spotColor": [513, "spot-color"],
|
|
85
|
-
"color": [
|
|
75
|
+
"color": [513],
|
|
86
76
|
"marginBlock": [513, "margin-block"],
|
|
87
77
|
"lineHeight": [513, "line-height"],
|
|
88
78
|
"styles": [32]
|
|
89
|
-
}, undefined, {
|
|
90
|
-
"color": ["handleChangeColor"],
|
|
91
|
-
"spotColor": ["handleChangeColor"]
|
|
92
79
|
}]);
|
|
93
80
|
function defineCustomElement() {
|
|
94
81
|
if (typeof customElements === "undefined") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"cura-heading2.js","mappings":";;AAAA,MAAM,cAAc,GAAG,
|
|
1
|
+
{"file":"cura-heading2.js","mappings":";;AAAA,MAAM,cAAc,GAAG,osHAAosH,CAAC;AAC5tH,0BAAe,cAAc;;MCMhB,WAAW;;;;;QAuDtB,UAAK,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;qBAjD0B,CAAC;oBAMuC,QAAQ;sBAMnD,SAAS;yBAM1B,aAAa;;2BAYX,QAAQ;0BAMT,MAAM;sBAYxB,EAAE;;IAGpB,iBAAiB;QACf,IAAI,CAAC,iBAAiB,EAAE,CAAC;KAC1B;IAED,UAAU;QACR,MAAM,OAAO,GAAG,EAAE,CAAC;QACnB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,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ACX,GAAG,EAAE,UAAI,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,IAAE,eAAa,CAAK;YACzE,GAAG,EAAE,UAAI,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,IAAE,eAAa,CAAK;YACzE,GAAG,EAAE,UAAI,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,IAAE,eAAa,CAAK;YACzE,GAAG,EAAE,UAAI,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,IAAE,eAAa,CAAK;YACzE,GAAG,EAAE,UAAI,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,IAAE,eAAa,CAAK;YACzE,GAAG,EAAE,UAAI,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,IAAE,eAAa,CAAK;YACzE,SAAS,EAAE,UAAI,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,IAAE,eAAa,CAAK;SAChF,CAAC;QACF,OAAO,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC;KACjD;IAED,MAAM;QACJ,QACE,EAAC,IAAI,qDAAC,KAAK,EAAE,IAAI,CAAC,iBAAiB,EAAE,IACjC,IAAI,CAAC,aAAa,EAAE,CACjB,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/text/cura-heading/cura-heading.scss?tag=cura-heading&encapsulation=shadow","src/components/text/cura-heading/cura-heading.tsx"],"sourcesContent":["@import '../../../scss/mixins/responsive.scss';\n\n:host {\n display: block;\n font-size: var(--font-size-base);\n\n h1, h2, h3, h4, h5, h6 {\n font-family: var(--font-family);\n font-size: 1.714em;\n font-weight: var(--font-weight-regular);\n color: var(--color-body);\n line-height: var(--line-height);\n margin-block: var(--margin-block);\n letter-spacing: 0px;\n\n &.bold-weight {\n font-weight: var(--font-weight-medium);\n }\n\n &.large {\n font-size: 2.071em;\n letter-spacing: -0.58px;\n }\n\n &.small {\n font-size: 1.214em;\n line-height: calc(var(--line-height) + 20%);\n\n &.bold-weight, ::slotted(b), ::slotted(strong) {\n font-weight: var(--font-weight-bold);\n }\n }\n\n &.xsmall {\n font-size: 0.8571428571428571em;\n font-weight: var(--font-weight-medium);\n letter-spacing: 0.6px;\n\n &.bold-weight, ::slotted(b), ::slotted(strong) {\n font-weight: var(--font-weight-bold);\n }\n }\n\n }\n\n @include medium-large() {\n h1, h2, h3, h4, h5, h6 {\n font-size: 2em;\n\n &.large {\n font-size: 2.357em;\n letter-spacing: -0.66px;\n }\n\n &.small {\n font-size: 1.357em;\n }\n\n &.xsmall {\n font-size: 0.8571428571428571em;\n line-height: calc(var(--line-height) + 3%);\n letter-spacing: 0.72px;\n }\n\n }\n }\n\n @include xlarge-only() {\n h1, h2, h3, h4, h5, h6 {\n font-size: 2.5em;\n line-height: calc(var(--line-height) + 5%);\n letter-spacing: -0.82px;\n\n &.large {\n font-size: 2.929em;\n }\n\n &.small {\n font-size: 1.714em;\n line-height: calc(var(--line-height) + 30%);\n letter-spacing: 0%;\n }\n\n &.xsmall {\n font-size: 1em;\n line-height: calc(var(--line-height) + 12.857%);\n letter-spacing: 0.28px;\n }\n }\n }\n\n ::slotted(b), ::slotted(strong) {\n font-weight: var(--font-weight-medium);\n }\n\n ::slotted(a) {\n font-weight: var(--font-weight-bold);\n color: var(--color-spot);\n text-underline-offset: 10%;\n cursor: pointer;\n }\n\n ::slotted(u) {\n text-underline-offset: 10%;\n }\n\n ::slotted(abbr) {\n color: var(--color-spot);\n text-decoration: underline dashed 1px var(--color-spot);\n text-underline-offset: 10%;\n cursor: default;\n }\n\n ::slotted(i) {\n font-weight: var(--font-weight-medium);\n }\n\n ::slotted(em) {\n color: var(--color-spot);\n font-weight: var(--font-weight-bold);\n font-style: normal;\n }\n\n}\n","import { Component, Host, h, Prop, Element, State } from '@stencil/core';\n\n@Component({\n tag: 'cura-heading',\n styleUrl: 'cura-heading.scss',\n shadow: true,\n})\nexport class CuraHeading {\n\n /**\n * Heading level for semantics. Will render the related HTML tag <h1>, <h2>, ...\n * Values: 1(default) to 6.\n */\n @Prop({reflect: true}) level: 1 | 2 | 3 | 4 | 5 | 6 = 1;\n\n /**\n * Heading style size.\n * Values: regular (deprecated), medium (default) | large | small | caption (deprecated) | xsmall.\n */\n @Prop({reflect: true}) size: 'regular' | 'medium' | 'large' | 'small' | 'caption' | 'xsmall' = 'medium';\n\n /**\n * Heading font weight. It is possible to use regular HTML tags like <b> or <strong> as well.\n * Values: regular (default) | bold.\n */\n @Prop({reflect: true}) weight: 'regular' | 'bold' = 'regular';\n\n /**\n * Apply design system color to interactive elements like <a> and <abbr> inside the text.\n * Values: Color from design system scheme. Default to 'accent-dark'.\n */\n @Prop({reflect: true}) spotColor = 'accent-dark';\n\n /**\n * Text color.\n * Values: Color from design system scheme. Default to the font color from the theme.\n */\n @Prop({reflect: true}) color: string;\n\n /**\n * CSS margin-block property values.\n * Default to 1.25em\n */\n @Prop({reflect: true}) marginBlock = '1.25em';\n\n /**\n * CSS line-height property values.\n * Default to 130%\n */\n @Prop({reflect: true}) lineHeight = '130%';\n\n /**\n * Host element <cura-heading>\n */\n @Element() host: HTMLElement;\n\n /**\n * Internal Props\n */\n weights: any;\n fontSizeBase: string;\n @State() styles = {};\n theme = window.CuraAPI.theme;\n\n connectedCallback() {\n this.setFontProperties();\n }\n\n getClasses() {\n const classes = {};\n classes[this.size.toLowerCase()] = true;\n classes[`${this.weight.toLowerCase()}-weight`] = true;\n return classes;\n }\n\n setFontProperties() {\n this.weights = this.theme.fonts.getWeights();\n this.fontSizeBase = this.theme.fonts.getSize();\n this.styles = {\n '--font-family': window.CuraAPI.theme.fonts.getFamily('heading'),\n '--font-weight-regular': this.weights.regular,\n '--font-weight-medium': this.weights.medium,\n '--font-weight-bold': this.weights.bold,\n '--font-weight-black': this.weights.black\n }\n }\n\n hostCSSProperties() {\n const fontColor = this.color\n ? this.theme.colors.getColor(this.color)\n : this.theme.fonts.getColor();\n return {\n '--margin-block': this.marginBlock,\n '--font-size-base': this.fontSizeBase,\n '--line-height': this.lineHeight,\n '--color-body': fontColor || this.theme.colors.getColor('neutral-darker'),\n '--color-spot': this.theme.colors.getColor(`${this.spotColor}`)\n };\n }\n\n getHeadingTag() {\n const tags = {\n '1': <h1 style={this.styles} class={this.getClasses()}><slot></slot></h1>,\n '2': <h2 style={this.styles} class={this.getClasses()}><slot></slot></h2>,\n '3': <h3 style={this.styles} class={this.getClasses()}><slot></slot></h3>,\n '4': <h4 style={this.styles} class={this.getClasses()}><slot></slot></h4>,\n '5': <h5 style={this.styles} class={this.getClasses()}><slot></slot></h5>,\n '6': <h6 style={this.styles} class={this.getClasses()}><slot></slot></h6>,\n 'default': <h1 style={this.styles} class={this.getClasses()}><slot></slot></h1>\n };\n return tags[`${this.level}`] || tags['default'];\n }\n\n render() {\n return (\n <Host style={this.hostCSSProperties()}>\n { this.getHeadingTag() }\n </Host>\n );\n }\n\n}\n"],"version":3}
|
|
@@ -47,7 +47,7 @@ const CuraIcon = /*@__PURE__*/ proxyCustomElement(class CuraIcon extends HTMLEle
|
|
|
47
47
|
this.host.style.setProperty(prop, value);
|
|
48
48
|
}
|
|
49
49
|
render() {
|
|
50
|
-
return (h(Host, { key: '
|
|
50
|
+
return (h(Host, { key: 'd2c7487f9fadebc1da94bc4b8cd661a75e0d93ef' }, h("svg", { key: 'd8d0a70bf11cce073da95cce58c2fca4705b4b9f', version: "1.1", viewBox: "0 0 24 24", preserveAspectRatio: "xMidYMid meet", xmlns: "http://www.w3.org/2000/svg" }, h("use", { key: '10f2f6c34ce7cc782de70d9e9cdd22f54e08acc9', xlinkHref: `${this.assetsPath}/icons/iconset-${this.iconset}.svg#${this.name}` }))));
|
|
51
51
|
}
|
|
52
52
|
get host() { return this; }
|
|
53
53
|
static get watchers() { return {
|
|
@@ -24,7 +24,7 @@ const CuraIconsView$1 = /*@__PURE__*/ proxyCustomElement(class CuraIconsView ext
|
|
|
24
24
|
this.sizes.unshift(this.sizes.pop());
|
|
25
25
|
}
|
|
26
26
|
render() {
|
|
27
|
-
return (h(Host, { key: '
|
|
27
|
+
return (h(Host, { key: '08ac6235b9218c2202cd4957bb78100216b5b680' }, h("div", { key: '71856330d5f050d46b83c06125d29a235532bf98', class: "iconDetail" }, h("cura-heading", { key: '2520247cde8d71b1a31ce028c4525b04e6302bf1', size: "small", "margin-block": "0 24px" }, "Icon: ", h("b", { key: '5cf48d96ed36dd5514357c65b0ec8c9f137bb1e4' }, this.selected)), h("div", { key: '7eda1e7db5efc89abb583631a5e959e31397684f', class: "iconSizes" }, this.sizes.map(size => h("div", { class: "size" }, h("cura-icon", { name: this.selected, size: size }), h("span", null, size)))), h("div", { key: 'f443dab7e85fe89a207da8fbefb024b0c22fa084', class: "iconSizes invert" }, this.sizes.map(size => h("div", { class: "size" }, h("cura-icon", { name: this.selected, size: size, color: "neutral-white" }), h("span", null, size))))), h("div", { key: '5ea3b71259ae5454297a94aef4ce1e154c968512', class: "icons" }, iconsetdefaulticons.map(icon => h("div", { class: { icon: true, selected: icon === this.selected }, onClick: () => this.setSelected(icon) }, h("cura-icon", { name: icon, size: "32", color: icon === this.selected ? 'accent-dark' : 'neutral-dark' }), h("cura-label", { size: "xsmall", weight: icon === this.selected ? 'bold' : 'regular', color: icon === this.selected ? 'accent-dark' : 'neutral-dark' }, icon))))));
|
|
28
28
|
}
|
|
29
29
|
static get style() { return CuraIconsViewStyle0; }
|
|
30
30
|
}, [1, "cura-icons-view", {
|
|
@@ -8,7 +8,7 @@ import { d as defineCustomElement$4 } from './cura-loader-circle2.js';
|
|
|
8
8
|
import { d as defineCustomElement$3 } from './cura-select2.js';
|
|
9
9
|
import { d as defineCustomElement$2 } from './cura-select-option2.js';
|
|
10
10
|
|
|
11
|
-
const curaInputDateCss = ":host{display:block}.container{display:flex;flex-direction:column;position:relative}.container .calendar{padding:0px calc(var(--
|
|
11
|
+
const curaInputDateCss = ":host{display:block}.container{display:flex;flex-direction:column;position:relative}.container .calendar{padding:0px calc(var(--cura-spacing-base) * 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}";
|
|
12
12
|
const CuraInputDateStyle0 = curaInputDateCss;
|
|
13
13
|
|
|
14
14
|
const CuraInputDate$1 = /*@__PURE__*/ proxyCustomElement(class CuraInputDate extends HTMLElement {
|
|
@@ -178,7 +178,7 @@ const CuraInputDate$1 = /*@__PURE__*/ proxyCustomElement(class CuraInputDate ext
|
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
180
|
render() {
|
|
181
|
-
return (h(Host, { key: '
|
|
181
|
+
return (h(Host, { key: '6561926408fe00e541e6e7932a448f5a46cb5909' }, h("div", { key: '23e9db15f773d76e01c1dd0d7b71d6765a9a6c26', class: "container", style: this.styles }, h("cura-input-text", { key: '040e257cfaf01fbf0bd087d3abf0d159e7d1ac7a', 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()))));
|
|
182
182
|
}
|
|
183
183
|
static get formAssociated() { return true; }
|
|
184
184
|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,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;iBAClC,GACD,CACE,EACN;SACH;aAAM;YACL,OAAO,IAAI,CAAC,UAAU,CAAC;SACxB;KACF;IAED,MAAM;QACJ,QACE,EAAC,IAAI,uDACH,4DAAK,KAAK,EAAC,WAAW,EAAC,KAAK,EAAE,IAAI,CAAC,MAAM,IACvC,wEACE,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,eACJ,IAAI,CAAC,QAAQ,EACxB,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":["CuraInputDate"],"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}
|
|
1
|
+
{"file":"cura-input-date.js","mappings":";;;;;;;;;;AAAA,MAAM,gBAAgB,GAAG,slBAAslB,CAAC;AAChnB,4BAAe,gBAAgB;;MCSlBA,eAAa;;;;;;;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,OAAO,CAAC,KAAK,CAAC;QACxD,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,EAAE,CAAC;QAEnC,IAAI,CAAC,MAAM,GAAG;YACZ,gBAAgB,EAAE,OAAO,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AgB,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":["CuraInputDate"],"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}
|