mimir-ui-kit 1.37.2 → 1.37.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- ._input_hmkm7_2{padding-right:var(--mimir-space-3xl)}._input-wrapper_hmkm7_6{flex:1}._date-wrapper_hmkm7_10{position:relative;width:100%}._date-wrapper_hmkm7_10 ._inputBorderControl_hmkm7_14{border:transparent}._date-wrapper_hmkm7_10:hover ._input-wrapper_hmkm7_6{background-color:var(--input-bg-color-hover)}._date-wrapper_hmkm7_10:before{position:absolute;top:0;right:45px;bottom:0;left:0;z-index:3;cursor:pointer;content:""}._date-wrapper_hmkm7_10._editable_hmkm7_27:before{display:none}._date-wrapper_hmkm7_10 svg{cursor:pointer}[data-disabled=true] ._date-wrapper_hmkm7_10:before{cursor:auto}[data-disabled=true] ._date-wrapper_hmkm7_10 ._input-wrapper_hmkm7_6{background:var(--black-20)}[data-disabled=true] ._date-wrapper_hmkm7_10 ._input-wrapper_hmkm7_6 label,[data-disabled=true] ._date-wrapper_hmkm7_10 ._input-wrapper_hmkm7_6 input{color:var(--white)}[data-disabled=true] ._button-wrapper_hmkm7_44 svg{color:var(--white);cursor:default;fill:var(--white)}._wrapper_hmkm7_50{position:relative;display:flex;align-items:center;border-radius:var(--mimir-control-radius-s)}._wrapper_hmkm7_50._active_hmkm7_56{border-bottom:1px solid var(--citrine-100)}._button-wrapper_hmkm7_44{position:absolute;top:0;right:0;z-index:2;display:flex;justify-content:center;width:44px;height:100%;max-height:var(--button-height-xxl)}._button_hmkm7_44{align-self:center;background-color:transparent;border-radius:var(--mimir-control-radius-s)}._calendar-block_hmkm7_78{position:absolute;z-index:var(--mimir-zindex-dropdown);display:flex;flex-direction:column;width:368px;max-height:none;padding:var(--mimir-space-m);font-weight:var(--mimir-font-weight-text-regular);font-size:var(--mimir-size-text-l);font-family:var(--mimir-font-inter);line-height:var(--mimir-line-height-text-2xs);text-align:center;text-overflow:ellipsis;background:var(--white);border-radius:var(--mimir-control-radius-s);box-shadow:0 0 #16172705,0 2px 4px #16172705,0 6px 6px #16172705,0 15px 9px #16172703;opacity:0;transition:height .5s ease-in;font-feature-settings:"zero";font-variant-numeric:slashed-zero}._calendar-block_hmkm7_78 ._h_hmkm7_100{display:flex;width:100%;color:var(--black-100)}._calendar-block_hmkm7_78 ._b_hmkm7_44{display:grid;grid-template-columns:repeat(7,1fr)}._calendar-block_hmkm7_78 ._d_hmkm7_10{display:flex;flex:1;gap:var(--mimir-space-2xs);align-items:center;justify-content:center;color:var(--black-100);font-size:var(--mimir-size-text-l);cursor:pointer}._calendar-block_hmkm7_78 ._m_hmkm7_122,._calendar-block_hmkm7_78 ._a_hmkm7_56,._calendar-block_hmkm7_78 ._prev_hmkm7_124{width:auto;height:48px;overflow:hidden}._calendar-block_hmkm7_78 ._m_hmkm7_122{display:flex;align-items:center;justify-content:center;color:var(--disabled);font-size:var(--mimir-size-text-l)}._calendar-block_hmkm7_78 ._orange_hmkm7_138{color:var(--citrine-100)}._calendar-block_hmkm7_78 ._a_hmkm7_56{color:var(--black-100);font-size:var(--mimir-size-text-l);border-radius:var(--mimir-control-radius-s)}._calendar-block_hmkm7_78 ._a_hmkm7_56:hover{background:var(--black-10)}._calendar-block_hmkm7_78 ._a_hmkm7_56:active{color:var(--white);background:var(--sapphire-100)}._calendar-block_hmkm7_78 ._current_hmkm7_155{background:var(--sapphire-10);border-radius:var(--mimir-control-radius-s)}._calendar-block_hmkm7_78 ._monthGrid_hmkm7_160{display:grid;grid-template-columns:repeat(3,1fr)}._icon-button_hmkm7_165{display:flex}
1
+ ._input-field-group-datePicker_97gw7_2{display:flex;flex-direction:column;gap:var(--mimir-space-2xs)}._input-field-group-datePicker_97gw7_2 ._textError_97gw7_7{font-family:var(--mimir-font-inter);font-weight:var(--mimir-font-weight-text-regular);font-size:var(--mimir-size-text-s);line-height:var(--mimir-size-text-m);text-align:left;color:var(--gos-znak-diplomatic-background-color)}._input_97gw7_2{padding-right:var(--mimir-space-3xl)}._input-wrapper_97gw7_20{flex:1}._date-wrapper_97gw7_24{position:relative;width:100%}._date-wrapper_97gw7_24 ._inputBorderControl_97gw7_28{border:transparent}._date-wrapper_97gw7_24:hover ._input-wrapper_97gw7_20{background-color:var(--input-bg-color-hover)}._date-wrapper_97gw7_24:before{position:absolute;top:0;right:45px;bottom:0;left:0;z-index:3;cursor:pointer;content:""}._date-wrapper_97gw7_24._editable_97gw7_41:before{display:none}._date-wrapper_97gw7_24 svg{cursor:pointer}[data-disabled=true] ._date-wrapper_97gw7_24:before{cursor:auto}[data-disabled=true] ._date-wrapper_97gw7_24 ._input-wrapper_97gw7_20{background:var(--black-20)}[data-disabled=true] ._date-wrapper_97gw7_24 ._input-wrapper_97gw7_20 label,[data-disabled=true] ._date-wrapper_97gw7_24 ._input-wrapper_97gw7_20 input{color:var(--white)}[data-disabled=true] ._button-wrapper_97gw7_58 svg{color:var(--white);cursor:default;fill:var(--white)}._wrapper_97gw7_64{--border-color: var(--citrine-100);position:relative;display:flex;align-items:center;border-radius:var(--mimir-control-radius-s)}._wrapper_97gw7_64:has([data-error=true]){--border-color: var(--error-normal)}._wrapper_97gw7_64._active_97gw7_74{border-bottom:1px solid var(--border-color)}._button-wrapper_97gw7_58{position:absolute;top:0;right:0;z-index:2;display:flex;justify-content:center;width:44px;height:100%;max-height:var(--button-height-xxl)}._button_97gw7_58{align-self:center;background-color:transparent;border-radius:var(--mimir-control-radius-s)}._calendar-block_97gw7_96{position:absolute;z-index:var(--mimir-zindex-dropdown);display:flex;flex-direction:column;width:368px;max-height:none;padding:var(--mimir-space-m);font-weight:var(--mimir-font-weight-text-regular);font-size:var(--mimir-size-text-l);font-family:var(--mimir-font-inter);line-height:var(--mimir-line-height-text-2xs);text-align:center;text-overflow:ellipsis;background:var(--white);border-radius:var(--mimir-control-radius-s);box-shadow:0 0 #16172705,0 2px 4px #16172705,0 6px 6px #16172705,0 15px 9px #16172703;opacity:0;transition:height .5s ease-in;font-feature-settings:"zero";font-variant-numeric:slashed-zero}._calendar-block_97gw7_96 ._h_97gw7_118{display:flex;width:100%;color:var(--black-100)}._calendar-block_97gw7_96 ._b_97gw7_58{display:grid;grid-template-columns:repeat(7,1fr)}._calendar-block_97gw7_96 ._d_97gw7_24{display:flex;flex:1;gap:var(--mimir-space-2xs);align-items:center;justify-content:center;color:var(--black-100);font-size:var(--mimir-size-text-l);cursor:pointer}._calendar-block_97gw7_96 ._m_97gw7_140,._calendar-block_97gw7_96 ._a_97gw7_74,._calendar-block_97gw7_96 ._prev_97gw7_142{width:auto;height:48px;overflow:hidden}._calendar-block_97gw7_96 ._m_97gw7_140{display:flex;align-items:center;justify-content:center;color:var(--disabled);font-size:var(--mimir-size-text-l)}._calendar-block_97gw7_96 ._orange_97gw7_156{color:var(--citrine-100)}._calendar-block_97gw7_96 ._a_97gw7_74{color:var(--black-100);font-size:var(--mimir-size-text-l);border-radius:var(--mimir-control-radius-s)}._calendar-block_97gw7_96 ._a_97gw7_74:hover{background:var(--black-10)}._calendar-block_97gw7_96 ._a_97gw7_74:active{color:var(--white);background:var(--sapphire-100)}._calendar-block_97gw7_96 ._current_97gw7_173{background:var(--sapphire-10);border-radius:var(--mimir-control-radius-s)}._calendar-block_97gw7_96 ._monthGrid_97gw7_178{display:grid;grid-template-columns:repeat(3,1fr)}._icon-button_97gw7_183{display:flex}
@@ -30,9 +30,9 @@ export type TProps = {
30
30
  */
31
31
  disabled?: boolean;
32
32
  /**
33
- * Флаг наличия ошибки
33
+ * Флаг наличия ошибки или текст ошибки
34
34
  */
35
- error?: boolean;
35
+ error?: boolean | string;
36
36
  /**
37
37
  * Флаг немедленной валидации при вводе
38
38
  */
@@ -84,9 +84,9 @@ export declare const DatePicker: import('react').MemoExoticComponent<import('rea
84
84
  */
85
85
  disabled?: boolean;
86
86
  /**
87
- * Флаг наличия ошибки
87
+ * Флаг наличия ошибки или текст ошибки
88
88
  */
89
- error?: boolean;
89
+ error?: boolean | string;
90
90
  /**
91
91
  * Флаг немедленной валидации при вводе
92
92
  */
@@ -1,10 +1,10 @@
1
- import { jsxs as B, jsx as m } from "react/jsx-runtime";
2
- import { c as b } from "../../index-DIxK0V-G.js";
1
+ import { jsxs as H, jsx as a } from "react/jsx-runtime";
2
+ import { c as _ } from "../../index-DIxK0V-G.js";
3
3
  import { memo as V, forwardRef as tt, useState as w, useEffect as T } from "react";
4
4
  import { MAX_DAY as st, MAX_MONTH as et, DATE_LENGTH as it } from "./constants.js";
5
- import { DatePickerModal as ot } from "./DatePickerModal.js";
6
- import { MonthPickerModal as rt } from "./MonthPickerModal.js";
7
- import { c as o } from "../../styles.module-B3xL6-zc.js";
5
+ import { DatePickerModal as rt } from "./DatePickerModal.js";
6
+ import { MonthPickerModal as ot } from "./MonthPickerModal.js";
7
+ import { c as e } from "../../styles.module-CPvzaOtD.js";
8
8
  import { formatDatePart as L } from "./utils.js";
9
9
  import { YearPickerModal as at } from "./YearPickerModal.js";
10
10
  import { useClickOutside as ct } from "../../hooks/useClickOutside/useClickOutside.js";
@@ -13,137 +13,140 @@ import { formating as y } from "../../utils/index.js";
13
13
  import { I as mt } from "../../Input-BYrIS5GU.js";
14
14
  import { EInputStatus as pt, EInputSize as U } from "../Input/constants.js";
15
15
  const dt = {
16
- days: ot,
17
- months: rt,
16
+ days: rt,
17
+ months: ot,
18
18
  years: at
19
19
  }, ft = V(
20
20
  tt(
21
21
  ({
22
- size: P,
23
- value: e,
22
+ size: M,
23
+ value: i,
24
24
  onChangeValue: s,
25
- name: a,
26
- before: M,
25
+ name: c,
26
+ before: v,
27
27
  type: p = "days",
28
- error: v,
28
+ error: x,
29
29
  onError: d,
30
- onBlur: i,
31
- validateImmediately: h,
30
+ onBlur: r,
31
+ validateImmediately: b,
32
32
  variant: X,
33
- disabled: x = !1,
33
+ disabled: S = !1,
34
34
  editable: D = !1,
35
35
  openOnInput: j = !0,
36
- ...u
36
+ ...E
37
37
  }, F) => {
38
- const [N, c] = w(!1), [S, f] = w(p), [r, l] = w(
39
- () => e && !isNaN(new Date(e).getTime()) ? new Date(e) : void 0
40
- ), [_, g] = w(v), [G, k] = w("");
38
+ const [l, m] = w(!1), [g, f] = w(p), [o, k] = w(
39
+ () => i && !isNaN(new Date(i).getTime()) ? new Date(i) : void 0
40
+ ), [n, h] = w(x), [G, A] = w("");
41
41
  T(() => {
42
- g(v);
43
- }, [v]), T(() => {
44
- l(
45
- e && !isNaN(new Date(e).getTime()) ? new Date(e) : void 0
42
+ h(x);
43
+ }, [x]), T(() => {
44
+ k(
45
+ i && !isNaN(new Date(i).getTime()) ? new Date(i) : void 0
46
46
  );
47
- }, [e]), T(() => {
48
- r && typeof r != "string" && !isNaN(r == null ? void 0 : r.getTime()) ? k(y.Date(r, "dd/mm/yyyy")) : k("");
49
- }, [r]);
50
- const O = e && new Date(e).getTime;
47
+ }, [i]), T(() => {
48
+ o && typeof o != "string" && !isNaN(o == null ? void 0 : o.getTime()) ? A(y.Date(o, "dd/mm/yyyy")) : A("");
49
+ }, [o]);
50
+ const u = i && new Date(i).getTime;
51
51
  T(() => {
52
- h && (O ? (g(!1), d == null || d({ name: a, active: !1 })) : (g(!0), d == null || d({ name: a, active: !0 })));
53
- }, [h, a, O]), ct({
54
- isActive: N,
52
+ b && (u ? (h(!1), d == null || d({ name: c, active: !1 })) : (h(!0), d == null || d({ name: c, active: !0 })));
53
+ }, [b, c, u]), ct({
54
+ isActive: l,
55
55
  setActive: (t) => {
56
- c(t), f(p);
56
+ m(t), f(p);
57
57
  },
58
- className: o["calendar-block"]
58
+ className: e["calendar-block"]
59
59
  });
60
60
  const K = () => {
61
- !x && (j || !D) && c(!0);
61
+ !S && (j || !D) && m(!0);
62
62
  }, W = (t) => {
63
- isNaN(t.getTime()) || (l(t), s == null || s({
63
+ isNaN(t.getTime()) || (k(t), s == null || s({
64
64
  value: y.Date(t, "yyyy-mm-dd"),
65
- name: a
66
- })), S === "years" && (p === "years" ? (c(!1), f(p)) : f("months")), S === "months" && (p === "months" ? (c(!1), f(p)) : f("days")), l(t), s == null || s({
65
+ name: c
66
+ })), g === "years" && (p === "years" ? (m(!1), f(p)) : f("months")), g === "months" && (p === "months" ? (m(!1), f(p)) : f("days")), k(t), s == null || s({
67
67
  value: y.Date(t, "yyyy-mm-dd"),
68
- name: a
69
- }), i == null || i(y.Date(t, "yyyy-mm-dd"));
68
+ name: c
69
+ }), r == null || r(y.Date(t, "yyyy-mm-dd"));
70
70
  }, q = (t) => {
71
71
  if (D) {
72
- const n = t.target.value.replace(/[^\d]/g, "");
73
- if (n.length === 0)
74
- k(""), s == null || s({ value: "", name: a }), i == null || i("");
72
+ const N = t.target.value.replace(/[^\d]/g, "");
73
+ if (N.length === 0)
74
+ A(""), s == null || s({ value: "", name: c }), r == null || r("");
75
75
  else {
76
- const [A, Y, $] = [
77
- L(n.substring(0, 2), st),
78
- L(n.substring(2, 4), et),
79
- n.substring(4, 8)
80
- ], H = [A, Y, $].filter(Boolean).join("/");
81
- if (k(H), H.length === it) {
82
- const C = parseInt($), I = /* @__PURE__ */ new Date(
83
- `${C}-${Y.padStart(2, "0")}-${A.padStart(2, "0")}`
76
+ const [I, O, Y] = [
77
+ L(N.substring(0, 2), st),
78
+ L(N.substring(2, 4), et),
79
+ N.substring(4, 8)
80
+ ], $ = [I, O, Y].filter(Boolean).join("/");
81
+ if (A($), $.length === it) {
82
+ const B = parseInt(Y), P = /* @__PURE__ */ new Date(
83
+ `${B}-${O.padStart(2, "0")}-${I.padStart(2, "0")}`
84
84
  );
85
- isNaN(I.getTime()) || (l(I), s == null || s({
86
- value: y.Date(I, "yyyy-mm-dd"),
87
- name: a
88
- }), i == null || i(y.Date(I, "yyyy-mm-dd")));
85
+ isNaN(P.getTime()) || (k(P), s == null || s({
86
+ value: y.Date(P, "yyyy-mm-dd"),
87
+ name: c
88
+ }), r == null || r(y.Date(P, "yyyy-mm-dd")));
89
89
  }
90
90
  }
91
91
  }
92
- }, E = b(o.wrapper, N && o.active), J = b(o.input, o.inputBorderControl), Q = {
92
+ }, J = _(e.wrapper, l && e.active), Q = _(e.input, e.inputBorderControl), Z = {
93
93
  onChangeValue: W,
94
- date: r || /* @__PURE__ */ new Date(),
95
- before: typeof M == "string" ? new Date(M) : M,
94
+ date: o || /* @__PURE__ */ new Date(),
95
+ before: typeof v == "string" ? new Date(v) : v,
96
96
  onChangeType: f,
97
- setIsActive: c
98
- }, Z = dt[S], z = ({ isActive: t }) => /* @__PURE__ */ m("button", { onClick: (A) => {
99
- A.stopPropagation(), x || c(!t);
100
- }, className: o["icon-button"], children: t ? /* @__PURE__ */ m(
97
+ setIsActive: m
98
+ }, z = dt[g], C = ({ isActive: t }) => /* @__PURE__ */ a("button", { onClick: (I) => {
99
+ I.stopPropagation(), S || m(!t);
100
+ }, className: e["icon-button"], children: t ? /* @__PURE__ */ a(
101
101
  R,
102
102
  {
103
- iconName: P === U.S ? "DropdownArrowUp16px" : "DropdownArrowUp24px"
103
+ iconName: M === U.S ? "DropdownArrowUp16px" : "DropdownArrowUp24px"
104
104
  }
105
- ) : /* @__PURE__ */ m(
105
+ ) : /* @__PURE__ */ a(
106
106
  R,
107
107
  {
108
- iconName: P === U.S ? "DropdownArrowBottom16px" : "DropdownArrowDown24px"
108
+ iconName: M === U.S ? "DropdownArrowBottom16px" : "DropdownArrowDown24px"
109
109
  }
110
110
  ) });
111
- return /* @__PURE__ */ B("div", { className: E, "data-disabled": x, children: [
112
- /* @__PURE__ */ m(
113
- "div",
114
- {
115
- role: "button",
116
- "data-error": _,
117
- className: b(o["date-wrapper"], {
118
- [o.editable]: D
119
- }),
120
- onClick: K,
121
- children: /* @__PURE__ */ m(
122
- mt,
123
- {
124
- ref: F,
125
- className: J,
126
- wrapperClassName: o["input-wrapper"],
127
- size: P,
128
- type: "text",
129
- variant: X,
130
- status: _ ? pt.Error : void 0,
131
- value: G,
132
- onChange: q,
133
- rightAddon: {
134
- addonType: "react-node",
135
- addonContent: /* @__PURE__ */ m(z, { isActive: N })
136
- },
137
- onFocus: () => {
138
- j && !D && c(!0);
139
- },
140
- "data-error": _,
141
- ...u
142
- }
143
- )
144
- }
145
- ),
146
- N && /* @__PURE__ */ m(Z, { ...Q })
111
+ return /* @__PURE__ */ H("div", { className: e["input-field-group-datePicker"], children: [
112
+ /* @__PURE__ */ H("div", { className: J, "data-disabled": S, children: [
113
+ /* @__PURE__ */ a(
114
+ "div",
115
+ {
116
+ role: "button",
117
+ "data-error": n,
118
+ className: _(e["date-wrapper"], {
119
+ [e.editable]: D
120
+ }),
121
+ onClick: K,
122
+ children: /* @__PURE__ */ a(
123
+ mt,
124
+ {
125
+ ref: F,
126
+ className: Q,
127
+ wrapperClassName: e["input-wrapper"],
128
+ size: M,
129
+ type: "text",
130
+ variant: X,
131
+ status: n ? pt.Error : void 0,
132
+ value: G,
133
+ onChange: q,
134
+ rightAddon: {
135
+ addonType: "react-node",
136
+ addonContent: /* @__PURE__ */ a(C, { isActive: l })
137
+ },
138
+ onFocus: () => {
139
+ j && !D && m(!0);
140
+ },
141
+ "data-error": n,
142
+ ...E
143
+ }
144
+ )
145
+ }
146
+ ),
147
+ l && /* @__PURE__ */ a(z, { ...Z })
148
+ ] }),
149
+ n && typeof n == "string" && /* @__PURE__ */ a("div", { className: e.textError, children: n })
147
150
  ] });
148
151
  }
149
152
  )
@@ -3,7 +3,7 @@ import { c as x } from "../../index-DIxK0V-G.js";
3
3
  import { useState as O } from "react";
4
4
  import { week as Y, COUNT_WORK_DAYS as j } from "./constants.js";
5
5
  import { useDatePickerPosition as z } from "./hooks.js";
6
- import { c as o } from "../../styles.module-B3xL6-zc.js";
6
+ import { c as o } from "../../styles.module-CPvzaOtD.js";
7
7
  import { getUpdateDate as M } from "./utils.js";
8
8
  import { Icon as G } from "../../icons/Icon.js";
9
9
  import { formating as s } from "../../utils/index.js";
@@ -3,7 +3,7 @@ import { c as k } from "../../index-DIxK0V-G.js";
3
3
  import { useState as $ } from "react";
4
4
  import { months as x } from "./constants.js";
5
5
  import { useDatePickerPosition as v } from "./hooks.js";
6
- import { c as e } from "../../styles.module-B3xL6-zc.js";
6
+ import { c as e } from "../../styles.module-CPvzaOtD.js";
7
7
  import { Icon as B } from "../../icons/Icon.js";
8
8
  import { formating as a } from "../../utils/index.js";
9
9
  import { Button as b } from "../Button/Button.js";
@@ -2,7 +2,7 @@ import { jsxs as p, jsx as o } from "react/jsx-runtime";
2
2
  import { c as v } from "../../index-DIxK0V-G.js";
3
3
  import { useState as x } from "react";
4
4
  import { useDatePickerPosition as Y } from "./hooks.js";
5
- import { c as t } from "../../styles.module-B3xL6-zc.js";
5
+ import { c as t } from "../../styles.module-CPvzaOtD.js";
6
6
  import { formating as n } from "../../utils/index.js";
7
7
  import { Button as y } from "../Button/Button.js";
8
8
  const F = ({
@@ -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 V } from "react/jsx-runtime";
2
- import { c as j } from "../../index-DIxK0V-G.js";
3
- import { forwardRef as B, useState as D, useEffect as T, useMemo as _ } from "react";
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 E } from "../ListFiles/ListFiles.js";
8
- import { ListPhotos as M } from "../ListPhotos/ListPhotos.js";
9
- import { Uploader as O } from "../Uploader/Uploader.js";
10
- import '../../assets/UploaderPhotos.css';const g = {
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, W = B(
13
- (i, v) => {
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: s,
16
- filesType: x,
17
- arrayName: F,
18
- maxSize: U,
19
- onChange: a,
20
- value: r,
21
- maxFiles: u,
22
- titleUploader: b,
23
- buttonText: w = "Выберите файлы",
24
- showOnlyUploadButton: d = !1,
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
- } = i, [l, n] = D(
29
- r || []
30
- ), m = l.length >= u;
28
+ buttonClassName: L,
29
+ variantListFiles: V = O.white
30
+ } = i, [l, n] = E(
31
+ o || []
32
+ ), d = l.length >= m;
31
33
  T(() => {
32
- r && n(r);
33
- }, [r]);
34
+ o && n(o);
35
+ }, [o]);
34
36
  const N = (t) => {
35
- const o = t.value.map((e) => f(e.file) ? {
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, ...o]), a == null || a({ type: "add", data: t.value });
50
+ n((e) => [...e, ...r]), s == null || s({ type: "add", data: t.value });
49
51
  }, c = (t) => {
50
- n((o) => o.filter((e) => e.id !== t)), a == null || a({ type: "delete", data: t });
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)), o = () => l.filter(f);
53
- return s === "all" ? { files: t(), photos: o() } : s === "files" ? { photos: [], files: t() } : s === "photos" ? { files: [], photos: o() } : { files: [], photos: [] };
54
- }, [l, s]);
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: j(
60
- g["upload-file-wrapper"],
61
- m && g.disabled
61
+ className: B(
62
+ v["upload-file-wrapper"],
63
+ d && v.disabled
62
64
  ),
63
65
  children: [
64
66
  /* @__PURE__ */ p(
65
- O,
67
+ A,
66
68
  {
67
- filesType: x,
68
- arrayName: F,
69
- maxSize: U,
69
+ filesType: g,
70
+ arrayName: w,
71
+ maxSize: x,
70
72
  onChangeValue: N,
71
- ref: v,
72
- maxFiles: u,
73
- isDisabled: m,
74
- titleUploader: b,
75
- showOnlyUploadButton: d,
76
- buttonText: w,
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
- !d && /* @__PURE__ */ h(V, { children: [
83
- (s === "files" || s === "all") && /* @__PURE__ */ p(
84
- E,
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
- (s === "photos" || s === "all") && /* @__PURE__ */ p(
91
- M,
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
- W as UniversalUploader
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;
@@ -0,0 +1,27 @@
1
+ import './assets/styles.css';const t = "_textError_97gw7_7", _ = "_input_97gw7_2", r = "_inputBorderControl_97gw7_28", n = "_editable_97gw7_41", o = "_wrapper_97gw7_64", e = "_active_97gw7_74", p = "_button_97gw7_58", c = "_h_97gw7_118", w = "_b_97gw7_58", a = "_d_97gw7_24", g = "_m_97gw7_140", i = "_a_97gw7_74", u = "_prev_97gw7_142", d = "_orange_97gw7_156", s = "_current_97gw7_173", b = "_monthGrid_97gw7_178", l = {
2
+ "input-field-group-datePicker": "_input-field-group-datePicker_97gw7_2",
3
+ textError: t,
4
+ input: _,
5
+ "input-wrapper": "_input-wrapper_97gw7_20",
6
+ "date-wrapper": "_date-wrapper_97gw7_24",
7
+ inputBorderControl: r,
8
+ editable: n,
9
+ "button-wrapper": "_button-wrapper_97gw7_58",
10
+ wrapper: o,
11
+ active: e,
12
+ button: p,
13
+ "calendar-block": "_calendar-block_97gw7_96",
14
+ h: c,
15
+ b: w,
16
+ d: a,
17
+ m: g,
18
+ a: i,
19
+ prev: u,
20
+ orange: d,
21
+ current: s,
22
+ monthGrid: b,
23
+ "icon-button": "_icon-button_97gw7_183"
24
+ };
25
+ export {
26
+ l as c
27
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mimir-ui-kit",
3
3
  "private": false,
4
- "version": "1.37.2",
4
+ "version": "1.37.4",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {
@@ -1,25 +0,0 @@
1
- import './assets/styles.css';const _ = "_input_hmkm7_2", t = "_inputBorderControl_hmkm7_14", n = "_editable_hmkm7_27", m = "_wrapper_hmkm7_50", r = "_active_hmkm7_56", o = "_button_hmkm7_44", e = "_h_hmkm7_100", c = "_b_hmkm7_44", p = "_d_hmkm7_10", a = "_m_hmkm7_122", h = "_a_hmkm7_56", k = "_prev_hmkm7_124", i = "_orange_hmkm7_138", s = "_current_hmkm7_155", u = "_monthGrid_hmkm7_160", d = {
2
- input: _,
3
- "input-wrapper": "_input-wrapper_hmkm7_6",
4
- "date-wrapper": "_date-wrapper_hmkm7_10",
5
- inputBorderControl: t,
6
- editable: n,
7
- "button-wrapper": "_button-wrapper_hmkm7_44",
8
- wrapper: m,
9
- active: r,
10
- button: o,
11
- "calendar-block": "_calendar-block_hmkm7_78",
12
- h: e,
13
- b: c,
14
- d: p,
15
- m: a,
16
- a: h,
17
- prev: k,
18
- orange: i,
19
- current: s,
20
- monthGrid: u,
21
- "icon-button": "_icon-button_hmkm7_165"
22
- };
23
- export {
24
- d as c
25
- };