mimir-ui-kit 1.37.1 → 1.37.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{combobox-CDU06zJj.js → combobox-BpYucpxz.js} +1121 -1080
- package/dist/components/Accordion/Accordion.js +15 -15
- package/dist/components/CheckboxMimir/CheckboxMimir.js +4 -4
- package/dist/components/DatePicker/DatePicker.js +112 -107
- package/dist/components/MultiSelectSearch/MultiSelectSearch.js +22 -22
- package/dist/components/RadioGroup/RadioGroup.js +3 -3
- package/dist/components/SelectSearch/SelectSearch.js +24 -24
- package/dist/components/Switcher/Switcher.js +4 -4
- package/dist/components/TabTrail/TabTrail.js +4 -4
- package/dist/components/UniversalUploader/UniversalUploader.d.ts +2 -0
- package/dist/components/UniversalUploader/UniversalUploader.js +54 -51
- package/dist/components/UniversalUploader/types.d.ts +2 -0
- package/dist/{field-FJ34aSs4.js → field-C1kt7aNM.js} +2 -2
- package/dist/{focus-management-XwV-9qkO.js → focus-management-DOYCPyGg.js} +1 -1
- package/dist/{hidden-DbgtYPOH.js → hidden-PvGXrYUY.js} +1 -1
- package/dist/{keyboard-B0lm_zyn.js → keyboard-mgWkd2Vh.js} +114 -111
- package/dist/{label-y3ANLTNC.js → label-D4GFpe5F.js} +2 -2
- package/dist/open-closed-D2VjDhAN.js +86 -0
- package/dist/{use-active-press-86hajhdd.js → use-active-press-CqLGIFz7.js} +1 -1
- package/package.json +1 -1
- package/dist/open-closed-CdldUPoq.js +0 -86
@@ -1,13 +1,13 @@
|
|
1
1
|
import { jsx as s, jsxs as _, Fragment as z } from "react/jsx-runtime";
|
2
2
|
import { c as i } from "../../index-DIxK0V-G.js";
|
3
|
-
import { forwardRef as K, useState as D, useMemo as U, useCallback as
|
3
|
+
import { forwardRef as K, useState as D, useMemo as U, useCallback as R, useEffect as $ } from "react";
|
4
4
|
import { ESelectSearchSize as v } from "./constants.js";
|
5
|
-
import { mapSizeToInputSize as
|
6
|
-
import { Icon as
|
7
|
-
import { Button as
|
8
|
-
import { I as
|
9
|
-
import { EInputVariant as
|
10
|
-
import { H as X, U as
|
5
|
+
import { mapSizeToInputSize as j, getDropdownArrowIcon as J } from "./utils.js";
|
6
|
+
import { Icon as q } from "../../icons/Icon.js";
|
7
|
+
import { Button as Q } from "../Button/Button.js";
|
8
|
+
import { I as A } from "../../Input-BYrIS5GU.js";
|
9
|
+
import { EInputVariant as W } from "../Input/constants.js";
|
10
|
+
import { H as X, U as O, G as B, K as Y, j as Z } from "../../combobox-BpYucpxz.js";
|
11
11
|
import '../../assets/SelectSearch.css';const ee = "_disabled_rphak_5", te = "_container_rphak_9", oe = "_full_rphak_22", ae = "_button_rphak_34", ne = "_options_rphak_48", se = "_top_rphak_59", re = "_bottom_rphak_64", ie = "_m_rphak_91", le = "_l_rphak_106", ce = "_option_rphak_48", pe = "_clear_rphak_160", e = {
|
12
12
|
"select-search": "_select-search_rphak_2",
|
13
13
|
disabled: ee,
|
@@ -34,7 +34,7 @@ import '../../assets/SelectSearch.css';const ee = "_disabled_rphak_5", te = "_co
|
|
34
34
|
clear: pe,
|
35
35
|
"icon-button": "_icon-button_rphak_169"
|
36
36
|
}, ge = K(
|
37
|
-
(
|
37
|
+
(M, E) => {
|
38
38
|
const {
|
39
39
|
placeholder: g,
|
40
40
|
size: r = v.L,
|
@@ -47,18 +47,18 @@ import '../../assets/SelectSearch.css';const ee = "_disabled_rphak_5", te = "_co
|
|
47
47
|
displayValue: G = "name",
|
48
48
|
filterOnSearch: w = !0,
|
49
49
|
onSearch: m,
|
50
|
-
variant: C =
|
50
|
+
variant: C = W.DefaultGray,
|
51
51
|
menuPlacement: b = "bottom",
|
52
52
|
disabled: l = !1,
|
53
53
|
searchProps: I,
|
54
54
|
withClearButton: f = !1,
|
55
55
|
disableInput: c = !1,
|
56
56
|
autocomplete: S = "on"
|
57
|
-
} =
|
57
|
+
} = M, k = String((a == null ? void 0 : a[G]) || ""), [p, u] = D(k), [N, h] = D(a), y = U(() => !w || a && (a.id || a.name) ? d : p.trim().toLowerCase() ? d.filter(
|
58
58
|
(o) => o.name.toLowerCase().includes(p.toLowerCase())
|
59
59
|
) : d, [p, d, a, w]), P = (o) => {
|
60
60
|
o ? (u(o.name), h(o), n == null || n(o)) : (u(""), h(null), n == null || n({ id: "", name: "" }));
|
61
|
-
}, x =
|
61
|
+
}, x = R(
|
62
62
|
(o) => {
|
63
63
|
if (c) return;
|
64
64
|
const t = o.target.value;
|
@@ -68,7 +68,7 @@ import '../../assets/SelectSearch.css';const ee = "_disabled_rphak_5", te = "_co
|
|
68
68
|
), T = () => {
|
69
69
|
u(""), h(null), n == null || n({ id: "", name: "" });
|
70
70
|
};
|
71
|
-
return
|
71
|
+
return $(() => {
|
72
72
|
const o = !a || typeof a == "object" && !Object.keys(a).length;
|
73
73
|
u(o ? "" : k), h(o ? null : a);
|
74
74
|
}, [a, k]), /* @__PURE__ */ s(
|
@@ -93,12 +93,12 @@ import '../../assets/SelectSearch.css';const ee = "_disabled_rphak_5", te = "_co
|
|
93
93
|
}),
|
94
94
|
children: [
|
95
95
|
c && /* @__PURE__ */ _("div", { style: { position: "relative", width: "100%" }, children: [
|
96
|
-
/* @__PURE__ */ s(
|
97
|
-
|
96
|
+
/* @__PURE__ */ s(O, { disabled: l, style: { width: "100%" }, children: /* @__PURE__ */ s(
|
97
|
+
B,
|
98
98
|
{
|
99
|
-
as:
|
99
|
+
as: A,
|
100
100
|
label: g,
|
101
|
-
size:
|
101
|
+
size: j(r),
|
102
102
|
className: i(e["select-input"], {
|
103
103
|
[e["select-input-disabled"]]: c && f
|
104
104
|
}),
|
@@ -114,14 +114,14 @@ import '../../assets/SelectSearch.css';const ee = "_disabled_rphak_5", te = "_co
|
|
114
114
|
},
|
115
115
|
rightAddon: {
|
116
116
|
addonType: "icon",
|
117
|
-
addonContent:
|
117
|
+
addonContent: J(o, r)
|
118
118
|
},
|
119
119
|
autocomplete: S,
|
120
120
|
...I
|
121
121
|
}
|
122
122
|
) }),
|
123
123
|
f && p && /* @__PURE__ */ s(
|
124
|
-
|
124
|
+
Q,
|
125
125
|
{
|
126
126
|
tabIndex: -1,
|
127
127
|
className: i(e.clear, {
|
@@ -142,11 +142,11 @@ import '../../assets/SelectSearch.css';const ee = "_disabled_rphak_5", te = "_co
|
|
142
142
|
)
|
143
143
|
] }),
|
144
144
|
!c && /* @__PURE__ */ s(
|
145
|
-
|
145
|
+
B,
|
146
146
|
{
|
147
|
-
as:
|
147
|
+
as: A,
|
148
148
|
label: g,
|
149
|
-
size:
|
149
|
+
size: j(r),
|
150
150
|
className: e["select-input"],
|
151
151
|
onChange: x,
|
152
152
|
value: p,
|
@@ -159,14 +159,14 @@ import '../../assets/SelectSearch.css';const ee = "_disabled_rphak_5", te = "_co
|
|
159
159
|
rightAddon: {
|
160
160
|
addonType: "react-node",
|
161
161
|
addonContent: V && /* @__PURE__ */ s(
|
162
|
-
|
162
|
+
O,
|
163
163
|
{
|
164
164
|
className: i(e.button, {
|
165
165
|
[e.disabled]: l
|
166
166
|
}),
|
167
167
|
disabled: l,
|
168
168
|
children: /* @__PURE__ */ s(
|
169
|
-
|
169
|
+
q,
|
170
170
|
{
|
171
171
|
iconName: r == v.M ? "DropdownArrowBottom16px" : "DropdownArrowDown24px",
|
172
172
|
className: i(e["selector-icon"], {
|
@@ -215,7 +215,7 @@ import '../../assets/SelectSearch.css';const ee = "_disabled_rphak_5", te = "_co
|
|
215
215
|
t.bottom && /* @__PURE__ */ s("div", { children: t.bottom })
|
216
216
|
] }),
|
217
217
|
N && N.id === t.id && /* @__PURE__ */ s(
|
218
|
-
|
218
|
+
q,
|
219
219
|
{
|
220
220
|
iconName: r === v.M ? "Done16px" : "Done24px",
|
221
221
|
className: e["selected-icon"]
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import { jsxs as L, jsx as N } from "react/jsx-runtime";
|
2
|
-
import { H as te } from "../../field-
|
3
|
-
import { K as I, w as re, z as se, U as ae, u as ce, a as le, b as oe, T as ie, I as ne, G as ue, j as he, p as me } from "../../label-
|
4
|
-
import { W as de, H as j, y as pe, p as fe, o as $, $ as be, b as we, D as _e, c as H } from "../../keyboard-
|
2
|
+
import { H as te } from "../../field-C1kt7aNM.js";
|
3
|
+
import { K as I, w as re, z as se, U as ae, u as ce, a as le, b as oe, T as ie, I as ne, G as ue, j as he, p as me } from "../../label-D4GFpe5F.js";
|
4
|
+
import { W as de, H as j, y as pe, p as fe, o as $, $ as be, b as we, D as _e, c as H } from "../../keyboard-mgWkd2Vh.js";
|
5
5
|
import u, { createContext as $e, useState as x, useMemo as G, useId as ge, useContext as ve, useRef as ke, useCallback as xe, Fragment as ye, forwardRef as Pe } from "react";
|
6
|
-
import { w as Ce } from "../../use-active-press-
|
6
|
+
import { w as Ce } from "../../use-active-press-CqLGIFz7.js";
|
7
7
|
import { e as De } from "../../use-resolve-button-type-DhFdPxnv.js";
|
8
8
|
import { r as Fe } from "../../bugs-diTMAGNw.js";
|
9
9
|
import { c as g } from "../../index-DIxK0V-G.js";
|
@@ -5,11 +5,11 @@ import N, { useRef as U, useState as Q, createContext as oe, useReducer as ke, u
|
|
5
5
|
import { ETabTrailSize as Ae } from "./constants.js";
|
6
6
|
import { TabButtons as Se } from "./TabButtons/TabButtons.js";
|
7
7
|
import { NotificationBadge as Fe } from "../NotificationBadge/NotificationBadge.js";
|
8
|
-
import { n as W, M as se, W as q, s as H, y as z, o as E, H as V, $ as ce, b as De, D as de, a as B, u as Ne, c as h, t as Re } from "../../keyboard-
|
9
|
-
import { w as Me } from "../../use-active-press-
|
8
|
+
import { n as W, M as se, W as q, s as H, y as z, o as E, H as V, $ as ce, b as De, D as de, a as B, u as Ne, c as h, t as Re } from "../../keyboard-mgWkd2Vh.js";
|
9
|
+
import { w as Me } from "../../use-active-press-CqLGIFz7.js";
|
10
10
|
import { e as Ce } from "../../use-resolve-button-type-DhFdPxnv.js";
|
11
|
-
import { T as pe, s as Le } from "../../hidden-
|
12
|
-
import { _ as G, T as J, P as D, F as T } from "../../focus-management-
|
11
|
+
import { T as pe, s as Le } from "../../hidden-PvGXrYUY.js";
|
12
|
+
import { _ as G, T as J, P as D, F as T } from "../../focus-management-DOYCPyGg.js";
|
13
13
|
import '../../assets/TabTrail.css';function Oe() {
|
14
14
|
let e = U(!1);
|
15
15
|
return W(() => (e.current = !0, () => {
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { EFileItemVariant } from '../ListFiles';
|
1
2
|
import { TFilesDetail } from '../ListFiles/ListFiles';
|
2
3
|
import { TPhotosDetail } from '../ListPhotos/ListPhotos';
|
3
4
|
|
@@ -5,4 +6,5 @@ export declare const UniversalUploader: import('react').ForwardRefExoticComponen
|
|
5
6
|
type: "files" | "photos" | "all";
|
6
7
|
onChange: (j: import('./types').TOnChangeUpdate) => void;
|
7
8
|
value?: TFilesDetail[] | TPhotosDetail[];
|
9
|
+
variantListFiles?: EFileItemVariant | `${EFileItemVariant}`;
|
8
10
|
} & import('react').RefAttributes<HTMLDivElement>>;
|
@@ -1,38 +1,40 @@
|
|
1
|
-
import { jsxs as h, jsx as p, Fragment as
|
2
|
-
import { c as
|
3
|
-
import { forwardRef as
|
1
|
+
import { jsxs as h, jsx as p, Fragment as j } from "react/jsx-runtime";
|
2
|
+
import { c as B } from "../../index-DIxK0V-G.js";
|
3
|
+
import { forwardRef as D, useState as E, useEffect as T, useMemo as _ } from "react";
|
4
4
|
import { imageTypes as y } from "./constants.js";
|
5
5
|
import "../Button/Button.js";
|
6
6
|
import { EButtonVariantDefault as C } from "../Button/constants.js";
|
7
|
-
import { ListFiles as
|
8
|
-
import {
|
9
|
-
import {
|
10
|
-
import
|
7
|
+
import { ListFiles as M } from "../ListFiles/ListFiles.js";
|
8
|
+
import { EFileItemVariant as O } from "../ListFiles/constants.js";
|
9
|
+
import { ListPhotos as P } from "../ListPhotos/ListPhotos.js";
|
10
|
+
import { Uploader as A } from "../Uploader/Uploader.js";
|
11
|
+
import '../../assets/UploaderPhotos.css';const v = {
|
11
12
|
"upload-file-wrapper": "_upload-file-wrapper_1a115_2"
|
12
|
-
}, f = (i) => "file" in i && i.file instanceof File ? y.includes(i.file.type) : "type" in i && typeof i.type == "string" ? y.includes(i.type) : !1,
|
13
|
-
(i,
|
13
|
+
}, f = (i) => "file" in i && i.file instanceof File ? y.includes(i.file.type) : "type" in i && typeof i.type == "string" ? y.includes(i.type) : !1, Z = D(
|
14
|
+
(i, F) => {
|
14
15
|
const {
|
15
|
-
type:
|
16
|
-
filesType:
|
17
|
-
arrayName:
|
18
|
-
maxSize:
|
19
|
-
onChange:
|
20
|
-
value:
|
21
|
-
maxFiles:
|
22
|
-
titleUploader:
|
23
|
-
buttonText:
|
24
|
-
showOnlyUploadButton:
|
16
|
+
type: a,
|
17
|
+
filesType: g,
|
18
|
+
arrayName: w,
|
19
|
+
maxSize: x,
|
20
|
+
onChange: s,
|
21
|
+
value: o,
|
22
|
+
maxFiles: m,
|
23
|
+
titleUploader: U,
|
24
|
+
buttonText: b = "Выберите файлы",
|
25
|
+
showOnlyUploadButton: u = !1,
|
25
26
|
uploadButtonVariant: z = C.SecondaryAsphalt,
|
26
27
|
buttonSize: I = "m",
|
27
|
-
buttonClassName: L
|
28
|
-
|
29
|
-
|
30
|
-
|
28
|
+
buttonClassName: L,
|
29
|
+
variantListFiles: V = O.white
|
30
|
+
} = i, [l, n] = E(
|
31
|
+
o || []
|
32
|
+
), d = l.length >= m;
|
31
33
|
T(() => {
|
32
|
-
|
33
|
-
}, [
|
34
|
+
o && n(o);
|
35
|
+
}, [o]);
|
34
36
|
const N = (t) => {
|
35
|
-
const
|
37
|
+
const r = t.value.map((e) => f(e.file) ? {
|
36
38
|
id: e.id,
|
37
39
|
url: URL.createObjectURL(e.file),
|
38
40
|
type: e.file.type,
|
@@ -45,50 +47,51 @@ import '../../assets/UploaderPhotos.css';const g = {
|
|
45
47
|
name: e.file.name,
|
46
48
|
type: e.file.type
|
47
49
|
});
|
48
|
-
n((e) => [...e, ...
|
50
|
+
n((e) => [...e, ...r]), s == null || s({ type: "add", data: t.value });
|
49
51
|
}, c = (t) => {
|
50
|
-
n((
|
52
|
+
n((r) => r.filter((e) => e.id !== t)), s == null || s({ type: "delete", data: t });
|
51
53
|
}, { photos: R, files: S } = _(() => {
|
52
|
-
const t = () => l.filter((e) => !f(e)),
|
53
|
-
return
|
54
|
-
}, [l,
|
54
|
+
const t = () => l.filter((e) => !f(e)), r = () => l.filter(f);
|
55
|
+
return a === "all" ? { files: t(), photos: r() } : a === "files" ? { photos: [], files: t() } : a === "photos" ? { files: [], photos: r() } : { files: [], photos: [] };
|
56
|
+
}, [l, a]);
|
55
57
|
return /* @__PURE__ */ h(
|
56
58
|
"div",
|
57
59
|
{
|
58
60
|
"data-testid": "universal-uploader",
|
59
|
-
className:
|
60
|
-
|
61
|
-
|
61
|
+
className: B(
|
62
|
+
v["upload-file-wrapper"],
|
63
|
+
d && v.disabled
|
62
64
|
),
|
63
65
|
children: [
|
64
66
|
/* @__PURE__ */ p(
|
65
|
-
|
67
|
+
A,
|
66
68
|
{
|
67
|
-
filesType:
|
68
|
-
arrayName:
|
69
|
-
maxSize:
|
69
|
+
filesType: g,
|
70
|
+
arrayName: w,
|
71
|
+
maxSize: x,
|
70
72
|
onChangeValue: N,
|
71
|
-
ref:
|
72
|
-
maxFiles:
|
73
|
-
isDisabled:
|
74
|
-
titleUploader:
|
75
|
-
showOnlyUploadButton:
|
76
|
-
buttonText:
|
73
|
+
ref: F,
|
74
|
+
maxFiles: m,
|
75
|
+
isDisabled: d,
|
76
|
+
titleUploader: U,
|
77
|
+
showOnlyUploadButton: u,
|
78
|
+
buttonText: b,
|
77
79
|
uploadButtonVariant: z,
|
78
80
|
buttonSize: I,
|
79
81
|
buttonClassName: L
|
80
82
|
}
|
81
83
|
),
|
82
|
-
!
|
83
|
-
(
|
84
|
-
|
84
|
+
!u && /* @__PURE__ */ h(j, { children: [
|
85
|
+
(a === "files" || a === "all") && /* @__PURE__ */ p(
|
86
|
+
M,
|
85
87
|
{
|
86
88
|
value: S,
|
87
|
-
onChange: (t) => c(t.deleteId)
|
89
|
+
onChange: (t) => c(t.deleteId),
|
90
|
+
variant: V
|
88
91
|
}
|
89
92
|
),
|
90
|
-
(
|
91
|
-
|
93
|
+
(a === "photos" || a === "all") && /* @__PURE__ */ p(
|
94
|
+
P,
|
92
95
|
{
|
93
96
|
value: R,
|
94
97
|
onChange: (t) => c(t.deleteId)
|
@@ -101,5 +104,5 @@ import '../../assets/UploaderPhotos.css';const g = {
|
|
101
104
|
}
|
102
105
|
);
|
103
106
|
export {
|
104
|
-
|
107
|
+
Z as UniversalUploader
|
105
108
|
};
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { EFileItemVariant } from '../ListFiles';
|
1
2
|
import { TFilesDetail } from '../ListFiles/ListFiles';
|
2
3
|
import { TPhotosDetail } from '../ListPhotos/ListPhotos';
|
3
4
|
import { TFileItem, TUploader } from '../Uploader';
|
@@ -6,6 +7,7 @@ export type TUniversalUploader = Omit<TUploader, 'onChangeValue'> & {
|
|
6
7
|
type: 'files' | 'photos' | 'all';
|
7
8
|
onChange: (j: TOnChangeUpdate) => void;
|
8
9
|
value?: TFilesDetail[] | TPhotosDetail[];
|
10
|
+
variantListFiles?: EFileItemVariant | `${EFileItemVariant}`;
|
9
11
|
};
|
10
12
|
export type TOnChangeUpdate = {
|
11
13
|
type: string;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import l, { useId as u, useMemo as f } from "react";
|
2
|
-
import { z as p, U as h, a as v, l as E, f as b, W as $ } from "./label-
|
3
|
-
import { W as H, H as W } from "./keyboard-
|
2
|
+
import { z as p, U as h, a as v, l as E, f as b, W as $ } from "./label-D4GFpe5F.js";
|
3
|
+
import { W as H, H as W } from "./keyboard-mgWkd2Vh.js";
|
4
4
|
let P = "div";
|
5
5
|
function _(a, i) {
|
6
6
|
let d = `headlessui-control-${u()}`, [o, n] = p(), [m, s] = h(), c = v(), { disabled: e = c || !1, ...t } = a, r = f(() => ({ disabled: e }), [e]);
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { u as N, a as v } from "./keyboard-
|
1
|
+
import { u as N, a as v } from "./keyboard-mgWkd2Vh.js";
|
2
2
|
let m = ["[contentEditable=true]", "[tabindex]", "a[href]", "area[href]", "button:not([disabled])", "iframe", "input:not([disabled])", "select:not([disabled])", "textarea:not([disabled])"].map((e) => `${e}:not([tabindex='-1'])`).join(","), F = ["[data-autofocus]"].map((e) => `${e}:not([tabindex='-1'])`).join(",");
|
3
3
|
var h = ((e) => (e[e.First = 1] = "First", e[e.Previous = 2] = "Previous", e[e.Next = 4] = "Next", e[e.Last = 8] = "Last", e[e.WrapAround = 16] = "WrapAround", e[e.NoScroll = 32] = "NoScroll", e[e.AutoFocus = 64] = "AutoFocus", e))(h || {}), x = ((e) => (e[e.Error = 0] = "Error", e[e.Overflow = 1] = "Overflow", e[e.Success = 2] = "Success", e[e.Underflow = 3] = "Underflow", e))(x || {}), A = ((e) => (e[e.Previous = -1] = "Previous", e[e.Next = 1] = "Next", e))(A || {});
|
4
4
|
function y(e = document.body) {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { W as t, H as a } from "./keyboard-
|
1
|
+
import { W as t, H as a } from "./keyboard-mgWkd2Vh.js";
|
2
2
|
let l = "span";
|
3
3
|
var p = ((e) => (e[e.None = 1] = "None", e[e.Focusable = 2] = "Focusable", e[e.Hidden = 4] = "Hidden", e))(p || {});
|
4
4
|
function s(e, n) {
|