@scbt-ecom/ui 0.19.2 → 0.19.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.
- package/dist/mergeRefs-qDToYXtM.js +12 -0
- package/dist/mergeRefs-qDToYXtM.js.map +1 -0
- package/dist/shared/ui/formElements/uncontrolled/maskInput/MaskInput.d.ts +3 -3
- package/dist/ui.js +2454 -2462
- package/dist/ui.js.map +1 -1
- package/dist/utils.js +10 -16
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const o = (...f) => {
|
|
2
|
+
const r = f.filter(Boolean);
|
|
3
|
+
return r.length <= 1 ? r[0] || null : function(t) {
|
|
4
|
+
r.forEach((e) => {
|
|
5
|
+
typeof e == "function" ? e(t) : e && (e.current = t);
|
|
6
|
+
});
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
o as m
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=mergeRefs-qDToYXtM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mergeRefs-qDToYXtM.js","sources":["../lib/shared/utils/mergeRefs.ts"],"sourcesContent":["import type React from 'react'\n\nexport const mergeRefs = <T>(...inputRefs: (React.Ref<T> | undefined)[]): React.Ref<T> | React.RefCallback<T> => {\n const filteredInputRefs = inputRefs.filter(Boolean)\n\n if (filteredInputRefs.length <= 1) {\n const firstRef = filteredInputRefs[0]\n\n return firstRef || null\n }\n\n return function mergedRefs(ref) {\n filteredInputRefs.forEach((inputRef) => {\n if (typeof inputRef === 'function') {\n inputRef(ref)\n } else if (inputRef) {\n ;(inputRef as React.MutableRefObject<T | null>).current = ref\n }\n })\n }\n}\n"],"names":["mergeRefs","inputRefs","filteredInputRefs","ref","inputRef"],"mappings":"AAEa,MAAAA,IAAY,IAAOC,MAAiF;AACzG,QAAAC,IAAoBD,EAAU,OAAO,OAAO;AAE9C,SAAAC,EAAkB,UAAU,IACbA,EAAkB,CAAC,KAEjB,OAGd,SAAoBC,GAAK;AACZ,IAAAD,EAAA,QAAQ,CAACE,MAAa;AAClC,MAAA,OAAOA,KAAa,aACtBA,EAASD,CAAG,IACHC,MACPA,EAA8C,UAAUD;AAAA,IAC5D,CACD;AAAA,EACH;AACF;"}
|
|
@@ -22,9 +22,9 @@ export type MaskInputProps = InputBaseProps & {
|
|
|
22
22
|
/**
|
|
23
23
|
* Компонент маски очень умный, умеет обрабатывать специальные символы
|
|
24
24
|
* в том порядке, который определён маской
|
|
25
|
-
* @typeParam
|
|
26
|
-
* @typeParam
|
|
27
|
-
* @typeParam
|
|
25
|
+
* @typeParam `#` позволяет вводить только числа (regexp: `/\d/g`)
|
|
26
|
+
* @typeParam `A` позволяет вводить любые буквы русского и английского алфавита (regexp: `/[A-Za-zА-Яа-я]/g`)
|
|
27
|
+
* @typeParam `C` позволяет вводить любые буквы, которые определены для использования в гос номерах автомобилей (regexp: `/([АВЕКМНОРСТУХавекмнорстух])/`)
|
|
28
28
|
*/
|
|
29
29
|
export declare const MaskInput: import('react').ForwardRefExoticComponent<Omit<import('react').InputHTMLAttributes<HTMLInputElement>, "placeholder"> & {
|
|
30
30
|
classes?: {
|