@ramathibodi/nuxt-commons 0.1.72 → 0.1.74

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 (90) hide show
  1. package/README.md +74 -55
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +1 -0
  4. package/dist/runtime/components/Alert.vue +4 -0
  5. package/dist/runtime/components/BarcodeReader.vue +8 -0
  6. package/dist/runtime/components/ExportCSV.vue +13 -5
  7. package/dist/runtime/components/FileBtn.vue +17 -5
  8. package/dist/runtime/components/ImportCSV.vue +14 -2
  9. package/dist/runtime/components/MrzReader.vue +168 -0
  10. package/dist/runtime/components/SplitterPanel.vue +9 -1
  11. package/dist/runtime/components/TabsGroup.vue +9 -1
  12. package/dist/runtime/components/TextBarcode.vue +13 -1
  13. package/dist/runtime/components/device/IdCardButton.vue +15 -3
  14. package/dist/runtime/components/device/IdCardWebSocket.vue +18 -6
  15. package/dist/runtime/components/device/Scanner.vue +18 -6
  16. package/dist/runtime/components/dialog/Confirm.vue +20 -8
  17. package/dist/runtime/components/dialog/Host.vue +4 -0
  18. package/dist/runtime/components/dialog/Index.vue +17 -5
  19. package/dist/runtime/components/dialog/Loading.vue +14 -2
  20. package/dist/runtime/components/dialog/default/Confirm.vue +20 -8
  21. package/dist/runtime/components/dialog/default/Loading.vue +14 -2
  22. package/dist/runtime/components/dialog/default/Notify.vue +18 -6
  23. package/dist/runtime/components/dialog/default/Printing.vue +14 -2
  24. package/dist/runtime/components/dialog/default/VerifyUser.vue +20 -8
  25. package/dist/runtime/components/document/Form.vue +10 -2
  26. package/dist/runtime/components/document/TemplateBuilder.vue +14 -2
  27. package/dist/runtime/components/form/ActionPad.vue +19 -7
  28. package/dist/runtime/components/form/Birthdate.vue +15 -3
  29. package/dist/runtime/components/form/CheckboxGroup.vue +17 -5
  30. package/dist/runtime/components/form/CodeEditor.vue +11 -3
  31. package/dist/runtime/components/form/Date.vue +23 -11
  32. package/dist/runtime/components/form/DateTime.vue +29 -17
  33. package/dist/runtime/components/form/Dialog.vue +21 -9
  34. package/dist/runtime/components/form/EditPad.vue +20 -8
  35. package/dist/runtime/components/form/File.vue +18 -6
  36. package/dist/runtime/components/form/Hidden.vue +15 -3
  37. package/dist/runtime/components/form/Iterator.vue +43 -31
  38. package/dist/runtime/components/form/Login.vue +18 -6
  39. package/dist/runtime/components/form/Pad.vue +24 -12
  40. package/dist/runtime/components/form/SignPad.vue +13 -5
  41. package/dist/runtime/components/form/System.vue +10 -2
  42. package/dist/runtime/components/form/Table.vue +31 -19
  43. package/dist/runtime/components/form/TableData.vue +21 -9
  44. package/dist/runtime/components/form/Time.vue +16 -4
  45. package/dist/runtime/components/form/images/Capture.vue +17 -9
  46. package/dist/runtime/components/form/images/Edit.vue +16 -4
  47. package/dist/runtime/components/form/images/Field.vue +21 -10
  48. package/dist/runtime/components/form/images/Pad.vue +12 -0
  49. package/dist/runtime/components/label/Date.vue +12 -4
  50. package/dist/runtime/components/label/DateAgo.vue +13 -5
  51. package/dist/runtime/components/label/DateCount.vue +13 -5
  52. package/dist/runtime/components/label/Field.vue +14 -6
  53. package/dist/runtime/components/label/FormatMoney.vue +11 -3
  54. package/dist/runtime/components/label/Mask.vue +11 -3
  55. package/dist/runtime/components/label/Object.vue +11 -3
  56. package/dist/runtime/components/master/Autocomplete.vue +25 -7
  57. package/dist/runtime/components/master/Combobox.vue +26 -8
  58. package/dist/runtime/components/master/RadioGroup.vue +17 -5
  59. package/dist/runtime/components/master/Select.vue +24 -7
  60. package/dist/runtime/components/master/label.vue +14 -6
  61. package/dist/runtime/components/model/Autocomplete.vue +31 -12
  62. package/dist/runtime/components/model/Combobox.vue +30 -12
  63. package/dist/runtime/components/model/Pad.vue +15 -3
  64. package/dist/runtime/components/model/Select.vue +27 -7
  65. package/dist/runtime/components/model/Table.vue +30 -18
  66. package/dist/runtime/components/model/iterator.vue +36 -28
  67. package/dist/runtime/components/model/label.vue +16 -8
  68. package/dist/runtime/components/pdf/Print.vue +17 -5
  69. package/dist/runtime/components/pdf/View.vue +18 -6
  70. package/dist/runtime/composables/alert.d.ts +4 -0
  71. package/dist/runtime/composables/api.d.ts +4 -0
  72. package/dist/runtime/composables/document/templateFormHidden.d.ts +4 -0
  73. package/dist/runtime/composables/localStorageModel.d.ts +4 -0
  74. package/dist/runtime/composables/lookupList.d.ts +16 -5
  75. package/dist/runtime/composables/lookupList.js +71 -21
  76. package/dist/runtime/composables/lookupListMaster.d.ts +4 -0
  77. package/dist/runtime/composables/lookupListMaster.js +9 -4
  78. package/dist/runtime/composables/menu.d.ts +4 -0
  79. package/dist/runtime/composables/useMrzReader.d.ts +48 -0
  80. package/dist/runtime/composables/useMrzReader.js +423 -0
  81. package/dist/runtime/composables/useTesseract.d.ts +16 -0
  82. package/dist/runtime/composables/useTesseract.js +45 -0
  83. package/dist/runtime/utils/asset.d.ts +2 -0
  84. package/dist/runtime/utils/asset.js +49 -0
  85. package/package.json +12 -3
  86. package/scripts/enrich-vue-docs-from-ai.mjs +197 -0
  87. package/scripts/generate-ai-summary.mjs +321 -0
  88. package/scripts/generate-composables-md.mjs +129 -0
  89. package/templates/public/tesseract/mrz.traineddata.gz +0 -0
  90. package/templates/public/tesseract/ocrb.traineddata.gz +0 -0
@@ -1,4 +1,8 @@
1
1
  <script lang="ts" setup>
2
+ /**
3
+ * FormDateTime 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
+ */
2
6
  import {ref, computed, watch, watchEffect, nextTick, useAttrs} from 'vue'
3
7
  import {union, isBoolean, isArray, isString, omit} from 'lodash-es'
4
8
  import { VTextField } from 'vuetify/components/VTextField'
@@ -6,25 +10,29 @@ import { type dateFormat, Datetime } from '../../utils/datetime'
6
10
  import { useRules } from '../../composables/utils/validation'
7
11
 
8
12
  interface Props {
9
- modelValue?: string | null
10
- format?: dateFormat | string
11
- label?: string
12
- enableSeconds?: boolean
13
- rules?: typeof import('vuetify/components')['VTextField']['rules']
14
- dateRules?: typeof import('vuetify/components')['VTextField']['rules']
15
- timeRules?: typeof import('vuetify/components')['VTextField']['rules']
16
- dense?: boolean
17
- pickerOnly?: boolean
18
- minDate?: Date | string
19
- maxDate?: Date | string
20
- readonly?: boolean
21
- locale?: 'TH' | 'EN'
22
-
23
- defaultDate?: boolean | string,
24
- defaultDateTime?: boolean | string,
25
- fixedDate?: boolean
13
+ modelValue?: string | null // Bound value for v-model synchronization with the parent component.
14
+ format?: dateFormat | string // Output format used when converting the value for display or emit.
15
+ label?: string // UI label displayed to end users
16
+ enableSeconds?: boolean // Includes seconds selector in the time picker.
17
+ rules?: typeof import('vuetify/components')['VTextField']['rules'] // validation rules applied before accepting input
18
+ dateRules?: typeof import('vuetify/components')['VTextField']['rules'] // date value used by component logic and display
19
+ timeRules?: typeof import('vuetify/components')['VTextField']['rules'] // time value used by component logic and display
20
+ dense?: boolean // Configuration option used by DateTime.
21
+ pickerOnly?: boolean // forces value selection through picker interaction only
22
+ minDate?: Date | string // earliest selectable date allowed by business rules
23
+ maxDate?: Date | string // latest selectable date allowed by business rules
24
+ readonly?: boolean // renders as read-only while keeping value visible
25
+ locale?: 'TH' | 'EN' // Locale used for date/time formatting and localized labels.
26
+
27
+ defaultDate?: boolean | string, // default date behavior/value when model is initially empty
28
+ defaultDateTime?: boolean | string, // date value used by component logic and display
29
+ fixedDate?: boolean // date value used by component logic and display
26
30
  }
27
31
 
32
+ /**
33
+ * Public props accepted by FormDateTime.
34
+ * Document each prop field with intent, defaults, and side effects for clear generated docs.
35
+ */
28
36
  const props = withDefaults(defineProps<Props>(), {
29
37
  dense: false,
30
38
  locale: 'TH',
@@ -37,6 +45,10 @@ const props = withDefaults(defineProps<Props>(), {
37
45
  fixedDate: false,
38
46
  })
39
47
 
48
+ /**
49
+ * Custom events emitted by FormDateTime.
50
+ * Parents can listen to these events to react to user actions and internal state changes.
51
+ */
40
52
  const emit = defineEmits(['update:modelValue'])
41
53
 
42
54
  const attrs = useAttrs()
@@ -1,20 +1,28 @@
1
1
  <script lang="ts" setup>
2
+ /**
3
+ * FormDialog 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
+ */
2
6
  import {computed, defineModel, ref, watch, watchEffect} from 'vue'
3
7
  import {cloneDeep, isEqual} from 'lodash-es'
4
8
  import type {FormDialogCallback} from '../../types/formDialog'
5
9
 
6
10
  interface Props {
7
- fullscreen?: boolean
8
- title?: string
9
- initialData?: object
10
- formData?: object
11
- saveCaption?: string
12
- cancelCaption?: string
13
- closeCaption?: string
14
- saveAndStay?: boolean
15
- readonly?: boolean
11
+ fullscreen?: boolean // Opens the dialog in fullscreen mode.
12
+ title?: string // Title text displayed in the component header or dialog.
13
+ initialData?: object // Initial form/object values used when creating a new record.
14
+ formData?: object // Configuration option used by Dialog.
15
+ saveCaption?: string // Label text for the save/confirm action button.
16
+ cancelCaption?: string // Label text for the cancel action button.
17
+ closeCaption?: string // Label text for the close action button.
18
+ saveAndStay?: boolean // Keeps editing context open after save for consecutive updates.
19
+ readonly?: boolean // renders as read-only while keeping value visible
16
20
  }
17
21
 
22
+ /**
23
+ * Public props accepted by FormDialog.
24
+ * Document each prop field with intent, defaults, and side effects for clear generated docs.
25
+ */
18
26
  const props = withDefaults(defineProps<Props>(), {
19
27
  saveCaption: 'บันทึก',
20
28
  cancelCaption: 'ยกเลิก',
@@ -30,6 +38,10 @@ const formPadRef = ref()
30
38
  const formData = ref<object>({})
31
39
  const formDataOriginalValue = ref<object>()
32
40
 
41
+ /**
42
+ * Custom events emitted by FormDialog.
43
+ * Parents can listen to these events to react to user actions and internal state changes.
44
+ */
33
45
  const emit = defineEmits(['create', 'update'])
34
46
 
35
47
  function save() {
@@ -1,20 +1,28 @@
1
1
  <script lang="ts" setup>
2
+ /**
3
+ * FormEditPad 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
+ */
2
6
  import {computed, defineExpose, ref, watchEffect} from 'vue'
3
7
  import {cloneDeep, isEqual} from 'lodash-es'
4
8
  import type {FormDialogCallback} from '../../types/formDialog'
5
9
  import FormPadComponent from './Pad.vue'
6
10
 
7
11
  interface Props extends /* @vue-ignore */ InstanceType<typeof FormPadComponent['$props']> {
8
- title?: string
9
- initialData?: object
10
- formData?: object
11
- saveCaption?: string
12
- cancelCaption?: string
13
- readonly?: boolean
14
- showTitle?: boolean
15
- skipValidation?:boolean
12
+ title?: string // Title text displayed in the component header or dialog.
13
+ initialData?: object // Initial form/object values used when creating a new record.
14
+ formData?: object // Configuration option used by EditPad.
15
+ saveCaption?: string // Label text for the save/confirm action button.
16
+ cancelCaption?: string // Label text for the cancel action button.
17
+ readonly?: boolean // renders as read-only while keeping value visible
18
+ showTitle?: boolean // Shows or hides the component title/header area.
19
+ skipValidation?: boolean // Skips form validation before emitting save actions.
16
20
  }
17
21
 
22
+ /**
23
+ * Public props accepted by FormEditPad.
24
+ * Document each prop field with intent, defaults, and side effects for clear generated docs.
25
+ */
18
26
  const props = withDefaults(defineProps<Props>(), {
19
27
  saveCaption: 'บันทึก',
20
28
  cancelCaption: 'ยกเลิก',
@@ -28,6 +36,10 @@ const formPadRef = ref()
28
36
  const formData = ref<object>({})
29
37
  const formDataOriginalValue = ref<object>()
30
38
 
39
+ /**
40
+ * Custom events emitted by FormEditPad.
41
+ * Parents can listen to these events to react to user actions and internal state changes.
42
+ */
31
43
  const emit = defineEmits(['create', 'update'])
32
44
 
33
45
  function save() {
@@ -1,4 +1,8 @@
1
1
  <script lang="ts" setup>
2
+ /**
3
+ * FormFile 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
+ */
2
6
  import { castArray } from 'lodash-es'
3
7
  import { ref, shallowRef, watch, computed } from 'vue'
4
8
  import { VTextField } from 'vuetify/components/VTextField'
@@ -12,14 +16,18 @@ const { hydrateAssetFile, base64ToFile, fileToBase64, downloadBase64File } = use
12
16
  const fileToBase64WithMaxSize = (file: File) => fileToBase64(file, props.maxSize)
13
17
 
14
18
  interface Props extends /* @vue-ignore */ InstanceType<typeof VTextField['$props']> {
15
- accept?: string
16
- multiple?: boolean
17
- maxSize?: number
18
- modelValue?: Base64File | Base64File[] | null
19
- downloadable?: boolean
20
- autoHydrate?: boolean
19
+ accept?: string // Accepted file MIME types or extensions for file selection.
20
+ multiple?: boolean // Allows selecting or uploading more than one file.
21
+ maxSize?: number // Maximum allowed output size (MB) before upload is blocked.
22
+ modelValue?: Base64File | Base64File[] | null // Bound value for v-model synchronization with the parent component.
23
+ downloadable?: boolean // Shows download actions for selected/loaded files.
24
+ autoHydrate?: boolean // Converts incoming serialized values into component runtime format on mount/watch.
21
25
  }
22
26
 
27
+ /**
28
+ * Public props accepted by FormFile.
29
+ * Document each prop field with intent, defaults, and side effects for clear generated docs.
30
+ */
23
31
  const props = withDefaults(defineProps<Props>(), {
24
32
  accept: '*',
25
33
  multiple: false,
@@ -28,6 +36,10 @@ const props = withDefaults(defineProps<Props>(), {
28
36
  autoHydrate: false,
29
37
  })
30
38
 
39
+ /**
40
+ * Custom events emitted by FormFile.
41
+ * Parents can listen to these events to react to user actions and internal state changes.
42
+ */
31
43
  const emit = defineEmits<{
32
44
  (e: 'update:modelValue', value: Base64File | Base64File[] | null): void
33
45
  }>()
@@ -1,14 +1,26 @@
1
1
  <script lang="ts" setup>
2
+ /**
3
+ * FormHidden 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
+ */
2
6
  import { watch } from 'vue'
3
7
  import { cloneDeep } from 'lodash-es'
4
8
 
5
9
  interface Props {
6
- itemValue?: any
7
- hook?: Function
8
- modelValue?: any
10
+ itemValue?: any // Internal hidden value to emit/store from this field.
11
+ hook?: Function // Callback function executed before emitting the final value.
12
+ modelValue?: any // Bound value for v-model synchronization with the parent component.
9
13
  }
10
14
 
15
+ /**
16
+ * Public props accepted by FormHidden.
17
+ * Document each prop field with intent, defaults, and side effects for clear generated docs.
18
+ */
11
19
  const props = defineProps<Props>()
20
+ /**
21
+ * Custom events emitted by FormHidden.
22
+ * Parents can listen to these events to react to user actions and internal state changes.
23
+ */
12
24
  const emit = defineEmits(['update:modelValue'])
13
25
 
14
26
  watch(() => props.itemValue, (newValue,oldValue) => {
@@ -1,4 +1,8 @@
1
1
  <script lang="ts" setup>
2
+ /**
3
+ * FormIterator 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
+ */
2
6
  import {computed, defineExpose, defineOptions, nextTick, ref, useAttrs, useSlots, useTemplateRef, watch} from 'vue'
3
7
  import {omit} from 'lodash-es'
4
8
  import type {FormDialogCallback} from '../../types/formDialog'
@@ -12,39 +16,43 @@ defineOptions({
12
16
  })
13
17
 
14
18
  interface Props extends /* @vue-ignore */ InstanceType<typeof VDataIterator['$props']>,/* @vue-ignore */ InstanceType<typeof VDataTable['$props']> {
15
- title: string
16
- noDataText?: string
17
- modelValue?: Record<string, any>[]
18
- modelKey?: string
19
- dialogFullscreen?: boolean
20
- initialData?: Record<string, any>
21
- toolbarColor?: string
22
- importable?: boolean
23
- exportable?: boolean
24
- insertable?: boolean
25
- searchable?: boolean
26
-
27
- loading?: boolean
28
-
29
- viewSwitch?: boolean
30
- viewSwitchMultiple?: boolean
31
-
32
- cols?: string | number | boolean
33
- xxl?: string | number | boolean
34
- xl?: string | number | boolean
35
- lg?: string | number | boolean
36
- md?: string | number | boolean
37
- sm?: string | number | boolean
38
- itemsPerPage?: string | number
39
-
40
- preferTable?: string | number | boolean
41
- preferTableXxl?: string | number | boolean
42
- preferTableXl?: string | number | boolean
43
- preferTableLg?: string | number | boolean
44
- preferTableMd?: string | number | boolean
45
- preferTableSm?: string | number | boolean
19
+ title: string // Toolbar title shown above iterator/table view.
20
+ noDataText?: string // Message shown when no rows are available to render.
21
+ modelValue?: Record<string, any>[] // Parent-provided rows; component emits reordered/edited rows back via v-model.
22
+ modelKey?: string // Row identity key used for edit/delete/move operations and table item-value.
23
+ dialogFullscreen?: boolean // Opens item editor dialog in fullscreen mode by default.
24
+ initialData?: Record<string, any> // Default payload merged into a new item before editing.
25
+ toolbarColor?: string // Toolbar/action color theme token.
26
+ importable?: boolean // Shows import action and allows creating rows from imported records.
27
+ exportable?: boolean // Shows export action for the current iterator dataset.
28
+ insertable?: boolean // Enables add/create action for new rows.
29
+ searchable?: boolean // Shows search control and applies client-side filtering keyword.
30
+
31
+ loading?: boolean // External loading state passed through to iterator/table rendering.
32
+
33
+ viewSwitch?: boolean // Enables UI control that lets users switch between card iterator and table view.
34
+ viewSwitchMultiple?: boolean // Allows multi-select behavior in view switch control when enabled.
35
+
36
+ cols?: string | number | boolean // Base grid columns for iterator card items.
37
+ xxl?: string | number | boolean // Card grid columns at `xxl` breakpoint.
38
+ xl?: string | number | boolean // Card grid columns at `xl` breakpoint.
39
+ lg?: string | number | boolean // Card grid columns at `lg` breakpoint.
40
+ md?: string | number | boolean // Card grid columns at `md` breakpoint.
41
+ sm?: string | number | boolean // Card grid columns at `sm` breakpoint.
42
+ itemsPerPage?: string | number // Page size for iterator/table; supports `'all'` semantics.
43
+
44
+ preferTable?: string | number | boolean // Global auto-switch rule: `true` always table, number means table when item count reaches threshold.
45
+ preferTableXxl?: string | number | boolean // Breakpoint-specific override for `preferTable` at `xxl`.
46
+ preferTableXl?: string | number | boolean // Breakpoint-specific override for `preferTable` at `xl`.
47
+ preferTableLg?: string | number | boolean // Breakpoint-specific override for `preferTable` at `lg`.
48
+ preferTableMd?: string | number | boolean // Breakpoint-specific override for `preferTable` at `md`.
49
+ preferTableSm?: string | number | boolean // Breakpoint-specific override for `preferTable` at `sm`.
46
50
  }
47
51
 
52
+ /**
53
+ * Public props accepted by FormIterator.
54
+ * Document each prop field with intent, defaults, and side effects for clear generated docs.
55
+ */
48
56
  const props = withDefaults(defineProps<Props>(), {
49
57
  noDataText: 'ไม่พบข้อมูล',
50
58
  dialogFullscreen: false,
@@ -69,6 +77,10 @@ const props = withDefaults(defineProps<Props>(), {
69
77
  itemsPerPage: 12,
70
78
  })
71
79
 
80
+ /**
81
+ * Custom events emitted by FormIterator.
82
+ * Parents can listen to these events to react to user actions and internal state changes.
83
+ */
72
84
  const emit = defineEmits(['update:modelValue'])
73
85
 
74
86
  const attrs = useAttrs()
@@ -1,15 +1,23 @@
1
1
  <script lang="ts" setup>
2
+ /**
3
+ * FormLogin 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
+ */
2
6
  import { ref, watch, withDefaults } from 'vue'
3
7
 
4
8
  interface Props {
5
- title?: string
6
- btnSubmit?: string
7
- imgLogo?: string
8
- errorMessages?: string
9
- loading?: boolean
10
- hint?: string
9
+ title?: string // Title text displayed in the component header or dialog.
10
+ btnSubmit?: string // Label text displayed on the login submit button.
11
+ imgLogo?: string // Logo image URL shown above the login form.
12
+ errorMessages?: string // Validation or authentication error message displayed to the user.
13
+ loading?: boolean // Displays loading state and disables actions while pending.
14
+ hint?: string // Helper text displayed under input fields.
11
15
  }
12
16
 
17
+ /**
18
+ * Public props accepted by FormLogin.
19
+ * Document each prop field with intent, defaults, and side effects for clear generated docs.
20
+ */
13
21
  const props = withDefaults(defineProps<Props>(), {
14
22
  title: 'Login Ramathibodi',
15
23
  btnSubmit: 'เข้าสู่ระบบ',
@@ -26,6 +34,10 @@ interface LoginData {
26
34
 
27
35
  const formValid = ref<boolean>(false)
28
36
  const loginData = ref<LoginData>({ username: '', password: '' })
37
+ /**
38
+ * Custom events emitted by FormLogin.
39
+ * Parents can listen to these events to react to user actions and internal state changes.
40
+ */
29
41
  const emit = defineEmits(['update:modelValue'])
30
42
 
31
43
  const errorText = ref<string>('')
@@ -1,4 +1,8 @@
1
1
  <script lang="ts" setup>
2
+ /**
3
+ * FormPad 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
+ */
2
6
  /* eslint-disable @typescript-eslint/no-explicit-any,import/no-self-import */
3
7
  import {
4
8
  compile,
@@ -23,20 +27,24 @@ defineOptions({
23
27
  })
24
28
 
25
29
  interface Props {
26
- modelValue?: object
27
- originalData?: object
28
- template?: any
29
- templateScript?: string
30
- disabled?: boolean
31
- readonly?: boolean
32
- isolated?: boolean
33
- decoration?: object
34
- parentTemplates?: string|string[]
35
- dirtyClass?: string
36
- dirtyOnCreate?: boolean
37
- sanitizeDelay?: number
30
+ modelValue?: object // Bound value for v-model synchronization with the parent component.
31
+ originalData?: object // Original baseline data used for dirty-checking and reset behavior.
32
+ template?: any // Template object used to render dynamic form/pad structure.
33
+ templateScript?: string // Optional script expression used to post-process template behavior.
34
+ disabled?: boolean // disables user interaction for this field
35
+ readonly?: boolean // renders as read-only while keeping value visible
36
+ isolated?: boolean // boolean flag controlling runtime behavior
37
+ decoration?: object // Decoration config used to style or annotate generated fields.
38
+ parentTemplates?: string|string[] // Parent template code(s) used for template inheritance/extension.
39
+ dirtyClass?: string // CSS class applied when form state differs from original data.
40
+ dirtyOnCreate?: boolean // Marks new forms as dirty immediately on first render.
41
+ sanitizeDelay?: number // Debounce delay before sanitizing emitted form values.
38
42
  }
39
43
 
44
+ /**
45
+ * Public props accepted by FormPad.
46
+ * Document each prop field with intent, defaults, and side effects for clear generated docs.
47
+ */
40
48
  const props = withDefaults(defineProps<Props>(), {
41
49
  disabled: false,
42
50
  readonly: false,
@@ -48,6 +56,10 @@ const props = withDefaults(defineProps<Props>(), {
48
56
  sanitizeDelay: 2000,
49
57
  })
50
58
 
59
+ /**
60
+ * Custom events emitted by FormPad.
61
+ * Parents can listen to these events to react to user actions and internal state changes.
62
+ */
51
63
  const emit = defineEmits(['update:modelValue'])
52
64
 
53
65
  const disabled = ref(props.disabled)
@@ -1,18 +1,26 @@
1
1
  <script lang="ts" setup>
2
+ /**
3
+ * FormSignPad 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
+ */
2
6
  import { VueSignaturePad } from 'vue-signature-pad'
3
7
  import { VInput } from 'vuetify/components/VInput'
4
8
  import { ref, computed, withDefaults, defineProps, defineExpose, watch } from 'vue'
5
9
  import { useAssetFile, type Base64Asset, type Base64File } from '../../composables/assetFile'
6
10
 
7
11
  interface SignatureProps extends /* @vue-ignore */ InstanceType<typeof VInput['$props']> {
8
- title?: string
9
- btnName?: string
10
- titleConfirm?: string
11
- penColor?: string
12
+ title?: string // Title text displayed in the component header or dialog.
13
+ btnName?: string // Button label used to open the signature pad dialog.
14
+ titleConfirm?: string // Confirmation text shown before accepting the signature.
15
+ penColor?: string // Pen stroke color used while drawing the signature.
12
16
  /** hydrate when id is present but base64String is missing */
13
- autoHydrate?: boolean
17
+ autoHydrate?: boolean // Converts incoming serialized values into component runtime format on mount/watch.
14
18
  }
15
19
 
20
+ /**
21
+ * Public props accepted by FormSignPad.
22
+ * Document each prop field with intent, defaults, and side effects for clear generated docs.
23
+ */
16
24
  const props = withDefaults(defineProps<SignatureProps>(), {
17
25
  title: 'Signature',
18
26
  btnName: 'Draw Your Signature',
@@ -1,13 +1,21 @@
1
1
  <script lang="ts" setup>
2
+ /**
3
+ * FormSystem 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
+ */
2
6
  import Pad from './Pad.vue'
3
7
  import { watch } from 'vue'
4
8
  import { useGraphQlOperation } from '../../composables/graphqlOperation'
5
9
 
6
10
  interface Props extends /* @vue-ignore */ InstanceType<typeof Pad['$props']> {
7
- templateId: string;
8
- cache?: boolean | number
11
+ templateId: string; // identifier value used to resolve business data
12
+ cache?: boolean | number // Enables cached requests; number values represent cache TTL in milliseconds.
9
13
  }
10
14
 
15
+ /**
16
+ * Public props accepted by FormSystem.
17
+ * Document each prop field with intent, defaults, and side effects for clear generated docs.
18
+ */
11
19
  const props = withDefaults(defineProps<Props>(),{
12
20
  cache: false
13
21
  })
@@ -1,4 +1,8 @@
1
1
  <script lang="ts" setup>
2
+ /**
3
+ * FormTable 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
+ */
2
6
  import {VDataTable} from 'vuetify/components/VDataTable'
3
7
  import {VInput} from 'vuetify/components/VInput'
4
8
  import {computed, defineOptions,defineExpose, nextTick, ref, useAttrs, watch, useTemplateRef} from 'vue'
@@ -12,27 +16,31 @@ defineOptions({
12
16
  })
13
17
 
14
18
  interface Props extends /* @vue-ignore */ InstanceType<typeof VDataTable['$props']> {
15
- title: string
16
- noDataText?: string
17
- modelValue?: Record<string, any>[]
18
- modelKey?: string
19
- dialogWidth?: string | number
20
- dialogMaxWidth?: string | number
21
- dialogHeight?: string | number
22
- dialogMaxHeight?: string | number
23
- dialogFullscreen?: boolean
24
- initialData?: Record<string, any>
25
- toolbarColor?: string
26
- importable?: boolean
27
- exportable?: boolean
28
- insertable?: boolean
29
- searchable?: boolean
30
- inputPad?: boolean
31
- inputPadOnly?: boolean
32
- saveAndStay?: boolean
33
- stringFields?: Array<string>
19
+ title: string // Toolbar title and default export file name shown for this table section.
20
+ noDataText?: string // Text rendered by the data table when `items` is empty after filtering/loading.
21
+ modelValue?: Record<string, any>[] // Source rows from parent; component normalizes, mutates order, then emits updated rows.
22
+ modelKey?: string // Unique row key used for update/delete/reorder; missing keys are auto-generated incrementally.
23
+ dialogWidth?: string | number // Passed to row edit dialog width to control normal (non-fullscreen) modal size.
24
+ dialogMaxWidth?: string | number // Upper width bound for the edit dialog on large screens.
25
+ dialogHeight?: string | number // Passed to row edit dialog height to control vertical editing space.
26
+ dialogMaxHeight?: string | number // Upper height bound for the edit dialog before internal scrolling.
27
+ dialogFullscreen?: boolean // Default open mode for row editor dialog (`true` opens full screen).
28
+ initialData?: Record<string, any> // Seed object merged into new rows before user input.
29
+ toolbarColor?: string // Vuetify color applied to toolbar and default action buttons.
30
+ importable?: boolean // Enables Import button and `@import` flow for adding multiple rows from file.
31
+ exportable?: boolean // Enables Export button for current `items` dataset.
32
+ insertable?: boolean // Enables Add button and creation flow for new rows.
33
+ searchable?: boolean // Shows toolbar search input and binds keyword to table filtering.
34
+ inputPad?: boolean // Enables embedded pad editing workflow instead of relying only on dialog.
35
+ inputPadOnly?: boolean // Uses pad editor exclusively and skips dialog open/close behavior.
36
+ saveAndStay?: boolean // Forwards to child editor to keep it open after save (batch editing).
37
+ stringFields?: Array<string> // Dot-path fields preserved as string during import/export flattening and parsing.
34
38
  }
35
39
 
40
+ /**
41
+ * Public props accepted by FormTable.
42
+ * Document each prop field with intent, defaults, and side effects for clear generated docs.
43
+ */
36
44
  const props = withDefaults(defineProps<Props & PersistSlimProps>(), {
37
45
  noDataText: 'ไม่พบข้อมูล',
38
46
  dialogFullscreen: false,
@@ -48,6 +56,10 @@ const props = withDefaults(defineProps<Props & PersistSlimProps>(), {
48
56
  stringFields: ()=>[],
49
57
  })
50
58
 
59
+ /**
60
+ * Custom events emitted by FormTable.
61
+ * Parents can listen to these events to react to user actions and internal state changes.
62
+ */
51
63
  const emit = defineEmits(['update:modelValue','open:dialog','close:dialog'])
52
64
  const attrs = useAttrs()
53
65
  const plainAttrs = computed(() => {
@@ -1,4 +1,8 @@
1
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
+ */
2
6
  import {VDataTable} from 'vuetify/components/VDataTable'
3
7
  import {VInput} from 'vuetify/components/VInput'
4
8
  import {computed, defineOptions,defineExpose, ref, useAttrs, watch, useTemplateRef} from 'vue'
@@ -12,17 +16,21 @@ defineOptions({
12
16
  })
13
17
 
14
18
  interface Props extends /* @vue-ignore */ InstanceType<typeof VDataTable['$props']> {
15
- title: string
16
- noDataText?: string
17
- modelValue?: Record<string, any>[]
18
- modelKey?: string
19
- toolbarColor?: string
20
- headers : Record<string, any>[]
21
- itemsInitial : Record<string, any>[]
22
- dataTemplate?: string | object
23
- disableApplyToAll?: boolean | string | string[]
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.
24
28
  }
25
29
 
30
+ /**
31
+ * Public props accepted by FormTableData.
32
+ * Document each prop field with intent, defaults, and side effects for clear generated docs.
33
+ */
26
34
  const props = withDefaults(defineProps<Props & PersistSlimProps>(), {
27
35
  noDataText: 'ไม่พบข้อมูล',
28
36
  modelKey: 'id',
@@ -30,6 +38,10 @@ const props = withDefaults(defineProps<Props & PersistSlimProps>(), {
30
38
  disableApplyToAll: false,
31
39
  })
32
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
+ */
33
45
  const emit = defineEmits(['update:modelValue'])
34
46
  const attrs = useAttrs()
35
47
  const plainAttrs = computed(() => {
@@ -1,4 +1,8 @@
1
1
  <script lang="ts" setup>
2
+ /**
3
+ * FormTime 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
+ */
2
6
  import { ref, watch, watchEffect, nextTick, defineExpose } from 'vue'
3
7
  import { VTextField } from 'vuetify/components/VTextField'
4
8
  import Datepicker from '@vuepic/vue-datepicker'
@@ -6,18 +10,26 @@ import '@vuepic/vue-datepicker/dist/main.css'
6
10
  import { Datetime } from '../../utils/datetime'
7
11
 
8
12
  interface Props extends /* @vue-ignore */ InstanceType<typeof VTextField['$props']> {
9
- enableSeconds?: boolean
10
- locale?: 'TH' | 'EN'
11
- pickerOnly?: boolean
12
- modelValue?: string | null
13
+ enableSeconds?: boolean // Includes seconds selector in the time picker.
14
+ locale?: 'TH' | 'EN' // Locale used for date/time formatting and localized labels.
15
+ pickerOnly?: boolean // forces value selection through picker interaction only
16
+ modelValue?: string | null // Bound value for v-model synchronization with the parent component.
13
17
  }
14
18
 
19
+ /**
20
+ * Public props accepted by FormTime.
21
+ * Document each prop field with intent, defaults, and side effects for clear generated docs.
22
+ */
15
23
  const props = withDefaults(defineProps<Props>(), {
16
24
  locale: 'TH',
17
25
  pickerOnly: false,
18
26
  enableSeconds: false,
19
27
  })
20
28
 
29
+ /**
30
+ * Custom events emitted by FormTime.
31
+ * Parents can listen to these events to react to user actions and internal state changes.
32
+ */
21
33
  const emit = defineEmits(['update:modelValue'])
22
34
 
23
35
  const time = ref<string | null>(null)