@ramathibodi/nuxt-commons 0.1.14 → 0.1.16

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 (54) hide show
  1. package/README.md +96 -96
  2. package/dist/module.json +1 -1
  3. package/dist/runtime/components/Alert.vue +53 -53
  4. package/dist/runtime/components/BarcodeReader.vue +98 -98
  5. package/dist/runtime/components/ExportCSV.vue +55 -55
  6. package/dist/runtime/components/FileBtn.vue +62 -62
  7. package/dist/runtime/components/ImportCSV.vue +64 -64
  8. package/dist/runtime/components/SplitterPanel.vue +59 -59
  9. package/dist/runtime/components/TabsGroup.vue +32 -32
  10. package/dist/runtime/components/TextBarcode.vue +52 -52
  11. package/dist/runtime/components/dialog/Confirm.vue +100 -100
  12. package/dist/runtime/components/dialog/Index.vue +72 -72
  13. package/dist/runtime/components/dialog/Loading.vue +39 -39
  14. package/dist/runtime/components/document/TemplateBuilder.vue +203 -216
  15. package/dist/runtime/components/form/Birthdate.vue +216 -216
  16. package/dist/runtime/components/form/CodeEditor.vue +37 -37
  17. package/dist/runtime/components/form/Date.vue +163 -163
  18. package/dist/runtime/components/form/DateTime.vue +107 -107
  19. package/dist/runtime/components/form/Dialog.vue +138 -138
  20. package/dist/runtime/components/form/File.vue +187 -187
  21. package/dist/runtime/components/form/Hidden.vue +32 -32
  22. package/dist/runtime/components/form/Login.vue +131 -131
  23. package/dist/runtime/components/form/Pad.vue +217 -217
  24. package/dist/runtime/components/form/SignPad.vue +186 -186
  25. package/dist/runtime/components/form/Table.vue +294 -266
  26. package/dist/runtime/components/form/Time.vue +158 -158
  27. package/dist/runtime/components/form/images/Capture.vue +230 -230
  28. package/dist/runtime/components/form/images/Edit.vue +114 -114
  29. package/dist/runtime/components/label/Date.vue +29 -29
  30. package/dist/runtime/components/label/Field.vue +42 -42
  31. package/dist/runtime/components/label/FormatMoney.vue +29 -29
  32. package/dist/runtime/components/label/Mask.vue +38 -38
  33. package/dist/runtime/components/master/Autocomplete.vue +159 -159
  34. package/dist/runtime/components/master/Combobox.vue +84 -84
  35. package/dist/runtime/components/master/RadioGroup.vue +78 -78
  36. package/dist/runtime/components/master/Select.vue +82 -82
  37. package/dist/runtime/components/model/Pad.vue +122 -122
  38. package/dist/runtime/components/model/Table.vue +242 -240
  39. package/dist/runtime/components/model/iterator.vue +312 -312
  40. package/dist/runtime/components/pdf/Print.vue +63 -63
  41. package/dist/runtime/components/pdf/View.vue +104 -104
  42. package/dist/runtime/composables/graphqlModel.mjs +1 -1
  43. package/dist/runtime/labs/Calendar.vue +99 -99
  44. package/dist/runtime/labs/form/EditMobile.vue +152 -152
  45. package/dist/runtime/labs/form/TextFieldMask.vue +43 -43
  46. package/dist/runtime/types/alert.d.ts +11 -11
  47. package/dist/runtime/types/formDialog.d.ts +4 -4
  48. package/dist/runtime/types/graphqlOperation.d.ts +23 -23
  49. package/dist/runtime/types/menu.d.ts +25 -25
  50. package/dist/runtime/types/modules.d.ts +7 -7
  51. package/package.json +120 -119
  52. package/scripts/postInstall.cjs +70 -70
  53. package/templates/.codegen/codegen.ts +32 -32
  54. package/templates/.codegen/plugin-schema-object.js +161 -154
@@ -1,100 +1,100 @@
1
- <script lang="ts" setup>
2
- import { type Ref, ref, watch, computed } from 'vue'
3
- import { isEqual, isUndefined, isEmpty } from 'lodash-es'
4
-
5
- interface DialogProps {
6
- title?: string
7
- modelValue: boolean
8
- message?: string
9
- buttonTrueText?: string
10
- buttonFalseText?: string
11
- type?: 'primary' | 'success' | 'warning' | 'info' | 'error'
12
- confirmData?: string
13
- width?: string
14
- }
15
-
16
- const props = withDefaults(defineProps<DialogProps>(), {
17
- title: 'ยืนยัน',
18
- message: 'ยืนยันทำรายการนี้',
19
- buttonTrueText: 'ตกลง',
20
- buttonFalseText: 'ยกเลิก',
21
- width: 'auto',
22
- })
23
-
24
- const emit = defineEmits<{
25
- (e: 'update:result', value: boolean): void
26
- (e: 'update:modelValue', value: boolean): void
27
- }>()
28
-
29
- const dialogVisible: Ref<boolean> = ref(false)
30
- dialogVisible.value = props.modelValue
31
- watch(
32
- () => props.modelValue,
33
- () => {
34
- dialogVisible.value = props.modelValue
35
- },
36
- )
37
-
38
- const txtConfirm = ref<string>()
39
-
40
- const isDisabled = computed(() => {
41
- if (isUndefined(props.confirmData)) return false
42
- if (isEmpty(props.confirmData)) return true
43
- return props.confirmData ? !isEqual(txtConfirm.value, props.confirmData) : false
44
- })
45
-
46
- const handleResult = (result: boolean) => {
47
- dialogVisible.value = false
48
- emit('update:modelValue', dialogVisible.value)
49
- emit('update:result', result)
50
- txtConfirm.value = ''
51
- }
52
- </script>
53
-
54
- <template>
55
- <v-row justify="center">
56
- <v-dialog
57
- v-model="dialogVisible"
58
- persistent
59
- :width="props.width"
60
- >
61
- <v-card>
62
- <v-toolbar
63
- :color="props.type"
64
- :title="props.title"
65
- />
66
- <v-card-text>{{ props.message }}</v-card-text>
67
- <v-card-text v-if="props.confirmData">
68
- <v-text-field
69
- v-model="txtConfirm"
70
- variant="underlined"
71
- >
72
- <template #label>
73
- <slot
74
- name="labelTextConfirm"
75
- :text="props.confirmData"
76
- />
77
- </template>
78
- </v-text-field>
79
- </v-card-text>
80
- <v-card-actions>
81
- <v-spacer />
82
- <v-btn
83
- variant="text"
84
- @click="handleResult(false)"
85
- >
86
- {{ props.buttonFalseText }}
87
- </v-btn>
88
- <v-btn
89
- :color="props.type"
90
- variant="text"
91
- :disabled="isDisabled"
92
- @click="handleResult(true)"
93
- >
94
- {{ props.buttonTrueText }}
95
- </v-btn>
96
- </v-card-actions>
97
- </v-card>
98
- </v-dialog>
99
- </v-row>
100
- </template>
1
+ <script lang="ts" setup>
2
+ import { type Ref, ref, watch, computed } from 'vue'
3
+ import { isEqual, isUndefined, isEmpty } from 'lodash-es'
4
+
5
+ interface DialogProps {
6
+ title?: string
7
+ modelValue: boolean
8
+ message?: string
9
+ buttonTrueText?: string
10
+ buttonFalseText?: string
11
+ type?: 'primary' | 'success' | 'warning' | 'info' | 'error'
12
+ confirmData?: string
13
+ width?: string
14
+ }
15
+
16
+ const props = withDefaults(defineProps<DialogProps>(), {
17
+ title: 'ยืนยัน',
18
+ message: 'ยืนยันทำรายการนี้',
19
+ buttonTrueText: 'ตกลง',
20
+ buttonFalseText: 'ยกเลิก',
21
+ width: 'auto',
22
+ })
23
+
24
+ const emit = defineEmits<{
25
+ (e: 'update:result', value: boolean): void
26
+ (e: 'update:modelValue', value: boolean): void
27
+ }>()
28
+
29
+ const dialogVisible: Ref<boolean> = ref(false)
30
+ dialogVisible.value = props.modelValue
31
+ watch(
32
+ () => props.modelValue,
33
+ () => {
34
+ dialogVisible.value = props.modelValue
35
+ },
36
+ )
37
+
38
+ const txtConfirm = ref<string>()
39
+
40
+ const isDisabled = computed(() => {
41
+ if (isUndefined(props.confirmData)) return false
42
+ if (isEmpty(props.confirmData)) return true
43
+ return props.confirmData ? !isEqual(txtConfirm.value, props.confirmData) : false
44
+ })
45
+
46
+ const handleResult = (result: boolean) => {
47
+ dialogVisible.value = false
48
+ emit('update:modelValue', dialogVisible.value)
49
+ emit('update:result', result)
50
+ txtConfirm.value = ''
51
+ }
52
+ </script>
53
+
54
+ <template>
55
+ <v-row justify="center">
56
+ <v-dialog
57
+ v-model="dialogVisible"
58
+ persistent
59
+ :width="props.width"
60
+ >
61
+ <v-card>
62
+ <v-toolbar
63
+ :color="props.type"
64
+ :title="props.title"
65
+ />
66
+ <v-card-text>{{ props.message }}</v-card-text>
67
+ <v-card-text v-if="props.confirmData">
68
+ <v-text-field
69
+ v-model="txtConfirm"
70
+ variant="underlined"
71
+ >
72
+ <template #label>
73
+ <slot
74
+ name="labelTextConfirm"
75
+ :text="props.confirmData"
76
+ />
77
+ </template>
78
+ </v-text-field>
79
+ </v-card-text>
80
+ <v-card-actions>
81
+ <v-spacer />
82
+ <v-btn
83
+ variant="text"
84
+ @click="handleResult(false)"
85
+ >
86
+ {{ props.buttonFalseText }}
87
+ </v-btn>
88
+ <v-btn
89
+ :color="props.type"
90
+ variant="text"
91
+ :disabled="isDisabled"
92
+ @click="handleResult(true)"
93
+ >
94
+ {{ props.buttonTrueText }}
95
+ </v-btn>
96
+ </v-card-actions>
97
+ </v-card>
98
+ </v-dialog>
99
+ </v-row>
100
+ </template>
@@ -1,72 +1,72 @@
1
- <script lang="ts" setup>
2
- import { computed } from 'vue'
3
-
4
- interface DialogProps {
5
- modelValue?: boolean
6
- title?: string
7
- message?: string
8
- type?: 'success' | 'error' | 'warning' | 'info'
9
- width?: number | string
10
- }
11
-
12
- const props = defineProps<DialogProps>()
13
- const emit = defineEmits(['update:modelValue'])
14
-
15
- const dialogIcon = computed(() => {
16
- switch (props.type) {
17
- case 'success':
18
- return 'mdi mdi-check-circle'
19
- case 'error':
20
- return 'mdi mdi-alert-circle'
21
- case 'warning':
22
- return 'mdi mdi-alert'
23
- case 'info':
24
- return 'mdi mdi-information-variant-circle'
25
- default:
26
- return ''
27
- }
28
- })
29
- </script>
30
-
31
- <template>
32
- <VDialog
33
- :model-value="modelValue"
34
- :width="width"
35
- max-width="800"
36
- @update:model-value="emit('update:modelValue', false)"
37
- >
38
- <VCard>
39
- <VToolbar :color="type">
40
- <VToolbarTitle>
41
- <VIcon :icon="dialogIcon" />
42
- {{ title }}
43
- </VToolbarTitle>
44
- <VBtn
45
- icon="mdi mdi-close"
46
- size="x-small"
47
- @click="emit('update:modelValue', false)"
48
- />
49
- </VToolbar>
50
- <VCardText>
51
- <slot>
52
- {{ message }}
53
- </slot>
54
- </VCardText>
55
- <VDivider />
56
- <VCardActions>
57
- <VBtn
58
- :color="type"
59
- block
60
- class="ma-auto"
61
- @click="emit('update:modelValue', false)"
62
- >
63
- ตกลง
64
- </VBtn>
65
- </VCardActions>
66
- </VCard>
67
- </VDialog>
68
- </template>
69
-
70
- <style lang="">
71
-
72
- </style>
1
+ <script lang="ts" setup>
2
+ import { computed } from 'vue'
3
+
4
+ interface DialogProps {
5
+ modelValue?: boolean
6
+ title?: string
7
+ message?: string
8
+ type?: 'success' | 'error' | 'warning' | 'info'
9
+ width?: number | string
10
+ }
11
+
12
+ const props = defineProps<DialogProps>()
13
+ const emit = defineEmits(['update:modelValue'])
14
+
15
+ const dialogIcon = computed(() => {
16
+ switch (props.type) {
17
+ case 'success':
18
+ return 'mdi mdi-check-circle'
19
+ case 'error':
20
+ return 'mdi mdi-alert-circle'
21
+ case 'warning':
22
+ return 'mdi mdi-alert'
23
+ case 'info':
24
+ return 'mdi mdi-information-variant-circle'
25
+ default:
26
+ return ''
27
+ }
28
+ })
29
+ </script>
30
+
31
+ <template>
32
+ <VDialog
33
+ :model-value="modelValue"
34
+ :width="width"
35
+ max-width="800"
36
+ @update:model-value="emit('update:modelValue', false)"
37
+ >
38
+ <VCard>
39
+ <VToolbar :color="type">
40
+ <VToolbarTitle>
41
+ <VIcon :icon="dialogIcon" />
42
+ {{ title }}
43
+ </VToolbarTitle>
44
+ <VBtn
45
+ icon="mdi mdi-close"
46
+ size="x-small"
47
+ @click="emit('update:modelValue', false)"
48
+ />
49
+ </VToolbar>
50
+ <VCardText>
51
+ <slot>
52
+ {{ message }}
53
+ </slot>
54
+ </VCardText>
55
+ <VDivider />
56
+ <VCardActions>
57
+ <VBtn
58
+ :color="type"
59
+ block
60
+ class="ma-auto"
61
+ @click="emit('update:modelValue', false)"
62
+ >
63
+ ตกลง
64
+ </VBtn>
65
+ </VCardActions>
66
+ </VCard>
67
+ </VDialog>
68
+ </template>
69
+
70
+ <style lang="">
71
+
72
+ </style>
@@ -1,39 +1,39 @@
1
- <script setup lang="ts">
2
- import { ref, watch } from 'vue'
3
-
4
- interface DialogProps {
5
- modelValue: boolean
6
- color?: string
7
- }
8
- const emit = defineEmits(['update:modelValue'])
9
-
10
- const props = defineProps<DialogProps>()
11
- const dialogVisible = ref<boolean>(props.modelValue)
12
-
13
- watch(() => props.modelValue, (newValue) => {
14
- dialogVisible.value = newValue
15
- })
16
-
17
- watch(() => dialogVisible.value, (newValue) => {
18
- emit('update:modelValue', newValue)
19
- })
20
- </script>
21
-
22
- <template>
23
- <v-dialog
24
- v-model="dialogVisible"
25
- persistent
26
- max-width="500"
27
- >
28
- <v-card :color="props.color">
29
- <v-card-text>
30
- <v-row>
31
- <v-col class="text-center">
32
- <slot>กรุณารอสักครู่</slot>
33
- </v-col>
34
- </v-row>
35
- </v-card-text>
36
- <v-progress-linear indeterminate />
37
- </v-card>
38
- </v-dialog>
39
- </template>
1
+ <script setup lang="ts">
2
+ import { ref, watch } from 'vue'
3
+
4
+ interface DialogProps {
5
+ modelValue: boolean
6
+ color?: string
7
+ }
8
+ const emit = defineEmits(['update:modelValue'])
9
+
10
+ const props = defineProps<DialogProps>()
11
+ const dialogVisible = ref<boolean>(props.modelValue)
12
+
13
+ watch(() => props.modelValue, (newValue) => {
14
+ dialogVisible.value = newValue
15
+ })
16
+
17
+ watch(() => dialogVisible.value, (newValue) => {
18
+ emit('update:modelValue', newValue)
19
+ })
20
+ </script>
21
+
22
+ <template>
23
+ <v-dialog
24
+ v-model="dialogVisible"
25
+ persistent
26
+ max-width="500"
27
+ >
28
+ <v-card :color="props.color">
29
+ <v-card-text>
30
+ <v-row>
31
+ <v-col class="text-center">
32
+ <slot>กรุณารอสักครู่</slot>
33
+ </v-col>
34
+ </v-row>
35
+ </v-card-text>
36
+ <v-progress-linear indeterminate />
37
+ </v-card>
38
+ </v-dialog>
39
+ </template>