@fewangsit/wangsvue-fats 1.0.1-rc.0 → 1.0.1-rc.11

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 (242) hide show
  1. package/animation/index.es.js +50 -0
  2. package/approverinfo/index.es.js +6 -6
  3. package/assetinfo/index.es.js +160 -2
  4. package/backgroundimagecropper/{BackgroundImageCropper.es.js → index.es.js} +1 -1
  5. package/badge/index.es.js +7 -7
  6. package/badgegroup/index.es.js +7 -7
  7. package/basecalendar/{BaseCalendar.es.js → index.es.js} +6 -6
  8. package/basetree/index.es.js +14 -14
  9. package/breadcrumb/index.es.js +6 -6
  10. package/button/index.es.js +118 -2
  11. package/buttonaddbyscan/index.es.js +13 -13
  12. package/buttonbulkaction/index.es.js +184 -2
  13. package/buttoncopy/index.es.js +6 -6
  14. package/buttondownload/index.es.js +15 -15
  15. package/buttonfilter/index.es.js +6 -6
  16. package/buttonradio/index.es.js +2 -2
  17. package/buttonscan/index.es.js +414 -2
  18. package/buttonsearch/index.es.js +9 -9
  19. package/buttonsearchbyscan/index.es.js +7 -7
  20. package/buttonselecttree/index.es.js +22 -22
  21. package/buttonselectuser/index.es.js +25 -25
  22. package/buttonsync/index.es.js +12 -12
  23. package/buttontoggle/index.es.js +6 -6
  24. package/buttonviewlog/index.es.js +2 -2
  25. package/calendar/index.es.js +4 -4
  26. package/card/index.es.js +4 -4
  27. package/carousel/index.es.js +7 -7
  28. package/checkbox/index.es.js +2 -2
  29. package/codesnippet/{CodeSnippet.es.js → index.es.js} +1 -1
  30. package/codesnippetadapter/{CodeSnippetAdapter.es.js → index.es.js} +1 -1
  31. package/columnlist/{ColumnList.es.js → index.es.js} +8 -8
  32. package/config/defaultProps.es.js +133 -0
  33. package/config/index.es.js +10 -218
  34. package/config/locale.es.js +85 -0
  35. package/customcolumn/index.es.js +8 -8
  36. package/datatable/index.es.js +108 -107
  37. package/datepicker/index.es.js +138 -2
  38. package/daypicker/index.es.js +6 -6
  39. package/dialog/index.es.js +4 -4
  40. package/dialogassetnamedetail/index.es.js +11 -11
  41. package/dialogbasictransferlog/{DialogBasicTransferLog.es.js → index.es.js} +17 -17
  42. package/dialogconfirm/index.es.js +17 -17
  43. package/dialogdamagelog/index.es.js +14 -14
  44. package/dialogform/index.es.js +32 -32
  45. package/dialogfulltransferlog/{DialogFullTransferLog.es.js → index.es.js} +16 -16
  46. package/dialoglinkedasset/index.es.js +9 -9
  47. package/dialogprintqr/index.es.js +332 -2
  48. package/dialogreportdamage/index.es.js +12 -12
  49. package/dialogreportmissing/index.es.js +12 -12
  50. package/dialogreporttag/index.es.js +8 -8
  51. package/dialogselecttree/index.es.js +13 -13
  52. package/dialogselectuser/index.d.ts +2 -2
  53. package/dialogselectuser/index.es.js +18 -18
  54. package/dialogselectuserfilter/{DialogSelectUserFilter.es.js → index.es.js} +2 -2
  55. package/dialogtransferlog/index.es.js +9 -9
  56. package/directives/{focus/index.es.js → focus.es.js} +2 -2
  57. package/directives/index.es.js +2 -0
  58. package/directives/tooltip.es.js +1 -0
  59. package/disposalreport/index.es.js +8 -8
  60. package/disposalreportbulkaction/{DisposalReportBulkAction.es.js → index.es.js} +9 -8
  61. package/disposalreporttable/{DisposalReportTable.es.js → index.es.js} +16 -16
  62. package/disposalreporttablefilter/{DisposalReportTableFilter.es.js → index.es.js} +5 -5
  63. package/dropdown/index.es.js +37 -37
  64. package/editor/{Editor.es.js → index.es.js} +57 -57
  65. package/editorbutton/{EditorButton.es.js → index.es.js} +1 -1
  66. package/event-bus/index.es.js +4 -3
  67. package/event-bus/mitt.es.js +53 -0
  68. package/fieldwrapper/{FieldWrapper.es.js → index.es.js} +2 -2
  69. package/fileupload/index.es.js +13 -13
  70. package/filtercontainer/index.es.js +34 -34
  71. package/form/index.es.js +23 -23
  72. package/hardwaresync/{HardwareSync.es.js → index.es.js} +42 -42
  73. package/icon/index.es.js +4 -4
  74. package/image/index.es.js +14 -14
  75. package/imagecompressor/index.es.js +14 -14
  76. package/imageinputinfo/{ImageInputInfo.es.js → index.es.js} +2 -2
  77. package/inlinemessage/index.es.js +7 -7
  78. package/inputbadge/index.es.js +14 -14
  79. package/inputcurrency/index.es.js +147 -2
  80. package/inputemail/index.es.js +4 -4
  81. package/inputnumber/index.es.js +6 -6
  82. package/inputotp/index.es.js +1 -1
  83. package/inputpassword/index.es.js +10 -10
  84. package/inputphonenumber/index.es.js +28 -28
  85. package/inputrangenumber/index.es.js +9 -9
  86. package/inputsearch/index.es.js +2 -2
  87. package/inputtext/index.es.js +11 -11
  88. package/inputurl/index.es.js +5 -5
  89. package/invisiblefield/index.es.js +8 -8
  90. package/languagedropdownoption/{LanguageDropdownOption.es.js → index.es.js} +3 -3
  91. package/languageswitcher/index.es.js +7 -7
  92. package/litedropdown/index.es.js +10 -10
  93. package/loading/index.es.js +8 -8
  94. package/mentionlist/{MentionList.es.js → index.es.js} +4 -4
  95. package/menu/index.es.js +20 -19
  96. package/menuitem/{MenuItem.es.js → index.es.js} +1 -1
  97. package/multiselect/index.es.js +27 -27
  98. package/overlaypanel/index.es.js +6 -6
  99. package/package.json +1 -5
  100. package/paginator/index.es.js +11 -11
  101. package/plugins/VueHtmlToPaper.es.js +40 -0
  102. package/{animation/Animation.es.js → plugins/WangsVue.es.js} +38 -83
  103. package/plugins/basei18n.d.ts +103 -0
  104. package/plugins/basei18n.es.js +88 -0
  105. package/plugins/{formValidation/index.es.js → formValidation.es.js} +4 -4
  106. package/plugins/i18n.d.ts +5 -102
  107. package/plugins/i18n.es.js +6 -0
  108. package/stats.html +1 -1
  109. package/steps/index.es.js +4 -4
  110. package/tabmenu/index.es.js +1 -1
  111. package/tagtype/index.es.js +6 -6
  112. package/textarea/index.es.js +5 -5
  113. package/timeline/index.es.js +5 -5
  114. package/timelinecontentbytype/{TimelineContentByType.es.js → index.es.js} +9 -9
  115. package/toast/index.es.js +3 -3
  116. package/toggleswitch/index.es.js +2 -2
  117. package/transactionroles/index.es.js +2 -2
  118. package/tree/index.es.js +117 -107
  119. package/treenode/{TreeNode.es.js → index.es.js} +4 -4
  120. package/treesearchinput/{TreeSearchInput.es.js → index.es.js} +4 -4
  121. package/username/index.es.js +20 -20
  122. package/userwithicon/index.es.js +4 -4
  123. package/utils/baseToast.util.es.js +1 -1
  124. package/utils/date.util.es.js +2 -2
  125. package/utils/index.es.js +3 -36
  126. package/utils/role.util.es.js +2 -2
  127. package/validatormessage/index.es.js +4 -4
  128. package/vendor/highlight.js/es/core.es.js +1 -1
  129. package/vendor/lodash/_freeGlobal.es.js +1 -1
  130. package/vendor/simplebar-core/dist/index.es.js +1 -1
  131. package/wangsvue-fats.d.ts +1 -2
  132. package/wangsvue-fats.es.js +219 -256
  133. package/wangsvue-fats.system.js +56 -56
  134. package/approverinfo/package.json +0 -4
  135. package/assetinfo/AssetInfo.es.js +0 -179
  136. package/assetinfo/package.json +0 -4
  137. package/badge/package.json +0 -4
  138. package/badgegroup/package.json +0 -4
  139. package/basetree/package.json +0 -4
  140. package/breadcrumb/package.json +0 -4
  141. package/button/Button.es.js +0 -120
  142. package/button/package.json +0 -4
  143. package/buttonaddbyscan/package.json +0 -4
  144. package/buttonbulkaction/ButtonBulkAction.es.js +0 -238
  145. package/buttonbulkaction/package.json +0 -4
  146. package/buttoncopy/package.json +0 -4
  147. package/buttondownload/package.json +0 -4
  148. package/buttonfilter/package.json +0 -4
  149. package/buttonradio/package.json +0 -4
  150. package/buttonscan/ButtonScan.es.js +0 -416
  151. package/buttonscan/package.json +0 -4
  152. package/buttonsearch/package.json +0 -4
  153. package/buttonsearchbyscan/package.json +0 -4
  154. package/buttonselecttree/package.json +0 -4
  155. package/buttonselectuser/package.json +0 -4
  156. package/buttonsync/package.json +0 -4
  157. package/buttontoggle/package.json +0 -4
  158. package/buttonviewlog/package.json +0 -4
  159. package/calendar/package.json +0 -4
  160. package/card/package.json +0 -4
  161. package/carousel/package.json +0 -4
  162. package/checkbox/package.json +0 -4
  163. package/config/package.json +0 -4
  164. package/customcolumn/package.json +0 -4
  165. package/datatable/package.json +0 -4
  166. package/datepicker/DatePicker.es.js +0 -224
  167. package/datepicker/package.json +0 -4
  168. package/daypicker/package.json +0 -4
  169. package/dialog/package.json +0 -4
  170. package/dialogassetnamedetail/package.json +0 -4
  171. package/dialogconfirm/package.json +0 -4
  172. package/dialogdamagelog/package.json +0 -4
  173. package/dialogform/package.json +0 -4
  174. package/dialoglinkedasset/package.json +0 -4
  175. package/dialogprintqr/DialogPrintQR.es.js +0 -334
  176. package/dialogprintqr/package.json +0 -4
  177. package/dialogreportdamage/package.json +0 -4
  178. package/dialogreportmissing/package.json +0 -4
  179. package/dialogreporttag/package.json +0 -4
  180. package/dialogselecttree/package.json +0 -4
  181. package/dialogselectuser/package.json +0 -4
  182. package/dialogtransferlog/package.json +0 -4
  183. package/directives/focus/package.json +0 -4
  184. package/directives/tooltip/index.es.js +0 -4
  185. package/directives/tooltip/package.json +0 -4
  186. package/disposalreport/package.json +0 -4
  187. package/dropdown/package.json +0 -4
  188. package/event-bus/package.json +0 -4
  189. package/fileupload/package.json +0 -4
  190. package/filtercontainer/package.json +0 -4
  191. package/form/package.json +0 -4
  192. package/icon/package.json +0 -4
  193. package/image/package.json +0 -4
  194. package/imagecompressor/package.json +0 -4
  195. package/index.d.ts +0 -2
  196. package/inlinemessage/package.json +0 -4
  197. package/inputbadge/package.json +0 -4
  198. package/inputcurrency/InputCurrency.es.js +0 -150
  199. package/inputcurrency/helpers/index.es.js +0 -5
  200. package/inputcurrency/helpers/package.json +0 -4
  201. package/inputcurrency/package.json +0 -4
  202. package/inputemail/package.json +0 -4
  203. package/inputnumber/package.json +0 -4
  204. package/inputotp/package.json +0 -4
  205. package/inputpassword/package.json +0 -4
  206. package/inputphonenumber/package.json +0 -4
  207. package/inputrangenumber/package.json +0 -4
  208. package/inputsearch/package.json +0 -4
  209. package/inputtext/package.json +0 -4
  210. package/inputurl/package.json +0 -4
  211. package/invisiblefield/package.json +0 -4
  212. package/languageswitcher/package.json +0 -4
  213. package/litedropdown/package.json +0 -4
  214. package/loading/package.json +0 -4
  215. package/loading/store/index.es.js +0 -5
  216. package/loading/store/package.json +0 -4
  217. package/menu/package.json +0 -4
  218. package/multiselect/package.json +0 -4
  219. package/overlaypanel/package.json +0 -4
  220. package/paginator/package.json +0 -4
  221. package/plugins/formValidation/package.json +0 -4
  222. package/plugins/i18n/index.es.js +0 -8
  223. package/plugins/i18n/package.json +0 -4
  224. package/plugins/i18n-extension.d.ts +0 -4
  225. package/steps/package.json +0 -4
  226. package/tabmenu/package.json +0 -4
  227. package/tagtype/package.json +0 -4
  228. package/textarea/package.json +0 -4
  229. package/timeline/package.json +0 -4
  230. package/toast/package.json +0 -4
  231. package/toast/service/index.es.js +0 -5
  232. package/toast/service/package.json +0 -4
  233. package/toggleswitch/package.json +0 -4
  234. package/transactionroles/package.json +0 -4
  235. package/tree/package.json +0 -4
  236. package/username/package.json +0 -4
  237. package/userwithicon/package.json +0 -4
  238. package/utils/package.json +0 -4
  239. package/validatormessage/package.json +0 -4
  240. /package/inputgroup/{InputGroup.es.js → index.es.js} +0 -0
  241. /package/mentionsection/{MentionSection.es.js → index.es.js} +0 -0
  242. /package/multirow/{MultiRow.es.js → index.es.js} +0 -0
@@ -1,4 +0,0 @@
1
- {
2
- "module": "./index.es.js",
3
- "types": "./index.d.ts"
4
- }
@@ -1,179 +0,0 @@
1
- import "../utils/role.util.es.js";
2
- import "../utils/listenSidebarChanges.util.es.js";
3
- import "../utils/object.util.es.js";
4
- import "../utils/date.util.es.js";
5
- import "../utils/textFormatter.util.es.js";
6
- import "../utils/exportToExcel.util.es.js";
7
- import { g as X } from "../utils/getStatusSeverity.util.es.js";
8
- import { u as Y } from "../utils/toast.util.es.js";
9
- import { shallowRef as J, ref as Z, defineComponent as ee, onMounted as se, computed as v, watch as ae, createElementBlock as f, openBlock as m, createVNode as g, createElementVNode as l, createCommentVNode as y, toDisplayString as C, Fragment as te, unref as W, normalizeClass as N } from "vue";
10
- import { AssetServices as le } from "@tagsamurai/fats-api-services";
11
- import "../vendor/single-spa/lib/es2015/esm/single-spa.min.es.js";
12
- import I from "../badge/index.es.js";
13
- import ne from "../image/index.es.js";
14
- import oe from "../tagtype/index.es.js";
15
- const Oe = (o, n = !1) => Object.keys(re(o, n)).map(Number), re = (o, n = !1) => Object.fromEntries(
16
- Object.entries(o).filter(([t, h]) => {
17
- const b = h.checked && !h.partialChecked, T = n || t != "-1";
18
- return b && T;
19
- })
20
- ), ie = (o) => o ? o.flatMap((n) => [
21
- { ...n },
22
- ...ie(n.children)
23
- ]) : [], q = J(!1), z = Z(), ue = () => ({
24
- loading: q,
25
- message: z,
26
- setLoading: (n, t) => {
27
- q.value = n, z.value = t, document.body.classList[n ? "add" : "remove"]("loading");
28
- }
29
- }), de = { class: "flex justify-between gap-[18px] dark:text-general-100" }, ce = { class: "w-full flex flex-col gap-[6px]" }, pe = { class: "flex justify-between" }, fe = { class: "" }, me = { class: "text-[16px] font-bold leading-[19.12px]" }, ve = { class: "flex items-center gap-[6px]" }, ge = { class: "text-general-400 leading-[16.39px]" }, ye = ["href"], _e = { class: "flex flex-col gap-1" }, xe = {
30
- key: 0,
31
- class: "flex gap-3"
32
- }, he = {
33
- key: 1,
34
- class: "flex gap-3"
35
- }, be = {
36
- key: 2,
37
- class: "flex gap-3"
38
- }, ke = {
39
- key: 3,
40
- class: "flex gap-3"
41
- }, Fe = /* @__PURE__ */ ee({
42
- __name: "AssetInfo",
43
- props: {
44
- id: {},
45
- fields: {},
46
- transactionDetail: {},
47
- useNfc: { type: Boolean, default: !0 },
48
- useTagType: { type: Boolean, default: !0 }
49
- },
50
- setup(o, { expose: n }) {
51
- const t = o;
52
- se(async () => {
53
- t.transactionDetail ? e.value = t.transactionDetail : await U();
54
- });
55
- const h = Y(), { setLoading: b } = ue(), T = JSON.parse(localStorage.getItem("user") ?? "{}"), e = J(), w = v(() => {
56
- var s;
57
- return (s = t.fields) == null ? void 0 : s.includes("status");
58
- }), R = v(() => {
59
- const {
60
- setDefault: s,
61
- firstImageBig: a,
62
- secondImageBig: r,
63
- assetImageBig: i,
64
- assetImage: u,
65
- firstImage: d,
66
- secondImage: c
67
- } = e.value ?? {}, p = s === "firstImage";
68
- return t.transactionDetail ? u ?? i : p ? d ?? a : c ?? r;
69
- }), H = v(() => {
70
- var s, a, r, i, u, d, c, p, _, x;
71
- return t.transactionDetail ? (r = (a = (s = e.value) == null ? void 0 : s.assetName) == null ? void 0 : a.aliasCode) != null && r.length ? `(${(u = (i = e.value) == null ? void 0 : i.assetName) == null ? void 0 : u.aliasCode})` : "" : (p = (c = (d = e.value) == null ? void 0 : d.name) == null ? void 0 : c.aliasCode) != null && p.length ? `(${(x = (_ = e.value) == null ? void 0 : _.name) == null ? void 0 : x.aliasCode})` : "";
72
- }), P = v(() => {
73
- var s, a;
74
- return ((s = e.value) == null ? void 0 : s.assetTagType) ?? ((a = e.value) == null ? void 0 : a.tagType);
75
- }), Q = v(() => {
76
- var s, a;
77
- return ((s = e.value) == null ? void 0 : s.assetName) ?? ((a = e.value) == null ? void 0 : a.name);
78
- }), k = v(() => [
79
- {
80
- "w-[69px]": !w.value,
81
- "w-[76px]": w.value
82
- }
83
- ]), U = async () => {
84
- try {
85
- b(!0);
86
- const { data: s } = await le.getAssetDetail(t.id);
87
- s && (e.value = s.data);
88
- } catch (s) {
89
- h.add({ error: s, message: "Error, failed to load asset details." });
90
- } finally {
91
- b(!1);
92
- }
93
- };
94
- return ae(
95
- () => t.transactionDetail,
96
- (s) => {
97
- e.value = s;
98
- },
99
- { deep: !0 }
100
- ), n({ asset: e }), (s, a) => {
101
- var r, i, u, d, c, p, _, x, D, B, S, A, $, j, L, E, M, O, F, V, G, K;
102
- return m(), f("div", de, [
103
- g(ne, { src: R.value }, null, 8, ["src"]),
104
- l("div", ce, [
105
- l("div", pe, [
106
- l("div", fe, [
107
- l("div", me, C(((r = Q.value) == null ? void 0 : r.nameWithSequence) ?? "-"), 1),
108
- l("div", ve, [
109
- l("span", ge, C(((i = e.value) == null ? void 0 : i.assetId) ?? "-") + " " + C(H.value), 1),
110
- s.useTagType ? (m(), f(te, { key: 0 }, [
111
- a[0] || (a[0] = l("div", { class: "w-[6px] h-[6px] rounded-full bg-general-100" }, null, -1)),
112
- g(oe, {
113
- type: P.value,
114
- "use-nfc": s.useNfc
115
- }, null, 8, ["type", "use-nfc"])
116
- ], 64)) : y("", !0)
117
- ])
118
- ]),
119
- W(T).userType !== "Basic" ? (m(), f("a", {
120
- key: 0,
121
- href: `/assets/detail/${((u = e.value) == null ? void 0 : u.asset) ?? ((d = e.value) == null ? void 0 : d._id)}`,
122
- class: "text-primary-500",
123
- target: "_blank"
124
- }, " Asset Detail > ", 8, ye)) : y("", !0)
125
- ]),
126
- l("div", _e, [
127
- !t.fields || (c = t.fields) != null && c.includes("brand") ? (m(), f("div", xe, [
128
- l("span", {
129
- class: N(k.value)
130
- }, " Brand ", 2),
131
- a[1] || (a[1] = l("span", null, ":", -1)),
132
- g(I, {
133
- label: ((_ = (p = e.value) == null ? void 0 : p.assetBrand) == null ? void 0 : _.name) ?? ((D = (x = e.value) == null ? void 0 : x.brand) == null ? void 0 : D.name) ?? "-",
134
- severity: "dark"
135
- }, null, 8, ["label"])
136
- ])) : y("", !0),
137
- !t.fields || (B = t.fields) != null && B.includes("model") ? (m(), f("div", he, [
138
- l("span", {
139
- class: N(k.value)
140
- }, " Model/Type ", 2),
141
- a[2] || (a[2] = l("span", null, ":", -1)),
142
- g(I, {
143
- label: ((A = (S = e.value) == null ? void 0 : S.assetModel) == null ? void 0 : A.name) ?? ((j = ($ = e.value) == null ? void 0 : $.model) == null ? void 0 : j.name) ?? "-",
144
- severity: "dark"
145
- }, null, 8, ["label"])
146
- ])) : y("", !0),
147
- !t.fields || (L = t.fields) != null && L.includes("group") ? (m(), f("div", be, [
148
- l("span", {
149
- class: N(k.value)
150
- }, " Group ", 2),
151
- a[3] || (a[3] = l("span", null, ":", -1)),
152
- g(I, {
153
- label: ((M = (E = e.value) == null ? void 0 : E.assetGroup) == null ? void 0 : M.name) ?? ((F = (O = e.value) == null ? void 0 : O.group) == null ? void 0 : F.name) ?? "-"
154
- }, null, 8, ["label"])
155
- ])) : y("", !0),
156
- (V = t.fields) != null && V.includes("status") ? (m(), f("div", ke, [
157
- l("span", {
158
- class: N(k.value)
159
- }, " Asset Status ", 2),
160
- a[4] || (a[4] = l("span", null, ":", -1)),
161
- g(I, {
162
- label: ((G = e.value) == null ? void 0 : G.status) ?? "-",
163
- severity: W(X)((K = e.value) == null ? void 0 : K.status),
164
- format: "nowrap"
165
- }, null, 8, ["label", "severity"])
166
- ])) : y("", !0)
167
- ])
168
- ])
169
- ]);
170
- };
171
- }
172
- });
173
- export {
174
- Fe as _,
175
- re as a,
176
- ie as f,
177
- Oe as p,
178
- ue as u
179
- };
@@ -1,4 +0,0 @@
1
- {
2
- "module": "./index.es.js",
3
- "types": "./index.d.ts"
4
- }
@@ -1,4 +0,0 @@
1
- {
2
- "module": "./index.es.js",
3
- "types": "./index.d.ts"
4
- }
@@ -1,4 +0,0 @@
1
- {
2
- "module": "./index.es.js",
3
- "types": "./index.d.ts"
4
- }
@@ -1,4 +0,0 @@
1
- {
2
- "module": "./index.es.js",
3
- "types": "./index.d.ts"
4
- }
@@ -1,4 +0,0 @@
1
- {
2
- "module": "./index.es.js",
3
- "types": "./index.d.ts"
4
- }
@@ -1,120 +0,0 @@
1
- import { defineComponent as P, inject as B, computed as b, resolveDirective as g, withDirectives as c, createBlock as i, openBlock as n, unref as p, mergeProps as t, withCtx as l, renderSlot as u, createCommentVNode as d, normalizeProps as v } from "vue";
2
- import { s as y } from "../vendor/primevue/button/button.esm.es.js";
3
- import f from "../icon/index.es.js";
4
- const C = (s) => s ? Array.isArray(s) ? s : [s] : [], z = /* @__PURE__ */ P({
5
- __name: "Button",
6
- props: {
7
- style: {},
8
- class: {},
9
- label: {},
10
- icon: {},
11
- iconPos: {},
12
- iconClass: {},
13
- tooltip: {},
14
- tooltipPos: {},
15
- badge: {},
16
- badgeClass: {},
17
- badgeSeverity: {},
18
- loading: { type: Boolean },
19
- loadingIcon: {},
20
- link: { type: Boolean },
21
- severity: {},
22
- raised: { type: Boolean },
23
- rounded: { type: Boolean },
24
- text: { type: Boolean },
25
- outlined: { type: Boolean },
26
- size: {},
27
- plain: { type: Boolean }
28
- },
29
- setup(s) {
30
- const e = s, m = B("preset", {}).button, r = b(() => ({
31
- icon: e.icon ?? "check",
32
- class: [
33
- ...(m == null ? void 0 : m.icon({ props: e }).class) ?? {},
34
- { "text-base": e.icon && !e.label },
35
- // Need to use attrs, because props.label is always undefined.
36
- ...C(e.iconClass)
37
- ]
38
- }));
39
- return (o, h) => {
40
- const a = g("tooltip");
41
- return o.tooltipPos === "top" ? c((n(), i(p(y), t({ key: 0 }, e, {
42
- icon: o.icon,
43
- "icon-pos": o.iconPos
44
- }), {
45
- icon: l(({ class: k }) => [
46
- o.icon ? (n(), i(f, t({ key: 0 }, r.value, { class: k }), null, 16, ["class"])) : d("", !0)
47
- ]),
48
- default: l(() => [
49
- u(o.$slots, "default")
50
- ]),
51
- _: 3
52
- }, 16, ["icon", "icon-pos"])), [
53
- [
54
- a,
55
- o.tooltip,
56
- void 0,
57
- { top: !0 }
58
- ]
59
- ]) : o.tooltipPos === "left" ? c((n(), i(p(y), t({ key: 1 }, e, {
60
- icon: o.icon,
61
- "icon-pos": o.iconPos
62
- }), {
63
- icon: l(() => [
64
- o.icon ? (n(), i(f, v(t({ key: 0 }, r.value)), null, 16)) : d("", !0)
65
- ]),
66
- default: l(() => [
67
- u(o.$slots, "default")
68
- ]),
69
- _: 3
70
- }, 16, ["icon", "icon-pos"])), [
71
- [
72
- a,
73
- o.tooltip,
74
- void 0,
75
- { left: !0 }
76
- ]
77
- ]) : o.tooltipPos === "right" ? c((n(), i(p(y), t({ key: 2 }, e, {
78
- icon: o.icon,
79
- "icon-pos": o.iconPos
80
- }), {
81
- icon: l(() => [
82
- o.icon ? (n(), i(f, v(t({ key: 0 }, r.value)), null, 16)) : d("", !0)
83
- ]),
84
- default: l(() => [
85
- u(o.$slots, "default")
86
- ]),
87
- _: 3
88
- }, 16, ["icon", "icon-pos"])), [
89
- [
90
- a,
91
- o.tooltip,
92
- void 0,
93
- { right: !0 }
94
- ]
95
- ]) : c((n(), i(p(y), t({ key: 3 }, e, {
96
- icon: o.icon,
97
- "icon-pos": o.iconPos
98
- }), {
99
- icon: l(() => [
100
- o.icon ? (n(), i(f, v(t({ key: 0 }, r.value)), null, 16)) : d("", !0)
101
- ]),
102
- default: l(() => [
103
- u(o.$slots, "default")
104
- ]),
105
- _: 3
106
- }, 16, ["icon", "icon-pos"])), [
107
- [
108
- a,
109
- o.tooltip,
110
- void 0,
111
- { bottom: !0 }
112
- ]
113
- ]);
114
- };
115
- }
116
- });
117
- export {
118
- z as _,
119
- C as c
120
- };
@@ -1,4 +0,0 @@
1
- {
2
- "module": "./index.es.js",
3
- "types": "./index.d.ts"
4
- }
@@ -1,4 +0,0 @@
1
- {
2
- "module": "./index.es.js",
3
- "types": "./index.d.ts"
4
- }
@@ -1,238 +0,0 @@
1
- import { defineComponent as Y, onMounted as Z, onUnmounted as I, ref as R, shallowRef as y, computed as x, watch as F, withDirectives as B, createElementBlock as $, openBlock as m, mergeProps as k, createBlock as E, createCommentVNode as A, createVNode as h, unref as u, Fragment as T, renderSlot as ee, withCtx as V, normalizeClass as te, vShow as D, createElementVNode as oe, normalizeProps as ae, guardReactiveProps as ne, toDisplayString as O, createTextVNode as H, nextTick as le } from "vue";
2
- import { u as se } from "../animation/Animation.es.js";
3
- import { m as ie } from "../utils/mergePropsWithDefaults.util.es.js";
4
- import { s as ue } from "../vendor/primevue/dropdown/dropdown.esm.es.js";
5
- import { _ as N } from "../button/Button.es.js";
6
- import ce from "../icon/index.es.js";
7
- import re from "../menu/index.es.js";
8
- import { _ as de } from "../menuitem/MenuItem.es.js";
9
- function pe(t) {
10
- var a;
11
- t = t || ((a = window.eventBus) == null ? void 0 : a.all) || /* @__PURE__ */ new Map();
12
- const v = {
13
- /**
14
- * A Map of event names to registered handler functions.
15
- */
16
- all: t,
17
- /**
18
- * Register an event handler for the given type.
19
- * @param {string|symbol} type Type of event to listen for, or `'*'` for all events
20
- * @param {Function} handler Function to call in response to given event
21
- * @memberOf mitt
22
- */
23
- on(s, l) {
24
- const o = t == null ? void 0 : t.get(s);
25
- o ? o.push(l) : t == null || t.set(s, [l]);
26
- },
27
- /**
28
- * Remove an event handler for the given type.
29
- * If `handler` is omitted, all handlers of the given type are removed.
30
- * @param {string|symbol} type Type of event to unregister `handler` from (`'*'` to remove a wildcard handler)
31
- * @param {Function} [handler] Handler function to remove
32
- * @memberOf mitt
33
- */
34
- off(s, l) {
35
- const o = t == null ? void 0 : t.get(s);
36
- o && (l ? o.splice(o.indexOf(l) >>> 0, 1) : t == null || t.set(s, []));
37
- },
38
- /**
39
- * Invoke all handlers for the given type.
40
- * If present, `'*'` handlers are invoked after type-matched handlers.
41
- *
42
- * Note: Manually firing '*' handlers is not supported.
43
- *
44
- * @param {string|symbol} type The event type to invoke
45
- * @param {Any} [evt] Any value (object is recommended and powerful), passed to each handler
46
- * @memberOf mitt
47
- */
48
- emit(s, l) {
49
- let o = t == null ? void 0 : t.get(s);
50
- o && o.slice().map((d) => {
51
- d(l);
52
- }), o = t == null ? void 0 : t.get("*"), o && o.slice().map((d) => {
53
- d(s, l);
54
- });
55
- }
56
- };
57
- return window.eventBus ?? (window.eventBus = v), window.eventBus;
58
- }
59
- const b = pe(), Be = () => b, me = (t, v) => {
60
- const a = {
61
- label: v,
62
- disabled: !0
63
- }, s = t.filter((l) => l.visible !== !1);
64
- return s.length ? s : [a];
65
- }, $e = /* @__PURE__ */ Y({
66
- __name: "ButtonBulkAction",
67
- props: {
68
- disabled: { type: Boolean },
69
- selectedData: { default: () => [] },
70
- totalRecords: {},
71
- options: { default: () => [] },
72
- tableName: { default: "datatable" },
73
- selectMenuType: {},
74
- naming: {}
75
- },
76
- emits: ["apply", "update:selectedData"],
77
- setup(t, { emit: v }) {
78
- const a = t, { defaultProps: s, locale: l } = se("ButtonBulkAction"), o = ie(a, s), d = v;
79
- Z(() => {
80
- window.addEventListener("disableBulkAction", z), b.on("data-table:update-selected-data", U), b.on("data-table:update-total-record", L);
81
- }), I(() => {
82
- window.removeEventListener("disableBulkAction", z), b.off("data-table:update-total-record", U), b.off("data-table:update-selected-data", L);
83
- });
84
- const S = R(), P = R(), c = y(), g = y(0), M = y(!1), C = y(!1), p = R(a.selectedData), j = x(
85
- () => {
86
- var e;
87
- return ((e = p.value) == null ? void 0 : e.length) && !C.value && g.value > 0;
88
- }
89
- ), G = () => {
90
- window.dispatchEvent(
91
- new CustomEvent("fetchAllData", { detail: a.tableName })
92
- ), b.emit("data-table:select-all-record", { tableName: a.tableName });
93
- }, J = () => {
94
- d("update:selectedData", []), b.emit("data-table:clear-selected-data", {
95
- tableName: a.tableName
96
- });
97
- }, z = (e) => {
98
- a.tableName === e.detail.tableName && (C.value = e.detail.value);
99
- }, K = (e) => {
100
- var n;
101
- (n = S.value) == null || n.toggle(e);
102
- }, L = (e) => {
103
- a.tableName === (e == null ? void 0 : e.tableName) && (g.value = e == null ? void 0 : e.total);
104
- }, U = (e) => {
105
- e.tableName === a.tableName && (p.value = e.data, d("update:selectedData", e.data ?? []));
106
- }, Q = async (e) => {
107
- var n, r;
108
- if (e.useAdditionSlot) {
109
- c.value = e, await le();
110
- const f = (n = P.value) == null ? void 0 : n.children[1], i = f == null ? void 0 : f.querySelector(
111
- "input"
112
- );
113
- i && (i == null || i.click(), i == null || i.focus());
114
- } else e.command ? (e.command({
115
- originalEvent: void 0,
116
- item: e
117
- }), (r = S.value) == null || r.hide(), c.value = void 0) : e.url ? window.open(e.url, e.target) : e.route && window.history.pushState(void 0, "", e.route);
118
- }, X = (e) => {
119
- var n, r;
120
- (r = (n = c.value) == null ? void 0 : n.command) == null || r.call(n, {
121
- originalEvent: e,
122
- item: c.value
123
- }), c.value = void 0, d("apply");
124
- };
125
- return F(
126
- [p, g],
127
- ([e, n]) => {
128
- e != null && e.length || (c.value = void 0), M.value = (e == null ? void 0 : e.length) === n;
129
- },
130
- { deep: !0 }
131
- ), F(
132
- () => a.totalRecords,
133
- (e) => g.value = e ?? 0,
134
- { immediate: !0 }
135
- ), (e, n) => {
136
- var r, f, i, _, W, q;
137
- return B((m(), $("div", k(e.$preset.buttonbulkaction.root, {
138
- ref_key: "wrapper",
139
- ref: P
140
- }), [
141
- u(o).selectMenuType === "overlay-panel" && ((r = p.value) != null && r.length) ? (m(), E(re, {
142
- key: 0,
143
- ref_key: "menu",
144
- ref: S,
145
- model: e.options,
146
- popup: ""
147
- }, null, 8, ["model"])) : A("", !0),
148
- u(o).selectMenuType === "dropdown" ? (m(), $(T, { key: 1 }, [
149
- (f = e.selectedData) != null && f.length ? (m(), E(u(ue), {
150
- key: 0,
151
- disabled: a.disabled || C.value || !((i = e.selectedData) != null && i.length),
152
- options: u(me)(
153
- e.options,
154
- e.$wangsvue.config.locale.components.Menu.noOptionLabel
155
- ),
156
- pt: e.$preset.buttonbulkaction.dropdownmenu,
157
- "onUpdate:modelValue": n[0] || (n[0] = (w) => Q(w)),
158
- "option-label": "label",
159
- outlined: "",
160
- placeholder: "Bulk Action"
161
- }, {
162
- dropdownicon: V(({ class: w }) => [
163
- h(ce, {
164
- class: te([w]),
165
- icon: "arrow-down"
166
- }, null, 8, ["class"])
167
- ]),
168
- option: V(({ option: w }) => [
169
- h(de, {
170
- item: w,
171
- "router-props": {
172
- action: e.$preset.menu.action,
173
- label: e.$preset.menu.label,
174
- icon: e.$preset.menu.icon
175
- }
176
- }, null, 8, ["item", "router-props"])
177
- ]),
178
- _: 1
179
- }, 8, ["disabled", "options", "pt"])) : A("", !0),
180
- ee(e.$slots, "addition", { selectedOption: c.value }),
181
- B(h(N, k({ onClick: X }, e.$preset.buttonbulkaction.applybutton, { label: "Apply" }), null, 16), [
182
- [D, (_ = c.value) == null ? void 0 : _.useAdditionSlot]
183
- ])
184
- ], 64)) : A("", !0),
185
- B(oe("span", ae(ne(e.$preset.buttonbulkaction.selectionmessage)), O(u(l).currentSelectionMessage.replace(
186
- "{length} {naming}",
187
- `${p.value.length.toString()} ${u(o).naming}`
188
- )), 17), [
189
- [D, (W = p.value) == null ? void 0 : W.length]
190
- ]),
191
- B(h(N, k(
192
- { onClick: G },
193
- e.$preset.buttonbulkaction.buttonselectall({
194
- context: { selectedAll: M.value }
195
- }),
196
- { text: "" }
197
- ), {
198
- default: V(() => [
199
- M.value ? (m(), $(T, { key: 1 }, [
200
- H(O(u(l).allRecordSelected.replace("{naming}", u(o).naming)), 1)
201
- ], 64)) : (m(), $(T, { key: 0 }, [
202
- H(O(u(l).selectAllRecords.replace(
203
- "{totalRecords}",
204
- g.value.toString()
205
- )), 1)
206
- ], 64))
207
- ]),
208
- _: 1
209
- }, 16), [
210
- [D, j.value]
211
- ]),
212
- u(o).selectMenuType === "overlay-panel" ? (m(), E(N, k({
213
- key: 2,
214
- onClick: K
215
- }, e.$preset.buttonbulkaction.bulkactiontoggle, {
216
- icon: "ellipsis-h",
217
- outlined: "",
218
- severity: "secondary",
219
- size: "small"
220
- }), null, 16)) : A("", !0),
221
- h(N, k({ onClick: J }, e.$preset.buttonbulkaction.buttonclearselection, {
222
- icon: "close",
223
- severity: "danger",
224
- text: ""
225
- }), null, 16)
226
- ], 16)), [
227
- [D, (q = p.value) == null ? void 0 : q.length]
228
- ]);
229
- };
230
- }
231
- });
232
- export {
233
- $e as _,
234
- Be as a,
235
- b as e,
236
- me as f,
237
- pe as m
238
- };
@@ -1,4 +0,0 @@
1
- {
2
- "module": "./index.es.js",
3
- "types": "./index.d.ts"
4
- }
@@ -1,4 +0,0 @@
1
- {
2
- "module": "./index.es.js",
3
- "types": "./index.d.ts"
4
- }
@@ -1,4 +0,0 @@
1
- {
2
- "module": "./index.es.js",
3
- "types": "./index.d.ts"
4
- }
@@ -1,4 +0,0 @@
1
- {
2
- "module": "./index.es.js",
3
- "types": "./index.d.ts"
4
- }
@@ -1,4 +0,0 @@
1
- {
2
- "module": "./index.es.js",
3
- "types": "./index.d.ts"
4
- }