@rockshin/tao-ui 0.0.21 → 0.0.23
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/README.md +8 -1
- package/component-manifest.json +77 -48
- package/dist/components/button/button.css +11 -11
- package/dist/components/button/button.d.ts +3 -2
- package/dist/components/button/button.js +55 -47
- package/dist/components/checkbox/checkbox.d.ts +3 -2
- package/dist/components/checkbox/checkbox.js +91 -81
- package/dist/components/date-picker/calendar/calendar-grid.d.ts +7 -1
- package/dist/components/date-picker/calendar/calendar-grid.js +158 -160
- package/dist/components/date-picker/calendar/time-panel.js +64 -70
- package/dist/components/date-picker/date-picker.css +11 -5
- package/dist/components/date-picker/date-picker.d.ts +13 -5
- package/dist/components/date-picker/date-picker.js +389 -718
- package/dist/components/date-picker/range-picker.d.ts +12 -5
- package/dist/components/date-picker/range-picker.js +68 -12
- package/dist/components/date-picker/types.d.ts +5 -0
- package/dist/components/drawer/drawer.css +3 -1
- package/dist/components/form-field/form-field.d.ts +1 -1
- package/dist/components/form-field/form-field.js +106 -63
- package/dist/components/input/input.css +13 -0
- package/dist/components/input/input.d.ts +2 -1
- package/dist/components/input/input.js +76 -70
- package/dist/components/input-number/input-number.d.ts +5 -3
- package/dist/components/input-number/input-number.js +63 -47
- package/dist/components/modal/modal.css +2 -1
- package/dist/components/radio/radio.d.ts +3 -2
- package/dist/components/radio/radio.js +43 -39
- package/dist/components/select/mobile-select.d.ts +1 -1
- package/dist/components/select/mobile-select.js +1 -1
- package/dist/components/select/select-icons.d.ts +7 -0
- package/dist/components/select/select-icons.js +141 -0
- package/dist/components/select/select-model.d.ts +4 -0
- package/dist/components/select/select-model.js +22 -0
- package/dist/components/select/select-searchable-list.d.ts +22 -0
- package/dist/components/select/select-searchable-list.js +101 -0
- package/dist/components/select/select-tags.d.ts +15 -0
- package/dist/components/select/select-tags.js +152 -0
- package/dist/components/select/select-types.d.ts +82 -0
- package/dist/components/select/select-types.js +0 -0
- package/dist/components/select/select.css +2 -1
- package/dist/components/select/select.d.ts +2 -118
- package/dist/components/select/select.js +91 -404
- package/dist/components/select/use-is-mobile.js +2 -5
- package/dist/components/sonner/sonner.js +9 -3
- package/dist/components/spinner/spinner.css +1 -1
- package/dist/components/splitter/splitter.js +181 -133
- package/dist/components/switch/switch.css +17 -8
- package/dist/components/switch/switch.d.ts +3 -2
- package/dist/components/switch/switch.js +90 -79
- package/dist/components/table/table-filter.d.ts +6 -0
- package/dist/components/table/table-filter.js +123 -0
- package/dist/components/table/table-icons.d.ts +9 -0
- package/dist/components/table/table-icons.js +157 -0
- package/dist/components/table/table-model.d.ts +11 -0
- package/dist/components/table/table-model.js +33 -0
- package/dist/components/table/table-types.d.ts +87 -0
- package/dist/components/table/table-types.js +0 -0
- package/dist/components/table/table.css +14 -15
- package/dist/components/table/table.d.ts +3 -101
- package/dist/components/table/table.js +29 -329
- package/dist/components/tabs/tabs.css +5 -2
- package/dist/components/tabs/tabs.js +71 -62
- package/dist/components/textarea/textarea.d.ts +5 -3
- package/dist/components/textarea/textarea.js +102 -85
- package/dist/docs/component-docs.d.ts +1 -0
- package/dist/docs/components/breadcrumb.doc.js +3 -1
- package/dist/docs/components/checkbox.doc.js +2 -5
- package/dist/docs/components/context-menu.doc.js +7 -2
- package/dist/docs/components/drawer.doc.js +4 -2
- package/dist/docs/components/dropdown.doc.js +7 -3
- package/dist/docs/components/form-field.doc.js +0 -1
- package/dist/docs/components/form-layout.doc.d.ts +1 -0
- package/dist/docs/components/form-layout.doc.js +3 -0
- package/dist/docs/components/form-section.doc.js +1 -1
- package/dist/docs/components/input-number.doc.js +2 -3
- package/dist/docs/components/input.doc.js +1 -2
- package/dist/docs/components/modal.doc.js +1 -1
- package/dist/docs/components/pagination.doc.js +1 -3
- package/dist/docs/components/radio.doc.js +1 -4
- package/dist/docs/components/range-picker.doc.js +2 -2
- package/dist/docs/components/select.doc.js +19 -6
- package/dist/docs/components/spinner.doc.js +4 -1
- package/dist/docs/components/splitter.doc.js +1 -1
- package/dist/docs/components/stack.doc.d.ts +1 -0
- package/dist/docs/components/stack.doc.js +3 -0
- package/dist/docs/components/switch.doc.js +1 -2
- package/dist/docs/components/table.doc.js +9 -4
- package/dist/docs/components/tabs.doc.js +2 -1
- package/dist/docs/components/tag.doc.js +1 -0
- package/dist/docs/components/tao-provider.doc.js +1 -2
- package/dist/index.d.ts +7 -9
- package/dist/index.js +4 -5
- package/dist/layouts/form-layout/form-layout.d.ts +8 -2
- package/dist/layouts/form-layout/form-layout.js +33 -9
- package/dist/layouts/stack/stack.d.ts +8 -2
- package/dist/layouts/stack/stack.js +36 -12
- package/dist/provider/tao-provider.d.ts +3 -9
- package/dist/provider/tao-provider.js +99 -33
- package/dist/theme/theme.css +24 -14
- package/dist/theme/tokens.d.ts +2 -2
- package/dist/theme/tokens.js +4 -1
- package/dist/utils/refs.d.ts +2 -0
- package/dist/utils/refs.js +7 -0
- package/llms.txt +26 -24
- package/package.json +16 -4
|
@@ -121,107 +121,101 @@ function TimePanel(t0) {
|
|
|
121
121
|
return t10;
|
|
122
122
|
}
|
|
123
123
|
function TimeColumn(t0) {
|
|
124
|
-
const $ = c(
|
|
125
|
-
const { values, selected, onSelect, label } = t0;
|
|
124
|
+
const $ = c(19);
|
|
125
|
+
const { values, selected, onSelect, label, scrollKey } = t0;
|
|
126
126
|
const listRef = useRef(null);
|
|
127
|
+
const initRef = _temp;
|
|
127
128
|
let t1;
|
|
128
129
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
129
130
|
t1 = ()=>{
|
|
130
|
-
const
|
|
131
|
-
if (!
|
|
132
|
-
const
|
|
133
|
-
|
|
131
|
+
const el_0 = listRef.current;
|
|
132
|
+
if (!el_0) return;
|
|
133
|
+
const selectedEl_0 = el_0.querySelector("[data-tao-selected]");
|
|
134
|
+
selectedEl_0?.scrollIntoView({
|
|
134
135
|
block: "center",
|
|
135
136
|
behavior: "smooth"
|
|
136
137
|
});
|
|
137
138
|
};
|
|
138
139
|
$[0] = t1;
|
|
139
140
|
} else t1 = $[0];
|
|
140
|
-
const scrollToSelected = t1;
|
|
141
|
-
const initRef = _temp;
|
|
142
141
|
let t2;
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
};
|
|
148
|
-
t3 = [
|
|
149
|
-
scrollToSelected
|
|
142
|
+
if ($[1] !== scrollKey || $[2] !== selected) {
|
|
143
|
+
t2 = [
|
|
144
|
+
selected,
|
|
145
|
+
scrollKey
|
|
150
146
|
];
|
|
151
|
-
$[1] =
|
|
152
|
-
$[2] =
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
if ($[3] !== label) {
|
|
160
|
-
t4 = /*#__PURE__*/ jsx("div", {
|
|
147
|
+
$[1] = scrollKey;
|
|
148
|
+
$[2] = selected;
|
|
149
|
+
$[3] = t2;
|
|
150
|
+
} else t2 = $[3];
|
|
151
|
+
useEffect(t1, t2);
|
|
152
|
+
let t3;
|
|
153
|
+
if ($[4] !== label) {
|
|
154
|
+
t3 = /*#__PURE__*/ jsx("div", {
|
|
161
155
|
"data-tao-time-column-title": "",
|
|
162
156
|
children: label
|
|
163
157
|
});
|
|
164
|
-
$[
|
|
165
|
-
$[
|
|
166
|
-
} else
|
|
167
|
-
let
|
|
168
|
-
if ($[
|
|
169
|
-
|
|
158
|
+
$[4] = label;
|
|
159
|
+
$[5] = t3;
|
|
160
|
+
} else t3 = $[5];
|
|
161
|
+
let t4;
|
|
162
|
+
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
163
|
+
t4 = (el_1)=>{
|
|
170
164
|
listRef.current = el_1;
|
|
171
165
|
initRef(el_1);
|
|
172
166
|
};
|
|
173
|
-
$[
|
|
174
|
-
} else
|
|
175
|
-
let
|
|
176
|
-
if ($[
|
|
177
|
-
let
|
|
178
|
-
if ($[
|
|
179
|
-
|
|
167
|
+
$[6] = t4;
|
|
168
|
+
} else t4 = $[6];
|
|
169
|
+
let t5;
|
|
170
|
+
if ($[7] !== onSelect || $[8] !== selected || $[9] !== values) {
|
|
171
|
+
let t6;
|
|
172
|
+
if ($[11] !== onSelect || $[12] !== selected) {
|
|
173
|
+
t6 = (v)=>/*#__PURE__*/ jsx("button", {
|
|
180
174
|
type: "button",
|
|
181
175
|
"data-tao-time-cell": "",
|
|
182
176
|
"data-tao-selected": v === selected || void 0,
|
|
183
177
|
onClick: ()=>onSelect(v),
|
|
184
178
|
children: String(v).padStart(2, "0")
|
|
185
179
|
}, v);
|
|
186
|
-
$[
|
|
187
|
-
$[
|
|
188
|
-
$[
|
|
189
|
-
} else
|
|
190
|
-
|
|
191
|
-
$[
|
|
192
|
-
$[
|
|
193
|
-
$[
|
|
194
|
-
$[
|
|
195
|
-
} else
|
|
196
|
-
let
|
|
197
|
-
if ($[
|
|
198
|
-
|
|
180
|
+
$[11] = onSelect;
|
|
181
|
+
$[12] = selected;
|
|
182
|
+
$[13] = t6;
|
|
183
|
+
} else t6 = $[13];
|
|
184
|
+
t5 = values.map(t6);
|
|
185
|
+
$[7] = onSelect;
|
|
186
|
+
$[8] = selected;
|
|
187
|
+
$[9] = values;
|
|
188
|
+
$[10] = t5;
|
|
189
|
+
} else t5 = $[10];
|
|
190
|
+
let t6;
|
|
191
|
+
if ($[14] !== t5) {
|
|
192
|
+
t6 = /*#__PURE__*/ jsx("div", {
|
|
199
193
|
"data-tao-time-column-list": "",
|
|
200
|
-
ref:
|
|
201
|
-
children:
|
|
194
|
+
ref: t4,
|
|
195
|
+
children: t5
|
|
202
196
|
});
|
|
203
|
-
$[
|
|
204
|
-
$[
|
|
205
|
-
} else
|
|
206
|
-
let
|
|
207
|
-
if ($[
|
|
208
|
-
|
|
197
|
+
$[14] = t5;
|
|
198
|
+
$[15] = t6;
|
|
199
|
+
} else t6 = $[15];
|
|
200
|
+
let t7;
|
|
201
|
+
if ($[16] !== t3 || $[17] !== t6) {
|
|
202
|
+
t7 = /*#__PURE__*/ jsxs("div", {
|
|
209
203
|
"data-tao-time-column": "",
|
|
210
204
|
children: [
|
|
211
|
-
|
|
212
|
-
|
|
205
|
+
t3,
|
|
206
|
+
t6
|
|
213
207
|
]
|
|
214
208
|
});
|
|
215
|
-
$[
|
|
216
|
-
$[
|
|
217
|
-
$[
|
|
218
|
-
} else
|
|
219
|
-
return
|
|
209
|
+
$[16] = t3;
|
|
210
|
+
$[17] = t6;
|
|
211
|
+
$[18] = t7;
|
|
212
|
+
} else t7 = $[18];
|
|
213
|
+
return t7;
|
|
220
214
|
}
|
|
221
|
-
function _temp(
|
|
222
|
-
if (!
|
|
223
|
-
const
|
|
224
|
-
|
|
215
|
+
function _temp(el) {
|
|
216
|
+
if (!el) return;
|
|
217
|
+
const selectedEl = el.querySelector("[data-tao-selected]");
|
|
218
|
+
selectedEl?.scrollIntoView({
|
|
225
219
|
block: "center"
|
|
226
220
|
});
|
|
227
221
|
}
|
|
@@ -192,7 +192,8 @@ button[data-tao-calendar-nav-btn] {
|
|
|
192
192
|
color: var(--tao-color-text-tertiary);
|
|
193
193
|
cursor: pointer;
|
|
194
194
|
appearance: none;
|
|
195
|
-
transition:
|
|
195
|
+
transition: background-color var(--tao-motion-duration-fast) ease-out,
|
|
196
|
+
color var(--tao-motion-duration-fast) ease-out;
|
|
196
197
|
background: none;
|
|
197
198
|
border: none;
|
|
198
199
|
outline: none;
|
|
@@ -294,7 +295,8 @@ button[data-tao-calendar-title-btn]:hover {
|
|
|
294
295
|
height: 28px;
|
|
295
296
|
font-size: var(--tao-font-size-sm);
|
|
296
297
|
color: var(--tao-color-text);
|
|
297
|
-
transition:
|
|
298
|
+
transition: background-color var(--tao-motion-duration-fast) ease-out,
|
|
299
|
+
color var(--tao-motion-duration-fast) ease-out;
|
|
298
300
|
justify-content: center;
|
|
299
301
|
align-items: center;
|
|
300
302
|
line-height: 1;
|
|
@@ -371,7 +373,8 @@ button[data-tao-month-cell], button[data-tao-year-cell] {
|
|
|
371
373
|
color: var(--tao-color-text);
|
|
372
374
|
cursor: pointer;
|
|
373
375
|
appearance: none;
|
|
374
|
-
transition:
|
|
376
|
+
transition: background-color var(--tao-motion-duration-fast) ease-out,
|
|
377
|
+
color var(--tao-motion-duration-fast) ease-out;
|
|
375
378
|
background: none;
|
|
376
379
|
border: none;
|
|
377
380
|
outline: none;
|
|
@@ -514,7 +517,8 @@ button[data-tao-preset-btn] {
|
|
|
514
517
|
color: var(--tao-color-text-secondary);
|
|
515
518
|
cursor: pointer;
|
|
516
519
|
appearance: none;
|
|
517
|
-
transition:
|
|
520
|
+
transition: border-color var(--tao-motion-duration-fast) ease-out,
|
|
521
|
+
color var(--tao-motion-duration-fast) ease-out;
|
|
518
522
|
background: none;
|
|
519
523
|
outline: none;
|
|
520
524
|
margin: 0;
|
|
@@ -544,7 +548,9 @@ button[data-tao-picker-footer-btn] {
|
|
|
544
548
|
color: var(--tao-color-text-secondary);
|
|
545
549
|
cursor: pointer;
|
|
546
550
|
appearance: none;
|
|
547
|
-
transition:
|
|
551
|
+
transition: background-color var(--tao-motion-duration-fast) ease-out,
|
|
552
|
+
border-color var(--tao-motion-duration-fast) ease-out,
|
|
553
|
+
color var(--tao-motion-duration-fast) ease-out;
|
|
548
554
|
background: none;
|
|
549
555
|
outline: none;
|
|
550
556
|
margin: 0;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import type { Dayjs } from 'dayjs';
|
|
2
|
-
import { type ReactNode } from 'react';
|
|
3
|
-
import { type TaoSize, type TaoVariant } from '../../provider/tao-provider';
|
|
2
|
+
import { type CSSProperties, type ReactNode, type Ref } from 'react';
|
|
3
|
+
import { type TaoSize, type TaoStatus, type TaoVariant } from '../../provider/tao-provider';
|
|
4
|
+
import { type SemanticClassNames, type SemanticStyles } from '../../utils/semantic';
|
|
4
5
|
import './date-picker.css';
|
|
5
|
-
import { type PresetItem, type TimeConfig } from './types';
|
|
6
|
+
import { type PickerRef, type PresetItem, type TimeConfig } from './types';
|
|
7
|
+
export type { PickerRef } from './types';
|
|
8
|
+
export type DatePickerSemanticPart = 'root' | 'input' | 'popup' | 'calendar' | 'cell' | 'footer';
|
|
6
9
|
export interface DatePickerProps {
|
|
7
10
|
value?: Dayjs | null;
|
|
8
11
|
defaultValue?: Dayjs | null;
|
|
@@ -21,9 +24,14 @@ export interface DatePickerProps {
|
|
|
21
24
|
allowClear?: boolean;
|
|
22
25
|
prefix?: ReactNode;
|
|
23
26
|
suffixIcon?: ReactNode;
|
|
24
|
-
status?:
|
|
27
|
+
status?: TaoStatus;
|
|
28
|
+
ref?: Ref<PickerRef>;
|
|
25
29
|
mobile?: boolean;
|
|
26
30
|
open?: boolean;
|
|
27
31
|
onOpenChange?: (open: boolean) => void;
|
|
32
|
+
className?: string;
|
|
33
|
+
style?: CSSProperties;
|
|
34
|
+
classNames?: SemanticClassNames<DatePickerSemanticPart>;
|
|
35
|
+
styles?: SemanticStyles<DatePickerSemanticPart>;
|
|
28
36
|
}
|
|
29
|
-
export declare function DatePicker({ value, onChange, picker, showTime, format: formatProp, disabledDate, minDate, maxDate, presets, placeholder, size, variant, disabled, allowClear, prefix, suffixIcon, status, mobile, open: controlledOpen, onOpenChange, }: DatePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
export declare function DatePicker({ value, onChange, picker, showTime, format: formatProp, disabledDate, minDate, maxDate, presets, placeholder, size, variant, disabled, allowClear, prefix, suffixIcon, status, mobile, open: controlledOpen, onOpenChange, className, style, classNames, styles, ref, }: DatePickerProps): import("react/jsx-runtime").JSX.Element;
|