triafly-ui-kit 1.0.24 → 1.0.25

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.
Files changed (93) hide show
  1. package/README.md +93 -93
  2. package/dist/{_commonjsHelpers-C6fGbg64.js → _virtual/_commonjsHelpers.js} +1 -1
  3. package/dist/_virtual/index.js +7 -0
  4. package/dist/_virtual/index2.js +7 -0
  5. package/dist/_virtual/index3.js +4 -0
  6. package/dist/_virtual/papaparse.min.js +7 -0
  7. package/dist/_virtual/papaparse.min2.js +4 -0
  8. package/dist/_virtual/react-paginate.js +7 -0
  9. package/dist/_virtual/react-paginate2.js +4 -0
  10. package/dist/assets/src/components/Ui/Tooltip/Tooltip.stories.module.css +1 -0
  11. package/dist/components/Ui/Accordeon/Accordeon.js +11 -10
  12. package/dist/components/Ui/Alert/Alert.js +9 -8
  13. package/dist/components/Ui/Avatar/Avatar.js +4 -3
  14. package/dist/components/Ui/Badge/Badge.js +19 -32
  15. package/dist/components/Ui/Button/Button.js +16 -15
  16. package/dist/components/Ui/ButtonsArray/ButtonsArray.js +8 -7
  17. package/dist/components/Ui/Checkbox/Checkbox.js +17 -16
  18. package/dist/components/Ui/CliTextareaInput/CliTextareaInput.js +16 -15
  19. package/dist/components/Ui/CustomLink/CustomLink.js +15 -14
  20. package/dist/components/Ui/DatePicker/DatePicker.js +16 -8
  21. package/dist/components/Ui/DatePicker/DatePicker.stories.js +39 -33
  22. package/dist/components/Ui/DropdownInput/DropdownInput.js +15 -14
  23. package/dist/components/Ui/DropdownMenu/DropdownMenu.js +4 -3
  24. package/dist/components/Ui/FileUpload/FileUpload.js +126 -544
  25. package/dist/components/Ui/Form/FormRoot/FormRoot.js +2 -1
  26. package/dist/components/Ui/Loader/Loader.js +5 -4
  27. package/dist/components/Ui/ModalWindow/ModalWindow.js +13 -12
  28. package/dist/components/Ui/Pagination/Pagination.js +20 -275
  29. package/dist/components/Ui/Radio/Radio.js +2 -1
  30. package/dist/components/Ui/SearchInput/SearchInput.js +13 -12
  31. package/dist/components/Ui/Skeleton/Skeleton.js +16 -18
  32. package/dist/components/Ui/Switch/Switch.js +10 -9
  33. package/dist/components/Ui/Table/MemoizedRow/MemoizedRow.js +30 -59
  34. package/dist/components/Ui/Table/Table.js +5 -4
  35. package/dist/components/Ui/Tabs/Tabs.js +6 -5
  36. package/dist/components/Ui/TextInput/TextInput.js +11 -10
  37. package/dist/components/Ui/TextareaInput/TextareaInput.js +18 -17
  38. package/dist/components/Ui/Tooltip/Tooltip.js +3 -2
  39. package/dist/components/Ui/Tooltip/Tooltip.stories.js +9 -14
  40. package/dist/context/ToastContext/ToastContext.js +22 -24
  41. package/dist/main.d.ts +0 -14
  42. package/dist/main.js +147 -149
  43. package/dist/node_modules/classnames/index.js +42 -0
  44. package/dist/node_modules/fast-deep-equal/index.js +31 -0
  45. package/dist/node_modules/papaparse/papaparse.min.js +421 -0
  46. package/dist/node_modules/react-paginate/dist/react-paginate.js +259 -0
  47. package/dist/src/components/Ui/Badge/Badge.module.scss.js +30 -0
  48. package/dist/src/components/Ui/Skeleton/Skeleton.module.scss.js +9 -0
  49. package/dist/src/components/Ui/Tooltip/Tooltip.stories.module.css.js +15 -0
  50. package/dist/src/context/ToastContext/ToastContext.module.scss.js +9 -0
  51. package/dist/styles/_mixins.scss +22 -0
  52. package/dist/styles/fix.scss +4 -0
  53. package/dist/styles/main.scss +27 -0
  54. package/dist/styles/reset.scss +106 -0
  55. package/dist/styles/typography.scss +102 -0
  56. package/dist/styles/variables.scss +278 -0
  57. package/package.json +110 -106
  58. package/src/styles/_mixins.scss +22 -0
  59. package/src/styles/fix.scss +4 -0
  60. package/src/styles/main.scss +27 -0
  61. package/src/styles/reset.scss +106 -0
  62. package/src/styles/typography.scss +102 -0
  63. package/src/styles/variables.scss +278 -0
  64. package/dist/assets/Tooltip.css +0 -1
  65. package/dist/components/Ui/DatePicker/index.js +0 -4
  66. package/dist/index-2QXL0WYc.js +0 -45
  67. /package/dist/assets/{Accordeon.css → src/components/Ui/Accordeon/Accordeon.css} +0 -0
  68. /package/dist/assets/{Alert.css → src/components/Ui/Alert/Alert.css} +0 -0
  69. /package/dist/assets/{Avatar.css → src/components/Ui/Avatar/Avatar.css} +0 -0
  70. /package/dist/assets/{Badge.css → src/components/Ui/Badge/Badge.module.css} +0 -0
  71. /package/dist/assets/{Button.css → src/components/Ui/Button/Button.css} +0 -0
  72. /package/dist/assets/{ButtonsArray.css → src/components/Ui/ButtonsArray/ButtonsArray.css} +0 -0
  73. /package/dist/assets/{Checkbox.css → src/components/Ui/Checkbox/Checkbox.css} +0 -0
  74. /package/dist/assets/{CliTextareaInput.css → src/components/Ui/CliTextareaInput/CliTextareaInput.css} +0 -0
  75. /package/dist/assets/{CustomLink.css → src/components/Ui/CustomLink/CustomLink.css} +0 -0
  76. /package/dist/assets/{DatePicker.css → src/components/Ui/DatePicker/DatePicker.css} +0 -0
  77. /package/dist/assets/{DropdownInput.css → src/components/Ui/DropdownInput/DropdownInput.css} +0 -0
  78. /package/dist/assets/{DropdownMenu.css → src/components/Ui/DropdownMenu/DropdownMenu.css} +0 -0
  79. /package/dist/assets/{FileUpload.css → src/components/Ui/FileUpload/FileUpload.css} +0 -0
  80. /package/dist/assets/{FormRoot.css → src/components/Ui/Form/FormRoot/Form.css} +0 -0
  81. /package/dist/assets/{Loader.css → src/components/Ui/Loader/Loader.css} +0 -0
  82. /package/dist/assets/{ModalWindow.css → src/components/Ui/ModalWindow/ModalWindow.css} +0 -0
  83. /package/dist/assets/{Pagination.css → src/components/Ui/Pagination/Pagination.css} +0 -0
  84. /package/dist/assets/{Radio.css → src/components/Ui/Radio/Radio.css} +0 -0
  85. /package/dist/assets/{SearchInput.css → src/components/Ui/SearchInput/SearchInput.css} +0 -0
  86. /package/dist/assets/{Skeleton.css → src/components/Ui/Skeleton/Skeleton.module.css} +0 -0
  87. /package/dist/assets/{Switch.css → src/components/Ui/Switch/Switch.css} +0 -0
  88. /package/dist/assets/{Table.css → src/components/Ui/Table/Table.css} +0 -0
  89. /package/dist/assets/{Tabs.css → src/components/Ui/Tabs/Tabs.css} +0 -0
  90. /package/dist/assets/{TextInput.css → src/components/Ui/TextInput/TextInput.css} +0 -0
  91. /package/dist/assets/{TextareaInput.css → src/components/Ui/TextareaInput/TextareaInput.css} +0 -0
  92. /package/dist/assets/{Tooltip2.css → src/components/Ui/Tooltip/Tooltip.css} +0 -0
  93. /package/dist/assets/{ToastContext.css → src/context/ToastContext/ToastContext.module.css} +0 -0
@@ -1,615 +1,197 @@
1
- import { jsxs as J, jsx as j } from "react/jsx-runtime";
2
- import { forwardRef as Ee, useState as _e, useRef as Re, useCallback as we, useImperativeHandle as Se } from "react";
3
- import { g as xe } from "../../../_commonjsHelpers-C6fGbg64.js";
4
- import { Button as Oe } from "../Button/Button.js";
5
- import { IconFile as Ie } from "../Icons/Icons.js";
6
- import { Loader as De } from "../Loader/Loader.js";
7
- import { formatFileSize as Le, SIZE_UNITS as Te } from "./fn.js";
8
- import '../../../assets/FileUpload.css';var ge = { exports: {} };
9
- /* @license
10
- Papa Parse
11
- v5.5.3
12
- https://github.com/mholt/PapaParse
13
- License: MIT
14
- */
15
- var Ae = ge.exports, be;
16
- function Ce() {
17
- return be || (be = 1, function(ne, le) {
18
- ((ee, b) => {
19
- ne.exports = b();
20
- })(Ae, function ee() {
21
- var b = typeof self < "u" ? self : typeof window < "u" ? window : b !== void 0 ? b : {}, U, T = !b.document && !!b.postMessage, Y = b.IS_PAPA_WORKER || !1, Z = {}, me = 0, u = {};
22
- function C(e) {
23
- this._handle = null, this._finished = !1, this._completed = !1, this._halted = !1, this._input = null, this._baseIndex = 0, this._partialLine = "", this._rowCount = 0, this._start = 0, this._nextChunk = null, this.isFirstChunk = !0, this._completeResults = { data: [], errors: [], meta: {} }, (function(t) {
24
- var r = ie(t);
25
- r.chunkSize = parseInt(r.chunkSize), t.step || t.chunk || (r.chunkSize = null), this._handle = new de(r), (this._handle.streamer = this)._config = r;
26
- }).call(this, e), this.parseChunk = function(t, r) {
27
- var s = parseInt(this._config.skipFirstNLines) || 0;
28
- if (this.isFirstChunk && 0 < s) {
29
- let d = this._config.newline;
30
- d || (n = this._config.quoteChar || '"', d = this._handle.guessLineEndings(t, n)), t = [...t.split(d).slice(s)].join(d);
31
- }
32
- this.isFirstChunk && y(this._config.beforeFirstChunk) && (n = this._config.beforeFirstChunk(t)) !== void 0 && (t = n), this.isFirstChunk = !1, this._halted = !1;
33
- var s = this._partialLine + t, n = (this._partialLine = "", this._handle.parse(s, this._baseIndex, !this._finished));
34
- if (!this._handle.paused() && !this._handle.aborted()) {
35
- if (t = n.meta.cursor, s = (this._finished || (this._partialLine = s.substring(t - this._baseIndex), this._baseIndex = t), n && n.data && (this._rowCount += n.data.length), this._finished || this._config.preview && this._rowCount >= this._config.preview), Y) b.postMessage({ results: n, workerId: u.WORKER_ID, finished: s });
36
- else if (y(this._config.chunk) && !r) {
37
- if (this._config.chunk(n, this._handle), this._handle.paused() || this._handle.aborted()) return void (this._halted = !0);
38
- this._completeResults = n = void 0;
39
- }
40
- return this._config.step || this._config.chunk || (this._completeResults.data = this._completeResults.data.concat(n.data), this._completeResults.errors = this._completeResults.errors.concat(n.errors), this._completeResults.meta = n.meta), this._completed || !s || !y(this._config.complete) || n && n.meta.aborted || (this._config.complete(this._completeResults, this._input), this._completed = !0), s || n && n.meta.paused || this._nextChunk(), n;
41
- }
42
- this._halted = !0;
43
- }, this._sendError = function(t) {
44
- y(this._config.error) ? this._config.error(t) : Y && this._config.error && b.postMessage({ workerId: u.WORKER_ID, error: t, finished: !1 });
45
- };
46
- }
47
- function B(e) {
48
- var t;
49
- (e = e || {}).chunkSize || (e.chunkSize = u.RemoteChunkSize), C.call(this, e), this._nextChunk = T ? function() {
50
- this._readChunk(), this._chunkLoaded();
51
- } : function() {
52
- this._readChunk();
53
- }, this.stream = function(r) {
54
- this._input = r, this._nextChunk();
55
- }, this._readChunk = function() {
56
- if (this._finished) this._chunkLoaded();
57
- else {
58
- if (t = new XMLHttpRequest(), this._config.withCredentials && (t.withCredentials = this._config.withCredentials), T || (t.onload = F(this._chunkLoaded, this), t.onerror = F(this._chunkError, this)), t.open(this._config.downloadRequestBody ? "POST" : "GET", this._input, !T), this._config.downloadRequestHeaders) {
59
- var r, s = this._config.downloadRequestHeaders;
60
- for (r in s) t.setRequestHeader(r, s[r]);
61
- }
62
- var n;
63
- this._config.chunkSize && (n = this._start + this._config.chunkSize - 1, t.setRequestHeader("Range", "bytes=" + this._start + "-" + n));
64
- try {
65
- t.send(this._config.downloadRequestBody);
66
- } catch (d) {
67
- this._chunkError(d.message);
68
- }
69
- T && t.status === 0 && this._chunkError();
70
- }
71
- }, this._chunkLoaded = function() {
72
- t.readyState === 4 && (t.status < 200 || 400 <= t.status ? this._chunkError() : (this._start += this._config.chunkSize || t.responseText.length, this._finished = !this._config.chunkSize || this._start >= ((r) => (r = r.getResponseHeader("Content-Range")) !== null ? parseInt(r.substring(r.lastIndexOf("/") + 1)) : -1)(t), this.parseChunk(t.responseText)));
73
- }, this._chunkError = function(r) {
74
- r = t.statusText || r, this._sendError(new Error(r));
75
- };
76
- }
77
- function se(e) {
78
- (e = e || {}).chunkSize || (e.chunkSize = u.LocalChunkSize), C.call(this, e);
79
- var t, r, s = typeof FileReader < "u";
80
- this.stream = function(n) {
81
- this._input = n, r = n.slice || n.webkitSlice || n.mozSlice, s ? ((t = new FileReader()).onload = F(this._chunkLoaded, this), t.onerror = F(this._chunkError, this)) : t = new FileReaderSync(), this._nextChunk();
82
- }, this._nextChunk = function() {
83
- this._finished || this._config.preview && !(this._rowCount < this._config.preview) || this._readChunk();
84
- }, this._readChunk = function() {
85
- var n = this._input, d = (this._config.chunkSize && (d = Math.min(this._start + this._config.chunkSize, this._input.size), n = r.call(n, this._start, d)), t.readAsText(n, this._config.encoding));
86
- s || this._chunkLoaded({ target: { result: d } });
87
- }, this._chunkLoaded = function(n) {
88
- this._start += this._config.chunkSize, this._finished = !this._config.chunkSize || this._start >= this._input.size, this.parseChunk(n.target.result);
89
- }, this._chunkError = function() {
90
- this._sendError(t.error);
91
- };
92
- }
93
- function X(e) {
94
- var t;
95
- C.call(this, e = e || {}), this.stream = function(r) {
96
- return t = r, this._nextChunk();
97
- }, this._nextChunk = function() {
98
- var r, s;
99
- if (!this._finished) return r = this._config.chunkSize, t = r ? (s = t.substring(0, r), t.substring(r)) : (s = t, ""), this._finished = !t, this.parseChunk(s);
100
- };
101
- }
102
- function te(e) {
103
- C.call(this, e = e || {});
104
- var t = [], r = !0, s = !1;
105
- this.pause = function() {
106
- C.prototype.pause.apply(this, arguments), this._input.pause();
107
- }, this.resume = function() {
108
- C.prototype.resume.apply(this, arguments), this._input.resume();
109
- }, this.stream = function(n) {
110
- this._input = n, this._input.on("data", this._streamData), this._input.on("end", this._streamEnd), this._input.on("error", this._streamError);
111
- }, this._checkIsFinished = function() {
112
- s && t.length === 1 && (this._finished = !0);
113
- }, this._nextChunk = function() {
114
- this._checkIsFinished(), t.length ? this.parseChunk(t.shift()) : r = !0;
115
- }, this._streamData = F(function(n) {
116
- try {
117
- t.push(typeof n == "string" ? n : n.toString(this._config.encoding)), r && (r = !1, this._checkIsFinished(), this.parseChunk(t.shift()));
118
- } catch (d) {
119
- this._streamError(d);
120
- }
121
- }, this), this._streamError = F(function(n) {
122
- this._streamCleanUp(), this._sendError(n);
123
- }, this), this._streamEnd = F(function() {
124
- this._streamCleanUp(), s = !0, this._streamData("");
125
- }, this), this._streamCleanUp = F(function() {
126
- this._input.removeListener("data", this._streamData), this._input.removeListener("end", this._streamEnd), this._input.removeListener("error", this._streamError);
127
- }, this);
128
- }
129
- function de(e) {
130
- var t, r, s, n, d = Math.pow(2, 53), R = -d, M = /^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/, z = /^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/, i = this, v = 0, l = 0, S = !1, f = !1, a = [], o = { data: [], errors: [], meta: {} };
131
- function I(_) {
132
- return e.skipEmptyLines === "greedy" ? _.join("").trim() === "" : _.length === 1 && _[0].length === 0;
133
- }
134
- function p() {
135
- if (o && s && (q("Delimiter", "UndetectableDelimiter", "Unable to auto-detect delimiting character; defaulted to '" + u.DefaultDelimiter + "'"), s = !1), e.skipEmptyLines && (o.data = o.data.filter(function(h) {
136
- return !I(h);
137
- })), D()) {
138
- let h = function(O, L) {
139
- y(e.transformHeader) && (O = e.transformHeader(O, L)), a.push(O);
140
- };
141
- if (o) if (Array.isArray(o.data[0])) {
142
- for (var _ = 0; D() && _ < o.data.length; _++) o.data[_].forEach(h);
143
- o.data.splice(0, 1);
144
- } else o.data.forEach(h);
145
- }
146
- function m(h, O) {
147
- for (var L = e.header ? {} : [], k = 0; k < h.length; k++) {
148
- var w = k, g = h[k], g = ((W, c) => ((E) => (e.dynamicTypingFunction && e.dynamicTyping[E] === void 0 && (e.dynamicTyping[E] = e.dynamicTypingFunction(E)), (e.dynamicTyping[E] || e.dynamicTyping) === !0))(W) ? c === "true" || c === "TRUE" || c !== "false" && c !== "FALSE" && (((E) => {
149
- if (M.test(E) && (E = parseFloat(E), R < E && E < d))
150
- return 1;
151
- })(c) ? parseFloat(c) : z.test(c) ? new Date(c) : c === "" ? null : c) : c)(w = e.header ? k >= a.length ? "__parsed_extra" : a[k] : w, g = e.transform ? e.transform(g, w) : g);
152
- w === "__parsed_extra" ? (L[w] = L[w] || [], L[w].push(g)) : L[w] = g;
153
- }
154
- return e.header && (k > a.length ? q("FieldMismatch", "TooManyFields", "Too many fields: expected " + a.length + " fields but parsed " + k, l + O) : k < a.length && q("FieldMismatch", "TooFewFields", "Too few fields: expected " + a.length + " fields but parsed " + k, l + O)), L;
155
- }
156
- var x;
157
- o && (e.header || e.dynamicTyping || e.transform) && (x = 1, !o.data.length || Array.isArray(o.data[0]) ? (o.data = o.data.map(m), x = o.data.length) : o.data = m(o.data, 0), e.header && o.meta && (o.meta.fields = a), l += x);
158
- }
159
- function D() {
160
- return e.header && a.length === 0;
161
- }
162
- function q(_, m, x, h) {
163
- _ = { type: _, code: m, message: x }, h !== void 0 && (_.row = h), o.errors.push(_);
164
- }
165
- y(e.step) && (n = e.step, e.step = function(_) {
166
- o = _, D() ? p() : (p(), o.data.length !== 0 && (v += _.data.length, e.preview && v > e.preview ? r.abort() : (o.data = o.data[0], n(o, i))));
167
- }), this.parse = function(_, m, x) {
168
- var h = e.quoteChar || '"', h = (e.newline || (e.newline = this.guessLineEndings(_, h)), s = !1, e.delimiter ? y(e.delimiter) && (e.delimiter = e.delimiter(_), o.meta.delimiter = e.delimiter) : ((h = ((O, L, k, w, g) => {
169
- var W, c, E, V;
170
- g = g || [",", " ", "|", ";", u.RECORD_SEP, u.UNIT_SEP];
171
- for (var ae = 0; ae < g.length; ae++) {
172
- for (var H, fe = g[ae], N = 0, K = 0, A = 0, P = (E = void 0, new $({ comments: w, delimiter: fe, newline: L, preview: 10 }).parse(O)), G = 0; G < P.data.length; G++) k && I(P.data[G]) ? A++ : (H = P.data[G].length, K += H, E === void 0 ? E = H : 0 < H && (N += Math.abs(H - E), E = H));
173
- 0 < P.data.length && (K /= P.data.length - A), (c === void 0 || N <= c) && (V === void 0 || V < K) && 1.99 < K && (c = N, W = fe, V = K);
174
- }
175
- return { successful: !!(e.delimiter = W), bestDelimiter: W };
176
- })(_, e.newline, e.skipEmptyLines, e.comments, e.delimitersToGuess)).successful ? e.delimiter = h.bestDelimiter : (s = !0, e.delimiter = u.DefaultDelimiter), o.meta.delimiter = e.delimiter), ie(e));
177
- return e.preview && e.header && h.preview++, t = _, r = new $(h), o = r.parse(t, m, x), p(), S ? { meta: { paused: !0 } } : o || { meta: { paused: !1 } };
178
- }, this.paused = function() {
179
- return S;
180
- }, this.pause = function() {
181
- S = !0, r.abort(), t = y(e.chunk) ? "" : t.substring(r.getCharIndex());
182
- }, this.resume = function() {
183
- i.streamer._halted ? (S = !1, i.streamer.parseChunk(t, !0)) : setTimeout(i.resume, 3);
184
- }, this.aborted = function() {
185
- return f;
186
- }, this.abort = function() {
187
- f = !0, r.abort(), o.meta.aborted = !0, y(e.complete) && e.complete(o), t = "";
188
- }, this.guessLineEndings = function(O, h) {
189
- O = O.substring(0, 1048576);
190
- var h = new RegExp(re(h) + "([^]*?)" + re(h), "gm"), x = (O = O.replace(h, "")).split("\r"), h = O.split(`
191
- `), O = 1 < h.length && h[0].length < x[0].length;
192
- if (x.length === 1 || O) return `
193
- `;
194
- for (var L = 0, k = 0; k < x.length; k++) x[k][0] === `
195
- ` && L++;
196
- return L >= x.length / 2 ? `\r
197
- ` : "\r";
198
- };
199
- }
200
- function re(e) {
201
- return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
202
- }
203
- function $(e) {
204
- var t = (e = e || {}).delimiter, r = e.newline, s = e.comments, n = e.step, d = e.preview, R = e.fastMode, M = null, z = !1, i = e.quoteChar == null ? '"' : e.quoteChar, v = i;
205
- if (e.escapeChar !== void 0 && (v = e.escapeChar), (typeof t != "string" || -1 < u.BAD_DELIMITERS.indexOf(t)) && (t = ","), s === t) throw new Error("Comment character same as delimiter");
206
- s === !0 ? s = "#" : (typeof s != "string" || -1 < u.BAD_DELIMITERS.indexOf(s)) && (s = !1), r !== `
207
- ` && r !== "\r" && r !== `\r
208
- ` && (r = `
209
- `);
210
- var l = 0, S = !1;
211
- this.parse = function(f, a, o) {
212
- if (typeof f != "string") throw new Error("Input must be a string");
213
- var I = f.length, p = t.length, D = r.length, q = s.length, _ = y(n), m = [], x = [], h = [], O = l = 0;
214
- if (!f) return N();
215
- if (R || R !== !1 && f.indexOf(i) === -1) {
216
- for (var L = f.split(r), k = 0; k < L.length; k++) {
217
- if (h = L[k], l += h.length, k !== L.length - 1) l += r.length;
218
- else if (o) return N();
219
- if (!s || h.substring(0, q) !== s) {
220
- if (_) {
221
- if (m = [], V(h.split(t)), K(), S) return N();
222
- } else V(h.split(t));
223
- if (d && d <= k) return m = m.slice(0, d), N(!0);
224
- }
225
- }
226
- return N();
227
- }
228
- for (var w = f.indexOf(t, l), g = f.indexOf(r, l), W = new RegExp(re(v) + re(i), "g"), c = f.indexOf(i, l); ; ) if (f[l] === i) for (c = l, l++; ; ) {
229
- if ((c = f.indexOf(i, c + 1)) === -1) return o || x.push({ type: "Quotes", code: "MissingQuotes", message: "Quoted field unterminated", row: m.length, index: l }), H();
230
- if (c === I - 1) return H(f.substring(l, c).replace(W, i));
231
- if (i === v && f[c + 1] === v) c++;
232
- else if (i === v || c === 0 || f[c - 1] !== v) {
233
- w !== -1 && w < c + 1 && (w = f.indexOf(t, c + 1));
234
- var E = ae((g = g !== -1 && g < c + 1 ? f.indexOf(r, c + 1) : g) === -1 ? w : Math.min(w, g));
235
- if (f.substr(c + 1 + E, p) === t) {
236
- h.push(f.substring(l, c).replace(W, i)), f[l = c + 1 + E + p] !== i && (c = f.indexOf(i, l)), w = f.indexOf(t, l), g = f.indexOf(r, l);
237
- break;
238
- }
239
- if (E = ae(g), f.substring(c + 1 + E, c + 1 + E + D) === r) {
240
- if (h.push(f.substring(l, c).replace(W, i)), fe(c + 1 + E + D), w = f.indexOf(t, l), c = f.indexOf(i, l), _ && (K(), S)) return N();
241
- if (d && m.length >= d) return N(!0);
242
- break;
243
- }
244
- x.push({ type: "Quotes", code: "InvalidQuotes", message: "Trailing quote on quoted field is malformed", row: m.length, index: l }), c++;
245
- }
246
- }
247
- else if (s && h.length === 0 && f.substring(l, l + q) === s) {
248
- if (g === -1) return N();
249
- l = g + D, g = f.indexOf(r, l), w = f.indexOf(t, l);
250
- } else if (w !== -1 && (w < g || g === -1)) h.push(f.substring(l, w)), l = w + p, w = f.indexOf(t, l);
251
- else {
252
- if (g === -1) break;
253
- if (h.push(f.substring(l, g)), fe(g + D), _ && (K(), S)) return N();
254
- if (d && m.length >= d) return N(!0);
255
- }
256
- return H();
257
- function V(A) {
258
- m.push(A), O = l;
259
- }
260
- function ae(A) {
261
- var P = 0;
262
- return P = A !== -1 && (A = f.substring(c + 1, A)) && A.trim() === "" ? A.length : P;
263
- }
264
- function H(A) {
265
- return o || (A === void 0 && (A = f.substring(l)), h.push(A), l = I, V(h), _ && K()), N();
266
- }
267
- function fe(A) {
268
- l = A, V(h), h = [], g = f.indexOf(r, l);
269
- }
270
- function N(A) {
271
- if (e.header && !a && m.length && !z) {
272
- var P = m[0], G = /* @__PURE__ */ Object.create(null), ye = new Set(P);
273
- let ve = !1;
274
- for (let oe = 0; oe < P.length; oe++) {
275
- let Q = P[oe];
276
- if (G[Q = y(e.transformHeader) ? e.transformHeader(Q, oe) : Q]) {
277
- let he, ke = G[Q];
278
- for (; he = Q + "_" + ke, ke++, ye.has(he); ) ;
279
- ye.add(he), P[oe] = he, G[Q]++, ve = !0, (M = M === null ? {} : M)[he] = Q;
280
- } else G[Q] = 1, P[oe] = Q;
281
- ye.add(Q);
282
- }
283
- ve && console.warn("Duplicate headers found and renamed."), z = !0;
284
- }
285
- return { data: m, errors: x, meta: { delimiter: t, linebreak: r, aborted: S, truncated: !!A, cursor: O + (a || 0), renamedHeaders: M } };
286
- }
287
- function K() {
288
- n(N()), m = [], x = [];
289
- }
290
- }, this.abort = function() {
291
- S = !0;
292
- }, this.getCharIndex = function() {
293
- return l;
294
- };
295
- }
296
- function ce(e) {
297
- var t = e.data, r = Z[t.workerId], s = !1;
298
- if (t.error) r.userError(t.error, t.file);
299
- else if (t.results && t.results.data) {
300
- var n = { abort: function() {
301
- s = !0, pe(t.workerId, { data: [], errors: [], meta: { aborted: !0 } });
302
- }, pause: ue, resume: ue };
303
- if (y(r.userStep)) {
304
- for (var d = 0; d < t.results.data.length && (r.userStep({ data: t.results.data[d], errors: t.results.errors, meta: t.results.meta }, n), !s); d++) ;
305
- delete t.results;
306
- } else y(r.userChunk) && (r.userChunk(t.results, n, t.file), delete t.results);
307
- }
308
- t.finished && !s && pe(t.workerId, t.results);
309
- }
310
- function pe(e, t) {
311
- var r = Z[e];
312
- y(r.userComplete) && r.userComplete(t), r.terminate(), delete Z[e];
313
- }
314
- function ue() {
315
- throw new Error("Not implemented.");
316
- }
317
- function ie(e) {
318
- if (typeof e != "object" || e === null) return e;
319
- var t, r = Array.isArray(e) ? [] : {};
320
- for (t in e) r[t] = ie(e[t]);
321
- return r;
322
- }
323
- function F(e, t) {
324
- return function() {
325
- e.apply(t, arguments);
326
- };
327
- }
328
- function y(e) {
329
- return typeof e == "function";
330
- }
331
- return u.parse = function(e, t) {
332
- var r = (t = t || {}).dynamicTyping || !1;
333
- if (y(r) && (t.dynamicTypingFunction = r, r = {}), t.dynamicTyping = r, t.transform = !!y(t.transform) && t.transform, !t.worker || !u.WORKERS_SUPPORTED) return r = null, u.NODE_STREAM_INPUT, typeof e == "string" ? (e = ((s) => s.charCodeAt(0) !== 65279 ? s : s.slice(1))(e), r = new (t.download ? B : X)(t)) : e.readable === !0 && y(e.read) && y(e.on) ? r = new te(t) : (b.File && e instanceof File || e instanceof Object) && (r = new se(t)), r.stream(e);
334
- (r = (() => {
335
- var s;
336
- return !!u.WORKERS_SUPPORTED && (s = (() => {
337
- var n = b.URL || b.webkitURL || null, d = ee.toString();
338
- return u.BLOB_URL || (u.BLOB_URL = n.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ", "(", d, ")();"], { type: "text/javascript" })));
339
- })(), (s = new b.Worker(s)).onmessage = ce, s.id = me++, Z[s.id] = s);
340
- })()).userStep = t.step, r.userChunk = t.chunk, r.userComplete = t.complete, r.userError = t.error, t.step = y(t.step), t.chunk = y(t.chunk), t.complete = y(t.complete), t.error = y(t.error), delete t.worker, r.postMessage({ input: e, config: t, workerId: r.id });
341
- }, u.unparse = function(e, t) {
342
- var r = !1, s = !0, n = ",", d = `\r
343
- `, R = '"', M = R + R, z = !1, i = null, v = !1, l = ((() => {
344
- if (typeof t == "object") {
345
- if (typeof t.delimiter != "string" || u.BAD_DELIMITERS.filter(function(a) {
346
- return t.delimiter.indexOf(a) !== -1;
347
- }).length || (n = t.delimiter), typeof t.quotes != "boolean" && typeof t.quotes != "function" && !Array.isArray(t.quotes) || (r = t.quotes), typeof t.skipEmptyLines != "boolean" && typeof t.skipEmptyLines != "string" || (z = t.skipEmptyLines), typeof t.newline == "string" && (d = t.newline), typeof t.quoteChar == "string" && (R = t.quoteChar), typeof t.header == "boolean" && (s = t.header), Array.isArray(t.columns)) {
348
- if (t.columns.length === 0) throw new Error("Option columns is empty");
349
- i = t.columns;
350
- }
351
- t.escapeChar !== void 0 && (M = t.escapeChar + R), t.escapeFormulae instanceof RegExp ? v = t.escapeFormulae : typeof t.escapeFormulae == "boolean" && t.escapeFormulae && (v = /^[=+\-@\t\r].*$/);
352
- }
353
- })(), new RegExp(re(R), "g"));
354
- if (typeof e == "string" && (e = JSON.parse(e)), Array.isArray(e)) {
355
- if (!e.length || Array.isArray(e[0])) return S(null, e, z);
356
- if (typeof e[0] == "object") return S(i || Object.keys(e[0]), e, z);
357
- } else if (typeof e == "object") return typeof e.data == "string" && (e.data = JSON.parse(e.data)), Array.isArray(e.data) && (e.fields || (e.fields = e.meta && e.meta.fields || i), e.fields || (e.fields = Array.isArray(e.data[0]) ? e.fields : typeof e.data[0] == "object" ? Object.keys(e.data[0]) : []), Array.isArray(e.data[0]) || typeof e.data[0] == "object" || (e.data = [e.data])), S(e.fields || [], e.data || [], z);
358
- throw new Error("Unable to serialize unrecognized input");
359
- function S(a, o, I) {
360
- var p = "", D = (typeof a == "string" && (a = JSON.parse(a)), typeof o == "string" && (o = JSON.parse(o)), Array.isArray(a) && 0 < a.length), q = !Array.isArray(o[0]);
361
- if (D && s) {
362
- for (var _ = 0; _ < a.length; _++) 0 < _ && (p += n), p += f(a[_], _);
363
- 0 < o.length && (p += d);
364
- }
365
- for (var m = 0; m < o.length; m++) {
366
- var x = (D ? a : o[m]).length, h = !1, O = D ? Object.keys(o[m]).length === 0 : o[m].length === 0;
367
- if (I && !D && (h = I === "greedy" ? o[m].join("").trim() === "" : o[m].length === 1 && o[m][0].length === 0), I === "greedy" && D) {
368
- for (var L = [], k = 0; k < x; k++) {
369
- var w = q ? a[k] : k;
370
- L.push(o[m][w]);
371
- }
372
- h = L.join("").trim() === "";
373
- }
374
- if (!h) {
375
- for (var g = 0; g < x; g++) {
376
- 0 < g && !O && (p += n);
377
- var W = D && q ? a[g] : g;
378
- p += f(o[m][W], g);
379
- }
380
- m < o.length - 1 && (!I || 0 < x && !O) && (p += d);
381
- }
382
- }
383
- return p;
384
- }
385
- function f(a, o) {
386
- var I, p;
387
- return a == null ? "" : a.constructor === Date ? JSON.stringify(a).slice(1, 25) : (p = !1, v && typeof a == "string" && v.test(a) && (a = "'" + a, p = !0), I = a.toString().replace(l, M), (p = p || r === !0 || typeof r == "function" && r(a, o) || Array.isArray(r) && r[o] || ((D, q) => {
388
- for (var _ = 0; _ < q.length; _++) if (-1 < D.indexOf(q[_])) return !0;
389
- return !1;
390
- })(I, u.BAD_DELIMITERS) || -1 < I.indexOf(n) || I.charAt(0) === " " || I.charAt(I.length - 1) === " ") ? R + I + R : I);
391
- }
392
- }, u.RECORD_SEP = "", u.UNIT_SEP = "", u.BYTE_ORDER_MARK = "\uFEFF", u.BAD_DELIMITERS = ["\r", `
393
- `, '"', u.BYTE_ORDER_MARK], u.WORKERS_SUPPORTED = !T && !!b.Worker, u.NODE_STREAM_INPUT = 1, u.LocalChunkSize = 10485760, u.RemoteChunkSize = 5242880, u.DefaultDelimiter = ",", u.Parser = $, u.ParserHandle = de, u.NetworkStreamer = B, u.FileStreamer = se, u.StringStreamer = X, u.ReadableStreamStreamer = te, b.jQuery && ((U = b.jQuery).fn.parse = function(e) {
394
- var t = e.config || {}, r = [];
395
- return this.each(function(d) {
396
- if (!(U(this).prop("tagName").toUpperCase() === "INPUT" && U(this).attr("type").toLowerCase() === "file" && b.FileReader) || !this.files || this.files.length === 0) return !0;
397
- for (var R = 0; R < this.files.length; R++) r.push({ file: this.files[R], inputElem: this, instanceConfig: U.extend({}, t) });
398
- }), s(), this;
399
- function s() {
400
- if (r.length === 0) y(e.complete) && e.complete();
401
- else {
402
- var d, R, M, z, i = r[0];
403
- if (y(e.before)) {
404
- var v = e.before(i.file, i.inputElem);
405
- if (typeof v == "object") {
406
- if (v.action === "abort") return d = "AbortError", R = i.file, M = i.inputElem, z = v.reason, void (y(e.error) && e.error({ name: d }, R, M, z));
407
- if (v.action === "skip") return void n();
408
- typeof v.config == "object" && (i.instanceConfig = U.extend(i.instanceConfig, v.config));
409
- } else if (v === "skip") return void n();
410
- }
411
- var l = i.instanceConfig.complete;
412
- i.instanceConfig.complete = function(S) {
413
- y(l) && l(S, i.file, i.inputElem), n();
414
- }, u.parse(i.file, i.instanceConfig);
415
- }
416
- }
417
- function n() {
418
- r.splice(0, 1), s();
419
- }
420
- }), Y && (b.onmessage = function(e) {
421
- e = e.data, u.WORKER_ID === void 0 && e && (u.WORKER_ID = e.workerId), typeof e.input == "string" ? b.postMessage({ workerId: u.WORKER_ID, results: u.parse(e.input, e.config), finished: !0 }) : (b.File && e.input instanceof File || e.input instanceof Object) && (e = u.parse(e.input, e.config)) && b.postMessage({ workerId: u.WORKER_ID, results: e, finished: !0 });
422
- }), (B.prototype = Object.create(C.prototype)).constructor = B, (se.prototype = Object.create(C.prototype)).constructor = se, (X.prototype = Object.create(X.prototype)).constructor = X, (te.prototype = Object.create(C.prototype)).constructor = te, u;
423
- });
424
- }(ge)), ge.exports;
425
- }
426
- var Fe = Ce();
427
- const Ne = /* @__PURE__ */ xe(Fe), je = Ee(
1
+ import { jsxs as i, jsx as a } from "react/jsx-runtime";
2
+ import { forwardRef as Y, useState as w, useRef as F, useCallback as P, useImperativeHandle as R } from "react";
3
+ import b from "../../../_virtual/papaparse.min.js";
4
+ import '../../../assets/src/components/Ui/FileUpload/FileUpload.css';/* empty css */
5
+ import { Button as V } from "../Button/Button.js";
6
+ import { IconFile as E } from "../Icons/Icons.js";
7
+ import { Loader as C } from "../Loader/Loader.js";
8
+ import { formatFileSize as ee, SIZE_UNITS as le } from "./fn.js";
9
+ const ae = Y(
428
10
  ({
429
- acceptedFormats: ne = [".csv", ".pdf", ".jpg", ".png", ".xlsx"],
430
- maxSize: le = 7,
431
- sizeUnit: ee = "MB",
432
- multiple: b = !1,
433
- onFilesChange: U,
434
- onError: T,
435
- parserCsv: Y = !1,
436
- onReset: Z,
437
- visibilityFileUpload: me = !0,
438
- onVisibilityChange: u,
439
- onChange: C,
440
- isDisabled: B = !1,
441
- hasError: se = !1,
442
- errorMessage: X,
443
- label: te,
444
- isNotDeleteElement: de
445
- }, re) => {
446
- const [$, ce] = _e([]), [pe, ue] = _e(!1), [ie, F] = _e(""), y = Re(null), [e, t] = _e(!1), r = we(() => {
447
- ce([]), F(""), y.current && (y.current.value = ""), Z == null || Z(), C == null || C([]), U == null || U([], []), u == null || u(!0);
448
- }, [Z, U, u]);
449
- Se(re, () => ({
450
- reset: r,
451
- getFiles: () => $.map((i) => i.file),
452
- getParsedData: () => $.map((i) => i.parsedData)
11
+ acceptedFormats: _ = [".csv", ".pdf", ".jpg", ".png", ".xlsx"],
12
+ maxSize: v = 7,
13
+ sizeUnit: N = "MB",
14
+ multiple: x = !1,
15
+ onFilesChange: d,
16
+ onError: s,
17
+ parserCsv: $ = !1,
18
+ onReset: h,
19
+ visibilityFileUpload: W = !0,
20
+ onVisibilityChange: c,
21
+ onChange: m,
22
+ isDisabled: p = !1,
23
+ hasError: A = !1,
24
+ errorMessage: S,
25
+ label: k,
26
+ isNotDeleteElement: H
27
+ }, O) => {
28
+ const [f, T] = w([]), [U, B] = w(!1), [D, n] = w(""), L = F(null), [Z, g] = w(!1), q = P(() => {
29
+ T([]), n(""), L.current && (L.current.value = ""), h == null || h(), m == null || m([]), d == null || d([], []), c == null || c(!0);
30
+ }, [h, d, c]);
31
+ R(O, () => ({
32
+ reset: q,
33
+ getFiles: () => f.map((e) => e.file),
34
+ getParsedData: () => f.map((e) => e.parsedData)
453
35
  }));
454
- const s = le * Te[ee], n = we(
455
- async (i) => Y && i.name.endsWith(".csv") ? new Promise((v, l) => {
456
- Ne.parse(i, {
457
- complete: (S) => {
458
- S.errors.length && l(new Error("Ошибка при парсинге CSV файла")), v(S.data);
36
+ const G = v * le[N], J = P(
37
+ async (e) => $ && e.name.endsWith(".csv") ? new Promise((o, r) => {
38
+ b.parse(e, {
39
+ complete: (u) => {
40
+ u.errors.length && r(new Error("Ошибка при парсинге CSV файла")), o(u.data);
459
41
  },
460
42
  error: () => {
461
- l(new Error("Не удалось прочитать CSV файл"));
43
+ r(new Error("Не удалось прочитать CSV файл"));
462
44
  },
463
45
  skipEmptyLines: !0
464
46
  });
465
47
  }) : [],
466
- [Y]
467
- ), d = async (i) => {
468
- if (!i.target.files || B) return;
469
- F("");
470
- const v = Array.from(i.target.files), l = [];
471
- ue(!0);
48
+ [$]
49
+ ), M = async (e) => {
50
+ if (!e.target.files || p) return;
51
+ n("");
52
+ const o = Array.from(e.target.files), r = [];
53
+ B(!0);
472
54
  try {
473
- for (const a of v) {
474
- const o = ne.some(
475
- (p) => a.name.toLowerCase().endsWith(p.replace(".", ""))
476
- ), I = a.size <= s;
477
- if ($.some(
478
- (p) => p.file.name === a.name && p.file.size === a.size && p.file.lastModified === a.lastModified
55
+ for (const l of o) {
56
+ const y = _.some(
57
+ (t) => l.name.toLowerCase().endsWith(t.replace(".", ""))
58
+ ), X = l.size <= G;
59
+ if (f.some(
60
+ (t) => t.file.name === l.name && t.file.size === l.size && t.file.lastModified === l.lastModified
479
61
  )) {
480
- T == null || T(`Файл "${a.name}" уже загружен`), F(`Файл "${a.name}" уже загружен`);
62
+ s == null || s(`Файл "${l.name}" уже загружен`), n(`Файл "${l.name}" уже загружен`);
481
63
  continue;
482
64
  }
483
- if (!o) {
484
- const p = `Неподдерживаемый формат: ${a.name}`;
485
- T == null || T(p), F(`Неподдерживаемый формат: ${a.name}`);
65
+ if (!y) {
66
+ const t = `Неподдерживаемый формат: ${l.name}`;
67
+ s == null || s(t), n(`Неподдерживаемый формат: ${l.name}`);
486
68
  continue;
487
69
  }
488
- if (!I) {
489
- const p = `Файл слишком большой (максимум ${le} ${ee}): ${a.name}`;
490
- T == null || T(p), F(`Файл слишком большой (максимум ${le} ${ee}): ${a.name}`);
70
+ if (!X) {
71
+ const t = `Файл слишком большой (максимум ${v} ${N}): ${l.name}`;
72
+ s == null || s(t), n(`Файл слишком большой (максимум ${v} ${N}): ${l.name}`);
491
73
  continue;
492
74
  }
493
75
  try {
494
- const p = Y ? await n(a) : void 0;
495
- l.push({ file: a, parsedData: p });
496
- } catch (p) {
497
- const D = p instanceof Error ? p.message : "Неизвестная ошибка";
498
- T == null || T(D), l.push({
499
- file: a,
500
- error: D,
76
+ const t = $ ? await J(l) : void 0;
77
+ r.push({ file: l, parsedData: t });
78
+ } catch (t) {
79
+ const z = t instanceof Error ? t.message : "Неизвестная ошибка";
80
+ s == null || s(z), r.push({
81
+ file: l,
82
+ error: z,
501
83
  isLoading: !1
502
84
  });
503
85
  }
504
86
  }
505
- ce((a) => b ? [...a, ...l] : l);
506
- const f = (b ? [...$, ...l] : l).filter((a) => !a.error);
507
- C == null || C(f.map((a) => a.file)), U == null || U(
508
- f.map((a) => a.file),
509
- Y ? f.map((a) => a.parsedData).filter(Boolean) : void 0
510
- ), f.length > 0 && (u == null || u(!1));
87
+ T((l) => x ? [...l, ...r] : r);
88
+ const I = (x ? [...f, ...r] : r).filter((l) => !l.error);
89
+ m == null || m(I.map((l) => l.file)), d == null || d(
90
+ I.map((l) => l.file),
91
+ $ ? I.map((l) => l.parsedData).filter(Boolean) : void 0
92
+ ), I.length > 0 && (c == null || c(!1));
511
93
  } finally {
512
- ue(!1);
513
- }
514
- }, R = (i) => {
515
- i.preventDefault(), t(!0);
516
- }, M = (i) => {
517
- i.preventDefault(), t(!1);
518
- }, z = (i) => {
519
- if (i.preventDefault(), F(""), t(!1), i.dataTransfer.files && i.dataTransfer.files.length > 0) {
520
- if (!ne.some(
521
- (S) => i.dataTransfer.files[0].name.toLowerCase().endsWith(S.replace(".", ""))
94
+ B(!1);
95
+ }
96
+ }, j = (e) => {
97
+ e.preventDefault(), g(!0);
98
+ }, K = (e) => {
99
+ e.preventDefault(), g(!1);
100
+ }, Q = (e) => {
101
+ if (e.preventDefault(), n(""), g(!1), e.dataTransfer.files && e.dataTransfer.files.length > 0) {
102
+ if (!_.some(
103
+ (u) => e.dataTransfer.files[0].name.toLowerCase().endsWith(u.replace(".", ""))
522
104
  )) {
523
- F(`Неподдерживаемый формат: ${i.dataTransfer.files[0].name}`);
105
+ n(`Неподдерживаемый формат: ${e.dataTransfer.files[0].name}`);
524
106
  return;
525
107
  }
526
- const l = {
527
- target: { files: i.dataTransfer.files }
108
+ const r = {
109
+ target: { files: e.dataTransfer.files }
528
110
  };
529
- d(l);
111
+ M(r);
530
112
  }
531
113
  };
532
- return /* @__PURE__ */ J("div", { className: "file-upload", children: [
533
- te && /* @__PURE__ */ j("label", { className: "form-item-label", children: te }),
534
- me && /* @__PURE__ */ j("div", { children: pe ? /* @__PURE__ */ J("div", { className: "file-upload__loading", children: [
535
- /* @__PURE__ */ j("div", { style: { position: "relative", height: "40px", width: "40px" }, children: /* @__PURE__ */ j(De, { size: 40 }) }),
536
- /* @__PURE__ */ j("span", { children: "Файл загружается..." })
537
- ] }) : /* @__PURE__ */ J(
114
+ return /* @__PURE__ */ i("div", { className: "file-upload", children: [
115
+ k && /* @__PURE__ */ a("label", { className: "form-item-label", children: k }),
116
+ W && /* @__PURE__ */ a("div", { children: U ? /* @__PURE__ */ i("div", { className: "file-upload__loading", children: [
117
+ /* @__PURE__ */ a("div", { style: { position: "relative", height: "40px", width: "40px" }, children: /* @__PURE__ */ a(C, { size: 40 }) }),
118
+ /* @__PURE__ */ a("span", { children: "Файл загружается..." })
119
+ ] }) : /* @__PURE__ */ i(
538
120
  "label",
539
121
  {
540
122
  htmlFor: "fileInput",
541
- className: `file-upload__label ${B ? "disabled" : ""}`,
123
+ className: `file-upload__label ${p ? "disabled" : ""}`,
542
124
  children: [
543
- /* @__PURE__ */ j(
125
+ /* @__PURE__ */ a(
544
126
  "input",
545
127
  {
546
- ref: y,
128
+ ref: L,
547
129
  type: "file",
548
130
  id: "fileInput",
549
131
  multiple: !1,
550
- accept: ne.join(","),
551
- onChange: d,
132
+ accept: _.join(","),
133
+ onChange: M,
552
134
  className: "file-upload__input",
553
- disabled: B
135
+ disabled: p
554
136
  }
555
137
  ),
556
- /* @__PURE__ */ J(
138
+ /* @__PURE__ */ i(
557
139
  "div",
558
140
  {
559
- onDragEnter: R,
560
- onDragOver: R,
561
- onDragLeave: M,
562
- onDrop: z,
563
- className: `file-upload__drop-area ${e ? "dragging" : ""} ${ie ? "error" : ""} ${B ? "disabled" : ""}`,
141
+ onDragEnter: j,
142
+ onDragOver: j,
143
+ onDragLeave: K,
144
+ onDrop: Q,
145
+ className: `file-upload__drop-area ${Z ? "dragging" : ""} ${D ? "error" : ""} ${p ? "disabled" : ""}`,
564
146
  children: [
565
- /* @__PURE__ */ j("p", { children: "Перетащите или выберите файлы чтобы загрузить" }),
566
- /* @__PURE__ */ j(
567
- Oe,
147
+ /* @__PURE__ */ a("p", { children: "Перетащите или выберите файлы чтобы загрузить" }),
148
+ /* @__PURE__ */ a(
149
+ V,
568
150
  {
569
151
  onClick: () => {
570
- var i;
571
- return !B && ((i = document.getElementById("fileInput")) == null ? void 0 : i.click());
152
+ var e;
153
+ return !p && ((e = document.getElementById("fileInput")) == null ? void 0 : e.click());
572
154
  },
573
155
  label: "Выбрать файлы",
574
156
  type: "button",
575
157
  className: "file-upload__select-btn",
576
- isDisabled: B
158
+ isDisabled: p
577
159
  }
578
160
  ),
579
- /* @__PURE__ */ J("div", { className: "file-upload__formats", children: [
580
- /* @__PURE__ */ J("span", { children: [
161
+ /* @__PURE__ */ i("div", { className: "file-upload__formats", children: [
162
+ /* @__PURE__ */ i("span", { children: [
581
163
  "Поддерживаемые форматы: ",
582
- ne.join(", ")
164
+ _.join(", ")
583
165
  ] }),
584
- /* @__PURE__ */ J("span", { children: [
166
+ /* @__PURE__ */ i("span", { children: [
585
167
  "Максимальный размер: ",
586
- le,
168
+ v,
587
169
  " ",
588
- ee
170
+ N
589
171
  ] })
590
172
  ] }),
591
- (ie || se && X) && /* @__PURE__ */ j("span", { style: { color: "red" }, children: ie || X })
173
+ (D || A && S) && /* @__PURE__ */ a("span", { style: { color: "red" }, children: D || S })
592
174
  ]
593
175
  }
594
176
  )
595
177
  ]
596
178
  }
597
179
  ) }),
598
- $.length > 0 && /* @__PURE__ */ j("div", { className: "file-upload__files-list", children: /* @__PURE__ */ j("ul", { children: $ == null ? void 0 : $.map((i, v) => /* @__PURE__ */ J("li", { className: "file-upload__file-item", children: [
599
- /* @__PURE__ */ J("div", { className: "file-upload__file-info", children: [
600
- /* @__PURE__ */ j("div", { className: "file-upload__box-icon", children: /* @__PURE__ */ j(Ie, { className: "icon" }) }),
601
- /* @__PURE__ */ J("div", { className: "file-upload__block-text", children: [
602
- /* @__PURE__ */ j("span", { className: "file-upload__file-name", children: i.file.name }),
603
- /* @__PURE__ */ j("span", { className: "file-upload__file-size", children: Le(i.file.size) })
180
+ f.length > 0 && /* @__PURE__ */ a("div", { className: "file-upload__files-list", children: /* @__PURE__ */ a("ul", { children: f == null ? void 0 : f.map((e, o) => /* @__PURE__ */ i("li", { className: "file-upload__file-item", children: [
181
+ /* @__PURE__ */ i("div", { className: "file-upload__file-info", children: [
182
+ /* @__PURE__ */ a("div", { className: "file-upload__box-icon", children: /* @__PURE__ */ a(E, { className: "icon" }) }),
183
+ /* @__PURE__ */ i("div", { className: "file-upload__block-text", children: [
184
+ /* @__PURE__ */ a("span", { className: "file-upload__file-name", children: e.file.name }),
185
+ /* @__PURE__ */ a("span", { className: "file-upload__file-size", children: ee(e.file.size) })
604
186
  ] }),
605
- i.error && /* @__PURE__ */ j("span", { className: "file-upload__file-error", children: i.error })
187
+ e.error && /* @__PURE__ */ a("span", { className: "file-upload__file-error", children: e.error })
606
188
  ] }),
607
189
  null
608
- ] }, `${i.file.name}-${v}`)) }) })
190
+ ] }, `${e.file.name}-${o}`)) }) })
609
191
  ] });
610
192
  }
611
193
  );
612
- je.displayName = "FileUpload";
194
+ ae.displayName = "FileUpload";
613
195
  export {
614
- je as FileUpload
196
+ ae as FileUpload
615
197
  };