@fewangsit/wangsvue-fats 1.0.1-alpha.30 → 1.0.1-alpha.32

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.
@@ -50,8 +50,8 @@ const I = (i, s) => {
50
50
  _: 3
51
51
  }, 8, ["mouse-move", "touch-move", "touch-resize", "wheel-resize"]));
52
52
  }
53
- }), S = /* @__PURE__ */ I(R, [["__scopeId", "data-v-9031c32d"]]);
53
+ }), b = /* @__PURE__ */ I(R, [["__scopeId", "data-v-5cd98b2d"]]);
54
54
  export {
55
- S as B,
55
+ b as B,
56
56
  I as _
57
57
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as wt, onMounted as Dt, useAttrs as bt, ref as B, shallowRef as P, computed as A, watch as he, createBlock as ye, openBlock as c, withCtx as we, renderSlot as U, createVNode as S, createElementVNode as f, mergeProps as u, unref as q, createElementBlock as g, createCommentVNode as $, withDirectives as Mt, toDisplayString as F, Fragment as Q, renderList as re, createTextVNode as kt, normalizeProps as Tt, withKeys as w, vShow as St } from "vue";
1
+ import { defineComponent as wt, onMounted as Dt, useAttrs as bt, ref as B, shallowRef as P, computed as A, watch as ge, createBlock as he, openBlock as c, withCtx as ye, renderSlot as U, createVNode as S, createElementVNode as f, mergeProps as u, unref as q, createElementBlock as g, createCommentVNode as $, withDirectives as Mt, toDisplayString as F, Fragment as Q, renderList as re, createTextVNode as kt, normalizeProps as Tt, withKeys as w, vShow as St } from "vue";
2
2
  import { u as $t } from "../plugins/WangsVue.es.js";
3
3
  import { s as Ft } from "../vendor/primevue/overlaypanel/overlaypanel.esm.es.js";
4
4
  import { s as Yt } from "../vendor/primevue/selectbutton/selectbutton.esm.es.js";
@@ -67,12 +67,12 @@ const It = ["id"], Pt = ["id", "aria-invalid", "disabled", "placeholder", "value
67
67
  exactSelection: { type: Boolean, default: !1 }
68
68
  },
69
69
  emits: ["update:modelValue", "update:epochTimeMillis", "monthChange", "yearChange", "dateSelect"],
70
- setup(xe, { emit: Ne }) {
71
- const l = xe, x = Ne;
70
+ setup(Ae, { emit: xe }) {
71
+ const l = Ae, x = xe;
72
72
  Dt(() => {
73
73
  R();
74
74
  });
75
- const ue = bt(), Y = $t("Calendar"), Oe = (1969 * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) + Math.floor(1970 / 400)) * 24 * 60 * 60 * 1e7, De = B(), Z = B(), ie = B(), L = /* @__PURE__ */ new Date(), h = B(L.getMonth()), i = B(L.getFullYear()), v = B(L.getHours()), D = B(L.getMinutes()), V = B(L.getSeconds()), N = B(l.modelValue), _ = B(!1), de = P(), p = P(l.view ?? "date"), be = P([]), Me = P(!1), y = P(!1), ve = P(), ke = P(!1), ce = P(), Te = P([]), o = A(() => l.showButtons || l.showTime ? N.value : l.modelValue), ee = A(() => be.value.flatMap((e) => e)), Ee = A(() => v.value < 10 ? "0" + v.value : v.value), Ke = A(() => D.value < 10 ? "0" + D.value : D.value), We = A(() => l.dateFormat || Y.locale.global.dateFormat), Le = A(() => {
75
+ const Ne = bt(), Y = $t("Calendar"), Oe = (1969 * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) + Math.floor(1970 / 400)) * 24 * 60 * 60 * 1e7, we = B(), Z = B(), ue = B(), L = /* @__PURE__ */ new Date(), h = B(L.getMonth()), i = B(L.getFullYear()), v = B(L.getHours()), D = B(L.getMinutes()), V = B(L.getSeconds()), N = B(l.modelValue), _ = B(!1), ie = P(), p = P(l.view ?? "date"), De = P([]), be = P(!1), y = P(!1), de = P(), Me = P(!1), ve = P(), ke = P([]), o = A(() => l.showButtons || l.showTime ? N.value : l.modelValue), ee = A(() => De.value.flatMap((e) => e)), Ee = A(() => v.value < 10 ? "0" + v.value : v.value), Ke = A(() => D.value < 10 ? "0" + D.value : D.value), We = A(() => l.dateFormat || Y.locale.global.dateFormat), Le = A(() => {
76
76
  const e = [], t = (a) => {
77
77
  if (l.minDate) {
78
78
  const n = l.minDate.getMonth(), r = l.minDate.getFullYear();
@@ -119,11 +119,7 @@ const It = ["id"], Pt = ["id", "aria-invalid", "disabled", "placeholder", "value
119
119
  return e;
120
120
  const t = /* @__PURE__ */ new Date();
121
121
  return l.maxDate && l.maxDate < t ? l.maxDate : l.minDate && l.minDate > t ? l.minDate : t;
122
- }), Re = A(() => (console.log(
123
- l.invalid || !!ue["error-message"],
124
- l.invalid,
125
- !!ue["error-message"]
126
- ), l.invalid || !!ue["error-message"])), b = (e) => e.length > 2 ? e.length - 1 : 1, je = () => {
122
+ }), Re = A(() => l.invalid || !!Ne["error-message"]), b = (e) => e.length > 2 ? e.length - 1 : 1, je = () => {
127
123
  const e = new Date(i.value, h.value, 1), t = new Date(i.value, h.value + 1, 0), a = t.getDate(), n = e.getDay(), r = t.getDay(), d = [];
128
124
  let s = 1 - n;
129
125
  for (; s <= a; ) {
@@ -154,10 +150,10 @@ const It = ["id"], Pt = ["id", "aria-invalid", "disabled", "placeholder", "value
154
150
  h.value === 0 ? (i.value--, h.value = 11) : h.value--, R();
155
151
  }, qe = () => {
156
152
  i.value--;
157
- }, Se = () => {
153
+ }, Te = () => {
158
154
  i.value++;
159
155
  }, ze = () => {
160
- h.value === 11 ? (Se(), h.value = 0) : h.value++, R();
156
+ h.value === 11 ? (Te(), h.value = 0) : h.value++, R();
161
157
  }, Ge = () => {
162
158
  i.value -= 10;
163
159
  }, Je = () => {
@@ -165,9 +161,9 @@ const It = ["id"], Pt = ["id", "aria-invalid", "disabled", "placeholder", "value
165
161
  }, Qe = () => {
166
162
  p.value === "date" ? Ue() : p.value === "month" ? qe() : Ge();
167
163
  }, Xe = () => {
168
- p.value === "date" ? ze() : p.value === "month" ? Se() : Je();
164
+ p.value === "date" ? ze() : p.value === "month" ? Te() : Je();
169
165
  }, R = () => {
170
- be.value = je();
166
+ De.value = je();
171
167
  }, E = () => o.value != null && typeof o.value != "string", K = (e) => l.selectionMode === "single" && (!Array.isArray(o.value) || o.value == null), C = () => l.selectionMode === "range" && (Array.isArray(o.value) || o.value == null), I = () => l.selectionMode === "multiple" && (Array.isArray(o.value) || o.value == null), ae = (e) => I() || C(), W = (e, t) => e ? e.getDate() === t.day && e.getMonth() === t.month && e.getFullYear() === t.year : !1, Ze = (e, t, a) => {
172
168
  if (e && t) {
173
169
  const r = new Date(a.year, a.month, a.day);
@@ -198,7 +194,7 @@ const It = ["id"], Pt = ["id", "aria-invalid", "disabled", "placeholder", "value
198
194
  }, _e = (e) => K(o.value) || I() ? z(e) : C() ? z(e) && (W(o.value[0], e) || o.value[0] == null) : !1, et = (e) => K(o.value) || I() ? z(e) : C() ? z(e) && (W(
199
195
  o.value[b(o.value)],
200
196
  e
201
- ) || o.value[b(o.value)] == null) : !1, $e = (e) => {
197
+ ) || o.value[b(o.value)] == null) : !1, Se = (e) => {
202
198
  if (E()) {
203
199
  if (K(o.value))
204
200
  return o.value.getMonth() === e && o.value.getFullYear() === i.value;
@@ -215,7 +211,7 @@ const It = ["id"], Pt = ["id", "aria-invalid", "disabled", "placeholder", "value
215
211
  }
216
212
  }
217
213
  return !1;
218
- }, Fe = (e) => {
214
+ }, $e = (e) => {
219
215
  var t;
220
216
  if (E()) {
221
217
  if (K(o.value))
@@ -239,10 +235,10 @@ const It = ["id"], Pt = ["id", "aria-invalid", "disabled", "placeholder", "value
239
235
  return l.excludeDates && (s = !l.excludeDates.some(
240
236
  (m) => m.getFullYear() === a && m.getMonth() === t && m.getDate() === e
241
237
  )), l.minDate && (l.minDate.getFullYear() > a || l.minDate.getFullYear() === a && (l.minDate.getMonth() > t || l.minDate.getMonth() === t && l.minDate.getDate() > e)) && (n = !1), l.maxDate && (l.maxDate.getFullYear() < a || l.maxDate.getFullYear() === a && (l.maxDate.getMonth() < t || l.maxDate.getMonth() === t && l.maxDate.getDate() < e)) && (r = !1), n && r && d && s;
242
- }, me = (e, t) => {
238
+ }, ce = (e, t) => {
243
239
  e.currentTarget instanceof HTMLElement && e.currentTarget.focus(), t.selectable && gt(t), l.selectionMode === "single" && (!l.showTime || l.hideOnDateTimeSelect) && J();
244
240
  }, at = (e, t) => {
245
- t.selectable && (l.view === "month" ? me(e, {
241
+ t.selectable && (l.view === "month" ? ce(e, {
246
242
  year: i.value,
247
243
  month: t.value,
248
244
  day: 1,
@@ -254,7 +250,7 @@ const It = ["id"], Pt = ["id", "aria-invalid", "disabled", "placeholder", "value
254
250
  year: i.value
255
251
  })), R());
256
252
  }, lt = (e, t) => {
257
- t.selectable && (l.view === "year" ? me(e, {
253
+ t.selectable && (l.view === "year" ? ce(e, {
258
254
  year: t.value,
259
255
  month: 0,
260
256
  day: 1,
@@ -266,11 +262,11 @@ const It = ["id"], Pt = ["id", "aria-invalid", "disabled", "placeholder", "value
266
262
  year: i.value
267
263
  })), R());
268
264
  }, M = (e, t, a) => {
269
- !l.disabled && !l.readonly && (He(e, null, t, a), e.preventDefault());
265
+ !l.disabled && !l.readonly && (Ce(e, null, t, a), e.preventDefault());
270
266
  }, k = (e) => {
271
- !l.disabled && !l.readonly && (fe(), Be(), e.preventDefault());
267
+ !l.disabled && !l.readonly && (me(), He(), e.preventDefault());
272
268
  }, le = () => {
273
- fe();
269
+ me();
274
270
  }, ne = (e) => {
275
271
  switch (e.code) {
276
272
  case "Tab":
@@ -279,20 +275,20 @@ const It = ["id"], Pt = ["id", "aria-invalid", "disabled", "placeholder", "value
279
275
  J(), e.preventDefault();
280
276
  break;
281
277
  }
282
- }, Ye = (e) => {
278
+ }, Fe = (e) => {
283
279
  l.disabled || setTimeout(() => {
284
- Z.value.show(e, Ce(e));
280
+ Z.value.show(e, Ye(e));
285
281
  }, 0);
286
282
  }, nt = (e) => {
287
283
  l.disabled || setTimeout(() => {
288
284
  var t;
289
- (t = Z.value) == null || t.toggle(e, Ce(e));
285
+ (t = Z.value) == null || t.toggle(e, Ye(e));
290
286
  }, 0);
291
287
  }, ot = () => {
292
- p.value = l.view, pe(), _.value || Pe();
293
- }, Ce = (e) => ("$el" in ie.value ? ie.value.$el : De.value) ?? e.currentTarget, He = (e, t, a, n) => {
294
- switch (t || (t = 500), fe(), ve.value = setTimeout(() => {
295
- He(e, 100, a, n);
288
+ p.value = l.view, fe(), _.value || Ie();
289
+ }, Ye = (e) => ("$el" in ue.value ? ue.value.$el : we.value) ?? e.currentTarget, Ce = (e, t, a, n) => {
290
+ switch (t || (t = 500), me(), de.value = setTimeout(() => {
291
+ Ce(e, 100, a, n);
296
292
  }, t), a) {
297
293
  case 0:
298
294
  n === 1 ? rt(e) : st(e);
@@ -314,8 +310,8 @@ const It = ["id"], Pt = ["id", "aria-invalid", "disabled", "placeholder", "value
314
310
  }, it = (e) => {
315
311
  let t = D.value - l.stepMinute;
316
312
  t = t < 0 ? 60 + t : t, G(v.value, t, V.value, y.value) && (D.value = t), e.preventDefault();
317
- }, fe = () => {
318
- ve.value && clearInterval(ve.value);
313
+ }, me = () => {
314
+ de.value && clearInterval(de.value);
319
315
  }, G = (e, t, a, n) => {
320
316
  let r;
321
317
  const d = dt(e, n);
@@ -326,20 +322,20 @@ const It = ["id"], Pt = ["id", "aria-invalid", "disabled", "placeholder", "value
326
322
  r = E() ? o.value : O.value;
327
323
  const s = r ? r.toDateString() : null;
328
324
  return !(l.minDate && s && l.minDate.toDateString() === s && (l.minDate.getHours() > d || l.minDate.getHours() === d && (l.minDate.getMinutes() > t || l.minDate.getMinutes() === t && l.minDate.getSeconds() > a)) || l.maxDate && s && l.maxDate.toDateString() === s && (l.maxDate.getHours() < d || l.maxDate.getHours() === d && (l.maxDate.getMinutes() < t || l.maxDate.getMinutes() === t && l.maxDate.getSeconds() < a)));
329
- }, dt = (e, t) => l.hourFormat == "12" ? e === 12 ? t ? 12 : 0 : t ? e + 12 : e : e, Be = () => {
330
- ke.value = !0;
325
+ }, dt = (e, t) => l.hourFormat == "12" ? e === 12 ? t ? 12 : 0 : t ? e + 12 : e : e, He = () => {
326
+ Me.value = !0;
331
327
  let e;
332
328
  if (ae(o.value)) {
333
329
  const t = E() ? o.value : O.value;
334
330
  e = t[b(t)] || t[0];
335
331
  } else
336
332
  e = E() ? o.value : O.value;
337
- e = e && !Array.isArray(e) ? new Date(e.getTime()) : /* @__PURE__ */ new Date(), l.hourFormat == "12" ? v.value === 12 ? e.setHours(y.value ? 12 : 0) : e.setHours(y.value ? v.value + 12 : v.value) : e.setHours(v.value), e.setMinutes(D.value), e.setSeconds(V.value), ae(o.value) && (I() ? e = [...o.value] : C() && (o.value[b(o.value)] ? e = [o.value[0], e] : e = [e, null])), Ie(e), x("dateSelect", e), setTimeout(() => ke.value = !1, 0);
338
- }, Ve = (e) => e ? Array.isArray(e) ? e.map((a) => a == null ? void 0 : a.getTime()) : e.getTime() : null, Ie = (e) => {
339
- l.showButtons || l.showTime ? (N.value = e, _.value = !1) : (x("update:epochTimeMillis", Ve(e)), x("update:modelValue", e));
333
+ e = e && !Array.isArray(e) ? new Date(e.getTime()) : /* @__PURE__ */ new Date(), l.hourFormat == "12" ? v.value === 12 ? e.setHours(y.value ? 12 : 0) : e.setHours(y.value ? v.value + 12 : v.value) : e.setHours(v.value), e.setMinutes(D.value), e.setSeconds(V.value), ae(o.value) && (I() ? e = [...o.value] : C() && (o.value[b(o.value)] ? e = [o.value[0], e] : e = [e, null])), Ve(e), x("dateSelect", e), setTimeout(() => Me.value = !1, 0);
334
+ }, Be = (e) => e ? Array.isArray(e) ? e.map((a) => a == null ? void 0 : a.getTime()) : e.getTime() : null, Ve = (e) => {
335
+ l.showButtons || l.showTime ? (N.value = e, _.value = !1) : (x("update:epochTimeMillis", Be(e)), x("update:modelValue", e));
340
336
  }, vt = () => {
341
- x("update:epochTimeMillis", Ve(N.value)), x("update:modelValue", N.value), _.value = !0, J();
342
- }, Pe = () => {
337
+ x("update:epochTimeMillis", Be(N.value)), x("update:modelValue", N.value), _.value = !0, J();
338
+ }, Ie = () => {
343
339
  N.value = l.modelValue, _.value = !0, J();
344
340
  }, ct = () => {
345
341
  !G(
@@ -347,13 +343,13 @@ const It = ["id"], Pt = ["id", "aria-invalid", "disabled", "placeholder", "value
347
343
  D.value,
348
344
  V.value,
349
345
  !y.value
350
- ) && (l.maxDate || l.minDate) || (y.value = !y.value, Be());
351
- }, pe = () => {
346
+ ) && (l.maxDate || l.minDate) || (y.value = !y.value, He());
347
+ }, fe = () => {
352
348
  h.value = O.value.getMonth(), i.value = O.value.getFullYear(), l.showTime && mt(O.value);
353
349
  }, mt = (e) => {
354
350
  let t = e.getHours();
355
351
  l.hourFormat === "12" && (y.value = t > 11, t >= 12 ? t = t == 12 ? 12 : t - 12 : t = t == 0 ? 12 : t), v.value = Math.floor(t / l.stepHour) * l.stepHour, D.value = Math.floor(e.getMinutes() / l.stepMinute) * l.stepMinute;
356
- }, Ae = () => {
352
+ }, Pe = () => {
357
353
  const e = l.showButtons || l.showTime ? N.value : o.value;
358
354
  if (typeof e == "string")
359
355
  return e;
@@ -382,13 +378,13 @@ const It = ["id"], Pt = ["id", "aria-invalid", "disabled", "placeholder", "value
382
378
  const n = (H) => {
383
379
  const T = a + 1 < t.length && t.charAt(a + 1) === H;
384
380
  return T && a++, T;
385
- }, r = (H, T, ge) => {
381
+ }, r = (H, T, pe) => {
386
382
  let j = "" + T;
387
383
  if (n(H))
388
- for (; j.length < ge; )
384
+ for (; j.length < pe; )
389
385
  j = "0" + j;
390
386
  return j;
391
- }, d = (H, T, ge, j) => n(H) ? j[T] : ge[T];
387
+ }, d = (H, T, pe, j) => n(H) ? j[T] : pe[T];
392
388
  let s = "", m = !1;
393
389
  if (e)
394
390
  for (a = 0; a < t.length; a++)
@@ -478,16 +474,16 @@ const It = ["id"], Pt = ["id", "aria-invalid", "disabled", "placeholder", "value
478
474
  !r && t.getTime() >= n.getTime() ? r = t : (n = t, r = null), a = [n, r];
479
475
  } else
480
476
  a = [t, null];
481
- a !== null && Ie(a), ht(a), x("dateSelect", t);
477
+ a !== null && Ve(a), ht(a), x("dateSelect", t);
482
478
  }, ht = (e) => {
483
479
  const t = l.exactSelection ? e.length > 1 : e && e[b(e)] !== null;
484
480
  C() && l.hideOnRangeSelection && !l.showButtons && !l.showTime && t && J();
485
481
  }, yt = (e, t) => {
486
- const a = ce.value;
487
- if (!ce.value || a.day === e.day)
488
- return ce.value = e, Te.value = ee.value, [t];
482
+ const a = ve.value;
483
+ if (!ve.value || a.day === e.day)
484
+ return ve.value = e, ke.value = ee.value, [t];
489
485
  const n = a.month === e.month ? ee.value.filter((r) => r.day > a.day && r.day < e.day).map((r) => new Date(r.year, r.month, r.day)) : [
490
- ...Te.value.filter((r) => !r.otherMonth && r.day > a.day).map((r) => new Date(r.year, r.month, r.day)),
486
+ ...ke.value.filter((r) => !r.otherMonth && r.day > a.day).map((r) => new Date(r.year, r.month, r.day)),
491
487
  ...ee.value.filter((r) => !r.otherMonth && r.day < e.day).map((r) => new Date(r.year, r.month, r.day))
492
488
  ];
493
489
  return [
@@ -501,7 +497,7 @@ const It = ["id"], Pt = ["id", "aria-invalid", "disabled", "placeholder", "value
501
497
  (e = Z.value) == null || e.hide();
502
498
  }, 150);
503
499
  };
504
- return he(
500
+ return ge(
505
501
  () => [
506
502
  l.minDate,
507
503
  l.maxDate,
@@ -510,38 +506,38 @@ const It = ["id"], Pt = ["id", "aria-invalid", "disabled", "placeholder", "value
510
506
  l.maxMonth
511
507
  ],
512
508
  () => R()
513
- ), he(
509
+ ), ge(
514
510
  () => o.value,
515
511
  () => {
516
- pe(), de.value = Ae();
512
+ fe(), ie.value = Pe();
517
513
  },
518
514
  {
519
515
  immediate: !0
520
516
  }
521
- ), (l.showButtons || l.showTime) && he(
517
+ ), (l.showButtons || l.showTime) && ge(
522
518
  N,
523
519
  () => {
524
- pe(), de.value = Ae();
520
+ fe(), ie.value = Pe();
525
521
  },
526
522
  {
527
523
  immediate: !0,
528
524
  deep: !0
529
525
  }
530
- ), (e, t) => (c(), ye(Ht, {
526
+ ), (e, t) => (c(), he(Ht, {
531
527
  ref_key: "wrapper",
532
- ref: ie,
528
+ ref: ue,
533
529
  info: e.fieldInfo,
534
530
  label: e.label,
535
531
  mandatory: e.mandatory,
536
532
  "show-optional-text": e.showOptionalText
537
533
  }, {
538
- default: we(() => [
539
- U(e.$slots, "default", { onClick: Ye }, () => [
534
+ default: ye(() => [
535
+ U(e.$slots, "default", { onClick: Fe }, () => [
540
536
  S(Bt, {
541
537
  disabled: e.disabled,
542
538
  invalid: Re.value
543
539
  }, {
544
- default: we(() => [
540
+ default: ye(() => [
545
541
  f("span", u(e.$preset.calendar.root({ props: l }), {
546
542
  id: e.id,
547
543
  "data-wv-name": "calendar",
@@ -550,13 +546,13 @@ const It = ["id"], Pt = ["id", "aria-invalid", "disabled", "placeholder", "value
550
546
  f("input", u({
551
547
  id: e.inputId,
552
548
  ref_key: "input",
553
- ref: De,
549
+ ref: we,
554
550
  "aria-invalid": e.invalid || void 0,
555
551
  disabled: e.disabled,
556
552
  placeholder: e.placeholder ?? q(Y).locale.defaultPlaceholder,
557
553
  tabindex: 0,
558
- value: de.value,
559
- onClick: Ye,
554
+ value: ie.value,
555
+ onClick: Fe,
560
556
  "aria-autocomplete": "none",
561
557
  autocomplete: "off",
562
558
  inputmode: "none",
@@ -583,7 +579,7 @@ const It = ["id"], Pt = ["id", "aria-invalid", "disabled", "placeholder", "value
583
579
  },
584
580
  onHide: ot
585
581
  }, {
586
- default: we(() => [
582
+ default: ye(() => [
587
583
  f("div", u(e.$preset.calendar.panel({ props: l }), { "data-wv-section": "panel" }), [
588
584
  f("div", u(e.$preset.calendar.container, { "data-wv-section": "container" }), [
589
585
  f("div", u(e.$preset.calendar.header({ props: l, state: { currentView: p.value } }), { "data-wv-section": "navigation" }), [
@@ -634,16 +630,16 @@ const It = ["id"], Pt = ["id", "aria-invalid", "disabled", "placeholder", "value
634
630
  "data-wv-today": a.today,
635
631
  "data-wv-section": "day"
636
632
  }, [
637
- Me.value && !a.otherMonth ? (c(), ye(q(Ct), {
633
+ be.value && !a.otherMonth ? (c(), he(q(Ct), {
638
634
  key: 0,
639
635
  class: "!w-8 !h-8",
640
636
  shape: "circle"
641
- })) : Me.value ? $("", !0) : (c(), g("span", u(
637
+ })) : be.value ? $("", !0) : (c(), g("span", u(
642
638
  {
643
639
  key: 1,
644
640
  "aria-disabled": !a.selectable,
645
641
  "data-p-disabled": a.otherMonth || !a.selectable,
646
- onClick: (r) => me(r, a),
642
+ onClick: (r) => ce(r, a),
647
643
  ref_for: !0
648
644
  },
649
645
  e.$preset.calendar.daylabel({
@@ -683,13 +679,13 @@ const It = ["id"], Pt = ["id", "aria-invalid", "disabled", "placeholder", "value
683
679
  context: {
684
680
  month: a,
685
681
  monthIndex: n,
686
- selected: $e(n),
682
+ selected: Se(n),
687
683
  disabled: !a.selectable
688
684
  }
689
685
  }),
690
686
  {
691
687
  "data-p-disabled": !a.selectable,
692
- "data-p-highlight": $e(n),
688
+ "data-p-highlight": Se(n),
693
689
  onClick: (r) => at(r, a)
694
690
  }
695
691
  ), F(e.$wangsvue.config.locale.global.monthNamesShort[a.value]), 17, Rt))), 128))
@@ -703,13 +699,13 @@ const It = ["id"], Pt = ["id", "aria-invalid", "disabled", "placeholder", "value
703
699
  e.$preset.calendar.year({
704
700
  context: {
705
701
  year: a,
706
- selected: Fe(a.value),
702
+ selected: $e(a.value),
707
703
  disabled: !a.selectable
708
704
  }
709
705
  }),
710
706
  {
711
707
  "data-p-disabled": !a.selectable,
712
- "data-p-highlight": Fe(a.value),
708
+ "data-p-highlight": $e(a.value),
713
709
  onClick: (n) => lt(n, a)
714
710
  }
715
711
  ), F(a.value), 17, jt))), 128))
@@ -838,7 +834,7 @@ const It = ["id"], Pt = ["id", "aria-invalid", "disabled", "placeholder", "value
838
834
  ])
839
835
  ], 16, Gt)
840
836
  ], 16),
841
- e.hourFormat === "12" ? (c(), ye(q(Yt), {
837
+ e.hourFormat === "12" ? (c(), he(q(Yt), {
842
838
  key: 0,
843
839
  "model-value": y.value,
844
840
  options: [
@@ -854,7 +850,7 @@ const It = ["id"], Pt = ["id", "aria-invalid", "disabled", "placeholder", "value
854
850
  e.showButtons || e.showTime ? Mt((c(), g("div", Jt, [
855
851
  S(se, {
856
852
  label: q(Y).locale.cancelFooterButtonLabel,
857
- onClick: Pe,
853
+ onClick: Ie,
858
854
  severity: "secondary",
859
855
  text: ""
860
856
  }, null, 8, ["label"]),
@@ -1,9 +1,9 @@
1
- import { defineComponent as C, onMounted as D, ref as v, computed as c, watch as u, watchEffect as x, createElementBlock as S, openBlock as f, createElementVNode as b, createBlock as F, toDisplayString as k, unref as y, mergeProps as I, withCtx as V, renderSlot as g, nextTick as E } from "vue";
2
- import { u as L } from "../vendor/vee-validate/dist/vee-validate.esm.es.js";
3
- import { u as N } from "../plugins/WangsVue.es.js";
4
- import { a as O } from "../utils/textFormatter.util.es.js";
5
- import { _ as U } from "../basecalendar/index.es.js";
6
- const H = /* @__PURE__ */ C({
1
+ import { defineComponent as T, onMounted as w, ref as p, computed as v, watch as n, watchEffect as C, createBlock as x, openBlock as D, mergeProps as b, unref as F, withCtx as f, renderSlot as c, nextTick as S } from "vue";
2
+ import { u as k } from "../vendor/vee-validate/dist/vee-validate.esm.es.js";
3
+ import { u as I } from "../plugins/WangsVue.es.js";
4
+ import { a as L } from "../utils/textFormatter.util.es.js";
5
+ import { _ as O } from "../basecalendar/index.es.js";
6
+ const N = /* @__PURE__ */ T({
7
7
  __name: "Calendar",
8
8
  props: {
9
9
  modelValue: {},
@@ -48,73 +48,70 @@ const H = /* @__PURE__ */ C({
48
48
  exactSelection: { type: Boolean }
49
49
  },
50
50
  emits: ["update:modelValue", "update:epochTimeMillis", "monthChange", "yearChange", "dateSelect"],
51
- setup(M, { emit: h }) {
52
- const e = M, d = h;
53
- D(() => {
54
- e.dateValue != null && (t.value = n(e.dateValue), o.value = t.value, r.value++), e.epochTimeMillis != null && (t.value = n(e.epochTimeMillis), o.value = t.value, r.value++);
51
+ setup(y, { emit: V }) {
52
+ const e = y, r = V;
53
+ w(() => {
54
+ e.dateValue != null && (t.value = d(e.dateValue), o.value = t.value, u.value++), e.epochTimeMillis != null && (t.value = d(e.epochTimeMillis), o.value = t.value, u.value++);
55
55
  });
56
- const { locale: B } = N("Calendar"), t = v(), r = v(0), { value: o, errorMessage: s } = e.useValidator ? L(e.fieldName ?? "date", (a) => w(a)) : {
57
- value: c({
56
+ const { locale: M } = I("Calendar"), t = p(), u = p(0), { value: o, errorMessage: g } = e.useValidator ? k(e.fieldName ?? "date", (a) => B(a)) : {
57
+ value: v({
58
58
  get: () => e.modelValue,
59
59
  set: (a) => {
60
- d("update:modelValue", a);
60
+ r("update:modelValue", a);
61
61
  }
62
62
  })
63
- }, T = c(
63
+ }, h = v(
64
64
  () => e.invalid || "errorMessage" in o && !!o.errorMessage
65
- ), w = async (a) => {
65
+ ), B = async (a) => {
66
66
  var l, i;
67
- return await E(), console.log("🚀 ~ props.validatorMessage:", e.validatorMessage), console.log("🚀 ~ value:", a), typeof e.validatorMessage == "string" && e.invalid ? e.validatorMessage : typeof e.validatorMessage != "string" && !a && e.mandatory ? ((l = e.validatorMessage) == null ? void 0 : l.empty) ?? m() : !a && e.mandatory ? ((i = e.customValidation) == null ? void 0 : i.empty) ?? m() : !0;
68
- }, m = () => {
67
+ return await S(), typeof e.validatorMessage == "string" && e.invalid ? e.validatorMessage : typeof e.validatorMessage != "string" && !a && e.mandatory ? ((l = e.validatorMessage) == null ? void 0 : l.empty) ?? s() : !a && e.mandatory ? ((i = e.customValidation) == null ? void 0 : i.empty) ?? s() : !0;
68
+ }, s = () => {
69
69
  var a;
70
- return B.emptyInvalidText.replace("{label}", e.label).replace(
70
+ return M.emptyInvalidText.replace("{label}", e.label).replace(
71
71
  "{formattedLabel}",
72
- (a = O(e.label)) == null ? void 0 : a.toLowerCase()
72
+ (a = L(e.label)) == null ? void 0 : a.toLowerCase()
73
73
  );
74
- }, p = (a, l) => {
75
- (a === e.valueFormat && e.useValidator || !e.useValidator && a === "date") && (o.value = l), a === "date" && e.useValidator && d("update:modelValue", l), a === "millis" && d("update:epochTimeMillis", l);
76
- }, n = (a) => Array.isArray(a) ? a.map((l) => l == null ? null : new Date(l)) : new Date(a);
77
- return u(
74
+ }, m = (a, l) => {
75
+ (a === e.valueFormat && e.useValidator || !e.useValidator && a === "date") && (o.value = l), a === "date" && e.useValidator && r("update:modelValue", l), a === "millis" && r("update:epochTimeMillis", l);
76
+ }, d = (a) => Array.isArray(a) ? a.map((l) => l == null ? null : new Date(l)) : new Date(a);
77
+ return n(
78
78
  () => e.dateValue,
79
79
  () => {
80
- t.value = n(e.dateValue), e.useValidator && (o.value = t.value), r.value++;
80
+ t.value = d(e.dateValue), e.useValidator && (o.value = t.value), u.value++;
81
81
  },
82
82
  {
83
83
  once: !0
84
84
  }
85
- ), u(
85
+ ), n(
86
86
  () => e.epochTimeMillis,
87
87
  () => {
88
- t.value = n(e.epochTimeMillis), e.useValidator && (o.value = t.value), r.value++;
88
+ t.value = d(e.epochTimeMillis), e.useValidator && (o.value = t.value), u.value++;
89
89
  }
90
- ), u(
90
+ ), n(
91
91
  () => e.modelValue,
92
92
  () => {
93
93
  t.value = e.modelValue, e.useValidator && (o.value = t.value);
94
94
  }
95
- ), x(() => {
96
- t.value = e.valueFormat === "date" ? o.value : o.value ? n(o.value) : o.value;
97
- }), (a, l) => (f(), S("div", null, [
98
- b("pre", null, k(y(s)), 1),
99
- (f(), F(U, I({ key: r.value }, e, {
100
- "error-message": y(s),
101
- invalid: T.value,
102
- "model-value": t.value,
103
- "selection-mode": a.selectionMode || a.mode,
104
- "onUpdate:epochTimeMillis": l[0] || (l[0] = (i) => p("millis", i)),
105
- "onUpdate:modelValue": l[1] || (l[1] = (i) => p("date", i))
106
- }), {
107
- default: V(({ onClick: i }) => [
108
- g(a.$slots, "default", { onClick: i })
109
- ]),
110
- "addon-overlay": V(() => [
111
- g(a.$slots, "addon-overlay")
112
- ]),
113
- _: 3
114
- }, 16, ["error-message", "invalid", "model-value", "selection-mode"]))
115
- ]));
95
+ ), C(() => {
96
+ t.value = e.valueFormat === "date" ? o.value : o.value ? d(o.value) : o.value;
97
+ }), (a, l) => (D(), x(O, b({ key: u.value }, e, {
98
+ "error-message": F(g),
99
+ invalid: h.value,
100
+ "model-value": t.value,
101
+ "selection-mode": a.selectionMode || a.mode,
102
+ "onUpdate:epochTimeMillis": l[0] || (l[0] = (i) => m("millis", i)),
103
+ "onUpdate:modelValue": l[1] || (l[1] = (i) => m("date", i))
104
+ }), {
105
+ default: f(({ onClick: i }) => [
106
+ c(a.$slots, "default", { onClick: i })
107
+ ]),
108
+ "addon-overlay": f(() => [
109
+ c(a.$slots, "addon-overlay")
110
+ ]),
111
+ _: 3
112
+ }, 16, ["error-message", "invalid", "model-value", "selection-mode"]));
116
113
  }
117
114
  });
118
115
  export {
119
- H as _
116
+ N as _
120
117
  };
@@ -988,7 +988,7 @@ const zt = (W, $) => W.every((t) => $.includes(t)), jt = ["id"], Vt = ["onClick"
988
988
  ], 16);
989
989
  };
990
990
  }
991
- }), Fl = /* @__PURE__ */ Lt(sl, [["__scopeId", "data-v-015be0a0"]]);
991
+ }), Fl = /* @__PURE__ */ Lt(sl, [["__scopeId", "data-v-37d9df20"]]);
992
992
  export {
993
993
  Fl as D
994
994
  };
@@ -231,8 +231,8 @@ const H = /* @__PURE__ */ nA(vA), j = "data:image/png;base64,iVBORw0KGgoAAAANSUh
231
231
  t[4] || (t[4] = e("span", null, "Preview", -1)),
232
232
  a(eA, {
233
233
  icon: "info",
234
- info: `This preview is only for showing the side of the\r
235
- label that printed or not. It does not show the\r
234
+ info: `This preview is only for showing the side of the
235
+ label that printed or not. It does not show the
236
236
  exact amount you entered.`,
237
237
  severity: "primary"
238
238
  })