ablok-components 0.3.95 → 0.3.96

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.
@@ -135,6 +135,10 @@ declare const __VLS_component: import('../../../../vue/dist/vue.esm-bundler.js')
135
135
  type: NumberConstructor;
136
136
  default: number;
137
137
  };
138
+ showProgress: {
139
+ type: BooleanConstructor;
140
+ default: boolean;
141
+ };
138
142
  }>, {}, {}, {}, {}, import('../../../../vue/dist/vue.esm-bundler.js').ComponentOptionsMixin, import('../../../../vue/dist/vue.esm-bundler.js').ComponentOptionsMixin, {
139
143
  "update:modelValue": (...args: any[]) => void;
140
144
  }, string, import('../../../../vue/dist/vue.esm-bundler.js').PublicProps, Readonly<import('../../../../vue/dist/vue.esm-bundler.js').ExtractPropTypes<{
@@ -249,6 +253,10 @@ declare const __VLS_component: import('../../../../vue/dist/vue.esm-bundler.js')
249
253
  type: NumberConstructor;
250
254
  default: number;
251
255
  };
256
+ showProgress: {
257
+ type: BooleanConstructor;
258
+ default: boolean;
259
+ };
252
260
  }>> & Readonly<{
253
261
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
254
262
  }>, {
@@ -271,6 +279,7 @@ declare const __VLS_component: import('../../../../vue/dist/vue.esm-bundler.js')
271
279
  editCaptions: boolean;
272
280
  allowDuplicateFiles: boolean;
273
281
  maxFiles: number;
282
+ showProgress: boolean;
274
283
  }, {}, {}, {}, string, import('../../../../vue/dist/vue.esm-bundler.js').ComponentProvideOptions, true, {
275
284
  root: HTMLDivElement;
276
285
  }, HTMLDivElement>;
@@ -1,4 +1,4 @@
1
- import { defineComponent as N, computed as V, ref as k, resolveComponent as x, openBlock as n, createElementBlock as i, createElementVNode as l, unref as U, renderSlot as $, withModifiers as M, createVNode as f, createCommentVNode as u, toDisplayString as g, withCtx as F, normalizeClass as P, Fragment as A, withDirectives as E, vModelText as R, nextTick as K } from "vue";
1
+ import { defineComponent as I, computed as V, ref as k, resolveComponent as x, openBlock as n, createElementBlock as i, createElementVNode as l, unref as N, renderSlot as $, withModifiers as M, createVNode as f, createCommentVNode as u, toDisplayString as g, withCtx as F, normalizeClass as U, Fragment as A, withDirectives as E, vModelText as R, nextTick as K } from "vue";
2
2
  import j from "../file-upload/file-upload.vue.js";
3
3
  /* empty css */
4
4
  import { sanitizeHtml as q } from "../../../composables/useSanitize.js";
@@ -11,7 +11,7 @@ const G = { class: "container" }, J = { class: "row" }, O = {
11
11
  }, Z = { class: "m-0" }, ee = { class: "preview-item border-bottom p-3" }, te = { class: "d-flex gap-3" }, le = { class: "col-2" }, oe = { class: "col d-flex flex-column" }, se = { class: "file-meta text-muted small mb-2" }, ae = { class: "fw-semibold" }, ne = { key: 0 }, ie = { key: 1 }, de = ["onUpdate:modelValue", "id"], re = ["innerHTML"], ue = {
12
12
  key: 2,
13
13
  class: "upload-progress mt-3 mb-0"
14
- }, ce = ["value"], pe = { class: "col-auto d-flex flex-column gap-2" }, me = ["onClick"], fe = ["onClick"], ve = { class: "file-upload__label" }, be = { class: "d-flex align-items-end p-3" }, he = ["for"], ge = ["innerHTML"], Me = /* @__PURE__ */ N({
14
+ }, ce = ["value"], pe = { class: "col-auto d-flex flex-column gap-2" }, me = ["onClick"], fe = ["onClick"], ve = { class: "file-upload__label" }, be = { class: "d-flex align-items-end p-3" }, he = ["for"], ge = ["innerHTML"], Me = /* @__PURE__ */ I({
15
15
  __name: "bulk-upload",
16
16
  props: {
17
17
  storeId: String,
@@ -61,11 +61,15 @@ const G = { class: "container" }, J = { class: "row" }, O = {
61
61
  maxFiles: {
62
62
  type: Number,
63
63
  default: 0
64
+ },
65
+ showProgress: {
66
+ type: Boolean,
67
+ default: !0
64
68
  }
65
69
  },
66
70
  emits: ["update:modelValue"],
67
71
  setup(d, { emit: z }) {
68
- const r = d, C = z, w = (e) => `${e.name ?? ""}|${e.size ?? 0}|${e.lastModified ?? 0}|${e.type ?? ""}`, c = V({
72
+ const r = d, w = z, C = (e) => `${e.name ?? ""}|${e.size ?? 0}|${e.lastModified ?? 0}|${e.type ?? ""}`, c = V({
69
73
  get: () => {
70
74
  const e = r.modelValue || [];
71
75
  return b.value = e.map((t) => t.caption || ""), e.map((t) => ({
@@ -79,8 +83,8 @@ const G = { class: "container" }, J = { class: "row" }, O = {
79
83
  },
80
84
  set: (e) => {
81
85
  const t = c.value || [], a = Array.isArray(e) ? e : [], p = r.allowDuplicateFiles ? a : a.filter((y) => {
82
- const _ = w(y);
83
- return !t.some((I) => w(I) === _);
86
+ const _ = C(y);
87
+ return !t.some((P) => C(P) === _);
84
88
  }), o = r.maxFiles > 0 ? Math.max(0, r.maxFiles - t.length) : void 0, s = typeof o == "number" ? p.slice(0, o) : p;
85
89
  if (!r.allowDuplicateFiles && a.length > 0 && s.length === 0)
86
90
  return;
@@ -90,7 +94,7 @@ const G = { class: "container" }, J = { class: "row" }, O = {
90
94
  }), B = k(null), v = k({}), b = k({}), H = V(() => r.disabled || r.maxFiles > 0 && c.value.length >= r.maxFiles);
91
95
  function S(e) {
92
96
  const t = [...r.modelValue || []];
93
- t.splice(e, 1), C("update:modelValue", t);
97
+ t.splice(e, 1), w("update:modelValue", t);
94
98
  }
95
99
  async function D(e) {
96
100
  v.value[e] = !v.value[e], v.value[e] || h(), await K(), B.value?.querySelector(`#caption-${e}`)?.focus();
@@ -107,7 +111,7 @@ const G = { class: "container" }, J = { class: "row" }, O = {
107
111
  return e ? new Date(e).toLocaleDateString() : "";
108
112
  }
109
113
  function h(e) {
110
- C("update:modelValue", (e || c.value).map((t, a) => ({
114
+ w("update:modelValue", (e || c.value).map((t, a) => ({
111
115
  ...t,
112
116
  caption: b.value[a] || ""
113
117
  })));
@@ -125,7 +129,7 @@ const G = { class: "container" }, J = { class: "row" }, O = {
125
129
  l("div", Q, [
126
130
  l("p", {
127
131
  class: "fw-bold m-0",
128
- innerHTML: U(q)(d.title || e.$t("fileInput.bulkUploadHeadline"))
132
+ innerHTML: N(q)(d.title || e.$t("fileInput.bulkUploadHeadline"))
129
133
  }, null, 8, W),
130
134
  $(e.$slots, "bulk-remove", {}, () => [
131
135
  d.hasBulkRemove ? (n(), i("button", {
@@ -185,7 +189,7 @@ const G = { class: "container" }, J = { class: "row" }, O = {
185
189
  class: "m-0",
186
190
  innerHTML: b.value[s] || `<small>${e.$t("fileInput.noCaption")}</small>`
187
191
  }, null, 8, re)),
188
- o.uploadProgress ? (n(), i("div", ue, [
192
+ d.showProgress && o.uploadProgress ? (n(), i("div", ue, [
189
193
  $(e.$slots, "upload-progress", {
190
194
  bind: { item: o, index: s }
191
195
  }, () => [
@@ -224,7 +228,7 @@ const G = { class: "container" }, J = { class: "row" }, O = {
224
228
  l("span", be, [
225
229
  l("label", {
226
230
  for: `${d.id}-file-upload`,
227
- class: P(["btn btn-primary btn-sm ms-auto d-flex align-items-center gap-2", { disabled: H.value }])
231
+ class: U(["btn btn-primary btn-sm ms-auto d-flex align-items-center gap-2", { disabled: H.value }])
228
232
  }, [
229
233
  f(a, {
230
234
  symbol: "upload",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ablok-components",
3
3
  "private": false,
4
- "version": "0.3.95",
4
+ "version": "0.3.96",
5
5
  "dependencies": {
6
6
  "date-fns": "^3.0.0",
7
7
  "dompurify": "^3.3.1",