bmi-next-brokers 2.2.6 → 2.2.7

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.
@@ -1,8 +1,8 @@
1
- import { jsx as e, jsxs as r, Fragment as k } from "react/jsx-runtime";
2
- import { useState as T, useRef as X, useEffect as W } from "react";
1
+ import { jsx as e, jsxs as r, Fragment as $ } from "react/jsx-runtime";
2
+ import { useState as k, useRef as X, useEffect as T } from "react";
3
3
  import { Icon as h } from "../../icons/Icon.js";
4
4
  import { Spinner as Y } from "../Spinner/Spinner.js";
5
- import { Button as L } from "../Button/Button.js";
5
+ import { Button as W } from "../Button/Button.js";
6
6
  import '../../assets/CompactFileUpload.css';const Z = "_inputContainer_g5trv_1", tt = "_compactFileUploadContainer_g5trv_9", et = "_fullWidth_g5trv_26", nt = "_dragOver_g5trv_35", at = "_variant_document_g5trv_41", ct = "_icon_g5trv_41", ot = "_variant_add_g5trv_45", it = "_disabled_g5trv_50", lt = "_error_g5trv_61", rt = "_warning_g5trv_69", st = "_inverted_g5trv_78", mt = "_uploadContent_g5trv_103", dt = "_textContent_g5trv_113", pt = "_dragText_g5trv_123", _t = "_hiddenInput_g5trv_153", ht = "_compactFileContent_g5trv_166", vt = "_compactFileIcon_g5trv_174", ut = "_compactIconBackground_g5trv_182", gt = "_compactFileText_g5trv_190", ft = "_compactLabel_g5trv_202", Ct = "_compactFileName_g5trv_209", xt = "_compactStatusText_g5trv_210", Nt = "_success_g5trv_221", Ft = "_loading_g5trv_229", It = "_addIconWrapper_g5trv_233", bt = "_browseText_g5trv_239", wt = "_compactVisibilityIcon_g5trv_246", Dt = "_compactActions_g5trv_255", yt = "_deleteText_g5trv_262", t = {
7
7
  inputContainer: Z,
8
8
  compactFileUploadContainer: tt,
@@ -34,7 +34,7 @@ import '../../assets/CompactFileUpload.css';const Z = "_inputContainer_g5trv_1",
34
34
  compactActions: Dt,
35
35
  deleteText: yt
36
36
  }, Bt = ({
37
- variant: j = "document",
37
+ variant: L = "document",
38
38
  label: v,
39
39
  error: o,
40
40
  success: a,
@@ -42,11 +42,11 @@ import '../../assets/CompactFileUpload.css';const Z = "_inputContainer_g5trv_1",
42
42
  loading: c,
43
43
  defaultFile: b = null,
44
44
  disabled: m = !1,
45
- inverted: B = !1,
46
- browseText: E = "Seleccionar archivo",
45
+ inverted: j = !1,
46
+ browseText: B = "Seleccionar archivo",
47
47
  clearFileText: g = "Eliminar",
48
48
  allowedTypes: d,
49
- inspectFileFunction: O = () => {
49
+ inspectFileFunction: E = () => {
50
50
  console.warn(
51
51
  "No hay función asignada para ver el archivo. Hay que pasarla al componente como prop inspectFileFunction."
52
52
  );
@@ -56,32 +56,32 @@ import '../../assets/CompactFileUpload.css';const Z = "_inputContainer_g5trv_1",
56
56
  onFileSelect: C,
57
57
  onSuccessAction: x,
58
58
  statusIconBorderRadius: D = "50%",
59
- customIcon: R = "Documentos",
60
- customInspectIcon: A = "Visibility",
61
- fullWidth: S = !1,
62
- ...U
59
+ customIcon: O = "Documentos",
60
+ customInspectIcon: R = "Visibility",
61
+ fullWidth: A = !1,
62
+ ...S
63
63
  }) => {
64
- const [V, N] = T(!1), [i, F] = T(null), _ = X(null);
65
- W(() => {
64
+ const [U, N] = k(!1), [i, F] = k(null), _ = X(null);
65
+ T(() => {
66
66
  F(b ?? null);
67
- }, [b]), W(() => {
67
+ }, [b]), T(() => {
68
68
  if (!i) return;
69
69
  const n = [];
70
70
  o && n.push("error"), a && n.push("success"), c && n.push("loading"), n.length > 1 && console.warn(
71
71
  `⚠️ CompactFileUpload: Múltiples estados detectados (${n.join(", ")}). Solo un estado debe estar activo a la vez.`
72
72
  );
73
73
  }, [o, a, c, i]);
74
- const M = (n) => {
74
+ const V = (n) => {
75
75
  n.preventDefault(), m || N(!0);
76
- }, z = (n) => {
76
+ }, M = (n) => {
77
77
  n.preventDefault(), N(!1);
78
- }, q = (n) => {
78
+ }, z = (n) => {
79
79
  n.preventDefault();
80
- }, H = (n) => {
80
+ }, q = (n) => {
81
81
  if (n.preventDefault(), N(!1), m) return;
82
82
  const s = n.dataTransfer.files;
83
83
  y(s);
84
- }, P = async (n) => {
84
+ }, H = async (n) => {
85
85
  const s = n.target.files;
86
86
  y(s);
87
87
  }, y = async (n) => {
@@ -111,37 +111,37 @@ import '../../assets/CompactFileUpload.css';const Z = "_inputContainer_g5trv_1",
111
111
  return l.items.add(s), l.files;
112
112
  })() : null
113
113
  ));
114
- }, G = () => {
114
+ }, P = () => {
115
115
  !i && !m && _.current && _.current.click();
116
- }, $ = () => {
116
+ }, G = () => {
117
117
  F(null), _.current && (_.current.value = "");
118
118
  }, J = () => {
119
- $();
119
+ G();
120
120
  }, K = () => {
121
- x == null || x(), $();
121
+ x == null || x();
122
122
  }, Q = [
123
123
  t.compactFileUploadContainer,
124
- S && t.fullWidth,
125
- t[`variant_${j}`],
124
+ A && t.fullWidth,
125
+ t[`variant_${L}`],
126
126
  !i && u ? t.warning : "",
127
127
  i && !c && !a && o ? t.error : "",
128
128
  i && !o && !a && c ? t.loading : "",
129
129
  i && !o && !c && a ? t.success : "",
130
130
  m ? t.disabled : "",
131
- B ? t.inverted : "",
132
- V ? t.dragOver : ""
131
+ j ? t.inverted : "",
132
+ U ? t.dragOver : ""
133
133
  ].filter(Boolean).join(" ");
134
134
  return /* @__PURE__ */ e("div", { className: t.inputContainer, children: /* @__PURE__ */ r(
135
135
  "div",
136
136
  {
137
137
  className: Q,
138
- onDragEnter: M,
139
- onDragLeave: z,
140
- onDragOver: q,
141
- onDrop: H,
142
- onClick: G,
138
+ onDragEnter: V,
139
+ onDragLeave: M,
140
+ onDragOver: z,
141
+ onDrop: q,
142
+ onClick: P,
143
143
  style: { cursor: m ? "not-allowed" : "pointer" },
144
- ...U,
144
+ ...S,
145
145
  children: [
146
146
  /* @__PURE__ */ e(
147
147
  "input",
@@ -149,7 +149,7 @@ import '../../assets/CompactFileUpload.css';const Z = "_inputContainer_g5trv_1",
149
149
  ref: _,
150
150
  type: "file",
151
151
  className: t.hiddenInput,
152
- onChange: P,
152
+ onChange: H,
153
153
  disabled: m,
154
154
  accept: d == null ? void 0 : d.join(",")
155
155
  }
@@ -196,7 +196,7 @@ import '../../assets/CompactFileUpload.css';const Z = "_inputContainer_g5trv_1",
196
196
  children: /* @__PURE__ */ e(
197
197
  h,
198
198
  {
199
- name: o ? "CancelIcon" : a ? "CheckIcon" : R,
199
+ name: o ? "CancelIcon" : a ? "CheckIcon" : O,
200
200
  fill: "white",
201
201
  height: 20,
202
202
  width: 20
@@ -207,7 +207,7 @@ import '../../assets/CompactFileUpload.css';const Z = "_inputContainer_g5trv_1",
207
207
  }
208
208
  ) }),
209
209
  /* @__PURE__ */ r("div", { className: t.compactFileText, children: [
210
- !o && !c && !a && /* @__PURE__ */ r(k, { children: [
210
+ !o && !c && !a && /* @__PURE__ */ r($, { children: [
211
211
  v && /* @__PURE__ */ e("span", { className: `small1Medium ${t.compactLabel}`, children: v }),
212
212
  /* @__PURE__ */ e("span", { className: `small3Regular ${t.compactFileName}`, children: i == null ? void 0 : i.name })
213
213
  ] }),
@@ -233,11 +233,11 @@ import '../../assets/CompactFileUpload.css';const Z = "_inputContainer_g5trv_1",
233
233
  "div",
234
234
  {
235
235
  className: t.compactVisibilityIcon,
236
- onClick: O,
236
+ onClick: E,
237
237
  children: /* @__PURE__ */ e(
238
238
  h,
239
239
  {
240
- name: A,
240
+ name: R,
241
241
  fill: "#2054A5",
242
242
  height: 24,
243
243
  width: 24
@@ -246,7 +246,7 @@ import '../../assets/CompactFileUpload.css';const Z = "_inputContainer_g5trv_1",
246
246
  }
247
247
  ),
248
248
  (o || a) && /* @__PURE__ */ e(
249
- L,
249
+ W,
250
250
  {
251
251
  variant: g ? "outline" : "ghost",
252
252
  icon: {
@@ -302,7 +302,7 @@ import '../../assets/CompactFileUpload.css';const Z = "_inputContainer_g5trv_1",
302
302
  /* @__PURE__ */ e("span", { className: `small3Regular ${t.compactStatusText}`, children: u })
303
303
  ] }),
304
304
  /* @__PURE__ */ e("div", { className: t.compactActions, children: /* @__PURE__ */ e(
305
- L,
305
+ W,
306
306
  {
307
307
  variant: "outline",
308
308
  icon: {
@@ -312,7 +312,7 @@ import '../../assets/CompactFileUpload.css';const Z = "_inputContainer_g5trv_1",
312
312
  children: "Subir doc"
313
313
  }
314
314
  ) })
315
- ] }) : /* @__PURE__ */ e(k, { children: /* @__PURE__ */ r("div", { className: t.textContent, children: [
315
+ ] }) : /* @__PURE__ */ e($, { children: /* @__PURE__ */ r("div", { className: t.textContent, children: [
316
316
  /* @__PURE__ */ e(
317
317
  "div",
318
318
  {
@@ -323,7 +323,7 @@ import '../../assets/CompactFileUpload.css';const Z = "_inputContainer_g5trv_1",
323
323
  children: /* @__PURE__ */ e("div", { style: { marginTop: "3px" }, children: /* @__PURE__ */ e(h, { name: "Add", fill: "white", height: 27, width: 27 }) })
324
324
  }
325
325
  ),
326
- /* @__PURE__ */ e("span", { className: `small1Medium ${t.browseText}`, children: E })
326
+ /* @__PURE__ */ e("span", { className: `small1Medium ${t.browseText}`, children: B })
327
327
  ] }) }) })
328
328
  ]
329
329
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bmi-next-brokers",
3
3
  "description": "Componentes de UI para proyecto BMI Next Brokers",
4
- "version": "2.2.6",
4
+ "version": "2.2.7",
5
5
  "author": "BMI Ahorro España",
6
6
  "contributors": [
7
7
  "José Ramón Jiménez <jrjimenez@bmicos.com>",