@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,5 +1,5 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
|
-
import { getMonth, getYear, startOfMonth, endOfMonth, eachDayOfInterval, format, getDay, isBefore, isAfter, isSameDay, isToday, parseISO, addDays, addMonths, subDays, startOfYear, eachMonthOfInterval, startOfWeek, endOfWeek, subMonths, isValid } from "date-fns";
|
|
2
|
+
import { getMonth, getYear, startOfMonth, endOfMonth, eachDayOfInterval, format, getDay, isBefore, isAfter, isSameDay, isToday, parseISO, addDays, addMonths, subDays, startOfYear, eachMonthOfInterval, startOfWeek, endOfWeek, subMonths, isValid, subWeeks, addWeeks } from "date-fns";
|
|
3
3
|
import enAU from "date-fns/locale/en-AU";
|
|
4
4
|
import ptBR from "date-fns/locale/pt-BR";
|
|
5
5
|
export class CuraCalendar {
|
|
@@ -7,8 +7,8 @@ export class CuraCalendar {
|
|
|
7
7
|
this.theme = window.CuraAPI.theme;
|
|
8
8
|
this.weights = this.theme.fonts.getWeights();
|
|
9
9
|
this.optionsLocale = { 'pt-BR': ptBR, 'en-US': enAU };
|
|
10
|
-
this.period =
|
|
11
|
-
this.width = '
|
|
10
|
+
this.period = null;
|
|
11
|
+
this.width = '280px';
|
|
12
12
|
this.mode = 'single';
|
|
13
13
|
this.dateFormat = 'yyyy-MM-dd';
|
|
14
14
|
this.locale = 'pt-BR';
|
|
@@ -17,6 +17,8 @@ export class CuraCalendar {
|
|
|
17
17
|
this.enable = [];
|
|
18
18
|
this.defaultDate = [];
|
|
19
19
|
this.limitRange = null;
|
|
20
|
+
this.disablePassDates = false;
|
|
21
|
+
this.collapsed = null;
|
|
20
22
|
this.currentDate = new Date();
|
|
21
23
|
this.selectedDates = [];
|
|
22
24
|
this.rangeStart = null;
|
|
@@ -67,6 +69,9 @@ export class CuraCalendar {
|
|
|
67
69
|
* @returns {boolean} Whether the date is valid.
|
|
68
70
|
*/
|
|
69
71
|
isDateInValidPeriod(date) {
|
|
72
|
+
if (this.period === null) {
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
70
75
|
return this.period.includes(format(date, this.dateFormat));
|
|
71
76
|
}
|
|
72
77
|
/**
|
|
@@ -94,6 +99,12 @@ export class CuraCalendar {
|
|
|
94
99
|
* @returns {boolean} Whether the date is disabled.
|
|
95
100
|
*/
|
|
96
101
|
isDateInDisabledPeriod(date) {
|
|
102
|
+
const today = new Date();
|
|
103
|
+
today.setHours(0, 0, 0, 0);
|
|
104
|
+
if (this.disablePassDates)
|
|
105
|
+
return isBefore(date, today);
|
|
106
|
+
if (this.disable === null)
|
|
107
|
+
return false;
|
|
97
108
|
return this.isDateInList(this.expandDateRanges(this.disable), date);
|
|
98
109
|
}
|
|
99
110
|
/**
|
|
@@ -103,7 +114,7 @@ export class CuraCalendar {
|
|
|
103
114
|
* @returns {boolean} Whether the date is enabled.
|
|
104
115
|
*/
|
|
105
116
|
isDateInEnabledPeriod(date) {
|
|
106
|
-
if (this.enable
|
|
117
|
+
if (this.enable === null || [])
|
|
107
118
|
return true;
|
|
108
119
|
return this.isDateInList(this.expandDateRanges(this.enable), date);
|
|
109
120
|
}
|
|
@@ -147,7 +158,7 @@ export class CuraCalendar {
|
|
|
147
158
|
*/
|
|
148
159
|
onMonthDropdownChange(event) {
|
|
149
160
|
const { months } = this.fetchMonthNames();
|
|
150
|
-
const newMonth = event.detail
|
|
161
|
+
const newMonth = event.detail;
|
|
151
162
|
this.selectMonth = newMonth;
|
|
152
163
|
this.currentDate = new Date(getYear(this.currentDate), months.indexOf(newMonth), 1);
|
|
153
164
|
}
|
|
@@ -157,7 +168,7 @@ export class CuraCalendar {
|
|
|
157
168
|
* @param {CustomEvent} event - The change event.
|
|
158
169
|
*/
|
|
159
170
|
onYearDropdownChange(event) {
|
|
160
|
-
const newYear = event.detail
|
|
171
|
+
const newYear = event.detail;
|
|
161
172
|
this.selectYear = newYear;
|
|
162
173
|
this.currentDate = new Date(newYear, getMonth(this.currentDate), 1);
|
|
163
174
|
}
|
|
@@ -249,11 +260,38 @@ export class CuraCalendar {
|
|
|
249
260
|
*
|
|
250
261
|
* @returns {(Date | null)[]} An array of dates and nulls for the current month view.
|
|
251
262
|
*/
|
|
263
|
+
showNotColapsedCalendar() {
|
|
264
|
+
if (this.collapsed) {
|
|
265
|
+
this.fetchDaysOfWeek();
|
|
266
|
+
}
|
|
267
|
+
else
|
|
268
|
+
(this.fetchDaysOfMonth());
|
|
269
|
+
this.collapsed = false;
|
|
270
|
+
}
|
|
271
|
+
showColapsedCalendar() {
|
|
272
|
+
this.collapsed = true;
|
|
273
|
+
return this.fetchDaysOfWeek();
|
|
274
|
+
}
|
|
275
|
+
fetchDaysOfWeek() {
|
|
276
|
+
const DAYS_IN_CALENDAR_VIEW = 7;
|
|
277
|
+
const start = startOfWeek(this.currentDate);
|
|
278
|
+
const end = endOfWeek(this.currentDate);
|
|
279
|
+
const daysIncurrentDate = eachDayOfInterval({ start, end });
|
|
280
|
+
return daysIncurrentDate.slice(0, DAYS_IN_CALENDAR_VIEW);
|
|
281
|
+
}
|
|
282
|
+
updateCurrentWeek(direction) {
|
|
283
|
+
let newWeek = new Date(this.currentDate);
|
|
284
|
+
if (direction === 'prev')
|
|
285
|
+
newWeek = subWeeks(this.currentDate, 1);
|
|
286
|
+
if (direction === 'next')
|
|
287
|
+
newWeek = addWeeks(this.currentDate, 1);
|
|
288
|
+
this.currentDate = newWeek;
|
|
289
|
+
}
|
|
252
290
|
fetchDaysOfMonth() {
|
|
253
|
-
const start = startOfMonth(this.currentDate);
|
|
254
|
-
const end = endOfMonth(this.currentDate);
|
|
255
291
|
const WEEKS_IN_CALENDAR_VIEW = 6;
|
|
256
292
|
const DAYS_IN_CALENDAR_VIEW = 42;
|
|
293
|
+
const start = startOfMonth(this.currentDate);
|
|
294
|
+
const end = endOfMonth(this.currentDate);
|
|
257
295
|
const daysIncurrentDate = eachDayOfInterval({ start, end });
|
|
258
296
|
const prevMonthStart = startOfMonth(addMonths(start, -1));
|
|
259
297
|
const prevMonthEnd = endOfMonth(prevMonthStart);
|
|
@@ -308,7 +346,7 @@ export class CuraCalendar {
|
|
|
308
346
|
*/
|
|
309
347
|
determinePrevButtonColor() {
|
|
310
348
|
const isPrevDisabled = isBefore(new Date(getYear(this.currentDate), getMonth(this.currentDate) - 1, 1), startOfMonth(new Date()));
|
|
311
|
-
return isPrevDisabled
|
|
349
|
+
return isPrevDisabled && 'primary-base';
|
|
312
350
|
}
|
|
313
351
|
/**
|
|
314
352
|
* Get the status of a given date, determining its position and interval status.
|
|
@@ -382,7 +420,9 @@ export class CuraCalendar {
|
|
|
382
420
|
}
|
|
383
421
|
render() {
|
|
384
422
|
const { months } = this.fetchMonthNames();
|
|
385
|
-
return (h(Host, { key: '
|
|
423
|
+
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 ?
|
|
424
|
+
this.fetchDaysOfMonth().map((day, index) => (h("div", { key: index, class: this.getClasses(day), onClick: () => this.onDateClick(day) }, day ? format(day, 'd') : ''))) :
|
|
425
|
+
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)));
|
|
386
426
|
}
|
|
387
427
|
static get is() { return "cura-calendar"; }
|
|
388
428
|
static get encapsulation() { return "shadow"; }
|
|
@@ -402,7 +442,7 @@ export class CuraCalendar {
|
|
|
402
442
|
"type": "string",
|
|
403
443
|
"mutable": false,
|
|
404
444
|
"complexType": {
|
|
405
|
-
"original": "string[] | string",
|
|
445
|
+
"original": "null | string[] | string",
|
|
406
446
|
"resolved": "string | string[]",
|
|
407
447
|
"references": {}
|
|
408
448
|
},
|
|
@@ -423,7 +463,7 @@ export class CuraCalendar {
|
|
|
423
463
|
},
|
|
424
464
|
"attribute": "period",
|
|
425
465
|
"reflect": true,
|
|
426
|
-
"defaultValue": "
|
|
466
|
+
"defaultValue": "null"
|
|
427
467
|
},
|
|
428
468
|
"width": {
|
|
429
469
|
"type": "string",
|
|
@@ -441,13 +481,13 @@ export class CuraCalendar {
|
|
|
441
481
|
"text": "{string}"
|
|
442
482
|
}, {
|
|
443
483
|
"name": "default",
|
|
444
|
-
"text": "'
|
|
484
|
+
"text": "'280px'"
|
|
445
485
|
}],
|
|
446
486
|
"text": "Width of the component."
|
|
447
487
|
},
|
|
448
488
|
"attribute": "width",
|
|
449
489
|
"reflect": true,
|
|
450
|
-
"defaultValue": "'
|
|
490
|
+
"defaultValue": "'280px'"
|
|
451
491
|
},
|
|
452
492
|
"mode": {
|
|
453
493
|
"type": "string",
|
|
@@ -475,7 +515,7 @@ export class CuraCalendar {
|
|
|
475
515
|
},
|
|
476
516
|
"dateFormat": {
|
|
477
517
|
"type": "string",
|
|
478
|
-
"mutable":
|
|
518
|
+
"mutable": true,
|
|
479
519
|
"complexType": {
|
|
480
520
|
"original": "string",
|
|
481
521
|
"resolved": "string",
|
|
@@ -549,7 +589,7 @@ export class CuraCalendar {
|
|
|
549
589
|
"type": "unknown",
|
|
550
590
|
"mutable": false,
|
|
551
591
|
"complexType": {
|
|
552
|
-
"original": "string[]",
|
|
592
|
+
"original": "string[] | null",
|
|
553
593
|
"resolved": "string[]",
|
|
554
594
|
"references": {}
|
|
555
595
|
},
|
|
@@ -571,7 +611,7 @@ export class CuraCalendar {
|
|
|
571
611
|
"type": "unknown",
|
|
572
612
|
"mutable": false,
|
|
573
613
|
"complexType": {
|
|
574
|
-
"original": "string[]",
|
|
614
|
+
"original": "string[] | null",
|
|
575
615
|
"resolved": "string[]",
|
|
576
616
|
"references": {}
|
|
577
617
|
},
|
|
@@ -634,6 +674,42 @@ export class CuraCalendar {
|
|
|
634
674
|
"attribute": "limit-range",
|
|
635
675
|
"reflect": true,
|
|
636
676
|
"defaultValue": "null"
|
|
677
|
+
},
|
|
678
|
+
"disablePassDates": {
|
|
679
|
+
"type": "boolean",
|
|
680
|
+
"mutable": true,
|
|
681
|
+
"complexType": {
|
|
682
|
+
"original": "boolean",
|
|
683
|
+
"resolved": "boolean",
|
|
684
|
+
"references": {}
|
|
685
|
+
},
|
|
686
|
+
"required": false,
|
|
687
|
+
"optional": false,
|
|
688
|
+
"docs": {
|
|
689
|
+
"tags": [],
|
|
690
|
+
"text": ""
|
|
691
|
+
},
|
|
692
|
+
"attribute": "disable-pass-dates",
|
|
693
|
+
"reflect": true,
|
|
694
|
+
"defaultValue": "false"
|
|
695
|
+
},
|
|
696
|
+
"collapsed": {
|
|
697
|
+
"type": "boolean",
|
|
698
|
+
"mutable": true,
|
|
699
|
+
"complexType": {
|
|
700
|
+
"original": "boolean | null",
|
|
701
|
+
"resolved": "boolean",
|
|
702
|
+
"references": {}
|
|
703
|
+
},
|
|
704
|
+
"required": false,
|
|
705
|
+
"optional": false,
|
|
706
|
+
"docs": {
|
|
707
|
+
"tags": [],
|
|
708
|
+
"text": ""
|
|
709
|
+
},
|
|
710
|
+
"attribute": "collapsed",
|
|
711
|
+
"reflect": true,
|
|
712
|
+
"defaultValue": "null"
|
|
637
713
|
}
|
|
638
714
|
};
|
|
639
715
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cura-calendar.js","sourceRoot":"","sources":["../../../src/components/cura-calendar/cura-calendar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAgB,IAAI,EAAE,MAAM,eAAe,CAAC;AACrF,OAAO,EACL,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,EAC9E,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,EACzF,mBAAmB,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EACtD,OAAO,EACR,MAAM,UAAU,CAAC;AAClB,OAAO,IAAI,MAAM,uBAAuB,CAAC;AACzC,OAAO,IAAI,MAAM,uBAAuB,CAAC;AAQzC,MAAM,OAAO,YAAY;;QA6IvB,UAAK,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;QAC7B,YAAO,GAA8B,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;QACnE,kBAAa,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;sBArII,EAAE;qBAOd,OAAO;oBAOiB,QAAQ;0BAO3B,YAAY;sBAOL,OAAO;oBAQL,UAAU;uBAQpB,EAAE;sBAOH,EAAE;2BAOG,EAAE;0BAOE,IAAI;2BAQ5B,IAAI,IAAI,EAAE;6BAQN,EAAE;0BAQA,IAAI;4BAQP,EAAE;2BAQH,EAAE;0BAQH,EAAE;sBAQd,EAAE;;IAcpB,iBAAiB;QACf,IAAI,CAAC,sBAAsB,EAAE,CAAC;QAC9B,IAAI,CAAC,i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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, State, Prop, Event, EventEmitter, Host } from '@stencil/core';\nimport {\n getMonth, getYear, startOfMonth, endOfMonth, eachDayOfInterval, format, getDay,\n isBefore, isAfter, isSameDay, isToday, parseISO, addDays, addMonths, subDays, startOfYear,\n eachMonthOfInterval, startOfWeek, endOfWeek, subMonths,\n isValid\n} from 'date-fns';\nimport enAU from 'date-fns/locale/en-AU';\nimport ptBR from 'date-fns/locale/pt-BR';\n\n@Component({\n tag: 'cura-calendar',\n styleUrl: 'cura-calendar.scss',\n shadow: true,\n})\n\nexport class CuraCalendar {\n /**\n * An array of specific dates to be highlighted or processed.\n *\n * @type {string[] | string}\n * @default []\n * @example\n * // Example usage\n * period = [\"2024-08-01\", \"2024-08-30\"];\n */\n @Prop({ reflect: true }) period: string[] | string = []\n /**\n * Width of the component.\n *\n * @type {string}\n * @default '300px'\n */\n @Prop({ reflect: true }) width: string = '300px';\n /**\n * Selection mode of the date picker.\n *\n * @type {'single' | 'multiple' | 'range'}\n * @default 'single'\n */\n @Prop({ reflect: true }) mode: 'single' | 'multiple' | 'range' = 'single';\n /**\n * Date format used for display and parsing.\n *\n * @type {string}\n * @default 'yyyy-MM-dd'\n */\n @Prop({ reflect: true }) dateFormat: string = 'yyyy-MM-dd';\n /**\n * Locale for date formatting.\n *\n * @type {'pt-BR' | 'en-US'}\n * @default 'pt-BR'\n */\n @Prop({ reflect: true }) locale: 'pt-BR' | 'en-US' = 'pt-BR';\n\n /**\n * Display type of the date picker.\n *\n * @type {'dropdown' | 'static'}\n * @default 'dropdown'\n */\n @Prop({ reflect: true }) type: 'dropdown' | 'static' = 'dropdown';\n\n /**\n * List of dates to disable.\n *\n * @type {string[]}\n * @default []\n */\n @Prop({ reflect: true }) disable: string[] = [];\n /**\n * List of dates to enable.\n *\n * @type {string[]}\n * @default []\n */\n @Prop({ reflect: true }) enable: string[] = [];\n /**\n * Default dates selected on initialization.\n *\n * @type {string[]}\n * @default []\n */\n @Prop({ reflect: true }) defaultDate: string[] = [];\n /**\n * Limits the selectable date range.\n *\n * @type {Date | null}\n * @default null\n */\n @Prop({ reflect: true }) limitRange: number | null = null;\n\n /**\n * The current month being viewed in the date picker.\n *\n * @type {Date}\n * @default new Date()\n */\n @State() currentDate: Date = new Date();\n\n /**\n * Array of currently selected dates.\n *\n * @type {Date[]}\n * @default []\n */\n @State() selectedDates: Date[] = [];\n\n /**\n * The start date of the range selection, if applicable.\n *\n * @type {Date | null}\n * @default null\n */\n @State() rangeStart: Date | null = null;\n\n /**\n * Array of default dates that are initially selected.\n *\n * @type {Date[]}\n * @default []\n */\n @State() defaultDates: Date[] = [];\n\n /**\n * Selected months on dropdown.\n *\n * @type {string}\n * @default ''\n */\n @State() selectMonth: string = '';\n\n /**\n * Selected year on dropdown.\n *\n * @type {string}\n * @default ''\n */\n @State() selectYear: string = ''\n\n /**\n * CSS styles applied to the component.\n *\n * @type {Object}\n * @default {}\n */\n @State() styles = {};\n\n /**\n * Event emitted when a day is changed.\n *\n * @event\n * @type {EventEmitter<{ days: Date[] }>}\n */\n @Event() onchangeday: EventEmitter<{ days: Date[] }>;\n\n theme = window.CuraAPI.theme;\n weights: { [key: string]: string } = this.theme.fonts.getWeights();\n optionsLocale = { 'pt-BR': ptBR, 'en-US': enAU };\n\n connectedCallback() {\n this.initializeDefaultDates();\n this.setFontProperties()\n\n const colors = [\n { name: '--accent-base', theme: 'accent-base' },\n { name: '--accent-light', theme: 'accent-light' },\n { name: '--neutral-black', theme: 'neutral-black' },\n { name: '--primary-darker', theme: 'primary-darker' },\n { name: '--neutral-dark', theme: 'neutral-dark' },\n { name: '--neutral-light', theme: 'neutral-light' },\n ];\n\n colors.forEach(color => this.styles = { ...this.styles, [color.name]: this.theme.colors.getColor(color.theme) });\n }\n\n setFontProperties() {\n this.styles['--font-family'] = window.CuraAPI.theme.fonts.getFamily();\n this.styles['--font-size'] = window.CuraAPI.theme.fonts.getSize();\n this.styles['--font-color'] = window.CuraAPI.theme.fonts.getColor();\n this.styles['--font-weight-medium'] = this.weights.medium;\n this.styles['--font-weight-bold'] = this.weights.bold;\n this.styles['--font-weight-regular'] = this.weights.regular;\n }\n\n /**\n * Initialize the selected dates based on defaultDate and mode.\n */\n initializeDefaultDates() {\n this.defaultDates = this.expandDateRanges(this.defaultDate);\n }\n\n /**\n * Get the locale for the calendar.\n *\n * @returns {Locale} The locale object.\n */\n determineLocale() {\n return this.optionsLocale[this.locale as string] || this.locale;\n }\n\n /**\n * Check if a date is within the valid period.\n *\n * @param {Date} date - The date to check.\n * @returns {boolean} Whether the date is valid.\n */\n isDateInValidPeriod(date: Date): boolean {\n return this.period.includes(format(date, this.dateFormat));\n }\n\n /**\n * Check if a date is selected.\n *\n * @param {Date} date - The date to check.\n * @returns {boolean} Whether the date is selected.\n */\n isDateSelected(date: Date): boolean {\n return this.isDateInList(this.selectedDates, date);\n }\n\n /**\n * Check if has date in defaultDates.\n *\n * @param {Date} date - The date to check.\n * @returns {boolean} Whether the date is selected.\n */\n isDateInDefaultSelection(date: Date): boolean {\n return this.isDateInList(this.defaultDates, date);\n }\n\n /**\n * Check if a date is within a disabled period.\n *\n * @param {Date} date - The date to check.\n * @returns {boolean} Whether the date is disabled.\n */\n isDateInDisabledPeriod(date: Date): boolean {\n return this.isDateInList(this.expandDateRanges(this.disable), date)\n }\n\n /**\n * Check if a date is within an enabled period.\n *\n * @param {Date} date - The date to check.\n * @returns {boolean} Whether the date is enabled.\n */\n isDateInEnabledPeriod(date: Date): boolean {\n if (this.enable.length === 0) return true;\n return this.isDateInList(this.expandDateRanges(this.enable), date)\n }\n\n /**\n * Checks if a date is in the provided list of dates.\n *\n * @param {Date[]} dates - The list of dates to check against.\n * @param {Date} date - The date to check.\n * @returns {boolean} Whether the date is in the list.\n */\n isDateInList(dates: Date[], date: Date): boolean {\n return dates.some(d => isSameDay(d, date));\n }\n\n /**\n * Removes a specific date from a list of dates.\n *\n * @param {Date[]} dates - The array of dates to filter.\n * @param {Date} dateToRemove - The date to remove from the array.\n * @returns {Date[]} A new array with the specified date removed.\n */\n removeDateFromSelection(dates: Date[], dateToRemove: Date): Date[] {\n return dates.filter(d => !isSameDay(d, dateToRemove));\n }\n\n /**\n * Change the current month.\n *\n * @param {string} direction - 'prev' | 'next'\n */\n updateCurrentMonth(direction: 'prev' | 'next') {\n let newMonth = new Date(this.currentDate);\n\n if (direction === 'prev') newMonth = subMonths(this.currentDate, 1)\n if (direction === 'next') newMonth = addMonths(this.currentDate, 1)\n\n this.currentDate = newMonth;\n }\n\n /**\n * Handle the month dropdown change.\n *\n * @param {CustomEvent} event - The change event.\n */\n onMonthDropdownChange(event: CustomEvent) {\n const { months } = this.fetchMonthNames();\n const newMonth = event.detail.value;\n\n this.selectMonth = newMonth\n this.currentDate = new Date(getYear(this.currentDate), months.indexOf(newMonth), 1);\n }\n\n /**\n * Handle the year input change.\n *\n * @param {CustomEvent} event - The change event.\n */\n onYearDropdownChange(event: CustomEvent) {\n const newYear = event.detail.value;\n\n this.selectYear = newYear\n this.currentDate = new Date(newYear, getMonth(this.currentDate), 1);\n }\n\n /**\n * Flatten date ranges into individual dates.\n *\n * @param {({ from: string; to: string } | string)[]} dates - An array of date ranges or individual dates.\n * @returns {Date[]} An array of individual dates.\n */\n expandDateRanges(dates: ({ from: string; to: string } | string)[]): Date[] {\n return dates.flatMap(date => {\n if (typeof date === 'string') return isValid(parseISO(date)) ? [parseISO(date)] : [];\n\n const start = parseISO(date.from);\n const end = parseISO(date.to);\n\n if (isValid(start) && isValid(end) && start <= end) return eachDayOfInterval({ start, end });\n return [];\n });\n }\n\n /**\n * Handle single date selection.\n *\n * @param {Date} date - The date to select.\n */\n selectSingleDate(date: Date) {\n this.defaultDates = [];\n this.selectedDates = [date];\n }\n\n /**\n * Handle multiple date selection.\n *\n * @param {Date} date - The date to select or deselect.\n */\n selectMultiplesDate(date: Date) {\n if (!this.isDateSelected(date) || !this.isDateInDefaultSelection(date)) return this.selectedDates = [...this.selectedDates, date];\n\n this.selectedDates = this.removeDateFromSelection(this.selectedDates, date)\n this.defaultDates = this.removeDateFromSelection(this.defaultDates, date)\n }\n\n /**\n * Handle range date selection.\n *\n * @param {Date} date - The date to select.\n */\n selectDateRange(date: Date) {\n this.defaultDates = [];\n\n const start = isBefore(this.rangeStart, date) ? this.rangeStart : date;\n const end = isAfter(this.rangeStart, date) ? this.rangeStart : date;\n const range = eachDayOfInterval({ start, end });\n\n if (!this.rangeStart || this.selectedDates.length === 2) {\n this.rangeStart = date;\n this.selectedDates = [date];\n return;\n }\n\n if (this.limitRange === null || range.length <= this.limitRange) {\n this.selectedDates = range;\n this.rangeStart = null;\n }\n }\n\n /**\n * Handle a click on a date.\n *\n * @param {Date} date - The date that was clicked.\n */\n onDateClick(date: Date) {\n if (!this.isDateInValidPeriod(date) || this.isDateInDisabledPeriod(date) || !this.isDateInEnabledPeriod(date)) return;\n\n const selectionHandlers = {\n single: this.selectSingleDate.bind(this),\n multiple: this.selectMultiplesDate.bind(this),\n range: this.selectDateRange.bind(this)\n };\n\n selectionHandlers[this.mode](date);\n this.onchangeday.emit({ days: [...this.defaultDates, ...this.selectedDates].filter(d => this.isDateInValidPeriod(d)) });\n }\n\n /**\n * Get the days of the week.\n *\n * @returns {string[]} An array of abbreviated day names.\n */\n fetchWeekDays(): string[] {\n const start = startOfWeek(new Date(2021, 0, 3), { locale: this.determineLocale() });\n const end = endOfWeek(new Date(2021, 0, 3), { locale: this.determineLocale() });\n\n return eachDayOfInterval({ start, end }).map(day => format(day, 'EEEEEE', { locale: this.determineLocale() }));\n }\n\n /**\n * Get the days of the current month, including leading nulls for alignment.\n *\n * @returns {(Date | null)[]} An array of dates and nulls for the current month view.\n */\n fetchDaysOfMonth(): Date[] {\n const start = startOfMonth(this.currentDate);\n const end = endOfMonth(this.currentDate);\n const WEEKS_IN_CALENDAR_VIEW = 6;\n const DAYS_IN_CALENDAR_VIEW = 42;\n\n const daysIncurrentDate = eachDayOfInterval({ start, end });\n\n const prevMonthStart = startOfMonth(addMonths(start, -1));\n const prevMonthEnd = endOfMonth(prevMonthStart);\n const daysInPrevMonth = eachDayOfInterval({\n start: subDays(prevMonthEnd, getDay(start)),\n end: prevMonthEnd\n });\n\n const nextMonthStart = startOfMonth(addMonths(end, 1));\n const nextMonthEnd = endOfMonth(nextMonthStart);\n const remainingDays = WEEKS_IN_CALENDAR_VIEW - getDay(end);\n const daysInNextMonth = eachDayOfInterval({\n start: nextMonthStart,\n end: addDays(nextMonthEnd, remainingDays)\n });\n\n const totalDays = [\n ...daysInPrevMonth.slice(-getDay(start)),\n ...daysIncurrentDate,\n ...daysInNextMonth\n ];\n\n return totalDays.slice(0, DAYS_IN_CALENDAR_VIEW);\n }\n\n /**\n * Get the names of all months in the current year.\n *\n * @returns {{ months: string[], currentMonth: string }} An object containing an array of month names and the name of the current month.\n */\n fetchMonthNames(): { months: string[] } {\n const currentYear = getYear(this.currentDate);\n const locale = this.determineLocale();\n\n const months = eachMonthOfInterval({\n start: startOfYear(new Date(currentYear, 0, 1)),\n end: new Date(currentYear, 11, 31)\n }).map(month => format(month, 'MMMM', { locale }));\n\n const capitalize = (str: string) => str.charAt(0).toUpperCase() + str.slice(1).toLowerCase();\n\n return {\n months: months.map(capitalize),\n };\n }\n\n /**\n * Get a list of years in descending order from the current year to a specified limit.\n *\n * @returns {number[]} An array of years.\n */\n fetchYearList(): number[] {\n const currentYear = getYear(new Date());\n return Array.from({ length: 100 }, (_, i) => currentYear - i);\n }\n\n /**\n * Get the color for the previous button.\n *\n * @returns {string} The color name for the previous button.\n */\n determinePrevButtonColor(): string {\n const isPrevDisabled = isBefore(new Date(getYear(this.currentDate), getMonth(this.currentDate) - 1, 1), startOfMonth(new Date()));\n return isPrevDisabled ? 'neutral-light' : 'primary-base';\n }\n\n /**\n * Get the status of a given date, determining its position and interval status.\n *\n * @param {Date | null} date - The date to evaluate.\n * @returns {Object} An object containing the status flags for the date.\n */\n getDateStatus(date: Date) {\n const [startSelected, endSelected] = [this.selectedDates[0], this.selectedDates[this.selectedDates.length - 1]];\n const [startDefault, endDefault] = [this.defaultDates[0], this.defaultDates[this.defaultDates.length - 1]];\n\n const hasSelectedDates = this.selectedDates.length > 1;\n const isDateInDefaultSelection = this.defaultDates.length > 1;\n\n const isStartSelected = this.isDateSelected(date) && isSameDay(date, startSelected);\n const isStartDefault = this.isDateInDefaultSelection(date) && isSameDay(date, startDefault);\n const isEndSelected = this.isDateSelected(date) && isSameDay(date, endSelected);\n const isEndDefault = this.isDateInDefaultSelection(date) && isSameDay(date, endDefault);\n\n const isStart = isStartSelected || isStartDefault;\n const isEnd = isEndSelected || isEndDefault;\n\n\n const selectedIntervals = this.expandDateRanges([{ from: startSelected?.toISOString(), to: endSelected?.toISOString() }]);\n const defaultIntervals = this.expandDateRanges([{ from: startDefault?.toISOString(), to: endDefault?.toISOString() }]);\n\n const intervalSelected = hasSelectedDates && this.isDateInList(selectedIntervals, date);\n const intervalDefault = isDateInDefaultSelection && this.isDateInList(defaultIntervals, date);\n\n const isValid = this.isDateInValidPeriod(date);\n const isInvalid = !isValid || this.isDateInDisabledPeriod(date) || !this.isDateInEnabledPeriod(date);\n const isSelected = this.isDateSelected(date);\n const isRange = this.mode === 'range' && (hasSelectedDates || isDateInDefaultSelection);\n const isDefault = this.mode !== 'range' && this.isDateInDefaultSelection(date);\n const isInterval = (intervalSelected || intervalDefault) && !isStart && !isEnd;\n\n return {\n isStart,\n isEnd,\n isValid,\n isInvalid,\n isSelected,\n isRange,\n isDefault,\n isInterval\n };\n }\n\n /**\n * Get the CSS classes for a given date based on its status.\n *\n * @param {Date | null} date - The date to evaluate.\n * @returns {Object} An object containing the CSS classes for the date.\n */\n getClasses(date: Date) {\n const classes = { 'date': true };\n if (date === null) return classes;\n\n const dateStatus = this.getDateStatus(date);\n\n classes['today'] = isToday(date);\n classes['valid'] = dateStatus.isValid;\n classes['invalid'] = dateStatus.isInvalid;\n classes['selected'] = dateStatus.isSelected;\n classes['range'] = dateStatus.isRange;\n classes['default-dates'] = dateStatus.isDefault;\n classes['start'] = dateStatus.isStart;\n classes['interval'] = dateStatus.isInterval;\n classes['end'] = dateStatus.isEnd;\n\n return classes;\n }\n\n /**\n * Get custom CSS properties for the host element.\n *\n * @returns {Object} An object containing CSS properties and their values.\n */\n getHostCSSProperties() {\n return {\n '--width': this.width,\n };\n }\n\n\n render() {\n const { months } = this.fetchMonthNames();\n\n return (\n <Host style={this.getHostCSSProperties()}>\n <div class=\"calendar\" style={this.styles}>\n <header class=\"header\">\n <div class={`month-year ${this.type === 'dropdown' && 'dropdown'}`}>\n <cura-icon\n class={`icon ${this.type === 'dropdown' && 'dropdown'}`}\n name=\"left\"\n color={this.determinePrevButtonColor()}\n onClick={() => this.updateCurrentMonth('prev')}>\n </cura-icon>\n {this.type === 'dropdown' ? (\n <div class=\"select\">\n <cura-select\n class=\"drop-month\"\n mode=\"transparent\"\n value={months[getMonth(this.currentDate)]}\n onSelected={(e) => this.onMonthDropdownChange(e)}\n >\n {months.map((month, index) => (\n <cura-select-option\n key={index}\n value={month}>\n {month}\n </cura-select-option>\n ))}\n </cura-select>\n <cura-select\n class=\"drop-year\"\n mode=\"transparent\"\n value={getYear(this.currentDate).toString()}\n onSelected={(e) => this.onYearDropdownChange(e)}\n >\n {this.fetchYearList().map((year, index) => (\n <cura-select-option\n key={index}\n value={year.toString()}>\n {year.toString()}\n </cura-select-option>\n ))}\n </cura-select>\n </div>\n ) : (\n <cura-label\n color=\"neutral-black\"\n size=\"large\">\n {months[getMonth(this.currentDate)].slice(0, 3)}, {getYear(this.currentDate)}\n </cura-label>\n )}\n <cura-icon\n class={`icon ${this.type === 'dropdown' && 'dropdown'}`}\n name=\"right\"\n color=\"primary-base\"\n onClick={() => this.updateCurrentMonth('next')}>\n </cura-icon>\n </div>\n </header>\n\n <span class=\"days-of-week\">\n {this.fetchWeekDays().map((day, index) => (\n <cura-label\n class=\"day\"\n size=\"xsmall\"\n color=\"neutral-black\"\n weight='bold'\n key={index}>\n {day === 'sab' ? 'SÁB' : day.toLocaleUpperCase()}\n </cura-label>\n ))}\n </span>\n\n <div class=\"dates\">\n {this.fetchDaysOfMonth().map((day, index) => (\n <div\n key={index}\n class={this.getClasses(day)}\n onClick={() => this.onDateClick(day)}>\n {day ? format(day, 'd') : ''}\n </div>\n ))}\n </div>\n </div >\n </Host >\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"cura-calendar.js","sourceRoot":"","sources":["../../../src/components/cura-calendar/cura-calendar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAgB,IAAI,EAAE,MAAM,eAAe,CAAC;AACrF,OAAO,EACL,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,EAC9E,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,EACzF,mBAAmB,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EACtD,OAAO,EACP,QAAQ,EACR,QAAQ,EACT,MAAM,UAAU,CAAC;AAClB,OAAO,IAAI,MAAM,uBAAuB,CAAC;AACzC,OAAO,IAAI,MAAM,uBAAuB,CAAC;AAQzC,MAAM,OAAO,YAAY;;QAiJvB,UAAK,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;QAC7B,YAAO,GAA8B,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;QACnE,kBAAa,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;sBAzIW,IAAI;qBAOvB,OAAO;oBAOiB,QAAQ;0BAOZ,YAAY;sBAOpB,OAAO;oBAQL,UAAU;uBAQb,EAAE;sBAOH,EAAE;2BAOJ,EA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,CACP,CACF,CAAC,CAAC,CAAC,IAAI,CACH,CACD,CACT,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, h, State, Prop, Event, EventEmitter, Host } from '@stencil/core';\nimport {\n getMonth, getYear, startOfMonth, endOfMonth, eachDayOfInterval, format, getDay,\n isBefore, isAfter, isSameDay, isToday, parseISO, addDays, addMonths, subDays, startOfYear,\n eachMonthOfInterval, startOfWeek, endOfWeek, subMonths,\n isValid,\n subWeeks,\n addWeeks\n} from 'date-fns';\nimport enAU from 'date-fns/locale/en-AU';\nimport ptBR from 'date-fns/locale/pt-BR';\n\n@Component({\n tag: 'cura-calendar',\n styleUrl: 'cura-calendar.scss',\n shadow: true,\n})\n\nexport class CuraCalendar {\n /**\n * An array of specific dates to be highlighted or processed.\n *\n * @type {string[] | string}\n * @default []\n * @example\n * // Example usage\n * period = [\"2024-08-01\", \"2024-08-30\"];\n */\n @Prop({ reflect: true }) period: null | string[] | string = null;\n /**\n * Width of the component.\n *\n * @type {string}\n * @default '280px'\n */\n @Prop({ reflect: true }) width: string = '280px';\n /**\n * Selection mode of the date picker.\n *\n * @type {'single' | 'multiple' | 'range'}\n * @default 'single'\n */\n @Prop({ reflect: true }) mode: 'single' | 'multiple' | 'range' = 'single';\n /**\n * Date format used for display and parsing.\n *\n * @type {string}\n * @default 'yyyy-MM-dd'\n */\n @Prop({ reflect: true, mutable: true }) dateFormat: string = 'yyyy-MM-dd';\n /**\n * Locale for date formatting.\n *\n * @type {'pt-BR' | 'en-US'}\n * @default 'pt-BR'\n */\n @Prop({ reflect: true }) locale: 'pt-BR' | 'en-US' = 'pt-BR';\n\n /**\n * Display type of the date picker.\n *\n * @type {'dropdown' | 'static'}\n * @default 'dropdown'\n */\n @Prop({ reflect: true }) type: 'dropdown' | 'static' = 'dropdown';\n\n /**\n * List of dates to disable.\n *\n * @type {string[]}\n * @default []\n */\n @Prop({ reflect: true }) disable: string[] | null = [];\n /**\n * List of dates to enable.\n *\n * @type {string[]}\n * @default []\n */\n @Prop({ reflect: true }) enable: string[] | null = [];\n /**\n * Default dates selected on initialization.\n *\n * @type {string[]}\n * @default []\n */\n @Prop({ reflect: true }) defaultDate: string[] = [];\n /**\n * Limits the selectable date range.\n *\n * @type {Date | null}\n * @default null\n */\n @Prop({ reflect: true }) limitRange: number | null = null;\n\n @Prop({ reflect: true, mutable: true }) disablePassDates: boolean = false;\n\n @Prop({ reflect: true, mutable: true }) collapsed: boolean | null = null;\n\n /**\n * The current month being viewed in the date picker.\n *\n * @type {Date}\n * @default new Date()\n */\n @State() currentDate: Date = new Date();\n\n /**\n * Array of currently selected dates.\n *\n * @type {Date[]}\n * @default []\n */\n @State() selectedDates: Date[] = [];\n\n /**\n * The start date of the range selection, if applicable.\n *\n * @type {Date | null}\n * @default null\n */\n @State() rangeStart: Date | null = null;\n\n /**\n * Array of default dates that are initially selected.\n *\n * @type {Date[]}\n * @default []\n */\n @State() defaultDates: Date[] = [];\n\n /**\n * Selected months on dropdown.\n *\n * @type {string}\n * @default ''\n */\n @State() selectMonth: string = '';\n\n /**\n * Selected year on dropdown.\n *\n * @type {string}\n * @default ''\n */\n @State() selectYear: string = ''\n\n /**\n * CSS styles applied to the component.\n *\n * @type {Object}\n * @default {}\n */\n @State() styles = {};\n\n /**\n * Event emitted when a day is changed.\n *\n * @event\n * @type {EventEmitter<{ days: Date[] }>}\n */\n @Event() onchangeday: EventEmitter<{ days: Date[] }>;\n\n theme = window.CuraAPI.theme;\n weights: { [key: string]: string } = this.theme.fonts.getWeights();\n optionsLocale = { 'pt-BR': ptBR, 'en-US': enAU };\n\n connectedCallback() {\n this.initializeDefaultDates();\n this.setFontProperties()\n\n const colors = [\n { name: '--accent-base', theme: 'accent-base' },\n { name: '--accent-light', theme: 'accent-light' },\n { name: '--neutral-black', theme: 'neutral-black' },\n { name: '--primary-darker', theme: 'primary-darker' },\n { name: '--neutral-dark', theme: 'neutral-dark' },\n { name: '--neutral-light', theme: 'neutral-light' },\n ];\n\n colors.forEach(color => this.styles = { ...this.styles, [color.name]: this.theme.colors.getColor(color.theme) });\n }\n\n setFontProperties() {\n this.styles['--font-family'] = window.CuraAPI.theme.fonts.getFamily();\n this.styles['--font-size'] = window.CuraAPI.theme.fonts.getSize();\n this.styles['--font-color'] = window.CuraAPI.theme.fonts.getColor();\n this.styles['--font-weight-medium'] = this.weights.medium;\n this.styles['--font-weight-bold'] = this.weights.bold;\n this.styles['--font-weight-regular'] = this.weights.regular;\n }\n\n /**\n * Initialize the selected dates based on defaultDate and mode.\n */\n initializeDefaultDates() {\n this.defaultDates = this.expandDateRanges(this.defaultDate);\n }\n\n /**\n * Get the locale for the calendar.\n *\n * @returns {Locale} The locale object.\n */\n determineLocale() {\n return this.optionsLocale[this.locale as string] || this.locale;\n }\n\n /**\n * Check if a date is within the valid period.\n *\n * @param {Date} date - The date to check.\n * @returns {boolean} Whether the date is valid.\n */\n isDateInValidPeriod(date: Date | null): boolean {\n if (this.period === null) {\n return true;\n }\n return this.period.includes(format(date, this.dateFormat));\n }\n\n /**\n * Check if a date is selected.\n *\n * @param {Date} date - The date to check.\n * @returns {boolean} Whether the date is selected.\n */\n isDateSelected(date: Date): boolean {\n return this.isDateInList(this.selectedDates, date);\n }\n\n /**\n * Check if has date in defaultDates.\n *\n * @param {Date} date - The date to check.\n * @returns {boolean} Whether the date is selected.\n */\n isDateInDefaultSelection(date: Date): boolean {\n return this.isDateInList(this.defaultDates, date);\n }\n\n /**\n * Check if a date is within a disabled period.\n *\n * @param {Date} date - The date to check.\n * @returns {boolean} Whether the date is disabled.\n */\n isDateInDisabledPeriod(date: Date | null): boolean {\n\n const today = new Date()\n today.setHours(0, 0, 0, 0);\n if (this.disablePassDates) return isBefore(date, today)\n if (this.disable === null) return false\n return this.isDateInList(this.expandDateRanges(this.disable), date)\n }\n\n /**\n * Check if a date is within an enabled period.\n *\n * @param {Date} date - The date to check.\n * @returns {boolean} Whether the date is enabled.\n */\n isDateInEnabledPeriod(date: Date | null): boolean {\n if (this.enable === null || []) return true;\n return this.isDateInList(this.expandDateRanges(this.enable), date)\n }\n\n /**\n * Checks if a date is in the provided list of dates.\n *\n * @param {Date[]} dates - The list of dates to check against.\n * @param {Date} date - The date to check.\n * @returns {boolean} Whether the date is in the list.\n */\n isDateInList(dates: Date[], date: Date): boolean {\n return dates.some(d => isSameDay(d, date));\n }\n\n /**\n * Removes a specific date from a list of dates.\n *\n * @param {Date[]} dates - The array of dates to filter.\n * @param {Date} dateToRemove - The date to remove from the array.\n * @returns {Date[]} A new array with the specified date removed.\n */\n removeDateFromSelection(dates: Date[], dateToRemove: Date): Date[] {\n return dates.filter(d => !isSameDay(d, dateToRemove));\n }\n\n /**\n * Change the current month.\n *\n * @param {string} direction - 'prev' | 'next'\n */\n updateCurrentMonth(direction: 'prev' | 'next') {\n let newMonth = new Date(this.currentDate);\n\n if (direction === 'prev') newMonth = subMonths(this.currentDate, 1)\n if (direction === 'next') newMonth = addMonths(this.currentDate, 1)\n\n this.currentDate = newMonth;\n }\n\n /**\n * Handle the month dropdown change.\n *\n * @param {CustomEvent} event - The change event.\n */\n onMonthDropdownChange(event: CustomEvent) {\n const { months } = this.fetchMonthNames();\n const newMonth = event.detail;\n\n this.selectMonth = newMonth\n this.currentDate = new Date(getYear(this.currentDate), months.indexOf(newMonth), 1);\n }\n\n /**\n * Handle the year input change.\n *\n * @param {CustomEvent} event - The change event.\n */\n onYearDropdownChange(event: CustomEvent) {\n const newYear = event.detail;\n\n this.selectYear = newYear\n this.currentDate = new Date(newYear, getMonth(this.currentDate), 1);\n }\n\n /**\n * Flatten date ranges into individual dates.\n *\n * @param {({ from: string; to: string } | string)[]} dates - An array of date ranges or individual dates.\n * @returns {Date[]} An array of individual dates.\n */\n expandDateRanges(dates: ({ from: string; to: string } | string)[]): Date[] {\n return dates.flatMap(date => {\n if (typeof date === 'string') return isValid(parseISO(date)) ? [parseISO(date)] : [];\n\n const start = parseISO(date.from);\n const end = parseISO(date.to);\n\n if (isValid(start) && isValid(end) && start <= end) return eachDayOfInterval({ start, end });\n return [];\n });\n }\n\n /**\n * Handle single date selection.\n *\n * @param {Date} date - The date to select.\n */\n selectSingleDate(date: Date) {\n this.defaultDates = [];\n this.selectedDates = [date];\n }\n\n /**\n * Handle multiple date selection.\n *\n * @param {Date} date - The date to select or deselect.\n */\n selectMultiplesDate(date: Date) {\n if (!this.isDateSelected(date) || !this.isDateInDefaultSelection(date)) return this.selectedDates = [...this.selectedDates, date];\n\n this.selectedDates = this.removeDateFromSelection(this.selectedDates, date)\n this.defaultDates = this.removeDateFromSelection(this.defaultDates, date)\n }\n\n /**\n * Handle range date selection.\n *\n * @param {Date} date - The date to select.\n */\n selectDateRange(date: Date) {\n this.defaultDates = [];\n\n const start = isBefore(this.rangeStart, date) ? this.rangeStart : date;\n const end = isAfter(this.rangeStart, date) ? this.rangeStart : date;\n const range = eachDayOfInterval({ start, end });\n\n if (!this.rangeStart || this.selectedDates.length === 2) {\n this.rangeStart = date;\n this.selectedDates = [date];\n return;\n }\n\n if (this.limitRange === null || range.length <= this.limitRange) {\n this.selectedDates = range;\n this.rangeStart = null;\n }\n }\n\n /**\n * Handle a click on a date.\n *\n * @param {Date} date - The date that was clicked.\n */\n onDateClick(date: Date) {\n if (!this.isDateInValidPeriod(date) || this.isDateInDisabledPeriod(date) || !this.isDateInEnabledPeriod(date)) return;\n\n const selectionHandlers = {\n single: this.selectSingleDate.bind(this),\n multiple: this.selectMultiplesDate.bind(this),\n range: this.selectDateRange.bind(this)\n };\n\n selectionHandlers[this.mode](date);\n this.onchangeday.emit({ days: [...this.defaultDates, ...this.selectedDates].filter(d => this.isDateInValidPeriod(d)) });\n }\n\n /**\n * Get the days of the week.\n *\n * @returns {string[]} An array of abbreviated day names.\n */\n fetchWeekDays(): string[] {\n const start = startOfWeek(new Date(2021, 0, 3), { locale: this.determineLocale() });\n const end = endOfWeek(new Date(2021, 0, 3), { locale: this.determineLocale() });\n\n return eachDayOfInterval({ start, end }).map(day => format(day, 'EEEEEE', { locale: this.determineLocale() }));\n }\n\n /**\n * Get the days of the current month, including leading nulls for alignment.\n *\n * @returns {(Date | null)[]} An array of dates and nulls for the current month view.\n */\n showNotColapsedCalendar() {\n if (this.collapsed) {\n this.fetchDaysOfWeek()\n }\n else (\n this.fetchDaysOfMonth())\n this.collapsed = false\n }\n\n showColapsedCalendar() {\n this.collapsed = true\n return this.fetchDaysOfWeek()\n }\n\n fetchDaysOfWeek(): Date[] {\n\n const DAYS_IN_CALENDAR_VIEW = 7\n const start = startOfWeek(this.currentDate);\n const end = endOfWeek(this.currentDate);\n\n const daysIncurrentDate = eachDayOfInterval({ start, end });\n\n return daysIncurrentDate.slice(0, DAYS_IN_CALENDAR_VIEW);\n }\n\n updateCurrentWeek(direction: 'prev' | 'next') {\n let newWeek = new Date(this.currentDate);\n\n if (direction === 'prev') newWeek = subWeeks(this.currentDate, 1)\n if (direction === 'next') newWeek = addWeeks(this.currentDate, 1)\n\n this.currentDate = newWeek;\n }\n\n fetchDaysOfMonth(): Date[] {\n\n const WEEKS_IN_CALENDAR_VIEW = 6\n const DAYS_IN_CALENDAR_VIEW = 42\n const start = startOfMonth(this.currentDate);\n const end = endOfMonth(this.currentDate);\n\n const daysIncurrentDate = eachDayOfInterval({ start, end });\n\n const prevMonthStart = startOfMonth(addMonths(start, -1));\n const prevMonthEnd = endOfMonth(prevMonthStart);\n const daysInPrevMonth = eachDayOfInterval({\n start: subDays(prevMonthEnd, getDay(start)),\n end: prevMonthEnd\n });\n\n const nextMonthStart = startOfMonth(addMonths(end, 1));\n const nextMonthEnd = endOfMonth(nextMonthStart);\n const remainingDays = WEEKS_IN_CALENDAR_VIEW - getDay(end);\n const daysInNextMonth = eachDayOfInterval({\n start: nextMonthStart,\n end: addDays(nextMonthEnd, remainingDays)\n });\n\n const totalDays = [\n ...daysInPrevMonth.slice(-getDay(start)),\n ...daysIncurrentDate,\n ...daysInNextMonth\n ];\n\n return totalDays.slice(0, DAYS_IN_CALENDAR_VIEW);\n }\n\n /**\n * Get the names of all months in the current year.\n *\n * @returns {{ months: string[], currentMonth: string }} An object containing an array of month names and the name of the current month.\n */\n fetchMonthNames(): { months: string[] } {\n const currentYear = getYear(this.currentDate);\n const locale = this.determineLocale();\n\n const months = eachMonthOfInterval({\n start: startOfYear(new Date(currentYear, 0, 1)),\n end: new Date(currentYear, 11, 31)\n }).map(month => format(month, 'MMMM', { locale }));\n\n const capitalize = (str: string) => str.charAt(0).toUpperCase() + str.slice(1).toLowerCase();\n\n return {\n months: months.map(capitalize),\n };\n }\n\n /**\n * Get a list of years in descending order from the current year to a specified limit.\n *\n * @returns {number[]} An array of years.\n */\n fetchYearList(): number[] {\n const currentYear = getYear(new Date());\n return Array.from({ length: 100 }, (_, i) => currentYear - i);\n }\n\n /**\n * Get the color for the previous button.\n *\n * @returns {string} The color name for the previous button.\n */\n determinePrevButtonColor(): string {\n const isPrevDisabled = isBefore(new Date(getYear(this.currentDate), getMonth(this.currentDate) - 1, 1), startOfMonth(new Date()));\n return isPrevDisabled && 'primary-base';\n }\n\n /**\n * Get the status of a given date, determining its position and interval status.\n *\n * @param {Date | null} date - The date to evaluate.\n * @returns {Object} An object containing the status flags for the date.\n */\n getDateStatus(date: Date) {\n const [startSelected, endSelected] = [this.selectedDates[0], this.selectedDates[this.selectedDates.length - 1]];\n const [startDefault, endDefault] = [this.defaultDates[0], this.defaultDates[this.defaultDates.length - 1]];\n\n const hasSelectedDates = this.selectedDates.length > 1;\n const isDateInDefaultSelection = this.defaultDates.length > 1;\n\n const isStartSelected = this.isDateSelected(date) && isSameDay(date, startSelected);\n const isStartDefault = this.isDateInDefaultSelection(date) && isSameDay(date, startDefault);\n const isEndSelected = this.isDateSelected(date) && isSameDay(date, endSelected);\n const isEndDefault = this.isDateInDefaultSelection(date) && isSameDay(date, endDefault);\n\n const isStart = isStartSelected || isStartDefault;\n const isEnd = isEndSelected || isEndDefault;\n\n\n const selectedIntervals = this.expandDateRanges([{ from: startSelected?.toISOString(), to: endSelected?.toISOString() }]);\n const defaultIntervals = this.expandDateRanges([{ from: startDefault?.toISOString(), to: endDefault?.toISOString() }]);\n\n const intervalSelected = hasSelectedDates && this.isDateInList(selectedIntervals, date);\n const intervalDefault = isDateInDefaultSelection && this.isDateInList(defaultIntervals, date);\n\n const isValid = this.isDateInValidPeriod(date);\n const isInvalid = !isValid || this.isDateInDisabledPeriod(date) || !this.isDateInEnabledPeriod(date);\n const isSelected = this.isDateSelected(date);\n const isRange = this.mode === 'range' && (hasSelectedDates || isDateInDefaultSelection);\n const isDefault = this.mode !== 'range' && this.isDateInDefaultSelection(date);\n const isInterval = (intervalSelected || intervalDefault) && !isStart && !isEnd;\n\n return {\n isStart,\n isEnd,\n isValid,\n isInvalid,\n isSelected,\n isRange,\n isDefault,\n isInterval\n };\n }\n\n /**\n * Get the CSS classes for a given date based on its status.\n *\n * @param {Date | null} date - The date to evaluate.\n * @returns {Object} An object containing the CSS classes for the date.\n */\n getClasses(date: Date) {\n const classes = { 'date': true };\n if (date === null) return classes;\n\n const dateStatus = this.getDateStatus(date);\n\n classes['today'] = isToday(date);\n classes['valid'] = dateStatus.isValid;\n classes['invalid'] = dateStatus.isInvalid;\n classes['selected'] = dateStatus.isSelected;\n classes['range'] = dateStatus.isRange;\n classes['default-dates'] = dateStatus.isDefault;\n classes['start'] = dateStatus.isStart;\n classes['interval'] = dateStatus.isInterval;\n classes['end'] = dateStatus.isEnd;\n\n return classes;\n }\n\n /**\n * Get custom CSS properties for the host element.\n *\n * @returns {Object} An object containing CSS properties and their values.\n */\n getHostCSSProperties() {\n return {\n '--width': this.width,\n };\n }\n\n\n render() {\n const { months } = this.fetchMonthNames();\n\n\n\n return (\n <Host style={this.getHostCSSProperties()}>\n <div class=\"calendar\" style={this.styles}>\n <header class=\"header\">\n <div class={`month-year ${this.type === 'dropdown' && 'dropdown'}`}>\n <cura-icon\n class={`icon ${this.type === 'dropdown' && 'dropdown'}`}\n name=\"left\"\n color={this.determinePrevButtonColor()}\n onClick={!this.collapsed ? () => this.updateCurrentMonth('prev') : () => this.updateCurrentWeek('prev')}>\n </cura-icon>\n {this.type === 'dropdown' ? (\n <div class=\"select\">\n <cura-select\n class=\"drop-month\"\n mode=\"transparent\"\n value={months[getMonth(this.currentDate)]}\n onSelected={(e) => this.onMonthDropdownChange(e)}\n >\n {months.map((month, index) => (\n <cura-select-option\n key={index}\n value={month}>\n {month}\n </cura-select-option>\n ))}\n </cura-select>\n <cura-select\n class=\"drop-year\"\n mode=\"transparent\"\n value={getYear(this.currentDate).toString()}\n onSelected={(e) => this.onYearDropdownChange(e)}\n >\n {this.fetchYearList().map((year, index) => (\n <cura-select-option\n key={index}\n value={year.toString()}>\n {year.toString()}\n </cura-select-option>\n ))}\n </cura-select>\n </div>\n ) : (\n <cura-label\n color=\"neutral-black\"\n size=\"large\">\n {months[getMonth(this.currentDate)].slice(0, 3)}, {getYear(this.currentDate)}\n </cura-label>\n )}\n <cura-icon\n class={`icon ${this.type === 'dropdown' && 'dropdown'}`}\n name=\"right\"\n color=\"primary-base\"\n onClick={!this.collapsed ? () => this.updateCurrentMonth('next') : () => this.updateCurrentWeek('next')}>\n </cura-icon>\n </div>\n </header>\n\n <span class=\"days-of-week\">\n {this.fetchWeekDays().map((day, index) => (\n <cura-label\n class=\"day\"\n size=\"xsmall\"\n color=\"neutral-black\"\n weight='bold'\n key={index}>\n {day === 'sab' ? 'SÁB' : day.toLocaleUpperCase()}\n </cura-label>\n ))}\n </span>\n\n <div class=\"dates\">\n {!this.collapsed ?\n this.fetchDaysOfMonth().map((day, index) => (\n <div\n key={index}\n class={this.getClasses(day)}\n onClick={() => this.onDateClick(day)}>\n {day ? format(day, 'd') : ''}\n </div>\n )) :\n this.fetchDaysOfWeek().map((day, index) => (\n <div\n key={index}\n class={this.getClasses(day)}\n onClick={() => this.onDateClick(day)}>\n {day ? format(day, 'd') : ''}\n </div>\n ))}\n </div>\n {this.collapsed !== null ? (\n this.collapsed ? (\n <div class='collapsed-container'>\n <cura-button-transparent\n onClick={() => this.showNotColapsedCalendar()}\n size='small'\n color='primary'\n fontColor='dark'\n iconName='plusCircle'>\n Veja mais datas\n </cura-button-transparent>\n </div>\n ) : (\n <div class='collapsed-container'>\n <cura-button-transparent\n onClick={() => this.showColapsedCalendar()}\n size='small'\n color='primary'\n fontColor='dark'\n iconName='minusCircle'>\n Veja menos datas\n </cura-button-transparent>\n </div>\n )\n ) : null}\n </div >\n </Host >\n );\n }\n}\n"]}
|
|
@@ -9,6 +9,8 @@ const renderCuraCalendar = (args) => `
|
|
|
9
9
|
${`enable="${args.enable.length > 0 ? args.enable : '[]'}"`}
|
|
10
10
|
${`disable="${args.disable.length > 0 ? args.disable : '[]'}"`}
|
|
11
11
|
${`defaultDate="${args.defaultDate.length > 0 ? args.defaultDate : '[]'}"`}
|
|
12
|
+
${args.disablePassDates && `disable-pass-dates="${args.disablePassDates}"`}
|
|
13
|
+
${args.collapsed && `collapsed="${args.collapsed}"`}
|
|
12
14
|
${args.limitRange !== null ? `limit-range="${args.limitRange}"` : ''}
|
|
13
15
|
></cura-calendar>
|
|
14
16
|
`;
|
|
@@ -22,10 +24,10 @@ export default {
|
|
|
22
24
|
argTypes: {
|
|
23
25
|
period: {
|
|
24
26
|
control: 'array',
|
|
25
|
-
description: 'Define os períodos disponíveis para o calendário.',
|
|
27
|
+
description: 'Define os períodos disponíveis para o calendário. Quando não informado, considera todas as datas como habilitadas',
|
|
26
28
|
table: {
|
|
27
29
|
category: 'Properties',
|
|
28
|
-
defaultValue: { summary:
|
|
30
|
+
defaultValue: { summary: null },
|
|
29
31
|
},
|
|
30
32
|
},
|
|
31
33
|
width: {
|
|
@@ -33,7 +35,7 @@ export default {
|
|
|
33
35
|
description: 'Define a largura do calendário. <b>Largura minima "300px"</b>.',
|
|
34
36
|
table: {
|
|
35
37
|
category: 'Properties',
|
|
36
|
-
defaultValue: { summary: '
|
|
38
|
+
defaultValue: { summary: '280px' },
|
|
37
39
|
},
|
|
38
40
|
},
|
|
39
41
|
mode: {
|
|
@@ -103,6 +105,22 @@ export default {
|
|
|
103
105
|
defaultValue: { summary: 'null' },
|
|
104
106
|
},
|
|
105
107
|
},
|
|
108
|
+
disablePassDates: {
|
|
109
|
+
control: 'boolean',
|
|
110
|
+
description: 'Define se as datas anteriores a data atual serão consideras como desabilitadas',
|
|
111
|
+
table: {
|
|
112
|
+
category: "Properties",
|
|
113
|
+
defaultValue: { summary: false },
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
collapsed: {
|
|
117
|
+
control: 'boolean',
|
|
118
|
+
description: 'Define se a exibição do calendário será com recolhida ou expandida ',
|
|
119
|
+
table: {
|
|
120
|
+
category: "Properties",
|
|
121
|
+
defaultValue: { summary: null },
|
|
122
|
+
},
|
|
123
|
+
}
|
|
106
124
|
},
|
|
107
125
|
};
|
|
108
126
|
export const Calendar = {
|
|
@@ -112,7 +130,7 @@ export const Calendar = {
|
|
|
112
130
|
"2024-08-29", "2024-08-15", "2024-08-02", "2024-08-30", "2024-09-01",
|
|
113
131
|
"2024-09-29", "2024-10-15", "2024-09-02", "2024-09-30", "2024-10-01"
|
|
114
132
|
],
|
|
115
|
-
width: '
|
|
133
|
+
width: '280px',
|
|
116
134
|
mode: 'single',
|
|
117
135
|
type: 'static',
|
|
118
136
|
locale: 'pt-BR',
|
|
@@ -121,6 +139,8 @@ export const Calendar = {
|
|
|
121
139
|
enable: [],
|
|
122
140
|
disable: [],
|
|
123
141
|
limitRange: null,
|
|
142
|
+
disablePassDates: false,
|
|
143
|
+
collapsed: null
|
|
124
144
|
},
|
|
125
145
|
};
|
|
126
146
|
//# sourceMappingURL=cura-calendar.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cura-calendar.stories.js","sourceRoot":"","sources":["../../../src/components/cura-calendar/cura-calendar.stories.tsx"],"names":[],"mappings":"AAAA,MAAM,kBAAkB,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC;;QAE7B,IAAI,CAAC,MAAM,IAAI,WAAW,IAAI,CAAC,MAAM,GAAG;QACxC,IAAI,CAAC,KAAK,IAAI,UAAU,IAAI,CAAC,KAAK,GAAG;QACrC,IAAI,CAAC,IAAI,IAAI,SAAS,IAAI,CAAC,IAAI,GAAG;QAClC,IAAI,CAAC,IAAI,IAAI,SAAS,IAAI,CAAC,IAAI,GAAG;QAClC,IAAI,CAAC,UAAU,IAAI,gBAAgB,IAAI,CAAC,UAAU,GAAG;QACrD,IAAI,CAAC,MAAM,IAAI,WAAW,IAAI,CAAC,MAAM,GAAG;QACxC,WAAW,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,GAAG;QACzD,YAAY,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,GAAG;QAC5D,gBAAgB,IAAI,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,GAAG;QACxE,IAAI,CAAC,UAAU,KAAK,IAAI,CAAC,CAAC,CAAC,gBAAgB,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,EAAE;;CAEzE,CAAC;AAEF,eAAe;IACb,KAAK,EAAE,+BAA+B;IACtC,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,UAAU,EAAE;QACV,MAAM,EAAE,UAAU;KACnB;IACD,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,kBAAkB,CAAC,IAAI,CAAC;IAC1C,QAAQ,EAAE;QACR,MAAM,EAAE;YACN,OAAO,EAAE,OAAO;YAChB,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"cura-calendar.stories.js","sourceRoot":"","sources":["../../../src/components/cura-calendar/cura-calendar.stories.tsx"],"names":[],"mappings":"AAAA,MAAM,kBAAkB,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC;;QAE7B,IAAI,CAAC,MAAM,IAAI,WAAW,IAAI,CAAC,MAAM,GAAG;QACxC,IAAI,CAAC,KAAK,IAAI,UAAU,IAAI,CAAC,KAAK,GAAG;QACrC,IAAI,CAAC,IAAI,IAAI,SAAS,IAAI,CAAC,IAAI,GAAG;QAClC,IAAI,CAAC,IAAI,IAAI,SAAS,IAAI,CAAC,IAAI,GAAG;QAClC,IAAI,CAAC,UAAU,IAAI,gBAAgB,IAAI,CAAC,UAAU,GAAG;QACrD,IAAI,CAAC,MAAM,IAAI,WAAW,IAAI,CAAC,MAAM,GAAG;QACxC,WAAW,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,GAAG;QACzD,YAAY,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,GAAG;QAC5D,gBAAgB,IAAI,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,GAAG;QACxE,IAAI,CAAC,gBAAgB,IAAI,uBAAuB,IAAI,CAAC,gBAAgB,GAAG;QACxE,IAAI,CAAC,SAAS,IAAI,cAAc,IAAI,CAAC,S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K,EAAE;gBACL,QAAQ,EAAE,YAAY;gBACtB,YAAY,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;aAChC;SACF;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,IAAI,EAAE;QACJ,MAAM,EAAE;YACN,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY;YACpE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY;YACpE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY;SACrE;QACD,KAAK,EAAE,OAAO;QACd,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,OAAO;QACf,UAAU,EAAE,YAAY;QACxB,WAAW,EAAE,EAAE;QACf,MAAM,EAAE,EAAE;QACV,OAAO,EAAE,EAAE;QACX,UAAU,EAAE,IAAI;QAChB,gBAAgB,EAAE,KAAK;QACvB,SAAS,EAAE,IAAI;KAChB;CACF,CAAC","sourcesContent":["const renderCuraCalendar = (args) => `\n <cura-calendar\n ${args.period && `period=\"${args.period}\"`}\n ${args.width && `width=\"${args.width}\"`}\n ${args.mode && `mode=\"${args.mode}\"`}\n ${args.type && `type=\"${args.type}\"`}\n ${args.dateFormat && `date-format=\"${args.dateFormat}\"`}\n ${args.locale && `locale=\"${args.locale}\"`}\n ${`enable=\"${args.enable.length > 0 ? args.enable : '[]'}\"`}\n ${`disable=\"${args.disable.length > 0 ? args.disable : '[]'}\"`}\n ${`defaultDate=\"${args.defaultDate.length > 0 ? args.defaultDate : '[]'}\"`}\n ${args.disablePassDates && `disable-pass-dates=\"${args.disablePassDates}\"`}\n ${args.collapsed && `collapsed=\"${args.collapsed}\"`}\n ${args.limitRange !== null ? `limit-range=\"${args.limitRange}\"` : ''}\n ></cura-calendar>\n`;\n\nexport default {\n title: 'Componentes/Calendar/Calendar',\n tags: ['autodocs'],\n parameters: {\n layout: 'centered',\n },\n render: (args) => renderCuraCalendar(args),\n argTypes: {\n period: {\n control: 'array',\n description: 'Define os períodos disponíveis para o calendário. Quando não informado, considera todas as datas como habilitadas',\n table: {\n category: 'Properties',\n defaultValue: { summary: null },\n },\n },\n width: {\n control: 'text',\n description: 'Define a largura do calendário. <b>Largura minima \"300px\"</b>.',\n table: {\n category: 'Properties',\n defaultValue: { summary: '280px' },\n },\n },\n mode: {\n control: 'inline-radio',\n options: ['single', 'multiple', 'range'],\n description: 'Define o modo de seleção de datas.',\n table: {\n category: \"Properties\",\n defaultValue: { summary: 'single' },\n },\n },\n type: {\n control: 'inline-radio',\n options: ['static', 'dropdown'],\n description: 'Define o tipo de visualização (mês/ano) do calendário.',\n table: {\n category: \"Properties\",\n defaultValue: { summary: 'static' },\n },\n },\n dateFormat: {\n control: 'text',\n description: 'Define o formato das datas exibidas.',\n table: {\n category: \"Properties\",\n defaultValue: { summary: 'yyyy-MM-dd' },\n },\n },\n locale: {\n control: 'inline-radio',\n options: ['pt-BR', 'en-US'],\n description: 'Define o idioma/localização do calendário.',\n table: {\n category: \"Properties\",\n defaultValue: { summary: 'pt-BR' },\n },\n },\n defaultDate: {\n control: 'array',\n description: 'Define as datas que serão pré-selecionadas no calendário.',\n table: {\n category: \"Properties\",\n defaultValue: { summary: '[]' },\n },\n },\n enable: {\n control: 'array',\n description: 'Define as datas que são habilitadas para seleção.',\n table: {\n category: \"Properties\",\n defaultValue: { summary: '[]' },\n },\n },\n disable: {\n control: 'array',\n description: 'Define as datas que são desabilitadas para seleção.',\n table: {\n category: \"Properties\",\n defaultValue: { summary: '[]' },\n },\n },\n limitRange: {\n control: 'number',\n description: 'Define o limite de datas selecionáveis no modo de seleção range.',\n table: {\n category: \"Properties\",\n defaultValue: { summary: 'null' },\n },\n },\n disablePassDates: {\n control: 'boolean',\n description: 'Define se as datas anteriores a data atual serão consideras como desabilitadas',\n table: {\n category: \"Properties\",\n defaultValue: { summary: false },\n },\n },\n collapsed: {\n control: 'boolean',\n description: 'Define se a exibição do calendário será com recolhida ou expandida ',\n table: {\n category: \"Properties\",\n defaultValue: { summary: null },\n },\n }\n },\n};\n\nexport const Calendar = {\n args: {\n period: [\n \"2024-08-01\", \"2024-08-30\", \"2024-08-02\", \"2024-08-03\", \"2024-08-04\",\n \"2024-08-29\", \"2024-08-15\", \"2024-08-02\", \"2024-08-30\", \"2024-09-01\",\n \"2024-09-29\", \"2024-10-15\", \"2024-09-02\", \"2024-09-30\", \"2024-10-01\"\n ],\n width: '280px',\n mode: 'single',\n type: 'static',\n locale: 'pt-BR',\n dateFormat: 'yyyy-MM-dd',\n defaultDate: [],\n enable: [],\n disable: [],\n limitRange: null,\n disablePassDates: false,\n collapsed: null\n },\n};\n"]}
|
|
@@ -34,7 +34,7 @@ export class CuraCard {
|
|
|
34
34
|
return classes;
|
|
35
35
|
}
|
|
36
36
|
render() {
|
|
37
|
-
return (h(Host, { key: '
|
|
37
|
+
return (h(Host, { key: '24318e0e70d7a9cb1cbdfa3503b2fa5bce791c00', role: this.href ? 'link' : 'div' }, this.href ? (h("a", { class: this.getClasses(), target: this.target, style: this.styles, href: this.href }, h("slot", null))) : (h("div", { class: this.getClasses(), style: this.styles }, h("slot", null)))));
|
|
38
38
|
}
|
|
39
39
|
static get is() { return "cura-card"; }
|
|
40
40
|
static get encapsulation() { return "shadow"; }
|
|
@@ -31,7 +31,7 @@ export class CuraIcon {
|
|
|
31
31
|
this.host.style.setProperty(prop, value);
|
|
32
32
|
}
|
|
33
33
|
render() {
|
|
34
|
-
return (h(Host, { key: '
|
|
34
|
+
return (h(Host, { key: '42f2502c1180315fde13c1c383ba2335e681f25b' }, h("svg", { key: 'b30e76338033abd6be556049e1db9d949173adc2', version: "1.1", viewBox: "0 0 24 24", preserveAspectRatio: "xMidYMid meet", xmlns: "http://www.w3.org/2000/svg" }, h("use", { key: '45df96f126cc573ce5189332a04c4e9a6db02b36', xlinkHref: `${this.assetsPath}/icons/iconset-${this.iconset}.svg#${this.name}` }))));
|
|
35
35
|
}
|
|
36
36
|
static get is() { return "cura-icon"; }
|
|
37
37
|
static get encapsulation() { return "shadow"; }
|
|
@@ -14,9 +14,9 @@ export class CuraIconsView {
|
|
|
14
14
|
this.sizes.unshift(this.sizes.pop());
|
|
15
15
|
}
|
|
16
16
|
render() {
|
|
17
|
-
return (h(Host, { key: '
|
|
18
|
-
h("div", { class: "size" }, h("cura-icon", { name: this.selected, size: size }), h("span", null, size)))), h("div", { key: '
|
|
19
|
-
h("div", { class: "size" }, h("cura-icon", { name: this.selected, size: size, color: "neutral-white" }), h("span", null, size))))), h("div", { key: '
|
|
17
|
+
return (h(Host, { key: 'a6617c95d8f812380ad9a6471b2d3308f230d985' }, h("div", { key: 'fd3d146d453f37b1e1f8968113271bd59c870821', class: "iconDetail" }, h("cura-heading", { key: '6f8ba0f48fe6a3fd7d237bf8606f0e789bb9a24e', size: "small", "margin-block": "0 24px" }, "Icon: ", h("b", { key: '9a90cfdc2df40488ece88e4af4ddf7af4c8b7413' }, this.selected)), h("div", { key: '0b0978997491adc4bf5c9629c3ca93302d352a57', class: "iconSizes" }, this.sizes.map(size => size === 'micro' && !microIcons.includes(this.selected) ? '' :
|
|
18
|
+
h("div", { class: "size" }, h("cura-icon", { name: this.selected, size: size }), h("span", null, size)))), h("div", { key: '0d8666083a28088fbb036920c0130770fadb9fe8', class: "iconSizes invert" }, this.sizes.map(size => size === 'micro' && !microIcons.includes(this.selected) ? '' :
|
|
19
|
+
h("div", { class: "size" }, h("cura-icon", { name: this.selected, size: size, color: "neutral-white" }), h("span", null, size))))), h("div", { key: 'fcc2275ca60d1c36dbcc5a7a5b10e1a35d2445e2', class: "icons" }, iconsetdefaulticons.map(icon => h("div", { class: { icon: true, selected: icon === this.selected }, onClick: () => this.setSelected(icon) }, h("cura-icon", { name: icon, size: "32", color: icon === this.selected ? 'accent-dark' : 'neutral-dark' }), h("cura-label", { size: "xsmall", weight: icon === this.selected ? 'bold' : 'regular', color: icon === this.selected ? 'accent-dark' : 'neutral-dark' }, icon), !microIcons.includes(icon) ? '' :
|
|
20
20
|
h("cura-paragraph", { color: 'success-dark', size: "xsmall", "margin-block": "0px", "line-height": '100%' }, "MICRO"))))));
|
|
21
21
|
}
|
|
22
22
|
static get is() { return "cura-icons-view"; }
|
|
@@ -14,7 +14,7 @@ export class CuraPageTemplate {
|
|
|
14
14
|
return classes;
|
|
15
15
|
}
|
|
16
16
|
render() {
|
|
17
|
-
return (h(Host, { key: '
|
|
17
|
+
return (h(Host, { key: '11b8c556d3608f5fdb0f80fa5c0c9a71fa51e506' }, h("div", { key: '41c0a6cb17747a0bf8fb44f8e5766412dd261b4d', style: this.styles, class: "grid-template" }, h("div", { key: 'f563c6dbcd7506bfc100df9d5e4d7afe28cc7172', id: "sub-header" }, h("slot", { key: '2db35bb65c395d6af3ec1654fdbe2fa76735d60d', name: 'sub-header' })), h("div", { key: 'dff85fecdcf50c6812dd7eda1d2547b868da36a4', id: "header" }, h("slot", { key: 'dd1726210432a383868ae4ab716ee20259a7a744', name: 'header' })), h("div", { key: '3d8ebad203977884ea3b0c97cffd764e7c87ff8b', id: "pre-content" }, h("slot", { key: '15e9cd099c005d78afc31624d968142d657cd53e', name: 'pre-content' })), h("div", { key: '682ac5ec6855a6e598a1c27dae336787f38d5143', id: "content-container", class: this.getClasses() }, h("div", { key: 'a288d9994489df25bffac158026df89e688064a9', id: "sidebar-left" }, h("slot", { key: '26546baebf11e32f18ddec1659453e85cb5f8542', name: 'sidebar-left' })), h("div", { key: 'f998d555d298800c770919c6195b2d963000c07f', id: "content" }, h("slot", { key: 'e15084b2c7a2092331e92d5a0e389a37e07905d0', name: "content" }), h("slot", { key: '31a9c32a7309a34882ee8c7e5fe5f8893083a1ba' })), h("div", { key: '661aa62b89dd76d5d40008690fa56d53234e048d', id: "sidebar-right" }, h("slot", { key: 'f0b96d33a41818840a38ca162fd32fba8b3f70bb', name: 'sidebar-right' }))), h("div", { key: 'bdb1b6793f62315d80ab3843224a56e9586f5cc4', id: "post-body" }, h("slot", { key: 'c373462fbd8d8ecebccb1515304be38b68f1fc87', name: 'post-body' })), h("div", { key: '097ae8d7ccb045ebcc60f2829b43a2ba8e87fc2b', id: "footer" }, h("slot", { key: '1d519a8e1e5094bbf5c2a3309c4e84122468ab3e', name: 'footer' })), h("div", { key: '62e5ab1d7c9a4be5e4b4f9ab0803b298ee9fe125', id: "sub-footer" }, h("slot", { key: '59a0637bbc2dad5a2bfef04e78858a95f59231d1', name: 'sub-footer' })))));
|
|
18
18
|
}
|
|
19
19
|
static get is() { return "cura-page-template"; }
|
|
20
20
|
static get encapsulation() { return "shadow"; }
|