mimir-ui-kit 1.7.1 → 1.8.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/DatePickerModal-DUUCHAWF.js +204 -0
- package/dist/assets/DatePickerModal.css +1 -0
- package/dist/assets/Input.css +1 -1
- package/dist/assets/SelectSearch.css +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts +44 -0
- package/dist/components/DatePicker/DatePicker.js +69 -0
- package/dist/components/DatePicker/DatePickerModal.d.ts +8 -0
- package/dist/components/DatePicker/DatePickerModal.js +9 -0
- package/dist/components/DatePicker/constants.d.ts +6 -0
- package/dist/components/DatePicker/constants.js +11 -0
- package/dist/components/DatePicker/index.d.ts +2 -0
- package/dist/components/DatePicker/index.js +4 -0
- package/dist/components/Input/Input.d.ts +2 -2
- package/dist/components/Input/Input.js +14 -14
- package/dist/components/RadioGroup/RadioGroup.d.ts +18 -2
- package/dist/components/RadioGroup/RadioGroup.js +50 -44
- package/dist/components/RadioGroup/index.d.ts +1 -1
- package/dist/components/SelectSearch/SelectSearch.d.ts +10 -16
- package/dist/components/SelectSearch/SelectSearch.js +100 -104
- package/dist/components/SelectSearch/index.d.ts +1 -2
- package/dist/components/Switch/Switch.d.ts +293 -3
- package/dist/components/Switch/Switch.js +27 -22
- package/dist/components/Switch/index.d.ts +1 -1
- package/dist/components/index.d.ts +4 -2
- package/dist/components/index.js +2 -0
- package/dist/hooks/useClickOutside/index.d.ts +1 -0
- package/dist/hooks/useClickOutside/index.js +4 -0
- package/dist/hooks/useClickOutside/useClickOutside.d.ts +7 -0
- package/dist/hooks/useClickOutside/useClickOutside.js +25 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4 -0
- package/dist/utils/formating/Date.d.ts +1 -0
- package/dist/utils/formating/Date.js +26 -0
- package/dist/utils/formating/Month.d.ts +8 -0
- package/dist/utils/formating/Month.js +80 -0
- package/dist/utils/formating/Numbers.d.ts +6 -0
- package/dist/utils/formating/Numbers.js +8 -0
- package/dist/utils/index.d.ts +9 -0
- package/dist/utils/index.js +11 -0
- package/package.json +1 -1
- package/dist/components/SelectSearch/types.d.ts +0 -17
- package/dist/components/SelectSearch/types.js +0 -1
- package/dist/components/Switch/types.d.ts +0 -4
- package/dist/components/Switch/types.js +0 -1
@@ -1,6 +1,6 @@
|
|
1
1
|
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
2
2
|
import { W, K, w, b as a, z as z$1, U, y, l, T, o, j as j$1, H, s, n, $ as $f7dceffc5ad7768b$export$4e328f61c538687f, c as $6179b936705e76d3$export$ae780daf29e6d456, D, d as u$1, I, G, a as u$2, u as u$3, e as o$1, f as p, r } from "../../label-BXAcSLy0.js";
|
3
|
-
import React__default, { createContext, useId, useReducer, useRef, useMemo, useCallback, useContext } from "react";
|
3
|
+
import React__default, { createContext, useId, useReducer, useRef, useMemo, useCallback, useContext, forwardRef } from "react";
|
4
4
|
import { u, P, F, T as T$1, _ } from "../../focus-management-CFDo6ZSc.js";
|
5
5
|
import { c as classNames } from "../../index-CweZ_OcN.js";
|
6
6
|
import '../../assets/RadioGroup.css';var Le = ((e) => (e[e.RegisterOption = 0] = "RegisterOption", e[e.UnregisterOption = 1] = "UnregisterOption", e))(Le || {});
|
@@ -116,51 +116,57 @@ const cls = {
|
|
116
116
|
frame,
|
117
117
|
checked
|
118
118
|
};
|
119
|
-
|
120
|
-
options,
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
const radioClasses = classNames(cls["radio-wrapper"], {
|
127
|
-
[cls.disabled]: props.disabled
|
128
|
-
});
|
129
|
-
return /* @__PURE__ */ jsxs(Tt, { value, className: cls.group, onChange, ...props, children: [
|
130
|
-
label2 && /* @__PURE__ */ jsx(K, { as: "p", className: cls.label, children: label2 }),
|
131
|
-
/* @__PURE__ */ jsx("div", { className: cls["content-wrapper"], children: options.map(({ label: label22, value: value2 }) => /* @__PURE__ */ jsx(
|
132
|
-
Be,
|
119
|
+
const RadioGroup = forwardRef(
|
120
|
+
({ options, value, onChange, label: label2, ...props }, ref) => {
|
121
|
+
const radioClasses = classNames(cls["radio-wrapper"], {
|
122
|
+
[cls.disabled]: props.disabled
|
123
|
+
});
|
124
|
+
return /* @__PURE__ */ jsxs(
|
125
|
+
Tt,
|
133
126
|
{
|
134
|
-
|
135
|
-
value
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
127
|
+
ref,
|
128
|
+
value,
|
129
|
+
className: cls.group,
|
130
|
+
onChange,
|
131
|
+
...props,
|
132
|
+
children: [
|
133
|
+
label2 && /* @__PURE__ */ jsx(K, { as: "p", className: cls.label, children: label2 }),
|
134
|
+
/* @__PURE__ */ jsx("div", { className: cls["content-wrapper"], children: options.map(({ label: label22, value: value2 }) => /* @__PURE__ */ jsx(
|
135
|
+
Be,
|
141
136
|
{
|
142
|
-
as: "
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
children: /* @__PURE__ */
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
}
|
137
|
+
as: "span",
|
138
|
+
value: value2,
|
139
|
+
disabled: props.disabled,
|
140
|
+
className: radioClasses,
|
141
|
+
children: ({ checked: checked2, disabled: disabled2 }) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
142
|
+
/* @__PURE__ */ jsx(
|
143
|
+
K,
|
144
|
+
{
|
145
|
+
as: "button",
|
146
|
+
className: classNames(cls.radio, {
|
147
|
+
[cls.disabled]: props.disabled
|
148
|
+
}),
|
149
|
+
children: /* @__PURE__ */ jsx(
|
150
|
+
"span",
|
151
|
+
{
|
152
|
+
className: classNames(cls.frame, {
|
153
|
+
[cls.checked]: checked2,
|
154
|
+
[cls.disabled]: disabled2
|
155
|
+
})
|
156
|
+
}
|
157
|
+
)
|
158
|
+
}
|
159
|
+
),
|
160
|
+
label22
|
161
|
+
] })
|
162
|
+
},
|
163
|
+
label22
|
164
|
+
)) })
|
165
|
+
]
|
166
|
+
}
|
167
|
+
);
|
168
|
+
}
|
169
|
+
);
|
164
170
|
export {
|
165
171
|
RadioGroup
|
166
172
|
};
|
@@ -1,2 +1,2 @@
|
|
1
1
|
export { RadioGroup } from './RadioGroup';
|
2
|
-
export type { TRadioOption } from './RadioGroup';
|
2
|
+
export type { TRadioOption, TRadioGroupProps } from './RadioGroup';
|
@@ -1,21 +1,15 @@
|
|
1
|
-
import {
|
1
|
+
import { ESelectSearchSize } from './constants';
|
2
2
|
|
3
|
-
export type
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
export type TSelectSearchItem = {
|
4
|
+
id: number;
|
5
|
+
name: string;
|
6
|
+
};
|
7
|
+
export type TSelectSearchProps = {
|
7
8
|
items: TSelectSearchItem[];
|
8
|
-
|
9
|
-
|
10
|
-
*/
|
9
|
+
value?: TSelectSearchItem | null;
|
10
|
+
onChange?: (value: TSelectSearchItem | null) => void;
|
11
11
|
placeholder?: string;
|
12
|
-
|
13
|
-
* Размер SelectSearch. Допустимые значения: `l`, `xxl`.
|
14
|
-
*/
|
15
|
-
size?: 'l' | 'xxl';
|
16
|
-
/**
|
17
|
-
* Флаг, указывающий, что элемент занимает все доступное пространство.
|
18
|
-
*/
|
12
|
+
size?: ESelectSearchSize;
|
19
13
|
full?: boolean;
|
20
14
|
};
|
21
|
-
export declare const SelectSearch: (
|
15
|
+
export declare const SelectSearch: import('react').ForwardRefExoticComponent<TSelectSearchProps & import('react').RefAttributes<HTMLElement>>;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
|
2
2
|
import { c as classNames } from "../../index-CweZ_OcN.js";
|
3
3
|
import * as React from "react";
|
4
|
-
import React__default, { useReducer, useMemo, useSyncExternalStore, useId as useId$1, useEffect, useCallback, useRef, useState, useLayoutEffect, createContext, useContext, Fragment, createRef } from "react";
|
4
|
+
import React__default, { useReducer, useMemo, useSyncExternalStore, useId as useId$1, useEffect, useCallback, useRef, useState, useLayoutEffect, createContext, useContext, Fragment, createRef, forwardRef } from "react";
|
5
5
|
import { ESelectSearchSize } from "./constants.js";
|
6
6
|
import { useMediaQuery } from "../../hooks/useMediaQuery/useMediaQuery.js";
|
7
7
|
import { EMediaQuery } from "../../hooks/useMediaQuery/constants.js";
|
@@ -3841,125 +3841,121 @@ function No(o2, r2) {
|
|
3841
3841
|
return H({ ourProps: { id: d2, ref: M2, role: "option", tabIndex: s2 === true ? void 0 : -1, "aria-disabled": s2 === true ? true : void 0, "aria-selected": C, disabled: void 0, onMouseDown: y2, onFocus: A2, onPointerEnter: h2, onMouseEnter: h2, onPointerMove: O, onMouseMove: O, onPointerLeave: G2, onMouseLeave: G2 }, theirProps: a3, slot: J2, defaultTag: ko, name: "Combobox.Option" });
|
3842
3842
|
}
|
3843
3843
|
let Uo = W$1(ho), Ho = W$1(Vo), Go = W$1(Mo), jo = K, zo = W$1(Bo), Ko = W$1(No), Nt = Object.assign(Uo, { Input: Go, Button: Ho, Label: jo, Options: zo, Option: Ko });
|
3844
|
-
const container = "
|
3845
|
-
const full = "
|
3846
|
-
const placeholder = "
|
3847
|
-
const input = "
|
3848
|
-
const button = "
|
3849
|
-
const options = "
|
3850
|
-
const option = "
|
3851
|
-
const l = "
|
3852
|
-
const xxl = "
|
3844
|
+
const container = "_container_xswn2_6";
|
3845
|
+
const full = "_full_xswn2_20";
|
3846
|
+
const placeholder = "_placeholder_xswn2_28";
|
3847
|
+
const input = "_input_xswn2_43";
|
3848
|
+
const button = "_button_xswn2_61";
|
3849
|
+
const options = "_options_xswn2_69";
|
3850
|
+
const option = "_option_xswn2_69";
|
3851
|
+
const l = "_l_xswn2_118";
|
3852
|
+
const xxl = "_xxl_xswn2_128";
|
3853
3853
|
const cls = {
|
3854
|
-
"select-search": "_select-
|
3854
|
+
"select-search": "_select-search_xswn2_2",
|
3855
3855
|
container,
|
3856
|
-
"container-open": "_container-
|
3856
|
+
"container-open": "_container-open_xswn2_16",
|
3857
3857
|
full,
|
3858
|
-
"selectorIcon-open": "_selectorIcon-
|
3858
|
+
"selectorIcon-open": "_selectorIcon-open_xswn2_24",
|
3859
3859
|
placeholder,
|
3860
|
-
"placeholder-top": "_placeholder-
|
3860
|
+
"placeholder-top": "_placeholder-top_xswn2_37",
|
3861
3861
|
input,
|
3862
|
-
"input-container": "_input-
|
3862
|
+
"input-container": "_input-container_xswn2_55",
|
3863
3863
|
button,
|
3864
3864
|
options,
|
3865
3865
|
option,
|
3866
|
-
"option-active": "_option-
|
3867
|
-
"option-inner": "_option-
|
3868
|
-
"no-options": "_no-
|
3866
|
+
"option-active": "_option-active_xswn2_103",
|
3867
|
+
"option-inner": "_option-inner_xswn2_106",
|
3868
|
+
"no-options": "_no-options_xswn2_113",
|
3869
3869
|
l,
|
3870
3870
|
xxl,
|
3871
|
-
"selected-icon": "_selected-
|
3871
|
+
"selected-icon": "_selected-icon_xswn2_138"
|
3872
3872
|
};
|
3873
|
-
const SelectSearch = (
|
3874
|
-
items,
|
3875
|
-
|
3876
|
-
|
3877
|
-
|
3878
|
-
|
3879
|
-
|
3880
|
-
|
3881
|
-
|
3882
|
-
|
3883
|
-
|
3884
|
-
|
3885
|
-
|
3886
|
-
|
3887
|
-
|
3888
|
-
|
3889
|
-
|
3890
|
-
|
3891
|
-
|
3892
|
-
|
3893
|
-
|
3894
|
-
|
3895
|
-
|
3896
|
-
|
3897
|
-
|
3898
|
-
|
3899
|
-
|
3900
|
-
|
3901
|
-
|
3902
|
-
|
3903
|
-
|
3904
|
-
|
3905
|
-
|
3906
|
-
|
3907
|
-
|
3908
|
-
|
3909
|
-
|
3910
|
-
|
3873
|
+
const SelectSearch = forwardRef(
|
3874
|
+
({ items, placeholder: placeholder2, size: size2 = ESelectSearchSize.L, onChange, value, full: full2 }, ref) => {
|
3875
|
+
const [searchValue, setSearchValue] = useState("");
|
3876
|
+
const [isItemSelected, setIsItemSelected] = useState(false);
|
3877
|
+
const isMobile = useMediaQuery(EMediaQuery.XSS);
|
3878
|
+
const filteredItems = useMemo(() => {
|
3879
|
+
return searchValue.trim().toLowerCase() ? items.filter(
|
3880
|
+
(item) => item.name.toLowerCase().includes(searchValue.toLowerCase())
|
3881
|
+
) : items;
|
3882
|
+
}, [searchValue, items]);
|
3883
|
+
const handleOneChange = (newValue) => {
|
3884
|
+
onChange == null ? void 0 : onChange(newValue);
|
3885
|
+
setIsItemSelected(!!newValue);
|
3886
|
+
};
|
3887
|
+
return /* @__PURE__ */ jsx(
|
3888
|
+
Nt,
|
3889
|
+
{
|
3890
|
+
as: "div",
|
3891
|
+
onChange: handleOneChange,
|
3892
|
+
value,
|
3893
|
+
className: classNames(cls["select-search"], { [cls.full]: full2 }),
|
3894
|
+
ref,
|
3895
|
+
children: ({ open }) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
3896
|
+
/* @__PURE__ */ jsxs(
|
3897
|
+
"div",
|
3898
|
+
{
|
3899
|
+
className: classNames(cls.container, cls[size2], {
|
3900
|
+
[cls["container-open"]]: open
|
3901
|
+
}),
|
3902
|
+
children: [
|
3903
|
+
/* @__PURE__ */ jsxs("div", { className: cls["input-container"], children: [
|
3904
|
+
/* @__PURE__ */ jsx(
|
3905
|
+
Go,
|
3906
|
+
{
|
3907
|
+
className: cls.input,
|
3908
|
+
onChange: (event) => setSearchValue(event.target.value),
|
3909
|
+
displayValue: (item) => item == null ? void 0 : item.name
|
3910
|
+
}
|
3911
|
+
),
|
3912
|
+
/* @__PURE__ */ jsx(
|
3913
|
+
"span",
|
3914
|
+
{
|
3915
|
+
className: classNames(cls.placeholder, {
|
3916
|
+
[cls["placeholder-top"]]: isItemSelected || open || searchValue
|
3917
|
+
}),
|
3918
|
+
children: placeholder2
|
3919
|
+
}
|
3920
|
+
)
|
3921
|
+
] }),
|
3922
|
+
/* @__PURE__ */ jsx(Ho, { className: cls.button, children: /* @__PURE__ */ jsx(
|
3923
|
+
Icon,
|
3911
3924
|
{
|
3912
|
-
|
3913
|
-
|
3914
|
-
|
3925
|
+
iconName: isMobile ? "DropdownArrowBottom16px" : "DropdownArrowDown24px",
|
3926
|
+
className: classNames(cls["selector-icon"], {
|
3927
|
+
[cls["selector-icon-open"]]: open
|
3928
|
+
})
|
3915
3929
|
}
|
3916
|
-
)
|
3917
|
-
|
3918
|
-
|
3930
|
+
) })
|
3931
|
+
]
|
3932
|
+
}
|
3933
|
+
),
|
3934
|
+
/* @__PURE__ */ jsx(zo, { className: classNames(cls.options, cls[size2]), children: !items.length ? /* @__PURE__ */ jsx("div", { className: cls["no-options"], children: "Нет данных" }) : !filteredItems.length && searchValue.trim() ? /* @__PURE__ */ jsx("div", { className: cls["no-options"], children: "Ничего не найдено" }) : filteredItems.map((item) => /* @__PURE__ */ jsx(
|
3935
|
+
Ko,
|
3936
|
+
{
|
3937
|
+
value: item,
|
3938
|
+
className: ({ focus }) => classNames(cls.option, {
|
3939
|
+
[cls["option-active"]]: focus
|
3940
|
+
}),
|
3941
|
+
children: ({ selected }) => /* @__PURE__ */ jsxs("div", { className: cls["option-inner"], children: [
|
3942
|
+
/* @__PURE__ */ jsx("span", { className: cls["option-text"], children: item.name }),
|
3943
|
+
selected && /* @__PURE__ */ jsx(
|
3944
|
+
Icon,
|
3919
3945
|
{
|
3920
|
-
|
3921
|
-
|
3922
|
-
}),
|
3923
|
-
children: placeholder2
|
3946
|
+
iconName: "Done16px",
|
3947
|
+
className: cls["selected-icon"]
|
3924
3948
|
}
|
3925
3949
|
)
|
3926
|
-
] })
|
3927
|
-
|
3928
|
-
|
3929
|
-
|
3930
|
-
|
3931
|
-
|
3932
|
-
|
3933
|
-
|
3934
|
-
|
3935
|
-
) })
|
3936
|
-
]
|
3937
|
-
}
|
3938
|
-
),
|
3939
|
-
/* @__PURE__ */ jsx(zo, { className: classNames(cls.options, cls[size2]), children: !items.length ? /* @__PURE__ */ jsx("div", { className: cls["no-options"], children: "Нет данных" }) : !filteredItems.length && searchValue.trim() ? /* @__PURE__ */ jsx("div", { className: cls["no-options"], children: "Ничего не найдено" }) : filteredItems.map((item) => /* @__PURE__ */ jsx(
|
3940
|
-
Ko,
|
3941
|
-
{
|
3942
|
-
value: item,
|
3943
|
-
className: ({ focus }) => classNames(cls.option, {
|
3944
|
-
[cls["option-active"]]: focus
|
3945
|
-
}),
|
3946
|
-
children: ({ selected }) => /* @__PURE__ */ jsxs("div", { className: cls["option-inner"], children: [
|
3947
|
-
/* @__PURE__ */ jsx("span", { className: cls["option-text"], children: item.name }),
|
3948
|
-
selected && /* @__PURE__ */ jsx(
|
3949
|
-
Icon,
|
3950
|
-
{
|
3951
|
-
iconName: "Done16px",
|
3952
|
-
className: cls["selected-icon"]
|
3953
|
-
}
|
3954
|
-
)
|
3955
|
-
] })
|
3956
|
-
},
|
3957
|
-
item.id
|
3958
|
-
)) })
|
3959
|
-
] })
|
3960
|
-
}
|
3961
|
-
);
|
3962
|
-
};
|
3950
|
+
] })
|
3951
|
+
},
|
3952
|
+
item.id
|
3953
|
+
)) })
|
3954
|
+
] })
|
3955
|
+
}
|
3956
|
+
);
|
3957
|
+
}
|
3958
|
+
);
|
3963
3959
|
export {
|
3964
3960
|
SelectSearch
|
3965
3961
|
};
|
@@ -1,3 +1,2 @@
|
|
1
|
-
export { SelectSearch, type
|
1
|
+
export { SelectSearch, type TSelectSearchProps, type TSelectSearchItem } from './SelectSearch';
|
2
2
|
export { ESelectSearchSize } from './constants';
|
3
|
-
export type { TSelectSearchItem, TSelectSearchSize } from './types';
|