@fewangsit/wangsvue-fats 1.0.1-alpha.67 → 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 (96) hide show
  1. package/animation/index.es.js +30 -20
  2. package/approverinfo/index.es.js +50 -50
  3. package/assetinfo/index.d.ts +5 -4
  4. package/assetinfo/index.es.js +116 -100
  5. package/assets/lottiejs/loading-page-dark.es.js +4 -0
  6. package/assets/lottiejs/loading-table-dark.es.js +4 -0
  7. package/assets/lottiejs/no-data-dark.es.js +4 -0
  8. package/backgroundimagecropper/index.es.js +14 -12
  9. package/button/index.es.js +58 -48
  10. package/buttonbulkaction/index.es.js +67 -59
  11. package/buttoncopy/index.es.js +8 -8
  12. package/buttondownload/index.es.js +18 -18
  13. package/buttonradio/index.es.js +11 -11
  14. package/buttonscan/index.es.js +48 -48
  15. package/buttonsearch/index.es.js +14 -14
  16. package/buttonselectuser/index.es.js +29 -29
  17. package/carousel/index.es.js +24 -24
  18. package/checkbox/index.es.js +5 -5
  19. package/columnlist/index.es.js +142 -132
  20. package/config/defaultProps.es.js +15 -11
  21. package/datatable/index.d.ts +14 -0
  22. package/datatable/index.es.js +520 -509
  23. package/datepicker/index.es.js +24 -24
  24. package/daypicker/index.es.js +29 -29
  25. package/dialog/index.es.js +17 -15
  26. package/dialogbasictransferlog/index.es.js +100 -100
  27. package/dialogconfirm/index.es.js +33 -33
  28. package/dialogdamagelog/index.es.js +106 -103
  29. package/dialogform/index.es.js +25 -25
  30. package/dialogfulltransferlog/index.es.js +98 -98
  31. package/dialoglinkedasset/index.es.js +61 -61
  32. package/dialogprintqr/index.es.js +78 -80
  33. package/dialogreportdamage/index.es.js +57 -57
  34. package/dialogreportmissing/index.es.js +94 -86
  35. package/dialogselecttree/index.es.js +18 -16
  36. package/dialogselectuser/index.es.js +17 -17
  37. package/directives/index.d.ts +1 -0
  38. package/directives/index.es.js +1 -0
  39. package/directives/safeHtml.d.ts +16 -0
  40. package/directives/safeHtml.es.js +12 -0
  41. package/disposalreport/index.es.js +3 -3
  42. package/disposalreportbulkaction/index.es.js +40 -41
  43. package/disposalreportdialogselectasset/index.es.js +72 -72
  44. package/disposalreporttable/index.es.js +108 -108
  45. package/disposalreporttablefilter/index.es.js +16 -17
  46. package/dropdown/index.es.js +120 -117
  47. package/editor/index.es.js +51 -48
  48. package/fieldwrapper/index.es.js +7 -7
  49. package/fileupload/index.es.js +44 -40
  50. package/hardwaresync/index.es.js +12 -12
  51. package/headercell/index.es.js +4 -4
  52. package/icon/index.es.js +36 -35
  53. package/imagecompressor/index.es.js +155 -155
  54. package/imageinputinfo/index.es.js +13 -13
  55. package/inlinemessage/index.es.js +12 -12
  56. package/inputbadge/index.es.js +42 -43
  57. package/inputnumber/index.es.js +7 -7
  58. package/inputpassword/index.es.js +9 -9
  59. package/inputrangenumber/index.es.js +16 -16
  60. package/inputsearch/index.es.js +27 -27
  61. package/inputtext/index.es.js +33 -33
  62. package/litedropdown/index.es.js +47 -39
  63. package/loading-page-dark-e0SrRAHc.js +4 -0
  64. package/loading-page-dark-mz8tLHZ3.js +1 -0
  65. package/loading-table-dark-BGh0tAPM.js +4 -0
  66. package/loading-table-dark-Cky7AB_C.js +1 -0
  67. package/menuitem/index.es.js +27 -26
  68. package/multirow/index.es.js +17 -16
  69. package/multiselect/index.es.js +86 -83
  70. package/no-data-dark-DERIJ8Ml.js +1 -0
  71. package/no-data-dark-nK4e4RAM.js +4 -0
  72. package/package.json +1 -1
  73. package/plugins/WangsVue.es.js +11 -9
  74. package/plugins/basei18n.d.ts +2 -2
  75. package/plugins/basei18n.es.js +48 -42
  76. package/stats.html +1 -1
  77. package/steps/index.es.js +18 -16
  78. package/style.css +2 -2
  79. package/tabmenu/index.es.js +14 -9
  80. package/tagtype/index.es.js +35 -32
  81. package/textarea/index.es.js +3 -3
  82. package/toggledarkmode/store/index.d.ts +7 -0
  83. package/toggleswitch/index.es.js +3 -3
  84. package/transactionroles/index.es.js +4 -1
  85. package/treesearchinput/index.es.js +15 -15
  86. package/username/index.es.js +37 -37
  87. package/utils/baseToast.util.es.js +23 -22
  88. package/utils/index.es.js +1 -2
  89. package/utils/textFormatter.util.d.ts +32 -0
  90. package/utils/textFormatter.util.es.js +38 -10
  91. package/validatormessage/index.es.js +1 -1
  92. package/vendor/dompurify/dist/purify.es.es.js +553 -0
  93. package/wangsvue-fats.d.ts +2 -1
  94. package/wangsvue-fats.es.js +190 -186
  95. package/wangsvue-fats.esm.browser.js +22487 -21781
  96. package/wangsvue-fats.system.js +72 -71
@@ -1,12 +1,12 @@
1
- import { defineComponent as A, computed as h, shallowRef as N, ref as H, resolveDirective as I, createElementBlock as u, openBlock as a, mergeProps as i, createBlock as d, withDirectives as M, createCommentVNode as P, withModifiers as F, unref as v, createTextVNode as U, toDisplayString as p, withCtx as R, createElementVNode as k, createVNode as q, normalizeProps as G, Fragment as J } from "vue";
1
+ import { defineComponent as A, computed as h, shallowRef as N, ref as H, resolveDirective as I, createElementBlock as u, openBlock as t, mergeProps as i, createBlock as d, withDirectives as M, createCommentVNode as P, withModifiers as F, unref as v, createTextVNode as $, toDisplayString as p, withCtx as R, createElementVNode as k, createVNode as q, normalizeProps as G, Fragment as J } from "vue";
2
2
  import { t as K } from "../vendor/single-spa/lib/es2015/esm/single-spa.min.es.js";
3
3
  import { u as L } from "../plugins/WangsVue.es.js";
4
4
  import { m as Q } from "../utils/mergePropsWithDefaults.util.es.js";
5
- import { g as _ } from "../utils/object.util.es.js";
5
+ import { g as j } from "../utils/object.util.es.js";
6
6
  import { f as X } from "../utils/textFormatter.util.es.js";
7
- import { s as $ } from "../vendor/primevue/skeleton/skeleton.esm.es.js";
7
+ import { s as U } from "../vendor/primevue/skeleton/skeleton.esm.es.js";
8
8
  import { _ as Y } from "../icon/index.es.js";
9
- import { _ as j } from "../image/index.es.js";
9
+ import { _ } from "../image/index.es.js";
10
10
  import { _ as Z } from "../overlaypanel/index.es.js";
11
11
  const ee = { key: 0 }, me = /* @__PURE__ */ A({
12
12
  __name: "UserName",
@@ -23,16 +23,16 @@ const ee = { key: 0 }, me = /* @__PURE__ */ A({
23
23
  },
24
24
  setup(z) {
25
25
  const r = z, { locale: E, defaultProps: T } = L("UserName"), n = h(() => Q(r, T)), f = N(!1), s = N(), g = N(!1), w = H(), m = h(
26
- () => _(
26
+ () => j(
27
27
  r.user ?? {},
28
28
  n.value.userNameField
29
29
  )
30
30
  ), D = h(() => n.value.formatUserName ? X(m.value) : m.value), W = async () => {
31
- var t, e, y;
31
+ var e, a, y;
32
32
  if (!s.value && r.fetchDetailOnPanelShow)
33
33
  try {
34
34
  f.value = !0;
35
- const o = await ((y = (e = n.value).getUserDetail) == null ? void 0 : y.call(e, (t = r.user) == null ? void 0 : t._id));
35
+ const o = await ((y = (a = n.value).getUserDetail) == null ? void 0 : y.call(a, (e = r.user) == null ? void 0 : e._id));
36
36
  s.value = o;
37
37
  } catch (o) {
38
38
  console.error(o);
@@ -41,39 +41,39 @@ const ee = { key: 0 }, me = /* @__PURE__ */ A({
41
41
  }
42
42
  else r.fetchDetailOnPanelShow || (s.value = r.user);
43
43
  };
44
- return (t, e) => {
44
+ return (e, a) => {
45
45
  const y = I("tooltip");
46
- return Object.keys(r.user ?? {}).length < 1 ? (a(), u("span", ee, " - ")) : (a(), u("span", i({
46
+ return Object.keys(r.user ?? {}).length < 1 ? (t(), u("span", ee, " - ")) : (t(), u("span", i({
47
47
  key: 1,
48
- onClick: e[4] || (e[4] = //@ts-ignore
48
+ onClick: a[4] || (a[4] = //@ts-ignore
49
49
  (...o) => {
50
50
  var l, c;
51
51
  return ((l = w.value) == null ? void 0 : l.toggle) && ((c = w.value) == null ? void 0 : c.toggle(...o));
52
52
  })
53
- }, t.$preset.username.root, {
53
+ }, e.$preset.username.root, {
54
54
  "data-wv-name": "username",
55
55
  "data-wv-section": "root"
56
56
  }), [
57
- n.value.type == "picture" ? (a(), d(j, {
57
+ n.value.type == "picture" ? (t(), d(_, {
58
58
  key: 0,
59
59
  preview: m.value !== void 0,
60
- src: v(_)(
60
+ src: v(j)(
61
61
  r.user ?? {},
62
62
  n.value.profilePictureField
63
63
  ),
64
- onClick: e[0] || (e[0] = F((o) => {
64
+ onClick: a[0] || (a[0] = F((o) => {
65
65
  var l;
66
66
  m.value || (l = w.value) == null || l.toggle(o);
67
67
  }, ["stop"])),
68
68
  rounded: "",
69
69
  size: "small"
70
- }, null, 8, ["preview", "src"])) : (a(), d(Y, {
70
+ }, null, 8, ["preview", "src"])) : (t(), d(Y, {
71
71
  key: 1,
72
- class: "text-general-300 text-base",
72
+ class: "text-general-300 dark:text-grayscale-700 text-base",
73
73
  icon: "user"
74
74
  })),
75
- n.value.showUserName ? M((a(), u("span", i({ key: 2 }, t.$preset.username.displayname({ props: r }), { "data-wv-section": "displayname" }), [
76
- U(p(D.value), 1)
75
+ n.value.showUserName ? M((t(), u("span", i({ key: 2 }, e.$preset.username.displayname({ props: r }), { "data-wv-section": "displayname" }), [
76
+ $(p(D.value), 1)
77
77
  ], 16)), [
78
78
  [
79
79
  y,
@@ -82,7 +82,7 @@ const ee = { key: 0 }, me = /* @__PURE__ */ A({
82
82
  { top: !0 }
83
83
  ]
84
84
  ]) : P("", !0),
85
- Object.keys(r.user ?? {}).length > 1 ? (a(), d(Z, {
85
+ Object.keys(r.user ?? {}).length > 1 ? (t(), d(Z, {
86
86
  key: 3,
87
87
  ref_key: "miniProfile",
88
88
  ref: w,
@@ -92,46 +92,46 @@ const ee = { key: 0 }, me = /* @__PURE__ */ A({
92
92
  default: R(() => {
93
93
  var o, l, c, b, B, C, O, S;
94
94
  return [
95
- k("div", i(t.$preset.username.panel.contentwrapper, { "data-wv-section": "contentwrapper" }), [
96
- k("div", i(t.$preset.username.panel.background, { "data-wv-section": "background" }), null, 16),
97
- q(j, {
95
+ k("div", i(e.$preset.username.panel.contentwrapper, { "data-wv-section": "contentwrapper" }), [
96
+ k("div", i(e.$preset.username.panel.background, { "data-wv-section": "background" }), null, 16),
97
+ q(_, {
98
98
  src: ((o = s.value) == null ? void 0 : o.profilePicture) ?? ((l = s.value) == null ? void 0 : l.profilePictureBig),
99
99
  width: 60,
100
- onHide: e[1] || (e[1] = (V) => g.value = !1),
101
- onShow: e[2] || (e[2] = (V) => g.value = !0),
100
+ onHide: a[1] || (a[1] = (V) => g.value = !1),
101
+ onShow: a[2] || (a[2] = (V) => g.value = !0),
102
102
  class: "w-[60px] h-[60px]",
103
103
  rounded: ""
104
104
  }, null, 8, ["src"]),
105
- f.value ? (a(), d(v($), {
105
+ f.value ? (t(), d(v(U), {
106
106
  key: 1,
107
107
  height: "29px",
108
108
  width: "100px"
109
- })) : (a(), u("div", G(i({ key: 0 }, t.$preset.username.panel.detailwrapper)), [
110
- k("h4", i(t.$preset.username.panel.username, { "data-wv-section": "username" }), [
111
- U(p((c = s.value) == null ? void 0 : c.fullName) + " ", 1),
112
- (b = s.value) != null && b.nickName ? (a(), u(J, { key: 0 }, [
113
- U(" (" + p((B = s.value) == null ? void 0 : B.nickName) + ") ", 1)
109
+ })) : (t(), u("div", G(i({ key: 0 }, e.$preset.username.panel.detailwrapper)), [
110
+ k("h4", i(e.$preset.username.panel.username, { "data-wv-section": "username" }), [
111
+ $(p((c = s.value) == null ? void 0 : c.fullName) + " ", 1),
112
+ (b = s.value) != null && b.nickName ? (t(), u(J, { key: 0 }, [
113
+ $(" (" + p((B = s.value) == null ? void 0 : B.nickName) + ") ", 1)
114
114
  ], 64)) : P("", !0)
115
115
  ], 16),
116
- k("span", i(t.$preset.username.panel.useremail, { "data-wv-section": "useremail" }), p((C = s.value) == null ? void 0 : C.email), 17)
116
+ k("span", i(e.$preset.username.panel.useremail, { "data-wv-section": "useremail" }), p((C = s.value) == null ? void 0 : C.email), 17)
117
117
  ], 16)),
118
- f.value ? (a(), d(v($), {
118
+ f.value ? (t(), d(v(U), {
119
119
  key: 3,
120
120
  height: "12px",
121
121
  width: "60px"
122
- })) : (a(), u("span", i({ key: 2 }, t.$preset.username.panel.positiondivision, { "data-wv-section": "positiondivision" }), p((O = s.value) == null ? void 0 : O.division) + " / " + p((S = s.value) == null ? void 0 : S.position), 17)),
123
- f.value ? (a(), d(v($), {
122
+ })) : (t(), u("span", i({ key: 2 }, e.$preset.username.panel.positiondivision, { "data-wv-section": "positiondivision" }), p((O = s.value) == null ? void 0 : O.division) + " / " + p((S = s.value) == null ? void 0 : S.position), 17)),
123
+ f.value ? (t(), d(v(U), {
124
124
  key: 5,
125
125
  width: "75px"
126
- })) : (a(), u("a", i({
126
+ })) : (t(), u("a", i({
127
127
  key: 4,
128
- onClick: e[3] || (e[3] = F((V) => {
128
+ onClick: a[3] || (a[3] = F((V) => {
129
129
  var x;
130
130
  return v(K)(
131
131
  n.value.detailUserPath.replace("{userId}", (x = r.user) == null ? void 0 : x._id)
132
132
  );
133
133
  }, ["stop"]))
134
- }, t.$preset.username.panel.userdetaillink, { "data-wv-section": "userdetaillink" }), p(v(E).detailUserAnchorText), 17))
134
+ }, e.$preset.username.panel.userdetaillink, { "data-wv-section": "userdetaillink" }), p(e.$t(v(E).detailUserAnchorText)), 17))
135
135
  ], 16)
136
136
  ];
137
137
  }),
@@ -1,44 +1,45 @@
1
1
  import { e as G } from "../event-bus/index.es.js";
2
- import { u as M } from "../vendor/primevue/usetoast/usetoast.esm.es.js";
3
- import { u as A } from "../vendor/lodash-es/uniqueId.es.js";
4
- const w = ({ icons: i, template: r } = {}) => {
5
- const t = M();
2
+ import { u as A } from "../plugins/basei18n.es.js";
3
+ import { u as I } from "../vendor/primevue/usetoast/usetoast.esm.es.js";
4
+ import { u as N } from "../vendor/lodash-es/uniqueId.es.js";
5
+ const { t: R } = A(), q = ({ icons: t, template: s } = {}) => {
6
+ const i = I();
6
7
  return {
7
- add: (e) => {
8
+ add: (o) => {
8
9
  var n, c, f;
9
10
  const {
10
11
  message: a,
11
12
  customMessage: v,
12
- error: s,
13
+ error: r,
13
14
  severity: g,
14
- life: l,
15
+ life: m,
15
16
  group: d = "default-toast",
16
- ...m
17
- } = e;
17
+ ...l
18
+ } = o;
18
19
  let u = "";
19
- s instanceof Error && s && s.isAxiosError && (u = s.code === "ERR_NETWORK" ? (r == null ? void 0 : r.additionalMessage) ?? "" : "");
20
- const o = s ? "error" : g ?? "success", E = ((f = (c = (n = r == null ? void 0 : r.severity) == null ? void 0 : n[o]) == null ? void 0 : c.replace("{message}", a)) == null ? void 0 : f.replace("{additionalMessage}", u)) || a, y = m.icon ?? (i == null ? void 0 : i[o]);
21
- t.add({
22
- severity: o,
23
- detail: v ? a : E,
24
- life: l ?? 3e3,
20
+ r instanceof Error && r && r.isAxiosError && (u = r.code === "ERR_NETWORK" ? (s == null ? void 0 : s.additionalMessage) ?? "" : "");
21
+ const e = r ? "error" : g ?? "success", E = ((f = (c = (n = s == null ? void 0 : s.severity) == null ? void 0 : n[e]) == null ? void 0 : c.replace("{message}", a)) == null ? void 0 : f.replace("{additionalMessage}", u)) || a, y = l.icon ?? (t == null ? void 0 : t[e]), M = v ? a : E;
22
+ i.add({
23
+ severity: e,
24
+ detail: R(M),
25
+ life: m ?? 3e3,
25
26
  group: d
26
27
  }), G.emit("toast:add", {
27
- messageId: A(),
28
- ...e,
29
- severity: o,
28
+ messageId: N(),
29
+ ...o,
30
+ severity: e,
30
31
  group: d,
31
32
  icon: y
32
33
  });
33
34
  },
34
- removeGroup: (e) => {
35
- t.removeGroup(e);
35
+ removeGroup: (o) => {
36
+ i.removeGroup(o);
36
37
  },
37
38
  removeAllGroups: () => {
38
- t.removeAllGroups();
39
+ i.removeAllGroups();
39
40
  }
40
41
  };
41
42
  };
42
43
  export {
43
- w as u
44
+ q as u
44
45
  };
package/utils/index.es.js CHANGED
@@ -1,3 +1,2 @@
1
1
  import "./role.util.es.js";
2
- import "../event-bus/index.es.js";
3
- import "vue";
2
+ import "./baseToast.util.es.js";
@@ -27,3 +27,35 @@ export declare const getInitialsBy3FirstLetter: (
27
27
  * @returns {string} The label prefixed with the appropriate article ("a" or "an").
28
28
  */
29
29
  export declare const formatVowelSoundLabel: (label?: string) => string;
30
+ /**
31
+ * Format text with custom operators into HTML.
32
+ *
33
+ * Rules (ignore \(backslash) operator):
34
+ * - \|text| → \<b>text\</b>
35
+ * - \*text* → \<i>text\</i>
36
+ * - \_text_ → \<u>text\</u>
37
+ * - \~text~ → \<s>text\</s>
38
+ * - Unpaired operator will be ignored
39
+ * - Supports nested formatting
40
+ * - Supports escaping using backslash (e.g., \\|text|)
41
+ *
42
+ * @param input - The raw string containing custom formatting operators.
43
+ * @returns The formatted HTML string.
44
+ *
45
+ * @example
46
+ * formatMarkupToHtml("Hello |Udin|");
47
+ * → "Hello <b>Udin</b>"
48
+ *
49
+ * @example
50
+ * formatMarkupToHtml("|hello *bro*|");
51
+ * → "<b>hello <i>bro</i></b>"
52
+ *
53
+ * @example
54
+ * formatMarkupToHtml("Hello |Udin");
55
+ * → "Hello |Udin"
56
+ *
57
+ * @example
58
+ * formatMarkupToHtml("ini \\|bukan bold|");
59
+ * → "ini |bukan bold|"
60
+ */
61
+ export declare const formatMarkupToHtml: (input: string) => string;
@@ -1,21 +1,49 @@
1
- const l = (t) => {
1
+ const h = (t) => {
2
2
  if (!t) return "-";
3
3
  if (t.length <= 8) return t;
4
4
  const s = t.split(" ");
5
5
  if (s.length === 1)
6
6
  return `${s[0].slice(0, 8)}..`;
7
- const o = s.slice(0, -1).join(" "), n = o.length > 8 ? `${o.slice(0, 8)}..` : o, e = s[s.length - 1];
8
- return `${n} ${e.slice(0, 1)}`;
9
- }, d = (t) => {
7
+ const n = s.slice(0, -1).join(" "), o = n.length > 8 ? `${n.slice(0, 8)}..` : n, e = s[s.length - 1];
8
+ return `${o} ${e.slice(0, 1)}`;
9
+ }, f = (t) => {
10
10
  if (!t) return "";
11
- const s = ["a", "e", "i", "o", "h"], o = ["a", "e", "i", "o", "u"], n = t.toLowerCase(), e = n[0], r = s.includes(e);
11
+ const s = ["a", "e", "i", "o", "h"], n = ["a", "e", "i", "o", "u"], o = t.toLowerCase(), e = o[0], r = s.includes(e);
12
12
  if (e === "h") {
13
- const i = ["hour", "honest", "heir", "honor"].some((c) => n.includes(c));
14
- return !o.includes(n.slice(2, 3)) && !i ? `a ${t}` : `an ${t}`;
13
+ const u = ["hour", "honest", "heir", "honor"].some((l) => o.includes(l));
14
+ return !n.includes(o.slice(2, 3)) && !u ? `a ${t}` : `an ${t}`;
15
15
  }
16
- return r || e === "u" && !s.includes(n.slice(2, 3)) ? `an ${t}` : `a ${t}`;
16
+ return r || e === "u" && !s.includes(o.slice(2, 3)) ? `an ${t}` : `a ${t}`;
17
+ }, c = {
18
+ "|": "b",
19
+ "*": "i",
20
+ _: "u",
21
+ "~": "s"
22
+ }, a = (t) => {
23
+ const s = [], n = [];
24
+ for (let o = 0; o < t.length; o++) {
25
+ const e = t[o];
26
+ if (e === "\\") {
27
+ n.push(t[o + 1] ?? ""), o++;
28
+ continue;
29
+ }
30
+ if (e in c) {
31
+ const r = s[s.length - 1];
32
+ if (r && r.op === e) {
33
+ const i = c[e];
34
+ s.pop(), n[r.pos] = `<${i}>`, n.push(`</${i}>`);
35
+ } else
36
+ s.push({ op: e, pos: n.length }), n.push("");
37
+ continue;
38
+ }
39
+ n.push(e);
40
+ }
41
+ for (const o of s)
42
+ n[o.pos] = o.op;
43
+ return n.join("");
17
44
  };
18
45
  export {
19
- d as a,
20
- l as f
46
+ f as a,
47
+ a as b,
48
+ h as f
21
49
  };
@@ -8,7 +8,7 @@ const u = /* @__PURE__ */ o({
8
8
  const r = t("preset", {}).validatormessage;
9
9
  return (e, _) => {
10
10
  var s;
11
- return a((m(), n("small", p((s = i(r)) == null ? void 0 : s.root, { role: "alert" }), l(e.message), 17)), [
11
+ return a((m(), n("small", p((s = i(r)) == null ? void 0 : s.root, { role: "alert" }), l(e.$t(e.message)), 17)), [
12
12
  [c, e.message]
13
13
  ]);
14
14
  };