@uzum-tech/ui 1.5.1 → 1.5.3

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 (202) hide show
  1. package/README.md +0 -1
  2. package/dist/index.js +1333 -869
  3. package/dist/index.prod.js +3 -3
  4. package/es/_internal/checkbox/src/use-checkbox.js +3 -3
  5. package/es/_internal/radio/src/use-radio.js +3 -3
  6. package/es/_internal/typography/src/styles/text.cssr.js +0 -1
  7. package/es/_internal/typography/styles/light.js +1 -1
  8. package/es/_mixins/use-form-item.d.ts +4 -4
  9. package/es/_mixins/use-form-item.js +4 -4
  10. package/es/_styles/common/dark.js +1 -1
  11. package/es/_styles/common/light.d.ts +3 -0
  12. package/es/_styles/common/light.js +1 -1
  13. package/es/_utils/composable/composables.d.ts +11 -0
  14. package/es/_utils/composable/composables.js +40 -0
  15. package/es/_utils/index.d.ts +1 -1
  16. package/es/_utils/index.js +1 -1
  17. package/es/_utils/uzum/index.d.ts +1 -0
  18. package/es/_utils/uzum/index.js +1 -0
  19. package/es/_utils/uzum/value.d.ts +1 -0
  20. package/es/_utils/uzum/value.js +9 -0
  21. package/es/_utils/vue/resolve-slot.d.ts +1 -1
  22. package/es/alert/styles/light.js +6 -6
  23. package/es/auto-complete/src/AutoComplete.js +10 -10
  24. package/es/avatar/src/Avatar.d.ts +6 -0
  25. package/es/avatar/src/Avatar.js +9 -3
  26. package/es/card-list/src/CardList.js +1 -1
  27. package/es/card-list/src/CardListItem.d.ts +13 -0
  28. package/es/card-list/src/CardListItem.js +11 -4
  29. package/es/card-list/src/interface.d.ts +1 -0
  30. package/es/card-list/src/styles/index.cssr.js +6 -6
  31. package/es/card-list/styles/light.js +2 -2
  32. package/es/cascader/src/Cascader.js +7 -7
  33. package/es/checkbox/src/CheckboxGroup.js +9 -9
  34. package/es/color-picker/src/ColorPicker.js +6 -6
  35. package/es/components.d.ts +1 -0
  36. package/es/components.js +1 -0
  37. package/es/config-provider/src/internal-interface.d.ts +2 -0
  38. package/es/data-table/src/DataTable.d.ts +8 -0
  39. package/es/data-table/src/DataTable.js +21 -10
  40. package/es/data-table/src/TableParts/Body.d.ts +1 -0
  41. package/es/data-table/src/TableParts/Body.js +6 -5
  42. package/es/data-table/src/TableParts/Cell.js +85 -23
  43. package/es/data-table/src/interface.d.ts +13 -6
  44. package/es/data-table/src/interface.js +1 -1
  45. package/es/data-table/src/styles/index.cssr.js +5 -3
  46. package/es/data-table/src/use-mask.d.ts +3 -6
  47. package/es/data-table/src/utils.d.ts +2 -1
  48. package/es/data-table/src/utils.js +13 -0
  49. package/es/date-picker/src/DatePicker.js +7 -7
  50. package/es/dialog/src/DialogProvider.d.ts +6 -0
  51. package/es/dynamic-tags/src/DynamicTags.js +3 -3
  52. package/es/input/src/Input.js +8 -8
  53. package/es/input-number/src/InputNumber.js +7 -7
  54. package/es/input-otp/index.d.ts +3 -0
  55. package/es/input-otp/index.js +1 -0
  56. package/es/input-otp/src/InputOtp.d.ts +871 -0
  57. package/es/input-otp/src/InputOtp.js +250 -0
  58. package/es/input-otp/src/public-types.d.ts +25 -0
  59. package/es/input-otp/src/public-types.js +1 -0
  60. package/es/input-otp/src/styles/index.cssr.d.ts +2 -0
  61. package/es/input-otp/src/styles/index.cssr.js +20 -0
  62. package/es/input-otp/src/styles/input-otp-rtl.cssr.d.ts +2 -0
  63. package/es/input-otp/src/styles/input-otp-rtl.cssr.js +5 -0
  64. package/es/input-otp/styles/dark.d.ts +3 -0
  65. package/es/input-otp/styles/dark.js +12 -0
  66. package/es/input-otp/styles/index.d.ts +4 -0
  67. package/es/input-otp/styles/index.js +3 -0
  68. package/es/input-otp/styles/light.d.ts +83 -0
  69. package/es/input-otp/styles/light.js +22 -0
  70. package/es/input-otp/styles/rtl.d.ts +2 -0
  71. package/es/input-otp/styles/rtl.js +5 -0
  72. package/es/legacy-transfer/src/Transfer.js +3 -3
  73. package/es/list/src/List.d.ts +41 -55
  74. package/es/list/src/List.js +6 -10
  75. package/es/list/src/ListItem.d.ts +84 -25
  76. package/es/list/src/ListItem.js +120 -98
  77. package/es/list/src/interface.d.ts +1 -0
  78. package/es/list/src/props.d.ts +70 -31
  79. package/es/list/src/props.js +25 -5
  80. package/es/list/src/styles/index.cssr.js +32 -90
  81. package/es/list/styles/light.d.ts +5 -8
  82. package/es/list/styles/light.js +6 -9
  83. package/es/mention/src/Mention.js +7 -7
  84. package/es/radio/src/RadioGroup.js +5 -5
  85. package/es/rate/src/Rate.js +3 -3
  86. package/es/select/src/Select.js +7 -7
  87. package/es/slider/src/Slider.js +3 -3
  88. package/es/styles.d.ts +1 -0
  89. package/es/styles.js +1 -0
  90. package/es/switch/src/Switch.js +7 -7
  91. package/es/tag/src/styles/index.cssr.js +5 -1
  92. package/es/tag/styles/light.js +2 -2
  93. package/es/theme-editor/src/ThemeEditor.d.ts +3 -0
  94. package/es/themes/dark.js +2 -0
  95. package/es/themes/light.js +2 -0
  96. package/es/time-picker/src/TimePicker.js +7 -7
  97. package/es/transfer/src/Transfer.js +3 -3
  98. package/es/tree-select/src/TreeSelect.js +5 -5
  99. package/es/upload/src/UploadFile.js +4 -3
  100. package/es/version.d.ts +1 -1
  101. package/es/version.js +1 -1
  102. package/lib/_internal/checkbox/src/use-checkbox.js +3 -3
  103. package/lib/_internal/radio/src/use-radio.js +3 -3
  104. package/lib/_internal/typography/src/styles/text.cssr.js +0 -1
  105. package/lib/_internal/typography/styles/light.js +1 -1
  106. package/lib/_mixins/use-form-item.d.ts +4 -4
  107. package/lib/_mixins/use-form-item.js +4 -4
  108. package/lib/_styles/common/dark.js +1 -1
  109. package/lib/_styles/common/light.d.ts +3 -0
  110. package/lib/_styles/common/light.js +1 -1
  111. package/lib/_utils/composable/composables.d.ts +11 -0
  112. package/lib/_utils/composable/composables.js +47 -0
  113. package/lib/_utils/index.d.ts +1 -1
  114. package/lib/_utils/index.js +2 -1
  115. package/lib/_utils/uzum/index.d.ts +1 -0
  116. package/lib/_utils/uzum/index.js +3 -1
  117. package/lib/_utils/uzum/value.d.ts +1 -0
  118. package/lib/_utils/uzum/value.js +12 -0
  119. package/lib/_utils/vue/resolve-slot.d.ts +1 -1
  120. package/lib/alert/styles/light.js +6 -6
  121. package/lib/auto-complete/src/AutoComplete.js +10 -10
  122. package/lib/avatar/src/Avatar.d.ts +6 -0
  123. package/lib/avatar/src/Avatar.js +9 -3
  124. package/lib/card-list/src/CardList.js +1 -1
  125. package/lib/card-list/src/CardListItem.d.ts +13 -0
  126. package/lib/card-list/src/CardListItem.js +11 -4
  127. package/lib/card-list/src/interface.d.ts +1 -0
  128. package/lib/card-list/src/styles/index.cssr.js +5 -5
  129. package/lib/card-list/styles/light.js +2 -2
  130. package/lib/cascader/src/Cascader.js +7 -7
  131. package/lib/checkbox/src/CheckboxGroup.js +9 -9
  132. package/lib/color-picker/src/ColorPicker.js +6 -6
  133. package/lib/components.d.ts +1 -0
  134. package/lib/components.js +1 -0
  135. package/lib/config-provider/src/internal-interface.d.ts +2 -0
  136. package/lib/data-table/src/DataTable.d.ts +8 -0
  137. package/lib/data-table/src/DataTable.js +21 -10
  138. package/lib/data-table/src/TableParts/Body.d.ts +1 -0
  139. package/lib/data-table/src/TableParts/Body.js +6 -5
  140. package/lib/data-table/src/TableParts/Cell.js +84 -22
  141. package/lib/data-table/src/interface.d.ts +13 -6
  142. package/lib/data-table/src/interface.js +1 -1
  143. package/lib/data-table/src/styles/index.cssr.js +5 -3
  144. package/lib/data-table/src/use-mask.d.ts +3 -6
  145. package/lib/data-table/src/utils.d.ts +2 -1
  146. package/lib/data-table/src/utils.js +14 -1
  147. package/lib/date-picker/src/DatePicker.js +7 -7
  148. package/lib/dialog/src/DialogProvider.d.ts +6 -0
  149. package/lib/dynamic-tags/src/DynamicTags.js +3 -3
  150. package/lib/input/src/Input.js +8 -8
  151. package/lib/input-number/src/InputNumber.js +7 -7
  152. package/lib/input-otp/index.d.ts +3 -0
  153. package/lib/input-otp/index.js +9 -0
  154. package/lib/input-otp/src/InputOtp.d.ts +871 -0
  155. package/lib/input-otp/src/InputOtp.js +256 -0
  156. package/lib/input-otp/src/public-types.d.ts +25 -0
  157. package/lib/input-otp/src/public-types.js +2 -0
  158. package/lib/input-otp/src/styles/index.cssr.d.ts +2 -0
  159. package/lib/input-otp/src/styles/index.cssr.js +25 -0
  160. package/lib/input-otp/src/styles/input-otp-rtl.cssr.d.ts +2 -0
  161. package/lib/input-otp/src/styles/input-otp-rtl.cssr.js +10 -0
  162. package/lib/input-otp/styles/dark.d.ts +3 -0
  163. package/lib/input-otp/styles/dark.js +14 -0
  164. package/lib/input-otp/styles/index.d.ts +4 -0
  165. package/lib/input-otp/styles/index.js +12 -0
  166. package/lib/input-otp/styles/light.d.ts +83 -0
  167. package/lib/input-otp/styles/light.js +25 -0
  168. package/lib/input-otp/styles/rtl.d.ts +2 -0
  169. package/lib/input-otp/styles/rtl.js +11 -0
  170. package/lib/legacy-transfer/src/Transfer.js +3 -3
  171. package/lib/list/src/List.d.ts +41 -55
  172. package/lib/list/src/List.js +6 -10
  173. package/lib/list/src/ListItem.d.ts +84 -25
  174. package/lib/list/src/ListItem.js +119 -97
  175. package/lib/list/src/interface.d.ts +1 -0
  176. package/lib/list/src/props.d.ts +70 -31
  177. package/lib/list/src/props.js +25 -5
  178. package/lib/list/src/styles/index.cssr.js +32 -90
  179. package/lib/list/styles/light.d.ts +5 -8
  180. package/lib/list/styles/light.js +6 -9
  181. package/lib/mention/src/Mention.js +7 -7
  182. package/lib/radio/src/RadioGroup.js +5 -5
  183. package/lib/rate/src/Rate.js +3 -3
  184. package/lib/select/src/Select.js +7 -7
  185. package/lib/slider/src/Slider.js +3 -3
  186. package/lib/styles.d.ts +1 -0
  187. package/lib/styles.js +106 -103
  188. package/lib/switch/src/Switch.js +7 -7
  189. package/lib/tag/src/styles/index.cssr.js +5 -1
  190. package/lib/tag/styles/light.js +2 -2
  191. package/lib/theme-editor/src/ThemeEditor.d.ts +3 -0
  192. package/lib/themes/dark.js +2 -0
  193. package/lib/themes/light.js +2 -0
  194. package/lib/time-picker/src/TimePicker.js +7 -7
  195. package/lib/transfer/src/Transfer.js +3 -3
  196. package/lib/tree-select/src/TreeSelect.js +5 -5
  197. package/lib/upload/src/UploadFile.js +4 -3
  198. package/lib/version.d.ts +1 -1
  199. package/lib/version.js +1 -1
  200. package/package.json +1 -1
  201. package/volar.d.ts +1 -0
  202. package/web-types.json +180 -38
@@ -188,7 +188,7 @@ exports.default = (0, vue_1.defineComponent)({
188
188
  }
189
189
  function doUpdateValue(value, option, optionPath) {
190
190
  const { onUpdateValue, 'onUpdate:value': _onUpdateValue, onChange } = props;
191
- const { nTriggerFormInput, nTriggerFormChange } = formItem;
191
+ const { triggerFormInput, triggerFormChange } = formItem;
192
192
  if (onUpdateValue) {
193
193
  (0, _utils_1.call)(onUpdateValue, value, option, optionPath);
194
194
  }
@@ -199,8 +199,8 @@ exports.default = (0, vue_1.defineComponent)({
199
199
  (0, _utils_1.call)(onChange, value, option, optionPath);
200
200
  }
201
201
  uncontrolledValueRef.value = value;
202
- nTriggerFormInput();
203
- nTriggerFormChange();
202
+ triggerFormInput();
203
+ triggerFormChange();
204
204
  }
205
205
  function updateKeyboardKey(key) {
206
206
  keyboardKeyRef.value = key;
@@ -377,17 +377,17 @@ exports.default = (0, vue_1.defineComponent)({
377
377
  // --- methods
378
378
  function doBlur(e) {
379
379
  const { onBlur } = props;
380
- const { nTriggerFormBlur } = formItem;
380
+ const { triggerFormBlur } = formItem;
381
381
  if (onBlur)
382
382
  (0, _utils_1.call)(onBlur, e);
383
- nTriggerFormBlur();
383
+ triggerFormBlur();
384
384
  }
385
385
  function doFocus(e) {
386
386
  const { onFocus } = props;
387
- const { nTriggerFormFocus } = formItem;
387
+ const { triggerFormFocus } = formItem;
388
388
  if (onFocus)
389
389
  (0, _utils_1.call)(onFocus, e);
390
- nTriggerFormFocus();
390
+ triggerFormFocus();
391
391
  }
392
392
  function focusSelectionInput() {
393
393
  var _a;
@@ -52,7 +52,7 @@ exports.default = (0, vue_1.defineComponent)({
52
52
  return new Set();
53
53
  });
54
54
  function toggleCheckbox(checked, checkboxValue) {
55
- const { nTriggerFormInput, nTriggerFormChange } = formItem;
55
+ const { triggerFormInput, triggerFormChange } = formItem;
56
56
  const { onChange, 'onUpdate:value': _onUpdateValue, onUpdateValue } = props;
57
57
  if (Array.isArray(mergedValueRef.value)) {
58
58
  const groupValue = Array.from(mergedValueRef.value);
@@ -72,8 +72,8 @@ exports.default = (0, vue_1.defineComponent)({
72
72
  value: checkboxValue
73
73
  });
74
74
  }
75
- nTriggerFormInput();
76
- nTriggerFormChange();
75
+ triggerFormInput();
76
+ triggerFormChange();
77
77
  uncontrolledValueRef.value = groupValue;
78
78
  // deprecated
79
79
  if (onChange)
@@ -98,8 +98,8 @@ exports.default = (0, vue_1.defineComponent)({
98
98
  if (onChange)
99
99
  (0, _utils_1.call)(onChange, groupValue); // deprecated
100
100
  uncontrolledValueRef.value = groupValue;
101
- nTriggerFormInput();
102
- nTriggerFormChange();
101
+ triggerFormInput();
102
+ triggerFormChange();
103
103
  }
104
104
  }
105
105
  }
@@ -120,8 +120,8 @@ exports.default = (0, vue_1.defineComponent)({
120
120
  if (onChange)
121
121
  (0, _utils_1.call)(onChange, [checkboxValue]); // deprecated
122
122
  uncontrolledValueRef.value = [checkboxValue];
123
- nTriggerFormInput();
124
- nTriggerFormChange();
123
+ triggerFormInput();
124
+ triggerFormChange();
125
125
  }
126
126
  else {
127
127
  if (onUpdateValue) {
@@ -139,8 +139,8 @@ exports.default = (0, vue_1.defineComponent)({
139
139
  if (onChange)
140
140
  (0, _utils_1.call)(onChange, []); // deprecated
141
141
  uncontrolledValueRef.value = [];
142
- nTriggerFormInput();
143
- nTriggerFormChange();
142
+ triggerFormInput();
143
+ triggerFormChange();
144
144
  }
145
145
  }
146
146
  }
@@ -261,14 +261,14 @@ exports.default = (0, vue_1.defineComponent)({
261
261
  else {
262
262
  upcomingValue = null;
263
263
  }
264
- const { nTriggerFormChange, nTriggerFormInput } = formItem;
264
+ const { triggerFormChange, triggerFormInput } = formItem;
265
265
  const { onUpdateValue, 'onUpdate:value': _onUpdateValue } = props;
266
266
  if (onUpdateValue)
267
267
  (0, _utils_1.call)(onUpdateValue, value);
268
268
  if (_onUpdateValue)
269
269
  (0, _utils_1.call)(_onUpdateValue, value);
270
- nTriggerFormChange();
271
- nTriggerFormInput();
270
+ triggerFormChange();
271
+ triggerFormInput();
272
272
  uncontrolledValueRef.value = value;
273
273
  }
274
274
  function handleInputUpdateValue(value) {
@@ -279,7 +279,7 @@ exports.default = (0, vue_1.defineComponent)({
279
279
  const { value } = mergedValueRef;
280
280
  // no value & only hue changes will complete with no value
281
281
  if (value) {
282
- const { nTriggerFormChange, nTriggerFormInput } = formItem;
282
+ const { triggerFormChange, triggerFormInput } = formItem;
283
283
  const { onComplete } = props;
284
284
  if (onComplete) {
285
285
  ;
@@ -291,8 +291,8 @@ exports.default = (0, vue_1.defineComponent)({
291
291
  undoStack.splice(valueIndex + 1, undoStack.length, value);
292
292
  valueIndexRef.value = valueIndex + 1;
293
293
  }
294
- nTriggerFormChange();
295
- nTriggerFormInput();
294
+ triggerFormChange();
295
+ triggerFormInput();
296
296
  }
297
297
  }
298
298
  function undo() {
@@ -44,6 +44,7 @@ export * from './icon-wrapper';
44
44
  export * from './image';
45
45
  export * from './input';
46
46
  export * from './input-number';
47
+ export * from './input-otp';
47
48
  export * from './layout';
48
49
  export * from './legacy-grid';
49
50
  export * from './legacy-transfer';
package/lib/components.js CHANGED
@@ -60,6 +60,7 @@ __exportStar(require("./icon-wrapper"), exports);
60
60
  __exportStar(require("./image"), exports);
61
61
  __exportStar(require("./input"), exports);
62
62
  __exportStar(require("./input-number"), exports);
63
+ __exportStar(require("./input-otp"), exports);
63
64
  __exportStar(require("./layout"), exports);
64
65
  __exportStar(require("./legacy-grid"), exports);
65
66
  __exportStar(require("./legacy-transfer"), exports);
@@ -37,6 +37,7 @@ import type { IconWrapperTheme } from '../../icon-wrapper/styles';
37
37
  import type { ImageTheme } from '../../image/styles';
38
38
  import type { InputTheme } from '../../input/styles';
39
39
  import type { InputNumberTheme } from '../../input-number/styles';
40
+ import type { InputOtpTheme } from '../../input-otp/styles';
40
41
  import type { LayoutTheme } from '../../layout/styles';
41
42
  import type { LegacyTransferTheme } from '../../legacy-transfer/styles';
42
43
  import type { ListTheme } from '../../list/styles';
@@ -190,6 +191,7 @@ export interface GlobalThemeWithoutCommon {
190
191
  InternalSelectMenu?: InternalSelectMenuTheme;
191
192
  InternalSelection?: InternalSelectionTheme;
192
193
  AccountOption?: AccountOptionTheme;
194
+ InputOtp?: InputOtpTheme;
193
195
  }
194
196
  export interface GlobalComponentConfig {
195
197
  Pagination?: {
@@ -24,6 +24,7 @@ declare const _default: import("vue").DefineComponent<{
24
24
  readonly default: () => never[];
25
25
  };
26
26
  readonly loading: BooleanConstructor;
27
+ readonly loadingSkeleton: BooleanConstructor;
27
28
  readonly bordered: {
28
29
  readonly type: import("vue").PropType<boolean | undefined>;
29
30
  readonly default: undefined;
@@ -2871,6 +2872,11 @@ declare const _default: import("vue").DefineComponent<{
2871
2872
  page: (page: number) => void;
2872
2873
  sort: (columnKey: import("./interface").ColumnKey, order: import("./interface").SortOrder) => void;
2873
2874
  scrollTo: import("../../scrollbar/src/Scrollbar").ScrollTo;
2875
+ getData: () => {
2876
+ data: import("./interface").InternalRowData[];
2877
+ totalRows: import("./interface").InternalRowData | null;
2878
+ };
2879
+ getTotalRowData: () => import("./interface").InternalRowData | null;
2874
2880
  clearFilter: () => void;
2875
2881
  mainTableInstRef: import("vue").Ref<{
2876
2882
  getHeaderElement: () => HTMLElement | null;
@@ -4295,6 +4301,7 @@ declare const _default: import("vue").DefineComponent<{
4295
4301
  readonly default: () => never[];
4296
4302
  };
4297
4303
  readonly loading: BooleanConstructor;
4304
+ readonly loadingSkeleton: BooleanConstructor;
4298
4305
  readonly bordered: {
4299
4306
  readonly type: import("vue").PropType<boolean | undefined>;
4300
4307
  readonly default: undefined;
@@ -7145,6 +7152,7 @@ declare const _default: import("vue").DefineComponent<{
7145
7152
  readonly virtualScroll: boolean;
7146
7153
  readonly tableLayout: "auto" | "fixed";
7147
7154
  readonly columns: import("./interface").TableColumns<any>;
7155
+ readonly loadingSkeleton: boolean;
7148
7156
  readonly remote: boolean;
7149
7157
  readonly paginateSinglePage: boolean;
7150
7158
  readonly bottomBordered: boolean | undefined;
@@ -18,7 +18,6 @@ const use_resizable_1 = require("./use-resizable");
18
18
  const interface_1 = require("./interface");
19
19
  const use_group_header_1 = require("./use-group-header");
20
20
  const use_expand_1 = require("./use-expand");
21
- const use_mask_1 = require("./use-mask");
22
21
  const index_cssr_1 = __importDefault(require("./styles/index.cssr"));
23
22
  exports.default = (0, vue_1.defineComponent)({
24
23
  name: 'DataTable',
@@ -98,7 +97,7 @@ exports.default = (0, vue_1.defineComponent)({
98
97
  return;
99
98
  if (!('totalRow' in col) || !col.totalRow)
100
99
  return;
101
- const { key, totalRow, render, mask } = col;
100
+ const { key, totalRow, render } = col;
102
101
  if (!totalRow)
103
102
  return;
104
103
  if (totalRow.type === 'default') {
@@ -111,18 +110,12 @@ exports.default = (0, vue_1.defineComponent)({
111
110
  return Number(renderedValue) || 0;
112
111
  });
113
112
  const sum = values.reduce((sum, val) => sum + val, 0);
114
- const finalValue = mask
115
- ? (0, use_mask_1.processMaskedValue)(String(sum), mask)
116
- : sum;
117
- summaryRow[key] = { value: finalValue };
113
+ summaryRow[key] = { value: sum };
118
114
  }
119
115
  else {
120
116
  const values = pageData.map((row) => Number(row[key]) || 0);
121
117
  const sum = values.reduce((sum, val) => sum + val, 0);
122
- const finalValue = mask
123
- ? (0, use_mask_1.processMaskedValue)(String(sum), mask)
124
- : sum;
125
- summaryRow[key] = { value: finalValue };
118
+ summaryRow[key] = { value: sum };
126
119
  }
127
120
  }
128
121
  else {
@@ -258,6 +251,7 @@ exports.default = (0, vue_1.defineComponent)({
258
251
  mergedSortStateRef,
259
252
  mergedFilterStateRef,
260
253
  loadingRef: (0, vue_1.toRef)(props, 'loading'),
254
+ loadingSkeletonRef: (0, vue_1.toRef)(props, 'loadingSkeleton'),
261
255
  rowClassNameRef: (0, vue_1.toRef)(props, 'rowClassName'),
262
256
  mergedCheckedRowKeySetRef,
263
257
  mergedExpandedRowKeysRef,
@@ -324,6 +318,23 @@ exports.default = (0, vue_1.defineComponent)({
324
318
  scrollTo: (arg0, arg1) => {
325
319
  var _a;
326
320
  (_a = mainTableInstRef.value) === null || _a === void 0 ? void 0 : _a.scrollTo(arg0, arg1);
321
+ },
322
+ getData: () => {
323
+ const originalData = props.data || [];
324
+ const totalRowData = autoSummaryRef.value && rawPaginatedDataRef.value
325
+ ? autoSummaryRef.value(rawPaginatedDataRef.value)
326
+ : null;
327
+ return {
328
+ data: originalData,
329
+ totalRows: totalRowData
330
+ };
331
+ },
332
+ getTotalRowData: () => {
333
+ if (autoSummaryRef.value && rawPaginatedDataRef.value) {
334
+ const summaryResult = autoSummaryRef.value(rawPaginatedDataRef.value);
335
+ return summaryResult;
336
+ }
337
+ return null;
327
338
  }
328
339
  };
329
340
  const cssVarsRef = (0, vue_1.computed)(() => {
@@ -1376,6 +1376,7 @@ declare const _default: import("vue").DefineComponent<{
1376
1376
  scrollX: import("vue").Ref<string | number | undefined>;
1377
1377
  cols: import("vue").Ref<ColItem[]>;
1378
1378
  loading: import("vue").Ref<boolean>;
1379
+ loadingSkeleton: import("vue").Ref<boolean>;
1379
1380
  bodyShowHeaderOnly: import("vue").ComputedRef<boolean>;
1380
1381
  shouldDisplaySomeTablePart: import("vue").ComputedRef<boolean>;
1381
1382
  empty: import("vue").ComputedRef<boolean>;
@@ -99,7 +99,7 @@ exports.default = (0, vue_1.defineComponent)({
99
99
  bodyStyle: Object
100
100
  },
101
101
  setup(props) {
102
- const { slots: dataTableSlots, bodyWidthRef, mergedExpandedRowKeysRef, mergedClsPrefixRef, mergedThemeRef, scrollXRef, colsRef, paginatedDataRef, rawPaginatedDataRef, fixedColumnLeftMapRef, fixedColumnRightMapRef, mergedCurrentPageRef, rowClassNameRef, leftActiveFixedColKeyRef, leftActiveFixedChildrenColKeysRef, rightActiveFixedColKeyRef, rightActiveFixedChildrenColKeysRef, renderExpandRef, hoverKeyRef, summaryRef, mergedSortStateRef, virtualScrollRef, componentId, mergedTableLayoutRef, childTriggerColIndexRef, indentRef, rowPropsRef, maxHeightRef, stripedRef, loadingRef, onLoadRef, loadingKeySetRef, expandableRef, stickyExpandedRowsRef, renderExpandIconRef, summaryPlacementRef, treeMateRef, scrollbarPropsRef, setHeaderScrollLeft, doUpdateExpandedRowKeys, handleTableBodyScroll, doCheck, doUncheck, renderCell
102
+ const { slots: dataTableSlots, bodyWidthRef, mergedExpandedRowKeysRef, mergedClsPrefixRef, mergedThemeRef, scrollXRef, colsRef, paginatedDataRef, rawPaginatedDataRef, fixedColumnLeftMapRef, fixedColumnRightMapRef, mergedCurrentPageRef, rowClassNameRef, leftActiveFixedColKeyRef, leftActiveFixedChildrenColKeysRef, rightActiveFixedColKeyRef, rightActiveFixedChildrenColKeysRef, renderExpandRef, hoverKeyRef, summaryRef, mergedSortStateRef, virtualScrollRef, componentId, mergedTableLayoutRef, childTriggerColIndexRef, indentRef, rowPropsRef, maxHeightRef, stripedRef, loadingRef, loadingSkeletonRef, onLoadRef, loadingKeySetRef, expandableRef, stickyExpandedRowsRef, renderExpandIconRef, summaryPlacementRef, treeMateRef, scrollbarPropsRef, setHeaderScrollLeft, doUpdateExpandedRowKeys, handleTableBodyScroll, doCheck, doUncheck, renderCell
103
103
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
104
104
  } = (0, vue_1.inject)(interface_1.dataTableInjectionKey);
105
105
  const scrollbarInstRef = (0, vue_1.ref)(null);
@@ -309,7 +309,7 @@ exports.default = (0, vue_1.defineComponent)({
309
309
  componentId,
310
310
  scrollbarInstRef,
311
311
  virtualListRef,
312
- emptyElRef, summary: summaryRef, mergedClsPrefix: mergedClsPrefixRef, mergedTheme: mergedThemeRef, scrollX: scrollXRef, cols: colsRef, loading: loadingRef, bodyShowHeaderOnly: bodyShowHeaderOnlyRef, shouldDisplaySomeTablePart: shouldDisplaySomeTablePartRef, empty: emptyRef, paginatedDataAndInfo: (0, vue_1.computed)(() => {
312
+ emptyElRef, summary: summaryRef, mergedClsPrefix: mergedClsPrefixRef, mergedTheme: mergedThemeRef, scrollX: scrollXRef, cols: colsRef, loading: loadingRef, loadingSkeleton: loadingSkeletonRef, bodyShowHeaderOnly: bodyShowHeaderOnlyRef, shouldDisplaySomeTablePart: shouldDisplaySomeTablePartRef, empty: emptyRef, paginatedDataAndInfo: (0, vue_1.computed)(() => {
313
313
  const { value: striped } = stripedRef;
314
314
  let hasChildren = false;
315
315
  const data = paginatedDataRef.value.map(striped
@@ -565,6 +565,7 @@ exports.default = (0, vue_1.defineComponent)({
565
565
  `${mergedClsPrefix}-data-table-td--last-row`,
566
566
  'editable' in column &&
567
567
  column.editable &&
568
+ !isSummary &&
568
569
  `${mergedClsPrefix}-data-table-td--editable`
569
570
  ] }),
570
571
  column.fixed && ((0, vue_1.h)("div", { class: `${mergedClsPrefix}-data-table-td__shadow-holder` })),
@@ -596,12 +597,12 @@ exports.default = (0, vue_1.defineComponent)({
596
597
  } },
597
598
  (0, vue_1.h)("colgroup", null, cols.map((col) => ((0, vue_1.h)("col", { key: col.key, style: col.style })))),
598
599
  this.showHeader ? (0, vue_1.h)(Header_1.default, { discrete: false }) : null,
599
- this.loading ? ((0, vue_1.h)(BodySkeleton_1.default, null)) : !this.empty ? ((0, vue_1.h)("tbody", { "data-u-id": componentId, class: `${mergedClsPrefix}-data-table-tbody` }, displayedData.map((rowInfo, displayedRowIndex) => {
600
+ this.loadingSkeleton ? ((0, vue_1.h)(BodySkeleton_1.default, null)) : !this.empty ? ((0, vue_1.h)("tbody", { "data-u-id": componentId, class: `${mergedClsPrefix}-data-table-tbody` }, displayedData.map((rowInfo, displayedRowIndex) => {
600
601
  return renderRow(rowInfo, displayedRowIndex, false);
601
602
  }))) : null));
602
603
  }
603
604
  else {
604
- if (this.loading) {
605
+ if (this.loading || this.loadingSkeleton) {
605
606
  return ((0, vue_1.h)("table", { class: `${mergedClsPrefix}-data-table-table`, onMouseleave: handleMouseleaveTable, style: {
606
607
  tableLayout: this.mergedTableLayout
607
608
  } },
@@ -620,7 +621,7 @@ exports.default = (0, vue_1.defineComponent)({
620
621
  }
621
622
  }
622
623
  }));
623
- if (this.empty) {
624
+ if (this.empty && !this.loadingSkeleton) {
624
625
  const createEmptyNode = () => ((0, vue_1.h)("div", { class: [
625
626
  `${mergedClsPrefix}-data-table-empty`,
626
627
  this.loading && `${mergedClsPrefix}-data-table-empty--hide`
@@ -4,6 +4,7 @@ const vue_1 = require("vue");
4
4
  const lodash_es_1 = require("lodash-es");
5
5
  const ellipsis_1 = require("../../../ellipsis");
6
6
  const use_mask_1 = require("../use-mask");
7
+ const utils_1 = require("../utils");
7
8
  exports.default = (0, vue_1.defineComponent)({
8
9
  name: 'DataTableCell',
9
10
  emits: ['edit'],
@@ -35,7 +36,10 @@ exports.default = (0, vue_1.defineComponent)({
35
36
  var _a;
36
37
  const { isSummary, column, row, renderCell } = this;
37
38
  let cell;
38
- const { render, key, ellipsis, editable, mask } = column;
39
+ let { mask } = column;
40
+ const { render, key, ellipsis, editable, numeric } = column;
41
+ if (numeric && !mask)
42
+ mask = utils_1.defaultNumericMask;
39
43
  if (render && !isSummary) {
40
44
  let cellValue = render(row, this.index);
41
45
  if (mask && cellValue !== null && cellValue !== undefined) {
@@ -47,37 +51,95 @@ exports.default = (0, vue_1.defineComponent)({
47
51
  }
48
52
  else if (editable && !isSummary) {
49
53
  const { placeholder } = column;
50
- let initialValue = String(row[key] || '');
51
- if (mask && initialValue) {
52
- initialValue = (0, use_mask_1.processMaskedValue)(initialValue, mask);
53
- }
54
+ const rawValue = String(row[key] || '');
55
+ const displayValue = mask ? (0, use_mask_1.processMaskedValue)(rawValue, mask) : rawValue;
56
+ const isEditingRef = { current: false };
54
57
  const inputProps = {
55
58
  class: `${this.clsPrefix}-data-table-editable-input`,
56
- value: initialValue,
59
+ value: displayValue,
57
60
  placeholder: placeholder || '',
61
+ onFocus: (e) => {
62
+ const input = e.target;
63
+ isEditingRef.current = true;
64
+ input.value = rawValue;
65
+ },
66
+ onKeyDown: (e) => {
67
+ if (mask && typeof mask === 'function' && isEditingRef.current) {
68
+ const input = e.target;
69
+ input.value = rawValue;
70
+ }
71
+ },
58
72
  onInput: (e) => {
59
- const value = e.target.value;
60
- if (mask) {
61
- const { processedValue, displayValue } = (0, use_mask_1.processInputWithMask)(value, mask);
62
- setTimeout(() => {
63
- const input = e.target;
64
- if (input.value !== displayValue) {
65
- const cursorPos = input.selectionStart || 0;
66
- input.value = displayValue;
67
- input.setSelectionRange(cursorPos, cursorPos);
73
+ const input = e.target;
74
+ const value = input.value;
75
+ if (mask && typeof mask === 'function' && !isEditingRef.current) {
76
+ isEditingRef.current = true;
77
+ }
78
+ if (mask && typeof mask === 'function' && isEditingRef.current) {
79
+ const rawValue = value.replace(/\$/g, '').replace(/[^\d.,]/g, '');
80
+ input.value = rawValue;
81
+ let processedValue = rawValue;
82
+ if (numeric && rawValue !== '') {
83
+ const cleanValue = rawValue
84
+ .replace(/[^\d.,]/g, '')
85
+ .replace(',', '.');
86
+ const numValue = Number(cleanValue);
87
+ if (!isNaN(numValue)) {
88
+ processedValue = numValue;
68
89
  }
69
- });
90
+ }
70
91
  this.$emit('edit', processedValue, row, key);
92
+ void Promise.resolve().then(() => {
93
+ if (isEditingRef.current && input.value !== rawValue) {
94
+ input.value = rawValue;
95
+ }
96
+ });
97
+ return;
98
+ }
99
+ let processedValue = value;
100
+ if (numeric && value !== '') {
101
+ const cleanValue = value.replace(/[^\d.,]/g, '').replace(',', '.');
102
+ const numValue = Number(cleanValue);
103
+ if (!isNaN(numValue)) {
104
+ processedValue = numValue;
105
+ }
71
106
  }
72
- else {
73
- this.$emit('edit', value, row, key);
107
+ this.$emit('edit', processedValue, row, key);
108
+ },
109
+ onKeyUp: (e) => {
110
+ if (mask && typeof mask === 'function' && isEditingRef.current) {
111
+ const input = e.target;
112
+ input.value = rawValue;
113
+ }
114
+ },
115
+ onChange: (e) => {
116
+ if (mask && typeof mask === 'function' && isEditingRef.current) {
117
+ const input = e.target;
118
+ setTimeout(() => {
119
+ if (isEditingRef.current && input.value !== rawValue) {
120
+ input.value = rawValue;
121
+ }
122
+ }, 0);
123
+ setTimeout(() => {
124
+ if (isEditingRef.current && input.value !== rawValue) {
125
+ input.value = rawValue;
126
+ }
127
+ }, 10);
128
+ }
129
+ },
130
+ onBlur: (e) => {
131
+ isEditingRef.current = false;
132
+ if (mask) {
133
+ const input = e.target;
134
+ let currentValue = input.value;
135
+ if (numeric && currentValue !== '') {
136
+ currentValue = currentValue.replace(',', '.');
137
+ }
138
+ const maskedValue = (0, use_mask_1.processMaskedValue)(currentValue, mask);
139
+ input.value = maskedValue;
74
140
  }
75
141
  }
76
142
  };
77
- if (mask) {
78
- inputProps['data-mask'] =
79
- typeof mask === 'string' ? mask : JSON.stringify(mask);
80
- }
81
143
  cell = (0, vue_1.h)('input', inputProps);
82
144
  }
83
145
  else {
@@ -34,6 +34,7 @@ export declare const dataTableProps: {
34
34
  readonly default: () => never[];
35
35
  };
36
36
  readonly loading: BooleanConstructor;
37
+ readonly loadingSkeleton: BooleanConstructor;
37
38
  readonly bordered: {
38
39
  readonly type: PropType<boolean | undefined>;
39
40
  readonly default: undefined;
@@ -2912,6 +2913,10 @@ export interface CommonColumnInfo<T = InternalRowData> {
2912
2913
  cellProps?: (rowData: T, rowIndex: number) => HTMLAttributes;
2913
2914
  visible?: boolean;
2914
2915
  }
2916
+ export interface TableColumnMaskObject {
2917
+ postProcess: (value: string) => string;
2918
+ }
2919
+ export type TableColumnMask = string | ((value: string) => string) | TableColumnMaskObject;
2915
2920
  export type TableColumnTitle = string | ((column: TableBaseColumn) => VNodeChild);
2916
2921
  export type TableExpandColumnTitle = string | ((column: TableExpandColumn) => VNodeChild);
2917
2922
  export type TableColumnGroupTitle = string | ((column: TableColumnGroup) => VNodeChild);
@@ -2931,18 +2936,14 @@ export type TableBaseColumn<T = InternalRowData> = {
2931
2936
  type?: never;
2932
2937
  key: ColumnKey;
2933
2938
  editable?: boolean;
2934
- mask?: string | ((value: string) => string) | {
2935
- postProcess: (value: string) => string;
2936
- };
2939
+ mask?: TableColumnMask;
2940
+ numeric?: boolean;
2937
2941
  placeholder?: string;
2938
2942
  totalRow?: {
2939
2943
  type: 'sum' | 'default' | 'diff' | 'multiply' | 'divide' | 'percentage' | 'function';
2940
2944
  value?: string;
2941
2945
  fields?: string[];
2942
2946
  function?: (values: number[]) => number;
2943
- mask?: string | ((value: string) => string) | {
2944
- postProcess: (value: string) => string;
2945
- };
2946
2947
  };
2947
2948
  tree?: boolean;
2948
2949
  sorter?: boolean | Sorter<T> | 'default';
@@ -3035,6 +3036,7 @@ export interface DataTableInjection {
3035
3036
  mergedSortStateRef: Ref<SortState[]>;
3036
3037
  mergedFilterStateRef: Ref<FilterState>;
3037
3038
  loadingRef: Ref<boolean>;
3039
+ loadingSkeletonRef: Ref<boolean>;
3038
3040
  rowClassNameRef: Ref<string | CreateRowClassName | undefined>;
3039
3041
  mergedCheckedRowKeySetRef: Ref<Set<RowKey>>;
3040
3042
  mergedInderminateRowKeySetRef: Ref<Set<RowKey>>;
@@ -3136,6 +3138,11 @@ export interface DataTableInst {
3136
3138
  page: (page: number) => void;
3137
3139
  sort: (columnKey: ColumnKey, order: SortOrder) => void;
3138
3140
  scrollTo: ScrollTo;
3141
+ getData: () => {
3142
+ data: InternalRowData[];
3143
+ totalRows: InternalRowData | null;
3144
+ };
3145
+ getTotalRowData: () => InternalRowData | null;
3139
3146
  /** @deprecated it but just leave it here, it does no harm */
3140
3147
  clearFilter: () => void;
3141
3148
  }
@@ -17,7 +17,7 @@ exports.dataTableProps = Object.assign(Object.assign({}, _mixins_1.useTheme.prop
17
17
  }, rowClassName: [String, Function], rowProps: Function, rowKey: Function, summary: [Function], data: {
18
18
  type: Array,
19
19
  default: () => []
20
- }, loading: Boolean, bordered: {
20
+ }, loading: Boolean, loadingSkeleton: Boolean, bordered: {
21
21
  type: Boolean,
22
22
  default: undefined
23
23
  }, bottomBordered: {
@@ -301,19 +301,21 @@ exports.default = (0, cssr_1.c)([(0, cssr_1.cB)('data-table', `
301
301
  `), (0, cssr_1.cM)('editable', `
302
302
  cursor: pointer;
303
303
  position: relative;
304
-
304
+ padding: 0;
305
305
  .u-data-table-editable-input {
306
306
  appearance: none;
307
307
  text-align: right;
308
308
  border: none;
309
309
  background: none;
310
310
  outline: none;
311
- padding: 0;
311
+ box-sizing: border-box;
312
+ padding: var(--u-td-padding);
312
313
  margin: 0;
313
314
  font: inherit;
314
315
  color: inherit;
315
316
  box-shadow: none;
316
- width: '100%';
317
+ height: 100%;
318
+ width: 100%;
317
319
  }
318
320
  `), fixedColumnStyle]), (0, cssr_1.cB)('data-table-empty', `
319
321
  box-sizing: border-box;
@@ -1,10 +1,7 @@
1
+ import { TableColumnMask } from './interface';
1
2
  export declare function applyMask(value: string, mask: string): string;
2
- export declare function processMaskedValue(value: string | number, mask: string | ((value: string) => string) | {
3
- postProcess: (value: string) => string;
4
- }): string;
5
- export declare function processInputWithMask(value: string, mask: string | ((value: string) => string) | {
6
- postProcess: (value: string) => string;
7
- }): {
3
+ export declare function processMaskedValue(value: string | number, mask: TableColumnMask): string;
4
+ export declare function processInputWithMask(value: string, mask: TableColumnMask): {
8
5
  processedValue: string | number;
9
6
  displayValue: string;
10
7
  };
@@ -1,11 +1,12 @@
1
1
  import type { CSSProperties } from 'vue';
2
- import type { SortOrder, TableBaseColumn, InternalRowData, SortOrderFlag, SortState, CreateRowClassName, TableSelectionColumn, TableColumn, TableExpandColumn } from './interface';
2
+ import type { SortOrder, TableBaseColumn, InternalRowData, SortOrderFlag, SortState, CreateRowClassName, TableSelectionColumn, TableColumn, TableExpandColumn, TableColumnMaskObject } from './interface';
3
3
  export declare const SELECTION_COL_WIDTH = 40;
4
4
  export declare const EXPAND_COL_WIDTH = 40;
5
5
  export declare const REGEX: {
6
6
  ONLY_DIGITS: RegExp;
7
7
  ONLY_NUMERIC_AND_DOT: RegExp;
8
8
  };
9
+ export declare const defaultNumericMask: TableColumnMaskObject;
9
10
  export declare function getNumberColWidth(col: TableColumn): number | undefined;
10
11
  export declare function getStringColWidth(col: TableColumn): string | undefined;
11
12
  export declare function getColKey(col: TableColumn): string | number;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.REGEX = exports.EXPAND_COL_WIDTH = exports.SELECTION_COL_WIDTH = void 0;
3
+ exports.defaultNumericMask = exports.REGEX = exports.EXPAND_COL_WIDTH = exports.SELECTION_COL_WIDTH = void 0;
4
4
  exports.getNumberColWidth = getNumberColWidth;
5
5
  exports.getStringColWidth = getStringColWidth;
6
6
  exports.getColKey = getColKey;
@@ -23,6 +23,19 @@ exports.REGEX = {
23
23
  ONLY_DIGITS: /\D/g,
24
24
  ONLY_NUMERIC_AND_DOT: /[^\d.]/g
25
25
  };
26
+ exports.defaultNumericMask = {
27
+ postProcess: (value) => {
28
+ if (!value)
29
+ return '';
30
+ const isNegative = value.trim().startsWith('-');
31
+ const cleaned = value.replace(/[^\d.]/g, '');
32
+ const [intPartRaw, decimalPartRaw = ''] = cleaned.split('.', 2);
33
+ const intPart = intPartRaw.replace(/\B(?=(\d{3})+(?!\d))/g, ' ');
34
+ const decimalPart = decimalPartRaw.slice(0, 2);
35
+ const result = cleaned.includes('.') ? `${intPart}.${decimalPart}` : intPart;
36
+ return isNegative ? `-${result}` : result;
37
+ }
38
+ };
26
39
  function getNumberColWidth(col) {
27
40
  if (col.type === 'selection') {
28
41
  return col.width === undefined ? exports.SELECTION_COL_WIDTH : (0, seemly_1.depx)(col.width);