@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
|
@@ -287,6 +287,31 @@ function startOfDay(dirtyDate) {
|
|
|
287
287
|
return date;
|
|
288
288
|
}
|
|
289
289
|
|
|
290
|
+
/**
|
|
291
|
+
* @name addWeeks
|
|
292
|
+
* @category Week Helpers
|
|
293
|
+
* @summary Add the specified number of weeks to the given date.
|
|
294
|
+
*
|
|
295
|
+
* @description
|
|
296
|
+
* Add the specified number of week to the given date.
|
|
297
|
+
*
|
|
298
|
+
* @param {Date|Number} date - the date to be changed
|
|
299
|
+
* @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`.
|
|
300
|
+
* @returns {Date} the new date with the weeks added
|
|
301
|
+
* @throws {TypeError} 2 arguments required
|
|
302
|
+
*
|
|
303
|
+
* @example
|
|
304
|
+
* // Add 4 weeks to 1 September 2014:
|
|
305
|
+
* const result = addWeeks(new Date(2014, 8, 1), 4)
|
|
306
|
+
* //=> Mon Sep 29 2014 00:00:00
|
|
307
|
+
*/
|
|
308
|
+
function addWeeks(dirtyDate, dirtyAmount) {
|
|
309
|
+
requiredArgs(2, arguments);
|
|
310
|
+
var amount = toInteger(dirtyAmount);
|
|
311
|
+
var days = amount * 7;
|
|
312
|
+
return addDays(dirtyDate, days);
|
|
313
|
+
}
|
|
314
|
+
|
|
290
315
|
/**
|
|
291
316
|
* Days in 1 week.
|
|
292
317
|
*
|
|
@@ -3075,6 +3100,30 @@ function subMonths(dirtyDate, dirtyAmount) {
|
|
|
3075
3100
|
return addMonths(dirtyDate, -amount);
|
|
3076
3101
|
}
|
|
3077
3102
|
|
|
3103
|
+
/**
|
|
3104
|
+
* @name subWeeks
|
|
3105
|
+
* @category Week Helpers
|
|
3106
|
+
* @summary Subtract the specified number of weeks from the given date.
|
|
3107
|
+
*
|
|
3108
|
+
* @description
|
|
3109
|
+
* Subtract the specified number of weeks from the given date.
|
|
3110
|
+
*
|
|
3111
|
+
* @param {Date|Number} date - the date to be changed
|
|
3112
|
+
* @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`.
|
|
3113
|
+
* @returns {Date} the new date with the weeks subtracted
|
|
3114
|
+
* @throws {TypeError} 2 arguments required
|
|
3115
|
+
*
|
|
3116
|
+
* @example
|
|
3117
|
+
* // Subtract 4 weeks from 1 September 2014:
|
|
3118
|
+
* const result = subWeeks(new Date(2014, 8, 1), 4)
|
|
3119
|
+
* //=> Mon Aug 04 2014 00:00:00
|
|
3120
|
+
*/
|
|
3121
|
+
function subWeeks(dirtyDate, dirtyAmount) {
|
|
3122
|
+
requiredArgs(2, arguments);
|
|
3123
|
+
var amount = toInteger(dirtyAmount);
|
|
3124
|
+
return addWeeks(dirtyDate, -amount);
|
|
3125
|
+
}
|
|
3126
|
+
|
|
3078
3127
|
var dateFormats$1 = {
|
|
3079
3128
|
full: 'EEEE, d MMMM yyyy',
|
|
3080
3129
|
long: 'd MMMM yyyy',
|
|
@@ -3514,7 +3563,7 @@ var locale = {
|
|
|
3514
3563
|
};
|
|
3515
3564
|
const ptBR = locale;
|
|
3516
3565
|
|
|
3517
|
-
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:
|
|
3566
|
+
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}";
|
|
3518
3567
|
const CuraCalendarStyle0 = curaCalendarCss;
|
|
3519
3568
|
|
|
3520
3569
|
const CuraCalendar = class {
|
|
@@ -3524,8 +3573,8 @@ const CuraCalendar = class {
|
|
|
3524
3573
|
this.theme = window.CuraAPI.theme;
|
|
3525
3574
|
this.weights = this.theme.fonts.getWeights();
|
|
3526
3575
|
this.optionsLocale = { 'pt-BR': ptBR, 'en-US': enAU };
|
|
3527
|
-
this.period =
|
|
3528
|
-
this.width = '
|
|
3576
|
+
this.period = null;
|
|
3577
|
+
this.width = '280px';
|
|
3529
3578
|
this.mode = 'single';
|
|
3530
3579
|
this.dateFormat = 'yyyy-MM-dd';
|
|
3531
3580
|
this.locale = 'pt-BR';
|
|
@@ -3534,6 +3583,8 @@ const CuraCalendar = class {
|
|
|
3534
3583
|
this.enable = [];
|
|
3535
3584
|
this.defaultDate = [];
|
|
3536
3585
|
this.limitRange = null;
|
|
3586
|
+
this.disablePassDates = false;
|
|
3587
|
+
this.collapsed = null;
|
|
3537
3588
|
this.currentDate = new Date();
|
|
3538
3589
|
this.selectedDates = [];
|
|
3539
3590
|
this.rangeStart = null;
|
|
@@ -3584,6 +3635,9 @@ const CuraCalendar = class {
|
|
|
3584
3635
|
* @returns {boolean} Whether the date is valid.
|
|
3585
3636
|
*/
|
|
3586
3637
|
isDateInValidPeriod(date) {
|
|
3638
|
+
if (this.period === null) {
|
|
3639
|
+
return true;
|
|
3640
|
+
}
|
|
3587
3641
|
return this.period.includes(format(date, this.dateFormat));
|
|
3588
3642
|
}
|
|
3589
3643
|
/**
|
|
@@ -3611,6 +3665,12 @@ const CuraCalendar = class {
|
|
|
3611
3665
|
* @returns {boolean} Whether the date is disabled.
|
|
3612
3666
|
*/
|
|
3613
3667
|
isDateInDisabledPeriod(date) {
|
|
3668
|
+
const today = new Date();
|
|
3669
|
+
today.setHours(0, 0, 0, 0);
|
|
3670
|
+
if (this.disablePassDates)
|
|
3671
|
+
return isBefore(date, today);
|
|
3672
|
+
if (this.disable === null)
|
|
3673
|
+
return false;
|
|
3614
3674
|
return this.isDateInList(this.expandDateRanges(this.disable), date);
|
|
3615
3675
|
}
|
|
3616
3676
|
/**
|
|
@@ -3620,7 +3680,7 @@ const CuraCalendar = class {
|
|
|
3620
3680
|
* @returns {boolean} Whether the date is enabled.
|
|
3621
3681
|
*/
|
|
3622
3682
|
isDateInEnabledPeriod(date) {
|
|
3623
|
-
if (this.enable
|
|
3683
|
+
if (this.enable === null || [])
|
|
3624
3684
|
return true;
|
|
3625
3685
|
return this.isDateInList(this.expandDateRanges(this.enable), date);
|
|
3626
3686
|
}
|
|
@@ -3664,7 +3724,7 @@ const CuraCalendar = class {
|
|
|
3664
3724
|
*/
|
|
3665
3725
|
onMonthDropdownChange(event) {
|
|
3666
3726
|
const { months } = this.fetchMonthNames();
|
|
3667
|
-
const newMonth = event.detail
|
|
3727
|
+
const newMonth = event.detail;
|
|
3668
3728
|
this.selectMonth = newMonth;
|
|
3669
3729
|
this.currentDate = new Date(getYear(this.currentDate), months.indexOf(newMonth), 1);
|
|
3670
3730
|
}
|
|
@@ -3674,7 +3734,7 @@ const CuraCalendar = class {
|
|
|
3674
3734
|
* @param {CustomEvent} event - The change event.
|
|
3675
3735
|
*/
|
|
3676
3736
|
onYearDropdownChange(event) {
|
|
3677
|
-
const newYear = event.detail
|
|
3737
|
+
const newYear = event.detail;
|
|
3678
3738
|
this.selectYear = newYear;
|
|
3679
3739
|
this.currentDate = new Date(newYear, getMonth(this.currentDate), 1);
|
|
3680
3740
|
}
|
|
@@ -3766,11 +3826,38 @@ const CuraCalendar = class {
|
|
|
3766
3826
|
*
|
|
3767
3827
|
* @returns {(Date | null)[]} An array of dates and nulls for the current month view.
|
|
3768
3828
|
*/
|
|
3829
|
+
showNotColapsedCalendar() {
|
|
3830
|
+
if (this.collapsed) {
|
|
3831
|
+
this.fetchDaysOfWeek();
|
|
3832
|
+
}
|
|
3833
|
+
else
|
|
3834
|
+
(this.fetchDaysOfMonth());
|
|
3835
|
+
this.collapsed = false;
|
|
3836
|
+
}
|
|
3837
|
+
showColapsedCalendar() {
|
|
3838
|
+
this.collapsed = true;
|
|
3839
|
+
return this.fetchDaysOfWeek();
|
|
3840
|
+
}
|
|
3841
|
+
fetchDaysOfWeek() {
|
|
3842
|
+
const DAYS_IN_CALENDAR_VIEW = 7;
|
|
3843
|
+
const start = startOfWeek(this.currentDate);
|
|
3844
|
+
const end = endOfWeek(this.currentDate);
|
|
3845
|
+
const daysIncurrentDate = eachDayOfInterval({ start, end });
|
|
3846
|
+
return daysIncurrentDate.slice(0, DAYS_IN_CALENDAR_VIEW);
|
|
3847
|
+
}
|
|
3848
|
+
updateCurrentWeek(direction) {
|
|
3849
|
+
let newWeek = new Date(this.currentDate);
|
|
3850
|
+
if (direction === 'prev')
|
|
3851
|
+
newWeek = subWeeks(this.currentDate, 1);
|
|
3852
|
+
if (direction === 'next')
|
|
3853
|
+
newWeek = addWeeks(this.currentDate, 1);
|
|
3854
|
+
this.currentDate = newWeek;
|
|
3855
|
+
}
|
|
3769
3856
|
fetchDaysOfMonth() {
|
|
3770
|
-
const start = startOfMonth(this.currentDate);
|
|
3771
|
-
const end = endOfMonth(this.currentDate);
|
|
3772
3857
|
const WEEKS_IN_CALENDAR_VIEW = 6;
|
|
3773
3858
|
const DAYS_IN_CALENDAR_VIEW = 42;
|
|
3859
|
+
const start = startOfMonth(this.currentDate);
|
|
3860
|
+
const end = endOfMonth(this.currentDate);
|
|
3774
3861
|
const daysIncurrentDate = eachDayOfInterval({ start, end });
|
|
3775
3862
|
const prevMonthStart = startOfMonth(addMonths(start, -1));
|
|
3776
3863
|
const prevMonthEnd = endOfMonth(prevMonthStart);
|
|
@@ -3825,7 +3912,7 @@ const CuraCalendar = class {
|
|
|
3825
3912
|
*/
|
|
3826
3913
|
determinePrevButtonColor() {
|
|
3827
3914
|
const isPrevDisabled = isBefore(new Date(getYear(this.currentDate), getMonth(this.currentDate) - 1, 1), startOfMonth(new Date()));
|
|
3828
|
-
return isPrevDisabled
|
|
3915
|
+
return isPrevDisabled && 'primary-base';
|
|
3829
3916
|
}
|
|
3830
3917
|
/**
|
|
3831
3918
|
* Get the status of a given date, determining its position and interval status.
|
|
@@ -3899,7 +3986,9 @@ const CuraCalendar = class {
|
|
|
3899
3986
|
}
|
|
3900
3987
|
render() {
|
|
3901
3988
|
const { months } = this.fetchMonthNames();
|
|
3902
|
-
return (h(Host, { key: '
|
|
3989
|
+
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 ?
|
|
3990
|
+
this.fetchDaysOfMonth().map((day, index) => (h("div", { key: index, class: this.getClasses(day), onClick: () => this.onDateClick(day) }, day ? format(day, 'd') : ''))) :
|
|
3991
|
+
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)));
|
|
3903
3992
|
}
|
|
3904
3993
|
};
|
|
3905
3994
|
CuraCalendar.style = CuraCalendarStyle0;
|