ablok-components 0.1.80 → 0.1.82

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.
@@ -22262,6 +22262,10 @@ const mG = /* @__PURE__ */ JA({
22262
22262
  default: ""
22263
22263
  },
22264
22264
  customFetch: null,
22265
+ baseResponsePath: {
22266
+ type: String,
22267
+ default: "/media"
22268
+ },
22265
22269
  previewWidth: {
22266
22270
  type: Number,
22267
22271
  default: 0
@@ -22270,16 +22274,16 @@ const mG = /* @__PURE__ */ JA({
22270
22274
  emits: ["update:modelValue", "update:src"],
22271
22275
  setup(t, { emit: A }) {
22272
22276
  const e = t, n = RA([]), r = RA([]), i = RA(!1), s = GA(() => e.modelValue.length ? e.modelValue : e.src ? [{ type: "", src: e.src }] : r.value);
22273
- Gr(() => n, async (c, d) => {
22277
+ Gr(() => n.value, async (c) => {
22274
22278
  r.value = await Promise.all(
22275
- c.value.map(async (h) => ({
22276
- src: e.toDataUrl ? await yN(h) : await u(h),
22277
- type: h.type
22279
+ c.map(async (d) => ({
22280
+ src: e.toDataUrl ? await yN(d) : await u(d),
22281
+ type: d.type
22278
22282
  }))
22279
22283
  );
22280
- }, { deep: !0 }), Gr(() => r, async (c, d) => {
22281
- const h = e.multiple ? r.value : r.value[0];
22282
- A("update:modelValue", h), e.multiple || A("update:src", r.value[0] && r.value[0].src);
22284
+ }, { deep: !0 }), Gr(() => r.value, async (c) => {
22285
+ const d = e.multiple ? c : c[0];
22286
+ A("update:modelValue", d), e.multiple || A("update:src", c[0] && c[0].src);
22283
22287
  }, { deep: !0 });
22284
22288
  function a(c) {
22285
22289
  n.value.splice(c, 1), (!r.value || !r.value.length) && A("update:src", "");
@@ -22297,7 +22301,7 @@ const mG = /* @__PURE__ */ JA({
22297
22301
  }).catch((B) => {
22298
22302
  console.error("Error", B);
22299
22303
  });
22300
- return i.value = !1, console.log("Response", g), `/media/${g.path}`;
22304
+ return i.value = !1, `${e.baseResponsePath}/${g.path}`;
22301
22305
  }
22302
22306
  return (c, d) => {
22303
22307
  const h = un("svg-icon"), g = un("input-file");
@@ -22390,6 +22394,10 @@ const QN = { class: "upload-group" }, vN = ["innerHTML"], EN = { class: "row" },
22390
22394
  default: ""
22391
22395
  },
22392
22396
  customFetch: null,
22397
+ baseResponsePath: {
22398
+ type: String,
22399
+ default: "/media"
22400
+ },
22393
22401
  previewWidth: {
22394
22402
  type: Number,
22395
22403
  default: 0
@@ -22434,7 +22442,8 @@ const QN = { class: "upload-group" }, vN = ["innerHTML"], EN = { class: "row" },
22434
22442
  "custom-fetch": t.customFetch,
22435
22443
  "to-data-url": !t.endpoint,
22436
22444
  "auth-token": t.authToken,
22437
- disabled: t.disabled
22445
+ disabled: t.disabled,
22446
+ "base-response-path": t.baseResponsePath
22438
22447
  }, {
22439
22448
  button: Pr(() => [
22440
22449
  N("span", SN, [
@@ -22442,7 +22451,7 @@ const QN = { class: "upload-group" }, vN = ["innerHTML"], EN = { class: "row" },
22442
22451
  ])
22443
22452
  ]),
22444
22453
  _: 1
22445
- }, 8, ["src", "endpoint", "custom-fetch", "to-data-url", "auth-token", "disabled"])
22454
+ }, 8, ["src", "endpoint", "custom-fetch", "to-data-url", "auth-token", "disabled", "base-response-path"])
22446
22455
  ])
22447
22456
  ])
22448
22457
  ]);
@@ -22506,6 +22515,10 @@ const xN = { class: "upload-group" }, HN = ["innerHTML"], wG = /* @__PURE__ */ J
22506
22515
  /* Image */
22507
22516
  })
22508
22517
  },
22518
+ baseResponsePath: {
22519
+ type: String,
22520
+ default: "/media"
22521
+ },
22509
22522
  previewWidth: {
22510
22523
  type: Number,
22511
22524
  default: 0
@@ -22521,7 +22534,7 @@ const xN = { class: "upload-group" }, HN = ["innerHTML"], wG = /* @__PURE__ */ J
22521
22534
  A("update:modelValue", r.map(
22522
22535
  (i, s) => ({
22523
22536
  mediaType: e.modelValue[s] && e.modelValue[s].mediaType || i.includes("data:image") ? i.includes("data:image/svg") ? "Svg" : "Image" : e.mediaTypeMap[i.split(".")[1]],
22524
- src: i instanceof Object ? `/media/${i.path}` : i,
22537
+ src: i,
22525
22538
  name: e.modelValue[s] && e.modelValue[s].name || `${e.name}-${s}`,
22526
22539
  ...e.type ? { type: e.type } : {}
22527
22540
  })
@@ -22537,8 +22550,9 @@ const xN = { class: "upload-group" }, HN = ["innerHTML"], wG = /* @__PURE__ */ J
22537
22550
  "custom-fetch": t.customFetch,
22538
22551
  "auth-token": t.authToken,
22539
22552
  disabled: t.disabled,
22540
- "preview-width": t.previewWidth
22541
- }, null, 8, ["modelValue", "endpoint", "custom-fetch", "auth-token", "disabled", "preview-width"])
22553
+ "preview-width": t.previewWidth,
22554
+ "base-response-path": t.baseResponsePath
22555
+ }, null, 8, ["modelValue", "endpoint", "custom-fetch", "auth-token", "disabled", "preview-width", "base-response-path"])
22542
22556
  ]));
22543
22557
  }
22544
22558
  });