@fewangsit/wangsvue-fats 1.0.1-alpha.68 → 1.0.1-alpha.69

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.
Files changed (78) hide show
  1. package/animation/index.es.js +9 -8
  2. package/assetinfo/index.d.ts +5 -4
  3. package/assetinfo/index.es.js +113 -97
  4. package/backgroundimagecropper/index.es.js +14 -12
  5. package/button/index.es.js +58 -48
  6. package/buttonbulkaction/index.es.js +67 -59
  7. package/buttondownload/index.es.js +18 -18
  8. package/buttonradio/index.es.js +11 -11
  9. package/buttonscan/index.es.js +1 -1
  10. package/buttonsearch/index.es.js +14 -14
  11. package/buttonselectuser/index.es.js +29 -29
  12. package/checkbox/index.es.js +5 -5
  13. package/config/defaultProps.es.js +3 -4
  14. package/datatable/index.es.js +470 -465
  15. package/datepicker/index.es.js +17 -17
  16. package/daypicker/index.es.js +21 -21
  17. package/dialog/index.es.js +17 -15
  18. package/dialogbasictransferlog/index.es.js +89 -89
  19. package/dialogconfirm/index.es.js +33 -33
  20. package/dialogdamagelog/index.es.js +89 -89
  21. package/dialogform/index.es.js +16 -16
  22. package/dialogfulltransferlog/index.es.js +96 -96
  23. package/dialoglinkedasset/index.es.js +48 -48
  24. package/dialogprintqr/index.es.js +70 -70
  25. package/dialogreportdamage/index.es.js +57 -57
  26. package/dialogreportmissing/index.es.js +94 -86
  27. package/dialogselecttree/index.es.js +18 -16
  28. package/dialogselectuser/index.es.js +16 -16
  29. package/directives/index.d.ts +1 -0
  30. package/directives/index.es.js +1 -0
  31. package/directives/safeHtml.d.ts +16 -0
  32. package/directives/safeHtml.es.js +12 -0
  33. package/disposalreport/index.es.js +1 -1
  34. package/disposalreportbulkaction/index.es.js +40 -41
  35. package/disposalreportdialogselectasset/index.es.js +72 -72
  36. package/disposalreporttable/index.es.js +108 -108
  37. package/disposalreporttablefilter/index.es.js +16 -17
  38. package/dropdown/index.es.js +120 -117
  39. package/fieldwrapper/index.es.js +7 -7
  40. package/fileupload/index.es.js +35 -31
  41. package/hardwaresync/index.es.js +12 -12
  42. package/headercell/index.es.js +4 -4
  43. package/icon/index.es.js +26 -25
  44. package/imagecompressor/index.es.js +143 -143
  45. package/imageinputinfo/index.es.js +13 -13
  46. package/inlinemessage/index.es.js +12 -12
  47. package/inputbadge/index.es.js +42 -43
  48. package/inputnumber/index.es.js +7 -7
  49. package/inputpassword/index.es.js +9 -9
  50. package/inputrangenumber/index.es.js +16 -16
  51. package/inputsearch/index.es.js +18 -18
  52. package/inputtext/index.es.js +33 -33
  53. package/litedropdown/index.es.js +48 -40
  54. package/menuitem/index.es.js +27 -26
  55. package/multirow/index.es.js +16 -16
  56. package/multiselect/index.es.js +86 -83
  57. package/package.json +1 -1
  58. package/plugins/basei18n.d.ts +2 -2
  59. package/plugins/basei18n.es.js +48 -42
  60. package/stats.html +1 -1
  61. package/style.css +1 -1
  62. package/tabmenu/index.es.js +14 -9
  63. package/tagtype/index.es.js +33 -30
  64. package/textarea/index.es.js +3 -3
  65. package/toggledarkmode/store/index.d.ts +7 -0
  66. package/toggleswitch/index.es.js +3 -3
  67. package/treesearchinput/index.es.js +11 -11
  68. package/username/index.es.js +39 -39
  69. package/utils/baseToast.util.es.js +23 -22
  70. package/utils/index.es.js +1 -2
  71. package/utils/textFormatter.util.d.ts +32 -0
  72. package/utils/textFormatter.util.es.js +38 -10
  73. package/validatormessage/index.es.js +1 -1
  74. package/vendor/dompurify/dist/purify.es.es.js +553 -0
  75. package/wangsvue-fats.d.ts +2 -1
  76. package/wangsvue-fats.es.js +190 -186
  77. package/wangsvue-fats.esm.browser.js +17750 -17086
  78. package/wangsvue-fats.system.js +73 -72
@@ -1,16 +1,17 @@
1
- import { defineComponent as z, onMounted as E, onUnmounted as H, inject as T, shallowRef as U, ref as A, reactive as R, computed as b, watch as v, createBlock as V, openBlock as w, withCtx as i, createVNode as r, normalizeClass as D, renderSlot as F, unref as t, mergeProps as k, createSlots as W, normalizeProps as p, guardReactiveProps as f, withModifiers as q, createElementVNode as G, toDisplayString as J, createCommentVNode as K } from "vue";
2
- import { u as Q } from "../vendor/vee-validate/dist/vee-validate.esm.es.js";
3
- import { e as C } from "../event-bus/index.es.js";
4
- import { u as X } from "../plugins/WangsVue.es.js";
5
- import { f as Y } from "../utils/filterOptions.util.es.js";
6
- import { a as Z } from "../utils/textFormatter.util.es.js";
7
- import { s as ee } from "../vendor/primevue/multiselect/multiselect.esm.es.js";
8
- import { _ as S } from "../button/index.es.js";
9
- import { _ as le } from "../fieldwrapper/index.es.js";
1
+ import { defineComponent as E, onMounted as H, onUnmounted as T, inject as U, shallowRef as A, ref as R, reactive as D, computed as b, watch as v, createBlock as w, openBlock as k, withCtx as i, createVNode as r, normalizeClass as F, renderSlot as W, unref as t, mergeProps as C, createSlots as q, normalizeProps as p, guardReactiveProps as f, withModifiers as G, createElementVNode as J, toDisplayString as K, createCommentVNode as Q } from "vue";
2
+ import { u as X } from "../vendor/vee-validate/dist/vee-validate.esm.es.js";
3
+ import { e as S } from "../event-bus/index.es.js";
4
+ import { u as Y } from "../plugins/basei18n.es.js";
5
+ import { u as Z } from "../plugins/WangsVue.es.js";
6
+ import { f as ee } from "../utils/filterOptions.util.es.js";
7
+ import { a as le } from "../utils/textFormatter.util.es.js";
8
+ import { s as oe } from "../vendor/primevue/multiselect/multiselect.esm.es.js";
9
+ import { _ as M } from "../button/index.es.js";
10
+ import { _ as ae } from "../fieldwrapper/index.es.js";
10
11
  import { _ as c } from "../icon/index.es.js";
11
- import { _ as oe } from "../inputgroup/index.es.js";
12
- import { _ as ae } from "../validatormessage/index.es.js";
13
- const be = /* @__PURE__ */ z({
12
+ import { _ as te } from "../inputgroup/index.es.js";
13
+ import { _ as ie } from "../validatormessage/index.es.js";
14
+ const ge = /* @__PURE__ */ E({
14
15
  __name: "MultiSelect",
15
16
  props: {
16
17
  modelValue: {},
@@ -37,89 +38,91 @@ const be = /* @__PURE__ */ z({
37
38
  hideHeaderCheckbox: { type: Boolean, default: !1 }
38
39
  },
39
40
  emits: ["update:modelValue", "show", "hide"],
40
- setup(M, { expose: x, emit: B }) {
41
- const e = M, L = B;
42
- E(() => {
43
- _(), C.on("multi-select:hide-overlay", g);
44
- }), H(() => {
45
- C.off("multi-select:hide-overlay");
41
+ setup($, { expose: B, emit: L }) {
42
+ const l = $, P = L;
43
+ H(() => {
44
+ _(), S.on("multi-select:hide-overlay", V);
45
+ }), T(() => {
46
+ S.off("multi-select:hide-overlay");
46
47
  });
47
- const { locale: m } = X("MultiSelect"), s = T("preset", {}).multiselect, u = U(!1), d = A(), a = R({
48
- value: e.initialValue ? e.initialValue : e.modelValue
49
- }), P = b(() => Y(e.options)), $ = b(() => {
50
- var l;
51
- return m.emptySelectionErrorMessage.replace("{label}", e.label).replace(
48
+ const { t: y } = Y(), { locale: m } = Z("MultiSelect"), s = U("preset", {}).multiselect, u = A(!1), d = R(), a = D({
49
+ value: l.initialValue ? l.initialValue : l.modelValue
50
+ }), O = b(
51
+ () => ee(l.options).map((e) => typeof e.value == "string" ? y(e) : { ...e, label: y(e.label) })
52
+ ), x = b(() => {
53
+ var e;
54
+ return m.emptySelectionErrorMessage.replace("{label}", l.label).replace(
52
55
  "{formattedLabel}",
53
- (l = Z(e.label)) == null ? void 0 : l.toLowerCase()
56
+ (e = le(l.label)) == null ? void 0 : e.toLowerCase()
54
57
  );
55
- }), O = b(() => {
56
- var l;
57
- return e.loading ? m.loadingPlaceholder : e.placeholder ?? ((l = m.inputPlaceholder) == null ? void 0 : l.replace("{label}", e.label ?? "").replace("{lowercaseLabel}", (e.label ?? "").toLowerCase()));
58
+ }), I = b(() => {
59
+ var e;
60
+ return l.loading ? m.loadingPlaceholder : l.placeholder ?? ((e = m.inputPlaceholder) == null ? void 0 : e.replace("{label}", l.label ?? "").replace("{lowercaseLabel}", (l.label ?? "").toLowerCase()));
58
61
  }), _ = () => {
59
- var l;
60
- e.useValidator && (Object.assign(
62
+ var e;
63
+ l.useValidator && (Object.assign(
61
64
  a,
62
- Q(e.fieldName ?? "multiSelect", (o) => !(Array.isArray(o) && o.length) && e.mandatory ? typeof e.validatorMessage == "object" && "empty" in e.validatorMessage ? e.validatorMessage.empty : e.validatorMessage ?? $.value : !0)
63
- ), (l = e.initialValue) != null && l.length && (a.value = e.initialValue));
64
- }, y = () => {
65
- d.value && d.value.show();
65
+ X(l.fieldName ?? "multiSelect", (o) => !(Array.isArray(o) && o.length) && l.mandatory ? typeof l.validatorMessage == "object" && "empty" in l.validatorMessage ? l.validatorMessage.empty : l.validatorMessage ?? x.value : !0)
66
+ ), (e = l.initialValue) != null && e.length && (a.value = l.initialValue));
66
67
  }, g = () => {
68
+ d.value && d.value.show();
69
+ }, V = () => {
67
70
  d.value && d.value.hide();
68
- }, I = (l) => {
69
- const o = l != null && l.length ? l : void 0;
70
- L("update:modelValue", o);
71
+ }, N = (e) => {
72
+ const o = e != null && e.length ? e : void 0;
73
+ P("update:modelValue", o);
71
74
  };
72
75
  return v(
73
76
  () => a.value,
74
77
  () => {
75
- I(a.value);
78
+ N(a.value);
76
79
  }
77
80
  ), v(
78
- () => e.modelValue,
79
- (l) => {
80
- a.value = l;
81
+ () => l.modelValue,
82
+ (e) => {
83
+ a.value = e;
81
84
  }
82
85
  ), v(
83
- () => e.initialValue,
84
- (l) => {
85
- a.value = l;
86
+ () => l.initialValue,
87
+ (e) => {
88
+ a.value = e;
86
89
  },
87
90
  { once: !0 }
88
- ), x({
91
+ ), B({
89
92
  isShowOverlay: u,
90
- showOverlay: y,
91
- hideOverlay: g
92
- }), (l, o) => (w(), V(le, {
93
- info: l.fieldInfo,
94
- label: e.label,
95
- mandatory: e.mandatory,
96
- "show-optional-text": l.showOptionalText
93
+ showOverlay: g,
94
+ hideOverlay: V
95
+ }), (e, o) => (k(), w(ae, {
96
+ info: e.fieldInfo,
97
+ label: l.label,
98
+ mandatory: l.mandatory,
99
+ "show-optional-text": e.showOptionalText
97
100
  }, {
98
101
  default: i(() => [
99
- r(oe, {
100
- class: D({ "rounded-none !ring-0 !w-max": l.controls }),
101
- disabled: e.disabled,
102
+ r(te, {
103
+ class: F({ "rounded-none !ring-0 !w-max": e.controls }),
104
+ disabled: l.disabled,
102
105
  invalid: !!a.errorMessage
103
106
  }, {
104
107
  default: i(() => {
105
108
  var h;
106
109
  return [
107
- r(t(ee), k(e, {
110
+ r(t(oe), C(l, {
108
111
  ref_key: "multiselect",
109
112
  ref: d,
110
113
  modelValue: a.value,
111
114
  "onUpdate:modelValue": o[0] || (o[0] = (n) => a.value = n),
112
- "aria-describedby": e.label + "error",
115
+ "aria-describedby": l.label + "error",
113
116
  class: [
114
117
  {
115
- "invisible !w-0": l.controls
118
+ "invisible !w-0": e.controls
116
119
  }
117
120
  ],
118
- display: e.display,
119
- "filter-placeholder": e.filterPlaceholder || t(m).filterPlaceholder,
120
- "max-selected-labels": e.maxSelectedLabels,
121
- options: P.value,
122
- placeholder: O.value,
121
+ display: l.display,
122
+ "filter-placeholder": e.$t(l.filterPlaceholder || t(m).filterPlaceholder),
123
+ "max-selected-labels": l.maxSelectedLabels,
124
+ options: O.value,
125
+ placeholder: e.$t(I.value),
123
126
  pt: {
124
127
  headerCheckbox: {
125
128
  ...t(s).headerCheckbox,
@@ -127,17 +130,17 @@ const be = /* @__PURE__ */ z({
127
130
  ...t(s).headerCheckbox.root,
128
131
  class: [
129
132
  ...t(s).headerCheckbox.root.class,
130
- { hidden: l.hideHeaderCheckbox }
133
+ { hidden: e.hideHeaderCheckbox }
131
134
  ]
132
135
  }
133
136
  }
134
137
  },
135
- "selected-items-label": e.selectedItemsLabel,
136
- "show-toggle-all": e.filter,
137
- "virtual-scroller-options": (((h = l.options) == null ? void 0 : h.length) ?? 0) > 10 ? { itemSize: 32 } : void 0,
138
- onHide: o[1] || (o[1] = (n) => (u.value = !1, l.$emit("hide"))),
139
- onShow: o[2] || (o[2] = (n) => (l.$emit("show"), u.value = !0))
140
- }), W({
138
+ "selected-items-label": l.selectedItemsLabel,
139
+ "show-toggle-all": l.filter,
140
+ "virtual-scroller-options": (((h = e.options) == null ? void 0 : h.length) ?? 0) > 10 ? { itemSize: 32 } : void 0,
141
+ onHide: o[1] || (o[1] = (n) => (u.value = !1, e.$emit("hide"))),
142
+ onShow: o[2] || (o[2] = (n) => (e.$emit("show"), u.value = !0))
143
+ }), q({
141
144
  dropdownicon: i(() => [
142
145
  r(c, p(f(t(s).dropdownicon({ state: { isShowOverlay: u.value } }))), null, 16)
143
146
  ]),
@@ -150,9 +153,9 @@ const be = /* @__PURE__ */ z({
150
153
  filtericon: i(() => [
151
154
  r(c, p(f(t(s).filtericon)), null, 16)
152
155
  ]),
153
- removetokenicon: i(({ removeCallback: n, item: N }) => [
154
- r(S, k({
155
- onClick: q((j) => n(j, N), ["stop"])
156
+ removetokenicon: i(({ removeCallback: n, item: j }) => [
157
+ r(M, C({
158
+ onClick: G((z) => n(z, j), ["stop"])
156
159
  }, t(s).removeTokenIcon, {
157
160
  icon: "close",
158
161
  rounded: "",
@@ -165,31 +168,31 @@ const be = /* @__PURE__ */ z({
165
168
  ]),
166
169
  _: 2
167
170
  }, [
168
- l.loading ? {
171
+ e.loading ? {
169
172
  name: "value",
170
173
  fn: i(({ placeholder: n }) => [
171
- G("span", p(f(t(s).loadingplaceholder)), J(n), 17)
174
+ J("span", p(f(t(s).loadingplaceholder)), K(e.$t(n)), 17)
172
175
  ]),
173
176
  key: "0"
174
177
  } : void 0
175
178
  ]), 1040, ["modelValue", "aria-describedby", "class", "display", "filter-placeholder", "max-selected-labels", "options", "placeholder", "pt", "selected-items-label", "show-toggle-all", "virtual-scroller-options"]),
176
- F(l.$slots, "trigger", {
177
- disabled: e.disabled
179
+ W(e.$slots, "trigger", {
180
+ disabled: l.disabled
178
181
  }, () => [
179
- l.controls ? (w(), V(S, {
182
+ e.controls ? (k(), w(M, {
180
183
  key: 0,
181
- disabled: e.disabled,
182
- onClick: y,
184
+ disabled: l.disabled,
185
+ onClick: g,
183
186
  class: "!rounded !ring-0",
184
187
  icon: "add"
185
- }, null, 8, ["disabled"])) : K("", !0)
188
+ }, null, 8, ["disabled"])) : Q("", !0)
186
189
  ])
187
190
  ];
188
191
  }),
189
192
  _: 3
190
193
  }, 8, ["class", "disabled", "invalid"]),
191
- r(ae, {
192
- id: e.label + "error",
194
+ r(ie, {
195
+ id: l.label + "error",
193
196
  message: a.errorMessage
194
197
  }, null, 8, ["id", "message"])
195
198
  ]),
@@ -198,5 +201,5 @@ const be = /* @__PURE__ */ z({
198
201
  }
199
202
  });
200
203
  export {
201
- be as _
204
+ ge as _
202
205
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fewangsit/wangsvue-fats",
3
- "version": "1.0.1-alpha.68",
3
+ "version": "1.0.1-alpha.69",
4
4
  "author": "Wangsit FE Developer",
5
5
  "description": "Fixed Asset Tagsamurai VueJS Component Library",
6
6
  "type": "module",
@@ -29,8 +29,8 @@ export interface I18n {
29
29
  * @example `t('Hello %s! I am %s.', "John Doe", "Peter Smith")` - returns: 'Hello John Doe! I am Peter Smith.'
30
30
  */
31
31
  t: {
32
- (key: string, params: Record<string, any>): string;
33
- (key: string, ...args: (string | number | boolean)[]): string;
32
+ (key?: string, params?: Record<string, any>): string | undefined;
33
+ (key?: string, ...args: (string | number | boolean)[]): string | undefined;
34
34
  };
35
35
  /**
36
36
  * Change the locale dynamically
@@ -1,27 +1,28 @@
1
- import { shallowRef as m, shallowReactive as P, inject as I } from "vue";
2
- import { u as M } from "../assetinfo/index.es.js";
3
- import { s as b, g as y } from "../utils/cookie.util.es.js";
4
- const s = m(), u = "messages";
1
+ import { shallowRef as M, shallowReactive as P, inject as b } from "vue";
2
+ import { u as I } from "../assetinfo/index.es.js";
3
+ import { s as T, g as x } from "../utils/cookie.util.es.js";
4
+ import { b as g } from "../utils/textFormatter.util.es.js";
5
+ const s = M(), f = "messages";
5
6
  let o;
6
- const f = () => {
7
+ const d = () => {
7
8
  try {
8
- const e = localStorage.getItem(u);
9
+ const e = localStorage.getItem(f);
9
10
  return e ? JSON.parse(e) : {};
10
11
  } catch {
11
12
  return {};
12
13
  }
13
- }, i = P(f()), r = new Proxy(i, {
14
+ }, i = P(d()), a = new Proxy(i, {
14
15
  get: (e, t) => {
15
- const l = f()[t];
16
+ const l = d()[t];
16
17
  return i[t] = l, l;
17
18
  },
18
- set: (e, t, n) => (i[t] = n, x(i), !0)
19
- }), x = (e) => {
20
- localStorage.setItem(u, JSON.stringify(e));
19
+ set: (e, t, n) => (i[t] = n, y(i), !0)
20
+ }), y = (e) => {
21
+ localStorage.setItem(f, JSON.stringify(e));
21
22
  }, A = async (e) => {
22
23
  var t;
23
- if (!(e in r)) {
24
- const { setLoading: n } = M();
24
+ if (!(e in a)) {
25
+ const { setLoading: n } = I();
25
26
  n(!0, "Loading language package...");
26
27
  let l = {};
27
28
  try {
@@ -33,48 +34,53 @@ const f = () => {
33
34
  }
34
35
  return l;
35
36
  }
36
- return r[e];
37
- }, d = (e, ...t) => {
37
+ return a[e];
38
+ }, v = (e, ...t) => {
38
39
  var c;
39
- if (!s.value && !y("lang")) return e;
40
- let n = (c = r[s.value]) == null ? void 0 : c[e];
40
+ if (!e) return;
41
+ if (!s.value && !x("lang")) return e;
42
+ let n = (c = a[s.value]) == null ? void 0 : c[e];
41
43
  const l = n === e && s.value !== "en";
42
- if ((!n || l) && (n = e, o == null || o.translateText(e, s.value).then((a) => {
43
- r[s.value] ? r[s.value] = {
44
- ...r[s.value],
45
- [e]: a
46
- } : r[s.value] = {
47
- [e]: a
44
+ if ((!n || l) && (n = e, o == null || o.translateText(e, s.value).then((r) => {
45
+ a[s.value] ? a[s.value] = {
46
+ ...a[s.value],
47
+ [e]: r
48
+ } : a[s.value] = {
49
+ [e]: r
48
50
  };
49
- }).catch((a) => {
50
- console.error("Translation error:", a);
51
+ }).catch((r) => {
52
+ console.error("Translation error:", r);
51
53
  })), t.length === 1 && typeof t[0] == "object" && !Array.isArray(t[0])) {
52
- const a = t[0];
53
- return Object.keys(a).reduce(
54
- (h, g) => h.replaceAll(`{${g}}`, a[g]),
55
- n
54
+ const r = t[0];
55
+ return g(
56
+ Object.keys(r).reduce(
57
+ (h, u) => h.replaceAll(`{${u}}`, r[u]),
58
+ n
59
+ )
56
60
  );
57
61
  }
58
62
  if (t.length > 0) {
59
- let a = 0;
60
- return n.replace(/%s/g, () => String(t[a++] ?? ""));
63
+ let r = 0;
64
+ return g(
65
+ n.replace(/%s/g, () => String(t[r++] ?? ""))
66
+ );
61
67
  }
62
- return n;
63
- }, v = async (e) => {
68
+ return g(n);
69
+ }, m = async (e) => {
64
70
  if (s.value !== e) {
65
71
  const t = await A(e);
66
- s.value = e, r[e] = t, b({ name: "lang", value: s.value, path: "/" });
72
+ s.value = e, a[e] = t, T({ name: "lang", value: s.value, path: "/" });
67
73
  }
68
- }, E = () => (I("i18n") || console.error("I18n Plugin not installed!"), {
69
- t: d,
74
+ }, R = () => (b("i18n") || console.error("I18n Plugin not installed!"), {
75
+ t: v,
70
76
  locale: s,
71
- setLocale: v,
77
+ setLocale: m,
72
78
  service: o
73
79
  }), O = () => {
74
80
  const e = {
75
- t: d,
81
+ t: v,
76
82
  locale: s,
77
- setLocale: v,
83
+ setLocale: m,
78
84
  service: o
79
85
  };
80
86
  return {
@@ -82,8 +88,8 @@ const f = () => {
82
88
  t.config.globalProperties.$i18n = e, t.config.globalProperties.$t = e.t, t.provide("i18n", e);
83
89
  }
84
90
  };
85
- }, R = (e) => (o = e, O());
91
+ }, S = (e) => (o = e, O());
86
92
  export {
87
- R as c,
88
- E as u
93
+ S as c,
94
+ R as u
89
95
  };