mimir-ui-kit 1.38.3 → 1.38.5
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/assets/SelectSearch.css +1 -1
- package/dist/components/SelectSearch/SelectSearch.js +82 -82
- package/dist/components/UniversalUploader/UniversalUploader.js +8 -8
- package/dist/components/Uploader/Uploader.js +34 -34
- package/dist/components/UploaderFiles/UploaderFiles.js +23 -23
- package/dist/components/UploaderPhotos/UploaderPhotos.js +15 -15
- package/package.json +1 -1
@@ -1 +1 @@
|
|
1
|
-
._select-
|
1
|
+
._select-search_1bph7_2{position:relative;isolation:isolate}._select-search_1bph7_2._disabled_1bph7_6{cursor:not-allowed}._select-search_1bph7_2:has([data-headlessui-state=open]){z-index:100}._container_1bph7_13{position:relative;z-index:10;display:block;gap:var(--mimir-select-search-gap);align-items:center;justify-content:space-between;height:var(--mimir-select-search-height);background-color:var(--black-5);border-radius:var(--mimir-select-search-radius)}._container-open_1bph7_24{border-bottom:1px solid var(--citrine-100)}._full_1bph7_28{width:100%}._selected-icon_1bph7_32 path{fill:var(--sapphire-100)}._selector-icon-open_1bph7_36{transform:rotate(180deg)}._button_1bph7_40{display:flex;align-items:center;background:none;border:none;cursor:pointer}._button_1bph7_40._disabled_1bph7_6{cursor:not-allowed}._button_1bph7_40._disabled_1bph7_6 ._selector-icon_1bph7_36 path{fill:var(--white)}._options_1bph7_54{position:absolute;z-index:5;width:100%;min-height:100%;max-height:var(--mimir-select-search-options-height);overflow-y:auto;font-size:var(--mimir-size-text-l);background:var(--white);box-shadow:var(--mimir-box-shadow-select-search)}._options_1bph7_54._top_1bph7_65{bottom:90%;margin-bottom:1px;padding-bottom:5px;border-radius:var(--mimir-select-search-radius) var(--mimir-select-search-radius) 0 0}._options_1bph7_54._bottom_1bph7_71{top:90%;margin-top:1px;padding-top:5px;border-radius:0 0 var(--mimir-select-search-radius) var(--mimir-select-search-radius)}._options_1bph7_54._no-options_1bph7_77{height:100%;padding:var(--mimir-select-search-option-space);color:var(--black-80)}._options_1bph7_54::-webkit-scrollbar{width:3px}._options_1bph7_54::-webkit-scrollbar-thumb{background-color:var(--black-80);border-radius:var(--mimir-control-radius-xs2)}._options_1bph7_54::-webkit-scrollbar-track{background-color:var(--white)}@media (max-width: 600px){._options_1bph7_54{max-height:var(--mimir-select-search-options-height-mobile)}}._m_1bph7_98{--mimir-select-search-height: var(--mimir-select-search-height-l);--mimir-select-search-space: var(--mimir-space-xss) var(--mimir-space-m);--mimir-select-search-radius: var(--mimir-control-radius);--mimir-select-search-gap: var(--mimir-space-2xs);--mimir-select-search-btn-space: var(--mimir-space-m) var(--mimir-space-m) var(--mimir-space-m) var(--mimir-space-xs);--mimir-select-search-option-space: var(--mimir-space-2s) var(--mimir-space-m);--mimir-select-search-options-height: var( --mimir-select-search-options-height-mobile );--clear-right: var(--mimir-space-2xxl);--select-input-disabled-margin-right: var(--mimir-space-l)}._l_1bph7_113{--mimir-select-search-height: var(--mimir-select-search-height-xxl);--mimir-select-search-space: var(--mimir-space-xss) var(--mimir-space-m);--mimir-select-search-radius: var(--mimir-control-radius-s);--mimir-select-search-gap: var(--mimir-space-xs);--mimir-select-search-btn-space: var(--mimir-space-l) var(--mimir-space-m) var(--mimir-space-l) var(--mimir-space-xs);--mimir-select-search-option-space: var(--mimir-space-2l) var(--mimir-space-m);--mimir-select-search-options-height: var( --mimir-select-search-options-height-desktop );--clear-right: var(--mimir-space-4xl);--select-input-disabled-margin-right: var(--mimir-space-1xl)}._select-input_1bph7_128{width:100%!important}._select-input-disabled_1bph7_131{margin-right:var(--select-input-disabled-margin-right)}._select-input_1bph7_128:last-child{padding-right:var(--mimir-space-4xl)}._option_1bph7_54{display:flex;gap:var(--mimir-space-m);align-items:center;width:100%;padding:var(--mimir-select-search-option-space);cursor:pointer;transition:background-color .2s ease-in-out}._option-active_1bph7_147{background-color:var(--black-5)}._option-inner_1bph7_150{display:flex;flex-direction:column;gap:var(--mimir-space-xs);width:100%}._right-slot_1bph7_157{order:2;padding-top:0!important}._required-mark_1bph7_162{order:1;margin-right:var(--mimir-space-xs)}._clear_1bph7_167{position:absolute;top:50%;right:var(--clear-right);transform:translateY(-50%)}._clear_1bph7_167._disabled_1bph7_6{cursor:not-allowed}._clear_1bph7_167._disabled_1bph7_6 ._icon-button_1bph7_176 path{fill:var(--white)}
|
@@ -1,63 +1,63 @@
|
|
1
|
-
import { jsx as
|
2
|
-
import { c as
|
1
|
+
import { jsx as a, jsxs as u, Fragment as D } from "react/jsx-runtime";
|
2
|
+
import { c as l } from "../../index-DIxK0V-G.js";
|
3
3
|
import { forwardRef as U, useState as j, useMemo as R, useCallback as $, useEffect as J } from "react";
|
4
|
-
import { ESelectSearchSize as
|
4
|
+
import { ESelectSearchSize as g } from "./constants.js";
|
5
5
|
import { mapSizeToInputSize as q, getDropdownArrowIcon as Q } from "./utils.js";
|
6
6
|
import { Icon as A } from "../../icons/Icon.js";
|
7
7
|
import { Button as W } from "../Button/Button.js";
|
8
8
|
import { I as O } from "../../Input-BYrIS5GU.js";
|
9
9
|
import { EInputVariant as X } from "../Input/constants.js";
|
10
10
|
import { H as Y, U as B, G as M, K as Z, j as ee } from "../../combobox-DgSZTriw.js";
|
11
|
-
import '../../assets/SelectSearch.css';const te = "
|
12
|
-
"select-search": "_select-
|
11
|
+
import '../../assets/SelectSearch.css';const te = "_disabled_1bph7_6", oe = "_container_1bph7_13", ne = "_full_1bph7_28", se = "_button_1bph7_40", ae = "_options_1bph7_54", ie = "_top_1bph7_65", le = "_bottom_1bph7_71", re = "_m_1bph7_98", ce = "_l_1bph7_113", pe = "_option_1bph7_54", de = "_clear_1bph7_167", e = {
|
12
|
+
"select-search": "_select-search_1bph7_2",
|
13
13
|
disabled: te,
|
14
14
|
container: oe,
|
15
|
-
"container-open": "_container-
|
15
|
+
"container-open": "_container-open_1bph7_24",
|
16
16
|
full: ne,
|
17
|
-
"selected-icon": "_selected-
|
18
|
-
"selector-icon-open": "_selector-icon-
|
17
|
+
"selected-icon": "_selected-icon_1bph7_32",
|
18
|
+
"selector-icon-open": "_selector-icon-open_1bph7_36",
|
19
19
|
button: se,
|
20
|
-
"selector-icon": "_selector-
|
21
|
-
options:
|
22
|
-
top:
|
23
|
-
bottom:
|
24
|
-
"no-options": "_no-
|
20
|
+
"selector-icon": "_selector-icon_1bph7_36",
|
21
|
+
options: ae,
|
22
|
+
top: ie,
|
23
|
+
bottom: le,
|
24
|
+
"no-options": "_no-options_1bph7_77",
|
25
25
|
m: re,
|
26
26
|
l: ce,
|
27
|
-
"select-input": "_select-
|
28
|
-
"select-input-disabled": "_select-input-
|
29
|
-
option:
|
30
|
-
"option-active": "_option-
|
31
|
-
"option-inner": "_option-
|
32
|
-
"right-slot": "_right-
|
33
|
-
"required-mark": "_required-
|
34
|
-
clear:
|
35
|
-
"icon-button": "_icon-
|
36
|
-
},
|
27
|
+
"select-input": "_select-input_1bph7_128",
|
28
|
+
"select-input-disabled": "_select-input-disabled_1bph7_131",
|
29
|
+
option: pe,
|
30
|
+
"option-active": "_option-active_1bph7_147",
|
31
|
+
"option-inner": "_option-inner_1bph7_150",
|
32
|
+
"right-slot": "_right-slot_1bph7_157",
|
33
|
+
"required-mark": "_required-mark_1bph7_162",
|
34
|
+
clear: de,
|
35
|
+
"icon-button": "_icon-button_1bph7_176"
|
36
|
+
}, Ce = U(
|
37
37
|
(E, L) => {
|
38
38
|
const {
|
39
|
-
placeholder:
|
40
|
-
size:
|
39
|
+
placeholder: w,
|
40
|
+
size: i = g.L,
|
41
41
|
value: n,
|
42
42
|
onChange: s,
|
43
43
|
full: V,
|
44
|
-
showArrow:
|
45
|
-
items:
|
44
|
+
showArrow: C = !0,
|
45
|
+
items: d = [],
|
46
46
|
classNameOption: F,
|
47
47
|
displayValue: G = "name",
|
48
|
-
filterOnSearch:
|
48
|
+
filterOnSearch: I = !0,
|
49
49
|
onSearch: _,
|
50
|
-
variant:
|
51
|
-
menuPlacement:
|
50
|
+
variant: S = X.DefaultGray,
|
51
|
+
menuPlacement: b = "bottom",
|
52
52
|
disabled: r = !1,
|
53
|
-
searchProps:
|
53
|
+
searchProps: y,
|
54
54
|
withClearButton: f = !1,
|
55
55
|
disableInput: c = !1,
|
56
|
-
autocomplete:
|
56
|
+
autocomplete: k = "on",
|
57
57
|
immediate: P = !1
|
58
|
-
} = E,
|
59
|
-
(o) => o.name.toLowerCase().includes(
|
60
|
-
) :
|
58
|
+
} = E, N = String((n == null ? void 0 : n[G]) || ""), [p, m] = j(N), [v, h] = j(n), x = R(() => !I || n && (n.id || n.name) ? d : p.trim().toLowerCase() ? d.filter(
|
59
|
+
(o) => o.name.toLowerCase().includes(p.toLowerCase())
|
60
|
+
) : d, [p, d, n, I]), T = (o) => {
|
61
61
|
o ? (m(o.name), h(o), s == null || s(o)) : (m(""), h(null), s == null || s({ id: "", name: "" }));
|
62
62
|
}, z = $(
|
63
63
|
(o) => {
|
@@ -71,13 +71,13 @@ import '../../assets/SelectSearch.css';const te = "_disabled_7klny_6", oe = "_co
|
|
71
71
|
};
|
72
72
|
return J(() => {
|
73
73
|
const o = !n || typeof n == "object" && !Object.keys(n).length;
|
74
|
-
m(o ? "" :
|
75
|
-
}, [n,
|
74
|
+
m(o ? "" : N), h(o ? null : n);
|
75
|
+
}, [n, N]), /* @__PURE__ */ a(
|
76
76
|
Y,
|
77
77
|
{
|
78
78
|
as: "div",
|
79
|
-
value:
|
80
|
-
className:
|
79
|
+
value: v,
|
80
|
+
className: l(e["select-search"], {
|
81
81
|
[e.full]: V,
|
82
82
|
[e.disabled]: r
|
83
83
|
}),
|
@@ -90,24 +90,24 @@ import '../../assets/SelectSearch.css';const te = "_disabled_7klny_6", oe = "_co
|
|
90
90
|
/* @__PURE__ */ u(
|
91
91
|
"div",
|
92
92
|
{
|
93
|
-
className:
|
93
|
+
className: l(e.container, e[i], {
|
94
94
|
[e["container-open"]]: o
|
95
95
|
}),
|
96
96
|
children: [
|
97
97
|
c && /* @__PURE__ */ u("div", { style: { position: "relative", width: "100%" }, children: [
|
98
|
-
/* @__PURE__ */
|
98
|
+
/* @__PURE__ */ a(B, { disabled: r, style: { width: "100%" }, children: /* @__PURE__ */ a(
|
99
99
|
M,
|
100
100
|
{
|
101
101
|
as: O,
|
102
|
-
label:
|
103
|
-
size: q(
|
104
|
-
className:
|
102
|
+
label: w,
|
103
|
+
size: q(i),
|
104
|
+
className: l(e["select-input"], {
|
105
105
|
[e["select-input-disabled"]]: c && f
|
106
106
|
}),
|
107
107
|
onChange: z,
|
108
|
-
value:
|
108
|
+
value: p,
|
109
109
|
disabled: r,
|
110
|
-
variant:
|
110
|
+
variant: S,
|
111
111
|
rightSlotClassName: e["right-slot"],
|
112
112
|
requiredMarkClassName: e["required-mark"],
|
113
113
|
"data-testid": "select-search-input",
|
@@ -116,17 +116,17 @@ import '../../assets/SelectSearch.css';const te = "_disabled_7klny_6", oe = "_co
|
|
116
116
|
},
|
117
117
|
rightAddon: {
|
118
118
|
addonType: "icon",
|
119
|
-
addonContent: Q(o,
|
119
|
+
addonContent: Q(o, i)
|
120
120
|
},
|
121
|
-
autocomplete:
|
122
|
-
...
|
121
|
+
autocomplete: k,
|
122
|
+
...y
|
123
123
|
}
|
124
124
|
) }),
|
125
|
-
f &&
|
125
|
+
f && p && /* @__PURE__ */ a(
|
126
126
|
W,
|
127
127
|
{
|
128
128
|
tabIndex: -1,
|
129
|
-
className:
|
129
|
+
className: l(e.clear, {
|
130
130
|
[e.disabled]: r
|
131
131
|
}),
|
132
132
|
iconButtonClassName: e["icon-button"],
|
@@ -143,35 +143,35 @@ import '../../assets/SelectSearch.css';const te = "_disabled_7klny_6", oe = "_co
|
|
143
143
|
}
|
144
144
|
)
|
145
145
|
] }),
|
146
|
-
!c && /* @__PURE__ */
|
146
|
+
!c && /* @__PURE__ */ a(
|
147
147
|
M,
|
148
148
|
{
|
149
149
|
as: O,
|
150
|
-
label:
|
151
|
-
size: q(
|
150
|
+
label: w,
|
151
|
+
size: q(i),
|
152
152
|
className: e["select-input"],
|
153
153
|
onChange: z,
|
154
|
-
value:
|
154
|
+
value: p,
|
155
155
|
disabled: r,
|
156
|
-
variant:
|
156
|
+
variant: S,
|
157
157
|
withClearButton: f,
|
158
158
|
rightSlotClassName: e["right-slot"],
|
159
159
|
requiredMarkClassName: e["required-mark"],
|
160
160
|
"data-testid": "select-search-input",
|
161
|
-
rightAddon:
|
161
|
+
rightAddon: C ? {
|
162
162
|
addonType: "react-node",
|
163
|
-
addonContent:
|
163
|
+
addonContent: C && /* @__PURE__ */ a(
|
164
164
|
B,
|
165
165
|
{
|
166
|
-
className:
|
166
|
+
className: l(e.button, {
|
167
167
|
[e.disabled]: r
|
168
168
|
}),
|
169
169
|
disabled: r,
|
170
|
-
children: /* @__PURE__ */
|
170
|
+
children: /* @__PURE__ */ a(
|
171
171
|
A,
|
172
172
|
{
|
173
|
-
iconName:
|
174
|
-
className:
|
173
|
+
iconName: i == g.M ? "DropdownArrowBottom16px" : "DropdownArrowDown24px",
|
174
|
+
className: l(e["selector-icon"], {
|
175
175
|
[e["selector-icon-open"]]: o
|
176
176
|
})
|
177
177
|
}
|
@@ -182,30 +182,30 @@ import '../../assets/SelectSearch.css';const te = "_disabled_7klny_6", oe = "_co
|
|
182
182
|
onFocus: (t) => {
|
183
183
|
c && t.target.blur();
|
184
184
|
},
|
185
|
-
autocomplete:
|
186
|
-
...
|
185
|
+
autocomplete: k,
|
186
|
+
...y
|
187
187
|
}
|
188
188
|
)
|
189
189
|
]
|
190
190
|
}
|
191
191
|
),
|
192
|
-
o && /* @__PURE__ */
|
192
|
+
o && /* @__PURE__ */ a(D, { children: d.length ? x.length ? /* @__PURE__ */ a(
|
193
193
|
Z,
|
194
194
|
{
|
195
195
|
"data-testid": "select-search-options",
|
196
|
-
className:
|
196
|
+
className: l(
|
197
197
|
e.options,
|
198
|
-
e[
|
199
|
-
e[
|
198
|
+
e[i],
|
199
|
+
e[b]
|
200
200
|
),
|
201
201
|
children: ({ option: t }) => /* @__PURE__ */ u(
|
202
202
|
ee,
|
203
203
|
{
|
204
204
|
value: t,
|
205
|
-
className: ({ focus: K }) =>
|
205
|
+
className: ({ focus: K }) => l(
|
206
206
|
e.option,
|
207
207
|
F,
|
208
|
-
|
208
|
+
i && e[i],
|
209
209
|
{
|
210
210
|
[e["option-active"]]: K
|
211
211
|
}
|
@@ -214,12 +214,12 @@ import '../../assets/SelectSearch.css';const te = "_disabled_7klny_6", oe = "_co
|
|
214
214
|
children: [
|
215
215
|
/* @__PURE__ */ u("div", { className: e["option-inner"], children: [
|
216
216
|
t.name,
|
217
|
-
t.bottom && /* @__PURE__ */
|
217
|
+
t.bottom && /* @__PURE__ */ a("div", { children: t.bottom })
|
218
218
|
] }),
|
219
|
-
|
219
|
+
v && v.id === t.id && /* @__PURE__ */ a(
|
220
220
|
A,
|
221
221
|
{
|
222
|
-
iconName:
|
222
|
+
iconName: i === g.M ? "Done16px" : "Done24px",
|
223
223
|
className: e["selected-icon"]
|
224
224
|
}
|
225
225
|
)
|
@@ -228,25 +228,25 @@ import '../../assets/SelectSearch.css';const te = "_disabled_7klny_6", oe = "_co
|
|
228
228
|
t.id
|
229
229
|
)
|
230
230
|
}
|
231
|
-
) : /* @__PURE__ */
|
231
|
+
) : /* @__PURE__ */ a(
|
232
232
|
"div",
|
233
233
|
{
|
234
|
-
className:
|
234
|
+
className: l(
|
235
235
|
e.options,
|
236
|
-
e[
|
236
|
+
e[i],
|
237
237
|
e["no-options"],
|
238
|
-
e[
|
238
|
+
e[b]
|
239
239
|
),
|
240
240
|
children: "Ничего не найдено"
|
241
241
|
}
|
242
|
-
) : /* @__PURE__ */
|
242
|
+
) : /* @__PURE__ */ a(
|
243
243
|
"div",
|
244
244
|
{
|
245
|
-
className:
|
245
|
+
className: l(
|
246
246
|
e.options,
|
247
|
-
e[
|
247
|
+
e[i],
|
248
248
|
e["no-options"],
|
249
|
-
e[
|
249
|
+
e[b]
|
250
250
|
),
|
251
251
|
children: "Нет данных"
|
252
252
|
}
|
@@ -257,5 +257,5 @@ import '../../assets/SelectSearch.css';const te = "_disabled_7klny_6", oe = "_co
|
|
257
257
|
}
|
258
258
|
);
|
259
259
|
export {
|
260
|
-
|
260
|
+
Ce as SelectSearch
|
261
261
|
};
|
@@ -8,13 +8,13 @@ import { ListFiles as A } from "../ListFiles/ListFiles.js";
|
|
8
8
|
import { EFileItemVariant as k } from "../ListFiles/constants.js";
|
9
9
|
import { ListPhotos as q } from "../ListPhotos/ListPhotos.js";
|
10
10
|
import { Uploader as G } from "../Uploader/Uploader.js";
|
11
|
-
import '../../assets/UploaderPhotos.css';const
|
11
|
+
import '../../assets/UploaderPhotos.css';const x = {
|
12
12
|
"upload-file-wrapper": "_upload-file-wrapper_1a115_2"
|
13
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, te = D(
|
14
|
-
(i,
|
14
|
+
(i, F) => {
|
15
15
|
const {
|
16
16
|
type: a,
|
17
|
-
filesType:
|
17
|
+
filesType: v,
|
18
18
|
arrayName: g,
|
19
19
|
maxSize: w,
|
20
20
|
onChange: s,
|
@@ -62,19 +62,19 @@ import '../../assets/UploaderPhotos.css';const v = {
|
|
62
62
|
{
|
63
63
|
"data-testid": "universal-uploader",
|
64
64
|
className: B(
|
65
|
-
|
66
|
-
u &&
|
65
|
+
x["upload-file-wrapper"],
|
66
|
+
u && x.disabled
|
67
67
|
),
|
68
68
|
children: [
|
69
69
|
/* @__PURE__ */ p(
|
70
70
|
G,
|
71
71
|
{
|
72
|
-
filesType:
|
72
|
+
filesType: v,
|
73
73
|
arrayName: g,
|
74
74
|
maxSize: w,
|
75
75
|
onChangeValue: N,
|
76
|
-
ref:
|
77
|
-
maxFiles: d,
|
76
|
+
ref: F,
|
77
|
+
maxFiles: d - l.length,
|
78
78
|
isDisabled: u,
|
79
79
|
titleUploader: z,
|
80
80
|
showOnlyUploadButton: m,
|
@@ -1,9 +1,9 @@
|
|
1
|
-
import { jsxs as o, jsx as n, Fragment as
|
2
|
-
import { forwardRef as
|
1
|
+
import { jsxs as o, jsx as n, Fragment as B } from "react/jsx-runtime";
|
2
|
+
import { forwardRef as M, useRef as _, useId as k } from "react";
|
3
3
|
import { Icon as D } from "../../icons/Icon.js";
|
4
4
|
import { Button as G } from "../Button/Button.js";
|
5
5
|
import { EButtonVariantDefault as O } from "../Button/constants.js";
|
6
|
-
import '../../assets/Uploader.css';const
|
6
|
+
import '../../assets/Uploader.css';const c = {
|
7
7
|
"upload-file-wrapper": "_upload-file-wrapper_bplvw_2",
|
8
8
|
"upload-text": "_upload-text_bplvw_25",
|
9
9
|
"upload-file-input": "_upload-file-input_bplvw_35"
|
@@ -31,76 +31,76 @@ import '../../assets/Uploader.css';const s = {
|
|
31
31
|
], X = () => {
|
32
32
|
let i = 0;
|
33
33
|
return () => (i = (i + 1) % Number.MAX_SAFE_INTEGER, i);
|
34
|
-
}, q = X(), W =
|
34
|
+
}, q = X(), W = M(
|
35
35
|
(i, v) => {
|
36
36
|
const {
|
37
37
|
filesType: l = L,
|
38
38
|
onChangeValue: I,
|
39
39
|
arrayName: N,
|
40
|
-
maxSize:
|
40
|
+
maxSize: f = 15,
|
41
41
|
maxFiles: d,
|
42
|
-
isDisabled:
|
43
|
-
titleUploader:
|
42
|
+
isDisabled: m,
|
43
|
+
titleUploader: u = "Или перетащите сюда",
|
44
44
|
buttonText: T = "Выберите файлы",
|
45
|
-
showOnlyUploadButton:
|
46
|
-
uploadButtonVariant:
|
47
|
-
buttonSize:
|
48
|
-
buttonClassName:
|
49
|
-
onMaxFilesExceeded:
|
45
|
+
showOnlyUploadButton: z = !1,
|
46
|
+
uploadButtonVariant: S = O.SecondaryAsphalt,
|
47
|
+
buttonSize: C = "m",
|
48
|
+
buttonClassName: E,
|
49
|
+
onMaxFilesExceeded: p,
|
50
50
|
onMaxSizeExceeded: g,
|
51
51
|
onInvalidFileType: x
|
52
|
-
} = i, h = _(null),
|
52
|
+
} = i, h = _(null), r = _(null), b = k(), F = (e) => {
|
53
53
|
var a;
|
54
54
|
return e.type ? e.type : ((a = e.name.split(".").pop()) == null ? void 0 : a.toLowerCase()) === "heic" ? "image/heic" : "";
|
55
|
-
},
|
55
|
+
}, R = (e) => {
|
56
56
|
if (e.target.files && e.target.files[0]) {
|
57
|
-
const
|
58
|
-
|
59
|
-
const a =
|
60
|
-
const
|
57
|
+
const s = Array.from(e.target.files);
|
58
|
+
s.length > d && (p == null || p());
|
59
|
+
const a = s.filter((t) => {
|
60
|
+
const V = F(t), w = l.map((A) => j[A]).includes(V), y = t.size / 1024 ** 2 <= f;
|
61
61
|
return !w && x && x(t.name), !y && g && g(t.name), w && y;
|
62
62
|
}).slice(0, d).map((t) => ({ file: t, id: q() }));
|
63
|
-
I({ arrayName: N, value: a }),
|
63
|
+
I({ arrayName: N, value: a }), r.current && (r.current.value = "");
|
64
64
|
}
|
65
|
-
},
|
65
|
+
}, U = () => {
|
66
66
|
var e;
|
67
67
|
(e = h.current) == null || e.click();
|
68
68
|
};
|
69
|
-
return /* @__PURE__ */ o("div", { className:
|
69
|
+
return /* @__PURE__ */ o("div", { className: c["upload-file-wrapper"], ref: v, children: [
|
70
70
|
/* @__PURE__ */ n(
|
71
71
|
"input",
|
72
72
|
{
|
73
|
-
ref:
|
73
|
+
ref: r,
|
74
74
|
type: "file",
|
75
|
-
className:
|
75
|
+
className: c["upload-file-input"],
|
76
76
|
"aria-label": "Upload",
|
77
77
|
name: "image[]",
|
78
78
|
multiple: !0,
|
79
|
-
onChange:
|
79
|
+
onChange: R,
|
80
80
|
title: "",
|
81
81
|
id: b,
|
82
82
|
accept: l.map((e) => j[e]).join(),
|
83
|
-
disabled:
|
83
|
+
disabled: m
|
84
84
|
}
|
85
85
|
),
|
86
86
|
/* @__PURE__ */ o("label", { htmlFor: b, ref: h, children: [
|
87
87
|
/* @__PURE__ */ n(
|
88
88
|
G,
|
89
89
|
{
|
90
|
-
size:
|
91
|
-
variant:
|
90
|
+
size: C,
|
91
|
+
variant: S,
|
92
92
|
leftIcon: /* @__PURE__ */ n(D, { iconName: "UnionIcon16px" }),
|
93
|
-
onClick:
|
94
|
-
disabled:
|
95
|
-
className:
|
93
|
+
onClick: U,
|
94
|
+
disabled: m,
|
95
|
+
className: E,
|
96
96
|
children: T
|
97
97
|
}
|
98
98
|
),
|
99
|
-
!
|
100
|
-
|
101
|
-
/* @__PURE__ */ o("span", { className:
|
99
|
+
!z && /* @__PURE__ */ o(B, { children: [
|
100
|
+
u && /* @__PURE__ */ n("b", { children: u }),
|
101
|
+
/* @__PURE__ */ o("span", { className: c["upload-text"], children: [
|
102
102
|
"Максимальный размер одного файла – ",
|
103
|
-
|
103
|
+
f,
|
104
104
|
" Мб",
|
105
105
|
/* @__PURE__ */ n("br", {}),
|
106
106
|
"Загрузить можно файлы следующих форматов: ",
|
@@ -1,11 +1,11 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { c as
|
3
|
-
import { forwardRef as
|
1
|
+
import { jsxs as N, jsx as f } from "react/jsx-runtime";
|
2
|
+
import { c as S } from "../../index-DIxK0V-G.js";
|
3
|
+
import { forwardRef as T, useState as _, useEffect as D } from "react";
|
4
4
|
import { ListFiles as R } from "../ListFiles/ListFiles.js";
|
5
5
|
import { Uploader as U } from "../Uploader/Uploader.js";
|
6
6
|
import '../../assets/UploaderPhotos.css';const c = {
|
7
7
|
"upload-file-wrapper": "_upload-file-wrapper_1a115_2"
|
8
|
-
}, q =
|
8
|
+
}, q = T(
|
9
9
|
(u, x) => {
|
10
10
|
const {
|
11
11
|
filesType: F,
|
@@ -14,58 +14,58 @@ import '../../assets/UploaderPhotos.css';const c = {
|
|
14
14
|
onChange: a,
|
15
15
|
value: s,
|
16
16
|
name: d,
|
17
|
-
maxFiles:
|
17
|
+
maxFiles: l,
|
18
18
|
buttonText: w,
|
19
19
|
onMaxFilesExceeded: z,
|
20
20
|
onMaxSizeExceeded: b,
|
21
|
-
onInvalidFileType:
|
22
|
-
} = u, [t, o] =
|
21
|
+
onInvalidFileType: h
|
22
|
+
} = u, [t, o] = _(s || []), r = t.length >= l;
|
23
23
|
D(() => {
|
24
24
|
s && o(s);
|
25
25
|
}, [s]);
|
26
|
-
const
|
27
|
-
const
|
26
|
+
const E = (i) => {
|
27
|
+
const M = [
|
28
28
|
...t,
|
29
29
|
...i.value.map((e) => {
|
30
|
-
var p,
|
30
|
+
var p, m, n;
|
31
31
|
return {
|
32
32
|
id: e.id,
|
33
33
|
url: "",
|
34
34
|
size: (p = e == null ? void 0 : e.file) == null ? void 0 : p.size,
|
35
|
-
name: (
|
36
|
-
type: (
|
35
|
+
name: (m = e == null ? void 0 : e.file) == null ? void 0 : m.name,
|
36
|
+
type: (n = e == null ? void 0 : e.file) == null ? void 0 : n.type
|
37
37
|
};
|
38
38
|
})
|
39
39
|
];
|
40
|
-
o(
|
41
|
-
},
|
40
|
+
o(M), a == null || a({ type: "add", data: i.value, name: d });
|
41
|
+
}, I = (i) => {
|
42
42
|
o(i.list), i.deleteId && (a == null || a({ type: "delete", data: i.deleteId, name: d }));
|
43
43
|
};
|
44
|
-
return /* @__PURE__ */
|
44
|
+
return /* @__PURE__ */ N(
|
45
45
|
"div",
|
46
46
|
{
|
47
|
-
className:
|
47
|
+
className: S(
|
48
48
|
c["upload-file-wrapper"],
|
49
|
-
|
49
|
+
r && c.disabled
|
50
50
|
),
|
51
51
|
children: [
|
52
|
-
/* @__PURE__ */
|
52
|
+
/* @__PURE__ */ f(
|
53
53
|
U,
|
54
54
|
{
|
55
55
|
filesType: F,
|
56
56
|
arrayName: y,
|
57
57
|
maxSize: v,
|
58
|
-
onChangeValue:
|
58
|
+
onChangeValue: E,
|
59
59
|
ref: x,
|
60
|
-
maxFiles:
|
61
|
-
isDisabled:
|
60
|
+
maxFiles: l - t.length,
|
61
|
+
isDisabled: r,
|
62
62
|
buttonText: w,
|
63
63
|
onMaxFilesExceeded: z,
|
64
64
|
onMaxSizeExceeded: b,
|
65
|
-
onInvalidFileType:
|
65
|
+
onInvalidFileType: h
|
66
66
|
}
|
67
67
|
),
|
68
|
-
/* @__PURE__ */
|
68
|
+
/* @__PURE__ */ f(R, { value: t, onChange: I })
|
69
69
|
]
|
70
70
|
}
|
71
71
|
);
|
@@ -12,29 +12,29 @@ import '../../assets/UploaderPhotos.css';const c = {
|
|
12
12
|
arrayName: u,
|
13
13
|
maxSize: x,
|
14
14
|
onChange: e,
|
15
|
-
value:
|
16
|
-
maxFiles:
|
15
|
+
value: o,
|
16
|
+
maxFiles: s,
|
17
17
|
titleUploader: h,
|
18
18
|
name: i,
|
19
19
|
buttonText: v = "Выберите файлы",
|
20
20
|
onMaxFilesExceeded: w,
|
21
21
|
onMaxSizeExceeded: y,
|
22
|
-
onInvalidFileType:
|
23
|
-
} = n, [
|
22
|
+
onInvalidFileType: F
|
23
|
+
} = n, [a, l] = L(o || []), d = a.length >= s;
|
24
24
|
M(() => {
|
25
|
-
|
26
|
-
}, [
|
27
|
-
const
|
25
|
+
o && l(o);
|
26
|
+
}, [o]);
|
27
|
+
const U = (t) => {
|
28
28
|
const P = [
|
29
|
-
...
|
29
|
+
...a,
|
30
30
|
...t.value.map((r) => ({
|
31
31
|
url: URL.createObjectURL(r.file),
|
32
32
|
id: r.id
|
33
33
|
}))
|
34
34
|
];
|
35
|
-
|
36
|
-
},
|
37
|
-
|
35
|
+
l(P), e == null || e({ type: "add", data: t.value, name: i });
|
36
|
+
}, b = (t) => {
|
37
|
+
l(t.list), t.deleteId && (e == null || e({ type: "delete", data: t.deleteId, name: i }));
|
38
38
|
};
|
39
39
|
return /* @__PURE__ */ R(
|
40
40
|
"div",
|
@@ -50,18 +50,18 @@ import '../../assets/UploaderPhotos.css';const c = {
|
|
50
50
|
filesType: f,
|
51
51
|
arrayName: u,
|
52
52
|
maxSize: x,
|
53
|
-
onChangeValue:
|
53
|
+
onChangeValue: U,
|
54
54
|
ref: m,
|
55
|
-
maxFiles:
|
55
|
+
maxFiles: s - a.length,
|
56
56
|
isDisabled: d,
|
57
57
|
titleUploader: h,
|
58
58
|
buttonText: v,
|
59
59
|
onMaxFilesExceeded: w,
|
60
60
|
onMaxSizeExceeded: y,
|
61
|
-
onInvalidFileType:
|
61
|
+
onInvalidFileType: F
|
62
62
|
}
|
63
63
|
),
|
64
|
-
!!
|
64
|
+
!!a.length && /* @__PURE__ */ p(N, { value: a, onChange: b })
|
65
65
|
]
|
66
66
|
}
|
67
67
|
);
|