ablok-components 0.3.103 → 0.3.105
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,18 +1,19 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { uniqueId as
|
|
1
|
+
import { defineComponent as F, shallowRef as K, onMounted as Y, computed as c, ref as z, watch as E, openBlock as o, createElementBlock as V, normalizeClass as W, renderSlot as x, createElementVNode as m, unref as G, createCommentVNode as B, createBlock as k, resolveDynamicComponent as w } from "vue";
|
|
2
|
+
import { uniqueId as U } from "../../../utilities/helpers.js";
|
|
3
3
|
/* empty css */
|
|
4
|
-
import { useI18n as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
4
|
+
import { useI18n as J } from "vue-i18n";
|
|
5
|
+
import { WeekStart as T } from "@vuepic/vue-datepicker";
|
|
6
|
+
import { sanitizeHtml as Q } from "../../../composables/useSanitize.js";
|
|
7
|
+
import { fr as X } from "../../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/fr.js";
|
|
8
|
+
import { de as _ } from "../../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/de.js";
|
|
9
|
+
import { enUS as H } from "../../../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US.js";
|
|
10
|
+
const ee = { class: "row" }, te = { class: "col-12" }, le = ["for", "innerHTML"], ae = { key: 0 }, ne = { class: "input-group justify-content-center" }, re = {
|
|
10
11
|
key: 0,
|
|
11
12
|
class: "row"
|
|
12
|
-
},
|
|
13
|
+
}, ue = { class: "col-12 col-md-6" }, oe = { class: "col-12 col-md-6" }, ie = {
|
|
13
14
|
key: 1,
|
|
14
15
|
class: "row"
|
|
15
|
-
},
|
|
16
|
+
}, de = { class: "col-12" }, $e = /* @__PURE__ */ F({
|
|
16
17
|
__name: "input-datepicker",
|
|
17
18
|
props: {
|
|
18
19
|
modelValue: {
|
|
@@ -33,11 +34,11 @@ const X = { class: "row" }, _ = { class: "col-12" }, ee = ["for", "innerHTML"],
|
|
|
33
34
|
},
|
|
34
35
|
name: {
|
|
35
36
|
type: String,
|
|
36
|
-
default: () =>
|
|
37
|
+
default: () => U()
|
|
37
38
|
},
|
|
38
39
|
id: {
|
|
39
40
|
type: String,
|
|
40
|
-
default: () =>
|
|
41
|
+
default: () => U()
|
|
41
42
|
},
|
|
42
43
|
label: {
|
|
43
44
|
type: String,
|
|
@@ -85,135 +86,145 @@ const X = { class: "row" }, _ = { class: "col-12" }, ee = ["for", "innerHTML"],
|
|
|
85
86
|
}
|
|
86
87
|
},
|
|
87
88
|
emits: ["update:modelValue", "update:from", "update:to"],
|
|
88
|
-
setup(a, { emit:
|
|
89
|
-
const
|
|
90
|
-
|
|
89
|
+
setup(a, { emit: Z }) {
|
|
90
|
+
const f = K(null);
|
|
91
|
+
Y(async () => {
|
|
91
92
|
const { VueDatePicker: e } = await import("@vuepic/vue-datepicker");
|
|
92
|
-
|
|
93
|
+
f.value = e, console.log("VueDatePicker loaded:", A.value, l.locale);
|
|
93
94
|
});
|
|
94
|
-
const l = a, i =
|
|
95
|
-
en:
|
|
96
|
-
de:
|
|
97
|
-
fr:
|
|
98
|
-
}, s =
|
|
99
|
-
const e = l.locale ||
|
|
100
|
-
return
|
|
101
|
-
}),
|
|
102
|
-
|
|
95
|
+
const l = a, i = Z, { t: se, locale: A } = J(), C = {
|
|
96
|
+
en: H,
|
|
97
|
+
de: _,
|
|
98
|
+
fr: X
|
|
99
|
+
}, s = c(() => {
|
|
100
|
+
const e = l.locale || A.value;
|
|
101
|
+
return C[e] || H;
|
|
102
|
+
}), $ = c(() => {
|
|
103
|
+
switch (l.locale || A.value) {
|
|
104
|
+
case "en":
|
|
105
|
+
return T.Sunday;
|
|
106
|
+
case "de":
|
|
107
|
+
case "fr":
|
|
108
|
+
return T.Monday;
|
|
109
|
+
default:
|
|
110
|
+
return T.Sunday;
|
|
111
|
+
}
|
|
112
|
+
}), N = c(() => l.inline || !l.picker ? { openMenu: !1, format: s.value } : !0);
|
|
113
|
+
function M(e) {
|
|
103
114
|
return !e || Number.isNaN(e.getTime()) ? null : e.toISOString().replace("Z", "");
|
|
104
115
|
}
|
|
105
|
-
function f(e) {
|
|
106
|
-
return !e || Array.isArray(e) ? null : k(/* @__PURE__ */ new Date(`${e}Z`));
|
|
107
|
-
}
|
|
108
116
|
function y(e) {
|
|
117
|
+
return !e || Array.isArray(e) ? null : M(/* @__PURE__ */ new Date(`${e}Z`));
|
|
118
|
+
}
|
|
119
|
+
function g(e) {
|
|
109
120
|
if (!e || Array.isArray(e)) return null;
|
|
110
121
|
const t = new Date(e);
|
|
111
|
-
return Number.isNaN(t.getTime()) ? null : (t.setUTCHours(t.getHours()),
|
|
122
|
+
return Number.isNaN(t.getTime()) ? null : (t.setUTCHours(t.getHours()), M(t));
|
|
112
123
|
}
|
|
113
|
-
function
|
|
124
|
+
function I() {
|
|
114
125
|
let e = l.from || (Array.isArray(l.modelValue) ? l.modelValue[0] : null), t = l.to || (Array.isArray(l.modelValue) ? l.modelValue[1] : null);
|
|
115
|
-
return l.utcStore ? (e = e ?
|
|
126
|
+
return l.utcStore ? (e = e ? v(e) : null, t = t ? v(t) : null) : (e = y(e), t = y(t)), [e, t];
|
|
116
127
|
}
|
|
117
|
-
const d =
|
|
118
|
-
|
|
128
|
+
const d = z(I());
|
|
129
|
+
E(() => [l.modelValue, l.from, l.to, l.utcStore], () => {
|
|
119
130
|
if (!l.range) return;
|
|
120
|
-
const e =
|
|
131
|
+
const e = I();
|
|
121
132
|
(e[0] !== d.value[0] || e[1] !== d.value[1]) && (d.value = e);
|
|
122
133
|
});
|
|
123
|
-
function
|
|
124
|
-
l.utcStore ? (e = e ? p(e) : null, t = t ? p(t) : null) : (e =
|
|
134
|
+
function P(e, t) {
|
|
135
|
+
l.utcStore ? (e = e ? p(e) : null, t = t ? p(t) : null) : (e = g(e), t = g(t)), i("update:modelValue", [e, t]), i("update:from", e), i("update:to", t);
|
|
125
136
|
}
|
|
126
|
-
function
|
|
127
|
-
d.value = [e ?? null, t ?? null],
|
|
137
|
+
function O(e, t) {
|
|
138
|
+
d.value = [e ?? null, t ?? null], P(e ?? null, t ?? null);
|
|
128
139
|
}
|
|
129
|
-
const
|
|
140
|
+
const b = c({
|
|
130
141
|
get() {
|
|
131
142
|
if (l.range) {
|
|
132
143
|
let e = l.from || (Array.isArray(l.modelValue) ? l.modelValue[0] : null), t = l.to || (Array.isArray(l.modelValue) ? l.modelValue[1] : null);
|
|
133
|
-
return l.utcStore ? (e = e ?
|
|
144
|
+
return l.utcStore ? (e = e ? v(e) : null, t = t ? v(t) : null) : (e = y(e), t = y(t)), [
|
|
134
145
|
...e ? [e] : [],
|
|
135
146
|
...t ? [t] : []
|
|
136
147
|
];
|
|
137
148
|
} else {
|
|
138
149
|
if (l.utcStore) {
|
|
139
150
|
const e = l.modelValue;
|
|
140
|
-
return e &&
|
|
151
|
+
return e && v(e) || "";
|
|
141
152
|
}
|
|
142
|
-
return
|
|
153
|
+
return y(l.modelValue) || "";
|
|
143
154
|
}
|
|
144
155
|
},
|
|
145
156
|
set(e) {
|
|
146
157
|
if (l.range && Array.isArray(e)) {
|
|
147
158
|
let [t, n] = e;
|
|
148
|
-
l.utcStore ? (t = p(t) || null, n = p(n) || null) : (t =
|
|
159
|
+
l.utcStore ? (t = p(t) || null, n = p(n) || null) : (t = g(t), n = g(n)), i("update:modelValue", [t, n]), i("update:from", t), i("update:to", n);
|
|
149
160
|
} else if (l.utcStore) {
|
|
150
161
|
const t = p(e);
|
|
151
162
|
i("update:modelValue", t);
|
|
152
163
|
} else
|
|
153
|
-
i("update:modelValue",
|
|
164
|
+
i("update:modelValue", g(e));
|
|
154
165
|
}
|
|
155
|
-
}), D =
|
|
166
|
+
}), D = c({
|
|
156
167
|
get() {
|
|
157
168
|
return d.value[0];
|
|
158
169
|
},
|
|
159
170
|
set(e) {
|
|
160
|
-
|
|
171
|
+
O(e, d.value[1]);
|
|
161
172
|
}
|
|
162
|
-
}), h =
|
|
173
|
+
}), h = c({
|
|
163
174
|
get() {
|
|
164
175
|
return d.value[1];
|
|
165
176
|
},
|
|
166
177
|
set(e) {
|
|
167
|
-
|
|
178
|
+
O(d.value[0], e);
|
|
168
179
|
}
|
|
169
180
|
});
|
|
170
|
-
function
|
|
181
|
+
function R(e) {
|
|
171
182
|
if (!e)
|
|
172
183
|
return;
|
|
173
|
-
const t = e.getDate(), n = e.getMonth() + 1,
|
|
184
|
+
const t = e.getDate(), n = e.getMonth() + 1, S = e.getFullYear(), r = e.getMinutes(), u = e.getHours();
|
|
174
185
|
switch (s.value) {
|
|
175
186
|
case "de":
|
|
176
|
-
return `${t}.${n}.${
|
|
187
|
+
return `${t}.${n}.${S} ${u < 10 ? "0" + u : u}:${r < 10 ? "0" + r : r}`;
|
|
177
188
|
case "fr":
|
|
178
|
-
return `${t}/${n}/${
|
|
189
|
+
return `${t}/${n}/${S} ${u < 10 ? "0" + u : u}:${r < 10 ? "0" + r : r}`;
|
|
179
190
|
default:
|
|
180
|
-
return `${n}/${t}/${
|
|
191
|
+
return `${n}/${t}/${S} ${u < 10 ? "0" + u : u}:${r < 10 ? "0" + r : r}`;
|
|
181
192
|
}
|
|
182
193
|
}
|
|
183
|
-
function
|
|
194
|
+
function v(e) {
|
|
184
195
|
if (!e || Array.isArray(e)) return null;
|
|
185
196
|
const t = e instanceof Date ? new Date(e) : /* @__PURE__ */ new Date(`${e}Z`);
|
|
186
197
|
if (Number.isNaN(t.getTime())) return null;
|
|
187
|
-
const n = t.getFullYear(),
|
|
188
|
-
return `${n}-${
|
|
198
|
+
const n = t.getFullYear(), S = String(t.getMonth() + 1).padStart(2, "0"), r = String(t.getDate()).padStart(2, "0"), u = String(t.getHours()).padStart(2, "0"), L = String(t.getMinutes()).padStart(2, "0"), j = String(t.getSeconds()).padStart(2, "0");
|
|
199
|
+
return `${n}-${S}-${r}T${u}:${L}:${j}`;
|
|
189
200
|
}
|
|
190
201
|
function p(e) {
|
|
191
202
|
if (!e || Array.isArray(e)) return null;
|
|
192
203
|
const t = e instanceof Date ? new Date(e) : new Date(String(e));
|
|
193
204
|
return Number.isNaN(t.getTime()) ? null : t.toISOString().split(".")[0];
|
|
194
205
|
}
|
|
195
|
-
const q = (e) => (Array.isArray(e) ? e = e.map((t) =>
|
|
206
|
+
const q = (e) => (Array.isArray(e) ? e = e.map((t) => R(t)).join(" - ") : e = R(e), e);
|
|
196
207
|
return (e, t) => (o(), V("div", {
|
|
197
|
-
class:
|
|
208
|
+
class: W(["input", "input--datepicker"])
|
|
198
209
|
}, [
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
210
|
+
x(e.$slots, "label", {}, () => [
|
|
211
|
+
m("div", ee, [
|
|
212
|
+
m("div", te, [
|
|
202
213
|
a.label ? (o(), V("label", {
|
|
203
214
|
key: 0,
|
|
204
215
|
for: a.id,
|
|
205
216
|
class: "input__label",
|
|
206
|
-
innerHTML:
|
|
207
|
-
}, null, 8,
|
|
217
|
+
innerHTML: G(Q)(`${a.label}${a.required ? " *" : ""}`)
|
|
218
|
+
}, null, 8, le)) : B("", !0)
|
|
208
219
|
])
|
|
209
220
|
])
|
|
210
221
|
]),
|
|
211
|
-
a.textInput ? (o(), V("div",
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
a.range && !a.textRange ? (o(), V("div",
|
|
215
|
-
|
|
216
|
-
(o(),
|
|
222
|
+
a.textInput ? (o(), V("div", ae, [
|
|
223
|
+
m("div", ne, [
|
|
224
|
+
x(e.$slots, "input-prepend", { slotScope: "props" }),
|
|
225
|
+
a.range && !a.textRange ? (o(), V("div", re, [
|
|
226
|
+
m("div", ue, [
|
|
227
|
+
(o(), k(w(f.value), {
|
|
217
228
|
uid: `${a.id}-from`,
|
|
218
229
|
modelValue: D.value,
|
|
219
230
|
"onUpdate:modelValue": t[0] || (t[0] = (n) => D.value = n),
|
|
@@ -224,11 +235,12 @@ const X = { class: "row" }, _ = { class: "col-12" }, ee = ["for", "innerHTML"],
|
|
|
224
235
|
"read-only": a.readOnly,
|
|
225
236
|
required: a.required,
|
|
226
237
|
"max-date": h.value,
|
|
227
|
-
"auto-apply": !0
|
|
228
|
-
|
|
238
|
+
"auto-apply": !0,
|
|
239
|
+
"week-start": $.value
|
|
240
|
+
}, null, 8, ["uid", "modelValue", "locale", "text-input", "disabled", "read-only", "required", "max-date", "week-start"]))
|
|
229
241
|
]),
|
|
230
|
-
|
|
231
|
-
(o(),
|
|
242
|
+
m("div", oe, [
|
|
243
|
+
(o(), k(w(f.value), {
|
|
232
244
|
uid: `${a.id}-to`,
|
|
233
245
|
modelValue: h.value,
|
|
234
246
|
"onUpdate:modelValue": t[1] || (t[1] = (n) => h.value = n),
|
|
@@ -239,14 +251,15 @@ const X = { class: "row" }, _ = { class: "col-12" }, ee = ["for", "innerHTML"],
|
|
|
239
251
|
"read-only": a.readOnly,
|
|
240
252
|
required: a.required,
|
|
241
253
|
"min-date": D.value,
|
|
242
|
-
"auto-apply": !0
|
|
243
|
-
|
|
254
|
+
"auto-apply": !0,
|
|
255
|
+
"week-start": $.value
|
|
256
|
+
}, null, 8, ["uid", "modelValue", "locale", "text-input", "disabled", "read-only", "required", "min-date", "week-start"]))
|
|
244
257
|
])
|
|
245
|
-
])) : (o(),
|
|
258
|
+
])) : (o(), k(w(f.value), {
|
|
246
259
|
key: 1,
|
|
247
260
|
uid: `${a.id}-input-to`,
|
|
248
|
-
modelValue:
|
|
249
|
-
"onUpdate:modelValue": t[2] || (t[2] = (n) =>
|
|
261
|
+
modelValue: b.value,
|
|
262
|
+
"onUpdate:modelValue": t[2] || (t[2] = (n) => b.value = n),
|
|
250
263
|
format: q,
|
|
251
264
|
locale: s.value,
|
|
252
265
|
range: a.textRange,
|
|
@@ -254,17 +267,18 @@ const X = { class: "row" }, _ = { class: "col-12" }, ee = ["for", "innerHTML"],
|
|
|
254
267
|
disabled: a.disabled,
|
|
255
268
|
"read-only": a.readOnly,
|
|
256
269
|
required: a.required,
|
|
257
|
-
"auto-apply": !0
|
|
258
|
-
|
|
259
|
-
|
|
270
|
+
"auto-apply": !0,
|
|
271
|
+
"week-start": $.value
|
|
272
|
+
}, null, 8, ["uid", "modelValue", "locale", "range", "text-input", "disabled", "read-only", "required", "week-start"])),
|
|
273
|
+
x(e.$slots, "input-append", { slotScope: "props" })
|
|
260
274
|
])
|
|
261
|
-
])) :
|
|
262
|
-
a.inline ? (o(), V("div",
|
|
263
|
-
|
|
264
|
-
(o(),
|
|
275
|
+
])) : B("", !0),
|
|
276
|
+
a.inline ? (o(), V("div", ie, [
|
|
277
|
+
m("div", de, [
|
|
278
|
+
(o(), k(w(f.value), {
|
|
265
279
|
uid: `${a.id}-inline`,
|
|
266
|
-
modelValue:
|
|
267
|
-
"onUpdate:modelValue": t[3] || (t[3] = (n) =>
|
|
280
|
+
modelValue: b.value,
|
|
281
|
+
"onUpdate:modelValue": t[3] || (t[3] = (n) => b.value = n),
|
|
268
282
|
locale: s.value,
|
|
269
283
|
cancelText: "abbrechen",
|
|
270
284
|
selectText: "auswählen",
|
|
@@ -279,13 +293,14 @@ const X = { class: "row" }, _ = { class: "col-12" }, ee = ["for", "innerHTML"],
|
|
|
279
293
|
disabled: a.disabled,
|
|
280
294
|
"read-only": a.readOnly,
|
|
281
295
|
required: a.required,
|
|
282
|
-
"month-name-format": "long"
|
|
283
|
-
|
|
296
|
+
"month-name-format": "long",
|
|
297
|
+
"week-start": $.value
|
|
298
|
+
}, null, 8, ["uid", "modelValue", "locale", "range", "multi-calendars", "partial-range", "disabled", "read-only", "required", "week-start"]))
|
|
284
299
|
])
|
|
285
|
-
])) :
|
|
300
|
+
])) : B("", !0)
|
|
286
301
|
]));
|
|
287
302
|
}
|
|
288
303
|
});
|
|
289
304
|
export {
|
|
290
|
-
|
|
305
|
+
$e as default
|
|
291
306
|
};
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ablok-components",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.105",
|
|
5
5
|
"dependencies": {
|
|
6
|
+
"@vuepic/vue-datepicker": "^14.0.0",
|
|
6
7
|
"date-fns": "^4.4.0",
|
|
7
8
|
"dompurify": "^3.4.13",
|
|
8
9
|
"html2canvas": "^1.4.1",
|
|
@@ -10,16 +11,15 @@
|
|
|
10
11
|
"ofetch": "^1.5.1"
|
|
11
12
|
},
|
|
12
13
|
"peerDependencies": {
|
|
13
|
-
"@tiptap/core": "^3.
|
|
14
|
-
"@tiptap/extension-bold": "^3.
|
|
15
|
-
"@tiptap/extension-highlight": "^3.
|
|
16
|
-
"@tiptap/extension-link": "^3.
|
|
17
|
-
"@tiptap/extension-text-align": "^3.
|
|
18
|
-
"@tiptap/pm": "^3.
|
|
19
|
-
"@tiptap/starter-kit": "^3.
|
|
20
|
-
"@tiptap/vue-3": "^3.
|
|
14
|
+
"@tiptap/core": "^3.30.0",
|
|
15
|
+
"@tiptap/extension-bold": "^3.30.0",
|
|
16
|
+
"@tiptap/extension-highlight": "^3.30.0",
|
|
17
|
+
"@tiptap/extension-link": "^3.30.0",
|
|
18
|
+
"@tiptap/extension-text-align": "^3.30.0",
|
|
19
|
+
"@tiptap/pm": "^3.30.0",
|
|
20
|
+
"@tiptap/starter-kit": "^3.30.0",
|
|
21
|
+
"@tiptap/vue-3": "^3.30.0",
|
|
21
22
|
"@vue-leaflet/vue-leaflet": "^0.10.1",
|
|
22
|
-
"@vuepic/vue-datepicker": "^12.1.0",
|
|
23
23
|
"canvas-confetti": "^1.9.4",
|
|
24
24
|
"leaflet": "^1.9.4",
|
|
25
25
|
"qr-code-styling": "^1.9.2",
|
|
@@ -96,8 +96,6 @@
|
|
|
96
96
|
"vite-plugin-dts": "^5.0.3",
|
|
97
97
|
"vite-plugin-mkcert": "^2.1.0",
|
|
98
98
|
"vitest": "^4.1.10",
|
|
99
|
-
"vscode-oniguruma": "^2.0.1",
|
|
100
|
-
"vscode-textmate": "^9.3.2",
|
|
101
99
|
"vue-i18n": "^11.4.8",
|
|
102
100
|
"vue-tsc": "^3.3.9"
|
|
103
101
|
},
|