@uzum-tech/ui 1.5.2 → 1.5.4

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 (200) hide show
  1. package/README.md +0 -1
  2. package/dist/index.js +1147 -628
  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/_mixins/use-form-item.d.ts +4 -4
  7. package/es/_mixins/use-form-item.js +4 -4
  8. package/es/_styles/common/dark.js +1 -1
  9. package/es/_styles/common/light.d.ts +3 -0
  10. package/es/_styles/common/light.js +1 -1
  11. package/es/_utils/composable/composables.d.ts +11 -0
  12. package/es/_utils/composable/composables.js +40 -0
  13. package/es/_utils/index.d.ts +1 -1
  14. package/es/_utils/index.js +1 -1
  15. package/es/_utils/uzum/index.d.ts +1 -0
  16. package/es/_utils/uzum/index.js +1 -0
  17. package/es/_utils/uzum/value.d.ts +1 -0
  18. package/es/_utils/uzum/value.js +9 -0
  19. package/es/_utils/vue/resolve-slot.d.ts +1 -1
  20. package/es/alert/styles/light.js +6 -6
  21. package/es/auto-complete/src/AutoComplete.js +10 -10
  22. package/es/avatar/src/Avatar.d.ts +6 -0
  23. package/es/avatar/src/Avatar.js +9 -3
  24. package/es/card-list/src/CardList.js +1 -1
  25. package/es/card-list/src/CardListItem.d.ts +13 -0
  26. package/es/card-list/src/CardListItem.js +11 -4
  27. package/es/card-list/src/interface.d.ts +1 -0
  28. package/es/card-list/src/styles/index.cssr.js +6 -6
  29. package/es/card-list/styles/light.js +2 -2
  30. package/es/cascader/src/Cascader.js +7 -7
  31. package/es/checkbox/src/CheckboxGroup.js +9 -9
  32. package/es/collapse/src/Collapse.d.ts +47 -14
  33. package/es/collapse/src/Collapse.js +6 -3
  34. package/es/collapse/src/CollapseItem.js +3 -2
  35. package/es/collapse/src/styles/index.cssr.js +27 -7
  36. package/es/collapse/styles/light.d.ts +4 -1
  37. package/es/collapse/styles/light.js +6 -3
  38. package/es/color-picker/src/ColorPicker.js +6 -6
  39. package/es/components.d.ts +1 -0
  40. package/es/components.js +1 -0
  41. package/es/config-provider/src/internal-interface.d.ts +2 -0
  42. package/es/data-table/src/DataTable.d.ts +7 -0
  43. package/es/data-table/src/DataTable.js +21 -10
  44. package/es/data-table/src/TableParts/Body.d.ts +1 -0
  45. package/es/data-table/src/TableParts/Body.js +8 -6
  46. package/es/data-table/src/TableParts/Cell.js +85 -23
  47. package/es/data-table/src/interface.d.ts +14 -6
  48. package/es/data-table/src/interface.js +1 -1
  49. package/es/data-table/src/styles/index.cssr.js +5 -3
  50. package/es/data-table/src/use-mask.d.ts +3 -6
  51. package/es/data-table/src/utils.d.ts +2 -1
  52. package/es/data-table/src/utils.js +13 -0
  53. package/es/date-picker/src/DatePicker.js +7 -7
  54. package/es/dialog/src/DialogProvider.d.ts +6 -0
  55. package/es/dynamic-tags/src/DynamicTags.d.ts +10 -0
  56. package/es/dynamic-tags/src/DynamicTags.js +3 -3
  57. package/es/dynamic-tags/styles/light.d.ts +1 -0
  58. package/es/input/src/Input.js +8 -8
  59. package/es/input-number/src/InputNumber.js +7 -7
  60. package/es/input-otp/index.d.ts +3 -0
  61. package/es/input-otp/index.js +1 -0
  62. package/es/input-otp/src/InputOtp.d.ts +871 -0
  63. package/es/input-otp/src/InputOtp.js +250 -0
  64. package/es/input-otp/src/public-types.d.ts +25 -0
  65. package/es/input-otp/src/public-types.js +1 -0
  66. package/es/input-otp/src/styles/index.cssr.d.ts +2 -0
  67. package/es/input-otp/src/styles/index.cssr.js +20 -0
  68. package/es/input-otp/src/styles/input-otp-rtl.cssr.d.ts +2 -0
  69. package/es/input-otp/src/styles/input-otp-rtl.cssr.js +5 -0
  70. package/es/input-otp/styles/dark.d.ts +3 -0
  71. package/es/input-otp/styles/dark.js +12 -0
  72. package/es/input-otp/styles/index.d.ts +4 -0
  73. package/es/input-otp/styles/index.js +3 -0
  74. package/es/input-otp/styles/light.d.ts +83 -0
  75. package/es/input-otp/styles/light.js +22 -0
  76. package/es/input-otp/styles/rtl.d.ts +2 -0
  77. package/es/input-otp/styles/rtl.js +5 -0
  78. package/es/legacy-transfer/src/Transfer.js +3 -3
  79. package/es/list/src/ListItem.js +8 -4
  80. package/es/mention/src/Mention.js +7 -7
  81. package/es/radio/src/RadioGroup.js +5 -5
  82. package/es/rate/src/Rate.js +3 -3
  83. package/es/select/src/Select.js +7 -7
  84. package/es/slider/src/Slider.js +3 -3
  85. package/es/styles.d.ts +1 -0
  86. package/es/styles.js +1 -0
  87. package/es/switch/src/Switch.js +7 -7
  88. package/es/tag/src/Tag.d.ts +27 -13
  89. package/es/tag/src/Tag.js +7 -2
  90. package/es/tag/src/styles/index.cssr.js +13 -3
  91. package/es/tag/styles/light.d.ts +1 -0
  92. package/es/tag/styles/light.js +7 -6
  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/version.d.ts +1 -1
  100. package/es/version.js +1 -1
  101. package/lib/_internal/checkbox/src/use-checkbox.js +3 -3
  102. package/lib/_internal/radio/src/use-radio.js +3 -3
  103. package/lib/_mixins/use-form-item.d.ts +4 -4
  104. package/lib/_mixins/use-form-item.js +4 -4
  105. package/lib/_styles/common/dark.js +1 -1
  106. package/lib/_styles/common/light.d.ts +3 -0
  107. package/lib/_styles/common/light.js +1 -1
  108. package/lib/_utils/composable/composables.d.ts +11 -0
  109. package/lib/_utils/composable/composables.js +47 -0
  110. package/lib/_utils/index.d.ts +1 -1
  111. package/lib/_utils/index.js +2 -1
  112. package/lib/_utils/uzum/index.d.ts +1 -0
  113. package/lib/_utils/uzum/index.js +3 -1
  114. package/lib/_utils/uzum/value.d.ts +1 -0
  115. package/lib/_utils/uzum/value.js +12 -0
  116. package/lib/_utils/vue/resolve-slot.d.ts +1 -1
  117. package/lib/alert/styles/light.js +6 -6
  118. package/lib/auto-complete/src/AutoComplete.js +10 -10
  119. package/lib/avatar/src/Avatar.d.ts +6 -0
  120. package/lib/avatar/src/Avatar.js +9 -3
  121. package/lib/card-list/src/CardList.js +1 -1
  122. package/lib/card-list/src/CardListItem.d.ts +13 -0
  123. package/lib/card-list/src/CardListItem.js +11 -4
  124. package/lib/card-list/src/interface.d.ts +1 -0
  125. package/lib/card-list/src/styles/index.cssr.js +5 -5
  126. package/lib/card-list/styles/light.js +2 -2
  127. package/lib/cascader/src/Cascader.js +7 -7
  128. package/lib/checkbox/src/CheckboxGroup.js +9 -9
  129. package/lib/collapse/src/Collapse.d.ts +47 -14
  130. package/lib/collapse/src/Collapse.js +6 -3
  131. package/lib/collapse/src/CollapseItem.js +3 -2
  132. package/lib/collapse/src/styles/index.cssr.js +27 -7
  133. package/lib/collapse/styles/light.d.ts +4 -1
  134. package/lib/collapse/styles/light.js +6 -3
  135. package/lib/color-picker/src/ColorPicker.js +6 -6
  136. package/lib/components.d.ts +1 -0
  137. package/lib/components.js +1 -0
  138. package/lib/config-provider/src/internal-interface.d.ts +2 -0
  139. package/lib/data-table/src/DataTable.d.ts +7 -0
  140. package/lib/data-table/src/DataTable.js +21 -10
  141. package/lib/data-table/src/TableParts/Body.d.ts +1 -0
  142. package/lib/data-table/src/TableParts/Body.js +8 -6
  143. package/lib/data-table/src/TableParts/Cell.js +84 -22
  144. package/lib/data-table/src/interface.d.ts +14 -6
  145. package/lib/data-table/src/interface.js +1 -1
  146. package/lib/data-table/src/styles/index.cssr.js +5 -3
  147. package/lib/data-table/src/use-mask.d.ts +3 -6
  148. package/lib/data-table/src/utils.d.ts +2 -1
  149. package/lib/data-table/src/utils.js +14 -1
  150. package/lib/date-picker/src/DatePicker.js +7 -7
  151. package/lib/dialog/src/DialogProvider.d.ts +6 -0
  152. package/lib/dynamic-tags/src/DynamicTags.d.ts +10 -0
  153. package/lib/dynamic-tags/src/DynamicTags.js +3 -3
  154. package/lib/dynamic-tags/styles/light.d.ts +1 -0
  155. package/lib/input/src/Input.js +8 -8
  156. package/lib/input-number/src/InputNumber.js +7 -7
  157. package/lib/input-otp/index.d.ts +3 -0
  158. package/lib/input-otp/index.js +9 -0
  159. package/lib/input-otp/src/InputOtp.d.ts +871 -0
  160. package/lib/input-otp/src/InputOtp.js +256 -0
  161. package/lib/input-otp/src/public-types.d.ts +25 -0
  162. package/lib/input-otp/src/public-types.js +2 -0
  163. package/lib/input-otp/src/styles/index.cssr.d.ts +2 -0
  164. package/lib/input-otp/src/styles/index.cssr.js +25 -0
  165. package/lib/input-otp/src/styles/input-otp-rtl.cssr.d.ts +2 -0
  166. package/lib/input-otp/src/styles/input-otp-rtl.cssr.js +10 -0
  167. package/lib/input-otp/styles/dark.d.ts +3 -0
  168. package/lib/input-otp/styles/dark.js +14 -0
  169. package/lib/input-otp/styles/index.d.ts +4 -0
  170. package/lib/input-otp/styles/index.js +12 -0
  171. package/lib/input-otp/styles/light.d.ts +83 -0
  172. package/lib/input-otp/styles/light.js +25 -0
  173. package/lib/input-otp/styles/rtl.d.ts +2 -0
  174. package/lib/input-otp/styles/rtl.js +11 -0
  175. package/lib/legacy-transfer/src/Transfer.js +3 -3
  176. package/lib/list/src/ListItem.js +8 -4
  177. package/lib/mention/src/Mention.js +7 -7
  178. package/lib/radio/src/RadioGroup.js +5 -5
  179. package/lib/rate/src/Rate.js +3 -3
  180. package/lib/select/src/Select.js +7 -7
  181. package/lib/slider/src/Slider.js +3 -3
  182. package/lib/styles.d.ts +1 -0
  183. package/lib/styles.js +106 -103
  184. package/lib/switch/src/Switch.js +7 -7
  185. package/lib/tag/src/Tag.d.ts +27 -13
  186. package/lib/tag/src/Tag.js +7 -2
  187. package/lib/tag/src/styles/index.cssr.js +13 -3
  188. package/lib/tag/styles/light.d.ts +1 -0
  189. package/lib/tag/styles/light.js +7 -6
  190. package/lib/theme-editor/src/ThemeEditor.d.ts +3 -0
  191. package/lib/themes/dark.js +2 -0
  192. package/lib/themes/light.js +2 -0
  193. package/lib/time-picker/src/TimePicker.js +7 -7
  194. package/lib/transfer/src/Transfer.js +3 -3
  195. package/lib/tree-select/src/TreeSelect.js +5 -5
  196. package/lib/version.d.ts +1 -1
  197. package/lib/version.js +1 -1
  198. package/package.json +1 -1
  199. package/volar.d.ts +1 -0
  200. package/web-types.json +131 -4
@@ -1,7 +1,8 @@
1
1
  import { h, defineComponent } from 'vue';
2
2
  import { get } from 'lodash-es';
3
3
  import { UEllipsis } from '../../../ellipsis';
4
- import { processMaskedValue, processInputWithMask } from '../use-mask';
4
+ import { processMaskedValue } from '../use-mask';
5
+ import { defaultNumericMask } from '../utils';
5
6
  export default defineComponent({
6
7
  name: 'DataTableCell',
7
8
  emits: ['edit'],
@@ -33,7 +34,10 @@ export default defineComponent({
33
34
  var _a;
34
35
  const { isSummary, column, row, renderCell } = this;
35
36
  let cell;
36
- const { render, key, ellipsis, editable, mask } = column;
37
+ let { mask } = column;
38
+ const { render, key, ellipsis, editable, numeric } = column;
39
+ if (numeric && !mask)
40
+ mask = defaultNumericMask;
37
41
  if (render && !isSummary) {
38
42
  let cellValue = render(row, this.index);
39
43
  if (mask && cellValue !== null && cellValue !== undefined) {
@@ -45,37 +49,95 @@ export default defineComponent({
45
49
  }
46
50
  else if (editable && !isSummary) {
47
51
  const { placeholder } = column;
48
- let initialValue = String(row[key] || '');
49
- if (mask && initialValue) {
50
- initialValue = processMaskedValue(initialValue, mask);
51
- }
52
+ const rawValue = String(row[key] || '');
53
+ const displayValue = mask ? processMaskedValue(rawValue, mask) : rawValue;
54
+ const isEditingRef = { current: false };
52
55
  const inputProps = {
53
56
  class: `${this.clsPrefix}-data-table-editable-input`,
54
- value: initialValue,
57
+ value: displayValue,
55
58
  placeholder: placeholder || '',
59
+ onFocus: (e) => {
60
+ const input = e.target;
61
+ isEditingRef.current = true;
62
+ input.value = rawValue;
63
+ },
64
+ onKeyDown: (e) => {
65
+ if (mask && typeof mask === 'function' && isEditingRef.current) {
66
+ const input = e.target;
67
+ input.value = rawValue;
68
+ }
69
+ },
56
70
  onInput: (e) => {
57
- const value = e.target.value;
58
- if (mask) {
59
- const { processedValue, displayValue } = processInputWithMask(value, mask);
60
- setTimeout(() => {
61
- const input = e.target;
62
- if (input.value !== displayValue) {
63
- const cursorPos = input.selectionStart || 0;
64
- input.value = displayValue;
65
- input.setSelectionRange(cursorPos, cursorPos);
71
+ const input = e.target;
72
+ const value = input.value;
73
+ if (mask && typeof mask === 'function' && !isEditingRef.current) {
74
+ isEditingRef.current = true;
75
+ }
76
+ if (mask && typeof mask === 'function' && isEditingRef.current) {
77
+ const rawValue = value.replace(/\$/g, '').replace(/[^\d.,]/g, '');
78
+ input.value = rawValue;
79
+ let processedValue = rawValue;
80
+ if (numeric && rawValue !== '') {
81
+ const cleanValue = rawValue
82
+ .replace(/[^\d.,]/g, '')
83
+ .replace(',', '.');
84
+ const numValue = Number(cleanValue);
85
+ if (!isNaN(numValue)) {
86
+ processedValue = numValue;
66
87
  }
67
- });
88
+ }
68
89
  this.$emit('edit', processedValue, row, key);
90
+ void Promise.resolve().then(() => {
91
+ if (isEditingRef.current && input.value !== rawValue) {
92
+ input.value = rawValue;
93
+ }
94
+ });
95
+ return;
96
+ }
97
+ let processedValue = value;
98
+ if (numeric && value !== '') {
99
+ const cleanValue = value.replace(/[^\d.,]/g, '').replace(',', '.');
100
+ const numValue = Number(cleanValue);
101
+ if (!isNaN(numValue)) {
102
+ processedValue = numValue;
103
+ }
69
104
  }
70
- else {
71
- this.$emit('edit', value, row, key);
105
+ this.$emit('edit', processedValue, row, key);
106
+ },
107
+ onKeyUp: (e) => {
108
+ if (mask && typeof mask === 'function' && isEditingRef.current) {
109
+ const input = e.target;
110
+ input.value = rawValue;
111
+ }
112
+ },
113
+ onChange: (e) => {
114
+ if (mask && typeof mask === 'function' && isEditingRef.current) {
115
+ const input = e.target;
116
+ setTimeout(() => {
117
+ if (isEditingRef.current && input.value !== rawValue) {
118
+ input.value = rawValue;
119
+ }
120
+ }, 0);
121
+ setTimeout(() => {
122
+ if (isEditingRef.current && input.value !== rawValue) {
123
+ input.value = rawValue;
124
+ }
125
+ }, 10);
126
+ }
127
+ },
128
+ onBlur: (e) => {
129
+ isEditingRef.current = false;
130
+ if (mask) {
131
+ const input = e.target;
132
+ let currentValue = input.value;
133
+ if (numeric && currentValue !== '') {
134
+ currentValue = currentValue.replace(',', '.');
135
+ }
136
+ const maskedValue = processMaskedValue(currentValue, mask);
137
+ input.value = maskedValue;
72
138
  }
73
139
  }
74
140
  };
75
- if (mask) {
76
- inputProps['data-mask'] =
77
- typeof mask === 'string' ? mask : JSON.stringify(mask);
78
- }
79
141
  cell = h('input', inputProps);
80
142
  }
81
143
  else {
@@ -9,6 +9,7 @@ import type { PaginationProps } from '../../pagination';
9
9
  import type { DataTableTheme } from '../styles';
10
10
  import type { RowItem, ColItem } from './use-group-header';
11
11
  import type { BaseLoadingExposedProps } from '../../_internal';
12
+ import type { EmptyProps } from '../../empty';
12
13
  export declare const dataTableProps: {
13
14
  readonly onUnstableColumnResize: PropType<(resizedWidth: number, limitedWidth: number, column: TableBaseColumn, getColumnWidth: (key: ColumnKey) => number | undefined) => void>;
14
15
  readonly pagination: {
@@ -101,6 +102,7 @@ export declare const dataTableProps: {
101
102
  readonly type: PropType<BaseLoadingExposedProps>;
102
103
  readonly default: {};
103
104
  };
105
+ readonly emptyProps: PropType<Partial<EmptyProps>>;
104
106
  readonly onLoad: PropType<DataTableOnLoad>;
105
107
  readonly 'onUpdate:page': PropType<PaginationProps["onUpdate:page"]>;
106
108
  readonly onUpdatePage: PropType<PaginationProps["onUpdate:page"]>;
@@ -2913,6 +2915,10 @@ export interface CommonColumnInfo<T = InternalRowData> {
2913
2915
  cellProps?: (rowData: T, rowIndex: number) => HTMLAttributes;
2914
2916
  visible?: boolean;
2915
2917
  }
2918
+ export interface TableColumnMaskObject {
2919
+ postProcess: (value: string) => string;
2920
+ }
2921
+ export type TableColumnMask = string | ((value: string) => string) | TableColumnMaskObject;
2916
2922
  export type TableColumnTitle = string | ((column: TableBaseColumn) => VNodeChild);
2917
2923
  export type TableExpandColumnTitle = string | ((column: TableExpandColumn) => VNodeChild);
2918
2924
  export type TableColumnGroupTitle = string | ((column: TableColumnGroup) => VNodeChild);
@@ -2932,18 +2938,14 @@ export type TableBaseColumn<T = InternalRowData> = {
2932
2938
  type?: never;
2933
2939
  key: ColumnKey;
2934
2940
  editable?: boolean;
2935
- mask?: string | ((value: string) => string) | {
2936
- postProcess: (value: string) => string;
2937
- };
2941
+ mask?: TableColumnMask;
2942
+ numeric?: boolean;
2938
2943
  placeholder?: string;
2939
2944
  totalRow?: {
2940
2945
  type: 'sum' | 'default' | 'diff' | 'multiply' | 'divide' | 'percentage' | 'function';
2941
2946
  value?: string;
2942
2947
  fields?: string[];
2943
2948
  function?: (values: number[]) => number;
2944
- mask?: string | ((value: string) => string) | {
2945
- postProcess: (value: string) => string;
2946
- };
2947
2949
  };
2948
2950
  tree?: boolean;
2949
2951
  sorter?: boolean | Sorter<T> | 'default';
@@ -3083,6 +3085,7 @@ export interface DataTableInjection {
3083
3085
  syncScrollState: (deltaX?: number, deltaY?: number) => void;
3084
3086
  setHeaderScrollLeft: (scrollLeft: number) => void;
3085
3087
  renderCell: Ref<undefined | ((value: any, rowData: object, column: TableBaseColumn) => VNodeChild)>;
3088
+ emptyPropsRef: Ref<Partial<EmptyProps> | undefined>;
3086
3089
  handleEdit: (value: any, row: any, key: string) => void;
3087
3090
  }
3088
3091
  export declare const dataTableInjectionKey: import("vue").InjectionKey<DataTableInjection>;
@@ -3138,6 +3141,11 @@ export interface DataTableInst {
3138
3141
  page: (page: number) => void;
3139
3142
  sort: (columnKey: ColumnKey, order: SortOrder) => void;
3140
3143
  scrollTo: ScrollTo;
3144
+ getData: () => {
3145
+ data: InternalRowData[];
3146
+ totalRows: InternalRowData | null;
3147
+ };
3148
+ getTotalRowData: () => InternalRowData | null;
3141
3149
  /** @deprecated it but just leave it here, it does no harm */
3142
3150
  clearFilter: () => void;
3143
3151
  }
@@ -50,7 +50,7 @@ export const dataTableProps = Object.assign(Object.assign({}, useTheme.props), {
50
50
  }, paginationBehaviorOnFilter: {
51
51
  type: String,
52
52
  default: 'current'
53
- }, scrollbarProps: Object, renderCell: Function, renderExpandIcon: Function, spinProps: { type: Object, default: {} }, onLoad: Function, 'onUpdate:page': [Function, Array], onUpdatePage: [Function, Array], 'onUpdate:pageSize': [Function, Array], onUpdatePageSize: [Function, Array], 'onUpdate:sorter': [Function, Array], onUpdateSorter: [Function, Array], 'onUpdate:filters': [Function, Array], onUpdateFilters: [Function, Array], 'onUpdate:checkedRowKeys': [Function, Array], onUpdateCheckedRowKeys: [Function, Array], 'onUpdate:expandedRowKeys': [Function, Array], onUpdateExpandedRowKeys: [Function, Array], onScroll: Function,
53
+ }, scrollbarProps: Object, renderCell: Function, renderExpandIcon: Function, spinProps: { type: Object, default: {} }, emptyProps: Object, onLoad: Function, 'onUpdate:page': [Function, Array], onUpdatePage: [Function, Array], 'onUpdate:pageSize': [Function, Array], onUpdatePageSize: [Function, Array], 'onUpdate:sorter': [Function, Array], onUpdateSorter: [Function, Array], 'onUpdate:filters': [Function, Array], onUpdateFilters: [Function, Array], 'onUpdate:checkedRowKeys': [Function, Array], onUpdateCheckedRowKeys: [Function, Array], 'onUpdate:expandedRowKeys': [Function, Array], onUpdateExpandedRowKeys: [Function, Array], onScroll: Function,
54
54
  // deprecated
55
55
  onPageChange: [Function, Array], onPageSizeChange: [Function, Array], onSorterChange: [Function, Array], onFiltersChange: [Function, Array], onCheckedRowKeysChange: [Function, Array] });
56
56
  export const dataTableInjectionKey = createInjectionKey('u-data-table');
@@ -296,19 +296,21 @@ c('&:last-child', 'flex-grow: 1;')])])])])])])]), c('>', [cB('data-table-loading
296
296
  `), cM('editable', `
297
297
  cursor: pointer;
298
298
  position: relative;
299
-
299
+ padding: 0;
300
300
  .u-data-table-editable-input {
301
301
  appearance: none;
302
302
  text-align: right;
303
303
  border: none;
304
304
  background: none;
305
305
  outline: none;
306
- padding: 0;
306
+ box-sizing: border-box;
307
+ padding: var(--u-td-padding);
307
308
  margin: 0;
308
309
  font: inherit;
309
310
  color: inherit;
310
311
  box-shadow: none;
311
- width: '100%';
312
+ height: 100%;
313
+ width: 100%;
312
314
  }
313
315
  `), fixedColumnStyle]), cB('data-table-empty', `
314
316
  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;
@@ -6,6 +6,19 @@ export const REGEX = {
6
6
  ONLY_DIGITS: /\D/g,
7
7
  ONLY_NUMERIC_AND_DOT: /[^\d.]/g
8
8
  };
9
+ export const defaultNumericMask = {
10
+ postProcess: (value) => {
11
+ if (!value)
12
+ return '';
13
+ const isNegative = value.trim().startsWith('-');
14
+ const cleaned = value.replace(/[^\d.]/g, '');
15
+ const [intPartRaw, decimalPartRaw = ''] = cleaned.split('.', 2);
16
+ const intPart = intPartRaw.replace(/\B(?=(\d{3})+(?!\d))/g, ' ');
17
+ const decimalPart = decimalPartRaw.slice(0, 2);
18
+ const result = cleaned.includes('.') ? `${intPart}.${decimalPart}` : intPart;
19
+ return isNegative ? `-${result}` : result;
20
+ }
21
+ };
9
22
  export function getNumberColWidth(col) {
10
23
  if (col.type === 'selection') {
11
24
  return col.width === undefined ? SELECTION_COL_WIDTH : depx(col.width);
@@ -281,7 +281,7 @@ export default defineComponent({
281
281
  return;
282
282
  }
283
283
  const { 'onUpdate:value': _onUpdateValue, onUpdateValue, onChange } = props;
284
- const { nTriggerFormChange, nTriggerFormInput } = formItem;
284
+ const { triggerFormChange, triggerFormInput } = formItem;
285
285
  const formattedValue = getFormattedValue(value);
286
286
  if (options.doConfirm) {
287
287
  doConfirm(value, formattedValue);
@@ -296,8 +296,8 @@ export default defineComponent({
296
296
  call(onChange, value, formattedValue);
297
297
  uncontrolledValueRef.value = value;
298
298
  doUpdateFormattedValue(formattedValue, value);
299
- nTriggerFormChange();
300
- nTriggerFormInput();
299
+ triggerFormChange();
300
+ triggerFormInput();
301
301
  }
302
302
  function doClear() {
303
303
  const { onClear } = props;
@@ -310,17 +310,17 @@ export default defineComponent({
310
310
  }
311
311
  function doFocus(e) {
312
312
  const { onFocus } = props;
313
- const { nTriggerFormFocus } = formItem;
313
+ const { triggerFormFocus } = formItem;
314
314
  if (onFocus)
315
315
  call(onFocus, e);
316
- nTriggerFormFocus();
316
+ triggerFormFocus();
317
317
  }
318
318
  function doBlur(e) {
319
319
  const { onBlur } = props;
320
- const { nTriggerFormBlur } = formItem;
320
+ const { triggerFormBlur } = formItem;
321
321
  if (onBlur)
322
322
  call(onBlur, e);
323
- nTriggerFormBlur();
323
+ triggerFormBlur();
324
324
  }
325
325
  function doUpdateShow(show) {
326
326
  const { 'onUpdate:show': _onUpdateShow, onUpdateShow } = props;
@@ -283,6 +283,9 @@ export declare const UDialogProvider: import("vue").DefineComponent<{
283
283
  scrollbarHeight: string;
284
284
  scrollbarBorderRadius: string;
285
285
  opacityDisabled: string;
286
+ brand150: string;
287
+ brand350: string;
288
+ brand550: string;
286
289
  brandPrimary50: string;
287
290
  brandPrimary100: string;
288
291
  brandPrimary200: string;
@@ -639,6 +642,9 @@ export declare const UDialogProvider: import("vue").DefineComponent<{
639
642
  scrollbarHeight: string;
640
643
  scrollbarBorderRadius: string;
641
644
  opacityDisabled: string;
645
+ brand150: string;
646
+ brand350: string;
647
+ brand550: string;
642
648
  brandPrimary50: string;
643
649
  brandPrimary100: string;
644
650
  brandPrimary200: string;
@@ -349,6 +349,7 @@ export declare const dynamicTagsProps: {
349
349
  textColorPressedCheckable: string;
350
350
  textColorChecked: string;
351
351
  colorCheckable: string;
352
+ colorCheckableOutline: string;
352
353
  colorHoverCheckable: string;
353
354
  colorPressedCheckable: string;
354
355
  colorChecked: string;
@@ -736,6 +737,7 @@ export declare const dynamicTagsProps: {
736
737
  textColorPressedCheckable: string;
737
738
  textColorChecked: string;
738
739
  colorCheckable: string;
740
+ colorCheckableOutline: string;
739
741
  colorHoverCheckable: string;
740
742
  colorPressedCheckable: string;
741
743
  colorChecked: string;
@@ -1123,6 +1125,7 @@ export declare const dynamicTagsProps: {
1123
1125
  textColorPressedCheckable: string;
1124
1126
  textColorChecked: string;
1125
1127
  colorCheckable: string;
1128
+ colorCheckableOutline: string;
1126
1129
  colorHoverCheckable: string;
1127
1130
  colorPressedCheckable: string;
1128
1131
  colorChecked: string;
@@ -1548,6 +1551,7 @@ declare const _default: import("vue").DefineComponent<{
1548
1551
  textColorPressedCheckable: string;
1549
1552
  textColorChecked: string;
1550
1553
  colorCheckable: string;
1554
+ colorCheckableOutline: string;
1551
1555
  colorHoverCheckable: string;
1552
1556
  colorPressedCheckable: string;
1553
1557
  colorChecked: string;
@@ -1935,6 +1939,7 @@ declare const _default: import("vue").DefineComponent<{
1935
1939
  textColorPressedCheckable: string;
1936
1940
  textColorChecked: string;
1937
1941
  colorCheckable: string;
1942
+ colorCheckableOutline: string;
1938
1943
  colorHoverCheckable: string;
1939
1944
  colorPressedCheckable: string;
1940
1945
  colorChecked: string;
@@ -2322,6 +2327,7 @@ declare const _default: import("vue").DefineComponent<{
2322
2327
  textColorPressedCheckable: string;
2323
2328
  textColorChecked: string;
2324
2329
  colorCheckable: string;
2330
+ colorCheckableOutline: string;
2325
2331
  colorHoverCheckable: string;
2326
2332
  colorPressedCheckable: string;
2327
2333
  colorChecked: string;
@@ -2742,6 +2748,7 @@ declare const _default: import("vue").DefineComponent<{
2742
2748
  textColorPressedCheckable: string;
2743
2749
  textColorChecked: string;
2744
2750
  colorCheckable: string;
2751
+ colorCheckableOutline: string;
2745
2752
  colorHoverCheckable: string;
2746
2753
  colorPressedCheckable: string;
2747
2754
  colorChecked: string;
@@ -3194,6 +3201,7 @@ declare const _default: import("vue").DefineComponent<{
3194
3201
  textColorPressedCheckable: string;
3195
3202
  textColorChecked: string;
3196
3203
  colorCheckable: string;
3204
+ colorCheckableOutline: string;
3197
3205
  colorHoverCheckable: string;
3198
3206
  colorPressedCheckable: string;
3199
3207
  colorChecked: string;
@@ -3581,6 +3589,7 @@ declare const _default: import("vue").DefineComponent<{
3581
3589
  textColorPressedCheckable: string;
3582
3590
  textColorChecked: string;
3583
3591
  colorCheckable: string;
3592
+ colorCheckableOutline: string;
3584
3593
  colorHoverCheckable: string;
3585
3594
  colorPressedCheckable: string;
3586
3595
  colorChecked: string;
@@ -3968,6 +3977,7 @@ declare const _default: import("vue").DefineComponent<{
3968
3977
  textColorPressedCheckable: string;
3969
3978
  textColorChecked: string;
3970
3979
  colorCheckable: string;
3980
+ colorCheckableOutline: string;
3971
3981
  colorHoverCheckable: string;
3972
3982
  colorPressedCheckable: string;
3973
3983
  colorChecked: string;
@@ -61,7 +61,7 @@ export default defineComponent({
61
61
  });
62
62
  function doChange(value) {
63
63
  const { onChange, 'onUpdate:value': _onUpdateValue, onUpdateValue } = props;
64
- const { nTriggerFormInput, nTriggerFormChange } = formItem;
64
+ const { triggerFormInput, triggerFormChange } = formItem;
65
65
  if (onChange)
66
66
  call(onChange, value);
67
67
  if (onUpdateValue)
@@ -69,8 +69,8 @@ export default defineComponent({
69
69
  if (_onUpdateValue)
70
70
  call(_onUpdateValue, value);
71
71
  uncontrolledValueRef.value = value;
72
- nTriggerFormInput();
73
- nTriggerFormChange();
72
+ triggerFormInput();
73
+ triggerFormChange();
74
74
  }
75
75
  function handleCloseClick(index) {
76
76
  const tags = mergedValueRef.value.slice(0);
@@ -309,6 +309,7 @@ declare const dynamicTagsLight: import("../../_mixins").Theme<"DynamicTags", {
309
309
  textColorPressedCheckable: string;
310
310
  textColorChecked: string;
311
311
  colorCheckable: string;
312
+ colorCheckableOutline: string;
312
313
  colorHoverCheckable: string;
313
314
  colorPressedCheckable: string;
314
315
  colorChecked: string;
@@ -244,7 +244,7 @@ export default defineComponent({
244
244
  const vm = getCurrentInstance().proxy;
245
245
  function doUpdateValue(value) {
246
246
  const { onUpdateValue, 'onUpdate:value': _onUpdateValue, onInput } = props;
247
- const { nTriggerFormInput } = formItem;
247
+ const { triggerFormInput } = formItem;
248
248
  if (onUpdateValue)
249
249
  call(onUpdateValue, value);
250
250
  if (_onUpdateValue)
@@ -252,30 +252,30 @@ export default defineComponent({
252
252
  if (onInput)
253
253
  call(onInput, value);
254
254
  uncontrolledValueRef.value = value;
255
- nTriggerFormInput();
255
+ triggerFormInput();
256
256
  emitDebouncedInput(value);
257
257
  }
258
258
  function doChange(value) {
259
259
  const { onChange } = props;
260
- const { nTriggerFormChange } = formItem;
260
+ const { triggerFormChange } = formItem;
261
261
  if (onChange)
262
262
  call(onChange, value);
263
263
  uncontrolledValueRef.value = value;
264
- nTriggerFormChange();
264
+ triggerFormChange();
265
265
  }
266
266
  function doBlur(e) {
267
267
  const { onBlur } = props;
268
- const { nTriggerFormBlur } = formItem;
268
+ const { triggerFormBlur } = formItem;
269
269
  if (onBlur)
270
270
  call(onBlur, e);
271
- nTriggerFormBlur();
271
+ triggerFormBlur();
272
272
  }
273
273
  function doFocus(e) {
274
274
  const { onFocus } = props;
275
- const { nTriggerFormFocus } = formItem;
275
+ const { triggerFormFocus } = formItem;
276
276
  if (onFocus)
277
277
  call(onFocus, e);
278
- nTriggerFormFocus();
278
+ triggerFormFocus();
279
279
  }
280
280
  function doClear(e) {
281
281
  const { onClear } = props;
@@ -114,7 +114,7 @@ export default defineComponent({
114
114
  return;
115
115
  }
116
116
  const { 'onUpdate:value': _onUpdateValue, onUpdateValue, onChange } = props;
117
- const { nTriggerFormInput, nTriggerFormChange } = formItem;
117
+ const { triggerFormInput, triggerFormChange } = formItem;
118
118
  if (onChange)
119
119
  call(onChange, value);
120
120
  if (onUpdateValue)
@@ -122,8 +122,8 @@ export default defineComponent({
122
122
  if (_onUpdateValue)
123
123
  call(_onUpdateValue, value);
124
124
  uncontrolledValueRef.value = value;
125
- nTriggerFormInput();
126
- nTriggerFormChange();
125
+ triggerFormInput();
126
+ triggerFormChange();
127
127
  };
128
128
  const deriveValueFromDisplayedValue = ({ offset, doUpdateIfValid, fixPrecision, isInputing }) => {
129
129
  const { value: displayedValue } = displayedValueRef;
@@ -234,10 +234,10 @@ export default defineComponent({
234
234
  });
235
235
  function doFocus(e) {
236
236
  const { onFocus } = props;
237
- const { nTriggerFormFocus } = formItem;
237
+ const { triggerFormFocus } = formItem;
238
238
  if (onFocus)
239
239
  call(onFocus, e);
240
- nTriggerFormFocus();
240
+ triggerFormFocus();
241
241
  }
242
242
  function doBlur(e) {
243
243
  var _a, _b;
@@ -272,10 +272,10 @@ export default defineComponent({
272
272
  deriveDisplayedValueFromValue();
273
273
  }
274
274
  const { onBlur } = props;
275
- const { nTriggerFormBlur } = formItem;
275
+ const { triggerFormBlur } = formItem;
276
276
  if (onBlur)
277
277
  call(onBlur, e);
278
- nTriggerFormBlur();
278
+ triggerFormBlur();
279
279
  // User may change value in blur callback, we make sure it will be
280
280
  // displayed. Sometimes mergedValue won't be viewed as changed
281
281
  void nextTick(() => {
@@ -0,0 +1,3 @@
1
+ export { inputOtpProps, default as UInputOtp } from './src/InputOtp';
2
+ export type { InputOtpProps } from './src/InputOtp';
3
+ export type * from './src/public-types';
@@ -0,0 +1 @@
1
+ export { inputOtpProps, default as UInputOtp } from './src/InputOtp';