@fewangsit/wangsvue-fats 1.0.1-alpha.43 → 1.0.1-alpha.44

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.
@@ -20,6 +20,10 @@ export interface ApproverInfoProps {
20
20
  * @default true
21
21
  */
22
22
  showShortInfo?: boolean;
23
+ /**
24
+ * To customize the level 0 label, for example 'Senior'
25
+ */
26
+ customLevelZeroLabel?: string;
23
27
  /**
24
28
  * To set label text when showShortInfo is false
25
29
  */
@@ -1,39 +1,40 @@
1
- import { defineComponent as C, shallowRef as B, computed as F, createElementBlock as o, openBlock as a, Fragment as i, createElementVNode as l, createVNode as m, toDisplayString as r, withCtx as I, renderList as g, createBlock as h, createCommentVNode as k } from "vue";
2
- import { f as N } from "../utils/date.util.es.js";
3
- import { _ as w } from "../badge/index.es.js";
1
+ import { defineComponent as N, shallowRef as B, computed as F, createElementBlock as o, openBlock as t, Fragment as i, createElementVNode as l, createVNode as m, toDisplayString as r, withCtx as I, renderList as k, createBlock as g, createCommentVNode as h, createTextVNode as w } from "vue";
2
+ import { f as V } from "../utils/date.util.es.js";
3
+ import { _ as L } from "../badge/index.es.js";
4
4
  import { _ as $ } from "../dialog/index.es.js";
5
5
  import { _ as A } from "../icon/index.es.js";
6
- const V = {
6
+ const E = {
7
7
  class: "flex justify-end gap-1 items-center pb-1 flex-wrap whitespace-nowrap",
8
8
  "data-wv-name": "approver-info"
9
- }, E = { class: "text-primary-500" }, H = { class: "text-general-800" }, M = { key: 1 }, S = { class: "flex flex-col gap-3 justify-between" }, U = { class: "flex justify-between" }, P = { class: "text-general-800 text-xs font-medium" }, R = { class: "flex justify-between items-center" }, T = { class: "text-primary-500 font-medium text-xs" }, q = {
9
+ }, Z = { class: "text-primary-500" }, H = { class: "text-general-800" }, M = { key: 1 }, S = { class: "flex flex-col gap-3 justify-between" }, T = { class: "flex justify-between" }, U = { class: "text-general-800 text-xs font-medium" }, P = { class: "flex justify-between items-center" }, R = { class: "text-primary-500 font-medium text-xs" }, q = {
10
10
  key: 0,
11
11
  class: "text-general-800 font-normal text-xs"
12
12
  }, z = {
13
13
  key: 1,
14
14
  class: "flex gap-1 justify-end items-center"
15
- }, G = { class: "text-general-800 font-normal text-xs" }, X = /* @__PURE__ */ C({
15
+ }, G = { class: "text-general-800 font-normal text-xs" }, X = /* @__PURE__ */ N({
16
16
  __name: "ApproverInfo",
17
17
  props: {
18
18
  approvals: {},
19
19
  showShortInfo: { type: Boolean, default: !0 },
20
+ customLevelZeroLabel: {},
20
21
  label: {},
21
22
  btnLabel: {},
22
23
  useFormatDate: { type: Boolean, default: !0 }
23
24
  },
24
25
  setup(D) {
25
- const u = D, c = B(!1), d = F(() => {
26
- var p, s, n, v, y, _, x;
27
- let t, e;
28
- return (p = u.approvals) == null || p.forEach((b) => {
29
- e = b.approvers.findIndex((L) => !!L.actionAt), t = e === -1 ? 0 : b.level - 1, e = e === -1 ? 0 : e;
26
+ const u = D, p = B(!1), d = F(() => {
27
+ var c, a, n, v, y, x, _;
28
+ let s, e;
29
+ return (c = u.approvals) == null || c.forEach((b) => {
30
+ e = b.approvers.findIndex((C) => !!C.actionAt), s = e === -1 ? 0 : b.level - 1, e = e === -1 ? 0 : e;
30
31
  }), {
31
- name: (v = (n = (s = u.approvals) == null ? void 0 : s[t]) == null ? void 0 : n.approvers[e]) == null ? void 0 : v.fullName,
32
- date: (x = (_ = (y = u.approvals) == null ? void 0 : y[t]) == null ? void 0 : _.approvers[e]) == null ? void 0 : x.actionAt
32
+ name: (v = (n = (a = u.approvals) == null ? void 0 : a[s]) == null ? void 0 : n.approvers[e]) == null ? void 0 : v.fullName,
33
+ date: (_ = (x = (y = u.approvals) == null ? void 0 : y[s]) == null ? void 0 : x.approvers[e]) == null ? void 0 : _.actionAt
33
34
  };
34
- }), j = (t) => {
35
+ }), j = (s) => {
35
36
  let e;
36
- switch (t) {
37
+ switch (s) {
37
38
  case "menyetujui":
38
39
  e = "success";
39
40
  break;
@@ -44,73 +45,79 @@ const V = {
44
45
  e = "warning";
45
46
  }
46
47
  return e;
47
- }, f = (t) => u.useFormatDate ? t ? N(new Date(t), {
48
+ }, f = (s) => u.useFormatDate ? s ? V(new Date(s), {
48
49
  locale: "id-ID",
49
50
  dateFormat: "dd M yyyy",
50
51
  timeFormat: "HH:mm:ss"
51
- }) : "-" : t;
52
- return (t, e) => {
53
- var p;
54
- return a(), o(i, null, [
55
- l("div", V, [
56
- t.showShortInfo ? (a(), o(i, { key: 0 }, [
52
+ }) : "-" : s;
53
+ return (s, e) => {
54
+ var c;
55
+ return t(), o(i, null, [
56
+ l("div", E, [
57
+ s.showShortInfo ? (t(), o(i, { key: 0 }, [
57
58
  e[3] || (e[3] = l("span", null, "Approver:", -1)),
58
- (p = t.approvals) != null && p.length ? (a(), o(i, { key: 0 }, [
59
+ (c = s.approvals) != null && c.length ? (t(), o(i, { key: 0 }, [
59
60
  m(A, {
60
61
  class: "!text-general-200 !text-base",
61
62
  icon: "user"
62
63
  }),
63
- l("span", E, r(d.value.name), 1),
64
+ l("span", Z, r(d.value.name), 1),
64
65
  l("span", H, r(f(d.value.date)), 1),
65
66
  l("span", {
66
- onClick: e[0] || (e[0] = (s) => c.value = !0),
67
+ onClick: e[0] || (e[0] = (a) => p.value = !0),
67
68
  class: "text-primary-500 hover:cursor-pointer"
68
69
  }, r(u.btnLabel ?? "more"), 1)
69
- ], 64)) : (a(), o("span", M, "-"))
70
- ], 64)) : (a(), o("span", {
70
+ ], 64)) : (t(), o("span", M, "-"))
71
+ ], 64)) : (t(), o("span", {
71
72
  key: 1,
72
- onClick: e[1] || (e[1] = (s) => c.value = !0),
73
+ onClick: e[1] || (e[1] = (a) => p.value = !0),
73
74
  class: "text-primary-500 hover:cursor-pointer"
74
- }, r(t.label ?? "Lihat Approval"), 1))
75
+ }, r(s.label ?? "Lihat Approval"), 1))
75
76
  ]),
76
77
  m($, {
77
- visible: c.value,
78
- "onUpdate:visible": e[2] || (e[2] = (s) => c.value = s),
78
+ visible: p.value,
79
+ "onUpdate:visible": e[2] || (e[2] = (a) => p.value = a),
79
80
  class: "min-w-[400px]",
80
81
  header: "List Approver",
81
82
  modal: ""
82
83
  }, {
83
84
  default: I(() => [
84
85
  l("div", S, [
85
- (a(!0), o(i, null, g(t.approvals, (s) => (a(), o(i, {
86
- key: s._id
86
+ (t(!0), o(i, null, k(s.approvals, (a) => (t(), o(i, {
87
+ key: a._id
87
88
  }, [
88
- l("div", U, [
89
- l("span", P, " Level " + r(s.level) + " (" + r(s.type.toLowerCase()) + ") ", 1),
90
- s.status !== "menunggu approval" ? (a(), h(w, {
89
+ l("div", T, [
90
+ l("span", U, [
91
+ a.level === 0 && u.customLevelZeroLabel ? (t(), o(i, { key: 0 }, [
92
+ w(r(u.customLevelZeroLabel), 1)
93
+ ], 64)) : (t(), o(i, { key: 1 }, [
94
+ w(" Level " + r(a.level) + " (" + r(a.type.toLowerCase()) + ") ", 1)
95
+ ], 64))
96
+ ]),
97
+ a.status !== "menunggu approval" ? (t(), g(L, {
91
98
  key: 0,
92
99
  label: "selesai",
93
100
  severity: "success"
94
- })) : k("", !0)
101
+ })) : h("", !0)
95
102
  ]),
96
- (a(!0), o(i, null, g(s.approvers, (n) => (a(), o("div", {
103
+ (t(!0), o(i, null, k(a.approvers, (n) => (t(), o("div", {
97
104
  key: n._id,
98
105
  class: "flex justify-between"
99
106
  }, [
100
- l("div", R, [
107
+ l("div", P, [
101
108
  m(A, {
102
109
  class: "!text-general-200 !text-base",
103
110
  icon: "user"
104
111
  }),
105
- l("span", T, r(n.fullName), 1)
112
+ l("span", R, r(n.fullName), 1)
106
113
  ]),
107
- s.status !== "menunggu approval" && !n.action ? (a(), o("span", q, " Tidak terlibat ")) : (a(), o("div", z, [
114
+ a.status !== "menunggu approval" && !n.action ? (t(), o("span", q, " Tidak terlibat ")) : (t(), o("div", z, [
108
115
  l("span", G, r(n.actionAt ? f(n.actionAt) : "Menunggu approval..."), 1),
109
- n.action ? (a(), h(w, {
116
+ n.action ? (t(), g(L, {
110
117
  key: 0,
111
118
  label: n.action,
112
119
  severity: j(n.action)
113
- }, null, 8, ["label", "severity"])) : k("", !0)
120
+ }, null, 8, ["label", "severity"])) : h("", !0)
114
121
  ]))
115
122
  ]))), 128))
116
123
  ], 64))), 128))
@@ -11,7 +11,7 @@ const R = () => u([
11
11
  {
12
12
  field: "profilePictureSmall",
13
13
  header: "Photo",
14
- sortable: !0,
14
+ sortable: !1,
15
15
  bodyComponent(e) {
16
16
  return {
17
17
  component: I,
@@ -70,7 +70,7 @@ const Y = {
70
70
  header: "Photo",
71
71
  style: "min-width: 72px",
72
72
  fixed: !0,
73
- sortable: !0,
73
+ sortable: !1,
74
74
  excluded: !0,
75
75
  bodyComponent: (o) => ({
76
76
  component: G,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fewangsit/wangsvue-fats",
3
- "version": "1.0.1-alpha.43",
3
+ "version": "1.0.1-alpha.44",
4
4
  "author": "Wangsit FE Developer",
5
5
  "description": "Fixed Asset Tagsamurai VueJS Component Library",
6
6
  "type": "module",