@rockshin/tao-ui 0.0.45 → 0.0.46
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 +3 -1
- package/component-manifest.json +32 -3
- package/dist/components/alert/alert.js +20 -17
- package/dist/components/avatar/avatar.js +2 -1
- package/dist/components/breadcrumb/breadcrumb.js +81 -77
- package/dist/components/calendar/calendar.d.ts +0 -1
- package/dist/components/calendar/calendar.js +41 -30
- package/dist/components/color-picker/color-picker.js +273 -269
- package/dist/components/date-picker/calendar/calendar-grid.js +10 -4
- package/dist/components/date-picker/calendar/use-calendar.d.ts +2 -2
- package/dist/components/date-picker/calendar/use-calendar.js +2 -3
- package/dist/components/date-picker/date-localization.d.ts +3 -0
- package/dist/components/date-picker/date-localization.js +76 -0
- package/dist/components/date-picker/date-picker.js +35 -27
- package/dist/components/date-picker/range-picker.js +28 -20
- package/dist/components/dropdown/dropdown.js +21 -20
- package/dist/components/float-button/float-button.js +3 -2
- package/dist/components/form/form.js +88 -103
- package/dist/components/image/image.js +202 -137
- package/dist/components/list/list-pagination.js +148 -147
- package/dist/components/modal/confirm-dialog.js +4 -2
- package/dist/components/modal/modal.js +385 -383
- package/dist/components/pagination/pagination.js +115 -110
- package/dist/components/popconfirm/popconfirm.js +109 -107
- package/dist/components/qr-code/qr-code.js +22 -21
- package/dist/components/scroll-area/scroll-area.js +41 -38
- package/dist/components/select/mobile-select.d.ts +1 -1
- package/dist/components/select/mobile-select.js +2 -1
- package/dist/components/sonner/sonner.js +10 -10
- package/dist/components/spinner/spinner.js +1 -1
- package/dist/components/splitter/splitter.js +24 -21
- package/dist/components/statistic/statistic.d.ts +2 -0
- package/dist/components/statistic/statistic.js +203 -187
- package/dist/components/table/table-filter.js +61 -52
- package/dist/components/table/table-icons.js +3 -1
- package/dist/components/table/table.d.ts +1 -1
- package/dist/components/table/table.js +5 -4
- package/dist/components/tag/tag.js +22 -19
- package/dist/components/time-picker/time-picker.d.ts +0 -1
- package/dist/components/time-picker/time-picker.js +139 -96
- package/dist/components/transfer/transfer-list.js +224 -488
- package/dist/components/transfer/transfer-parts.js +2 -2
- package/dist/components/transfer/transfer-types.d.ts +1 -0
- package/dist/components/transfer/transfer.js +13 -16
- package/dist/components/upload/upload.js +30 -26
- package/dist/docs/component-docs.d.ts +13 -2
- package/dist/docs/components/headless-input-number.doc.d.ts +5 -0
- package/dist/docs/components/headless-input-number.doc.js +7 -0
- package/dist/docs/components/input-number.doc.d.ts +5 -0
- package/dist/docs/components/input-number.doc.js +7 -0
- package/dist/docs/components/statistic.doc.d.ts +5 -0
- package/dist/docs/components/statistic.doc.js +7 -0
- package/dist/docs/components/tao-provider.doc.d.ts +8 -2
- package/dist/docs/components/tao-provider.doc.js +10 -2
- package/dist/docs/components/tooltip.doc.d.ts +2 -2
- package/dist/entries/provider.d.ts +1 -0
- package/dist/entries/provider.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/locales/ar-EG.d.ts +3 -0
- package/dist/locales/ar-EG.js +199 -0
- package/dist/locales/create-locale.d.ts +41 -0
- package/dist/locales/create-locale.js +88 -0
- package/dist/locales/de-DE.d.ts +3 -0
- package/dist/locales/de-DE.js +195 -0
- package/dist/locales/en-US.d.ts +2 -0
- package/dist/locales/en-US.js +194 -0
- package/dist/locales/es-ES.d.ts +3 -0
- package/dist/locales/es-ES.js +195 -0
- package/dist/locales/fr-FR.d.ts +3 -0
- package/dist/locales/fr-FR.js +195 -0
- package/dist/locales/hi-IN.d.ts +3 -0
- package/dist/locales/hi-IN.js +194 -0
- package/dist/locales/id-ID.d.ts +3 -0
- package/dist/locales/id-ID.js +194 -0
- package/dist/locales/index.d.ts +18 -0
- package/dist/locales/index.js +17 -0
- package/dist/locales/it-IT.d.ts +3 -0
- package/dist/locales/it-IT.js +195 -0
- package/dist/locales/ja-JP.d.ts +3 -0
- package/dist/locales/ja-JP.js +194 -0
- package/dist/locales/ko-KR.d.ts +3 -0
- package/dist/locales/ko-KR.js +194 -0
- package/dist/locales/pt-BR.d.ts +3 -0
- package/dist/locales/pt-BR.js +195 -0
- package/dist/locales/ru-RU.d.ts +3 -0
- package/dist/locales/ru-RU.js +197 -0
- package/dist/locales/th-TH.d.ts +3 -0
- package/dist/locales/th-TH.js +194 -0
- package/dist/locales/tr-TR.d.ts +3 -0
- package/dist/locales/tr-TR.js +194 -0
- package/dist/locales/types.d.ts +176 -0
- package/dist/locales/types.js +0 -0
- package/dist/locales/vi-VN.d.ts +3 -0
- package/dist/locales/vi-VN.js +194 -0
- package/dist/locales/zh-CN.d.ts +3 -0
- package/dist/locales/zh-CN.js +194 -0
- package/dist/locales/zh-TW.d.ts +3 -0
- package/dist/locales/zh-TW.js +194 -0
- package/dist/number-input/format.d.ts +4 -3
- package/dist/number-input/format.js +9 -7
- package/dist/number-input/locale.d.ts +19 -0
- package/dist/number-input/locale.js +44 -0
- package/dist/number-input/number-input.js +1 -0
- package/dist/number-input/use-number-input.d.ts +2 -0
- package/dist/number-input/use-number-input.js +180 -176
- package/dist/provider/locale.d.ts +3 -65
- package/dist/provider/locale.js +2 -146
- package/dist/provider/merge-locale.d.ts +8 -0
- package/dist/provider/merge-locale.js +53 -0
- package/dist/provider/tao-provider.d.ts +6 -2
- package/dist/provider/tao-provider.js +2 -4
- package/llms.txt +1 -1
- package/package.json +5 -1
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { c } from "react-compiler-runtime";
|
|
3
3
|
import { forwardRef, useEffect, useImperativeHandle, useLayoutEffect, useRef, useState } from "react";
|
|
4
|
+
import { groupInteger, localizeDigits, resolveNumberFormat } from "../../number-input/locale.js";
|
|
5
|
+
import { useTaoConfig } from "../../provider/tao-provider.js";
|
|
4
6
|
import { cx } from "../../utils/semantic.js";
|
|
5
7
|
import { Skeleton } from "../skeleton/skeleton.js";
|
|
6
8
|
import "./statistic.css";
|
|
@@ -8,26 +10,26 @@ const plainNumber = new Intl.NumberFormat('en-US', {
|
|
|
8
10
|
useGrouping: false,
|
|
9
11
|
maximumSignificantDigits: 21
|
|
10
12
|
});
|
|
11
|
-
function formattedNumber(value, precision,
|
|
13
|
+
function formattedNumber(value, precision, options) {
|
|
12
14
|
const text = 'number' == typeof value && String(value).includes('e') ? plainNumber.format(value) : String(value);
|
|
13
15
|
const match = /^(-?)(\d*)(?:\.(\d+))?$/.exec(text);
|
|
14
16
|
if (!match || '-' === text) return text;
|
|
15
|
-
const integer = (match[2] || '0')
|
|
17
|
+
const integer = localizeDigits(groupInteger(match[2] || '0', options), options);
|
|
16
18
|
const fraction = void 0 === precision ? match[3] ?? '' : (match[3] ?? '').padEnd(precision, '0').slice(0, Math.max(0, precision));
|
|
17
19
|
return /*#__PURE__*/ jsxs(Fragment, {
|
|
18
20
|
children: [
|
|
19
21
|
/*#__PURE__*/ jsxs("span", {
|
|
20
22
|
"data-tao-statistic-integer": "",
|
|
21
23
|
children: [
|
|
22
|
-
match[1],
|
|
24
|
+
match[1] ? options.minusSign ?? '-' : '',
|
|
23
25
|
integer
|
|
24
26
|
]
|
|
25
27
|
}),
|
|
26
28
|
fraction && /*#__PURE__*/ jsxs("span", {
|
|
27
29
|
"data-tao-statistic-decimal": "",
|
|
28
30
|
children: [
|
|
29
|
-
|
|
30
|
-
fraction
|
|
31
|
+
options.decimalSeparator,
|
|
32
|
+
localizeDigits(fraction, options)
|
|
31
33
|
]
|
|
32
34
|
})
|
|
33
35
|
]
|
|
@@ -35,10 +37,13 @@ function formattedNumber(value, precision, group, separator) {
|
|
|
35
37
|
}
|
|
36
38
|
const hasContent = (node)=>null != node && 'boolean' != typeof node;
|
|
37
39
|
const StatisticRoot = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
38
|
-
const $ = c(
|
|
40
|
+
const $ = c(86);
|
|
39
41
|
let className;
|
|
40
42
|
let classNames;
|
|
43
|
+
let decimalSeparator;
|
|
41
44
|
let formatter;
|
|
45
|
+
let groupSeparator;
|
|
46
|
+
let localeProp;
|
|
42
47
|
let precision;
|
|
43
48
|
let prefix;
|
|
44
49
|
let prefixCls;
|
|
@@ -49,145 +54,156 @@ const StatisticRoot = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
49
54
|
let suffix;
|
|
50
55
|
let t0;
|
|
51
56
|
let t1;
|
|
52
|
-
let t2;
|
|
53
|
-
let t3;
|
|
54
57
|
let title;
|
|
55
58
|
let valueRender;
|
|
56
59
|
let valueStyle;
|
|
57
60
|
if ($[0] !== props) {
|
|
58
|
-
({ prefixCls, rootClassName, value: t0, valueStyle, valueRender, title, prefix, suffix, loading: t1, formatter,
|
|
61
|
+
({ prefixCls, rootClassName, value: t0, valueStyle, valueRender, title, prefix, suffix, loading: t1, formatter, locale: localeProp, decimalSeparator, groupSeparator, precision, classNames, styles, className, style, ...rest } = props);
|
|
59
62
|
$[0] = props;
|
|
60
63
|
$[1] = className;
|
|
61
64
|
$[2] = classNames;
|
|
62
|
-
$[3] =
|
|
63
|
-
$[4] =
|
|
64
|
-
$[5] =
|
|
65
|
-
$[6] =
|
|
66
|
-
$[7] =
|
|
67
|
-
$[8] =
|
|
68
|
-
$[9] =
|
|
69
|
-
$[10] =
|
|
70
|
-
$[11] =
|
|
71
|
-
$[12] =
|
|
72
|
-
$[13] =
|
|
73
|
-
$[14] =
|
|
74
|
-
$[15] =
|
|
75
|
-
$[16] =
|
|
76
|
-
$[17] =
|
|
77
|
-
$[18] =
|
|
65
|
+
$[3] = decimalSeparator;
|
|
66
|
+
$[4] = formatter;
|
|
67
|
+
$[5] = groupSeparator;
|
|
68
|
+
$[6] = localeProp;
|
|
69
|
+
$[7] = precision;
|
|
70
|
+
$[8] = prefix;
|
|
71
|
+
$[9] = prefixCls;
|
|
72
|
+
$[10] = rest;
|
|
73
|
+
$[11] = rootClassName;
|
|
74
|
+
$[12] = style;
|
|
75
|
+
$[13] = styles;
|
|
76
|
+
$[14] = suffix;
|
|
77
|
+
$[15] = t0;
|
|
78
|
+
$[16] = t1;
|
|
79
|
+
$[17] = title;
|
|
80
|
+
$[18] = valueRender;
|
|
81
|
+
$[19] = valueStyle;
|
|
78
82
|
} else {
|
|
79
83
|
className = $[1];
|
|
80
84
|
classNames = $[2];
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
85
|
+
decimalSeparator = $[3];
|
|
86
|
+
formatter = $[4];
|
|
87
|
+
groupSeparator = $[5];
|
|
88
|
+
localeProp = $[6];
|
|
89
|
+
precision = $[7];
|
|
90
|
+
prefix = $[8];
|
|
91
|
+
prefixCls = $[9];
|
|
92
|
+
rest = $[10];
|
|
93
|
+
rootClassName = $[11];
|
|
94
|
+
style = $[12];
|
|
95
|
+
styles = $[13];
|
|
96
|
+
suffix = $[14];
|
|
97
|
+
t0 = $[15];
|
|
98
|
+
t1 = $[16];
|
|
99
|
+
title = $[17];
|
|
100
|
+
valueRender = $[18];
|
|
101
|
+
valueStyle = $[19];
|
|
97
102
|
}
|
|
98
103
|
const value = void 0 === t0 ? 0 : t0;
|
|
99
104
|
const loading = void 0 === t1 ? false : t1;
|
|
100
|
-
const
|
|
101
|
-
const
|
|
105
|
+
const config = useTaoConfig();
|
|
106
|
+
const locale = localeProp ?? config.locale.numberLocale;
|
|
107
|
+
let t2;
|
|
108
|
+
if ($[20] !== decimalSeparator || $[21] !== groupSeparator || $[22] !== locale) {
|
|
109
|
+
t2 = resolveNumberFormat(locale, {
|
|
110
|
+
decimalSeparator,
|
|
111
|
+
thousandsSeparator: groupSeparator
|
|
112
|
+
});
|
|
113
|
+
$[20] = decimalSeparator;
|
|
114
|
+
$[21] = groupSeparator;
|
|
115
|
+
$[22] = locale;
|
|
116
|
+
$[23] = t2;
|
|
117
|
+
} else t2 = $[23];
|
|
118
|
+
const numberFormat = t2;
|
|
102
119
|
let classes;
|
|
103
|
-
let
|
|
104
|
-
if ($[
|
|
120
|
+
let t3;
|
|
121
|
+
if ($[24] !== classNames || $[25] !== loading || $[26] !== numberFormat.decimalSeparator || $[27] !== numberFormat.thousandsSeparator || $[28] !== props || $[29] !== styles || $[30] !== value) {
|
|
105
122
|
const merged = {
|
|
106
123
|
...props,
|
|
107
124
|
value,
|
|
108
125
|
loading,
|
|
109
|
-
decimalSeparator,
|
|
110
|
-
groupSeparator
|
|
126
|
+
decimalSeparator: numberFormat.decimalSeparator,
|
|
127
|
+
groupSeparator: numberFormat.thousandsSeparator
|
|
111
128
|
};
|
|
112
129
|
classes = "function" == typeof classNames ? classNames({
|
|
113
130
|
props: merged
|
|
114
131
|
}) : classNames;
|
|
115
|
-
|
|
132
|
+
t3 = "function" == typeof styles ? styles({
|
|
116
133
|
props: merged
|
|
117
134
|
}) : styles;
|
|
118
|
-
$[
|
|
119
|
-
$[
|
|
120
|
-
$[
|
|
121
|
-
$[
|
|
122
|
-
$[
|
|
123
|
-
$[
|
|
124
|
-
$[
|
|
125
|
-
$[
|
|
126
|
-
$[
|
|
135
|
+
$[24] = classNames;
|
|
136
|
+
$[25] = loading;
|
|
137
|
+
$[26] = numberFormat.decimalSeparator;
|
|
138
|
+
$[27] = numberFormat.thousandsSeparator;
|
|
139
|
+
$[28] = props;
|
|
140
|
+
$[29] = styles;
|
|
141
|
+
$[30] = value;
|
|
142
|
+
$[31] = classes;
|
|
143
|
+
$[32] = t3;
|
|
127
144
|
} else {
|
|
128
|
-
classes = $[
|
|
129
|
-
|
|
145
|
+
classes = $[31];
|
|
146
|
+
t3 = $[32];
|
|
130
147
|
}
|
|
131
|
-
const slots =
|
|
148
|
+
const slots = t3;
|
|
132
149
|
const node = useRef(null);
|
|
133
|
-
let
|
|
134
|
-
if ($[
|
|
135
|
-
|
|
150
|
+
let t4;
|
|
151
|
+
if ($[33] === Symbol.for("react.memo_cache_sentinel")) {
|
|
152
|
+
t4 = ()=>({
|
|
136
153
|
nativeElement: node.current
|
|
137
154
|
});
|
|
138
|
-
$[
|
|
139
|
-
} else
|
|
140
|
-
useImperativeHandle(ref,
|
|
141
|
-
const
|
|
142
|
-
const
|
|
155
|
+
$[33] = t4;
|
|
156
|
+
} else t4 = $[33];
|
|
157
|
+
useImperativeHandle(ref, t4);
|
|
158
|
+
const t5 = classes?.value;
|
|
159
|
+
const t6 = slots?.value;
|
|
160
|
+
let t7;
|
|
161
|
+
if ($[34] !== formatter || $[35] !== numberFormat || $[36] !== precision || $[37] !== value) {
|
|
162
|
+
t7 = "function" == typeof formatter ? formatter(value) : formattedNumber(value, precision, numberFormat);
|
|
163
|
+
$[34] = formatter;
|
|
164
|
+
$[35] = numberFormat;
|
|
165
|
+
$[36] = precision;
|
|
166
|
+
$[37] = value;
|
|
167
|
+
$[38] = t7;
|
|
168
|
+
} else t7 = $[38];
|
|
143
169
|
let t8;
|
|
144
|
-
if ($[
|
|
145
|
-
t8 = "
|
|
146
|
-
$[29] = decimalSeparator;
|
|
147
|
-
$[30] = formatter;
|
|
148
|
-
$[31] = groupSeparator;
|
|
149
|
-
$[32] = precision;
|
|
150
|
-
$[33] = value;
|
|
151
|
-
$[34] = t8;
|
|
152
|
-
} else t8 = $[34];
|
|
153
|
-
let t9;
|
|
154
|
-
if ($[35] !== t6 || $[36] !== t7 || $[37] !== t8) {
|
|
155
|
-
t9 = /*#__PURE__*/ jsx("span", {
|
|
170
|
+
if ($[39] !== t5 || $[40] !== t6 || $[41] !== t7) {
|
|
171
|
+
t8 = /*#__PURE__*/ jsx("span", {
|
|
156
172
|
"data-tao-statistic-value": "",
|
|
157
|
-
className:
|
|
158
|
-
style:
|
|
159
|
-
children:
|
|
173
|
+
className: t5,
|
|
174
|
+
style: t6,
|
|
175
|
+
children: t7
|
|
160
176
|
});
|
|
161
|
-
$[
|
|
162
|
-
$[
|
|
163
|
-
$[
|
|
164
|
-
$[
|
|
165
|
-
} else
|
|
166
|
-
const formatted =
|
|
167
|
-
const
|
|
168
|
-
let
|
|
169
|
-
if ($[
|
|
170
|
-
|
|
171
|
-
$[
|
|
172
|
-
$[
|
|
173
|
-
$[
|
|
174
|
-
$[
|
|
175
|
-
$[
|
|
176
|
-
} else
|
|
177
|
-
const
|
|
178
|
-
let
|
|
179
|
-
if ($[
|
|
180
|
-
|
|
181
|
-
...
|
|
177
|
+
$[39] = t5;
|
|
178
|
+
$[40] = t6;
|
|
179
|
+
$[41] = t7;
|
|
180
|
+
$[42] = t8;
|
|
181
|
+
} else t8 = $[42];
|
|
182
|
+
const formatted = t8;
|
|
183
|
+
const t9 = classes?.root;
|
|
184
|
+
let t10;
|
|
185
|
+
if ($[43] !== className || $[44] !== prefixCls || $[45] !== rootClassName || $[46] !== t9) {
|
|
186
|
+
t10 = cx(prefixCls, t9, className, rootClassName);
|
|
187
|
+
$[43] = className;
|
|
188
|
+
$[44] = prefixCls;
|
|
189
|
+
$[45] = rootClassName;
|
|
190
|
+
$[46] = t9;
|
|
191
|
+
$[47] = t10;
|
|
192
|
+
} else t10 = $[47];
|
|
193
|
+
const t11 = slots?.root;
|
|
194
|
+
let t12;
|
|
195
|
+
if ($[48] !== style || $[49] !== t11) {
|
|
196
|
+
t12 = {
|
|
197
|
+
...t11,
|
|
182
198
|
...style
|
|
183
199
|
};
|
|
184
|
-
$[
|
|
185
|
-
$[
|
|
186
|
-
$[
|
|
187
|
-
} else
|
|
188
|
-
let
|
|
189
|
-
if ($[
|
|
190
|
-
|
|
200
|
+
$[48] = style;
|
|
201
|
+
$[49] = t11;
|
|
202
|
+
$[50] = t12;
|
|
203
|
+
} else t12 = $[50];
|
|
204
|
+
let t13;
|
|
205
|
+
if ($[51] !== classes?.header || $[52] !== classes?.title || $[53] !== slots?.header || $[54] !== slots?.title || $[55] !== title) {
|
|
206
|
+
t13 = hasContent(title) && /*#__PURE__*/ jsx("div", {
|
|
191
207
|
"data-tao-statistic-header": "",
|
|
192
208
|
className: classes?.header,
|
|
193
209
|
style: slots?.header,
|
|
@@ -198,110 +214,110 @@ const StatisticRoot = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
198
214
|
children: title
|
|
199
215
|
})
|
|
200
216
|
});
|
|
201
|
-
$[
|
|
202
|
-
$[
|
|
203
|
-
$[
|
|
204
|
-
$[
|
|
205
|
-
$[
|
|
206
|
-
$[
|
|
207
|
-
} else
|
|
208
|
-
const
|
|
209
|
-
const
|
|
210
|
-
let
|
|
211
|
-
if ($[
|
|
212
|
-
|
|
217
|
+
$[51] = classes?.header;
|
|
218
|
+
$[52] = classes?.title;
|
|
219
|
+
$[53] = slots?.header;
|
|
220
|
+
$[54] = slots?.title;
|
|
221
|
+
$[55] = title;
|
|
222
|
+
$[56] = t13;
|
|
223
|
+
} else t13 = $[56];
|
|
224
|
+
const t14 = classes?.content;
|
|
225
|
+
const t15 = slots?.content;
|
|
226
|
+
let t16;
|
|
227
|
+
if ($[57] !== t15 || $[58] !== valueStyle) {
|
|
228
|
+
t16 = {
|
|
213
229
|
...valueStyle,
|
|
214
|
-
...
|
|
230
|
+
...t15
|
|
215
231
|
};
|
|
216
|
-
$[
|
|
217
|
-
$[
|
|
218
|
-
$[
|
|
219
|
-
} else
|
|
220
|
-
let
|
|
221
|
-
if ($[
|
|
222
|
-
|
|
232
|
+
$[57] = t15;
|
|
233
|
+
$[58] = valueStyle;
|
|
234
|
+
$[59] = t16;
|
|
235
|
+
} else t16 = $[59];
|
|
236
|
+
let t17;
|
|
237
|
+
if ($[60] !== classes?.prefix || $[61] !== prefix || $[62] !== slots?.prefix) {
|
|
238
|
+
t17 = hasContent(prefix) && /*#__PURE__*/ jsx("span", {
|
|
223
239
|
"data-tao-statistic-prefix": "",
|
|
224
240
|
className: classes?.prefix,
|
|
225
241
|
style: slots?.prefix,
|
|
226
242
|
children: prefix
|
|
227
243
|
});
|
|
228
|
-
$[
|
|
229
|
-
$[
|
|
230
|
-
$[
|
|
231
|
-
$[
|
|
232
|
-
} else
|
|
244
|
+
$[60] = classes?.prefix;
|
|
245
|
+
$[61] = prefix;
|
|
246
|
+
$[62] = slots?.prefix;
|
|
247
|
+
$[63] = t17;
|
|
248
|
+
} else t17 = $[63];
|
|
249
|
+
let t18;
|
|
250
|
+
if ($[64] !== formatted || $[65] !== valueRender) {
|
|
251
|
+
t18 = valueRender ? valueRender(formatted) : formatted;
|
|
252
|
+
$[64] = formatted;
|
|
253
|
+
$[65] = valueRender;
|
|
254
|
+
$[66] = t18;
|
|
255
|
+
} else t18 = $[66];
|
|
233
256
|
let t19;
|
|
234
|
-
if ($[
|
|
235
|
-
t19 =
|
|
236
|
-
$[60] = formatted;
|
|
237
|
-
$[61] = valueRender;
|
|
238
|
-
$[62] = t19;
|
|
239
|
-
} else t19 = $[62];
|
|
240
|
-
let t20;
|
|
241
|
-
if ($[63] !== classes?.suffix || $[64] !== slots?.suffix || $[65] !== suffix) {
|
|
242
|
-
t20 = hasContent(suffix) && /*#__PURE__*/ jsx("span", {
|
|
257
|
+
if ($[67] !== classes?.suffix || $[68] !== slots?.suffix || $[69] !== suffix) {
|
|
258
|
+
t19 = hasContent(suffix) && /*#__PURE__*/ jsx("span", {
|
|
243
259
|
"data-tao-statistic-suffix": "",
|
|
244
260
|
className: classes?.suffix,
|
|
245
261
|
style: slots?.suffix,
|
|
246
262
|
children: suffix
|
|
247
263
|
});
|
|
248
|
-
$[
|
|
249
|
-
$[
|
|
250
|
-
$[
|
|
251
|
-
$[
|
|
252
|
-
} else
|
|
253
|
-
let
|
|
254
|
-
if ($[
|
|
255
|
-
|
|
264
|
+
$[67] = classes?.suffix;
|
|
265
|
+
$[68] = slots?.suffix;
|
|
266
|
+
$[69] = suffix;
|
|
267
|
+
$[70] = t19;
|
|
268
|
+
} else t19 = $[70];
|
|
269
|
+
let t20;
|
|
270
|
+
if ($[71] !== t14 || $[72] !== t16 || $[73] !== t17 || $[74] !== t18 || $[75] !== t19) {
|
|
271
|
+
t20 = /*#__PURE__*/ jsxs("div", {
|
|
256
272
|
"data-tao-statistic-content": "",
|
|
257
|
-
className:
|
|
258
|
-
style:
|
|
273
|
+
className: t14,
|
|
274
|
+
style: t16,
|
|
259
275
|
children: [
|
|
276
|
+
t17,
|
|
260
277
|
t18,
|
|
261
|
-
t19
|
|
262
|
-
t20
|
|
278
|
+
t19
|
|
263
279
|
]
|
|
264
280
|
});
|
|
265
|
-
$[
|
|
266
|
-
$[
|
|
267
|
-
$[
|
|
268
|
-
$[
|
|
269
|
-
$[
|
|
270
|
-
$[
|
|
271
|
-
} else
|
|
272
|
-
let
|
|
273
|
-
if ($[
|
|
274
|
-
|
|
281
|
+
$[71] = t14;
|
|
282
|
+
$[72] = t16;
|
|
283
|
+
$[73] = t17;
|
|
284
|
+
$[74] = t18;
|
|
285
|
+
$[75] = t19;
|
|
286
|
+
$[76] = t20;
|
|
287
|
+
} else t20 = $[76];
|
|
288
|
+
let t21;
|
|
289
|
+
if ($[77] !== loading || $[78] !== t20) {
|
|
290
|
+
t21 = /*#__PURE__*/ jsx(Skeleton, {
|
|
275
291
|
loading: loading,
|
|
276
292
|
paragraph: false,
|
|
277
293
|
active: true,
|
|
278
|
-
children:
|
|
294
|
+
children: t20
|
|
279
295
|
});
|
|
280
|
-
$[
|
|
281
|
-
$[
|
|
282
|
-
$[
|
|
283
|
-
} else
|
|
284
|
-
let
|
|
285
|
-
if ($[
|
|
286
|
-
|
|
296
|
+
$[77] = loading;
|
|
297
|
+
$[78] = t20;
|
|
298
|
+
$[79] = t21;
|
|
299
|
+
} else t21 = $[79];
|
|
300
|
+
let t22;
|
|
301
|
+
if ($[80] !== rest || $[81] !== t10 || $[82] !== t12 || $[83] !== t13 || $[84] !== t21) {
|
|
302
|
+
t22 = /*#__PURE__*/ jsxs("div", {
|
|
287
303
|
...rest,
|
|
288
304
|
ref: node,
|
|
289
305
|
"data-tao-statistic": "",
|
|
290
|
-
className:
|
|
291
|
-
style:
|
|
306
|
+
className: t10,
|
|
307
|
+
style: t12,
|
|
292
308
|
children: [
|
|
293
|
-
|
|
294
|
-
|
|
309
|
+
t13,
|
|
310
|
+
t21
|
|
295
311
|
]
|
|
296
312
|
});
|
|
297
|
-
$[
|
|
298
|
-
$[
|
|
299
|
-
$[
|
|
300
|
-
$[
|
|
301
|
-
$[
|
|
302
|
-
$[
|
|
303
|
-
} else
|
|
304
|
-
return
|
|
313
|
+
$[80] = rest;
|
|
314
|
+
$[81] = t10;
|
|
315
|
+
$[82] = t12;
|
|
316
|
+
$[83] = t13;
|
|
317
|
+
$[84] = t21;
|
|
318
|
+
$[85] = t22;
|
|
319
|
+
} else t22 = $[85];
|
|
320
|
+
return t22;
|
|
305
321
|
});
|
|
306
322
|
StatisticRoot.displayName = 'Statistic';
|
|
307
323
|
const units = [
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { c } from "react-compiler-runtime";
|
|
3
|
-
import { TaoPortalScope } from "../../provider/tao-provider.js";
|
|
3
|
+
import { TaoPortalScope, useTaoConfig } from "../../provider/tao-provider.js";
|
|
4
4
|
import { CheckIcon, FilterIcon } from "./table-icons.js";
|
|
5
5
|
import * as __rspack_external__radix_ui_react_dropdown_menu_154a7470 from "@radix-ui/react-dropdown-menu";
|
|
6
6
|
function TableFilterDropdown(t0) {
|
|
7
|
-
const $ = c(
|
|
7
|
+
const $ = c(25);
|
|
8
8
|
const { filters, activeValues, onSelect } = t0;
|
|
9
|
+
const { locale } = useTaoConfig();
|
|
9
10
|
let t1;
|
|
10
11
|
if ($[0] !== activeValues || $[1] !== onSelect) {
|
|
11
12
|
t1 = (value)=>{
|
|
@@ -22,25 +23,32 @@ function TableFilterDropdown(t0) {
|
|
|
22
23
|
const t2 = activeValues.length > 0;
|
|
23
24
|
let t3;
|
|
24
25
|
if ($[3] !== t2) {
|
|
25
|
-
t3 = /*#__PURE__*/ jsx(
|
|
26
|
+
t3 = /*#__PURE__*/ jsx(FilterIcon, {
|
|
27
|
+
active: t2
|
|
28
|
+
});
|
|
29
|
+
$[3] = t2;
|
|
30
|
+
$[4] = t3;
|
|
31
|
+
} else t3 = $[4];
|
|
32
|
+
let t4;
|
|
33
|
+
if ($[5] !== locale.messages.filter || $[6] !== t3) {
|
|
34
|
+
t4 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dropdown_menu_154a7470.Trigger, {
|
|
26
35
|
asChild: true,
|
|
27
36
|
children: /*#__PURE__*/ jsx("button", {
|
|
28
37
|
type: "button",
|
|
29
38
|
"data-tao-table-filter-trigger": "",
|
|
30
|
-
"aria-label":
|
|
31
|
-
children:
|
|
32
|
-
active: t2
|
|
33
|
-
})
|
|
39
|
+
"aria-label": locale.messages.filter,
|
|
40
|
+
children: t3
|
|
34
41
|
})
|
|
35
42
|
});
|
|
36
|
-
$[
|
|
37
|
-
$[
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
$[5] = locale.messages.filter;
|
|
44
|
+
$[6] = t3;
|
|
45
|
+
$[7] = t4;
|
|
46
|
+
} else t4 = $[7];
|
|
47
|
+
let t5;
|
|
48
|
+
if ($[8] !== activeValues || $[9] !== filters || $[10] !== toggle) {
|
|
49
|
+
let t6;
|
|
50
|
+
if ($[12] !== activeValues || $[13] !== toggle) {
|
|
51
|
+
t6 = (filter)=>{
|
|
44
52
|
const checked = activeValues.includes(filter.value);
|
|
45
53
|
return /*#__PURE__*/ jsxs(__rspack_external__radix_ui_react_dropdown_menu_154a7470.CheckboxItem, {
|
|
46
54
|
checked: checked,
|
|
@@ -61,30 +69,31 @@ function TableFilterDropdown(t0) {
|
|
|
61
69
|
]
|
|
62
70
|
}, filter.value);
|
|
63
71
|
};
|
|
64
|
-
$[
|
|
65
|
-
$[
|
|
66
|
-
$[
|
|
67
|
-
} else
|
|
68
|
-
|
|
69
|
-
$[
|
|
70
|
-
$[
|
|
71
|
-
$[
|
|
72
|
-
$[
|
|
73
|
-
} else
|
|
74
|
-
let
|
|
75
|
-
if ($[
|
|
76
|
-
|
|
72
|
+
$[12] = activeValues;
|
|
73
|
+
$[13] = toggle;
|
|
74
|
+
$[14] = t6;
|
|
75
|
+
} else t6 = $[14];
|
|
76
|
+
t5 = filters.map(t6);
|
|
77
|
+
$[8] = activeValues;
|
|
78
|
+
$[9] = filters;
|
|
79
|
+
$[10] = toggle;
|
|
80
|
+
$[11] = t5;
|
|
81
|
+
} else t5 = $[11];
|
|
82
|
+
let t6;
|
|
83
|
+
if ($[15] !== activeValues.length || $[16] !== locale.messages.filterReset || $[17] !== onSelect) {
|
|
84
|
+
t6 = activeValues.length > 0 && /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dropdown_menu_154a7470.Item, {
|
|
77
85
|
"data-tao-table-filter-reset": "",
|
|
78
86
|
onSelect: ()=>onSelect([]),
|
|
79
|
-
children:
|
|
87
|
+
children: locale.messages.filterReset
|
|
80
88
|
});
|
|
81
|
-
$[
|
|
82
|
-
$[
|
|
83
|
-
$[
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
89
|
+
$[15] = activeValues.length;
|
|
90
|
+
$[16] = locale.messages.filterReset;
|
|
91
|
+
$[17] = onSelect;
|
|
92
|
+
$[18] = t6;
|
|
93
|
+
} else t6 = $[18];
|
|
94
|
+
let t7;
|
|
95
|
+
if ($[19] !== t5 || $[20] !== t6) {
|
|
96
|
+
t7 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dropdown_menu_154a7470.Portal, {
|
|
88
97
|
children: /*#__PURE__*/ jsx(TaoPortalScope, {
|
|
89
98
|
asChild: true,
|
|
90
99
|
children: /*#__PURE__*/ jsxs(__rspack_external__radix_ui_react_dropdown_menu_154a7470.Content, {
|
|
@@ -93,29 +102,29 @@ function TableFilterDropdown(t0) {
|
|
|
93
102
|
sideOffset: 4,
|
|
94
103
|
loop: true,
|
|
95
104
|
children: [
|
|
96
|
-
|
|
97
|
-
|
|
105
|
+
t5,
|
|
106
|
+
t6
|
|
98
107
|
]
|
|
99
108
|
})
|
|
100
109
|
})
|
|
101
110
|
});
|
|
102
|
-
$[
|
|
103
|
-
$[
|
|
104
|
-
$[
|
|
105
|
-
} else
|
|
106
|
-
let
|
|
107
|
-
if ($[
|
|
108
|
-
|
|
111
|
+
$[19] = t5;
|
|
112
|
+
$[20] = t6;
|
|
113
|
+
$[21] = t7;
|
|
114
|
+
} else t7 = $[21];
|
|
115
|
+
let t8;
|
|
116
|
+
if ($[22] !== t4 || $[23] !== t7) {
|
|
117
|
+
t8 = /*#__PURE__*/ jsxs(__rspack_external__radix_ui_react_dropdown_menu_154a7470.Root, {
|
|
109
118
|
children: [
|
|
110
|
-
|
|
111
|
-
|
|
119
|
+
t4,
|
|
120
|
+
t7
|
|
112
121
|
]
|
|
113
122
|
});
|
|
114
|
-
$[
|
|
115
|
-
$[
|
|
116
|
-
$[
|
|
117
|
-
} else
|
|
118
|
-
return
|
|
123
|
+
$[22] = t4;
|
|
124
|
+
$[23] = t7;
|
|
125
|
+
$[24] = t8;
|
|
126
|
+
} else t8 = $[24];
|
|
127
|
+
return t8;
|
|
119
128
|
}
|
|
120
129
|
function _temp(event) {
|
|
121
130
|
return event.preventDefault();
|