@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
@@ -0,0 +1,256 @@
1
+ "use strict";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ var __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.inputOtpProps = void 0;
18
+ const seemly_1 = require("seemly");
19
+ const vooks_1 = require("vooks");
20
+ const vue_1 = require("vue");
21
+ const _mixins_1 = require("../../_mixins");
22
+ const _utils_1 = require("../../_utils");
23
+ const light_1 = __importDefault(require("../styles/light"));
24
+ const index_cssr_1 = __importDefault(require("./styles/index.cssr"));
25
+ const input_1 = require("../../input");
26
+ exports.inputOtpProps = Object.assign(Object.assign({}, _mixins_1.useTheme.props), { defaultValue: { type: Array, default: [] }, value: Array, length: {
27
+ type: Number,
28
+ default: 6
29
+ }, block: Boolean, size: String, disabled: Boolean, mask: Boolean, readonly: Boolean, status: String, gap: [String, Number], placeholder: { type: String, default: '' }, allowInput: Function, onBlur: [Function, Array], onFocus: [Function, Array], 'onUpdate:value': [Function, Array], onUpdateValue: [Function, Array], onFinish: [Function, Array] });
30
+ exports.default = (0, vue_1.defineComponent)({
31
+ name: 'InputOtp',
32
+ props: exports.inputOtpProps,
33
+ slots: Object,
34
+ setup(props) {
35
+ const { mergedClsPrefixRef, mergedRtlRef, inlineThemeDisabled } = (0, _mixins_1.useConfig)(props);
36
+ const themeRef = (0, _mixins_1.useTheme)('InputOtp', '-input-otp', index_cssr_1.default, light_1.default, props, mergedClsPrefixRef);
37
+ const rtlEnabledRef = (0, _mixins_1.useRtl)('InputOtp', mergedRtlRef, mergedClsPrefixRef);
38
+ // form-item
39
+ const formItem = (0, _mixins_1.useFormItem)(props);
40
+ const { mergedSizeRef, mergedDisabledRef, mergedStatusRef } = formItem;
41
+ const cssVarsRef = (0, vue_1.computed)(() => {
42
+ const { value: size } = mergedSizeRef;
43
+ const { gap: propGap } = props;
44
+ const { self: { [(0, _utils_1.createKey)('inputWidth', size)]: inputWidth, [(0, _utils_1.createKey)('gap', size)]: gap } } = themeRef.value;
45
+ return {
46
+ '--u-gap': propGap === undefined
47
+ ? gap
48
+ : typeof propGap === 'number'
49
+ ? (0, seemly_1.pxfy)(propGap)
50
+ : propGap,
51
+ '--u-input-width': inputWidth
52
+ };
53
+ });
54
+ const themeClassHandle = inlineThemeDisabled
55
+ ? (0, _mixins_1.useThemeClass)('input-otp', (0, vue_1.computed)(() => {
56
+ const { value: size } = mergedSizeRef;
57
+ return size[0];
58
+ }), cssVarsRef, props)
59
+ : undefined;
60
+ const uncontrolledValueRef = (0, vue_1.ref)(props.defaultValue);
61
+ const controlledValueRef = (0, vue_1.toRef)(props, 'value');
62
+ const mergedValueRef = (0, vooks_1.useMergedState)(controlledValueRef, uncontrolledValueRef);
63
+ const inputRefList = (0, vue_1.ref)([]);
64
+ const inputTypeRef = (0, vue_1.computed)(() => props.mask ? 'password' : 'text');
65
+ const handleFocus = (event, index) => {
66
+ // If it's focused from other input element inside the component, returns
67
+ if (inputRefList === null || inputRefList === void 0 ? void 0 : inputRefList.value.some((inputInst) => inputInst.inputElRef === event.relatedTarget)) {
68
+ return;
69
+ }
70
+ const { onFocus } = props;
71
+ if (onFocus) {
72
+ (0, _utils_1.call)(onFocus, event, index);
73
+ }
74
+ const { triggerFormFocus } = formItem;
75
+ triggerFormFocus();
76
+ };
77
+ const handleBlur = (event, index) => {
78
+ // If it's blured to other input element inside the component, returns
79
+ if (inputRefList === null || inputRefList === void 0 ? void 0 : inputRefList.value.some((inputInst) => inputInst.inputElRef === event.relatedTarget)) {
80
+ return;
81
+ }
82
+ const { onBlur } = props;
83
+ const { triggerFormBlur } = formItem;
84
+ if (onBlur) {
85
+ (0, _utils_1.call)(onBlur, event, index);
86
+ }
87
+ triggerFormBlur();
88
+ };
89
+ const focusOnChar = (charIndex) => {
90
+ if (charIndex >= props.length) {
91
+ return;
92
+ }
93
+ if (charIndex < 0) {
94
+ return;
95
+ }
96
+ inputRefList === null || inputRefList === void 0 ? void 0 : inputRefList.value[charIndex].focus();
97
+ inputRefList === null || inputRefList === void 0 ? void 0 : inputRefList.value[charIndex].select();
98
+ };
99
+ const focusOnNextChar = (currentIndex) => {
100
+ if (currentIndex >= props.length - 1) {
101
+ return;
102
+ }
103
+ focusOnChar(currentIndex + 1);
104
+ };
105
+ const focusOnPrevChar = (currentIndex) => {
106
+ if (currentIndex <= 0) {
107
+ return;
108
+ }
109
+ focusOnChar(currentIndex - 1);
110
+ };
111
+ const justifyValue = (value) => {
112
+ const justifiedValue = value ? Array.from(value) : [];
113
+ const length = props.length;
114
+ while (justifiedValue.length > length) {
115
+ justifiedValue.pop();
116
+ }
117
+ while (justifiedValue.length < length) {
118
+ justifiedValue.push('');
119
+ }
120
+ return justifiedValue;
121
+ };
122
+ function doUpdateValue(values, meta) {
123
+ const { triggerFormInput, triggerFormChange } = formItem;
124
+ if ((0, _utils_1.isArrayShallowEqual)(values, mergedValueRef.value)) {
125
+ triggerFormInput();
126
+ return;
127
+ }
128
+ const { 'onUpdate:value': _onUpdateValue, onUpdateValue, onFinish } = props;
129
+ if (_onUpdateValue) {
130
+ (0, _utils_1.call)(_onUpdateValue, values, meta);
131
+ }
132
+ if (onUpdateValue) {
133
+ (0, _utils_1.call)(onUpdateValue, values, meta);
134
+ }
135
+ if (onFinish && values.every(Boolean)) {
136
+ (0, _utils_1.call)(onFinish, values);
137
+ }
138
+ uncontrolledValueRef.value = values;
139
+ triggerFormInput();
140
+ triggerFormChange();
141
+ }
142
+ const handlePaste = (event, index) => {
143
+ if (props.readonly || mergedDisabledRef.value) {
144
+ return;
145
+ }
146
+ event.preventDefault();
147
+ const { clipboardData } = event;
148
+ const text = clipboardData === null || clipboardData === void 0 ? void 0 : clipboardData.getData('text');
149
+ if (!text) {
150
+ return;
151
+ }
152
+ const currentValue = justifyValue(mergedValueRef.value);
153
+ let startIndex = index;
154
+ const allowInput = props.allowInput;
155
+ let pasteApplied = false;
156
+ let appendedText = '';
157
+ for (let i = 0; i < text.length; ++i) {
158
+ if (allowInput && !allowInput(text[i], startIndex, currentValue)) {
159
+ continue;
160
+ }
161
+ pasteApplied = true;
162
+ currentValue[startIndex] = text[i];
163
+ appendedText += text[i];
164
+ startIndex++;
165
+ if (startIndex >= currentValue.length) {
166
+ break;
167
+ }
168
+ }
169
+ if (pasteApplied) {
170
+ focusOnChar(startIndex);
171
+ doUpdateValue(currentValue, {
172
+ diff: appendedText,
173
+ index: startIndex,
174
+ source: 'paste'
175
+ });
176
+ }
177
+ };
178
+ const handleKeydown = (event, index) => {
179
+ if (mergedDisabledRef.value) {
180
+ return;
181
+ }
182
+ const keyCode = event.code || event.key;
183
+ const currentValue = justifyValue(mergedValueRef.value);
184
+ if (keyCode === 'Backspace' && !props.readonly) {
185
+ event.preventDefault();
186
+ currentValue[Math.max(index, 0)] = '';
187
+ doUpdateValue(currentValue, { diff: '', index, source: 'delete' });
188
+ focusOnPrevChar(index);
189
+ }
190
+ else if (keyCode === 'ArrowLeft') {
191
+ event.preventDefault();
192
+ focusOnPrevChar(index);
193
+ }
194
+ else if (keyCode === 'ArrowRight') {
195
+ event.preventDefault();
196
+ focusOnNextChar(index);
197
+ }
198
+ };
199
+ const handleInput = (value, index) => {
200
+ const currentValue = justifyValue(mergedValueRef.value);
201
+ const currentValueAtIndex = currentValue[index];
202
+ const diff = value.replace(currentValueAtIndex, '');
203
+ const char = diff[diff.length - 1] || value[value.length - 1] || '';
204
+ const allowInput = props.allowInput;
205
+ if (allowInput && !allowInput(char, index, currentValue)) {
206
+ return;
207
+ }
208
+ currentValue[index] = char;
209
+ doUpdateValue(currentValue, { diff: char, index, source: 'input' });
210
+ focusOnNextChar(index);
211
+ };
212
+ // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
213
+ const getTemplateEvents = (index) => {
214
+ return {
215
+ onInput: (value) => {
216
+ handleInput(value, index);
217
+ },
218
+ onPaste: (event) => {
219
+ handlePaste(event, index);
220
+ },
221
+ onKeydown: (event) => {
222
+ handleKeydown(event, index);
223
+ },
224
+ onFocus: (event) => {
225
+ handleFocus(event, index);
226
+ },
227
+ onBlur: (event) => {
228
+ handleBlur(event, index);
229
+ }
230
+ };
231
+ };
232
+ const exposedMethods = {
233
+ focusOnChar
234
+ };
235
+ return Object.assign({ mergedTheme: themeRef, perItemValueArray: (0, vue_1.computed)(() => justifyValue(mergedValueRef.value)), mergedClsPrefix: mergedClsPrefixRef, inputRefList, inputType: inputTypeRef, rtlEnabled: rtlEnabledRef, mergedStatus: mergedStatusRef, mergedDisabled: mergedDisabledRef, cssVars: inlineThemeDisabled ? undefined : cssVarsRef, themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass, getTemplateEvents, onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender }, exposedMethods);
236
+ },
237
+ render() {
238
+ const { mergedTheme, mergedClsPrefix, perItemValueArray, size, placeholder, mergedDisabled, mergedStatus, readonly, inputType, $slots, getTemplateEvents, themeClass, onRender } = this;
239
+ onRender === null || onRender === void 0 ? void 0 : onRender();
240
+ return ((0, vue_1.h)("div", { style: this.cssVars, class: [
241
+ `${mergedClsPrefix}-input-otp`,
242
+ themeClass,
243
+ this.rtlEnabled && `${mergedClsPrefix}-input-otp--rtl`,
244
+ this.block && `${mergedClsPrefix}-input-otp--block`
245
+ ] }, (0, seemly_1.repeat)(this.length, undefined).map((_, index) => (0, _utils_1.resolveSlotWithProps)($slots.default, Object.assign({ index, value: perItemValueArray[index], type: inputType, size,
246
+ placeholder, disabled: mergedDisabled, readonly, status: mergedStatus, builtinThemeOverrides: {
247
+ paddingTiny: '0',
248
+ paddingSmall: '0',
249
+ paddingMedium: '0',
250
+ paddingLarge: '0'
251
+ }, theme: mergedTheme.peers.Input, themeOverrides: mergedTheme.peerOverrides.Input, ref: (el) => (this.inputRefList[index] = el) }, getTemplateEvents(index)), (_a) => {
252
+ var { index } = _a, restProps = __rest(_a, ["index"]);
253
+ return [(0, vue_1.h)(input_1.UInput, Object.assign({}, restProps, { key: index }))];
254
+ }))));
255
+ }
256
+ });
@@ -0,0 +1,25 @@
1
+ import type { VNode } from 'vue';
2
+ import type { InputInst } from '../../components';
3
+ import type { InputProps } from '../../input/src/Input';
4
+ export type InputOtpAllowInput = (char: string, index: number, currentValue: string[]) => boolean;
5
+ export type InputOtpSize = 'small' | 'medium' | 'large';
6
+ export type InputOtpOnUpdateValue = (value: string[], meta: InputOtpOnUpdateValueMeta) => void;
7
+ export type InputOtpOnFocus = (e: FocusEvent, index: number) => void;
8
+ export type InputOtpOnBlur = (e: FocusEvent, index: number) => void;
9
+ export interface InputOtpSlots {
10
+ default?: InputOtpDefaultSlot;
11
+ }
12
+ export type InputOtpDefaultSlot = (props: InputProps & {
13
+ index: number;
14
+ ref: (inst: InputInst) => void;
15
+ }) => VNode[];
16
+ export type InputOtpOnFinish = (value: string[]) => void;
17
+ export interface InputOtpOnUpdateValueMeta {
18
+ diff: string;
19
+ index: number;
20
+ source: InputOtpOnUpdateValueMetaSource;
21
+ }
22
+ export type InputOtpOnUpdateValueMetaSource = 'paste' | 'input' | 'delete';
23
+ export interface InputOtpInst {
24
+ focusOnChar: (charIndex: number) => void;
25
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ declare const _default: import("css-render").CNode;
2
+ export default _default;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ const cssr_1 = require("../../../_utils/cssr");
7
+ // --u-input-width
8
+ // --u-gap
9
+ exports.default = (0, cssr_1.c)([(0, cssr_1.cB)('input-otp', `
10
+ display: flex;
11
+ align-items: center;
12
+ gap: var(--u-gap);
13
+ `, [(0, cssr_1.cM)('block', '', [(0, cssr_1.cB)('input', '', [(0, cssr_1.cNotM)('autosize', `
14
+ text-align: center;
15
+ min-width: 0;
16
+ `), (0, cssr_1.cM)('autosize', `
17
+ text-align: center;
18
+ min-width: 0;
19
+ `)])]), (0, cssr_1.cNotM)('block', '', [(0, cssr_1.cB)('input', '', [(0, cssr_1.cNotM)('autosize', `
20
+ width: var(--u-input-width);
21
+ text-align: center;
22
+ `), (0, cssr_1.cM)('autosize', `
23
+ width: var(--u-input-width);
24
+ text-align: center;
25
+ `)])])])]);
@@ -0,0 +1,2 @@
1
+ declare const _default: import("css-render").CNode;
2
+ export default _default;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ const cssr_1 = require("../../../_utils/cssr");
7
+ // --u-gap
8
+ exports.default = (0, cssr_1.cB)('input-otp', [(0, cssr_1.cM)('rtl', `
9
+ direction: rtl;
10
+ `)]);
@@ -0,0 +1,3 @@
1
+ import type { InputOtpTheme } from './light';
2
+ declare const inputOtpDark: InputOtpTheme;
3
+ export default inputOtpDark;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const common_1 = require("../../_styles/common");
4
+ const styles_1 = require("../../input/styles");
5
+ const light_1 = require("./light");
6
+ const inputOtpDark = {
7
+ name: 'InputOtp',
8
+ common: common_1.commonDark,
9
+ peers: {
10
+ Input: styles_1.inputDark
11
+ },
12
+ self: light_1.self
13
+ };
14
+ exports.default = inputOtpDark;
@@ -0,0 +1,4 @@
1
+ export { default as inputOtpDark } from './dark';
2
+ export { default as inputOtpLight } from './light';
3
+ export type { InputOtpTheme } from './light';
4
+ export { inputOtpRtl } from './rtl';
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.inputOtpRtl = exports.inputOtpLight = exports.inputOtpDark = void 0;
7
+ var dark_1 = require("./dark");
8
+ Object.defineProperty(exports, "inputOtpDark", { enumerable: true, get: function () { return __importDefault(dark_1).default; } });
9
+ var light_1 = require("./light");
10
+ Object.defineProperty(exports, "inputOtpLight", { enumerable: true, get: function () { return __importDefault(light_1).default; } });
11
+ var rtl_1 = require("./rtl");
12
+ Object.defineProperty(exports, "inputOtpRtl", { enumerable: true, get: function () { return rtl_1.inputOtpRtl; } });
@@ -0,0 +1,83 @@
1
+ export declare function self(): {
2
+ inputWidthSmall: string;
3
+ inputWidthMedium: string;
4
+ inputWidthLarge: string;
5
+ gapSmall: string;
6
+ gapMedium: string;
7
+ gapLarge: string;
8
+ };
9
+ declare const inputOtpLight: import("../../_mixins").Theme<"InputOtp", {
10
+ inputWidthSmall: string;
11
+ inputWidthMedium: string;
12
+ inputWidthLarge: string;
13
+ gapSmall: string;
14
+ gapMedium: string;
15
+ gapLarge: string;
16
+ }, {
17
+ Input: import("../../_mixins").Theme<"Input", {
18
+ paddingTiny: string;
19
+ paddingSmall: string;
20
+ paddingMedium: string;
21
+ paddingLarge: string;
22
+ paddingHuge: string;
23
+ clearSize: string;
24
+ countTextColorDisabled: string;
25
+ countTextColor: string;
26
+ heightTiny: string;
27
+ heightSmall: string;
28
+ heightMedium: string;
29
+ heightLarge: string;
30
+ heightHuge: string;
31
+ fontSizeTiny: string;
32
+ fontSizeSmall: string;
33
+ fontSizeMedium: string;
34
+ fontSizeLarge: string;
35
+ fontSizeHuge: string;
36
+ lineHeight: string;
37
+ lineHeightTextarea: string;
38
+ borderRadius: string;
39
+ iconSize: string;
40
+ groupLabelTextColor: string;
41
+ textColor: string;
42
+ textColorDisabled: string;
43
+ textDecorationColor: string;
44
+ caretColor: string;
45
+ placeholderColor: string;
46
+ placeholderColorDisabled: string;
47
+ color: string;
48
+ colorDisabled: string;
49
+ colorFocus: string;
50
+ groupLabelBorder: string;
51
+ border: string;
52
+ borderHover: string;
53
+ borderDisabled: string;
54
+ borderFocus: string;
55
+ boxShadowFocus: string;
56
+ loadingColor: string;
57
+ loadingColorWarning: string;
58
+ borderWarning: string;
59
+ borderHoverWarning: string;
60
+ colorFocusWarning: string;
61
+ borderFocusWarning: string;
62
+ boxShadowFocusWarning: string;
63
+ caretColorWarning: string;
64
+ loadingColorError: string;
65
+ borderError: string;
66
+ borderHoverError: string;
67
+ colorFocusError: string;
68
+ borderFocusError: string;
69
+ boxShadowFocusError: string;
70
+ caretColorError: string;
71
+ clearColor: string;
72
+ clearColorHover: string;
73
+ clearColorPressed: string;
74
+ iconColor: string;
75
+ iconColorDisabled: string;
76
+ iconColorHover: string;
77
+ iconColorPressed: string;
78
+ suffixTextColor: string;
79
+ selectionColor: string;
80
+ }, any>;
81
+ }>;
82
+ export default inputOtpLight;
83
+ export type InputOtpTheme = typeof inputOtpLight;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.self = self;
4
+ const _mixins_1 = require("../../_mixins");
5
+ const common_1 = require("../../_styles/common");
6
+ const styles_1 = require("../../input/styles");
7
+ function self() {
8
+ return {
9
+ inputWidthSmall: '44px',
10
+ inputWidthMedium: '50px',
11
+ inputWidthLarge: '56px',
12
+ gapSmall: '6px',
13
+ gapMedium: '8px',
14
+ gapLarge: '10px'
15
+ };
16
+ }
17
+ const inputOtpLight = (0, _mixins_1.createTheme)({
18
+ name: 'InputOtp',
19
+ common: common_1.commonLight,
20
+ peers: {
21
+ Input: styles_1.inputLight
22
+ },
23
+ self
24
+ });
25
+ exports.default = inputOtpLight;
@@ -0,0 +1,2 @@
1
+ import type { RtlItem } from '../../config-provider/src/internal-interface';
2
+ export declare const inputOtpRtl: RtlItem;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.inputOtpRtl = void 0;
7
+ const input_otp_rtl_cssr_1 = __importDefault(require("../src/styles/input-otp-rtl.cssr"));
8
+ exports.inputOtpRtl = {
9
+ name: 'InputOtp',
10
+ style: input_otp_rtl_cssr_1.default
11
+ };
@@ -62,7 +62,7 @@ exports.default = (0, vue_1.defineComponent)({
62
62
  const { uncontrolledValue: uncontrolledValueRef, mergedValue: mergedValueRef, avlSrcValueSet: avlSrcValueSetRef, avlTgtValueSet: avlTgtValueSetRef, tgtOpts: tgtOptsRef, srcOpts: srcOptsRef, filteredSrcOpts: filteredSrcOptsRef, filteredTgtOpts: filteredTgtOptsRef, srcCheckedValues: srcCheckedValuesRef, tgtCheckedValues: tgtCheckedValuesRef, srcCheckedStatus: srcCheckedStatusRef, tgtCheckedStatus: tgtCheckedStatusRef, srcPattern: srcPatternRef, tgtPattern: tgtPatternRef, isInputing: isInputingRef, fromButtonDisabled: fromButtonDisabledRef, toButtonDisabled: toButtonDisabledRef, handleInputFocus, handleInputBlur, handleTgtFilterUpdateValue, handleSrcFilterUpdateValue } = (0, use_transfer_data_1.useTransferData)(props, mergedDisabledRef);
63
63
  function doUpdateValue(value) {
64
64
  const { onUpdateValue, 'onUpdate:value': _onUpdateValue, onChange } = props;
65
- const { nTriggerFormInput, nTriggerFormChange } = formItem;
65
+ const { triggerFormInput, triggerFormChange } = formItem;
66
66
  if (onUpdateValue)
67
67
  (0, _utils_1.call)(onUpdateValue, value);
68
68
  if (_onUpdateValue)
@@ -70,8 +70,8 @@ exports.default = (0, vue_1.defineComponent)({
70
70
  if (onChange)
71
71
  (0, _utils_1.call)(onChange, value);
72
72
  uncontrolledValueRef.value = value;
73
- nTriggerFormInput();
74
- nTriggerFormChange();
73
+ triggerFormInput();
74
+ triggerFormChange();
75
75
  }
76
76
  function handleSrcHeaderCheck(value) {
77
77
  const { value: { checked, indeterminate } } = srcCheckedStatusRef;