@rockshin/tao-ui 0.0.20 → 0.0.22
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/drawer/drawer.js +119 -133
- 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 +30 -9
- 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/modal/modal.js +116 -130
- 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/portal.d.ts +4 -0
- package/dist/utils/portal.js +4 -0
- 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
|
@@ -1,101 +1,144 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { cloneElement, isValidElement, useId } from "react";
|
|
3
4
|
import { cx } from "../../utils/semantic.js";
|
|
4
5
|
import "./form.css";
|
|
5
6
|
function FormField(t0) {
|
|
6
|
-
const $ = c(
|
|
7
|
+
const $ = c(40);
|
|
7
8
|
const { label, htmlFor, required, error, description, children, className, style, classNames, styles } = t0;
|
|
8
|
-
const
|
|
9
|
+
const generatedId = useId();
|
|
10
|
+
const child = /*#__PURE__*/ isValidElement(children) ? children : null;
|
|
11
|
+
const childId = "string" == typeof child?.props.id ? child.props.id : void 0;
|
|
12
|
+
const controlId = htmlFor ?? childId ?? `${generatedId}-control`;
|
|
13
|
+
const descriptionId = `${generatedId}-description`;
|
|
14
|
+
const errorId = `${generatedId}-error`;
|
|
15
|
+
const childDescribedBy = "string" == typeof child?.props["aria-describedby"] ? child.props["aria-describedby"] : void 0;
|
|
16
|
+
const t1 = error ? errorId : description ? descriptionId : void 0;
|
|
9
17
|
let t2;
|
|
10
|
-
if ($[0] !==
|
|
11
|
-
t2 =
|
|
12
|
-
|
|
18
|
+
if ($[0] !== childDescribedBy || $[1] !== t1) {
|
|
19
|
+
t2 = [
|
|
20
|
+
childDescribedBy,
|
|
21
|
+
t1
|
|
22
|
+
].filter(Boolean);
|
|
23
|
+
$[0] = childDescribedBy;
|
|
13
24
|
$[1] = t1;
|
|
14
25
|
$[2] = t2;
|
|
15
26
|
} else t2 = $[2];
|
|
16
|
-
const
|
|
17
|
-
let
|
|
18
|
-
if ($[3] !==
|
|
19
|
-
|
|
20
|
-
|
|
27
|
+
const describedBy = t2.join(" ");
|
|
28
|
+
let t3;
|
|
29
|
+
if ($[3] !== child || $[4] !== children || $[5] !== controlId || $[6] !== describedBy || $[7] !== error || $[8] !== errorId || $[9] !== required) {
|
|
30
|
+
t3 = child ? /*#__PURE__*/ cloneElement(child, {
|
|
31
|
+
id: controlId,
|
|
32
|
+
"aria-describedby": describedBy || void 0,
|
|
33
|
+
"aria-errormessage": error ? errorId : void 0,
|
|
34
|
+
"aria-invalid": error ? true : child.props["aria-invalid"],
|
|
35
|
+
"aria-required": required ? true : child.props["aria-required"]
|
|
36
|
+
}) : children;
|
|
37
|
+
$[3] = child;
|
|
38
|
+
$[4] = children;
|
|
39
|
+
$[5] = controlId;
|
|
40
|
+
$[6] = describedBy;
|
|
41
|
+
$[7] = error;
|
|
42
|
+
$[8] = errorId;
|
|
43
|
+
$[9] = required;
|
|
44
|
+
$[10] = t3;
|
|
45
|
+
} else t3 = $[10];
|
|
46
|
+
const control = t3;
|
|
47
|
+
const t4 = classNames?.root;
|
|
48
|
+
let t5;
|
|
49
|
+
if ($[11] !== className || $[12] !== t4) {
|
|
50
|
+
t5 = cx(t4, className);
|
|
51
|
+
$[11] = className;
|
|
52
|
+
$[12] = t4;
|
|
53
|
+
$[13] = t5;
|
|
54
|
+
} else t5 = $[13];
|
|
55
|
+
const t6 = styles?.root;
|
|
56
|
+
let t7;
|
|
57
|
+
if ($[14] !== style || $[15] !== t6) {
|
|
58
|
+
t7 = {
|
|
59
|
+
...t6,
|
|
21
60
|
...style
|
|
22
61
|
};
|
|
23
|
-
$[
|
|
24
|
-
$[
|
|
25
|
-
$[
|
|
26
|
-
} else
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
let
|
|
30
|
-
if ($[
|
|
31
|
-
|
|
62
|
+
$[14] = style;
|
|
63
|
+
$[15] = t6;
|
|
64
|
+
$[16] = t7;
|
|
65
|
+
} else t7 = $[16];
|
|
66
|
+
const t8 = classNames?.label;
|
|
67
|
+
const t9 = styles?.label;
|
|
68
|
+
let t10;
|
|
69
|
+
if ($[17] !== required) {
|
|
70
|
+
t10 = required && /*#__PURE__*/ jsx("span", {
|
|
32
71
|
"data-tao-required": "",
|
|
33
72
|
"aria-hidden": "true",
|
|
34
73
|
children: "*"
|
|
35
74
|
});
|
|
36
|
-
$[
|
|
37
|
-
$[
|
|
38
|
-
} else
|
|
39
|
-
let
|
|
40
|
-
if ($[
|
|
41
|
-
|
|
42
|
-
htmlFor:
|
|
43
|
-
className:
|
|
44
|
-
style:
|
|
75
|
+
$[17] = required;
|
|
76
|
+
$[18] = t10;
|
|
77
|
+
} else t10 = $[18];
|
|
78
|
+
let t11;
|
|
79
|
+
if ($[19] !== controlId || $[20] !== label || $[21] !== t10 || $[22] !== t8 || $[23] !== t9) {
|
|
80
|
+
t11 = /*#__PURE__*/ jsxs("label", {
|
|
81
|
+
htmlFor: controlId,
|
|
82
|
+
className: t8,
|
|
83
|
+
style: t9,
|
|
45
84
|
"data-tao-form-label": "",
|
|
46
85
|
children: [
|
|
47
86
|
label,
|
|
48
|
-
|
|
87
|
+
t10
|
|
49
88
|
]
|
|
50
89
|
});
|
|
51
|
-
$[
|
|
52
|
-
$[
|
|
53
|
-
$[
|
|
54
|
-
$[
|
|
55
|
-
$[
|
|
56
|
-
$[
|
|
57
|
-
} else
|
|
58
|
-
let
|
|
59
|
-
if ($[
|
|
60
|
-
|
|
90
|
+
$[19] = controlId;
|
|
91
|
+
$[20] = label;
|
|
92
|
+
$[21] = t10;
|
|
93
|
+
$[22] = t8;
|
|
94
|
+
$[23] = t9;
|
|
95
|
+
$[24] = t11;
|
|
96
|
+
} else t11 = $[24];
|
|
97
|
+
let t12;
|
|
98
|
+
if ($[25] !== classNames?.description || $[26] !== classNames?.error || $[27] !== description || $[28] !== descriptionId || $[29] !== error || $[30] !== errorId || $[31] !== styles?.description || $[32] !== styles?.error) {
|
|
99
|
+
t12 = error ? /*#__PURE__*/ jsx("p", {
|
|
61
100
|
className: classNames?.error,
|
|
62
101
|
style: styles?.error,
|
|
63
102
|
"data-tao-form-error": "",
|
|
103
|
+
id: errorId,
|
|
64
104
|
role: "alert",
|
|
65
105
|
children: error
|
|
66
106
|
}) : description ? /*#__PURE__*/ jsx("p", {
|
|
67
107
|
className: classNames?.description,
|
|
68
108
|
style: styles?.description,
|
|
69
109
|
"data-tao-form-description": "",
|
|
110
|
+
id: descriptionId,
|
|
70
111
|
children: description
|
|
71
112
|
}) : null;
|
|
72
|
-
$[
|
|
73
|
-
$[
|
|
74
|
-
$[
|
|
75
|
-
$[
|
|
76
|
-
$[
|
|
77
|
-
$[
|
|
78
|
-
$[
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
113
|
+
$[25] = classNames?.description;
|
|
114
|
+
$[26] = classNames?.error;
|
|
115
|
+
$[27] = description;
|
|
116
|
+
$[28] = descriptionId;
|
|
117
|
+
$[29] = error;
|
|
118
|
+
$[30] = errorId;
|
|
119
|
+
$[31] = styles?.description;
|
|
120
|
+
$[32] = styles?.error;
|
|
121
|
+
$[33] = t12;
|
|
122
|
+
} else t12 = $[33];
|
|
123
|
+
let t13;
|
|
124
|
+
if ($[34] !== control || $[35] !== t11 || $[36] !== t12 || $[37] !== t5 || $[38] !== t7) {
|
|
125
|
+
t13 = /*#__PURE__*/ jsxs("div", {
|
|
126
|
+
className: t5,
|
|
127
|
+
style: t7,
|
|
85
128
|
"data-tao-form-field": "",
|
|
86
129
|
children: [
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
130
|
+
t11,
|
|
131
|
+
control,
|
|
132
|
+
t12
|
|
90
133
|
]
|
|
91
134
|
});
|
|
92
|
-
$[
|
|
93
|
-
$[
|
|
94
|
-
$[
|
|
95
|
-
$[
|
|
96
|
-
$[
|
|
97
|
-
$[
|
|
98
|
-
} else
|
|
99
|
-
return
|
|
135
|
+
$[34] = control;
|
|
136
|
+
$[35] = t11;
|
|
137
|
+
$[36] = t12;
|
|
138
|
+
$[37] = t5;
|
|
139
|
+
$[38] = t7;
|
|
140
|
+
$[39] = t13;
|
|
141
|
+
} else t13 = $[39];
|
|
142
|
+
return t13;
|
|
100
143
|
}
|
|
101
144
|
export { FormField };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
[data-tao-input] {
|
|
2
|
+
--tao-input-line-height: var(--tao-line-height);
|
|
2
3
|
width: 100%;
|
|
3
4
|
font-family: var(--tao-font-family);
|
|
4
5
|
align-items: center;
|
|
@@ -7,6 +8,7 @@
|
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
[data-tao-input][data-tao-size="small"] {
|
|
11
|
+
--tao-input-line-height: var(--tao-line-height-sm);
|
|
10
12
|
height: var(--tao-control-height-sm);
|
|
11
13
|
border-radius: var(--tao-radius-sm);
|
|
12
14
|
}
|
|
@@ -27,6 +29,7 @@
|
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
[data-tao-input][data-tao-size="large"] {
|
|
32
|
+
--tao-input-line-height: var(--tao-line-height-lg);
|
|
30
33
|
height: var(--tao-control-height-lg);
|
|
31
34
|
border-radius: var(--tao-radius-md);
|
|
32
35
|
}
|
|
@@ -41,14 +44,17 @@
|
|
|
41
44
|
}
|
|
42
45
|
|
|
43
46
|
[data-tao-input] input {
|
|
47
|
+
box-sizing: border-box;
|
|
44
48
|
height: 100%;
|
|
49
|
+
font-family: inherit;
|
|
50
|
+
line-height: var(--tao-input-line-height);
|
|
45
51
|
color: var(--tao-color-text);
|
|
46
52
|
background: none;
|
|
47
53
|
border: none;
|
|
48
54
|
outline: none;
|
|
49
55
|
flex: 1;
|
|
50
56
|
min-width: 0;
|
|
51
|
-
|
|
57
|
+
padding-block: 0;
|
|
52
58
|
}
|
|
53
59
|
|
|
54
60
|
[data-tao-input] input::placeholder {
|
|
@@ -67,20 +73,35 @@
|
|
|
67
73
|
display: flex;
|
|
68
74
|
}
|
|
69
75
|
|
|
70
|
-
[data-tao-prefix] {
|
|
76
|
+
[data-tao-prefix], [data-tao-input] [data-tao-prefix] + input {
|
|
71
77
|
padding-inline-start: var(--tao-padding-sm);
|
|
72
78
|
}
|
|
73
79
|
|
|
74
|
-
[data-tao-
|
|
75
|
-
|
|
80
|
+
[data-tao-prefix] svg, [data-tao-suffix] svg {
|
|
81
|
+
width: 16px;
|
|
82
|
+
height: 16px;
|
|
76
83
|
}
|
|
77
84
|
|
|
78
|
-
[data-tao-
|
|
79
|
-
|
|
85
|
+
[data-tao-input]:has([data-tao-prefix] svg) [data-tao-prefix] {
|
|
86
|
+
inset-inline-start: var(--tao-padding-sm);
|
|
87
|
+
padding: 0;
|
|
88
|
+
position: absolute;
|
|
89
|
+
top: 50%;
|
|
90
|
+
transform: translateY(-50%);
|
|
80
91
|
}
|
|
81
92
|
|
|
82
|
-
[data-tao-prefix] svg
|
|
83
|
-
|
|
84
|
-
|
|
93
|
+
[data-tao-input]:has([data-tao-prefix] svg) [data-tao-prefix] svg {
|
|
94
|
+
position: static;
|
|
95
|
+
transform: none;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
[data-tao-input]:has([data-tao-prefix] svg) input {
|
|
99
|
+
padding-inline-start: calc(var(--tao-padding-sm) +
|
|
100
|
+
16px +
|
|
101
|
+
var(--tao-padding-sm));
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
[data-tao-suffix] {
|
|
105
|
+
padding-inline-end: var(--tao-padding-sm);
|
|
85
106
|
}
|
|
86
107
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type InputHTMLAttributes, type ReactNode } from 'react';
|
|
2
|
-
import { type TaoSize, type TaoVariant } from '../../provider/tao-provider';
|
|
2
|
+
import { type TaoSize, type TaoStatus, type TaoVariant } from '../../provider/tao-provider';
|
|
3
3
|
import { type SemanticClassNames, type SemanticStyles } from '../../utils/semantic';
|
|
4
4
|
import './input.css';
|
|
5
5
|
export type InputSemanticPart = 'root' | 'input' | 'prefix' | 'suffix';
|
|
@@ -9,6 +9,7 @@ export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>,
|
|
|
9
9
|
prefix?: ReactNode;
|
|
10
10
|
suffix?: ReactNode;
|
|
11
11
|
error?: boolean;
|
|
12
|
+
status?: TaoStatus;
|
|
12
13
|
classNames?: SemanticClassNames<InputSemanticPart>;
|
|
13
14
|
styles?: SemanticStyles<InputSemanticPart>;
|
|
14
15
|
}
|
|
@@ -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;
|