@fewangsit/wangsvue-fats 1.0.1-alpha.45 → 1.0.1-alpha.46
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.
- package/calendar/index.es.js +47 -42
- package/package.json +1 -1
- package/stats.html +1 -1
- package/wangsvue-fats.esm.browser.js +2044 -2039
- package/wangsvue-fats.system.js +43 -43
package/calendar/index.es.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { u as
|
|
3
|
-
import { u as
|
|
4
|
-
import { a as
|
|
5
|
-
import { _ as
|
|
6
|
-
const
|
|
1
|
+
import { defineComponent as C, onMounted as F, ref as f, computed as d, watch as s, watchEffect as S, createBlock as x, openBlock as D, mergeProps as b, unref as I, withCtx as c, renderSlot as y, nextTick as k } from "vue";
|
|
2
|
+
import { u as L } from "../vendor/vee-validate/dist/vee-validate.esm.es.js";
|
|
3
|
+
import { u as O } from "../plugins/WangsVue.es.js";
|
|
4
|
+
import { a as N } from "../utils/textFormatter.util.es.js";
|
|
5
|
+
import { _ as U } from "../basecalendar/index.es.js";
|
|
6
|
+
const Y = /* @__PURE__ */ C({
|
|
7
7
|
__name: "Calendar",
|
|
8
8
|
props: {
|
|
9
9
|
modelValue: {},
|
|
@@ -33,7 +33,7 @@ const N = /* @__PURE__ */ T({
|
|
|
33
33
|
validatorMessage: {},
|
|
34
34
|
customValidation: {},
|
|
35
35
|
dateFormat: { default: "dd/mm/yy" },
|
|
36
|
-
hourFormat: {
|
|
36
|
+
hourFormat: {},
|
|
37
37
|
showTime: { type: Boolean },
|
|
38
38
|
timeSeparator: { default: ":" },
|
|
39
39
|
stepHour: { default: 1 },
|
|
@@ -48,70 +48,75 @@ const N = /* @__PURE__ */ T({
|
|
|
48
48
|
exactSelection: { type: Boolean }
|
|
49
49
|
},
|
|
50
50
|
emits: ["update:modelValue", "update:epochTimeMillis", "monthChange", "yearChange", "dateSelect"],
|
|
51
|
-
setup(
|
|
52
|
-
const e =
|
|
53
|
-
|
|
54
|
-
e.dateValue != null && (t.value =
|
|
51
|
+
setup(V, { emit: g }) {
|
|
52
|
+
const e = V, n = g;
|
|
53
|
+
F(() => {
|
|
54
|
+
e.dateValue != null && (t.value = u(e.dateValue), o.value = t.value, i.value++), e.epochTimeMillis != null && (t.value = u(e.epochTimeMillis), o.value = t.value, i.value++);
|
|
55
55
|
});
|
|
56
|
-
const { locale:
|
|
57
|
-
value:
|
|
56
|
+
const { locale: h } = O("Calendar"), t = f(), i = f(0), { value: o, errorMessage: M } = e.useValidator ? L(e.fieldName ?? "date", (a) => w(a)) : {
|
|
57
|
+
value: d({
|
|
58
58
|
get: () => e.modelValue,
|
|
59
59
|
set: (a) => {
|
|
60
|
-
|
|
60
|
+
n("update:modelValue", a);
|
|
61
61
|
}
|
|
62
62
|
})
|
|
63
|
-
},
|
|
63
|
+
}, B = d(
|
|
64
64
|
() => e.invalid || "errorMessage" in o && !!o.errorMessage
|
|
65
|
-
),
|
|
66
|
-
var
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
), T = d(() => {
|
|
66
|
+
var r, v;
|
|
67
|
+
const a = JSON.parse(localStorage.getItem("user") || "{}"), l = (r = a == null ? void 0 : a.generalSetting) == null ? void 0 : r.timeFormat;
|
|
68
|
+
return e.hourFormat ? e.hourFormat : (v = l == null ? void 0 : l.toLowerCase()) != null && v.includes("pm") ? "12" : "24";
|
|
69
|
+
}), w = async (a) => {
|
|
70
|
+
var l, r;
|
|
71
|
+
return await k(), 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 ? ((r = e.customValidation) == null ? void 0 : r.empty) ?? m() : !0;
|
|
72
|
+
}, m = () => {
|
|
69
73
|
var a;
|
|
70
|
-
return
|
|
74
|
+
return h.emptyInvalidText.replace("{label}", e.label).replace(
|
|
71
75
|
"{formattedLabel}",
|
|
72
|
-
(a =
|
|
76
|
+
(a = N(e.label)) == null ? void 0 : a.toLowerCase()
|
|
73
77
|
);
|
|
74
|
-
},
|
|
75
|
-
(a === e.valueFormat && e.useValidator || !e.useValidator && a === "date") && (o.value = l), a === "date" && e.useValidator &&
|
|
76
|
-
},
|
|
77
|
-
return
|
|
78
|
+
}, p = (a, l) => {
|
|
79
|
+
(a === e.valueFormat && e.useValidator || !e.useValidator && a === "date") && (o.value = l), a === "date" && e.useValidator && n("update:modelValue", l), a === "millis" && n("update:epochTimeMillis", l);
|
|
80
|
+
}, u = (a) => Array.isArray(a) ? a.map((l) => l == null ? null : new Date(l)) : new Date(a);
|
|
81
|
+
return s(
|
|
78
82
|
() => e.dateValue,
|
|
79
83
|
() => {
|
|
80
|
-
t.value =
|
|
84
|
+
t.value = u(e.dateValue), e.useValidator && (o.value = t.value), i.value++;
|
|
81
85
|
},
|
|
82
86
|
{
|
|
83
87
|
once: !0
|
|
84
88
|
}
|
|
85
|
-
),
|
|
89
|
+
), s(
|
|
86
90
|
() => e.epochTimeMillis,
|
|
87
91
|
() => {
|
|
88
|
-
t.value =
|
|
92
|
+
t.value = u(e.epochTimeMillis), e.useValidator && (o.value = t.value), i.value++;
|
|
89
93
|
}
|
|
90
|
-
),
|
|
94
|
+
), s(
|
|
91
95
|
() => e.modelValue,
|
|
92
96
|
() => {
|
|
93
97
|
t.value = e.modelValue, e.useValidator && (o.value = t.value);
|
|
94
98
|
}
|
|
95
|
-
),
|
|
96
|
-
t.value = e.valueFormat === "date" ? o.value : o.value ?
|
|
97
|
-
}), (a, l) => (D(), x(
|
|
98
|
-
"error-message":
|
|
99
|
-
|
|
99
|
+
), S(() => {
|
|
100
|
+
t.value = e.valueFormat === "date" ? o.value : o.value ? u(o.value) : o.value;
|
|
101
|
+
}), (a, l) => (D(), x(U, b({ key: i.value }, e, {
|
|
102
|
+
"error-message": I(M),
|
|
103
|
+
"hour-format": T.value,
|
|
104
|
+
invalid: B.value,
|
|
100
105
|
"model-value": t.value,
|
|
101
106
|
"selection-mode": a.selectionMode || a.mode,
|
|
102
|
-
"onUpdate:epochTimeMillis": l[0] || (l[0] = (
|
|
103
|
-
"onUpdate:modelValue": l[1] || (l[1] = (
|
|
107
|
+
"onUpdate:epochTimeMillis": l[0] || (l[0] = (r) => p("millis", r)),
|
|
108
|
+
"onUpdate:modelValue": l[1] || (l[1] = (r) => p("date", r))
|
|
104
109
|
}), {
|
|
105
|
-
default:
|
|
106
|
-
|
|
110
|
+
default: c(({ onClick: r }) => [
|
|
111
|
+
y(a.$slots, "default", { onClick: r })
|
|
107
112
|
]),
|
|
108
|
-
"addon-overlay":
|
|
109
|
-
|
|
113
|
+
"addon-overlay": c(() => [
|
|
114
|
+
y(a.$slots, "addon-overlay")
|
|
110
115
|
]),
|
|
111
116
|
_: 3
|
|
112
|
-
}, 16, ["error-message", "invalid", "model-value", "selection-mode"]));
|
|
117
|
+
}, 16, ["error-message", "hour-format", "invalid", "model-value", "selection-mode"]));
|
|
113
118
|
}
|
|
114
119
|
});
|
|
115
120
|
export {
|
|
116
|
-
|
|
121
|
+
Y as _
|
|
117
122
|
};
|