@scbt-ecom/ui 0.47.1 → 0.49.0

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.
@@ -24234,19 +24234,19 @@ function o3(t, e) {
24234
24234
  }
24235
24235
  function Qy() {
24236
24236
  }
24237
- const s3 = ({ dropzoneOptions: t, controlledFiles: e = [], onChange: n }) => {
24238
- const [r, i] = Le({}), o = (l) => {
24239
- const c = e == null ? void 0 : e.filter((u, d) => d !== l);
24240
- n && n(c);
24241
- }, a = rE({
24242
- onDrop: (l, c) => {
24243
- var d, f;
24244
- switch (l.forEach((p) => {
24245
- const h = new FileReader();
24246
- i((m) => ({ ...m, [p.name]: "loading" })), h.onload = () => {
24247
- i((m) => ({ ...m, [p.name]: "success" }));
24248
- }, h.readAsArrayBuffer(p);
24249
- }), (f = (d = c[0]) == null ? void 0 : d.errors[0]) == null ? void 0 : f.code) {
24237
+ const s3 = ({ dropzoneOptions: t, controlledFiles: e = [], onChange: n, externalHandlers: r }) => {
24238
+ const [i, o] = Le({}), s = (c) => {
24239
+ const u = e == null ? void 0 : e.filter((d, f) => f !== c);
24240
+ n && n(u);
24241
+ }, l = rE({
24242
+ onDrop: (c, u) => {
24243
+ var f, p;
24244
+ switch (c.forEach((h) => {
24245
+ const m = new FileReader();
24246
+ o((g) => ({ ...g, [h.name]: "loading" })), m.onload = () => {
24247
+ o((g) => ({ ...g, [h.name]: "success" }));
24248
+ }, m.readAsArrayBuffer(h);
24249
+ }), (p = (f = u[0]) == null ? void 0 : f.errors[0]) == null ? void 0 : p.code) {
24250
24250
  case gd.FileInvalidType:
24251
24251
  sd({
24252
24252
  intent: "error",
@@ -24266,12 +24266,12 @@ const s3 = ({ dropzoneOptions: t, controlledFiles: e = [], onChange: n }) => {
24266
24266
  });
24267
24267
  break;
24268
24268
  }
24269
- const u = [...e, ...l];
24270
- n && n(u);
24269
+ const d = [...e, ...c];
24270
+ n && n(d), r != null && r.onChange && (r == null || r.onChange(d));
24271
24271
  },
24272
24272
  ...t
24273
24273
  });
24274
- return { filesStatus: r, removeFile: o, dropzoneState: a };
24274
+ return { filesStatus: i, removeFile: s, dropzoneState: l };
24275
24275
  }, a3 = (t) => {
24276
24276
  const [e, n] = Le(!1), r = Ae(() => {
24277
24277
  const { current: i } = t, o = !!i && i.scrollWidth > i.clientWidth;
@@ -24310,8 +24310,8 @@ const s3 = ({ dropzoneOptions: t, controlledFiles: e = [], onChange: n }) => {
24310
24310
  l
24311
24311
  )) });
24312
24312
  }, d3 = lt(
24313
- ({ dropzoneState: t, classes: e, disabled: n, invalid: r, name: i, ...o }, s) => {
24314
- const a = t.getRootProps();
24313
+ ({ dropzoneState: t, classes: e, disabled: n, invalid: r, name: i, externalHandlers: o, ...s }, a) => {
24314
+ const l = t.getRootProps();
24315
24315
  return /* @__PURE__ */ P.jsxs(
24316
24316
  "div",
24317
24317
  {
@@ -24325,8 +24325,8 @@ const s3 = ({ dropzoneOptions: t, controlledFiles: e = [], onChange: n }) => {
24325
24325
  { "bg-color-primary-light-default opacity-50": n },
24326
24326
  { "border-negative": r }
24327
24327
  ),
24328
- ref: s,
24329
- ...a,
24328
+ ref: a,
24329
+ ...l,
24330
24330
  children: [
24331
24331
  /* @__PURE__ */ P.jsxs("div", { className: te("flex h-full w-full items-center justify-center gap-2", e == null ? void 0 : e.textContainer), children: [
24332
24332
  /* @__PURE__ */ P.jsx(Ve, { name: "files/upload", className: te("text-icon-primary-default", e == null ? void 0 : e.icon) }),
@@ -24338,8 +24338,9 @@ const s3 = ({ dropzoneOptions: t, controlledFiles: e = [], onChange: n }) => {
24338
24338
  /* @__PURE__ */ P.jsx(
24339
24339
  "input",
24340
24340
  {
24341
- ...o,
24341
+ ...s,
24342
24342
  ...t.getInputProps(),
24343
+ onClick: o == null ? void 0 : o.onClick,
24343
24344
  name: i,
24344
24345
  ref: t.inputRef,
24345
24346
  disabled: n,
@@ -24352,26 +24353,38 @@ const s3 = ({ dropzoneOptions: t, controlledFiles: e = [], onChange: n }) => {
24352
24353
  );
24353
24354
  }
24354
24355
  ), f3 = lt(
24355
- ({ classes: t, dropzoneOptions: e = rz, name: n, value: r, disabled: i, invalid: o, onChange: s, ...a }, l) => {
24356
- const { filesStatus: c, removeFile: u, dropzoneState: d } = s3({
24356
+ ({
24357
+ classes: t,
24358
+ dropzoneOptions: e = rz,
24359
+ name: n,
24360
+ value: r,
24361
+ disabled: i,
24362
+ invalid: o,
24363
+ onChange: s,
24364
+ externalHandlers: a,
24365
+ ...l
24366
+ }, c) => {
24367
+ const { filesStatus: u, removeFile: d, dropzoneState: f } = s3({
24357
24368
  controlledFiles: r,
24358
24369
  dropzoneOptions: e,
24359
- onChange: s
24360
- }), { root: f, input: p, files: h } = t || {};
24370
+ onChange: s,
24371
+ externalHandlers: a
24372
+ }), { root: p, input: h, files: m } = t || {};
24361
24373
  return /* @__PURE__ */ P.jsxs(P.Fragment, { children: [
24362
- /* @__PURE__ */ P.jsx("div", { className: te("relative mb-3 w-[476px]", f), children: /* @__PURE__ */ P.jsx(
24374
+ /* @__PURE__ */ P.jsx("div", { className: te("relative mb-3 w-[476px]", p), children: /* @__PURE__ */ P.jsx(
24363
24375
  d3,
24364
24376
  {
24365
- ...a,
24366
- ref: l,
24377
+ ...l,
24378
+ ref: c,
24367
24379
  name: n,
24368
- classes: p,
24380
+ classes: h,
24369
24381
  disabled: i,
24370
24382
  invalid: o,
24371
- dropzoneState: d
24383
+ dropzoneState: f,
24384
+ externalHandlers: a
24372
24385
  }
24373
24386
  ) }),
24374
- /* @__PURE__ */ P.jsx(u3, { files: r, removeFile: u, classes: h, filesStatus: c })
24387
+ /* @__PURE__ */ P.jsx(u3, { files: r, removeFile: d, classes: m, filesStatus: u })
24375
24388
  ] });
24376
24389
  }
24377
24390
  );
@@ -41804,4 +41817,4 @@ export {
41804
41817
  m1 as t,
41805
41818
  Kh as u
41806
41819
  };
41807
- //# sourceMappingURL=index-jk9y4fVq.js.map
41820
+ //# sourceMappingURL=index-BiAdttkO.js.map