@fewangsit/wangsvue-gsts 2.0.0-alpha.3 → 2.0.0-alpha.5
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.
- package/assets/{scanner.worker-CqQNqzoU.js.map → scanner.worker-Bk2e5hSA.js.map} +1 -1
- package/changelogpage/index.d.ts +1 -1
- package/datatable/index.d.ts +1 -1
- package/dialogconfirm/index.d.ts +1 -0
- package/dialogform/index.d.ts +1 -1
- package/icon/index.d.ts +2 -0
- package/mcp/components.json +1 -1
- package/mcp/components.summary.txt +1 -1
- package/mcp/package.json +5 -5
- package/package.json +1 -1
- package/plugins/WangsVue.d.ts +2 -0
- package/stats.html +1 -1
- package/toast/index.d.ts +13 -0
- package/utils/baseToast.util.d.ts +1 -24
- package/utils/toast.util.d.ts +1 -3
- package/wangsvue-gsts.es.js +14117 -14265
- package/wangsvue-gsts.es.js.map +1 -1
- package/wangsvue-gsts.system.js +61 -61
- package/wangsvue-gsts.system.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scanner.worker-
|
|
1
|
+
{"version":3,"file":"scanner.worker-Bk2e5hSA.js","sources":["../../../library/components/buttonscan/workers/scanner.worker.ts"],"sourcesContent":["interface ConnectionOption {\n onopen: (ws: WebSocket, connectionState: ConnectionState) => void;\n onmessage: (event: MessageEvent) => void;\n onerror: (error: Event) => void;\n timeout?: number;\n}\n\ninterface WorkerMessage {\n command: string;\n sessionId: string;\n scanCommand?: string;\n userId?: string;\n companyCode?: string;\n serialNumber?: string;\n jenisDevice?: string;\n}\n\ntype ConnectionState = 'established' | 'reused';\n\nlet socket: WebSocket | null = null;\nlet timeoutId: NodeJS.Timeout | null = null; // Stores timeout ID for idle socket connection\nlet currentUserId: string | undefined;\nlet currentCompanyCode: string | undefined;\nlet sessionId: string = ''; // The unique session ID for the current connection\n\nself.onmessage = (event): void => {\n const message: WorkerMessage = event.data;\n currentCompanyCode = message.companyCode;\n\n switch (message.command) {\n case 'sync':\n sync(message);\n break;\n case 'connect':\n connect(message);\n break;\n case 'scan':\n scan(message);\n break;\n case 'stopscan':\n stopScan(message);\n break;\n default:\n break;\n }\n};\n\n/**\n * Opens a WebSocket connection if not already open.\n * If the connection is open, the `onopen` callback is immediately called.\n * @returns {WebSocket} The WebSocket instance.\n */\nconst openConnection = (opt: ConnectionOption): void => {\n let connectionState: ConnectionState = 'established';\n if (socket && socket.readyState === WebSocket.OPEN) {\n // If the socket is already open, immediately call the onopen callback\n connectionState = 'reused';\n opt.onopen(socket, connectionState);\n resetTimeOut(opt.timeout);\n } else {\n // If the socket is not open or undefined, create a new connection\n socket = new WebSocket(`${import.meta.env.VITE_APP_READER_API}`);\n }\n\n // Handle successful connection\n socket.onopen = (): void => {\n sessionId =\n Math.random().toString(36).substring(2, 15) +\n Math.random().toString(36).substring(2, 15); // Generate a random session ID\n\n connectionState = 'established';\n\n if (socket) opt.onopen(socket, connectionState); // Execute the onopen callback once the connection is established\n resetTimeOut(opt.timeout);\n };\n\n socket.onmessage = (event): void => {\n opt.onmessage(event);\n resetTimeOut(opt.timeout);\n };\n\n socket.onerror = (error): void => {\n console.error('🚀 ~ Scanner Worker: openConnection ~ error:', error);\n opt.onerror(error);\n socket?.close();\n socket = null;\n if (timeoutId) clearTimeout(timeoutId);\n };\n};\n\nconst handleSocketTimeout = (): void => {\n stopScan({ userId: currentUserId });\n currentUserId = undefined;\n if (socket) socket.close();\n socket = null;\n if (timeoutId) clearTimeout(timeoutId);\n console.info('Socket connection has been closed!');\n};\n\nconst resetTimeOut = (timeout = 0): void => {\n if (timeout) {\n // Adding this conditional to disable timout, may be sometimes it need to be enable, simpli remove the condition\n if (timeoutId) clearTimeout(timeoutId);\n timeoutId = setTimeout(handleSocketTimeout, timeout); // Timed out after 3 Minutes\n }\n};\n\nconst sync = ({ userId }: WorkerMessage): void => {\n currentUserId = userId;\n\n openConnection({\n onopen: (ws: WebSocket): void => {\n ws.send(\n JSON.stringify({\n data: {\n command: 'connect',\n userId,\n sessionId,\n companyCode: currentCompanyCode,\n source: 'app',\n },\n event: 'reader',\n }),\n );\n },\n\n onmessage: (event): void => {\n postMessage({ status: 'synced', ...JSON.parse(event.data) });\n },\n\n onerror: (error): void => {\n postMessage({ status: 'sync_error', error });\n },\n });\n};\n\nconst connect = ({ userId }: WorkerMessage): void => {\n currentUserId = userId;\n\n openConnection({\n onopen: (ws: WebSocket, state): void => {\n if (state === 'established') {\n ws.send(\n JSON.stringify({\n data: {\n command: 'connect',\n userId,\n source: 'app',\n sessionId,\n companyCode: currentCompanyCode,\n },\n event: 'reader',\n }),\n );\n } else {\n postMessage({\n status: 'connection_reused',\n });\n }\n },\n\n onmessage: (event): void => {\n postMessage({\n status: 'connection_established',\n ...JSON.parse(event.data),\n });\n },\n\n onerror: (error): void => {\n postMessage({ status: 'error_connecting', error });\n },\n });\n};\n\nconst scan = ({\n scanCommand,\n userId,\n serialNumber,\n jenisDevice,\n}: WorkerMessage): void => {\n currentUserId = userId;\n\n openConnection({\n onopen: (ws: WebSocket): void => {\n ws.send(\n JSON.stringify({\n data: {\n command: scanCommand,\n userId,\n sessionId,\n companyCode: currentCompanyCode,\n source: 'app',\n serialNumber,\n jenisDevice,\n },\n event: 'reader',\n }),\n );\n\n postMessage({ status: 'scan_started' });\n },\n\n onmessage: (event): void => {\n postMessage({ status: 'scanned', ...JSON.parse(event.data) });\n },\n\n onerror: (error): void => {\n postMessage({ status: 'scan_error', error });\n },\n });\n};\n\n/**\n * Single Scan:\n * - Stop Scan will be invoked on socket timeout\n *\n * Bulk Scan:\n * - Stop Scan will also be invoked on stopScan by user interaction\n */\nconst stopScan = ({ userId }: Partial<WorkerMessage>): void => {\n if (socket && socket.readyState === WebSocket.OPEN) {\n socket.send(\n JSON.stringify({\n data: {\n command: 'stopscan',\n userId,\n source: 'app',\n sessionId,\n companyCode: currentCompanyCode,\n },\n event: 'reader',\n }),\n );\n\n postMessage({ status: 'scan_stopped' });\n console.info('Scan Process Stopped!');\n }\n};\n"],"names":["socket","timeoutId","currentUserId","currentCompanyCode","sessionId","event","message","sync","connect","scan","stopScan","openConnection","opt","connectionState","resetTimeOut","error","handleSocketTimeout","timeout","userId","ws","state","scanCommand","serialNumber","jenisDevice"],"mappings":"yBAmBA,IAAIA,EAA2B,KAC3BC,EAAmC,KACnCC,EACAC,EACAC,EAAoB,GAExB,KAAK,UAAaC,GAAgB,CAChC,MAAMC,EAAyBD,EAAM,KAGrC,OAFAF,EAAqBG,EAAQ,YAErBA,EAAQ,QAAA,CACd,IAAK,OACHC,EAAKD,CAAO,EACZ,MACF,IAAK,UACHE,EAAQF,CAAO,EACf,MACF,IAAK,OACHG,EAAKH,CAAO,EACZ,MACF,IAAK,WACHI,EAASJ,CAAO,EAChB,KAEA,CAEN,EAOA,MAAMK,EAAkBC,GAAgC,CACtD,IAAIC,EAAmC,cACnCb,GAAUA,EAAO,aAAe,UAAU,MAE5Ca,EAAkB,SAClBD,EAAI,OAAOZ,EAAQa,CAAe,EAClCC,EAAaF,EAAI,OAAO,GAGxBZ,EAAS,IAAI,UAAU,qCAAwC,EAIjEA,EAAO,OAAS,IAAY,CAC1BI,EACE,KAAK,OAAA,EAAS,SAAS,EAAE,EAAE,UAAU,EAAG,EAAE,EAC1C,KAAK,SAAS,SAAS,EAAE,EAAE,UAAU,EAAG,EAAE,EAE5CS,EAAkB,cAEdb,GAAQY,EAAI,OAAOZ,EAAQa,CAAe,EAC9CC,EAAaF,EAAI,OAAO,CAC1B,EAEAZ,EAAO,UAAaK,GAAgB,CAClCO,EAAI,UAAUP,CAAK,EACnBS,EAAaF,EAAI,OAAO,CAC1B,EAEAZ,EAAO,QAAWe,GAAgB,CAChC,QAAQ,MAAM,+CAAgDA,CAAK,EACnEH,EAAI,QAAQG,CAAK,EACjBf,GAAQ,MAAA,EACRA,EAAS,KACLC,gBAAwBA,CAAS,CACvC,CACF,EAEMe,EAAsB,IAAY,CACtCN,EAAS,CAAE,OAAQR,EAAe,EAClCA,EAAg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Q,GAAwB,CAC/BA,EAAG,KACD,KAAK,UAAU,CACb,KAAM,CACJ,QAASE,EACT,OAAAH,EACA,UAAAd,EACA,YAAaD,EACb,OAAQ,MACR,aAAAmB,EACA,YAAAC,CAAA,EAEF,MAAO,QAAA,CACR,CAAA,EAGH,YAAY,CAAE,OAAQ,eAAgB,CACxC,EAEA,UAAYlB,GAAgB,CAC1B,YAAY,CAAE,OAAQ,UAAW,GAAG,KAAK,MAAMA,EAAM,IAAI,EAAG,CAC9D,EAEA,QAAUU,GAAgB,CACxB,YAAY,CAAE,OAAQ,aAAc,MAAAA,CAAA,CAAO,CAC7C,CAAA,CACD,CACH,EASML,EAAW,CAAC,CAAE,OAAAQ,KAA2C,CACzDlB,GAAUA,EAAO,aAAe,UAAU,OAC5CA,EAAO,KACL,KAAK,UAAU,CACb,KAAM,CACJ,QAAS,WACT,OAAAkB,EACA,OAAQ,MACR,UAAAd,EACA,YAAaD,CAAA,EAEf,MAAO,QAAA,CACR,CAAA,EAGH,YAAY,CAAE,OAAQ,eAAgB,EACtC,QAAQ,KAAK,uBAAuB,EAExC"}
|
package/changelogpage/index.d.ts
CHANGED
package/datatable/index.d.ts
CHANGED
package/dialogconfirm/index.d.ts
CHANGED
package/dialogform/index.d.ts
CHANGED
package/icon/index.d.ts
CHANGED
|
@@ -188,6 +188,7 @@ export type WangsIcons =
|
|
|
188
188
|
| 'add-line' // Preferred
|
|
189
189
|
| 'arrow-down-s-line' // Preferred
|
|
190
190
|
| 'arrow-drop-down-line' // Preferred
|
|
191
|
+
| 'folder-line' // Preferred
|
|
191
192
|
| 'arrow-left-double-line' // Preferred
|
|
192
193
|
| 'arrow-left-line' // Preferred
|
|
193
194
|
| 'arrow-up-down-line' // Preferred
|
|
@@ -214,6 +215,7 @@ export type WangsIcons =
|
|
|
214
215
|
| 'file-list-2-line' // Preferred
|
|
215
216
|
| 'file-settings-line' // Preferred
|
|
216
217
|
| 'group-line' // Preferred
|
|
218
|
+
| 'global-line' // Preferred
|
|
217
219
|
| 'hand-coin-line' // Preferred
|
|
218
220
|
| 'history-line' // Preferred
|
|
219
221
|
| 'image-add-line' // Preferred
|
package/mcp/components.json
CHANGED
package/mcp/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fewangsit/wangsvue-gsts-mcp",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.4",
|
|
4
4
|
"description": "MCP Server for @fewangsit/wangsvue-gsts",
|
|
5
5
|
"main": "main.js",
|
|
6
6
|
"type": "module",
|
|
@@ -10,18 +10,18 @@
|
|
|
10
10
|
"buildContext": {
|
|
11
11
|
"package": {
|
|
12
12
|
"name": "@fewangsit/wangsvue-gsts",
|
|
13
|
-
"version": "2.0.0-alpha.
|
|
13
|
+
"version": "2.0.0-alpha.4",
|
|
14
14
|
"description": "Global Settings Tagsamurai VueJS Component Library",
|
|
15
15
|
"repository": "https://github.com/fewangsit/wangsvue",
|
|
16
16
|
"workspace": "wangsvue-gsts"
|
|
17
17
|
},
|
|
18
18
|
"build": {
|
|
19
|
-
"timestamp": "2026-
|
|
19
|
+
"timestamp": "2026-04-24T06:44:52.269Z",
|
|
20
20
|
"gitInfo": {
|
|
21
|
-
"head": "
|
|
21
|
+
"head": "99e73c6ef4dc03e059b12f9701e28dde0626d23c",
|
|
22
22
|
"branch": "dev",
|
|
23
23
|
"repository": "https://github.com/fewangsit/wangsvue.git",
|
|
24
|
-
"timestamp": "2026-
|
|
24
|
+
"timestamp": "2026-04-24T06:44:52.029Z"
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
}
|
package/package.json
CHANGED
package/plugins/WangsVue.d.ts
CHANGED
|
@@ -39,6 +39,7 @@ import { MultiSelectLocaleConfig } from '../multiselect';
|
|
|
39
39
|
import { OverlayPanelPassThroughOptions } from '../overlaypanel';
|
|
40
40
|
import { TagTypeProps } from '../tagtype';
|
|
41
41
|
import { TextareaLocaleConfig } from '../textarea';
|
|
42
|
+
import { ToastLocaleConfig } from '../toast';
|
|
42
43
|
import { TreeProps } from '../tree';
|
|
43
44
|
import {
|
|
44
45
|
UserNameComponentConfigs,
|
|
@@ -87,6 +88,7 @@ interface ComponentLocaleConfig {
|
|
|
87
88
|
DataTable?: DataTableLocaleConfig;
|
|
88
89
|
ImageCompressor?: ImageCompressorLocaleConfig;
|
|
89
90
|
ButtonDownload?: ButtonDownloadLocaleConfig;
|
|
91
|
+
Toast?: ToastLocaleConfig;
|
|
90
92
|
}
|
|
91
93
|
export interface LocaleConfig {
|
|
92
94
|
global: Partial<typeof DEFAULT_GLOBAL_LOCALE_CONFIG>;
|