@fewangsit/wangsvue-fats 1.0.1-alpha.40 → 1.0.1-alpha.41

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.
@@ -237,6 +237,7 @@ export interface DropdownProps {
237
237
  export interface DropdownSlots {
238
238
  'value': Slot<{ value: string; originalValue: any }>;
239
239
  'option': Slot<{ option: Option }>;
240
+ 'footer': Slot<{ options: Option[]; value: OptionValue }>;
240
241
  'addon-left': Slot;
241
242
  'addon-right': Slot;
242
243
  }
@@ -1,19 +1,19 @@
1
- import { defineComponent as x, onMounted as ee, computed as u, inject as N, ref as le, shallowRef as I, reactive as ae, watch as $, createBlock as f, openBlock as s, withCtx as r, createVNode as d, normalizeClass as oe, createCommentVNode as T, unref as t, renderSlot as m, mergeProps as j, createSlots as te, normalizeProps as v, guardReactiveProps as c, createElementVNode as ie, toDisplayString as k, createElementBlock as D, Fragment as E, createTextVNode as R, nextTick as re } from "vue";
2
- import { u as ne } from "../vendor/vee-validate/dist/vee-validate.esm.es.js";
3
- import { u as se } from "../plugins/WangsVue.es.js";
4
- import { f as de } from "../utils/filterOptions.util.es.js";
5
- import { m as ue } from "../utils/mergePropsWithDefaults.util.es.js";
6
- import { a as pe } from "../utils/textFormatter.util.es.js";
7
- import { s as fe } from "../vendor/primevue/dropdown/dropdown.esm.es.js";
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
8
  import { s as K } from "../vendor/primevue/inputgroupaddon/inputgroupaddon.esm.es.js";
9
- import { _ as me } from "../badge/index.es.js";
10
- import { _ as ve } from "../fieldwrapper/index.es.js";
9
+ import { _ as ve } from "../badge/index.es.js";
10
+ import { _ as ce } from "../fieldwrapper/index.es.js";
11
11
  import { _ as B } from "../icon/index.es.js";
12
- import { _ as ce } from "../inputgroup/index.es.js";
13
- import { _ as ge } from "../validatormessage/index.es.js";
12
+ import { _ as ge } from "../inputgroup/index.es.js";
13
+ import { _ as ye } from "../validatormessage/index.es.js";
14
14
  import { i as z } from "../vendor/lodash-es/isEqual.es.js";
15
15
  import { c as F } from "../vendor/lodash-es/cloneDeep.es.js";
16
- const Ie = /* @__PURE__ */ x({
16
+ const Te = /* @__PURE__ */ ee({
17
17
  __name: "Dropdown",
18
18
  props: {
19
19
  modelValue: { type: [String, Number, Boolean, Object], default: void 0 },
@@ -46,78 +46,78 @@ const Ie = /* @__PURE__ */ x({
46
46
  emits: ["update:modelValue", "show", "fieldInfoClick"],
47
47
  setup(W, { expose: q, emit: A }) {
48
48
  const e = W, O = A;
49
- ee(() => {
49
+ le(() => {
50
50
  X();
51
51
  });
52
- const { locale: p, defaultProps: G } = se("Dropdown"), H = u(() => ue(e, G)), n = N("preset", {}).dropdown, U = N(
52
+ const { locale: f, defaultProps: G } = de("Dropdown"), H = u(() => pe(e, G)), n = N("preset", {}).dropdown, U = N(
53
53
  "preset",
54
54
  {}
55
- ).inputgroupaddon, g = le(), y = I(!1), b = I(!1), M = u(() => e.invalid || !!a.errorMessage), a = ae({
55
+ ).inputgroupaddon, g = oe(), y = I(!1), b = I(!1), M = u(() => e.invalid || !!o.errorMessage), o = ae({
56
56
  value: e.initialValue !== void 0 ? e.initialValue : e.modelValue
57
57
  }), J = u(() => {
58
58
  var l;
59
- return p.emptySelectionErrorMessage.replace("{label}", e.label).replace(
59
+ return f.emptySelectionErrorMessage.replace("{label}", e.label).replace(
60
60
  "{formattedLabel}",
61
- (l = pe(e.label)) == null ? void 0 : l.toLowerCase()
61
+ (l = fe(e.label)) == null ? void 0 : l.toLowerCase()
62
62
  );
63
- }), V = u(() => de(e.options)), Q = u(() => {
63
+ }), V = u(() => ue(e.options)), Q = u(() => {
64
64
  var l;
65
- return e.loading ? p.loadingPlaceholder : e.placeholder ?? ((l = p.inputPlaceholder) == null ? void 0 : l.replace("{label}", e.label ?? "").replace("{lowercaseLabel}", (e.label ?? "").toLowerCase()));
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
66
  }), X = () => {
67
67
  e.useValidator && (Object.assign(
68
- a,
69
- ne(e.fieldName ?? "dropdown", (l) => !(l != null && l !== "") && e.mandatory ? typeof e.validatorMessage == "object" && "empty" in e.validatorMessage ? e.validatorMessage.empty : e.validatorMessage ?? J.value : re(Y))
70
- ), e.initialValue !== void 0 && (a.value = e.initialValue), e.invalid && a.validate());
68
+ 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
71
  }, Y = () => e.validatorMessage && e.invalid ? e.validatorMessage : !0, Z = (l) => {
72
- const { value: o } = l;
73
- e.unselectOnReselect ? b.value = !0 : O("update:modelValue", o);
72
+ const { value: a } = l;
73
+ e.unselectOnReselect ? b.value = !0 : O("update:modelValue", a);
74
74
  }, h = () => {
75
75
  if (e.optionValue) {
76
- const l = V.value.find((o) => {
77
- if (typeof o != "string")
78
- return e.dataKey ? a.value[e.dataKey] === o[e.optionValue ?? ""][e.dataKey] : z(
79
- F(o[e.optionValue ?? ""]),
80
- F(a.value)
76
+ const l = V.value.find((a) => {
77
+ 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
81
  );
82
82
  });
83
83
  if (l && typeof l != "string")
84
84
  return l[e.optionLabel ?? ""];
85
- } else if (a.value && typeof a.value == "object" && e.optionLabel && e.optionLabel in a.value)
86
- return a.value[e.optionLabel];
87
- return a.value;
85
+ } else if (o.value && typeof o.value == "object" && e.optionLabel && e.optionLabel in o.value)
86
+ return o.value[e.optionLabel];
87
+ return o.value;
88
88
  }, _ = () => {
89
89
  g.value && g.value.show();
90
90
  };
91
91
  return $(
92
92
  () => e.initialValue,
93
93
  (l) => {
94
- a.value = l;
94
+ o.value = l;
95
95
  },
96
96
  { once: !0 }
97
97
  ), $(
98
98
  () => e.modelValue,
99
99
  (l) => {
100
- a.value = l;
100
+ o.value = l;
101
101
  }
102
102
  ), $(
103
- () => a.value,
104
- (l, o) => {
103
+ () => o.value,
104
+ (l, a) => {
105
105
  setTimeout(() => {
106
- e.unselectOnReselect && b.value && (z(l, o) && l !== void 0 && (a.value = void 0), b.value = !1, O("update:modelValue", a.value));
106
+ e.unselectOnReselect && b.value && (z(l, a) && l !== void 0 && (o.value = void 0), b.value = !1, O("update:modelValue", o.value));
107
107
  }, 0);
108
108
  }
109
109
  ), q({
110
110
  showOverlay: _
111
- }), (l, o) => (s(), f(ve, {
111
+ }), (l, a) => (s(), m(ce, {
112
112
  info: l.fieldInfo,
113
113
  label: e.label,
114
114
  mandatory: e.mandatory,
115
115
  "show-optional-text": l.showOptionalText,
116
- onInfoClick: o[3] || (o[3] = (w) => l.$emit("fieldInfoClick"))
116
+ onInfoClick: a[3] || (a[3] = (w) => l.$emit("fieldInfoClick"))
117
117
  }, {
118
118
  default: r(() => [
119
- d(ce, {
120
- class: oe([
119
+ d(ge, {
120
+ class: te([
121
121
  {
122
122
  "grid grid-cols-[max-content,1fr,max-content]": l.$slots["addon-left"] && l.$slots["addon-right"],
123
123
  "grid grid-cols-[1fr,max-content]": !l.$slots["addon-left"] && l.$slots["addon-right"],
@@ -131,85 +131,95 @@ const Ie = /* @__PURE__ */ x({
131
131
  default: r(() => {
132
132
  var w, C, S, P, L;
133
133
  return [
134
- l.$slots["addon-left"] ? (s(), f(t(K), {
134
+ l.$slots["addon-left"] ? (s(), m(i(K), {
135
135
  key: 0,
136
136
  disabled: e.disabled
137
137
  }, {
138
138
  default: r(() => [
139
- m(l.$slots, "addon-left")
139
+ p(l.$slots, "addon-left")
140
140
  ]),
141
141
  _: 3
142
142
  }, 8, ["disabled"])) : T("", !0),
143
- d(t(fe), j({
143
+ d(i(me), j({
144
144
  ref_key: "dropdown",
145
145
  ref: g
146
146
  }, e, {
147
- modelValue: a.value,
148
- "onUpdate:modelValue": o[0] || (o[0] = (i) => a.value = i),
147
+ modelValue: o.value,
148
+ "onUpdate:modelValue": a[0] || (a[0] = (t) => o.value = t),
149
149
  "aria-describedby": e.label + "error",
150
- "filter-placeholder": e.filterPlaceholder || t(p).filterPlaceholder,
150
+ "filter-placeholder": e.filterPlaceholder || i(f).filterPlaceholder,
151
151
  invalid: M.value,
152
152
  options: V.value,
153
153
  placeholder: Q.value,
154
154
  pt: {
155
- list: (w = t(n)) == null ? void 0 : w.list({ props: e }),
156
- panel: (C = t(n)) == null ? void 0 : C.panel({ props: e }),
157
- virtualScroller: (S = t(n)) == null ? void 0 : S.virtualScroller({ props: e }),
158
- wrapper: (P = t(n)) == null ? void 0 : P.wrapper({ props: e })
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 })
159
159
  },
160
160
  "virtual-scroller-options": ((L = V.value) == null ? void 0 : L.length) > 10 ? { itemSize: 32 } : void 0,
161
161
  onChange: Z,
162
- onHide: o[1] || (o[1] = (i) => y.value = !1),
163
- onShow: o[2] || (o[2] = (i) => (l.$emit("show"), y.value = !0))
164
- }), te({
162
+ onHide: a[1] || (a[1] = (t) => y.value = !1),
163
+ onShow: a[2] || (a[2] = (t) => (l.$emit("show"), y.value = !0))
164
+ }), ie({
165
165
  dropdownicon: r(() => [
166
- d(B, v(c(t(n).dropdownicon({ state: { isShowOverlay: y.value } }))), null, 16)
166
+ d(B, v(c(i(n).dropdownicon({ state: { isShowOverlay: y.value } }))), null, 16)
167
167
  ]),
168
168
  loadingicon: r(() => [
169
- d(B, v(c(t(n).loadingicon)), null, 16)
169
+ d(B, v(c(i(n).loadingicon)), null, 16)
170
170
  ]),
171
171
  filtericon: r(() => [
172
- d(B, v(c(t(n).filtericon)), null, 16)
172
+ d(B, v(c(i(n).filtericon)), null, 16)
173
173
  ]),
174
174
  _: 2
175
175
  }, [
176
176
  l.loading ? {
177
177
  name: "value",
178
- fn: r(({ placeholder: i }) => [
179
- ie("span", v(c(t(n).loadingplaceholder)), k(i), 17)
178
+ fn: r(({ placeholder: t }) => [
179
+ re("span", v(c(i(n).loadingplaceholder)), k(t), 17)
180
180
  ]),
181
181
  key: "0"
182
182
  } : {
183
183
  name: "value",
184
- fn: r((i) => [
185
- (H.value.allowNullOption ? i.value !== void 0 : i.value != null) ? m(l.$slots, "value", {
184
+ fn: r((t) => [
185
+ (H.value.allowNullOption ? t.value !== void 0 : t.value != null) ? p(l.$slots, "value", {
186
186
  key: 0,
187
- originalValue: i.value,
187
+ originalValue: t.value,
188
188
  value: h()
189
189
  }, () => [
190
- l.valueType === "badge" ? (s(), f(me, j({ key: 0 }, l.badgeValueProps, {
190
+ l.valueType === "badge" ? (s(), m(ve, j({ key: 0 }, l.badgeValueProps, {
191
191
  label: h()
192
192
  }), null, 16, ["label"])) : (s(), D(E, { key: 1 }, [
193
193
  R(k(h()), 1)
194
194
  ], 64))
195
195
  ]) : (s(), D(E, { key: 1 }, [
196
- R(k(i.placeholder), 1)
196
+ R(k(t.placeholder), 1)
197
197
  ], 64))
198
198
  ]),
199
199
  key: "1"
200
200
  },
201
201
  l.$slots.option ? {
202
202
  name: "option",
203
- fn: r(({ option: i }) => [
204
- m(l.$slots, "option", { option: i })
203
+ fn: r(({ option: t }) => [
204
+ p(l.$slots, "option", { option: t })
205
205
  ]),
206
206
  key: "2"
207
+ } : void 0,
208
+ l.$slots.footer ? {
209
+ name: "footer",
210
+ fn: r(({ value: t, options: x }) => [
211
+ p(l.$slots, "footer", {
212
+ options: x,
213
+ value: t
214
+ })
215
+ ]),
216
+ key: "3"
207
217
  } : void 0
208
218
  ]), 1040, ["modelValue", "aria-describedby", "filter-placeholder", "invalid", "options", "placeholder", "pt", "virtual-scroller-options"]),
209
- l.$slots["addon-right"] ? (s(), f(t(K), {
219
+ l.$slots["addon-right"] ? (s(), m(i(K), {
210
220
  key: 1,
211
221
  pt: {
212
- root: t(U).root({
222
+ root: i(U).root({
213
223
  props: {
214
224
  class: [
215
225
  {
@@ -221,7 +231,7 @@ const Ie = /* @__PURE__ */ x({
221
231
  }
222
232
  }, {
223
233
  default: r(() => [
224
- m(l.$slots, "addon-right")
234
+ p(l.$slots, "addon-right")
225
235
  ]),
226
236
  _: 3
227
237
  }, 8, ["pt"])) : T("", !0)
@@ -229,9 +239,9 @@ const Ie = /* @__PURE__ */ x({
229
239
  }),
230
240
  _: 3
231
241
  }, 8, ["class", "disabled", "invalid", "ring"]),
232
- d(ge, {
242
+ d(ye, {
233
243
  id: e.label + "error",
234
- message: a.errorMessage
244
+ message: o.errorMessage
235
245
  }, null, 8, ["id", "message"])
236
246
  ]),
237
247
  _: 3
@@ -239,5 +249,5 @@ const Ie = /* @__PURE__ */ x({
239
249
  }
240
250
  });
241
251
  export {
242
- Ie as _
252
+ Te as _
243
253
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fewangsit/wangsvue-fats",
3
- "version": "1.0.1-alpha.40",
3
+ "version": "1.0.1-alpha.41",
4
4
  "author": "Wangsit FE Developer",
5
5
  "description": "Fixed Asset Tagsamurai VueJS Component Library",
6
6
  "type": "module",