@fewangsit/wangsvue-fats 1.0.1-alpha.54 → 1.0.1-alpha.56

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,9 +1,10 @@
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";
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 U } from "../basecalendar/index.es.js";
6
- const Y = /* @__PURE__ */ C({
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(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++);
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 { 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
+ 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
- n("update:modelValue", a);
62
+ p("update:modelValue", a);
61
63
  }
62
64
  })
63
- }, B = d(
64
- () => e.invalid || "errorMessage" in o && !!o.errorMessage
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 = () => {
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 h.emptyInvalidText.replace("{label}", e.label).replace(
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
- }, 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
+ }, 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 s(
83
+ return f(
82
84
  () => e.dateValue,
83
85
  () => {
84
- t.value = u(e.dateValue), e.useValidator && (o.value = t.value), i.value++;
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
- ), s(
91
+ ), f(
90
92
  () => e.epochTimeMillis,
91
93
  () => {
92
- t.value = u(e.epochTimeMillis), e.useValidator && (o.value = t.value), i.value++;
94
+ t.value = u(e.epochTimeMillis), e.useValidator && (r.value = t.value), n.value++;
93
95
  }
94
- ), s(
96
+ ), f(
95
97
  () => e.modelValue,
96
98
  () => {
97
- t.value = e.modelValue, e.useValidator && (o.value = t.value);
99
+ t.value = e.modelValue, e.useValidator && (r.value = t.value);
98
100
  }
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,
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] = (r) => p("millis", r)),
108
- "onUpdate:modelValue": l[1] || (l[1] = (r) => p("date", r))
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: c(({ onClick: r }) => [
111
- y(a.$slots, "default", { onClick: r })
114
+ default: s(({ onClick: o }) => [
115
+ m(a.$slots, "default", { onClick: o })
112
116
  ]),
113
- "addon-overlay": c(() => [
114
- y(a.$slots, "addon-overlay")
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
- Y as _
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 T - The type of query parameters, extending `QueryParams`. Defaults to `any`.
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
@@ -182,6 +182,7 @@ export type WangsIcons =
182
182
  | 'star'
183
183
  | 'store'
184
184
  | 'subtract'
185
+ | 'table'
185
186
  | 'time'
186
187
  | 'ticket'
187
188
  | 'tools'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fewangsit/wangsvue-fats",
3
- "version": "1.0.1-alpha.54",
3
+ "version": "1.0.1-alpha.56",
4
4
  "author": "Wangsit FE Developer",
5
5
  "description": "Fixed Asset Tagsamurai VueJS Component Library",
6
6
  "type": "module",