@rededor/cura 1.0.0-alpha.7 → 1.0.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/icons/iconset-default-list.ts +1 -1
- package/dist/assets/assets/icons/iconset-default-tmp.svg +4 -0
- package/dist/assets/assets/icons/iconset-default.svg +1 -1
- package/dist/cjs/{app-globals-bcffd819.js → app-globals-b77d5b06.js} +7 -7
- package/dist/cjs/{app-globals-bcffd819.js.map → app-globals-b77d5b06.js.map} +1 -1
- package/dist/cjs/cura-accordion_12.cjs.entry.js +30 -16
- package/dist/cjs/cura-accordion_12.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-alert.cjs.entry.js +1 -1
- package/dist/cjs/cura-avatar.cjs.entry.js +1 -1
- package/dist/cjs/cura-badge-distance.cjs.entry.js +46 -0
- package/dist/cjs/cura-badge-distance.cjs.entry.js.map +1 -0
- package/dist/cjs/cura-button-outline.cjs.entry.js +10 -6
- 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-button-transparent.cjs.entry.js +11 -7
- package/dist/cjs/cura-button-transparent.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-button.definitions-f036371c.js +12 -0
- package/dist/cjs/cura-button.definitions-f036371c.js.map +1 -0
- package/dist/cjs/cura-calendar.cjs.entry.js +99 -10
- package/dist/cjs/cura-calendar.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-card.cjs.entry.js +1 -1
- package/dist/cjs/cura-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/cura-display.cjs.entry.js +19 -10
- package/dist/cjs/cura-display.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-dropdown-search-option-title.cjs.entry.js +1 -1
- package/dist/cjs/cura-dropdown-search-option.cjs.entry.js +5 -3
- 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-dropdown-search.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-icons-view.cjs.entry.js +4 -4
- package/dist/cjs/cura-icons-view.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-loader-bar.cjs.entry.js +1 -1
- package/dist/cjs/cura-radio.cjs.entry.js +1 -1
- package/dist/cjs/cura-switch.cjs.entry.js +1 -1
- package/dist/cjs/cura-toast.cjs.entry.js +1 -1
- package/dist/cjs/cura.cjs.js +2 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/api/theme-presets/theme-maternity.js +6 -6
- package/dist/collection/api/theme-presets/theme-maternity.js.map +1 -1
- package/dist/collection/assets/icons/iconset-default-list.js +1 -1
- package/dist/collection/assets/icons/iconset-default-list.js.map +1 -1
- package/dist/collection/assets/icons/iconset-default-tmp.svg +4 -0
- package/dist/collection/assets/icons/iconset-default.svg +1 -1
- package/dist/collection/assets-raw/icons/default/drug.svg +3 -0
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/badges/cura-badge-distance/cura-badge-distance.css +28 -0
- package/dist/collection/components/badges/cura-badge-distance/cura-badge-distance.js +94 -0
- package/dist/collection/components/badges/cura-badge-distance/cura-badge-distance.js.map +1 -0
- package/dist/collection/components/badges/cura-badge-distance/cura-badge-distance.stories.js +56 -0
- package/dist/collection/components/badges/cura-badge-distance/cura-badge-distance.stories.js.map +1 -0
- package/dist/collection/components/buttons/cura-button/cura-button.css +61 -65
- package/dist/collection/components/buttons/cura-button/cura-button.js +26 -3
- package/dist/collection/components/buttons/cura-button/cura-button.js.map +1 -1
- package/dist/collection/components/buttons/cura-button/cura-button.stories.js +28 -2
- package/dist/collection/components/buttons/cura-button/cura-button.stories.js.map +1 -1
- package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.css +50 -53
- package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.js +28 -6
- package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.js.map +1 -1
- package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.stories.js +28 -2
- package/dist/collection/components/buttons/cura-button-outline/cura-button-outline.stories.js.map +1 -1
- package/dist/collection/components/buttons/cura-button-select/cura-button-select.css +29 -33
- package/dist/collection/components/buttons/cura-button-select/cura-button-select.js +1 -1
- package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.css +37 -54
- package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.js +31 -9
- package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.js.map +1 -1
- package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.stories.js +16 -6
- package/dist/collection/components/buttons/cura-button-transparent/cura-button-transparent.stories.js.map +1 -1
- package/dist/collection/components/buttons/cura-button.definitions.js +7 -0
- package/dist/collection/components/buttons/cura-button.definitions.js.map +1 -0
- 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 +18 -1
- package/dist/collection/components/cura-calendar/cura-calendar.js +93 -17
- package/dist/collection/components/cura-calendar/cura-calendar.js.map +1 -1
- package/dist/collection/components/cura-calendar/cura-calendar.stories.js +24 -4
- 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.js +1 -1
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.css +48 -29
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.js +4 -2
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.js.map +1 -1
- 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 +3 -3
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.js.map +1 -1
- package/dist/collection/components/forms/cura-input-text/cura-input-text.js +1 -1
- package/dist/collection/components/forms/cura-label/cura-label.js +3 -3
- 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 +14 -3
- package/dist/collection/components/forms/cura-select/cura-select.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.css +16 -0
- package/dist/collection/components/text/cura-display/cura-display.js +37 -10
- package/dist/collection/components/text/cura-display/cura-display.js.map +1 -1
- package/dist/collection/components/text/cura-display/cura-display.stories.js +13 -2
- package/dist/collection/components/text/cura-display/cura-display.stories.js.map +1 -1
- package/dist/collection/components/text/cura-heading/cura-heading.js +1 -1
- package/dist/collection/components/text/cura-paragraph/cura-paragraph.css +9 -1
- package/dist/collection/components/text/cura-paragraph/cura-paragraph.js +1 -1
- package/dist/collection/components/text/cura-paragraph/cura-paragraph.stories.js +1 -1
- package/dist/collection/components/text/cura-paragraph/cura-paragraph.stories.js.map +1 -1
- package/dist/components/cura-alert.js +1 -1
- package/dist/components/cura-avatar.js +1 -1
- package/dist/components/cura-badge-distance.d.ts +11 -0
- package/dist/components/cura-badge-distance.js +73 -0
- package/dist/components/cura-badge-distance.js.map +1 -0
- package/dist/components/cura-button-outline.js +11 -6
- package/dist/components/cura-button-outline.js.map +1 -1
- package/dist/components/cura-button-select.js +2 -2
- package/dist/components/cura-button-select.js.map +1 -1
- package/dist/components/cura-button-transparent2.js +13 -8
- package/dist/components/cura-button-transparent2.js.map +1 -1
- package/dist/components/cura-button.definitions.js +10 -0
- package/dist/components/cura-button.definitions.js.map +1 -0
- package/dist/components/cura-button.js +10 -4
- package/dist/components/cura-button.js.map +1 -1
- package/dist/components/cura-calendar.js +118 -15
- package/dist/components/cura-calendar.js.map +1 -1
- package/dist/components/cura-card.js +1 -1
- package/dist/components/cura-checkbox.js +1 -1
- package/dist/components/cura-display.js +21 -11
- package/dist/components/cura-display.js.map +1 -1
- package/dist/components/cura-dropdown-search-option-title.js +1 -1
- package/dist/components/cura-dropdown-search-option.js +5 -3
- package/dist/components/cura-dropdown-search-option.js.map +1 -1
- package/dist/components/cura-dropdown-search.js +3 -3
- 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 +4 -4
- package/dist/components/cura-icons-view.js.map +1 -1
- package/dist/components/cura-label2.js +1 -1
- 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-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 +15 -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 +8 -6
- 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-0a923806.entry.js +2 -0
- package/dist/cura/p-0a923806.entry.js.map +1 -0
- package/dist/cura/{p-260edb61.entry.js → p-0d435e42.entry.js} +2 -2
- package/dist/cura/{p-8433fec9.entry.js → p-0dd837cf.entry.js} +2 -2
- package/dist/cura/{p-c63f4695.entry.js → p-2203e829.entry.js} +2 -2
- package/dist/cura/{p-6373c7cd.entry.js → p-4c7a2419.entry.js} +2 -2
- package/dist/cura/p-4ef24fbd.entry.js +2 -0
- package/dist/cura/p-4ef24fbd.entry.js.map +1 -0
- package/dist/cura/p-57b8b468.entry.js +2 -0
- package/dist/cura/p-57b8b468.entry.js.map +1 -0
- package/dist/cura/p-599acc84.entry.js +2 -0
- package/dist/cura/p-599acc84.entry.js.map +1 -0
- package/dist/cura/p-6682619b.entry.js +2 -0
- package/dist/cura/p-6682619b.entry.js.map +1 -0
- package/dist/cura/{p-5fcfbf32.entry.js → p-66c5cf5f.entry.js} +2 -2
- package/dist/cura/{p-4eaeb590.entry.js → p-84d8c67d.entry.js} +2 -2
- package/dist/cura/p-a00d2c68.entry.js +2 -0
- package/dist/cura/p-a00d2c68.entry.js.map +1 -0
- package/dist/cura/{p-a9dad622.entry.js → p-a5cf0fd6.entry.js} +2 -2
- package/dist/cura/{p-70c369b1.js → p-a6c3c0ea.js} +2 -2
- package/dist/cura/{p-70c369b1.js.map → p-a6c3c0ea.js.map} +1 -1
- package/dist/cura/{p-f016eb62.entry.js → p-ad8a7e0f.entry.js} +2 -2
- package/dist/cura/p-b301a1ef.entry.js +2 -0
- package/dist/cura/p-b301a1ef.entry.js.map +1 -0
- package/dist/cura/{p-0b1829ed.entry.js → p-dc5d0c29.entry.js} +2 -2
- package/dist/cura/p-dc5d0c29.entry.js.map +1 -0
- package/dist/cura/p-df5c3a86.entry.js +2 -0
- package/dist/cura/{p-17a878d4.entry.js.map → p-df5c3a86.entry.js.map} +1 -1
- package/dist/cura/p-dfc65f66.entry.js +2 -0
- package/dist/cura/p-efcb32eb.js +2 -0
- package/dist/cura/p-efcb32eb.js.map +1 -0
- package/dist/cura/p-f9433d24.entry.js +2 -0
- package/dist/cura/p-f9433d24.entry.js.map +1 -0
- package/dist/esm/{app-globals-f2da2b14.js → app-globals-488bf508.js} +7 -7
- package/dist/esm/{app-globals-f2da2b14.js.map → app-globals-488bf508.js.map} +1 -1
- package/dist/esm/cura-accordion_12.entry.js +30 -16
- package/dist/esm/cura-accordion_12.entry.js.map +1 -1
- package/dist/esm/cura-alert.entry.js +1 -1
- package/dist/esm/cura-avatar.entry.js +1 -1
- package/dist/esm/cura-badge-distance.entry.js +42 -0
- package/dist/esm/cura-badge-distance.entry.js.map +1 -0
- package/dist/esm/cura-button-outline.entry.js +10 -6
- 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-button-transparent.entry.js +11 -7
- package/dist/esm/cura-button-transparent.entry.js.map +1 -1
- package/dist/esm/cura-button.definitions-617d3bad.js +10 -0
- package/dist/esm/cura-button.definitions-617d3bad.js.map +1 -0
- package/dist/esm/cura-calendar.entry.js +99 -10
- package/dist/esm/cura-calendar.entry.js.map +1 -1
- package/dist/esm/cura-card.entry.js +1 -1
- package/dist/esm/cura-checkbox.entry.js +1 -1
- package/dist/esm/cura-display.entry.js +19 -10
- package/dist/esm/cura-display.entry.js.map +1 -1
- package/dist/esm/cura-dropdown-search-option-title.entry.js +1 -1
- package/dist/esm/cura-dropdown-search-option.entry.js +5 -3
- 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-dropdown-search.entry.js.map +1 -1
- package/dist/esm/cura-icons-view.entry.js +4 -4
- package/dist/esm/cura-icons-view.entry.js.map +1 -1
- package/dist/esm/cura-loader-bar.entry.js +1 -1
- package/dist/esm/cura-radio.entry.js +1 -1
- package/dist/esm/cura-switch.entry.js +1 -1
- package/dist/esm/cura-toast.entry.js +1 -1
- package/dist/esm/cura.js +2 -2
- package/dist/esm/loader.js +2 -2
- package/dist/types/components/badges/cura-badge-distance/cura-badge-distance.d.ts +12 -0
- package/dist/types/components/badges/cura-badge-distance/cura-badge-distance.stories.d.ts +39 -0
- package/dist/types/components/buttons/cura-button/cura-button.d.ts +5 -0
- package/dist/types/components/buttons/cura-button/cura-button.stories.d.ts +23 -0
- package/dist/types/components/buttons/cura-button-outline/cura-button-outline.d.ts +6 -1
- package/dist/types/components/buttons/cura-button-outline/cura-button-outline.stories.d.ts +23 -0
- package/dist/types/components/buttons/cura-button-transparent/cura-button-transparent.d.ts +6 -0
- package/dist/types/components/buttons/cura-button-transparent/cura-button-transparent.stories.d.ts +11 -0
- package/dist/types/components/buttons/cura-button.definitions.d.ts +6 -0
- package/dist/types/components/cura-calendar/cura-calendar.d.ts +13 -7
- package/dist/types/components/cura-calendar/cura-calendar.stories.d.ts +23 -1
- package/dist/types/components/forms/cura-label/cura-label.d.ts +1 -1
- package/dist/types/components/forms/cura-select/cura-select.d.ts +1 -0
- package/dist/types/components/text/cura-display/cura-display.d.ts +6 -0
- package/dist/types/components/text/cura-display/cura-display.stories.d.ts +14 -0
- package/dist/types/components.d.ts +67 -14
- package/package.json +2 -2
- package/dist/cura/p-0b1829ed.entry.js.map +0 -1
- package/dist/cura/p-17a878d4.entry.js +0 -2
- package/dist/cura/p-335323b5.entry.js +0 -2
- package/dist/cura/p-335323b5.entry.js.map +0 -1
- package/dist/cura/p-67e34464.entry.js +0 -2
- package/dist/cura/p-67e34464.entry.js.map +0 -1
- package/dist/cura/p-79fa3b97.entry.js +0 -2
- package/dist/cura/p-79fa3b97.entry.js.map +0 -1
- package/dist/cura/p-89014323.entry.js +0 -2
- package/dist/cura/p-89014323.entry.js.map +0 -1
- package/dist/cura/p-9a4094e3.entry.js +0 -2
- package/dist/cura/p-9a4094e3.entry.js.map +0 -1
- package/dist/cura/p-af2036a7.entry.js +0 -2
- package/dist/cura/p-b0d66386.entry.js +0 -2
- package/dist/cura/p-b0d66386.entry.js.map +0 -1
- package/dist/cura/p-c518a91c.entry.js +0 -2
- package/dist/cura/p-c518a91c.entry.js.map +0 -1
- /package/dist/cura/{p-260edb61.entry.js.map → p-0d435e42.entry.js.map} +0 -0
- /package/dist/cura/{p-8433fec9.entry.js.map → p-0dd837cf.entry.js.map} +0 -0
- /package/dist/cura/{p-c63f4695.entry.js.map → p-2203e829.entry.js.map} +0 -0
- /package/dist/cura/{p-6373c7cd.entry.js.map → p-4c7a2419.entry.js.map} +0 -0
- /package/dist/cura/{p-5fcfbf32.entry.js.map → p-66c5cf5f.entry.js.map} +0 -0
- /package/dist/cura/{p-4eaeb590.entry.js.map → p-84d8c67d.entry.js.map} +0 -0
- /package/dist/cura/{p-a9dad622.entry.js.map → p-a5cf0fd6.entry.js.map} +0 -0
- /package/dist/cura/{p-f016eb62.entry.js.map → p-ad8a7e0f.entry.js.map} +0 -0
- /package/dist/cura/{p-af2036a7.entry.js.map → p-dfc65f66.entry.js.map} +0 -0
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import { d as defineCustomElement$
|
|
3
|
-
import { d as defineCustomElement$
|
|
2
|
+
import { d as defineCustomElement$7 } from './cura-button-transparent2.js';
|
|
3
|
+
import { d as defineCustomElement$6 } from './cura-icon2.js';
|
|
4
|
+
import { d as defineCustomElement$5 } from './cura-label2.js';
|
|
5
|
+
import { d as defineCustomElement$4 } from './cura-loader-circle2.js';
|
|
4
6
|
import { d as defineCustomElement$3 } from './cura-select2.js';
|
|
5
7
|
import { d as defineCustomElement$2 } from './cura-select-option2.js';
|
|
6
8
|
|
|
@@ -291,6 +293,31 @@ function startOfDay(dirtyDate) {
|
|
|
291
293
|
return date;
|
|
292
294
|
}
|
|
293
295
|
|
|
296
|
+
/**
|
|
297
|
+
* @name addWeeks
|
|
298
|
+
* @category Week Helpers
|
|
299
|
+
* @summary Add the specified number of weeks to the given date.
|
|
300
|
+
*
|
|
301
|
+
* @description
|
|
302
|
+
* Add the specified number of week to the given date.
|
|
303
|
+
*
|
|
304
|
+
* @param {Date|Number} date - the date to be changed
|
|
305
|
+
* @param {Number} amount - the amount of weeks to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
|
|
306
|
+
* @returns {Date} the new date with the weeks added
|
|
307
|
+
* @throws {TypeError} 2 arguments required
|
|
308
|
+
*
|
|
309
|
+
* @example
|
|
310
|
+
* // Add 4 weeks to 1 September 2014:
|
|
311
|
+
* const result = addWeeks(new Date(2014, 8, 1), 4)
|
|
312
|
+
* //=> Mon Sep 29 2014 00:00:00
|
|
313
|
+
*/
|
|
314
|
+
function addWeeks(dirtyDate, dirtyAmount) {
|
|
315
|
+
requiredArgs(2, arguments);
|
|
316
|
+
var amount = toInteger(dirtyAmount);
|
|
317
|
+
var days = amount * 7;
|
|
318
|
+
return addDays(dirtyDate, days);
|
|
319
|
+
}
|
|
320
|
+
|
|
294
321
|
/**
|
|
295
322
|
* Days in 1 week.
|
|
296
323
|
*
|
|
@@ -3079,6 +3106,30 @@ function subMonths(dirtyDate, dirtyAmount) {
|
|
|
3079
3106
|
return addMonths(dirtyDate, -amount);
|
|
3080
3107
|
}
|
|
3081
3108
|
|
|
3109
|
+
/**
|
|
3110
|
+
* @name subWeeks
|
|
3111
|
+
* @category Week Helpers
|
|
3112
|
+
* @summary Subtract the specified number of weeks from the given date.
|
|
3113
|
+
*
|
|
3114
|
+
* @description
|
|
3115
|
+
* Subtract the specified number of weeks from the given date.
|
|
3116
|
+
*
|
|
3117
|
+
* @param {Date|Number} date - the date to be changed
|
|
3118
|
+
* @param {Number} amount - the amount of weeks to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
|
|
3119
|
+
* @returns {Date} the new date with the weeks subtracted
|
|
3120
|
+
* @throws {TypeError} 2 arguments required
|
|
3121
|
+
*
|
|
3122
|
+
* @example
|
|
3123
|
+
* // Subtract 4 weeks from 1 September 2014:
|
|
3124
|
+
* const result = subWeeks(new Date(2014, 8, 1), 4)
|
|
3125
|
+
* //=> Mon Aug 04 2014 00:00:00
|
|
3126
|
+
*/
|
|
3127
|
+
function subWeeks(dirtyDate, dirtyAmount) {
|
|
3128
|
+
requiredArgs(2, arguments);
|
|
3129
|
+
var amount = toInteger(dirtyAmount);
|
|
3130
|
+
return addWeeks(dirtyDate, -amount);
|
|
3131
|
+
}
|
|
3132
|
+
|
|
3082
3133
|
var dateFormats$1 = {
|
|
3083
3134
|
full: 'EEEE, d MMMM yyyy',
|
|
3084
3135
|
long: 'd MMMM yyyy',
|
|
@@ -3518,7 +3569,7 @@ var locale = {
|
|
|
3518
3569
|
};
|
|
3519
3570
|
const ptBR = locale;
|
|
3520
3571
|
|
|
3521
|
-
const curaCalendarCss = ":host{display:block;width:var(--width)}:host .calendar{display:flex;flex-direction:column;gap:5px;width:var(--width);padding:0 12px 12px 12px;min-width:
|
|
3572
|
+
const curaCalendarCss = ":host{display:block;width:var(--width)}:host .calendar{display:flex;flex-direction:column;gap:5px;width:var(--width);padding:0 12px 12px 12px;min-width:280px;border:1px solid var(--neutral-light);border-radius:4px;overflow:hidden;background:#fff;box-shadow:0 4px 8px var(--neutral-light);font-family:var(--font-family)}:host .header{position:relative;padding:12px 0}:host .header::after{content:\"\";position:absolute;bottom:0;left:2px;right:2px;border-bottom:2px dotted var(--neutral-light)}:host .month-year{display:flex;padding:12px 8px;justify-content:space-between;align-self:stretch}:host .month-year.dropdown{padding:0%}:host .select{display:flex;padding:0px 12px;justify-content:center;align-items:center;gap:6px;flex:1 0 0}:host .drop-month{display:flex;max-width:118px;padding:0px;align-items:flex-start;gap:0px;flex:1 0 0}:host .drop-year{display:flex;min-width:80px;max-width:85px;padding:0px;align-items:flex-start;gap:0px;flex:1 0 0}:host .days-of-week{display:flex;height:30px;padding:4px;justify-content:center;align-items:center;gap:4px;flex-shrink:0}:host .day{flex:1;text-align:center}:host .dates{display:flex;flex-wrap:wrap;align-items:center;align-self:stretch;gap:0}:host .icon{cursor:pointer;position:relative;overflow:hidden;border-radius:50%}:host .icon.dropdown{margin-top:10px}:host .icon::before{content:\"\";position:absolute;border-radius:50%;top:50%;left:50%;width:20px;height:20px;background:var(--accent-base);transform:translate(-50%, -50%) scale(0);transition:transform 0.2s ease}:host .icon:active::before{transform:translate(-50%, -50%) scale(1)}:host .icon:active{transform:scale(1)}:host .collapsed-container{text-align:center;position:relative;display:flex;align-items:center;justify-content:center;padding-top:10px}:host .collapsed-container::before{content:\"\";position:absolute;bottom:0;top:0;left:2px;right:2px;border-top:2px dotted var(--neutral-light)}:host .date{display:flex;justify-content:center;align-items:center;height:auto;width:14.2857142857%;aspect-ratio:1;font-size:14px;cursor:pointer;position:relative;box-sizing:border-box;text-align:center;flex-shrink:0}:host .date.today{border:2px solid var(--primary-darker);border-radius:50%;color:var(--primary-darker)}:host .date.selected,:host .date.default-dates{color:var(--neutral-black) !important;background:var(--accent-base);border-radius:50%;border:none}:host .date.invalid{color:var(--neutral-dark) !important;cursor:not-allowed}:host .date.invalid:hover{background:none;box-shadow:none}:host .date.valid{color:var(--primary-darker);font-weight:var(--font-weight-bold)}:host .date.range.start{border-radius:50% 0 0 50%;color:var(--primary-darker) !important;background:var(--accent-base)}:host .date.range.interval{border-radius:0;background-color:var(--accent-light);color:var(--neutral-black)}:host .date.range.interval.today{border:none}:host .date.range.end{border-radius:0 50% 50% 0;color:var(--primary-darker) !important;background:var(--accent-base)}:host .date:hover{background:var(--accent-light);border-radius:50%;color:var(--neutral-black)}:host select,:host input{width:60px;font-size:16px;box-shadow:0 2px 2px var(--neutral-black);padding:5px;border-radius:4px;border:1px solid #ccc;background:#f7f7f7}";
|
|
3522
3573
|
const CuraCalendarStyle0 = curaCalendarCss;
|
|
3523
3574
|
|
|
3524
3575
|
const CuraCalendar$1 = /*@__PURE__*/ proxyCustomElement(class CuraCalendar extends HTMLElement {
|
|
@@ -3530,8 +3581,8 @@ const CuraCalendar$1 = /*@__PURE__*/ proxyCustomElement(class CuraCalendar exten
|
|
|
3530
3581
|
this.theme = window.CuraAPI.theme;
|
|
3531
3582
|
this.weights = this.theme.fonts.getWeights();
|
|
3532
3583
|
this.optionsLocale = { 'pt-BR': ptBR, 'en-US': enAU };
|
|
3533
|
-
this.period =
|
|
3534
|
-
this.width = '
|
|
3584
|
+
this.period = null;
|
|
3585
|
+
this.width = '280px';
|
|
3535
3586
|
this.mode = 'single';
|
|
3536
3587
|
this.dateFormat = 'yyyy-MM-dd';
|
|
3537
3588
|
this.locale = 'pt-BR';
|
|
@@ -3540,6 +3591,8 @@ const CuraCalendar$1 = /*@__PURE__*/ proxyCustomElement(class CuraCalendar exten
|
|
|
3540
3591
|
this.enable = [];
|
|
3541
3592
|
this.defaultDate = [];
|
|
3542
3593
|
this.limitRange = null;
|
|
3594
|
+
this.disablePassDates = false;
|
|
3595
|
+
this.collapsed = null;
|
|
3543
3596
|
this.currentDate = new Date();
|
|
3544
3597
|
this.selectedDates = [];
|
|
3545
3598
|
this.rangeStart = null;
|
|
@@ -3590,6 +3643,9 @@ const CuraCalendar$1 = /*@__PURE__*/ proxyCustomElement(class CuraCalendar exten
|
|
|
3590
3643
|
* @returns {boolean} Whether the date is valid.
|
|
3591
3644
|
*/
|
|
3592
3645
|
isDateInValidPeriod(date) {
|
|
3646
|
+
if (this.period === null) {
|
|
3647
|
+
return true;
|
|
3648
|
+
}
|
|
3593
3649
|
return this.period.includes(format(date, this.dateFormat));
|
|
3594
3650
|
}
|
|
3595
3651
|
/**
|
|
@@ -3617,6 +3673,12 @@ const CuraCalendar$1 = /*@__PURE__*/ proxyCustomElement(class CuraCalendar exten
|
|
|
3617
3673
|
* @returns {boolean} Whether the date is disabled.
|
|
3618
3674
|
*/
|
|
3619
3675
|
isDateInDisabledPeriod(date) {
|
|
3676
|
+
const today = new Date();
|
|
3677
|
+
today.setHours(0, 0, 0, 0);
|
|
3678
|
+
if (this.disablePassDates)
|
|
3679
|
+
return isBefore(date, today);
|
|
3680
|
+
if (this.disable === null)
|
|
3681
|
+
return false;
|
|
3620
3682
|
return this.isDateInList(this.expandDateRanges(this.disable), date);
|
|
3621
3683
|
}
|
|
3622
3684
|
/**
|
|
@@ -3626,7 +3688,7 @@ const CuraCalendar$1 = /*@__PURE__*/ proxyCustomElement(class CuraCalendar exten
|
|
|
3626
3688
|
* @returns {boolean} Whether the date is enabled.
|
|
3627
3689
|
*/
|
|
3628
3690
|
isDateInEnabledPeriod(date) {
|
|
3629
|
-
if (this.enable
|
|
3691
|
+
if (this.enable === null || [])
|
|
3630
3692
|
return true;
|
|
3631
3693
|
return this.isDateInList(this.expandDateRanges(this.enable), date);
|
|
3632
3694
|
}
|
|
@@ -3670,7 +3732,7 @@ const CuraCalendar$1 = /*@__PURE__*/ proxyCustomElement(class CuraCalendar exten
|
|
|
3670
3732
|
*/
|
|
3671
3733
|
onMonthDropdownChange(event) {
|
|
3672
3734
|
const { months } = this.fetchMonthNames();
|
|
3673
|
-
const newMonth = event.detail
|
|
3735
|
+
const newMonth = event.detail;
|
|
3674
3736
|
this.selectMonth = newMonth;
|
|
3675
3737
|
this.currentDate = new Date(getYear(this.currentDate), months.indexOf(newMonth), 1);
|
|
3676
3738
|
}
|
|
@@ -3680,7 +3742,7 @@ const CuraCalendar$1 = /*@__PURE__*/ proxyCustomElement(class CuraCalendar exten
|
|
|
3680
3742
|
* @param {CustomEvent} event - The change event.
|
|
3681
3743
|
*/
|
|
3682
3744
|
onYearDropdownChange(event) {
|
|
3683
|
-
const newYear = event.detail
|
|
3745
|
+
const newYear = event.detail;
|
|
3684
3746
|
this.selectYear = newYear;
|
|
3685
3747
|
this.currentDate = new Date(newYear, getMonth(this.currentDate), 1);
|
|
3686
3748
|
}
|
|
@@ -3772,11 +3834,38 @@ const CuraCalendar$1 = /*@__PURE__*/ proxyCustomElement(class CuraCalendar exten
|
|
|
3772
3834
|
*
|
|
3773
3835
|
* @returns {(Date | null)[]} An array of dates and nulls for the current month view.
|
|
3774
3836
|
*/
|
|
3837
|
+
showNotColapsedCalendar() {
|
|
3838
|
+
if (this.collapsed) {
|
|
3839
|
+
this.fetchDaysOfWeek();
|
|
3840
|
+
}
|
|
3841
|
+
else
|
|
3842
|
+
(this.fetchDaysOfMonth());
|
|
3843
|
+
this.collapsed = false;
|
|
3844
|
+
}
|
|
3845
|
+
showColapsedCalendar() {
|
|
3846
|
+
this.collapsed = true;
|
|
3847
|
+
return this.fetchDaysOfWeek();
|
|
3848
|
+
}
|
|
3849
|
+
fetchDaysOfWeek() {
|
|
3850
|
+
const DAYS_IN_CALENDAR_VIEW = 7;
|
|
3851
|
+
const start = startOfWeek(this.currentDate);
|
|
3852
|
+
const end = endOfWeek(this.currentDate);
|
|
3853
|
+
const daysIncurrentDate = eachDayOfInterval({ start, end });
|
|
3854
|
+
return daysIncurrentDate.slice(0, DAYS_IN_CALENDAR_VIEW);
|
|
3855
|
+
}
|
|
3856
|
+
updateCurrentWeek(direction) {
|
|
3857
|
+
let newWeek = new Date(this.currentDate);
|
|
3858
|
+
if (direction === 'prev')
|
|
3859
|
+
newWeek = subWeeks(this.currentDate, 1);
|
|
3860
|
+
if (direction === 'next')
|
|
3861
|
+
newWeek = addWeeks(this.currentDate, 1);
|
|
3862
|
+
this.currentDate = newWeek;
|
|
3863
|
+
}
|
|
3775
3864
|
fetchDaysOfMonth() {
|
|
3776
|
-
const start = startOfMonth(this.currentDate);
|
|
3777
|
-
const end = endOfMonth(this.currentDate);
|
|
3778
3865
|
const WEEKS_IN_CALENDAR_VIEW = 6;
|
|
3779
3866
|
const DAYS_IN_CALENDAR_VIEW = 42;
|
|
3867
|
+
const start = startOfMonth(this.currentDate);
|
|
3868
|
+
const end = endOfMonth(this.currentDate);
|
|
3780
3869
|
const daysIncurrentDate = eachDayOfInterval({ start, end });
|
|
3781
3870
|
const prevMonthStart = startOfMonth(addMonths(start, -1));
|
|
3782
3871
|
const prevMonthEnd = endOfMonth(prevMonthStart);
|
|
@@ -3831,7 +3920,7 @@ const CuraCalendar$1 = /*@__PURE__*/ proxyCustomElement(class CuraCalendar exten
|
|
|
3831
3920
|
*/
|
|
3832
3921
|
determinePrevButtonColor() {
|
|
3833
3922
|
const isPrevDisabled = isBefore(new Date(getYear(this.currentDate), getMonth(this.currentDate) - 1, 1), startOfMonth(new Date()));
|
|
3834
|
-
return isPrevDisabled
|
|
3923
|
+
return isPrevDisabled && 'primary-base';
|
|
3835
3924
|
}
|
|
3836
3925
|
/**
|
|
3837
3926
|
* Get the status of a given date, determining its position and interval status.
|
|
@@ -3905,20 +3994,24 @@ const CuraCalendar$1 = /*@__PURE__*/ proxyCustomElement(class CuraCalendar exten
|
|
|
3905
3994
|
}
|
|
3906
3995
|
render() {
|
|
3907
3996
|
const { months } = this.fetchMonthNames();
|
|
3908
|
-
return (h(Host, { key: '
|
|
3997
|
+
return (h(Host, { key: '49e48240bb1da756c8d4ee8dff554a24b1da8038', style: this.getHostCSSProperties() }, h("div", { key: 'bfa7c4b9362c6a9b3c35639ebb720a3fd2601fa4', class: "calendar", style: this.styles }, h("header", { key: 'aa6803cb2bf8b6f7b58cdd9796921aadfc40abca', class: "header" }, h("div", { key: 'efa9f7c0598677defca5f31220e3b1f0dbc16037', class: `month-year ${this.type === 'dropdown' && 'dropdown'}` }, h("cura-icon", { key: '759a409d176a47c44be9615bf342d8a6d296ded6', class: `icon ${this.type === 'dropdown' && 'dropdown'}`, name: "left", color: this.determinePrevButtonColor(), onClick: !this.collapsed ? () => this.updateCurrentMonth('prev') : () => this.updateCurrentWeek('prev') }), this.type === 'dropdown' ? (h("div", { class: "select" }, h("cura-select", { class: "drop-month", mode: "transparent", value: months[getMonth(this.currentDate)], onSelected: (e) => this.onMonthDropdownChange(e) }, months.map((month, index) => (h("cura-select-option", { key: index, value: month }, month)))), h("cura-select", { class: "drop-year", mode: "transparent", value: getYear(this.currentDate).toString(), onSelected: (e) => this.onYearDropdownChange(e) }, this.fetchYearList().map((year, index) => (h("cura-select-option", { key: index, value: year.toString() }, year.toString())))))) : (h("cura-label", { color: "neutral-black", size: "large" }, months[getMonth(this.currentDate)].slice(0, 3), ", ", getYear(this.currentDate))), h("cura-icon", { key: '650919445aa94fd26b9605da79dbaa1950652c0d', class: `icon ${this.type === 'dropdown' && 'dropdown'}`, name: "right", color: "primary-base", onClick: !this.collapsed ? () => this.updateCurrentMonth('next') : () => this.updateCurrentWeek('next') }))), h("span", { key: '3934dec68753250503976b462b6589327b7be613', class: "days-of-week" }, this.fetchWeekDays().map((day, index) => (h("cura-label", { class: "day", size: "xsmall", color: "neutral-black", weight: 'bold', key: index }, day === 'sab' ? 'SÁB' : day.toLocaleUpperCase())))), h("div", { key: '47e46d363c972877b97889c3c5756c14d42046de', class: "dates" }, !this.collapsed ?
|
|
3998
|
+
this.fetchDaysOfMonth().map((day, index) => (h("div", { key: index, class: this.getClasses(day), onClick: () => this.onDateClick(day) }, day ? format(day, 'd') : ''))) :
|
|
3999
|
+
this.fetchDaysOfWeek().map((day, index) => (h("div", { key: index, class: this.getClasses(day), onClick: () => this.onDateClick(day) }, day ? format(day, 'd') : '')))), this.collapsed !== null ? (this.collapsed ? (h("div", { class: 'collapsed-container' }, h("cura-button-transparent", { onClick: () => this.showNotColapsedCalendar(), size: 'small', color: 'primary', fontColor: 'dark', iconName: 'plusCircle' }, "Veja mais datas"))) : (h("div", { class: 'collapsed-container' }, h("cura-button-transparent", { onClick: () => this.showColapsedCalendar(), size: 'small', color: 'primary', fontColor: 'dark', iconName: 'minusCircle' }, "Veja menos datas")))) : null)));
|
|
3909
4000
|
}
|
|
3910
4001
|
static get style() { return CuraCalendarStyle0; }
|
|
3911
4002
|
}, [1, "cura-calendar", {
|
|
3912
4003
|
"period": [513],
|
|
3913
4004
|
"width": [513],
|
|
3914
4005
|
"mode": [513],
|
|
3915
|
-
"dateFormat": [
|
|
4006
|
+
"dateFormat": [1537, "date-format"],
|
|
3916
4007
|
"locale": [513],
|
|
3917
4008
|
"type": [513],
|
|
3918
4009
|
"disable": [16],
|
|
3919
4010
|
"enable": [16],
|
|
3920
4011
|
"defaultDate": [16],
|
|
3921
4012
|
"limitRange": [514, "limit-range"],
|
|
4013
|
+
"disablePassDates": [1540, "disable-pass-dates"],
|
|
4014
|
+
"collapsed": [1540],
|
|
3922
4015
|
"currentDate": [32],
|
|
3923
4016
|
"selectedDates": [32],
|
|
3924
4017
|
"rangeStart": [32],
|
|
@@ -3931,19 +4024,29 @@ function defineCustomElement$1() {
|
|
|
3931
4024
|
if (typeof customElements === "undefined") {
|
|
3932
4025
|
return;
|
|
3933
4026
|
}
|
|
3934
|
-
const components = ["cura-calendar", "cura-icon", "cura-label", "cura-select", "cura-select-option"];
|
|
4027
|
+
const components = ["cura-calendar", "cura-button-transparent", "cura-icon", "cura-label", "cura-loader-circle", "cura-select", "cura-select-option"];
|
|
3935
4028
|
components.forEach(tagName => { switch (tagName) {
|
|
3936
4029
|
case "cura-calendar":
|
|
3937
4030
|
if (!customElements.get(tagName)) {
|
|
3938
4031
|
customElements.define(tagName, CuraCalendar$1);
|
|
3939
4032
|
}
|
|
3940
4033
|
break;
|
|
4034
|
+
case "cura-button-transparent":
|
|
4035
|
+
if (!customElements.get(tagName)) {
|
|
4036
|
+
defineCustomElement$7();
|
|
4037
|
+
}
|
|
4038
|
+
break;
|
|
3941
4039
|
case "cura-icon":
|
|
3942
4040
|
if (!customElements.get(tagName)) {
|
|
3943
|
-
defineCustomElement$
|
|
4041
|
+
defineCustomElement$6();
|
|
3944
4042
|
}
|
|
3945
4043
|
break;
|
|
3946
4044
|
case "cura-label":
|
|
4045
|
+
if (!customElements.get(tagName)) {
|
|
4046
|
+
defineCustomElement$5();
|
|
4047
|
+
}
|
|
4048
|
+
break;
|
|
4049
|
+
case "cura-loader-circle":
|
|
3947
4050
|
if (!customElements.get(tagName)) {
|
|
3948
4051
|
defineCustomElement$4();
|
|
3949
4052
|
}
|