@consta/uikit 4.9.0 → 4.11.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.
- package/__internal__/src/components/Avatar/Avatar.css +1 -1
- package/__internal__/src/components/Avatar/Avatar.d.ts +2 -1
- package/__internal__/src/components/Avatar/Avatar.js +1 -1
- package/__internal__/src/components/Avatar/Avatar.js.map +1 -1
- package/__internal__/src/components/AvatarGroup/AvatarGroup.css +1 -1
- package/__internal__/src/components/AvatarGroup/AvatarGroup.js +1 -1
- package/__internal__/src/components/AvatarGroup/AvatarGroup.js.map +1 -1
- package/__internal__/src/components/AvatarGroup/helpers.d.ts +1 -0
- package/__internal__/src/components/AvatarGroup/types.d.ts +1 -0
- package/__internal__/src/components/AvatarGroup/types.js.map +1 -1
- package/__internal__/src/components/Combobox/Combobox.js +1 -1
- package/__internal__/src/components/Combobox/Combobox.js.map +1 -1
- package/__internal__/src/components/Combobox/helpers.d.ts +3 -1
- package/__internal__/src/components/Combobox/helpers.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeDate/DatePickerFieldTypeDate.d.ts +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeDate/DatePickerFieldTypeDate.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeDate/DatePickerFieldTypeDate.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeDate/helpers.d.ts +13 -4
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeDate/helpers.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeDate/helpers.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeDateTime/DatePickerFieldTypeDateTime.d.ts +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeDateTime/DatePickerFieldTypeDateTime.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeDateTime/DatePickerFieldTypeDateTime.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeDateTime/helpers.d.ts +16 -4
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeDateTime/helpers.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeDateTime/helpers.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeMonth/DatePickerFieldTypeMonth.d.ts +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeMonth/DatePickerFieldTypeMonth.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeMonth/DatePickerFieldTypeMonth.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeMonth/helpers.d.ts +13 -4
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeMonth/helpers.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeMonth/helpers.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeTime/DatePickerFieldTypeTime.d.ts +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeTime/DatePickerFieldTypeTime.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeTime/DatePickerFieldTypeTime.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeTime/helpers.d.ts +16 -4
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeTime/helpers.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeTime/helpers.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeYear/DatePickerFieldTypeYear.d.ts +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeYear/DatePickerFieldTypeYear.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeYear/DatePickerFieldTypeYear.js.map +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeYear/helpers.d.ts +13 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeYear/helpers.js +1 -1
- package/__internal__/src/components/DatePicker/DatePickerFieldTypeYear/helpers.js.map +1 -1
- package/__internal__/src/components/ProgressStepBar/ProgressStepBar.css +1 -1
- package/__internal__/src/components/ProgressStepBar/ProgressStepBar.js +1 -1
- package/__internal__/src/components/ProgressStepBar/ProgressStepBar.js.map +1 -1
- package/__internal__/src/components/ProgressStepBar/ProgressStepBarItem/ProgressStepBarItem.css +1 -1
- package/__internal__/src/components/ProgressStepBar/ProgressStepBarItem/ProgressStepBarItem.js +1 -1
- package/__internal__/src/components/ProgressStepBar/ProgressStepBarItem/ProgressStepBarItem.js.map +1 -1
- package/__internal__/src/components/ProgressStepBar/ProgressStepBarLine/ProgressStepBarLine.css +1 -1
- package/__internal__/src/components/ProgressStepBar/ProgressStepBarLine/ProgressStepBarLine.js +1 -1
- package/__internal__/src/components/ProgressStepBar/ProgressStepBarLine/ProgressStepBarLine.js.map +1 -1
- package/__internal__/src/components/ProgressStepBar/helpers.d.ts +2 -0
- package/__internal__/src/components/ProgressStepBar/helpers.js +1 -1
- package/__internal__/src/components/ProgressStepBar/helpers.js.map +1 -1
- package/__internal__/src/components/SelectComponents/SelectItem/SelectItem.js +1 -1
- package/__internal__/src/components/SelectComponents/SelectItem/SelectItem.js.map +1 -1
- package/__internal__/src/components/SelectComponents/SelectValueTag/SelectValueTag.css +1 -1
- package/__internal__/src/components/SelectComponents/SelectValueTag/SelectValueTag.d.ts +1 -0
- package/__internal__/src/components/SelectComponents/SelectValueTag/SelectValueTag.js +1 -1
- package/__internal__/src/components/SelectComponents/SelectValueTag/SelectValueTag.js.map +1 -1
- package/__internal__/src/components/Switch/Switch.css +1 -1
- package/__internal__/src/components/Switch/Switch.d.ts +20 -37
- package/__internal__/src/components/Switch/Switch.js +1 -1
- package/__internal__/src/components/Switch/Switch.js.map +1 -1
- package/__internal__/src/components/Switch/index.d.ts +1 -0
- package/__internal__/src/components/Switch/index.js +1 -1
- package/__internal__/src/components/Switch/index.js.map +1 -1
- package/__internal__/src/components/Switch/types.d.ts +35 -0
- package/__internal__/src/components/Switch/types.js +2 -0
- package/__internal__/src/components/Switch/types.js.map +1 -0
- package/__internal__/src/components/SwitchGroup/SwitchGroup.css +1 -1
- package/__internal__/src/components/SwitchGroup/SwitchGroup.js +1 -1
- package/__internal__/src/components/SwitchGroup/SwitchGroup.js.map +1 -1
- package/__internal__/src/components/SwitchGroup/helpers.d.ts +1 -1
- package/__internal__/src/components/SwitchGroup/types.d.ts +3 -8
- package/__internal__/src/components/SwitchGroup/types.js +1 -1
- package/__internal__/src/components/SwitchGroup/types.js.map +1 -1
- package/__internal__/src/components/TextField/TextField.css +1 -1
- package/__internal__/src/components/TextField/index.d.ts +1 -0
- package/__internal__/src/components/TextField/index.js +1 -1
- package/__internal__/src/components/TextField/index.js.map +1 -1
- package/__internal__/src/components/TextField/useIMask.d.ts +15 -0
- package/__internal__/src/components/TextField/useIMask.js +2 -0
- package/__internal__/src/components/TextField/useIMask.js.map +1 -0
- package/__internal__/src/components/UserSelect/UserSelect.js +1 -1
- package/__internal__/src/components/UserSelect/UserSelect.js.map +1 -1
- package/__internal__/src/components/UserSelect/UserSelectItem/UserSelectItem.css +1 -1
- package/__internal__/src/components/UserSelect/UserSelectValue/UserSelectValue.css +1 -1
- package/__internal__/src/components/UserSelect/UserSelectValue/UserSelectValue.js +1 -1
- package/__internal__/src/components/UserSelect/UserSelectValue/UserSelectValue.js.map +1 -1
- package/__internal__/src/components/UserSelect/helpers.d.ts +3 -1
- package/__internal__/src/components/UserSelect/helpers.js.map +1 -1
- package/__internal__/src/hooks/useSelect/useSelect.js +1 -1
- package/__internal__/src/hooks/useSelect/useSelect.js.map +1 -1
- package/__internal__/src/mixs/MixFocus/MixFocus.css +1 -1
- package/package.json +1 -1
|
@@ -1,41 +1,24 @@
|
|
|
1
1
|
import './Switch.css';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { PropsWithHTMLAttributes } from '../../utils/types/PropsWithHTMLAttributes';
|
|
4
|
-
export declare const switchPropSize: readonly ["m", "s", "l"];
|
|
5
|
-
export declare type SwitchPropSize = typeof switchPropSize[number];
|
|
6
|
-
export declare const switchPropSizeDefault: SwitchPropSize;
|
|
7
|
-
export declare const switchPropView: readonly ["primary", "ghost"];
|
|
8
|
-
export declare type SwitchPropView = typeof switchPropView[number];
|
|
9
|
-
export declare const switchPropViewDefault: SwitchPropView;
|
|
10
|
-
export declare const switchPropAlign: readonly ["center", "top"];
|
|
11
|
-
export declare type SwitchPropAlign = typeof switchPropAlign[number];
|
|
12
|
-
export declare const switchPropAlignDefault: SwitchPropAlign;
|
|
13
|
-
export declare type SwitchPropOnChange = (object: {
|
|
14
|
-
e: React.ChangeEvent<HTMLInputElement>;
|
|
15
|
-
checked: boolean;
|
|
16
|
-
}) => void;
|
|
17
|
-
declare type Props = {
|
|
18
|
-
checked: boolean | undefined;
|
|
19
|
-
size?: SwitchPropSize;
|
|
20
|
-
view?: SwitchPropView;
|
|
21
|
-
align?: SwitchPropAlign;
|
|
22
|
-
disabled?: boolean;
|
|
23
|
-
className?: string;
|
|
24
|
-
label?: string;
|
|
25
|
-
onChange?: SwitchPropOnChange;
|
|
26
|
-
name?: string;
|
|
27
|
-
onFocus?: React.FocusEventHandler<HTMLInputElement>;
|
|
28
|
-
onBlur?: React.FocusEventHandler<HTMLInputElement>;
|
|
29
|
-
autoFocus?: boolean;
|
|
30
|
-
readOnly?: boolean;
|
|
31
|
-
required?: boolean;
|
|
32
|
-
step?: number | string;
|
|
33
|
-
tabIndex?: number;
|
|
34
|
-
inputRef?: React.Ref<HTMLInputElement>;
|
|
35
|
-
children?: never;
|
|
36
|
-
};
|
|
37
|
-
export declare type SwitchProps = PropsWithHTMLAttributes<Props, HTMLLabelElement>;
|
|
38
3
|
export declare const cnSwitch: import("@bem-react/classname").ClassNameFormatter;
|
|
39
4
|
export declare const COMPONENT_NAME: "Switch";
|
|
40
|
-
export declare const Switch: React.ForwardRefExoticComponent<
|
|
41
|
-
|
|
5
|
+
export declare const Switch: React.ForwardRefExoticComponent<{
|
|
6
|
+
checked: boolean | undefined;
|
|
7
|
+
size?: "m" | "s" | "xs" | "l" | undefined;
|
|
8
|
+
view?: "primary" | "ghost" | undefined;
|
|
9
|
+
align?: "center" | "top" | undefined;
|
|
10
|
+
disabled?: boolean | undefined;
|
|
11
|
+
className?: string | undefined;
|
|
12
|
+
label?: string | undefined;
|
|
13
|
+
onChange?: import("./types").SwitchPropOnChange | undefined;
|
|
14
|
+
name?: string | undefined;
|
|
15
|
+
onFocus?: React.FocusEventHandler<HTMLInputElement> | undefined;
|
|
16
|
+
onBlur?: React.FocusEventHandler<HTMLInputElement> | undefined;
|
|
17
|
+
autoFocus?: boolean | undefined;
|
|
18
|
+
readOnly?: boolean | undefined;
|
|
19
|
+
required?: boolean | undefined;
|
|
20
|
+
step?: string | number | undefined;
|
|
21
|
+
tabIndex?: number | undefined;
|
|
22
|
+
inputRef?: React.Ref<HTMLInputElement> | undefined;
|
|
23
|
+
children?: undefined;
|
|
24
|
+
} & Omit<React.HTMLAttributes<HTMLLabelElement>, "css" | "className" | "tabIndex" | "children" | "onFocus" | "onBlur" | "onChange" | "size" | "label" | "view" | "step" | "name" | "autoFocus" | "disabled" | "checked" | "readOnly" | "required" | "align" | "inputRef"> & React.RefAttributes<HTMLLabelElement>>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["checked","name","size","view","align","disabled","className","label","onChange","onFocus","onBlur","readOnly","required","step","tabIndex","inputRef"];import"./Switch.css";import React,{useRef}from"react";import{useForkRef}from"../../hooks/useForkRef/useForkRef";import{cnMixFocus}from"../../mixs/MixFocus/MixFocus";import{cn}from"../../utils/bem";import{usePropsHandler}from"../EventInterceptor/usePropsHandler";
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["checked","name","size","view","align","disabled","className","label","onChange","onFocus","onBlur","readOnly","required","step","tabIndex","inputRef"];import"./Switch.css";import React,{useRef}from"react";import{useForkRef}from"../../hooks/useForkRef/useForkRef";import{cnMixFocus}from"../../mixs/MixFocus/MixFocus";import{cn}from"../../utils/bem";import{usePropsHandler}from"../EventInterceptor/usePropsHandler";import{switchPropAlignDefault,switchPropSizeDefault,switchPropViewDefault}from"./types";export var cnSwitch=cn("Switch");export var COMPONENT_NAME="Switch";export var Switch=React.forwardRef(function(a,b){var c=useRef(null),d=usePropsHandler(COMPONENT_NAME,a,c),e=d.checked,f=void 0!==e&&e,g=d.name,h=d.size,i=void 0===h?switchPropSizeDefault:h,j=d.view,k=void 0===j?switchPropViewDefault:j,l=d.align,m=void 0===l?switchPropAlignDefault:l,n=d.disabled,o=d.className,p=d.label,q=d.onChange,r=d.onFocus,s=d.onBlur,t=d.readOnly,u=d.required,v=d.step,w=d.tabIndex,x=d.inputRef,y=_objectWithoutProperties(d,_excluded);return React.createElement("label",Object.assign({},y,{className:cnSwitch({size:i,view:k,disabled:n,align:m},[o]),ref:useForkRef([c,b])}),React.createElement("input",{type:"checkbox",name:g,className:cnSwitch("Input",[cnMixFocus()]),checked:f,disabled:n,onChange:function handleChange(a){q&&q({e:a,checked:!f})},onFocus:r,onBlur:s,readOnly:t,required:u,step:v,tabIndex:w,ref:x}),p&&React.createElement("span",{className:cnSwitch("Label")},p))});
|
|
2
2
|
//# sourceMappingURL=Switch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.js","names":["React","useRef","useForkRef","cnMixFocus","cn","usePropsHandler","
|
|
1
|
+
{"version":3,"file":"Switch.js","names":["React","useRef","useForkRef","cnMixFocus","cn","usePropsHandler","switchPropAlignDefault","switchPropSizeDefault","switchPropViewDefault","cnSwitch","COMPONENT_NAME","Switch","forwardRef","props","ref","switchRef","checked","name","size","view","align","disabled","className","label","onChange","onFocus","onBlur","readOnly","required","step","tabIndex","inputRef","otherProps","handleChange","e"],"sources":["../../../../../src/components/Switch/Switch.tsx"],"sourcesContent":["import './Switch.css';\n\nimport React, { ChangeEventHandler, useRef } from 'react';\n\nimport { useForkRef } from '../../hooks/useForkRef/useForkRef';\nimport { cnMixFocus } from '../../mixs/MixFocus/MixFocus';\nimport { cn } from '../../utils/bem';\nimport { usePropsHandler } from '../EventInterceptor/usePropsHandler';\nimport {\n switchPropAlignDefault,\n SwitchProps,\n switchPropSizeDefault,\n switchPropViewDefault,\n} from './types';\n\nexport const cnSwitch = cn('Switch');\n\nexport const COMPONENT_NAME = 'Switch' as const;\n\nexport const Switch = React.forwardRef<HTMLLabelElement, SwitchProps>(\n (props, ref) => {\n const switchRef = useRef<HTMLLabelElement>(null);\n const {\n checked = false,\n name,\n size = switchPropSizeDefault,\n view = switchPropViewDefault,\n align = switchPropAlignDefault,\n disabled,\n className,\n label,\n onChange,\n onFocus,\n onBlur,\n readOnly,\n required,\n step,\n tabIndex,\n inputRef,\n ...otherProps\n } = usePropsHandler(COMPONENT_NAME, props, switchRef);\n\n const handleChange: ChangeEventHandler<HTMLInputElement> = (e) => {\n if (onChange) {\n onChange({ e, checked: !checked });\n }\n };\n\n return (\n <label\n {...otherProps}\n className={cnSwitch({ size, view, disabled, align }, [className])}\n ref={useForkRef([switchRef, ref])}\n >\n <input\n type=\"checkbox\"\n name={name}\n className={cnSwitch('Input', [cnMixFocus()])}\n checked={checked}\n disabled={disabled}\n onChange={handleChange}\n onFocus={onFocus}\n onBlur={onBlur}\n readOnly={readOnly}\n required={required}\n step={step}\n tabIndex={tabIndex}\n ref={inputRef}\n />\n {label && <span className={cnSwitch('Label')}>{label}</span>}\n </label>\n );\n },\n);\n"],"mappings":"4PAAA,qBAEA,MAAOA,MAAP,EAAoCC,MAApC,KAAkD,OAAlD,CAEA,OAASC,UAAT,yCACA,OAASC,UAAT,oCACA,OAASC,EAAT,uBACA,OAASC,eAAT,2CACA,OACEC,sBADF,CAGEC,qBAHF,CAIEC,qBAJF,eAOA,MAAO,IAAMC,SAAQ,CAAGL,EAAE,CAAC,QAAD,CAAnB,CAEP,MAAO,IAAMM,eAAc,CAAG,QAAvB,CAEP,MAAO,IAAM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AAF,CAAKlB,OAAO,CAAE,CAACA,CAAf,CAAD,CAEX,CAQG,CAOE,OAAO,CAAES,CAPX,CAQE,MAAM,CAAEC,CARV,CASE,QAAQ,CAAEC,CATZ,CAUE,QAAQ,CAAEC,CAVZ,CAWE,IAAI,CAAEC,CAXR,CAYE,QAAQ,CAAEC,CAZZ,CAaE,GAAG,CAAEC,CAbP,EALF,CAoBGR,CAAK,EAAI,4BAAM,SAAS,CAAEd,QAAQ,CAAC,OAAD,CAAzB,EAAqCc,CAArC,CApBZ,CAuBH,CArDmB,CAAf"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export*from"./Switch";
|
|
1
|
+
export*from"./Switch";export*from"./types";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/Switch/index.ts"],"sourcesContent":["export * from './Switch';\n"],"mappings":"AAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/Switch/index.ts"],"sourcesContent":["export * from './Switch';\nexport * from './types';\n"],"mappings":"AAAA,sBACA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { PropsWithHTMLAttributes } from "../../utils/types/PropsWithHTMLAttributes";
|
|
3
|
+
export declare const switchPropSize: readonly ["m", "xs", "s", "l"];
|
|
4
|
+
export declare type SwitchPropSize = typeof switchPropSize[number];
|
|
5
|
+
export declare const switchPropSizeDefault: SwitchPropSize;
|
|
6
|
+
export declare const switchPropView: readonly ["primary", "ghost"];
|
|
7
|
+
export declare type SwitchPropView = typeof switchPropView[number];
|
|
8
|
+
export declare const switchPropViewDefault: SwitchPropView;
|
|
9
|
+
export declare const switchPropAlign: readonly ["center", "top"];
|
|
10
|
+
export declare type SwitchPropAlign = typeof switchPropAlign[number];
|
|
11
|
+
export declare const switchPropAlignDefault: SwitchPropAlign;
|
|
12
|
+
export declare type SwitchPropOnChange = (object: {
|
|
13
|
+
e: React.ChangeEvent<HTMLInputElement>;
|
|
14
|
+
checked: boolean;
|
|
15
|
+
}) => void;
|
|
16
|
+
export declare type SwitchProps = PropsWithHTMLAttributes<{
|
|
17
|
+
checked: boolean | undefined;
|
|
18
|
+
size?: SwitchPropSize;
|
|
19
|
+
view?: SwitchPropView;
|
|
20
|
+
align?: SwitchPropAlign;
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
className?: string;
|
|
23
|
+
label?: string;
|
|
24
|
+
onChange?: SwitchPropOnChange;
|
|
25
|
+
name?: string;
|
|
26
|
+
onFocus?: React.FocusEventHandler<HTMLInputElement>;
|
|
27
|
+
onBlur?: React.FocusEventHandler<HTMLInputElement>;
|
|
28
|
+
autoFocus?: boolean;
|
|
29
|
+
readOnly?: boolean;
|
|
30
|
+
required?: boolean;
|
|
31
|
+
step?: number | string;
|
|
32
|
+
tabIndex?: number;
|
|
33
|
+
inputRef?: React.Ref<HTMLInputElement>;
|
|
34
|
+
children?: never;
|
|
35
|
+
}, HTMLLabelElement>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export var switchPropSize=["m","xs","s","l"];export var switchPropSizeDefault=switchPropSize[0];export var switchPropView=["primary","ghost"];export var switchPropViewDefault=switchPropView[0];export var switchPropAlign=["center","top"];export var switchPropAlignDefault=switchPropAlign[0];
|
|
2
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","names":["switchPropSize","switchPropSizeDefault","switchPropView","switchPropViewDefault","switchPropAlign","switchPropAlignDefault"],"sources":["../../../../../src/components/Switch/types.ts"],"sourcesContent":["import { PropsWithHTMLAttributes } from '##/utils/types/PropsWithHTMLAttributes';\n\nexport const switchPropSize = ['m', 'xs', 's', 'l'] as const;\nexport type SwitchPropSize = typeof switchPropSize[number];\nexport const switchPropSizeDefault: SwitchPropSize = switchPropSize[0];\n\nexport const switchPropView = ['primary', 'ghost'] as const;\nexport type SwitchPropView = typeof switchPropView[number];\nexport const switchPropViewDefault: SwitchPropView = switchPropView[0];\n\nexport const switchPropAlign = ['center', 'top'] as const;\nexport type SwitchPropAlign = typeof switchPropAlign[number];\nexport const switchPropAlignDefault: SwitchPropAlign = switchPropAlign[0];\n\nexport type SwitchPropOnChange = (object: {\n e: React.ChangeEvent<HTMLInputElement>;\n checked: boolean;\n}) => void;\n\nexport type SwitchProps = PropsWithHTMLAttributes<\n {\n checked: boolean | undefined;\n size?: SwitchPropSize;\n view?: SwitchPropView;\n align?: SwitchPropAlign;\n disabled?: boolean;\n className?: string;\n label?: string;\n onChange?: SwitchPropOnChange;\n name?: string;\n onFocus?: React.FocusEventHandler<HTMLInputElement>;\n onBlur?: React.FocusEventHandler<HTMLInputElement>;\n autoFocus?: boolean;\n readOnly?: boolean;\n required?: boolean;\n step?: number | string;\n tabIndex?: number;\n inputRef?: React.Ref<HTMLInputElement>;\n children?: never;\n },\n HTMLLabelElement\n>;\n"],"mappings":"AAEA,MAAO,IAAMA,eAAc,CAAG,CAAC,GAAD,CAAM,IAAN,CAAY,GAAZ,CAAiB,GAAjB,CAAvB,CAEP,MAAO,IAAMC,sBAAqC,CAAGD,cAAc,CAAC,CAAD,CAA5D,CAEP,MAAO,IAAME,eAAc,CAAG,CAAC,SAAD,CAAY,OAAZ,CAAvB,CAEP,MAAO,IAAMC,sBAAqC,CAAGD,cAAc,CAAC,CAAD,CAA5D,CAEP,MAAO,IAAME,gBAAe,CAAG,CAAC,QAAD,CAAW,KAAX,CAAxB,CAEP,MAAO,IAAMC,uBAAuC,CAAGD,eAAe,CAAC,CAAD,CAA/D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.SwitchGroup{display:flex}.SwitchGroup_direction_column{flex-direction:column}.
|
|
1
|
+
.SwitchGroup{display:flex;gap:var(--offset)}.SwitchGroup_direction_column{flex-direction:column}.SwitchGroup_direction_row{flex-direction:row}.SwitchGroup_size_s,.SwitchGroup_size_xs{--offset:var(--space-2xs)}.SwitchGroup_size_m{--offset:var(--space-xs)}.SwitchGroup_size_l{--offset:var(--space-s)}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["value","items","getItemLabel","getItemDisabled","onChange","name","direction","size","view","disabled","className"];import"./SwitchGroup.css";import React,{forwardRef}from"react";import{useChoiceGroup}from"../../hooks/useChoiceGroup/useChoiceGroup";import{cn}from"../../utils/bem";import{Switch}from"../Switch
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["value","items","getItemLabel","getItemDisabled","onChange","name","direction","size","view","disabled","className"];import"./SwitchGroup.css";import React,{forwardRef}from"react";import{useChoiceGroup}from"../../hooks/useChoiceGroup/useChoiceGroup";import{cn}from"../../utils/bem";import{Switch,switchPropSizeDefault,switchPropViewDefault}from"../Switch";import{withDefaultGetters}from"./helpers";import{switchGroupDefaultDirection}from"./types";export var cnSwitchGroup=cn("SwitchGroup");var SwitchGroupRender=function(a,b){var c=withDefaultGetters(a),d=c.value,e=void 0===d?null:d,f=c.items,g=c.getItemLabel,h=c.getItemDisabled,i=c.onChange,j=c.name,k=c.direction,l=void 0===k?switchGroupDefaultDirection:k,m=c.size,n=void 0===m?switchPropSizeDefault:m,o=c.view,p=void 0===o?switchPropViewDefault:o,q=c.disabled,r=c.className,s=_objectWithoutProperties(c,_excluded),t=useChoiceGroup({value:e,getKey:g,callBack:i,multiple:!0}),u=t.getOnChange,v=t.getChecked;return React.createElement("div",Object.assign({},s,{ref:b,className:cnSwitchGroup({direction:l,size:n,view:p},[r])}),f.map(function(a){return React.createElement(Switch,{key:g(a),label:g(a),size:n,view:p,name:j,disabled:void 0!==q&&q||(null===h||void 0===h?void 0:h(a)),checked:v(a),onChange:function(b){var c=b.e;return u(a)(c)},className:cnSwitchGroup("Item")})}))};export var SwitchGroup=forwardRef(SwitchGroupRender);export*from"./types";
|
|
2
2
|
//# sourceMappingURL=SwitchGroup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwitchGroup.js","names":["React","forwardRef","useChoiceGroup","cn","Switch","
|
|
1
|
+
{"version":3,"file":"SwitchGroup.js","names":["React","forwardRef","useChoiceGroup","cn","Switch","switchPropSizeDefault","switchPropViewDefault","withDefaultGetters","switchGroupDefaultDirection","cnSwitchGroup","SwitchGroupRender","props","ref","value","items","getItemLabel","getItemDisabled","onChange","name","direction","size","view","disabled","className","otherProps","getKey","callBack","multiple","getOnChange","getChecked","map","item","e","SwitchGroup"],"sources":["../../../../../src/components/SwitchGroup/SwitchGroup.tsx"],"sourcesContent":["import './SwitchGroup.css';\n\nimport React, { forwardRef } from 'react';\n\nimport { useChoiceGroup } from '../../hooks/useChoiceGroup/useChoiceGroup';\nimport { cn } from '../../utils/bem';\nimport {\n Switch,\n switchPropSizeDefault,\n switchPropViewDefault,\n} from '../Switch';\nimport { withDefaultGetters } from './helpers';\nimport {\n SwitchGroupComponent,\n switchGroupDefaultDirection,\n SwitchGroupProps,\n} from './types';\n\nexport const cnSwitchGroup = cn('SwitchGroup');\n\nconst SwitchGroupRender = (\n props: SwitchGroupProps,\n ref: React.Ref<HTMLDivElement>,\n) => {\n const {\n value = null,\n items,\n getItemLabel,\n getItemDisabled,\n onChange,\n name,\n direction = switchGroupDefaultDirection,\n size = switchPropSizeDefault,\n view = switchPropViewDefault,\n disabled = false,\n className,\n ...otherProps\n } = withDefaultGetters(props);\n\n const { getOnChange, getChecked } = useChoiceGroup({\n value,\n getKey: getItemLabel,\n callBack: onChange,\n multiple: true,\n });\n\n return (\n <div\n {...otherProps}\n ref={ref}\n className={cnSwitchGroup({ direction, size, view }, [className])}\n >\n {items.map((item) => (\n <Switch\n key={getItemLabel(item)}\n label={getItemLabel(item)}\n size={size}\n view={view}\n name={name}\n disabled={disabled || getItemDisabled?.(item)}\n checked={getChecked(item)}\n onChange={({ e }) => getOnChange(item)(e)}\n className={cnSwitchGroup('Item')}\n />\n ))}\n </div>\n );\n};\n\nexport const SwitchGroup = forwardRef(\n SwitchGroupRender,\n) as SwitchGroupComponent;\n\nexport * from './types';\n"],"mappings":"yNAAA,0BAEA,MAAOA,MAAP,EAAgBC,UAAhB,KAAkC,OAAlC,CAEA,OAASC,cAAT,iDACA,OAASC,EAAT,uBACA,OACEC,MADF,CAEEC,qBAFF,CAGEC,qBAHF,iBAKA,OAASC,kBAAT,iBACA,OAEEC,2BAFF,eAMA,MAAO,IAAMC,cAAa,CAAGN,EAAE,CAAC,aAAD,CAAxB,CAEP,GAAMO,kBAAiB,CAAG,SACxBC,CADwB,CAExBC,CAFwB,CAGrB,OAcCL,kBAAkB,CAACI,CAAD,CAdnB,KAEDE,KAFC,CAEDA,CAFC,YAEO,IAFP,GAGDC,CAHC,GAGDA,KAHC,CAIDC,CAJC,GAIDA,YAJC,CAKDC,CALC,GAKDA,eALC,CAMDC,CANC,GAMDA,QANC,CAODC,CAPC,GAODA,IAPC,KAQDC,SARC,CAQDA,CARC,YAQWX,2BARX,OASDY,IATC,CASDA,CATC,YASMf,qBATN,OAUDgB,IAVC,CAUDA,CAVC,YAUMf,qBAVN,OAWDgB,QAXC,CAYDC,CAZC,GAYDA,SAZC,CAaEC,CAbF,yCAgBiCtB,cAAc,CAAC,CACjDW,KAAK,CAALA,CADiD,CAEjDY,MAAM,CAAEV,CAFyC,CAGjDW,QAAQ,CAAET,CAHuC,CAIjDU,QAAQ,GAJyC,CAAD,CAhB/C,CAgBKC,CAhBL,GAgBKA,WAhBL,CAgBkBC,CAhBlB,GAgBkBA,UAhBlB,CAuBH,MACE,4CACML,CADN,EAEE,GAAG,CAAEZ,CAFP,CAGE,SAAS,CAAEH,aAAa,CAAC,CAAEU,SAAS,CAATA,CAAF,CAAaC,IAAI,CAAJA,CAAb,CAAmBC,IAAI,CAAJA,CAAnB,CAAD,CAA4B,CAACE,CAAD,CAA5B,CAH1B,GAKGT,CAAK,CAACgB,GAAN,CAAU,SAACC,CAAD,QACT,qBAAC,MAAD,EACE,GAAG,CAAEhB,CAAY,CAACgB,CAAD,CADnB,CAEE,KAAK,CAAEhB,CAAY,CAACgB,CAAD,CAFrB,CAGE,IAAI,CAAEX,CAHR,CAIE,IAAI,CAAEC,CAJR,CAKE,IAAI,CAAEH,CALR,CAME,QAAQ,CAAE,uBAAYF,CAAZ,WAAYA,CAAZ,QAAYA,CAAe,CAAGe,CAAH,CAA3B,CANZ,CAOE,OAAO,CAAEF,CAAU,CAACE,CAAD,CAPrB,CAQE,QAAQ,CAAE,eAAGC,EAAH,GAAGA,CAAH,OAAWJ,EAAW,CAACG,CAAD,CAAX,CAAkBC,CAAlB,CAAX,CARZ,CASE,SAAS,CAAEvB,aAAa,CAAC,MAAD,CAT1B,EADS,CAAV,CALH,CAoBH,CA/CD,CAiDA,MAAO,IAAMwB,YAAW,CAAGhC,UAAU,CACnCS,iBADmC,CAA9B,CAIP"}
|
|
@@ -11,7 +11,7 @@ export declare const withDefaultGetters: (props: SwitchGroupProps) => {
|
|
|
11
11
|
}) => void;
|
|
12
12
|
name: string;
|
|
13
13
|
direction?: "row" | "column" | undefined;
|
|
14
|
-
size?: "m" | "l" | undefined;
|
|
14
|
+
size?: "m" | "s" | "xs" | "l" | undefined;
|
|
15
15
|
view?: "primary" | "ghost" | undefined;
|
|
16
16
|
disabled?: boolean | undefined;
|
|
17
17
|
className?: string | undefined;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';
|
|
3
|
+
import { SwitchPropSize, SwitchPropView } from '../Switch/types';
|
|
3
4
|
export declare type SwitchGroupDefaultItem = {
|
|
4
5
|
label: string;
|
|
5
6
|
disabled?: boolean;
|
|
@@ -7,12 +8,6 @@ export declare type SwitchGroupDefaultItem = {
|
|
|
7
8
|
export declare const switchGroupDirections: readonly ["column", "row"];
|
|
8
9
|
export declare type SwitchGroupDirection = typeof switchGroupDirections[number];
|
|
9
10
|
export declare const switchGroupDefaultDirection: SwitchGroupDirection;
|
|
10
|
-
export declare const switchGroupSizes: readonly ["m", "l"];
|
|
11
|
-
export declare type SwitchGroupPropSize = typeof switchGroupSizes[number];
|
|
12
|
-
export declare const switchGroupDefaultSize: SwitchGroupPropSize;
|
|
13
|
-
export declare const switchGroupViews: readonly ["primary", "ghost"];
|
|
14
|
-
export declare type SwitchGroupPropView = typeof switchGroupViews[number];
|
|
15
|
-
export declare const switchGroupDefaultView: SwitchGroupPropView;
|
|
16
11
|
export declare type SwitchGroupPropGetItemLabel<ITEM> = (item: ITEM) => string;
|
|
17
12
|
export declare type SwitchGroupPropGetItemDisabled<ITEM> = (item: ITEM) => boolean | undefined;
|
|
18
13
|
export declare type SwitchGroupProps<ITEM = SwitchGroupDefaultItem> = PropsWithHTMLAttributesAndRef<{
|
|
@@ -26,8 +21,8 @@ export declare type SwitchGroupProps<ITEM = SwitchGroupDefaultItem> = PropsWithH
|
|
|
26
21
|
}) => void;
|
|
27
22
|
name: string;
|
|
28
23
|
direction?: SwitchGroupDirection;
|
|
29
|
-
size?:
|
|
30
|
-
view?:
|
|
24
|
+
size?: SwitchPropSize;
|
|
25
|
+
view?: SwitchPropView;
|
|
31
26
|
disabled?: boolean;
|
|
32
27
|
className?: string;
|
|
33
28
|
}, HTMLDivElement> & (ITEM extends {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export var switchGroupDirections=["column","row"];export var switchGroupDefaultDirection=switchGroupDirections[0];
|
|
1
|
+
export var switchGroupDirections=["column","row"];export var switchGroupDefaultDirection=switchGroupDirections[0];
|
|
2
2
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["switchGroupDirections","switchGroupDefaultDirection"
|
|
1
|
+
{"version":3,"file":"types.js","names":["switchGroupDirections","switchGroupDefaultDirection"],"sources":["../../../../../src/components/SwitchGroup/types.ts"],"sourcesContent":["import { PropsWithHTMLAttributesAndRef } from '../../utils/types/PropsWithHTMLAttributes';\nimport { SwitchPropSize, SwitchPropView } from '../Switch/types';\n\nexport type SwitchGroupDefaultItem = {\n label: string;\n disabled?: boolean;\n};\n\nexport const switchGroupDirections = ['column', 'row'] as const;\nexport type SwitchGroupDirection = typeof switchGroupDirections[number];\nexport const switchGroupDefaultDirection: SwitchGroupDirection =\n switchGroupDirections[0];\n\nexport type SwitchGroupPropGetItemLabel<ITEM> = (item: ITEM) => string;\nexport type SwitchGroupPropGetItemDisabled<ITEM> = (\n item: ITEM,\n) => boolean | undefined;\n\nexport type SwitchGroupProps<ITEM = SwitchGroupDefaultItem> =\n PropsWithHTMLAttributesAndRef<\n {\n value?: ITEM[] | null;\n items: ITEM[];\n getItemLabel?: SwitchGroupPropGetItemLabel<ITEM>;\n getItemDisabled?: SwitchGroupPropGetItemDisabled<ITEM>;\n onChange: (props: {\n e: React.ChangeEvent<HTMLInputElement>;\n value: ITEM[] | null;\n }) => void;\n name: string;\n direction?: SwitchGroupDirection;\n size?: SwitchPropSize;\n view?: SwitchPropView;\n disabled?: boolean;\n className?: string;\n },\n HTMLDivElement\n > &\n (ITEM extends { label: SwitchGroupDefaultItem['label'] }\n ? {}\n : {\n getItemLabel: SwitchGroupPropGetItemLabel<ITEM>;\n });\n\nexport type SwitchGroupComponent = <ITEM>(\n props: SwitchGroupProps<ITEM>,\n) => React.ReactElement | null;\n"],"mappings":"AAQA,MAAO,IAAMA,sBAAqB,CAAG,CAAC,QAAD,CAAW,KAAX,CAA9B,CAEP,MAAO,IAAMC,4BAAiD,CAC5DD,qBAAqB,CAAC,CAAD,CADhB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.TextField{--caption-margin-left:calc(var(--input-space) + var(--control-border-width));--counter-button-icon-color:var(--color-control-typo-ghost);--counter-button-background:transparent;--clear-button-color:var(--color-control-typo-clear);display:inline-flex;position:relative}.TextField_width_full{width:100%}.TextField_size_xs{--input-height:var(--control-height-xs);--input-font-size:var(--control-text-size-xs);--input-space:calc(var(--control-space-xs)*0.5)}.TextField_size_s{--input-height:var(--control-height-s);--input-font-size:var(--control-text-size-s);--input-space:calc(var(--control-space-s)*0.5)}.TextField_size_m{--input-height:var(--control-height-m);--input-font-size:var(--control-text-size-m);--input-space:calc(var(--control-space-m)*0.5)}.TextField_size_l{--input-height:var(--control-height-l);--input-font-size:var(--control-text-size-l);--input-space:calc(var(--control-space-l)*0.5)}.TextField_labelPosition_top{flex-direction:column}.TextField_labelPosition_top>:not(:last-child){margin-bottom:var(--space-xs)}.TextField_labelPosition_left{flex-direction:row}.TextField_labelPosition_left .TextField-Label{align-items:center;display:inline-flex;height:var(--input-height)}.TextField_labelPosition_left>:not(:last-child){margin-right:var(--space-s)}.TextField-Body{display:inline-flex;flex-direction:column;width:100%}.TextField-Body .TextField-Caption{margin-left:var(--caption-margin-left);margin-top:var(--space-2xs)}.TextField_view_clear .TextField-Caption{--caption-margin-left:0}.TextField-InputContainer{box-sizing:border-box;display:inline-flex;font-family:var(--font-primary);font-weight:var(--font-weight-text-regular);max-width:100%;min-height:var(--input-height);position:relative;transition:border-color .15s,box-shadow .15s,background-color .15s}.TextField-InputContainer_disabled{--counter-button-background:var(--color-control-bg-disable);--counter-button-icon-color:var(--color-control-typo-disable)}.TextField-InputContainer_view_clear,.TextField-InputContainer_view_clear:focus,.TextField-InputContainer_view_clear:hover{color:var(--color-control-typo-default);padding:0}.TextField-InputContainer_view_clear.TextField-InputContainer_disabled,.TextField-InputContainer_view_clear:focus.TextField-InputContainer_disabled,.TextField-InputContainer_view_clear:hover.TextField-InputContainer_disabled{pointer-events:none}.TextField-InputContainer_view_clear.TextField-InputContainer_disabled .TextField-Input,.TextField-InputContainer_view_clear:focus.TextField-InputContainer_disabled .TextField-Input,.TextField-InputContainer_view_clear:hover.TextField-InputContainer_disabled .TextField-Input{color:var(--color-control-typo-disable)}.TextField-InputContainer_view_clear.TextField-InputContainer_disabled .TextField-Input:-webkit-autofill,.TextField-InputContainer_view_clear.TextField-InputContainer_disabled .TextField-Input:-webkit-autofill:focus,.TextField-InputContainer_view_clear.TextField-InputContainer_disabled .TextField-Input:-webkit-autofill:hover,.TextField-InputContainer_view_clear:focus.TextField-InputContainer_disabled .TextField-Input:-webkit-autofill,.TextField-InputContainer_view_clear:focus.TextField-InputContainer_disabled .TextField-Input:-webkit-autofill:focus,.TextField-InputContainer_view_clear:focus.TextField-InputContainer_disabled .TextField-Input:-webkit-autofill:hover,.TextField-InputContainer_view_clear:hover.TextField-InputContainer_disabled .TextField-Input:-webkit-autofill,.TextField-InputContainer_view_clear:hover.TextField-InputContainer_disabled .TextField-Input:-webkit-autofill:focus,.TextField-InputContainer_view_clear:hover.TextField-InputContainer_disabled .TextField-Input:-webkit-autofill:hover{-webkit-text-fill-color:var(--color-control-typo-disable)}.TextField-InputContainer_view_clear.TextField-InputContainer_disabled .TextField-Input::-moz-placeholder,.TextField-InputContainer_view_clear:focus.TextField-InputContainer_disabled .TextField-Input::-moz-placeholder,.TextField-InputContainer_view_clear:hover.TextField-InputContainer_disabled .TextField-Input::-moz-placeholder{color:var(--color-control-typo-disable)}.TextField-InputContainer_view_clear.TextField-InputContainer_disabled .TextField-Input::placeholder,.TextField-InputContainer_view_clear:focus.TextField-InputContainer_disabled .TextField-Input::placeholder,.TextField-InputContainer_view_clear:hover.TextField-InputContainer_disabled .TextField-Input::placeholder{color:var(--color-control-typo-disable)}.TextField-InputContainer_view_clear.TextField-InputContainer_disabled .TextField-Side_type_string,.TextField-InputContainer_view_clear.TextField-InputContainer_disabled.TextField-InputContainer .TextField-Icon,.TextField-InputContainer_view_clear.TextField-InputContainer_disabled.TextField-InputContainer_withValue .TextField-Icon,.TextField-InputContainer_view_clear.TextField-InputContainer_disabled.TextField-InputContainer_withValue .TextField-Side_type_string,.TextField-InputContainer_view_clear:focus.TextField-InputContainer_disabled .TextField-Side_type_string,.TextField-InputContainer_view_clear:focus.TextField-InputContainer_disabled.TextField-InputContainer .TextField-Icon,.TextField-InputContainer_view_clear:focus.TextField-InputContainer_disabled.TextField-InputContainer_withValue .TextField-Icon,.TextField-InputContainer_view_clear:focus.TextField-InputContainer_disabled.TextField-InputContainer_withValue .TextField-Side_type_string,.TextField-InputContainer_view_clear:hover.TextField-InputContainer_disabled .TextField-Side_type_string,.TextField-InputContainer_view_clear:hover.TextField-InputContainer_disabled.TextField-InputContainer .TextField-Icon,.TextField-InputContainer_view_clear:hover.TextField-InputContainer_disabled.TextField-InputContainer_withValue .TextField-Icon,.TextField-InputContainer_view_clear:hover.TextField-InputContainer_disabled.TextField-InputContainer_withValue .TextField-Side_type_string{color:var(--color-control-typo-disable)}.TextField-InputContainer_view_default{--container-border-color:var(--color-control-bg-border-default);background:var(--color-control-bg-default);border:var(--control-border-width) solid var(--container-border-color);border-radius:var(--control-radius);color:var(--color-control-typo-default);overflow-x:hidden;padding:0 var(--input-space)}.TextField-InputContainer_view_default:hover{border-color:var(--color-control-bg-border-default-hover)}.TextField-InputContainer_view_default.TextField-InputContainer_status_alert{--container-border-color:var(--color-bg-alert)}.TextField-InputContainer_view_default.TextField-InputContainer_status_success{--container-border-color:var(--color-bg-success)}.TextField-InputContainer_view_default.TextField-InputContainer_status_warning{--container-border-color:var(--color-bg-warning)}.TextField-InputContainer_view_default .TextField-Input{color:var(--color-control-typo-default)}.TextField-InputContainer_view_default .TextField-Input::-moz-placeholder{color:var(--color-control-typo-placeholder)}.TextField-InputContainer_view_default .TextField-Input::placeholder{color:var(--color-control-typo-placeholder)}.TextField-InputContainer_view_default .TextField-Input:-webkit-autofill,.TextField-InputContainer_view_default .TextField-Input:-webkit-autofill:focus,.TextField-InputContainer_view_default .TextField-Input:-webkit-autofill:hover{-webkit-text-fill-color:var(--color-control-typo-default)}.TextField-InputContainer_view_default .TextField-Side_type_string{color:var(--color-control-typo-placeholder)}.TextField-InputContainer_view_default.TextField-InputContainer_focus{border-color:var(--color-control-bg-border-focus);outline:none;z-index:1}.TextField-InputContainer_view_default.TextField-InputContainer_focus.TextField-InputContainer_form_clearClear{box-shadow:var(--control-border-width) 0 var(--color-control-bg-border-focus),calc(var(--control-border-width)*-1) 0 var(--color-control-bg-border-focus)}.TextField-InputContainer_view_default.TextField-InputContainer_focus.TextField-InputContainer_form_brickClear,.TextField-InputContainer_view_default.TextField-InputContainer_focus.TextField-InputContainer_form_defaultClear,.TextField-InputContainer_view_default.TextField-InputContainer_focus.TextField-InputContainer_form_roundClear{box-shadow:var(--control-border-width) 0 var(--color-control-bg-border-focus)}.TextField-InputContainer_view_default.TextField-InputContainer_focus.TextField-InputContainer_form_clearBrick,.TextField-InputContainer_view_default.TextField-InputContainer_focus.TextField-InputContainer_form_clearDefault,.TextField-InputContainer_view_default.TextField-InputContainer_focus.TextField-InputContainer_form_clearRound{box-shadow:calc(var(--control-border-width)*-1) 0 var(--color-control-bg-border-focus)}.TextField-InputContainer_view_default.TextField-InputContainer_disabled{--clear-button-color:var(--color-control-typo-disable);background:var(--color-control-bg-disable);border-color:var(--color-control-bg-border-disable);pointer-events:none}.TextField-InputContainer_view_default.TextField-InputContainer_disabled .TextField-Input{color:var(--color-control-typo-disable)}.TextField-InputContainer_view_default.TextField-InputContainer_disabled .TextField-Input::-moz-placeholder{color:var(--color-control-typo-disable)}.TextField-InputContainer_view_default.TextField-InputContainer_disabled .TextField-Input::placeholder{color:var(--color-control-typo-disable)}.TextField-InputContainer_view_default.TextField-InputContainer_disabled .TextField-Side_type_string,.TextField-InputContainer_view_default.TextField-InputContainer_disabled.TextField-InputContainer .TextField-Icon,.TextField-InputContainer_view_default.TextField-InputContainer_disabled.TextField-InputContainer_withValue .TextField-Icon,.TextField-InputContainer_view_default.TextField-InputContainer_disabled.TextField-InputContainer_withValue .TextField-Side_type_string{color:var(--color-control-typo-disable)}.TextField-InputContainer_form_defaultClear{border-right-width:0}.TextField-InputContainer_form_defaultBrick,.TextField-InputContainer_form_defaultClear{border-radius:var(--control-radius) 0 0 var(--control-radius)}.TextField-InputContainer_form_round{border-radius:calc(var(--input-height)/2);padding-left:calc(var(--input-space)*1.6);padding-right:calc(var(--input-space)*1.6)}.TextField-InputContainer_form_roundBrick{border-radius:calc(var(--input-height)/2) 0 0 calc(var(--input-height)/2);padding-left:calc(var(--input-space)*1.6)}.TextField-InputContainer_form_roundClear{border-radius:calc(var(--input-height)/2) 0 0 calc(var(--input-height)/2);border-right-width:0;padding-left:calc(var(--input-space)*1.6)}.TextField-InputContainer_form_brick{border-radius:0}.TextField-InputContainer_form_brickDefault{border-radius:0 var(--control-radius) var(--control-radius) 0}.TextField-InputContainer_form_brickRound{border-radius:0 calc(var(--input-height)/2) calc(var(--input-height)/2) 0;padding-right:calc(var(--input-space)*1.6)}.TextField-InputContainer_form_brickClear{border-radius:0;border-right-width:0}.TextField-InputContainer_form_clearDefault{border-left-width:0;border-radius:0 var(--control-radius) var(--control-radius) 0}.TextField-InputContainer_form_clearBrick{border-left-width:0;border-radius:0}.TextField-InputContainer_form_clearRound{border-left-width:0;border-radius:0 calc(var(--input-height)/2) calc(var(--input-height)/2) 0;padding-right:calc(var(--input-space)*1.6)}.TextField-InputContainer_form_clearClear{border-width:0;border-bottom-width:var(--control-border-width);border-radius:0;border-top-width:var(--control-border-width)}.TextField-InputContainer_withValue .TextField-Side.TextField-Side_type_string{color:var(--color-control-typo-default)}.TextField-InputContainer_withValue .TextField-Icon{color:var(--color-typo-secondary)}.TextField-InputContainer_type_number{padding-right:0}.TextField-InputContainer_type_textarea .TextField-Input{display:block;line-height:var(--line-height-text-m);min-width:0;padding-bottom:calc((var(--input-height) - (var(--control-border-width)*2) - var(--line-height-text-m))/2);padding-top:calc((var(--input-height) - (var(--control-border-width)*2) - var(--line-height-text-m))/2);resize:none}.TextField-Counter{display:inline-flex;flex-direction:column;height:calc(var(--input-height) - var(--control-border-width)*2);width:var(--space-xl)}.TextField-CounterButton{align-items:center;background-color:var(--counter-button-background);border:none;color:var(--counter-button-icon-color);cursor:pointer;display:inline-flex;flex:1;flex-direction:column;justify-content:center;margin:0;overflow-y:hidden;padding:0;transition:background-color .15s;width:var(--space-xl)}.TextField-ClearButton,.TextField-EyeButton{background-color:transparent;border:none;cursor:pointer;display:flex;flex-direction:column;height:calc(var(--input-height) - var(--control-border-width)*2);justify-content:center;margin:0;margin-left:var(--input-space);padding:0}.TextField-ClearButton{color:var(--clear-button-color)}.TextField-ClearButton:hover{--clear-button-color:var(--color-control-typo-clear-hover)}.TextField-EyeButton{color:var(--color-control-typo-placeholder)}.TextField-EyeButton:hover{color:var(--color-control-typo-clear-hover)}.TextField-ClearButtonIcon{position:relative;top:1px}.TextField-Input{background:transparent;border:none;color:currentColor;flex:1;font-family:var(--font-primary);font-size:var(--input-font-size);height:calc(var(--input-height) - var(--control-border-width)*2);min-width:80px;outline:none;padding:0;width:100%}.TextField-Input::-webkit-inner-spin-button,.TextField-Input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.TextField-Input[type=password]::-ms-reveal{display:none}.TextField-Input[type=number]{-moz-appearance:textfield}.TextField-Input:focus{outline:none}.TextField-Input:-webkit-autofill,.TextField-Input:-webkit-autofill:focus,.TextField-Input:-webkit-autofill:hover{border:none;-webkit-box-shadow:inset 0 0 0 1000px transparent;-webkit-transition:background-color 5000s ease-in-out 0s;transition:background-color 5000s ease-in-out 0s}.TextField-Side{align-items:center;display:flex;height:calc(var(--input-height) - var(--control-border-width)*2);overflow:hidden}.TextField-Side_position_left{margin-right:var(--input-space)}.TextField-Side_position_right{margin-left:var(--input-space)}.TextField-Side_type_string{font-size:var(--input-font-size);white-space:nowrap}.TextField-Icon{color:var(--color-control-typo-placeholder)}
|
|
1
|
+
.TextField{--caption-margin-left:calc(var(--input-space) + var(--control-border-width));--counter-button-icon-color:var(--color-control-typo-ghost);--counter-button-background:transparent;--clear-button-color:var(--color-control-typo-clear);display:inline-flex;position:relative}.TextField_width_full{width:100%}.TextField_size_xs{--input-height:var(--control-height-xs);--input-font-size:var(--control-text-size-xs);--input-space:calc(var(--control-space-xs)*0.5)}.TextField_size_s{--input-height:var(--control-height-s);--input-font-size:var(--control-text-size-s);--input-space:calc(var(--control-space-s)*0.5)}.TextField_size_m{--input-height:var(--control-height-m);--input-font-size:var(--control-text-size-m);--input-space:calc(var(--control-space-m)*0.5)}.TextField_size_l{--input-height:var(--control-height-l);--input-font-size:var(--control-text-size-l);--input-space:calc(var(--control-space-l)*0.5)}.TextField_labelPosition_top{flex-direction:column}.TextField_labelPosition_top>:not(:last-child){margin-bottom:var(--space-xs)}.TextField_labelPosition_left{flex-direction:row}.TextField_labelPosition_left .TextField-Label{align-items:center;display:inline-flex;height:var(--input-height)}.TextField_labelPosition_left>:not(:last-child){margin-right:var(--space-s)}.TextField-Body{display:inline-flex;flex-direction:column;width:100%}.TextField-Body .TextField-Caption{margin-left:var(--caption-margin-left);margin-top:var(--space-2xs)}.TextField_view_clear .TextField-Caption{--caption-margin-left:0}.TextField-InputContainer{box-sizing:border-box;display:inline-flex;font-family:var(--font-primary);font-weight:var(--font-weight-text-regular);max-width:100%;min-height:var(--input-height);position:relative;transition:border-color .15s,box-shadow .15s,background-color .15s}.TextField-InputContainer_disabled{--counter-button-background:var(--color-control-bg-disable);--counter-button-icon-color:var(--color-control-typo-disable)}.TextField-InputContainer_view_clear,.TextField-InputContainer_view_clear:focus,.TextField-InputContainer_view_clear:hover{color:var(--color-control-typo-default);padding:0}.TextField-InputContainer_view_clear.TextField-InputContainer_disabled .TextField-Input,.TextField-InputContainer_view_clear:focus.TextField-InputContainer_disabled .TextField-Input,.TextField-InputContainer_view_clear:hover.TextField-InputContainer_disabled .TextField-Input{color:var(--color-control-typo-disable);pointer-events:all}.TextField-InputContainer_view_clear.TextField-InputContainer_disabled .TextField-Input:-webkit-autofill,.TextField-InputContainer_view_clear.TextField-InputContainer_disabled .TextField-Input:-webkit-autofill:focus,.TextField-InputContainer_view_clear.TextField-InputContainer_disabled .TextField-Input:-webkit-autofill:hover,.TextField-InputContainer_view_clear:focus.TextField-InputContainer_disabled .TextField-Input:-webkit-autofill,.TextField-InputContainer_view_clear:focus.TextField-InputContainer_disabled .TextField-Input:-webkit-autofill:focus,.TextField-InputContainer_view_clear:focus.TextField-InputContainer_disabled .TextField-Input:-webkit-autofill:hover,.TextField-InputContainer_view_clear:hover.TextField-InputContainer_disabled .TextField-Input:-webkit-autofill,.TextField-InputContainer_view_clear:hover.TextField-InputContainer_disabled .TextField-Input:-webkit-autofill:focus,.TextField-InputContainer_view_clear:hover.TextField-InputContainer_disabled .TextField-Input:-webkit-autofill:hover{-webkit-text-fill-color:var(--color-control-typo-disable)}.TextField-InputContainer_view_clear.TextField-InputContainer_disabled .TextField-Input::-moz-placeholder,.TextField-InputContainer_view_clear:focus.TextField-InputContainer_disabled .TextField-Input::-moz-placeholder,.TextField-InputContainer_view_clear:hover.TextField-InputContainer_disabled .TextField-Input::-moz-placeholder{color:var(--color-control-typo-disable)}.TextField-InputContainer_view_clear.TextField-InputContainer_disabled .TextField-Input::placeholder,.TextField-InputContainer_view_clear:focus.TextField-InputContainer_disabled .TextField-Input::placeholder,.TextField-InputContainer_view_clear:hover.TextField-InputContainer_disabled .TextField-Input::placeholder{color:var(--color-control-typo-disable)}.TextField-InputContainer_view_clear.TextField-InputContainer_disabled .TextField-Side_type_string,.TextField-InputContainer_view_clear.TextField-InputContainer_disabled.TextField-InputContainer .TextField-Icon,.TextField-InputContainer_view_clear.TextField-InputContainer_disabled.TextField-InputContainer_withValue .TextField-Icon,.TextField-InputContainer_view_clear.TextField-InputContainer_disabled.TextField-InputContainer_withValue .TextField-Side_type_string,.TextField-InputContainer_view_clear:focus.TextField-InputContainer_disabled .TextField-Side_type_string,.TextField-InputContainer_view_clear:focus.TextField-InputContainer_disabled.TextField-InputContainer .TextField-Icon,.TextField-InputContainer_view_clear:focus.TextField-InputContainer_disabled.TextField-InputContainer_withValue .TextField-Icon,.TextField-InputContainer_view_clear:focus.TextField-InputContainer_disabled.TextField-InputContainer_withValue .TextField-Side_type_string,.TextField-InputContainer_view_clear:hover.TextField-InputContainer_disabled .TextField-Side_type_string,.TextField-InputContainer_view_clear:hover.TextField-InputContainer_disabled.TextField-InputContainer .TextField-Icon,.TextField-InputContainer_view_clear:hover.TextField-InputContainer_disabled.TextField-InputContainer_withValue .TextField-Icon,.TextField-InputContainer_view_clear:hover.TextField-InputContainer_disabled.TextField-InputContainer_withValue .TextField-Side_type_string{color:var(--color-control-typo-disable)}.TextField-InputContainer_view_default{--container-border-color:var(--color-control-bg-border-default);background:var(--color-control-bg-default);border:var(--control-border-width) solid var(--container-border-color);border-radius:var(--control-radius);color:var(--color-control-typo-default);overflow-x:hidden;padding:0 var(--input-space)}.TextField-InputContainer_view_default:hover{border-color:var(--color-control-bg-border-default-hover)}.TextField-InputContainer_view_default.TextField-InputContainer_status_alert{--container-border-color:var(--color-bg-alert)}.TextField-InputContainer_view_default.TextField-InputContainer_status_success{--container-border-color:var(--color-bg-success)}.TextField-InputContainer_view_default.TextField-InputContainer_status_warning{--container-border-color:var(--color-bg-warning)}.TextField-InputContainer_view_default .TextField-Input{color:var(--color-control-typo-default)}.TextField-InputContainer_view_default .TextField-Input::-moz-placeholder{color:var(--color-control-typo-placeholder)}.TextField-InputContainer_view_default .TextField-Input::placeholder{color:var(--color-control-typo-placeholder)}.TextField-InputContainer_view_default .TextField-Input:-webkit-autofill,.TextField-InputContainer_view_default .TextField-Input:-webkit-autofill:focus,.TextField-InputContainer_view_default .TextField-Input:-webkit-autofill:hover{-webkit-text-fill-color:var(--color-control-typo-default)}.TextField-InputContainer_view_default .TextField-Side_type_string{color:var(--color-control-typo-placeholder)}.TextField-InputContainer_view_default.TextField-InputContainer_focus{border-color:var(--color-control-bg-border-focus);outline:none;z-index:1}.TextField-InputContainer_view_default.TextField-InputContainer_focus.TextField-InputContainer_form_clearClear{box-shadow:var(--control-border-width) 0 var(--color-control-bg-border-focus),calc(var(--control-border-width)*-1) 0 var(--color-control-bg-border-focus)}.TextField-InputContainer_view_default.TextField-InputContainer_focus.TextField-InputContainer_form_brickClear,.TextField-InputContainer_view_default.TextField-InputContainer_focus.TextField-InputContainer_form_defaultClear,.TextField-InputContainer_view_default.TextField-InputContainer_focus.TextField-InputContainer_form_roundClear{box-shadow:var(--control-border-width) 0 var(--color-control-bg-border-focus)}.TextField-InputContainer_view_default.TextField-InputContainer_focus.TextField-InputContainer_form_clearBrick,.TextField-InputContainer_view_default.TextField-InputContainer_focus.TextField-InputContainer_form_clearDefault,.TextField-InputContainer_view_default.TextField-InputContainer_focus.TextField-InputContainer_form_clearRound{box-shadow:calc(var(--control-border-width)*-1) 0 var(--color-control-bg-border-focus)}.TextField-InputContainer_view_default.TextField-InputContainer_disabled{--clear-button-color:var(--color-control-typo-disable);background:var(--color-control-bg-disable);border-color:var(--color-control-bg-border-disable)}.TextField-InputContainer_view_default.TextField-InputContainer_disabled .TextField-Input{color:var(--color-control-typo-disable);pointer-events:all}.TextField-InputContainer_view_default.TextField-InputContainer_disabled .TextField-Input::-moz-placeholder{color:var(--color-control-typo-disable)}.TextField-InputContainer_view_default.TextField-InputContainer_disabled .TextField-Input::placeholder{color:var(--color-control-typo-disable)}.TextField-InputContainer_view_default.TextField-InputContainer_disabled .TextField-Side_type_string,.TextField-InputContainer_view_default.TextField-InputContainer_disabled.TextField-InputContainer .TextField-Icon,.TextField-InputContainer_view_default.TextField-InputContainer_disabled.TextField-InputContainer_withValue .TextField-Icon,.TextField-InputContainer_view_default.TextField-InputContainer_disabled.TextField-InputContainer_withValue .TextField-Side_type_string{color:var(--color-control-typo-disable)}.TextField-InputContainer_form_defaultClear{border-right-width:0}.TextField-InputContainer_form_defaultBrick,.TextField-InputContainer_form_defaultClear{border-radius:var(--control-radius) 0 0 var(--control-radius)}.TextField-InputContainer_form_round{border-radius:calc(var(--input-height)/2);padding-left:calc(var(--input-space)*1.6);padding-right:calc(var(--input-space)*1.6)}.TextField-InputContainer_form_roundBrick{border-radius:calc(var(--input-height)/2) 0 0 calc(var(--input-height)/2);padding-left:calc(var(--input-space)*1.6)}.TextField-InputContainer_form_roundClear{border-radius:calc(var(--input-height)/2) 0 0 calc(var(--input-height)/2);border-right-width:0;padding-left:calc(var(--input-space)*1.6)}.TextField-InputContainer_form_brick{border-radius:0}.TextField-InputContainer_form_brickDefault{border-radius:0 var(--control-radius) var(--control-radius) 0}.TextField-InputContainer_form_brickRound{border-radius:0 calc(var(--input-height)/2) calc(var(--input-height)/2) 0;padding-right:calc(var(--input-space)*1.6)}.TextField-InputContainer_form_brickClear{border-radius:0;border-right-width:0}.TextField-InputContainer_form_clearDefault{border-left-width:0;border-radius:0 var(--control-radius) var(--control-radius) 0}.TextField-InputContainer_form_clearBrick{border-left-width:0;border-radius:0}.TextField-InputContainer_form_clearRound{border-left-width:0;border-radius:0 calc(var(--input-height)/2) calc(var(--input-height)/2) 0;padding-right:calc(var(--input-space)*1.6)}.TextField-InputContainer_form_clearClear{border-width:0;border-bottom-width:var(--control-border-width);border-radius:0;border-top-width:var(--control-border-width)}.TextField-InputContainer_withValue .TextField-Side.TextField-Side_type_string{color:var(--color-control-typo-default)}.TextField-InputContainer_withValue .TextField-Icon{color:var(--color-typo-secondary)}.TextField-InputContainer_type_number{padding-right:0}.TextField-InputContainer_type_textarea .TextField-Input{display:block;line-height:var(--line-height-text-m);min-width:0;padding-bottom:calc((var(--input-height) - (var(--control-border-width)*2) - var(--line-height-text-m))/2);padding-top:calc((var(--input-height) - (var(--control-border-width)*2) - var(--line-height-text-m))/2);resize:none}.TextField-Counter{display:inline-flex;flex-direction:column;height:calc(var(--input-height) - var(--control-border-width)*2);width:var(--space-xl)}.TextField-CounterButton{align-items:center;background-color:var(--counter-button-background);border:none;color:var(--counter-button-icon-color);cursor:pointer;display:inline-flex;flex:1;flex-direction:column;justify-content:center;margin:0;overflow-y:hidden;padding:0;transition:background-color .15s;width:var(--space-xl)}.TextField-ClearButton,.TextField-EyeButton{background-color:transparent;border:none;cursor:pointer;display:flex;flex-direction:column;height:calc(var(--input-height) - var(--control-border-width)*2);justify-content:center;margin:0;margin-left:var(--input-space);padding:0}.TextField-ClearButton{color:var(--clear-button-color)}.TextField-ClearButton:hover{--clear-button-color:var(--color-control-typo-clear-hover)}.TextField-EyeButton{color:var(--color-control-typo-placeholder)}.TextField-EyeButton:hover{color:var(--color-control-typo-clear-hover)}.TextField-ClearButtonIcon{position:relative;top:1px}.TextField-Input{background:transparent;border:none;color:currentColor;flex:1;font-family:var(--font-primary);font-size:var(--input-font-size);height:calc(var(--input-height) - var(--control-border-width)*2);min-width:80px;outline:none;padding:0;width:100%}.TextField-Input::-webkit-inner-spin-button,.TextField-Input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.TextField-Input[type=password]::-ms-reveal{display:none}.TextField-Input[type=number]{-moz-appearance:textfield}.TextField-Input:focus{outline:none}.TextField-Input:-webkit-autofill,.TextField-Input:-webkit-autofill:focus,.TextField-Input:-webkit-autofill:hover{border:none;-webkit-box-shadow:inset 0 0 0 1000px transparent;-webkit-transition:background-color 5000s ease-in-out 0s;transition:background-color 5000s ease-in-out 0s}.TextField-Side{align-items:center;display:flex;height:calc(var(--input-height) - var(--control-border-width)*2);overflow:hidden}.TextField-Side_position_left{margin-right:var(--input-space)}.TextField-Side_position_right{margin-left:var(--input-space)}.TextField-Side_type_string{font-size:var(--input-font-size);white-space:nowrap}.TextField-Icon{color:var(--color-control-typo-placeholder)}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export*from"./TextField";
|
|
1
|
+
export*from"./TextField";export*from"./useIMask";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/TextField/index.ts"],"sourcesContent":["export * from './TextField';\n"],"mappings":"AAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/TextField/index.ts"],"sourcesContent":["export * from './TextField';\nexport * from './useIMask';\n"],"mappings":"AAAA,yBACA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import IMask from 'imask';
|
|
3
|
+
declare type Props<MASK extends IMask.AnyMaskedOptions> = {
|
|
4
|
+
value: string | null;
|
|
5
|
+
onChange?: (value: string | null, params: {
|
|
6
|
+
e: Event;
|
|
7
|
+
value: string | null;
|
|
8
|
+
}) => void;
|
|
9
|
+
maskOptions: string | MASK;
|
|
10
|
+
};
|
|
11
|
+
export declare function useIMask<MASK extends IMask.AnyMaskedOptions>(props: Props<MASK>): {
|
|
12
|
+
inputRef: import("react").RefObject<HTMLInputElement>;
|
|
13
|
+
imaskRef: import("react").MutableRefObject<IMask.InputMask<MASK> | null>;
|
|
14
|
+
};
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import IMask from"imask";import{useCallback,useEffect,useRef}from"react";import{useMutableRef}from"../../hooks/useMutableRef";export function useIMask(a){var b=a.value,c=a.maskOptions,d=a.onChange,e=useRef(null),f=useRef(null),g=useMutableRef(d);useEffect(function(){if(e.current){var a="string"==typeof c?{mask:c}:c;f.current?f.current.updateOptions(a):f.current=IMask(e.current,a)}},[e.current,c]),useEffect(function(){return function(){var a;null===(a=f.current)||void 0===a?void 0:a.destroy()}},[]);var h=useCallback(function(a){var b,c,d=(null===(b=f.current)||void 0===b?void 0:b.value)||null;null===(c=g.current)||void 0===c?void 0:c.call(g,d,{e:a,value:d})},[]);return useEffect(function(){var a;return null===(a=f.current)||void 0===a?void 0:a.on("accept",h),function(){var a;null===(a=f.current)||void 0===a?void 0:a.off("accept",h)}},[]),useEffect(function(){var a;null===(a=f.current)||void 0===a?void 0:a.updateValue()},[b]),{inputRef:e,imaskRef:f}}
|
|
2
|
+
//# sourceMappingURL=useIMask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useIMask.js","names":["IMask","useCallback","useEffect","useRef","useMutableRef","useIMask","props","value","maskOptions","onChange","inputRef","imaskRef","handleChanheRef","current","options","mask","updateOptions","destroy","onAcept","e","on","off","updateValue"],"sources":["../../../../../src/components/TextField/useIMask.ts"],"sourcesContent":["import IMask from 'imask';\nimport { useCallback, useEffect, useRef } from 'react';\n\nimport { useMutableRef } from '##/hooks/useMutableRef';\n\ntype Props<MASK extends IMask.AnyMaskedOptions> = {\n value: string | null;\n onChange?: (\n value: string | null,\n params: { e: Event; value: string | null },\n ) => void;\n maskOptions: string | MASK;\n};\nexport function useIMask<MASK extends IMask.AnyMaskedOptions>(\n props: Props<MASK>,\n) {\n const { value, maskOptions, onChange } = props;\n const inputRef = useRef<HTMLInputElement>(null);\n const imaskRef = useRef<IMask.InputMask<MASK> | null>(null);\n const handleChanheRef = useMutableRef(onChange);\n\n useEffect(() => {\n if (inputRef.current) {\n const options = (\n typeof maskOptions === 'string' ? { mask: maskOptions } : maskOptions\n ) as MASK;\n if (imaskRef.current) {\n imaskRef.current.updateOptions(options);\n } else {\n imaskRef.current = IMask(inputRef.current, options);\n }\n }\n }, [inputRef.current, maskOptions]);\n\n useEffect(() => {\n return () => {\n imaskRef.current?.destroy();\n };\n }, []);\n\n // Нужно для синхранизации value c Imask,\n // так как value мы можем задать через пропс без самого ввода,\n // и Imask требует ручной синхронихации в этом случае\n const onAcept = useCallback((e: Event) => {\n const value = imaskRef.current?.value || null;\n handleChanheRef.current?.(value, { e, value });\n }, []);\n\n useEffect(() => {\n imaskRef.current?.on('accept', onAcept);\n return () => {\n imaskRef.current?.off('accept', onAcept);\n };\n }, []);\n\n useEffect(() => {\n imaskRef.current?.updateValue();\n }, [value]);\n\n return {\n inputRef,\n imaskRef,\n };\n}\n"],"mappings":"AAAA,MAAOA,MAAP,KAAkB,OAAlB,CACA,OAASC,WAAT,CAAsBC,SAAtB,CAAiCC,MAAjC,KAA+C,OAA/C,CAEA,OAASC,aAAT,iCAUA,MAAO,SAASC,SAAT,CACLC,CADK,CAEL,IACQC,EADR,CACyCD,CADzC,CACQC,KADR,CACeC,CADf,CACyCF,CADzC,CACeE,WADf,CAC4BC,CAD5B,CACyCH,CADzC,CAC4BG,QAD5B,CA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B,SAAS,CAAC,UAAM,iBACdS,CAAQ,CAACE,OADK,qBACd,EAAkBS,WAAlB,EACD,CAFQ,CAEN,CAACf,CAAD,CAFM,CAIT,CAAO,CACLG,QAAQ,CAARA,CADK,CAELC,QAAQ,CAARA,CAFK,CAIR"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["placeholder","onBlur","onFocus","items","onChange","value","disabled","ariaLabel","id","isLoading","required","dropdownRef","form","view","size","dropdownClassName","name","groups","getItemKey","getItemLabel","getItemSubLabel","getItemAvatarUrl","getItemGroupKey","getItemDisabled","getGroupKey","getGroupLabel","renderItem","renderValue","onCreate","inputRef","labelForNotFound","labelForCreate","labelForEmptyItems","multiple","searchFunction","style","dropdownForm"];import"../SelectComponents/Select.css";import{IconClose}from"@consta/icons/IconClose";import{IconSelect}from"@consta/icons/IconSelect";import React,{forwardRef,useRef}from"react";import{useForkRef}from"../../hooks/useForkRef/useForkRef";import{useSelect}from"../../hooks/useSelect/useSelect";import{cnMixFocus}from"../../mixs/MixFocus/MixFocus";import{usePropsHandler}from"../EventInterceptor/usePropsHandler";import{cnSelect}from"../SelectComponents/cnSelect";import{defaultlabelForCreate,defaultLabelForEmptyItems,defaultlabelForNotFound,getInputWidth}from"../SelectComponents/helpers";import{SelectContainer}from"../SelectComponents/SelectContainer/SelectContainer";import{SelectDropdown}from"../SelectComponents/SelectDropdown/SelectDropdown";import{defaultPropForm,defaultPropSize,defaultPropView}from"../SelectComponents/types";import{isMultipleParams,isNotMultipleParams,searchCompare,withDefaultGetters}from"./helpers";import{UserSelectItem}from"./UserSelectItem/UserSelectItem";import{UserSelectValue}from"./UserSelectValue/UserSelectValue";export var COMPONENT_NAME="UserSelect";var UserSelectRender=function(a,b){var c=useRef(null),d=useRef(null),e=useRef(null),f=useRef(null),g=usePropsHandler(COMPONENT_NAME,withDefaultGetters(a),f),h=g.placeholder,i=g.onBlur,j=g.onFocus,k=g.items,l=g.onChange,m=g.value,n=g.disabled,o=g.ariaLabel,p=g.id,q=g.isLoading,r=g.required,s=g.dropdownRef,t=void 0===s?c:s,u=g.form,v=void 0===u?defaultPropForm:u,w=g.view,x=void 0===w?defaultPropView:w,y=g.size,z=void 0===y?defaultPropSize:y,A=g.dropdownClassName,B=g.
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["placeholder","onBlur","onFocus","items","onChange","value","disabled","ariaLabel","id","isLoading","required","dropdownRef","form","view","size","dropdownClassName","searchValue","name","groups","getItemKey","getItemLabel","getItemSubLabel","getItemAvatarUrl","getItemGroupKey","getItemDisabled","getGroupKey","getGroupLabel","renderItem","renderValue","onCreate","inputRef","labelForNotFound","labelForCreate","labelForEmptyItems","multiple","searchFunction","style","dropdownForm"];import"../SelectComponents/Select.css";import{IconClose}from"@consta/icons/IconClose";import{IconSelect}from"@consta/icons/IconSelect";import React,{forwardRef,useRef}from"react";import{useForkRef}from"../../hooks/useForkRef/useForkRef";import{useSelect}from"../../hooks/useSelect/useSelect";import{cnMixFocus}from"../../mixs/MixFocus/MixFocus";import{usePropsHandler}from"../EventInterceptor/usePropsHandler";import{cnSelect}from"../SelectComponents/cnSelect";import{defaultlabelForCreate,defaultLabelForEmptyItems,defaultlabelForNotFound,getInputWidth}from"../SelectComponents/helpers";import{SelectContainer}from"../SelectComponents/SelectContainer/SelectContainer";import{SelectDropdown}from"../SelectComponents/SelectDropdown/SelectDropdown";import{defaultPropForm,defaultPropSize,defaultPropView}from"../SelectComponents/types";import{isMultipleParams,isNotMultipleParams,searchCompare,withDefaultGetters}from"./helpers";import{UserSelectItem}from"./UserSelectItem/UserSelectItem";import{UserSelectValue}from"./UserSelectValue/UserSelectValue";export var COMPONENT_NAME="UserSelect";var UserSelectRender=function(a,b){var c=useRef(null),d=useRef(null),e=useRef(null),f=useRef(null),g=usePropsHandler(COMPONENT_NAME,withDefaultGetters(a),f),h=g.placeholder,i=g.onBlur,j=g.onFocus,k=g.items,l=g.onChange,m=g.value,n=g.disabled,o=g.ariaLabel,p=g.id,q=g.isLoading,r=g.required,s=g.dropdownRef,t=void 0===s?c:s,u=g.form,v=void 0===u?defaultPropForm:u,w=g.view,x=void 0===w?defaultPropView:w,y=g.size,z=void 0===y?defaultPropSize:y,A=g.dropdownClassName,B=g.searchValue,C=g.name,D=g.groups,E=void 0===D?[]:D,F=g.getItemKey,G=g.getItemLabel,H=g.getItemSubLabel,I=g.getItemAvatarUrl,J=g.getItemGroupKey,K=g.getItemDisabled,L=g.getGroupKey,M=g.getGroupLabel,N=g.renderItem,O=g.renderValue,P=g.onCreate,Q=g.inputRef,R=g.labelForNotFound,S=void 0===R?defaultlabelForNotFound:R,T=g.labelForCreate,U=void 0===T?defaultlabelForCreate:T,V=g.labelForEmptyItems,W=void 0===V?defaultLabelForEmptyItems:V,X=g.multiple,Y=void 0!==X&&X,Z=g.searchFunction,$=g.style,_=g.dropdownForm,aa=void 0===_?"default":_,ba=_objectWithoutProperties(g,_excluded),ca=useSelect({items:k,groups:E,value:m,onChange:l,dropdownRef:t,controlRef:f,disabled:n,getItemLabel:G,getItemKey:F,getGroupKey:L,getItemGroupKey:J,searchValue:B,getItemDisabled:K,multiple:Y,onBlur:i,onFocus:j,onCreate:P,searchFunction:Z||function searchFunctionDefault(a,b){var c=searchCompare(b,G(a));return c?c:searchCompare(b,H(a))}}),da=ca.getKeyProps,ea=ca.getOptionProps,fa=ca.isOpen,ga=ca.visibleItems,ha=ca.isFocused,ia=ca.handleInputFocus,ja=ca.handleInputBlur,ka=ca.handleToggleDropdown,la=ca.inputRef,ma=ca.handleInputClick,na=ca.handleInputChange,oa=ca.searchValue,pa=ca.clearValue,qa=ca.getHandleRemoveValue,ra=ca.notFound,sa=ca.hasItems,ta=O||function renderValueDefault(a){var b=a.item,c=a.handleRemove;return React.createElement(UserSelectValue,{label:G(b),subLabel:H(b),avatarUrl:I(b),key:F(b),size:z,handleRemove:c,multiple:Y,disabled:n||K(b)})},ua=useForkRef([la,Q]),va=function(){var b=Y?getInputWidth(d,e):void 0;return React.createElement(React.Fragment,null,isMultipleParams(a)&&Array.isArray(a.value)&&a.value.map(function(a){return ta({item:a,handleRemove:qa(a)})}),isNotMultipleParams(a)&&a.value&&ta({item:a.value}),(!m||Array.isArray(m)&&0===m.length)&&!oa&&h&&React.createElement("span",{className:cnSelect("Placeholder"),title:"placeholder"},h),React.createElement("input",Object.assign({},da(),{type:"text",name:C,onFocus:ia,onBlur:ja,"aria-label":o,onChange:na,ref:ua,className:cnSelect("Input",{size:z,hide:!Y&&!!m,multiple:Y,isUserSelect:!0}),value:oa,style:{width:b}})))};return React.createElement(React.Fragment,null,React.createElement(SelectContainer,Object.assign({focused:ha,disabled:n,size:z,required:r,view:x,type:"userselect",form:v,multiple:!0,ref:b,style:$},ba),React.createElement("div",{className:cnSelect("Control",{hasInput:!0}),ref:f,"aria-expanded":fa,"aria-haspopup":"listbox",id:p},React.createElement("div",{className:cnSelect("ControlInner"),onClick:ma,role:"button",ref:d,"aria-hidden":"true"},React.createElement("div",{className:cnSelect("ControlValueContainer")},Y?React.createElement("div",{className:cnSelect("ControlValue",{isUserSelect:!0})},va()):va())),React.createElement("span",{className:cnSelect("Indicators")},m&&React.createElement("button",{type:"button",onClick:pa,className:cnSelect("ClearIndicator",[cnMixFocus()])},React.createElement(IconClose,{size:"xs",className:cnSelect("ClearIndicatorIcon")})),React.createElement("span",{className:cnSelect("Delimiter")}),React.createElement("button",{type:"button",className:cnSelect("IndicatorsDropdown"),tabIndex:-1,onClick:ka},React.createElement(IconSelect,{size:"xs",className:cnSelect("DropdownIndicatorIcon")})))),React.createElement("div",{className:cnSelect("HelperInputFakeElement"),ref:e},oa)),React.createElement(SelectDropdown,{isOpen:fa,size:z,controlRef:f,getOptionProps:ea,dropdownRef:t,form:aa,isLoading:q,className:A,renderItem:N||function renderItemDefault(a){var b=a.item,c=a.active,d=a.hovered,e=a.onClick,f=a.onMouseEnter;return React.createElement(UserSelectItem,{label:G(b),subLabel:H(b),avatarUrl:I(b),active:c,hovered:d,size:z,indent:"round"===aa?"increased":"normal",onClick:e,onMouseEnter:f,disable:K(b),multiple:Y})},getGroupLabel:M,visibleItems:ga,labelForNotFound:S,labelForCreate:U,notFound:ra,hasItems:sa,labelForEmptyItems:W,style:"number"==typeof(null===$||void 0===$?void 0:$.zIndex)?{zIndex:$.zIndex+1}:void 0}))};export var UserSelect=forwardRef(UserSelectRender);export*from"./helpers";
|
|
2
2
|
//# sourceMappingURL=UserSelect.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserSelect.js","names":["IconClose","IconSelect","React","forwardRef","useRef","useForkRef","useSelect","cnMixFocus","usePropsHandler","cnSelect","defaultlabelForCreate","defaultLabelForEmptyItems","defaultlabelForNotFound","getInputWidth","SelectContainer","SelectDropdown","defaultPropForm","defaultPropSize","defaultPropView","isMultipleParams","isNotMultipleParams","searchCompare","withDefaultGetters","UserSelectItem","UserSelectValue","COMPONENT_NAME","UserSelectRender","props","ref","defaultDropdownRef","controlInnerRef","helperInputFakeElement","controlRef","placeholder","onBlur","onFocus","items","onChange","value","disabled","ariaLabel","id","isLoading","required","dropdownRef","form","view","size","dropdownClassName","name","groups","getItemKey","getItemLabel","getItemSubLabel","getItemAvatarUrl","getItemGroupKey","getItemDisabled","getGroupKey","getGroupLabel","renderItem","renderValueProp","renderValue","onCreate","inputRefProp","inputRef","labelForNotFound","labelForCreate","labelForEmptyItems","multiple","searchFunction","style","dropdownForm","restProps","searchFunctionDefault","item","searchValue","searchOfLabel","getKeyProps","getOptionProps","isOpen","visibleItems","isFocused","handleInputFocus","handleInputBlur","handleToggleDropdown","handleInputClick","handleInputChange","clearValue","getHandleRemoveValue","notFound","hasItems","renderValueDefault","handleRemove","inputRefForRender","renderControlValue","width","Array","isArray","map","length","hide","isUserSelect","hasInput","renderItemDefault","active","hovered","onClick","onMouseEnter","zIndex","UserSelect"],"sources":["../../../../../src/components/UserSelect/UserSelect.tsx"],"sourcesContent":["import '../SelectComponents/Select.css';\n\nimport { IconClose } from '@consta/icons/IconClose';\nimport { IconSelect } from '@consta/icons/IconSelect';\nimport React, { forwardRef, useRef } from 'react';\n\nimport { useForkRef } from '../../hooks/useForkRef/useForkRef';\nimport { useSelect } from '../../hooks/useSelect/useSelect';\nimport { cnMixFocus } from '../../mixs/MixFocus/MixFocus';\nimport { usePropsHandler } from '../EventInterceptor/usePropsHandler';\nimport { cnSelect } from '../SelectComponents/cnSelect';\nimport {\n defaultlabelForCreate,\n defaultLabelForEmptyItems,\n defaultlabelForNotFound,\n getInputWidth,\n} from '../SelectComponents/helpers';\nimport { SelectContainer } from '../SelectComponents/SelectContainer/SelectContainer';\nimport { SelectDropdown } from '../SelectComponents/SelectDropdown/SelectDropdown';\nimport {\n defaultPropForm,\n defaultPropSize,\n defaultPropView,\n} from '../SelectComponents/types';\nimport {\n DefaultGroup,\n DefaultItem,\n isMultipleParams,\n isNotMultipleParams,\n PropRenderItem,\n PropRenderValue,\n searchCompare,\n UserSelectComponent,\n UserSelectProps,\n withDefaultGetters,\n} from './helpers';\nimport { UserSelectItem } from './UserSelectItem/UserSelectItem';\nimport { UserSelectValue } from './UserSelectValue/UserSelectValue';\n\nexport const COMPONENT_NAME = 'UserSelect' as const;\n\nconst UserSelectRender = <\n ITEM = DefaultItem,\n GROUP = DefaultGroup,\n MULTIPLE extends boolean = false,\n>(\n props: UserSelectProps<ITEM, GROUP, MULTIPLE>,\n ref: React.Ref<HTMLDivElement>,\n) => {\n const defaultDropdownRef = useRef<HTMLDivElement | null>(null);\n const controlInnerRef = useRef<HTMLDivElement>(null);\n const helperInputFakeElement = useRef<HTMLDivElement>(null);\n const controlRef = useRef<HTMLDivElement | null>(null);\n\n const {\n placeholder,\n onBlur,\n onFocus,\n items,\n onChange,\n value,\n disabled,\n ariaLabel,\n id,\n isLoading,\n required,\n dropdownRef = defaultDropdownRef,\n form = defaultPropForm,\n view = defaultPropView,\n size = defaultPropSize,\n dropdownClassName,\n name,\n groups = [],\n getItemKey,\n getItemLabel,\n getItemSubLabel,\n getItemAvatarUrl,\n getItemGroupKey,\n getItemDisabled,\n getGroupKey,\n getGroupLabel,\n renderItem,\n renderValue: renderValueProp,\n onCreate,\n inputRef: inputRefProp,\n labelForNotFound = defaultlabelForNotFound,\n labelForCreate = defaultlabelForCreate,\n labelForEmptyItems = defaultLabelForEmptyItems,\n multiple = false,\n searchFunction,\n style,\n dropdownForm = 'default',\n ...restProps\n } = usePropsHandler(COMPONENT_NAME, withDefaultGetters(props), controlRef);\n\n const searchFunctionDefault = (item: ITEM, searchValue: string): boolean => {\n const searchOfLabel = searchCompare(searchValue, getItemLabel(item));\n\n if (searchOfLabel) {\n return searchOfLabel;\n }\n\n return searchCompare(searchValue, getItemSubLabel(item));\n };\n\n const {\n getKeyProps,\n getOptionProps,\n isOpen,\n visibleItems,\n isFocused,\n handleInputFocus,\n handleInputBlur,\n handleToggleDropdown,\n inputRef,\n handleInputClick,\n handleInputChange,\n searchValue,\n clearValue,\n getHandleRemoveValue,\n notFound,\n hasItems,\n } = useSelect({\n items,\n groups,\n value,\n onChange,\n dropdownRef,\n controlRef,\n disabled,\n getItemLabel,\n getItemKey,\n getGroupKey,\n getItemGroupKey,\n getItemDisabled,\n multiple,\n onBlur,\n onFocus,\n onCreate,\n searchFunction: searchFunction || searchFunctionDefault,\n });\n\n const renderItemDefault: PropRenderItem<ITEM> = (props) => {\n const { item, active, hovered, onClick, onMouseEnter } = props;\n\n return (\n <UserSelectItem\n label={getItemLabel(item)}\n subLabel={getItemSubLabel(item)}\n avatarUrl={getItemAvatarUrl(item)}\n active={active}\n hovered={hovered}\n size={size}\n indent={dropdownForm === 'round' ? 'increased' : 'normal'}\n onClick={onClick}\n onMouseEnter={onMouseEnter}\n disable={getItemDisabled(item)}\n multiple={multiple}\n />\n );\n };\n\n const renderValueDefault: PropRenderValue<ITEM> = ({\n item,\n handleRemove,\n }) => {\n return (\n <UserSelectValue\n label={getItemLabel(item)}\n subLabel={getItemSubLabel(item)}\n avatarUrl={getItemAvatarUrl(item)}\n key={getItemKey(item)}\n size={size}\n handleRemove={handleRemove}\n multiple={multiple}\n disabled={disabled}\n />\n );\n };\n\n const renderValue = renderValueProp || renderValueDefault;\n\n const inputRefForRender = useForkRef([inputRef, inputRefProp]);\n\n const renderControlValue = () => {\n const width = multiple\n ? getInputWidth(controlInnerRef, helperInputFakeElement)\n : undefined;\n return (\n <>\n {isMultipleParams(props) &&\n Array.isArray(props.value) &&\n props.value.map((item) =>\n renderValue({ item, handleRemove: getHandleRemoveValue(item) }),\n )}\n {isNotMultipleParams(props) &&\n props.value &&\n renderValue({ item: props.value })}\n {(!value || (Array.isArray(value) && value.length === 0)) &&\n !searchValue &&\n placeholder && (\n <span className={cnSelect('Placeholder')} title=\"placeholder\">\n {placeholder}\n </span>\n )}\n <input\n {...getKeyProps()}\n type=\"text\"\n name={name}\n onFocus={handleInputFocus}\n onBlur={handleInputBlur}\n aria-label={ariaLabel}\n onChange={handleInputChange}\n ref={inputRefForRender}\n className={cnSelect('Input', {\n size,\n hide: !multiple && !!value,\n multiple,\n isUserSelect: true,\n })}\n value={searchValue}\n style={{ width }}\n />\n </>\n );\n };\n\n return (\n <>\n <SelectContainer\n focused={isFocused}\n disabled={disabled}\n size={size}\n required={required}\n view={view}\n type=\"userselect\"\n form={form}\n multiple\n ref={ref}\n style={style}\n {...restProps}\n >\n <div\n className={cnSelect('Control', { hasInput: true })}\n ref={controlRef}\n aria-expanded={isOpen}\n aria-haspopup=\"listbox\"\n id={id}\n >\n <div\n className={cnSelect('ControlInner')}\n onClick={handleInputClick}\n role=\"button\"\n ref={controlInnerRef}\n aria-hidden=\"true\"\n >\n <div className={cnSelect('ControlValueContainer')}>\n {multiple ? (\n <div\n className={cnSelect('ControlValue', { isUserSelect: true })}\n >\n {renderControlValue()}\n </div>\n ) : (\n renderControlValue()\n )}\n </div>\n </div>\n <span className={cnSelect('Indicators')}>\n {value && (\n <button\n type=\"button\"\n onClick={clearValue}\n className={cnSelect('ClearIndicator', [cnMixFocus()])}\n >\n <IconClose\n size=\"xs\"\n className={cnSelect('ClearIndicatorIcon')}\n />\n </button>\n )}\n <span className={cnSelect('Delimiter')} />\n <button\n type=\"button\"\n className={cnSelect('IndicatorsDropdown')}\n tabIndex={-1}\n onClick={handleToggleDropdown}\n >\n <IconSelect\n size=\"xs\"\n className={cnSelect('DropdownIndicatorIcon')}\n />\n </button>\n </span>\n </div>\n <div\n className={cnSelect('HelperInputFakeElement')}\n ref={helperInputFakeElement}\n >\n {searchValue}\n </div>\n </SelectContainer>\n <SelectDropdown\n isOpen={isOpen}\n size={size}\n controlRef={controlRef}\n getOptionProps={getOptionProps}\n dropdownRef={dropdownRef}\n form={dropdownForm}\n isLoading={isLoading}\n className={dropdownClassName}\n renderItem={renderItem || renderItemDefault}\n getGroupLabel={getGroupLabel}\n visibleItems={visibleItems}\n labelForNotFound={labelForNotFound}\n labelForCreate={labelForCreate}\n notFound={notFound}\n hasItems={hasItems}\n labelForEmptyItems={labelForEmptyItems}\n style={\n typeof style?.zIndex === 'number'\n ? { zIndex: style.zIndex + 1 }\n : undefined\n }\n />\n </>\n );\n};\n\nexport const UserSelect = forwardRef(UserSelectRender) as UserSelectComponent;\n\nexport * from './helpers';\n"],"mappings":"2jBAAA,uCAEA,OAASA,SAAT,KAA0B,yBAA1B,CACA,OAASC,UAAT,KAA2B,0BAA3B,CACA,MAAOC,MAAP,EAAgBC,UAAhB,CAA4BC,MAA5B,KAA0C,OAA1C,CAEA,OAASC,UAAT,yCACA,OAASC,SAAT,uCACA,OAASC,UAAT,oCACA,OAASC,eAAT,2CACA,OAASC,QAAT,oCACA,OACEC,qBADF,CAEEC,yBAFF,CAGEC,uBAHF,CAIEC,aAJF,mCAMA,OAASC,eAAT,2DACA,OAASC,cAAT,yDACA,OACEC,eADF,CAEEC,eAFF,CAGEC,eAHF,iCAKA,OAGEC,gBAHF,CAIEC,mBAJF,CAOEC,aAPF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B,CAcE,QAAQ,CAAEuB,EAdZ,CAeE,QAAQ,CAAEC,EAfZ,CAgBE,kBAAkB,CAAEvB,CAhBtB,CAiBE,KAAK,CACsB,QAAzB,gBAAOG,CAAP,WAAOA,CAAP,QAAOA,CAAK,CAAEsC,MAAd,EACI,CAAEA,MAAM,CAAEtC,CAAK,CAACsC,MAAN,CAAe,CAAzB,CADJ,OAlBJ,EA1EF,CAmGH,CA9RD,CAgSA,MAAO,IAAMC,WAAU,CAAG1G,UAAU,CAACuB,gBAAD,CAA7B,CAEP"}
|
|
1
|
+
{"version":3,"file":"UserSelect.js","names":["IconClose","IconSelect","React","forwardRef","useRef","useForkRef","useSelect","cnMixFocus","usePropsHandler","cnSelect","defaultlabelForCreate","defaultLabelForEmptyItems","defaultlabelForNotFound","getInputWidth","SelectContainer","SelectDropdown","defaultPropForm","defaultPropSize","defaultPropView","isMultipleParams","isNotMultipleParams","searchCompare","withDefaultGetters","UserSelectItem","UserSelectValue","COMPONENT_NAME","UserSelectRender","props","ref","defaultDropdownRef","controlInnerRef","helperInputFakeElement","controlRef","placeholder","onBlur","onFocus","items","onChange","value","disabled","ariaLabel","id","isLoading","required","dropdownRef","form","view","size","dropdownClassName","searchValueProp","searchValue","name","groups","getItemKey","getItemLabel","getItemSubLabel","getItemAvatarUrl","getItemGroupKey","getItemDisabled","getGroupKey","getGroupLabel","renderItem","renderValueProp","renderValue","onCreate","inputRefProp","inputRef","labelForNotFound","labelForCreate","labelForEmptyItems","multiple","searchFunction","style","dropdownForm","restProps","searchFunctionDefault","item","searchOfLabel","getKeyProps","getOptionProps","isOpen","visibleItems","isFocused","handleInputFocus","handleInputBlur","handleToggleDropdown","handleInputClick","handleInputChange","clearValue","getHandleRemoveValue","notFound","hasItems","renderValueDefault","handleRemove","inputRefForRender","renderControlValue","width","Array","isArray","map","length","hide","isUserSelect","hasInput","renderItemDefault","active","hovered","onClick","onMouseEnter","zIndex","UserSelect"],"sources":["../../../../../src/components/UserSelect/UserSelect.tsx"],"sourcesContent":["import '../SelectComponents/Select.css';\n\nimport { IconClose } from '@consta/icons/IconClose';\nimport { IconSelect } from '@consta/icons/IconSelect';\nimport React, { forwardRef, useRef } from 'react';\n\nimport { useForkRef } from '../../hooks/useForkRef/useForkRef';\nimport { useSelect } from '../../hooks/useSelect/useSelect';\nimport { cnMixFocus } from '../../mixs/MixFocus/MixFocus';\nimport { usePropsHandler } from '../EventInterceptor/usePropsHandler';\nimport { cnSelect } from '../SelectComponents/cnSelect';\nimport {\n defaultlabelForCreate,\n defaultLabelForEmptyItems,\n defaultlabelForNotFound,\n getInputWidth,\n} from '../SelectComponents/helpers';\nimport { SelectContainer } from '../SelectComponents/SelectContainer/SelectContainer';\nimport { SelectDropdown } from '../SelectComponents/SelectDropdown/SelectDropdown';\nimport {\n defaultPropForm,\n defaultPropSize,\n defaultPropView,\n} from '../SelectComponents/types';\nimport {\n DefaultGroup,\n DefaultItem,\n isMultipleParams,\n isNotMultipleParams,\n PropRenderItem,\n PropRenderValue,\n searchCompare,\n UserSelectComponent,\n UserSelectProps,\n withDefaultGetters,\n} from './helpers';\nimport { UserSelectItem } from './UserSelectItem/UserSelectItem';\nimport { UserSelectValue } from './UserSelectValue/UserSelectValue';\n\nexport const COMPONENT_NAME = 'UserSelect' as const;\n\nconst UserSelectRender = <\n ITEM = DefaultItem,\n GROUP = DefaultGroup,\n MULTIPLE extends boolean = false,\n>(\n props: UserSelectProps<ITEM, GROUP, MULTIPLE>,\n ref: React.Ref<HTMLDivElement>,\n) => {\n const defaultDropdownRef = useRef<HTMLDivElement | null>(null);\n const controlInnerRef = useRef<HTMLDivElement>(null);\n const helperInputFakeElement = useRef<HTMLDivElement>(null);\n const controlRef = useRef<HTMLDivElement | null>(null);\n\n const {\n placeholder,\n onBlur,\n onFocus,\n items,\n onChange,\n value,\n disabled,\n ariaLabel,\n id,\n isLoading,\n required,\n dropdownRef = defaultDropdownRef,\n form = defaultPropForm,\n view = defaultPropView,\n size = defaultPropSize,\n dropdownClassName,\n searchValue: searchValueProp,\n name,\n groups = [],\n getItemKey,\n getItemLabel,\n getItemSubLabel,\n getItemAvatarUrl,\n getItemGroupKey,\n getItemDisabled,\n getGroupKey,\n getGroupLabel,\n renderItem,\n renderValue: renderValueProp,\n onCreate,\n inputRef: inputRefProp,\n labelForNotFound = defaultlabelForNotFound,\n labelForCreate = defaultlabelForCreate,\n labelForEmptyItems = defaultLabelForEmptyItems,\n multiple = false,\n searchFunction,\n style,\n dropdownForm = 'default',\n ...restProps\n } = usePropsHandler(COMPONENT_NAME, withDefaultGetters(props), controlRef);\n\n const searchFunctionDefault = (item: ITEM, searchValue: string): boolean => {\n const searchOfLabel = searchCompare(searchValue, getItemLabel(item));\n\n if (searchOfLabel) {\n return searchOfLabel;\n }\n\n return searchCompare(searchValue, getItemSubLabel(item));\n };\n\n const {\n getKeyProps,\n getOptionProps,\n isOpen,\n visibleItems,\n isFocused,\n handleInputFocus,\n handleInputBlur,\n handleToggleDropdown,\n inputRef,\n handleInputClick,\n handleInputChange,\n searchValue,\n clearValue,\n getHandleRemoveValue,\n notFound,\n hasItems,\n } = useSelect({\n items,\n groups,\n value,\n onChange,\n dropdownRef,\n controlRef,\n disabled,\n getItemLabel,\n getItemKey,\n getGroupKey,\n getItemGroupKey,\n searchValue: searchValueProp,\n getItemDisabled,\n multiple,\n onBlur,\n onFocus,\n onCreate,\n searchFunction: searchFunction || searchFunctionDefault,\n });\n\n const renderItemDefault: PropRenderItem<ITEM> = (props) => {\n const { item, active, hovered, onClick, onMouseEnter } = props;\n\n return (\n <UserSelectItem\n label={getItemLabel(item)}\n subLabel={getItemSubLabel(item)}\n avatarUrl={getItemAvatarUrl(item)}\n active={active}\n hovered={hovered}\n size={size}\n indent={dropdownForm === 'round' ? 'increased' : 'normal'}\n onClick={onClick}\n onMouseEnter={onMouseEnter}\n disable={getItemDisabled(item)}\n multiple={multiple}\n />\n );\n };\n\n const renderValueDefault: PropRenderValue<ITEM> = ({\n item,\n handleRemove,\n }) => {\n return (\n <UserSelectValue\n label={getItemLabel(item)}\n subLabel={getItemSubLabel(item)}\n avatarUrl={getItemAvatarUrl(item)}\n key={getItemKey(item)}\n size={size}\n handleRemove={handleRemove}\n multiple={multiple}\n disabled={disabled || getItemDisabled(item)}\n />\n );\n };\n\n const renderValue = renderValueProp || renderValueDefault;\n\n const inputRefForRender = useForkRef([inputRef, inputRefProp]);\n\n const renderControlValue = () => {\n const width = multiple\n ? getInputWidth(controlInnerRef, helperInputFakeElement)\n : undefined;\n return (\n <>\n {isMultipleParams(props) &&\n Array.isArray(props.value) &&\n props.value.map((item) =>\n renderValue({ item, handleRemove: getHandleRemoveValue(item) }),\n )}\n {isNotMultipleParams(props) &&\n props.value &&\n renderValue({ item: props.value })}\n {(!value || (Array.isArray(value) && value.length === 0)) &&\n !searchValue &&\n placeholder && (\n <span className={cnSelect('Placeholder')} title=\"placeholder\">\n {placeholder}\n </span>\n )}\n <input\n {...getKeyProps()}\n type=\"text\"\n name={name}\n onFocus={handleInputFocus}\n onBlur={handleInputBlur}\n aria-label={ariaLabel}\n onChange={handleInputChange}\n ref={inputRefForRender}\n className={cnSelect('Input', {\n size,\n hide: !multiple && !!value,\n multiple,\n isUserSelect: true,\n })}\n value={searchValue}\n style={{ width }}\n />\n </>\n );\n };\n\n return (\n <>\n <SelectContainer\n focused={isFocused}\n disabled={disabled}\n size={size}\n required={required}\n view={view}\n type=\"userselect\"\n form={form}\n multiple\n ref={ref}\n style={style}\n {...restProps}\n >\n <div\n className={cnSelect('Control', { hasInput: true })}\n ref={controlRef}\n aria-expanded={isOpen}\n aria-haspopup=\"listbox\"\n id={id}\n >\n <div\n className={cnSelect('ControlInner')}\n onClick={handleInputClick}\n role=\"button\"\n ref={controlInnerRef}\n aria-hidden=\"true\"\n >\n <div className={cnSelect('ControlValueContainer')}>\n {multiple ? (\n <div\n className={cnSelect('ControlValue', { isUserSelect: true })}\n >\n {renderControlValue()}\n </div>\n ) : (\n renderControlValue()\n )}\n </div>\n </div>\n <span className={cnSelect('Indicators')}>\n {value && (\n <button\n type=\"button\"\n onClick={clearValue}\n className={cnSelect('ClearIndicator', [cnMixFocus()])}\n >\n <IconClose\n size=\"xs\"\n className={cnSelect('ClearIndicatorIcon')}\n />\n </button>\n )}\n <span className={cnSelect('Delimiter')} />\n <button\n type=\"button\"\n className={cnSelect('IndicatorsDropdown')}\n tabIndex={-1}\n onClick={handleToggleDropdown}\n >\n <IconSelect\n size=\"xs\"\n className={cnSelect('DropdownIndicatorIcon')}\n />\n </button>\n </span>\n </div>\n <div\n className={cnSelect('HelperInputFakeElement')}\n ref={helperInputFakeElement}\n >\n {searchValue}\n </div>\n </SelectContainer>\n <SelectDropdown\n isOpen={isOpen}\n size={size}\n controlRef={controlRef}\n getOptionProps={getOptionProps}\n dropdownRef={dropdownRef}\n form={dropdownForm}\n isLoading={isLoading}\n className={dropdownClassName}\n renderItem={renderItem || renderItemDefault}\n getGroupLabel={getGroupLabel}\n visibleItems={visibleItems}\n labelForNotFound={labelForNotFound}\n labelForCreate={labelForCreate}\n notFound={notFound}\n hasItems={hasItems}\n labelForEmptyItems={labelForEmptyItems}\n style={\n typeof style?.zIndex === 'number'\n ? { zIndex: style.zIndex + 1 }\n : undefined\n }\n />\n </>\n );\n};\n\nexport const UserSelect = forwardRef(UserSelectRender) as UserSelectComponent;\n\nexport * from './helpers';\n"],"mappings":"ykBAAA,uCAEA,OAASA,SAAT,KAA0B,yBAA1B,CACA,OAASC,UAAT,KAA2B,0BAA3B,CACA,MAAOC,MAAP,EAAgBC,UAAhB,CAA4BC,MAA5B,KAA0C,OAA1C,CAEA,OAASC,UAAT,yCACA,OAASC,SAAT,uCACA,OAASC,UAAT,oCACA,OAASC,eAAT,2CACA,OAASC,QAAT,oCACA,OACEC,qBADF,CAEEC,yBAFF,CAGEC,uBAHF,CAIEC,aAJF,mCAMA,OAASC,eAAT,2DACA,OAASC,cAAT,yDACA,OACEC,eADF,CAEEC,eAFF,CAGEC,eAHF,iCAKA,OAGEC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,CAAEN,CAXZ,EAcH,CA8IG,CAUE,aAAa,CAAEV,CAVjB,CAWE,YAAY,CAAEqB,EAXhB,CAYE,gBAAgB,CAAEd,CAZpB,CAaE,cAAc,CAAEC,CAblB,CAcE,QAAQ,CAAEsB,EAdZ,CAeE,QAAQ,CAAEC,EAfZ,CAgBE,kBAAkB,CAAEtB,CAhBtB,CAiBE,KAAK,CACsB,QAAzB,gBAAOG,CAAP,WAAOA,CAAP,QAAOA,CAAK,CAAEqC,MAAd,EACI,CAAEA,MAAM,CAAErC,CAAK,CAACqC,MAAN,CAAe,CAAzB,CADJ,OAlBJ,EA1EF,CAmGH,CAhSD,CAkSA,MAAO,IAAMC,WAAU,CAAG3G,UAAU,CAACuB,gBAAD,CAA7B,CAEP"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.UserSelectItem{align-items:center;background-color:var(--color-control-bg-clear);color:var(--color-control-typo-default);cursor:pointer;display:flex;font-size:var(--font-size);position:relative}.UserSelectItem_size_s{--font-size:var(--control-text-size-s);--sub-info-space:var(--space-xs);--sub-label-font-size:var(--size-text-2xs)}.UserSelectItem_size_m{--font-size:var(--control-text-size-m);--sub-info-space:var(--space-s);--sub-label-font-size:var(--size-text-xs)}.UserSelectItem_size_l{--font-size:var(--control-text-size-l);--sub-info-space:var(--space-s);--sub-label-font-size:var(--size-text-s)}.UserSelectItem_disable{color:var(--color-control-typo-disable)}.UserSelectItem_hovered{background-color:var(--color-control-bg-clear-hover)}.UserSelectItem_active{color:var(--color-control-typo-secondary)}.UserSelectItem_indent_increased{padding-left:calc(var(--horizontal-space)*2.6)}.UserSelectItem-AvatarContainer{position:relative}.UserSelectItem-CheckIcon{background-color:var(--color-control-bg-primary);border:1px solid var(--color-control-bg-default);border-radius:50%;bottom:calc(var(--space-2xs)*-1);color:var(--color-control-bg-default);height:var(--graphics-size-xs);padding:0;position:absolute;right:calc(var(--space-2xs)*-1);width:var(--graphics-size-xs)}.UserSelectItem-CheckIcon_animate_entered,.UserSelectItem-CheckIcon_animate_entering,.UserSelectItem-CheckIcon_animate_exited,.UserSelectItem-CheckIcon_animate_exiting{transition:.2s ease;transition-property:opacity,transform}.UserSelectItem-CheckIcon_animate_entered,.UserSelectItem-CheckIcon_animate_entering{opacity:1;transform:scale(1)}.UserSelectItem-CheckIcon_animate_exiting{opacity:0;transform:scale(.25)}.UserSelectItem-CheckIcon_animate_exited{opacity:0;transform:scale(0)}.UserSelectItem-Info{padding-left:var(--sub-info-space)}.UserSelectItem-SubLabel{font-size:var(--sub-label-font-size);opacity:.7}.UserSelectItem-SubLabel_disable{opacity:1}
|
|
1
|
+
.UserSelectItem{align-items:center;background-color:var(--color-control-bg-clear);color:var(--color-control-typo-default);cursor:pointer;display:flex;font-size:var(--font-size);position:relative}.UserSelectItem_size_s{--font-size:var(--control-text-size-s);--sub-info-space:var(--space-xs);--sub-label-font-size:var(--size-text-2xs)}.UserSelectItem_size_m{--font-size:var(--control-text-size-m);--sub-info-space:var(--space-s);--sub-label-font-size:var(--size-text-xs)}.UserSelectItem_size_l{--font-size:var(--control-text-size-l);--sub-info-space:var(--space-s);--sub-label-font-size:var(--size-text-s)}.UserSelectItem_disable{color:var(--color-control-typo-disable)}.UserSelectItem_disable .UserSelectItem-AvatarContainer{opacity:.6}.UserSelectItem_hovered{background-color:var(--color-control-bg-clear-hover)}.UserSelectItem_active{color:var(--color-control-typo-secondary)}.UserSelectItem_indent_increased{padding-left:calc(var(--horizontal-space)*2.6)}.UserSelectItem-AvatarContainer{position:relative}.UserSelectItem-CheckIcon{background-color:var(--color-control-bg-primary);border:1px solid var(--color-control-bg-default);border-radius:50%;bottom:calc(var(--space-2xs)*-1);color:var(--color-control-bg-default);height:var(--graphics-size-xs);padding:0;position:absolute;right:calc(var(--space-2xs)*-1);width:var(--graphics-size-xs)}.UserSelectItem-CheckIcon_animate_entered,.UserSelectItem-CheckIcon_animate_entering,.UserSelectItem-CheckIcon_animate_exited,.UserSelectItem-CheckIcon_animate_exiting{transition:.2s ease;transition-property:opacity,transform}.UserSelectItem-CheckIcon_animate_entered,.UserSelectItem-CheckIcon_animate_entering{opacity:1;transform:scale(1)}.UserSelectItem-CheckIcon_animate_exiting{opacity:0;transform:scale(.25)}.UserSelectItem-CheckIcon_animate_exited{opacity:0;transform:scale(0)}.UserSelectItem-Info{padding-left:var(--sub-info-space)}.UserSelectItem-SubLabel{font-size:var(--sub-label-font-size);opacity:.7}.UserSelectItem-SubLabel_disable{opacity:1}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.UserSelectValue_multiple{margin-bottom:calc(var(--space-s)/4);margin-right:var(--space-xs)}.UserSelectValue:not(.UserSelectValue_multiple).User:hover{background-color:var(--color-control-bg-clear)}
|
|
1
|
+
.UserSelectValue_multiple{margin-bottom:calc(var(--space-s)/4);margin-right:var(--space-xs)}.UserSelectValue_disabled{opacity:.6}.UserSelectValue:not(.UserSelectValue_multiple).User:hover{background-color:var(--color-control-bg-clear)}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./UserSelectValue.css";import{IconClose}from"@consta/icons/IconClose";import React from"react";import{cn}from"../../../utils/bem";import{User}from"../../User/User";export var cnUserSelectValue=cn("UserSelectValue");export var UserSelectValue=function(a){var b=a.size,c=a.label,d=a.subLabel,e=a.disabled,f=a.handleRemove,g=a.avatarUrl,h=a.multiple;return React.createElement(User,{className:cnUserSelectValue({multiple:h,size:b}),avatarUrl:g,name:c,info:d,size:b,view:h?"ghost":"clear",iconRight:!e&&h?IconClose:void 0,onIconRightClick:!e&&h?f:void 0})};
|
|
1
|
+
import"./UserSelectValue.css";import{IconClose}from"@consta/icons/IconClose";import React from"react";import{cn}from"../../../utils/bem";import{User}from"../../User/User";export var cnUserSelectValue=cn("UserSelectValue");export var UserSelectValue=function(a){var b=a.size,c=a.label,d=a.subLabel,e=a.disabled,f=a.handleRemove,g=a.avatarUrl,h=a.multiple;return React.createElement(User,{className:cnUserSelectValue({multiple:h,size:b,disabled:e}),avatarUrl:g,name:c,info:d,size:b,view:h?"ghost":"clear",iconRight:!e&&h?IconClose:void 0,onIconRightClick:!e&&h?f:void 0})};
|
|
2
2
|
//# sourceMappingURL=UserSelectValue.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserSelectValue.js","names":["IconClose","React","cn","User","cnUserSelectValue","UserSelectValue","props","size","label","subLabel","disabled","handleRemove","avatarUrl","multiple"],"sources":["../../../../../../src/components/UserSelect/UserSelectValue/UserSelectValue.tsx"],"sourcesContent":["import './UserSelectValue.css';\n\nimport { IconClose } from '@consta/icons/IconClose';\nimport React from 'react';\n\nimport { cn } from '../../../utils/bem';\nimport { User } from '../../User/User';\n\ntype UserValueProps = {\n label: string;\n size: 's' | 'm' | 'l';\n subLabel?: string;\n avatarUrl?: string;\n handleRemove?: (e: React.SyntheticEvent) => void;\n multiple?: boolean;\n disabled?: boolean;\n children?: never;\n};\n\nexport const cnUserSelectValue = cn('UserSelectValue');\n\nexport const UserSelectValue: React.FC<UserValueProps> = (props) => {\n const { size, label, subLabel, disabled, handleRemove, avatarUrl, multiple } =\n props;\n\n return (\n <User\n className={cnUserSelectValue({ multiple, size })}\n avatarUrl={avatarUrl}\n name={label}\n info={subLabel}\n size={size}\n view={multiple ? 'ghost' : 'clear'}\n iconRight={!disabled && multiple ? IconClose : undefined}\n onIconRightClick={!disabled && multiple ? handleRemove : undefined}\n />\n );\n};\n"],"mappings":"AAAA,8BAEA,OAASA,SAAT,KAA0B,yBAA1B,CACA,MAAOC,MAAP,KAAkB,OAAlB,CAEA,OAASC,EAAT,0BACA,OAASC,IAAT,uBAaA,MAAO,IAAMC,kBAAiB,CAAGF,EAAE,CAAC,iBAAD,CAA5B,CAEP,MAAO,IAAMG,gBAAyC,CAAG,SAACC,CAAD,CAAW,CAClE,GAAQC,EAAR,CACED,CADF,CAAQC,IAAR,CAAcC,CAAd,CACEF,CADF,CAAcE,KAAd,CAAqBC,CAArB,CACEH,CADF,CAAqBG,QAArB,CAA+BC,CAA/B,CACEJ,CADF,CAA+BI,QAA/B,CAAyCC,CAAzC,CACEL,CADF,CAAyCK,YAAzC,CAAuDC,CAAvD,CACEN,CADF,CAAuDM,SAAvD,CAAkEC,CAAlE,CACEP,CADF,CAAkEO,QAAlE,CAGA,MACE,qBAAC,IAAD,EACE,SAAS,CAAET,iBAAiB,CAAC,CAAES,QAAQ,CAARA,CAAF,CAAYN,IAAI,CAAJA,CAAZ,CAAD,CAD9B,CAEE,SAAS,
|
|
1
|
+
{"version":3,"file":"UserSelectValue.js","names":["IconClose","React","cn","User","cnUserSelectValue","UserSelectValue","props","size","label","subLabel","disabled","handleRemove","avatarUrl","multiple"],"sources":["../../../../../../src/components/UserSelect/UserSelectValue/UserSelectValue.tsx"],"sourcesContent":["import './UserSelectValue.css';\n\nimport { IconClose } from '@consta/icons/IconClose';\nimport React from 'react';\n\nimport { cn } from '../../../utils/bem';\nimport { User } from '../../User/User';\n\ntype UserValueProps = {\n label: string;\n size: 's' | 'm' | 'l';\n subLabel?: string;\n avatarUrl?: string;\n handleRemove?: (e: React.SyntheticEvent) => void;\n multiple?: boolean;\n disabled?: boolean;\n children?: never;\n};\n\nexport const cnUserSelectValue = cn('UserSelectValue');\n\nexport const UserSelectValue: React.FC<UserValueProps> = (props) => {\n const { size, label, subLabel, disabled, handleRemove, avatarUrl, multiple } =\n props;\n\n return (\n <User\n className={cnUserSelectValue({ multiple, size, disabled })}\n avatarUrl={avatarUrl}\n name={label}\n info={subLabel}\n size={size}\n view={multiple ? 'ghost' : 'clear'}\n iconRight={!disabled && multiple ? IconClose : undefined}\n onIconRightClick={!disabled && multiple ? handleRemove : undefined}\n />\n );\n};\n"],"mappings":"AAAA,8BAEA,OAASA,SAAT,KAA0B,yBAA1B,CACA,MAAOC,MAAP,KAAkB,OAAlB,CAEA,OAASC,EAAT,0BACA,OAASC,IAAT,uBAaA,MAAO,IAAMC,kBAAiB,CAAGF,EAAE,CAAC,iBAAD,CAA5B,CAEP,MAAO,IAAMG,gBAAyC,CAAG,SAACC,CAAD,CAAW,CAClE,GAAQC,EAAR,CACED,CADF,CAAQC,IAAR,CAAcC,CAAd,CACEF,CADF,CAAcE,KAAd,CAAqBC,CAArB,CACEH,CADF,CAAqBG,QAArB,CAA+BC,CAA/B,CACEJ,CADF,CAA+BI,QAA/B,CAAyCC,CAAzC,CACEL,CADF,CAAyCK,YAAzC,CAAuDC,CAAvD,CACEN,CADF,CAAuDM,SAAvD,CAAkEC,CAAlE,CACEP,CADF,CAAkEO,QAAlE,CAGA,MACE,qBAAC,IAAD,EACE,SAAS,CAAET,iBAAiB,CAAC,CAAES,QAAQ,CAARA,CAAF,CAAYN,IAAI,CAAJA,CAAZ,CAAkBG,QAAQ,CAARA,CAAlB,CAAD,CAD9B,CAEE,SAAS,CAAEE,CAFb,CAGE,IAAI,CAAEJ,CAHR,CAIE,IAAI,CAAEC,CAJR,CAKE,IAAI,CAAEF,CALR,CAME,IAAI,CAAEM,CAAQ,CAAG,OAAH,CAAa,OAN7B,CAOE,SAAS,CAAE,CAACH,CAAD,EAAaG,CAAb,CAAwBb,SAAxB,OAPb,CAQE,gBAAgB,CAAE,CAACU,CAAD,EAAaG,CAAb,CAAwBF,CAAxB,OARpB,EAWH,CAhBM"}
|