@fewangsit/wangsvue-gsts 2.0.0-alpha.27 → 2.0.0-alpha.28
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-DQsz7oT_.js.map → scanner.worker-Bk2e5hSA.js.map} +1 -1
- package/badge/Badge.fm.md +32 -0
- package/breadcrumb/Breadcrumb.fm.md +23 -0
- package/button/Button.fm.md +53 -0
- package/buttonbulkaction/ButtonBulkAction-MenuItem.fm.md +18 -0
- package/buttonbulkaction/ButtonBulkAction.fm.md +25 -0
- package/buttondownload/ButtonDownload.fm.md +22 -0
- package/buttonfilter/ButtonFilter.fm.md +19 -0
- package/buttonsearch/ButtonSearch.fm.md +19 -0
- package/buttonsearchbyscan/ButtonSearchByScan.fm.md +25 -0
- package/buttonselecttree/ButtonSelectTree.fm.md +40 -0
- package/calendar/Calendar.fm.md +34 -0
- package/changelogpage/index.d.ts +1 -1
- package/components.fm.md +56 -0
- package/datatable/DataTable-MenuItem.fm.md +22 -0
- package/datatable/DataTable-TableColumn.fm.md +52 -0
- package/datatable/DataTable.fm.md +40 -0
- package/datatable/index.d.ts +1 -0
- package/dialogconfirm/DialogConfirm.fm.md +29 -0
- package/dialogform/DialogForm.fm.md +57 -0
- package/dialogselecttree/DialogSelectTree.fm.md +42 -0
- package/dropdown/Dropdown.fm.md +34 -0
- package/fileupload/FileUpload.fm.md +31 -0
- package/icon/index.d.ts +63 -66
- package/imagecompressor/ImageCompressor.fm.md +44 -0
- package/inputbadge/InputBadge.fm.md +34 -0
- package/inputnumber/InputNumber.fm.md +39 -0
- package/inputpassword/InputPassword.fm.md +28 -0
- package/inputphonenumber/InputPhoneNumber.fm.md +34 -0
- package/inputrangenumber/InputRangeNumber.fm.md +31 -0
- package/inputtext/InputText.fm.md +34 -0
- package/mcp/main.js +1216 -1092
- package/mcp/package.json +6 -6
- package/multiselect/MultiSelect.fm.md +34 -0
- package/package.json +1 -1
- package/stats.html +1 -1
- package/tabmenu/TabMenu.fm.md +28 -0
- package/textarea/TextArea.fm.md +34 -0
- package/wangsvue-gsts.es.js +12 -5
- package/wangsvue-gsts.es.js.map +1 -1
- package/wangsvue-gsts.system.js +57 -57
- package/wangsvue-gsts.system.js.map +1 -1
- package/mcp/components.json +0 -4776
- package/mcp/components.summary.txt +0 -27
|
@@ -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 {\r\n onopen: (ws: WebSocket, connectionState: ConnectionState) => void;\r\n onmessage: (event: MessageEvent) => void;\r\n onerror: (error: Event) => void;\r\n timeout?: number;\r\n}\r\n\r\ninterface WorkerMessage {\r\n command: string;\r\n sessionId: string;\r\n scanCommand?: string;\r\n userId?: string;\r\n companyCode?: string;\r\n serialNumber?: string;\r\n jenisDevice?: string;\r\n}\r\n\r\ntype ConnectionState = 'established' | 'reused';\r\n\r\nlet socket: WebSocket | null = null;\r\nlet timeoutId: NodeJS.Timeout | null = null; // Stores timeout ID for idle socket connection\r\nlet currentUserId: string | undefined;\r\nlet currentCompanyCode: string | undefined;\r\nlet sessionId: string = ''; // The unique session ID for the current connection\r\n\r\nself.onmessage = (event): void => {\r\n const message: WorkerMessage = event.data;\r\n currentCompanyCode = message.companyCode;\r\n\r\n switch (message.command) {\r\n case 'sync':\r\n sync(message);\r\n break;\r\n case 'connect':\r\n connect(message);\r\n break;\r\n case 'scan':\r\n scan(message);\r\n break;\r\n case 'stopscan':\r\n stopScan(message);\r\n break;\r\n default:\r\n break;\r\n }\r\n};\r\n\r\n/**\r\n * Opens a WebSocket connection if not already open.\r\n * If the connection is open, the `onopen` callback is immediately called.\r\n * @returns {WebSocket} The WebSocket instance.\r\n */\r\nconst openConnection = (opt: ConnectionOption): void => {\r\n let connectionState: ConnectionState = 'established';\r\n if (socket && socket.readyState === WebSocket.OPEN) {\r\n // If the socket is already open, immediately call the onopen callback\r\n connectionState = 'reused';\r\n opt.onopen(socket, connectionState);\r\n resetTimeOut(opt.timeout);\r\n } else {\r\n // If the socket is not open or undefined, create a new connection\r\n socket = new WebSocket(`${import.meta.env.VITE_APP_READER_API}`);\r\n }\r\n\r\n // Handle successful connection\r\n socket.onopen = (): void => {\r\n sessionId =\r\n Math.random().toString(36).substring(2, 15) +\r\n Math.random().toString(36).substring(2, 15); // Generate a random session ID\r\n\r\n connectionState = 'established';\r\n\r\n if (socket) opt.onopen(socket, connectionState); // Execute the onopen callback once the connection is established\r\n resetTimeOut(opt.timeout);\r\n };\r\n\r\n socket.onmessage = (event): void => {\r\n opt.onmessage(event);\r\n resetTimeOut(opt.timeout);\r\n };\r\n\r\n socket.onerror = (error): void => {\r\n console.error('🚀 ~ Scanner Worker: openConnection ~ error:', error);\r\n opt.onerror(error);\r\n socket?.close();\r\n socket = null;\r\n if (timeoutId) clearTimeout(timeoutId);\r\n };\r\n};\r\n\r\nconst handleSocketTimeout = (): void => {\r\n stopScan({ userId: currentUserId });\r\n currentUserId = undefined;\r\n if (socket) socket.close();\r\n socket = null;\r\n if (timeoutId) clearTimeout(timeoutId);\r\n console.info('Socket connection has been closed!');\r\n};\r\n\r\nconst resetTimeOut = (timeout = 0): void => {\r\n if (timeout) {\r\n // Adding this conditional to disable timout, may be sometimes it need to be enable, simpli remove the condition\r\n if (timeoutId) clearTimeout(timeoutId);\r\n timeoutId = setTimeout(handleSocketTimeout, timeout); // Timed out after 3 Minutes\r\n }\r\n};\r\n\r\nconst sync = ({ userId }: WorkerMessage): void => {\r\n currentUserId = userId;\r\n\r\n openConnection({\r\n onopen: (ws: WebSocket): void => {\r\n ws.send(\r\n JSON.stringify({\r\n data: {\r\n command: 'connect',\r\n userId,\r\n sessionId,\r\n companyCode: currentCompanyCode,\r\n source: 'app',\r\n },\r\n event: 'reader',\r\n }),\r\n );\r\n },\r\n\r\n onmessage: (event): void => {\r\n postMessage({ status: 'synced', ...JSON.parse(event.data) });\r\n },\r\n\r\n onerror: (error): void => {\r\n postMessage({ status: 'sync_error', error });\r\n },\r\n });\r\n};\r\n\r\nconst connect = ({ userId }: WorkerMessage): void => {\r\n currentUserId = userId;\r\n\r\n openConnection({\r\n onopen: (ws: WebSocket, state): void => {\r\n if (state === 'established') {\r\n ws.send(\r\n JSON.stringify({\r\n data: {\r\n command: 'connect',\r\n userId,\r\n source: 'app',\r\n sessionId,\r\n companyCode: currentCompanyCode,\r\n },\r\n event: 'reader',\r\n }),\r\n );\r\n } else {\r\n postMessage({\r\n status: 'connection_reused',\r\n });\r\n }\r\n },\r\n\r\n onmessage: (event): void => {\r\n postMessage({\r\n status: 'connection_established',\r\n ...JSON.parse(event.data),\r\n });\r\n },\r\n\r\n onerror: (error): void => {\r\n postMessage({ status: 'error_connecting', error });\r\n },\r\n });\r\n};\r\n\r\nconst scan = ({\r\n scanCommand,\r\n userId,\r\n serialNumber,\r\n jenisDevice,\r\n}: WorkerMessage): void => {\r\n currentUserId = userId;\r\n\r\n openConnection({\r\n onopen: (ws: WebSocket): void => {\r\n ws.send(\r\n JSON.stringify({\r\n data: {\r\n command: scanCommand,\r\n userId,\r\n sessionId,\r\n companyCode: currentCompanyCode,\r\n source: 'app',\r\n serialNumber,\r\n jenisDevice,\r\n },\r\n event: 'reader',\r\n }),\r\n );\r\n\r\n postMessage({ status: 'scan_started' });\r\n },\r\n\r\n onmessage: (event): void => {\r\n postMessage({ status: 'scanned', ...JSON.parse(event.data) });\r\n },\r\n\r\n onerror: (error): void => {\r\n postMessage({ status: 'scan_error', error });\r\n },\r\n });\r\n};\r\n\r\n/**\r\n * Single Scan:\r\n * - Stop Scan will be invoked on socket timeout\r\n *\r\n * Bulk Scan:\r\n * - Stop Scan will also be invoked on stopScan by user interaction\r\n */\r\nconst stopScan = ({ userId }: Partial<WorkerMessage>): void => {\r\n if (socket && socket.readyState === WebSocket.OPEN) {\r\n socket.send(\r\n JSON.stringify({\r\n data: {\r\n command: 'stopscan',\r\n userId,\r\n source: 'app',\r\n sessionId,\r\n companyCode: currentCompanyCode,\r\n },\r\n event: 'reader',\r\n }),\r\n );\r\n\r\n postMessage({ status: 'scan_stopped' });\r\n console.info('Scan Process Stopped!');\r\n }\r\n};\r\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":"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"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Badge
|
|
2
|
+
type reference: ./index.d.ts
|
|
3
|
+
|
|
4
|
+
Append a `Badge` component when the figma context contains:
|
|
5
|
+
|
|
6
|
+
- A figma component or instance named "Badge" or similar, consisting of a small rounded pill with centered text (9px SemiBold) and an optional close/remove icon.
|
|
7
|
+
- The Figma `BadgeProps` uses `color` ("Primary" | "Primary Supply" | "Success" | "Warning" | "Dark") and `propDelete` (boolean) to define appearance.
|
|
8
|
+
- IGNORE badges that appear inside an `InputBadge` component (those are child badges, not standalone).
|
|
9
|
+
|
|
10
|
+
## Metadata Shape (Component)
|
|
11
|
+
|
|
12
|
+
Append this component to the `components` array of the returned JSON.
|
|
13
|
+
|
|
14
|
+
## Metadata Shape (Properties)
|
|
15
|
+
|
|
16
|
+
Append these properties to the `props` object of this component.
|
|
17
|
+
|
|
18
|
+
### Properties definitions
|
|
19
|
+
|
|
20
|
+
- `label` (string)
|
|
21
|
+
The text content of the badge. Derived from the text node inside the badge pill element.
|
|
22
|
+
|
|
23
|
+
- `severity` (string | undefined)
|
|
24
|
+
The severity of the badge, inferred from the Figma `color` property:
|
|
25
|
+
- `'primary'` if `color` is "Primary" (blue, `--badge/primary`). Used for labels like "group", "nama".
|
|
26
|
+
- `'success'` if `color` is "Success" (green). Used for status like "verified".
|
|
27
|
+
- `'warning'` if `color` is "Warning" (yellow). Used for status like "unverified".
|
|
28
|
+
- `'dark'` if `color` is "Dark" (dark). Used for labels like "brand", "model type", "disposed".
|
|
29
|
+
- Omit if the color does not match any known mapping.
|
|
30
|
+
|
|
31
|
+
- `removable` (boolean | undefined)
|
|
32
|
+
Whether a close/remove icon button is present inside the badge. Maps to the Figma `propDelete` property. If `propDelete` is true or a close icon exists, set to `true`. Omit if absent.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Breadcrumb
|
|
2
|
+
type reference: ./index.d.ts
|
|
3
|
+
|
|
4
|
+
Append a `Breadcrumb` component when the figma context contains:
|
|
5
|
+
|
|
6
|
+
- A figma instance named "Breadcrumb" or similar, unique to a single page.
|
|
7
|
+
|
|
8
|
+
## Metadata Shape (Component)
|
|
9
|
+
|
|
10
|
+
Append this component to the `components` array of the returned JSON.
|
|
11
|
+
|
|
12
|
+
## Metadata Shape (Properties)
|
|
13
|
+
|
|
14
|
+
Append these properties to the `props` object of this component.
|
|
15
|
+
|
|
16
|
+
### Properties definitions
|
|
17
|
+
|
|
18
|
+
- `menus` (BreadcrumbMenu[])
|
|
19
|
+
Get each menu item and set them as follows:
|
|
20
|
+
- `name` (string)
|
|
21
|
+
The label of this item.
|
|
22
|
+
- `route` (string)
|
|
23
|
+
Must be empty.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Button
|
|
2
|
+
type reference: ./index.d.ts
|
|
3
|
+
|
|
4
|
+
Append a `Button` component when the figma context contains:
|
|
5
|
+
|
|
6
|
+
- A button named "Button" or similar.
|
|
7
|
+
- The Figma `ButtonProps` uses `type` ("Default" | "Text" | "Outline" | "Icon Default" | "Icon Outline") and `color` ("Primary" | "Success" | "Warning" | "Danger" | "Dark" | "Secondary") to define appearance.
|
|
8
|
+
- IGNORE any already extended button component like "Button Search", "Button Download", etc.
|
|
9
|
+
- IGNORE any action button that is already present in Dialog (such as "Save", "Cancel", "Submit", etc.)
|
|
10
|
+
- IGNORE any action button that is already present in Filter Container (such as "Apply", "Clear Field")
|
|
11
|
+
|
|
12
|
+
## Metadata Shape (Component)
|
|
13
|
+
|
|
14
|
+
Append this component to the `components` array of the returned JSON.
|
|
15
|
+
|
|
16
|
+
## Metadata Shape (Properties)
|
|
17
|
+
|
|
18
|
+
Append these properties to the `props` object of this component.
|
|
19
|
+
|
|
20
|
+
### Properties definitions
|
|
21
|
+
|
|
22
|
+
- `label` (string | undefined)
|
|
23
|
+
The text of the button. Derived from the `text` property in Figma. For icon-only buttons (type "Icon Default" or "Icon Outline"), omit this field.
|
|
24
|
+
|
|
25
|
+
- `icon` (WangsIcons | undefined)
|
|
26
|
+
The icon of the button. Derived from the `data-name` attribute of an icon/image node inside the button (e.g. `checkbox-blank-circle-line`, `close-line`, `search-2-line`). If no icon is present, omit this field.
|
|
27
|
+
|
|
28
|
+
- `iconPos` (string | undefined)
|
|
29
|
+
The icon position. Inferred from the Figma `leftIcon`/`rightIcon` boolean flags:
|
|
30
|
+
- `'left'` if only `leftIcon` is true.
|
|
31
|
+
- `'right'` if only `rightIcon` is true.
|
|
32
|
+
- Omit if no icon is present, or if `leftIcon` and `rightIcon` are both false.
|
|
33
|
+
|
|
34
|
+
- `severity` (string)
|
|
35
|
+
The severity of the button, inferred from the Figma `color` property:
|
|
36
|
+
- `'primary'` if `color` is "Primary" (blue, `--button/primary`).
|
|
37
|
+
- `'success'` if `color` is "Success" (green, `--button/success`).
|
|
38
|
+
- `'warning'` if `color` is "Warning" (yellow, `--button/warning`).
|
|
39
|
+
- `'danger'` if `color` is "Danger" (red, `--button/danger`).
|
|
40
|
+
- `'secondary'` if `color` is "Secondary" (gray, `--button/disable`).
|
|
41
|
+
- Omit or use `'contrast'` if `color` is "Dark" (`--button/dark`).
|
|
42
|
+
|
|
43
|
+
- `text` (boolean | undefined)
|
|
44
|
+
Whether the button has no background (text-only style). Set to `true` when Figma `type` is "Text". Omit when `type` is "Default" or "Outline".
|
|
45
|
+
|
|
46
|
+
- `outlined` (boolean | undefined)
|
|
47
|
+
Whether the button has a border but no fill. Set to `true` when Figma `type` is "Outline". Omit when `type` is "Default" or "Text".
|
|
48
|
+
|
|
49
|
+
- `size` ('small' | 'large' | undefined)
|
|
50
|
+
Inferred from the button frame dimensions:
|
|
51
|
+
- `'small'` if the button height is notably smaller (e.g. < 26px).
|
|
52
|
+
- `'large'` if the button height is notably larger (e.g. > 26px).
|
|
53
|
+
- Omit for default 26px height.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# MenuItem
|
|
2
|
+
type reference: ./index.d.ts
|
|
3
|
+
|
|
4
|
+
Append each multi action option to the `options` array inside the parent `ButtonBulkAction` props when the figma context contains:
|
|
5
|
+
|
|
6
|
+
- For each distinct multi action option detected from the "Bulk Action" or similar layer(s) adjacent to `BulkAction`.
|
|
7
|
+
|
|
8
|
+
## Metadata Shape (Properties)
|
|
9
|
+
|
|
10
|
+
### Properties definitions
|
|
11
|
+
|
|
12
|
+
`label` (string)
|
|
13
|
+
The text label rendered on the item.
|
|
14
|
+
|
|
15
|
+
`icon` (string)
|
|
16
|
+
Get the icon label rendered on the item, and search for the most similar type string from the WangsIcons type, and set it as kebab-case (just like how it is in the type).
|
|
17
|
+
|
|
18
|
+
WangsIcons reference: ../icon/Icon.vue.d.ts
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# ButtonBulkAction
|
|
2
|
+
type reference: ./index.d.ts
|
|
3
|
+
|
|
4
|
+
Append a `ButtonBulkAction` component when the figma context contains:
|
|
5
|
+
|
|
6
|
+
- A button named "ButtonBulkAction" or similar, adjacent to a `DataTable`.
|
|
7
|
+
|
|
8
|
+
## Metadata Shape (Component)
|
|
9
|
+
|
|
10
|
+
Append this component to the `components` array of the returned JSON.
|
|
11
|
+
|
|
12
|
+
## Metadata Shape (Properties)
|
|
13
|
+
|
|
14
|
+
Append these properties to the `props` object of this component.
|
|
15
|
+
|
|
16
|
+
### Properties definitions
|
|
17
|
+
|
|
18
|
+
- `options` (MenuItem[])
|
|
19
|
+
Refer to ./ButtonBulkAction-MenuItem.fm.md
|
|
20
|
+
|
|
21
|
+
- `tableName` (string)
|
|
22
|
+
Must be exactly the same table name with the adjacent `DataTable` component.
|
|
23
|
+
|
|
24
|
+
- `naming` (string)
|
|
25
|
+
The text that contains "x Data(s) Selected", or similar. In this case, "Data" is the naming.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# ButtonDownload
|
|
2
|
+
type reference: ./index.d.ts
|
|
3
|
+
|
|
4
|
+
Append a `ButtonDownload` component when the figma context contains:
|
|
5
|
+
|
|
6
|
+
- A button named "Button Download" or similar, adjacent to a `DataTable`.
|
|
7
|
+
|
|
8
|
+
## Metadata Shape (Component)
|
|
9
|
+
|
|
10
|
+
Append this component to the `components` array of the returned JSON.
|
|
11
|
+
|
|
12
|
+
## Metadata Shape (Properties)
|
|
13
|
+
|
|
14
|
+
Append these properties to the `props` object of this component.
|
|
15
|
+
|
|
16
|
+
### Properties definitions
|
|
17
|
+
|
|
18
|
+
- `tableName` (string)
|
|
19
|
+
Must be exactly the same table name with the adjacent `DataTable` component.
|
|
20
|
+
|
|
21
|
+
- `fileName` (string)
|
|
22
|
+
Must be empty.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# ButtonFilter
|
|
2
|
+
type reference: ./ButtonFilter.vue.d.ts
|
|
3
|
+
|
|
4
|
+
Append a `ButtonFilter` component when the figma context contains:
|
|
5
|
+
|
|
6
|
+
- A button named "Button Filter" or similar, adjacent to a `DataTable`.
|
|
7
|
+
|
|
8
|
+
## Metadata Shape (Component)
|
|
9
|
+
|
|
10
|
+
Append this component to the `components` array of the returned JSON.
|
|
11
|
+
|
|
12
|
+
## Metadata Shape (Properties)
|
|
13
|
+
|
|
14
|
+
Append these properties to the `props` object of this component.
|
|
15
|
+
|
|
16
|
+
### Properties definitions
|
|
17
|
+
|
|
18
|
+
- `tableName` (string)
|
|
19
|
+
Must be exactly the same table name with the adjacent `DataTable` component.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# ButtonSearch
|
|
2
|
+
type reference: ./index.d.ts
|
|
3
|
+
|
|
4
|
+
Append a `ButtonSearch` component when the figma context contains:
|
|
5
|
+
|
|
6
|
+
- A button named "Button Search" or similar, adjacent to a `DataTable`.
|
|
7
|
+
|
|
8
|
+
## Metadata Shape (Component)
|
|
9
|
+
|
|
10
|
+
Append this component to the `components` array of the returned JSON.
|
|
11
|
+
|
|
12
|
+
## Metadata Shape (Properties)
|
|
13
|
+
|
|
14
|
+
Append these properties to the `props` object of this component.
|
|
15
|
+
|
|
16
|
+
### Properties definitions
|
|
17
|
+
|
|
18
|
+
- `tableName` (string)
|
|
19
|
+
Must be exactly the same table name with the adjacent `DataTable` component.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# ButtonSearchByScan
|
|
2
|
+
type reference: ./index.d.ts
|
|
3
|
+
|
|
4
|
+
Append a `ButtonSearchByScan` component when the figma context contains:
|
|
5
|
+
|
|
6
|
+
- A button named "Button Search by Scan" or similar, with a `qr-scan-line` icon and label "Search by Scan", adjacent to a `DataTable`.
|
|
7
|
+
|
|
8
|
+
## Metadata Shape (Component)
|
|
9
|
+
|
|
10
|
+
Append this component to the `components` array of the returned JSON.
|
|
11
|
+
|
|
12
|
+
## Metadata Shape (Properties)
|
|
13
|
+
|
|
14
|
+
Append these properties to the `props` object of this component.
|
|
15
|
+
|
|
16
|
+
### Properties definitions
|
|
17
|
+
|
|
18
|
+
- `label` (string)
|
|
19
|
+
The text of the button (e.g. "Search by Scan"), if it already is "Search by Scan", omit it.
|
|
20
|
+
|
|
21
|
+
- `icon` (WangsVueIcons | undefined)
|
|
22
|
+
The icon of the button, typically `qr-scan-line`. If no icon is present, omit this field.
|
|
23
|
+
|
|
24
|
+
- `tableName` (string)
|
|
25
|
+
Must be exactly the same table name as the adjacent `DataTable` component.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# ButtonSelectTree
|
|
2
|
+
type reference: ./index.d.ts
|
|
3
|
+
|
|
4
|
+
Append a `ButtonSelectTree` component when the figma context contains:
|
|
5
|
+
|
|
6
|
+
- A figma component or instance named "Button Select Tree" or similar, consisting of a button trigger that opens a tree selection dialog, optionally paired with a label, required asterisk, and info icon. When values are selected, the button text updates to show the selection count (e.g. "3 group(s) selected").
|
|
7
|
+
|
|
8
|
+
## Metadata Shape (Component)
|
|
9
|
+
|
|
10
|
+
Append this component to the `components` array of the returned JSON.
|
|
11
|
+
|
|
12
|
+
## Metadata Shape (Properties)
|
|
13
|
+
|
|
14
|
+
Append these properties to the `props` object of this component.
|
|
15
|
+
|
|
16
|
+
### Properties definitions
|
|
17
|
+
|
|
18
|
+
- `fieldLabel` (string)
|
|
19
|
+
The text of the label displayed above the button.
|
|
20
|
+
|
|
21
|
+
- `label` (string | undefined)
|
|
22
|
+
The text of the button (e.g. "Select"). When values are selected, the button text is replaced with the selection count (e.g. "3 group(s) selected"). Omit if the button shows the default label.
|
|
23
|
+
|
|
24
|
+
- `fieldInfo` (string | undefined)
|
|
25
|
+
Whether an info icon (`information-line`) is present next to the label. Omit if absent.
|
|
26
|
+
|
|
27
|
+
- `mandatory` (boolean | undefined)
|
|
28
|
+
Whether a red asterisk `*` is present next to the label. Omit if absent.
|
|
29
|
+
|
|
30
|
+
- `invalid` (boolean | undefined)
|
|
31
|
+
Whether the component shows an error state (red caption text below the button). Omit if not in error state.
|
|
32
|
+
|
|
33
|
+
- `disabled` (boolean | undefined)
|
|
34
|
+
Whether the button shows a disabled state (gray background). Omit if not disabled.
|
|
35
|
+
|
|
36
|
+
- `selectionMode` ('single' | 'checkbox')
|
|
37
|
+
Infer from the button type:
|
|
38
|
+
- `"Default"` type (standard button with text like "Select" or "3 group(s) selected") → `'checkbox'`
|
|
39
|
+
- `"Single Selected"` type (badge with edit and close icons) → `'single'`
|
|
40
|
+
- `"Icon"` type (small icon-only button with `checkbox-blank-circle-line`) → `'checkbox'`
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Calendar
|
|
2
|
+
type reference: ./index.d.ts
|
|
3
|
+
|
|
4
|
+
Append a `Calendar` component when the figma context contains:
|
|
5
|
+
|
|
6
|
+
- A figma component or instance named "Calendar" or similar, consisting of a date input field optionally paired with a label, required asterisk, info icon, and a calendar icon.
|
|
7
|
+
|
|
8
|
+
## Metadata Shape (Component)
|
|
9
|
+
|
|
10
|
+
Append this component to the `components` array of the returned JSON.
|
|
11
|
+
|
|
12
|
+
## Metadata Shape (Properties)
|
|
13
|
+
|
|
14
|
+
Append these properties to the `props` object of this component.
|
|
15
|
+
|
|
16
|
+
### Properties definitions
|
|
17
|
+
|
|
18
|
+
- `label` (string)
|
|
19
|
+
The text of the label displayed above the date input.
|
|
20
|
+
|
|
21
|
+
- `placeholder` (string | undefined)
|
|
22
|
+
The placeholder text inside the date input (e.g. "Select date"). When a date is selected, the placeholder is replaced with the formatted date (e.g. "22/03/2022"). Omit if no placeholder text is visible.
|
|
23
|
+
|
|
24
|
+
- `mandatory` (boolean | undefined)
|
|
25
|
+
Whether a red asterisk `*` is present next to the label, indicating the field is required. Omit if absent.
|
|
26
|
+
|
|
27
|
+
- `fieldInfo` (string | undefined)
|
|
28
|
+
Whether an info icon (`information-line`) is present next to the label. Omit if absent.
|
|
29
|
+
|
|
30
|
+
- `invalid` (boolean | undefined)
|
|
31
|
+
Whether the date input shows an error state (red border, red caption text). Omit if the field is not in error state.
|
|
32
|
+
|
|
33
|
+
- `disabled` (boolean | undefined)
|
|
34
|
+
Whether the date input shows a disabled state (gray background, gray text). Omit if the field is not disabled.
|
package/changelogpage/index.d.ts
CHANGED
package/components.fm.md
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Supported Components
|
|
2
|
+
|
|
3
|
+
This document lists every wangsvue component the parser can emit. When the design context contains a UI element matching one of the entries below, produce the corresponding metadata block. If a node does NOT match any entry in this list, SKIP it silently — do NOT emit unrecognised components.
|
|
4
|
+
|
|
5
|
+
## Scope
|
|
6
|
+
|
|
7
|
+
- When the design context contains **multiple page-level frames** (e.g. "fixed-asset/assets", "fixed-asset/borrow", "fixed-asset/missing/active"), process **ALL of them**. Each frame that contains a recognised component yields its own entry in the output.
|
|
8
|
+
- Nodes that clearly map to **Card, Sidebar, or Navbar** are **skipped** (do not emit metadata for them), but their **child nodes are still processed** — a `DataTable` nested inside a Card frame is still emitted.
|
|
9
|
+
|
|
10
|
+
## Component list
|
|
11
|
+
Each of this component contains {component}.fm.md in their respective directory that will guide you how to parse them.
|
|
12
|
+
|
|
13
|
+
Inside these *.fm.md file, they will give definition type reference for each component. ONLY parse component properties that is strictly defined inside the *.fm.md file, DON'T parse component properties that is listed in the *.d.ts, only use it for a type reference.
|
|
14
|
+
|
|
15
|
+
1. DataTable
|
|
16
|
+
2. ButtonSearch
|
|
17
|
+
3. ButtonFilter
|
|
18
|
+
4. ButtonDownload
|
|
19
|
+
5. FilterContainer
|
|
20
|
+
6. Breadcrumb
|
|
21
|
+
7. DialogForm
|
|
22
|
+
8. InputText
|
|
23
|
+
9. InputNumber
|
|
24
|
+
10. TextArea
|
|
25
|
+
11. Dropdown
|
|
26
|
+
12. MultiSelect
|
|
27
|
+
13. Calendar
|
|
28
|
+
14. InputPhoneNumber
|
|
29
|
+
15. InputBadge
|
|
30
|
+
16. InputRangeNumber
|
|
31
|
+
17. FileUpload
|
|
32
|
+
18. ButtonSelectTree
|
|
33
|
+
19. ImageCompressor
|
|
34
|
+
20. InputPassword
|
|
35
|
+
21. ButtonSearchByScan
|
|
36
|
+
22. DialogSelectTree
|
|
37
|
+
23. Button
|
|
38
|
+
24. Badge
|
|
39
|
+
|
|
40
|
+
## How to identify a component from Figma nodes
|
|
41
|
+
|
|
42
|
+
- Use the node `name`, `type`, and child structure from the design context to decide which wangsvue component it represents.
|
|
43
|
+
- If a node clearly maps to Card, Sidebar, or Navbar -> SKIP the node itself but **continue processing its children** (do not discard content nested inside it).
|
|
44
|
+
- If none of the heuristics match -> SKIP the node entirely. Do NOT invent new component types.
|
|
45
|
+
|
|
46
|
+
## Multi-step context fetching
|
|
47
|
+
|
|
48
|
+
1. **Page structure** — Call `figma_get_design_context` on each page-level frame (e.g. `fixed-asset/borrow`). The returned code reveals the table structure, column header text, and whether a sort icon or ellipsis action column is present.
|
|
49
|
+
2. **Column visibility** — For each table, locate its associated `Column Visibility` frame (positioned near the filter area in the canvas, typically at `x~1197.5` with a y near the page's filter container). Call `figma_get_design_context` on that frame to determine `fixed` and `checkedByDefault` per column. Refer to @docs/figma-parser/datatable-tablecolumn.md#determining-fixed-and-checkedbydefault-from-column-visibility-panels.
|
|
50
|
+
3. **Table Toolbars (ButtonSearch)** — The top-level design context may expose a `Table Toolbars` instance as a collapsed component with no visible children. To determine whether a `Button Search` exists, fetch `figma_get_design_context` on that instance directly. The expanded code will reveal child elements with `data-name="Button Search"` containing a `search-2-line` icon. If present, emit a `ButtonSearch` component linked to the adjacent DataTable's `tableName`.
|
|
51
|
+
|
|
52
|
+
## Output specification
|
|
53
|
+
|
|
54
|
+
The parser MUST return a single JSON object. Refer to the typescript specification at ./wangsvue-metadata.ts
|
|
55
|
+
|
|
56
|
+
Use that file as the authoritative type reference when implementing the parser output.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# MenuItem
|
|
2
|
+
type reference: ./index.d.ts
|
|
3
|
+
|
|
4
|
+
Append each single action option to the `options` array inside the parent `DataTable` props when the figma context contains:
|
|
5
|
+
|
|
6
|
+
- For each distinct single action option detected from the "Single Action" or similar layer(s) adjacent to `DataTable`.
|
|
7
|
+
- IGNORE any option that is "No Option Available" or similar.
|
|
8
|
+
|
|
9
|
+
## Metadata Shape (Properties)
|
|
10
|
+
|
|
11
|
+
### Properties definitions
|
|
12
|
+
|
|
13
|
+
`label` (string)
|
|
14
|
+
The text label rendered on the item.
|
|
15
|
+
|
|
16
|
+
`icon` (string)
|
|
17
|
+
Get the icon label rendered on the item, and search for the most similar type string from the WangsIcons type, and set it as kebab-case (just like how it is in the type).
|
|
18
|
+
|
|
19
|
+
WangsIcons reference: ../icon/Icon.vue.d.ts
|
|
20
|
+
|
|
21
|
+
`command` ((event: MenuItemCommandEvent) => void)
|
|
22
|
+
The action that this menu item triggers when clicked. Must always be set to a no-op function: `() => {}`. But if you can use it for showing dialog, you may set it accordingly.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# TableColumn
|
|
2
|
+
type reference: ./index.d.ts
|
|
3
|
+
|
|
4
|
+
Append each column to the `columns` array inside the parent `DataTable` props when the figma context contains:
|
|
5
|
+
|
|
6
|
+
- For each distinct column detected in the `DataTable` header.
|
|
7
|
+
|
|
8
|
+
## Metadata Shape (Properties)
|
|
9
|
+
|
|
10
|
+
### Properties definitions
|
|
11
|
+
|
|
12
|
+
`header` (string)
|
|
13
|
+
The column header text (TH).
|
|
14
|
+
|
|
15
|
+
`field` (string)
|
|
16
|
+
The column header text, but converted into snake_case.
|
|
17
|
+
|
|
18
|
+
`sortable` (boolean)
|
|
19
|
+
True if the column header have the sort icon, false if not. Image column is always false.
|
|
20
|
+
|
|
21
|
+
`visible` (boolean)
|
|
22
|
+
Must be true.
|
|
23
|
+
|
|
24
|
+
`reorderable` (boolean)
|
|
25
|
+
Must be true.
|
|
26
|
+
|
|
27
|
+
`dragable` (boolean)
|
|
28
|
+
Must be true.
|
|
29
|
+
|
|
30
|
+
`fixed` (boolean)
|
|
31
|
+
True if the checkbox for the column visibility of this column is disabled, false if not.
|
|
32
|
+
|
|
33
|
+
`checkedByDefault` (boolean)
|
|
34
|
+
True if the checkbox for the column visibility of this column is checked, false if not.
|
|
35
|
+
|
|
36
|
+
## GUIDANCE for parsing from Figma
|
|
37
|
+
|
|
38
|
+
- Exclude the first column if it contains checkbox. And exclude the last column if it contains ellipsis.
|
|
39
|
+
- Each column in the Figma table frame maps to ONE TableColumn entry.
|
|
40
|
+
|
|
41
|
+
### Determining `fixed` and `checkedByDefault` from Column Visibility panels
|
|
42
|
+
|
|
43
|
+
Locate the `Column Visibility` frame near the table's filter area (typically positioned at `x=1197.5`, y-aligned with the filter container). Call `figma_get_design_context` on that frame to get its expanded code output. Inside it, inspect each `Column-visibility` child:
|
|
44
|
+
|
|
45
|
+
- The `Column-visibility` instance contains a label `<p>` whose text matches the column header — use this to pair visibility state to the correct column.
|
|
46
|
+
- A "Setup Column" entry exists at the top; skip it.
|
|
47
|
+
- **`fixed`**: determined by the checkbox `<div>` background color token:
|
|
48
|
+
- `bg: option-disable-bg (#b5b3c7)` → greyed out, toggle is disabled → `fixed: true`
|
|
49
|
+
- `bg: button/primary (#0063f7)` → blue, toggle is interactive → `fixed: false`
|
|
50
|
+
- **`checkedByDefault`**: if the `check-line` icon (`<img>` with `data-name="check-line"`) is present inside the checkbox, the column is checked → `checkedByDefault: true`. If absent, the column is unchecked → `checkedByDefault: false`.
|
|
51
|
+
|
|
52
|
+
If the `Column Visibility` frame cannot be fetched (node invalid or not exported), fall back to false.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# DataTable
|
|
2
|
+
type reference: ./index.d.ts
|
|
3
|
+
|
|
4
|
+
Append a `DataTable` component when the figma context contains:
|
|
5
|
+
|
|
6
|
+
- A table named "Table Wrapper" or similar, inside the main frame.
|
|
7
|
+
|
|
8
|
+
## Metadata Shape (Component)
|
|
9
|
+
|
|
10
|
+
Append this component to the `components` array of the returned JSON.
|
|
11
|
+
|
|
12
|
+
## Metadata Shape (Properties)
|
|
13
|
+
|
|
14
|
+
Append these properties to the `props` object of this component.
|
|
15
|
+
|
|
16
|
+
### Properties definitions
|
|
17
|
+
|
|
18
|
+
- `tableName` (string)
|
|
19
|
+
Unique identifier for this table. Format: `{module}-{scope}-table` (e.g. borrow-available-list-table).
|
|
20
|
+
- {module} is inferred from the Figma file name. Normalize to lowercase, strip special characters, use the primary domain keyword (e.g. for a file named "-v2--Borrow" the module is `borrow`).
|
|
21
|
+
- {scope} is inferred from what the table represents within that module (e.g. available-list, prelist, active-list, history-list).
|
|
22
|
+
|
|
23
|
+
- `useOption` (boolean)
|
|
24
|
+
True if the rightmost column of the table row (NOT row header) contains an ellipsis icon (triple-dot or vertical-dot) indicating row actions / a context menu. False if there is no such column.
|
|
25
|
+
|
|
26
|
+
- `options` (MenuItem[])
|
|
27
|
+
Refer to ./DataTable-MenuItem.fm.md
|
|
28
|
+
|
|
29
|
+
- `columns` (TableColumn[])
|
|
30
|
+
Refer to ./DataTable-TableColumn.fm.md
|
|
31
|
+
|
|
32
|
+
- `usePaginator` (boolean)
|
|
33
|
+
True if there are Pagination adjacent to the DataTable, false if not.
|
|
34
|
+
|
|
35
|
+
- `lazy` (boolean)
|
|
36
|
+
True if `usePaginator` is true, otherwise false.
|
|
37
|
+
|
|
38
|
+
`selectionType` ('none', 'checkbox')
|
|
39
|
+
- none if no checkbox element/component on the leftmost column of the table.
|
|
40
|
+
- checkbox if checkbox element/component on the leftmost column of the table.
|
package/datatable/index.d.ts
CHANGED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# DialogConfirm
|
|
2
|
+
type reference: ./index.d.ts
|
|
3
|
+
|
|
4
|
+
Append a `DialogConfirm` component when the figma context contains:
|
|
5
|
+
|
|
6
|
+
- A figma component or instance named "Dialog Confirm" or similar.
|
|
7
|
+
|
|
8
|
+
## Metadata Shape (Component)
|
|
9
|
+
|
|
10
|
+
Append this component to the `components` array of the returned JSON.
|
|
11
|
+
|
|
12
|
+
## Metadata Shape (Properties)
|
|
13
|
+
|
|
14
|
+
Append these properties to the `props` object of this component.
|
|
15
|
+
|
|
16
|
+
### Properties definitions
|
|
17
|
+
|
|
18
|
+
- `header` (string)
|
|
19
|
+
The header of the dialog.
|
|
20
|
+
|
|
21
|
+
- `severity` (string)
|
|
22
|
+
- success if the color style / theme of the dialog is green, it tend to be a positive.
|
|
23
|
+
- danger if the color style / theme of the dialog is red, it tend to be a negative.
|
|
24
|
+
|
|
25
|
+
- `actionable` (boolean)
|
|
26
|
+
Whether the dialog is actionable, if there are buttons like "Save" or "Cancel", then its true. Otherwise false.
|
|
27
|
+
|
|
28
|
+
- `confirmLabel` (string)
|
|
29
|
+
The text of the "Confirmation" button, most commonly the rightmost one.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# DialogForm
|
|
2
|
+
type reference: ./index.d.ts
|
|
3
|
+
|
|
4
|
+
Append a `DialogForm` component when the figma context contains:
|
|
5
|
+
|
|
6
|
+
- A figma component or instance named "Dialog Form" or similar, consisting of a header (title + close button), a content slot area, and a footer with buttons.
|
|
7
|
+
|
|
8
|
+
## Metadata Shape (Component)
|
|
9
|
+
|
|
10
|
+
Append this component to the `components` array of the returned JSON.
|
|
11
|
+
|
|
12
|
+
## Metadata Shape (Properties)
|
|
13
|
+
|
|
14
|
+
Append these properties to the `props` object of this component.
|
|
15
|
+
|
|
16
|
+
### Properties definitions
|
|
17
|
+
|
|
18
|
+
- `header` (string)
|
|
19
|
+
The text inside the dialog title.
|
|
20
|
+
|
|
21
|
+
- `closable` (boolean)
|
|
22
|
+
Whether a close (X) icon button is present in the header. Omit if absent.
|
|
23
|
+
|
|
24
|
+
- `showStayCheckbox` (boolean)
|
|
25
|
+
Whether a "Stay on this form after submitting" checkbox exists in the footer.
|
|
26
|
+
|
|
27
|
+
- `stayCheckboxLabel` (string | undefined)
|
|
28
|
+
The text label of the stay checkbox. Omit if `showStayCheckbox` is false.
|
|
29
|
+
|
|
30
|
+
- `buttonsTemplate` ('clear' | 'submit' | 'cancel')[]
|
|
31
|
+
- Include `'clear'` if a "Clear Field" or similar text button is present.
|
|
32
|
+
- Include `'submit'` if a primary action button (e.g. "Submit", "Save") is present.
|
|
33
|
+
- Include `'cancel'` if a cancel/secondary dismiss button is present.
|
|
34
|
+
This is REQUIRED.
|
|
35
|
+
|
|
36
|
+
- `submitBtnLabel` (string | undefined)
|
|
37
|
+
The text of the submit button. Omit if `buttonsTemplate` does not contain `'submit'`.
|
|
38
|
+
|
|
39
|
+
- `clearBtnLabel` (string | undefined)
|
|
40
|
+
The text of the clear field button. Omit if `buttonsTemplate` does not contain `'clear'`.
|
|
41
|
+
|
|
42
|
+
- `severity` ('success' | 'danger' | 'primary' | undefined)
|
|
43
|
+
- `'success'` if the submit button or dialog theme is green.
|
|
44
|
+
- `'danger'` if the submit button or dialog theme is red.
|
|
45
|
+
- `'primary'` if the submit button or dialog theme is blue.
|
|
46
|
+
- Omit if ambiguous or no submit button is present.
|
|
47
|
+
|
|
48
|
+
- `width` ('small' | 'medium' | 'large' | 'semi-xlarge' | 'xlarge')
|
|
49
|
+
Infer from the dialog frame width:
|
|
50
|
+
- `400px` → `'small'`
|
|
51
|
+
- `500px` → `'medium'`
|
|
52
|
+
- `572px` → `'large'`
|
|
53
|
+
- `600px` → `'semi-xlarge'`
|
|
54
|
+
- `800px` → `'xlarge'`
|
|
55
|
+
|
|
56
|
+
## RULES - CRITICAL
|
|
57
|
+
1. **ALWAYS set `buttonsTemplate`** The Dialog Form most crucial property is `buttonsTemplate` it is what defines the DialogForm and distinguish it from a normal, regular, Dialog.
|