@ramathibodi/nuxt-commons 0.1.73 → 0.1.75
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 +115 -96
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -0
- package/dist/runtime/components/Alert.vue +58 -54
- package/dist/runtime/components/BarcodeReader.vue +130 -122
- package/dist/runtime/components/ExportCSV.vue +110 -102
- package/dist/runtime/components/FileBtn.vue +79 -67
- package/dist/runtime/components/ImportCSV.vue +151 -139
- package/dist/runtime/components/MrzReader.vue +168 -0
- package/dist/runtime/components/SplitterPanel.vue +67 -59
- package/dist/runtime/components/TabsGroup.vue +39 -31
- package/dist/runtime/components/TextBarcode.vue +66 -54
- package/dist/runtime/components/device/IdCardButton.vue +95 -83
- package/dist/runtime/components/device/IdCardWebSocket.vue +207 -195
- package/dist/runtime/components/device/Scanner.vue +350 -338
- package/dist/runtime/components/dialog/Confirm.vue +112 -100
- package/dist/runtime/components/dialog/Host.vue +88 -84
- package/dist/runtime/components/dialog/Index.vue +84 -72
- package/dist/runtime/components/dialog/Loading.vue +51 -39
- package/dist/runtime/components/dialog/default/Confirm.vue +112 -100
- package/dist/runtime/components/dialog/default/Loading.vue +60 -48
- package/dist/runtime/components/dialog/default/Notify.vue +82 -70
- package/dist/runtime/components/dialog/default/Printing.vue +46 -34
- package/dist/runtime/components/dialog/default/VerifyUser.vue +144 -132
- package/dist/runtime/components/document/Form.vue +50 -42
- package/dist/runtime/components/document/TemplateBuilder.vue +536 -524
- package/dist/runtime/components/form/ActionPad.vue +156 -144
- package/dist/runtime/components/form/Birthdate.vue +116 -104
- package/dist/runtime/components/form/CheckboxGroup.vue +99 -87
- package/dist/runtime/components/form/CodeEditor.vue +45 -37
- package/dist/runtime/components/form/Date.vue +270 -258
- package/dist/runtime/components/form/DateTime.vue +220 -208
- package/dist/runtime/components/form/Dialog.vue +178 -166
- package/dist/runtime/components/form/EditPad.vue +157 -145
- package/dist/runtime/components/form/File.vue +295 -283
- package/dist/runtime/components/form/Hidden.vue +44 -32
- package/dist/runtime/components/form/Iterator.vue +538 -526
- package/dist/runtime/components/form/Login.vue +143 -131
- package/dist/runtime/components/form/Pad.vue +399 -387
- package/dist/runtime/components/form/SignPad.vue +226 -218
- package/dist/runtime/components/form/System.vue +34 -26
- package/dist/runtime/components/form/Table.vue +391 -379
- package/dist/runtime/components/form/TableData.vue +236 -224
- package/dist/runtime/components/form/Time.vue +177 -165
- package/dist/runtime/components/form/images/Capture.vue +245 -237
- package/dist/runtime/components/form/images/Edit.vue +133 -121
- package/dist/runtime/components/form/images/Field.vue +331 -320
- package/dist/runtime/components/form/images/Pad.vue +54 -42
- package/dist/runtime/components/label/Date.vue +37 -29
- package/dist/runtime/components/label/DateAgo.vue +102 -94
- package/dist/runtime/components/label/DateCount.vue +152 -144
- package/dist/runtime/components/label/Field.vue +111 -103
- package/dist/runtime/components/label/FormatMoney.vue +37 -29
- package/dist/runtime/components/label/Mask.vue +46 -38
- package/dist/runtime/components/label/Object.vue +21 -13
- package/dist/runtime/components/master/Autocomplete.vue +89 -81
- package/dist/runtime/components/master/Combobox.vue +88 -80
- package/dist/runtime/components/master/RadioGroup.vue +90 -78
- package/dist/runtime/components/master/Select.vue +70 -62
- package/dist/runtime/components/master/label.vue +55 -47
- package/dist/runtime/components/model/Autocomplete.vue +91 -79
- package/dist/runtime/components/model/Combobox.vue +90 -78
- package/dist/runtime/components/model/Pad.vue +114 -102
- package/dist/runtime/components/model/Select.vue +78 -72
- package/dist/runtime/components/model/Table.vue +370 -358
- package/dist/runtime/components/model/iterator.vue +497 -489
- package/dist/runtime/components/model/label.vue +58 -50
- package/dist/runtime/components/pdf/Print.vue +75 -63
- package/dist/runtime/components/pdf/View.vue +146 -134
- package/dist/runtime/composables/alert.d.ts +4 -0
- package/dist/runtime/composables/api.d.ts +4 -0
- package/dist/runtime/composables/dialog.d.ts +1 -1
- package/dist/runtime/composables/document/templateFormHidden.d.ts +4 -0
- package/dist/runtime/composables/graphql.d.ts +1 -1
- package/dist/runtime/composables/graphqlModel.d.ts +9 -9
- package/dist/runtime/composables/graphqlModelItem.d.ts +7 -7
- package/dist/runtime/composables/graphqlModelOperation.d.ts +6 -6
- package/dist/runtime/composables/localStorageModel.d.ts +4 -0
- package/dist/runtime/composables/lookupList.d.ts +4 -0
- package/dist/runtime/composables/menu.d.ts +4 -0
- package/dist/runtime/composables/useMrzReader.d.ts +48 -0
- package/dist/runtime/composables/useMrzReader.js +423 -0
- package/dist/runtime/composables/useTesseract.d.ts +16 -0
- package/dist/runtime/composables/useTesseract.js +45 -0
- package/dist/runtime/composables/userPermission.d.ts +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/plugins/clientConfig.d.ts +1 -1
- package/dist/runtime/plugins/default.d.ts +1 -1
- package/dist/runtime/plugins/dialogManager.d.ts +1 -1
- package/dist/runtime/plugins/permission.d.ts +1 -1
- package/dist/runtime/types/alert.d.ts +11 -11
- package/dist/runtime/types/clientConfig.d.ts +13 -13
- package/dist/runtime/types/dialogManager.d.ts +35 -35
- package/dist/runtime/types/formDialog.d.ts +5 -5
- package/dist/runtime/types/graphqlOperation.d.ts +23 -23
- package/dist/runtime/types/menu.d.ts +31 -31
- package/dist/runtime/types/modules.d.ts +7 -7
- package/dist/runtime/types/permission.d.ts +13 -13
- package/dist/runtime/utils/asset.d.ts +2 -0
- package/dist/runtime/utils/asset.js +49 -0
- package/package.json +131 -122
- package/scripts/enrich-vue-docs-from-ai.mjs +197 -0
- package/scripts/generate-ai-summary.mjs +321 -0
- package/scripts/generate-composables-md.mjs +129 -0
- package/scripts/postInstall.cjs +70 -70
- package/templates/.codegen/codegen.ts +32 -32
- package/templates/.codegen/plugin-schema-object.js +161 -161
- package/templates/public/tesseract/mrz.traineddata.gz +0 -0
- package/templates/public/tesseract/ocrb.traineddata.gz +0 -0
|
@@ -1,50 +1,58 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
/**
|
|
3
|
+
* ModelLabel connects model metadata to reusable selection, labeling, iterator, or table UI patterns.
|
|
4
|
+
* This doc block is consumed by vue-docgen for generated API documentation.
|
|
5
|
+
*/
|
|
6
|
+
import { computedAsync } from '@vueuse/core'
|
|
7
|
+
import { useGraphQlOperation } from '../../composables/graphqlOperation'
|
|
8
|
+
import { concat } from "lodash-es";
|
|
9
|
+
import { ref } from 'vue'
|
|
10
|
+
|
|
11
|
+
interface Props {
|
|
12
|
+
modelName: string // GraphQL model name used to resolve lookup/query metadata.
|
|
13
|
+
modelBy?: object // Key/value filter used to fetch a specific model item.
|
|
14
|
+
itemTitle: string | ((result:Record<string,any>)=>void) // Field name or mapper function used to build display labels.
|
|
15
|
+
fields?: Array<string | object> // Field list/query selection used when fetching model or lookup data.
|
|
16
|
+
cache?: boolean | number // Enables cached requests; number values represent cache TTL in milliseconds.
|
|
17
|
+
|
|
18
|
+
notFoundText?: string // Text shown when the resolved value or label is unavailable.
|
|
19
|
+
placeholder?: string // placeholder text shown when value is empty
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Public props accepted by ModelLabel.
|
|
24
|
+
* Document each prop field with intent, defaults, and side effects for clear generated docs.
|
|
25
|
+
*/
|
|
26
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
27
|
+
cache: false,
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
const modelItem = ref<Record<string, any>>({})
|
|
31
|
+
|
|
32
|
+
const modelItemValue = computedAsync<string>(async () => {
|
|
33
|
+
if (props.modelName && props.itemTitle) {
|
|
34
|
+
let fields: any[] = (typeof props.itemTitle === "string") ? [props.itemTitle] : []
|
|
35
|
+
if (props.fields) fields = concat(fields, props.fields)
|
|
36
|
+
|
|
37
|
+
const variables: Record<string, any> = Object.assign({},props.modelBy)
|
|
38
|
+
const result : Record<string, any> = await useGraphQlOperation('Query',props.modelName,fields,variables,props.cache)
|
|
39
|
+
|
|
40
|
+
try {
|
|
41
|
+
if (result) {
|
|
42
|
+
modelItem.value = result
|
|
43
|
+
if (typeof props.itemTitle === "string") return result[props.itemTitle]
|
|
44
|
+
else return props.itemTitle(result)
|
|
45
|
+
}
|
|
46
|
+
} catch (e) {
|
|
47
|
+
console.error(e)
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return props.notFoundText
|
|
51
|
+
}, props.placeholder ?? '' )
|
|
52
|
+
</script>
|
|
53
|
+
|
|
54
|
+
<template>
|
|
55
|
+
<slot name="default" :data="modelItem">
|
|
56
|
+
<span>{{ modelItemValue }}</span>
|
|
57
|
+
</slot>
|
|
58
|
+
</template>
|
|
@@ -1,63 +1,75 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* PdfPrint renders a print-oriented PDF view and handles browser print lifecycle events.
|
|
4
|
+
* This doc block is consumed by vue-docgen for generated API documentation.
|
|
5
|
+
*/
|
|
6
|
+
import printJS from 'print-js'
|
|
7
|
+
import { ref, watch } from 'vue'
|
|
8
|
+
import { useAlert } from '../../composables/alert'
|
|
9
|
+
|
|
10
|
+
interface Props {
|
|
11
|
+
base64String?: string // Base64 document payload used as the PDF source.
|
|
12
|
+
fileName?: string // File name used when downloading or printing generated files.
|
|
13
|
+
print?: boolean // When true, starts printing automatically after the PDF is ready.
|
|
14
|
+
title?: string // Title text displayed in the component header or dialog.
|
|
15
|
+
disabled?: boolean // disables user interaction for this field
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Public props accepted by PdfPrint.
|
|
20
|
+
* Document each prop field with intent, defaults, and side effects for clear generated docs.
|
|
21
|
+
*/
|
|
22
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
23
|
+
print: false,
|
|
24
|
+
disabled: false,
|
|
25
|
+
})
|
|
26
|
+
/**
|
|
27
|
+
* Custom events emitted by PdfPrint.
|
|
28
|
+
* Parents can listen to these events to react to user actions and internal state changes.
|
|
29
|
+
*/
|
|
30
|
+
const emit = defineEmits(['update:print'])
|
|
31
|
+
|
|
32
|
+
const isMobile = ref(false)
|
|
33
|
+
const alert = useAlert()
|
|
34
|
+
|
|
35
|
+
const openPdf = () => {
|
|
36
|
+
if (/Android|Mobi|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Macintosh/i.test(navigator.userAgent)) {
|
|
37
|
+
isMobile.value = true
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
printJS({
|
|
41
|
+
printable: props.base64String,
|
|
42
|
+
type: 'pdf',
|
|
43
|
+
base64: true,
|
|
44
|
+
onPrintDialogClose: endLoadPdf,
|
|
45
|
+
onError: (error: any) => {
|
|
46
|
+
alert?.addAlert({ message: error, alertType: 'error' })
|
|
47
|
+
},
|
|
48
|
+
})
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const endLoadPdf = () => {
|
|
53
|
+
emit('update:print', false)
|
|
54
|
+
isMobile.value = false
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
watch(() => props.print, () => {
|
|
58
|
+
if (props.print) openPdf()
|
|
59
|
+
})
|
|
60
|
+
</script>
|
|
61
|
+
|
|
62
|
+
<template>
|
|
63
|
+
<v-dialog
|
|
64
|
+
v-model="isMobile"
|
|
65
|
+
fullscreen
|
|
66
|
+
>
|
|
67
|
+
<PdfView
|
|
68
|
+
:base64-string="props.base64String"
|
|
69
|
+
:disabled="props.disabled"
|
|
70
|
+
:title="props.title"
|
|
71
|
+
:file-name="props.fileName"
|
|
72
|
+
@close-dialog="endLoadPdf"
|
|
73
|
+
/>
|
|
74
|
+
</v-dialog>
|
|
75
|
+
</template>
|
|
@@ -1,134 +1,146 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
/>
|
|
119
|
-
<v-btn
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* PdfView displays PDF documents in-app with loading and viewport state management for preview workflows.
|
|
4
|
+
* This doc block is consumed by vue-docgen for generated API documentation.
|
|
5
|
+
*/
|
|
6
|
+
import PDF from 'pdf-vue3'
|
|
7
|
+
import { uid } from 'uid'
|
|
8
|
+
import printJS from 'print-js'
|
|
9
|
+
import { ref, computed } from 'vue'
|
|
10
|
+
import { useAlert } from '../../composables/alert'
|
|
11
|
+
|
|
12
|
+
interface Props extends /* @vue-ignore */ InstanceType<typeof PDF['$props']> {
|
|
13
|
+
base64String?: string // Base64 document payload used as the PDF source.
|
|
14
|
+
title?: string // Title text displayed in the component header or dialog.
|
|
15
|
+
fileName?: string // File name used when downloading or printing generated files.
|
|
16
|
+
disabled?: boolean // disables user interaction for this field
|
|
17
|
+
isPrint?: boolean // boolean flag controlling runtime behavior
|
|
18
|
+
showBackToTopBtn?: boolean // Shows a back-to-top button while scrolling long PDF content.
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Public props accepted by PdfView.
|
|
23
|
+
* Document each prop field with intent, defaults, and side effects for clear generated docs.
|
|
24
|
+
*/
|
|
25
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
26
|
+
base64String: '',
|
|
27
|
+
title: '',
|
|
28
|
+
fileName: '',
|
|
29
|
+
disabled: false,
|
|
30
|
+
isPrint: false,
|
|
31
|
+
showBackToTopBtn: false,
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Custom events emitted by PdfView.
|
|
36
|
+
* Parents can listen to these events to react to user actions and internal state changes.
|
|
37
|
+
*/
|
|
38
|
+
const emit = defineEmits(['closeDialog'])
|
|
39
|
+
const base64 = ref(props.base64String)
|
|
40
|
+
const alert = useAlert()
|
|
41
|
+
|
|
42
|
+
const generateUniqueId = (): string => {
|
|
43
|
+
const uniqueId: string = uid()
|
|
44
|
+
return props.fileName ? `${props.fileName}` : uniqueId
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const downloadPdf = (): void => {
|
|
48
|
+
try {
|
|
49
|
+
if (!props.base64String) alert?.addAlert({ message: 'No Base64 provided', alertType: 'error' })
|
|
50
|
+
|
|
51
|
+
const byteString = atob(props.base64String || '')
|
|
52
|
+
const byteArray = new Uint8Array(byteString.length)
|
|
53
|
+
|
|
54
|
+
for (let i = 0; i < byteString.length; i++) {
|
|
55
|
+
byteArray[i] = byteString.charCodeAt(i)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const blob = new Blob([byteArray], { type: 'application/pdf' })
|
|
59
|
+
const link = URL.createObjectURL(blob)
|
|
60
|
+
const anchorElement = document.createElement('a')
|
|
61
|
+
anchorElement.style.display = 'none'
|
|
62
|
+
anchorElement.href = link
|
|
63
|
+
anchorElement.download = `${generateUniqueId()}.pdf`
|
|
64
|
+
|
|
65
|
+
document.body.appendChild(anchorElement)
|
|
66
|
+
anchorElement.click()
|
|
67
|
+
URL.revokeObjectURL(link)
|
|
68
|
+
document.body.removeChild(anchorElement)
|
|
69
|
+
base64.value = ''
|
|
70
|
+
|
|
71
|
+
alert?.addAlert({ message: 'Download success', alertType: 'success' })
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
alert?.addAlert({ message: `Download unsuccess : ${error}`, alertType: 'error' })
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const printPdf = () => {
|
|
79
|
+
printJS({
|
|
80
|
+
printable: props.base64String,
|
|
81
|
+
type: 'pdf',
|
|
82
|
+
base64: true,
|
|
83
|
+
onPrintDialogClose: endLoadPdf,
|
|
84
|
+
onError: (error) => {
|
|
85
|
+
alert?.addAlert({ message: error, alertType: 'error' })
|
|
86
|
+
},
|
|
87
|
+
})
|
|
88
|
+
base64.value = ''
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const endLoadPdf = () => {
|
|
92
|
+
emit('closeDialog', false)
|
|
93
|
+
base64.value = ''
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const isMobile = () => {
|
|
97
|
+
return /Android|Mobi|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Macintosh/i.test(navigator.userAgent)
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const checkMobileAndPrint = computed(() => {
|
|
101
|
+
return !isMobile() && props.isPrint
|
|
102
|
+
})
|
|
103
|
+
|
|
104
|
+
const setWidthPdf = computed(() => {
|
|
105
|
+
if (isMobile()) {
|
|
106
|
+
return '100%'
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
return '100dvh'
|
|
110
|
+
}
|
|
111
|
+
})
|
|
112
|
+
</script>
|
|
113
|
+
|
|
114
|
+
<template>
|
|
115
|
+
<v-card>
|
|
116
|
+
<v-toolbar density="compact">
|
|
117
|
+
<v-toolbar-title>{{ props.title }}</v-toolbar-title>
|
|
118
|
+
<v-spacer />
|
|
119
|
+
<v-btn
|
|
120
|
+
v-if="checkMobileAndPrint"
|
|
121
|
+
icon="mdi mdi-printer"
|
|
122
|
+
variant="plain"
|
|
123
|
+
@click="printPdf"
|
|
124
|
+
/>
|
|
125
|
+
<v-btn
|
|
126
|
+
v-if="!props.disabled"
|
|
127
|
+
icon="mdi mdi-download"
|
|
128
|
+
variant="plain"
|
|
129
|
+
@click="downloadPdf"
|
|
130
|
+
/>
|
|
131
|
+
<v-btn
|
|
132
|
+
icon="mdi mdi-close"
|
|
133
|
+
variant="plain"
|
|
134
|
+
@click="endLoadPdf"
|
|
135
|
+
/>
|
|
136
|
+
</v-toolbar>
|
|
137
|
+
<v-card-text class="justify-center h-screen">
|
|
138
|
+
<PDF
|
|
139
|
+
v-bind="$attrs"
|
|
140
|
+
:pdf-width="setWidthPdf"
|
|
141
|
+
:src="base64"
|
|
142
|
+
:show-back-to-top-btn="props.showBackToTopBtn"
|
|
143
|
+
/>
|
|
144
|
+
</v-card-text>
|
|
145
|
+
</v-card>
|
|
146
|
+
</template>
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useAlert manages reactive alert state, creation helpers, and queue lifecycle used by notification components.
|
|
3
|
+
* This doc block is consumed by vue-docgen for generated API documentation.
|
|
4
|
+
*/
|
|
1
5
|
import { type InjectionKey, type Ref } from 'vue';
|
|
2
6
|
import type { AlertItem } from '../types/alert.js';
|
|
3
7
|
interface AlertProvide {
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useApi wraps authenticated HTTP calls, URL resolution, and optional response caching for runtime services.
|
|
3
|
+
* This doc block is consumed by vue-docgen for generated API documentation.
|
|
4
|
+
*/
|
|
1
5
|
import type { UseFetchOptions } from 'nuxt/app';
|
|
2
6
|
import type { SearchParameters } from 'ofetch';
|
|
3
7
|
export declare function useApi(): {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useDialog: () =>
|
|
1
|
+
export declare const useDialog: () => any;
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hidden-field template helpers build non-visual document form bindings while preserving data mapping.
|
|
3
|
+
* This doc block is consumed by vue-docgen for generated API documentation.
|
|
4
|
+
*/
|
|
1
5
|
import { type DocumentTemplateItem } from './template.js';
|
|
2
6
|
export declare function processTemplateFormHidden(item: DocumentTemplateItem, parentTemplates: string | string[], dataVariable?: string): string;
|
|
@@ -10,7 +10,7 @@ declare type VariableOptions = {
|
|
|
10
10
|
[k: string]: any;
|
|
11
11
|
};
|
|
12
12
|
export declare function useGraphQl(): {
|
|
13
|
-
query: <T>(operation: string, fields: Array<string | Object> | ClassConstructor<any>, variables?: VariableOptions, cache?: boolean) =>
|
|
13
|
+
query: <T>(operation: string, fields: Array<string | Object> | ClassConstructor<any>, variables?: VariableOptions, cache?: boolean) => any;
|
|
14
14
|
queryPromise: <T>(operation: string, fields: Array<string | Object> | ClassConstructor<any>, variables?: VariableOptions, cache?: boolean | number) => Promise<T>;
|
|
15
15
|
mutation: <T>(operation: string, fields: Array<string | Object> | ClassConstructor<any>, variables?: VariableOptions) => UseMutationReturn<any, any>;
|
|
16
16
|
mutationPromise: <T>(operation: string, fields: Array<string | Object> | ClassConstructor<any>, variables?: VariableOptions) => Promise<T>;
|
|
@@ -13,22 +13,22 @@ export declare function useGraphqlModel<T extends GraphqlModelProps>(props: T):
|
|
|
13
13
|
search: import("vue").Ref<string | undefined, string | undefined>;
|
|
14
14
|
setSearch: (keyword: string) => void;
|
|
15
15
|
currentOptions: import("vue").Ref<any, any>;
|
|
16
|
-
operationCreate: import("vue").ComputedRef<import("~/.nuxt/types/graphqlOperation").graphqlOperationObject<any, any
|
|
17
|
-
operationUpdate: import("vue").ComputedRef<import("~/.nuxt/types/graphqlOperation").graphqlOperationObject<any, any
|
|
18
|
-
operationDelete: import("vue").ComputedRef<import("~/.nuxt/types/graphqlOperation").graphqlOperationObject<any, any
|
|
19
|
-
operationRead: import("vue").ComputedRef<import("~/.nuxt/types/graphqlOperation").graphqlOperationObject<any, any
|
|
20
|
-
operationReadPageable: import("vue").ComputedRef<import("~/.nuxt/types/graphqlOperation").graphqlOperationObject<any, any
|
|
21
|
-
operationSearch: import("vue").ComputedRef<import("~/.nuxt/types/graphqlOperation").graphqlOperationObject<any, any
|
|
16
|
+
operationCreate: import("vue").ComputedRef<import("~/.nuxt/types/graphqlOperation").graphqlOperationObject<any, any> | undefined>;
|
|
17
|
+
operationUpdate: import("vue").ComputedRef<import("~/.nuxt/types/graphqlOperation").graphqlOperationObject<any, any> | undefined>;
|
|
18
|
+
operationDelete: import("vue").ComputedRef<import("~/.nuxt/types/graphqlOperation").graphqlOperationObject<any, any> | undefined>;
|
|
19
|
+
operationRead: import("vue").ComputedRef<import("~/.nuxt/types/graphqlOperation").graphqlOperationObject<any, any> | undefined>;
|
|
20
|
+
operationReadPageable: import("vue").ComputedRef<import("~/.nuxt/types/graphqlOperation").graphqlOperationObject<any, any> | undefined>;
|
|
21
|
+
operationSearch: import("vue").ComputedRef<import("~/.nuxt/types/graphqlOperation").graphqlOperationObject<any, any> | undefined>;
|
|
22
22
|
fields: import("vue").ComputedRef<(string | object)[]>;
|
|
23
23
|
canServerPageable: import("vue").ComputedRef<boolean>;
|
|
24
24
|
canServerSearch: import("vue").ComputedRef<boolean>;
|
|
25
25
|
canCreate: import("vue").ComputedRef<boolean>;
|
|
26
26
|
canUpdate: import("vue").ComputedRef<boolean>;
|
|
27
27
|
canDelete: import("vue").ComputedRef<boolean>;
|
|
28
|
-
createItem: (item: Record<string, any>, callback?: FormDialogCallback, importing?: boolean) => Promise<void
|
|
28
|
+
createItem: (item: Record<string, any>, callback?: FormDialogCallback, importing?: boolean) => Promise<void> | undefined;
|
|
29
29
|
importItems: (importItems: Record<string, any>[], callback?: FormDialogCallback) => void;
|
|
30
|
-
updateItem: (item: Record<string, any>, callback?: FormDialogCallback) => Promise<void
|
|
31
|
-
deleteItem: (item: Record<string, any>, callback?: FormDialogCallback) => Promise<any
|
|
30
|
+
updateItem: (item: Record<string, any>, callback?: FormDialogCallback) => Promise<void> | undefined;
|
|
31
|
+
deleteItem: (item: Record<string, any>, callback?: FormDialogCallback) => Promise<any> | undefined;
|
|
32
32
|
loadItems: (options: any) => void;
|
|
33
33
|
reload: () => void;
|
|
34
34
|
isLoading: import("vue").Ref<boolean, boolean>;
|
|
@@ -4,17 +4,17 @@ export type GraphqlModelItemProps = Omit<GraphqlModelConfigProps, 'operationSear
|
|
|
4
4
|
export declare function useGraphqlModelItem<T extends GraphqlModelItemProps>(props: T): {
|
|
5
5
|
modelBy: import("vue").Ref<object | undefined, object | undefined>;
|
|
6
6
|
item: import("vue").Ref<Record<string, any> | undefined, Record<string, any> | undefined>;
|
|
7
|
-
operationCreate: import("vue").ComputedRef<import("~/.nuxt/types/graphqlOperation").graphqlOperationObject<any, any
|
|
8
|
-
operationUpdate: import("vue").ComputedRef<import("~/.nuxt/types/graphqlOperation").graphqlOperationObject<any, any
|
|
9
|
-
operationDelete: import("vue").ComputedRef<import("~/.nuxt/types/graphqlOperation").graphqlOperationObject<any, any
|
|
10
|
-
operationRead: import("vue").ComputedRef<import("~/.nuxt/types/graphqlOperation").graphqlOperationObject<any, any
|
|
7
|
+
operationCreate: import("vue").ComputedRef<import("~/.nuxt/types/graphqlOperation").graphqlOperationObject<any, any> | undefined>;
|
|
8
|
+
operationUpdate: import("vue").ComputedRef<import("~/.nuxt/types/graphqlOperation").graphqlOperationObject<any, any> | undefined>;
|
|
9
|
+
operationDelete: import("vue").ComputedRef<import("~/.nuxt/types/graphqlOperation").graphqlOperationObject<any, any> | undefined>;
|
|
10
|
+
operationRead: import("vue").ComputedRef<import("~/.nuxt/types/graphqlOperation").graphqlOperationObject<any, any> | undefined>;
|
|
11
11
|
fields: import("vue").ComputedRef<(string | object)[]>;
|
|
12
12
|
canCreate: import("vue").ComputedRef<boolean>;
|
|
13
13
|
canUpdate: import("vue").ComputedRef<boolean>;
|
|
14
14
|
canDelete: import("vue").ComputedRef<boolean>;
|
|
15
|
-
createItem: (createItem: Record<string, any>, callback?: FormDialogCallback) => Promise<void
|
|
16
|
-
updateItem: (updateItem: Record<string, any>, callback?: FormDialogCallback) => Promise<void
|
|
17
|
-
deleteItem: (item: Record<string, any>, callback?: FormDialogCallback) => Promise<any
|
|
15
|
+
createItem: (createItem: Record<string, any>, callback?: FormDialogCallback) => Promise<void> | undefined;
|
|
16
|
+
updateItem: (updateItem: Record<string, any>, callback?: FormDialogCallback) => Promise<void> | undefined;
|
|
17
|
+
deleteItem: (item: Record<string, any>, callback?: FormDialogCallback) => Promise<any> | undefined;
|
|
18
18
|
reload: () => void;
|
|
19
19
|
isLoading: import("vue").Ref<boolean, boolean>;
|
|
20
20
|
};
|