@ramathibodi/nuxt-commons 0.1.74 → 4.0.0

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 (243) hide show
  1. package/README.md +9 -2
  2. package/dist/module.json +4 -4
  3. package/dist/module.mjs +4 -4
  4. package/dist/runtime/bridges/authentication.d.ts +21 -0
  5. package/dist/runtime/bridges/authentication.js +20 -0
  6. package/dist/runtime/bridges/graphql.d.ts +17 -0
  7. package/dist/runtime/bridges/graphql.js +45 -0
  8. package/dist/runtime/components/Alert.d.vue.ts +3 -0
  9. package/dist/runtime/components/Alert.vue +17 -26
  10. package/dist/runtime/components/Alert.vue.d.ts +3 -0
  11. package/dist/runtime/components/BarcodeReader.d.vue.ts +9 -0
  12. package/dist/runtime/components/BarcodeReader.vue +56 -81
  13. package/dist/runtime/components/BarcodeReader.vue.d.ts +9 -0
  14. package/dist/runtime/components/ExportCSV.d.vue.ts +55 -0
  15. package/dist/runtime/components/ExportCSV.vue +39 -76
  16. package/dist/runtime/components/ExportCSV.vue.d.ts +55 -0
  17. package/dist/runtime/components/FileBtn.d.vue.ts +53 -0
  18. package/dist/runtime/components/FileBtn.vue +23 -50
  19. package/dist/runtime/components/FileBtn.vue.d.ts +53 -0
  20. package/dist/runtime/components/ImportCSV.d.vue.ts +52 -0
  21. package/dist/runtime/components/ImportCSV.vue +60 -111
  22. package/dist/runtime/components/ImportCSV.vue.d.ts +52 -0
  23. package/dist/runtime/components/MrzReader.d.vue.ts +19 -0
  24. package/dist/runtime/components/MrzReader.vue +69 -109
  25. package/dist/runtime/components/MrzReader.vue.d.ts +19 -0
  26. package/dist/runtime/components/SplitterPanel.d.vue.ts +15 -0
  27. package/dist/runtime/components/SplitterPanel.vue +18 -35
  28. package/dist/runtime/components/SplitterPanel.vue.d.ts +15 -0
  29. package/dist/runtime/components/TabsGroup.d.vue.ts +19 -0
  30. package/dist/runtime/components/TabsGroup.vue +8 -20
  31. package/dist/runtime/components/TabsGroup.vue.d.ts +19 -0
  32. package/dist/runtime/components/TextBarcode.d.vue.ts +12 -0
  33. package/dist/runtime/components/TextBarcode.vue +22 -45
  34. package/dist/runtime/components/TextBarcode.vue.d.ts +12 -0
  35. package/dist/runtime/components/device/IdCardButton.d.vue.ts +57 -0
  36. package/dist/runtime/components/device/IdCardButton.vue +30 -67
  37. package/dist/runtime/components/device/IdCardButton.vue.d.ts +57 -0
  38. package/dist/runtime/components/device/IdCardWebSocket.d.vue.ts +55 -0
  39. package/dist/runtime/components/device/IdCardWebSocket.vue +104 -165
  40. package/dist/runtime/components/device/IdCardWebSocket.vue.d.ts +55 -0
  41. package/dist/runtime/components/device/Scanner.d.vue.ts +66 -0
  42. package/dist/runtime/components/device/Scanner.vue +97 -178
  43. package/dist/runtime/components/device/Scanner.vue.d.ts +66 -0
  44. package/dist/runtime/components/dialog/Confirm.d.vue.ts +37 -0
  45. package/dist/runtime/components/dialog/Confirm.vue +30 -59
  46. package/dist/runtime/components/dialog/Confirm.vue.d.ts +37 -0
  47. package/dist/runtime/components/dialog/Host.d.vue.ts +9 -0
  48. package/dist/runtime/components/dialog/Host.vue +34 -57
  49. package/dist/runtime/components/dialog/Host.vue.d.ts +9 -0
  50. package/dist/runtime/components/dialog/Index.d.vue.ts +24 -0
  51. package/dist/runtime/components/dialog/Index.vue +20 -40
  52. package/dist/runtime/components/dialog/Index.vue.d.ts +24 -0
  53. package/dist/runtime/components/dialog/Loading.d.vue.ts +21 -0
  54. package/dist/runtime/components/dialog/Loading.vue +12 -29
  55. package/dist/runtime/components/dialog/Loading.vue.d.ts +21 -0
  56. package/dist/runtime/components/dialog/default/Confirm.d.vue.ts +40 -0
  57. package/dist/runtime/components/dialog/default/Confirm.vue +29 -62
  58. package/dist/runtime/components/dialog/default/Confirm.vue.d.ts +40 -0
  59. package/dist/runtime/components/dialog/default/Loading.d.vue.ts +23 -0
  60. package/dist/runtime/components/dialog/default/Loading.vue +12 -29
  61. package/dist/runtime/components/dialog/default/Loading.vue.d.ts +23 -0
  62. package/dist/runtime/components/dialog/default/Notify.d.vue.ts +23 -0
  63. package/dist/runtime/components/dialog/default/Notify.vue +19 -48
  64. package/dist/runtime/components/dialog/default/Notify.vue.d.ts +23 -0
  65. package/dist/runtime/components/dialog/default/Printing.d.vue.ts +21 -0
  66. package/dist/runtime/components/dialog/default/Printing.vue +13 -29
  67. package/dist/runtime/components/dialog/default/Printing.vue.d.ts +21 -0
  68. package/dist/runtime/components/dialog/default/VerifyUser.d.vue.ts +29 -0
  69. package/dist/runtime/components/dialog/default/VerifyUser.vue +44 -82
  70. package/dist/runtime/components/dialog/default/VerifyUser.vue.d.ts +29 -0
  71. package/dist/runtime/components/document/Form.d.vue.ts +9 -0
  72. package/dist/runtime/components/document/Form.vue +27 -42
  73. package/dist/runtime/components/document/Form.vue.d.ts +9 -0
  74. package/dist/runtime/components/document/TemplateBuilder.d.vue.ts +24 -0
  75. package/dist/runtime/components/document/TemplateBuilder.vue +154 -194
  76. package/dist/runtime/components/document/TemplateBuilder.vue.d.ts +24 -0
  77. package/dist/runtime/components/form/ActionPad.d.vue.ts +114 -0
  78. package/dist/runtime/components/form/ActionPad.vue +48 -85
  79. package/dist/runtime/components/form/ActionPad.vue.d.ts +114 -0
  80. package/dist/runtime/components/form/Birthdate.d.vue.ts +38 -0
  81. package/dist/runtime/components/form/Birthdate.vue +44 -76
  82. package/dist/runtime/components/form/Birthdate.vue.d.ts +38 -0
  83. package/dist/runtime/components/form/CheckboxGroup.d.vue.ts +41 -0
  84. package/dist/runtime/components/form/CheckboxGroup.vue +34 -64
  85. package/dist/runtime/components/form/CheckboxGroup.vue.d.ts +41 -0
  86. package/dist/runtime/components/form/CodeEditor.d.vue.ts +25 -0
  87. package/dist/runtime/components/form/CodeEditor.vue +18 -36
  88. package/dist/runtime/components/form/CodeEditor.vue.d.ts +25 -0
  89. package/dist/runtime/components/form/Date.d.vue.ts +86 -0
  90. package/dist/runtime/components/form/Date.vue +109 -162
  91. package/dist/runtime/components/form/Date.vue.d.ts +86 -0
  92. package/dist/runtime/components/form/DateTime.d.vue.ts +36 -0
  93. package/dist/runtime/components/form/DateTime.vue +94 -143
  94. package/dist/runtime/components/form/DateTime.vue.d.ts +36 -0
  95. package/dist/runtime/components/form/Dialog.d.vue.ts +69 -0
  96. package/dist/runtime/components/form/Dialog.vue +60 -96
  97. package/dist/runtime/components/form/Dialog.vue.d.ts +69 -0
  98. package/dist/runtime/components/form/EditPad.d.vue.ts +113 -0
  99. package/dist/runtime/components/form/EditPad.vue +49 -85
  100. package/dist/runtime/components/form/EditPad.vue.d.ts +113 -0
  101. package/dist/runtime/components/form/File.d.vue.ts +65 -0
  102. package/dist/runtime/components/form/File.vue +112 -186
  103. package/dist/runtime/components/form/File.vue.d.ts +65 -0
  104. package/dist/runtime/components/form/Hidden.d.vue.ts +12 -0
  105. package/dist/runtime/components/form/Hidden.vue +17 -34
  106. package/dist/runtime/components/form/Hidden.vue.d.ts +12 -0
  107. package/dist/runtime/components/form/Iterator.d.vue.ts +279 -0
  108. package/dist/runtime/components/form/Iterator.vue +162 -252
  109. package/dist/runtime/components/form/Iterator.vue.d.ts +279 -0
  110. package/dist/runtime/components/form/Login.d.vue.ts +32 -0
  111. package/dist/runtime/components/form/Login.vue +23 -55
  112. package/dist/runtime/components/form/Login.vue.d.ts +32 -0
  113. package/dist/runtime/components/form/Pad.d.vue.ts +674 -0
  114. package/dist/runtime/components/form/Pad.vue +166 -265
  115. package/dist/runtime/components/form/Pad.vue.d.ts +674 -0
  116. package/dist/runtime/components/form/SignPad.d.vue.ts +62 -0
  117. package/dist/runtime/components/form/SignPad.vue +80 -126
  118. package/dist/runtime/components/form/SignPad.vue.d.ts +62 -0
  119. package/dist/runtime/components/form/System.d.vue.ts +34 -0
  120. package/dist/runtime/components/form/System.vue +18 -32
  121. package/dist/runtime/components/form/System.vue.d.ts +34 -0
  122. package/dist/runtime/components/form/Table.d.vue.ts +221 -0
  123. package/dist/runtime/components/form/Table.vue +123 -182
  124. package/dist/runtime/components/form/Table.vue.d.ts +221 -0
  125. package/dist/runtime/components/form/TableData.d.vue.ts +102 -0
  126. package/dist/runtime/components/form/TableData.vue +109 -139
  127. package/dist/runtime/components/form/TableData.vue.d.ts +102 -0
  128. package/dist/runtime/components/form/Time.d.vue.ts +49 -0
  129. package/dist/runtime/components/form/Time.vue +64 -99
  130. package/dist/runtime/components/form/Time.vue.d.ts +49 -0
  131. package/dist/runtime/components/form/images/Capture.d.vue.ts +96 -0
  132. package/dist/runtime/components/form/images/Capture.vue +104 -147
  133. package/dist/runtime/components/form/images/Capture.vue.d.ts +96 -0
  134. package/dist/runtime/components/form/images/Edit.d.vue.ts +29 -0
  135. package/dist/runtime/components/form/images/Edit.vue +57 -81
  136. package/dist/runtime/components/form/images/Edit.vue.d.ts +29 -0
  137. package/dist/runtime/components/form/images/Field.d.vue.ts +27 -0
  138. package/dist/runtime/components/form/images/Field.vue +136 -205
  139. package/dist/runtime/components/form/images/Field.vue.d.ts +27 -0
  140. package/dist/runtime/components/form/images/Pad.d.vue.ts +13 -0
  141. package/dist/runtime/components/form/images/Pad.vue +23 -40
  142. package/dist/runtime/components/form/images/Pad.vue.d.ts +13 -0
  143. package/dist/runtime/components/label/Date.d.vue.ts +13 -0
  144. package/dist/runtime/components/label/Date.vue +13 -29
  145. package/dist/runtime/components/label/Date.vue.d.ts +13 -0
  146. package/dist/runtime/components/label/DateAgo.d.vue.ts +20 -0
  147. package/dist/runtime/components/label/DateAgo.vue +43 -75
  148. package/dist/runtime/components/label/DateAgo.vue.d.ts +20 -0
  149. package/dist/runtime/components/label/DateCount.d.vue.ts +22 -0
  150. package/dist/runtime/components/label/DateCount.vue +58 -105
  151. package/dist/runtime/components/label/DateCount.vue.d.ts +22 -0
  152. package/dist/runtime/components/label/Field.d.vue.ts +38 -0
  153. package/dist/runtime/components/label/Field.vue +18 -40
  154. package/dist/runtime/components/label/Field.vue.d.ts +38 -0
  155. package/dist/runtime/components/label/FormatMoney.d.vue.ts +12 -0
  156. package/dist/runtime/components/label/FormatMoney.vue +12 -28
  157. package/dist/runtime/components/label/FormatMoney.vue.d.ts +12 -0
  158. package/dist/runtime/components/label/Mask.d.vue.ts +10 -0
  159. package/dist/runtime/components/label/Mask.vue +21 -38
  160. package/dist/runtime/components/label/Mask.vue.d.ts +10 -0
  161. package/dist/runtime/components/label/Object.d.vue.ts +8 -0
  162. package/dist/runtime/components/label/Object.vue +10 -20
  163. package/dist/runtime/components/label/Object.vue.d.ts +8 -0
  164. package/dist/runtime/components/master/Autocomplete.d.vue.ts +70 -0
  165. package/dist/runtime/components/master/Autocomplete.vue +25 -34
  166. package/dist/runtime/components/master/Autocomplete.vue.d.ts +70 -0
  167. package/dist/runtime/components/master/Combobox.d.vue.ts +70 -0
  168. package/dist/runtime/components/master/Combobox.vue +26 -35
  169. package/dist/runtime/components/master/Combobox.vue.d.ts +70 -0
  170. package/dist/runtime/components/master/RadioGroup.d.vue.ts +51 -0
  171. package/dist/runtime/components/master/RadioGroup.vue +44 -59
  172. package/dist/runtime/components/master/RadioGroup.vue.d.ts +51 -0
  173. package/dist/runtime/components/master/Select.d.vue.ts +68 -0
  174. package/dist/runtime/components/master/Select.vue +25 -34
  175. package/dist/runtime/components/master/Select.vue.d.ts +68 -0
  176. package/dist/runtime/components/master/label.d.vue.ts +24 -0
  177. package/dist/runtime/components/master/label.vue +22 -42
  178. package/dist/runtime/components/master/label.vue.d.ts +24 -0
  179. package/dist/runtime/components/model/Autocomplete.d.vue.ts +82 -0
  180. package/dist/runtime/components/model/Autocomplete.vue +50 -49
  181. package/dist/runtime/components/model/Autocomplete.vue.d.ts +82 -0
  182. package/dist/runtime/components/model/Combobox.d.vue.ts +82 -0
  183. package/dist/runtime/components/model/Combobox.vue +51 -49
  184. package/dist/runtime/components/model/Combobox.vue.d.ts +82 -0
  185. package/dist/runtime/components/model/Pad.d.vue.ts +72 -0
  186. package/dist/runtime/components/model/Pad.vue +50 -65
  187. package/dist/runtime/components/model/Pad.vue.d.ts +72 -0
  188. package/dist/runtime/components/model/Select.d.vue.ts +72 -0
  189. package/dist/runtime/components/model/Select.vue +42 -44
  190. package/dist/runtime/components/model/Select.vue.d.ts +72 -0
  191. package/dist/runtime/components/model/Table.d.vue.ts +272 -0
  192. package/dist/runtime/components/model/Table.vue +121 -145
  193. package/dist/runtime/components/model/Table.vue.d.ts +272 -0
  194. package/dist/runtime/components/model/iterator.d.vue.ts +321 -0
  195. package/dist/runtime/components/model/iterator.vue +148 -183
  196. package/dist/runtime/components/model/iterator.vue.d.ts +321 -0
  197. package/dist/runtime/components/model/label.d.vue.ts +26 -0
  198. package/dist/runtime/components/model/label.vue +25 -43
  199. package/dist/runtime/components/model/label.vue.d.ts +26 -0
  200. package/dist/runtime/components/pdf/Print.d.vue.ts +17 -0
  201. package/dist/runtime/components/pdf/Print.vue +27 -50
  202. package/dist/runtime/components/pdf/Print.vue.d.ts +17 -0
  203. package/dist/runtime/components/pdf/View.d.vue.ts +52 -0
  204. package/dist/runtime/components/pdf/View.vue +58 -95
  205. package/dist/runtime/components/pdf/View.vue.d.ts +52 -0
  206. package/dist/runtime/composables/api.js +4 -2
  207. package/dist/runtime/composables/assetFile.js +4 -2
  208. package/dist/runtime/composables/dialog.d.ts +1 -1
  209. package/dist/runtime/composables/document/template.js +3 -3
  210. package/dist/runtime/composables/document/templateFormTable.js +1 -0
  211. package/dist/runtime/composables/graphql.d.ts +2 -2
  212. package/dist/runtime/composables/graphql.js +5 -5
  213. package/dist/runtime/composables/graphqlModel.d.ts +6 -6
  214. package/dist/runtime/composables/graphqlModelItem.d.ts +4 -4
  215. package/dist/runtime/composables/graphqlModelOperation.d.ts +6 -6
  216. package/dist/runtime/composables/graphqlModelOperation.js +2 -1
  217. package/dist/runtime/composables/graphqlOperation.js +5 -1
  218. package/dist/runtime/composables/hostAgentWs.d.ts +1 -1
  219. package/dist/runtime/composables/lookupListMaster.js +3 -3
  220. package/dist/runtime/composables/menu.js +2 -2
  221. package/dist/runtime/composables/userPermission.d.ts +1 -1
  222. package/dist/runtime/composables/utils/fuzzy.d.ts +2 -1
  223. package/dist/runtime/labs/Calendar.d.vue.ts +35 -0
  224. package/dist/runtime/labs/Calendar.vue +47 -75
  225. package/dist/runtime/labs/Calendar.vue.d.ts +35 -0
  226. package/dist/runtime/labs/form/EditMobile.d.vue.ts +12 -0
  227. package/dist/runtime/labs/form/EditMobile.vue +19 -36
  228. package/dist/runtime/labs/form/EditMobile.vue.d.ts +12 -0
  229. package/dist/runtime/labs/form/TextFieldMask.d.vue.ts +21 -0
  230. package/dist/runtime/labs/form/TextFieldMask.vue +19 -25
  231. package/dist/runtime/labs/form/TextFieldMask.vue.d.ts +21 -0
  232. package/dist/runtime/plugins/dialogManager.js +2 -2
  233. package/dist/runtime/plugins/permission.js +3 -3
  234. package/dist/runtime/types/bridge.d.ts +14 -0
  235. package/dist/runtime/utils/datetime.js +1 -1
  236. package/dist/types.d.mts +2 -6
  237. package/package.json +71 -58
  238. package/scripts/ci-release.mjs +125 -0
  239. package/scripts/release-version.mjs +68 -0
  240. package/scripts/release.mjs +49 -0
  241. package/dist/module.cjs +0 -5
  242. package/dist/module.d.ts +0 -8
  243. package/dist/types.d.ts +0 -7
@@ -0,0 +1,221 @@
1
+ /**
2
+ * FormTable is a schema-driven form field component that binds model data, renders field UI, and emits normalized updates.
3
+ * This doc block is consumed by vue-docgen for generated API documentation.
4
+ */
5
+ import { VDataTable } from 'vuetify/components/VDataTable';
6
+ import type { FormDialogCallback } from '../../types/formDialog.js';
7
+ import { type PersistSlimProps } from '../../composables/localStorageModel.js';
8
+ interface Props extends /* @vue-ignore */ InstanceType<typeof VDataTable['$props']> {
9
+ title: string;
10
+ noDataText?: string;
11
+ modelValue?: Record<string, any>[];
12
+ modelKey?: string;
13
+ dialogWidth?: string | number;
14
+ dialogMaxWidth?: string | number;
15
+ dialogHeight?: string | number;
16
+ dialogMaxHeight?: string | number;
17
+ dialogFullscreen?: boolean;
18
+ initialData?: Record<string, any>;
19
+ toolbarColor?: string;
20
+ importable?: boolean;
21
+ exportable?: boolean;
22
+ insertable?: boolean;
23
+ searchable?: boolean;
24
+ inputPad?: boolean;
25
+ inputPadOnly?: boolean;
26
+ saveAndStay?: boolean;
27
+ stringFields?: Array<string>;
28
+ }
29
+ /**
30
+ * Public props accepted by FormTable.
31
+ * Document each prop field with intent, defaults, and side effects for clear generated docs.
32
+ */
33
+ type __VLS_Props = Props & PersistSlimProps;
34
+ declare function setSearch(keyword: string): void;
35
+ declare function createItem(item: Record<string, any>, callback?: FormDialogCallback): void;
36
+ declare function updateItem(newItem: Record<string, any>, callback?: FormDialogCallback): void;
37
+ declare function moveUpItem(currentItem: Record<string, any>, callback?: FormDialogCallback): void;
38
+ declare function moveDownItem(currentItem: Record<string, any>, callback?: FormDialogCallback): void;
39
+ declare function moveToItem(currentItem: Record<string, any>, callback?: FormDialogCallback): void;
40
+ declare function deleteItem(deleteItem: Record<string, any>, callback?: FormDialogCallback): Promise<void>;
41
+ declare function openDialog(item?: object): void;
42
+ declare var __VLS_22: {
43
+ items: Record<string, any>[];
44
+ operation: {
45
+ openDialog: typeof openDialog;
46
+ createItem: typeof createItem;
47
+ updateItem: typeof updateItem;
48
+ deleteItem: typeof deleteItem;
49
+ moveUpItem: typeof moveUpItem;
50
+ moveDownItem: typeof moveDownItem;
51
+ moveToItem: typeof moveToItem;
52
+ setSearch: typeof setSearch;
53
+ };
54
+ }, __VLS_48: {}, __VLS_56: {
55
+ items: Record<string, any>[];
56
+ operation: {
57
+ openDialog: typeof openDialog;
58
+ createItem: typeof createItem;
59
+ updateItem: typeof updateItem;
60
+ deleteItem: typeof deleteItem;
61
+ moveUpItem: typeof moveUpItem;
62
+ moveDownItem: typeof moveDownItem;
63
+ moveToItem: typeof moveToItem;
64
+ setSearch: typeof setSearch;
65
+ };
66
+ }, __VLS_69: {
67
+ items: Record<string, any>[];
68
+ operation: {
69
+ openDialog: typeof openDialog;
70
+ createItem: typeof createItem;
71
+ updateItem: typeof updateItem;
72
+ deleteItem: typeof deleteItem;
73
+ moveUpItem: typeof moveUpItem;
74
+ moveDownItem: typeof moveDownItem;
75
+ moveToItem: typeof moveToItem;
76
+ setSearch: typeof setSearch;
77
+ };
78
+ }, __VLS_99: never, __VLS_100: {
79
+ operation: {
80
+ openDialog: typeof openDialog;
81
+ createItem: typeof createItem;
82
+ updateItem: typeof updateItem;
83
+ deleteItem: typeof deleteItem;
84
+ moveUpItem: typeof moveUpItem;
85
+ moveDownItem: typeof moveDownItem;
86
+ moveToItem: typeof moveToItem;
87
+ setSearch: typeof setSearch;
88
+ };
89
+ isReadonly: import("vue").ComputedRef<boolean>;
90
+ isDisabled: import("vue").ComputedRef<boolean>;
91
+ }, __VLS_153: any, __VLS_156: any, __VLS_159: any, __VLS_161: {
92
+ operation: {
93
+ openDialog: typeof openDialog;
94
+ createItem: typeof createItem;
95
+ updateItem: typeof updateItem;
96
+ deleteItem: typeof deleteItem;
97
+ moveUpItem: typeof moveUpItem;
98
+ moveDownItem: typeof moveDownItem;
99
+ moveToItem: typeof moveToItem;
100
+ setSearch: typeof setSearch;
101
+ };
102
+ isReadonly: import("vue").ComputedRef<boolean>;
103
+ isDisabled: import("vue").ComputedRef<boolean>;
104
+ }, __VLS_181: any;
105
+ type __VLS_Slots = {} & {
106
+ [K in NonNullable<typeof __VLS_99>]?: (props: typeof __VLS_100) => any;
107
+ } & {
108
+ header?: (props: typeof __VLS_22) => any;
109
+ } & {
110
+ title?: (props: typeof __VLS_48) => any;
111
+ } & {
112
+ search?: (props: typeof __VLS_56) => any;
113
+ } & {
114
+ toolbarItems?: (props: typeof __VLS_69) => any;
115
+ } & {
116
+ form?: (props: typeof __VLS_153) => any;
117
+ } & {
118
+ formTitle?: (props: typeof __VLS_156) => any;
119
+ } & {
120
+ formAction?: (props: typeof __VLS_159) => any;
121
+ } & {
122
+ inputPad?: (props: typeof __VLS_161) => any;
123
+ } & {
124
+ form?: (props: typeof __VLS_181) => any;
125
+ };
126
+ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
127
+ noDataText: string;
128
+ dialogFullscreen: boolean;
129
+ modelKey: string;
130
+ toolbarColor: string;
131
+ importable: boolean;
132
+ exportable: boolean;
133
+ insertable: boolean;
134
+ searchable: boolean;
135
+ inputPad: boolean;
136
+ inputPadOnly: boolean;
137
+ saveAndStay: boolean;
138
+ stringFields: () => never[];
139
+ }>>, {
140
+ errorMessages: import("vue").ComputedRef<(string & string[]) | (readonly string[] & string[]) | undefined>;
141
+ isValid: import("vue").ComputedRef<boolean | null | undefined>;
142
+ reset: () => Promise<void> | undefined;
143
+ resetValidation: () => Promise<void> | undefined;
144
+ validate: () => Promise<string[]> | undefined;
145
+ operation: import("vue").Ref<{
146
+ openDialog: typeof openDialog;
147
+ createItem: typeof createItem;
148
+ updateItem: typeof updateItem;
149
+ deleteItem: typeof deleteItem;
150
+ moveUpItem: typeof moveUpItem;
151
+ moveDownItem: typeof moveDownItem;
152
+ moveToItem: typeof moveToItem;
153
+ setSearch: typeof setSearch;
154
+ }, {
155
+ openDialog: typeof openDialog;
156
+ createItem: typeof createItem;
157
+ updateItem: typeof updateItem;
158
+ deleteItem: typeof deleteItem;
159
+ moveUpItem: typeof moveUpItem;
160
+ moveDownItem: typeof moveDownItem;
161
+ moveToItem: typeof moveToItem;
162
+ setSearch: typeof setSearch;
163
+ } | {
164
+ openDialog: typeof openDialog;
165
+ createItem: typeof createItem;
166
+ updateItem: typeof updateItem;
167
+ deleteItem: typeof deleteItem;
168
+ moveUpItem: typeof moveUpItem;
169
+ moveDownItem: typeof moveDownItem;
170
+ moveToItem: typeof moveToItem;
171
+ setSearch: typeof setSearch;
172
+ }>;
173
+ items: import("vue").Ref<Record<string, any>[], Record<string, any>[]>;
174
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
175
+ "update:modelValue": (...args: any[]) => void;
176
+ "open:dialog": (...args: any[]) => void;
177
+ "close:dialog": (...args: any[]) => void;
178
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
179
+ noDataText: string;
180
+ dialogFullscreen: boolean;
181
+ modelKey: string;
182
+ toolbarColor: string;
183
+ importable: boolean;
184
+ exportable: boolean;
185
+ insertable: boolean;
186
+ searchable: boolean;
187
+ inputPad: boolean;
188
+ inputPadOnly: boolean;
189
+ saveAndStay: boolean;
190
+ stringFields: () => never[];
191
+ }>>> & Readonly<{
192
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
193
+ "onOpen:dialog"?: ((...args: any[]) => any) | undefined;
194
+ "onClose:dialog"?: ((...args: any[]) => any) | undefined;
195
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
196
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
197
+ declare const _default: typeof __VLS_export;
198
+ export default _default;
199
+ type __VLS_TypePropsToOption<T> = {
200
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
201
+ type: import('vue').PropType<Required<T>[K]>;
202
+ } : {
203
+ type: import('vue').PropType<T[K]>;
204
+ required: true;
205
+ };
206
+ };
207
+ type __VLS_WithDefaults<P, D> = {
208
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
209
+ default: D[K];
210
+ }> : P[K];
211
+ };
212
+ type __VLS_WithSlots<T, S> = T & {
213
+ new (): {
214
+ $slots: S;
215
+ };
216
+ };
217
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
218
+ [K in keyof T]: T[K];
219
+ } : {
220
+ [K in keyof T as K]: T[K];
221
+ }) & {};
@@ -0,0 +1,102 @@
1
+ /**
2
+ * FormTableData is a schema-driven form field component that binds model data, renders field UI, and emits normalized updates.
3
+ * This doc block is consumed by vue-docgen for generated API documentation.
4
+ */
5
+ import { VDataTable } from 'vuetify/components/VDataTable';
6
+ import { type PersistSlimProps } from '../../composables/localStorageModel.js';
7
+ interface Props extends /* @vue-ignore */ InstanceType<typeof VDataTable['$props']> {
8
+ title: string;
9
+ noDataText?: string;
10
+ modelValue?: Record<string, any>[];
11
+ modelKey?: string;
12
+ toolbarColor?: string;
13
+ headers: Record<string, any>[];
14
+ itemsInitial: Record<string, any>[];
15
+ dataTemplate?: string | object;
16
+ disableApplyToAll?: boolean | string | string[];
17
+ }
18
+ /**
19
+ * Public props accepted by FormTableData.
20
+ * Document each prop field with intent, defaults, and side effects for clear generated docs.
21
+ */
22
+ type __VLS_Props = Props & PersistSlimProps;
23
+ declare var __VLS_22: {
24
+ items: Record<string, any>[];
25
+ operation: {
26
+ reset: () => void;
27
+ };
28
+ }, __VLS_48: {}, __VLS_56: {
29
+ items: Record<string, any>[];
30
+ operation: {
31
+ reset: () => void;
32
+ };
33
+ }, __VLS_73: never, __VLS_74: {
34
+ operation: {
35
+ reset: () => void;
36
+ };
37
+ isReadonly: import("vue").ComputedRef<boolean>;
38
+ isDisabled: import("vue").ComputedRef<boolean>;
39
+ };
40
+ type __VLS_Slots = {} & {
41
+ [K in NonNullable<typeof __VLS_73>]?: (props: typeof __VLS_74) => any;
42
+ } & {
43
+ header?: (props: typeof __VLS_22) => any;
44
+ } & {
45
+ title?: (props: typeof __VLS_48) => any;
46
+ } & {
47
+ toolbarItems?: (props: typeof __VLS_56) => any;
48
+ };
49
+ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
50
+ noDataText: string;
51
+ modelKey: string;
52
+ toolbarColor: string;
53
+ disableApplyToAll: boolean;
54
+ }>>, {
55
+ errorMessages: import("vue").ComputedRef<(string & string[]) | (readonly string[] & string[]) | undefined>;
56
+ isValid: import("vue").ComputedRef<boolean | null | undefined>;
57
+ reset: () => void;
58
+ resetValidation: () => Promise<void> | undefined;
59
+ validate: () => Promise<string[]> | undefined;
60
+ operation: import("vue").Ref<{
61
+ reset: () => void;
62
+ }, {
63
+ reset: () => void;
64
+ } | {
65
+ reset: () => void;
66
+ }>;
67
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
68
+ "update:modelValue": (...args: any[]) => void;
69
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
70
+ noDataText: string;
71
+ modelKey: string;
72
+ toolbarColor: string;
73
+ disableApplyToAll: boolean;
74
+ }>>> & Readonly<{
75
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
76
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
77
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
78
+ declare const _default: typeof __VLS_export;
79
+ export default _default;
80
+ type __VLS_TypePropsToOption<T> = {
81
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
82
+ type: import('vue').PropType<Required<T>[K]>;
83
+ } : {
84
+ type: import('vue').PropType<T[K]>;
85
+ required: true;
86
+ };
87
+ };
88
+ type __VLS_WithDefaults<P, D> = {
89
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
90
+ default: D[K];
91
+ }> : P[K];
92
+ };
93
+ type __VLS_WithSlots<T, S> = T & {
94
+ new (): {
95
+ $slots: S;
96
+ };
97
+ };
98
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
99
+ [K in keyof T]: T[K];
100
+ } : {
101
+ [K in keyof T as K]: T[K];
102
+ }) & {};
@@ -1,166 +1,136 @@
1
- <script lang="ts" setup>
2
- /**
3
- * FormTableData is a schema-driven form field component that binds model data, renders field UI, and emits normalized updates.
4
- * This doc block is consumed by vue-docgen for generated API documentation.
5
- */
6
- import {VDataTable} from 'vuetify/components/VDataTable'
7
- import {VInput} from 'vuetify/components/VInput'
8
- import {computed, defineOptions,defineExpose, ref, useAttrs, watch, useTemplateRef} from 'vue'
9
- import {cloneDeep, isEqual, omit, isArray, isString} from 'lodash-es'
10
- import {templateItemToString} from "../../composables/document/template";
11
- import {templateToHeader} from "../../composables/document/templateFormTable";
12
- import { useLocalStorageModel, type PersistSlimProps } from '../../composables/localStorageModel'
13
-
1
+ <script setup>
2
+ import { VDataTable } from "vuetify/components/VDataTable";
3
+ import { VInput } from "vuetify/components/VInput";
4
+ import { computed, ref, useAttrs, watch, useTemplateRef } from "vue";
5
+ import { cloneDeep, isEqual, omit, isArray, isString } from "lodash-es";
6
+ import { templateItemToString } from "../../composables/document/template";
7
+ import { templateToHeader } from "../../composables/document/templateFormTable";
8
+ import { useLocalStorageModel } from "../../composables/localStorageModel";
14
9
  defineOptions({
15
- inheritAttrs: false,
16
- })
17
-
18
- interface Props extends /* @vue-ignore */ InstanceType<typeof VDataTable['$props']> {
19
- title: string // Title text displayed in the component header or dialog.
20
- noDataText?: string // Fallback message shown when there is no data to display.
21
- modelValue?: Record<string, any>[] // Bound value for v-model synchronization with the parent component.
22
- modelKey?: string // Primary key field name used to track row identity.
23
- toolbarColor?: string // Vuetify color name applied to toolbar and action areas.
24
- headers: Record<string, any>[] // Column definitions used to render table headers and field mapping.
25
- itemsInitial: Record<string, any>[] // Initial rows used before external data is loaded.
26
- dataTemplate?: string | object // Template object/string used to seed new row data.
27
- disableApplyToAll?: boolean | string | string[] // Disables apply-to-all behavior globally or for selected field keys.
28
- }
29
-
30
- /**
31
- * Public props accepted by FormTableData.
32
- * Document each prop field with intent, defaults, and side effects for clear generated docs.
33
- */
34
- const props = withDefaults(defineProps<Props & PersistSlimProps>(), {
35
- noDataText: 'ไม่พบข้อมูล',
36
- modelKey: 'id',
37
- toolbarColor: 'primary',
38
- disableApplyToAll: false,
39
- })
40
-
41
- /**
42
- * Custom events emitted by FormTableData.
43
- * Parents can listen to these events to react to user actions and internal state changes.
44
- */
45
- const emit = defineEmits(['update:modelValue'])
46
- const attrs = useAttrs()
10
+ inheritAttrs: false
11
+ });
12
+ const props = defineProps({
13
+ title: { type: String, required: true },
14
+ noDataText: { type: String, required: false, default: "\u0E44\u0E21\u0E48\u0E1E\u0E1A\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25" },
15
+ modelValue: { type: Array, required: false },
16
+ modelKey: { type: String, required: false, default: "id" },
17
+ toolbarColor: { type: String, required: false, default: "primary" },
18
+ headers: { type: Array, required: true },
19
+ itemsInitial: { type: Array, required: true },
20
+ dataTemplate: { type: [String, Object], required: false },
21
+ disableApplyToAll: { type: [Boolean, String, Array], required: false, default: false },
22
+ persist: { type: Boolean, required: false },
23
+ persistKey: { type: String, required: false },
24
+ persistPrefix: { type: String, required: false },
25
+ persistDebounce: { type: Number, required: false },
26
+ persistClearOnEmpty: { type: Boolean, required: false },
27
+ persistTtl: { type: Number, required: false },
28
+ persistEncrypt: { type: Boolean, required: false },
29
+ persistSecret: { type: String, required: false },
30
+ persistAlwaysHydrate: { type: Boolean, required: false }
31
+ });
32
+ const emit = defineEmits(["update:modelValue"]);
33
+ const attrs = useAttrs();
47
34
  const plainAttrs = computed(() => {
48
- return omit(attrs, ['modelValue','items','onUpdate:modelValue','itemsInitial','dataTemplate'])
49
- })
50
-
51
- const inputRef = useTemplateRef<VInput>("inputRef")
52
-
53
- const itemsInternal = ref<Record<string, any>[]>([])
54
- const itemsApplyAll = ref<Record<string, any>>({})
55
-
56
- useLocalStorageModel(itemsInternal,props)
57
-
58
- const computedDisableApplyToAll = computed(()=>{
35
+ return omit(attrs, ["modelValue", "items", "onUpdate:modelValue", "itemsInitial", "dataTemplate"]);
36
+ });
37
+ const inputRef = useTemplateRef("inputRef");
38
+ const itemsInternal = ref([]);
39
+ const itemsApplyAll = ref({});
40
+ useLocalStorageModel(itemsInternal, props);
41
+ const computedDisableApplyToAll = computed(() => {
59
42
  if (isString(props.disableApplyToAll)) {
60
- return props.disableApplyToAll.split(',').map(i=>i.trim())
43
+ return props.disableApplyToAll.split(",").map((i) => i.trim());
61
44
  }
62
- return props.disableApplyToAll
63
- })
64
- const canApplyAll = (variableName: string) => {
65
- if (isArray(computedDisableApplyToAll.value)) return !computedDisableApplyToAll.value.includes(variableName)
66
- return !computedDisableApplyToAll.value
67
- }
68
-
45
+ return props.disableApplyToAll;
46
+ });
47
+ const canApplyAll = (variableName) => {
48
+ if (isArray(computedDisableApplyToAll.value)) return !computedDisableApplyToAll.value.includes(variableName);
49
+ return !computedDisableApplyToAll.value;
50
+ };
69
51
  watch(() => props.modelValue, (newValue) => {
70
- if (!Array.isArray(newValue) || !newValue.every(item => typeof item === 'object')) {
71
- itemsInternal.value = cloneDeep(props.itemsInitial)
72
- }
73
- else {
74
- let maxKey = 0
75
-
52
+ if (!Array.isArray(newValue) || !newValue.every((item) => typeof item === "object")) {
53
+ itemsInternal.value = cloneDeep(props.itemsInitial);
54
+ } else {
55
+ let maxKey = 0;
76
56
  newValue.forEach((item) => {
77
57
  if (!item.hasOwnProperty(props.modelKey)) {
78
- maxKey = Math.max(maxKey, ...newValue.map(i => i[props.modelKey] || 0))
79
- item[props.modelKey] = maxKey + 1
58
+ maxKey = Math.max(maxKey, ...newValue.map((i) => i[props.modelKey] || 0));
59
+ item[props.modelKey] = maxKey + 1;
80
60
  }
81
- })
82
-
83
- itemsInternal.value = newValue
61
+ });
62
+ itemsInternal.value = newValue;
84
63
  }
85
- }, { immediate: true })
86
-
87
- watch(()=>props.itemsInitial, (newValue,oldValue)=>{
88
- if (!isEqual(newValue,oldValue)) itemsInternal.value = cloneDeep(props.itemsInitial)
89
- },{immediate:true,deep:true})
90
-
64
+ }, { immediate: true });
65
+ watch(() => props.itemsInitial, (newValue, oldValue) => {
66
+ if (!isEqual(newValue, oldValue)) itemsInternal.value = cloneDeep(props.itemsInitial);
67
+ }, { immediate: true, deep: true });
91
68
  watch(itemsInternal, () => {
92
- emit('update:modelValue', itemsInternal.value)
93
- }, { deep: true })
94
-
69
+ emit("update:modelValue", itemsInternal.value);
70
+ }, { deep: true });
95
71
  watch(itemsApplyAll, () => {
96
72
  itemsInternal.value = itemsInternal.value?.map((item) => {
97
- return Object.assign(item, itemsApplyAll.value)
98
- })
99
- },{deep:true})
100
-
101
- const computedHeaders = computed(()=>{
102
- let dataHeaders = templateToHeader(props.dataTemplate)
103
- let combinedHeaders = [...props.headers, ...dataHeaders]
104
- return combinedHeaders.map((header: any) => {
105
- return {...header,headerProps:
106
- {
107
- style: 'font-weight: 800'
108
- }
109
- }
110
- })
111
- })
112
-
113
- const computedDataTemplate = computed(()=>{
114
- let template = cloneDeep(props.dataTemplate)
73
+ return Object.assign(item, itemsApplyAll.value);
74
+ });
75
+ }, { deep: true });
76
+ const computedHeaders = computed(() => {
77
+ let dataHeaders = templateToHeader(props.dataTemplate);
78
+ let combinedHeaders = [...props.headers, ...dataHeaders];
79
+ return combinedHeaders.map((header) => {
80
+ return {
81
+ ...header,
82
+ headerProps: {
83
+ style: "font-weight: 800"
84
+ }
85
+ };
86
+ });
87
+ });
88
+ const computedDataTemplate = computed(() => {
89
+ let template = cloneDeep(props.dataTemplate);
115
90
  if (isString(props.dataTemplate)) {
116
91
  try {
117
- template = JSON.parse(props.dataTemplate)
92
+ template = JSON.parse(props.dataTemplate);
118
93
  } catch (e) {
119
- void e
94
+ void e;
120
95
  }
121
96
  }
122
97
  if (isArray(template)) {
123
- return template.map((t: any) => {
124
- const out = { ...t }
125
- let s = out.inputAttributes?.trim() || ""
98
+ return template.map((t) => {
99
+ const out = { ...t };
100
+ let s = out.inputAttributes?.trim() || "";
126
101
  if (!/(^|\s)hide-details(\s|$)/.test(s) && !/(^|\s)hideDetails(\s|$)/.test(s)) {
127
- s = `${s} hide-details`.trim()
102
+ s = `${s} hide-details`.trim();
128
103
  }
129
- out.inputAttributes = s
130
- return out
131
- })
104
+ out.inputAttributes = s;
105
+ return out;
106
+ });
132
107
  }
133
- return []
134
- })
135
-
136
- const reset = ()=>{
137
- inputRef.value?.reset()
138
- itemsApplyAll.value = {}
139
- }
140
-
141
- const isValid = computed(()=>{
142
- return inputRef.value?.isValid
143
- })
144
-
145
- const errorMessages = computed(()=>{
146
- return inputRef.value?.errorMessages
147
- })
148
-
149
- const operation = ref({reset})
150
-
108
+ return [];
109
+ });
110
+ const reset = () => {
111
+ inputRef.value?.reset();
112
+ itemsApplyAll.value = {};
113
+ };
114
+ const isValid = computed(() => {
115
+ return inputRef.value?.isValid;
116
+ });
117
+ const errorMessages = computed(() => {
118
+ return inputRef.value?.errorMessages;
119
+ });
120
+ const operation = ref({ reset });
151
121
  defineExpose({
152
122
  errorMessages,
153
123
  isValid,
154
124
  reset,
155
- resetValidation : ()=>inputRef.value?.resetValidation(),
156
- validate : ()=>inputRef.value?.validate(),
125
+ resetValidation: () => inputRef.value?.resetValidation(),
126
+ validate: () => inputRef.value?.validate(),
157
127
  operation
158
- })
128
+ });
159
129
  </script>
160
130
 
161
131
  <template>
162
132
  <v-input v-model="itemsInternal" v-bind="plainAttrs" ref="inputRef">
163
- <template #default="{isReadonly,isDisabled}">
133
+ <template #default="{ isReadonly, isDisabled }">
164
134
  <v-container fluid class="ma-0 pa-0">
165
135
  <v-card>
166
136
  <slot
@@ -172,7 +142,7 @@ defineExpose({
172
142
  <v-row
173
143
  justify="end"
174
144
  class="ma-1"
175
- dense
145
+ density="compact"
176
146
  no-gutters
177
147
  align="center"
178
148
  >
@@ -207,13 +177,13 @@ defineExpose({
207
177
  >
208
178
  <!-- @ts-ignore -->
209
179
  <template
210
- v-for="(_, name, index) in ($slots as {})"
180
+ v-for="(_, name, index) in $slots"
211
181
  :key="index"
212
182
  #[name]="slotData"
213
183
  >
214
184
  <slot
215
185
  :name="name"
216
- v-bind="((slotData || {}) as object)"
186
+ v-bind="slotData || {}"
217
187
  :operation="operation"
218
188
  :isReadonly="isReadonly"
219
189
  :isDisabled="isDisabled"
@@ -221,12 +191,12 @@ defineExpose({
221
191
  </template>
222
192
 
223
193
  <template v-for="template in computedDataTemplate" :key="template.variableName" #[`header.${template.variableName}`]="props">
224
- <form-pad v-model="itemsApplyAll" :template="templateItemToString(template,[])" v-if="canApplyAll(template.variableName)"></form-pad>
194
+ <form-pad v-model="itemsApplyAll" :template="templateItemToString(template, [])" v-if="canApplyAll(template.variableName)"></form-pad>
225
195
  <template v-else>{{props.column.title}}</template>
226
196
  </template>
227
197
 
228
- <template v-for="template in computedDataTemplate" :key="template.variableName" #[`item.${template.variableName}`]="{index}">
229
- <form-pad v-model="itemsInternal[index]" :template="templateItemToString(template,[])"></form-pad>
198
+ <template v-for="template in computedDataTemplate" :key="template.variableName" #[`item.${template.variableName}`]="{ index }">
199
+ <form-pad v-model="itemsInternal[index]" :template="templateItemToString(template, [])"></form-pad>
230
200
  </template>
231
201
  </v-data-table>
232
202
  </v-card>