@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.
Files changed (114) hide show
  1. package/README.md +3 -1
  2. package/component-manifest.json +32 -3
  3. package/dist/components/alert/alert.js +20 -17
  4. package/dist/components/avatar/avatar.js +2 -1
  5. package/dist/components/breadcrumb/breadcrumb.js +81 -77
  6. package/dist/components/calendar/calendar.d.ts +0 -1
  7. package/dist/components/calendar/calendar.js +41 -30
  8. package/dist/components/color-picker/color-picker.js +273 -269
  9. package/dist/components/date-picker/calendar/calendar-grid.js +10 -4
  10. package/dist/components/date-picker/calendar/use-calendar.d.ts +2 -2
  11. package/dist/components/date-picker/calendar/use-calendar.js +2 -3
  12. package/dist/components/date-picker/date-localization.d.ts +3 -0
  13. package/dist/components/date-picker/date-localization.js +76 -0
  14. package/dist/components/date-picker/date-picker.js +35 -27
  15. package/dist/components/date-picker/range-picker.js +28 -20
  16. package/dist/components/dropdown/dropdown.js +21 -20
  17. package/dist/components/float-button/float-button.js +3 -2
  18. package/dist/components/form/form.js +88 -103
  19. package/dist/components/image/image.js +202 -137
  20. package/dist/components/list/list-pagination.js +148 -147
  21. package/dist/components/modal/confirm-dialog.js +4 -2
  22. package/dist/components/modal/modal.js +385 -383
  23. package/dist/components/pagination/pagination.js +115 -110
  24. package/dist/components/popconfirm/popconfirm.js +109 -107
  25. package/dist/components/qr-code/qr-code.js +22 -21
  26. package/dist/components/scroll-area/scroll-area.js +41 -38
  27. package/dist/components/select/mobile-select.d.ts +1 -1
  28. package/dist/components/select/mobile-select.js +2 -1
  29. package/dist/components/sonner/sonner.js +10 -10
  30. package/dist/components/spinner/spinner.js +1 -1
  31. package/dist/components/splitter/splitter.js +24 -21
  32. package/dist/components/statistic/statistic.d.ts +2 -0
  33. package/dist/components/statistic/statistic.js +203 -187
  34. package/dist/components/table/table-filter.js +61 -52
  35. package/dist/components/table/table-icons.js +3 -1
  36. package/dist/components/table/table.d.ts +1 -1
  37. package/dist/components/table/table.js +5 -4
  38. package/dist/components/tag/tag.js +22 -19
  39. package/dist/components/time-picker/time-picker.d.ts +0 -1
  40. package/dist/components/time-picker/time-picker.js +139 -96
  41. package/dist/components/transfer/transfer-list.js +224 -488
  42. package/dist/components/transfer/transfer-parts.js +2 -2
  43. package/dist/components/transfer/transfer-types.d.ts +1 -0
  44. package/dist/components/transfer/transfer.js +13 -16
  45. package/dist/components/upload/upload.js +30 -26
  46. package/dist/docs/component-docs.d.ts +13 -2
  47. package/dist/docs/components/headless-input-number.doc.d.ts +5 -0
  48. package/dist/docs/components/headless-input-number.doc.js +7 -0
  49. package/dist/docs/components/input-number.doc.d.ts +5 -0
  50. package/dist/docs/components/input-number.doc.js +7 -0
  51. package/dist/docs/components/statistic.doc.d.ts +5 -0
  52. package/dist/docs/components/statistic.doc.js +7 -0
  53. package/dist/docs/components/tao-provider.doc.d.ts +8 -2
  54. package/dist/docs/components/tao-provider.doc.js +10 -2
  55. package/dist/docs/components/tooltip.doc.d.ts +2 -2
  56. package/dist/entries/provider.d.ts +1 -0
  57. package/dist/entries/provider.js +1 -0
  58. package/dist/index.d.ts +1 -0
  59. package/dist/index.js +1 -0
  60. package/dist/locales/ar-EG.d.ts +3 -0
  61. package/dist/locales/ar-EG.js +199 -0
  62. package/dist/locales/create-locale.d.ts +41 -0
  63. package/dist/locales/create-locale.js +88 -0
  64. package/dist/locales/de-DE.d.ts +3 -0
  65. package/dist/locales/de-DE.js +195 -0
  66. package/dist/locales/en-US.d.ts +2 -0
  67. package/dist/locales/en-US.js +194 -0
  68. package/dist/locales/es-ES.d.ts +3 -0
  69. package/dist/locales/es-ES.js +195 -0
  70. package/dist/locales/fr-FR.d.ts +3 -0
  71. package/dist/locales/fr-FR.js +195 -0
  72. package/dist/locales/hi-IN.d.ts +3 -0
  73. package/dist/locales/hi-IN.js +194 -0
  74. package/dist/locales/id-ID.d.ts +3 -0
  75. package/dist/locales/id-ID.js +194 -0
  76. package/dist/locales/index.d.ts +18 -0
  77. package/dist/locales/index.js +17 -0
  78. package/dist/locales/it-IT.d.ts +3 -0
  79. package/dist/locales/it-IT.js +195 -0
  80. package/dist/locales/ja-JP.d.ts +3 -0
  81. package/dist/locales/ja-JP.js +194 -0
  82. package/dist/locales/ko-KR.d.ts +3 -0
  83. package/dist/locales/ko-KR.js +194 -0
  84. package/dist/locales/pt-BR.d.ts +3 -0
  85. package/dist/locales/pt-BR.js +195 -0
  86. package/dist/locales/ru-RU.d.ts +3 -0
  87. package/dist/locales/ru-RU.js +197 -0
  88. package/dist/locales/th-TH.d.ts +3 -0
  89. package/dist/locales/th-TH.js +194 -0
  90. package/dist/locales/tr-TR.d.ts +3 -0
  91. package/dist/locales/tr-TR.js +194 -0
  92. package/dist/locales/types.d.ts +176 -0
  93. package/dist/locales/types.js +0 -0
  94. package/dist/locales/vi-VN.d.ts +3 -0
  95. package/dist/locales/vi-VN.js +194 -0
  96. package/dist/locales/zh-CN.d.ts +3 -0
  97. package/dist/locales/zh-CN.js +194 -0
  98. package/dist/locales/zh-TW.d.ts +3 -0
  99. package/dist/locales/zh-TW.js +194 -0
  100. package/dist/number-input/format.d.ts +4 -3
  101. package/dist/number-input/format.js +9 -7
  102. package/dist/number-input/locale.d.ts +19 -0
  103. package/dist/number-input/locale.js +44 -0
  104. package/dist/number-input/number-input.js +1 -0
  105. package/dist/number-input/use-number-input.d.ts +2 -0
  106. package/dist/number-input/use-number-input.js +180 -176
  107. package/dist/provider/locale.d.ts +3 -65
  108. package/dist/provider/locale.js +2 -146
  109. package/dist/provider/merge-locale.d.ts +8 -0
  110. package/dist/provider/merge-locale.js +53 -0
  111. package/dist/provider/tao-provider.d.ts +6 -2
  112. package/dist/provider/tao-provider.js +2 -4
  113. package/llms.txt +1 -1
  114. 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, group, separator) {
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').replace(/\B(?=(\d{3})+(?!\d))/g, group);
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
- separator,
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(82);
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, decimalSeparator: t2, groupSeparator: t3, precision, classNames, styles, className, style, ...rest } = props);
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] = formatter;
63
- $[4] = precision;
64
- $[5] = prefix;
65
- $[6] = prefixCls;
66
- $[7] = rest;
67
- $[8] = rootClassName;
68
- $[9] = style;
69
- $[10] = styles;
70
- $[11] = suffix;
71
- $[12] = t0;
72
- $[13] = t1;
73
- $[14] = t2;
74
- $[15] = t3;
75
- $[16] = title;
76
- $[17] = valueRender;
77
- $[18] = valueStyle;
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
- formatter = $[3];
82
- precision = $[4];
83
- prefix = $[5];
84
- prefixCls = $[6];
85
- rest = $[7];
86
- rootClassName = $[8];
87
- style = $[9];
88
- styles = $[10];
89
- suffix = $[11];
90
- t0 = $[12];
91
- t1 = $[13];
92
- t2 = $[14];
93
- t3 = $[15];
94
- title = $[16];
95
- valueRender = $[17];
96
- valueStyle = $[18];
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 decimalSeparator = void 0 === t2 ? "." : t2;
101
- const groupSeparator = void 0 === t3 ? "," : t3;
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 t4;
104
- if ($[19] !== classNames || $[20] !== decimalSeparator || $[21] !== groupSeparator || $[22] !== loading || $[23] !== props || $[24] !== styles || $[25] !== value) {
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
- t4 = "function" == typeof styles ? styles({
132
+ t3 = "function" == typeof styles ? styles({
116
133
  props: merged
117
134
  }) : styles;
118
- $[19] = classNames;
119
- $[20] = decimalSeparator;
120
- $[21] = groupSeparator;
121
- $[22] = loading;
122
- $[23] = props;
123
- $[24] = styles;
124
- $[25] = value;
125
- $[26] = classes;
126
- $[27] = t4;
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 = $[26];
129
- t4 = $[27];
145
+ classes = $[31];
146
+ t3 = $[32];
130
147
  }
131
- const slots = t4;
148
+ const slots = t3;
132
149
  const node = useRef(null);
133
- let t5;
134
- if ($[28] === Symbol.for("react.memo_cache_sentinel")) {
135
- t5 = ()=>({
150
+ let t4;
151
+ if ($[33] === Symbol.for("react.memo_cache_sentinel")) {
152
+ t4 = ()=>({
136
153
  nativeElement: node.current
137
154
  });
138
- $[28] = t5;
139
- } else t5 = $[28];
140
- useImperativeHandle(ref, t5);
141
- const t6 = classes?.value;
142
- const t7 = slots?.value;
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 ($[29] !== decimalSeparator || $[30] !== formatter || $[31] !== groupSeparator || $[32] !== precision || $[33] !== value) {
145
- t8 = "function" == typeof formatter ? formatter(value) : formattedNumber(value, precision, groupSeparator, decimalSeparator);
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: t6,
158
- style: t7,
159
- children: t8
173
+ className: t5,
174
+ style: t6,
175
+ children: t7
160
176
  });
161
- $[35] = t6;
162
- $[36] = t7;
163
- $[37] = t8;
164
- $[38] = t9;
165
- } else t9 = $[38];
166
- const formatted = t9;
167
- const t10 = classes?.root;
168
- let t11;
169
- if ($[39] !== className || $[40] !== prefixCls || $[41] !== rootClassName || $[42] !== t10) {
170
- t11 = cx(prefixCls, t10, className, rootClassName);
171
- $[39] = className;
172
- $[40] = prefixCls;
173
- $[41] = rootClassName;
174
- $[42] = t10;
175
- $[43] = t11;
176
- } else t11 = $[43];
177
- const t12 = slots?.root;
178
- let t13;
179
- if ($[44] !== style || $[45] !== t12) {
180
- t13 = {
181
- ...t12,
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
- $[44] = style;
185
- $[45] = t12;
186
- $[46] = t13;
187
- } else t13 = $[46];
188
- let t14;
189
- if ($[47] !== classes?.header || $[48] !== classes?.title || $[49] !== slots?.header || $[50] !== slots?.title || $[51] !== title) {
190
- t14 = hasContent(title) && /*#__PURE__*/ jsx("div", {
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
- $[47] = classes?.header;
202
- $[48] = classes?.title;
203
- $[49] = slots?.header;
204
- $[50] = slots?.title;
205
- $[51] = title;
206
- $[52] = t14;
207
- } else t14 = $[52];
208
- const t15 = classes?.content;
209
- const t16 = slots?.content;
210
- let t17;
211
- if ($[53] !== t16 || $[54] !== valueStyle) {
212
- t17 = {
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
- ...t16
230
+ ...t15
215
231
  };
216
- $[53] = t16;
217
- $[54] = valueStyle;
218
- $[55] = t17;
219
- } else t17 = $[55];
220
- let t18;
221
- if ($[56] !== classes?.prefix || $[57] !== prefix || $[58] !== slots?.prefix) {
222
- t18 = hasContent(prefix) && /*#__PURE__*/ jsx("span", {
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
- $[56] = classes?.prefix;
229
- $[57] = prefix;
230
- $[58] = slots?.prefix;
231
- $[59] = t18;
232
- } else t18 = $[59];
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 ($[60] !== formatted || $[61] !== valueRender) {
235
- t19 = valueRender ? valueRender(formatted) : formatted;
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
- $[63] = classes?.suffix;
249
- $[64] = slots?.suffix;
250
- $[65] = suffix;
251
- $[66] = t20;
252
- } else t20 = $[66];
253
- let t21;
254
- if ($[67] !== t15 || $[68] !== t17 || $[69] !== t18 || $[70] !== t19 || $[71] !== t20) {
255
- t21 = /*#__PURE__*/ jsxs("div", {
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: t15,
258
- style: t17,
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
- $[67] = t15;
266
- $[68] = t17;
267
- $[69] = t18;
268
- $[70] = t19;
269
- $[71] = t20;
270
- $[72] = t21;
271
- } else t21 = $[72];
272
- let t22;
273
- if ($[73] !== loading || $[74] !== t21) {
274
- t22 = /*#__PURE__*/ jsx(Skeleton, {
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: t21
294
+ children: t20
279
295
  });
280
- $[73] = loading;
281
- $[74] = t21;
282
- $[75] = t22;
283
- } else t22 = $[75];
284
- let t23;
285
- if ($[76] !== rest || $[77] !== t11 || $[78] !== t13 || $[79] !== t14 || $[80] !== t22) {
286
- t23 = /*#__PURE__*/ jsxs("div", {
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: t11,
291
- style: t13,
306
+ className: t10,
307
+ style: t12,
292
308
  children: [
293
- t14,
294
- t22
309
+ t13,
310
+ t21
295
311
  ]
296
312
  });
297
- $[76] = rest;
298
- $[77] = t11;
299
- $[78] = t13;
300
- $[79] = t14;
301
- $[80] = t22;
302
- $[81] = t23;
303
- } else t23 = $[81];
304
- return t23;
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(21);
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(__rspack_external__radix_ui_react_dropdown_menu_154a7470.Trigger, {
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": "Filter",
31
- children: /*#__PURE__*/ jsx(FilterIcon, {
32
- active: t2
33
- })
39
+ "aria-label": locale.messages.filter,
40
+ children: t3
34
41
  })
35
42
  });
36
- $[3] = t2;
37
- $[4] = t3;
38
- } else t3 = $[4];
39
- let t4;
40
- if ($[5] !== activeValues || $[6] !== filters || $[7] !== toggle) {
41
- let t5;
42
- if ($[9] !== activeValues || $[10] !== toggle) {
43
- t5 = (filter)=>{
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
- $[9] = activeValues;
65
- $[10] = toggle;
66
- $[11] = t5;
67
- } else t5 = $[11];
68
- t4 = filters.map(t5);
69
- $[5] = activeValues;
70
- $[6] = filters;
71
- $[7] = toggle;
72
- $[8] = t4;
73
- } else t4 = $[8];
74
- let t5;
75
- if ($[12] !== activeValues.length || $[13] !== onSelect) {
76
- t5 = activeValues.length > 0 && /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dropdown_menu_154a7470.Item, {
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: "Reset"
87
+ children: locale.messages.filterReset
80
88
  });
81
- $[12] = activeValues.length;
82
- $[13] = onSelect;
83
- $[14] = t5;
84
- } else t5 = $[14];
85
- let t6;
86
- if ($[15] !== t4 || $[16] !== t5) {
87
- t6 = /*#__PURE__*/ jsx(__rspack_external__radix_ui_react_dropdown_menu_154a7470.Portal, {
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
- t4,
97
- t5
105
+ t5,
106
+ t6
98
107
  ]
99
108
  })
100
109
  })
101
110
  });
102
- $[15] = t4;
103
- $[16] = t5;
104
- $[17] = t6;
105
- } else t6 = $[17];
106
- let t7;
107
- if ($[18] !== t3 || $[19] !== t6) {
108
- t7 = /*#__PURE__*/ jsxs(__rspack_external__radix_ui_react_dropdown_menu_154a7470.Root, {
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
- t3,
111
- t6
119
+ t4,
120
+ t7
112
121
  ]
113
122
  });
114
- $[18] = t3;
115
- $[19] = t6;
116
- $[20] = t7;
117
- } else t7 = $[20];
118
- return t7;
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();