q2-tecton-elements 1.10.5 → 1.10.8
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/cjs/{icons-921779df.js → icons-4595ee47.js} +61 -1
- package/dist/cjs/{index-f4153f5a.js → index-a55d3c34.js} +9 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/q2-avatar.cjs.entry.js +1 -1
- package/dist/cjs/q2-btn_2.cjs.entry.js +10 -6
- package/dist/cjs/q2-calendar.cjs.entry.js +2902 -6078
- package/dist/cjs/q2-carousel-pane.cjs.entry.js +50 -7
- package/dist/cjs/q2-carousel.cjs.entry.js +2719 -6513
- package/dist/cjs/q2-checkbox-group.cjs.entry.js +2 -2
- package/dist/cjs/q2-checkbox.cjs.entry.js +10 -2
- package/dist/cjs/q2-dropdown-item.cjs.entry.js +2 -2
- package/dist/cjs/q2-dropdown.cjs.entry.js +8 -2
- package/dist/cjs/q2-editable-field.cjs.entry.js +26 -11
- package/dist/cjs/q2-icon.cjs.entry.js +2 -2
- package/dist/cjs/q2-input.cjs.entry.js +9 -7
- package/dist/cjs/q2-loading-element.cjs.entry.js +1 -1
- package/dist/cjs/q2-loc.cjs.entry.js +1 -1
- package/dist/cjs/q2-message.cjs.entry.js +11 -3
- package/dist/cjs/q2-optgroup.cjs.entry.js +2 -2
- package/dist/cjs/q2-option.cjs.entry.js +3 -34
- package/dist/cjs/q2-radio-group.cjs.entry.js +10 -2
- package/dist/cjs/q2-radio.cjs.entry.js +10 -2
- package/dist/cjs/q2-section.cjs.entry.js +9 -3
- package/dist/cjs/q2-select.cjs.entry.js +175 -130
- package/dist/cjs/q2-stepper-pane.cjs.entry.js +1 -1
- package/dist/cjs/q2-stepper.cjs.entry.js +10 -4
- package/dist/cjs/q2-tab-container.cjs.entry.js +9 -11
- package/dist/cjs/q2-tab-pane.cjs.entry.js +2 -2
- package/dist/cjs/q2-tecton-elements.cjs.js +1 -1
- package/dist/cjs/q2-textarea.cjs.entry.js +8 -4
- package/dist/cjs/tecton-tab-pane.cjs.entry.js +2 -2
- package/dist/collection/components/q2-avatar/index.js +1 -1
- package/dist/collection/components/q2-avatar/styles.css +63 -61
- package/dist/collection/components/q2-btn/index.js +8 -4
- package/dist/collection/components/q2-btn/styles.css +96 -96
- package/dist/collection/components/q2-calendar/helpers.js +77 -52
- package/dist/collection/components/q2-calendar/index.js +248 -196
- package/dist/collection/components/q2-calendar/styles.css +63 -84
- package/dist/collection/components/q2-calendar/validation.js +100 -166
- package/dist/collection/components/q2-carousel/index.js +204 -266
- package/dist/collection/components/q2-carousel/styles.css +152 -155
- package/dist/collection/components/q2-carousel-pane/index.js +67 -28
- package/dist/collection/components/q2-carousel-pane/styles.css +82 -16
- package/dist/collection/components/q2-checkbox/index.js +16 -2
- package/dist/collection/components/q2-checkbox/styles.css +152 -176
- package/dist/collection/components/q2-checkbox-group/index.js +1 -1
- package/dist/collection/components/q2-checkbox-group/styles.css +65 -81
- package/dist/collection/components/q2-dropdown/index.js +15 -2
- package/dist/collection/components/q2-dropdown/styles.css +49 -36
- package/dist/collection/components/q2-dropdown-item/index.js +1 -1
- package/dist/collection/components/q2-dropdown-item/styles.css +48 -62
- package/dist/collection/components/q2-editable-field/index.js +33 -12
- package/dist/collection/components/q2-editable-field/styles.css +49 -50
- package/dist/collection/components/q2-icon/icons.js +61 -1
- package/dist/collection/components/q2-icon/styles.css +29 -29
- package/dist/collection/components/q2-input/index.js +9 -7
- package/dist/collection/components/q2-input/styles.css +211 -292
- package/dist/collection/components/q2-loading/index.js +1 -1
- package/dist/collection/components/q2-loading/skeleton/q2-loading-element/index.js +1 -1
- package/dist/collection/components/q2-loading/skeleton/q2-loading-element/styles.css +5 -6
- package/dist/collection/components/q2-loading/styles.css +130 -136
- package/dist/collection/components/q2-loc/index.js +1 -1
- package/dist/collection/components/q2-loc/styles.css +30 -31
- package/dist/collection/components/q2-message/index.js +18 -3
- package/dist/collection/components/q2-message/styles.css +32 -29
- package/dist/collection/components/q2-optgroup/index.js +1 -1
- package/dist/collection/components/q2-optgroup/styles.css +42 -47
- package/dist/collection/components/q2-option/index.js +4 -42
- package/dist/collection/components/q2-option/styles.css +29 -29
- package/dist/collection/components/q2-radio/index.js +16 -2
- package/dist/collection/components/q2-radio/styles.css +29 -29
- package/dist/collection/components/q2-radio-group/index.js +16 -2
- package/dist/collection/components/q2-radio-group/styles.css +67 -72
- package/dist/collection/components/q2-section/index.js +15 -3
- package/dist/collection/components/q2-section/styles.css +77 -77
- package/dist/collection/components/q2-select/index.js +182 -131
- package/dist/collection/components/q2-select/styles.css +33 -34
- package/dist/collection/components/q2-stepper/index.js +15 -3
- package/dist/collection/components/q2-stepper/styles.css +32 -32
- package/dist/collection/components/q2-stepper-pane/styles.css +29 -29
- package/dist/collection/components/q2-tab-container/index.js +7 -9
- package/dist/collection/components/q2-tab-container/styles.css +29 -29
- package/dist/collection/components/q2-tab-pane/index.js +2 -2
- package/dist/collection/components/q2-tab-pane/styles.css +34 -36
- package/dist/collection/components/q2-textarea/index.js +8 -4
- package/dist/collection/components/q2-textarea/styles.css +180 -228
- package/dist/collection/components/tecton-tab-pane/index.js +2 -2
- package/dist/collection/components/tecton-tab-pane/styles.css +50 -50
- package/dist/collection/utils/index.js +7 -0
- package/dist/esm/{icons-a3817842.js → icons-3ee662ea.js} +61 -1
- package/dist/esm/{index-476b86cc.js → index-ec6660af.js} +8 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/q2-avatar.entry.js +1 -1
- package/dist/esm/q2-btn_2.entry.js +10 -6
- package/dist/esm/q2-calendar.entry.js +2902 -6078
- package/dist/esm/q2-carousel-pane.entry.js +51 -8
- package/dist/esm/q2-carousel.entry.js +2720 -6514
- package/dist/esm/q2-checkbox-group.entry.js +2 -2
- package/dist/esm/q2-checkbox.entry.js +10 -2
- package/dist/esm/q2-dropdown-item.entry.js +2 -2
- package/dist/esm/q2-dropdown.entry.js +8 -2
- package/dist/esm/q2-editable-field.entry.js +26 -11
- package/dist/esm/q2-icon.entry.js +2 -2
- package/dist/esm/q2-input.entry.js +9 -7
- package/dist/esm/q2-loading-element.entry.js +1 -1
- package/dist/esm/q2-loc.entry.js +1 -1
- package/dist/esm/q2-message.entry.js +11 -3
- package/dist/esm/q2-optgroup.entry.js +2 -2
- package/dist/esm/q2-option.entry.js +4 -35
- package/dist/esm/q2-radio-group.entry.js +10 -2
- package/dist/esm/q2-radio.entry.js +10 -2
- package/dist/esm/q2-section.entry.js +9 -3
- package/dist/esm/q2-select.entry.js +175 -130
- package/dist/esm/q2-stepper-pane.entry.js +1 -1
- package/dist/esm/q2-stepper.entry.js +10 -4
- package/dist/esm/q2-tab-container.entry.js +7 -9
- package/dist/esm/q2-tab-pane.entry.js +2 -2
- package/dist/esm/q2-tecton-elements.js +1 -1
- package/dist/esm/q2-textarea.entry.js +8 -4
- package/dist/esm/tecton-tab-pane.entry.js +2 -2
- package/dist/q2-tecton-elements/{p-4830affe.entry.js → p-07a5d703.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-84c05db6.entry.js → p-32ad664c.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-37aba2a4.js +1 -0
- package/dist/q2-tecton-elements/p-4ae9d1f3.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-67d86e3c.js → p-4cd00f1a.js} +1 -1
- package/dist/q2-tecton-elements/p-52f53e07.entry.js +1 -0
- package/dist/q2-tecton-elements/p-5559f126.entry.js +1 -0
- package/dist/q2-tecton-elements/p-6702eb4d.entry.js +1 -0
- package/dist/q2-tecton-elements/p-750bcd33.entry.js +1 -0
- package/dist/q2-tecton-elements/p-78642b7b.entry.js +1 -0
- package/dist/q2-tecton-elements/p-7e6fc65d.entry.js +1 -0
- package/dist/q2-tecton-elements/p-7eb39c90.entry.js +1 -0
- package/dist/q2-tecton-elements/p-81df91a1.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-01e00610.entry.js → p-843b1ee9.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-8509b171.entry.js +1 -0
- package/dist/q2-tecton-elements/p-8ea2c4f7.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-d1d040ef.entry.js → p-95a73559.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-96c9eb75.entry.js +1 -0
- package/dist/q2-tecton-elements/p-9b50c3c3.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-a9bdd814.entry.js → p-a6f8d09a.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-ab977515.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-9314863f.entry.js → p-bb2e110a.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-bbacb804.entry.js +1 -0
- package/dist/q2-tecton-elements/p-c555f1de.entry.js +1 -0
- package/dist/q2-tecton-elements/p-c5e55b9f.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-4229b057.entry.js → p-df182f61.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-fa6eea5c.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-61c0e5fd.entry.js → p-fbf7c5e6.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-fc804ebd.entry.js +1 -0
- package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
- package/dist/test/helpers.js +4 -0
- package/dist/types/components/q2-btn/index.d.ts +1 -0
- package/dist/types/components/q2-calendar/helpers.d.ts +6 -6
- package/dist/types/components/q2-calendar/index.d.ts +16 -17
- package/dist/types/components/q2-calendar/types.d.ts +9 -26
- package/dist/types/components/q2-calendar/validation.d.ts +27 -12
- package/dist/types/components/q2-carousel/index.d.ts +15 -45
- package/dist/types/components/q2-carousel-pane/index.d.ts +5 -2
- package/dist/types/components/q2-checkbox/index.d.ts +2 -0
- package/dist/types/components/q2-dropdown/index.d.ts +1 -0
- package/dist/types/components/q2-editable-field/index.d.ts +5 -1
- package/dist/types/components/q2-input/index.d.ts +1 -1
- package/dist/types/components/q2-message/index.d.ts +2 -0
- package/dist/types/components/q2-option/index.d.ts +0 -4
- package/dist/types/components/q2-radio/index.d.ts +3 -0
- package/dist/types/components/q2-radio-group/index.d.ts +1 -0
- package/dist/types/components/q2-section/index.d.ts +1 -0
- package/dist/types/components/q2-select/index.d.ts +10 -7
- package/dist/types/components/q2-stepper/index.d.ts +2 -1
- package/dist/types/components/q2-tab-container/index.d.ts +1 -1
- package/dist/types/components/q2-textarea/index.d.ts +2 -1
- package/dist/types/components.d.ts +3 -2
- package/dist/types/util.d.ts +1 -0
- package/dist/types/utils/index.d.ts +2 -0
- package/dist/types/workspace/workspace/tecton-production_release_1.10.x/packages/q2-tecton-elements/.stencil/test/helpers.d.ts +2 -1
- package/package.json +4 -5
- package/dist/q2-tecton-elements/p-1fc4e6f6.entry.js +0 -1
- package/dist/q2-tecton-elements/p-25a5f691.js +0 -1
- package/dist/q2-tecton-elements/p-27353237.entry.js +0 -1
- package/dist/q2-tecton-elements/p-3e100450.entry.js +0 -1
- package/dist/q2-tecton-elements/p-428d15fd.entry.js +0 -1
- package/dist/q2-tecton-elements/p-48fc317d.entry.js +0 -1
- package/dist/q2-tecton-elements/p-5222b792.entry.js +0 -1
- package/dist/q2-tecton-elements/p-5469c1e9.entry.js +0 -1
- package/dist/q2-tecton-elements/p-74c1a311.entry.js +0 -1
- package/dist/q2-tecton-elements/p-784af485.entry.js +0 -1
- package/dist/q2-tecton-elements/p-7c99a58b.entry.js +0 -1
- package/dist/q2-tecton-elements/p-7f74b629.entry.js +0 -1
- package/dist/q2-tecton-elements/p-831a461f.entry.js +0 -1
- package/dist/q2-tecton-elements/p-84c52d3b.entry.js +0 -9
- package/dist/q2-tecton-elements/p-997e4c7e.entry.js +0 -1
- package/dist/q2-tecton-elements/p-a224bc9c.entry.js +0 -1
- package/dist/q2-tecton-elements/p-d893fcf2.entry.js +0 -1
- package/dist/q2-tecton-elements/p-da7cca07.entry.js +0 -1
- package/dist/q2-tecton-elements/p-f17761da.entry.js +0 -1
- package/dist/q2-tecton-elements/p-f5e074f8.entry.js +0 -1
|
@@ -1,67 +1,67 @@
|
|
|
1
1
|
* {
|
|
2
|
-
|
|
2
|
+
box-sizing: border-box;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
*:active {
|
|
6
|
-
|
|
6
|
+
outline: none;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
*:focus {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
outline: none;
|
|
11
|
+
box-shadow: var(--const-global-focus);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
:host {
|
|
15
|
-
|
|
15
|
+
box-shadow: none !important;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
::-moz-focus-inner {
|
|
19
|
-
|
|
19
|
+
border: none;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
input,
|
|
23
23
|
textarea,
|
|
24
24
|
button {
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
font-family: inherit;
|
|
26
|
+
font-size: inherit;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
:host(.sr),
|
|
30
30
|
:host(.sr) button {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
31
|
+
border: 0;
|
|
32
|
+
clip: rect(0 0 0 0);
|
|
33
|
+
height: 1px;
|
|
34
|
+
margin: -1px;
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
padding: 0;
|
|
37
|
+
position: absolute;
|
|
38
|
+
width: 1px;
|
|
39
|
+
white-space: nowrap;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
.sr,
|
|
43
43
|
.sr button {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
44
|
+
border: 0;
|
|
45
|
+
clip: rect(0 0 0 0);
|
|
46
|
+
height: 1px;
|
|
47
|
+
margin: -1px;
|
|
48
|
+
overflow: hidden;
|
|
49
|
+
padding: 0;
|
|
50
|
+
position: absolute;
|
|
51
|
+
width: 1px;
|
|
52
|
+
white-space: nowrap;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
.hidden {
|
|
56
|
-
|
|
56
|
+
display: none;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
:host([hidden]) {
|
|
60
|
-
|
|
60
|
+
display: none;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
.invisible {
|
|
64
|
-
|
|
64
|
+
visibility: hidden;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
.q2-element-dropdown {
|
|
@@ -79,10 +79,10 @@ button {
|
|
|
79
79
|
opacity: 0;
|
|
80
80
|
visibility: hidden;
|
|
81
81
|
transition: opacity var(--app-tween-1);
|
|
82
|
-
border-radius: var(--tct-dropdown-
|
|
83
|
-
--comp-scrollbar-size: var(--tct-scrollbar-size, var(--app-scale-1x, 5px));
|
|
84
|
-
--comp-scrollbar-border-radius: var(--tct-scrollbar-border-radius, var(--app-border-radius-1, 3px));
|
|
85
|
-
--comp-scrollbar-color: var(--tct-scrollbar-color, var(--t-a11y-gray-color, #747474));
|
|
82
|
+
border-radius: var(--tct-dropdown-border-radius, --t-dropdown-border-radius, 0);
|
|
83
|
+
--comp-scrollbar-size: var(--tct-scrollbar-size, var(--t-scrollbar-size, var(--app-scale-1x, 5px)));
|
|
84
|
+
--comp-scrollbar-border-radius: var(--tct-scrollbar-border-radius, var(--t-scrollbar-border-radius, var(--app-border-radius-1, 3px)));
|
|
85
|
+
--comp-scrollbar-color: var(--tct-scrollbar-color, var(--t-scrollbar-color, var(--t-a11y-gray-color, #747474)));
|
|
86
86
|
scrollbar-width: thin;
|
|
87
87
|
scrollbar-color: var(--comp-scrollbar-color) transparent;
|
|
88
88
|
}
|
|
@@ -111,7 +111,6 @@ button {
|
|
|
111
111
|
overflow: auto;
|
|
112
112
|
opacity: 1;
|
|
113
113
|
visibility: visible;
|
|
114
|
-
margin-bottom: var(--app-scale-2);
|
|
115
114
|
}
|
|
116
115
|
|
|
117
116
|
:host([alignment=right]) .q2-element-dropdown {
|
|
@@ -148,11 +147,11 @@ q2-input {
|
|
|
148
147
|
}
|
|
149
148
|
|
|
150
149
|
.calendar-label {
|
|
151
|
-
font-size: var(--tct-calendar-label-font-size, 16px);
|
|
150
|
+
font-size: var(--tct-calendar-label-font-size, var(--t-calendar-label-font-size, 16px));
|
|
152
151
|
flex: 1 1;
|
|
153
152
|
flex-basis: calc(100% - var-list(--tct-btn-icon-width, 44px));
|
|
154
153
|
margin: 0;
|
|
155
|
-
padding: var(--tct-calendar-label-vertical-padding, var(--tct-scale-2, var(--app-scale-2, 10px))) 0;
|
|
154
|
+
padding: var(--tct-calendar-label-vertical-padding, var(--t-calendar-label-vertical-padding, var(--tct-scale-2, var(--app-scale-2, 10px)))) 0;
|
|
156
155
|
}
|
|
157
156
|
|
|
158
157
|
.calendar-hint {
|
|
@@ -165,8 +164,8 @@ q2-input {
|
|
|
165
164
|
display: flex;
|
|
166
165
|
justify-content: center;
|
|
167
166
|
align-items: center;
|
|
168
|
-
font-size: var(--tct-calendar-month-font-size, 16px);
|
|
169
|
-
font-weight: var(--tct-calendar-month-font-weight, 600);
|
|
167
|
+
font-size: var(--tct-calendar-month-font-size, var(--t-calendar-month-font-size, 16px));
|
|
168
|
+
font-weight: var(--tct-calendar-month-font-weight, var(--t-calendar-month-font-weight, 600));
|
|
170
169
|
}
|
|
171
170
|
|
|
172
171
|
.cal-month-text {
|
|
@@ -179,51 +178,39 @@ q2-input {
|
|
|
179
178
|
display: inline-block;
|
|
180
179
|
}
|
|
181
180
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
padding-bottom: 2px;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
.cal-day,
|
|
189
|
-
.cal-days > div {
|
|
190
|
-
flex: 0 0 14.285714%;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
.cal-day-heading {
|
|
194
|
-
font-size: var(--tct-calendar-day-heading-font-size, inherit);
|
|
195
|
-
font-weight: var(--tct-calendar-day-heading-font-weight, 600);
|
|
181
|
+
table {
|
|
182
|
+
width: 100%;
|
|
183
|
+
margin-bottom: 2px;
|
|
196
184
|
}
|
|
197
185
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
186
|
+
th {
|
|
187
|
+
font-size: var(--tct-calendar-day-heading-font-size, var(--t-calendar-day-heading-font-size, inherit));
|
|
188
|
+
font-weight: var(--tct-calendar-day-heading-font-weight, var(--t-calendar-day-heading-font-weight, 600));
|
|
189
|
+
width: 14.285714%;
|
|
201
190
|
}
|
|
202
191
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
box-shadow: inset 2px 2px var(--tct-calenday-day-selected-outline-color, var(--tct-stoplight-info, var(--const-stoplight-info, #0079c1))), inset -2px -2px var(--tct-calenday-day-selected-outline-color, var(--tct-stoplight-info, var(--const-stoplight-info, #0079c1)));
|
|
192
|
+
td {
|
|
193
|
+
height: 44px;
|
|
194
|
+
cursor: pointer;
|
|
207
195
|
}
|
|
208
|
-
|
|
209
|
-
.cal-day.is-unavailable {
|
|
196
|
+
td.is-unavailable {
|
|
210
197
|
border: 1px solid var(--tct-input-error-border-color, var(--const-stoplight-alert, #c30000));
|
|
211
198
|
}
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
height: 44px;
|
|
216
|
-
flex-direction: column;
|
|
217
|
-
justify-content: center;
|
|
218
|
-
align-items: center;
|
|
199
|
+
td.is-valid:hover {
|
|
200
|
+
background-color: var(--tct-calendar-day-hover-bg, var(--t-calendar-day-hover-bg, var(--tct-gray-14, var(--app-gray14, var(--tct-gray-l4, var(--app-gray-l4, #f2f2f2))))));
|
|
201
|
+
color: var(--tct-calendar-day-hover-font-color, var(--t-calendar-day-hover-font-color, inherit));
|
|
219
202
|
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
203
|
+
td[aria-hidden], td[aria-disabled] {
|
|
204
|
+
pointer-events: none;
|
|
205
|
+
cursor: not-allowed;
|
|
223
206
|
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
207
|
+
td[aria-disabled] {
|
|
208
|
+
opacity: var(--tct-calendar-day-disabled-opacity, var(--t-calendar-day-disabled-opacity, var(--app-disabled-opacity, 0.4)));
|
|
209
|
+
}
|
|
210
|
+
td[aria-selected] {
|
|
211
|
+
background-color: var(--tct-calendar-day-selected-bg, var(--t-calendar-day-selected-bg, var(--tct-calendar-day-hover-bg, var(--t-calendar-day-hover-bg, var(--tct-gray-14, var(--t-gray-14, var(--tct-gray-l4, var(--app-gray-l4, #f2f2f2))))))));
|
|
212
|
+
color: var(--tct-calendar-day-selected-font-color, var(--t-calendar-day-selected-font-color, var(--tct-calendar-day-hover-font-color, var(--t-calendar-day-hover-font-color, inherit))));
|
|
213
|
+
box-shadow: inset 2px 2px var(--tct-calendar-day-selected-outline-color, var(--t-calendar-day-selected-outline-color, var(--tct-stoplight-info, var(--const-stoplight-info, #0079c1)))), inset -2px -2px var(--tct-calendar-day-selected-outline-color, var(--t-calendar-day-selected-outline-color, var(--tct-stoplight-info, var(--const-stoplight-info, #0079c1))));
|
|
227
214
|
}
|
|
228
215
|
|
|
229
216
|
.today-decorator {
|
|
@@ -233,17 +220,9 @@ q2-input {
|
|
|
233
220
|
height: 12px;
|
|
234
221
|
}
|
|
235
222
|
|
|
236
|
-
.activity-decorator {
|
|
237
|
-
width: var(--tct-scale-1, var(--app-scale-1, 5px));
|
|
238
|
-
height: var(--tct-scale-1, var(--app-scale-1, 5px));
|
|
239
|
-
border-radius: 50%;
|
|
240
|
-
margin: 0 auto;
|
|
241
|
-
background-color: var(--tct-calendar-activity-indicator-color, var(--tct-stoplight-info, var(--const-stoplight-info, #0079c1)));
|
|
242
|
-
}
|
|
243
|
-
|
|
244
223
|
.calendar-disclaimer {
|
|
245
|
-
font-size: var(--tct-calendar-disclaimer-font-size, var(--tct-font-size-small, var(--app-font-size-small, 12px)));
|
|
246
|
-
border-top: 1px solid var(--tct-calendar-disclaimer-border-color, var(--tct-gray-13, var(--t-gray-13, var(--tct-gray-l3, var(--app-gray-l3, #e6e6e6)))));
|
|
224
|
+
font-size: var(--tct-calendar-disclaimer-font-size, var(--t-calendar-disclaimer-font-size, var(--tct-font-size-small, var(--app-font-size-small, 12px))));
|
|
225
|
+
border-top: 1px solid var(--tct-calendar-disclaimer-border-color, var(--t-calendar-disclaimer-border-color, var(--tct-gray-13, var(--t-gray-13, var(--tct-gray-l3, var(--app-gray-l3, #e6e6e6))))));
|
|
247
226
|
padding: var(--tct-calendar-disclaimer-padding, var(--tct-scale-2, var(--app-scale-2, 10px)));
|
|
248
227
|
text-align: left;
|
|
249
228
|
}
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import { firstDayOfWeekInMonth } from './helpers';
|
|
2
|
-
import
|
|
3
|
-
function generateDatesFromMonthYear(month, year) {
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
datesArr = datesArr.concat(lastDayInList.clone().add(1, 'day'));
|
|
10
|
-
}
|
|
11
|
-
return datesArr;
|
|
2
|
+
import { getDaysInMonth, isSameDay, isBefore, isAfter, isValid as isValidDate } from 'date-fns';
|
|
3
|
+
export function generateDatesFromMonthYear(month, year) {
|
|
4
|
+
const daysInMonth = getDaysInMonth(new Date(year, month));
|
|
5
|
+
return [...Array(daysInMonth).keys()].reduce((acc, stepIndex) => {
|
|
6
|
+
acc.push(new Date(year, month, stepIndex + 1));
|
|
7
|
+
return acc;
|
|
8
|
+
}, []);
|
|
12
9
|
}
|
|
13
10
|
export function getValidDaysOfWeek(checksum = 127) {
|
|
14
11
|
const sunValid = checksum & 1;
|
|
@@ -19,173 +16,110 @@ export function getValidDaysOfWeek(checksum = 127) {
|
|
|
19
16
|
const friValid = checksum & 32;
|
|
20
17
|
const satValid = checksum & 64;
|
|
21
18
|
const ret = [];
|
|
22
|
-
if (checksum
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
if (friValid) {
|
|
39
|
-
ret.push(5);
|
|
40
|
-
}
|
|
41
|
-
if (satValid) {
|
|
42
|
-
ret.push(6);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
19
|
+
if (checksum <= 0)
|
|
20
|
+
return ret;
|
|
21
|
+
if (sunValid)
|
|
22
|
+
ret.push(0);
|
|
23
|
+
if (monValid)
|
|
24
|
+
ret.push(1);
|
|
25
|
+
if (tuesValid)
|
|
26
|
+
ret.push(2);
|
|
27
|
+
if (wedsValid)
|
|
28
|
+
ret.push(3);
|
|
29
|
+
if (thursValid)
|
|
30
|
+
ret.push(4);
|
|
31
|
+
if (friValid)
|
|
32
|
+
ret.push(5);
|
|
33
|
+
if (satValid)
|
|
34
|
+
ret.push(6);
|
|
45
35
|
return ret;
|
|
46
36
|
}
|
|
47
37
|
export function validateAgainstChecksum(validDaysOfWeek, newDate) {
|
|
48
|
-
return validDaysOfWeek.includes(newDate.
|
|
38
|
+
return validDaysOfWeek.includes(newDate.getDay());
|
|
49
39
|
}
|
|
50
|
-
export function validateAgainstBlacklist(
|
|
51
|
-
return !
|
|
40
|
+
export function validateAgainstBlacklist(invalidDates, newDate) {
|
|
41
|
+
return !validateAgainstWhitelist(invalidDates, newDate);
|
|
52
42
|
}
|
|
53
|
-
export function validateAgainstWhitelist(
|
|
54
|
-
return
|
|
43
|
+
export function validateAgainstWhitelist(validDates, newDate) {
|
|
44
|
+
return validDates.some(validDate => isSameDay(validDate, newDate));
|
|
55
45
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
const validationFns = [];
|
|
61
|
-
if (validDateMoments === null || validDateMoments === void 0 ? void 0 : validDateMoments.length) {
|
|
62
|
-
validationFns.push(validateAgainstWhitelist.bind(null, validDateMoments));
|
|
46
|
+
export function buildDates(validDaysOfWeek, validDates, invalidDates, selectedMonthYear, currentSelection, dateValidators, typedValue) {
|
|
47
|
+
const validationFns = [baseValidation.bind(null, dateValidators, new Date())];
|
|
48
|
+
if (validDates === null || validDates === void 0 ? void 0 : validDates.length) {
|
|
49
|
+
validationFns.push(validateAgainstWhitelist.bind(null, validDates));
|
|
63
50
|
}
|
|
64
51
|
else {
|
|
65
52
|
validationFns.push(validateAgainstChecksum.bind(null, validDaysOfWeek));
|
|
66
53
|
}
|
|
67
|
-
validationFns.push(validateAgainstBlacklist.bind(null,
|
|
68
|
-
return generateDateList(selectedMonthYear, currentSelection,
|
|
69
|
-
}
|
|
70
|
-
export function generateDateList({ monthIndex,
|
|
71
|
-
const
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
const [isStartDate, isEndDate, isToday, isSelected] = applyDateClasses(momentDate, dateValidators, currentSelection);
|
|
79
|
-
const isFirst = isFirstDayOfWeek(dayIndexOfWeek);
|
|
80
|
-
const isLast = isLastDayOfWeek(dayIndexOfWeek);
|
|
81
|
-
const dayOfWeek = daysOfWeek[dayIndexOfWeek];
|
|
82
|
-
const classList = generateClassesForCalDay(!isInvalid, isFirst, isLast, isSelected, isEndDate, isStartDate, isToday, typedDate.toString() === 'Invalid Date');
|
|
83
|
-
return {
|
|
84
|
-
isValid: !isInvalid,
|
|
85
|
-
isEmpty: false,
|
|
86
|
-
dateString: momentDate.format('YYYY-MM-DD'),
|
|
87
|
-
integer: dateIndex + 1,
|
|
88
|
-
month,
|
|
89
|
-
year,
|
|
90
|
-
dayOfWeek,
|
|
91
|
-
metaDataTop,
|
|
92
|
-
metaDataBottom,
|
|
93
|
-
isActivityDate,
|
|
94
|
-
isStartDate,
|
|
95
|
-
isEndDate,
|
|
96
|
-
isSelected,
|
|
97
|
-
isToday,
|
|
98
|
-
isFirst,
|
|
99
|
-
isLast,
|
|
100
|
-
classList
|
|
101
|
-
};
|
|
54
|
+
validationFns.push(validateAgainstBlacklist.bind(null, invalidDates));
|
|
55
|
+
return generateDateList(selectedMonthYear, currentSelection, dateValidators, validationFns, typedValue);
|
|
56
|
+
}
|
|
57
|
+
export function generateDateList({ monthIndex, selectedYear }, currentSelection, dateValidators, validationFns, typedValue) {
|
|
58
|
+
const isIncompleteDate = !isValidDate(new Date(typedValue));
|
|
59
|
+
const datesInMonth = generateDatesFromMonthYear(monthIndex, selectedYear).map((dayInMonth, dateIndex) => {
|
|
60
|
+
const isInvalid = validationFns.some(fn => !fn(dayInMonth));
|
|
61
|
+
const dayState = getDayState(dayInMonth, dateValidators, currentSelection);
|
|
62
|
+
const classList = generateClassesForCalDay(Object.assign(Object.assign({}, dayState), { isInvalid,
|
|
63
|
+
isIncompleteDate }));
|
|
64
|
+
return Object.assign(Object.assign({}, dayState), { isValid: !isInvalid, date: dayInMonth, integer: dateIndex + 1, isEmpty: false, isActivity: false, classList });
|
|
102
65
|
});
|
|
66
|
+
const startOfMonthEmpties = addEmptiesMonthStart(firstDayOfWeekInMonth(monthIndex, selectedYear));
|
|
103
67
|
const endOfMonthEmpties = addEmptiesMonthEnd((startOfMonthEmpties.length + datesInMonth.length) % 7);
|
|
104
|
-
return startOfMonthEmpties
|
|
105
|
-
}
|
|
106
|
-
function baseValidation(dateValidators, now, newDate) {
|
|
107
|
-
const
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
const
|
|
117
|
-
const
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
return
|
|
136
|
-
}
|
|
137
|
-
function
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
68
|
+
return [...startOfMonthEmpties, ...datesInMonth, ...endOfMonthEmpties];
|
|
69
|
+
}
|
|
70
|
+
export function baseValidation(dateValidators, now, newDate) {
|
|
71
|
+
const isNewDateBeforeStartDate = isAfter(dateValidators === null || dateValidators === void 0 ? void 0 : dateValidators.startDate, newDate);
|
|
72
|
+
const isNewDateAfterEndDate = isBefore(dateValidators === null || dateValidators === void 0 ? void 0 : dateValidators.endDate, newDate);
|
|
73
|
+
const isNowAfterCutoffTime = isSameDay(now, newDate) && isAfter(now, dateValidators === null || dateValidators === void 0 ? void 0 : dateValidators.cutOffTime);
|
|
74
|
+
return !(isNewDateBeforeStartDate || isNowAfterCutoffTime || isNewDateAfterEndDate);
|
|
75
|
+
}
|
|
76
|
+
export function getDayState(dayInMonth, dateValidators, currentDate) {
|
|
77
|
+
if (!currentDate)
|
|
78
|
+
currentDate = new Date();
|
|
79
|
+
const isSelected = currentDate && isSameDay(currentDate, dayInMonth);
|
|
80
|
+
const isToday = isSameDay(dayInMonth, new Date());
|
|
81
|
+
const isStartDate = isSameDay(dayInMonth, dateValidators === null || dateValidators === void 0 ? void 0 : dateValidators.startDate);
|
|
82
|
+
const isEndDate = isSameDay(dayInMonth, dateValidators === null || dateValidators === void 0 ? void 0 : dateValidators.endDate);
|
|
83
|
+
return { isSelected, isToday, isStartDate, isEndDate };
|
|
84
|
+
}
|
|
85
|
+
export function generateClassesForCalDay({ isInvalid, isSelected, isEndDate, isStartDate, isToday, isIncompleteDate }) {
|
|
86
|
+
const classes = [];
|
|
87
|
+
if (!isInvalid)
|
|
88
|
+
classes.push('is-valid');
|
|
89
|
+
if (isSelected)
|
|
90
|
+
classes.push('is-selected');
|
|
91
|
+
if (isEndDate)
|
|
92
|
+
classes.push('is-end-date');
|
|
93
|
+
if (isStartDate)
|
|
94
|
+
classes.push('is-start-date');
|
|
95
|
+
if (isToday)
|
|
96
|
+
classes.push('is-today');
|
|
97
|
+
if (isSelected && isInvalid && !isIncompleteDate)
|
|
98
|
+
classes.push('is-unavailable');
|
|
99
|
+
return classes.join(' ');
|
|
100
|
+
}
|
|
101
|
+
export function addEmptiesMonthStart(monthStartDayOfWeek) {
|
|
102
|
+
return addEmptyDates(0, monthStartDayOfWeek);
|
|
103
|
+
}
|
|
104
|
+
export function addEmptiesMonthEnd(monthEndDayOfWeek) {
|
|
105
|
+
if (monthEndDayOfWeek === 0)
|
|
142
106
|
return [];
|
|
143
|
-
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
isSelected: false,
|
|
162
|
-
isRepeatDate: false,
|
|
163
|
-
isStartDate: false,
|
|
164
|
-
isEndDate: false,
|
|
165
|
-
metaDataTop: '',
|
|
166
|
-
metaDataBottom: '',
|
|
167
|
-
dayOfWeek: '',
|
|
168
|
-
classList: ''
|
|
169
|
-
};
|
|
170
|
-
processCount(newDate, i);
|
|
171
|
-
dates.push(newDate);
|
|
172
|
-
}
|
|
173
|
-
return dates;
|
|
174
|
-
}
|
|
175
|
-
function isFirstDayOfWeek(dayCount) {
|
|
176
|
-
return dayCount === 0 || dayCount % 7 === 0;
|
|
177
|
-
}
|
|
178
|
-
function isLastDayOfWeek(dayCount) {
|
|
179
|
-
return dayCount % 7 === 6;
|
|
180
|
-
}
|
|
181
|
-
function processCount(newCalendarDate, count) {
|
|
182
|
-
let returnCount = count;
|
|
183
|
-
if (count === 0 || count % 7 === 0) {
|
|
184
|
-
newCalendarDate.isFirst = true;
|
|
185
|
-
returnCount = 0;
|
|
186
|
-
}
|
|
187
|
-
else if (count % 7 === 6) {
|
|
188
|
-
newCalendarDate.isLast = true;
|
|
189
|
-
}
|
|
190
|
-
return returnCount;
|
|
107
|
+
return addEmptyDates(monthEndDayOfWeek, 7);
|
|
108
|
+
}
|
|
109
|
+
export const emptyDate = {
|
|
110
|
+
date: null,
|
|
111
|
+
integer: null,
|
|
112
|
+
isActivity: false,
|
|
113
|
+
isEmpty: true,
|
|
114
|
+
isValid: false,
|
|
115
|
+
isToday: false,
|
|
116
|
+
isSelected: false,
|
|
117
|
+
isStartDate: false,
|
|
118
|
+
isEndDate: false,
|
|
119
|
+
classList: ''
|
|
120
|
+
};
|
|
121
|
+
export function addEmptyDates(from, to) {
|
|
122
|
+
if (from === 7)
|
|
123
|
+
from = 0;
|
|
124
|
+
return [...Array(to - from).keys()].map(() => (Object.assign({}, emptyDate)));
|
|
191
125
|
}
|