@fewangsit/wangsvue-fats 1.0.1-alpha.53 → 1.0.1-alpha.55
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/assetinfo/index.es.js +82 -81
- package/basecalendartimezone/index.es.js +992 -0
- package/calendar/index.es.js +62 -42
- package/filtercontainer/index.d.ts +6 -1
- package/icon/index.d.ts +1 -0
- package/package.json +1 -1
- package/stats.html +1 -1
- package/wangsvue-fats.esm.browser.js +14678 -13682
- package/wangsvue-fats.system.js +70 -70
package/calendar/index.es.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as I, onMounted as $, ref as B, computed as v, watch as f, watchEffect as U, createBlock as T, unref as c, openBlock as w, mergeProps as C, withCtx as s, renderSlot as m, nextTick as x } from "vue";
|
|
2
2
|
import { u as L } from "../vendor/vee-validate/dist/vee-validate.esm.es.js";
|
|
3
3
|
import { u as O } from "../plugins/WangsVue.es.js";
|
|
4
4
|
import { a as N } from "../utils/textFormatter.util.es.js";
|
|
5
|
-
import { _ as
|
|
6
|
-
|
|
5
|
+
import { _ as A } from "../basecalendar/index.es.js";
|
|
6
|
+
import { _ as E } from "../basecalendartimezone/index.es.js";
|
|
7
|
+
const P = /* @__PURE__ */ I({
|
|
7
8
|
__name: "Calendar",
|
|
8
9
|
props: {
|
|
9
10
|
modelValue: {},
|
|
@@ -48,75 +49,94 @@ const Y = /* @__PURE__ */ C({
|
|
|
48
49
|
exactSelection: { type: Boolean }
|
|
49
50
|
},
|
|
50
51
|
emits: ["update:modelValue", "update:epochTimeMillis", "monthChange", "yearChange", "dateSelect"],
|
|
51
|
-
setup(
|
|
52
|
-
|
|
53
|
-
F
|
|
54
|
-
|
|
52
|
+
setup(F, { emit: D }) {
|
|
53
|
+
var h;
|
|
54
|
+
const e = F, p = D;
|
|
55
|
+
$(() => {
|
|
56
|
+
e.dateValue != null && (t.value = u(e.dateValue), r.value = t.value, n.value++), e.epochTimeMillis != null && (t.value = u(e.epochTimeMillis), r.value = t.value, n.value++);
|
|
55
57
|
});
|
|
56
|
-
const {
|
|
57
|
-
value:
|
|
58
|
+
const i = JSON.parse(localStorage.getItem("user") || "{}"), S = (h = i == null ? void 0 : i.generalSetting) == null ? void 0 : h.timezone, { locale: b } = O("Calendar"), t = B(), n = B(0), { value: r, errorMessage: y } = e.useValidator ? L(e.fieldName ?? "date", (a) => k(a)) : {
|
|
59
|
+
value: v({
|
|
58
60
|
get: () => e.modelValue,
|
|
59
61
|
set: (a) => {
|
|
60
|
-
|
|
62
|
+
p("update:modelValue", a);
|
|
61
63
|
}
|
|
62
64
|
})
|
|
63
|
-
},
|
|
64
|
-
() => e.invalid || "errorMessage" in
|
|
65
|
-
),
|
|
66
|
-
var
|
|
67
|
-
const a =
|
|
68
|
-
return e.hourFormat ? e.hourFormat : (
|
|
69
|
-
}),
|
|
70
|
-
var l,
|
|
71
|
-
return await
|
|
72
|
-
},
|
|
65
|
+
}, V = v(
|
|
66
|
+
() => e.invalid || "errorMessage" in r && !!r.errorMessage
|
|
67
|
+
), g = v(() => {
|
|
68
|
+
var l, o;
|
|
69
|
+
const a = (l = i == null ? void 0 : i.generalSetting) == null ? void 0 : l.timeFormat;
|
|
70
|
+
return e.hourFormat ? e.hourFormat : (o = a == null ? void 0 : a.toLowerCase()) != null && o.includes("pm") ? "12" : "24";
|
|
71
|
+
}), k = async (a) => {
|
|
72
|
+
var l, o;
|
|
73
|
+
return await x(), 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 ? ((o = e.customValidation) == null ? void 0 : o.empty) ?? M() : !0;
|
|
74
|
+
}, M = () => {
|
|
73
75
|
var a;
|
|
74
|
-
return
|
|
76
|
+
return b.emptyInvalidText.replace("{label}", e.label).replace(
|
|
75
77
|
"{formattedLabel}",
|
|
76
78
|
(a = N(e.label)) == null ? void 0 : a.toLowerCase()
|
|
77
79
|
);
|
|
78
|
-
},
|
|
79
|
-
(a === e.valueFormat && e.useValidator || !e.useValidator && a === "date") && (
|
|
80
|
+
}, d = (a, l) => {
|
|
81
|
+
(a === e.valueFormat && e.useValidator || !e.useValidator && a === "date") && (r.value = l), a === "date" && e.useValidator && p("update:modelValue", l), a === "millis" && p("update:epochTimeMillis", l);
|
|
80
82
|
}, u = (a) => Array.isArray(a) ? a.map((l) => l == null ? null : new Date(l)) : new Date(a);
|
|
81
|
-
return
|
|
83
|
+
return f(
|
|
82
84
|
() => e.dateValue,
|
|
83
85
|
() => {
|
|
84
|
-
t.value = u(e.dateValue), e.useValidator && (
|
|
86
|
+
t.value = u(e.dateValue), e.useValidator && (r.value = t.value), n.value++;
|
|
85
87
|
},
|
|
86
88
|
{
|
|
87
89
|
once: !0
|
|
88
90
|
}
|
|
89
|
-
),
|
|
91
|
+
), f(
|
|
90
92
|
() => e.epochTimeMillis,
|
|
91
93
|
() => {
|
|
92
|
-
t.value = u(e.epochTimeMillis), e.useValidator && (
|
|
94
|
+
t.value = u(e.epochTimeMillis), e.useValidator && (r.value = t.value), n.value++;
|
|
93
95
|
}
|
|
94
|
-
),
|
|
96
|
+
), f(
|
|
95
97
|
() => e.modelValue,
|
|
96
98
|
() => {
|
|
97
|
-
t.value = e.modelValue, e.useValidator && (
|
|
99
|
+
t.value = e.modelValue, e.useValidator && (r.value = t.value);
|
|
98
100
|
}
|
|
99
|
-
),
|
|
100
|
-
t.value = e.valueFormat === "date" ?
|
|
101
|
-
}), (a, l) => (
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
101
|
+
), U(() => {
|
|
102
|
+
t.value = e.valueFormat === "date" ? r.value : r.value ? u(r.value) : r.value;
|
|
103
|
+
}), (a, l) => c(S) ? (w(), T(E, C({
|
|
104
|
+
key: n.value + 1
|
|
105
|
+
}, e, {
|
|
106
|
+
"error-message": c(y),
|
|
107
|
+
"hour-format": g.value,
|
|
108
|
+
invalid: V.value,
|
|
105
109
|
"model-value": t.value,
|
|
106
110
|
"selection-mode": a.selectionMode || a.mode,
|
|
107
|
-
"onUpdate:epochTimeMillis": l[0] || (l[0] = (
|
|
108
|
-
"onUpdate:modelValue": l[1] || (l[1] = (
|
|
111
|
+
"onUpdate:epochTimeMillis": l[0] || (l[0] = (o) => d("millis", o)),
|
|
112
|
+
"onUpdate:modelValue": l[1] || (l[1] = (o) => d("date", o))
|
|
109
113
|
}), {
|
|
110
|
-
default:
|
|
111
|
-
|
|
114
|
+
default: s(({ onClick: o }) => [
|
|
115
|
+
m(a.$slots, "default", { onClick: o })
|
|
112
116
|
]),
|
|
113
|
-
"addon-overlay":
|
|
114
|
-
|
|
117
|
+
"addon-overlay": s(() => [
|
|
118
|
+
m(a.$slots, "addon-overlay")
|
|
119
|
+
]),
|
|
120
|
+
_: 3
|
|
121
|
+
}, 16, ["error-message", "hour-format", "invalid", "model-value", "selection-mode"])) : (w(), T(A, C({ key: n.value }, e, {
|
|
122
|
+
"error-message": c(y),
|
|
123
|
+
"hour-format": g.value,
|
|
124
|
+
invalid: V.value,
|
|
125
|
+
"model-value": t.value,
|
|
126
|
+
"selection-mode": a.selectionMode || a.mode,
|
|
127
|
+
"onUpdate:epochTimeMillis": l[2] || (l[2] = (o) => d("millis", o)),
|
|
128
|
+
"onUpdate:modelValue": l[3] || (l[3] = (o) => d("date", o))
|
|
129
|
+
}), {
|
|
130
|
+
default: s(({ onClick: o }) => [
|
|
131
|
+
m(a.$slots, "default", { onClick: o })
|
|
132
|
+
]),
|
|
133
|
+
"addon-overlay": s(() => [
|
|
134
|
+
m(a.$slots, "addon-overlay")
|
|
115
135
|
]),
|
|
116
136
|
_: 3
|
|
117
137
|
}, 16, ["error-message", "hour-format", "invalid", "model-value", "selection-mode"]));
|
|
118
138
|
}
|
|
119
139
|
});
|
|
120
140
|
export {
|
|
121
|
-
|
|
141
|
+
P as _
|
|
122
142
|
};
|
|
@@ -26,7 +26,7 @@ type BaseSelectField<OptionsQueryParams extends QueryParams> = {
|
|
|
26
26
|
/**
|
|
27
27
|
* Represents a function type for fetching options based on query parameters.
|
|
28
28
|
*
|
|
29
|
-
* @template
|
|
29
|
+
* @template OptionsQueryParams - The type of query parameters, extending `QueryParams`. Defaults to `any`.
|
|
30
30
|
*
|
|
31
31
|
* This function can have one of the following signatures:
|
|
32
32
|
* - A synchronous function that takes query parameters and returns an array of `Option` objects.
|
|
@@ -43,6 +43,11 @@ type BaseSelectField<OptionsQueryParams extends QueryParams> = {
|
|
|
43
43
|
args: OptionsQueryParams,
|
|
44
44
|
): Option[] | Promise<Option[]> | Promise<AxiosResponse<FetchOptionResponse>>;
|
|
45
45
|
|
|
46
|
+
/**
|
|
47
|
+
* Whether to fetch options when the component is mounted. Useful when the dropdown/multiselect has an initial value.
|
|
48
|
+
* For now, this is only applicable to quickfilter, though filtercontainer support can be added.
|
|
49
|
+
*/
|
|
50
|
+
fetchOnMount?: boolean;
|
|
46
51
|
optionField?: keyof OptionsQueryParams; // @example - actionOptions
|
|
47
52
|
params?: OptionsQueryParams; // Additional QueryParams for the fetchOptionFn
|
|
48
53
|
};
|
package/icon/index.d.ts
CHANGED