mimir-ui-kit 1.34.7 → 1.34.9
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/assets/ListPhotos.css +1 -1
- package/dist/components/Accordion/Accordion.js +63 -63
- package/dist/components/ListPhotos/ListPhotos.js +12 -12
- package/dist/components/UploaderFiles/UploaderFiles.d.ts +4 -0
- package/dist/components/UploaderFiles/UploaderFiles.js +25 -16
- package/dist/components/UploaderPhotos/UploaderPhotos.d.ts +1 -0
- package/dist/components/UploaderPhotos/UploaderPhotos.js +17 -15
- package/package.json +1 -1
@@ -1 +1 @@
|
|
1
|
-
._list-
|
1
|
+
._list-photos_167sp_2{display:flex;gap:var(--mimir-space-m);overflow-x:auto;padding-top:var(--mimir-space-m)}._list-photos_167sp_2::-webkit-scrollbar{display:none}._list-photos_167sp_2 ._list-photos-item_167sp_11{position:relative;flex-shrink:0;width:var(--mimir-space-4xxl);height:var(--mimir-space-4xxl);overflow:hidden;border-radius:var(--mimir-control-radius);box-shadow:0 0 #16172705,0 2px 4px #16172705,0 6px 6px #16172705,0 15px 9px #16172703}._list-photos_167sp_2 ._list-photos-image_167sp_20{width:100%;height:100%;-o-object-fit:cover;object-fit:cover}._list-photos_167sp_2 ._delete-button_167sp_25{position:absolute;top:var(--mimir-space-2xs);right:var(--mimir-space-2xs)}
|
@@ -7,18 +7,18 @@ import { useMediaQuery as _e } from "../../hooks/useMediaQuery/useMediaQuery.js"
|
|
7
7
|
import { EMediaQuery as Ie } from "../../hooks/useMediaQuery/constants.js";
|
8
8
|
import { Icon as Se } from "../../icons/Icon.js";
|
9
9
|
import { Link as Pe } from "../AnchorLink/Link.js";
|
10
|
-
import { M as ee, W as q, y as K, T as ke, o as O, a as V, H as W, I as le, $ as ve, b as he, D as
|
10
|
+
import { M as ee, W as q, y as K, T as ke, o as O, a as V, H as W, I as le, $ as ve, b as he, D as ne, u as ye, c as g } from "../../keyboard-B0lm_zyn.js";
|
11
11
|
import { w as Ee } from "../../use-active-press-86hajhdd.js";
|
12
12
|
import { T as be } from "../../use-resolve-button-type-BAxjHhds.js";
|
13
13
|
import { c as De, i as M, u as $e, V as ge, A as Te, s as we } from "../../open-closed-Cy6VDfYc.js";
|
14
14
|
import { r as Ne } from "../../bugs-diTMAGNw.js";
|
15
15
|
import '../../assets/Accordion.css';let Re = F(() => {
|
16
16
|
});
|
17
|
-
function Ce({ value: e, children:
|
18
|
-
return h.createElement(Re.Provider, { value: e },
|
17
|
+
function Ce({ value: e, children: n }) {
|
18
|
+
return h.createElement(Re.Provider, { value: e }, n);
|
19
19
|
}
|
20
|
-
var
|
21
|
-
let Ae = (
|
20
|
+
var te;
|
21
|
+
let Ae = (te = h.startTransition) != null ? te : function(e) {
|
22
22
|
e();
|
23
23
|
};
|
24
24
|
var Be = ((e) => (e[e.Open = 0] = "Open", e[e.Closed = 1] = "Closed", e))(Be || {}), Oe = ((e) => (e[e.ToggleDisclosure = 0] = "ToggleDisclosure", e[e.CloseDisclosure = 1] = "CloseDisclosure", e[e.SetButtonId = 2] = "SetButtonId", e[e.SetPanelId = 3] = "SetPanelId", e[e.LinkPanel = 4] = "LinkPanel", e[e.UnlinkPanel = 5] = "UnlinkPanel", e))(Oe || {});
|
@@ -26,43 +26,43 @@ let xe = { 0: (e) => ({ ...e, disclosureState: V(e.disclosureState, { 0: 1, 1: 0
|
|
26
26
|
return e.linkedPanel === !0 ? e : { ...e, linkedPanel: !0 };
|
27
27
|
}, 5(e) {
|
28
28
|
return e.linkedPanel === !1 ? e : { ...e, linkedPanel: !1 };
|
29
|
-
}, 2(e,
|
30
|
-
return e.buttonId ===
|
31
|
-
}, 3(e,
|
32
|
-
return e.panelId ===
|
29
|
+
}, 2(e, n) {
|
30
|
+
return e.buttonId === n.buttonId ? e : { ...e, buttonId: n.buttonId };
|
31
|
+
}, 3(e, n) {
|
32
|
+
return e.panelId === n.panelId ? e : { ...e, panelId: n.panelId };
|
33
33
|
} }, j = F(null);
|
34
34
|
j.displayName = "DisclosureContext";
|
35
35
|
function Q(e) {
|
36
|
-
let
|
37
|
-
if (
|
36
|
+
let n = H(j);
|
37
|
+
if (n === null) {
|
38
38
|
let c = new Error(`<${e} /> is missing a parent <Disclosure /> component.`);
|
39
39
|
throw Error.captureStackTrace && Error.captureStackTrace(c, Q), c;
|
40
40
|
}
|
41
|
-
return
|
41
|
+
return n;
|
42
42
|
}
|
43
43
|
let z = F(null);
|
44
44
|
z.displayName = "DisclosureAPIContext";
|
45
45
|
function se(e) {
|
46
|
-
let
|
47
|
-
if (
|
46
|
+
let n = H(z);
|
47
|
+
if (n === null) {
|
48
48
|
let c = new Error(`<${e} /> is missing a parent <Disclosure /> component.`);
|
49
49
|
throw Error.captureStackTrace && Error.captureStackTrace(c, se), c;
|
50
50
|
}
|
51
|
-
return
|
51
|
+
return n;
|
52
52
|
}
|
53
53
|
let G = F(null);
|
54
54
|
G.displayName = "DisclosurePanelContext";
|
55
55
|
function Me() {
|
56
56
|
return H(G);
|
57
57
|
}
|
58
|
-
function Fe(e,
|
59
|
-
return V(
|
58
|
+
function Fe(e, n) {
|
59
|
+
return V(n.type, xe, e, n);
|
60
60
|
}
|
61
61
|
let Le = U;
|
62
|
-
function Ue(e,
|
63
|
-
let { defaultOpen: c = !1, ...o } = e, l = B(null), p = K(
|
62
|
+
function Ue(e, n) {
|
63
|
+
let { defaultOpen: c = !1, ...o } = e, l = B(null), p = K(n, ke((a) => {
|
64
64
|
l.current = a;
|
65
|
-
}, e.as === void 0 || e.as === U)),
|
65
|
+
}, e.as === void 0 || e.as === U)), d = B(null), t = B(null), r = ue(Fe, { disclosureState: c ? 0 : 1, linkedPanel: !1, buttonRef: t, panelRef: d, buttonId: null, panelId: null }), [{ disclosureState: m, buttonId: s }, _] = r, i = O((a) => {
|
66
66
|
_({ type: 1 });
|
67
67
|
let v = ye(l);
|
68
68
|
if (!v || !s) return;
|
@@ -72,8 +72,8 @@ function Ue(e, t) {
|
|
72
72
|
return h.createElement(j.Provider, { value: r }, h.createElement(z.Provider, { value: y }, h.createElement(Ce, { value: i }, h.createElement(De, { value: V(m, { 0: M.Open, 1: M.Closed }) }, W({ ourProps: I, theirProps: o, slot: k, defaultTag: Le, name: "Disclosure" })))));
|
73
73
|
}
|
74
74
|
let He = "button";
|
75
|
-
function qe(e,
|
76
|
-
let c = oe(), { id: o = `headlessui-disclosure-button-${c}`, disabled: l = !1, autoFocus: p = !1, ...
|
75
|
+
function qe(e, n) {
|
76
|
+
let c = oe(), { id: o = `headlessui-disclosure-button-${c}`, disabled: l = !1, autoFocus: p = !1, ...d } = e, [t, r] = Q("Disclosure.Button"), m = Me(), s = m === null ? !1 : m === t.panelId, _ = B(null), i = K(_, n, s ? null : t.buttonRef), y = le();
|
77
77
|
re(() => {
|
78
78
|
if (!s) return r({ type: 2, buttonId: o }), () => {
|
79
79
|
r({ type: 2, buttonId: null });
|
@@ -82,11 +82,11 @@ function qe(e, t) {
|
|
82
82
|
let k = O((f) => {
|
83
83
|
var $;
|
84
84
|
if (s) {
|
85
|
-
if (
|
85
|
+
if (t.disclosureState === 1) return;
|
86
86
|
switch (f.key) {
|
87
87
|
case g.Space:
|
88
88
|
case g.Enter:
|
89
|
-
f.preventDefault(), f.stopPropagation(), r({ type: 0 }), ($ =
|
89
|
+
f.preventDefault(), f.stopPropagation(), r({ type: 0 }), ($ = t.buttonRef.current) == null || $.focus();
|
90
90
|
break;
|
91
91
|
}
|
92
92
|
} else switch (f.key) {
|
@@ -103,23 +103,23 @@ function qe(e, t) {
|
|
103
103
|
}
|
104
104
|
}), a = O((f) => {
|
105
105
|
var $;
|
106
|
-
Ne(f.currentTarget) || l || (s ? (r({ type: 0 }), ($ =
|
107
|
-
}), { isFocusVisible: v, focusProps: S } = ve({ autoFocus: p }), { isHovered: b, hoverProps: T } = he({ isDisabled: l }), { pressed: w, pressProps: D } = Ee({ disabled: l }), L = x(() => ({ open:
|
108
|
-
return W({ mergeRefs: y, ourProps: ie, theirProps:
|
106
|
+
Ne(f.currentTarget) || l || (s ? (r({ type: 0 }), ($ = t.buttonRef.current) == null || $.focus()) : r({ type: 0 }));
|
107
|
+
}), { isFocusVisible: v, focusProps: S } = ve({ autoFocus: p }), { isHovered: b, hoverProps: T } = he({ isDisabled: l }), { pressed: w, pressProps: D } = Ee({ disabled: l }), L = x(() => ({ open: t.disclosureState === 0, hover: b, active: w, disabled: l, focus: v, autofocus: p }), [t, b, w, v, l, p]), N = be(e, _), ie = s ? ne({ ref: i, type: N, disabled: l || void 0, autoFocus: p, onKeyDown: k, onClick: a }, S, T, D) : ne({ ref: i, id: o, type: N, "aria-expanded": t.disclosureState === 0, "aria-controls": t.linkedPanel ? t.panelId : void 0, disabled: l || void 0, autoFocus: p, onKeyDown: k, onKeyUp: I, onClick: a }, S, T, D);
|
108
|
+
return W({ mergeRefs: y, ourProps: ie, theirProps: d, slot: L, defaultTag: He, name: "Disclosure.Button" });
|
109
109
|
}
|
110
110
|
let Ke = "div", Ve = ee.RenderStrategy | ee.Static;
|
111
|
-
function We(e,
|
112
|
-
let c = oe(), { id: o = `headlessui-disclosure-panel-${c}`, transition: l = !1, ...p } = e, [
|
113
|
-
Ae(() =>
|
111
|
+
function We(e, n) {
|
112
|
+
let c = oe(), { id: o = `headlessui-disclosure-panel-${c}`, transition: l = !1, ...p } = e, [d, t] = Q("Disclosure.Panel"), { close: r } = se("Disclosure.Panel"), m = le(), s = K(n, d.panelRef, (a) => {
|
113
|
+
Ae(() => t({ type: a ? 4 : 5 }));
|
114
114
|
});
|
115
|
-
re(() => (
|
116
|
-
|
117
|
-
}), [o,
|
118
|
-
let _ = $e(), [i, y] = ge(l,
|
119
|
-
return h.createElement(we, null, h.createElement(G.Provider, { value:
|
115
|
+
re(() => (t({ type: 3, panelId: o }), () => {
|
116
|
+
t({ type: 3, panelId: null });
|
117
|
+
}), [o, t]);
|
118
|
+
let _ = $e(), [i, y] = ge(l, d.panelRef, _ !== null ? (_ & M.Open) === M.Open : d.disclosureState === 0), k = x(() => ({ open: d.disclosureState === 0, close: r }), [d.disclosureState, r]), I = { ref: s, id: o, ...Te(y) };
|
119
|
+
return h.createElement(we, null, h.createElement(G.Provider, { value: d.panelId }, W({ mergeRefs: m, ourProps: I, theirProps: p, slot: k, defaultTag: Ke, features: Ve, visible: i, name: "Disclosure.Panel" })));
|
120
120
|
}
|
121
121
|
let je = q(Ue), ae = q(qe), ce = q(We), Qe = Object.assign(je, { Button: ae, Panel: ce });
|
122
|
-
const ze = "_accordion_1p5o7_2", Ge = "_header_1p5o7_13", Xe = "_title_1p5o7_26", Je = "_icon_1p5o7_33", Ye = "_circle_1p5o7_43", Ze = "_square_1p5o7_50",
|
122
|
+
const ze = "_accordion_1p5o7_2", Ge = "_header_1p5o7_13", Xe = "_title_1p5o7_26", Je = "_icon_1p5o7_33", Ye = "_circle_1p5o7_43", Ze = "_square_1p5o7_50", en = "_panel_1p5o7_60", nn = "_open_1p5o7_67", tn = "_m_1p5o7_87", on = "_s_1p5o7_50", u = {
|
123
123
|
accordion: ze,
|
124
124
|
"is-link": "_is-link_1p5o7_9",
|
125
125
|
header: Ge,
|
@@ -129,22 +129,22 @@ const ze = "_accordion_1p5o7_2", Ge = "_header_1p5o7_13", Xe = "_title_1p5o7_26"
|
|
129
129
|
"icon-container": "_icon-container_1p5o7_36",
|
130
130
|
circle: Ye,
|
131
131
|
square: Ze,
|
132
|
-
panel:
|
133
|
-
open:
|
132
|
+
panel: en,
|
133
|
+
open: nn,
|
134
134
|
"link-open": "_link-open_1p5o7_83",
|
135
|
-
m:
|
136
|
-
s:
|
135
|
+
m: tn,
|
136
|
+
s: on,
|
137
137
|
"wrapper-button": "_wrapper-button_1p5o7_115"
|
138
|
-
},
|
138
|
+
}, kn = de(
|
139
139
|
({
|
140
140
|
title: e,
|
141
|
-
buttonType:
|
141
|
+
buttonType: n = C.BUTTON,
|
142
142
|
children: c,
|
143
143
|
size: o = A.M,
|
144
144
|
titleUppercase: l,
|
145
145
|
buttonStyle: p = me.CIRCLE,
|
146
|
-
iconType:
|
147
|
-
classNameTitle:
|
146
|
+
iconType: d = J.ARROW,
|
147
|
+
classNameTitle: t,
|
148
148
|
classNameContent: r,
|
149
149
|
classNameAccordion: m,
|
150
150
|
classNameIconButton: s,
|
@@ -152,13 +152,13 @@ const ze = "_accordion_1p5o7_2", Ge = "_header_1p5o7_13", Xe = "_title_1p5o7_26"
|
|
152
152
|
onlyOpenSubtitleNode: i,
|
153
153
|
classNameSubtitleContainer: y
|
154
154
|
}, k) => {
|
155
|
-
const [I, a] = pe(!1), v = _e(Ie.XS1), S =
|
156
|
-
[
|
155
|
+
const [I, a] = pe(!1), v = _e(Ie.XS1), S = n === "link", b = {
|
156
|
+
[u["is-link"]]: S
|
157
157
|
}, T = () => {
|
158
158
|
a(!I);
|
159
159
|
}, w = (D) => {
|
160
|
-
const L = () =>
|
161
|
-
switch (
|
160
|
+
const L = () => d === J.DROPDOWN ? o === A.S ? "DropdownArrowBottom16px" : "DropdownArrowDown24px" : o === A.S ? Z.S : Z.M, N = o === A.S ? Y.S : Y.M;
|
161
|
+
switch (n) {
|
162
162
|
case C.LINK:
|
163
163
|
return /* @__PURE__ */ P(
|
164
164
|
Pe,
|
@@ -168,7 +168,7 @@ const ze = "_accordion_1p5o7_2", Ge = "_header_1p5o7_13", Xe = "_title_1p5o7_26"
|
|
168
168
|
rightIcon: {
|
169
169
|
iconName: N,
|
170
170
|
className: E({
|
171
|
-
[
|
171
|
+
[u["link-open"]]: D
|
172
172
|
})
|
173
173
|
},
|
174
174
|
children: e
|
@@ -180,9 +180,9 @@ const ze = "_accordion_1p5o7_2", Ge = "_header_1p5o7_13", Xe = "_title_1p5o7_26"
|
|
180
180
|
"span",
|
181
181
|
{
|
182
182
|
className: E(
|
183
|
-
|
184
|
-
|
185
|
-
l &&
|
183
|
+
u.title,
|
184
|
+
t,
|
185
|
+
l && u["title-uppercase"]
|
186
186
|
),
|
187
187
|
children: e
|
188
188
|
}
|
@@ -191,9 +191,9 @@ const ze = "_accordion_1p5o7_2", Ge = "_header_1p5o7_13", Xe = "_title_1p5o7_26"
|
|
191
191
|
"div",
|
192
192
|
{
|
193
193
|
className: E(
|
194
|
-
|
195
|
-
D,
|
196
|
-
|
194
|
+
u["icon-container"],
|
195
|
+
D && u.open,
|
196
|
+
u[p],
|
197
197
|
s
|
198
198
|
),
|
199
199
|
"data-testid": "accordion-icon-container",
|
@@ -201,7 +201,7 @@ const ze = "_accordion_1p5o7_2", Ge = "_header_1p5o7_13", Xe = "_title_1p5o7_26"
|
|
201
201
|
Se,
|
202
202
|
{
|
203
203
|
iconName: L(),
|
204
|
-
className:
|
204
|
+
className: u.icon,
|
205
205
|
"data-testid": "accordion-icon"
|
206
206
|
}
|
207
207
|
)
|
@@ -217,27 +217,27 @@ const ze = "_accordion_1p5o7_2", Ge = "_header_1p5o7_13", Xe = "_title_1p5o7_26"
|
|
217
217
|
"div",
|
218
218
|
{
|
219
219
|
className: E(
|
220
|
-
|
221
|
-
|
220
|
+
u.accordion,
|
221
|
+
u[o],
|
222
222
|
b,
|
223
223
|
m
|
224
224
|
),
|
225
225
|
children: /* @__PURE__ */ R(Qe, { ref: k, children: [
|
226
|
-
/* @__PURE__ */ P("div", { className:
|
226
|
+
/* @__PURE__ */ P("div", { className: u["wrapper-button"], onClick: T, children: /* @__PURE__ */ P(
|
227
227
|
ae,
|
228
228
|
{
|
229
229
|
as: S ? U : C.BUTTON,
|
230
230
|
className: E({
|
231
|
-
[
|
231
|
+
[u.header]: !S
|
232
232
|
}),
|
233
|
-
children: w()
|
233
|
+
children: w(I)
|
234
234
|
}
|
235
235
|
) }),
|
236
236
|
I && /* @__PURE__ */ P(
|
237
237
|
ce,
|
238
238
|
{
|
239
239
|
className: E(
|
240
|
-
|
240
|
+
u.panel,
|
241
241
|
r,
|
242
242
|
b
|
243
243
|
),
|
@@ -255,5 +255,5 @@ const ze = "_accordion_1p5o7_2", Ge = "_header_1p5o7_13", Xe = "_title_1p5o7_26"
|
|
255
255
|
}
|
256
256
|
);
|
257
257
|
export {
|
258
|
-
|
258
|
+
kn as Accordion
|
259
259
|
};
|
@@ -1,32 +1,32 @@
|
|
1
1
|
import { jsx as e, jsxs as a } from "react/jsx-runtime";
|
2
2
|
import { useState as n, useEffect as _ } from "react";
|
3
|
-
import { Button as
|
3
|
+
import { Button as d } from "../Button/Button.js";
|
4
4
|
import '../../assets/ListPhotos.css';const o = {
|
5
|
-
"list-photos": "_list-
|
6
|
-
"list-photos-item": "_list-photos-
|
7
|
-
"list-photos-image": "_list-photos-
|
8
|
-
"delete-button": "_delete-
|
5
|
+
"list-photos": "_list-photos_167sp_2",
|
6
|
+
"list-photos-item": "_list-photos-item_167sp_11",
|
7
|
+
"list-photos-image": "_list-photos-image_167sp_20",
|
8
|
+
"delete-button": "_delete-button_167sp_25"
|
9
9
|
};
|
10
10
|
function N({ value: i, onChange: s }) {
|
11
|
-
const [l,
|
11
|
+
const [l, m] = n(i);
|
12
12
|
_(() => {
|
13
|
-
|
13
|
+
m(i);
|
14
14
|
}, [i]);
|
15
|
-
const
|
16
|
-
const
|
17
|
-
|
15
|
+
const p = async (t) => {
|
16
|
+
const c = [...l.filter((r) => r.id !== t)];
|
17
|
+
m(c), s == null || s({ deleteId: t, list: c });
|
18
18
|
};
|
19
19
|
return /* @__PURE__ */ e("ul", { className: o["list-photos"], children: l.map((t) => /* @__PURE__ */ a("li", { className: o["list-photos-item"], children: [
|
20
20
|
/* @__PURE__ */ e("img", { className: o["list-photos-image"], src: t.url, alt: "" }),
|
21
21
|
s && /* @__PURE__ */ e(
|
22
|
-
|
22
|
+
d,
|
23
23
|
{
|
24
24
|
isIconButton: !0,
|
25
25
|
iconName: "Close12px",
|
26
26
|
size: "m-s",
|
27
27
|
variant: "secondary-gray",
|
28
28
|
className: o["delete-button"],
|
29
|
-
onClick: () =>
|
29
|
+
onClick: () => p(t.id)
|
30
30
|
}
|
31
31
|
)
|
32
32
|
] }, t.id)) });
|
@@ -1,19 +1,27 @@
|
|
1
1
|
import { jsxs as N, jsx as m } from "react/jsx-runtime";
|
2
2
|
import { c as _ } from "../../index-DIxK0V-G.js";
|
3
|
-
import { forwardRef as
|
4
|
-
import { ListFiles as
|
5
|
-
import { Uploader as
|
3
|
+
import { forwardRef as h, useState as D, useEffect as I } from "react";
|
4
|
+
import { ListFiles as R } from "../ListFiles/ListFiles.js";
|
5
|
+
import { Uploader as S } from "../Uploader/Uploader.js";
|
6
6
|
import '../../assets/UploaderPhotos.css';const c = {
|
7
7
|
"upload-file-wrapper": "_upload-file-wrapper_1a115_2"
|
8
|
-
},
|
8
|
+
}, V = h(
|
9
9
|
(n, u) => {
|
10
|
-
const {
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
10
|
+
const {
|
11
|
+
filesType: x,
|
12
|
+
arrayName: y,
|
13
|
+
maxSize: F,
|
14
|
+
onChange: a,
|
15
|
+
value: t,
|
16
|
+
maxFiles: o,
|
17
|
+
buttonText: v
|
18
|
+
} = n, [i, r] = D(t || []), d = i.length >= o;
|
19
|
+
I(() => {
|
20
|
+
t && r(t);
|
21
|
+
}, [t]);
|
22
|
+
const w = (s) => {
|
15
23
|
const z = [
|
16
|
-
...
|
24
|
+
...i,
|
17
25
|
...s.value.map((e) => {
|
18
26
|
var p, l, f;
|
19
27
|
return {
|
@@ -26,7 +34,7 @@ import '../../assets/UploaderPhotos.css';const c = {
|
|
26
34
|
})
|
27
35
|
];
|
28
36
|
r(z), a == null || a({ type: "add", data: s.value });
|
29
|
-
},
|
37
|
+
}, b = (s) => {
|
30
38
|
r(s.list), s.deleteId && (a == null || a({ type: "delete", data: s.deleteId }));
|
31
39
|
};
|
32
40
|
return /* @__PURE__ */ N(
|
@@ -38,23 +46,24 @@ import '../../assets/UploaderPhotos.css';const c = {
|
|
38
46
|
),
|
39
47
|
children: [
|
40
48
|
/* @__PURE__ */ m(
|
41
|
-
|
49
|
+
S,
|
42
50
|
{
|
43
51
|
filesType: x,
|
44
52
|
arrayName: y,
|
45
53
|
maxSize: F,
|
46
|
-
onChangeValue:
|
54
|
+
onChangeValue: w,
|
47
55
|
ref: u,
|
48
56
|
maxFiles: o,
|
49
|
-
isDisabled: d
|
57
|
+
isDisabled: d,
|
58
|
+
buttonText: v
|
50
59
|
}
|
51
60
|
),
|
52
|
-
/* @__PURE__ */ m(
|
61
|
+
/* @__PURE__ */ m(R, { value: i, onChange: b })
|
53
62
|
]
|
54
63
|
}
|
55
64
|
);
|
56
65
|
}
|
57
66
|
);
|
58
67
|
export {
|
59
|
-
|
68
|
+
V as UploaderFiles
|
60
69
|
};
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import { jsxs as
|
1
|
+
import { jsxs as b, jsx as d } from "react/jsx-runtime";
|
2
2
|
import { c as y } from "../../index-DIxK0V-G.js";
|
3
|
-
import { forwardRef as P, useState as R, useEffect as
|
4
|
-
import { ListPhotos as
|
5
|
-
import { Uploader as
|
3
|
+
import { forwardRef as P, useState as R, useEffect as L } from "react";
|
4
|
+
import { ListPhotos as N } from "../ListPhotos/ListPhotos.js";
|
5
|
+
import { Uploader as _ } from "../Uploader/Uploader.js";
|
6
6
|
import '../../assets/UploaderPhotos.css';const p = {
|
7
7
|
"upload-file-wrapper": "_upload-file-wrapper_1a115_2"
|
8
8
|
}, g = P(
|
@@ -14,24 +14,25 @@ import '../../assets/UploaderPhotos.css';const p = {
|
|
14
14
|
onChange: e,
|
15
15
|
value: a,
|
16
16
|
maxFiles: l,
|
17
|
-
titleUploader: h
|
17
|
+
titleUploader: h,
|
18
|
+
buttonText: x = "Выберите файлы"
|
18
19
|
} = c, [o, s] = R(a || []), r = o.length >= l;
|
19
|
-
|
20
|
+
L(() => {
|
20
21
|
a && s(a);
|
21
22
|
}, [a]);
|
22
|
-
const
|
23
|
-
const
|
23
|
+
const v = (t) => {
|
24
|
+
const U = [
|
24
25
|
...o,
|
25
26
|
...t.value.map((i) => ({
|
26
27
|
url: URL.createObjectURL(i.file),
|
27
28
|
id: i.id
|
28
29
|
}))
|
29
30
|
];
|
30
|
-
s(
|
31
|
-
},
|
31
|
+
s(U), e == null || e({ type: "add", data: t.value });
|
32
|
+
}, w = (t) => {
|
32
33
|
s(t.list), t.deleteId && (e == null || e({ type: "delete", data: t.deleteId }));
|
33
34
|
};
|
34
|
-
return /* @__PURE__ */
|
35
|
+
return /* @__PURE__ */ b(
|
35
36
|
"div",
|
36
37
|
{
|
37
38
|
className: y(
|
@@ -40,19 +41,20 @@ import '../../assets/UploaderPhotos.css';const p = {
|
|
40
41
|
),
|
41
42
|
children: [
|
42
43
|
/* @__PURE__ */ d(
|
43
|
-
|
44
|
+
_,
|
44
45
|
{
|
45
46
|
filesType: m,
|
46
47
|
arrayName: n,
|
47
48
|
maxSize: u,
|
48
|
-
onChangeValue:
|
49
|
+
onChangeValue: v,
|
49
50
|
ref: f,
|
50
51
|
maxFiles: l,
|
51
52
|
isDisabled: r,
|
52
|
-
titleUploader: h
|
53
|
+
titleUploader: h,
|
54
|
+
buttonText: x
|
53
55
|
}
|
54
56
|
),
|
55
|
-
!!o.length && /* @__PURE__ */ d(
|
57
|
+
!!o.length && /* @__PURE__ */ d(N, { value: o, onChange: w })
|
56
58
|
]
|
57
59
|
}
|
58
60
|
);
|