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

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
- }), b = /* @__PURE__ */ I(R, [["__scopeId", "data-v-5cd98b2d"]]);
53
+ }), S = /* @__PURE__ */ I(R, [["__scopeId", "data-v-9031c32d"]]);
54
54
  export {
55
- b as B,
55
+ S 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-e75977eb"]]);
1019
+ }), Ol = /* @__PURE__ */ Vt(pl, [["__scopeId", "data-v-d33ae895"]]);
1020
1020
  export {
1021
1021
  Ol as D
1022
1022
  };
@@ -1,4 +1,6 @@
1
- import { DefineComponent } from 'vue';
1
+ import { Slot } from 'vue';
2
+
3
+ import { ClassComponent } from '../ts-helpers';
2
4
 
3
5
  /**
4
6
  * DatePicker component props
@@ -47,6 +49,15 @@ export type DatePickerEmits = {
47
49
  'update:modelValue': [days?: number[]];
48
50
  };
49
51
 
50
- declare const DatePicker: DefineComponent<DatePickerProps, DatePickerEmits>;
52
+ export interface DatePickerSlots {
53
+ header: Slot;
54
+ footer: Slot;
55
+ }
56
+
57
+ declare class DatePicker extends ClassComponent<
58
+ DatePickerProps,
59
+ DatePickerSlots,
60
+ DatePickerEmits
61
+ > {}
51
62
 
52
63
  export default DatePicker;
@@ -1,13 +1,19 @@
1
- import { defineComponent as $, onMounted as B, reactive as C, shallowRef as f, computed as D, watch as _, createElementBlock as c, openBlock as d, Fragment as v, createVNode as o, unref as s, withCtx as m, renderList as M, toDisplayString as E } from "vue";
2
- import { u as N } from "../vendor/vee-validate/dist/vee-validate.esm.es.js";
3
- import { u as S } from "../plugins/basei18n.es.js";
4
- import { s as F } from "../vendor/primevue/inputtext/inputtext.esm.es.js";
5
- import { s as P } from "../vendor/primevue/overlaypanel/overlaypanel.esm.es.js";
6
- import { _ as R } from "../fieldwrapper/index.es.js";
7
- import { _ as T } from "../icon/index.es.js";
8
- import { _ as j } from "../inputgroup/index.es.js";
9
- import { _ as A } from "../validatormessage/index.es.js";
10
- const I = ["aria-selected", "data-in-range", "onClick"], Q = /* @__PURE__ */ $({
1
+ import { defineComponent as B, onMounted as D, reactive as M, shallowRef as f, computed as N, watch as _, createElementBlock as s, openBlock as i, Fragment as v, createVNode as o, unref as c, withCtx as m, createCommentVNode as y, createElementVNode as E, renderSlot as h, renderList as S, toDisplayString as F } from "vue";
2
+ import { u as P } from "../vendor/vee-validate/dist/vee-validate.esm.es.js";
3
+ import { u as R } from "../plugins/basei18n.es.js";
4
+ import { s as T } from "../vendor/primevue/inputtext/inputtext.esm.es.js";
5
+ import { s as j } from "../vendor/primevue/overlaypanel/overlaypanel.esm.es.js";
6
+ import { _ as A } from "../fieldwrapper/index.es.js";
7
+ import { _ as I } from "../icon/index.es.js";
8
+ import { _ as K } from "../inputgroup/index.es.js";
9
+ import { _ as L } from "../validatormessage/index.es.js";
10
+ const O = {
11
+ key: 0,
12
+ class: "mb-2.5"
13
+ }, Y = { class: "grid grid-cols-7 grid-rows-[repeat(5,max-content)]" }, q = ["aria-selected", "data-in-range", "onClick"], z = {
14
+ key: 1,
15
+ class: "mt-2.5"
16
+ }, te = /* @__PURE__ */ B({
11
17
  __name: "DatePicker",
12
18
  props: {
13
19
  modelValue: {},
@@ -20,16 +26,16 @@ const I = ["aria-selected", "data-in-range", "onClick"], Q = /* @__PURE__ */ $({
20
26
  errorMessage: {}
21
27
  },
22
28
  emits: ["update:modelValue"],
23
- setup(y) {
24
- const n = y;
25
- B(() => {
29
+ setup(k) {
30
+ const n = k;
31
+ D(() => {
26
32
  n.useValidator && Object.assign(
27
33
  a,
28
- N(
34
+ P(
29
35
  n.fieldName ?? "date",
30
36
  (e) => {
31
37
  var t;
32
- return !(e != null && e.length) && n.mandatory ? u(((t = n.errorMessage) == null ? void 0 : t.empty) ?? "You must pick a date") : !0;
38
+ return !(e != null && e.length) && n.mandatory ? d(((t = n.errorMessage) == null ? void 0 : t.empty) ?? "You must pick a date") : !0;
33
39
  },
34
40
  {
35
41
  initialValue: n.initialValue ?? []
@@ -37,18 +43,18 @@ const I = ["aria-selected", "data-in-range", "onClick"], Q = /* @__PURE__ */ $({
37
43
  )
38
44
  );
39
45
  });
40
- const { t: u } = S(), a = C({ value: [] }), i = f(), p = f(), h = D(() => {
46
+ const { t: d } = R(), a = M({ value: [] }), u = f(), p = f(), V = N(() => {
41
47
  const e = a.value[0], t = a.value[1];
42
48
  return t && e !== t ? e + " - " + t : e == null ? void 0 : e.toString();
43
- }), k = Array.from({ length: 31 }, (e, t) => t + 1), x = (e) => {
49
+ }), b = Array.from({ length: 31 }, (e, t) => t + 1), $ = (e) => {
44
50
  var l;
45
51
  const t = a.value[0], r = a.value[1];
46
- t != null && r != null && t === r ? (a.value[1] = e, (l = i.value) == null || l.hide()) : a.value = [e, e], a.value.sort((b, w) => b - w);
52
+ t != null && r != null && t === r ? (a.value[1] = e, (l = u.value) == null || l.hide()) : a.value = [e, e], a.value.sort((w, C) => w - C);
47
53
  }, g = (e) => {
48
54
  var r, l;
49
55
  const t = ((r = p.value) == null ? void 0 : r.$el) || null;
50
- t && i.value && t.focus(), (l = i.value) == null || l.toggle(e);
51
- }, V = (e) => {
56
+ t && u.value && t.focus(), (l = u.value) == null || l.toggle(e);
57
+ }, x = (e) => {
52
58
  var t;
53
59
  if (e.key === "Enter" || e.key === " ") {
54
60
  e.preventDefault();
@@ -74,28 +80,28 @@ const I = ["aria-selected", "data-in-range", "onClick"], Q = /* @__PURE__ */ $({
74
80
  (e) => {
75
81
  a.value = e ?? [];
76
82
  }
77
- ), (e, t) => (d(), c(v, null, [
78
- o(R, {
79
- label: e.label ? s(u)(e.label) : void 0,
83
+ ), (e, t) => (i(), s(v, null, [
84
+ o(A, {
85
+ label: e.label ? c(d)(e.label) : void 0,
80
86
  mandatory: e.mandatory
81
87
  }, {
82
88
  default: m(() => [
83
- o(j, {
89
+ o(K, {
84
90
  invalid: !!a.errorMessage,
85
91
  onClick: g,
86
92
  class: "grid grid-cols-[1fr,max-content] !items-center gap-1 px-3 py-1"
87
93
  }, {
88
94
  default: m(() => [
89
- o(s(F), {
95
+ o(c(T), {
90
96
  ref_key: "inputtext",
91
97
  ref: p,
92
- "model-value": h.value,
93
- placeholder: s(u)("Select date"),
94
- onKeydown: V,
98
+ "model-value": V.value,
99
+ placeholder: c(d)("Select date"),
100
+ onKeydown: x,
95
101
  class: "!p-0",
96
102
  readonly: ""
97
103
  }, null, 8, ["model-value", "placeholder"]),
98
- o(T, {
104
+ o(I, {
99
105
  class: "w-4 h-4 shrink-0 !text-general-500",
100
106
  "data-ts-section": "inputtrigger",
101
107
  icon: "calendar"
@@ -103,38 +109,46 @@ const I = ["aria-selected", "data-in-range", "onClick"], Q = /* @__PURE__ */ $({
103
109
  ]),
104
110
  _: 1
105
111
  }, 8, ["invalid"]),
106
- o(A, {
112
+ o(L, {
107
113
  message: a.errorMessage,
108
114
  "data-test": "datepicker-validator-message"
109
115
  }, null, 8, ["message"])
110
116
  ]),
111
117
  _: 1
112
118
  }, 8, ["label", "mandatory"]),
113
- o(s(P), {
119
+ o(c(j), {
114
120
  ref_key: "panel",
115
- ref: i,
121
+ ref: u,
116
122
  pt: {
117
123
  content: {
118
- class: "grid grid-cols-7 grid-rows-[repeat(5,max-content)] p-6"
124
+ class: "p-6"
119
125
  }
120
126
  },
121
127
  class: "border-none !mt-0 !shadow-panel"
122
128
  }, {
123
129
  default: m(() => [
124
- (d(!0), c(v, null, M(s(k), (r) => (d(), c("span", {
125
- key: r,
126
- "aria-selected": a.value.includes(r),
127
- "data-in-range": a.value[0] < r && r < a.value[1],
128
- onClick: (l) => x(r),
129
- class: "text-xs text-general-800 bg-white hover:bg-primary-100 rounded-[20px] [&[data-in-range='true']]:bg-primary-200 [&[data-in-range='true']]:text-general-800 [&[data-in-range='true']]:rounded-[0] [&[aria-selected='true']]:bg-primary-500 [&[aria-selected='true']]:text-white text-center p-2 cursor-pointer",
130
- "data-ts-section": "date"
131
- }, E(r), 9, I))), 128))
130
+ e.$slots.header ? (i(), s("div", O, [
131
+ h(e.$slots, "header")
132
+ ])) : y("", !0),
133
+ E("div", Y, [
134
+ (i(!0), s(v, null, S(c(b), (r) => (i(), s("span", {
135
+ key: r,
136
+ "aria-selected": a.value.includes(r),
137
+ "data-in-range": a.value[0] < r && r < a.value[1],
138
+ onClick: (l) => $(r),
139
+ class: "text-xs text-general-800 bg-white hover:bg-primary-100 rounded-[20px] [&[data-in-range='true']]:bg-primary-200 [&[data-in-range='true']]:text-general-800 [&[data-in-range='true']]:rounded-[0] [&[aria-selected='true']]:bg-primary-500 [&[aria-selected='true']]:text-white text-center p-2 cursor-pointer",
140
+ "data-ts-section": "date"
141
+ }, F(r), 9, q))), 128))
142
+ ]),
143
+ e.$slots.footer ? (i(), s("div", z, [
144
+ h(e.$slots, "footer")
145
+ ])) : y("", !0)
132
146
  ]),
133
- _: 1
147
+ _: 3
134
148
  }, 512)
135
149
  ], 64));
136
150
  }
137
151
  });
138
152
  export {
139
- Q as _
153
+ te as _
140
154
  };
@@ -1,4 +1,6 @@
1
- import { DefineComponent } from 'vue';
1
+ import { Slot } from 'vue';
2
+
3
+ import { ClassComponent } from '../ts-helpers';
2
4
 
3
5
  /**
4
6
  * DayPicker component props
@@ -47,6 +49,15 @@ export type DayPickerEmits = {
47
49
  'update:modelValue': [days?: number[]];
48
50
  };
49
51
 
50
- declare const DayPicker: DefineComponent<DayPickerProps, DayPickerEmits>;
52
+ export interface DayPickerSlots {
53
+ header: Slot;
54
+ footer: Slot;
55
+ }
56
+
57
+ declare class DayPicker extends ClassComponent<
58
+ DayPickerProps,
59
+ DayPickerSlots,
60
+ DayPickerEmits
61
+ > {}
51
62
 
52
63
  export default DayPicker;
@@ -1,13 +1,19 @@
1
- import { defineComponent as $, onMounted as C, reactive as M, shallowRef as g, computed as B, watch as y, createElementBlock as f, openBlock as v, Fragment as _, createVNode as s, unref as o, withCtx as m, renderList as S, createElementVNode as D, normalizeClass as N, toDisplayString as F } from "vue";
2
- import { u as T } from "../vendor/vee-validate/dist/vee-validate.esm.es.js";
3
- import { u as E } from "../plugins/basei18n.es.js";
4
- import { s as P } from "../vendor/primevue/inputtext/inputtext.esm.es.js";
5
- import { s as R } from "../vendor/primevue/overlaypanel/overlaypanel.esm.es.js";
6
- import { _ as j } from "../fieldwrapper/index.es.js";
7
- import { _ as z } from "../icon/index.es.js";
8
- import { _ as I } from "../inputgroup/index.es.js";
9
- import { _ as L } from "../validatormessage/index.es.js";
10
- const O = ["aria-selected", "data-in-range", "onClick"], U = /* @__PURE__ */ $({
1
+ import { defineComponent as B, onMounted as N, reactive as x, shallowRef as f, computed as D, watch as v, createElementBlock as u, openBlock as c, Fragment as _, createVNode as n, unref as o, withCtx as g, createCommentVNode as h, createElementVNode as k, renderSlot as V, renderList as F, normalizeClass as T, toDisplayString as E } from "vue";
2
+ import { u as P } from "../vendor/vee-validate/dist/vee-validate.esm.es.js";
3
+ import { u as R } from "../plugins/basei18n.es.js";
4
+ import { s as j } from "../vendor/primevue/inputtext/inputtext.esm.es.js";
5
+ import { s as z } from "../vendor/primevue/overlaypanel/overlaypanel.esm.es.js";
6
+ import { _ as I } from "../fieldwrapper/index.es.js";
7
+ import { _ as L } from "../icon/index.es.js";
8
+ import { _ as O } from "../inputgroup/index.es.js";
9
+ import { _ as W } from "../validatormessage/index.es.js";
10
+ const Y = {
11
+ key: 0,
12
+ class: "mb-2.5"
13
+ }, q = { class: "grid grid-cols-3 gap-y-4" }, A = ["aria-selected", "data-in-range", "onClick"], G = {
14
+ key: 1,
15
+ class: "mt-2.5"
16
+ }, te = /* @__PURE__ */ B({
11
17
  __name: "DayPicker",
12
18
  props: {
13
19
  modelValue: {},
@@ -20,22 +26,22 @@ const O = ["aria-selected", "data-in-range", "onClick"], U = /* @__PURE__ */ $({
20
26
  errorMessage: {}
21
27
  },
22
28
  emits: ["update:modelValue"],
23
- setup(h) {
24
- const n = h;
25
- C(() => {
26
- n.useValidator && Object.assign(
29
+ setup(b) {
30
+ const s = b;
31
+ N(() => {
32
+ s.useValidator && Object.assign(
27
33
  a,
28
- T(
29
- n.fieldName ?? "day",
34
+ P(
35
+ s.fieldName ?? "day",
30
36
  (e) => {
31
37
  var t;
32
- return !(e != null && e.length) && n.mandatory ? i(((t = n.errorMessage) == null ? void 0 : t.empty) ?? "You must pick a day") : !0;
38
+ return !(e != null && e.length) && s.mandatory ? i(((t = s.errorMessage) == null ? void 0 : t.empty) ?? "You must pick a day") : !0;
33
39
  },
34
- { initialValue: n.initialValue ?? [] }
40
+ { initialValue: s.initialValue ?? [] }
35
41
  )
36
42
  );
37
43
  });
38
- const d = [
44
+ const m = [
39
45
  "Monday",
40
46
  "Tuesday",
41
47
  "Wednesday",
@@ -43,53 +49,53 @@ const O = ["aria-selected", "data-in-range", "onClick"], U = /* @__PURE__ */ $({
43
49
  "Friday",
44
50
  "Saturday",
45
51
  "Sunday"
46
- ], { t: i } = E(), a = M({ value: [] }), u = g(), p = g(), V = B(() => {
47
- const e = d[a.value[0]], t = d[a.value[1]];
52
+ ], { t: i } = R(), a = x({ value: [] }), d = f(), y = f(), $ = D(() => {
53
+ const e = m[a.value[0]], t = m[a.value[1]];
48
54
  return t && e !== t ? e + " - " + t : e;
49
- }), k = (e, t) => {
50
- var c;
55
+ }), w = (e, t) => {
56
+ var p;
51
57
  const r = a.value[0], l = a.value[1];
52
- r != null && l != null && r === l ? (a.value[1] = t, (c = u.value) == null || c.hide()) : a.value = [t, t], a.value.sort((x, w) => x - w);
53
- }, b = (e) => {
58
+ r != null && l != null && r === l ? (a.value[1] = t, (p = d.value) == null || p.hide()) : a.value = [t, t], a.value.sort((M, S) => M - S);
59
+ }, C = (e) => {
54
60
  var r, l;
55
- const t = ((r = p.value) == null ? void 0 : r.$el) || null;
56
- t && u.value && t.focus(), (l = u.value) == null || l.toggle(e);
61
+ const t = ((r = y.value) == null ? void 0 : r.$el) || null;
62
+ t && d.value && t.focus(), (l = d.value) == null || l.toggle(e);
57
63
  };
58
- return y(
59
- () => n.initialValue,
64
+ return v(
65
+ () => s.initialValue,
60
66
  () => {
61
67
  var e;
62
- (e = n.initialValue) != null && e.length && (a.value = n.initialValue);
68
+ (e = s.initialValue) != null && e.length && (a.value = s.initialValue);
63
69
  },
64
70
  {
65
71
  once: !0
66
72
  }
67
- ), y(
68
- () => n.modelValue,
73
+ ), v(
74
+ () => s.modelValue,
69
75
  (e) => {
70
76
  a.value = e ?? [];
71
77
  }
72
- ), (e, t) => (v(), f(_, null, [
73
- s(j, {
78
+ ), (e, t) => (c(), u(_, null, [
79
+ n(I, {
74
80
  label: e.label ? o(i)(e.label) : void 0,
75
81
  mandatory: e.mandatory
76
82
  }, {
77
- default: m(() => [
78
- s(I, {
83
+ default: g(() => [
84
+ n(O, {
79
85
  invalid: !!a.errorMessage,
80
- onClick: b,
86
+ onClick: C,
81
87
  class: "grid grid-cols-[1fr,max-content] !items-center gap-1 px-3 py-1"
82
88
  }, {
83
- default: m(() => [
84
- s(o(P), {
89
+ default: g(() => [
90
+ n(o(j), {
85
91
  ref_key: "inputtext",
86
- ref: p,
87
- "model-value": V.value,
92
+ ref: y,
93
+ "model-value": $.value,
88
94
  placeholder: o(i)("Select day"),
89
95
  class: "!p-0",
90
96
  readonly: ""
91
97
  }, null, 8, ["model-value", "placeholder"]),
92
- s(z, {
98
+ n(L, {
93
99
  class: "w-4 h-4 shrink-0 !text-general-500",
94
100
  "data-ts-section": "inputtrigger",
95
101
  icon: "calendar"
@@ -97,38 +103,46 @@ const O = ["aria-selected", "data-in-range", "onClick"], U = /* @__PURE__ */ $({
97
103
  ]),
98
104
  _: 1
99
105
  }, 8, ["invalid"]),
100
- s(L, {
106
+ n(W, {
101
107
  message: a.errorMessage,
102
108
  "data-test": "daypicker-validator-message"
103
109
  }, null, 8, ["message"])
104
110
  ]),
105
111
  _: 1
106
112
  }, 8, ["label", "mandatory"]),
107
- s(o(R), {
113
+ n(o(z), {
108
114
  ref_key: "panel",
109
- ref: u,
115
+ ref: d,
110
116
  pt: {
111
117
  content: {
112
- class: "grid grid-cols-3 p-6 gap-y-4"
118
+ class: "p-6"
113
119
  }
114
120
  },
115
121
  class: "border-none !mt-0 !shadow-panel"
116
122
  }, {
117
- default: m(() => [
118
- (v(), f(_, null, S(d, (r, l) => D("span", {
119
- key: r,
120
- "aria-selected": a.value.includes(l),
121
- class: N([{ "col-start-2": r === "Sunday" }, "text-xs text-general-800 bg-white hover:bg-primary-100 rounded-[20px] [&[data-in-range='true']]:bg-primary-200 [&[data-in-range='true']]:text-general-800 [&[data-in-range='true']]:rounded-[0] [&[aria-selected='true']]:bg-primary-500 [&[aria-selected='true']]:text-white text-center p-2 cursor-pointer"]),
122
- "data-in-range": a.value[0] < l && l < a.value[1],
123
- onClick: (c) => k(r, l),
124
- "data-ts-section": "day"
125
- }, F(o(i)(r)), 11, O)), 64))
123
+ default: g(() => [
124
+ e.$slots.header ? (c(), u("div", Y, [
125
+ V(e.$slots, "header")
126
+ ])) : h("", !0),
127
+ k("div", q, [
128
+ (c(), u(_, null, F(m, (r, l) => k("span", {
129
+ key: r,
130
+ "aria-selected": a.value.includes(l),
131
+ class: T([{ "col-start-2": r === "Sunday" }, "text-xs text-general-800 bg-white hover:bg-primary-100 rounded-[20px] [&[data-in-range='true']]:bg-primary-200 [&[data-in-range='true']]:text-general-800 [&[data-in-range='true']]:rounded-[0] [&[aria-selected='true']]:bg-primary-500 [&[aria-selected='true']]:text-white text-center p-2 cursor-pointer"]),
132
+ "data-in-range": a.value[0] < l && l < a.value[1],
133
+ onClick: (p) => w(r, l),
134
+ "data-ts-section": "day"
135
+ }, E(o(i)(r)), 11, A)), 64))
136
+ ]),
137
+ e.$slots.footer ? (c(), u("div", G, [
138
+ V(e.$slots, "footer")
139
+ ])) : h("", !0)
126
140
  ]),
127
- _: 1
141
+ _: 3
128
142
  }, 512)
129
143
  ], 64));
130
144
  }
131
145
  });
132
146
  export {
133
- U as _
147
+ te as _
134
148
  };
@@ -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
235
- label that printed or not. It does not show the
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
236
236
  exact amount you entered.`,
237
237
  severity: "primary"
238
238
  })
package/icon/index.d.ts CHANGED
@@ -32,6 +32,7 @@ export type WangsIcons =
32
32
  | 'assignment'
33
33
  | 'attachment-2'
34
34
  | 'audit'
35
+ | 'bank-card-line'
35
36
  | 'barcode'
36
37
  | 'barricade-line'
37
38
  | 'bell'
@@ -187,6 +188,7 @@ export type WangsIcons =
187
188
  | 'ticket'
188
189
  | 'tools'
189
190
  | 'tracking'
191
+ | 'truck-line'
190
192
  | 'unassign'
191
193
  | 'upload-2'
192
194
  | 'upload-cloud-2'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fewangsit/wangsvue-fats",
3
- "version": "1.0.1-alpha.60",
3
+ "version": "1.0.1-alpha.61",
4
4
  "author": "Wangsit FE Developer",
5
5
  "description": "Fixed Asset Tagsamurai VueJS Component Library",
6
6
  "type": "module",