@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
|
@@ -5,7 +5,7 @@ import { useTaoConfig } from "../../provider/tao-provider.js";
|
|
|
5
5
|
import { cx } from "../../utils/semantic.js";
|
|
6
6
|
import "./input.css";
|
|
7
7
|
const input_Input = /*#__PURE__*/ forwardRef(function(t0, ref) {
|
|
8
|
-
const $ = c(
|
|
8
|
+
const $ = c(44);
|
|
9
9
|
let className;
|
|
10
10
|
let classNames;
|
|
11
11
|
let disabled;
|
|
@@ -13,12 +13,13 @@ const input_Input = /*#__PURE__*/ forwardRef(function(t0, ref) {
|
|
|
13
13
|
let prefix;
|
|
14
14
|
let rest;
|
|
15
15
|
let size;
|
|
16
|
+
let status;
|
|
16
17
|
let style;
|
|
17
18
|
let styles;
|
|
18
19
|
let suffix;
|
|
19
20
|
let variant;
|
|
20
21
|
if ($[0] !== t0) {
|
|
21
|
-
({ size, variant, prefix, suffix, error, disabled, className, style, classNames, styles, ...rest } = t0);
|
|
22
|
+
({ size, variant, prefix, suffix, error, status, disabled, className, style, classNames, styles, ...rest } = t0);
|
|
22
23
|
$[0] = t0;
|
|
23
24
|
$[1] = className;
|
|
24
25
|
$[2] = classNames;
|
|
@@ -27,10 +28,11 @@ const input_Input = /*#__PURE__*/ forwardRef(function(t0, ref) {
|
|
|
27
28
|
$[5] = prefix;
|
|
28
29
|
$[6] = rest;
|
|
29
30
|
$[7] = size;
|
|
30
|
-
$[8] =
|
|
31
|
-
$[9] =
|
|
32
|
-
$[10] =
|
|
33
|
-
$[11] =
|
|
31
|
+
$[8] = status;
|
|
32
|
+
$[9] = style;
|
|
33
|
+
$[10] = styles;
|
|
34
|
+
$[11] = suffix;
|
|
35
|
+
$[12] = variant;
|
|
34
36
|
} else {
|
|
35
37
|
className = $[1];
|
|
36
38
|
classNames = $[2];
|
|
@@ -39,10 +41,11 @@ const input_Input = /*#__PURE__*/ forwardRef(function(t0, ref) {
|
|
|
39
41
|
prefix = $[5];
|
|
40
42
|
rest = $[6];
|
|
41
43
|
size = $[7];
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
status = $[8];
|
|
45
|
+
style = $[9];
|
|
46
|
+
styles = $[10];
|
|
47
|
+
suffix = $[11];
|
|
48
|
+
variant = $[12];
|
|
46
49
|
}
|
|
47
50
|
const ctx = useTaoConfig();
|
|
48
51
|
const resolvedSize = size ?? ctx.size;
|
|
@@ -50,74 +53,75 @@ const input_Input = /*#__PURE__*/ forwardRef(function(t0, ref) {
|
|
|
50
53
|
const resolvedDisabled = disabled ?? ctx.disabled;
|
|
51
54
|
const t1 = classNames?.root;
|
|
52
55
|
let t2;
|
|
53
|
-
if ($[
|
|
56
|
+
if ($[13] !== className || $[14] !== t1) {
|
|
54
57
|
t2 = cx(t1, className);
|
|
55
|
-
$[
|
|
56
|
-
$[
|
|
57
|
-
$[
|
|
58
|
-
} else t2 = $[
|
|
58
|
+
$[13] = className;
|
|
59
|
+
$[14] = t1;
|
|
60
|
+
$[15] = t2;
|
|
61
|
+
} else t2 = $[15];
|
|
59
62
|
const t3 = styles?.root;
|
|
60
63
|
let t4;
|
|
61
|
-
if ($[
|
|
64
|
+
if ($[16] !== style || $[17] !== t3) {
|
|
62
65
|
t4 = {
|
|
63
66
|
...t3,
|
|
64
67
|
...style
|
|
65
68
|
};
|
|
66
|
-
$[
|
|
67
|
-
$[
|
|
68
|
-
$[
|
|
69
|
-
} else t4 = $[
|
|
70
|
-
const t5 = error || void 0;
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
69
|
+
$[16] = style;
|
|
70
|
+
$[17] = t3;
|
|
71
|
+
$[18] = t4;
|
|
72
|
+
} else t4 = $[18];
|
|
73
|
+
const t5 = "error" === status || error || void 0;
|
|
74
|
+
const t6 = "warning" === status || void 0;
|
|
75
|
+
let t7;
|
|
76
|
+
if ($[19] !== classNames?.prefix || $[20] !== prefix || $[21] !== styles?.prefix) {
|
|
77
|
+
t7 = null != prefix && /*#__PURE__*/ jsx("span", {
|
|
74
78
|
className: classNames?.prefix,
|
|
75
79
|
style: styles?.prefix,
|
|
76
80
|
"data-tao-prefix": "",
|
|
77
81
|
children: prefix
|
|
78
82
|
});
|
|
79
|
-
$[
|
|
80
|
-
$[
|
|
81
|
-
$[
|
|
82
|
-
$[
|
|
83
|
-
} else
|
|
84
|
-
const
|
|
85
|
-
const
|
|
86
|
-
const
|
|
87
|
-
let
|
|
88
|
-
if ($[
|
|
89
|
-
|
|
83
|
+
$[19] = classNames?.prefix;
|
|
84
|
+
$[20] = prefix;
|
|
85
|
+
$[21] = styles?.prefix;
|
|
86
|
+
$[22] = t7;
|
|
87
|
+
} else t7 = $[22];
|
|
88
|
+
const t8 = classNames?.input;
|
|
89
|
+
const t9 = styles?.input;
|
|
90
|
+
const t10 = "error" === status || error || void 0;
|
|
91
|
+
let t11;
|
|
92
|
+
if ($[23] !== ref || $[24] !== resolvedDisabled || $[25] !== rest || $[26] !== t10 || $[27] !== t8 || $[28] !== t9) {
|
|
93
|
+
t11 = /*#__PURE__*/ jsx("input", {
|
|
90
94
|
...rest,
|
|
91
95
|
ref: ref,
|
|
92
|
-
className:
|
|
93
|
-
style:
|
|
96
|
+
className: t8,
|
|
97
|
+
style: t9,
|
|
94
98
|
disabled: resolvedDisabled,
|
|
95
|
-
"aria-invalid":
|
|
99
|
+
"aria-invalid": t10
|
|
96
100
|
});
|
|
97
|
-
$[
|
|
98
|
-
$[
|
|
99
|
-
$[
|
|
100
|
-
$[
|
|
101
|
-
$[
|
|
102
|
-
$[
|
|
103
|
-
$[
|
|
104
|
-
} else
|
|
105
|
-
let
|
|
106
|
-
if ($[
|
|
107
|
-
|
|
101
|
+
$[23] = ref;
|
|
102
|
+
$[24] = resolvedDisabled;
|
|
103
|
+
$[25] = rest;
|
|
104
|
+
$[26] = t10;
|
|
105
|
+
$[27] = t8;
|
|
106
|
+
$[28] = t9;
|
|
107
|
+
$[29] = t11;
|
|
108
|
+
} else t11 = $[29];
|
|
109
|
+
let t12;
|
|
110
|
+
if ($[30] !== classNames?.suffix || $[31] !== styles?.suffix || $[32] !== suffix) {
|
|
111
|
+
t12 = null != suffix && /*#__PURE__*/ jsx("span", {
|
|
108
112
|
className: classNames?.suffix,
|
|
109
113
|
style: styles?.suffix,
|
|
110
114
|
"data-tao-suffix": "",
|
|
111
115
|
children: suffix
|
|
112
116
|
});
|
|
113
|
-
$[
|
|
114
|
-
$[
|
|
115
|
-
$[
|
|
116
|
-
$[
|
|
117
|
-
} else
|
|
118
|
-
let
|
|
119
|
-
if ($[
|
|
120
|
-
|
|
117
|
+
$[30] = classNames?.suffix;
|
|
118
|
+
$[31] = styles?.suffix;
|
|
119
|
+
$[32] = suffix;
|
|
120
|
+
$[33] = t12;
|
|
121
|
+
} else t12 = $[33];
|
|
122
|
+
let t13;
|
|
123
|
+
if ($[34] !== resolvedSize || $[35] !== resolvedVariant || $[36] !== t11 || $[37] !== t12 || $[38] !== t2 || $[39] !== t4 || $[40] !== t5 || $[41] !== t6 || $[42] !== t7) {
|
|
124
|
+
t13 = /*#__PURE__*/ jsxs("div", {
|
|
121
125
|
className: t2,
|
|
122
126
|
style: t4,
|
|
123
127
|
"data-tao-control": "",
|
|
@@ -125,22 +129,24 @@ const input_Input = /*#__PURE__*/ forwardRef(function(t0, ref) {
|
|
|
125
129
|
"data-tao-size": resolvedSize,
|
|
126
130
|
"data-tao-variant": resolvedVariant,
|
|
127
131
|
"data-tao-error": t5,
|
|
132
|
+
"data-tao-warning": t6,
|
|
128
133
|
children: [
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
134
|
+
t7,
|
|
135
|
+
t11,
|
|
136
|
+
t12
|
|
132
137
|
]
|
|
133
138
|
});
|
|
134
|
-
$[
|
|
135
|
-
$[
|
|
136
|
-
$[35] = t10;
|
|
139
|
+
$[34] = resolvedSize;
|
|
140
|
+
$[35] = resolvedVariant;
|
|
137
141
|
$[36] = t11;
|
|
138
|
-
$[37] =
|
|
139
|
-
$[38] =
|
|
140
|
-
$[39] =
|
|
141
|
-
$[40] =
|
|
142
|
-
$[41] =
|
|
143
|
-
|
|
144
|
-
|
|
142
|
+
$[37] = t12;
|
|
143
|
+
$[38] = t2;
|
|
144
|
+
$[39] = t4;
|
|
145
|
+
$[40] = t5;
|
|
146
|
+
$[41] = t6;
|
|
147
|
+
$[42] = t7;
|
|
148
|
+
$[43] = t13;
|
|
149
|
+
} else t13 = $[43];
|
|
150
|
+
return t13;
|
|
145
151
|
});
|
|
146
152
|
export { input_Input as Input };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
1
|
+
import type { ReactNode, Ref } from 'react';
|
|
2
2
|
import { type UseNumberInputOptions } from '../../number-input/use-number-input';
|
|
3
|
-
import type { TaoSize, TaoVariant } from '../../provider/tao-provider';
|
|
3
|
+
import type { TaoSize, TaoStatus, TaoVariant } from '../../provider/tao-provider';
|
|
4
4
|
import type { SemanticClassNames, SemanticStyles } from '../../utils/semantic';
|
|
5
5
|
import { type InputSemanticPart } from '../input/input';
|
|
6
6
|
export type InputNumberSemanticPart = InputSemanticPart;
|
|
@@ -10,6 +10,8 @@ export interface InputNumberProps extends UseNumberInputOptions {
|
|
|
10
10
|
size?: TaoSize;
|
|
11
11
|
variant?: TaoVariant;
|
|
12
12
|
error?: boolean;
|
|
13
|
+
status?: TaoStatus;
|
|
14
|
+
ref?: Ref<HTMLInputElement>;
|
|
13
15
|
disabled?: boolean;
|
|
14
16
|
placeholder?: string;
|
|
15
17
|
id?: string;
|
|
@@ -19,4 +21,4 @@ export interface InputNumberProps extends UseNumberInputOptions {
|
|
|
19
21
|
classNames?: SemanticClassNames<InputNumberSemanticPart>;
|
|
20
22
|
styles?: SemanticStyles<InputNumberSemanticPart>;
|
|
21
23
|
}
|
|
22
|
-
export declare function InputNumber({ prefix, suffix, size, variant, error, disabled, placeholder, id, name, 'aria-label': ariaLabel, className, classNames, styles, ...hookOptions }: InputNumberProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export declare function InputNumber({ prefix, suffix, size, variant, error, status, disabled, placeholder, id, name, 'aria-label': ariaLabel, className, classNames, styles, ref: forwardedRef, ...hookOptions }: InputNumberProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,77 +1,92 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { c } from "react/compiler-runtime";
|
|
3
3
|
import { useNumberInput } from "../../number-input/use-number-input.js";
|
|
4
|
+
import { mergeRefs } from "../../utils/refs.js";
|
|
4
5
|
import { Input } from "../input/input.js";
|
|
5
6
|
function InputNumber(t0) {
|
|
6
|
-
const $ = c(
|
|
7
|
+
const $ = c(40);
|
|
7
8
|
let ariaLabel;
|
|
8
9
|
let className;
|
|
9
10
|
let classNames;
|
|
10
11
|
let disabled;
|
|
11
12
|
let error;
|
|
13
|
+
let forwardedRef;
|
|
12
14
|
let hookOptions;
|
|
13
15
|
let id;
|
|
14
16
|
let name;
|
|
15
17
|
let placeholder;
|
|
16
18
|
let prefix;
|
|
17
19
|
let size;
|
|
20
|
+
let status;
|
|
18
21
|
let styles;
|
|
19
22
|
let suffix;
|
|
20
23
|
let variant;
|
|
21
24
|
if ($[0] !== t0) {
|
|
22
|
-
({ prefix, suffix, size, variant, error, disabled, placeholder, id, name, "aria-label": ariaLabel, className, classNames, styles, ...hookOptions } = t0);
|
|
25
|
+
({ prefix, suffix, size, variant, error, status, disabled, placeholder, id, name, "aria-label": ariaLabel, className, classNames, styles, ref: forwardedRef, ...hookOptions } = t0);
|
|
23
26
|
$[0] = t0;
|
|
24
27
|
$[1] = ariaLabel;
|
|
25
28
|
$[2] = className;
|
|
26
29
|
$[3] = classNames;
|
|
27
30
|
$[4] = disabled;
|
|
28
31
|
$[5] = error;
|
|
29
|
-
$[6] =
|
|
30
|
-
$[7] =
|
|
31
|
-
$[8] =
|
|
32
|
-
$[9] =
|
|
33
|
-
$[10] =
|
|
34
|
-
$[11] =
|
|
35
|
-
$[12] =
|
|
36
|
-
$[13] =
|
|
37
|
-
$[14] =
|
|
32
|
+
$[6] = forwardedRef;
|
|
33
|
+
$[7] = hookOptions;
|
|
34
|
+
$[8] = id;
|
|
35
|
+
$[9] = name;
|
|
36
|
+
$[10] = placeholder;
|
|
37
|
+
$[11] = prefix;
|
|
38
|
+
$[12] = size;
|
|
39
|
+
$[13] = status;
|
|
40
|
+
$[14] = styles;
|
|
41
|
+
$[15] = suffix;
|
|
42
|
+
$[16] = variant;
|
|
38
43
|
} else {
|
|
39
44
|
ariaLabel = $[1];
|
|
40
45
|
className = $[2];
|
|
41
46
|
classNames = $[3];
|
|
42
47
|
disabled = $[4];
|
|
43
48
|
error = $[5];
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
forwardedRef = $[6];
|
|
50
|
+
hookOptions = $[7];
|
|
51
|
+
id = $[8];
|
|
52
|
+
name = $[9];
|
|
53
|
+
placeholder = $[10];
|
|
54
|
+
prefix = $[11];
|
|
55
|
+
size = $[12];
|
|
56
|
+
status = $[13];
|
|
57
|
+
styles = $[14];
|
|
58
|
+
suffix = $[15];
|
|
59
|
+
variant = $[16];
|
|
53
60
|
}
|
|
54
61
|
const { inputProps } = useNumberInput(hookOptions);
|
|
55
62
|
let inputRest;
|
|
56
63
|
let ref;
|
|
57
|
-
if ($[
|
|
64
|
+
if ($[17] !== inputProps) {
|
|
58
65
|
({ ref, ...inputRest } = inputProps);
|
|
59
|
-
$[
|
|
60
|
-
$[
|
|
61
|
-
$[
|
|
66
|
+
$[17] = inputProps;
|
|
67
|
+
$[18] = inputRest;
|
|
68
|
+
$[19] = ref;
|
|
62
69
|
} else {
|
|
63
|
-
inputRest = $[
|
|
64
|
-
ref = $[
|
|
70
|
+
inputRest = $[18];
|
|
71
|
+
ref = $[19];
|
|
65
72
|
}
|
|
66
73
|
let t1;
|
|
67
|
-
if ($[
|
|
68
|
-
t1 =
|
|
69
|
-
|
|
74
|
+
if ($[20] !== forwardedRef || $[21] !== ref) {
|
|
75
|
+
t1 = mergeRefs(ref, forwardedRef);
|
|
76
|
+
$[20] = forwardedRef;
|
|
77
|
+
$[21] = ref;
|
|
78
|
+
$[22] = t1;
|
|
79
|
+
} else t1 = $[22];
|
|
80
|
+
let t2;
|
|
81
|
+
if ($[23] !== ariaLabel || $[24] !== className || $[25] !== classNames || $[26] !== disabled || $[27] !== error || $[28] !== id || $[29] !== inputRest || $[30] !== name || $[31] !== placeholder || $[32] !== prefix || $[33] !== size || $[34] !== status || $[35] !== styles || $[36] !== suffix || $[37] !== t1 || $[38] !== variant) {
|
|
82
|
+
t2 = /*#__PURE__*/ jsx(Input, {
|
|
83
|
+
ref: t1,
|
|
70
84
|
prefix: prefix,
|
|
71
85
|
suffix: suffix,
|
|
72
86
|
size: size,
|
|
73
87
|
variant: variant,
|
|
74
88
|
error: error,
|
|
89
|
+
status: status,
|
|
75
90
|
disabled: disabled,
|
|
76
91
|
placeholder: placeholder,
|
|
77
92
|
id: id,
|
|
@@ -82,23 +97,24 @@ function InputNumber(t0) {
|
|
|
82
97
|
styles: styles,
|
|
83
98
|
...inputRest
|
|
84
99
|
});
|
|
85
|
-
$[
|
|
86
|
-
$[
|
|
87
|
-
$[
|
|
88
|
-
$[
|
|
89
|
-
$[
|
|
90
|
-
$[
|
|
91
|
-
$[
|
|
92
|
-
$[
|
|
93
|
-
$[
|
|
94
|
-
$[
|
|
95
|
-
$[
|
|
96
|
-
$[
|
|
97
|
-
$[
|
|
98
|
-
$[
|
|
99
|
-
$[
|
|
100
|
-
$[
|
|
101
|
-
|
|
102
|
-
|
|
100
|
+
$[23] = ariaLabel;
|
|
101
|
+
$[24] = className;
|
|
102
|
+
$[25] = classNames;
|
|
103
|
+
$[26] = disabled;
|
|
104
|
+
$[27] = error;
|
|
105
|
+
$[28] = id;
|
|
106
|
+
$[29] = inputRest;
|
|
107
|
+
$[30] = name;
|
|
108
|
+
$[31] = placeholder;
|
|
109
|
+
$[32] = prefix;
|
|
110
|
+
$[33] = size;
|
|
111
|
+
$[34] = status;
|
|
112
|
+
$[35] = styles;
|
|
113
|
+
$[36] = suffix;
|
|
114
|
+
$[37] = t1;
|
|
115
|
+
$[38] = variant;
|
|
116
|
+
$[39] = t2;
|
|
117
|
+
} else t2 = $[39];
|
|
118
|
+
return t2;
|
|
103
119
|
}
|
|
104
120
|
export { InputNumber };
|
|
@@ -93,7 +93,8 @@ button[data-tao-modal-close] {
|
|
|
93
93
|
color: var(--tao-color-text-tertiary);
|
|
94
94
|
cursor: pointer;
|
|
95
95
|
margin: 0;
|
|
96
|
-
transition:
|
|
96
|
+
transition: background-color var(--tao-motion-duration-fast) ease-out,
|
|
97
|
+
color var(--tao-motion-duration-fast) ease-out;
|
|
97
98
|
appearance: none;
|
|
98
99
|
background: none;
|
|
99
100
|
border: none;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ChangeEvent, type ReactNode } from 'react';
|
|
1
|
+
import { type ChangeEvent, type ReactNode, type Ref } from 'react';
|
|
2
2
|
import { type TaoSize } from '../../provider/tao-provider';
|
|
3
3
|
import { type SemanticClassNames, type SemanticStyles } from '../../utils/semantic';
|
|
4
4
|
import './radio.css';
|
|
@@ -13,8 +13,9 @@ export interface RadioProps {
|
|
|
13
13
|
name?: string;
|
|
14
14
|
classNames?: SemanticClassNames<RadioSemanticPart>;
|
|
15
15
|
styles?: SemanticStyles<RadioSemanticPart>;
|
|
16
|
+
ref?: Ref<HTMLInputElement>;
|
|
16
17
|
}
|
|
17
|
-
export declare function Radio({ value, checked, disabled, onChange, children, name, classNames, styles, }: RadioProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare function Radio({ value, checked, defaultChecked, disabled, onChange, children, name, classNames, styles, ref, }: RadioProps): import("react/jsx-runtime").JSX.Element;
|
|
18
19
|
export type RadioOptionType = {
|
|
19
20
|
label: ReactNode;
|
|
20
21
|
value: string;
|
|
@@ -6,8 +6,8 @@ import { cx } from "../../utils/semantic.js";
|
|
|
6
6
|
import "./radio.css";
|
|
7
7
|
const RadioGroupContext = /*#__PURE__*/ createContext(null);
|
|
8
8
|
function Radio(t0) {
|
|
9
|
-
const $ = c(
|
|
10
|
-
const { value, checked, disabled, onChange, children, name, classNames, styles } = t0;
|
|
9
|
+
const $ = c(33);
|
|
10
|
+
const { value, checked, defaultChecked, disabled, onChange, children, name, classNames, styles, ref } = t0;
|
|
11
11
|
const ctx = useTaoConfig();
|
|
12
12
|
const groupCtx = useContext(RadioGroupContext);
|
|
13
13
|
const resolvedDisabled = disabled ?? groupCtx?.disabled ?? ctx.disabled ?? false;
|
|
@@ -35,47 +35,51 @@ function Radio(t0) {
|
|
|
35
35
|
} else t4 = $[5];
|
|
36
36
|
const t5 = styles?.root;
|
|
37
37
|
let t6;
|
|
38
|
-
if ($[6] !==
|
|
38
|
+
if ($[6] !== defaultChecked || $[7] !== handleChange || $[8] !== ref || $[9] !== resolvedChecked || $[10] !== resolvedDisabled || $[11] !== resolvedName || $[12] !== value) {
|
|
39
39
|
t6 = /*#__PURE__*/ jsx("input", {
|
|
40
|
+
ref: ref,
|
|
40
41
|
type: "radio",
|
|
41
42
|
name: resolvedName,
|
|
42
43
|
value: value,
|
|
43
44
|
checked: resolvedChecked,
|
|
45
|
+
defaultChecked: defaultChecked,
|
|
44
46
|
disabled: resolvedDisabled,
|
|
45
47
|
onChange: handleChange,
|
|
46
48
|
"data-tao-radio-input": ""
|
|
47
49
|
});
|
|
48
|
-
$[6] =
|
|
49
|
-
$[7] =
|
|
50
|
-
$[8] =
|
|
51
|
-
$[9] =
|
|
52
|
-
$[10] =
|
|
53
|
-
$[11] =
|
|
54
|
-
|
|
50
|
+
$[6] = defaultChecked;
|
|
51
|
+
$[7] = handleChange;
|
|
52
|
+
$[8] = ref;
|
|
53
|
+
$[9] = resolvedChecked;
|
|
54
|
+
$[10] = resolvedDisabled;
|
|
55
|
+
$[11] = resolvedName;
|
|
56
|
+
$[12] = value;
|
|
57
|
+
$[13] = t6;
|
|
58
|
+
} else t6 = $[13];
|
|
55
59
|
const t7 = resolvedChecked || void 0;
|
|
56
60
|
const t8 = classNames?.indicator;
|
|
57
61
|
let t9;
|
|
58
|
-
if ($[
|
|
62
|
+
if ($[14] !== t8) {
|
|
59
63
|
t9 = cx(t8);
|
|
60
|
-
$[
|
|
61
|
-
$[
|
|
62
|
-
} else t9 = $[
|
|
64
|
+
$[14] = t8;
|
|
65
|
+
$[15] = t9;
|
|
66
|
+
} else t9 = $[15];
|
|
63
67
|
const t10 = styles?.indicator;
|
|
64
68
|
let t11;
|
|
65
|
-
if ($[
|
|
69
|
+
if ($[16] !== t10 || $[17] !== t7 || $[18] !== t9) {
|
|
66
70
|
t11 = /*#__PURE__*/ jsx("span", {
|
|
67
71
|
"data-tao-radio": "",
|
|
68
72
|
"data-tao-checked": t7,
|
|
69
73
|
className: t9,
|
|
70
74
|
style: t10
|
|
71
75
|
});
|
|
72
|
-
$[
|
|
73
|
-
$[
|
|
74
|
-
$[
|
|
75
|
-
$[
|
|
76
|
-
} else t11 = $[
|
|
76
|
+
$[16] = t10;
|
|
77
|
+
$[17] = t7;
|
|
78
|
+
$[18] = t9;
|
|
79
|
+
$[19] = t11;
|
|
80
|
+
} else t11 = $[19];
|
|
77
81
|
let t12;
|
|
78
|
-
if ($[
|
|
82
|
+
if ($[20] !== t11 || $[21] !== t6) {
|
|
79
83
|
t12 = /*#__PURE__*/ jsxs("span", {
|
|
80
84
|
"data-tao-radio-control": "",
|
|
81
85
|
children: [
|
|
@@ -83,25 +87,25 @@ function Radio(t0) {
|
|
|
83
87
|
t11
|
|
84
88
|
]
|
|
85
89
|
});
|
|
86
|
-
$[
|
|
87
|
-
$[
|
|
88
|
-
$[
|
|
89
|
-
} else t12 = $[
|
|
90
|
+
$[20] = t11;
|
|
91
|
+
$[21] = t6;
|
|
92
|
+
$[22] = t12;
|
|
93
|
+
} else t12 = $[22];
|
|
90
94
|
let t13;
|
|
91
|
-
if ($[
|
|
95
|
+
if ($[23] !== children || $[24] !== classNames?.label || $[25] !== styles?.label) {
|
|
92
96
|
t13 = null != children && /*#__PURE__*/ jsx("span", {
|
|
93
97
|
"data-tao-radio-label": "",
|
|
94
98
|
className: cx(classNames?.label),
|
|
95
99
|
style: styles?.label,
|
|
96
100
|
children: children
|
|
97
101
|
});
|
|
98
|
-
$[
|
|
99
|
-
$[
|
|
100
|
-
$[
|
|
101
|
-
$[
|
|
102
|
-
} else t13 = $[
|
|
102
|
+
$[23] = children;
|
|
103
|
+
$[24] = classNames?.label;
|
|
104
|
+
$[25] = styles?.label;
|
|
105
|
+
$[26] = t13;
|
|
106
|
+
} else t13 = $[26];
|
|
103
107
|
let t14;
|
|
104
|
-
if ($[
|
|
108
|
+
if ($[27] !== t12 || $[28] !== t13 || $[29] !== t2 || $[30] !== t4 || $[31] !== t5) {
|
|
105
109
|
t14 = /*#__PURE__*/ jsxs("label", {
|
|
106
110
|
"data-tao-radio-wrapper": "",
|
|
107
111
|
"data-tao-disabled": t2,
|
|
@@ -112,13 +116,13 @@ function Radio(t0) {
|
|
|
112
116
|
t13
|
|
113
117
|
]
|
|
114
118
|
});
|
|
115
|
-
$[
|
|
116
|
-
$[
|
|
117
|
-
$[
|
|
118
|
-
$[
|
|
119
|
-
$[
|
|
120
|
-
$[
|
|
121
|
-
} else t14 = $[
|
|
119
|
+
$[27] = t12;
|
|
120
|
+
$[28] = t13;
|
|
121
|
+
$[29] = t2;
|
|
122
|
+
$[30] = t4;
|
|
123
|
+
$[31] = t5;
|
|
124
|
+
$[32] = t14;
|
|
125
|
+
} else t14 = $[32];
|
|
122
126
|
return t14;
|
|
123
127
|
}
|
|
124
128
|
function RadioGroup(t0) {
|
|
@@ -2,7 +2,7 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { c } from "react/compiler-runtime";
|
|
3
3
|
import { useCallback, useMemo, useState } from "react";
|
|
4
4
|
import { Drawer } from "../drawer/drawer.js";
|
|
5
|
-
import { SearchIcon } from "./select.js";
|
|
5
|
+
import { SearchIcon } from "./select-icons.js";
|
|
6
6
|
import "./mobile-select.css";
|
|
7
7
|
const defaultFilter = (input, option)=>{
|
|
8
8
|
const label = 'string' == typeof option.label ? option.label : String(option.label);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function ChevronDownIcon(): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function CheckIcon(): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare function CloseIcon({ small }: {
|
|
4
|
+
small?: boolean;
|
|
5
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare function SearchIcon(): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function LoadingIcon(): import("react/jsx-runtime").JSX.Element;
|