@rededor/cura 1.0.0 → 1.2.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/assets/assets/cura-assets.zip +0 -0
- package/dist/assets/assets/fonts/Gotham/Gotham-Black.woff2 +0 -0
- package/dist/assets/assets/fonts/Gotham/Gotham-BlackItalic.woff2 +0 -0
- package/dist/assets/assets/fonts/Gotham/Gotham-Bold.woff2 +0 -0
- package/dist/assets/assets/fonts/Gotham/Gotham-BoldItalic.woff2 +0 -0
- package/dist/assets/assets/fonts/Gotham/Gotham-Book.woff2 +0 -0
- package/dist/assets/assets/fonts/Gotham/Gotham-BookItalic.woff2 +0 -0
- package/dist/assets/assets/fonts/Gotham/Gotham-ExtraLight.woff2 +0 -0
- package/dist/assets/assets/fonts/Gotham/Gotham-ExtraLightItalic.woff2 +0 -0
- package/dist/assets/assets/fonts/Gotham/Gotham-Light.woff2 +0 -0
- package/dist/assets/assets/fonts/Gotham/Gotham-LightItalic.woff2 +0 -0
- package/dist/assets/assets/fonts/Gotham/Gotham-Medium.woff2 +0 -0
- package/dist/assets/assets/fonts/Gotham/Gotham-MediumItalic.woff2 +0 -0
- package/dist/assets/assets/fonts/Gotham/Gotham-Thin.woff2 +0 -0
- package/dist/assets/assets/fonts/Gotham/Gotham-ThinItalic.woff2 +0 -0
- package/dist/assets/assets/fonts/Gotham/Gotham-Ultra.woff2 +0 -0
- package/dist/assets/assets/fonts/Gotham/Gotham-UltraItalic.woff2 +0 -0
- package/dist/assets/assets/fonts/Gotham/style.css +90 -0
- package/dist/assets/assets/fonts/HankenGrotesk/HankenGrotesk-Italic-VariableFont_wght.woff2 +0 -0
- package/dist/assets/assets/fonts/HankenGrotesk/HankenGrotesk-VariableFont_wght.woff2 +0 -0
- package/dist/assets/assets/fonts/HankenGrotesk/style-webfont.css +72 -0
- package/dist/assets/assets/fonts/HankenGrotesk/style.css +16 -0
- package/dist/assets/assets/fonts/Roboto/Roboto-Black.woff2 +0 -0
- package/dist/assets/assets/fonts/Roboto/Roboto-BlackItalic.woff2 +0 -0
- package/dist/assets/assets/fonts/Roboto/Roboto-Bold.woff2 +0 -0
- package/dist/assets/assets/fonts/Roboto/Roboto-BoldItalic.woff2 +0 -0
- package/dist/assets/assets/fonts/Roboto/Roboto-Italic.woff2 +0 -0
- package/dist/assets/assets/fonts/Roboto/Roboto-Light.woff2 +0 -0
- package/dist/assets/assets/fonts/Roboto/Roboto-LightItalic.woff2 +0 -0
- package/dist/assets/assets/fonts/Roboto/Roboto-Medium.woff2 +0 -0
- package/dist/assets/assets/fonts/Roboto/Roboto-MediumItalic.woff2 +0 -0
- package/dist/assets/assets/fonts/Roboto/Roboto-Regular.woff2 +0 -0
- package/dist/assets/assets/fonts/Roboto/Roboto-Thin.woff2 +0 -0
- package/dist/assets/assets/fonts/Roboto/Roboto-ThinItalic.woff2 +0 -0
- package/dist/assets/assets/fonts/Roboto/style-webfont.css +756 -0
- package/dist/assets/assets/fonts/Roboto/style.css +90 -0
- package/dist/assets/assets/images/avatar/doctor-default.svg +6 -7
- package/dist/assets/assets/images/avatar/doctor-default_old.svg +8 -0
- package/dist/assets/assets/images/avatar/dora-default.svg +3 -4
- package/dist/assets/assets/images/avatar/dora-default_old.svg +5 -0
- package/dist/assets/assets/images/avatar/patient-default.svg +16 -10
- package/dist/assets/assets/images/avatar/patient-default_old.svg +12 -0
- package/dist/assets/assets/images/avatar/unit-default.svg +7 -8
- package/dist/assets/assets/images/avatar/unit-default_old.svg +9 -0
- package/dist/cjs/{app-globals-b77d5b06.js → app-globals-4d07f363.js} +20 -4
- package/dist/cjs/app-globals-4d07f363.js.map +1 -0
- package/dist/cjs/cura-accordion_12.cjs.entry.js +24 -17
- package/dist/cjs/cura-accordion_12.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-alert.cjs.entry.js +2 -2
- package/dist/cjs/cura-avatar.cjs.entry.js +2 -2
- package/dist/cjs/cura-badge-distance.cjs.entry.js +1 -1
- package/dist/cjs/cura-badge-number.cjs.entry.js +29 -0
- package/dist/cjs/cura-badge-number.cjs.entry.js.map +1 -0
- 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 +69 -58
- package/dist/cjs/cura-button-select.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-button-transparent.cjs.entry.js +2 -2
- package/dist/cjs/cura-button-transparent.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-calendar.cjs.entry.js +126 -235
- package/dist/cjs/cura-calendar.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-card.cjs.entry.js +2 -2
- package/dist/cjs/cura-checkbox.cjs.entry.js +3 -3
- package/dist/cjs/cura-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-display.cjs.entry.js +2 -2
- package/dist/cjs/cura-dropdown-search-option-title.cjs.entry.js +2 -2
- package/dist/cjs/cura-dropdown-search-option.cjs.entry.js +3 -3
- package/dist/cjs/cura-dropdown-search.cjs.entry.js +33 -6
- package/dist/cjs/cura-dropdown-search.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-icons-view.cjs.entry.js +4 -4
- package/dist/cjs/cura-input-date.cjs.entry.js +188 -0
- package/dist/cjs/cura-input-date.cjs.entry.js.map +1 -0
- package/dist/cjs/cura-loader-bar.cjs.entry.js +2 -2
- package/dist/cjs/cura-radio.cjs.entry.js +2 -2
- package/dist/cjs/cura-switch.cjs.entry.js +2 -2
- package/dist/cjs/cura-toast.cjs.entry.js +2 -2
- package/dist/cjs/cura.cjs.js +3 -3
- package/dist/cjs/index-6dc29195.js +126 -0
- package/dist/cjs/index-6dc29195.js.map +1 -0
- package/dist/cjs/{index-98e7ba54.js → index-e6d728ec.js} +70 -3
- package/dist/{esm/index-1ad98520.js.map → cjs/index-e6d728ec.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/collection/api/theme-presets/theme-default.js +3 -3
- package/dist/collection/api/theme-presets/theme-default.js.map +1 -1
- package/dist/collection/api/theme-presets/theme-legacy-default.js +16 -0
- package/dist/collection/api/theme-presets/theme-legacy-default.js.map +1 -1
- package/dist/collection/assets/images/avatar/doctor-default.svg +6 -7
- package/dist/collection/assets/images/avatar/doctor-default_old.svg +8 -0
- package/dist/collection/assets/images/avatar/dora-default.svg +3 -4
- package/dist/collection/assets/images/avatar/dora-default_old.svg +5 -0
- package/dist/collection/assets/images/avatar/patient-default.svg +16 -10
- package/dist/collection/assets/images/avatar/patient-default_old.svg +12 -0
- package/dist/collection/assets/images/avatar/unit-default.svg +7 -8
- package/dist/collection/assets/images/avatar/unit-default_old.svg +9 -0
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/badges/cura-badge-number/cura-badge-number.css +30 -0
- package/dist/collection/components/badges/cura-badge-number/cura-badge-number.js +66 -0
- package/dist/collection/components/badges/cura-badge-number/cura-badge-number.js.map +1 -0
- package/dist/collection/components/badges/cura-badge-number/cura-badge-number.stories.js +56 -0
- package/dist/collection/components/badges/cura-badge-number/cura-badge-number.stories.js.map +1 -0
- package/dist/collection/components/buttons/cura-button/cura-button.js +1 -1
- package/dist/collection/components/buttons/cura-button/cura-button.js.map +1 -1
- package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.js +1 -1
- package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.js.map +1 -1
- package/dist/collection/components/buttons/cura-button-select/cura-button-select.css +49 -21
- package/dist/collection/components/buttons/cura-button-select/cura-button-select.js +110 -113
- 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 +133 -0
- package/dist/collection/components/buttons/cura-button-select/cura-button-select.stories.js.map +1 -0
- package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.js +1 -1
- package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.js.map +1 -1
- package/dist/collection/components/cura-alert/cura-alert.js +1 -1
- package/dist/collection/components/cura-avatar/cura-avatar.js +1 -1
- package/dist/collection/components/cura-calendar/cura-calendar.css +15 -5
- package/dist/collection/components/cura-calendar/cura-calendar.js +139 -52
- package/dist/collection/components/cura-calendar/cura-calendar.js.map +1 -1
- package/dist/collection/components/cura-calendar/cura-calendar.stories.js +33 -3
- package/dist/collection/components/cura-calendar/cura-calendar.stories.js.map +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/forms/cura-checkbox/cura-checkbox.css +13 -5
- 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 +49 -4
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.js.map +1 -1
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.stories.js +19 -6
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.stories.js.map +1 -1
- package/dist/collection/components/forms/cura-input-date/cura-input-date.css +79 -0
- package/dist/collection/components/forms/cura-input-date/cura-input-date.js +424 -0
- package/dist/collection/components/forms/cura-input-date/cura-input-date.js.map +1 -0
- package/dist/collection/components/forms/cura-input-date/cura-input-date.stories.js +138 -0
- package/dist/collection/components/forms/cura-input-date/cura-input-date.stories.js.map +1 -0
- package/dist/collection/components/forms/cura-input-text/cura-input-text.css +5 -2
- package/dist/collection/components/forms/cura-input-text/cura-input-text.js +41 -2
- package/dist/collection/components/forms/cura-input-text/cura-input-text.js.map +1 -1
- package/dist/collection/components/forms/cura-input-text/cura-input-text.stories.js +73 -21
- package/dist/collection/components/forms/cura-input-text/cura-input-text.stories.js.map +1 -1
- package/dist/collection/components/forms/cura-input-text/mask-presets/input-mask-presets.js +3 -0
- package/dist/collection/components/forms/cura-input-text/mask-presets/input-mask-presets.js.map +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.css +6 -2
- package/dist/collection/components/forms/cura-select/cura-select.js +23 -4
- package/dist/collection/components/forms/cura-select/cura-select.js.map +1 -1
- package/dist/collection/components/forms/cura-select/cura-select.stories.js +11 -1
- package/dist/collection/components/forms/cura-select/cura-select.stories.js.map +1 -1
- 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.js +1 -1
- package/dist/collection/components/text/cura-paragraph/cura-paragraph.css +3 -1
- package/dist/collection/components/text/cura-paragraph/cura-paragraph.js +1 -1
- package/dist/collection/stories/blocks/index.js +85 -0
- package/dist/components/cura-alert.js +1 -1
- package/dist/components/cura-avatar.js +1 -1
- package/dist/components/cura-badge-number.d.ts +11 -0
- package/dist/components/cura-badge-number.js +8 -0
- package/dist/components/cura-badge-number.js.map +1 -0
- package/dist/components/cura-badge-number2.js +49 -0
- package/dist/components/cura-badge-number2.js.map +1 -0
- 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 +81 -65
- 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-calendar.js +1 -4065
- package/dist/components/cura-calendar.js.map +1 -1
- package/dist/components/cura-calendar2.js +4082 -0
- package/dist/components/cura-calendar2.js.map +1 -0
- package/dist/components/cura-card.js +1 -1
- package/dist/components/cura-checkbox.js +2 -2
- package/dist/components/cura-checkbox.js.map +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 +33 -5
- package/dist/components/cura-dropdown-search.js.map +1 -1
- package/dist/components/cura-heading2.js +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.d.ts +11 -0
- package/dist/components/cura-input-date.js +270 -0
- package/dist/components/cura-input-date.js.map +1 -0
- package/dist/components/cura-input-text2.js +10 -2
- package/dist/components/cura-input-text2.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 +2 -2
- package/dist/components/cura-paragraph2.js.map +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 +7 -5
- package/dist/components/cura-select2.js.map +1 -1
- package/dist/components/cura-switch.js +1 -1
- package/dist/components/cura-toast.js +1 -1
- package/dist/components/index.js +23 -3
- 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-0b7a7306.js +2 -0
- package/dist/cura/p-0b7a7306.js.map +1 -0
- package/dist/cura/{p-0d435e42.entry.js → p-116a1cd6.entry.js} +2 -2
- package/dist/cura/p-272c784a.js +2 -0
- package/dist/cura/p-272c784a.js.map +1 -0
- package/dist/cura/{p-4c7a2419.entry.js → p-2d267d23.entry.js} +2 -2
- package/dist/cura/{p-b301a1ef.entry.js → p-33772510.entry.js} +2 -2
- package/dist/cura/{p-b301a1ef.entry.js.map → p-33772510.entry.js.map} +1 -1
- package/dist/cura/{p-0a923806.entry.js → p-41c3d47d.entry.js} +2 -2
- package/dist/cura/{p-0a923806.entry.js.map → p-41c3d47d.entry.js.map} +1 -1
- package/dist/cura/p-44e3325a.entry.js +2 -0
- package/dist/cura/p-44e3325a.entry.js.map +1 -0
- package/dist/cura/p-4e14c01c.entry.js +2 -0
- package/dist/cura/p-563ba0cd.entry.js +2 -0
- package/dist/cura/p-563ba0cd.entry.js.map +1 -0
- package/dist/cura/{p-57b8b468.entry.js → p-8f3db0fe.entry.js} +2 -2
- package/dist/cura/{p-a00d2c68.entry.js → p-907b3d12.entry.js} +2 -2
- package/dist/cura/p-a2ae6bd2.entry.js +2 -0
- package/dist/cura/p-a2ae6bd2.entry.js.map +1 -0
- package/dist/cura/{p-6682619b.entry.js → p-b2d5db22.entry.js} +2 -2
- package/dist/cura/p-b43b69f3.entry.js +2 -0
- package/dist/cura/p-b43b69f3.entry.js.map +1 -0
- package/dist/cura/{p-599acc84.entry.js → p-be10b681.entry.js} +2 -2
- package/dist/cura/p-be10b681.entry.js.map +1 -0
- package/dist/cura/{p-a5cf0fd6.entry.js → p-c6508bd7.entry.js} +2 -2
- package/dist/cura/{p-2203e829.entry.js → p-dcd2e5bb.entry.js} +2 -2
- package/dist/cura/{p-84d8c67d.entry.js → p-e5023e34.entry.js} +2 -2
- package/dist/cura/p-e8bc6381.entry.js +2 -0
- package/dist/cura/p-e8bc6381.entry.js.map +1 -0
- package/dist/cura/p-ed97cf3c.entry.js +2 -0
- package/dist/cura/p-ed97cf3c.entry.js.map +1 -0
- package/dist/cura/{p-ad8a7e0f.entry.js → p-fcbf4311.entry.js} +2 -2
- package/dist/cura/{p-66c5cf5f.entry.js → p-fd083399.entry.js} +2 -2
- package/dist/cura/p-fd5ed6b0.js +3 -0
- package/dist/cura/p-fd5ed6b0.js.map +1 -0
- package/dist/cura/{p-f9433d24.entry.js → p-fdce91a7.entry.js} +2 -2
- package/dist/esm/{app-globals-488bf508.js → app-globals-6ca7103d.js} +20 -4
- package/dist/esm/app-globals-6ca7103d.js.map +1 -0
- package/dist/esm/cura-accordion_12.entry.js +24 -17
- package/dist/esm/cura-accordion_12.entry.js.map +1 -1
- package/dist/esm/cura-alert.entry.js +2 -2
- package/dist/esm/cura-avatar.entry.js +2 -2
- package/dist/esm/cura-badge-distance.entry.js +1 -1
- package/dist/esm/cura-badge-number.entry.js +25 -0
- package/dist/esm/cura-badge-number.entry.js.map +1 -0
- 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 +69 -58
- package/dist/esm/cura-button-select.entry.js.map +1 -1
- package/dist/esm/cura-button-transparent.entry.js +2 -2
- package/dist/esm/cura-button-transparent.entry.js.map +1 -1
- package/dist/esm/cura-calendar.entry.js +58 -167
- package/dist/esm/cura-calendar.entry.js.map +1 -1
- package/dist/esm/cura-card.entry.js +2 -2
- package/dist/esm/cura-checkbox.entry.js +3 -3
- package/dist/esm/cura-checkbox.entry.js.map +1 -1
- package/dist/esm/cura-display.entry.js +2 -2
- package/dist/esm/cura-dropdown-search-option-title.entry.js +2 -2
- package/dist/esm/cura-dropdown-search-option.entry.js +3 -3
- package/dist/esm/cura-dropdown-search.entry.js +33 -6
- package/dist/esm/cura-dropdown-search.entry.js.map +1 -1
- package/dist/esm/cura-icons-view.entry.js +4 -4
- package/dist/esm/cura-input-date.entry.js +184 -0
- package/dist/esm/cura-input-date.entry.js.map +1 -0
- package/dist/esm/cura-loader-bar.entry.js +2 -2
- package/dist/esm/cura-radio.entry.js +2 -2
- package/dist/esm/cura-switch.entry.js +2 -2
- package/dist/esm/cura-toast.entry.js +2 -2
- package/dist/esm/cura.js +4 -4
- package/dist/esm/{index-1ad98520.js → index-747aad85.js} +70 -3
- package/dist/esm/index-747aad85.js.map +1 -0
- package/dist/esm/index-fbee309a.js +120 -0
- package/dist/esm/index-fbee309a.js.map +1 -0
- package/dist/esm/loader.js +4 -4
- package/dist/types/api/theme-presets/theme-legacy-default.d.ts +3 -3
- package/dist/types/api/theme-presets/theme-presets.d.ts +3 -3
- package/dist/types/components/badges/cura-badge-number/cura-badge-number.d.ts +8 -0
- package/dist/types/components/badges/cura-badge-number/cura-badge-number.stories.d.ts +39 -0
- package/dist/types/components/buttons/cura-button-select/cura-button-select.d.ts +12 -34
- package/dist/types/components/buttons/cura-button-select/cura-button-select.stories.d.ts +105 -0
- package/dist/types/components/cura-calendar/cura-calendar.d.ts +53 -42
- package/dist/types/components/cura-calendar/cura-calendar.stories.d.ts +33 -0
- package/dist/types/components/forms/cura-dropdown-search/cura-dropdown-search.d.ts +9 -3
- package/dist/types/components/forms/cura-dropdown-search/cura-dropdown-search.stories.d.ts +14 -0
- package/dist/types/components/forms/cura-input-date/cura-input-date.d.ts +92 -0
- package/dist/types/components/forms/cura-input-date/cura-input-date.stories.d.ts +125 -0
- package/dist/types/components/forms/cura-input-text/cura-input-text.d.ts +6 -0
- package/dist/types/components/forms/cura-input-text/cura-input-text.stories.d.ts +15 -0
- package/dist/types/components/forms/cura-select/cura-select.d.ts +5 -0
- package/dist/types/components/forms/cura-select/cura-select.stories.d.ts +11 -0
- package/dist/types/components.d.ts +180 -48
- package/package.json +5 -3
- package/dist/cjs/app-globals-b77d5b06.js.map +0 -1
- package/dist/cjs/index-98e7ba54.js.map +0 -1
- package/dist/cura/p-0dd837cf.entry.js +0 -2
- package/dist/cura/p-0dd837cf.entry.js.map +0 -1
- package/dist/cura/p-312791fb.js +0 -3
- package/dist/cura/p-312791fb.js.map +0 -1
- package/dist/cura/p-4ef24fbd.entry.js +0 -2
- package/dist/cura/p-4ef24fbd.entry.js.map +0 -1
- package/dist/cura/p-599acc84.entry.js.map +0 -1
- package/dist/cura/p-a6c3c0ea.js +0 -2
- package/dist/cura/p-a6c3c0ea.js.map +0 -1
- package/dist/cura/p-dc5d0c29.entry.js +0 -2
- package/dist/cura/p-dc5d0c29.entry.js.map +0 -1
- package/dist/cura/p-df5c3a86.entry.js +0 -2
- package/dist/cura/p-df5c3a86.entry.js.map +0 -1
- package/dist/cura/p-dfc65f66.entry.js +0 -2
- package/dist/esm/app-globals-488bf508.js.map +0 -1
- /package/dist/cura/{p-0d435e42.entry.js.map → p-116a1cd6.entry.js.map} +0 -0
- /package/dist/cura/{p-4c7a2419.entry.js.map → p-2d267d23.entry.js.map} +0 -0
- /package/dist/cura/{p-dfc65f66.entry.js.map → p-4e14c01c.entry.js.map} +0 -0
- /package/dist/cura/{p-57b8b468.entry.js.map → p-8f3db0fe.entry.js.map} +0 -0
- /package/dist/cura/{p-a00d2c68.entry.js.map → p-907b3d12.entry.js.map} +0 -0
- /package/dist/cura/{p-6682619b.entry.js.map → p-b2d5db22.entry.js.map} +0 -0
- /package/dist/cura/{p-a5cf0fd6.entry.js.map → p-c6508bd7.entry.js.map} +0 -0
- /package/dist/cura/{p-2203e829.entry.js.map → p-dcd2e5bb.entry.js.map} +0 -0
- /package/dist/cura/{p-84d8c67d.entry.js.map → p-e5023e34.entry.js.map} +0 -0
- /package/dist/cura/{p-ad8a7e0f.entry.js.map → p-fcbf4311.entry.js.map} +0 -0
- /package/dist/cura/{p-66c5cf5f.entry.js.map → p-fd083399.entry.js.map} +0 -0
- /package/dist/cura/{p-f9433d24.entry.js.map → p-fdce91a7.entry.js.map} +0 -0
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-e6d728ec.js');
|
|
6
|
+
const index$1 = require('./index-6dc29195.js');
|
|
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))}";
|
|
9
|
+
const CuraInputDateStyle0 = curaInputDateCss;
|
|
10
|
+
|
|
11
|
+
const CuraInputDate = class {
|
|
12
|
+
constructor(hostRef) {
|
|
13
|
+
index.registerInstance(this, hostRef);
|
|
14
|
+
this.dateChange = index.createEvent(this, "dateChange", 7);
|
|
15
|
+
this.label = '';
|
|
16
|
+
this.status = 'default';
|
|
17
|
+
this.size = 'medium';
|
|
18
|
+
this.name = '';
|
|
19
|
+
this.helperText = undefined;
|
|
20
|
+
this.enableRangeDates = undefined;
|
|
21
|
+
this.disableFutureDates = undefined;
|
|
22
|
+
this.disablePassDates = undefined;
|
|
23
|
+
this.iconName = '';
|
|
24
|
+
this.placeholder = null;
|
|
25
|
+
this.styles = {};
|
|
26
|
+
this.isCalendarVisible = false;
|
|
27
|
+
this.dates = [];
|
|
28
|
+
this.value = '';
|
|
29
|
+
}
|
|
30
|
+
connectedCallback() {
|
|
31
|
+
const weights = window.CuraAPI.theme.fonts.getWeights();
|
|
32
|
+
this.styles['--base-spacing'] = window.CuraAPI.theme.spacing.getSpacing();
|
|
33
|
+
this.styles['--neutral-purewhite'] = window.CuraAPI.theme.colors.getColor(`neutral-purewhite`);
|
|
34
|
+
this.styles['--neutral-lighter'] = window.CuraAPI.theme.colors.getColor(`neutral-lighter`);
|
|
35
|
+
this.styles['--neutral-base'] = window.CuraAPI.theme.colors.getColor(`neutral-base`);
|
|
36
|
+
this.styles['--font-size'] = window.CuraAPI.theme.fonts.getSize();
|
|
37
|
+
this.styles['--font-color'] = window.CuraAPI.theme.fonts.getColor();
|
|
38
|
+
this.styles['--font-family'] = window.CuraAPI.theme.fonts.getFamily();
|
|
39
|
+
this.styles['--font-weight-regular'] = weights.regular;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Callback for form association
|
|
43
|
+
*/
|
|
44
|
+
formAssociatedCallback(form) {
|
|
45
|
+
form.ariaLabel = this.label;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Formats the placeholder based on the enableRangeDates flag
|
|
49
|
+
*
|
|
50
|
+
* @returns {string} A string representing the placeholder format,
|
|
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;
|
|
56
|
+
}
|
|
57
|
+
return this.enableRangeDates ? 'dd/mm/aaaa - dd/mm/aaaa' : 'dd/mm/aaaa';
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Sets the mask type based on the enableRangeDates flag
|
|
61
|
+
*
|
|
62
|
+
* @returns {string} The mask type, either 'dateRange' or 'date'
|
|
63
|
+
*/
|
|
64
|
+
setMask() {
|
|
65
|
+
return this.enableRangeDates ? 'dateRange' : 'date';
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Sets the mode type based on the enableRangeDates flag
|
|
69
|
+
*
|
|
70
|
+
* @returns {'range' | 'single'}
|
|
71
|
+
*/
|
|
72
|
+
setMode() {
|
|
73
|
+
return this.enableRangeDates ? 'range' : 'single';
|
|
74
|
+
}
|
|
75
|
+
handleClick(ev) {
|
|
76
|
+
if (this.el.contains(ev.target)) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
this.hideCalendar();
|
|
80
|
+
}
|
|
81
|
+
hideCalendar() {
|
|
82
|
+
this.isCalendarVisible = false;
|
|
83
|
+
}
|
|
84
|
+
showCalendar() {
|
|
85
|
+
this.isCalendarVisible = true;
|
|
86
|
+
}
|
|
87
|
+
handleInputDates(event) {
|
|
88
|
+
const inputValue = event.target.value;
|
|
89
|
+
const dateRangeRegex = /^(\d{2}\/\d{2}\/\d{4})\s*-\s*(\d{2}\/\d{2}\/\d{4})$/;
|
|
90
|
+
const simpleDateRegex = /^(\d{2}\/\d{2}\/\d{4})$/;
|
|
91
|
+
if (dateRangeRegex.test(inputValue)) {
|
|
92
|
+
const matches = inputValue.match(dateRangeRegex);
|
|
93
|
+
const startDate = this.parseStringToDate(matches[1]);
|
|
94
|
+
const endDate = this.parseStringToDate(matches[2]);
|
|
95
|
+
if (this.isDateValid(startDate) && this.isDateValid(endDate)) {
|
|
96
|
+
this.status = 'default';
|
|
97
|
+
this.dates = [startDate, endDate];
|
|
98
|
+
this.value = `${this.parseDateToString(startDate)} - ${this.parseDateToString(endDate)}`;
|
|
99
|
+
this.dateChange.emit(this.value);
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
this.status = 'error';
|
|
103
|
+
this.dates = [];
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
else if (simpleDateRegex.test(inputValue)) {
|
|
107
|
+
const matches = inputValue.match(simpleDateRegex);
|
|
108
|
+
const singleDate = this.parseStringToDate(matches[1]);
|
|
109
|
+
if (this.isDateValid(singleDate)) {
|
|
110
|
+
this.status = 'default';
|
|
111
|
+
this.dates = [singleDate];
|
|
112
|
+
this.value = this.parseDateToString(singleDate);
|
|
113
|
+
this.dateChange.emit(this.value);
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
this.status = 'error';
|
|
117
|
+
this.dates = [];
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
this.dates = [];
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
handleChangeDates(event) {
|
|
125
|
+
if (event.detail === '') {
|
|
126
|
+
this.dates = [];
|
|
127
|
+
this.status = 'default';
|
|
128
|
+
this.value = '';
|
|
129
|
+
this.dateChange.emit(this.value);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
isDateValid(date) {
|
|
133
|
+
const today = new Date();
|
|
134
|
+
today.setHours(0, 0, 0, 0);
|
|
135
|
+
if (this.disablePassDates)
|
|
136
|
+
return !index$1.isBefore(date, today);
|
|
137
|
+
if (this.disableFutureDates)
|
|
138
|
+
return !index$1.isAfter(date, today);
|
|
139
|
+
return true;
|
|
140
|
+
}
|
|
141
|
+
parseStringToDate(dateString) {
|
|
142
|
+
const [day, month, year] = dateString.split('/').map(Number);
|
|
143
|
+
return new Date(year, month - 1, day);
|
|
144
|
+
}
|
|
145
|
+
parseDateToString(date) {
|
|
146
|
+
const day = String(date.getDate()).padStart(2, '0');
|
|
147
|
+
const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
148
|
+
const year = date.getFullYear();
|
|
149
|
+
return `${day}/${month}/${year}`;
|
|
150
|
+
}
|
|
151
|
+
renderCalendarOrHelperText() {
|
|
152
|
+
if (this.isCalendarVisible) {
|
|
153
|
+
return (index.h("div", { class: "calendar" }, index.h("cura-calendar", { customDates: this.dates, mode: this.setMode(), width: "100%", embedded: false, floating: false, disableFutureDates: this.disableFutureDates, disablePassDates: this.disablePassDates, onOnchangeday: e => {
|
|
154
|
+
const days = e.detail.days;
|
|
155
|
+
if (days.length === 1) {
|
|
156
|
+
this.value = this.parseDateToString(days[0]);
|
|
157
|
+
}
|
|
158
|
+
else if (days.length > 0) {
|
|
159
|
+
this.value = `${this.parseDateToString(days[0])} - ${this.parseDateToString(days[days.length - 1])}`;
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
this.value = '';
|
|
163
|
+
}
|
|
164
|
+
this.dateChange.emit(this.value);
|
|
165
|
+
} })));
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
return this.helperText;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
render() {
|
|
172
|
+
return (index.h(index.Host, { key: '8bf7141427b370ea271d2f589c26060111862f79' }, index.h("div", { key: '5c955bf76f93912512bbf18887db5305e6772faa', class: "container", style: this.styles }, index.h("cura-input-text", { key: 'a8c3ff65ca54123d0f7612f61e06e44275047961', label: this.label, name: this.name, status: this.status, value: this.value, onFocus: () => this.showCalendar(), size: this.size, iconName: this.iconName, placeholder: this.setPlaceholder(), "mask-preset": this.setMask(), "enable-selection-mode": true, onKeyUp: event => this.handleInputDates(event), autocomplete: "off", onValueChange: event => this.handleChangeDates(event) }, this.renderCalendarOrHelperText()))));
|
|
173
|
+
}
|
|
174
|
+
static get formAssociated() { return true; }
|
|
175
|
+
get el() { return index.getElement(this); }
|
|
176
|
+
static get watchers() { return {
|
|
177
|
+
"enableRangeDates": ["setPlaceholder", "setMask", "setMode"],
|
|
178
|
+
"disableFutureDates": ["isDateValid", "renderCalendarOrHelperText"],
|
|
179
|
+
"disablePassDates": ["isDateValid"],
|
|
180
|
+
"dates": ["renderCalendarOrHelperText"],
|
|
181
|
+
"isCalendarVisible": ["renderCalendarOrHelperText"]
|
|
182
|
+
}; }
|
|
183
|
+
};
|
|
184
|
+
CuraInputDate.style = CuraInputDateStyle0;
|
|
185
|
+
|
|
186
|
+
exports.cura_input_date = CuraInputDate;
|
|
187
|
+
|
|
188
|
+
//# sourceMappingURL=cura-input-date.cjs.entry.js.map
|
|
@@ -0,0 +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,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,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}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-e6d728ec.js');
|
|
6
6
|
|
|
7
7
|
const curaLoaderBarCss = ":host{display:block}:host .progress-bar{position:absolute;left:0;bottom:0;width:100%;height:4px;background-color:var(--neutral-base)}:host .progress-bar span{position:absolute;left:0;bottom:0;width:var(--bar-width);height:100%;border-radius:0 2px 2px 0;background-color:var(--color-base);transition:width 0.2s linear}";
|
|
8
8
|
const CuraLoaderBarStyle0 = curaLoaderBarCss;
|
|
@@ -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: 'c98e1e2e370b5fadc87eb960d030324e36acd250' }, index.h("div", { key: '39dac6c361361e840305e15d6bf4ff09cfa3380e', id: "progress-bar", class: "progress-bar", style: this.styles }, index.h("span", { key: 'b501bd4846993c62a246a5891b9650faaca89c32', 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) });
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-e6d728ec.js');
|
|
6
6
|
const curaForms_definitions = require('./cura-forms.definitions-c164f1b8.js');
|
|
7
7
|
|
|
8
8
|
const curaRadioCss = "@charset \"UTF-8\";:host{display:block;width:fit-content;box-sizing:border-box;}:host .container{display:flex;align-items:center;flex-direction:row-reverse;gap:var(--gap)}:host .position.container{flex-direction:row}:host .position .label-wrapper{justify-content:end}:host .position .message{text-align:right}:host .position .label{order:1}:host .info{display:flex;flex-direction:column}:host .label-wrapper{display:flex;justify-content:start;align-items:center;gap:5px}:host .control{width:fit-content;cursor:pointer;position:relative}:host .radio{margin:0;appearance:none;-webkit-appearance:none;-moz-appearance:none;border-radius:50%;border:2px solid var(--primary-base-neutral-medium);background:var(--neutral-purewhite);box-sizing:border-box;transition:border-color 0.3s;position:relative;display:flex;align-items:center;justify-content:center;cursor:pointer;width:var(--size);height:var(--size);flex:0 0 var(--size)}:host .radio::after{content:\"\";background:var(--color-base-light);border-radius:50%;opacity:0;transition:opacity 0.3s;width:var(--size-after);height:var(--size-after)}:host .radio:focus{border-color:var(--info-base) !important}:host .success .radio{border-color:var(--success-base);background:var(--success-lighter)}:host .success .radio:hover{border-color:var(--success-base) !important}:host .success.checked .radio{border-color:var(--success-base)}:host .success.checked .radio::after{background:var(--success-base)}:host .success.checked .radio:hover{background:var(--success-lighter) !important;border-color:var(--success-base) !important}:host .success.checked .radio:hover::after{background:var(--success-base) !important}:host .error .radio{border-color:var(--error-base);background:var(--error-lighter)}:host .error .radio:hover{border-color:var(--error-base) !important}:host .error.checked .radio{border-color:var(--error-base)}:host .error.checked .radio::after{background:var(--error-base)}:host .error.checked .radio:hover{background:var(--error-lighter) !important;border-color:var(--error-base) !important}:host .error.checked .radio:hover::after{background:var(--error-base) !important}:host .checked .radio::after{opacity:1;background:var(--color-base)}:host .checked .radio{border-color:var(--color-dark)}:host .checked .radio:hover{border-color:var(--color-light) !important}:host .checked .radio:hover::after{background:var(--color-light)}:host .disabled .radio{background:var(--primary-base-neutral-white);border-color:var(--primary-darker-neutral-base);cursor:not-allowed}:host .disabled .radio::after{background:var(--neutral-lighter)}:host .disabled.checked .radio{border-color:var(--primary-base-neutral-base) !important;background:var(--primary-darker-neutral-white) !important}:host .disabled.checked .radio::after{background:var(--primary-base-neutral-base) !important}:host :not(.disabled):not(.checked) .radio:hover{border-color:var(--primary-base-neutral-dark)}";
|
|
@@ -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: '015424d6821feeef090b0e064cf35eb39100f918' }, index.h("div", { key: '85b54a48eb2c75dd98df83f7ac7557162b036300', class: this.getClasses(), style: this.styles }, index.h("div", { key: '84f0b0a8f5e2698fc5fcc6941b6a8b369629d6c0', class: "info" }, index.h("div", { key: '94194138a25b71c7a6cd1b8c191662ebcbd16b71', class: "label-wrapper" }, index.h("cura-label", { key: 'cd5af14f2c174bf6a2e2715f32c3f97ed42dd05e', class: "label", size: this.size === 'large' ? 'medium' : 'xsmall', color: this.assignColor('label') }, this.label), this.required && index.h("cura-paragraph", { key: '237bc98ab60ab07e917dcd99b1874bf6fd400ec6', lineHeight: '0%', marginBlock: '0', color: "error-base" }, "* ")), index.h("cura-label", { key: '88a3014b55f420ed7744090f1e54927f7f6ec767', color: this.assignColor('message'), size: "xsmall", class: "message" }, index.h("slot", { key: 'b505727b192c807344f328c73c44f88b72314cb3' }))), index.h("input", { key: '6f324f596f24328d0829e1013bf78545dda17e4b', 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); }
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-e6d728ec.js');
|
|
6
6
|
const curaForms_definitions = require('./cura-forms.definitions-c164f1b8.js');
|
|
7
7
|
|
|
8
8
|
const curaSwitchCss = "@charset \"UTF-8\";:host{display:block;width:fit-content;box-sizing:border-box}.container{display:flex;align-items:center;flex-direction:row-reverse;gap:var(--gap);text-align:left}.position{flex-direction:row}.label,.message{text-align:left}.control{width:fit-content}.track{background:var(--neutral-dark-base);border-radius:16px;transition:background-color 0.3s;align-items:flex-start;flex-shrink:0;box-sizing:border-box;width:var(--size-track);height:var(--size);position:relative}.thumb{background:var(--neutral-purewhite);border:2px solid var(--neutral-darker-medium);border-radius:50%;position:absolute;transition:transform 0.3s, outline 0.3s;display:inline-block;cursor:pointer;user-select:none;box-sizing:border-box;width:var(--size);height:var(--size);top:50%;transform:translateY(-50%)}.checked .thumb{border-color:var(--color-dark);box-shadow:0px 4px 8px 0px var(--neutral-black-shadow, rgba(38, 38, 38, 0.16));background:var(--neutral-purewhite);transform:translateX(var(--size)) translateY(-50%)}.checked .thumb:hover{background:var(--neutral-pale) !important;border-color:var(--neutral-darker-medium) !important}.checked .thumb:active{border-color:var(--color-dark);background:var(--neutral-pale)}.checked .track{background:var(--color-base-light)}.disabled .track{background:var(--neutral-black-neutral-pale)}.disabled .thumb{background:var(--neutral-black-neutral-base) !important;border-color:var(--neutral-black-neutral-pale) !important;cursor:not-allowed}.disabled.checked .track{background:var(--neutral-black-neutral-pale)}.container.disabled .thumb:focus{outline:none !important;border-color:var(--neutral-black-neutral-pale) !important}:not(.disabled):not(.checked) .thumb:hover{border-color:var(--color-dark);background:var(--neutral-pale)}:not(.disabled):not(.checked) .thumb:active{border-color:var(--color-dark);background:var(--neutral-pale)}:not(.disabled) .thumb:focus{outline:2px solid var(--info-base) !important;border:2px solid var(--neutral-darker-medium);z-index:1}:not(.disabled) .checked .thumb:focus{outline:2px solid var(--info-base) !important;border-color:var(--color-dark)}";
|
|
@@ -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: '6bbc037348270c69bfac13e7466c6fd19f4dc427' }, index.h("div", { key: '11ada01c69ff91815ba1b1f76a6e6b448e88a361', class: this.getClasses(), style: this.styles }, index.h("div", { key: '34992d3d6fbf3ca7782fa4502e297d508656c34c', class: "info" }, index.h("cura-label", { key: '0e6a178f1f74526962d588b1fad3024920bcf815', 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: '33e7c6d7aaabd9007b0a41fb966b41b0fd947bc8', style: { textAlign: this.position === 'right' ? 'right' : 'left' }, color: this.assignColor('primary-lighter', 'neutral-dark'), size: "xsmall", class: "message" }, index.h("slot", { key: '66dd525702f7d53c8167cfd2aa25552d1bd79837' }))), index.h("div", { key: 'a3828f2e511a7e23ad5d0e04319637e1aa256c96', onClick: this.toggleSwitch, class: "control" }, index.h("div", { key: 'afc664ab5563591ef201eee1ca0d33a48075ad04', class: `track ${this.size.toLowerCase()}` }, index.h("div", { key: 'e6b7f3b67e78421283426ce1c7679cbbf8f77f5e', class: `thumb ${this.size.toLowerCase()}`, tabIndex: this.ontabindex }))))));
|
|
113
113
|
}
|
|
114
114
|
static get formAssociated() { return true; }
|
|
115
115
|
static get watchers() { return {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-e6d728ec.js');
|
|
6
6
|
|
|
7
7
|
const curaToastCss = ":host{display:block;box-sizing:border-box}:host .container{position:fixed;z-index:99999;display:flex;box-sizing:border-box;min-width:328px;height:fit-content;padding:16px;border:1px solid var(--color-base);border-radius:12px;background-color:var(--neutral-purewhite);overflow:hidden;box-shadow:0px 8px 16px 0px var(--neutral-black-shadow-4, rgba(38, 38, 38, 0.12))}:host .container.loader{padding:16px 16px 20px}:host .container.top{top:24px}:host .container.top.center{top:-100%;left:50%;transform:translateX(-50%);opacity:0;transition:opacity 0.5s ease-in-out, top 0.5s ease-in-out}:host .container.top.center.active{top:24px;opacity:1}:host .container.bottom{bottom:24px}:host .container.bottom.center{bottom:-100%;left:50%;transform:translateX(-50%);opacity:0;transition:opacity 0.5s ease-in-out, bottom 0.5s ease-in-out}:host .container.bottom.center.active{bottom:24px;opacity:1}:host .container.left{left:-100%;opacity:0;transition:opacity 0.5s ease-in-out, left 0.5s ease-in-out}@media (max-width: 768px){:host .container.left{right:unset;left:50%;transform:translateX(-50%)}}:host .container.left.active{left:24px;opacity:1}:host .container.right{right:-100%;opacity:0;transition:opacity 0.5s ease-in-out, right 0.5s ease-in-out}@media (max-width: 768px){:host .container.right{right:unset;left:50%;transform:translateX(-50%)}}:host .container.right.active{right:24px;opacity:1}:host .container .content{flex:1 1 0;display:flex;flex-direction:column;gap:4px}:host .container .default-icon{margin-right:12px}:host .container .close-icon{margin-left:12px;cursor:pointer}";
|
|
8
8
|
const CuraToastStyle0 = curaToastCss;
|
|
@@ -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: 'b875e88d00075a71d6052563a45849f0b3124f13' }, index.h("div", { key: 'e766c7a687ec1f9ad943dc4e2ebb87c100da5b71', class: this.getClasses(), style: this.styles }, index.h("cura-icon", { key: '9379419d8403c5c7b14182bb136cd3375f8aa09a', class: "default-icon", name: this.getNameIcon(), size: 16, color: `${this.type}-dark` }), index.h("div", { key: '38f2a177984d826209d6fbdc9ad3036ef02a1825', class: "content" }, index.h("cura-heading", { key: 'a4fd1cce18d6208daa527b8da5687b47fbb59968', level: 4, size: "xsmall", color: `${this.type}-dark`, weight: "bold", "margin-block": "0" }, this.label), index.h("cura-paragraph", { key: 'fb803bbcbe47f1d2eca897ca5679d71294fe59ab', color: `${this.type}-darker`, size: "xsmall", marginBlock: "0", lineHeight: "133.33%" }, index.h("slot", { key: '9ea56d9f87a423b109945cd4cf4078347a9fc1e9' })), index.h("slot", { key: '045b4ae11997260832288428df6672be6e918730', name: "actions" })), this.closeButton && index.h("cura-icon", { key: 'e326bb7786f60c95bed9d910e46f47bb4273bb7b', class: "close-icon", name: "close", size: 16, color: "error-dark", onClick: this.handleClose }), this.loader && !!this.autoCloseDelay && index.h("cura-loader-bar", { key: 'bf1d59681ac35d79fe240777e5d5424ee2b4a4e7', color: `${this.type}-base`, progress: this.progress }))));
|
|
35
35
|
}
|
|
36
36
|
componentDidLoad() {
|
|
37
37
|
this.openContainer();
|
package/dist/cjs/cura.cjs.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const appGlobals = require('./app-globals-
|
|
5
|
+
const index = require('./index-e6d728ec.js');
|
|
6
|
+
const appGlobals = require('./app-globals-4d07f363.js');
|
|
7
7
|
|
|
8
8
|
/*
|
|
9
9
|
Stencil Client Patch Browser v4.22.0 | MIT Licensed | https://stenciljs.com
|
|
@@ -19,7 +19,7 @@ var patchBrowser = () => {
|
|
|
19
19
|
|
|
20
20
|
patchBrowser().then(async (options) => {
|
|
21
21
|
await appGlobals.globalScripts();
|
|
22
|
-
return index.bootstrapLazy([["cura-accordion_12.cjs",[[65,"cura-button",{"type":[513],"size":[513],"disabled":[516],"isLoading":[516,"is-loading"],"iconName":[513,"icon-name"],"iconset":[513],"iconPosition":[513,"icon-position"],"iconOnly":[516,"icon-only"],"href":[513],"target":[513],"color":[1],"background":[513],"fontColor":[513,"font-color"],"textAlign":[513,"text-align"],"justify":[516],"styles":[32],"hovered":[32]},null,{"background":["setColors"],"color":["setColors"]}],[1,"cura-accordion-item",{"label":[513],"iconSize":[514,"icon-size"],"openIcon":[513,"open-icon"],"closeIcon":[513,"close-icon"],"iconColor":[513,"icon-color"],"iconActiveColor":[513,"icon-active-color"],"colorMode":[1,"color-mode"],"opened":[1540],"styles":[32]}],[1,"cura-accordion",{"color":[513],"activeColor":[513,"active-color"],"colorMode":[513,"color-mode"],"iconSize":[514,"icon-size"],"openIcon":[513,"open-icon"],"closeIcon":[513,"close-icon"],"iconColor":[513,"icon-color"],"iconActiveColor":[513,"icon-active-color"],"behavior":[513],"styles":[32]},null,{"color":["handleChangeColor"],"activeColor":["handleChangeColor"]}],[1,"cura-page-template",{"contentwidth":[513]}],[65,"cura-input-text",{"mode":[1537],"status":[1537],"size":[1537],"type":[513],"inputMode":[513,"input-mode"],"label":[513],"name":[513],"placeholder":[513],"value":[1032],"iconName":[1537,"icon-name"],"helperText":[1537,"helper-text"],"disabled":[516],"required":[516],"maskPreset":[8,"mask-preset"],"maskRegex":[1537,"mask-regex"],"maskAdvanced":[1544,"mask-advanced"],"maxlength":[1538],"readOnly":[516,"read-only"],"isLoading":[1540,"is-loading"],"clearIcon":[1540,"clear-icon"],"hideErrorIcon":[4,"hide-error-icon"],"isHovered":[32],"isFocused":[32],"styles":[32]},null,{"styles":["connectedCallback"],"size":["getClasses"],"status":["renderIcon"],"mode":["renderIcon"],"maskPreset":["initializeMask"],"maskRegex":["initializeMask"],"maskAdvanced":["initializeMask"]}],[65,"cura-select",{"label":[513],"placeholder":[513],"value":[1537],"mode":[513],"size":[513],"status":[1537],"disabled":[516],"required":[516],"isHovered":[32],"isFocused":[32],"isOpen":[32],"options":[32],"activeIndex":[32],"textInput":[32]},null,{"activeIndex":["updateOptionHighlights"],"textInput":["filterOptions"],"value":["handleValueChange"]}],[1,"cura-select-option",{"value":[513],"selected":[516],"active":[516],"size":[1],"styles":[32]},null,{"size":["getSize"]}],[1,"cura-heading",{"level":[514],"size":[513],"weight":[513],"spotColor":[513,"spot-color"],"color":[1],"marginBlock":[513,"margin-block"],"lineHeight":[513,"line-height"],"styles":[32]},null,{"color":["handleChangeColor"],"spotColor":["handleChangeColor"]}],[1,"cura-paragraph",{"size":[513],"spotColor":[513,"spot-color"],"color":[1],"marginBlock":[513,"margin-block"],"lineHeight":[513,"line-height"],"styles":[32]},null,{"color":["handleChangeColor"],"spotColor":["handleChangeColor"]}],[1,"cura-loader-circle",{"size":[513],"color":[513]}],[1,"cura-icon",{"name":[513],"color":[1],"size":[8],"iconset":[513],"disabled":[4]},null,{"size":["sizeHandler"],"color":["colorHandler"],"disabled":["colorHandler"]}],[1,"cura-label",{"size":[513],"weight":[513],"spotColor":[513,"spot-color"],"color":[1],"marginBlock":[513,"margin-block"],"lineHeight":[513,"line-height"],"styles":[32]},null,{"color":["handleChangeColor"],"spotColor":["handleChangeColor"]}]]],["cura-
|
|
22
|
+
return index.bootstrapLazy([["cura-accordion_12.cjs",[[65,"cura-button",{"type":[513],"size":[513],"disabled":[516],"isLoading":[516,"is-loading"],"iconName":[513,"icon-name"],"iconset":[513],"iconPosition":[513,"icon-position"],"iconOnly":[516,"icon-only"],"href":[513],"target":[513],"color":[1],"background":[513],"fontColor":[513,"font-color"],"textAlign":[513,"text-align"],"justify":[516],"styles":[32],"hovered":[32]},null,{"background":["setColors"],"color":["setColors"]}],[1,"cura-accordion-item",{"label":[513],"iconSize":[514,"icon-size"],"openIcon":[513,"open-icon"],"closeIcon":[513,"close-icon"],"iconColor":[513,"icon-color"],"iconActiveColor":[513,"icon-active-color"],"colorMode":[1,"color-mode"],"opened":[1540],"styles":[32]}],[1,"cura-accordion",{"color":[513],"activeColor":[513,"active-color"],"colorMode":[513,"color-mode"],"iconSize":[514,"icon-size"],"openIcon":[513,"open-icon"],"closeIcon":[513,"close-icon"],"iconColor":[513,"icon-color"],"iconActiveColor":[513,"icon-active-color"],"behavior":[513],"styles":[32]},null,{"color":["handleChangeColor"],"activeColor":["handleChangeColor"]}],[1,"cura-page-template",{"contentwidth":[513]}],[65,"cura-input-text",{"mode":[1537],"status":[1537],"size":[1537],"type":[513],"inputMode":[513,"input-mode"],"label":[513],"name":[513],"placeholder":[513],"value":[1032],"iconName":[1537,"icon-name"],"helperText":[1537,"helper-text"],"disabled":[516],"required":[516],"maskPreset":[8,"mask-preset"],"enableSelectionMode":[1540,"enable-selection-mode"],"maskRegex":[1537,"mask-regex"],"maskAdvanced":[1544,"mask-advanced"],"maxlength":[1538],"readOnly":[516,"read-only"],"isLoading":[1540,"is-loading"],"clearIcon":[1540,"clear-icon"],"hideErrorIcon":[4,"hide-error-icon"],"autocomplete":[513],"isHovered":[32],"isFocused":[32],"styles":[32]},null,{"styles":["connectedCallback"],"size":["getClasses"],"status":["renderIcon"],"mode":["renderIcon"],"maskPreset":["initializeMask"],"maskRegex":["initializeMask"],"maskAdvanced":["initializeMask"]}],[65,"cura-select",{"label":[513],"placeholder":[513],"value":[1537],"mode":[513],"size":[513],"status":[1537],"disabled":[516],"required":[516],"searchBehavior":[516,"search-behavior"],"isHovered":[32],"isFocused":[32],"isOpen":[32],"options":[32],"activeIndex":[32],"textInput":[32]},null,{"activeIndex":["updateOptionHighlights"],"textInput":["filterOptions"],"value":["handleValueChange"]}],[1,"cura-select-option",{"value":[513],"selected":[516],"active":[516],"size":[1],"styles":[32]},null,{"size":["getSize"]}],[1,"cura-heading",{"level":[514],"size":[513],"weight":[513],"spotColor":[513,"spot-color"],"color":[1],"marginBlock":[513,"margin-block"],"lineHeight":[513,"line-height"],"styles":[32]},null,{"color":["handleChangeColor"],"spotColor":["handleChangeColor"]}],[1,"cura-paragraph",{"size":[513],"spotColor":[513,"spot-color"],"color":[1],"marginBlock":[513,"margin-block"],"lineHeight":[513,"line-height"],"styles":[32]},null,{"color":["handleChangeColor"],"spotColor":["handleChangeColor"]}],[1,"cura-loader-circle",{"size":[513],"color":[513]}],[1,"cura-icon",{"name":[513],"color":[1],"size":[8],"iconset":[513],"disabled":[4]},null,{"size":["sizeHandler"],"color":["colorHandler"],"disabled":["colorHandler"]}],[1,"cura-label",{"size":[513],"weight":[513],"spotColor":[513,"spot-color"],"color":[1],"marginBlock":[513,"margin-block"],"lineHeight":[513,"line-height"],"styles":[32]},null,{"color":["handleChangeColor"],"spotColor":["handleChangeColor"]}]]],["cura-input-date.cjs",[[65,"cura-input-date",{"label":[513],"status":[1537],"size":[1537],"name":[513],"helperText":[1537,"helper-text"],"enableRangeDates":[1540,"enable-range-dates"],"disableFutureDates":[1540,"disable-future-dates"],"disablePassDates":[1540,"disable-pass-dates"],"iconName":[1537,"icon-name"],"placeholder":[513],"styles":[32],"isCalendarVisible":[32],"dates":[32],"value":[32]},[[8,"click","handleClick"]],{"enableRangeDates":["setPlaceholder","setMask","setMode"],"disableFutureDates":["isDateValid","renderCalendarOrHelperText"],"disablePassDates":["isDateValid"],"dates":["renderCalendarOrHelperText"],"isCalendarVisible":["renderCalendarOrHelperText"]}]]],["cura-dropdown-search.cjs",[[1,"cura-dropdown-search",{"size":[1537],"status":[513],"disabled":[516],"name":[513],"required":[1540],"selected":[1540],"value":[1537],"placeholder":[1537],"label":[1537],"iconName":[513,"icon-name"],"dropdownMaxHeight":[513,"dropdown-max-height"],"overlayVisible":[32],"isDropdownOpen":[32],"styles":[32],"isMobile":[32],"mode":[32],"inputTextRef":[32],"isOnBlurInput":[32],"hoveredIndex":[32],"options":[32]},null,{"value":["onValueChange"]}]]],["cura-icons-view.cjs",[[1,"cura-icons-view",{"selected":[32]}]]],["cura-toast.cjs",[[1,"cura-toast",{"type":[1],"position":[1],"icon":[513],"label":[513],"closeButton":[516,"close-button"],"loader":[516],"autoCloseDelay":[514,"auto-close-delay"],"styles":[32],"progress":[32]},null,{"type":["handleChangeType"],"position":["handleChangeType"]}]]],["cura-alert.cjs",[[1,"cura-alert",{"type":[1],"floating":[516],"label":[513],"closeable":[516],"icon":[513],"styles":[32]},null,{"type":["setColors"]}]]],["cura-button-outline.cjs",[[65,"cura-button-outline",{"type":[513],"size":[513],"disabled":[516],"isLoading":[516,"is-loading"],"iconName":[513,"icon-name"],"iconset":[513],"iconPosition":[513,"icon-position"],"iconOnly":[516,"icon-only"],"href":[513],"target":[513],"color":[1],"background":[1],"fontColor":[1,"font-color"],"textAlign":[513,"text-align"],"justify":[516],"styles":[32],"hovered":[32]},null,{"background":["setColors"],"color":["setColors","getSymbolColor"],"fontColor":["getSymbolColor"]}]]],["cura-button-select.cjs",[[1,"cura-button-select",{"selected":[1540],"iconName":[1537,"icon-name"],"size":[513],"counter":[1544],"disabled":[516],"background":[1],"color":[1],"hovered":[32],"styles":[32]},null,{"background":["setColors"],"color":["setColors"]}]]],["cura-checkbox.cjs",[[65,"cura-checkbox",{"checked":[1540],"indeterminate":[1540],"status":[1537],"disabled":[516],"required":[516],"label":[513],"ontabindex":[514],"position":[513],"value":[513],"name":[513],"size":[513],"background":[1],"iconColor":[1,"icon-color"],"color":[1],"styles":[32]},null,{"size":["sizeHandler"],"color":["setColors"],"background":["setColors","assignColor"],"iconColor":["assignColor"]}]]],["cura-radio.cjs",[[65,"cura-radio",{"checked":[1540],"status":[1537],"disabled":[516],"required":[516],"label":[513],"ontabindex":[514],"position":[513],"value":[513],"name":[513],"background":[1],"size":[1],"color":[1],"styles":[32]},null,{"size":["sizeHandler"],"color":["setColors"],"background":["setColors","assignColor"]}]]],["cura-badge-distance.cjs",[[1,"cura-badge-distance",{"distance":[2],"label":[513],"styles":[32],"displayDistance":[32]},null,{"distance":["formatDistance"]}]]],["cura-dropdown-search-option.cjs",[[1,"cura-dropdown-search-option",{"value":[513],"selected":[1540],"selectable":[516],"hovered":[1540],"styles":[32]},null,{"selected":["updateIconColor"]}]]],["cura-dropdown-search-option-title.cjs",[[1,"cura-dropdown-search-option-title"]]],["cura-switch.cjs",[[65,"cura-switch",{"checked":[1540],"disabled":[516],"label":[513],"ontabindex":[514],"position":[513],"size":[513],"background":[1],"color":[1],"styles":[32]},null,{"size":["sizeHandler"],"color":["setColors"],"background":["setColors"]}]]],["cura-avatar.cjs",[[1,"cura-avatar",{"size":[1],"backgroundColor":[513,"background-color"],"borderColor":[513,"border-color"],"borderRadius":[513,"border-radius"],"border":[516],"type":[513],"imageSrc":[1537,"image-src"],"imageSrcDefault":[513,"image-src-default"],"floating":[516],"styles":[32]},null,{"size":["sizeHandler"]}]]],["cura-card.cjs",[[1,"cura-card",{"hasPadding":[1028,"has-padding"],"hasShadow":[1028,"has-shadow"],"type":[1025],"colorMode":[1025,"color-mode"],"href":[1537],"target":[513],"styles":[32]}]]],["cura-display.cjs",[[1,"cura-display",{"level":[514],"size":[513],"spotColor":[1,"spot-color"],"color":[1],"marginBlock":[513,"margin-block"],"lineHeight":[513,"line-height"],"styles":[32]},null,{"color":["handleChangeColor"],"spotColor":["handleChangeColor"]}]]],["cura-calendar.cjs",[[1,"cura-calendar",{"period":[513],"width":[513],"mode":[513],"dateFormat":[1537,"date-format"],"locale":[513],"type":[513],"disable":[16],"enable":[16],"defaultDate":[16],"customDates":[16],"limitRange":[514,"limit-range"],"disablePassDates":[1540,"disable-pass-dates"],"disableFutureDates":[1540,"disable-future-dates"],"collapsed":[1540],"floating":[1540],"embedded":[1540],"currentDate":[32],"selectedDates":[32],"rangeStart":[32],"defaultDates":[32],"selectMonth":[32],"selectYear":[32],"styles":[32]},null,{"customDates":["watchDefaultDatesArray"]}]]],["cura-badge-number.cjs",[[1,"cura-badge-number",{"number":[514],"color":[513]}]]],["cura-loader-bar.cjs",[[1,"cura-loader-bar",{"color":[1],"progress":[2],"styles":[32]},null,{"color":["handleChangeColor"],"progress":["handleProgress"]}]]],["cura-button-transparent.cjs",[[65,"cura-button-transparent",{"type":[513],"size":[513],"disabled":[516],"isLoading":[516,"is-loading"],"iconName":[513,"icon-name"],"iconset":[513],"iconPosition":[513,"icon-position"],"iconOnly":[516,"icon-only"],"href":[513],"target":[513],"color":[513],"fontColor":[513,"font-color"],"textAlign":[513,"text-align"],"justify":[516],"hovered":[32],"styles":[32]},null,{"fontColor":["getSymbolColor"],"color":["getSymbolColor"]}]]]], options);
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
exports.setNonce = index.setNonce;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function _typeof(o) {
|
|
4
|
+
"@babel/helpers - typeof";
|
|
5
|
+
|
|
6
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
7
|
+
return typeof o;
|
|
8
|
+
} : function (o) {
|
|
9
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
10
|
+
}, _typeof(o);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function requiredArgs(required, args) {
|
|
14
|
+
if (args.length < required) {
|
|
15
|
+
throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @name toDate
|
|
21
|
+
* @category Common Helpers
|
|
22
|
+
* @summary Convert the given argument to an instance of Date.
|
|
23
|
+
*
|
|
24
|
+
* @description
|
|
25
|
+
* Convert the given argument to an instance of Date.
|
|
26
|
+
*
|
|
27
|
+
* If the argument is an instance of Date, the function returns its clone.
|
|
28
|
+
*
|
|
29
|
+
* If the argument is a number, it is treated as a timestamp.
|
|
30
|
+
*
|
|
31
|
+
* If the argument is none of the above, the function returns Invalid Date.
|
|
32
|
+
*
|
|
33
|
+
* **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
|
|
34
|
+
*
|
|
35
|
+
* @param {Date|Number} argument - the value to convert
|
|
36
|
+
* @returns {Date} the parsed date in the local time zone
|
|
37
|
+
* @throws {TypeError} 1 argument required
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* // Clone the date:
|
|
41
|
+
* const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
|
|
42
|
+
* //=> Tue Feb 11 2014 11:30:30
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* // Convert the timestamp to date:
|
|
46
|
+
* const result = toDate(1392098430000)
|
|
47
|
+
* //=> Tue Feb 11 2014 11:30:30
|
|
48
|
+
*/
|
|
49
|
+
function toDate(argument) {
|
|
50
|
+
requiredArgs(1, arguments);
|
|
51
|
+
var argStr = Object.prototype.toString.call(argument);
|
|
52
|
+
|
|
53
|
+
// Clone the date
|
|
54
|
+
if (argument instanceof Date || _typeof(argument) === 'object' && argStr === '[object Date]') {
|
|
55
|
+
// Prevent the date to lose the milliseconds when passed to new Date() in IE10
|
|
56
|
+
return new Date(argument.getTime());
|
|
57
|
+
} else if (typeof argument === 'number' || argStr === '[object Number]') {
|
|
58
|
+
return new Date(argument);
|
|
59
|
+
} else {
|
|
60
|
+
if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
|
|
61
|
+
// eslint-disable-next-line no-console
|
|
62
|
+
console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments");
|
|
63
|
+
// eslint-disable-next-line no-console
|
|
64
|
+
console.warn(new Error().stack);
|
|
65
|
+
}
|
|
66
|
+
return new Date(NaN);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* @name isAfter
|
|
72
|
+
* @category Common Helpers
|
|
73
|
+
* @summary Is the first date after the second one?
|
|
74
|
+
*
|
|
75
|
+
* @description
|
|
76
|
+
* Is the first date after the second one?
|
|
77
|
+
*
|
|
78
|
+
* @param {Date|Number} date - the date that should be after the other one to return true
|
|
79
|
+
* @param {Date|Number} dateToCompare - the date to compare with
|
|
80
|
+
* @returns {Boolean} the first date is after the second date
|
|
81
|
+
* @throws {TypeError} 2 arguments required
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* // Is 10 July 1989 after 11 February 1987?
|
|
85
|
+
* const result = isAfter(new Date(1989, 6, 10), new Date(1987, 1, 11))
|
|
86
|
+
* //=> true
|
|
87
|
+
*/
|
|
88
|
+
function isAfter(dirtyDate, dirtyDateToCompare) {
|
|
89
|
+
requiredArgs(2, arguments);
|
|
90
|
+
var date = toDate(dirtyDate);
|
|
91
|
+
var dateToCompare = toDate(dirtyDateToCompare);
|
|
92
|
+
return date.getTime() > dateToCompare.getTime();
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* @name isBefore
|
|
97
|
+
* @category Common Helpers
|
|
98
|
+
* @summary Is the first date before the second one?
|
|
99
|
+
*
|
|
100
|
+
* @description
|
|
101
|
+
* Is the first date before the second one?
|
|
102
|
+
*
|
|
103
|
+
* @param {Date|Number} date - the date that should be before the other one to return true
|
|
104
|
+
* @param {Date|Number} dateToCompare - the date to compare with
|
|
105
|
+
* @returns {Boolean} the first date is before the second date
|
|
106
|
+
* @throws {TypeError} 2 arguments required
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
* // Is 10 July 1989 before 11 February 1987?
|
|
110
|
+
* const result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11))
|
|
111
|
+
* //=> false
|
|
112
|
+
*/
|
|
113
|
+
function isBefore(dirtyDate, dirtyDateToCompare) {
|
|
114
|
+
requiredArgs(2, arguments);
|
|
115
|
+
var date = toDate(dirtyDate);
|
|
116
|
+
var dateToCompare = toDate(dirtyDateToCompare);
|
|
117
|
+
return date.getTime() < dateToCompare.getTime();
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
exports._typeof = _typeof;
|
|
121
|
+
exports.isAfter = isAfter;
|
|
122
|
+
exports.isBefore = isBefore;
|
|
123
|
+
exports.requiredArgs = requiredArgs;
|
|
124
|
+
exports.toDate = toDate;
|
|
125
|
+
|
|
126
|
+
//# sourceMappingURL=index-6dc29195.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"index-6dc29195.js","mappings":";;AAAA,SAAS,OAAO,CAAC,CAAC,EAAE;AACpB,EAAE,yBAAyB,CAAC;AAC5B;AACA,EAAE,OAAO,OAAO,GAAG,UAAU,IAAI,OAAO,MAAM,IAAI,QAAQ,IAAI,OAAO,MAAM,CAAC,QAAQ,GAAG,UAAU,CAAC,EAAE;AACpG,IAAI,OAAO,OAAO,CAAC,CAAC;AACpB,GAAG,GAAG,UAAU,CAAC,EAAE;AACnB,IAAI,OAAO,CAAC,IAAI,UAAU,IAAI,OAAO,MAAM,IAAI,CAAC,CAAC,WAAW,KAAK,MAAM,IAAI,CAAC,KAAK,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OAAO,CAAC,IAAI,CAAC,oNAAoN,CAAC,CAAC;AACzO;AACA,MAAM,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,EAAE,CAAC,KAAK,CAAC,CAAC;AACtC,KAAK;AACL,IAAI,OAAO,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC;AACzB,GAAG;AACH;;ACjDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAAS,OAAO,CAAC,SAAS,EAAE,kBAAkB,EAAE;AAC/D,EAAE,YAAY,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;AAC7B,EAAE,IAAI,IAAI,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;AAC/B,EAAE,IAAI,aAAa,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC;AACjD,EAAE,OAAO,IAAI,CAAC,OAAO,EAAE,GAAG,aAAa,CAAC,OAAO,EAAE,CAAC;AAClD;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAAS,QAAQ,CAAC,SAAS,EAAE,kBAAkB,EAAE;AAChE,EAAE,YAAY,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;AAC7B,EAAE,IAAI,IAAI,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;AAC/B,EAAE,IAAI,aAAa,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC;AACjD,EAAE,OAAO,IAAI,CAAC,OAAO,EAAE,GAAG,aAAa,CAAC,OAAO,EAAE,CAAC;AAClD;;;;;;;;","names":[],"sources":["../../node_modules/@babel/runtime/helpers/esm/typeof.js","../../node_modules/date-fns/esm/_lib/requiredArgs/index.js","../../node_modules/date-fns/esm/toDate/index.js","../../node_modules/date-fns/esm/isAfter/index.js","../../node_modules/date-fns/esm/isBefore/index.js"],"sourcesContent":["function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\nexport { _typeof as default };","export default function requiredArgs(required, args) {\n if (args.length < required) {\n throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');\n }\n}","import _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @param {Date|Number} argument - the value to convert\n * @returns {Date} the parsed date in the local time zone\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\nexport default function toDate(argument) {\n requiredArgs(1, arguments);\n var argStr = Object.prototype.toString.call(argument);\n\n // Clone the date\n if (argument instanceof Date || _typeof(argument) === 'object' && argStr === '[object Date]') {\n // Prevent the date to lose the milliseconds when passed to new Date() in IE10\n return new Date(argument.getTime());\n } else if (typeof argument === 'number' || argStr === '[object Number]') {\n return new Date(argument);\n } else {\n if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {\n // eslint-disable-next-line no-console\n console.warn(\"Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments\");\n // eslint-disable-next-line no-console\n console.warn(new Error().stack);\n }\n return new Date(NaN);\n }\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isAfter\n * @category Common Helpers\n * @summary Is the first date after the second one?\n *\n * @description\n * Is the first date after the second one?\n *\n * @param {Date|Number} date - the date that should be after the other one to return true\n * @param {Date|Number} dateToCompare - the date to compare with\n * @returns {Boolean} the first date is after the second date\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Is 10 July 1989 after 11 February 1987?\n * const result = isAfter(new Date(1989, 6, 10), new Date(1987, 1, 11))\n * //=> true\n */\nexport default function isAfter(dirtyDate, dirtyDateToCompare) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var dateToCompare = toDate(dirtyDateToCompare);\n return date.getTime() > dateToCompare.getTime();\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isBefore\n * @category Common Helpers\n * @summary Is the first date before the second one?\n *\n * @description\n * Is the first date before the second one?\n *\n * @param {Date|Number} date - the date that should be before the other one to return true\n * @param {Date|Number} dateToCompare - the date to compare with\n * @returns {Boolean} the first date is before the second date\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Is 10 July 1989 before 11 February 1987?\n * const result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11))\n * //=> false\n */\nexport default function isBefore(dirtyDate, dirtyDateToCompare) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var dateToCompare = toDate(dirtyDateToCompare);\n return date.getTime() < dateToCompare.getTime();\n}"],"version":3}
|