@tmorrow/cre8-wc 1.0.26 → 1.1.1
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/cdn/cre8-wc.esm.js +9082 -15604
- package/cdn/cre8-wc.esm.js.map +1 -1
- package/cdn/cre8-wc.min.js +1231 -8308
- package/cdn/cre8-wc.min.js.map +1 -1
- package/lib/cdn-entry.d.ts +20 -2
- package/lib/cdn-entry.d.ts.map +1 -1
- package/lib/components/accordion/accordion.js +18 -64
- package/lib/components/accordion/accordion.styles.d.ts.map +1 -1
- package/lib/components/accordion-item/accordion-item.js +35 -238
- package/lib/components/accordion-item/accordion-item.styles.d.ts.map +1 -1
- package/lib/components/alert/alert.js +56 -221
- package/lib/components/alert/alert.styles.d.ts.map +1 -1
- package/lib/components/badge/badge.js +33 -164
- package/lib/components/badge/badge.styles.d.ts.map +1 -1
- package/lib/components/band/band.js +11 -261
- package/lib/components/band/band.styles.d.ts.map +1 -1
- package/lib/components/breadcrumbs/breadcrumbs.js +14 -33
- package/lib/components/breadcrumbs/breadcrumbs.styles.d.ts.map +1 -1
- package/lib/components/breadcrumbs-item/breadcrumbs-item.js +10 -45
- package/lib/components/breadcrumbs-item/breadcrumbs-item.styles.d.ts.map +1 -1
- package/lib/components/button/button.js +14 -14
- package/lib/components/button-group/button-group.js +10 -261
- package/lib/components/button-group/button-group.styles.d.ts.map +1 -1
- package/lib/components/card/card.js +17 -130
- package/lib/components/card/card.styles.d.ts.map +1 -1
- package/lib/components/chart/chart.js +137 -223
- package/lib/components/chart/chart.styles.d.ts.map +1 -1
- package/lib/components/checkbox-field/checkbox-field.js +26 -59
- package/lib/components/checkbox-field/checkbox-field.styles.d.ts.map +1 -1
- package/lib/components/checkbox-field-item/checkbox-field-item.js +38 -205
- package/lib/components/checkbox-field-item/checkbox-field-item.styles.d.ts.map +1 -1
- package/lib/components/danger-button/danger-button.js +53 -582
- package/lib/components/danger-button/danger-button.styles.d.ts.map +1 -1
- package/lib/components/date-picker/calendar/calendar.styles.d.ts.map +1 -1
- package/lib/components/date-picker/calendar-month-modal/calendar-month-modal.styles.d.ts.map +1 -1
- package/lib/components/date-picker/calendar-navigation/calendar-navigation.styles.d.ts.map +1 -1
- package/lib/components/date-picker/calendar-year-modal/calendar-year-modal.styles.d.ts.map +1 -1
- package/lib/components/date-picker/date-picker.js +262 -499
- package/lib/components/date-picker/date-picker.styles.d.ts.map +1 -1
- package/lib/components/divider/divider.js +20 -61
- package/lib/components/divider/divider.styles.d.ts.map +1 -1
- package/lib/components/dropdown/dropdown.js +34 -107
- package/lib/components/dropdown/dropdown.styles.d.ts.map +1 -1
- package/lib/components/dropdown-item/dropdown-item.js +18 -49
- package/lib/components/dropdown-item/dropdown-item.styles.d.ts.map +1 -1
- package/lib/components/feature/feature.js +19 -81
- package/lib/components/feature/feature.styles.d.ts.map +1 -1
- package/lib/components/field/field.js +12 -146
- package/lib/components/field/field.styles.d.ts.map +1 -1
- package/lib/components/field-note/field-note.js +22 -66
- package/lib/components/field-note/field-note.styles.d.ts.map +1 -1
- package/lib/components/footer/footer.js +10 -29
- package/lib/components/footer/footer.styles.d.ts.map +1 -1
- package/lib/components/global-nav/global-nav.js +20 -43
- package/lib/components/global-nav/global-nav.styles.d.ts.map +1 -1
- package/lib/components/global-nav-item/global-nav-item.js +26 -105
- package/lib/components/global-nav-item/global-nav-item.styles.d.ts.map +1 -1
- package/lib/components/grid/grid.js +15 -337
- package/lib/components/grid/grid.styles.d.ts.map +1 -1
- package/lib/components/grid-item/grid-item.js +7 -15
- package/lib/components/grid-item/grid-item.styles.d.ts.map +1 -1
- package/lib/components/header/header.js +17 -80
- package/lib/components/header/header.styles.d.ts.map +1 -1
- package/lib/components/heading/heading.js +16 -153
- package/lib/components/heading/heading.styles.d.ts.map +1 -1
- package/lib/components/hero/hero.js +17 -149
- package/lib/components/hero/hero.styles.d.ts.map +1 -1
- package/lib/components/icon/icon.js +1 -1
- package/lib/components/icon/icon.styles.d.ts.map +1 -1
- package/lib/components/inline-alert/inline-alert.js +53 -214
- package/lib/components/inline-alert/inline-alert.styles.d.ts.map +1 -1
- package/lib/components/layout/layout.js +20 -53
- package/lib/components/layout/layout.styles.d.ts.map +1 -1
- package/lib/components/layout-container/layout-container.js +20 -43
- package/lib/components/layout-container/layout-container.styles.d.ts.map +1 -1
- package/lib/components/layout-section/layout-section.js +20 -29
- package/lib/components/layout-section/layout-section.styles.d.ts.map +1 -1
- package/lib/components/linelength-container/linelength-container.js +7 -15
- package/lib/components/linelength-container/linelength-container.styles.d.ts.map +1 -1
- package/lib/components/link/link.js +33 -228
- package/lib/components/link/link.styles.d.ts.map +1 -1
- package/lib/components/link-list/link-list.js +23 -129
- package/lib/components/link-list/link-list.styles.d.ts.map +1 -1
- package/lib/components/link-list-item/link-list-item.js +19 -80
- package/lib/components/link-list-item/link-list-item.styles.d.ts.map +1 -1
- package/lib/components/list/list.js +17 -67
- package/lib/components/list/list.styles.d.ts.map +1 -1
- package/lib/components/list-item/list-item.js +11 -16
- package/lib/components/list-item/list-item.styles.d.ts.map +1 -1
- package/lib/components/loading-spinner/loading-spinner.js +13 -157
- package/lib/components/loading-spinner/loading-spinner.styles.d.ts.map +1 -1
- package/lib/components/logo/logo.js +20 -30
- package/lib/components/logo/logo.styles.d.ts.map +1 -1
- package/lib/components/main/main.js +18 -42
- package/lib/components/main/main.styles.d.ts.map +1 -1
- package/lib/components/modal/modal.js +50 -215
- package/lib/components/modal/modal.styles.d.ts.map +1 -1
- package/lib/components/multi-select/multi-select.js +71 -532
- package/lib/components/multi-select/multi-select.styles.d.ts.map +1 -1
- package/lib/components/nav-container/nav-container.js +5 -40
- package/lib/components/nav-container/nav-container.styles.d.ts.map +1 -1
- package/lib/components/page-header/page-header.js +19 -54
- package/lib/components/page-header/page-header.styles.d.ts.map +1 -1
- package/lib/components/pagination/page-counter/page-counter.styles.d.ts.map +1 -1
- package/lib/components/pagination/pagination.js +102 -183
- package/lib/components/pagination/pagination.styles.d.ts.map +1 -1
- package/lib/components/percent-bar/percent-bar.js +22 -50
- package/lib/components/percent-bar/percent-bar.styles.d.ts.map +1 -1
- package/lib/components/popover/popover.js +51 -220
- package/lib/components/popover/popover.styles.d.ts.map +1 -1
- package/lib/components/primary-nav/primary-nav.js +17 -51
- package/lib/components/primary-nav/primary-nav.styles.d.ts.map +1 -1
- package/lib/components/primary-nav-item/primary-nav-item.js +24 -191
- package/lib/components/primary-nav-item/primary-nav-item.styles.d.ts.map +1 -1
- package/lib/components/progress-meter/progress-meter.js +23 -127
- package/lib/components/progress-meter/progress-meter.styles.d.ts.map +1 -1
- package/lib/components/progress-steps/progress-steps.styles.d.ts.map +1 -1
- package/lib/components/progress-steps-item/progress-steps-item.js +27 -118
- package/lib/components/progress-steps-item/progress-steps-item.styles.d.ts.map +1 -1
- package/lib/components/radio-field/radio-field.js +28 -64
- package/lib/components/radio-field/radio-field.styles.d.ts.map +1 -1
- package/lib/components/radio-field-item/radio-field-item.js +54 -189
- package/lib/components/radio-field-item/radio-field-item.styles.d.ts.map +1 -1
- package/lib/components/remove-tag/remove-tag.js +36 -129
- package/lib/components/remove-tag/remove-tag.styles.d.ts.map +1 -1
- package/lib/components/section/section.js +19 -50
- package/lib/components/section/section.styles.d.ts.map +1 -1
- package/lib/components/select/select.js +43 -416
- package/lib/components/select/select.styles.d.ts.map +1 -1
- package/lib/components/select-tile/select-tile.js +18 -442
- package/lib/components/select-tile/select-tile.styles.d.ts.map +1 -1
- package/lib/components/select-tile-list/select-tile-list.js +24 -62
- package/lib/components/select-tile-list/select-tile-list.styles.d.ts.map +1 -1
- package/lib/components/skeleton-loader/skeleton-loader.js +19 -73
- package/lib/components/skeleton-loader/skeleton-loader.styles.d.ts.map +1 -1
- package/lib/components/split-button/split-button.js +21 -37
- package/lib/components/split-button/split-button.styles.d.ts.map +1 -1
- package/lib/components/submenu/submenu.js +8 -18
- package/lib/components/submenu/submenu.styles.d.ts.map +1 -1
- package/lib/components/submenu-item/submenu-item.js +21 -42
- package/lib/components/submenu-item/submenu-item.styles.d.ts.map +1 -1
- package/lib/components/tab/tab.js +17 -100
- package/lib/components/tab/tab.styles.d.ts.map +1 -1
- package/lib/components/tab-panel/tab-panel.js +18 -52
- package/lib/components/tab-panel/tab-panel.styles.d.ts.map +1 -1
- package/lib/components/table/table.js +21 -73
- package/lib/components/table/table.styles.d.ts.map +1 -1
- package/lib/components/table-body/table-body.js +12 -24
- package/lib/components/table-body/table-body.styles.d.ts.map +1 -1
- package/lib/components/table-cell/table-cell.js +29 -69
- package/lib/components/table-cell/table-cell.styles.d.ts.map +1 -1
- package/lib/components/table-header/table-header.js +8 -39
- package/lib/components/table-header/table-header.styles.d.ts.map +1 -1
- package/lib/components/table-header-cell/table-header-cell.js +18 -37
- package/lib/components/table-header-cell/table-header-cell.styles.d.ts.map +1 -1
- package/lib/components/table-object/table-object.js +13 -32
- package/lib/components/table-object/table-object.styles.d.ts.map +1 -1
- package/lib/components/table-row/table-row.js +33 -139
- package/lib/components/table-row/table-row.styles.d.ts.map +1 -1
- package/lib/components/tabs/tabs.js +24 -339
- package/lib/components/tabs/tabs.styles.d.ts.map +1 -1
- package/lib/components/tag/tag.js +44 -159
- package/lib/components/tag/tag.styles.d.ts.map +1 -1
- package/lib/components/tag-list/tag-list.js +20 -51
- package/lib/components/tag-list/tag-list.styles.d.ts.map +1 -1
- package/lib/components/tertiary-nav/tertiary-nav.js +21 -54
- package/lib/components/tertiary-nav/tertiary-nav.styles.d.ts.map +1 -1
- package/lib/components/tertiary-nav-item/tertiary-nav-item.js +18 -68
- package/lib/components/tertiary-nav-item/tertiary-nav-item.styles.d.ts.map +1 -1
- package/lib/components/text-link/text-link.js +20 -85
- package/lib/components/text-link/text-link.styles.d.ts.map +1 -1
- package/lib/components/text-passage/text-passage-light-dom.styles.d.ts.map +1 -1
- package/lib/components/text-passage/text-passage.js +17 -189
- package/lib/components/text-passage/text-passage.styles.d.ts.map +1 -1
- package/lib/components/tooltip/tooltip.js +57 -248
- package/lib/components/tooltip/tooltip.styles.d.ts.map +1 -1
- package/lib/components/utility-nav/utility-nav.js +23 -56
- package/lib/components/utility-nav/utility-nav.styles.d.ts.map +1 -1
- package/lib/components/utility-nav-item/utility-nav-item.js +28 -83
- package/lib/components/utility-nav-item/utility-nav-item.styles.d.ts.map +1 -1
- package/lib/design-tokens/brands/blue/css/tokens_blue.module.d.ts.map +1 -1
- package/lib/design-tokens/brands/bolt/tokens_bolt.theme.d.ts.map +1 -1
- package/lib/design-tokens/brands/cre8-a2ui/css/tokens_cre8-a2ui.module.d.ts +3 -0
- package/lib/design-tokens/brands/cre8-a2ui/css/tokens_cre8-a2ui.module.d.ts.map +1 -0
- package/lib/design-tokens/brands/cre8-legacy/css/tokens_cre8-legacy.module.d.ts.map +1 -1
- package/lib/design-tokens/brands/femmecubator/css/tokens_femmecubator2.module.d.ts.map +1 -1
- package/lib/design-tokens/brands/legacy/css/tokens_legacy.module.d.ts.map +1 -1
- package/lib/design-tokens/brands/marketing/css/tokens_marketing.module.d.ts.map +1 -1
- package/lib/design-tokens/brands/minimalist/css/tokens_minimalist.module.d.ts +2 -2
- package/lib/design-tokens/brands/minimalist/css/tokens_minimalist.module.d.ts.map +1 -1
- package/lib/design-tokens/brands/starbucks/tokens_starbucks.module.d.ts.map +1 -1
- package/lib/design-tokens/core/scss/theming/component.scss +5 -5
- package/lib/design-tokens/core/scss/theming/functions.scss +4 -0
- package/lib/design-tokens/core/scss/theming/spacing.scss +60 -60
- package/lib/design-tokens/core/scss/theming/variables.scss +11 -11
- package/lib/design-tokens/mixins/typography-usage.scss +277 -277
- package/lib/design-tokens/tokens_netflix.theme.d.ts.map +1 -1
- package/lib/{icon-DImqxDiW.js → icon-D22g8aWB.js} +35 -138
- package/lib/index.js +1 -1
- package/package.json +7 -6
|
@@ -1,213 +1,17 @@
|
|
|
1
|
-
import { css as v, html as s, nothing as
|
|
2
|
-
import { ifDefined as
|
|
3
|
-
import { state as l, property as
|
|
4
|
-
import { Cre8Field as
|
|
5
|
-
import { Cre8Element as
|
|
6
|
-
import "../../icon-
|
|
1
|
+
import { css as v, html as s, nothing as y } from "lit";
|
|
2
|
+
import { ifDefined as u } from "lit-html/directives/if-defined.js";
|
|
3
|
+
import { state as l, property as p, query as C } from "lit/decorators.js";
|
|
4
|
+
import { Cre8Field as R } from "../field/field.js";
|
|
5
|
+
import { Cre8Element as w } from "../cre8-element.js";
|
|
6
|
+
import "../../icon-D22g8aWB.js";
|
|
7
7
|
import "../button/button.js";
|
|
8
|
-
const F = v`@import '../../design-tokens/core/scss/theming/component';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
display: block;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Date Field Label
|
|
18
|
-
*/
|
|
19
|
-
.cre8-c-date-picker__label {
|
|
20
|
-
@include label-styles;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Date Field Body
|
|
25
|
-
* 1) The div that contains the input and icons
|
|
26
|
-
*/
|
|
27
|
-
.cre8-c-date-picker__body {
|
|
28
|
-
position: relative;
|
|
29
|
-
display: flex;
|
|
30
|
-
align-items: center;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Date Field Default Calendar Icon Button
|
|
35
|
-
* 1) Removes default calendar button and default calendar in Chrome
|
|
36
|
-
*/
|
|
37
|
-
input::-webkit-calendar-picker-indicator {
|
|
38
|
-
display: none;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
input[type="date"]::-webkit-input-placeholder {
|
|
42
|
-
visibility: hidden !important;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.cre8-c-date-picker__calendar-icon-button {
|
|
46
|
-
position: absolute;
|
|
47
|
-
right: calc(8px * 1);
|
|
48
|
-
background: var(--cre8-color-bg-default);
|
|
49
|
-
border: none;
|
|
50
|
-
border-radius: 0;
|
|
51
|
-
|
|
52
|
-
--cre8-icon-height: calc(8px * 3);
|
|
53
|
-
--cre8-icon-width: calc(8px * 3);
|
|
54
|
-
|
|
55
|
-
.cre8-c-date-picker--disabled &, .cre8-c-date-picker--read-only & {
|
|
56
|
-
background: var(--cre8-color-bg-disabled);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Date Field Input
|
|
62
|
-
* 1) The html5 input element
|
|
63
|
-
*/
|
|
64
|
-
.cre8-c-date-picker__input {
|
|
65
|
-
@include input-styles;
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Readonly input styles
|
|
69
|
-
*/
|
|
70
|
-
&:read-only {
|
|
71
|
-
background-color: var(--cre8-color-bg-disabled);
|
|
72
|
-
border-color: var(--cre8-color-border-disabled);
|
|
73
|
-
cursor: default;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
`, O = v`@import '../../design-tokens/core/scss/theming/component';
|
|
77
|
-
|
|
78
|
-
.cre8-c-calendar {
|
|
79
|
-
min-width: 340px; // this is the width of a calendar with the longest character month (September)
|
|
80
|
-
border: var(--cre8-color-border-strong);
|
|
81
|
-
border-radius: var(--cre8-border-radius-default);
|
|
82
|
-
border-width: var(--cre8-border-width-default);
|
|
83
|
-
border-style: var(--cre8-border-style-default);
|
|
84
|
-
margin-top: calc(8px * 0.5);
|
|
85
|
-
background-color: var(--cre8-color-bg-default);
|
|
86
|
-
position: absolute;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/* shortcuts */
|
|
90
|
-
.cre8-c-calendar__header-shortcuts {
|
|
91
|
-
display: inline-flex;
|
|
92
|
-
justify-content: center;
|
|
93
|
-
width: 100%;
|
|
94
|
-
padding-top: calc(8px * 2);
|
|
95
|
-
padding-bottom: calc(8px * 1);
|
|
96
|
-
|
|
97
|
-
cre8-button + cre8-button {
|
|
98
|
-
padding-left: calc(8px * 1);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
cre8-button {
|
|
102
|
-
max-height: 32px;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
table {
|
|
107
|
-
width: 100%;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
/* table row */
|
|
111
|
-
tr {
|
|
112
|
-
@include cre8-typography-body-default();
|
|
113
|
-
display: grid;
|
|
114
|
-
grid-row-gap: 0.33em;
|
|
115
|
-
grid-template-columns: repeat(7, 1fr);
|
|
116
|
-
list-style: none;
|
|
117
|
-
margin: unset;
|
|
118
|
-
padding: unset;
|
|
119
|
-
position: relative;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/* day wrappers */
|
|
123
|
-
td {
|
|
124
|
-
align-items: center;
|
|
125
|
-
display: flex;
|
|
126
|
-
height: 48px;
|
|
127
|
-
justify-content: center;
|
|
128
|
-
width: 48px;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
/* days */
|
|
132
|
-
.cre8-c-calendar :is(thead, tbody) :is(span, button) {
|
|
133
|
-
@include cre8-typography-body-default();
|
|
134
|
-
align-items: center;
|
|
135
|
-
block-size: 2em;
|
|
136
|
-
border-radius: var(--cre8-border-radius-brand);
|
|
137
|
-
display: flex;
|
|
138
|
-
inline-size: 2em;
|
|
139
|
-
justify-content: center;
|
|
140
|
-
margin-block: var(0, 0 0.33em);
|
|
141
|
-
user-select: none;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
/* day buttons */
|
|
145
|
-
.cre8-c-calendar__day-button {
|
|
146
|
-
border: none;
|
|
147
|
-
background: none;
|
|
148
|
-
margin: 0;
|
|
149
|
-
padding: 0;
|
|
150
|
-
|
|
151
|
-
&:hover,
|
|
152
|
-
&:focus {
|
|
153
|
-
background: var(--cre8-color-bg-default-hover);
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
&.cre8-c-calendar__different-month {
|
|
157
|
-
color: var(--cre8-color-content-subtle);
|
|
158
|
-
|
|
159
|
-
&:hover,
|
|
160
|
-
&:focus {
|
|
161
|
-
background: var(--cre8-color-bg-subtle);
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
&[data-today] {
|
|
166
|
-
color: var(--cre8-color-content-brand);
|
|
167
|
-
border-color: var(--cre8-color-border-brand);
|
|
168
|
-
border-width: var(--cre8-border-width-default);
|
|
169
|
-
border-style: var(--cre8-border-style-default);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
&[data-selected] {
|
|
173
|
-
background: var(--cre8-color-bg-brand-strong);
|
|
174
|
-
color: var(--cre8-color-content-knockout);
|
|
175
|
-
|
|
176
|
-
&:hover,
|
|
177
|
-
&:focus {
|
|
178
|
-
background: var(--cre8-color-bg-brand-strong-hover);
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
`, E = v`@import '../../design-tokens/core/scss/theming/component';
|
|
184
|
-
|
|
185
|
-
.cre8-c-calendar-month-modal {
|
|
186
|
-
padding: calc(8px * 1);
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
/* grid */
|
|
190
|
-
ol {
|
|
191
|
-
@include cre8-typography-body-default();
|
|
192
|
-
display: grid;
|
|
193
|
-
grid-row-gap: 0.33em;
|
|
194
|
-
grid-template-columns: repeat(3, 1fr);
|
|
195
|
-
list-style: none;
|
|
196
|
-
margin: unset;
|
|
197
|
-
padding: unset;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
li {
|
|
201
|
-
display: inline-flex;
|
|
202
|
-
justify-content: center;
|
|
203
|
-
}
|
|
204
|
-
`;
|
|
205
|
-
var A = Object.defineProperty, Y = (c, t, e, r) => {
|
|
206
|
-
for (var a = void 0, n = c.length - 1, i; n >= 0; n--)
|
|
207
|
-
(i = c[n]) && (a = i(t, e, a) || a);
|
|
208
|
-
return a && A(t, e, a), a;
|
|
8
|
+
const I = v`*,::slotted(*),*:before,*:after{box-sizing:border-box}:root{--size-base-unit: 0.5rem}[dir=rtl]{--rtlTranslateX: 50%;--rtlGradientToRight: 270deg;--rtlRotate45Inverse: -45deg}:host{--cre8-z-index-1: 1;--cre8-z-index-50: 50;--cre8-z-index-100: 100;--cre8-z-index-200: 200;--cre8-z-index-1030: 1030;--cre8-anim-fade-quick: 0.35s;--cre8-anim-ease: ease}@keyframes fadeIn{100%{opacity:1}}@keyframes slideIn{100%{transform:translateX(0)}}@keyframes slideInFwd{100%{width:272px;height:272px}}@keyframes slideOutRight{100%{width:272px;height:272px}}@keyframes slideUp{100%{transform:translateY(0)}}@media(width >= 481px){@keyframes slideInFwd{100%{width:417px;height:417px}}@keyframes slideOutRight{100%{width:417px;height:417px}}}@media(width >= 48rem){@keyframes slideInFwd{100%{width:330px;height:330px}}@keyframes slideOutRight{100%{width:330px;height:330px;transform:translateX(calc(100vw - 45px))}}}@media(width >= 60rem){@keyframes slideInFwd{100%{width:460px;height:460px}}@keyframes slideOutRight{100%{width:460px;height:460px;transform:translateX(calc(100vw - 45px))}}}@media(width >= 75rem){@keyframes slideInFwd{100%{width:592px;height:591px}}@keyframes slideOutRight{100%{width:592px;height:591px;transform:translateX(calc(100vw - 45px))}}}@media(width >= 87.5rem){@keyframes slideOutRight{100%{width:592px;height:591px;transform:translateX(calc(100vw - 120px))}}}@media(width >= 2200px){@keyframes slideOutRight{100%{width:592px;height:591px;transform:translateX(calc(100vw - 592px))}}}span.ripple{position:absolute;border-radius:50%;transform:scale(0);animation:ripple 600ms linear;background-color:var(--ripple-bg-color)}@keyframes ripple{to{transform:scale(4);opacity:1}}:root{--size-base-unit: 0.5rem}[dir=rtl]{--rtlTranslateX: 50%;--rtlGradientToRight: 270deg;--rtlRotate45Inverse: -45deg}:host{display:block}.cre8-c-date-picker__label{font-family:var(--cre8-typography-label-small-font-family);font-size:var(--cre8-typography-label-small-font-size);font-weight:var(--cre8-typography-label-small-font-weight);line-height:var(--cre8-typography-label-small-line-height);text-decoration:var(--cre8-typography-label-small-text-decoration);text-transform:var(--cre8-typography-label-small-text-transform);display:block;margin-bottom:0.5rem}.cre8-c-date-picker__body{position:relative;display:flex;align-items:center}input::-webkit-calendar-picker-indicator{display:none}input[type=date]::-webkit-input-placeholder{visibility:hidden !important}.cre8-c-date-picker__calendar-icon-button{position:absolute;right:0.5rem;background:var(--cre8-color-bg-default);border:none;border-radius:0;--cre8-icon-height: size(3);--cre8-icon-width: size(3)}.cre8-c-date-picker--disabled .cre8-c-date-picker__calendar-icon-button,.cre8-c-date-picker--read-only .cre8-c-date-picker__calendar-icon-button{background:var(--cre8-color-bg-disabled)}.cre8-c-date-picker__input{font-family:var(--cre8-typography-body-default-font-family);font-size:var(--cre8-typography-body-default-font-size);font-weight:var(--cre8-typography-body-default-font-weight);line-height:var(--cre8-typography-body-default-line-height);text-decoration:var(--cre8-typography-body-default-text-decoration);text-transform:var(--cre8-typography-body-default-text-transform);outline:var(--cre8-border-width-focus) solid rgba(0,0,0,0);outline-offset:0.125rem;-webkit-appearance:none;width:100%;border-width:var(--cre8-border-width-default);border-style:solid;border-color:var(--cre8-color-border-strong);border-radius:var(--cre8-border-radius-default);padding:0.75rem 0.5rem;color:var(--cre8-color-content-default);background-color:var(--cre8-color-bg-default);transition:outline-color var(--cre8-anim-fade-quick) var(--cre8-anim-ease),border-color var(--cre8-anim-fade-quick) var(--cre8-anim-ease),background-color var(--cre8-anim-fade-quick) var(--cre8-anim-ease),color var(--cre8-anim-fade-quick) var(--cre8-anim-ease)}.cre8-c-date-picker__input:hover:not(:disabled),.cre8-c-date-picker__input:focus:not(:disabled),.cre8-c-date-picker__input:active:not(:disabled),.cre8-c-date-picker__input:focus-visible{outline:var(--cre8-border-width-focus) solid var(--cre8-color-border-active-outline);outline-offset:0.125rem}.cre8-is-error .cre8-c-date-picker__input:hover:not(:disabled),.cre8-is-error .cre8-c-date-picker__input:focus:not(:disabled),.cre8-is-error .cre8-c-date-picker__input:active:not(:disabled),.cre8-is-error .cre8-c-date-picker__input:focus-visible{outline-color:var(--cre8-color-border-error)}.cre8-is-success .cre8-c-date-picker__input:hover:not(:disabled),.cre8-is-success .cre8-c-date-picker__input:focus:not(:disabled),.cre8-is-success .cre8-c-date-picker__input:active:not(:disabled),.cre8-is-success .cre8-c-date-picker__input:focus-visible{outline-color:var(--cre8-color-border-success)}.cre8-c-date-picker__input:disabled{background-color:var(--cre8-color-bg-disabled);border-color:var(--cre8-color-border-disabled);color:var(--cre8-color-content-disabled);cursor:not-allowed}.cre8-c-date-picker__input:disabled::placeholder{color:var(--cre8-color-content-disabled)}.cre8-c-date-picker__input::placeholder{color:var(--cre8-color-content-subtle)}.cre8-is-error .cre8-c-date-picker__input{border-color:var(--cre8-color-border-error)}.cre8-is-success .cre8-c-date-picker__input{border-color:var(--cre8-color-border-success)}.cre8-c-date-picker__input:read-only{background-color:var(--cre8-color-bg-disabled);border-color:var(--cre8-color-border-disabled);cursor:default}`, z = v`*,::slotted(*),*:before,*:after{box-sizing:border-box}:root{--size-base-unit: 0.5rem}[dir=rtl]{--rtlTranslateX: 50%;--rtlGradientToRight: 270deg;--rtlRotate45Inverse: -45deg}:host{--cre8-z-index-1: 1;--cre8-z-index-50: 50;--cre8-z-index-100: 100;--cre8-z-index-200: 200;--cre8-z-index-1030: 1030;--cre8-anim-fade-quick: 0.35s;--cre8-anim-ease: ease}@keyframes fadeIn{100%{opacity:1}}@keyframes slideIn{100%{transform:translateX(0)}}@keyframes slideInFwd{100%{width:272px;height:272px}}@keyframes slideOutRight{100%{width:272px;height:272px}}@keyframes slideUp{100%{transform:translateY(0)}}@media(width >= 481px){@keyframes slideInFwd{100%{width:417px;height:417px}}@keyframes slideOutRight{100%{width:417px;height:417px}}}@media(width >= 48rem){@keyframes slideInFwd{100%{width:330px;height:330px}}@keyframes slideOutRight{100%{width:330px;height:330px;transform:translateX(calc(100vw - 45px))}}}@media(width >= 60rem){@keyframes slideInFwd{100%{width:460px;height:460px}}@keyframes slideOutRight{100%{width:460px;height:460px;transform:translateX(calc(100vw - 45px))}}}@media(width >= 75rem){@keyframes slideInFwd{100%{width:592px;height:591px}}@keyframes slideOutRight{100%{width:592px;height:591px;transform:translateX(calc(100vw - 45px))}}}@media(width >= 87.5rem){@keyframes slideOutRight{100%{width:592px;height:591px;transform:translateX(calc(100vw - 120px))}}}@media(width >= 2200px){@keyframes slideOutRight{100%{width:592px;height:591px;transform:translateX(calc(100vw - 592px))}}}span.ripple{position:absolute;border-radius:50%;transform:scale(0);animation:ripple 600ms linear;background-color:var(--ripple-bg-color)}@keyframes ripple{to{transform:scale(4);opacity:1}}:root{--size-base-unit: 0.5rem}[dir=rtl]{--rtlTranslateX: 50%;--rtlGradientToRight: 270deg;--rtlRotate45Inverse: -45deg}.cre8-c-calendar{min-width:340px;border:var(--cre8-color-border-strong);border-radius:var(--cre8-border-radius-default);border-width:var(--cre8-border-width-default);border-style:var(--cre8-border-style-default);margin-top:0.25rem;background-color:var(--cre8-color-bg-default);position:absolute}.cre8-c-calendar__header-shortcuts{display:inline-flex;justify-content:center;width:100%;padding-top:1rem;padding-bottom:0.5rem}.cre8-c-calendar__header-shortcuts cre8-button+cre8-button{padding-left:0.5rem}.cre8-c-calendar__header-shortcuts cre8-button{max-height:32px}table{width:100%}tr{font-family:var(--cre8-typography-body-default-font-family);font-size:var(--cre8-typography-body-default-font-size);font-weight:var(--cre8-typography-body-default-font-weight);line-height:var(--cre8-typography-body-default-line-height);text-decoration:var(--cre8-typography-body-default-text-decoration);text-transform:var(--cre8-typography-body-default-text-transform);display:grid;grid-row-gap:.33em;grid-template-columns:repeat(7, 1fr);list-style:none;margin:unset;padding:unset;position:relative}td{align-items:center;display:flex;height:48px;justify-content:center;width:48px}.cre8-c-calendar :is(thead,tbody) :is(span,button){font-family:var(--cre8-typography-body-default-font-family);font-size:var(--cre8-typography-body-default-font-size);font-weight:var(--cre8-typography-body-default-font-weight);line-height:var(--cre8-typography-body-default-line-height);text-decoration:var(--cre8-typography-body-default-text-decoration);text-transform:var(--cre8-typography-body-default-text-transform);align-items:center;block-size:2em;border-radius:var(--cre8-border-radius-brand);display:flex;inline-size:2em;justify-content:center;margin-block:var(0, 0 0.33em);user-select:none}.cre8-c-calendar__day-button{border:none;background:none;margin:0;padding:0}.cre8-c-calendar__day-button:hover,.cre8-c-calendar__day-button:focus{background:var(--cre8-color-bg-default-hover)}.cre8-c-calendar__day-button.cre8-c-calendar__different-month{color:var(--cre8-color-content-subtle)}.cre8-c-calendar__day-button.cre8-c-calendar__different-month:hover,.cre8-c-calendar__day-button.cre8-c-calendar__different-month:focus{background:var(--cre8-color-bg-subtle)}.cre8-c-calendar__day-button[data-today]{color:var(--cre8-color-content-brand);border-color:var(--cre8-color-border-brand);border-width:var(--cre8-border-width-default);border-style:var(--cre8-border-style-default)}.cre8-c-calendar__day-button[data-selected]{background:var(--cre8-color-bg-brand-strong);color:var(--cre8-color-content-knockout)}.cre8-c-calendar__day-button[data-selected]:hover,.cre8-c-calendar__day-button[data-selected]:focus{background:var(--cre8-color-bg-brand-strong-hover)}`, F = v`*,::slotted(*),*:before,*:after{box-sizing:border-box}:root{--size-base-unit: 0.5rem}[dir=rtl]{--rtlTranslateX: 50%;--rtlGradientToRight: 270deg;--rtlRotate45Inverse: -45deg}:host{--cre8-z-index-1: 1;--cre8-z-index-50: 50;--cre8-z-index-100: 100;--cre8-z-index-200: 200;--cre8-z-index-1030: 1030;--cre8-anim-fade-quick: 0.35s;--cre8-anim-ease: ease}@keyframes fadeIn{100%{opacity:1}}@keyframes slideIn{100%{transform:translateX(0)}}@keyframes slideInFwd{100%{width:272px;height:272px}}@keyframes slideOutRight{100%{width:272px;height:272px}}@keyframes slideUp{100%{transform:translateY(0)}}@media(width >= 481px){@keyframes slideInFwd{100%{width:417px;height:417px}}@keyframes slideOutRight{100%{width:417px;height:417px}}}@media(width >= 48rem){@keyframes slideInFwd{100%{width:330px;height:330px}}@keyframes slideOutRight{100%{width:330px;height:330px;transform:translateX(calc(100vw - 45px))}}}@media(width >= 60rem){@keyframes slideInFwd{100%{width:460px;height:460px}}@keyframes slideOutRight{100%{width:460px;height:460px;transform:translateX(calc(100vw - 45px))}}}@media(width >= 75rem){@keyframes slideInFwd{100%{width:592px;height:591px}}@keyframes slideOutRight{100%{width:592px;height:591px;transform:translateX(calc(100vw - 45px))}}}@media(width >= 87.5rem){@keyframes slideOutRight{100%{width:592px;height:591px;transform:translateX(calc(100vw - 120px))}}}@media(width >= 2200px){@keyframes slideOutRight{100%{width:592px;height:591px;transform:translateX(calc(100vw - 592px))}}}span.ripple{position:absolute;border-radius:50%;transform:scale(0);animation:ripple 600ms linear;background-color:var(--ripple-bg-color)}@keyframes ripple{to{transform:scale(4);opacity:1}}:root{--size-base-unit: 0.5rem}[dir=rtl]{--rtlTranslateX: 50%;--rtlGradientToRight: 270deg;--rtlRotate45Inverse: -45deg}.cre8-c-calendar-month-modal{padding:0.5rem}ol{font-family:var(--cre8-typography-body-default-font-family);font-size:var(--cre8-typography-body-default-font-size);font-weight:var(--cre8-typography-body-default-font-weight);line-height:var(--cre8-typography-body-default-line-height);text-decoration:var(--cre8-typography-body-default-text-decoration);text-transform:var(--cre8-typography-body-default-text-transform);display:grid;grid-row-gap:.33em;grid-template-columns:repeat(3, 1fr);list-style:none;margin:unset;padding:unset}li{display:inline-flex;justify-content:center}`;
|
|
9
|
+
var S = Object.defineProperty, O = (d, e, t, a) => {
|
|
10
|
+
for (var r = void 0, i = d.length - 1, n; i >= 0; i--)
|
|
11
|
+
(n = d[i]) && (r = n(e, t, r) || r);
|
|
12
|
+
return r && S(e, t, r), r;
|
|
209
13
|
};
|
|
210
|
-
const
|
|
14
|
+
const _ = class _ extends w {
|
|
211
15
|
constructor() {
|
|
212
16
|
super(), this.monthNames = [
|
|
213
17
|
"January",
|
|
@@ -232,107 +36,79 @@ const k = class k extends D {
|
|
|
232
36
|
"li[data-current-month]"
|
|
233
37
|
).children[0].shadowRoot?.querySelector("button")).focus();
|
|
234
38
|
}
|
|
235
|
-
emitMonth(
|
|
236
|
-
const
|
|
39
|
+
emitMonth(e) {
|
|
40
|
+
const t = new CustomEvent("changeMonth", {
|
|
237
41
|
detail: {
|
|
238
|
-
month:
|
|
42
|
+
month: e
|
|
239
43
|
}
|
|
240
44
|
});
|
|
241
|
-
this.dispatchEvent(
|
|
45
|
+
this.dispatchEvent(t);
|
|
242
46
|
}
|
|
243
47
|
getMonthListItems() {
|
|
244
48
|
return this.monthNames.map(
|
|
245
|
-
(
|
|
246
|
-
<cre8-button text="${
|
|
247
|
-
@click="${() => this.emitMonth(
|
|
49
|
+
(e, t) => s` <li ?data-current-month="${t === this.currentMonth}" >
|
|
50
|
+
<cre8-button text="${e}" variant="tertiary" size="sm"
|
|
51
|
+
@click="${() => this.emitMonth(t)}"></cre8-button>
|
|
248
52
|
</li>`
|
|
249
53
|
);
|
|
250
54
|
}
|
|
251
55
|
render() {
|
|
252
|
-
const
|
|
253
|
-
return s` <div class="${
|
|
56
|
+
const e = this.componentClassNames("cre8-c-calendar-month-modal", {});
|
|
57
|
+
return s` <div class="${e}">
|
|
254
58
|
<ol aria-label="choose a month">
|
|
255
59
|
${this.getMonthListItems()}
|
|
256
60
|
</ol>
|
|
257
61
|
</div> `;
|
|
258
62
|
}
|
|
259
63
|
};
|
|
260
|
-
|
|
261
|
-
let
|
|
262
|
-
|
|
64
|
+
_.styles = [F];
|
|
65
|
+
let f = _;
|
|
66
|
+
O([
|
|
263
67
|
l()
|
|
264
|
-
],
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
],
|
|
268
|
-
customElements.get("cre8-calendar-month-modal") === void 0 && customElements.define("cre8-calendar-month-modal",
|
|
269
|
-
const
|
|
270
|
-
|
|
271
|
-
.
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
align-items: center;
|
|
275
|
-
padding: calc(8px * 1);
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
/* grid */
|
|
279
|
-
ol {
|
|
280
|
-
@include cre8-typography-body-default();
|
|
281
|
-
display: grid;
|
|
282
|
-
grid-row-gap: 0.33em;
|
|
283
|
-
grid-template-columns: repeat(3, 1fr);
|
|
284
|
-
list-style: none;
|
|
285
|
-
margin: unset;
|
|
286
|
-
padding: unset;
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
li {
|
|
290
|
-
display: inline-flex;
|
|
291
|
-
justify-content: center;
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
cre8-button {
|
|
295
|
-
height: fit-content;
|
|
296
|
-
}
|
|
297
|
-
`;
|
|
298
|
-
var P = Object.defineProperty, q = Object.getOwnPropertyDescriptor, w = (c, t, e, r) => {
|
|
299
|
-
for (var a = r > 1 ? void 0 : r ? q(t, e) : t, n = c.length - 1, i; n >= 0; n--)
|
|
300
|
-
(i = c[n]) && (a = (r ? i(t, e, a) : i(a)) || a);
|
|
301
|
-
return r && a && P(t, e, a), a;
|
|
68
|
+
], f.prototype, "monthNames");
|
|
69
|
+
O([
|
|
70
|
+
p({ reflect: !0, type: Number })
|
|
71
|
+
], f.prototype, "currentMonth");
|
|
72
|
+
customElements.get("cre8-calendar-month-modal") === void 0 && customElements.define("cre8-calendar-month-modal", f);
|
|
73
|
+
const N = v`*,::slotted(*),*:before,*:after{box-sizing:border-box}:root{--size-base-unit: 0.5rem}[dir=rtl]{--rtlTranslateX: 50%;--rtlGradientToRight: 270deg;--rtlRotate45Inverse: -45deg}:host{--cre8-z-index-1: 1;--cre8-z-index-50: 50;--cre8-z-index-100: 100;--cre8-z-index-200: 200;--cre8-z-index-1030: 1030;--cre8-anim-fade-quick: 0.35s;--cre8-anim-ease: ease}@keyframes fadeIn{100%{opacity:1}}@keyframes slideIn{100%{transform:translateX(0)}}@keyframes slideInFwd{100%{width:272px;height:272px}}@keyframes slideOutRight{100%{width:272px;height:272px}}@keyframes slideUp{100%{transform:translateY(0)}}@media(width >= 481px){@keyframes slideInFwd{100%{width:417px;height:417px}}@keyframes slideOutRight{100%{width:417px;height:417px}}}@media(width >= 48rem){@keyframes slideInFwd{100%{width:330px;height:330px}}@keyframes slideOutRight{100%{width:330px;height:330px;transform:translateX(calc(100vw - 45px))}}}@media(width >= 60rem){@keyframes slideInFwd{100%{width:460px;height:460px}}@keyframes slideOutRight{100%{width:460px;height:460px;transform:translateX(calc(100vw - 45px))}}}@media(width >= 75rem){@keyframes slideInFwd{100%{width:592px;height:591px}}@keyframes slideOutRight{100%{width:592px;height:591px;transform:translateX(calc(100vw - 45px))}}}@media(width >= 87.5rem){@keyframes slideOutRight{100%{width:592px;height:591px;transform:translateX(calc(100vw - 120px))}}}@media(width >= 2200px){@keyframes slideOutRight{100%{width:592px;height:591px;transform:translateX(calc(100vw - 592px))}}}span.ripple{position:absolute;border-radius:50%;transform:scale(0);animation:ripple 600ms linear;background-color:var(--ripple-bg-color)}@keyframes ripple{to{transform:scale(4);opacity:1}}:root{--size-base-unit: 0.5rem}[dir=rtl]{--rtlTranslateX: 50%;--rtlGradientToRight: 270deg;--rtlRotate45Inverse: -45deg}.cre8-c-calendar-year-modal{display:flex;justify-content:space-around;align-items:center;padding:0.5rem}ol{font-family:var(--cre8-typography-body-default-font-family);font-size:var(--cre8-typography-body-default-font-size);font-weight:var(--cre8-typography-body-default-font-weight);line-height:var(--cre8-typography-body-default-line-height);text-decoration:var(--cre8-typography-body-default-text-decoration);text-transform:var(--cre8-typography-body-default-text-transform);display:grid;grid-row-gap:.33em;grid-template-columns:repeat(3, 1fr);list-style:none;margin:unset;padding:unset}li{display:inline-flex;justify-content:center}cre8-button{height:fit-content}`;
|
|
74
|
+
var X = Object.defineProperty, E = Object.getOwnPropertyDescriptor, x = (d, e, t, a) => {
|
|
75
|
+
for (var r = a > 1 ? void 0 : a ? E(e, t) : e, i = d.length - 1, n; i >= 0; i--)
|
|
76
|
+
(n = d[i]) && (r = (a ? n(e, t, r) : n(r)) || r);
|
|
77
|
+
return a && r && X(e, t, r), r;
|
|
302
78
|
};
|
|
303
|
-
const
|
|
79
|
+
const D = class D extends w {
|
|
304
80
|
get currentYear() {
|
|
305
81
|
return this._currentYear;
|
|
306
82
|
}
|
|
307
|
-
set currentYear(
|
|
308
|
-
const
|
|
309
|
-
this._currentYear =
|
|
83
|
+
set currentYear(e) {
|
|
84
|
+
const t = this._currentYear;
|
|
85
|
+
this._currentYear = e, this.modalAnchorYear = e, this.requestUpdate("currentDate", t), this.createYearArray(this.currentYear);
|
|
310
86
|
}
|
|
311
87
|
constructor() {
|
|
312
88
|
super(), this.yearNumbers = [];
|
|
313
89
|
}
|
|
314
|
-
emitYear(
|
|
315
|
-
const
|
|
90
|
+
emitYear(e) {
|
|
91
|
+
const t = new CustomEvent("changeYear", {
|
|
316
92
|
detail: {
|
|
317
|
-
year:
|
|
93
|
+
year: e
|
|
318
94
|
}
|
|
319
95
|
});
|
|
320
|
-
this.dispatchEvent(
|
|
96
|
+
this.dispatchEvent(t);
|
|
321
97
|
}
|
|
322
|
-
createYearArray(
|
|
323
|
-
const
|
|
324
|
-
this.yearNumbers =
|
|
98
|
+
createYearArray(e) {
|
|
99
|
+
const t = Array.from(Array(12).keys());
|
|
100
|
+
this.yearNumbers = t.map((a) => a + (e - 7));
|
|
325
101
|
}
|
|
326
102
|
getYearListItems() {
|
|
327
103
|
return this.yearNumbers.map(
|
|
328
|
-
((
|
|
329
|
-
?data-current-year="${
|
|
104
|
+
((e) => s` <li
|
|
105
|
+
?data-current-year="${e === this.currentYear}"
|
|
330
106
|
>
|
|
331
107
|
<cre8-button
|
|
332
|
-
text="${
|
|
108
|
+
text="${e}"
|
|
333
109
|
variant="tertiary"
|
|
334
110
|
size="sm"
|
|
335
|
-
@click="${() => this.emitYear(
|
|
111
|
+
@click="${() => this.emitYear(e)}"
|
|
336
112
|
></cre8-button>
|
|
337
113
|
</li>`)
|
|
338
114
|
);
|
|
@@ -352,12 +128,12 @@ const M = class M extends D {
|
|
|
352
128
|
this.modalAnchorYear += 12, this.createYearArray(this.modalAnchorYear);
|
|
353
129
|
}
|
|
354
130
|
render() {
|
|
355
|
-
const
|
|
131
|
+
const e = this.componentClassNames(
|
|
356
132
|
"cre8-c-calendar-year-modal",
|
|
357
133
|
{}
|
|
358
134
|
);
|
|
359
135
|
return s`
|
|
360
|
-
<div class="${
|
|
136
|
+
<div class="${e}">
|
|
361
137
|
<cre8-button
|
|
362
138
|
class="cre8-c-calendar-year-modal__nav-button"
|
|
363
139
|
@click="${this.previousYearArray}"
|
|
@@ -381,72 +157,59 @@ const M = class M extends D {
|
|
|
381
157
|
`;
|
|
382
158
|
}
|
|
383
159
|
};
|
|
384
|
-
|
|
385
|
-
let
|
|
386
|
-
|
|
160
|
+
D.styles = [N];
|
|
161
|
+
let m = D;
|
|
162
|
+
x([
|
|
387
163
|
l()
|
|
388
|
-
],
|
|
389
|
-
|
|
164
|
+
], m.prototype, "yearNumbers", 2);
|
|
165
|
+
x([
|
|
390
166
|
l()
|
|
391
|
-
],
|
|
392
|
-
|
|
167
|
+
], m.prototype, "_currentYear", 2);
|
|
168
|
+
x([
|
|
393
169
|
l()
|
|
394
|
-
],
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
],
|
|
398
|
-
customElements.get("cre8-calendar-year-modal") === void 0 && customElements.define("cre8-calendar-year-modal",
|
|
399
|
-
const
|
|
400
|
-
|
|
401
|
-
.
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
height: 60px;
|
|
405
|
-
justify-content: center;
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
.cre8-c-calendar-navigation__inner-buttons {
|
|
409
|
-
display: flex;
|
|
410
|
-
min-width: 188px;
|
|
411
|
-
justify-content: space-around;
|
|
412
|
-
}`;
|
|
413
|
-
var B = Object.defineProperty, S = (c, t, e, r) => {
|
|
414
|
-
for (var a = void 0, n = c.length - 1, i; n >= 0; n--)
|
|
415
|
-
(i = c[n]) && (a = i(t, e, a) || a);
|
|
416
|
-
return a && B(t, e, a), a;
|
|
170
|
+
], m.prototype, "modalAnchorYear", 2);
|
|
171
|
+
x([
|
|
172
|
+
p({ reflect: !0, type: Number })
|
|
173
|
+
], m.prototype, "currentYear", 1);
|
|
174
|
+
customElements.get("cre8-calendar-year-modal") === void 0 && customElements.define("cre8-calendar-year-modal", m);
|
|
175
|
+
const A = v`*,::slotted(*),*:before,*:after{box-sizing:border-box}:root{--size-base-unit: 0.5rem}[dir=rtl]{--rtlTranslateX: 50%;--rtlGradientToRight: 270deg;--rtlRotate45Inverse: -45deg}:host{--cre8-z-index-1: 1;--cre8-z-index-50: 50;--cre8-z-index-100: 100;--cre8-z-index-200: 200;--cre8-z-index-1030: 1030;--cre8-anim-fade-quick: 0.35s;--cre8-anim-ease: ease}@keyframes fadeIn{100%{opacity:1}}@keyframes slideIn{100%{transform:translateX(0)}}@keyframes slideInFwd{100%{width:272px;height:272px}}@keyframes slideOutRight{100%{width:272px;height:272px}}@keyframes slideUp{100%{transform:translateY(0)}}@media(width >= 481px){@keyframes slideInFwd{100%{width:417px;height:417px}}@keyframes slideOutRight{100%{width:417px;height:417px}}}@media(width >= 48rem){@keyframes slideInFwd{100%{width:330px;height:330px}}@keyframes slideOutRight{100%{width:330px;height:330px;transform:translateX(calc(100vw - 45px))}}}@media(width >= 60rem){@keyframes slideInFwd{100%{width:460px;height:460px}}@keyframes slideOutRight{100%{width:460px;height:460px;transform:translateX(calc(100vw - 45px))}}}@media(width >= 75rem){@keyframes slideInFwd{100%{width:592px;height:591px}}@keyframes slideOutRight{100%{width:592px;height:591px;transform:translateX(calc(100vw - 45px))}}}@media(width >= 87.5rem){@keyframes slideOutRight{100%{width:592px;height:591px;transform:translateX(calc(100vw - 120px))}}}@media(width >= 2200px){@keyframes slideOutRight{100%{width:592px;height:591px;transform:translateX(calc(100vw - 592px))}}}span.ripple{position:absolute;border-radius:50%;transform:scale(0);animation:ripple 600ms linear;background-color:var(--ripple-bg-color)}@keyframes ripple{to{transform:scale(4);opacity:1}}:root{--size-base-unit: 0.5rem}[dir=rtl]{--rtlTranslateX: 50%;--rtlGradientToRight: 270deg;--rtlRotate45Inverse: -45deg}.cre8-c-calendar-navigation{align-items:center;display:flex;height:60px;justify-content:center}.cre8-c-calendar-navigation__inner-buttons{display:flex;min-width:188px;justify-content:space-around}`;
|
|
176
|
+
var q = Object.defineProperty, T = (d, e, t, a) => {
|
|
177
|
+
for (var r = void 0, i = d.length - 1, n; i >= 0; i--)
|
|
178
|
+
(n = d[i]) && (r = n(e, t, r) || r);
|
|
179
|
+
return r && q(e, t, r), r;
|
|
417
180
|
};
|
|
418
|
-
const
|
|
419
|
-
activateModal(
|
|
420
|
-
const
|
|
181
|
+
const $ = class $ extends w {
|
|
182
|
+
activateModal(e) {
|
|
183
|
+
const t = new CustomEvent("activateModal", {
|
|
421
184
|
detail: {
|
|
422
|
-
modal:
|
|
185
|
+
modal: e
|
|
423
186
|
}
|
|
424
187
|
});
|
|
425
|
-
this.dispatchEvent(
|
|
188
|
+
this.dispatchEvent(t);
|
|
426
189
|
}
|
|
427
|
-
changeMonth(
|
|
428
|
-
const
|
|
190
|
+
changeMonth(e) {
|
|
191
|
+
const t = new CustomEvent("changeMonth", {
|
|
429
192
|
detail: {
|
|
430
|
-
addend:
|
|
193
|
+
addend: e
|
|
431
194
|
}
|
|
432
195
|
});
|
|
433
|
-
this.dispatchEvent(
|
|
196
|
+
this.dispatchEvent(t);
|
|
434
197
|
}
|
|
435
|
-
changeYear(
|
|
436
|
-
const
|
|
198
|
+
changeYear(e) {
|
|
199
|
+
const t = new CustomEvent("changeYear", {
|
|
437
200
|
detail: {
|
|
438
|
-
addend:
|
|
201
|
+
addend: e
|
|
439
202
|
}
|
|
440
203
|
});
|
|
441
|
-
this.dispatchEvent(
|
|
204
|
+
this.dispatchEvent(t);
|
|
442
205
|
}
|
|
443
206
|
render() {
|
|
444
|
-
const
|
|
207
|
+
const e = this.componentClassNames(
|
|
445
208
|
"cre8-c-calendar-navigation",
|
|
446
209
|
{}
|
|
447
210
|
);
|
|
448
211
|
return s`
|
|
449
|
-
<div class="${
|
|
212
|
+
<div class="${e}">
|
|
450
213
|
<cre8-button
|
|
451
214
|
variant="tertiary"
|
|
452
215
|
text="Previous year"
|
|
@@ -502,21 +265,21 @@ const _ = class _ extends D {
|
|
|
502
265
|
`;
|
|
503
266
|
}
|
|
504
267
|
};
|
|
505
|
-
|
|
506
|
-
let
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
],
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
],
|
|
513
|
-
customElements.get("cre8-calendar-navigation") === void 0 && customElements.define("cre8-calendar-navigation",
|
|
514
|
-
var
|
|
515
|
-
for (var
|
|
516
|
-
(
|
|
517
|
-
return
|
|
268
|
+
$.styles = [A];
|
|
269
|
+
let b = $;
|
|
270
|
+
T([
|
|
271
|
+
p({ type: String, reflect: !0 })
|
|
272
|
+
], b.prototype, "monthName");
|
|
273
|
+
T([
|
|
274
|
+
p({ type: String, reflect: !0 })
|
|
275
|
+
], b.prototype, "year");
|
|
276
|
+
customElements.get("cre8-calendar-navigation") === void 0 && customElements.define("cre8-calendar-navigation", b);
|
|
277
|
+
var P = Object.defineProperty, j = Object.getOwnPropertyDescriptor, h = (d, e, t, a) => {
|
|
278
|
+
for (var r = a > 1 ? void 0 : a ? j(e, t) : e, i = d.length - 1, n; i >= 0; i--)
|
|
279
|
+
(n = d[i]) && (r = (a ? n(e, t, r) : n(r)) || r);
|
|
280
|
+
return a && r && P(e, t, r), r;
|
|
518
281
|
}, o;
|
|
519
|
-
const
|
|
282
|
+
const c = (o = class extends w {
|
|
520
283
|
constructor() {
|
|
521
284
|
super(), this._activeModal = "none", this._handleOnClickOutside = this._handleOnClickOutside.bind(this), this.currentDate = (this.fieldDate && /* @__PURE__ */ new Date(`${this.fieldDate}T00:00`)) ?? /* @__PURE__ */ new Date(), this.locale = document.documentElement.getAttribute("lang") || "en-US", this.dateConfig = {
|
|
522
285
|
locale: this.locale,
|
|
@@ -543,24 +306,24 @@ const d = (o = class extends D {
|
|
|
543
306
|
get activeModal() {
|
|
544
307
|
return this._activeModal;
|
|
545
308
|
}
|
|
546
|
-
set activeModal(
|
|
547
|
-
this._activeModal =
|
|
309
|
+
set activeModal(e) {
|
|
310
|
+
this._activeModal = e;
|
|
548
311
|
}
|
|
549
312
|
get fieldDate() {
|
|
550
313
|
return this._fieldDate;
|
|
551
314
|
}
|
|
552
|
-
set fieldDate(
|
|
553
|
-
const
|
|
554
|
-
this.requestUpdate("fieldDate",
|
|
555
|
-
const
|
|
556
|
-
this.currentDate =
|
|
315
|
+
set fieldDate(e) {
|
|
316
|
+
const t = this._fieldDate;
|
|
317
|
+
this.requestUpdate("fieldDate", t);
|
|
318
|
+
const a = !!(e && (/* @__PURE__ */ new Date(`${e}T00:00`)).getTime());
|
|
319
|
+
this.currentDate = a ? /* @__PURE__ */ new Date(`${e}T00:00`) : /* @__PURE__ */ new Date(), this._fieldDate = a ? e : "";
|
|
557
320
|
}
|
|
558
321
|
get currentDate() {
|
|
559
322
|
return this._currentDate;
|
|
560
323
|
}
|
|
561
|
-
set currentDate(
|
|
562
|
-
const
|
|
563
|
-
this._currentDate =
|
|
324
|
+
set currentDate(e) {
|
|
325
|
+
const t = this._currentDate;
|
|
326
|
+
this._currentDate = e, this.requestUpdate("currentDate", t);
|
|
564
327
|
}
|
|
565
328
|
connectedCallback() {
|
|
566
329
|
super.connectedCallback(), window.addEventListener("click", this._handleOnClickOutside, !1);
|
|
@@ -569,45 +332,45 @@ const d = (o = class extends D {
|
|
|
569
332
|
super.disconnectedCallback(), window.removeEventListener("click", this._handleOnClickOutside, !1);
|
|
570
333
|
}
|
|
571
334
|
/* Click Event Functions */
|
|
572
|
-
_handleOnClickOutside(
|
|
335
|
+
_handleOnClickOutside(e) {
|
|
573
336
|
if (!this.shadowRoot?.host)
|
|
574
337
|
throw Error(
|
|
575
338
|
"Could not determine navigation context during click handler"
|
|
576
339
|
);
|
|
577
|
-
if (!
|
|
578
|
-
const
|
|
340
|
+
if (!e.composedPath().includes(this.shadowRoot.host)) {
|
|
341
|
+
const a = new CustomEvent("outsideClick", {
|
|
579
342
|
detail: {
|
|
580
|
-
composedPath:
|
|
343
|
+
composedPath: e.composedPath()
|
|
581
344
|
}
|
|
582
345
|
});
|
|
583
|
-
this.dispatchEvent(
|
|
346
|
+
this.dispatchEvent(a);
|
|
584
347
|
}
|
|
585
348
|
}
|
|
586
|
-
emitSelectedDate(
|
|
587
|
-
const
|
|
349
|
+
emitSelectedDate(e) {
|
|
350
|
+
const t = new CustomEvent("dateSelect", {
|
|
588
351
|
detail: {
|
|
589
|
-
date:
|
|
352
|
+
date: e
|
|
590
353
|
}
|
|
591
354
|
});
|
|
592
|
-
this.currentDate = /* @__PURE__ */ new Date(`${
|
|
355
|
+
this.currentDate = /* @__PURE__ */ new Date(`${e}T00:00`), this.dispatchEvent(t);
|
|
593
356
|
}
|
|
594
|
-
changeYear(
|
|
595
|
-
const
|
|
596
|
-
this.currentDate =
|
|
357
|
+
changeYear(e) {
|
|
358
|
+
const t = this.currentDate, a = new Date(t.setFullYear(e));
|
|
359
|
+
this.currentDate = a, this.activeModal = "none";
|
|
597
360
|
}
|
|
598
|
-
changeMonth(
|
|
599
|
-
const
|
|
600
|
-
this.currentDate =
|
|
361
|
+
changeMonth(e) {
|
|
362
|
+
const t = this.currentDate, a = new Date(t.setMonth(e));
|
|
363
|
+
this.currentDate = a, this.activeModal = "none";
|
|
601
364
|
}
|
|
602
|
-
activateModal(
|
|
603
|
-
this.activeModal =
|
|
365
|
+
activateModal(e) {
|
|
366
|
+
this.activeModal = e;
|
|
604
367
|
}
|
|
605
368
|
/* Helper/Get Functions */
|
|
606
|
-
static formatMonthOrDayIndex(
|
|
607
|
-
return (
|
|
369
|
+
static formatMonthOrDayIndex(e) {
|
|
370
|
+
return (e + 1).toString().padStart(2, "0");
|
|
608
371
|
}
|
|
609
|
-
static formatDate(
|
|
610
|
-
return
|
|
372
|
+
static formatDate(e) {
|
|
373
|
+
return e.toString().padStart(2, "0");
|
|
611
374
|
}
|
|
612
375
|
numberOfDaysinMonth() {
|
|
613
376
|
return new Date(this.getYear(), this.getMonth() + 1, 0).getDate();
|
|
@@ -623,88 +386,88 @@ const d = (o = class extends D {
|
|
|
623
386
|
getYear() {
|
|
624
387
|
return this.currentDate.getFullYear();
|
|
625
388
|
}
|
|
626
|
-
static dateToString(
|
|
627
|
-
return `${
|
|
628
|
-
|
|
629
|
-
)}-${o.formatDate(
|
|
389
|
+
static dateToString(e) {
|
|
390
|
+
return `${e.getFullYear()}-${o.formatMonthOrDayIndex(
|
|
391
|
+
e.getMonth()
|
|
392
|
+
)}-${o.formatDate(e.getDate())}`;
|
|
630
393
|
}
|
|
631
|
-
async updateFocusForKeydown(
|
|
632
|
-
this.currentDate =
|
|
633
|
-
const
|
|
634
|
-
`button[datetime="${o.dateToString(
|
|
394
|
+
async updateFocusForKeydown(e) {
|
|
395
|
+
this.currentDate = e, await this.updateComplete;
|
|
396
|
+
const t = this.shadowRoot?.querySelector(
|
|
397
|
+
`button[datetime="${o.dateToString(e)}"]`
|
|
635
398
|
);
|
|
636
|
-
|
|
399
|
+
t.setAttribute("tabindex", "0"), t.focus();
|
|
637
400
|
}
|
|
638
|
-
_handleCalendarKeyDown(
|
|
639
|
-
const
|
|
401
|
+
_handleCalendarKeyDown(e) {
|
|
402
|
+
const t = this.shadowRoot?.querySelector(
|
|
640
403
|
`button[datetime="${o.dateToString(this.currentDate)}"]`
|
|
641
404
|
);
|
|
642
|
-
if (
|
|
643
|
-
const
|
|
405
|
+
if (e.key === "ArrowUp") {
|
|
406
|
+
const a = new Date(
|
|
644
407
|
this.getYear(),
|
|
645
408
|
this.getMonth(),
|
|
646
409
|
this.currentDate.getDate() - 7
|
|
647
410
|
);
|
|
648
|
-
this.updateFocusForKeydown(
|
|
411
|
+
this.updateFocusForKeydown(a), t.setAttribute("tabindex", "-1");
|
|
649
412
|
}
|
|
650
|
-
if (
|
|
651
|
-
const
|
|
413
|
+
if (e.key === "ArrowDown") {
|
|
414
|
+
const a = new Date(
|
|
652
415
|
this.getYear(),
|
|
653
416
|
this.getMonth(),
|
|
654
417
|
this.currentDate.getDate() + 7
|
|
655
418
|
);
|
|
656
|
-
this.updateFocusForKeydown(
|
|
419
|
+
this.updateFocusForKeydown(a), t.setAttribute("tabindex", "-1");
|
|
657
420
|
}
|
|
658
|
-
if (
|
|
659
|
-
const
|
|
421
|
+
if (e.key === "ArrowLeft") {
|
|
422
|
+
const a = new Date(
|
|
660
423
|
this.getYear(),
|
|
661
424
|
this.getMonth(),
|
|
662
425
|
this.currentDate.getDate() - 1
|
|
663
426
|
);
|
|
664
|
-
this.updateFocusForKeydown(
|
|
427
|
+
this.updateFocusForKeydown(a), t.setAttribute("tabindex", "-1");
|
|
665
428
|
}
|
|
666
|
-
if (
|
|
667
|
-
const
|
|
429
|
+
if (e.key === "ArrowRight") {
|
|
430
|
+
const a = new Date(
|
|
668
431
|
this.getYear(),
|
|
669
432
|
this.getMonth(),
|
|
670
433
|
this.currentDate.getDate() + 1
|
|
671
434
|
);
|
|
672
|
-
this.updateFocusForKeydown(
|
|
435
|
+
this.updateFocusForKeydown(a), t.setAttribute("tabindex", "-1");
|
|
673
436
|
}
|
|
674
|
-
if (
|
|
675
|
-
const
|
|
437
|
+
if (e.key === "Tab" && !e.shiftKey) {
|
|
438
|
+
const a = new CustomEvent("outsideClick", {
|
|
676
439
|
detail: {
|
|
677
440
|
composedPath: []
|
|
678
441
|
}
|
|
679
442
|
});
|
|
680
443
|
setTimeout(() => {
|
|
681
|
-
this.dispatchEvent(
|
|
444
|
+
this.dispatchEvent(a);
|
|
682
445
|
}, 20);
|
|
683
446
|
}
|
|
684
447
|
}
|
|
685
|
-
async changeMonthFromNav(
|
|
686
|
-
this.changeMonth(
|
|
687
|
-
const
|
|
448
|
+
async changeMonthFromNav(e) {
|
|
449
|
+
this.changeMonth(e), await this.updateComplete;
|
|
450
|
+
const a = (this.shadowRoot?.querySelector(
|
|
688
451
|
"cre8-calendar-navigation"
|
|
689
452
|
)).shadowRoot?.querySelector(
|
|
690
453
|
".cre8-c-calendar-navigation__month-modal-button"
|
|
691
454
|
);
|
|
692
|
-
await this.updateComplete,
|
|
455
|
+
await this.updateComplete, a.shadowRoot.querySelector("button").focus();
|
|
693
456
|
}
|
|
694
|
-
async changeYearFromNav(
|
|
695
|
-
this.changeYear(
|
|
696
|
-
const
|
|
457
|
+
async changeYearFromNav(e) {
|
|
458
|
+
this.changeYear(e), await this.updateComplete;
|
|
459
|
+
const a = (this.shadowRoot?.querySelector(
|
|
697
460
|
"cre8-calendar-navigation"
|
|
698
461
|
)).shadowRoot?.querySelector(
|
|
699
462
|
".cre8-c-calendar-navigation__year-modal-button"
|
|
700
463
|
);
|
|
701
|
-
await this.updateComplete,
|
|
464
|
+
await this.updateComplete, a.shadowRoot.querySelector("button").focus();
|
|
702
465
|
}
|
|
703
466
|
/* Template Map Functions */
|
|
704
467
|
getDaysOfWeekAbbreviations() {
|
|
705
468
|
return this.weekDays.map(
|
|
706
|
-
(
|
|
707
|
-
<span aria-label="${
|
|
469
|
+
(e) => s` <td>
|
|
470
|
+
<span aria-label="${e}">${e[0]}</span>
|
|
708
471
|
</td>`
|
|
709
472
|
);
|
|
710
473
|
}
|
|
@@ -726,22 +489,22 @@ const d = (o = class extends D {
|
|
|
726
489
|
getPreviousMonthDayButtons() {
|
|
727
490
|
return [
|
|
728
491
|
...Array(new Date(this.getYear(), this.getMonth(), 1).getDay()).keys()
|
|
729
|
-
].map((
|
|
730
|
-
const
|
|
492
|
+
].map((e) => {
|
|
493
|
+
const t = new Date(
|
|
731
494
|
this.getYear(),
|
|
732
495
|
this.getMonth(),
|
|
733
496
|
1
|
|
734
|
-
).getDay(),
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
),
|
|
497
|
+
).getDay(), a = new Date(this.getYear(), this.getMonth(), 0), r = a.getDate(), i = new Date(
|
|
498
|
+
a.getFullYear(),
|
|
499
|
+
a.getMonth(),
|
|
500
|
+
r - t + (e + 1)
|
|
501
|
+
), n = this.dateConfig.today.getDate() === i.getDate() && this.dateConfig.today.getMonth() === i.getMonth() && this.dateConfig.today.getFullYear() === i.getFullYear(), Y = (/* @__PURE__ */ new Date(`${this.fieldDate}T00:00`)).getTime() === i.getTime();
|
|
739
502
|
return s` <td>
|
|
740
503
|
<button
|
|
741
504
|
class="cre8-c-calendar__day-button cre8-c-calendar__different-month"
|
|
742
|
-
datetime="${o.dateToString(
|
|
743
|
-
?data-today="${
|
|
744
|
-
?data-selected="${
|
|
505
|
+
datetime="${o.dateToString(i)}"
|
|
506
|
+
?data-today="${n}"
|
|
507
|
+
?data-selected="${Y}"
|
|
745
508
|
tabindex="-1"
|
|
746
509
|
aria-label="${new Intl.DateTimeFormat(this.locale, {
|
|
747
510
|
weekday: "long",
|
|
@@ -749,11 +512,11 @@ const d = (o = class extends D {
|
|
|
749
512
|
month: "long",
|
|
750
513
|
day: "numeric"
|
|
751
514
|
}).format(
|
|
752
|
-
/* @__PURE__ */ new Date(`${o.dateToString(
|
|
515
|
+
/* @__PURE__ */ new Date(`${o.dateToString(i)}T00:00`)
|
|
753
516
|
)}"
|
|
754
|
-
@click="${() => this.emitSelectedDate(o.dateToString(
|
|
517
|
+
@click="${() => this.emitSelectedDate(o.dateToString(i))}"
|
|
755
518
|
>
|
|
756
|
-
${new Intl.NumberFormat(this.locale).format(
|
|
519
|
+
${new Intl.NumberFormat(this.locale).format(i.getDate())}
|
|
757
520
|
</button>
|
|
758
521
|
</td>`;
|
|
759
522
|
});
|
|
@@ -768,24 +531,24 @@ const d = (o = class extends D {
|
|
|
768
531
|
* 3. Build out day button with necessary props
|
|
769
532
|
* */
|
|
770
533
|
getCurrentMonthDayButtons() {
|
|
771
|
-
return [...Array(this.numberOfDaysinMonth()).keys()].map((
|
|
772
|
-
const
|
|
534
|
+
return [...Array(this.numberOfDaysinMonth()).keys()].map((e) => {
|
|
535
|
+
const t = e + 1, a = new Date(this.getYear(), this.getMonth(), t), r = this.dateConfig.today.getDate() === t && this.dateConfig.today.getMonth() === this.getMonth() && this.dateConfig.today.getFullYear() === this.getYear(), i = (/* @__PURE__ */ new Date(`${this.fieldDate}T00:00`)).getTime() === a.getTime();
|
|
773
536
|
return s` <td>
|
|
774
537
|
<button
|
|
775
538
|
class="cre8-c-calendar__day-button"
|
|
776
|
-
datetime="${o.dateToString(
|
|
777
|
-
?data-today="${
|
|
778
|
-
?data-selected="${
|
|
779
|
-
tabindex="${
|
|
539
|
+
datetime="${o.dateToString(a)}"
|
|
540
|
+
?data-today="${r}"
|
|
541
|
+
?data-selected="${i}"
|
|
542
|
+
tabindex="${t === this.currentDate.getDate() ? "0" : "-1"}"
|
|
780
543
|
aria-label="${new Intl.DateTimeFormat(this.locale, {
|
|
781
544
|
weekday: "long",
|
|
782
545
|
year: "numeric",
|
|
783
546
|
month: "long",
|
|
784
547
|
day: "numeric"
|
|
785
|
-
}).format(/* @__PURE__ */ new Date(`${o.dateToString(
|
|
786
|
-
@click="${() => this.emitSelectedDate(o.dateToString(
|
|
548
|
+
}).format(/* @__PURE__ */ new Date(`${o.dateToString(a)}T00:00`))}"
|
|
549
|
+
@click="${() => this.emitSelectedDate(o.dateToString(a))}"
|
|
787
550
|
>
|
|
788
|
-
${new Intl.NumberFormat(this.locale).format(
|
|
551
|
+
${new Intl.NumberFormat(this.locale).format(e + 1)}
|
|
789
552
|
</button>
|
|
790
553
|
</td>`;
|
|
791
554
|
});
|
|
@@ -813,24 +576,24 @@ const d = (o = class extends D {
|
|
|
813
576
|
this.numberOfDaysinMonth()
|
|
814
577
|
).getDay()
|
|
815
578
|
).keys()
|
|
816
|
-
].map((
|
|
817
|
-
const
|
|
579
|
+
].map((e) => {
|
|
580
|
+
const t = new Date(
|
|
818
581
|
this.getYear(),
|
|
819
582
|
this.getMonth(),
|
|
820
583
|
this.numberOfDaysinMonth()
|
|
821
|
-
), r = new Date(
|
|
822
|
-
e.setDate(e.getDate() + 1)
|
|
823
584
|
), a = new Date(
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
585
|
+
t.setDate(t.getDate() + 1)
|
|
586
|
+
), r = new Date(
|
|
587
|
+
a.getFullYear(),
|
|
588
|
+
a.getMonth(),
|
|
589
|
+
e + 1
|
|
590
|
+
), i = this.dateConfig.today.getDate() === r.getDate() && this.dateConfig.today.getMonth() === r.getMonth() && this.dateConfig.today.getFullYear() === r.getFullYear(), n = (/* @__PURE__ */ new Date(`${this.fieldDate}T00:00`)).getTime() === r.getTime();
|
|
828
591
|
return s` <td>
|
|
829
592
|
<button
|
|
830
593
|
class="cre8-c-calendar__day-button cre8-c-calendar__different-month"
|
|
831
|
-
datetime="${o.dateToString(
|
|
832
|
-
?data-today="${
|
|
833
|
-
?data-selected="${
|
|
594
|
+
datetime="${o.dateToString(r)}"
|
|
595
|
+
?data-today="${i}"
|
|
596
|
+
?data-selected="${n}"
|
|
834
597
|
tabindex="-1"
|
|
835
598
|
aria-label="${new Intl.DateTimeFormat(this.locale, {
|
|
836
599
|
weekday: "long",
|
|
@@ -838,26 +601,26 @@ const d = (o = class extends D {
|
|
|
838
601
|
month: "long",
|
|
839
602
|
day: "numeric"
|
|
840
603
|
}).format(
|
|
841
|
-
/* @__PURE__ */ new Date(`${o.dateToString(
|
|
604
|
+
/* @__PURE__ */ new Date(`${o.dateToString(r)}T00:00`)
|
|
842
605
|
)}"
|
|
843
|
-
@click="${() => this.emitSelectedDate(o.dateToString(
|
|
606
|
+
@click="${() => this.emitSelectedDate(o.dateToString(r))}"
|
|
844
607
|
>
|
|
845
|
-
${new Intl.NumberFormat(this.locale).format(
|
|
608
|
+
${new Intl.NumberFormat(this.locale).format(r.getDate())}
|
|
846
609
|
</button>
|
|
847
610
|
</td>`;
|
|
848
611
|
});
|
|
849
612
|
}
|
|
850
613
|
render() {
|
|
851
|
-
const
|
|
852
|
-
return s` <div class="${
|
|
614
|
+
const e = this.componentClassNames("cre8-c-calendar", {});
|
|
615
|
+
return s` <div class="${e}">
|
|
853
616
|
${this._activeModal === "month" ? s`<cre8-calendar-month-modal
|
|
854
617
|
currentMonth="${this.getMonth()}"
|
|
855
|
-
@changeMonth="${(
|
|
856
|
-
></cre8-calendar-month-modal>` :
|
|
618
|
+
@changeMonth="${(t) => this.changeMonthFromNav(t.detail.month)}"
|
|
619
|
+
></cre8-calendar-month-modal>` : y}
|
|
857
620
|
${this._activeModal === "year" ? s`<cre8-calendar-year-modal
|
|
858
621
|
currentYear="${this.getYear()}"
|
|
859
|
-
@changeYear="${(
|
|
860
|
-
></cre8-calendar-year-modal>` :
|
|
622
|
+
@changeYear="${(t) => this.changeYearFromNav(t.detail.year)}"
|
|
623
|
+
></cre8-calendar-year-modal>` : y}
|
|
861
624
|
${this._activeModal === "none" ? s` ${this.hasShortcuts ? s`<div class="cre8-c-calendar__header-shortcuts">
|
|
862
625
|
<cre8-button
|
|
863
626
|
text="Today"
|
|
@@ -895,13 +658,13 @@ const d = (o = class extends D {
|
|
|
895
658
|
)
|
|
896
659
|
)}"
|
|
897
660
|
></cre8-button>
|
|
898
|
-
</div>` :
|
|
661
|
+
</div>` : y}
|
|
899
662
|
<cre8-calendar-navigation
|
|
900
663
|
monthName="${this.getMonthName()}"
|
|
901
664
|
year="${this.getYear()}"
|
|
902
|
-
@activateModal="${(
|
|
903
|
-
@changeMonth="${(
|
|
904
|
-
@changeYear="${(
|
|
665
|
+
@activateModal="${(t) => this.activateModal(t.detail.modal)}"
|
|
666
|
+
@changeMonth="${(t) => this.changeMonth(this.getMonth() + t.detail.addend)}"
|
|
667
|
+
@changeYear="${(t) => this.changeYear(this.getYear() + t.detail.addend)}"
|
|
905
668
|
>
|
|
906
669
|
</cre8-calendar-navigation>
|
|
907
670
|
<table>
|
|
@@ -917,54 +680,54 @@ const d = (o = class extends D {
|
|
|
917
680
|
${this.getNextMonthDayButtons()}
|
|
918
681
|
</tr>
|
|
919
682
|
</tbody>
|
|
920
|
-
</table>` :
|
|
683
|
+
</table>` : y}
|
|
921
684
|
</div>`;
|
|
922
685
|
}
|
|
923
|
-
}, o.styles = [
|
|
686
|
+
}, o.styles = [z], o);
|
|
924
687
|
h([
|
|
925
|
-
|
|
926
|
-
],
|
|
688
|
+
C(".cre8-c-calendar__navigation-wrapper")
|
|
689
|
+
], c.prototype, "_navWrapper", 2);
|
|
927
690
|
h([
|
|
928
|
-
|
|
929
|
-
],
|
|
691
|
+
p({ type: Boolean, reflect: !0 })
|
|
692
|
+
], c.prototype, "hasShortcuts", 2);
|
|
930
693
|
h([
|
|
931
694
|
l()
|
|
932
|
-
],
|
|
695
|
+
], c.prototype, "_activeModal", 2);
|
|
933
696
|
h([
|
|
934
|
-
|
|
935
|
-
],
|
|
697
|
+
p({ reflect: !0, type: String })
|
|
698
|
+
], c.prototype, "activeModal", 1);
|
|
936
699
|
h([
|
|
937
700
|
l()
|
|
938
|
-
],
|
|
701
|
+
], c.prototype, "_fieldDate", 2);
|
|
939
702
|
h([
|
|
940
|
-
|
|
941
|
-
],
|
|
703
|
+
p({ reflect: !0, type: Date })
|
|
704
|
+
], c.prototype, "fieldDate", 1);
|
|
942
705
|
h([
|
|
943
706
|
l()
|
|
944
|
-
],
|
|
707
|
+
], c.prototype, "_currentDate", 2);
|
|
945
708
|
h([
|
|
946
|
-
|
|
947
|
-
],
|
|
709
|
+
p({ reflect: !0, type: Date })
|
|
710
|
+
], c.prototype, "currentDate", 1);
|
|
948
711
|
h([
|
|
949
712
|
l()
|
|
950
|
-
],
|
|
713
|
+
], c.prototype, "locale", 2);
|
|
951
714
|
h([
|
|
952
715
|
l()
|
|
953
|
-
],
|
|
716
|
+
], c.prototype, "weekDays", 2);
|
|
954
717
|
h([
|
|
955
718
|
l()
|
|
956
|
-
],
|
|
719
|
+
], c.prototype, "dateConfig", 2);
|
|
957
720
|
h([
|
|
958
721
|
l()
|
|
959
|
-
],
|
|
960
|
-
let
|
|
961
|
-
customElements.get("cre8-calendar") === void 0 && customElements.define("cre8-calendar",
|
|
962
|
-
var
|
|
963
|
-
for (var
|
|
964
|
-
(
|
|
965
|
-
return
|
|
722
|
+
], c.prototype, "dateFormatOptions", 2);
|
|
723
|
+
let B = c;
|
|
724
|
+
customElements.get("cre8-calendar") === void 0 && customElements.define("cre8-calendar", B);
|
|
725
|
+
var U = Object.defineProperty, k = (d, e, t, a) => {
|
|
726
|
+
for (var r = void 0, i = d.length - 1, n; i >= 0; i--)
|
|
727
|
+
(n = d[i]) && (r = n(e, t, r) || r);
|
|
728
|
+
return r && U(e, t, r), r;
|
|
966
729
|
};
|
|
967
|
-
const
|
|
730
|
+
const M = class M extends R {
|
|
968
731
|
constructor() {
|
|
969
732
|
super(...arguments), this.type = "date", this.showCalendar = !1;
|
|
970
733
|
}
|
|
@@ -973,46 +736,46 @@ const C = class C extends N {
|
|
|
973
736
|
* 1) Set the input's value equal to the event.target.value when the input is changed.
|
|
974
737
|
* 2) Set the internal form value of the input to the updated value
|
|
975
738
|
*/
|
|
976
|
-
handleDateOnInput(
|
|
977
|
-
this.value =
|
|
739
|
+
handleDateOnInput(e) {
|
|
740
|
+
this.value = e.target.value, this._internals.setFormValue(this.value);
|
|
978
741
|
}
|
|
979
|
-
handleCalendarSelect(
|
|
980
|
-
this.value =
|
|
742
|
+
handleCalendarSelect(e) {
|
|
743
|
+
this.value = e.detail.date, this._internals.setFormValue(this.value), this.showCalendar = !1;
|
|
981
744
|
}
|
|
982
|
-
handleOutsideClick(
|
|
983
|
-
const
|
|
984
|
-
this.showCalendar && !
|
|
745
|
+
handleOutsideClick(e) {
|
|
746
|
+
const t = this.renderRoot.querySelector(".cre8-c-date-picker");
|
|
747
|
+
this.showCalendar && !e.detail.composedPath.includes(t) && (this.showCalendar = !1);
|
|
985
748
|
}
|
|
986
749
|
toggleCalendar() {
|
|
987
750
|
!this.disabled && !this.readonly && (this.showCalendar = !this.showCalendar);
|
|
988
751
|
}
|
|
989
752
|
render() {
|
|
990
|
-
const
|
|
753
|
+
const e = this.componentClassNames("cre8-c-date-picker", {
|
|
991
754
|
"cre8-is-error": this.isError,
|
|
992
755
|
"cre8-is-success": this.isSuccess,
|
|
993
756
|
"cre8-c-date-picker--disabled": this.disabled,
|
|
994
757
|
"cre8-c-date-picker--read-only": this.readonly
|
|
995
758
|
});
|
|
996
759
|
return this.type = "date", s`
|
|
997
|
-
<div class="${
|
|
760
|
+
<div class="${e}">
|
|
998
761
|
<label class="cre8-c-date-picker__label" for="${this.fieldId}"
|
|
999
762
|
>${this.label}</label
|
|
1000
763
|
>
|
|
1001
764
|
<div class="cre8-c-date-picker__body">
|
|
1002
765
|
<input
|
|
1003
766
|
class="cre8-c-date-picker__input"
|
|
1004
|
-
autocomplete=${
|
|
767
|
+
autocomplete=${u(this.autocomplete)}
|
|
1005
768
|
type="${this.type}"
|
|
1006
769
|
id="${this.fieldId}"
|
|
1007
|
-
name="${
|
|
1008
|
-
max=${
|
|
1009
|
-
min=${
|
|
1010
|
-
value="${
|
|
770
|
+
name="${u(this.name)}"
|
|
771
|
+
max=${u(this.max)}
|
|
772
|
+
min=${u(this.min)}
|
|
773
|
+
value="${u(this.value)}"
|
|
1011
774
|
?readonly=${this.readonly}
|
|
1012
775
|
?required=${this.required}
|
|
1013
776
|
?disabled="${this.disabled}"
|
|
1014
|
-
aria-describedby="${
|
|
1015
|
-
placeholder="${
|
|
777
|
+
aria-describedby="${u(this.fieldNoteAria())}"
|
|
778
|
+
placeholder="${u(this.placeholder)}"
|
|
1016
779
|
@input=${this.handleDateOnInput}
|
|
1017
780
|
@click=${this.toggleCalendar}
|
|
1018
781
|
/>
|
|
@@ -1028,31 +791,31 @@ const C = class C extends N {
|
|
|
1028
791
|
></cre8-button>
|
|
1029
792
|
</div>
|
|
1030
793
|
${this.showCalendar ? s`<cre8-calendar
|
|
1031
|
-
fieldDate="${
|
|
794
|
+
fieldDate="${u(this.value)}"
|
|
1032
795
|
?hasShortcuts=${this.hasShortcuts}
|
|
1033
796
|
@dateSelect="${this.handleCalendarSelect}"
|
|
1034
797
|
@outsideClick="${this.handleOutsideClick}"
|
|
1035
|
-
></cre8-calendar>` :
|
|
798
|
+
></cre8-calendar>` : y}
|
|
1036
799
|
${this.fieldNote || this.slotNotEmpty("fieldNote") ? s`<cre8-field-note
|
|
1037
800
|
id=${this.ariaDescribedBy}
|
|
1038
801
|
class="cre8-c-date-picker__field-note"
|
|
1039
802
|
><slot name="fieldNote">${this.fieldNote}</slot></cre8-field-note
|
|
1040
|
-
>` :
|
|
803
|
+
>` : y}
|
|
1041
804
|
${this.renderSuccessErrorFieldNote()}
|
|
1042
805
|
</div>
|
|
1043
806
|
`;
|
|
1044
807
|
}
|
|
1045
808
|
};
|
|
1046
|
-
|
|
1047
|
-
let g =
|
|
1048
|
-
|
|
1049
|
-
|
|
809
|
+
M.styles = [I];
|
|
810
|
+
let g = M;
|
|
811
|
+
k([
|
|
812
|
+
C('input[type="date"]')
|
|
1050
813
|
], g.prototype, "field");
|
|
1051
|
-
|
|
814
|
+
k([
|
|
1052
815
|
l()
|
|
1053
816
|
], g.prototype, "showCalendar");
|
|
1054
|
-
|
|
1055
|
-
|
|
817
|
+
k([
|
|
818
|
+
p({ type: Boolean, reflect: !0 })
|
|
1056
819
|
], g.prototype, "hasShortcuts");
|
|
1057
820
|
customElements.get("cre8-date-picker") === void 0 && customElements.define("cre8-date-picker", g);
|
|
1058
821
|
export {
|