@fewangsit/wangsvue-fats 1.0.1-alpha.59 → 1.0.1-alpha.60

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.
@@ -50,8 +50,8 @@ const I = (i, s) => {
50
50
  _: 3
51
51
  }, 8, ["mouse-move", "touch-move", "touch-resize", "wheel-resize"]));
52
52
  }
53
- }), S = /* @__PURE__ */ I(R, [["__scopeId", "data-v-9031c32d"]]);
53
+ }), b = /* @__PURE__ */ I(R, [["__scopeId", "data-v-5cd98b2d"]]);
54
54
  export {
55
- S as B,
55
+ b as B,
56
56
  I as _
57
57
  };
@@ -1016,7 +1016,7 @@ const Wt = (W, B) => W.every((t) => B.includes(t)), qt = ["id"], Gt = ["rowspan"
1016
1016
  ], 16);
1017
1017
  };
1018
1018
  }
1019
- }), Ol = /* @__PURE__ */ Vt(pl, [["__scopeId", "data-v-d33ae895"]]);
1019
+ }), Ol = /* @__PURE__ */ Vt(pl, [["__scopeId", "data-v-e75977eb"]]);
1020
1020
  export {
1021
1021
  Ol as D
1022
1022
  };
@@ -231,8 +231,8 @@ const H = /* @__PURE__ */ nA(vA), j = "data:image/png;base64,iVBORw0KGgoAAAANSUh
231
231
  t[4] || (t[4] = e("span", null, "Preview", -1)),
232
232
  a(eA, {
233
233
  icon: "info",
234
- info: `This preview is only for showing the side of the\r
235
- label that printed or not. It does not show the\r
234
+ info: `This preview is only for showing the side of the
235
+ label that printed or not. It does not show the
236
236
  exact amount you entered.`,
237
237
  severity: "primary"
238
238
  })
@@ -1,10 +1,10 @@
1
- import { defineComponent as x, ref as N, shallowRef as S, onMounted as G, onBeforeUnmount as I, watch as Q, withDirectives as z, createElementBlock as k, openBlock as h, mergeProps as b, withModifiers as X, unref as w, createElementVNode as Y, Fragment as B, renderList as Z, createBlock as _, renderSlot as ee, createVNode as M, vShow as te, withCtx as ae } from "vue";
1
+ import { defineComponent as R, ref as N, shallowRef as k, onMounted as G, onBeforeUnmount as I, watch as Q, withDirectives as z, createElementBlock as S, openBlock as h, mergeProps as b, withModifiers as X, unref as w, createElementVNode as Y, Fragment as B, renderList as Z, createBlock as _, renderSlot as ee, createVNode as M, vShow as te, withCtx as ae } from "vue";
2
2
  import { _ as oe } from "../buttonselecttree/index.es.js";
3
3
  import { a as re } from "../vendor/vee-validate/dist/vee-validate.esm.es.js";
4
4
  import { e as p } from "../event-bus/index.es.js";
5
5
  import { u as se } from "../plugins/WangsVue.es.js";
6
6
  import { g as L, s as ne } from "../utils/object.util.es.js";
7
- import { _ as R } from "../button/index.es.js";
7
+ import { _ as x } from "../button/index.es.js";
8
8
  import { _ as le } from "../calendar/index.es.js";
9
9
  import { _ as ie } from "../dropdown/index.es.js";
10
10
  import { _ as ce } from "../inputrangenumber/index.es.js";
@@ -20,12 +20,12 @@ const J = (n) => {
20
20
  }, me = (n, u, o) => {
21
21
  const l = Object.keys(n), s = {};
22
22
  p.emit("multi-select:hide-overlay"), l.forEach((r) => {
23
- var f;
24
- const i = Array.isArray(n[r]), F = typeof n[r] == "string", c = i ? (f = n[r]) == null ? void 0 : f.filter((v) => v != null) : n[r];
23
+ var d;
24
+ const i = Array.isArray(n[r]), F = typeof n[r] == "string", c = i ? (d = n[r]) == null ? void 0 : d.filter((v) => v != null) : n[r];
25
25
  if ((c != null && !i || i && c.length) && !F) {
26
26
  if (Array.isArray(c) && c.every(
27
- (d) => typeof d == "number" && d > 9466848e5 && // Greater than 2000-01-01 00:00:00 UTC (milliseconds)
28
- !isNaN(new Date(d).getTime())
27
+ (f) => typeof f == "number" && f > 9466848e5 && // Greater than 2000-01-01 00:00:00 UTC (milliseconds)
28
+ !isNaN(new Date(f).getTime())
29
29
  // Converts to a valid date
30
30
  )) {
31
31
  s[r] = JSON.stringify(
@@ -58,10 +58,10 @@ const J = (n) => {
58
58
  }), p.emit("data-table:clear-selected-data", {
59
59
  tableName: u
60
60
  }), l == null || l("apply", s);
61
- }, fe = {
61
+ }, de = {
62
62
  class: "flex items-end justify-end gap-2",
63
63
  "data-wv-section": "filteractionbuttons"
64
- }, de = /* @__PURE__ */ x({
64
+ }, fe = /* @__PURE__ */ R({
65
65
  inheritAttrs: !1,
66
66
  __name: "FilterContainer",
67
67
  props: {
@@ -72,7 +72,7 @@ const J = (n) => {
72
72
  },
73
73
  emits: ["apply"],
74
74
  setup(n, { emit: u }) {
75
- const o = n, l = u, { locale: s } = se("FilterContainer"), { resetForm: r, handleSubmit: i, setValues: F } = re(), c = N({}), f = N({}), v = S(), d = N(null), T = S(!1), O = S(0);
75
+ const o = n, l = u, { locale: s } = se("FilterContainer"), { resetForm: r, handleSubmit: i, setValues: F } = re(), c = N({}), d = N({}), v = k(), f = N(null), T = k(!1), O = k(0);
76
76
  G(() => {
77
77
  V(), p.on("show-filter", C), p.on("data-table:updated", D), U();
78
78
  }), I(() => {
@@ -86,15 +86,15 @@ const J = (n) => {
86
86
  t.tableName === o.tableName && (v.value = t.data);
87
87
  }, P = async (t, a, e = {}) => {
88
88
  if (o.static && !t)
89
- f.value[a] = W(a);
89
+ d.value[a] = W(a);
90
90
  else
91
91
  try {
92
92
  c.value[a] = !0;
93
93
  const m = { [a]: !0, ...e }, y = await (t == null ? void 0 : t(m));
94
94
  if ("data" in y) {
95
95
  const { data: $ } = y;
96
- f.value[a] = $.data[a];
97
- } else Array.isArray(y) && (f.value[a] = y);
96
+ d.value[a] = $.data[a];
97
+ } else Array.isArray(y) && (d.value[a] = y);
98
98
  } catch (m) {
99
99
  console.error(m);
100
100
  } finally {
@@ -109,8 +109,8 @@ const J = (n) => {
109
109
  }
110
110
  return Array.from(a).map((e) => ({ label: e, value: e }));
111
111
  }, V = () => {
112
- if (d.value) {
113
- const { children: t } = d.value, a = d.value.childElementCount, e = a % o.fieldsPerRow;
112
+ if (f.value) {
113
+ const { children: t } = f.value, a = f.value.childElementCount, e = a % o.fieldsPerRow;
114
114
  let [m, y] = [1, 1];
115
115
  for (const $ in Array.from({ length: a })) {
116
116
  const q = Number($) === a - 1;
@@ -172,9 +172,9 @@ const J = (n) => {
172
172
  return o.static ? `${t.field}.value` : `${t.field}`;
173
173
  }
174
174
  };
175
- return Q(() => o.fields, V), (t, a) => z((h(), k("form", b({
175
+ return Q(() => o.fields, V), (t, a) => z((h(), S("form", b({
176
176
  ref_key: "container",
177
- ref: d
177
+ ref: f
178
178
  }, t.$preset.filtercontainer.root, {
179
179
  style: `grid-template-columns: repeat(${t.fieldsPerRow}, 1fr)`,
180
180
  onSubmit: a[0] || (a[0] = X(
@@ -184,7 +184,7 @@ const J = (n) => {
184
184
  )),
185
185
  "data-wv-name": "filtercontainer"
186
186
  }), [
187
- (h(!0), k(B, null, Z(w(A), (e) => (h(), k(B, {
187
+ (h(!0), S(B, null, Z(w(A), (e) => (h(), S(B, {
188
188
  key: JSON.stringify(e) + O.value
189
189
  }, [
190
190
  e.type == "rangenumber" ? (h(), _(ce, b({
@@ -203,13 +203,14 @@ const J = (n) => {
203
203
  "field-name": g(e),
204
204
  loading: c.value[e.optionField ?? e.field],
205
205
  mandatory: !1,
206
- options: f.value[e.optionField ?? e.field],
206
+ options: d.value[e.optionField ?? e.field],
207
207
  "show-optional-text": !1,
208
208
  onShow: (m) => P(
209
209
  e.fetchOptionFn,
210
210
  e.optionField ?? e.field,
211
211
  e.params
212
212
  ),
213
+ "hide-header-checkbox": "",
213
214
  "option-label": "label",
214
215
  "option-value": "value",
215
216
  "use-validator": ""
@@ -220,7 +221,7 @@ const J = (n) => {
220
221
  "field-name": g(e),
221
222
  loading: c.value[e.field],
222
223
  mandatory: !1,
223
- options: f.value[e.optionField ?? e.field],
224
+ options: d.value[e.optionField ?? e.field],
224
225
  "show-optional-text": !1,
225
226
  onShow: (m) => P(
226
227
  e.fetchOptionFn,
@@ -245,14 +246,14 @@ const J = (n) => {
245
246
  fieldName: g(e)
246
247
  })
247
248
  ], 64))), 128)),
248
- Y("div", fe, [
249
- M(R, {
249
+ Y("div", de, [
250
+ M(x, {
250
251
  label: w(s).clearFieldText,
251
252
  onClick: j,
252
253
  "data-wv-section": "clearbutton",
253
254
  text: ""
254
255
  }, null, 8, ["label"]),
255
- M(R, {
256
+ M(x, {
256
257
  label: w(s).applyText,
257
258
  onClick: w(E),
258
259
  "data-wv-section": "applybutton",
@@ -263,10 +264,10 @@ const J = (n) => {
263
264
  [te, T.value]
264
265
  ]);
265
266
  }
266
- }), Ne = /* @__PURE__ */ x({
267
+ }), Ne = /* @__PURE__ */ R({
267
268
  __name: "FilterContainer",
268
269
  setup(n) {
269
- return (u, o) => (h(), _(de, b({
270
+ return (u, o) => (h(), _(fe, b({
270
271
  fields: u.$attrs.fields
271
272
  }, u.$attrs), {
272
273
  field: ae(({ field: l, fieldName: s }) => [
@@ -133,6 +133,11 @@ export interface MultiSelectProps {
133
133
  * Decides how many selected item labels to show at most.
134
134
  */
135
135
  maxSelectedLabels?: number;
136
+
137
+ /**
138
+ * To disable select all functionality
139
+ */
140
+ hideHeaderCheckbox?: boolean;
136
141
  }
137
142
 
138
143
  /**
@@ -1,16 +1,16 @@
1
- import { defineComponent as z, onMounted as E, onUnmounted as T, inject as U, shallowRef as A, ref as R, reactive as D, computed as h, watch as v, createBlock as V, openBlock as w, withCtx as t, createVNode as i, normalizeClass as F, renderSlot as H, unref as r, 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";
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
2
  import { u as Q } from "../vendor/vee-validate/dist/vee-validate.esm.es.js";
3
- import { e as S } from "../event-bus/index.es.js";
3
+ import { e as C } from "../event-bus/index.es.js";
4
4
  import { u as X } from "../plugins/WangsVue.es.js";
5
5
  import { f as Y } from "../utils/filterOptions.util.es.js";
6
6
  import { a as Z } from "../utils/textFormatter.util.es.js";
7
7
  import { s as ee } from "../vendor/primevue/multiselect/multiselect.esm.es.js";
8
- import { _ as M } from "../button/index.es.js";
8
+ import { _ as S } from "../button/index.es.js";
9
9
  import { _ as le } from "../fieldwrapper/index.es.js";
10
10
  import { _ as c } from "../icon/index.es.js";
11
11
  import { _ as oe } from "../inputgroup/index.es.js";
12
12
  import { _ as ae } from "../validatormessage/index.es.js";
13
- const he = /* @__PURE__ */ z({
13
+ const be = /* @__PURE__ */ z({
14
14
  __name: "MultiSelect",
15
15
  props: {
16
16
  modelValue: {},
@@ -33,40 +33,41 @@ const he = /* @__PURE__ */ z({
33
33
  filterPlaceholder: {},
34
34
  display: { default: "chip" },
35
35
  selectedItemsLabel: {},
36
- maxSelectedLabels: {}
36
+ maxSelectedLabels: {},
37
+ hideHeaderCheckbox: { type: Boolean, default: !1 }
37
38
  },
38
39
  emits: ["update:modelValue", "show", "hide"],
39
- setup(B, { expose: C, emit: L }) {
40
- const e = B, P = L;
40
+ setup(M, { expose: x, emit: B }) {
41
+ const e = M, L = B;
41
42
  E(() => {
42
- x(), S.on("multi-select:hide-overlay", y);
43
- }), T(() => {
44
- S.off("multi-select:hide-overlay");
43
+ _(), C.on("multi-select:hide-overlay", g);
44
+ }), H(() => {
45
+ C.off("multi-select:hide-overlay");
45
46
  });
46
- const { locale: m } = X("MultiSelect"), n = U("preset", {}).multiselect, u = A(!1), d = R(), a = D({
47
+ const { locale: m } = X("MultiSelect"), s = T("preset", {}).multiselect, u = U(!1), d = A(), a = R({
47
48
  value: e.initialValue ? e.initialValue : e.modelValue
48
- }), _ = h(() => Y(e.options)), $ = h(() => {
49
+ }), P = b(() => Y(e.options)), $ = b(() => {
49
50
  var l;
50
51
  return m.emptySelectionErrorMessage.replace("{label}", e.label).replace(
51
52
  "{formattedLabel}",
52
53
  (l = Z(e.label)) == null ? void 0 : l.toLowerCase()
53
54
  );
54
- }), O = h(() => {
55
+ }), O = b(() => {
55
56
  var l;
56
57
  return e.loading ? m.loadingPlaceholder : e.placeholder ?? ((l = m.inputPlaceholder) == null ? void 0 : l.replace("{label}", e.label ?? "").replace("{lowercaseLabel}", (e.label ?? "").toLowerCase()));
57
- }), x = () => {
58
+ }), _ = () => {
58
59
  var l;
59
60
  e.useValidator && (Object.assign(
60
61
  a,
61
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)
62
63
  ), (l = e.initialValue) != null && l.length && (a.value = e.initialValue));
63
- }, g = () => {
64
- d.value && d.value.show();
65
64
  }, y = () => {
65
+ d.value && d.value.show();
66
+ }, g = () => {
66
67
  d.value && d.value.hide();
67
68
  }, I = (l) => {
68
69
  const o = l != null && l.length ? l : void 0;
69
- P("update:modelValue", o);
70
+ L("update:modelValue", o);
70
71
  };
71
72
  return v(
72
73
  () => a.value,
@@ -84,30 +85,30 @@ const he = /* @__PURE__ */ z({
84
85
  a.value = l;
85
86
  },
86
87
  { once: !0 }
87
- ), C({
88
+ ), x({
88
89
  isShowOverlay: u,
89
- showOverlay: g,
90
- hideOverlay: y
90
+ showOverlay: y,
91
+ hideOverlay: g
91
92
  }), (l, o) => (w(), V(le, {
92
93
  info: l.fieldInfo,
93
94
  label: e.label,
94
95
  mandatory: e.mandatory,
95
96
  "show-optional-text": l.showOptionalText
96
97
  }, {
97
- default: t(() => [
98
- i(oe, {
99
- class: F({ "rounded-none !ring-0 !w-max": l.controls }),
98
+ default: i(() => [
99
+ r(oe, {
100
+ class: D({ "rounded-none !ring-0 !w-max": l.controls }),
100
101
  disabled: e.disabled,
101
102
  invalid: !!a.errorMessage
102
103
  }, {
103
- default: t(() => {
104
- var b;
104
+ default: i(() => {
105
+ var h;
105
106
  return [
106
- i(r(ee), k(e, {
107
+ r(t(ee), k(e, {
107
108
  ref_key: "multiselect",
108
109
  ref: d,
109
110
  modelValue: a.value,
110
- "onUpdate:modelValue": o[0] || (o[0] = (s) => a.value = s),
111
+ "onUpdate:modelValue": o[0] || (o[0] = (n) => a.value = n),
111
112
  "aria-describedby": e.label + "error",
112
113
  class: [
113
114
  {
@@ -115,58 +116,70 @@ const he = /* @__PURE__ */ z({
115
116
  }
116
117
  ],
117
118
  display: e.display,
118
- "filter-placeholder": e.filterPlaceholder || r(m).filterPlaceholder,
119
+ "filter-placeholder": e.filterPlaceholder || t(m).filterPlaceholder,
119
120
  "max-selected-labels": e.maxSelectedLabels,
120
- options: _.value,
121
+ options: P.value,
121
122
  placeholder: O.value,
123
+ pt: {
124
+ headerCheckbox: {
125
+ ...t(s).headerCheckbox,
126
+ root: {
127
+ ...t(s).headerCheckbox.root,
128
+ class: [
129
+ ...t(s).headerCheckbox.root.class,
130
+ { hidden: l.hideHeaderCheckbox }
131
+ ]
132
+ }
133
+ }
134
+ },
122
135
  "selected-items-label": e.selectedItemsLabel,
123
136
  "show-toggle-all": e.filter,
124
- "virtual-scroller-options": (((b = l.options) == null ? void 0 : b.length) ?? 0) > 10 ? { itemSize: 32 } : void 0,
125
- onHide: o[1] || (o[1] = (s) => (u.value = !1, l.$emit("hide"))),
126
- onShow: o[2] || (o[2] = (s) => (l.$emit("show"), u.value = !0))
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))
127
140
  }), W({
128
- dropdownicon: t(() => [
129
- i(c, p(f(r(n).dropdownicon({ state: { isShowOverlay: u.value } }))), null, 16)
141
+ dropdownicon: i(() => [
142
+ r(c, p(f(t(s).dropdownicon({ state: { isShowOverlay: u.value } }))), null, 16)
130
143
  ]),
131
- headercheckboxicon: t(() => [
132
- i(c, { icon: "check" })
144
+ headercheckboxicon: i(() => [
145
+ r(c, { icon: "check" })
133
146
  ]),
134
- itemcheckboxicon: t(() => [
135
- i(c, { icon: "check" })
147
+ itemcheckboxicon: i(() => [
148
+ r(c, { icon: "check" })
136
149
  ]),
137
- filtericon: t(() => [
138
- i(c, p(f(r(n).filtericon)), null, 16)
150
+ filtericon: i(() => [
151
+ r(c, p(f(t(s).filtericon)), null, 16)
139
152
  ]),
140
- removetokenicon: t(({ removeCallback: s, item: N }) => [
141
- i(M, k({
142
- onClick: q((j) => s(j, N), ["stop"])
143
- }, r(n).removeTokenIcon, {
153
+ removetokenicon: i(({ removeCallback: n, item: N }) => [
154
+ r(S, k({
155
+ onClick: q((j) => n(j, N), ["stop"])
156
+ }, t(s).removeTokenIcon, {
144
157
  icon: "close",
145
158
  rounded: "",
146
159
  severity: "dark",
147
160
  text: ""
148
161
  }), null, 16, ["onClick"])
149
162
  ]),
150
- loadingicon: t(() => [
151
- i(c, p(f(r(n).loadingicon)), null, 16)
163
+ loadingicon: i(() => [
164
+ r(c, p(f(t(s).loadingicon)), null, 16)
152
165
  ]),
153
166
  _: 2
154
167
  }, [
155
168
  l.loading ? {
156
169
  name: "value",
157
- fn: t(({ placeholder: s }) => [
158
- G("span", p(f(r(n).loadingplaceholder)), J(s), 17)
170
+ fn: i(({ placeholder: n }) => [
171
+ G("span", p(f(t(s).loadingplaceholder)), J(n), 17)
159
172
  ]),
160
173
  key: "0"
161
174
  } : void 0
162
- ]), 1040, ["modelValue", "aria-describedby", "class", "display", "filter-placeholder", "max-selected-labels", "options", "placeholder", "selected-items-label", "show-toggle-all", "virtual-scroller-options"]),
163
- H(l.$slots, "trigger", {
175
+ ]), 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", {
164
177
  disabled: e.disabled
165
178
  }, () => [
166
- l.controls ? (w(), V(M, {
179
+ l.controls ? (w(), V(S, {
167
180
  key: 0,
168
181
  disabled: e.disabled,
169
- onClick: g,
182
+ onClick: y,
170
183
  class: "!rounded !ring-0",
171
184
  icon: "add"
172
185
  }, null, 8, ["disabled"])) : K("", !0)
@@ -175,7 +188,7 @@ const he = /* @__PURE__ */ z({
175
188
  }),
176
189
  _: 3
177
190
  }, 8, ["class", "disabled", "invalid"]),
178
- i(ae, {
191
+ r(ae, {
179
192
  id: e.label + "error",
180
193
  message: a.errorMessage
181
194
  }, null, 8, ["id", "message"])
@@ -185,5 +198,5 @@ const he = /* @__PURE__ */ z({
185
198
  }
186
199
  });
187
200
  export {
188
- he as _
201
+ be as _
189
202
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fewangsit/wangsvue-fats",
3
- "version": "1.0.1-alpha.59",
3
+ "version": "1.0.1-alpha.60",
4
4
  "author": "Wangsit FE Developer",
5
5
  "description": "Fixed Asset Tagsamurai VueJS Component Library",
6
6
  "type": "module",