@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,19 +1,20 @@
1
- import { defineComponent as ee, onMounted as le, computed as u, inject as N, ref as oe, shallowRef as I, reactive as ae, watch as $, createBlock as m, openBlock as s, withCtx as r, createVNode as d, normalizeClass as te, createCommentVNode as T, unref as i, renderSlot as p, mergeProps as j, createSlots as ie, normalizeProps as v, guardReactiveProps as c, createElementVNode as re, toDisplayString as k, createElementBlock as D, Fragment as E, createTextVNode as R, nextTick as ne } from "vue";
2
- import { u as se } from "../vendor/vee-validate/dist/vee-validate.esm.es.js";
3
- import { u as de } from "../plugins/WangsVue.es.js";
4
- import { f as ue } from "../utils/filterOptions.util.es.js";
5
- import { m as pe } from "../utils/mergePropsWithDefaults.util.es.js";
6
- import { a as fe } from "../utils/textFormatter.util.es.js";
7
- import { s as me } from "../vendor/primevue/dropdown/dropdown.esm.es.js";
8
- import { s as K } from "../vendor/primevue/inputgroupaddon/inputgroupaddon.esm.es.js";
9
- import { _ as ve } from "../badge/index.es.js";
10
- import { _ as ce } from "../fieldwrapper/index.es.js";
1
+ import { defineComponent as le, onMounted as oe, computed as u, inject as I, ref as ae, shallowRef as T, reactive as te, watch as w, createBlock as m, openBlock as s, withCtx as r, createVNode as d, normalizeClass as ie, createCommentVNode as j, unref as i, renderSlot as p, mergeProps as D, createSlots as re, normalizeProps as v, guardReactiveProps as c, createElementVNode as ne, toDisplayString as k, createElementBlock as E, Fragment as R, createTextVNode as K, nextTick as se } from "vue";
2
+ import { u as de } from "../vendor/vee-validate/dist/vee-validate.esm.es.js";
3
+ import { u as ue } from "../plugins/basei18n.es.js";
4
+ import { u as pe } from "../plugins/WangsVue.es.js";
5
+ import { f as fe } from "../utils/filterOptions.util.es.js";
6
+ import { m as me } from "../utils/mergePropsWithDefaults.util.es.js";
7
+ import { a as ve } from "../utils/textFormatter.util.es.js";
8
+ import { s as ce } from "../vendor/primevue/dropdown/dropdown.esm.es.js";
9
+ import { s as z } from "../vendor/primevue/inputgroupaddon/inputgroupaddon.esm.es.js";
10
+ import { _ as ge } from "../badge/index.es.js";
11
+ import { _ as ye } from "../fieldwrapper/index.es.js";
11
12
  import { _ as B } from "../icon/index.es.js";
12
- import { _ as ge } from "../inputgroup/index.es.js";
13
- import { _ as ye } from "../validatormessage/index.es.js";
14
- import { i as z } from "../vendor/lodash-es/isEqual.es.js";
15
- import { c as F } from "../vendor/lodash-es/cloneDeep.es.js";
16
- const Te = /* @__PURE__ */ ee({
13
+ import { _ as be } from "../inputgroup/index.es.js";
14
+ import { _ as Ve } from "../validatormessage/index.es.js";
15
+ import { i as F } from "../vendor/lodash-es/isEqual.es.js";
16
+ import { c as W } from "../vendor/lodash-es/cloneDeep.es.js";
17
+ const Ee = /* @__PURE__ */ le({
17
18
  __name: "Dropdown",
18
19
  props: {
19
20
  modelValue: { type: [String, Number, Boolean, Object], default: void 0 },
@@ -44,124 +45,126 @@ const Te = /* @__PURE__ */ ee({
44
45
  panelMaxContent: { type: Boolean, default: !1 }
45
46
  },
46
47
  emits: ["update:modelValue", "show", "fieldInfoClick"],
47
- setup(W, { expose: q, emit: A }) {
48
- const e = W, O = A;
49
- le(() => {
50
- X();
48
+ setup(q, { expose: A, emit: G }) {
49
+ const l = q, O = G;
50
+ oe(() => {
51
+ Y();
51
52
  });
52
- const { locale: f, defaultProps: G } = de("Dropdown"), H = u(() => pe(e, G)), n = N("preset", {}).dropdown, U = N(
53
+ const { t: M } = ue(), { locale: f, defaultProps: H } = pe("Dropdown"), U = u(() => me(l, H)), n = I("preset", {}).dropdown, J = I(
53
54
  "preset",
54
55
  {}
55
- ).inputgroupaddon, g = oe(), y = I(!1), b = I(!1), M = u(() => e.invalid || !!o.errorMessage), o = ae({
56
- value: e.initialValue !== void 0 ? e.initialValue : e.modelValue
57
- }), J = u(() => {
58
- var l;
59
- return f.emptySelectionErrorMessage.replace("{label}", e.label).replace(
56
+ ).inputgroupaddon, g = ae(), y = T(!1), b = T(!1), C = u(() => l.invalid || !!o.errorMessage), o = te({
57
+ value: l.initialValue !== void 0 ? l.initialValue : l.modelValue
58
+ }), Q = u(() => {
59
+ var e;
60
+ return f.emptySelectionErrorMessage.replace("{label}", l.label).replace(
60
61
  "{formattedLabel}",
61
- (l = fe(e.label)) == null ? void 0 : l.toLowerCase()
62
+ (e = ve(l.label)) == null ? void 0 : e.toLowerCase()
62
63
  );
63
- }), V = u(() => ue(e.options)), Q = u(() => {
64
- var l;
65
- return e.loading ? f.loadingPlaceholder : e.placeholder ?? ((l = f.inputPlaceholder) == null ? void 0 : l.replace("{label}", e.label ?? "").replace("{lowercaseLabel}", (e.label ?? "").toLowerCase()));
66
- }), X = () => {
67
- e.useValidator && (Object.assign(
64
+ }), V = u(
65
+ () => fe(l.options).map((e) => typeof e == "string" ? M(e) : { ...e, label: M(e.label) })
66
+ ), X = u(() => {
67
+ var e;
68
+ return l.loading ? f.loadingPlaceholder : l.placeholder ?? ((e = f.inputPlaceholder) == null ? void 0 : e.replace("{label}", l.label ?? "").replace("{lowercaseLabel}", (l.label ?? "").toLowerCase()));
69
+ }), Y = () => {
70
+ l.useValidator && (Object.assign(
68
71
  o,
69
- se(e.fieldName ?? "dropdown", (l) => !(l != null && l !== "") && e.mandatory ? typeof e.validatorMessage == "object" && "empty" in e.validatorMessage ? e.validatorMessage.empty : e.validatorMessage ?? J.value : ne(Y))
70
- ), e.initialValue !== void 0 && (o.value = e.initialValue), e.invalid && o.validate());
71
- }, Y = () => e.validatorMessage && e.invalid ? e.validatorMessage : !0, Z = (l) => {
72
- const { value: a } = l;
73
- e.unselectOnReselect ? b.value = !0 : O("update:modelValue", a);
74
- }, h = () => {
75
- if (e.optionValue) {
76
- const l = V.value.find((a) => {
72
+ de(l.fieldName ?? "dropdown", (e) => !(e != null && e !== "") && l.mandatory ? typeof l.validatorMessage == "object" && "empty" in l.validatorMessage ? l.validatorMessage.empty : l.validatorMessage ?? Q.value : se(Z))
73
+ ), l.initialValue !== void 0 && (o.value = l.initialValue), l.invalid && o.validate());
74
+ }, Z = () => l.validatorMessage && l.invalid ? l.validatorMessage : !0, _ = (e) => {
75
+ const { value: a } = e;
76
+ l.unselectOnReselect ? b.value = !0 : O("update:modelValue", a);
77
+ }, $ = () => {
78
+ if (l.optionValue) {
79
+ const e = V.value.find((a) => {
77
80
  if (typeof a != "string")
78
- return e.dataKey ? o.value[e.dataKey] === a[e.optionValue ?? ""][e.dataKey] : z(
79
- F(a[e.optionValue ?? ""]),
80
- F(o.value)
81
+ return l.dataKey ? o.value[l.dataKey] === a[l.optionValue ?? ""][l.dataKey] : F(
82
+ W(a[l.optionValue ?? ""]),
83
+ W(o.value)
81
84
  );
82
85
  });
83
- if (l && typeof l != "string")
84
- return l[e.optionLabel ?? ""];
85
- } else if (o.value && typeof o.value == "object" && e.optionLabel && e.optionLabel in o.value)
86
- return o.value[e.optionLabel];
86
+ if (e && typeof e != "string")
87
+ return e[l.optionLabel ?? ""];
88
+ } else if (o.value && typeof o.value == "object" && l.optionLabel && l.optionLabel in o.value)
89
+ return o.value[l.optionLabel];
87
90
  return o.value;
88
- }, _ = () => {
91
+ }, x = () => {
89
92
  g.value && g.value.show();
90
93
  };
91
- return $(
92
- () => e.initialValue,
93
- (l) => {
94
- o.value = l;
94
+ return w(
95
+ () => l.initialValue,
96
+ (e) => {
97
+ o.value = e;
95
98
  },
96
99
  { once: !0 }
97
- ), $(
98
- () => e.modelValue,
99
- (l) => {
100
- o.value = l;
100
+ ), w(
101
+ () => l.modelValue,
102
+ (e) => {
103
+ o.value = e;
101
104
  }
102
- ), $(
105
+ ), w(
103
106
  () => o.value,
104
- (l, a) => {
107
+ (e, a) => {
105
108
  setTimeout(() => {
106
- e.unselectOnReselect && b.value && (z(l, a) && l !== void 0 && (o.value = void 0), b.value = !1, O("update:modelValue", o.value));
109
+ l.unselectOnReselect && b.value && (F(e, a) && e !== void 0 && (o.value = void 0), b.value = !1, O("update:modelValue", o.value));
107
110
  }, 0);
108
111
  }
109
- ), q({
110
- showOverlay: _
111
- }), (l, a) => (s(), m(ce, {
112
- info: l.fieldInfo,
113
- label: e.label,
114
- mandatory: e.mandatory,
115
- "show-optional-text": l.showOptionalText,
116
- onInfoClick: a[3] || (a[3] = (w) => l.$emit("fieldInfoClick"))
112
+ ), A({
113
+ showOverlay: x
114
+ }), (e, a) => (s(), m(ye, {
115
+ info: e.fieldInfo,
116
+ label: l.label,
117
+ mandatory: l.mandatory,
118
+ "show-optional-text": e.showOptionalText,
119
+ onInfoClick: a[3] || (a[3] = (h) => e.$emit("fieldInfoClick"))
117
120
  }, {
118
121
  default: r(() => [
119
- d(ge, {
120
- class: te([
122
+ d(be, {
123
+ class: ie([
121
124
  {
122
- "grid grid-cols-[max-content,1fr,max-content]": l.$slots["addon-left"] && l.$slots["addon-right"],
123
- "grid grid-cols-[1fr,max-content]": !l.$slots["addon-left"] && l.$slots["addon-right"],
124
- "grid grid-cols-[max-content,1fr]": l.$slots["addon-left"] && !l.$slots["addon-right"]
125
+ "grid grid-cols-[max-content,1fr,max-content]": e.$slots["addon-left"] && e.$slots["addon-right"],
126
+ "grid grid-cols-[1fr,max-content]": !e.$slots["addon-left"] && e.$slots["addon-right"],
127
+ "grid grid-cols-[max-content,1fr]": e.$slots["addon-left"] && !e.$slots["addon-right"]
125
128
  }
126
129
  ]),
127
- disabled: e.disabled,
128
- invalid: M.value,
129
- ring: l.inputBorder
130
+ disabled: l.disabled,
131
+ invalid: C.value,
132
+ ring: e.inputBorder
130
133
  }, {
131
134
  default: r(() => {
132
- var w, C, S, P, L;
135
+ var h, S, P, L, N;
133
136
  return [
134
- l.$slots["addon-left"] ? (s(), m(i(K), {
137
+ e.$slots["addon-left"] ? (s(), m(i(z), {
135
138
  key: 0,
136
- disabled: e.disabled
139
+ disabled: l.disabled
137
140
  }, {
138
141
  default: r(() => [
139
- p(l.$slots, "addon-left")
142
+ p(e.$slots, "addon-left")
140
143
  ]),
141
144
  _: 3
142
- }, 8, ["disabled"])) : T("", !0),
143
- d(i(me), j({
145
+ }, 8, ["disabled"])) : j("", !0),
146
+ d(i(ce), D({
144
147
  ref_key: "dropdown",
145
148
  ref: g
146
- }, e, {
149
+ }, l, {
147
150
  modelValue: o.value,
148
151
  "onUpdate:modelValue": a[0] || (a[0] = (t) => o.value = t),
149
- "aria-describedby": e.label + "error",
150
- "filter-placeholder": e.filterPlaceholder || i(f).filterPlaceholder,
151
- invalid: M.value,
152
+ "aria-describedby": l.label + "error",
153
+ "filter-placeholder": e.$t(l.filterPlaceholder || i(f).filterPlaceholder),
154
+ invalid: C.value,
152
155
  options: V.value,
153
- placeholder: Q.value,
156
+ placeholder: e.$t(X.value),
154
157
  pt: {
155
- list: (w = i(n)) == null ? void 0 : w.list({ props: e }),
156
- panel: (C = i(n)) == null ? void 0 : C.panel({ props: e }),
157
- virtualScroller: (S = i(n)) == null ? void 0 : S.virtualScroller({ props: e }),
158
- wrapper: (P = i(n)) == null ? void 0 : P.wrapper({ props: e })
158
+ list: (h = i(n)) == null ? void 0 : h.list({ props: l }),
159
+ panel: (S = i(n)) == null ? void 0 : S.panel({ props: l }),
160
+ virtualScroller: (P = i(n)) == null ? void 0 : P.virtualScroller({ props: l }),
161
+ wrapper: (L = i(n)) == null ? void 0 : L.wrapper({ props: l })
159
162
  },
160
- "virtual-scroller-options": ((L = V.value) == null ? void 0 : L.length) > 10 ? { itemSize: 32 } : void 0,
161
- onChange: Z,
163
+ "virtual-scroller-options": ((N = V.value) == null ? void 0 : N.length) > 10 ? { itemSize: 32 } : void 0,
164
+ onChange: _,
162
165
  onHide: a[1] || (a[1] = (t) => y.value = !1),
163
- onShow: a[2] || (a[2] = (t) => (l.$emit("show"), y.value = !0))
164
- }), ie({
166
+ onShow: a[2] || (a[2] = (t) => (e.$emit("show"), y.value = !0))
167
+ }), re({
165
168
  dropdownicon: r(() => [
166
169
  d(B, v(c(i(n).dropdownicon({ state: { isShowOverlay: y.value } }))), null, 16)
167
170
  ]),
@@ -173,57 +176,57 @@ const Te = /* @__PURE__ */ ee({
173
176
  ]),
174
177
  _: 2
175
178
  }, [
176
- l.loading ? {
179
+ e.loading ? {
177
180
  name: "value",
178
181
  fn: r(({ placeholder: t }) => [
179
- re("span", v(c(i(n).loadingplaceholder)), k(t), 17)
182
+ ne("span", v(c(i(n).loadingplaceholder)), k(e.$t(t)), 17)
180
183
  ]),
181
184
  key: "0"
182
185
  } : {
183
186
  name: "value",
184
187
  fn: r((t) => [
185
- (H.value.allowNullOption ? t.value !== void 0 : t.value != null) ? p(l.$slots, "value", {
188
+ (U.value.allowNullOption ? t.value !== void 0 : t.value != null) ? p(e.$slots, "value", {
186
189
  key: 0,
187
190
  originalValue: t.value,
188
- value: h()
191
+ value: e.$t($())
189
192
  }, () => [
190
- l.valueType === "badge" ? (s(), m(ve, j({ key: 0 }, l.badgeValueProps, {
191
- label: h()
192
- }), null, 16, ["label"])) : (s(), D(E, { key: 1 }, [
193
- R(k(h()), 1)
193
+ e.valueType === "badge" ? (s(), m(ge, D({ key: 0 }, e.badgeValueProps, {
194
+ label: e.$t($())
195
+ }), null, 16, ["label"])) : (s(), E(R, { key: 1 }, [
196
+ K(k(e.$t($())), 1)
194
197
  ], 64))
195
- ]) : (s(), D(E, { key: 1 }, [
196
- R(k(t.placeholder), 1)
198
+ ]) : (s(), E(R, { key: 1 }, [
199
+ K(k(e.$t(t.placeholder)), 1)
197
200
  ], 64))
198
201
  ]),
199
202
  key: "1"
200
203
  },
201
- l.$slots.option ? {
204
+ e.$slots.option ? {
202
205
  name: "option",
203
206
  fn: r(({ option: t }) => [
204
- p(l.$slots, "option", { option: t })
207
+ p(e.$slots, "option", { option: t })
205
208
  ]),
206
209
  key: "2"
207
210
  } : void 0,
208
- l.$slots.footer ? {
211
+ e.$slots.footer ? {
209
212
  name: "footer",
210
- fn: r(({ value: t, options: x }) => [
211
- p(l.$slots, "footer", {
212
- options: x,
213
+ fn: r(({ value: t, options: ee }) => [
214
+ p(e.$slots, "footer", {
215
+ options: ee,
213
216
  value: t
214
217
  })
215
218
  ]),
216
219
  key: "3"
217
220
  } : void 0
218
221
  ]), 1040, ["modelValue", "aria-describedby", "filter-placeholder", "invalid", "options", "placeholder", "pt", "virtual-scroller-options"]),
219
- l.$slots["addon-right"] ? (s(), m(i(K), {
222
+ e.$slots["addon-right"] ? (s(), m(i(z), {
220
223
  key: 1,
221
224
  pt: {
222
- root: i(U).root({
225
+ root: i(J).root({
223
226
  props: {
224
227
  class: [
225
228
  {
226
- "!text-general-200": e.disabled
229
+ "!text-general-200": l.disabled
227
230
  }
228
231
  ]
229
232
  }
@@ -231,16 +234,16 @@ const Te = /* @__PURE__ */ ee({
231
234
  }
232
235
  }, {
233
236
  default: r(() => [
234
- p(l.$slots, "addon-right")
237
+ p(e.$slots, "addon-right")
235
238
  ]),
236
239
  _: 3
237
- }, 8, ["pt"])) : T("", !0)
240
+ }, 8, ["pt"])) : j("", !0)
238
241
  ];
239
242
  }),
240
243
  _: 3
241
244
  }, 8, ["class", "disabled", "invalid", "ring"]),
242
- d(ye, {
243
- id: e.label + "error",
245
+ d(Ve, {
246
+ id: l.label + "error",
244
247
  message: o.errorMessage
245
248
  }, null, 8, ["id", "message"])
246
249
  ]),
@@ -249,5 +252,5 @@ const Te = /* @__PURE__ */ ee({
249
252
  }
250
253
  });
251
254
  export {
252
- Te as _
255
+ Ee as _
253
256
  };
@@ -1,8 +1,8 @@
1
- import { defineComponent as $, useSlots as b, computed as w, createElementBlock as l, renderSlot as p, openBlock as o, normalizeProps as t, mergeProps as r, createCommentVNode as a, Fragment as g, createTextVNode as v, createBlock as C, toDisplayString as i, unref as u } from "vue";
1
+ import { defineComponent as y, useSlots as b, computed as w, createElementBlock as l, renderSlot as p, openBlock as o, normalizeProps as t, mergeProps as r, createCommentVNode as a, Fragment as g, createTextVNode as v, createBlock as C, toDisplayString as i, unref as u } from "vue";
2
2
  import { u as B } from "../plugins/WangsVue.es.js";
3
3
  import { m as P } from "../utils/mergePropsWithDefaults.util.es.js";
4
4
  import { _ as h } from "../icon/index.es.js";
5
- const T = /* @__PURE__ */ $({
5
+ const V = /* @__PURE__ */ y({
6
6
  __name: "FieldWrapper",
7
7
  props: {
8
8
  label: {},
@@ -15,19 +15,19 @@ const T = /* @__PURE__ */ $({
15
15
  },
16
16
  emits: ["infoClick"],
17
17
  setup(k) {
18
- const n = k, f = b(), { defaultProps: y, locale: d } = B("FieldWrapper"), s = w(() => P(n, y));
18
+ const n = k, f = b(), { defaultProps: $, locale: d } = B("FieldWrapper"), s = w(() => P(n, $));
19
19
  return (e, m) => e.$attrs["use-field-wrapper"] != !1 ? (o(), l("div", t(r({ key: 0 }, e.$preset.fieldwrapper.root)), [
20
20
  e.label || f["label-addon"] ? (o(), l("label", t(r({ key: 0 }, e.$preset.fieldwrapper.label({ props: n, slots: f }))), [
21
21
  e.label ? (o(), l(g, { key: 0 }, [
22
- v(i(e.label) + " ", 1),
23
- e.mandatory && s.value.showAsterisk ? (o(), l("span", t(r({ key: 0 }, e.$preset.fieldwrapper.arterisksign)), i(u(d).labelRequired), 17)) : a("", !0),
22
+ v(i(e.$t(e.label)) + " ", 1),
23
+ e.mandatory && s.value.showAsterisk ? (o(), l("span", t(r({ key: 0 }, e.$preset.fieldwrapper.arterisksign)), i(e.$t(u(d).labelRequired)), 17)) : a("", !0),
24
24
  e.info ? (o(), C(h, r({
25
25
  key: 1,
26
26
  info: e.info,
27
27
  "tooltip-pos": s.value.tooltipPos,
28
28
  onClick: m[0] || (m[0] = (W) => e.$emit("infoClick"))
29
29
  }, e.$preset.fieldwrapper.info, { icon: "info" }), null, 16, ["info", "tooltip-pos"])) : a("", !0),
30
- e.mandatory == !1 && s.value.showOptionalText ? (o(), l("span", t(r({ key: 2 }, e.$preset.fieldwrapper.optionaltext)), i(u(d).labelOptional), 17)) : a("", !0)
30
+ e.mandatory == !1 && s.value.showOptionalText ? (o(), l("span", t(r({ key: 2 }, e.$preset.fieldwrapper.optionaltext)), i(e.$t(u(d).labelOptional)), 17)) : a("", !0)
31
31
  ], 64)) : a("", !0),
32
32
  p(e.$slots, "label-addon")
33
33
  ], 16)) : a("", !0),
@@ -36,5 +36,5 @@ const T = /* @__PURE__ */ $({
36
36
  }
37
37
  });
38
38
  export {
39
- T as _
39
+ V as _
40
40
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as D, mergeModels as $, useModel as G, inject as Y, shallowRef as g, ref as z, reactive as H, computed as Z, onMounted as J, watch as x, createBlock as A, openBlock as f, unref as m, mergeProps as y, withCtx as M, createTextVNode as h, toDisplayString as k, createElementVNode as N, normalizeClass as B, createVNode as w, createCommentVNode as S, createElementBlock as F, withModifiers as Q, normalizeProps as W, Fragment as C } from "vue";
1
+ import { defineComponent as D, mergeModels as U, useModel as G, inject as Y, shallowRef as g, ref as z, reactive as H, computed as Z, onMounted as J, watch as k, createBlock as A, openBlock as f, unref as m, mergeProps as y, withCtx as M, createTextVNode as b, toDisplayString as h, createElementVNode as C, normalizeClass as B, createVNode as w, createCommentVNode as x, createElementBlock as F, withModifiers as Q, normalizeProps as W, Fragment as N } from "vue";
2
2
  import { u as X } from "../vendor/vee-validate/dist/vee-validate.esm.es.js";
3
3
  import { u as ee } from "../utils/baseToast.util.es.js";
4
4
  import { s as ae } from "../vendor/primevue/fileupload/fileupload.esm.es.js";
@@ -8,7 +8,7 @@ import { _ as ie } from "../button/index.es.js";
8
8
  import { _ as oe } from "../validatormessage/index.es.js";
9
9
  const te = { class: "'!mt-0 font-light text-xs text-general-500 dark:text-general-100'" }, re = 1048576, ge = /* @__PURE__ */ D({
10
10
  __name: "FileUpload",
11
- props: /* @__PURE__ */ $({
11
+ props: /* @__PURE__ */ U({
12
12
  accept: {},
13
13
  disabled: { type: Boolean },
14
14
  maxFileSize: {},
@@ -33,9 +33,9 @@ const te = { class: "'!mt-0 font-light text-xs text-general-500 dark:text-genera
33
33
  modelValue: {},
34
34
  modelModifiers: {}
35
35
  }),
36
- emits: /* @__PURE__ */ $(["select", "update:modelValue", "upload", "error"], ["update:modelValue"]),
37
- setup(T, { emit: R }) {
38
- const V = ee(), r = G(T, "modelValue"), a = T, _ = R, { fileupload: c = {} } = Y("preset", {}), i = g(), t = g(), o = g(), E = z(), n = H({ value: void 0 }), q = Z(() => !!n.errorMessage || (u.value ? u.value.length > 0 : !1)), d = g(!1);
36
+ emits: /* @__PURE__ */ U(["select", "update:modelValue", "upload", "error"], ["update:modelValue"]),
37
+ setup(S, { emit: R }) {
38
+ const V = ee(), r = G(S, "modelValue"), a = S, E = R, { fileupload: c = {} } = Y("preset", {}), i = g(), t = g(), o = g(), _ = z(), n = H({ value: void 0 }), q = Z(() => !!n.errorMessage || (u.value ? u.value.length > 0 : !1)), d = g(!1);
39
39
  J(() => {
40
40
  a.useValidator && Object.assign(
41
41
  n,
@@ -61,11 +61,11 @@ const te = { class: "'!mt-0 font-light text-xs text-general-500 dark:text-genera
61
61
  try {
62
62
  if (!e.files || e.files.length === 0)
63
63
  return;
64
- a.multiple ? (o.value = e.files, i.value = e.files.map((s) => s.name), _("select", e.files)) : (o.value = e.files[0], i.value = (l = e.files[0]) == null ? void 0 : l.name, _("select", e.files[0]));
64
+ a.multiple ? (o.value = e.files, i.value = e.files.map((s) => s.name), E("select", e.files)) : (o.value = e.files[0], i.value = (l = e.files[0]) == null ? void 0 : l.name, E("select", e.files[0]));
65
65
  } catch (s) {
66
66
  console.error(s);
67
67
  }
68
- }, U = (e, l) => {
68
+ }, T = (e, l) => {
69
69
  a.disabled || d.value || (u.value = void 0, new Promise((s, p) => {
70
70
  try {
71
71
  l(), s();
@@ -84,16 +84,16 @@ const te = { class: "'!mt-0 font-light text-xs text-general-500 dark:text-genera
84
84
  }, u = z(), P = (e) => {
85
85
  u.value = e;
86
86
  }, K = (e, l, s) => {
87
- (e.key === "Enter" || e.key === " ") && U(l, s);
87
+ (e.key === "Enter" || e.key === " ") && T(l, s);
88
88
  };
89
- return x(o, (e) => {
89
+ return k(o, (e) => {
90
90
  n.value = e, r.value = e, u.value = void 0, t.value = void 0;
91
- }), x(r, (e) => {
92
- Array.isArray(e) && a.multiple ? (o.value = e, i.value = e.map((l) => l.name)) : e instanceof File ? (o.value = e, i.value = e.name) : (o.value = void 0, i.value = void 0), n.value = e, "messages" in E.value && (E.value.messages = []), u.value = void 0, t.value = void 0;
93
- }), x(u, (e) => {
91
+ }), k(r, (e) => {
92
+ Array.isArray(e) && a.multiple ? (o.value = e, i.value = e.map((l) => l.name)) : e instanceof File ? (o.value = e, i.value = e.name) : (o.value = void 0, i.value = void 0), n.value = e, "messages" in _.value && (_.value.messages = []), u.value = void 0, t.value = void 0;
93
+ }), k(u, (e) => {
94
94
  if (e && e.length > 0) {
95
95
  const l = e[0].replace("{2}", a.accept || "").replace("{2.1}", a.fileExtensions || "");
96
- l.includes("Invalid file size") && _("error", "FILE_SIZE_TOO_LARGE"), j(l), a.useErrorToast && V.add({
96
+ l.includes("Invalid file size") && E("error", "FILE_SIZE_TOO_LARGE"), j(l), a.useErrorToast && V.add({
97
97
  message: l,
98
98
  severity: "error"
99
99
  }), o.value = void 0, i.value = void 0;
@@ -101,14 +101,16 @@ const te = { class: "'!mt-0 font-light text-xs text-general-500 dark:text-genera
101
101
  t.value = void 0;
102
102
  }), (e, l) => (f(), A(m(ae), y(a, {
103
103
  ref_key: "fileUpload",
104
- ref: E,
104
+ ref: _,
105
+ "cancel-label": e.$t("Cancel"),
105
106
  "file-limit": e.multiple ? void 0 : 1,
106
107
  pt: { input: { style: "display: none" } },
108
+ "upload-label": e.$t(a.uploadLabel),
107
109
  onSelect: L,
108
110
  onUpload: l[0] || (l[0] = (s) => e.$emit("upload", s))
109
111
  }), {
110
112
  header: M(({ files: s, chooseCallback: p, clearCallback: v }) => [
111
- N("div", {
113
+ C("div", {
112
114
  class: B([{ "grid-cols-[auto,max-content]": a.withUpload }, "grid gap-3 items-end"])
113
115
  }, [
114
116
  w(le, y(m(c).wrapper, {
@@ -123,12 +125,12 @@ const te = { class: "'!mt-0 font-light text-xs text-general-500 dark:text-genera
123
125
  invalid: q.value,
124
126
  "model-value": Array.isArray(i.value) ? i.value.join(", ") : i.value,
125
127
  placeholder: a.placeholder,
126
- onClick: (b) => U(p, v),
127
- onKeydown: Q((b) => K(b, p, v), ["prevent"])
128
+ onClick: ($) => T(p, v),
129
+ onKeydown: Q(($) => K($, p, v), ["prevent"])
128
130
  }, {
129
- "addon-left": M(() => l[1] || (l[1] = [
130
- h(" Browse")
131
- ])),
131
+ "addon-left": M(() => [
132
+ b(h(e.$t("Browse")), 1)
133
+ ]),
132
134
  _: 2
133
135
  }, 1032, ["disabled", "input-class", "invalid", "model-value", "placeholder", "onClick", "onKeydown"]),
134
136
  a.fileExtensions || a.fileRequirements || n.errorMessage || t.value || a.validatorMessage ? (f(), F("div", {
@@ -143,32 +145,34 @@ const te = { class: "'!mt-0 font-light text-xs text-general-500 dark:text-genera
143
145
  message: t.value ?? n.errorMessage
144
146
  }, null, 8, ["class", "message"]),
145
147
  a.fileExtensions || a.fileRequirements ? (f(), F("div", W(y({ key: 0 }, m(c).requirements)), [
146
- N("small", te, [
147
- e.fileRequirements ? (f(), F(C, { key: 0 }, [
148
- h(k(e.fileRequirements), 1)
149
- ], 64)) : (f(), F(C, { key: 1 }, [
150
- h(k(a.maxFileSize ? `${a.fileExtensions}. max file ${Math.round(a.maxFileSize / re)} MB` : `${a.fileExtensions} file`), 1)
148
+ C("small", te, [
149
+ e.fileRequirements ? (f(), F(N, { key: 0 }, [
150
+ b(h(e.$t(e.fileRequirements)), 1)
151
+ ], 64)) : (f(), F(N, { key: 1 }, [
152
+ b(h(e.$t(
153
+ a.maxFileSize ? `${a.fileExtensions}. max file ${Math.round(a.maxFileSize / re)} MB` : `${a.fileExtensions} file`
154
+ )), 1)
151
155
  ], 64))
152
156
  ])
153
- ], 16)) : S("", !0)
154
- ], 2)) : S("", !0)
157
+ ], 16)) : x("", !0)
158
+ ], 2)) : x("", !0)
155
159
  ]),
156
160
  _: 2
157
161
  }, 1040, ["error-messages", "label", "mandatory"]),
158
162
  a.withUpload ? (f(), A(ie, y({ key: 0 }, m(c).buttonupload({ props: a }), {
159
163
  disabled: a.disabled || d.value || !o.value,
160
164
  label: a.uploadLabel,
161
- onClick: (b) => O(s, v),
165
+ onClick: ($) => O(s, v),
162
166
  severity: "success",
163
167
  type: "button"
164
- }), null, 16, ["disabled", "label", "onClick"])) : S("", !0)
168
+ }), null, 16, ["disabled", "label", "onClick"])) : x("", !0)
165
169
  ], 2)
166
170
  ]),
167
171
  content: M(({ messages: s }) => [
168
- h(k(P(s)), 1)
172
+ b(h(P(s)), 1)
169
173
  ]),
170
174
  _: 1
171
- }, 16, ["file-limit"]));
175
+ }, 16, ["cancel-label", "file-limit", "upload-label"]));
172
176
  }
173
177
  });
174
178
  export {
@@ -1,9 +1,9 @@
1
- import { defineComponent as G, onMounted as K, shallowRef as u, computed as m, ref as X, watch as ee, createBlock as g, openBlock as p, createSlots as ae, withCtx as E, createCommentVNode as b, createVNode as C, createElementVNode as V, normalizeClass as M, createElementBlock as ne, Fragment as te, toDisplayString as se } from "vue";
1
+ import { defineComponent as G, onMounted as K, shallowRef as u, computed as m, ref as X, watch as ee, createBlock as g, openBlock as p, createSlots as ae, withCtx as E, createCommentVNode as b, createVNode as C, createElementVNode as V, normalizeClass as $, createElementBlock as ne, Fragment as te, toDisplayString as se } from "vue";
2
2
  import { u as le } from "../utils/baseToast.util.es.js";
3
3
  import { u as oe, W as re, g as ie } from "../buttonscan/index.es.js";
4
4
  import { _ as R } from "../button/index.es.js";
5
5
  import { _ as ce } from "../dialog/index.es.js";
6
- import { _ as $ } from "../dropdown/index.es.js";
6
+ import { _ as M } from "../dropdown/index.es.js";
7
7
  import { _ as ue } from "../icon/index.es.js";
8
8
  import { _ as de } from "../inlinemessage/index.es.js";
9
9
  const De = /* @__PURE__ */ G({
@@ -16,15 +16,15 @@ const De = /* @__PURE__ */ G({
16
16
  withoutScanBtn: { type: Boolean }
17
17
  },
18
18
  emits: ["update:visible", "scan"],
19
- setup(W, { emit: x }) {
20
- const o = W, k = x, P = le();
19
+ setup(W, { emit: P }) {
20
+ const o = W, k = P, U = le();
21
21
  K(() => {
22
22
  O();
23
23
  });
24
24
  const {
25
25
  device: _,
26
26
  devices: I,
27
- saveDevices: U,
27
+ saveDevices: x,
28
28
  setDevice: Q,
29
29
  loadDevices: z
30
30
  } = oe(), i = {
@@ -44,7 +44,7 @@ const De = /* @__PURE__ */ G({
44
44
  () => o.errorCode === "NOT_SUPPORTED_SYSTEM"
45
45
  ), H = m(() => o.searchBy === "RFID" && l.value.device), Y = m(() => o.searchBy === "QR" && r.value.device), D = m(() => !!o.searchBy && o.errorCode !== "HARDWARE_NOT_SYNCHRONIZED"), B = async (n) => {
46
46
  try {
47
- U(n);
47
+ x(n);
48
48
  const a = f.value.some(
49
49
  (s) => {
50
50
  var t, v, S;
@@ -113,7 +113,7 @@ const De = /* @__PURE__ */ G({
113
113
  B(t);
114
114
  const { error: v } = (e == null ? void 0 : e.data) ?? {};
115
115
  v === "Driver not connected to server" ? (d.value = !1, c.value = h("DRIVER_NOT_FOUND")) : t.length || (d.value = !1, c.value = h("DEVICE_NOT_CONNECTED"));
116
- } else e.status === "error_sync" && (d.value = !1, B([]), P.add({ message: "Failed to connecting scanner", severity: "error" }));
116
+ } else e.status === "error_sync" && (d.value = !1, B([]), U.add({ message: "Failed to connecting scanner", severity: "error" }));
117
117
  }, window.scannerWorker.postMessage({
118
118
  command: "sync",
119
119
  userId: (n = JSON.parse(localStorage.getItem("user") ?? "{}")) == null ? void 0 : n._id,
@@ -168,7 +168,7 @@ const De = /* @__PURE__ */ G({
168
168
  default: E(() => [
169
169
  c.value ? (p(), g(de, {
170
170
  key: 0,
171
- class: M(["p-[9.52px] transition"]),
171
+ class: $(["p-[9.52px] transition"]),
172
172
  message: c.value.detail,
173
173
  removable: !1,
174
174
  "show-icon": !1,
@@ -186,13 +186,13 @@ const De = /* @__PURE__ */ G({
186
186
  outlined: ""
187
187
  }, null, 8, ["disabled", "loading"]),
188
188
  V("section", {
189
- class: M([
189
+ class: $([
190
190
  "grid grid-cols-2 gap-3 justify-start w-full",
191
191
  { "opacity-60 pointer-events-none": w.value }
192
192
  ]),
193
193
  "data-ts-section": "scanner-list"
194
194
  }, [
195
- C($, {
195
+ C(M, {
196
196
  modelValue: l.value,
197
197
  "onUpdate:modelValue": [
198
198
  a[0] || (a[0] = (e) => l.value = e),
@@ -202,7 +202,7 @@ const De = /* @__PURE__ */ G({
202
202
  label: "RFID Scanner",
203
203
  "option-label": "label"
204
204
  }, null, 8, ["modelValue", "options"]),
205
- C($, {
205
+ C(M, {
206
206
  modelValue: r.value,
207
207
  "onUpdate:modelValue": [
208
208
  a[1] || (a[1] = (e) => r.value = e),
@@ -224,7 +224,7 @@ const De = /* @__PURE__ */ G({
224
224
  C(ue, {
225
225
  icon: (e = n.searchBy) == null ? void 0 : e.toLowerCase()
226
226
  }, null, 8, ["icon"]),
227
- V("h3", null, "Scan " + se(n.searchBy), 1)
227
+ V("h3", null, se(n.$t(`Scan ${n.searchBy}`)), 1)
228
228
  ];
229
229
  }),
230
230
  key: "0"