@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,416 +0,0 @@
1
- import { AxiosError as ye } from "axios";
2
- import { ref as re, defineComponent as Re, onBeforeUnmount as _e, shallowRef as v, computed as E, createElementBlock as D, openBlock as u, Fragment as F, createVNode as b, createBlock as M, createCommentVNode as U, mergeProps as De, withCtx as ke, createElementVNode as C, normalizeClass as ee, createTextVNode as ne, toDisplayString as A, Teleport as Ne } from "vue";
3
- import { ChangelogServices as he } from "@tagsamurai/fats-api-services";
4
- import { u as Ie } from "../utils/baseToast.util.es.js";
5
- import { _ as se } from "../button/Button.es.js";
6
- import Ee from "../dialogconfirm/index.es.js";
7
- import { _ as Ce } from "../hardwaresync/HardwareSync.es.js";
8
- import $ from "../icon/index.es.js";
9
- import z from "../toast/index.es.js";
10
- import { v as J } from "../vendor/uuid/dist/esm-browser/v4.es.js";
11
- const Oe = (a) => {
12
- if (a instanceof ye)
13
- return a.response ? "DEVICE_NOT_CONNECTED" : "DRIVER_NOT_FOUND";
14
- if (a instanceof Error && ["NOT_SUPPORTED_SYSTEM", "HARDWARE_NOT_SYNCHRONIZED"].includes(
15
- a.message
16
- ))
17
- return a.message;
18
- }, ce = `(function(){"use strict";let n=null,t=null,a;self.onmessage=s=>{const e=s.data;switch(e.command){case"sync":u(e);break;case"connect":l(e);break;case"scan":m(e);break;case"stopscan":d(e);break}};const r=s=>{let e="established";n&&n.readyState===WebSocket.OPEN?(e="reused",s.onopen(n,e),i(s.timeout)):n=new WebSocket("wss://dev-api.tagsamurai.com/rfid-reader-go/"),n.onopen=()=>{e="established",n&&s.onopen(n,e),i(s.timeout)},n.onmessage=o=>{s.onmessage(o),i(s.timeout)},n.onerror=o=>{console.error("🚀 ~ Scanner Worker: openConnection ~ error:",o),s.onerror(o),n==null||n.close(),n=null,t&&clearTimeout(t)}},p=()=>{d({userId:a}),a=void 0,n&&n.close(),n=null,t&&clearTimeout(t),console.info("Socket connection has been closed!")},i=(s=0)=>{s&&(t&&clearTimeout(t),t=setTimeout(p,s))},u=({userId:s})=>{a=s,r({onopen:e=>{e.send(JSON.stringify({data:{command:"connect",userId:s,source:"app"},event:"reader"}))},onmessage:e=>{postMessage({status:"synced",...JSON.parse(e.data)})},onerror:e=>{postMessage({status:"sync_error",error:e})}})},l=({userId:s})=>{a=s,r({onopen:(e,o)=>{o==="established"?e.send(JSON.stringify({data:{command:"connect",userId:s,source:"app"},event:"reader"})):postMessage({status:"connection_reused"})},onmessage:e=>{postMessage({status:"connection_established",...JSON.parse(e.data)})},onerror:e=>{postMessage({status:"error_connecting",error:e})}})},m=({scanCommand:s,userId:e,serialNumber:o,jenisDevice:g})=>{a=e,r({onopen:c=>{c.send(JSON.stringify({data:{command:s,userId:e,source:"app",serialNumber:o,jenisDevice:g},event:"reader"})),postMessage({status:"scan_started"})},onmessage:c=>{postMessage({status:"scanned",...JSON.parse(c.data)})},onerror:c=>{postMessage({status:"scan_error",error:c})}})},d=({userId:s})=>{n&&n.readyState===WebSocket.OPEN&&(n.send(JSON.stringify({data:{command:"stopscan",userId:s,source:"app"},event:"reader"})),postMessage({status:"scan_stopped"}),console.info("Scan Process Stopped!"))}})();
19
- `, te = typeof self < "u" && self.Blob && new Blob([ce], { type: "text/javascript;charset=utf-8" });
20
- function Te(a) {
21
- let l;
22
- try {
23
- if (l = te && (self.URL || self.webkitURL).createObjectURL(te), !l) throw "";
24
- const m = new Worker(l, {
25
- name: a == null ? void 0 : a.name
26
- });
27
- return m.addEventListener("error", () => {
28
- (self.URL || self.webkitURL).revokeObjectURL(l);
29
- }), m;
30
- } catch {
31
- return new Worker(
32
- "data:text/javascript;charset=utf-8," + encodeURIComponent(ce),
33
- {
34
- name: a == null ? void 0 : a.name
35
- }
36
- );
37
- } finally {
38
- l && (self.URL || self.webkitURL).revokeObjectURL(l);
39
- }
40
- }
41
- const ie = () => window.devices ?? [], xe = () => window.device ?? { RFID: null, QR: null }, oe = re(ie()), ae = re(xe()), Be = () => {
42
- const a = (n) => {
43
- window.devices = n, m();
44
- }, l = (n) => {
45
- window.device = n, ae.value = n;
46
- }, m = () => {
47
- oe.value = ie();
48
- };
49
- return {
50
- devices: oe,
51
- device: ae,
52
- saveDevices: a,
53
- setDevice: l,
54
- loadDevices: m
55
- };
56
- }, Le = { class: "flex gap-2 items-center" }, We = { class: "flex gap-0.5 items-center leading-4" }, Fe = { class: "flex gap-5 items-center" }, Me = {
57
- key: 1,
58
- class: "text-xs font-medium leading-[16.39px] tracking-[0.02em]"
59
- }, He = /* @__PURE__ */ Re({
60
- __name: "ButtonScan",
61
- props: {
62
- label: {},
63
- icon: {},
64
- type: { default: "RFID" },
65
- autoSwitch: { type: Boolean },
66
- scanValidation: {},
67
- modelValue: {},
68
- bulk: { type: Boolean },
69
- id: {},
70
- disabled: { type: Boolean },
71
- powerbank: { type: Boolean },
72
- labelOnly: { type: Boolean },
73
- outlined: { type: Boolean },
74
- severity: {},
75
- size: { default: void 0 },
76
- style: {},
77
- class: {},
78
- iconPos: {},
79
- iconClass: {},
80
- tooltip: {},
81
- tooltipPos: {},
82
- badge: {},
83
- badgeClass: {},
84
- badgeSeverity: {},
85
- loading: { type: Boolean },
86
- loadingIcon: {},
87
- link: { type: Boolean },
88
- raised: { type: Boolean },
89
- rounded: { type: Boolean },
90
- text: { type: Boolean },
91
- plain: { type: Boolean }
92
- },
93
- emits: ["update:modelValue", "connect", "connected", "scan", "stop", "error", "beforeStartScan"],
94
- setup(a, { expose: l, emit: m }) {
95
- const n = a, r = m;
96
- _e(() => {
97
- X();
98
- });
99
- const c = Ie(), { devices: le, device: S, saveDevices: ue, setDevice: G } = Be(), w = v(!1), O = v(!1), k = v(!1), N = v(!1), y = v(!1), V = v(!1), f = v(), H = v(0), o = v(n.type ?? "RFID"), P = [], T = E(
100
- () => o.value === "RFID" ? "RFID_Scanning" : "QR_Scanning"
101
- ), g = E(
102
- () => o.value === "RFID" ? "RFID_Connecting" : "QR_Connecting"
103
- );
104
- E(() => `The scanner could not identify the ${o.value} code. It may be damaged or improperly positioned. Please check the code and try again.`);
105
- const de = () => {
106
- window.scannerWorker ?? (window.scannerWorker = new Te());
107
- }, x = () => {
108
- const { serialNumber: e = "" } = S.value[o.value] ?? {};
109
- return e;
110
- }, q = async () => {
111
- try {
112
- de(), await ve(), w.value = !0;
113
- } catch (e) {
114
- console.error(e), w.value = !1;
115
- }
116
- }, ve = async () => {
117
- var e;
118
- try {
119
- if (!ge())
120
- throw new Error("NOT_SUPPORTED_SYSTEM");
121
- if (r("connect"), !le.value.length || !S.value[o.value])
122
- throw new Error("HARDWARE_NOT_SYNCHRONIZED");
123
- c.add({
124
- customMessage: !0,
125
- message: o.value === "QR" ? "Connecting QR Scanner..." : "Connecting RFID Scanner...",
126
- severity: "info",
127
- life: 0,
128
- group: g.value
129
- }), k.value = !0;
130
- const t = () => {
131
- r("connected", S.value[o.value]), setTimeout(() => {
132
- Q();
133
- }, 0);
134
- };
135
- window.scannerWorker.onmessage = ({ data: s }) => {
136
- var R;
137
- if (s.status === "connection_established")
138
- try {
139
- const { error: p } = (s == null ? void 0 : s.data) ?? {}, i = ((R = s == null ? void 0 : s.data) == null ? void 0 : R.deviceList) ?? [], _ = S.value[n.type], d = i.some(
140
- (W) => W.serialNumber === (_ == null ? void 0 : _.serialNumber)
141
- );
142
- if (i.length && d)
143
- t();
144
- else {
145
- if (p === "Driver not connected to server")
146
- throw new Error("DRIVER_NOT_FOUND");
147
- if (!i.length)
148
- throw new Error("DEVICE_NOT_CONNECTED");
149
- }
150
- c.removeGroup(g.value);
151
- } catch (p) {
152
- Y(p);
153
- }
154
- else s.status === "connection_reused" ? t() : s.status === "error_connecting" && (c.removeGroup(g.value), c.add({
155
- customMessage: !0,
156
- message: "Scanner connection failed",
157
- severity: "error"
158
- }));
159
- }, window.scannerWorker.postMessage({
160
- command: "connect",
161
- userId: (e = JSON.parse(localStorage.getItem("user") ?? "{}")) == null ? void 0 : e._id
162
- });
163
- } catch (t) {
164
- Y(t);
165
- }
166
- }, Q = (e = !1, t = !1) => {
167
- var R;
168
- V.value = !1, c.removeGroup(g.value), localStorage.devmode || (window.addEventListener("blur", L), window.addEventListener("beforeunload", L));
169
- const s = S.value[o.value];
170
- if (s) {
171
- let p = "";
172
- n.bulk ? p = `bulkscan-${o.value.toLowerCase()}` : p = `scan-${o.value.toLowerCase()}`, window.scannerWorker.onmessage = async ({ data: i }) => {
173
- var _;
174
- if (i.status === "scan_started")
175
- t || (H.value++, setTimeout(() => {
176
- c.add({
177
- customMessage: !0,
178
- message: "scanning",
179
- severity: "info",
180
- life: 0,
181
- group: T.value
182
- });
183
- }, 0));
184
- else if (i.status === "scanned") {
185
- const { code: d, error: W, deviceList: we } = (i == null ? void 0 : i.data) ?? {};
186
- if (W) return me(W, we);
187
- if (d) {
188
- if (["scan-rfid", "scan-qr"].includes(p)) {
189
- y.value = !!n.scanValidation;
190
- const j = await ((_ = n.scanValidation) == null ? void 0 : _.call(
191
- n,
192
- o.value,
193
- d,
194
- x()
195
- )) ?? !0;
196
- if (y.value = !1, j)
197
- n.autoSwitch ? (K(), fe()) : h(!0);
198
- else {
199
- V.value || Q(!1, !0);
200
- return;
201
- }
202
- }
203
- if (!P.includes(d)) {
204
- try {
205
- he.postScanLog({
206
- tag: d,
207
- serialNumber: x()
208
- });
209
- } catch (j) {
210
- console.error(j);
211
- }
212
- r("update:modelValue", d), r("scan", d, x()), n.bulk && P.push(d);
213
- }
214
- }
215
- } else i.status === "scan_stopped" ? h(!0) : i.status === "scan_error" && Z(i.error);
216
- }, window.scannerWorker.onerror = Z, window.scannerWorker.postMessage({
217
- command: "scan",
218
- scanCommand: p,
219
- userId: (R = JSON.parse(localStorage.getItem("user") ?? "{}")) == null ? void 0 : R._id,
220
- source: "app",
221
- jenisDevice: s.jenisDevice,
222
- serialNumber: s.serialNumber,
223
- newConnection: e
224
- });
225
- }
226
- }, Y = (e) => {
227
- G({ RFID: void 0, QR: void 0 }), N.value = !0, f.value = e instanceof Error ? e.message : Oe(e), k.value = !1, r("error", e), c.removeGroup(g.value);
228
- }, me = (e, t = []) => {
229
- let s = "";
230
- f.value = void 0, I(!0), e === "Time out" ? s = "The scanning process has timed out. Please try again." : e === "Driver not connected to server" ? f.value = "DRIVER_NOT_FOUND" : e === "Device disconnected" && (f.value = "DEVICE_DISCONNECTED", ue(t), G({ RFID: void 0, QR: void 0 })), r("error", e), N.value = !!f.value, s && c.add({
231
- customMessage: !0,
232
- message: s,
233
- error: e,
234
- life: 6e3,
235
- group: T.value
236
- });
237
- }, Z = (e) => {
238
- I(!0), r("error", e), c.add({
239
- customMessage: !0,
240
- message: "An unexpected error occurred during scanning. Please try again, and if the issue persists, contact your administrator for assistance.",
241
- error: e,
242
- life: 6e3,
243
- group: T.value
244
- });
245
- }, B = () => {
246
- window.Cypress ? pe() : q();
247
- }, pe = () => {
248
- c.add({
249
- customMessage: !0,
250
- message: "Connecting device...",
251
- severity: "info",
252
- life: 3e3,
253
- group: g.value
254
- }), setTimeout(async () => {
255
- var e;
256
- if (r("connect"), r("connected", {
257
- jenisDevice: "Handheld",
258
- serialNumber: J(),
259
- API: "v2",
260
- rfidScan: !0,
261
- qrScan: !0,
262
- name: "Device Test"
263
- }), n.bulk)
264
- r("scan", J(), "serialNumber");
265
- else {
266
- const t = J();
267
- y.value = !!n.scanValidation;
268
- const s = await ((e = n.scanValidation) == null ? void 0 : e.call(
269
- n,
270
- o.value,
271
- t,
272
- x()
273
- )) ?? !0;
274
- y.value = !1, s && (r("scan", t, "serialNumber"), h());
275
- }
276
- }, 100);
277
- }, K = () => {
278
- c.removeGroup("RFID_Scanning"), c.removeGroup("QR_Scanning");
279
- }, h = (e = !1) => {
280
- K(), k.value = !1, X(), e && r("stop"), P.splice(0);
281
- }, I = (e = !1) => {
282
- var t;
283
- window.scannerWorker.onmessage = null, window.scannerWorker.postMessage({
284
- command: "stopscan",
285
- userId: (t = JSON.parse(localStorage.getItem("user") ?? "{}")) == null ? void 0 : t._id
286
- }), h(e), V.value = !0, w.value = !1;
287
- }, fe = () => {
288
- n.bulk || (S.value[o.value] ? (o.value = o.value === "QR" ? "RFID" : "QR", Q()) : (h(), N.value = !0, f.value = "HARDWARE_NOT_SYNCHRONIZED", k.value = !1));
289
- }, L = (e) => {
290
- O.value = !0, I(!0), e.preventDefault();
291
- }, X = () => {
292
- window.removeEventListener("blur", L), window.removeEventListener("beforeunload", L);
293
- }, ge = () => {
294
- const { userAgent: e } = navigator;
295
- return e.includes("Windows");
296
- }, be = E(() => {
297
- if (!n.labelOnly)
298
- return n.icon ? n.icon : n.autoSwitch ? "qr-scan" : o.value === "QR" ? "qr" : "rfid";
299
- }), Se = E(() => n.label ? n.label : n.autoSwitch ? "SCAN TAG" : o.value === "QR" ? "Scan QR" : "Scan RFID");
300
- return l({
301
- onBeforeStartScan: B,
302
- startScan: q,
303
- stopScan: I
304
- }), (e, t) => (u(), D(F, null, [
305
- b(se, De(e.$attrs, {
306
- class: [
307
- {
308
- "[&_i]:w-2 [&_i]:h-2": e.type === "QR",
309
- "[&_i]:w-[11px] [&_i]:h-[7px]": e.type === "RFID"
310
- },
311
- "!px-1.5"
312
- ],
313
- disabled: n.disabled,
314
- icon: be.value,
315
- label: Se.value,
316
- outlined: n.outlined,
317
- severity: n.severity,
318
- size: n.size,
319
- onClick: B
320
- }), null, 16, ["class", "disabled", "icon", "label", "outlined", "severity", "size"]),
321
- b(Ce, {
322
- visible: N.value,
323
- "onUpdate:visible": t[0] || (t[0] = (s) => N.value = s),
324
- bulk: e.bulk,
325
- "error-code": f.value,
326
- "search-by": o.value,
327
- onScan: B
328
- }, null, 8, ["visible", "bulk", "error-code", "search-by"]),
329
- w.value ? (u(), M(z, {
330
- key: 0,
331
- "base-z-index": 9983,
332
- group: g.value,
333
- icon: "info"
334
- }, null, 8, ["group"])) : U("", !0),
335
- w.value ? (u(), M(z, {
336
- key: 1,
337
- "base-z-index": 9997,
338
- class: "!absolute !bottom-[80px] !h-max",
339
- group: "scan-error-validation"
340
- })) : U("", !0),
341
- w.value ? (u(), M(z, {
342
- key: H.value,
343
- "base-z-index": 9984,
344
- group: T.value,
345
- class: "[&_[data-pc-section=buttoncontainer]]"
346
- }, {
347
- message: ke(({ message: s }) => [
348
- C("div", {
349
- class: ee(
350
- s.detail == "scanning" ? "w-full -mr-8 z-10 flex gap-2 justify-between items-center text-general-800 text-xs font-normal" : "w-full"
351
- )
352
- }, [
353
- s.detail === "scanning" ? (u(), D(F, { key: 0 }, [
354
- C("section", Le, [
355
- b($, {
356
- class: "animate-spin text-base",
357
- icon: "loader-4"
358
- }),
359
- C("span", We, [
360
- o.value === "RFID" ? (u(), D(F, { key: 0 }, [
361
- b($, {
362
- class: "text-base !w-4 !h-4",
363
- icon: "rfid"
364
- }),
365
- ne(" " + A(y.value ? "Validating RFID..." : "RFID Scanning..."), 1)
366
- ], 64)) : (u(), D(F, { key: 1 }, [
367
- b($, {
368
- class: "text-sm",
369
- icon: "qr"
370
- }),
371
- ne(" " + A(y.value ? "Validating QR..." : "QR Scanning..."), 1)
372
- ], 64))
373
- ])
374
- ]),
375
- C("section", Fe, [
376
- t[4] || (t[4] = C("span", null, "do not leave this page", -1)),
377
- b(se, {
378
- onClick: t[1] || (t[1] = (R) => I(!0)),
379
- label: "Stop Scan",
380
- severity: "danger"
381
- })
382
- ])
383
- ], 64)) : (u(), D("span", Me, A(s.detail), 1))
384
- ], 2)
385
- ]),
386
- _: 1
387
- }, 8, ["group"])) : U("", !0),
388
- b(Ee, {
389
- visible: O.value,
390
- "onUpdate:visible": t[2] || (t[2] = (s) => O.value = s),
391
- header: `${o.value} SCAN STOPPED`,
392
- onConfirm: t[3] || (t[3] = (s) => (O.value = !1, B())),
393
- "confirm-label": "Continue",
394
- message: "The scan process was interrupted because you want to leave this window.",
395
- severity: "danger"
396
- }, null, 8, ["visible", "header"]),
397
- (u(), M(Ne, { to: "body" }, [
398
- k.value ? (u(), D("div", {
399
- key: 0,
400
- class: ee([
401
- e.$preset.dialog.mask({ props: { modal: !0 } }).class,
402
- "w-screen h-screen fixed top-0 left-0",
403
- "!z-[9982]"
404
- ]),
405
- "data-ts-section": "toast-mask"
406
- }, null, 2)) : U("", !0)
407
- ]))
408
- ], 64));
409
- }
410
- });
411
- export {
412
- Te as W,
413
- He as _,
414
- Oe as g,
415
- Be as u
416
- };
@@ -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,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
- }
package/card/package.json DELETED
@@ -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,4 +0,0 @@
1
- {
2
- "module": "./index.es.js",
3
- "types": "./index.d.ts"
4
- }