@coreui/vue-pro 5.16.0 → 5.17.1

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 (51) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/components/autocomplete/CAutocomplete.js +17 -16
  3. package/dist/cjs/components/autocomplete/CAutocomplete.js.map +1 -1
  4. package/dist/cjs/components/calendar/utils.js +20 -7
  5. package/dist/cjs/components/calendar/utils.js.map +1 -1
  6. package/dist/cjs/components/index.d.ts +1 -0
  7. package/dist/cjs/components/index.js +4 -0
  8. package/dist/cjs/components/index.js.map +1 -1
  9. package/dist/cjs/components/one-time-password-input/COneTimePassword.d.ts +278 -0
  10. package/dist/cjs/components/one-time-password-input/COneTimePassword.js +393 -0
  11. package/dist/cjs/components/one-time-password-input/COneTimePassword.js.map +1 -0
  12. package/dist/cjs/components/one-time-password-input/COneTimePasswordInput.d.ts +4 -0
  13. package/dist/cjs/components/one-time-password-input/COneTimePasswordInput.js +19 -0
  14. package/dist/cjs/components/one-time-password-input/COneTimePasswordInput.js.map +1 -0
  15. package/dist/cjs/components/one-time-password-input/index.d.ts +3 -0
  16. package/dist/cjs/components/one-time-password-input/utils.d.ts +2 -0
  17. package/dist/cjs/components/one-time-password-input/utils.js +18 -0
  18. package/dist/cjs/components/one-time-password-input/utils.js.map +1 -0
  19. package/dist/cjs/components/stepper/CStepper.d.ts +1 -1
  20. package/dist/cjs/index.js +4 -0
  21. package/dist/cjs/index.js.map +1 -1
  22. package/dist/esm/components/autocomplete/CAutocomplete.js +17 -16
  23. package/dist/esm/components/autocomplete/CAutocomplete.js.map +1 -1
  24. package/dist/esm/components/calendar/utils.js +20 -7
  25. package/dist/esm/components/calendar/utils.js.map +1 -1
  26. package/dist/esm/components/index.d.ts +1 -0
  27. package/dist/esm/components/index.js +2 -0
  28. package/dist/esm/components/index.js.map +1 -1
  29. package/dist/esm/components/one-time-password-input/COneTimePassword.d.ts +278 -0
  30. package/dist/esm/components/one-time-password-input/COneTimePassword.js +391 -0
  31. package/dist/esm/components/one-time-password-input/COneTimePassword.js.map +1 -0
  32. package/dist/esm/components/one-time-password-input/COneTimePasswordInput.d.ts +4 -0
  33. package/dist/esm/components/one-time-password-input/COneTimePasswordInput.js +17 -0
  34. package/dist/esm/components/one-time-password-input/COneTimePasswordInput.js.map +1 -0
  35. package/dist/esm/components/one-time-password-input/index.d.ts +3 -0
  36. package/dist/esm/components/one-time-password-input/utils.d.ts +2 -0
  37. package/dist/esm/components/one-time-password-input/utils.js +15 -0
  38. package/dist/esm/components/one-time-password-input/utils.js.map +1 -0
  39. package/dist/esm/components/stepper/CStepper.d.ts +1 -1
  40. package/dist/esm/index.js +2 -0
  41. package/dist/esm/index.js.map +1 -1
  42. package/package.json +6 -6
  43. package/src/components/autocomplete/CAutocomplete.ts +17 -16
  44. package/src/components/calendar/utils.ts +22 -7
  45. package/src/components/index.ts +1 -0
  46. package/src/components/one-time-password-input/COneTimePassword.ts +459 -0
  47. package/src/components/one-time-password-input/COneTimePasswordInput.ts +21 -0
  48. package/src/components/one-time-password-input/__tests__/COneTimePassword.spec.ts +210 -0
  49. package/src/components/one-time-password-input/__tests__/__snapshots__/COneTimePassword.spec.ts.snap +32 -0
  50. package/src/components/one-time-password-input/index.ts +4 -0
  51. package/src/components/one-time-password-input/utils.ts +13 -0
@@ -0,0 +1,391 @@
1
+ import { defineComponent, ref, computed, watch, h, nextTick } from 'vue';
2
+ import { CFormControlWrapper } from '../form/CFormControlWrapper.js';
3
+ import { COneTimePasswordInput } from './COneTimePasswordInput.js';
4
+ import { extractValidChars, isValidInput } from './utils.js';
5
+ import getNextActiveElement from '../../utils/getNextActiveElement.js';
6
+ import isRTL from '../../utils/isRTL.js';
7
+
8
+ const COneTimePassword = defineComponent({
9
+ name: 'COneTimePassword',
10
+ inheritAttrs: false,
11
+ props: {
12
+ /**
13
+ * Function to generate aria-label for each input field. Receives current index (0-based) and total number of inputs.
14
+ */
15
+ ariaLabel: {
16
+ type: Function,
17
+ default: (index, total) => `Digit ${index + 1} of ${total}`,
18
+ },
19
+ /**
20
+ * Automatically submit the form when all one time password fields are filled.
21
+ */
22
+ autoSubmit: {
23
+ type: Boolean,
24
+ default: false,
25
+ },
26
+ /**
27
+ * Disable all one time password (OTP) input fields.
28
+ */
29
+ disabled: {
30
+ type: Boolean,
31
+ default: false,
32
+ },
33
+ /**
34
+ * Initial value for uncontrolled Vue.js one time password input.
35
+ */
36
+ defaultValue: [String, Number],
37
+ /**
38
+ * Provide valuable, actionable feedback.
39
+ */
40
+ feedback: String,
41
+ /**
42
+ * Provide valuable, actionable feedback.
43
+ */
44
+ feedbackInvalid: String,
45
+ /**
46
+ * Provide valuable, actionable invalid feedback when using standard HTML form validation which applied two CSS pseudo-classes, `:invalid` and `:valid`.
47
+ */
48
+ feedbackValid: String,
49
+ /**
50
+ * A string of all className you want applied to the floating label wrapper.
51
+ */
52
+ floatingClassName: String,
53
+ /**
54
+ * Provide valuable, actionable valid feedback when using standard HTML form validation which applied two CSS pseudo-classes, `:invalid` and `:valid`.
55
+ */
56
+ floatingLabel: String,
57
+ /**
58
+ * ID attribute for the hidden input field.
59
+ */
60
+ id: String,
61
+ /**
62
+ * Set component validation state to invalid.
63
+ */
64
+ invalid: Boolean,
65
+ /**
66
+ * Add a caption for a component.
67
+ */
68
+ label: String,
69
+ /**
70
+ * Enforce sequential input (users must fill fields in order).
71
+ */
72
+ linear: {
73
+ type: Boolean,
74
+ default: true,
75
+ },
76
+ /**
77
+ * Show input as password (masked characters).
78
+ */
79
+ masked: {
80
+ type: Boolean,
81
+ default: false,
82
+ },
83
+ /**
84
+ * The default name for a value passed using v-model.
85
+ */
86
+ modelValue: [String, Number],
87
+ /**
88
+ * Name attribute for the hidden input field.
89
+ */
90
+ name: String,
91
+ /**
92
+ * Placeholder text for input fields. Single character applies to all fields, longer strings apply character-by-character.
93
+ */
94
+ placeholder: String,
95
+ /**
96
+ * Make Vue.js OTP input component read-only.
97
+ */
98
+ readonly: {
99
+ type: Boolean,
100
+ default: false,
101
+ },
102
+ /**
103
+ * Makes the input field required for form validation.
104
+ */
105
+ required: {
106
+ type: Boolean,
107
+ default: false,
108
+ },
109
+ /**
110
+ * Sets the visual size of the Vue.js one time password (OTP) input. Use 'sm' for small or 'lg' for large input fields.
111
+ */
112
+ size: {
113
+ type: String,
114
+ validator: (value) => ['sm', 'lg'].includes(value),
115
+ },
116
+ /**
117
+ * Add helper text to the component.
118
+ */
119
+ text: String,
120
+ /**
121
+ * Display validation feedback in a styled tooltip.
122
+ */
123
+ tooltipFeedback: Boolean,
124
+ /**
125
+ * Input validation type: 'number' for digits only, or 'text' for free text.
126
+ */
127
+ type: {
128
+ type: String,
129
+ default: 'number',
130
+ validator: (value) => ['number', 'text'].includes(value),
131
+ },
132
+ /**
133
+ * Set component validation state to valid.
134
+ */
135
+ valid: Boolean,
136
+ /**
137
+ * The current value of the one time password input.
138
+ */
139
+ value: [String, Number],
140
+ },
141
+ emits: [
142
+ /**
143
+ * Callback triggered when the Vue.js one time password (OTP) value changes.
144
+ */
145
+ 'update:modelValue',
146
+ /**
147
+ * Callback triggered when the Vue.js one time password (OTP) value changes.
148
+ */
149
+ 'change',
150
+ /**
151
+ * Callback triggered when all Vue.js one time password (OTP) fields are filled.
152
+ */
153
+ 'complete',
154
+ ],
155
+ setup(props, { attrs, slots, emit }) {
156
+ const inputRefs = ref([]);
157
+ const hiddenInputRef = ref(null);
158
+ const inputValues = ref([]);
159
+ // Count valid OTP input children
160
+ const inputCount = computed(() => {
161
+ return inputRefs.value.filter((ref) => ref !== null).length;
162
+ });
163
+ // Initialize input values
164
+ const initializeValues = () => {
165
+ const initialValue = String(props.modelValue ?? props.value ?? props.defaultValue ?? '');
166
+ inputValues.value = Array.from({ length: inputCount.value }, (_, i) => initialValue[i] || '');
167
+ };
168
+ // Watch for changes in modelValue or value (controlled mode)
169
+ watch(() => props.modelValue ?? props.value, (newValue) => {
170
+ if (newValue !== undefined) {
171
+ const valueString = String(newValue);
172
+ inputValues.value = Array.from({ length: inputCount.value }, (_, i) => valueString[i] || '');
173
+ }
174
+ }, { immediate: true });
175
+ // Watch for changes in inputCount
176
+ watch(inputCount, initializeValues, { immediate: true });
177
+ // Update hidden input and trigger events
178
+ const updateValue = (newValues) => {
179
+ const newValue = newValues.join('');
180
+ if (hiddenInputRef.value) {
181
+ hiddenInputRef.value.value = newValue;
182
+ }
183
+ emit('update:modelValue', newValue);
184
+ emit('change', newValue);
185
+ if (newValue.length === inputCount.value) {
186
+ emit('complete', newValue);
187
+ if (props.autoSubmit) {
188
+ nextTick(() => {
189
+ const form = hiddenInputRef.value?.closest('form');
190
+ if (form && typeof form.requestSubmit === 'function') {
191
+ form.requestSubmit();
192
+ }
193
+ });
194
+ }
195
+ }
196
+ };
197
+ const handleInputChange = (index, event) => {
198
+ const target = event.target;
199
+ const inputValue = target.value;
200
+ if (inputValue.length === 1 && !isValidInput(inputValue, props.type)) {
201
+ return;
202
+ }
203
+ const newValues = [...inputValues.value];
204
+ newValues[index] = inputValue.length === 1 ? inputValue : '';
205
+ inputValues.value = newValues;
206
+ updateValue(newValues);
207
+ if (inputValue.length === 1) {
208
+ const nextInput = getNextActiveElement(inputRefs.value.filter(Boolean), target, true, false);
209
+ nextInput?.focus();
210
+ }
211
+ };
212
+ const handleInputFocus = (event) => {
213
+ const target = event.target;
214
+ if (target.value) {
215
+ setTimeout(() => {
216
+ target.select();
217
+ }, 0);
218
+ return;
219
+ }
220
+ if (props.linear) {
221
+ const firstEmptyInput = inputRefs.value.find((input) => !input?.value);
222
+ if (firstEmptyInput && firstEmptyInput !== target) {
223
+ firstEmptyInput.focus();
224
+ }
225
+ }
226
+ };
227
+ const handleKeyDown = (event) => {
228
+ const { key, target } = event;
229
+ if (key === 'Backspace' && target.value === '') {
230
+ const newValues = [...inputValues.value];
231
+ const prevInput = getNextActiveElement(inputRefs.value.filter(Boolean), target, false, false);
232
+ if (prevInput) {
233
+ const prevIndex = inputRefs.value.indexOf(prevInput);
234
+ if (prevIndex !== -1) {
235
+ newValues[prevIndex] = '';
236
+ inputValues.value = newValues;
237
+ updateValue(newValues);
238
+ prevInput.focus();
239
+ }
240
+ }
241
+ return;
242
+ }
243
+ if (key === 'ArrowRight') {
244
+ if (props.linear && target.value === '') {
245
+ return;
246
+ }
247
+ const shouldMoveNext = !isRTL(target);
248
+ const nextInput = getNextActiveElement(inputRefs.value.filter(Boolean), target, shouldMoveNext, false);
249
+ nextInput?.focus();
250
+ return;
251
+ }
252
+ if (key === 'ArrowLeft') {
253
+ const shouldMoveNext = isRTL(target);
254
+ const prevInput = getNextActiveElement(inputRefs.value.filter(Boolean), target, shouldMoveNext, false);
255
+ prevInput?.focus();
256
+ }
257
+ };
258
+ const handlePaste = (index, event) => {
259
+ event.preventDefault();
260
+ const pastedData = event.clipboardData?.getData('text') || '';
261
+ const validChars = extractValidChars(pastedData, props.type);
262
+ if (!validChars) {
263
+ return;
264
+ }
265
+ const newValues = [...inputValues.value];
266
+ const startIndex = index;
267
+ for (let i = 0; i < validChars.length && startIndex + i < inputCount.value; i++) {
268
+ newValues[startIndex + i] = validChars[i];
269
+ }
270
+ inputValues.value = newValues;
271
+ updateValue(newValues);
272
+ // Focus the next empty input or the last filled input
273
+ const nextEmptyIndex = startIndex + validChars.length;
274
+ if (nextEmptyIndex < inputCount.value) {
275
+ inputRefs.value[nextEmptyIndex]?.focus();
276
+ }
277
+ else {
278
+ inputRefs.value[inputRefs.value.length - 1]?.focus();
279
+ }
280
+ };
281
+ return () => {
282
+ if (!slots.default) {
283
+ return null;
284
+ }
285
+ const children = slots.default();
286
+ let inputIndex = 0;
287
+ const processedChildren = children?.map((child) => {
288
+ if (child.type && child.type.name === 'COneTimePasswordInput') {
289
+ const currentInputIndex = inputIndex++;
290
+ return h(COneTimePasswordInput, {
291
+ ...child.props,
292
+ key: `otp-input-${currentInputIndex}`,
293
+ type: props.masked ? 'password' : 'text',
294
+ class: [
295
+ {
296
+ 'is-invalid': props.invalid,
297
+ 'is-valid': props.valid,
298
+ },
299
+ child.props?.class,
300
+ ],
301
+ id: child.props?.id || (props.id ? `${props.id}-${currentInputIndex}` : undefined),
302
+ name: child.props?.name || (props.name ? `${props.name}-${currentInputIndex}` : undefined),
303
+ placeholder: child.props?.placeholder ||
304
+ (props.placeholder && props.placeholder.length > 1
305
+ ? props.placeholder[currentInputIndex]
306
+ : props.placeholder),
307
+ value: inputValues.value[currentInputIndex] || '',
308
+ tabindex: currentInputIndex === 0 ? 0 : inputValues.value[currentInputIndex - 1] ? 0 : -1,
309
+ disabled: props.disabled || child.props?.disabled,
310
+ readonly: props.readonly || child.props?.readonly,
311
+ required: props.required || child.props?.required,
312
+ 'aria-label': child.props?.['aria-label'] || props.ariaLabel(currentInputIndex, inputCount.value),
313
+ inputmode: props.type === 'number' ? 'numeric' : 'text',
314
+ pattern: props.type === 'number' ? '[0-9]*' : '.*',
315
+ onInput: (event) => {
316
+ handleInputChange(currentInputIndex, event);
317
+ },
318
+ onFocus: handleInputFocus,
319
+ onKeydown: (event) => {
320
+ handleKeyDown(event);
321
+ },
322
+ onPaste: (event) => {
323
+ handlePaste(currentInputIndex, event);
324
+ },
325
+ ref: (el) => {
326
+ // Get the actual DOM element - handle both direct elements and component instances
327
+ if (el) {
328
+ // If it's a component instance, get the DOM element
329
+ const domElement = el.$el || el;
330
+ // Ensure it's actually an HTMLInputElement
331
+ if (domElement && domElement.tagName === 'INPUT') {
332
+ inputRefs.value[currentInputIndex] = domElement;
333
+ }
334
+ else {
335
+ inputRefs.value[currentInputIndex] = el;
336
+ }
337
+ }
338
+ else {
339
+ inputRefs.value[currentInputIndex] = null;
340
+ }
341
+ },
342
+ });
343
+ }
344
+ return child;
345
+ });
346
+ return h(CFormControlWrapper, {
347
+ ...(typeof attrs['aria-describedby'] === 'string' && {
348
+ describedby: attrs['aria-describedby'],
349
+ }),
350
+ feedback: props.feedback,
351
+ feedbackInvalid: props.feedbackInvalid,
352
+ feedbackValid: props.feedbackValid,
353
+ floatingClassName: props.floatingClassName,
354
+ floatingLabel: props.floatingLabel,
355
+ id: props.id,
356
+ invalid: props.invalid,
357
+ label: props.label,
358
+ text: props.text,
359
+ tooltipFeedback: props.tooltipFeedback,
360
+ valid: props.valid,
361
+ }, {
362
+ default: () => [
363
+ h('div', {
364
+ class: [
365
+ 'form-otp',
366
+ {
367
+ [`form-otp-${props.size}`]: props.size,
368
+ },
369
+ attrs.class,
370
+ ],
371
+ role: 'group',
372
+ ...attrs,
373
+ }, [
374
+ ...processedChildren,
375
+ h('input', {
376
+ type: 'hidden',
377
+ id: props.id,
378
+ name: props.name,
379
+ value: inputValues.value.join(''),
380
+ disabled: props.disabled,
381
+ ref: hiddenInputRef,
382
+ }),
383
+ ]),
384
+ ],
385
+ });
386
+ };
387
+ },
388
+ });
389
+
390
+ export { COneTimePassword };
391
+ //# sourceMappingURL=COneTimePassword.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"COneTimePassword.js","sources":["../../../../src/components/one-time-password-input/COneTimePassword.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;AAMA,MAAM,gBAAgB,GAAG,eAAe,CAAC;AACvC,IAAA,IAAI,EAAE,kBAAkB;AACxB,IAAA,YAAY,EAAE,KAAK;AACnB,IAAA,KAAK,EAAE;AACL;;AAEG;AACH,QAAA,SAAS,EAAE;AACT,YAAA,IAAI,EAAE,QAAQ;AACd,YAAA,OAAO,EAAE,CAAC,KAAa,EAAE,KAAa,KAAK,CAAA,MAAA,EAAS,KAAK,GAAG,CAAC,CAAA,IAAA,EAAO,KAAK,CAAA,CAAE;AAC5E,SAAA;AACD;;AAEG;AACH,QAAA,UAAU,EAAE;AACV,YAAA,IAAI,EAAE,OAAO;AACb,YAAA,OAAO,EAAE,KAAK;AACf,SAAA;AACD;;AAEG;AACH,QAAA,QAAQ,EAAE;AACR,YAAA,IAAI,EAAE,OAAO;AACb,YAAA,OAAO,EAAE,KAAK;AACf,SAAA;AACD;;AAEG;AACH,QAAA,YAAY,EAA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,wBAAA,GAAG,KAAK;qBACT,EACD;AACE,wBAAA,GAAG,iBAAiB;wBACpB,CAAC,CAAC,OAAO,EAAE;AACT,4BAAA,IAAI,EAAE,QAAQ;4BACd,EAAE,EAAE,KAAK,CAAC,EAAE;4BACZ,IAAI,EAAE,KAAK,CAAC,IAAI;4BAChB,KAAK,EAAE,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;4BACjC,QAAQ,EAAE,KAAK,CAAC,QAAQ;AACxB,4BAAA,GAAG,EAAE,cAAc;yBACpB,CAAC;qBACH,CACF;AACF,iBAAA;AACF,aAAA,CACF;AACH,QAAA,CAAC;IACH,CAAC;AACF,CAAA;;;;"}
@@ -0,0 +1,4 @@
1
+ declare const COneTimePasswordInput: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
2
+ [key: string]: any;
3
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
4
+ export { COneTimePasswordInput };
@@ -0,0 +1,17 @@
1
+ import { defineComponent, h } from 'vue';
2
+
3
+ const COneTimePasswordInput = defineComponent({
4
+ name: 'COneTimePasswordInput',
5
+ inheritAttrs: false,
6
+ setup(_, { attrs, slots }) {
7
+ return () => h('input', {
8
+ ...attrs,
9
+ class: ['form-otp-control', attrs.class],
10
+ maxlength: 1,
11
+ autocomplete: 'off',
12
+ }, slots.default && slots.default());
13
+ },
14
+ });
15
+
16
+ export { COneTimePasswordInput };
17
+ //# sourceMappingURL=COneTimePasswordInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"COneTimePasswordInput.js","sources":["../../../../src/components/one-time-password-input/COneTimePasswordInput.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAEA,MAAM,qBAAqB,GAAG,eAAe,CAAC;AAC5C,IAAA,IAAI,EAAE,uBAAuB;AAC7B,IAAA,YAAY,EAAE,KAAK;AACnB,IAAA,KAAK,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAA;AACvB,QAAA,OAAO,MACL,CAAC,CACC,OAAO,EACP;AACE,YAAA,GAAG,KAAK;AACR,YAAA,KAAK,EAAE,CAAC,kBAAkB,EAAE,KAAK,CAAC,KAAK,CAAC;AACxC,YAAA,SAAS,EAAE,CAAC;AACZ,YAAA,YAAY,EAAE,KAAK;SACpB,EACD,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,EAAE,CACjC;IACL,CAAC;AACF,CAAA;;;;"}
@@ -0,0 +1,3 @@
1
+ import { COneTimePassword } from './COneTimePassword';
2
+ import { COneTimePasswordInput } from './COneTimePasswordInput';
3
+ export { COneTimePassword, COneTimePasswordInput };
@@ -0,0 +1,2 @@
1
+ export declare const isValidInput: (value: string, type: "number" | "text") => boolean;
2
+ export declare const extractValidChars: (value: string, type: "number" | "text") => string;
@@ -0,0 +1,15 @@
1
+ const isValidInput = (value, type) => {
2
+ if (type === 'number') {
3
+ return /^\d$/.test(value);
4
+ }
5
+ return /^.$/u.test(value);
6
+ };
7
+ const extractValidChars = (value, type) => {
8
+ if (type === 'number') {
9
+ return value.replace(/\D/g, '');
10
+ }
11
+ return value;
12
+ };
13
+
14
+ export { extractValidChars, isValidInput };
15
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sources":["../../../../src/components/one-time-password-input/utils.ts"],"sourcesContent":[null],"names":[],"mappings":"MAAa,YAAY,GAAG,CAAC,KAAa,EAAE,IAAuB,KAAa;AAC9E,IAAA,IAAI,IAAI,KAAK,QAAQ,EAAE;AACrB,QAAA,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;IAC3B;AACA,IAAA,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;AAC3B;MAEa,iBAAiB,GAAG,CAAC,KAAa,EAAE,IAAuB,KAAY;AAClF,IAAA,IAAI,IAAI,KAAK,QAAQ,EAAE;QACrB,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;IACjC;AACA,IAAA,OAAO,KAAK;AACd;;;;"}
@@ -161,8 +161,8 @@ export declare const CStepper: import("vue").DefineComponent<import("vue").Extra
161
161
  onStepValidationComplete?: ((...args: any[]) => any) | undefined;
162
162
  }>, {
163
163
  layout: "horizontal" | "vertical";
164
- activeStepNumber: number;
165
164
  linear: boolean;
165
+ activeStepNumber: number;
166
166
  stepButtonLayout: "horizontal" | "vertical";
167
167
  validation: boolean;
168
168
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
package/dist/esm/index.js CHANGED
@@ -135,6 +135,8 @@ export { COffcanvas } from './components/offcanvas/COffcanvas.js';
135
135
  export { COffcanvasBody } from './components/offcanvas/COffcanvasBody.js';
136
136
  export { COffcanvasHeader } from './components/offcanvas/COffcanvasHeader.js';
137
137
  export { COffcanvasTitle } from './components/offcanvas/COffcanvasTitle.js';
138
+ export { COneTimePassword } from './components/one-time-password-input/COneTimePassword.js';
139
+ export { COneTimePasswordInput } from './components/one-time-password-input/COneTimePasswordInput.js';
138
140
  export { CPasswordInput } from './components/password-input/CPasswordInput.js';
139
141
  export { CPasswordInputPlugin } from './components/password-input/index.js';
140
142
  export { CPaginationPlugin } from './components/pagination/index.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":[null],"names":["Components","Directives"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,MAAM,SAAS,GAAG;AAChB,IAAA,OAAO,EAAE,CAAC,GAAQ,KAAU;AAC1B,QAAA,KAAK,MAAM,GAAG,IAAIA,KAAU,EAAE;YAC5B,GAAG,CAAC,SAAS,CAAC,GAAG,EAAGA,KAAqC,CAAC,GAAG,CAAC,CAAC;QACjE;AAEA,QAAA,KAAK,MAAM,GAAG,IAAIC,OAAU,EAAE;AAC5B,YAAA,GAAG,CAAC,SAAS,CACVA,OAAqC,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,EAClDA,OAAqC,CAAC,GAAG,CAAC,CAC5C;QACH;IACF,CAAC;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":[null],"names":["Components","Directives"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,MAAM,SAAS,GAAG;AAChB,IAAA,OAAO,EAAE,CAAC,GAAQ,KAAU;AAC1B,QAAA,KAAK,MAAM,GAAG,IAAIA,KAAU,EAAE;YAC5B,GAAG,CAAC,SAAS,CAAC,GAAG,EAAGA,KAAqC,CAAC,GAAG,CAAC,CAAC;QACjE;AAEA,QAAA,KAAK,MAAM,GAAG,IAAIC,OAAU,EAAE;AAC5B,YAAA,GAAG,CAAC,SAAS,CACVA,OAAqC,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,EAClDA,OAAqC,CAAC,GAAG,CAAC,CAC5C;QACH;IACF,CAAC;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coreui/vue-pro",
3
- "version": "5.16.0",
3
+ "version": "5.17.1",
4
4
  "description": "UI Components Library for Vue.js",
5
5
  "keywords": [
6
6
  "vue",
@@ -51,14 +51,14 @@
51
51
  "@types/jest": "^29.5.14",
52
52
  "@vue/test-utils": "^2.4.6",
53
53
  "@vue/vue3-jest": "29.2.6",
54
- "cross-env": "^10.0.0",
54
+ "cross-env": "^10.1.0",
55
55
  "jest": "^29.7.0",
56
56
  "jest-environment-jsdom": "^29.7.0",
57
- "rollup": "^4.50.2",
57
+ "rollup": "^4.52.3",
58
58
  "rollup-plugin-vue": "^6.0.0",
59
- "ts-jest": "^29.4.2",
60
- "typescript": "^5.9.2",
61
- "vue": "^3.5.21",
59
+ "ts-jest": "^29.4.4",
60
+ "typescript": "^5.9.3",
61
+ "vue": "^3.5.22",
62
62
  "vue-types": "^6.0.0"
63
63
  },
64
64
  "peerDependencies": {
@@ -785,22 +785,23 @@ const CAutocomplete = defineComponent({
785
785
  handleClear()
786
786
  },
787
787
  }),
788
- h('button', {
789
- type: 'button',
790
- class: 'autocomplete-indicator',
791
- disabled:
792
- !(props.searchNoResultsLabel || filteredOptions.value.length > 0) &&
793
- !isExternalSearch(props.search),
794
- onClick: (event: Event) => {
795
- event.preventDefault()
796
- event.stopPropagation()
797
- if (visible.value) {
798
- handleDropdownHide()
799
- } else {
800
- handleDropdownShow()
801
- }
802
- },
803
- }),
788
+ props.indicator &&
789
+ h('button', {
790
+ type: 'button',
791
+ class: 'autocomplete-indicator',
792
+ disabled:
793
+ !(props.searchNoResultsLabel || filteredOptions.value.length > 0) &&
794
+ !isExternalSearch(props.search),
795
+ onClick: (event: Event) => {
796
+ event.preventDefault()
797
+ event.stopPropagation()
798
+ if (visible.value) {
799
+ handleDropdownHide()
800
+ } else {
801
+ handleDropdownShow()
802
+ }
803
+ },
804
+ }),
804
805
  ]),
805
806
  ]
806
807
  ),
@@ -402,6 +402,22 @@ const createDateOnly = (groups: DateOnlyGroups): Date | null => {
402
402
  return new Date(parsedYear, parsedMonth, parsedDay)
403
403
  }
404
404
 
405
+ /**
406
+ * Helper function to determine expected parts count from patterns.
407
+ * @param patterns - Array of date format patterns.
408
+ * @returns Expected number of parts for a complete date.
409
+ */
410
+ const getExpectedPartsCount = (patterns: string[]): number => {
411
+ if (patterns.length === 0) {
412
+ return 3
413
+ }
414
+
415
+ // Analyze the first pattern to determine expected parts count
416
+ const firstPattern = patterns[0]
417
+ const parts = firstPattern.split(/[-/.\s:]+/).filter((part) => part.length > 0)
418
+ return parts.length
419
+ }
420
+
405
421
  /**
406
422
  * Enhanced day parsing with locale-aware patterns.
407
423
  * @param dateString - The day string to parse.
@@ -415,24 +431,23 @@ const parseDayString = (dateString: string, locale: string, includeTime: boolean
415
431
 
416
432
  if (!groups) {
417
433
  // Check if input looks like a complete date (has separators and multiple parts)
418
- // If so, use fallback parsing for formats like "2022/08/17", "2022-08-17"
419
- // If not (like "1", "12"), return null
420
434
  const trimmed = dateString.trim()
421
435
  const hasDateSeparators = /[-/.:]/.test(trimmed)
422
436
  const parts = trimmed.split(/[-/.\s:]+/).filter((part) => part.length > 0)
423
- const hasMultipleParts = parts.length >= 2
437
+ const expectedPartsCount = getExpectedPartsCount(patterns)
438
+ const hasRequiredParts = parts.length >= expectedPartsCount
424
439
 
425
- if (hasDateSeparators && hasMultipleParts) {
440
+ if (hasDateSeparators && hasRequiredParts) {
426
441
  // Use fallback for complete date strings that don't match locale patterns
427
442
  return parseLocalDateString(dateString)
428
443
  }
429
444
 
430
- // For incomplete input like "1" or "12", return null
445
+ // For incomplete input return null
431
446
  return null
432
447
  }
433
448
 
434
- // For day selection, require at least month and day to be present
435
- if ('month' in groups && 'day' in groups) {
449
+ // For day selection, require at least year, month, and day to be present
450
+ if ('year' in groups && 'month' in groups && 'day' in groups) {
436
451
  const { month, day } = groups
437
452
  if (!validateDateComponents(month, day)) {
438
453
  return null
@@ -32,6 +32,7 @@ export * from './multi-select'
32
32
  export * from './nav'
33
33
  export * from './navbar'
34
34
  export * from './offcanvas'
35
+ export * from './one-time-password-input'
35
36
  export * from './password-input'
36
37
  export * from './pagination'
37
38
  export * from './picker'