@rockshin/tao-ui 0.0.47 → 0.0.49
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/components/affix/affix.js +20 -16
- package/dist/components/alert/alert.js +114 -99
- package/dist/components/app/app-modals.js +134 -96
- package/dist/components/app/app-notices.js +39 -23
- package/dist/components/auto-complete/auto-complete.js +21 -7
- package/dist/components/avatar/avatar.js +31 -11
- package/dist/components/badge/badge.css +1 -1
- package/dist/components/badge/badge.js +72 -257
- package/dist/components/border-beam/border-beam.js +21 -17
- package/dist/components/breadcrumb/breadcrumb.js +178 -159
- package/dist/components/button/button.js +61 -53
- package/dist/components/calendar/calendar.js +6 -4
- package/dist/components/card/card.js +24 -8
- package/dist/components/carousel/carousel.d.ts +1 -1
- package/dist/components/carousel/carousel.js +105 -68
- package/dist/components/cascader/cascader.js +54 -19
- package/dist/components/checkbox/checkbox.css +13 -2
- package/dist/components/checkbox/checkbox.d.ts +2 -0
- package/dist/components/checkbox/checkbox.js +320 -229
- package/dist/components/collapse/collapse-panels.d.ts +1 -1
- package/dist/components/collapse/collapse-panels.js +122 -113
- package/dist/components/collapse/collapse.js +98 -63
- package/dist/components/color-picker/color-picker.js +539 -441
- package/dist/components/color-picker/color.js +1 -1
- package/dist/components/context-menu/context-menu.d.ts +1 -1
- package/dist/components/context-menu/context-menu.js +108 -68
- package/dist/components/date-picker/calendar/calendar-grid.js +42 -39
- package/dist/components/date-picker/calendar/month-grid.d.ts +8 -1
- package/dist/components/date-picker/calendar/month-grid.js +79 -37
- package/dist/components/date-picker/calendar/time-panel.d.ts +2 -1
- package/dist/components/date-picker/calendar/time-panel.js +94 -89
- package/dist/components/date-picker/calendar/year-grid.d.ts +8 -1
- package/dist/components/date-picker/calendar/year-grid.js +66 -35
- package/dist/components/date-picker/date-picker.css +24 -1
- package/dist/components/date-picker/date-picker.js +99 -53
- package/dist/components/date-picker/presets.d.ts +2 -1
- package/dist/components/date-picker/presets.js +27 -24
- package/dist/components/date-picker/range-picker.js +308 -153
- package/dist/components/descriptions/descriptions.js +7 -3
- package/dist/components/divider/divider.css +1 -1
- package/dist/components/divider/divider.js +1 -1
- package/dist/components/drawer/drawer.js +201 -369
- package/dist/components/dropdown/dropdown.d.ts +1 -1
- package/dist/components/dropdown/dropdown.js +183 -279
- package/dist/components/empty/empty.js +57 -78
- package/dist/components/float-button/float-button.d.ts +1 -0
- package/dist/components/float-button/float-button.js +47 -30
- package/dist/components/form/field-control.d.ts +4 -2
- package/dist/components/form/field-control.js +17 -9
- package/dist/components/form/form-context.d.ts +8 -2
- package/dist/components/form/form-context.js +2 -1
- package/dist/components/form/form-item.js +85 -63
- package/dist/components/form/form.css +3 -2
- package/dist/components/form/use-form.d.ts +2 -1
- package/dist/components/form/use-form.js +2 -1
- package/dist/components/form-field/form-field-view.d.ts +3 -1
- package/dist/components/form-field/form-field-view.js +194 -141
- package/dist/components/form-section/form-section.d.ts +1 -1
- package/dist/components/form-section/form-section.js +52 -45
- package/dist/components/image/image.js +585 -477
- package/dist/components/input/base-input.js +8 -9
- package/dist/components/input/input-shared.d.ts +5 -2
- package/dist/components/input/input-shared.js +42 -18
- package/dist/components/input/otp.js +236 -217
- package/dist/components/input/password.js +2 -1
- package/dist/components/input/search.js +8 -7
- package/dist/components/list/list-pagination.js +41 -36
- package/dist/components/list/list.js +141 -125
- package/dist/components/listy/listy.js +175 -106
- package/dist/components/masonry/masonry.js +108 -85
- package/dist/components/mentions/mentions.js +12 -3
- package/dist/components/menu/menu-render.d.ts +9 -3
- package/dist/components/menu/menu-render.js +99 -36
- package/dist/components/modal/confirm-dialog.js +10 -4
- package/dist/components/modal/confirm.js +3 -7
- package/dist/components/modal/index.js +9 -3
- package/dist/components/modal/modal.js +390 -365
- package/dist/components/pagination/pagination.js +105 -96
- package/dist/components/popconfirm/popconfirm.d.ts +1 -1
- package/dist/components/popconfirm/popconfirm.js +219 -168
- package/dist/components/popover/popover.js +330 -243
- package/dist/components/progress/progress.css +2 -2
- package/dist/components/progress/progress.js +232 -458
- package/dist/components/qr-code/qr-code.js +72 -66
- package/dist/components/radio/radio.css +15 -4
- package/dist/components/radio/radio.d.ts +2 -1
- package/dist/components/radio/radio.js +260 -198
- package/dist/components/rate/rate.js +173 -113
- package/dist/components/scroll-area/scroll-area.js +241 -211
- package/dist/components/segmented/segmented.js +73 -41
- package/dist/components/select/mobile-select.d.ts +2 -1
- package/dist/components/select/mobile-select.js +24 -13
- package/dist/components/select/select-searchable-list.d.ts +2 -1
- package/dist/components/select/select-searchable-list.js +2 -3
- package/dist/components/select/select.js +49 -25
- package/dist/components/select/use-select-selection.d.ts +1 -1
- package/dist/components/select/use-select-selection.js +7 -4
- package/dist/components/skeleton/skeleton.js +56 -48
- package/dist/components/slider/slider.js +87 -212
- package/dist/components/sonner/sonner.js +109 -93
- package/dist/components/spinner/spinner.js +147 -138
- package/dist/components/splitter/splitter.js +222 -159
- package/dist/components/statistic/statistic.js +7 -6
- package/dist/components/steps/steps.js +88 -81
- package/dist/components/steps/use-display-steps.js +1 -1
- package/dist/components/switch/switch.js +89 -89
- package/dist/components/table/table-filter.js +66 -56
- package/dist/components/table/table-icons.d.ts +2 -1
- package/dist/components/table/table-icons.js +11 -9
- package/dist/components/table/table-model.js +1 -1
- package/dist/components/table/table.js +107 -83
- package/dist/components/table/use-table-data.d.ts +6 -3
- package/dist/components/table/use-table-data.js +166 -130
- package/dist/components/tabs/tabs.css +1 -1
- package/dist/components/tabs/tabs.js +236 -179
- package/dist/components/tag/tag.d.ts +2 -2
- package/dist/components/tag/tag.js +111 -108
- package/dist/components/textarea/textarea.js +22 -17
- package/dist/components/time-picker/time-picker.js +5 -3
- package/dist/components/timeline/timeline.css +6 -1
- package/dist/components/timeline/timeline.js +21 -11
- package/dist/components/tooltip/tooltip.d.ts +2 -2
- package/dist/components/tooltip/tooltip.js +123 -233
- package/dist/components/tour/tour.css +4 -0
- package/dist/components/tour/tour.js +400 -331
- package/dist/components/transfer/transfer-list.js +29 -11
- package/dist/components/transfer/transfer-parts.js +1 -1
- package/dist/components/transfer/transfer-types.d.ts +1 -0
- package/dist/components/transfer/transfer.js +29 -14
- package/dist/components/tree/tree-keyboard.d.ts +1 -1
- package/dist/components/tree/tree-keyboard.js +5 -3
- package/dist/components/tree/tree.js +74 -59
- package/dist/components/tree-select/select-engine.d.ts +3 -2
- package/dist/components/tree-select/select-engine.js +18 -16
- package/dist/components/tree-select/tree-select.js +21 -5
- package/dist/components/upload/upload.css +8 -0
- package/dist/components/upload/upload.js +160 -72
- package/dist/components/watermark/watermark.js +36 -29
- package/dist/number-input/use-number-input.js +129 -90
- package/dist/number-input/validate.js +32 -5
- package/dist/provider/merge-locale.js +12 -9
- package/dist/provider/tao-provider.d.ts +3 -1
- package/dist/provider/tao-provider.js +123 -86
- package/package.json +1 -1
|
@@ -3,8 +3,8 @@ import { c } from "react-compiler-runtime";
|
|
|
3
3
|
import { useEffect, useRef } from "react";
|
|
4
4
|
import { useTaoConfig } from "../../../provider/tao-provider.js";
|
|
5
5
|
function TimePanel(t0) {
|
|
6
|
-
const $ = c(
|
|
7
|
-
const { hour, minute, second, onChange, config, scrollKey } = t0;
|
|
6
|
+
const $ = c(43);
|
|
7
|
+
const { hour, minute, second, disabled, onChange, config, scrollKey } = t0;
|
|
8
8
|
const { locale } = useTaoConfig();
|
|
9
9
|
const hourStep = config?.hourStep ?? 1;
|
|
10
10
|
const minuteStep = config?.minuteStep ?? 1;
|
|
@@ -45,71 +45,77 @@ function TimePanel(t0) {
|
|
|
45
45
|
$[9] = t4;
|
|
46
46
|
} else t4 = $[9];
|
|
47
47
|
let t5;
|
|
48
|
-
if ($[10] !==
|
|
48
|
+
if ($[10] !== disabled || $[11] !== hour || $[12] !== hours || $[13] !== locale.hour || $[14] !== scrollKey || $[15] !== t4) {
|
|
49
49
|
t5 = /*#__PURE__*/ jsx(TimeColumn, {
|
|
50
50
|
values: hours,
|
|
51
51
|
selected: hour,
|
|
52
52
|
onSelect: t4,
|
|
53
53
|
label: locale.hour,
|
|
54
|
+
disabled: disabled,
|
|
54
55
|
scrollKey: scrollKey
|
|
55
56
|
});
|
|
56
|
-
$[10] =
|
|
57
|
-
$[11] =
|
|
58
|
-
$[12] =
|
|
59
|
-
$[13] =
|
|
60
|
-
$[14] =
|
|
61
|
-
$[15] =
|
|
62
|
-
|
|
57
|
+
$[10] = disabled;
|
|
58
|
+
$[11] = hour;
|
|
59
|
+
$[12] = hours;
|
|
60
|
+
$[13] = locale.hour;
|
|
61
|
+
$[14] = scrollKey;
|
|
62
|
+
$[15] = t4;
|
|
63
|
+
$[16] = t5;
|
|
64
|
+
} else t5 = $[16];
|
|
63
65
|
let t6;
|
|
64
|
-
if ($[
|
|
66
|
+
if ($[17] !== hour || $[18] !== onChange || $[19] !== second) {
|
|
65
67
|
t6 = (v_0)=>onChange(hour, v_0, second);
|
|
66
|
-
$[
|
|
67
|
-
$[
|
|
68
|
-
$[
|
|
69
|
-
$[
|
|
70
|
-
} else t6 = $[
|
|
68
|
+
$[17] = hour;
|
|
69
|
+
$[18] = onChange;
|
|
70
|
+
$[19] = second;
|
|
71
|
+
$[20] = t6;
|
|
72
|
+
} else t6 = $[20];
|
|
71
73
|
let t7;
|
|
72
|
-
if ($[
|
|
74
|
+
if ($[21] !== disabled || $[22] !== locale.minute || $[23] !== minute || $[24] !== minutes || $[25] !== scrollKey || $[26] !== t6) {
|
|
73
75
|
t7 = /*#__PURE__*/ jsx(TimeColumn, {
|
|
74
76
|
values: minutes,
|
|
75
77
|
selected: minute,
|
|
76
78
|
onSelect: t6,
|
|
77
79
|
label: locale.minute,
|
|
80
|
+
disabled: disabled,
|
|
78
81
|
scrollKey: scrollKey
|
|
79
82
|
});
|
|
80
|
-
$[
|
|
81
|
-
$[
|
|
82
|
-
$[
|
|
83
|
-
$[
|
|
84
|
-
$[
|
|
85
|
-
$[
|
|
86
|
-
|
|
83
|
+
$[21] = disabled;
|
|
84
|
+
$[22] = locale.minute;
|
|
85
|
+
$[23] = minute;
|
|
86
|
+
$[24] = minutes;
|
|
87
|
+
$[25] = scrollKey;
|
|
88
|
+
$[26] = t6;
|
|
89
|
+
$[27] = t7;
|
|
90
|
+
} else t7 = $[27];
|
|
87
91
|
let t8;
|
|
88
|
-
if ($[
|
|
92
|
+
if ($[28] !== hour || $[29] !== minute || $[30] !== onChange) {
|
|
89
93
|
t8 = (v_1)=>onChange(hour, minute, v_1);
|
|
90
|
-
$[
|
|
91
|
-
$[
|
|
92
|
-
$[
|
|
93
|
-
$[
|
|
94
|
-
} else t8 = $[
|
|
94
|
+
$[28] = hour;
|
|
95
|
+
$[29] = minute;
|
|
96
|
+
$[30] = onChange;
|
|
97
|
+
$[31] = t8;
|
|
98
|
+
} else t8 = $[31];
|
|
95
99
|
let t9;
|
|
96
|
-
if ($[
|
|
100
|
+
if ($[32] !== disabled || $[33] !== locale.second || $[34] !== scrollKey || $[35] !== second || $[36] !== seconds || $[37] !== t8) {
|
|
97
101
|
t9 = /*#__PURE__*/ jsx(TimeColumn, {
|
|
98
102
|
values: seconds,
|
|
99
103
|
selected: second,
|
|
100
104
|
onSelect: t8,
|
|
101
105
|
label: locale.second,
|
|
106
|
+
disabled: disabled,
|
|
102
107
|
scrollKey: scrollKey
|
|
103
108
|
});
|
|
104
|
-
$[
|
|
105
|
-
$[
|
|
106
|
-
$[
|
|
107
|
-
$[
|
|
108
|
-
$[
|
|
109
|
-
$[
|
|
110
|
-
|
|
109
|
+
$[32] = disabled;
|
|
110
|
+
$[33] = locale.second;
|
|
111
|
+
$[34] = scrollKey;
|
|
112
|
+
$[35] = second;
|
|
113
|
+
$[36] = seconds;
|
|
114
|
+
$[37] = t8;
|
|
115
|
+
$[38] = t9;
|
|
116
|
+
} else t9 = $[38];
|
|
111
117
|
let t10;
|
|
112
|
-
if ($[
|
|
118
|
+
if ($[39] !== t5 || $[40] !== t7 || $[41] !== t9) {
|
|
113
119
|
t10 = /*#__PURE__*/ jsxs("div", {
|
|
114
120
|
"data-tao-time-panel": "",
|
|
115
121
|
children: [
|
|
@@ -118,57 +124,61 @@ function TimePanel(t0) {
|
|
|
118
124
|
t9
|
|
119
125
|
]
|
|
120
126
|
});
|
|
121
|
-
$[
|
|
122
|
-
$[
|
|
123
|
-
$[
|
|
124
|
-
$[
|
|
125
|
-
} else t10 = $[
|
|
127
|
+
$[39] = t5;
|
|
128
|
+
$[40] = t7;
|
|
129
|
+
$[41] = t9;
|
|
130
|
+
$[42] = t10;
|
|
131
|
+
} else t10 = $[42];
|
|
126
132
|
return t10;
|
|
127
133
|
}
|
|
134
|
+
function centerSelected(list, behavior) {
|
|
135
|
+
const selected = list.querySelector('[data-tao-selected]');
|
|
136
|
+
if (!selected) return;
|
|
137
|
+
list.scrollTo({
|
|
138
|
+
top: list.scrollTop + selected.getBoundingClientRect().top - list.getBoundingClientRect().top - (list.clientHeight - selected.offsetHeight) / 2,
|
|
139
|
+
behavior
|
|
140
|
+
});
|
|
141
|
+
}
|
|
128
142
|
function TimeColumn(t0) {
|
|
129
|
-
const $ = c(
|
|
130
|
-
const { values, selected, onSelect, label, scrollKey } = t0;
|
|
143
|
+
const $ = c(21);
|
|
144
|
+
const { values, selected, onSelect, label, disabled, scrollKey } = t0;
|
|
131
145
|
const listRef = useRef(null);
|
|
132
|
-
const initRef = _temp;
|
|
133
146
|
let t1;
|
|
134
147
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
135
|
-
t1 = ()=>{
|
|
136
|
-
|
|
137
|
-
if (
|
|
138
|
-
const selectedEl_0 = el_0.querySelector("[data-tao-selected]");
|
|
139
|
-
selectedEl_0?.scrollIntoView({
|
|
140
|
-
block: "center",
|
|
141
|
-
behavior: "smooth"
|
|
142
|
-
});
|
|
148
|
+
t1 = (el)=>{
|
|
149
|
+
listRef.current = el;
|
|
150
|
+
if (el) centerSelected(el, "instant");
|
|
143
151
|
};
|
|
144
152
|
$[0] = t1;
|
|
145
153
|
} else t1 = $[0];
|
|
154
|
+
const initRef = t1;
|
|
146
155
|
let t2;
|
|
147
|
-
if ($[1]
|
|
148
|
-
t2 =
|
|
156
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
157
|
+
t2 = ()=>{
|
|
158
|
+
const el_0 = listRef.current;
|
|
159
|
+
if (!el_0) return;
|
|
160
|
+
centerSelected(el_0, "smooth");
|
|
161
|
+
};
|
|
162
|
+
$[1] = t2;
|
|
163
|
+
} else t2 = $[1];
|
|
164
|
+
let t3;
|
|
165
|
+
if ($[2] !== scrollKey || $[3] !== selected) {
|
|
166
|
+
t3 = [
|
|
149
167
|
selected,
|
|
150
168
|
scrollKey
|
|
151
169
|
];
|
|
152
|
-
$[
|
|
153
|
-
$[
|
|
154
|
-
$[
|
|
155
|
-
} else
|
|
156
|
-
useEffect(
|
|
157
|
-
let
|
|
158
|
-
if ($[
|
|
159
|
-
|
|
170
|
+
$[2] = scrollKey;
|
|
171
|
+
$[3] = selected;
|
|
172
|
+
$[4] = t3;
|
|
173
|
+
} else t3 = $[4];
|
|
174
|
+
useEffect(t2, t3);
|
|
175
|
+
let t4;
|
|
176
|
+
if ($[5] !== label) {
|
|
177
|
+
t4 = /*#__PURE__*/ jsx("div", {
|
|
160
178
|
"data-tao-time-column-title": "",
|
|
161
179
|
children: label
|
|
162
180
|
});
|
|
163
|
-
$[
|
|
164
|
-
$[5] = t3;
|
|
165
|
-
} else t3 = $[5];
|
|
166
|
-
let t4;
|
|
167
|
-
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
168
|
-
t4 = (el_1)=>{
|
|
169
|
-
listRef.current = el_1;
|
|
170
|
-
initRef(el_1);
|
|
171
|
-
};
|
|
181
|
+
$[5] = label;
|
|
172
182
|
$[6] = t4;
|
|
173
183
|
} else t4 = $[6];
|
|
174
184
|
let t5;
|
|
@@ -197,34 +207,29 @@ function TimeColumn(t0) {
|
|
|
197
207
|
if ($[14] !== t5) {
|
|
198
208
|
t6 = /*#__PURE__*/ jsx("div", {
|
|
199
209
|
"data-tao-time-column-list": "",
|
|
200
|
-
ref:
|
|
210
|
+
ref: initRef,
|
|
201
211
|
children: t5
|
|
202
212
|
});
|
|
203
213
|
$[14] = t5;
|
|
204
214
|
$[15] = t6;
|
|
205
215
|
} else t6 = $[15];
|
|
206
216
|
let t7;
|
|
207
|
-
if ($[16] !==
|
|
217
|
+
if ($[16] !== disabled || $[17] !== label || $[18] !== t4 || $[19] !== t6) {
|
|
208
218
|
t7 = /*#__PURE__*/ jsxs("fieldset", {
|
|
209
219
|
"data-tao-time-column": "",
|
|
210
220
|
"aria-label": label,
|
|
221
|
+
disabled: disabled,
|
|
211
222
|
children: [
|
|
212
|
-
|
|
223
|
+
t4,
|
|
213
224
|
t6
|
|
214
225
|
]
|
|
215
226
|
});
|
|
216
|
-
$[16] =
|
|
217
|
-
$[17] =
|
|
218
|
-
$[18] =
|
|
219
|
-
$[19] =
|
|
220
|
-
|
|
227
|
+
$[16] = disabled;
|
|
228
|
+
$[17] = label;
|
|
229
|
+
$[18] = t4;
|
|
230
|
+
$[19] = t6;
|
|
231
|
+
$[20] = t7;
|
|
232
|
+
} else t7 = $[20];
|
|
221
233
|
return t7;
|
|
222
234
|
}
|
|
223
|
-
function _temp(el) {
|
|
224
|
-
if (!el) return;
|
|
225
|
-
const selectedEl = el.querySelector("[data-tao-selected]");
|
|
226
|
-
selectedEl?.scrollIntoView({
|
|
227
|
-
block: "center"
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
235
|
export { TimePanel };
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import type { Dayjs } from 'dayjs';
|
|
2
|
+
import type { CSSProperties } from 'react';
|
|
2
3
|
interface YearGridProps {
|
|
3
4
|
viewDate: Dayjs;
|
|
4
5
|
value?: Dayjs | null;
|
|
6
|
+
rangeStart?: Dayjs | null;
|
|
7
|
+
rangeEnd?: Dayjs | null;
|
|
5
8
|
onSelect: (date: Dayjs) => void;
|
|
6
9
|
disabledDate?: (date: Dayjs) => boolean;
|
|
7
10
|
minDate?: Dayjs;
|
|
8
11
|
maxDate?: Dayjs;
|
|
12
|
+
className?: string;
|
|
13
|
+
style?: CSSProperties;
|
|
14
|
+
cellClassName?: string;
|
|
15
|
+
cellStyle?: CSSProperties;
|
|
9
16
|
}
|
|
10
|
-
export declare function YearGrid({ viewDate, value, onSelect, disabledDate, minDate, maxDate, }: YearGridProps): import("react").JSX.Element;
|
|
17
|
+
export declare function YearGrid({ viewDate, value, rangeStart, rangeEnd, onSelect, disabledDate, minDate, maxDate, className, style, cellClassName, cellStyle, }: YearGridProps): import("react").JSX.Element;
|
|
11
18
|
export {};
|
|
@@ -2,24 +2,37 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { c } from "react-compiler-runtime";
|
|
3
3
|
import { getYears } from "./use-calendar.js";
|
|
4
4
|
function YearGrid(t0) {
|
|
5
|
-
const $ = c(
|
|
6
|
-
const { viewDate, value, onSelect, disabledDate, minDate, maxDate } = t0;
|
|
5
|
+
const $ = c(32);
|
|
6
|
+
const { viewDate, value, rangeStart, rangeEnd, onSelect, disabledDate, minDate, maxDate, className, style, cellClassName, cellStyle } = t0;
|
|
7
7
|
let t1;
|
|
8
8
|
let t2;
|
|
9
|
-
|
|
9
|
+
let t3;
|
|
10
|
+
let t4;
|
|
11
|
+
if ($[0] !== cellClassName || $[1] !== cellStyle || $[2] !== className || $[3] !== disabledDate || $[4] !== maxDate || $[5] !== minDate || $[6] !== onSelect || $[7] !== rangeEnd || $[8] !== rangeStart || $[9] !== style || $[10] !== value || $[11] !== viewDate) {
|
|
10
12
|
const years = getYears(viewDate.year());
|
|
11
13
|
const decadeStart = 10 * Math.floor(viewDate.year() / 10);
|
|
12
14
|
t1 = "";
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
t2 = className;
|
|
16
|
+
t3 = style;
|
|
17
|
+
let t5;
|
|
18
|
+
if ($[16] !== cellClassName || $[17] !== cellStyle || $[18] !== decadeStart || $[19] !== disabledDate || $[20] !== maxDate || $[21] !== minDate || $[22] !== onSelect || $[23] !== rangeEnd || $[24] !== rangeStart || $[25] !== value) {
|
|
19
|
+
t5 = (y)=>{
|
|
16
20
|
const yr = y.year();
|
|
17
|
-
const isSelected =
|
|
21
|
+
const isSelected = [
|
|
22
|
+
value,
|
|
23
|
+
rangeStart,
|
|
24
|
+
rangeEnd
|
|
25
|
+
].some((date)=>date?.isSame(y, "year"));
|
|
26
|
+
const inRange = rangeStart && rangeEnd && y.isAfter(rangeStart, "year") && y.isBefore(rangeEnd, "year");
|
|
18
27
|
const isOutside = yr < decadeStart || yr > decadeStart + 9;
|
|
19
28
|
const disabled = disabledDate?.(y) || null != minDate && y.isBefore(minDate, "year") || null != maxDate && y.isAfter(maxDate, "year");
|
|
20
29
|
return /*#__PURE__*/ jsx("button", {
|
|
21
30
|
type: "button",
|
|
22
31
|
"data-tao-year-cell": "",
|
|
32
|
+
"data-tao-calendar-date": y.format("YYYY"),
|
|
33
|
+
className: cellClassName,
|
|
34
|
+
style: cellStyle,
|
|
35
|
+
"data-tao-in-range": inRange || void 0,
|
|
23
36
|
"data-tao-selected": isSelected || void 0,
|
|
24
37
|
"aria-pressed": !!isSelected,
|
|
25
38
|
"data-tao-other-month": isOutside || void 0,
|
|
@@ -29,37 +42,55 @@ function YearGrid(t0) {
|
|
|
29
42
|
children: yr
|
|
30
43
|
}, yr);
|
|
31
44
|
};
|
|
32
|
-
$[
|
|
33
|
-
$[
|
|
34
|
-
$[
|
|
35
|
-
$[
|
|
36
|
-
$[
|
|
37
|
-
$[
|
|
38
|
-
$[
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
$[
|
|
44
|
-
|
|
45
|
-
$[
|
|
46
|
-
$[
|
|
47
|
-
$[
|
|
48
|
-
$[
|
|
45
|
+
$[16] = cellClassName;
|
|
46
|
+
$[17] = cellStyle;
|
|
47
|
+
$[18] = decadeStart;
|
|
48
|
+
$[19] = disabledDate;
|
|
49
|
+
$[20] = maxDate;
|
|
50
|
+
$[21] = minDate;
|
|
51
|
+
$[22] = onSelect;
|
|
52
|
+
$[23] = rangeEnd;
|
|
53
|
+
$[24] = rangeStart;
|
|
54
|
+
$[25] = value;
|
|
55
|
+
$[26] = t5;
|
|
56
|
+
} else t5 = $[26];
|
|
57
|
+
t4 = years.map(t5);
|
|
58
|
+
$[0] = cellClassName;
|
|
59
|
+
$[1] = cellStyle;
|
|
60
|
+
$[2] = className;
|
|
61
|
+
$[3] = disabledDate;
|
|
62
|
+
$[4] = maxDate;
|
|
63
|
+
$[5] = minDate;
|
|
64
|
+
$[6] = onSelect;
|
|
65
|
+
$[7] = rangeEnd;
|
|
66
|
+
$[8] = rangeStart;
|
|
67
|
+
$[9] = style;
|
|
68
|
+
$[10] = value;
|
|
69
|
+
$[11] = viewDate;
|
|
70
|
+
$[12] = t1;
|
|
71
|
+
$[13] = t2;
|
|
72
|
+
$[14] = t3;
|
|
73
|
+
$[15] = t4;
|
|
49
74
|
} else {
|
|
50
|
-
t1 = $[
|
|
51
|
-
t2 = $[
|
|
75
|
+
t1 = $[12];
|
|
76
|
+
t2 = $[13];
|
|
77
|
+
t3 = $[14];
|
|
78
|
+
t4 = $[15];
|
|
52
79
|
}
|
|
53
|
-
let
|
|
54
|
-
if ($[
|
|
55
|
-
|
|
80
|
+
let t5;
|
|
81
|
+
if ($[27] !== t1 || $[28] !== t2 || $[29] !== t3 || $[30] !== t4) {
|
|
82
|
+
t5 = /*#__PURE__*/ jsx("div", {
|
|
56
83
|
"data-tao-year-grid": t1,
|
|
57
|
-
|
|
84
|
+
className: t2,
|
|
85
|
+
style: t3,
|
|
86
|
+
children: t4
|
|
58
87
|
});
|
|
59
|
-
$[
|
|
60
|
-
$[
|
|
61
|
-
$[
|
|
62
|
-
|
|
63
|
-
|
|
88
|
+
$[27] = t1;
|
|
89
|
+
$[28] = t2;
|
|
90
|
+
$[29] = t3;
|
|
91
|
+
$[30] = t4;
|
|
92
|
+
$[31] = t5;
|
|
93
|
+
} else t5 = $[31];
|
|
94
|
+
return t5;
|
|
64
95
|
}
|
|
65
96
|
export { YearGrid };
|
|
@@ -404,6 +404,10 @@ button[data-tao-month-cell]:hover:not(:disabled), button[data-tao-year-cell]:hov
|
|
|
404
404
|
background: var(--tao-color-fill-tertiary);
|
|
405
405
|
}
|
|
406
406
|
|
|
407
|
+
button[data-tao-month-cell][data-tao-in-range], button[data-tao-year-cell][data-tao-in-range] {
|
|
408
|
+
background: color-mix(in oklab, var(--tao-primary) 12%, transparent);
|
|
409
|
+
}
|
|
410
|
+
|
|
407
411
|
button[data-tao-month-cell][data-tao-selected], button[data-tao-year-cell][data-tao-selected] {
|
|
408
412
|
background: var(--tao-primary);
|
|
409
413
|
color: #fff;
|
|
@@ -509,7 +513,7 @@ button[data-tao-time-cell] {
|
|
|
509
513
|
display: flex;
|
|
510
514
|
}
|
|
511
515
|
|
|
512
|
-
button[data-tao-time-cell]:hover {
|
|
516
|
+
button[data-tao-time-cell]:not(:disabled):hover {
|
|
513
517
|
background: var(--tao-color-fill-tertiary);
|
|
514
518
|
}
|
|
515
519
|
|
|
@@ -518,6 +522,11 @@ button[data-tao-time-cell][data-tao-selected] {
|
|
|
518
522
|
font-weight: var(--tao-font-weight-medium);
|
|
519
523
|
}
|
|
520
524
|
|
|
525
|
+
button[data-tao-time-cell]:disabled {
|
|
526
|
+
color: var(--tao-color-text-disabled);
|
|
527
|
+
cursor: not-allowed;
|
|
528
|
+
}
|
|
529
|
+
|
|
521
530
|
[data-tao-picker-presets] {
|
|
522
531
|
gap: var(--tao-padding-xxs);
|
|
523
532
|
padding: var(--tao-padding-xs) 0;
|
|
@@ -604,6 +613,20 @@ input[data-tao-range-input]::placeholder {
|
|
|
604
613
|
flex-shrink: 0;
|
|
605
614
|
}
|
|
606
615
|
|
|
616
|
+
[data-tao-range-time] {
|
|
617
|
+
min-width: 0;
|
|
618
|
+
padding: var(--tao-padding-xs) 0 0;
|
|
619
|
+
border: 0;
|
|
620
|
+
border-block-start: var(--tao-line-width) solid
|
|
621
|
+
var(--tao-color-border-secondary);
|
|
622
|
+
margin: 0;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
[data-tao-range-time] > legend {
|
|
626
|
+
font-size: var(--tao-font-size-sm);
|
|
627
|
+
color: var(--tao-color-text-secondary);
|
|
628
|
+
}
|
|
629
|
+
|
|
607
630
|
[data-tao-range-panels] {
|
|
608
631
|
gap: var(--tao-padding);
|
|
609
632
|
display: flex;
|