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

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
- }), b = /* @__PURE__ */ I(R, [["__scopeId", "data-v-5cd98b2d"]]);
53
+ }), S = /* @__PURE__ */ I(R, [["__scopeId", "data-v-9031c32d"]]);
54
54
  export {
55
- b as B,
55
+ S 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 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";
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";
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(Ae, { emit: xe }) {
71
- const l = Ae, x = xe;
70
+ setup(xe, { emit: Ne }) {
71
+ const l = xe, x = Ne;
72
72
  Dt(() => {
73
73
  R();
74
74
  });
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(() => {
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(() => {
76
76
  const e = [], t = (a) => {
77
77
  if (l.minDate) {
78
78
  const n = l.minDate.getMonth(), r = l.minDate.getFullYear();
@@ -119,7 +119,11 @@ 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(() => l.invalid || !!Ne["error-message"]), b = (e) => e.length > 2 ? e.length - 1 : 1, je = () => {
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 = () => {
123
127
  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 = [];
124
128
  let s = 1 - n;
125
129
  for (; s <= a; ) {
@@ -150,10 +154,10 @@ const It = ["id"], Pt = ["id", "aria-invalid", "disabled", "placeholder", "value
150
154
  h.value === 0 ? (i.value--, h.value = 11) : h.value--, R();
151
155
  }, qe = () => {
152
156
  i.value--;
153
- }, Te = () => {
157
+ }, Se = () => {
154
158
  i.value++;
155
159
  }, ze = () => {
156
- h.value === 11 ? (Te(), h.value = 0) : h.value++, R();
160
+ h.value === 11 ? (Se(), h.value = 0) : h.value++, R();
157
161
  }, Ge = () => {
158
162
  i.value -= 10;
159
163
  }, Je = () => {
@@ -161,9 +165,9 @@ const It = ["id"], Pt = ["id", "aria-invalid", "disabled", "placeholder", "value
161
165
  }, Qe = () => {
162
166
  p.value === "date" ? Ue() : p.value === "month" ? qe() : Ge();
163
167
  }, Xe = () => {
164
- p.value === "date" ? ze() : p.value === "month" ? Te() : Je();
168
+ p.value === "date" ? ze() : p.value === "month" ? Se() : Je();
165
169
  }, R = () => {
166
- De.value = je();
170
+ be.value = je();
167
171
  }, 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) => {
168
172
  if (e && t) {
169
173
  const r = new Date(a.year, a.month, a.day);
@@ -194,7 +198,7 @@ const It = ["id"], Pt = ["id", "aria-invalid", "disabled", "placeholder", "value
194
198
  }, _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(
195
199
  o.value[b(o.value)],
196
200
  e
197
- ) || o.value[b(o.value)] == null) : !1, Se = (e) => {
201
+ ) || o.value[b(o.value)] == null) : !1, $e = (e) => {
198
202
  if (E()) {
199
203
  if (K(o.value))
200
204
  return o.value.getMonth() === e && o.value.getFullYear() === i.value;
@@ -211,7 +215,7 @@ const It = ["id"], Pt = ["id", "aria-invalid", "disabled", "placeholder", "value
211
215
  }
212
216
  }
213
217
  return !1;
214
- }, $e = (e) => {
218
+ }, Fe = (e) => {
215
219
  var t;
216
220
  if (E()) {
217
221
  if (K(o.value))
@@ -235,10 +239,10 @@ const It = ["id"], Pt = ["id", "aria-invalid", "disabled", "placeholder", "value
235
239
  return l.excludeDates && (s = !l.excludeDates.some(
236
240
  (m) => m.getFullYear() === a && m.getMonth() === t && m.getDate() === e
237
241
  )), 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;
238
- }, ce = (e, t) => {
242
+ }, me = (e, t) => {
239
243
  e.currentTarget instanceof HTMLElement && e.currentTarget.focus(), t.selectable && gt(t), l.selectionMode === "single" && (!l.showTime || l.hideOnDateTimeSelect) && J();
240
244
  }, at = (e, t) => {
241
- t.selectable && (l.view === "month" ? ce(e, {
245
+ t.selectable && (l.view === "month" ? me(e, {
242
246
  year: i.value,
243
247
  month: t.value,
244
248
  day: 1,
@@ -250,7 +254,7 @@ const It = ["id"], Pt = ["id", "aria-invalid", "disabled", "placeholder", "value
250
254
  year: i.value
251
255
  })), R());
252
256
  }, lt = (e, t) => {
253
- t.selectable && (l.view === "year" ? ce(e, {
257
+ t.selectable && (l.view === "year" ? me(e, {
254
258
  year: t.value,
255
259
  month: 0,
256
260
  day: 1,
@@ -262,11 +266,11 @@ const It = ["id"], Pt = ["id", "aria-invalid", "disabled", "placeholder", "value
262
266
  year: i.value
263
267
  })), R());
264
268
  }, M = (e, t, a) => {
265
- !l.disabled && !l.readonly && (Ce(e, null, t, a), e.preventDefault());
269
+ !l.disabled && !l.readonly && (He(e, null, t, a), e.preventDefault());
266
270
  }, k = (e) => {
267
- !l.disabled && !l.readonly && (me(), He(), e.preventDefault());
271
+ !l.disabled && !l.readonly && (fe(), Be(), e.preventDefault());
268
272
  }, le = () => {
269
- me();
273
+ fe();
270
274
  }, ne = (e) => {
271
275
  switch (e.code) {
272
276
  case "Tab":
@@ -275,20 +279,20 @@ const It = ["id"], Pt = ["id", "aria-invalid", "disabled", "placeholder", "value
275
279
  J(), e.preventDefault();
276
280
  break;
277
281
  }
278
- }, Fe = (e) => {
282
+ }, Ye = (e) => {
279
283
  l.disabled || setTimeout(() => {
280
- Z.value.show(e, Ye(e));
284
+ Z.value.show(e, Ce(e));
281
285
  }, 0);
282
286
  }, nt = (e) => {
283
287
  l.disabled || setTimeout(() => {
284
288
  var t;
285
- (t = Z.value) == null || t.toggle(e, Ye(e));
289
+ (t = Z.value) == null || t.toggle(e, Ce(e));
286
290
  }, 0);
287
291
  }, ot = () => {
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);
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);
292
296
  }, t), a) {
293
297
  case 0:
294
298
  n === 1 ? rt(e) : st(e);
@@ -310,8 +314,8 @@ const It = ["id"], Pt = ["id", "aria-invalid", "disabled", "placeholder", "value
310
314
  }, it = (e) => {
311
315
  let t = D.value - l.stepMinute;
312
316
  t = t < 0 ? 60 + t : t, G(v.value, t, V.value, y.value) && (D.value = t), e.preventDefault();
313
- }, me = () => {
314
- de.value && clearInterval(de.value);
317
+ }, fe = () => {
318
+ ve.value && clearInterval(ve.value);
315
319
  }, G = (e, t, a, n) => {
316
320
  let r;
317
321
  const d = dt(e, n);
@@ -322,20 +326,20 @@ const It = ["id"], Pt = ["id", "aria-invalid", "disabled", "placeholder", "value
322
326
  r = E() ? o.value : O.value;
323
327
  const s = r ? r.toDateString() : null;
324
328
  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)));
325
- }, dt = (e, t) => l.hourFormat == "12" ? e === 12 ? t ? 12 : 0 : t ? e + 12 : e : e, He = () => {
326
- Me.value = !0;
329
+ }, dt = (e, t) => l.hourFormat == "12" ? e === 12 ? t ? 12 : 0 : t ? e + 12 : e : e, Be = () => {
330
+ ke.value = !0;
327
331
  let e;
328
332
  if (ae(o.value)) {
329
333
  const t = E() ? o.value : O.value;
330
334
  e = t[b(t)] || t[0];
331
335
  } else
332
336
  e = E() ? o.value : O.value;
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));
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));
336
340
  }, vt = () => {
337
- x("update:epochTimeMillis", Be(N.value)), x("update:modelValue", N.value), _.value = !0, J();
338
- }, Ie = () => {
341
+ x("update:epochTimeMillis", Ve(N.value)), x("update:modelValue", N.value), _.value = !0, J();
342
+ }, Pe = () => {
339
343
  N.value = l.modelValue, _.value = !0, J();
340
344
  }, ct = () => {
341
345
  !G(
@@ -343,13 +347,13 @@ const It = ["id"], Pt = ["id", "aria-invalid", "disabled", "placeholder", "value
343
347
  D.value,
344
348
  V.value,
345
349
  !y.value
346
- ) && (l.maxDate || l.minDate) || (y.value = !y.value, He());
347
- }, fe = () => {
350
+ ) && (l.maxDate || l.minDate) || (y.value = !y.value, Be());
351
+ }, pe = () => {
348
352
  h.value = O.value.getMonth(), i.value = O.value.getFullYear(), l.showTime && mt(O.value);
349
353
  }, mt = (e) => {
350
354
  let t = e.getHours();
351
355
  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;
352
- }, Pe = () => {
356
+ }, Ae = () => {
353
357
  const e = l.showButtons || l.showTime ? N.value : o.value;
354
358
  if (typeof e == "string")
355
359
  return e;
@@ -378,13 +382,13 @@ const It = ["id"], Pt = ["id", "aria-invalid", "disabled", "placeholder", "value
378
382
  const n = (H) => {
379
383
  const T = a + 1 < t.length && t.charAt(a + 1) === H;
380
384
  return T && a++, T;
381
- }, r = (H, T, pe) => {
385
+ }, r = (H, T, ge) => {
382
386
  let j = "" + T;
383
387
  if (n(H))
384
- for (; j.length < pe; )
388
+ for (; j.length < ge; )
385
389
  j = "0" + j;
386
390
  return j;
387
- }, d = (H, T, pe, j) => n(H) ? j[T] : pe[T];
391
+ }, d = (H, T, ge, j) => n(H) ? j[T] : ge[T];
388
392
  let s = "", m = !1;
389
393
  if (e)
390
394
  for (a = 0; a < t.length; a++)
@@ -474,16 +478,16 @@ const It = ["id"], Pt = ["id", "aria-invalid", "disabled", "placeholder", "value
474
478
  !r && t.getTime() >= n.getTime() ? r = t : (n = t, r = null), a = [n, r];
475
479
  } else
476
480
  a = [t, null];
477
- a !== null && Ve(a), ht(a), x("dateSelect", t);
481
+ a !== null && Ie(a), ht(a), x("dateSelect", t);
478
482
  }, ht = (e) => {
479
483
  const t = l.exactSelection ? e.length > 1 : e && e[b(e)] !== null;
480
484
  C() && l.hideOnRangeSelection && !l.showButtons && !l.showTime && t && J();
481
485
  }, yt = (e, t) => {
482
- const a = ve.value;
483
- if (!ve.value || a.day === e.day)
484
- return ve.value = e, ke.value = ee.value, [t];
486
+ const a = ce.value;
487
+ if (!ce.value || a.day === e.day)
488
+ return ce.value = e, Te.value = ee.value, [t];
485
489
  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)) : [
486
- ...ke.value.filter((r) => !r.otherMonth && r.day > a.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)),
487
491
  ...ee.value.filter((r) => !r.otherMonth && r.day < e.day).map((r) => new Date(r.year, r.month, r.day))
488
492
  ];
489
493
  return [
@@ -497,7 +501,7 @@ const It = ["id"], Pt = ["id", "aria-invalid", "disabled", "placeholder", "value
497
501
  (e = Z.value) == null || e.hide();
498
502
  }, 150);
499
503
  };
500
- return ge(
504
+ return he(
501
505
  () => [
502
506
  l.minDate,
503
507
  l.maxDate,
@@ -506,38 +510,38 @@ const It = ["id"], Pt = ["id", "aria-invalid", "disabled", "placeholder", "value
506
510
  l.maxMonth
507
511
  ],
508
512
  () => R()
509
- ), ge(
513
+ ), he(
510
514
  () => o.value,
511
515
  () => {
512
- fe(), ie.value = Pe();
516
+ pe(), de.value = Ae();
513
517
  },
514
518
  {
515
519
  immediate: !0
516
520
  }
517
- ), (l.showButtons || l.showTime) && ge(
521
+ ), (l.showButtons || l.showTime) && he(
518
522
  N,
519
523
  () => {
520
- fe(), ie.value = Pe();
524
+ pe(), de.value = Ae();
521
525
  },
522
526
  {
523
527
  immediate: !0,
524
528
  deep: !0
525
529
  }
526
- ), (e, t) => (c(), he(Ht, {
530
+ ), (e, t) => (c(), ye(Ht, {
527
531
  ref_key: "wrapper",
528
- ref: ue,
532
+ ref: ie,
529
533
  info: e.fieldInfo,
530
534
  label: e.label,
531
535
  mandatory: e.mandatory,
532
536
  "show-optional-text": e.showOptionalText
533
537
  }, {
534
- default: ye(() => [
535
- U(e.$slots, "default", { onClick: Fe }, () => [
538
+ default: we(() => [
539
+ U(e.$slots, "default", { onClick: Ye }, () => [
536
540
  S(Bt, {
537
541
  disabled: e.disabled,
538
542
  invalid: Re.value
539
543
  }, {
540
- default: ye(() => [
544
+ default: we(() => [
541
545
  f("span", u(e.$preset.calendar.root({ props: l }), {
542
546
  id: e.id,
543
547
  "data-wv-name": "calendar",
@@ -546,13 +550,13 @@ const It = ["id"], Pt = ["id", "aria-invalid", "disabled", "placeholder", "value
546
550
  f("input", u({
547
551
  id: e.inputId,
548
552
  ref_key: "input",
549
- ref: we,
553
+ ref: De,
550
554
  "aria-invalid": e.invalid || void 0,
551
555
  disabled: e.disabled,
552
556
  placeholder: e.placeholder ?? q(Y).locale.defaultPlaceholder,
553
557
  tabindex: 0,
554
- value: ie.value,
555
- onClick: Fe,
558
+ value: de.value,
559
+ onClick: Ye,
556
560
  "aria-autocomplete": "none",
557
561
  autocomplete: "off",
558
562
  inputmode: "none",
@@ -579,7 +583,7 @@ const It = ["id"], Pt = ["id", "aria-invalid", "disabled", "placeholder", "value
579
583
  },
580
584
  onHide: ot
581
585
  }, {
582
- default: ye(() => [
586
+ default: we(() => [
583
587
  f("div", u(e.$preset.calendar.panel({ props: l }), { "data-wv-section": "panel" }), [
584
588
  f("div", u(e.$preset.calendar.container, { "data-wv-section": "container" }), [
585
589
  f("div", u(e.$preset.calendar.header({ props: l, state: { currentView: p.value } }), { "data-wv-section": "navigation" }), [
@@ -630,16 +634,16 @@ const It = ["id"], Pt = ["id", "aria-invalid", "disabled", "placeholder", "value
630
634
  "data-wv-today": a.today,
631
635
  "data-wv-section": "day"
632
636
  }, [
633
- be.value && !a.otherMonth ? (c(), he(q(Ct), {
637
+ Me.value && !a.otherMonth ? (c(), ye(q(Ct), {
634
638
  key: 0,
635
639
  class: "!w-8 !h-8",
636
640
  shape: "circle"
637
- })) : be.value ? $("", !0) : (c(), g("span", u(
641
+ })) : Me.value ? $("", !0) : (c(), g("span", u(
638
642
  {
639
643
  key: 1,
640
644
  "aria-disabled": !a.selectable,
641
645
  "data-p-disabled": a.otherMonth || !a.selectable,
642
- onClick: (r) => ce(r, a),
646
+ onClick: (r) => me(r, a),
643
647
  ref_for: !0
644
648
  },
645
649
  e.$preset.calendar.daylabel({
@@ -679,13 +683,13 @@ const It = ["id"], Pt = ["id", "aria-invalid", "disabled", "placeholder", "value
679
683
  context: {
680
684
  month: a,
681
685
  monthIndex: n,
682
- selected: Se(n),
686
+ selected: $e(n),
683
687
  disabled: !a.selectable
684
688
  }
685
689
  }),
686
690
  {
687
691
  "data-p-disabled": !a.selectable,
688
- "data-p-highlight": Se(n),
692
+ "data-p-highlight": $e(n),
689
693
  onClick: (r) => at(r, a)
690
694
  }
691
695
  ), F(e.$wangsvue.config.locale.global.monthNamesShort[a.value]), 17, Rt))), 128))
@@ -699,13 +703,13 @@ const It = ["id"], Pt = ["id", "aria-invalid", "disabled", "placeholder", "value
699
703
  e.$preset.calendar.year({
700
704
  context: {
701
705
  year: a,
702
- selected: $e(a.value),
706
+ selected: Fe(a.value),
703
707
  disabled: !a.selectable
704
708
  }
705
709
  }),
706
710
  {
707
711
  "data-p-disabled": !a.selectable,
708
- "data-p-highlight": $e(a.value),
712
+ "data-p-highlight": Fe(a.value),
709
713
  onClick: (n) => lt(n, a)
710
714
  }
711
715
  ), F(a.value), 17, jt))), 128))
@@ -834,7 +838,7 @@ const It = ["id"], Pt = ["id", "aria-invalid", "disabled", "placeholder", "value
834
838
  ])
835
839
  ], 16, Gt)
836
840
  ], 16),
837
- e.hourFormat === "12" ? (c(), he(q(Yt), {
841
+ e.hourFormat === "12" ? (c(), ye(q(Yt), {
838
842
  key: 0,
839
843
  "model-value": y.value,
840
844
  options: [
@@ -850,7 +854,7 @@ const It = ["id"], Pt = ["id", "aria-invalid", "disabled", "placeholder", "value
850
854
  e.showButtons || e.showTime ? Mt((c(), g("div", Jt, [
851
855
  S(se, {
852
856
  label: q(Y).locale.cancelFooterButtonLabel,
853
- onClick: Ie,
857
+ onClick: Pe,
854
858
  severity: "secondary",
855
859
  text: ""
856
860
  }, null, 8, ["label"]),
@@ -1,9 +1,9 @@
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({
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({
7
7
  __name: "Calendar",
8
8
  props: {
9
9
  modelValue: {},
@@ -48,70 +48,73 @@ const N = /* @__PURE__ */ T({
48
48
  exactSelection: { type: Boolean }
49
49
  },
50
50
  emits: ["update:modelValue", "update:epochTimeMillis", "monthChange", "yearChange", "dateSelect"],
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++);
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++);
55
55
  });
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({
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({
58
58
  get: () => e.modelValue,
59
59
  set: (a) => {
60
- r("update:modelValue", a);
60
+ d("update:modelValue", a);
61
61
  }
62
62
  })
63
- }, h = v(
63
+ }, T = c(
64
64
  () => e.invalid || "errorMessage" in o && !!o.errorMessage
65
- ), B = async (a) => {
65
+ ), w = async (a) => {
66
66
  var l, i;
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 = () => {
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 = () => {
69
69
  var a;
70
- return M.emptyInvalidText.replace("{label}", e.label).replace(
70
+ return B.emptyInvalidText.replace("{label}", e.label).replace(
71
71
  "{formattedLabel}",
72
- (a = L(e.label)) == null ? void 0 : a.toLowerCase()
72
+ (a = O(e.label)) == null ? void 0 : a.toLowerCase()
73
73
  );
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(
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(
78
78
  () => e.dateValue,
79
79
  () => {
80
- t.value = d(e.dateValue), e.useValidator && (o.value = t.value), u.value++;
80
+ t.value = n(e.dateValue), e.useValidator && (o.value = t.value), r.value++;
81
81
  },
82
82
  {
83
83
  once: !0
84
84
  }
85
- ), n(
85
+ ), u(
86
86
  () => e.epochTimeMillis,
87
87
  () => {
88
- t.value = d(e.epochTimeMillis), e.useValidator && (o.value = t.value), u.value++;
88
+ t.value = n(e.epochTimeMillis), e.useValidator && (o.value = t.value), r.value++;
89
89
  }
90
- ), n(
90
+ ), u(
91
91
  () => e.modelValue,
92
92
  () => {
93
93
  t.value = e.modelValue, e.useValidator && (o.value = t.value);
94
94
  }
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"]));
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
+ ]));
113
116
  }
114
117
  });
115
118
  export {
116
- N as _
119
+ H as _
117
120
  };
@@ -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-37d9df20"]]);
991
+ }), Fl = /* @__PURE__ */ Lt(sl, [["__scopeId", "data-v-015be0a0"]]);
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
235
- label that printed or not. It does not show the
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
236
236
  exact amount you entered.`,
237
237
  severity: "primary"
238
238
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fewangsit/wangsvue-fats",
3
- "version": "1.0.1-alpha.29",
3
+ "version": "1.0.1-alpha.30",
4
4
  "author": "Wangsit FE Developer",
5
5
  "description": "Fixed Asset Tagsamurai VueJS Component Library",
6
6
  "type": "module",