@coreui/react-pro 5.22.0 → 5.23.0

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 (40) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/components/autocomplete/CAutocomplete.js +2 -2
  3. package/dist/cjs/components/autocomplete/CAutocomplete.js.map +1 -1
  4. package/dist/cjs/components/index.d.ts +1 -0
  5. package/dist/cjs/components/one-time-password-input/COneTimePassword.d.ts +73 -0
  6. package/dist/cjs/components/one-time-password-input/COneTimePassword.js +178 -0
  7. package/dist/cjs/components/one-time-password-input/COneTimePassword.js.map +1 -0
  8. package/dist/cjs/components/one-time-password-input/COneTimePasswordInput.d.ts +8 -0
  9. package/dist/cjs/components/one-time-password-input/COneTimePasswordInput.js +14 -0
  10. package/dist/cjs/components/one-time-password-input/COneTimePasswordInput.js.map +1 -0
  11. package/dist/cjs/components/one-time-password-input/index.d.ts +5 -0
  12. package/dist/cjs/components/one-time-password-input/utils.d.ts +2 -0
  13. package/dist/cjs/components/one-time-password-input/utils.js +28 -0
  14. package/dist/cjs/components/one-time-password-input/utils.js.map +1 -0
  15. package/dist/cjs/index.js +4 -0
  16. package/dist/cjs/index.js.map +1 -1
  17. package/dist/esm/components/autocomplete/CAutocomplete.js +2 -2
  18. package/dist/esm/components/autocomplete/CAutocomplete.js.map +1 -1
  19. package/dist/esm/components/index.d.ts +1 -0
  20. package/dist/esm/components/one-time-password-input/COneTimePassword.d.ts +73 -0
  21. package/dist/esm/components/one-time-password-input/COneTimePassword.js +176 -0
  22. package/dist/esm/components/one-time-password-input/COneTimePassword.js.map +1 -0
  23. package/dist/esm/components/one-time-password-input/COneTimePasswordInput.d.ts +8 -0
  24. package/dist/esm/components/one-time-password-input/COneTimePasswordInput.js +12 -0
  25. package/dist/esm/components/one-time-password-input/COneTimePasswordInput.js.map +1 -0
  26. package/dist/esm/components/one-time-password-input/index.d.ts +5 -0
  27. package/dist/esm/components/one-time-password-input/utils.d.ts +2 -0
  28. package/dist/esm/components/one-time-password-input/utils.js +25 -0
  29. package/dist/esm/components/one-time-password-input/utils.js.map +1 -0
  30. package/dist/esm/index.js +2 -0
  31. package/dist/esm/index.js.map +1 -1
  32. package/package.json +9 -9
  33. package/src/components/autocomplete/CAutocomplete.tsx +18 -16
  34. package/src/components/index.ts +1 -0
  35. package/src/components/one-time-password-input/COneTimePassword.tsx +462 -0
  36. package/src/components/one-time-password-input/COneTimePasswordInput.tsx +25 -0
  37. package/src/components/one-time-password-input/__tests__/COneTimePassword.spec.tsx +361 -0
  38. package/src/components/one-time-password-input/__tests__/__snapshots__/COneTimePassword.spec.tsx.snap +130 -0
  39. package/src/components/one-time-password-input/index.ts +6 -0
  40. package/src/components/one-time-password-input/utils.ts +23 -0
@@ -0,0 +1,73 @@
1
+ import React, { HTMLAttributes } from 'react';
2
+ import { CFormControlWrapperProps } from '../form/CFormControlWrapper';
3
+ export interface COneTimePasswordProps extends CFormControlWrapperProps, Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
4
+ /**
5
+ * Function to generate aria-label for each input field. Receives current index (0-based) and total number of inputs.
6
+ */
7
+ ariaLabel?: (index: number, total: number) => string;
8
+ /**
9
+ * Automatically submit the form when all one time password fields are filled.
10
+ */
11
+ autoSubmit?: boolean;
12
+ /**
13
+ * A string of all className you want applied to the React.js OTP component.
14
+ */
15
+ className?: string;
16
+ /**
17
+ * Initial value for uncontrolled React.js one time password input.
18
+ */
19
+ defaultValue?: string | number;
20
+ /**
21
+ * Disable all one time password (OTP) input fields.
22
+ */
23
+ disabled?: boolean;
24
+ /**
25
+ * ID attribute for the hidden input field.
26
+ */
27
+ id?: string;
28
+ /**
29
+ * Enforce sequential input (users must fill fields in order).
30
+ */
31
+ linear?: boolean;
32
+ /**
33
+ * Show input as password (masked characters).
34
+ */
35
+ masked?: boolean;
36
+ /**
37
+ * Name attribute for the hidden input field.
38
+ */
39
+ name?: string;
40
+ /**
41
+ * Callback triggered when the React.js one time password (OTP) value changes.
42
+ */
43
+ onChange?: (value: string) => void;
44
+ /**
45
+ * Callback triggered when all React.js one time password (OTP) fields are filled.
46
+ */
47
+ onComplete?: (value: string) => void;
48
+ /**
49
+ * Placeholder text for input fields. Single character applies to all fields, longer strings apply character-by-character.
50
+ */
51
+ placeholder?: string;
52
+ /**
53
+ * Make React.js OTP input component read-only.
54
+ */
55
+ readOnly?: boolean;
56
+ /**
57
+ * Makes the input field required for form validation.
58
+ */
59
+ required?: boolean;
60
+ /**
61
+ * Sets the visual size of the React.js one time password (OTP) input. Use 'sm' for small or 'lg' for large input fields.
62
+ */
63
+ size?: 'sm' | 'lg';
64
+ /**
65
+ * Input validation type: 'number' for digits only, or 'text' for free text.
66
+ */
67
+ type?: 'number' | 'text';
68
+ /**
69
+ * Current value for controlled OTP input.
70
+ */
71
+ value?: string | number;
72
+ }
73
+ export declare const COneTimePassword: React.ForwardRefExoticComponent<COneTimePasswordProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,176 @@
1
+ import { __rest } from '../../node_modules/tslib/tslib.es6.js';
2
+ import React, { forwardRef, useRef, useMemo, Children, useState, useEffect, useCallback, isValidElement, cloneElement } from 'react';
3
+ import PropTypes from 'prop-types';
4
+ import classNames from '../../_virtual/index.js';
5
+ import { CFormControlWrapper } from '../form/CFormControlWrapper.js';
6
+ import { isValidInput, extractValidChars } from './utils.js';
7
+ import getNextActiveElement from '../../utils/getNextActiveElement.js';
8
+ import isRTL from '../../utils/isRTL.js';
9
+
10
+ const COneTimePassword = forwardRef((_a, ref) => {
11
+ var { ariaLabel = (index, total) => `Digit ${index + 1} of ${total}`, autoSubmit = false, children, className, defaultValue, disabled = false, feedback, feedbackInvalid, feedbackValid, floatingClassName, floatingLabel, id, invalid, label, linear = true, masked = false, name, onChange, onComplete, placeholder, readOnly = false, required = false, size, text, tooltipFeedback, type = 'number', valid, value } = _a, rest = __rest(_a, ["ariaLabel", "autoSubmit", "children", "className", "defaultValue", "disabled", "feedback", "feedbackInvalid", "feedbackValid", "floatingClassName", "floatingLabel", "id", "invalid", "label", "linear", "masked", "name", "onChange", "onComplete", "placeholder", "readOnly", "required", "size", "text", "tooltipFeedback", "type", "valid", "value"]);
12
+ const inputRefs = useRef([]);
13
+ const hiddenInputRef = useRef(null);
14
+ // Count valid OTP input children
15
+ const inputCount = useMemo(() => {
16
+ return Children.count(children);
17
+ }, [children]);
18
+ const [inputValues, setInputValues] = useState(() => {
19
+ var _a;
20
+ const initialValue = String((_a = value !== null && value !== void 0 ? value : defaultValue) !== null && _a !== void 0 ? _a : '');
21
+ return Array.from({ length: inputCount }, (_, i) => initialValue[i] || '');
22
+ });
23
+ // Update input values when value prop changes (controlled mode)
24
+ useEffect(() => {
25
+ if (value !== undefined) {
26
+ const valueString = String(value);
27
+ setInputValues(Array.from({ length: inputCount }, (_, i) => valueString[i] || ''));
28
+ }
29
+ }, [value, inputCount]);
30
+ // Update hidden input and trigger events
31
+ const updateValue = useCallback((newValues) => {
32
+ var _a;
33
+ const newValue = newValues.join('');
34
+ if (hiddenInputRef.current) {
35
+ hiddenInputRef.current.value = newValue;
36
+ }
37
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
38
+ if (newValue.length === inputCount) {
39
+ onComplete === null || onComplete === void 0 ? void 0 : onComplete(newValue);
40
+ if (autoSubmit) {
41
+ const form = (_a = hiddenInputRef.current) === null || _a === void 0 ? void 0 : _a.closest('form');
42
+ if (form && typeof form.requestSubmit === 'function') {
43
+ form.requestSubmit();
44
+ }
45
+ }
46
+ }
47
+ }, [autoSubmit, onChange, onComplete, inputCount]);
48
+ const handleInputChange = useCallback((index, event) => {
49
+ const inputValue = event.target.value;
50
+ if (inputValue.length === 1 && !isValidInput(inputValue, type)) {
51
+ return;
52
+ }
53
+ const newValues = [...inputValues];
54
+ newValues[index] = inputValue.length === 1 ? inputValue : '';
55
+ setInputValues(newValues);
56
+ updateValue(newValues);
57
+ if (inputValue.length === 1) {
58
+ const nextInput = getNextActiveElement(inputRefs.current, event.target, true, false);
59
+ nextInput === null || nextInput === void 0 ? void 0 : nextInput.focus();
60
+ }
61
+ }, [inputValues, type, updateValue]);
62
+ const handleInputFocus = useCallback((event) => {
63
+ const { target } = event;
64
+ if (target.value) {
65
+ setTimeout(() => {
66
+ target.select();
67
+ }, 0);
68
+ return;
69
+ }
70
+ if (linear) {
71
+ const firstEmptyInput = inputRefs.current.find((input) => !(input === null || input === void 0 ? void 0 : input.value));
72
+ if (firstEmptyInput && firstEmptyInput !== target) {
73
+ firstEmptyInput.focus();
74
+ }
75
+ }
76
+ }, [linear]);
77
+ const handleKeyDown = useCallback((event) => {
78
+ const { key, target } = event;
79
+ if (key === 'Backspace' && target.value === '') {
80
+ const newValues = [...inputValues];
81
+ const prevInput = getNextActiveElement(inputRefs.current, target, false, false);
82
+ if (prevInput) {
83
+ const prevIndex = inputRefs.current.indexOf(prevInput);
84
+ if (prevIndex !== -1) {
85
+ newValues[prevIndex] = '';
86
+ setInputValues(newValues);
87
+ updateValue(newValues);
88
+ prevInput.focus();
89
+ }
90
+ }
91
+ return;
92
+ }
93
+ if (key === 'ArrowRight') {
94
+ if (linear && target.value === '') {
95
+ return;
96
+ }
97
+ const shouldMoveNext = !isRTL(target);
98
+ const nextInput = getNextActiveElement(inputRefs.current, target, shouldMoveNext, false);
99
+ nextInput === null || nextInput === void 0 ? void 0 : nextInput.focus();
100
+ return;
101
+ }
102
+ if (key === 'ArrowLeft') {
103
+ const shouldMoveNext = isRTL(target);
104
+ const prevInput = getNextActiveElement(inputRefs.current, target, shouldMoveNext, false);
105
+ prevInput === null || prevInput === void 0 ? void 0 : prevInput.focus();
106
+ }
107
+ }, [inputValues, linear, updateValue]);
108
+ const handlePaste = useCallback((index, event) => {
109
+ var _a, _b;
110
+ event.preventDefault();
111
+ const pastedData = event.clipboardData.getData('text');
112
+ const validChars = extractValidChars(pastedData, type);
113
+ if (!validChars)
114
+ return;
115
+ const newValues = [...inputValues];
116
+ const startIndex = index;
117
+ for (let i = 0; i < validChars.length && startIndex + i < inputCount; i++) {
118
+ newValues[startIndex + i] = validChars[i];
119
+ }
120
+ setInputValues(newValues);
121
+ updateValue(newValues);
122
+ // Focus the next empty input or the last filled input
123
+ const nextEmptyIndex = startIndex + validChars.length;
124
+ if (nextEmptyIndex < inputCount) {
125
+ (_a = inputRefs.current[nextEmptyIndex]) === null || _a === void 0 ? void 0 : _a.focus();
126
+ }
127
+ else {
128
+ (_b = inputRefs.current.at(-1)) === null || _b === void 0 ? void 0 : _b.focus();
129
+ }
130
+ }, [inputValues, type, updateValue, inputCount]);
131
+ let inputIndex = 0;
132
+ return (React.createElement(CFormControlWrapper, { describedby: rest['aria-describedby'], feedback: feedback, feedbackInvalid: feedbackInvalid, feedbackValid: feedbackValid, floatingClassName: floatingClassName, floatingLabel: floatingLabel, id: id, invalid: invalid, label: label, text: text, tooltipFeedback: tooltipFeedback, valid: valid },
133
+ React.createElement("div", Object.assign({ className: classNames('form-otp', {
134
+ [`form-otp-${size}`]: size,
135
+ }, className), role: "group", ref: ref }, rest),
136
+ Children.map(children, (child, index) => {
137
+ var _a;
138
+ if (!isValidElement(child) ||
139
+ ((_a = child.type) === null || _a === void 0 ? void 0 : _a.displayName) !== 'COneTimePasswordInput') {
140
+ return child;
141
+ }
142
+ const inputChild = child;
143
+ const currentInputIndex = inputIndex++;
144
+ return cloneElement(inputChild, Object.assign(Object.assign({}, inputChild.props), { type: masked ? 'password' : 'text', className: classNames({
145
+ 'is-invalid': invalid,
146
+ 'is-valid': valid,
147
+ }, inputChild.props.className), id: inputChild.props.id || (id ? `${id}-${currentInputIndex}` : undefined), name: inputChild.props.name || (name ? `${name}-${currentInputIndex}` : undefined), placeholder: inputChild.props.placeholder ||
148
+ (placeholder && placeholder.length > 1
149
+ ? placeholder[currentInputIndex]
150
+ : placeholder), value: inputValues[currentInputIndex] || '', tabIndex: currentInputIndex === 0 ? 0 : inputValues[currentInputIndex - 1] ? 0 : -1, disabled: disabled || inputChild.props.disabled, readOnly: readOnly || inputChild.props.readOnly, required: required || inputChild.props.required, 'aria-label': inputChild.props['aria-label'] || ariaLabel(currentInputIndex, inputCount), inputMode: type === 'number' ? 'numeric' : 'text', pattern: type === 'number' ? '[0-9]*' : '.*', onInput: (event) => {
151
+ var _a, _b;
152
+ handleInputChange(currentInputIndex, event);
153
+ (_b = (_a = inputChild.props).onChange) === null || _b === void 0 ? void 0 : _b.call(_a, event);
154
+ }, onFocus: (event) => {
155
+ var _a, _b;
156
+ handleInputFocus(event);
157
+ (_b = (_a = inputChild.props).onFocus) === null || _b === void 0 ? void 0 : _b.call(_a, event);
158
+ }, onKeyDown: (event) => {
159
+ var _a, _b;
160
+ handleKeyDown(currentInputIndex, event);
161
+ (_b = (_a = inputChild.props).onKeyDown) === null || _b === void 0 ? void 0 : _b.call(_a, event);
162
+ }, onPaste: (event) => {
163
+ var _a, _b;
164
+ handlePaste(index, event);
165
+ (_b = (_a = inputChild.props).onPaste) === null || _b === void 0 ? void 0 : _b.call(_a, event);
166
+ }, ref: (el) => {
167
+ inputRefs.current[currentInputIndex] = el;
168
+ } }));
169
+ }),
170
+ React.createElement("input", { type: "hidden", id: id, name: name, value: inputValues.join(''), disabled: disabled, ref: hiddenInputRef }))));
171
+ });
172
+ COneTimePassword.propTypes = Object.assign({ ariaLabel: PropTypes.func, autoSubmit: PropTypes.bool, children: PropTypes.node, className: PropTypes.string, defaultValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), disabled: PropTypes.bool, id: PropTypes.string, linear: PropTypes.bool, masked: PropTypes.bool, name: PropTypes.string, onChange: PropTypes.func, onComplete: PropTypes.func, placeholder: PropTypes.string, readOnly: PropTypes.bool, required: PropTypes.bool, size: PropTypes.oneOf(['sm', 'lg']), type: PropTypes.oneOf(['number', 'text']), value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]) }, CFormControlWrapper.propTypes);
173
+ COneTimePassword.displayName = 'COneTimePassword';
174
+
175
+ export { COneTimePassword };
176
+ //# sourceMappingURL=COneTimePassword.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"COneTimePassword.js","sources":["../../../../src/components/one-time-password-input/COneTimePassword.tsx"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;AAuHO,MAAM,gBAAgB,GAAG,UAAU,CACxC,CACE,EA8BC,EACD,GAAG,KACD;AAhCF,IAAA,IAAA,EACE,SAAS,GAAG,CAAC,KAAa,EAAE,KAAa,KAAK,SAAS,KAAK,GAAG,CAAC,CAAA,IAAA,EAAO,KAAK,EAAE,EAC9E,UAAU,GAAG,KAAK,EAClB,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,QAAQ,GAAG,KAAK,EAChB,QAAQ,EACR,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,EAAE,EACF,OAAO,EACP,KAAK,EACL,MAAM,GAAG,IAAI,EACb,MAAM,GAAG,KAAK,EACd,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,WAAW,EACX,QAAQ,GAAG,KAAK,EAChB,QAAQ,GAAG,KAAK,EAChB,IAAI,EACJ,IAAI,EACJ,eAAe,EACf,IAAI,GAAG,QAAQ,EACf,KAAK,EACL,KAAK,EAAA,GAAA,EAEN,EADI,IAAI,GAAA,MAAA,CAAA,EAAA,EA7BT,0VA8BC,CADQ;AAIT,IAAA,MAAM,SAAS,GAAG,MAAM,CAA8B,EAAE,CAAC;AACzD,IAAA,MAAM,cAAc,GAAG,MAAM,CAAmB,IAAI,CAAC;;AAGrD,IAAA,MAAM,UAAU,GAAG,OAAO,CAAC,MAAK;AAC9B,QAAA,OAAO,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC;AACjC,IAAA,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;IAEd,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAW,MAAK;;AAC5D,QAAA,MAAM,YAAY,GAAG,MAAM,CAAC,MAAA,KAAK,KAAA,IAAA,IAAL,KAAK,KAAA,MAAA,GAAL,KAAK,G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B,IAAI,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,EACnC,IAAI,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,EACzC,KAAK,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,EAAA,EAC7D,mBAAmB,CAAC,SAAS,CACjC;AAED,gBAAgB,CAAC,WAAW,GAAG,kBAAkB;;;;"}
@@ -0,0 +1,8 @@
1
+ import React, { InputHTMLAttributes } from 'react';
2
+ export interface COneTimePasswordInputProps extends InputHTMLAttributes<HTMLInputElement> {
3
+ /**
4
+ * A string of all className you want applied to the component.
5
+ */
6
+ className?: string;
7
+ }
8
+ export declare const COneTimePasswordInput: React.ForwardRefExoticComponent<COneTimePasswordInputProps & React.RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,12 @@
1
+ import { __rest } from '../../node_modules/tslib/tslib.es6.js';
2
+ import React, { forwardRef } from 'react';
3
+ import classNames from '../../_virtual/index.js';
4
+
5
+ const COneTimePasswordInput = forwardRef((_a, ref) => {
6
+ var { className } = _a, rest = __rest(_a, ["className"]);
7
+ return (React.createElement("input", Object.assign({ className: classNames('form-otp-control', className), maxLength: 1, autoComplete: "off", ref: ref }, rest)));
8
+ });
9
+ COneTimePasswordInput.displayName = 'COneTimePasswordInput';
10
+
11
+ export { COneTimePasswordInput };
12
+ //# sourceMappingURL=COneTimePasswordInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"COneTimePasswordInput.js","sources":["../../../../src/components/one-time-password-input/COneTimePasswordInput.tsx"],"sourcesContent":[null],"names":[],"mappings":";;;;AAUO,MAAM,qBAAqB,GAAG,UAAU,CAC7C,CAAC,EAAsB,EAAE,GAAG,KAAI;AAA/B,IAAA,IAAA,EAAE,SAAS,EAAA,GAAA,EAAW,EAAN,IAAI,GAAA,MAAA,CAAA,EAAA,EAApB,aAAsB,CAAF;IACnB,QACE,KAAA,CAAA,aAAA,CAAA,OAAA,EAAA,MAAA,CAAA,MAAA,CAAA,EACE,SAAS,EAAE,UAAU,CAAC,kBAAkB,EAAE,SAAS,CAAC,EACpD,SAAS,EAAE,CAAC,EACZ,YAAY,EAAC,KAAK,EAClB,GAAG,EAAE,GAAG,EAAA,EACJ,IAAI,CAAA,CACR;AAEN,CAAC;AAGH,qBAAqB,CAAC,WAAW,GAAG,uBAAuB;;;;"}
@@ -0,0 +1,5 @@
1
+ import { COneTimePassword } from './COneTimePassword';
2
+ import { COneTimePasswordInput } from './COneTimePasswordInput';
3
+ export { COneTimePassword, COneTimePasswordInput };
4
+ export type { COneTimePasswordProps } from './COneTimePassword';
5
+ export type { COneTimePasswordInputProps } from './COneTimePasswordInput';
@@ -0,0 +1,2 @@
1
+ export declare const isValidInput: (inputValue: string, type: "number" | "text") => boolean;
2
+ export declare const extractValidChars: (text: string, type: "number" | "text") => string;
@@ -0,0 +1,25 @@
1
+ const isValidInput = (inputValue, type) => {
2
+ if (inputValue.length !== 1)
3
+ return false;
4
+ switch (type) {
5
+ case 'number': {
6
+ return /^\d$/.test(inputValue);
7
+ }
8
+ default: {
9
+ return /^.$/.test(inputValue);
10
+ }
11
+ }
12
+ };
13
+ const extractValidChars = (text, type) => {
14
+ switch (type) {
15
+ case 'number': {
16
+ return text.replaceAll(/\D/g, '');
17
+ }
18
+ default: {
19
+ return text;
20
+ }
21
+ }
22
+ };
23
+
24
+ export { extractValidChars, isValidInput };
25
+ //# 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,UAAkB,EAAE,IAAuB,KAAa;AACnF,IAAA,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC;AAAE,QAAA,OAAO,KAAK;IAEzC,QAAQ,IAAI;QACV,KAAK,QAAQ,EAAE;AACb,YAAA,OAAO,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC;QAChC;QACA,SAAS;AACP,YAAA,OAAO,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC;QAC/B;;AAEJ;MAEa,iBAAiB,GAAG,CAAC,IAAY,EAAE,IAAuB,KAAY;IACjF,QAAQ,IAAI;QACV,KAAK,QAAQ,EAAE;YACb,OAAO,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,EAAE,CAAC;QACnC;QACA,SAAS;AACP,YAAA,OAAO,IAAI;QACb;;AAEJ;;;;"}
package/dist/esm/index.js CHANGED
@@ -98,6 +98,8 @@ export { COffcanvas } from './components/offcanvas/COffcanvas.js';
98
98
  export { COffcanvasBody } from './components/offcanvas/COffcanvasBody.js';
99
99
  export { COffcanvasHeader } from './components/offcanvas/COffcanvasHeader.js';
100
100
  export { COffcanvasTitle } from './components/offcanvas/COffcanvasTitle.js';
101
+ export { COneTimePassword } from './components/one-time-password-input/COneTimePassword.js';
102
+ export { COneTimePasswordInput } from './components/one-time-password-input/COneTimePasswordInput.js';
101
103
  export { CPasswordInput } from './components/password-input/CPasswordInput.js';
102
104
  export { CPagination } from './components/pagination/CPagination.js';
103
105
  export { CPaginationItem } from './components/pagination/CPaginationItem.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coreui/react-pro",
3
- "version": "5.22.0",
3
+ "version": "5.23.0",
4
4
  "description": "UI Components Library for React.js",
5
5
  "keywords": [
6
6
  "react",
@@ -41,7 +41,7 @@
41
41
  "test:update": "jest --coverage --updateSnapshot"
42
42
  },
43
43
  "dependencies": {
44
- "@coreui/coreui-pro": "^5.20.0",
44
+ "@coreui/coreui-pro": "^5.21.0",
45
45
  "@popperjs/core": "^2.11.8",
46
46
  "prop-types": "^15.8.1"
47
47
  },
@@ -50,25 +50,25 @@
50
50
  "@rollup/plugin-node-resolve": "^16.0.1",
51
51
  "@rollup/plugin-typescript": "^12.1.4",
52
52
  "@testing-library/dom": "^10.4.1",
53
- "@testing-library/jest-dom": "^6.8.0",
53
+ "@testing-library/jest-dom": "^6.9.1",
54
54
  "@testing-library/react": "^16.3.0",
55
55
  "@types/jest": "^29.5.14",
56
56
  "@types/prop-types": "15.7.15",
57
- "@types/react": "^19.1.13",
58
- "@types/react-dom": "^19.1.9",
57
+ "@types/react": "^19.2.0",
58
+ "@types/react-dom": "^19.2.0",
59
59
  "@types/react-transition-group": "^4.4.12",
60
60
  "classnames": "^2.5.1",
61
- "cross-env": "^10.0.0",
61
+ "cross-env": "^10.1.0",
62
62
  "jest": "^29.7.0",
63
63
  "jest-environment-jsdom": "^29.7.0",
64
64
  "react": "^18.3.1",
65
65
  "react-device-detect": "^2.2.3",
66
66
  "react-dom": "^18.3.1",
67
67
  "react-transition-group": "^4.4.5",
68
- "rollup": "^4.50.2",
69
- "ts-jest": "^29.4.2",
68
+ "rollup": "^4.52.3",
69
+ "ts-jest": "^29.4.4",
70
70
  "tslib": "^2.8.1",
71
- "typescript": "^5.9.2"
71
+ "typescript": "^5.9.3"
72
72
  },
73
73
  "peerDependencies": {
74
74
  "react": ">=17",
@@ -749,23 +749,25 @@ export const CAutocomplete = forwardRef<HTMLDivElement, CAutocompleteProps>(
749
749
  }}
750
750
  ></button>
751
751
  )}
752
- <button
753
- type="button"
754
- className="autocomplete-indicator"
755
- disabled={
756
- !(searchNoResultsLabel || filteredOptions.length > 0) &&
757
- isExternalSearch(search)
758
- }
759
- onClick={(event) => {
760
- event.preventDefault()
761
- event.stopPropagation()
762
- if (_visible) {
763
- handleDropdownHide()
764
- } else {
765
- handleDropdownShow()
752
+ {indicator && (
753
+ <button
754
+ type="button"
755
+ className="autocomplete-indicator"
756
+ disabled={
757
+ !(searchNoResultsLabel || filteredOptions.length > 0) &&
758
+ isExternalSearch(search)
766
759
  }
767
- }}
768
- ></button>
760
+ onClick={(event) => {
761
+ event.preventDefault()
762
+ event.stopPropagation()
763
+ if (_visible) {
764
+ handleDropdownHide()
765
+ } else {
766
+ handleDropdownShow()
767
+ }
768
+ }}
769
+ ></button>
770
+ )}
769
771
  </div>
770
772
  )}
771
773
  </div>
@@ -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 './placeholder'