@ramathibodi/nuxt-commons 0.1.14 → 0.1.15
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/README.md +96 -96
- package/dist/module.json +1 -1
- package/dist/runtime/components/Alert.vue +53 -53
- package/dist/runtime/components/BarcodeReader.vue +98 -98
- package/dist/runtime/components/ExportCSV.vue +55 -55
- package/dist/runtime/components/FileBtn.vue +62 -62
- package/dist/runtime/components/ImportCSV.vue +64 -64
- package/dist/runtime/components/SplitterPanel.vue +59 -59
- package/dist/runtime/components/TabsGroup.vue +32 -32
- package/dist/runtime/components/TextBarcode.vue +52 -52
- package/dist/runtime/components/dialog/Confirm.vue +100 -100
- package/dist/runtime/components/dialog/Index.vue +72 -72
- package/dist/runtime/components/dialog/Loading.vue +39 -39
- package/dist/runtime/components/document/TemplateBuilder.vue +203 -216
- package/dist/runtime/components/form/Birthdate.vue +216 -216
- package/dist/runtime/components/form/CodeEditor.vue +37 -37
- package/dist/runtime/components/form/Date.vue +163 -163
- package/dist/runtime/components/form/DateTime.vue +107 -107
- package/dist/runtime/components/form/Dialog.vue +138 -138
- package/dist/runtime/components/form/File.vue +187 -187
- package/dist/runtime/components/form/Hidden.vue +32 -32
- package/dist/runtime/components/form/Login.vue +131 -131
- package/dist/runtime/components/form/Pad.vue +217 -217
- package/dist/runtime/components/form/SignPad.vue +186 -186
- package/dist/runtime/components/form/Table.vue +266 -266
- package/dist/runtime/components/form/Time.vue +158 -158
- package/dist/runtime/components/form/images/Capture.vue +230 -230
- package/dist/runtime/components/form/images/Edit.vue +114 -114
- package/dist/runtime/components/label/Date.vue +29 -29
- package/dist/runtime/components/label/Field.vue +42 -42
- package/dist/runtime/components/label/FormatMoney.vue +29 -29
- package/dist/runtime/components/label/Mask.vue +38 -38
- package/dist/runtime/components/master/Autocomplete.vue +159 -159
- package/dist/runtime/components/master/Combobox.vue +84 -84
- package/dist/runtime/components/master/RadioGroup.vue +78 -78
- package/dist/runtime/components/master/Select.vue +82 -82
- package/dist/runtime/components/model/Pad.vue +122 -122
- package/dist/runtime/components/model/Table.vue +242 -240
- package/dist/runtime/components/model/iterator.vue +312 -312
- package/dist/runtime/components/pdf/Print.vue +63 -63
- package/dist/runtime/components/pdf/View.vue +104 -104
- package/dist/runtime/composables/graphqlModel.mjs +1 -1
- package/dist/runtime/labs/Calendar.vue +99 -99
- package/dist/runtime/labs/form/EditMobile.vue +152 -152
- package/dist/runtime/labs/form/TextFieldMask.vue +43 -43
- package/dist/runtime/types/alert.d.ts +11 -11
- package/dist/runtime/types/formDialog.d.ts +4 -4
- package/dist/runtime/types/graphqlOperation.d.ts +23 -23
- package/dist/runtime/types/menu.d.ts +25 -25
- package/dist/runtime/types/modules.d.ts +7 -7
- package/package.json +120 -119
- package/scripts/postInstall.cjs +70 -70
- package/templates/.codegen/codegen.ts +32 -32
- package/templates/.codegen/plugin-schema-object.js +154 -154
|
@@ -1,186 +1,186 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { VueSignaturePad } from 'vue-signature-pad'
|
|
3
|
-
import { type Ref, ref, onMounted, onBeforeUnmount, withDefaults } from 'vue'
|
|
4
|
-
|
|
5
|
-
interface SignatureOptions {
|
|
6
|
-
penColor: string
|
|
7
|
-
minWidth?: number
|
|
8
|
-
maxWidth?: number
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
interface SignatureProps {
|
|
12
|
-
title?: string
|
|
13
|
-
titleConfirm?: string
|
|
14
|
-
modelValue: string
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const props = withDefaults(defineProps<SignatureProps>(), {
|
|
18
|
-
title: 'Draw Your Signature',
|
|
19
|
-
titleConfirm: 'I Accept My Signature',
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
const signaturePadRef: Ref<any> = ref(null)
|
|
23
|
-
const signatureData: Ref<string> = ref('')
|
|
24
|
-
const colorOptions: string[] = ['#303F9F', '#1A2023', '#2E7D32', '#AC04BF']
|
|
25
|
-
const defaultColor: string = colorOptions[0]
|
|
26
|
-
const selectedColor: Ref<string> = ref(defaultColor)
|
|
27
|
-
const signatureOptions: Ref<SignatureOptions> = ref({ penColor: defaultColor, minWidth: 0.5, maxWidth: 4 })
|
|
28
|
-
const isDialogOpen: Ref<boolean> = ref(false)
|
|
29
|
-
|
|
30
|
-
const undoSignature = (): void => {
|
|
31
|
-
signaturePadRef.value.undoSignature()
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const clearSignature = (): void => {
|
|
35
|
-
signaturePadRef.value.clearSignature()
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const closeDialog = (): void => {
|
|
39
|
-
isDialogOpen.value = false
|
|
40
|
-
signaturePadRef.value.clearSignature()
|
|
41
|
-
signaturePadRef.value.clearCacheImages()
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const emit = defineEmits<{
|
|
45
|
-
(event: 'update:modelValue', value: string): void
|
|
46
|
-
}>()
|
|
47
|
-
|
|
48
|
-
const saveSignature = (): void => {
|
|
49
|
-
isDialogOpen.value = false
|
|
50
|
-
const { isEmpty, data } = signaturePadRef.value.saveSignature()
|
|
51
|
-
signatureData.value = isEmpty ? '' : data
|
|
52
|
-
emit('update:modelValue', signatureData.value)
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
const changePenColor = (color: string): void => {
|
|
56
|
-
selectedColor.value = color
|
|
57
|
-
signatureOptions.value = { penColor: color }
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
const openSignatureDialog = (): void => {
|
|
61
|
-
selectedColor.value = defaultColor
|
|
62
|
-
signatureOptions.value = { penColor: defaultColor }
|
|
63
|
-
isDialogOpen.value = true
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const signaturePadHeight: Ref<string> = ref('')
|
|
67
|
-
const updateSignaturePadHeight = () => {
|
|
68
|
-
const screenHeight = window.innerHeight
|
|
69
|
-
signaturePadHeight.value = `${screenHeight * 0.4}px`
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
onMounted(() => {
|
|
73
|
-
updateSignaturePadHeight()
|
|
74
|
-
window.addEventListener('resize', updateSignaturePadHeight)
|
|
75
|
-
})
|
|
76
|
-
|
|
77
|
-
onBeforeUnmount(() => {
|
|
78
|
-
window.removeEventListener('resize', updateSignaturePadHeight)
|
|
79
|
-
})
|
|
80
|
-
</script>
|
|
81
|
-
|
|
82
|
-
<template>
|
|
83
|
-
<v-card
|
|
84
|
-
v-if="signatureData"
|
|
85
|
-
class="pa-2 mb-1"
|
|
86
|
-
color="grey-lighten-1"
|
|
87
|
-
variant="outlined"
|
|
88
|
-
@click="openSignatureDialog"
|
|
89
|
-
>
|
|
90
|
-
<v-img
|
|
91
|
-
:src="signatureData"
|
|
92
|
-
cover
|
|
93
|
-
/>
|
|
94
|
-
</v-card>
|
|
95
|
-
<v-btn
|
|
96
|
-
append-icon="mdi mdi-draw-pen"
|
|
97
|
-
block
|
|
98
|
-
class="text-none"
|
|
99
|
-
color="primary"
|
|
100
|
-
variant="flat"
|
|
101
|
-
@click="openSignatureDialog"
|
|
102
|
-
>
|
|
103
|
-
{{ props.title }}
|
|
104
|
-
</v-btn>
|
|
105
|
-
|
|
106
|
-
<v-dialog
|
|
107
|
-
v-model="isDialogOpen"
|
|
108
|
-
height="auto"
|
|
109
|
-
persistent
|
|
110
|
-
width="100%"
|
|
111
|
-
>
|
|
112
|
-
<v-card>
|
|
113
|
-
<v-toolbar>
|
|
114
|
-
<v-toolbar-title class="text-no-wrap">
|
|
115
|
-
{{ props.title }}
|
|
116
|
-
</v-toolbar-title>
|
|
117
|
-
<v-btn
|
|
118
|
-
icon
|
|
119
|
-
@click="undoSignature"
|
|
120
|
-
>
|
|
121
|
-
<v-icon>fa-solid fa-arrow-rotate-left</v-icon>
|
|
122
|
-
</v-btn>
|
|
123
|
-
<v-btn
|
|
124
|
-
icon
|
|
125
|
-
@click="clearSignature"
|
|
126
|
-
>
|
|
127
|
-
<v-icon>fa-solid fa-trash</v-icon>
|
|
128
|
-
</v-btn>
|
|
129
|
-
<v-menu>
|
|
130
|
-
<template #activator="{ props: activatorProps }">
|
|
131
|
-
<v-btn
|
|
132
|
-
:color="selectedColor"
|
|
133
|
-
:icon="true"
|
|
134
|
-
v-bind="activatorProps"
|
|
135
|
-
>
|
|
136
|
-
<v-icon>fa-solid fa-paintbrush</v-icon>
|
|
137
|
-
</v-btn>
|
|
138
|
-
</template>
|
|
139
|
-
<v-list>
|
|
140
|
-
<v-row>
|
|
141
|
-
<v-col class="text-center">
|
|
142
|
-
<v-avatar
|
|
143
|
-
v-for="(color, index) in colorOptions"
|
|
144
|
-
:key="index"
|
|
145
|
-
:color="color"
|
|
146
|
-
:value="color"
|
|
147
|
-
class="mr-1"
|
|
148
|
-
@click="changePenColor(color)"
|
|
149
|
-
>
|
|
150
|
-
<v-icon color="white">
|
|
151
|
-
{{ selectedColor === color ? 'fa-solid fa-check' : '' }}
|
|
152
|
-
</v-icon>
|
|
153
|
-
</v-avatar>
|
|
154
|
-
</v-col>
|
|
155
|
-
</v-row>
|
|
156
|
-
</v-list>
|
|
157
|
-
</v-menu>
|
|
158
|
-
<v-btn
|
|
159
|
-
icon
|
|
160
|
-
@click="closeDialog"
|
|
161
|
-
>
|
|
162
|
-
<v-icon>fa-solid fa-xmark</v-icon>
|
|
163
|
-
</v-btn>
|
|
164
|
-
</v-toolbar>
|
|
165
|
-
<v-card-text>
|
|
166
|
-
<VueSignaturePad
|
|
167
|
-
ref="signaturePadRef"
|
|
168
|
-
:options="signatureOptions"
|
|
169
|
-
:height="signaturePadHeight"
|
|
170
|
-
/>
|
|
171
|
-
</v-card-text>
|
|
172
|
-
<v-divider />
|
|
173
|
-
<v-card-actions class="justify-center">
|
|
174
|
-
<v-btn
|
|
175
|
-
class="text-none"
|
|
176
|
-
color="success"
|
|
177
|
-
prepend-icon="fa-solid fa-check"
|
|
178
|
-
variant="flat"
|
|
179
|
-
@click="saveSignature"
|
|
180
|
-
>
|
|
181
|
-
{{ props.titleConfirm }}
|
|
182
|
-
</v-btn>
|
|
183
|
-
</v-card-actions>
|
|
184
|
-
</v-card>
|
|
185
|
-
</v-dialog>
|
|
186
|
-
</template>
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { VueSignaturePad } from 'vue-signature-pad'
|
|
3
|
+
import { type Ref, ref, onMounted, onBeforeUnmount, withDefaults } from 'vue'
|
|
4
|
+
|
|
5
|
+
interface SignatureOptions {
|
|
6
|
+
penColor: string
|
|
7
|
+
minWidth?: number
|
|
8
|
+
maxWidth?: number
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
interface SignatureProps {
|
|
12
|
+
title?: string
|
|
13
|
+
titleConfirm?: string
|
|
14
|
+
modelValue: string
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const props = withDefaults(defineProps<SignatureProps>(), {
|
|
18
|
+
title: 'Draw Your Signature',
|
|
19
|
+
titleConfirm: 'I Accept My Signature',
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
const signaturePadRef: Ref<any> = ref(null)
|
|
23
|
+
const signatureData: Ref<string> = ref('')
|
|
24
|
+
const colorOptions: string[] = ['#303F9F', '#1A2023', '#2E7D32', '#AC04BF']
|
|
25
|
+
const defaultColor: string = colorOptions[0]
|
|
26
|
+
const selectedColor: Ref<string> = ref(defaultColor)
|
|
27
|
+
const signatureOptions: Ref<SignatureOptions> = ref({ penColor: defaultColor, minWidth: 0.5, maxWidth: 4 })
|
|
28
|
+
const isDialogOpen: Ref<boolean> = ref(false)
|
|
29
|
+
|
|
30
|
+
const undoSignature = (): void => {
|
|
31
|
+
signaturePadRef.value.undoSignature()
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const clearSignature = (): void => {
|
|
35
|
+
signaturePadRef.value.clearSignature()
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const closeDialog = (): void => {
|
|
39
|
+
isDialogOpen.value = false
|
|
40
|
+
signaturePadRef.value.clearSignature()
|
|
41
|
+
signaturePadRef.value.clearCacheImages()
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const emit = defineEmits<{
|
|
45
|
+
(event: 'update:modelValue', value: string): void
|
|
46
|
+
}>()
|
|
47
|
+
|
|
48
|
+
const saveSignature = (): void => {
|
|
49
|
+
isDialogOpen.value = false
|
|
50
|
+
const { isEmpty, data } = signaturePadRef.value.saveSignature()
|
|
51
|
+
signatureData.value = isEmpty ? '' : data
|
|
52
|
+
emit('update:modelValue', signatureData.value)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const changePenColor = (color: string): void => {
|
|
56
|
+
selectedColor.value = color
|
|
57
|
+
signatureOptions.value = { penColor: color }
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const openSignatureDialog = (): void => {
|
|
61
|
+
selectedColor.value = defaultColor
|
|
62
|
+
signatureOptions.value = { penColor: defaultColor }
|
|
63
|
+
isDialogOpen.value = true
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const signaturePadHeight: Ref<string> = ref('')
|
|
67
|
+
const updateSignaturePadHeight = () => {
|
|
68
|
+
const screenHeight = window.innerHeight
|
|
69
|
+
signaturePadHeight.value = `${screenHeight * 0.4}px`
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
onMounted(() => {
|
|
73
|
+
updateSignaturePadHeight()
|
|
74
|
+
window.addEventListener('resize', updateSignaturePadHeight)
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
onBeforeUnmount(() => {
|
|
78
|
+
window.removeEventListener('resize', updateSignaturePadHeight)
|
|
79
|
+
})
|
|
80
|
+
</script>
|
|
81
|
+
|
|
82
|
+
<template>
|
|
83
|
+
<v-card
|
|
84
|
+
v-if="signatureData"
|
|
85
|
+
class="pa-2 mb-1"
|
|
86
|
+
color="grey-lighten-1"
|
|
87
|
+
variant="outlined"
|
|
88
|
+
@click="openSignatureDialog"
|
|
89
|
+
>
|
|
90
|
+
<v-img
|
|
91
|
+
:src="signatureData"
|
|
92
|
+
cover
|
|
93
|
+
/>
|
|
94
|
+
</v-card>
|
|
95
|
+
<v-btn
|
|
96
|
+
append-icon="mdi mdi-draw-pen"
|
|
97
|
+
block
|
|
98
|
+
class="text-none"
|
|
99
|
+
color="primary"
|
|
100
|
+
variant="flat"
|
|
101
|
+
@click="openSignatureDialog"
|
|
102
|
+
>
|
|
103
|
+
{{ props.title }}
|
|
104
|
+
</v-btn>
|
|
105
|
+
|
|
106
|
+
<v-dialog
|
|
107
|
+
v-model="isDialogOpen"
|
|
108
|
+
height="auto"
|
|
109
|
+
persistent
|
|
110
|
+
width="100%"
|
|
111
|
+
>
|
|
112
|
+
<v-card>
|
|
113
|
+
<v-toolbar>
|
|
114
|
+
<v-toolbar-title class="text-no-wrap">
|
|
115
|
+
{{ props.title }}
|
|
116
|
+
</v-toolbar-title>
|
|
117
|
+
<v-btn
|
|
118
|
+
icon
|
|
119
|
+
@click="undoSignature"
|
|
120
|
+
>
|
|
121
|
+
<v-icon>fa-solid fa-arrow-rotate-left</v-icon>
|
|
122
|
+
</v-btn>
|
|
123
|
+
<v-btn
|
|
124
|
+
icon
|
|
125
|
+
@click="clearSignature"
|
|
126
|
+
>
|
|
127
|
+
<v-icon>fa-solid fa-trash</v-icon>
|
|
128
|
+
</v-btn>
|
|
129
|
+
<v-menu>
|
|
130
|
+
<template #activator="{ props: activatorProps }">
|
|
131
|
+
<v-btn
|
|
132
|
+
:color="selectedColor"
|
|
133
|
+
:icon="true"
|
|
134
|
+
v-bind="activatorProps"
|
|
135
|
+
>
|
|
136
|
+
<v-icon>fa-solid fa-paintbrush</v-icon>
|
|
137
|
+
</v-btn>
|
|
138
|
+
</template>
|
|
139
|
+
<v-list>
|
|
140
|
+
<v-row>
|
|
141
|
+
<v-col class="text-center">
|
|
142
|
+
<v-avatar
|
|
143
|
+
v-for="(color, index) in colorOptions"
|
|
144
|
+
:key="index"
|
|
145
|
+
:color="color"
|
|
146
|
+
:value="color"
|
|
147
|
+
class="mr-1"
|
|
148
|
+
@click="changePenColor(color)"
|
|
149
|
+
>
|
|
150
|
+
<v-icon color="white">
|
|
151
|
+
{{ selectedColor === color ? 'fa-solid fa-check' : '' }}
|
|
152
|
+
</v-icon>
|
|
153
|
+
</v-avatar>
|
|
154
|
+
</v-col>
|
|
155
|
+
</v-row>
|
|
156
|
+
</v-list>
|
|
157
|
+
</v-menu>
|
|
158
|
+
<v-btn
|
|
159
|
+
icon
|
|
160
|
+
@click="closeDialog"
|
|
161
|
+
>
|
|
162
|
+
<v-icon>fa-solid fa-xmark</v-icon>
|
|
163
|
+
</v-btn>
|
|
164
|
+
</v-toolbar>
|
|
165
|
+
<v-card-text>
|
|
166
|
+
<VueSignaturePad
|
|
167
|
+
ref="signaturePadRef"
|
|
168
|
+
:options="signatureOptions"
|
|
169
|
+
:height="signaturePadHeight"
|
|
170
|
+
/>
|
|
171
|
+
</v-card-text>
|
|
172
|
+
<v-divider />
|
|
173
|
+
<v-card-actions class="justify-center">
|
|
174
|
+
<v-btn
|
|
175
|
+
class="text-none"
|
|
176
|
+
color="success"
|
|
177
|
+
prepend-icon="fa-solid fa-check"
|
|
178
|
+
variant="flat"
|
|
179
|
+
@click="saveSignature"
|
|
180
|
+
>
|
|
181
|
+
{{ props.titleConfirm }}
|
|
182
|
+
</v-btn>
|
|
183
|
+
</v-card-actions>
|
|
184
|
+
</v-card>
|
|
185
|
+
</v-dialog>
|
|
186
|
+
</template>
|