mimir-ui-kit 1.38.26 → 1.38.28

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.
@@ -76,7 +76,7 @@ import './assets/Input.css';const ne = "_label_1y1tj_27", oe = "_input_1y1tj_3",
76
76
  label: u,
77
77
  withClearButton: M,
78
78
  disabled: a,
79
- onChange: i,
79
+ onChange: d,
80
80
  rightAddon: O,
81
81
  status: F,
82
82
  leftAddon: S,
@@ -86,7 +86,7 @@ import './assets/Input.css';const ne = "_label_1y1tj_27", oe = "_input_1y1tj_3",
86
86
  maxLength: v,
87
87
  autocomplete: G = "on",
88
88
  ...P
89
- } = t, [_, I] = B(g), [f, h] = B(!!l), d = te(null), W = se(d, m);
89
+ } = t, [_, I] = B(g), [f, h] = B(!!l), i = te(null), W = se(i, m);
90
90
  R(() => {
91
91
  g && I(!0);
92
92
  }, [g]), R(() => {
@@ -98,12 +98,12 @@ import './assets/Input.css';const ne = "_label_1y1tj_27", oe = "_input_1y1tj_3",
98
98
  }, J = (r) => {
99
99
  c || (I(!0), N == null || N(r));
100
100
  }, K = () => {
101
- d != null && d.current && (d.current.value = "", d.current.focus(), h(!1), i == null || i({
102
- target: { value: "" }
101
+ i != null && i.current && (i.current.value = "", i.current.focus(), h(!1), d == null || d({
102
+ target: i.current
103
103
  }));
104
104
  }, Q = (r) => {
105
105
  let n = r.target.value;
106
- T && (n = n.replace(/\D/g, "")), v !== void 0 && (n = n.slice(0, v)), r.target.value = n, i == null || i(r), h(!!n);
106
+ T && (n = n.replace(/\D/g, "")), v !== void 0 && (n = n.slice(0, v)), r.target.value = n, d == null || d(r), h(!!n);
107
107
  }, y = z(S), b = z(O), U = {
108
108
  [e.readonly]: a || c,
109
109
  [e.focused]: _,
@@ -0,0 +1 @@
1
+ ._container_aj93w_2{display:flex;flex-direction:column;gap:var(--mimir-space-m);padding:var(--mimir-space-4xl) var(--mimir-space-xl);overflow:hidden;border:var(--mimir-control-border-width) dashed var(--black-20);border-radius:var(--mimir-control-radius-s)}._container_aj93w_2._white_aj93w_11{background-color:var(--white)}._container_aj93w_2._gray_aj93w_14{background-color:var(--black-5)}._container_aj93w_2._compact_aj93w_17{padding:var(--mimir-space-xl) var(--mimir-space-m)}
@@ -10,7 +10,7 @@ import { YearPickerModal as at } from "./YearPickerModal.js";
10
10
  import { useClickOutside as mt } from "../../hooks/useClickOutside/useClickOutside.js";
11
11
  import { Icon as X } from "../../icons/Icon.js";
12
12
  import { formating as l } from "../../utils/index.js";
13
- import { I as pt } from "../../Input-CQ7LgZWK.js";
13
+ import { I as pt } from "../../Input-DAmc_HxO.js";
14
14
  import { EInputStatus as dt, EInputSize as E } from "../Input/constants.js";
15
15
  const ft = {
16
16
  days: ot,
@@ -2,7 +2,7 @@ import "react/jsx-runtime";
2
2
  import "../../index-DIxK0V-G.js";
3
3
  import "react";
4
4
  import "./constants.js";
5
- import { I as f } from "../../Input-CQ7LgZWK.js";
5
+ import { I as f } from "../../Input-DAmc_HxO.js";
6
6
  import "../../hooks/useMergeRefs/useMergeRefs.js";
7
7
  import "../../icons/Icon.js";
8
8
  import "../Button/Button.js";
@@ -1,4 +1,4 @@
1
- import { I as n } from "../../Input-CQ7LgZWK.js";
1
+ import { I as n } from "../../Input-DAmc_HxO.js";
2
2
  import { EInputSize as u, EInputStatus as I, EInputVariant as a } from "./constants.js";
3
3
  export {
4
4
  u as EInputSize,
@@ -3,7 +3,7 @@ import { c } from "../../index-DIxK0V-G.js";
3
3
  import { memo as w, forwardRef as u, useState as m } from "react";
4
4
  import { Icon as d } from "../../icons/Icon.js";
5
5
  import { Button as _ } from "../Button/Button.js";
6
- import { I as l } from "../../Input-CQ7LgZWK.js";
6
+ import { I as l } from "../../Input-DAmc_HxO.js";
7
7
  import '../../assets/InputPassword.css';const b = "_input_7b9x2_2", x = "_wrapper_7b9x2_6", h = "_button_7b9x2_17", f = "_icon_7b9x2_33", N = "_show_7b9x2_38", t = {
8
8
  input: b,
9
9
  wrapper: x,
@@ -1,7 +1,7 @@
1
1
  import { jsx as d } from "react/jsx-runtime";
2
2
  import { memo as I, forwardRef as i, useState as c, useCallback as f, useImperativeHandle as P } from "react";
3
3
  import { getMaskedInputPhoneValue as m, getUnmaskedInputValue as o } from "./utils.js";
4
- import { I as b } from "../../Input-CQ7LgZWK.js";
4
+ import { I as b } from "../../Input-DAmc_HxO.js";
5
5
  const h = I(
6
6
  i(
7
7
  ({ value: s = "", onChange: e, ...p }, a) => {
@@ -17,6 +17,10 @@ export type TListFiles = {
17
17
  * Вариант отображения файла
18
18
  */
19
19
  variant?: EFileItemVariant | `${EFileItemVariant}`;
20
+ /**
21
+ * Блок удаления файлов
22
+ */
23
+ disabled?: boolean;
20
24
  };
21
25
  export type TFileItem = {
22
26
  id: number;
@@ -33,4 +37,4 @@ export type TFilesDetail = {
33
37
  size?: number;
34
38
  type?: string;
35
39
  };
36
- export declare function ListFiles({ value, onChange, classNameWrapper, variant }: TListFiles): import("react/jsx-runtime").JSX.Element | null;
40
+ export declare function ListFiles({ value, onChange, classNameWrapper, variant, disabled }: TListFiles): import("react/jsx-runtime").JSX.Element | null;
@@ -1,10 +1,10 @@
1
1
  import { jsx as t, jsxs as r } from "react/jsx-runtime";
2
- import { c as _ } from "../../index-DIxK0V-G.js";
3
- import { useState as d, useEffect as u } from "react";
4
- import { EFileItemVariant as w } from "./constants.js";
5
- import { formating as g } from "../../utils/index.js";
6
- import { Button as N } from "../Button/Button.js";
7
- import '../../assets/ListFiles.css';const h = "_white_wnnpg_58", z = "_gray_wnnpg_63", e = {
2
+ import { c as d } from "../../index-DIxK0V-G.js";
3
+ import { useState as u, useEffect as w } from "react";
4
+ import { EFileItemVariant as g } from "./constants.js";
5
+ import { formating as N } from "../../utils/index.js";
6
+ import { Button as h } from "../Button/Button.js";
7
+ import '../../assets/ListFiles.css';const z = "_white_wnnpg_58", y = "_gray_wnnpg_63", e = {
8
8
  "file-info": "_file-info_wnnpg_2",
9
9
  "file-info-size": "_file-info-size_wnnpg_8",
10
10
  "file-info-name-wrapper": "_file-info-name-wrapper_wnnpg_16",
@@ -12,27 +12,28 @@ import '../../assets/ListFiles.css';const h = "_white_wnnpg_58", z = "_gray_wnnp
12
12
  "file-upload-container": "_file-upload-container_wnnpg_34",
13
13
  "file-upload-container-item": "_file-upload-container-item_wnnpg_42",
14
14
  "delete-button": "_delete-button_wnnpg_51",
15
- white: h,
16
- gray: z
15
+ white: z,
16
+ gray: y
17
17
  };
18
- function v({
18
+ function B({
19
19
  value: o,
20
20
  onChange: s,
21
21
  classNameWrapper: f,
22
- variant: c = w.white
22
+ variant: c = g.white,
23
+ disabled: m
23
24
  }) {
24
- const [a, l] = d(o);
25
- u(() => {
25
+ const [a, l] = u(o);
26
+ w(() => {
26
27
  l(o);
27
28
  }, [o]);
28
- const m = async (i) => {
29
- const n = [...a.filter((p) => p.id !== i)];
29
+ const p = async (i) => {
30
+ const n = [...a.filter((_) => _.id !== i)];
30
31
  l(n), s == null || s({ deleteId: i, list: n });
31
32
  };
32
33
  return a.length ? /* @__PURE__ */ t(
33
34
  "ul",
34
35
  {
35
- className: _(
36
+ className: d(
36
37
  e["file-upload-container"],
37
38
  f,
38
39
  e[c]
@@ -41,19 +42,19 @@ function v({
41
42
  /* @__PURE__ */ r("div", { className: e["file-info"], children: [
42
43
  (i == null ? void 0 : i.size) && /* @__PURE__ */ r("span", { className: e["file-info-size"], children: [
43
44
  " ",
44
- g.Size(i == null ? void 0 : i.size)
45
+ N.Size(i == null ? void 0 : i.size)
45
46
  ] }),
46
47
  /* @__PURE__ */ t("div", { className: e["file-info-name-wrapper"], children: /* @__PURE__ */ t("div", { className: e["file-info-name"], children: i.name }) })
47
48
  ] }),
48
- /* @__PURE__ */ t(
49
- N,
49
+ !m && /* @__PURE__ */ t(
50
+ h,
50
51
  {
51
52
  isIconButton: !0,
52
53
  iconName: "Close12px",
53
54
  size: "m-s",
54
55
  variant: "secondary-gray",
55
56
  className: e["delete-button"],
56
- onClick: () => m(i.id)
57
+ onClick: () => p(i.id)
57
58
  }
58
59
  )
59
60
  ] }, n))
@@ -61,5 +62,5 @@ function v({
61
62
  ) : null;
62
63
  }
63
64
  export {
64
- v as ListFiles
65
+ B as ListFiles
65
66
  };
@@ -7,7 +7,7 @@ import { Icon as ye } from "../../icons/Icon.js";
7
7
  import { Button as ke } from "../Button/Button.js";
8
8
  import { CheckboxMimir as Te } from "../CheckboxMimir/CheckboxMimir.js";
9
9
  import { Chip as Oe } from "../Chip/Chip.js";
10
- import { I as ne } from "../../Input-CQ7LgZWK.js";
10
+ import { I as ne } from "../../Input-DAmc_HxO.js";
11
11
  import { EInputVariant as ze } from "../Input/constants.js";
12
12
  import { H as Ae, U as ie, G as se, K as Ve, W as qe } from "../../combobox-CVtJDVoZ.js";
13
13
  import '../../assets/MultiSelectSearch.css';const xe = "_disabled_io0c8_5", De = "_container_io0c8_9", Pe = "_full_io0c8_27", Re = "_button_io0c8_39", Be = "_options_io0c8_53", Fe = "_visible_io0c8_66", Je = "_top_io0c8_69", je = "_bottom_io0c8_74", Ge = "_m_io0c8_2", He = "_l_io0c8_116", Ue = "_focused_io0c8_134", We = "_option_io0c8_53", Ke = "_chip_io0c8_163", $e = "_clear_io0c8_188", e = {
@@ -1,5 +1,5 @@
1
1
  import { EMultiSelectSearchSize as o, MOBILE_MENU_HEIGHT as u, DESKTOP_MENU_HEIGHT as w } from "./constants.js";
2
- import "../../Input-CQ7LgZWK.js";
2
+ import "../../Input-DAmc_HxO.js";
3
3
  import { EInputSize as r } from "../Input/constants.js";
4
4
  const m = (t) => {
5
5
  switch (t) {
@@ -3,7 +3,7 @@ import { c as u } from "../../index-DIxK0V-G.js";
3
3
  import { forwardRef as P, useImperativeHandle as R, Fragment as T } from "react";
4
4
  import { ITEMS_PER_SEPARATOR as q, DEFAULT_VALUE_LENGTH as v } from "./constants.js";
5
5
  import { useOTPInput as y } from "./hooks.js";
6
- import { I as A } from "../../Input-CQ7LgZWK.js";
6
+ import { I as A } from "../../Input-DAmc_HxO.js";
7
7
  import '../../assets/OtpInput.css';const C = "_otp_1shq3_3", F = "_input_1shq3_14", L = "_separator_1shq3_28", r = {
8
8
  otp: C,
9
9
  "input-wrapper": "_input-wrapper_1shq3_14",
@@ -5,7 +5,7 @@ import { ESelectSearchSize as g } from "./constants.js";
5
5
  import { mapSizeToInputSize as A, getDropdownArrowIcon as J } from "./utils.js";
6
6
  import { Icon as O } from "../../icons/Icon.js";
7
7
  import { Button as Q } from "../Button/Button.js";
8
- import { I as B } from "../../Input-CQ7LgZWK.js";
8
+ import { I as B } from "../../Input-DAmc_HxO.js";
9
9
  import { EInputVariant as X } from "../Input/constants.js";
10
10
  import { H as Y, U as M, G as j, K as Z, W as ee } from "../../combobox-CVtJDVoZ.js";
11
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", de = "_option_1bph7_54", pe = "_clear_1bph7_167", e = {
@@ -1,5 +1,5 @@
1
1
  import { ESelectSearchSize as r } from "./constants.js";
2
- import "../../Input-CQ7LgZWK.js";
2
+ import "../../Input-DAmc_HxO.js";
3
3
  import { EInputSize as t } from "../Input/constants.js";
4
4
  const c = (o) => {
5
5
  switch (o) {
@@ -5,7 +5,7 @@ import { useAutoResizeTextArea as Z } from "./hooks.js";
5
5
  import { useMergeRefs as $ } from "../../hooks/useMergeRefs/useMergeRefs.js";
6
6
  import { Icon as ee } from "../../icons/Icon.js";
7
7
  import { Button as te } from "../Button/Button.js";
8
- import { c as e } from "../../Input-CQ7LgZWK.js";
8
+ import { c as e } from "../../Input-DAmc_HxO.js";
9
9
  import { EInputVariant as ae } from "../Input/constants.js";
10
10
  import '../../assets/TextArea.css';const re = "_textarea_rk5xe_2", se = "_clear_rk5xe_11", le = "_label_rk5xe_26", ne = "_s_rk5xe_71", oe = "_m_rk5xe_84", ce = "_l_rk5xe_26", t = {
11
11
  "textarea-wrapper": "_textarea-wrapper_rk5xe_2",
@@ -1,5 +1,5 @@
1
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";
2
+ import { forwardRef as R, useRef as M, 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";
@@ -7,7 +7,7 @@ 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"
10
- }, j = {
10
+ }, y = {
11
11
  jpeg: "image/jpeg",
12
12
  jpg: "image/jpg",
13
13
  png: "image/png",
@@ -31,76 +31,76 @@ import '../../assets/Uploader.css';const c = {
31
31
  ], X = () => {
32
32
  let i = 0;
33
33
  return () => (i = (i + 1) % Number.MAX_SAFE_INTEGER, i);
34
- }, q = X(), W = M(
34
+ }, q = X(), W = R(
35
35
  (i, v) => {
36
36
  const {
37
37
  filesType: l = L,
38
- onChangeValue: I,
39
- arrayName: N,
40
- maxSize: f = 15,
41
- maxFiles: d,
42
- isDisabled: m,
43
- titleUploader: u = "Или перетащите сюда",
44
- buttonText: T = "Выберите файлы",
45
- showOnlyUploadButton: z = !1,
46
- uploadButtonVariant: S = O.SecondaryAsphalt,
47
- buttonSize: C = "m",
48
- buttonClassName: E,
49
- onMaxFilesExceeded: p,
50
- onMaxSizeExceeded: g,
51
- onInvalidFileType: x
52
- } = i, h = _(null), r = _(null), b = k(), F = (e) => {
38
+ onChangeValue: _,
39
+ arrayName: j,
40
+ maxSize: d = 15,
41
+ maxFiles: p,
42
+ isDisabled: f,
43
+ titleUploader: m = "Или перетащите сюда",
44
+ buttonText: I = "Выберите файлы",
45
+ showOnlyUploadButton: N = !1,
46
+ uploadButtonVariant: T = O.SecondaryAsphalt,
47
+ buttonSize: z = "m",
48
+ buttonClassName: S,
49
+ onMaxFilesExceeded: r,
50
+ onMaxSizeExceeded: u,
51
+ onInvalidFileType: g
52
+ } = i, x = M(null), h = k(), C = (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
- }, R = (e) => {
55
+ }, E = (e) => {
56
+ var s;
56
57
  if (e.target.files && e.target.files[0]) {
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
- return !w && x && x(t.name), !y && g && g(t.name), w && y;
62
- }).slice(0, d).map((t) => ({ file: t, id: q() }));
63
- I({ arrayName: N, value: a }), r.current && (r.current.value = "");
58
+ const a = Array.from(e.target.files);
59
+ p && a.length > p && (r == null || r());
60
+ const U = a.filter((t) => {
61
+ const V = C(t), b = l.map((A) => y[A]).includes(V), w = t.size / 1024 ** 2 <= d;
62
+ return !b && g && g(t.name), !w && u && u(t.name), b && w;
63
+ }).slice(0, p).map((t) => ({ file: t, id: q() }));
64
+ _({ arrayName: j, value: U }), (s = e.target) != null && s.value && (e.target.value = "");
64
65
  }
65
- }, U = () => {
66
+ }, F = () => {
66
67
  var e;
67
- (e = h.current) == null || e.click();
68
+ (e = x.current) == null || e.click();
68
69
  };
69
70
  return /* @__PURE__ */ o("div", { className: c["upload-file-wrapper"], ref: v, children: [
70
71
  /* @__PURE__ */ n(
71
72
  "input",
72
73
  {
73
- ref: r,
74
74
  type: "file",
75
75
  className: c["upload-file-input"],
76
76
  "aria-label": "Upload",
77
77
  name: "image[]",
78
78
  multiple: !0,
79
- onChange: R,
79
+ onChange: E,
80
80
  title: "",
81
- id: b,
82
- accept: l.map((e) => j[e]).join(),
83
- disabled: m
81
+ id: h,
82
+ accept: l.map((e) => y[e]).join(),
83
+ disabled: f
84
84
  }
85
85
  ),
86
- /* @__PURE__ */ o("label", { htmlFor: b, ref: h, children: [
86
+ /* @__PURE__ */ o("label", { htmlFor: h, ref: x, children: [
87
87
  /* @__PURE__ */ n(
88
88
  G,
89
89
  {
90
- size: C,
91
- variant: S,
90
+ size: z,
91
+ variant: T,
92
92
  leftIcon: /* @__PURE__ */ n(D, { iconName: "UnionIcon16px" }),
93
- onClick: U,
94
- disabled: m,
95
- className: E,
96
- children: T
93
+ onClick: F,
94
+ disabled: f,
95
+ className: S,
96
+ children: I
97
97
  }
98
98
  ),
99
- !z && /* @__PURE__ */ o(B, { children: [
100
- u && /* @__PURE__ */ n("b", { children: u }),
99
+ !N && /* @__PURE__ */ o(B, { children: [
100
+ m && /* @__PURE__ */ n("b", { children: m }),
101
101
  /* @__PURE__ */ o("span", { className: c["upload-text"], children: [
102
102
  "Максимальный размер одного файла – ",
103
- f,
103
+ d,
104
104
  " Мб",
105
105
  /* @__PURE__ */ n("br", {}),
106
106
  "Загрузить можно файлы следующих форматов: ",
@@ -1,59 +1,3 @@
1
- import { TFilesDetail } from '../ListFiles/ListFiles';
2
- import { imageTypesArr } from '../Uploader/constants';
3
- import { TFileItem } from '../Uploader/Uploader';
1
+ import { TUploaderFiles } from './types';
4
2
 
5
- export type TUploaderFiles = {
6
- /**
7
- * Массив разрешенных типов файлов для настройки валидации
8
- * 'jpeg' | 'jpg' | 'png' | 'tiff' | 'gif' | 'heic' | 'doc' | 'xls' | 'pdf' |'docx' | 'txt'
9
- */
10
- filesType: imageTypesArr[];
11
- /**
12
- * Наименование передаваемого массива файлов
13
- */
14
- arrayName: string;
15
- /**
16
- * Максимальный размер файлов.
17
- */
18
- maxSize: number;
19
- /**
20
- * Функция обратного вызова, передает параметры type и data,
21
- * type 'add' в data передает массив файлов,
22
- * type:'delete' в data передает id удаленного файла
23
- */
24
- onChange: (j: TOnChangeFilesUpdate) => void;
25
- /**
26
- * Передаваемые файлы.
27
- */
28
- value?: TFilesDetail[];
29
- /**
30
- * Максимальное количество файлов.
31
- */
32
- maxFiles: number;
33
- /**
34
- * Текст внутри кнопки загрузки файла
35
- */
36
- buttonText?: string;
37
- /**
38
- * необязательное поле, имя формы загрузчика на случай, если на странице несколько форм
39
- */
40
- name?: string;
41
- /**
42
- * Проп для обработки ошибки при превышении максимального количества файлов
43
- */
44
- onMaxFilesExceeded?: () => void;
45
- /**
46
- * Проп для обработки ошибки при превышении максимального размера файла
47
- */
48
- onMaxSizeExceeded?: (fileName: string) => void;
49
- /**
50
- * Проп для обработки ошибки при загрузке файла неразрешенного типа
51
- */
52
- onInvalidFileType?: (fileName: string) => void;
53
- };
54
- export type TOnChangeFilesUpdate = {
55
- type: string;
56
- data: TFileItem[] | number;
57
- name?: string;
58
- };
59
3
  export declare const UploaderFiles: import('react').ForwardRefExoticComponent<TUploaderFiles & import('react').RefAttributes<HTMLDivElement>>;
@@ -1,76 +1,92 @@
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
- import { ListFiles as R } from "../ListFiles/ListFiles.js";
5
- import { Uploader as U } from "../Uploader/Uploader.js";
6
- import '../../assets/UploaderPhotos.css';const c = {
7
- "upload-file-wrapper": "_upload-file-wrapper_1a115_2"
8
- }, q = T(
9
- (u, x) => {
1
+ import { jsxs as Q, jsx as y } from "react/jsx-runtime";
2
+ import { c as R } from "../../index-DIxK0V-G.js";
3
+ import { forwardRef as W, useState as L, useEffect as X } from "react";
4
+ import { EUploaderFilesVariant as u } from "./constants.js";
5
+ import { useMediaQuery as k } from "../../hooks/useMediaQuery/useMediaQuery.js";
6
+ import { EMediaQuery as q } from "../../hooks/useMediaQuery/constants.js";
7
+ import { ListFiles as A } from "../ListFiles/ListFiles.js";
8
+ import { EFileItemVariant as x } from "../ListFiles/constants.js";
9
+ import { Uploader as B } from "../Uploader/Uploader.js";
10
+ import '../../assets/UploaderFiles.css';const C = "_container_aj93w_2", G = "_white_aj93w_11", H = "_gray_aj93w_14", J = "_compact_aj93w_17", c = {
11
+ container: C,
12
+ white: G,
13
+ gray: H,
14
+ compact: J
15
+ }, ta = W(
16
+ (F, _) => {
10
17
  const {
11
- filesType: F,
12
- arrayName: y,
13
- maxSize: v,
14
- onChange: a,
15
- value: s,
18
+ compact: w,
19
+ readonly: l,
20
+ filesType: h,
21
+ arrayName: S,
22
+ maxSize: j,
23
+ onChange: i,
24
+ value: t,
16
25
  name: d,
17
- maxFiles: l,
18
- buttonText: w,
19
- onMaxFilesExceeded: z,
20
- onMaxSizeExceeded: b,
21
- onInvalidFileType: h
22
- } = u, [t, o] = _(s || []), r = t.length >= l;
23
- D(() => {
24
- s && o(s);
25
- }, [s]);
26
- const E = (i) => {
27
- const M = [
28
- ...t,
29
- ...i.value.map((e) => {
30
- var p, m, n;
26
+ maxFiles: o,
27
+ buttonText: E,
28
+ variant: n = u.White,
29
+ className: M,
30
+ onMaxFilesExceeded: b,
31
+ onMaxSizeExceeded: g,
32
+ onInvalidFileType: v
33
+ } = F, z = k(q.XSS), [e, r] = L(t || []), N = o && e.length >= o, I = n === u.White ? x.gray : x.white;
34
+ X(() => {
35
+ t && r(t);
36
+ }, [t]);
37
+ const V = (s) => {
38
+ const D = [
39
+ ...e,
40
+ ...s.value.map((a) => {
41
+ var p, m, f;
31
42
  return {
32
- id: e.id,
43
+ id: a.id,
33
44
  url: "",
34
- size: (p = e == null ? void 0 : e.file) == null ? void 0 : p.size,
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
45
+ size: (p = a == null ? void 0 : a.file) == null ? void 0 : p.size,
46
+ name: (m = a == null ? void 0 : a.file) == null ? void 0 : m.name,
47
+ type: (f = a == null ? void 0 : a.file) == null ? void 0 : f.type
37
48
  };
38
49
  })
39
50
  ];
40
- o(M), a == null || a({ type: "add", data: i.value, name: d });
41
- }, I = (i) => {
42
- o(i.list), i.deleteId && (a == null || a({ type: "delete", data: i.deleteId, name: d }));
43
- };
44
- return /* @__PURE__ */ N(
45
- "div",
46
- {
47
- className: S(
48
- c["upload-file-wrapper"],
49
- r && c.disabled
50
- ),
51
- children: [
52
- /* @__PURE__ */ f(
53
- U,
54
- {
55
- filesType: F,
56
- arrayName: y,
57
- maxSize: v,
58
- onChangeValue: E,
59
- ref: x,
60
- maxFiles: l - t.length,
61
- isDisabled: r,
62
- buttonText: w,
63
- onMaxFilesExceeded: z,
64
- onMaxSizeExceeded: b,
65
- onInvalidFileType: h
66
- }
67
- ),
68
- /* @__PURE__ */ f(R, { value: t, onChange: I })
69
- ]
70
- }
71
- );
51
+ r(D), i == null || i({ type: "add", data: s.value, name: d });
52
+ }, T = (s) => {
53
+ r(s.list), s.deleteId && (i == null || i({ type: "delete", data: s.deleteId, name: d }));
54
+ }, U = R([
55
+ c.container,
56
+ c[n],
57
+ w && c.compact,
58
+ M
59
+ ]);
60
+ return /* @__PURE__ */ Q("div", { className: U, children: [
61
+ /* @__PURE__ */ y(
62
+ B,
63
+ {
64
+ filesType: h,
65
+ arrayName: S,
66
+ maxSize: j,
67
+ onChangeValue: V,
68
+ ref: _,
69
+ buttonSize: z ? "s" : "m",
70
+ maxFiles: o && o - e.length,
71
+ isDisabled: N || l,
72
+ buttonText: E,
73
+ onMaxFilesExceeded: b,
74
+ onMaxSizeExceeded: g,
75
+ onInvalidFileType: v
76
+ }
77
+ ),
78
+ /* @__PURE__ */ y(
79
+ A,
80
+ {
81
+ value: e,
82
+ variant: I,
83
+ onChange: T,
84
+ disabled: l
85
+ }
86
+ )
87
+ ] });
72
88
  }
73
89
  );
74
90
  export {
75
- q as UploaderFiles
91
+ ta as UploaderFiles
76
92
  };
@@ -0,0 +1,4 @@
1
+ export declare enum EUploaderFilesVariant {
2
+ Gray = "gray",
3
+ White = "white"
4
+ }
@@ -0,0 +1,4 @@
1
+ var t = /* @__PURE__ */ ((r) => (r.Gray = "gray", r.White = "white", r))(t || {});
2
+ export {
3
+ t as EUploaderFilesVariant
4
+ };
@@ -1,2 +1,3 @@
1
1
  export { UploaderFiles } from './UploaderFiles';
2
- export type { TUploaderFiles, TOnChangeFilesUpdate } from './UploaderFiles';
2
+ export type { TUploaderFiles, TOnChangeFilesUpdate } from './types';
3
+ export { EUploaderFilesVariant } from './constants';
@@ -1,4 +1,6 @@
1
- import { UploaderFiles as r } from "./UploaderFiles.js";
1
+ import { UploaderFiles as o } from "./UploaderFiles.js";
2
+ import { EUploaderFilesVariant as l } from "./constants.js";
2
3
  export {
3
- r as UploaderFiles
4
+ l as EUploaderFilesVariant,
5
+ o as UploaderFiles
4
6
  };