@ramathibodi/nuxt-commons 0.1.74 → 4.0.1
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 +9 -2
- package/dist/module.json +4 -4
- package/dist/module.mjs +4 -4
- package/dist/runtime/bridges/authentication.d.ts +21 -0
- package/dist/runtime/bridges/authentication.js +20 -0
- package/dist/runtime/bridges/graphql.d.ts +17 -0
- package/dist/runtime/bridges/graphql.js +45 -0
- package/dist/runtime/components/Alert.d.vue.ts +3 -0
- package/dist/runtime/components/Alert.vue +17 -26
- package/dist/runtime/components/Alert.vue.d.ts +3 -0
- package/dist/runtime/components/BarcodeReader.d.vue.ts +9 -0
- package/dist/runtime/components/BarcodeReader.vue +56 -81
- package/dist/runtime/components/BarcodeReader.vue.d.ts +9 -0
- package/dist/runtime/components/ExportCSV.d.vue.ts +55 -0
- package/dist/runtime/components/ExportCSV.vue +39 -76
- package/dist/runtime/components/ExportCSV.vue.d.ts +55 -0
- package/dist/runtime/components/FileBtn.d.vue.ts +53 -0
- package/dist/runtime/components/FileBtn.vue +23 -50
- package/dist/runtime/components/FileBtn.vue.d.ts +53 -0
- package/dist/runtime/components/ImportCSV.d.vue.ts +52 -0
- package/dist/runtime/components/ImportCSV.vue +60 -111
- package/dist/runtime/components/ImportCSV.vue.d.ts +52 -0
- package/dist/runtime/components/MrzReader.d.vue.ts +19 -0
- package/dist/runtime/components/MrzReader.vue +69 -109
- package/dist/runtime/components/MrzReader.vue.d.ts +19 -0
- package/dist/runtime/components/SplitterPanel.d.vue.ts +15 -0
- package/dist/runtime/components/SplitterPanel.vue +18 -35
- package/dist/runtime/components/SplitterPanel.vue.d.ts +15 -0
- package/dist/runtime/components/TabsGroup.d.vue.ts +19 -0
- package/dist/runtime/components/TabsGroup.vue +8 -20
- package/dist/runtime/components/TabsGroup.vue.d.ts +19 -0
- package/dist/runtime/components/TextBarcode.d.vue.ts +12 -0
- package/dist/runtime/components/TextBarcode.vue +22 -45
- package/dist/runtime/components/TextBarcode.vue.d.ts +12 -0
- package/dist/runtime/components/device/IdCardButton.d.vue.ts +57 -0
- package/dist/runtime/components/device/IdCardButton.vue +30 -67
- package/dist/runtime/components/device/IdCardButton.vue.d.ts +57 -0
- package/dist/runtime/components/device/IdCardWebSocket.d.vue.ts +55 -0
- package/dist/runtime/components/device/IdCardWebSocket.vue +104 -165
- package/dist/runtime/components/device/IdCardWebSocket.vue.d.ts +55 -0
- package/dist/runtime/components/device/Scanner.d.vue.ts +66 -0
- package/dist/runtime/components/device/Scanner.vue +97 -178
- package/dist/runtime/components/device/Scanner.vue.d.ts +66 -0
- package/dist/runtime/components/dialog/Confirm.d.vue.ts +37 -0
- package/dist/runtime/components/dialog/Confirm.vue +30 -59
- package/dist/runtime/components/dialog/Confirm.vue.d.ts +37 -0
- package/dist/runtime/components/dialog/Host.d.vue.ts +9 -0
- package/dist/runtime/components/dialog/Host.vue +34 -57
- package/dist/runtime/components/dialog/Host.vue.d.ts +9 -0
- package/dist/runtime/components/dialog/Index.d.vue.ts +24 -0
- package/dist/runtime/components/dialog/Index.vue +20 -40
- package/dist/runtime/components/dialog/Index.vue.d.ts +24 -0
- package/dist/runtime/components/dialog/Loading.d.vue.ts +21 -0
- package/dist/runtime/components/dialog/Loading.vue +12 -29
- package/dist/runtime/components/dialog/Loading.vue.d.ts +21 -0
- package/dist/runtime/components/dialog/default/Confirm.d.vue.ts +40 -0
- package/dist/runtime/components/dialog/default/Confirm.vue +29 -62
- package/dist/runtime/components/dialog/default/Confirm.vue.d.ts +40 -0
- package/dist/runtime/components/dialog/default/Loading.d.vue.ts +23 -0
- package/dist/runtime/components/dialog/default/Loading.vue +12 -29
- package/dist/runtime/components/dialog/default/Loading.vue.d.ts +23 -0
- package/dist/runtime/components/dialog/default/Notify.d.vue.ts +23 -0
- package/dist/runtime/components/dialog/default/Notify.vue +19 -48
- package/dist/runtime/components/dialog/default/Notify.vue.d.ts +23 -0
- package/dist/runtime/components/dialog/default/Printing.d.vue.ts +21 -0
- package/dist/runtime/components/dialog/default/Printing.vue +13 -29
- package/dist/runtime/components/dialog/default/Printing.vue.d.ts +21 -0
- package/dist/runtime/components/dialog/default/VerifyUser.d.vue.ts +29 -0
- package/dist/runtime/components/dialog/default/VerifyUser.vue +44 -82
- package/dist/runtime/components/dialog/default/VerifyUser.vue.d.ts +29 -0
- package/dist/runtime/components/document/Form.d.vue.ts +9 -0
- package/dist/runtime/components/document/Form.vue +27 -42
- package/dist/runtime/components/document/Form.vue.d.ts +9 -0
- package/dist/runtime/components/document/TemplateBuilder.d.vue.ts +24 -0
- package/dist/runtime/components/document/TemplateBuilder.vue +154 -194
- package/dist/runtime/components/document/TemplateBuilder.vue.d.ts +24 -0
- package/dist/runtime/components/form/ActionPad.d.vue.ts +114 -0
- package/dist/runtime/components/form/ActionPad.vue +48 -85
- package/dist/runtime/components/form/ActionPad.vue.d.ts +114 -0
- package/dist/runtime/components/form/Birthdate.d.vue.ts +38 -0
- package/dist/runtime/components/form/Birthdate.vue +44 -76
- package/dist/runtime/components/form/Birthdate.vue.d.ts +38 -0
- package/dist/runtime/components/form/CheckboxGroup.d.vue.ts +41 -0
- package/dist/runtime/components/form/CheckboxGroup.vue +34 -64
- package/dist/runtime/components/form/CheckboxGroup.vue.d.ts +41 -0
- package/dist/runtime/components/form/CodeEditor.d.vue.ts +25 -0
- package/dist/runtime/components/form/CodeEditor.vue +18 -36
- package/dist/runtime/components/form/CodeEditor.vue.d.ts +25 -0
- package/dist/runtime/components/form/Date.d.vue.ts +86 -0
- package/dist/runtime/components/form/Date.vue +109 -162
- package/dist/runtime/components/form/Date.vue.d.ts +86 -0
- package/dist/runtime/components/form/DateTime.d.vue.ts +36 -0
- package/dist/runtime/components/form/DateTime.vue +94 -143
- package/dist/runtime/components/form/DateTime.vue.d.ts +36 -0
- package/dist/runtime/components/form/Dialog.d.vue.ts +69 -0
- package/dist/runtime/components/form/Dialog.vue +60 -96
- package/dist/runtime/components/form/Dialog.vue.d.ts +69 -0
- package/dist/runtime/components/form/EditPad.d.vue.ts +113 -0
- package/dist/runtime/components/form/EditPad.vue +49 -85
- package/dist/runtime/components/form/EditPad.vue.d.ts +113 -0
- package/dist/runtime/components/form/File.d.vue.ts +65 -0
- package/dist/runtime/components/form/File.vue +112 -186
- package/dist/runtime/components/form/File.vue.d.ts +65 -0
- package/dist/runtime/components/form/Hidden.d.vue.ts +12 -0
- package/dist/runtime/components/form/Hidden.vue +17 -34
- package/dist/runtime/components/form/Hidden.vue.d.ts +12 -0
- package/dist/runtime/components/form/Iterator.d.vue.ts +279 -0
- package/dist/runtime/components/form/Iterator.vue +162 -252
- package/dist/runtime/components/form/Iterator.vue.d.ts +279 -0
- package/dist/runtime/components/form/Login.d.vue.ts +32 -0
- package/dist/runtime/components/form/Login.vue +23 -55
- package/dist/runtime/components/form/Login.vue.d.ts +32 -0
- package/dist/runtime/components/form/Pad.d.vue.ts +674 -0
- package/dist/runtime/components/form/Pad.vue +166 -265
- package/dist/runtime/components/form/Pad.vue.d.ts +674 -0
- package/dist/runtime/components/form/SignPad.d.vue.ts +62 -0
- package/dist/runtime/components/form/SignPad.vue +80 -126
- package/dist/runtime/components/form/SignPad.vue.d.ts +62 -0
- package/dist/runtime/components/form/System.d.vue.ts +34 -0
- package/dist/runtime/components/form/System.vue +18 -32
- package/dist/runtime/components/form/System.vue.d.ts +34 -0
- package/dist/runtime/components/form/Table.d.vue.ts +221 -0
- package/dist/runtime/components/form/Table.vue +123 -182
- package/dist/runtime/components/form/Table.vue.d.ts +221 -0
- package/dist/runtime/components/form/TableData.d.vue.ts +102 -0
- package/dist/runtime/components/form/TableData.vue +109 -139
- package/dist/runtime/components/form/TableData.vue.d.ts +102 -0
- package/dist/runtime/components/form/Time.d.vue.ts +49 -0
- package/dist/runtime/components/form/Time.vue +64 -99
- package/dist/runtime/components/form/Time.vue.d.ts +49 -0
- package/dist/runtime/components/form/images/Capture.d.vue.ts +96 -0
- package/dist/runtime/components/form/images/Capture.vue +104 -147
- package/dist/runtime/components/form/images/Capture.vue.d.ts +96 -0
- package/dist/runtime/components/form/images/Edit.d.vue.ts +29 -0
- package/dist/runtime/components/form/images/Edit.vue +57 -81
- package/dist/runtime/components/form/images/Edit.vue.d.ts +29 -0
- package/dist/runtime/components/form/images/Field.d.vue.ts +27 -0
- package/dist/runtime/components/form/images/Field.vue +136 -205
- package/dist/runtime/components/form/images/Field.vue.d.ts +27 -0
- package/dist/runtime/components/form/images/Pad.d.vue.ts +13 -0
- package/dist/runtime/components/form/images/Pad.vue +23 -40
- package/dist/runtime/components/form/images/Pad.vue.d.ts +13 -0
- package/dist/runtime/components/label/Date.d.vue.ts +13 -0
- package/dist/runtime/components/label/Date.vue +13 -29
- package/dist/runtime/components/label/Date.vue.d.ts +13 -0
- package/dist/runtime/components/label/DateAgo.d.vue.ts +20 -0
- package/dist/runtime/components/label/DateAgo.vue +43 -75
- package/dist/runtime/components/label/DateAgo.vue.d.ts +20 -0
- package/dist/runtime/components/label/DateCount.d.vue.ts +22 -0
- package/dist/runtime/components/label/DateCount.vue +58 -105
- package/dist/runtime/components/label/DateCount.vue.d.ts +22 -0
- package/dist/runtime/components/label/Field.d.vue.ts +38 -0
- package/dist/runtime/components/label/Field.vue +18 -40
- package/dist/runtime/components/label/Field.vue.d.ts +38 -0
- package/dist/runtime/components/label/FormatMoney.d.vue.ts +12 -0
- package/dist/runtime/components/label/FormatMoney.vue +12 -28
- package/dist/runtime/components/label/FormatMoney.vue.d.ts +12 -0
- package/dist/runtime/components/label/Mask.d.vue.ts +10 -0
- package/dist/runtime/components/label/Mask.vue +21 -38
- package/dist/runtime/components/label/Mask.vue.d.ts +10 -0
- package/dist/runtime/components/label/Object.d.vue.ts +8 -0
- package/dist/runtime/components/label/Object.vue +10 -20
- package/dist/runtime/components/label/Object.vue.d.ts +8 -0
- package/dist/runtime/components/master/Autocomplete.d.vue.ts +70 -0
- package/dist/runtime/components/master/Autocomplete.vue +25 -34
- package/dist/runtime/components/master/Autocomplete.vue.d.ts +70 -0
- package/dist/runtime/components/master/Combobox.d.vue.ts +70 -0
- package/dist/runtime/components/master/Combobox.vue +26 -35
- package/dist/runtime/components/master/Combobox.vue.d.ts +70 -0
- package/dist/runtime/components/master/RadioGroup.d.vue.ts +51 -0
- package/dist/runtime/components/master/RadioGroup.vue +44 -59
- package/dist/runtime/components/master/RadioGroup.vue.d.ts +51 -0
- package/dist/runtime/components/master/Select.d.vue.ts +68 -0
- package/dist/runtime/components/master/Select.vue +25 -34
- package/dist/runtime/components/master/Select.vue.d.ts +68 -0
- package/dist/runtime/components/master/label.d.vue.ts +24 -0
- package/dist/runtime/components/master/label.vue +22 -42
- package/dist/runtime/components/master/label.vue.d.ts +24 -0
- package/dist/runtime/components/model/Autocomplete.d.vue.ts +82 -0
- package/dist/runtime/components/model/Autocomplete.vue +50 -49
- package/dist/runtime/components/model/Autocomplete.vue.d.ts +82 -0
- package/dist/runtime/components/model/Combobox.d.vue.ts +82 -0
- package/dist/runtime/components/model/Combobox.vue +51 -49
- package/dist/runtime/components/model/Combobox.vue.d.ts +82 -0
- package/dist/runtime/components/model/Pad.d.vue.ts +72 -0
- package/dist/runtime/components/model/Pad.vue +50 -65
- package/dist/runtime/components/model/Pad.vue.d.ts +72 -0
- package/dist/runtime/components/model/Select.d.vue.ts +72 -0
- package/dist/runtime/components/model/Select.vue +42 -44
- package/dist/runtime/components/model/Select.vue.d.ts +72 -0
- package/dist/runtime/components/model/Table.d.vue.ts +272 -0
- package/dist/runtime/components/model/Table.vue +121 -145
- package/dist/runtime/components/model/Table.vue.d.ts +272 -0
- package/dist/runtime/components/model/iterator.d.vue.ts +321 -0
- package/dist/runtime/components/model/iterator.vue +148 -183
- package/dist/runtime/components/model/iterator.vue.d.ts +321 -0
- package/dist/runtime/components/model/label.d.vue.ts +26 -0
- package/dist/runtime/components/model/label.vue +25 -43
- package/dist/runtime/components/model/label.vue.d.ts +26 -0
- package/dist/runtime/components/pdf/Print.d.vue.ts +17 -0
- package/dist/runtime/components/pdf/Print.vue +27 -50
- package/dist/runtime/components/pdf/Print.vue.d.ts +17 -0
- package/dist/runtime/components/pdf/View.d.vue.ts +52 -0
- package/dist/runtime/components/pdf/View.vue +58 -95
- package/dist/runtime/components/pdf/View.vue.d.ts +52 -0
- package/dist/runtime/composables/api.js +4 -2
- package/dist/runtime/composables/assetFile.js +4 -2
- package/dist/runtime/composables/dialog.d.ts +1 -1
- package/dist/runtime/composables/document/template.js +3 -3
- package/dist/runtime/composables/document/templateFormTable.js +1 -0
- package/dist/runtime/composables/graphql.d.ts +2 -2
- package/dist/runtime/composables/graphql.js +5 -5
- package/dist/runtime/composables/graphqlModel.d.ts +6 -6
- package/dist/runtime/composables/graphqlModelItem.d.ts +4 -4
- package/dist/runtime/composables/graphqlModelOperation.d.ts +6 -6
- package/dist/runtime/composables/graphqlModelOperation.js +2 -1
- package/dist/runtime/composables/graphqlOperation.js +5 -1
- package/dist/runtime/composables/hostAgentWs.d.ts +1 -1
- package/dist/runtime/composables/lookupListMaster.js +3 -3
- package/dist/runtime/composables/menu.js +2 -2
- package/dist/runtime/composables/userPermission.d.ts +1 -1
- package/dist/runtime/composables/utils/fuzzy.d.ts +2 -1
- package/dist/runtime/labs/Calendar.d.vue.ts +35 -0
- package/dist/runtime/labs/Calendar.vue +47 -75
- package/dist/runtime/labs/Calendar.vue.d.ts +35 -0
- package/dist/runtime/labs/form/EditMobile.d.vue.ts +12 -0
- package/dist/runtime/labs/form/EditMobile.vue +19 -36
- package/dist/runtime/labs/form/EditMobile.vue.d.ts +12 -0
- package/dist/runtime/labs/form/TextFieldMask.d.vue.ts +21 -0
- package/dist/runtime/labs/form/TextFieldMask.vue +19 -25
- package/dist/runtime/labs/form/TextFieldMask.vue.d.ts +21 -0
- package/dist/runtime/plugins/dialogManager.js +2 -2
- package/dist/runtime/plugins/permission.js +3 -3
- package/dist/runtime/types/bridge.d.ts +14 -0
- package/dist/runtime/utils/datetime.js +1 -1
- package/dist/types.d.mts +2 -6
- package/package.json +71 -59
- package/scripts/ci-release.mjs +125 -0
- package/scripts/release-version.mjs +68 -0
- package/scripts/release.mjs +49 -0
- package/dist/module.cjs +0 -5
- package/dist/module.d.ts +0 -8
- package/dist/types.d.ts +0 -7
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
import { VDataIterator } from 'vuetify/components/VDataIterator';
|
|
2
|
+
import type { GraphqlModelProps } from '../../composables/graphqlModel.js';
|
|
3
|
+
interface Props extends /* @vue-ignore */ InstanceType<typeof VDataIterator['$props']> {
|
|
4
|
+
title: string;
|
|
5
|
+
noDataText?: string;
|
|
6
|
+
dialogFullscreen?: boolean;
|
|
7
|
+
initialData?: Record<string, any>;
|
|
8
|
+
toolbarColor?: string;
|
|
9
|
+
importable?: boolean;
|
|
10
|
+
exportable?: boolean;
|
|
11
|
+
insertable?: boolean;
|
|
12
|
+
searchable?: boolean;
|
|
13
|
+
search?: string;
|
|
14
|
+
viewSwitch?: boolean;
|
|
15
|
+
viewSwitchMultiple?: boolean;
|
|
16
|
+
cols?: string | number | boolean;
|
|
17
|
+
xxl?: string | number | boolean;
|
|
18
|
+
xl?: string | number | boolean;
|
|
19
|
+
lg?: string | number | boolean;
|
|
20
|
+
md?: string | number | boolean;
|
|
21
|
+
sm?: string | number | boolean;
|
|
22
|
+
itemsPerPage?: string | number;
|
|
23
|
+
preferTable?: string | number | boolean;
|
|
24
|
+
preferTableXxl?: string | number | boolean;
|
|
25
|
+
preferTableXl?: string | number | boolean;
|
|
26
|
+
preferTableLg?: string | number | boolean;
|
|
27
|
+
preferTableMd?: string | number | boolean;
|
|
28
|
+
preferTableSm?: string | number | boolean;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Public props accepted by ModelIterator.
|
|
32
|
+
* Document each prop field with intent, defaults, and side effects for clear generated docs.
|
|
33
|
+
*/
|
|
34
|
+
type __VLS_Props = Props & GraphqlModelProps;
|
|
35
|
+
declare function openDialog(item?: object): void;
|
|
36
|
+
declare var __VLS_15: {
|
|
37
|
+
operation: {
|
|
38
|
+
openDialog: typeof openDialog;
|
|
39
|
+
createItem: (item: Record<string, any>, callback?: import("../../types/formDialog.js").FormDialogCallback, importing?: boolean) => Promise<void>;
|
|
40
|
+
importItems: (importItems: Record<string, any>[], callback?: import("../../types/formDialog.js").FormDialogCallback) => void;
|
|
41
|
+
updateItem: (item: Record<string, any>, callback?: import("../../types/formDialog.js").FormDialogCallback) => Promise<void>;
|
|
42
|
+
deleteItem: (item: Record<string, any>, callback?: import("../../types/formDialog.js").FormDialogCallback) => Promise<any>;
|
|
43
|
+
reload: () => void;
|
|
44
|
+
setSearch: (keyword: string) => void;
|
|
45
|
+
canServerPageable: boolean;
|
|
46
|
+
canServerSearch: boolean;
|
|
47
|
+
canCreate: boolean;
|
|
48
|
+
canUpdate: boolean;
|
|
49
|
+
canDelete: boolean;
|
|
50
|
+
};
|
|
51
|
+
page: number;
|
|
52
|
+
itemsPerPage: number;
|
|
53
|
+
sortBy: readonly import("vuetify/lib/types.mjs").DataTableSortItem[];
|
|
54
|
+
pageCount: number;
|
|
55
|
+
toggleSort: ReturnType<typeof import("vuetify/lib/components/VDataTable/composables/sort.mjs").provideSort>["toggleSort"];
|
|
56
|
+
prevPage: ReturnType<typeof import("vuetify/lib/components/VDataTable/composables/paginate.mjs").providePagination>["prevPage"];
|
|
57
|
+
nextPage: ReturnType<typeof import("vuetify/lib/components/VDataTable/composables/paginate.mjs").providePagination>["nextPage"];
|
|
58
|
+
setPage: ReturnType<typeof import("vuetify/lib/components/VDataTable/composables/paginate.mjs").providePagination>["setPage"];
|
|
59
|
+
setItemsPerPage: ReturnType<typeof import("vuetify/lib/components/VDataTable/composables/paginate.mjs").providePagination>["setItemsPerPage"];
|
|
60
|
+
isSelected: ReturnType<typeof import("vuetify/lib/components/VDataTable/composables/select.mjs").provideSelection>["isSelected"];
|
|
61
|
+
select: ReturnType<typeof import("vuetify/lib/components/VDataTable/composables/select.mjs").provideSelection>["select"];
|
|
62
|
+
selectAll: ReturnType<typeof import("vuetify/lib/components/VDataTable/composables/select.mjs").provideSelection>["selectAll"];
|
|
63
|
+
toggleSelect: ReturnType<typeof import("vuetify/lib/components/VDataTable/composables/select.mjs").provideSelection>["toggleSelect"];
|
|
64
|
+
isExpanded: ReturnType<typeof import("vuetify/lib/components/VDataTable/composables/expand.mjs").provideExpanded>["isExpanded"];
|
|
65
|
+
toggleExpand: ReturnType<typeof import("vuetify/lib/components/VDataTable/composables/expand.mjs").provideExpanded>["toggleExpand"];
|
|
66
|
+
isGroupOpen: ReturnType<typeof import("vuetify/lib/components/VDataTable/composables/group.mjs").provideGroupBy>["isGroupOpen"];
|
|
67
|
+
toggleGroup: ReturnType<typeof import("vuetify/lib/components/VDataTable/composables/group.mjs").provideGroupBy>["toggleGroup"];
|
|
68
|
+
items: readonly import("vuetify/lib/components/VDataIterator/composables/items.mjs").DataIteratorItem<Record<string, any>>[];
|
|
69
|
+
itemsCount: number;
|
|
70
|
+
groupedItems: readonly (import("vuetify/lib/components/VDataIterator/composables/items.mjs").DataIteratorItem<Record<string, any>> | import("vuetify/lib/components/VDataTable/composables/group.mjs").Group<import("vuetify/lib/components/VDataIterator/composables/items.mjs").DataIteratorItem<Record<string, any>>> | import("vuetify/lib/components/VDataTable/composables/group.mjs").GroupSummary<import("vuetify/lib/components/VDataIterator/composables/items.mjs").DataIteratorItem<Record<string, any>>>)[];
|
|
71
|
+
}, __VLS_35: {
|
|
72
|
+
item: import("vuetify/lib/components/VDataIterator/composables/items.mjs").DataIteratorItem<Record<string, any>>;
|
|
73
|
+
operation: {
|
|
74
|
+
openDialog: typeof openDialog;
|
|
75
|
+
createItem: (item: Record<string, any>, callback?: import("../../types/formDialog.js").FormDialogCallback, importing?: boolean) => Promise<void>;
|
|
76
|
+
importItems: (importItems: Record<string, any>[], callback?: import("../../types/formDialog.js").FormDialogCallback) => void;
|
|
77
|
+
updateItem: (item: Record<string, any>, callback?: import("../../types/formDialog.js").FormDialogCallback) => Promise<void>;
|
|
78
|
+
deleteItem: (item: Record<string, any>, callback?: import("../../types/formDialog.js").FormDialogCallback) => Promise<any>;
|
|
79
|
+
reload: () => void;
|
|
80
|
+
setSearch: (keyword: string) => void;
|
|
81
|
+
canServerPageable: boolean;
|
|
82
|
+
canServerSearch: boolean;
|
|
83
|
+
canCreate: boolean;
|
|
84
|
+
canUpdate: boolean;
|
|
85
|
+
canDelete: boolean;
|
|
86
|
+
};
|
|
87
|
+
}, __VLS_38: {
|
|
88
|
+
color: string | undefined;
|
|
89
|
+
isActive: boolean;
|
|
90
|
+
}, __VLS_58: {}, __VLS_66: {
|
|
91
|
+
items: Record<string, any>[];
|
|
92
|
+
operation: {
|
|
93
|
+
openDialog: typeof openDialog;
|
|
94
|
+
createItem: (item: Record<string, any>, callback?: import("../../types/formDialog.js").FormDialogCallback, importing?: boolean) => Promise<void>;
|
|
95
|
+
importItems: (importItems: Record<string, any>[], callback?: import("../../types/formDialog.js").FormDialogCallback) => void;
|
|
96
|
+
updateItem: (item: Record<string, any>, callback?: import("../../types/formDialog.js").FormDialogCallback) => Promise<void>;
|
|
97
|
+
deleteItem: (item: Record<string, any>, callback?: import("../../types/formDialog.js").FormDialogCallback) => Promise<any>;
|
|
98
|
+
reload: () => void;
|
|
99
|
+
setSearch: (keyword: string) => void;
|
|
100
|
+
canServerPageable: boolean;
|
|
101
|
+
canServerSearch: boolean;
|
|
102
|
+
canCreate: boolean;
|
|
103
|
+
canUpdate: boolean;
|
|
104
|
+
canDelete: boolean;
|
|
105
|
+
};
|
|
106
|
+
page: number;
|
|
107
|
+
itemsPerPage: number;
|
|
108
|
+
sortBy: readonly import("vuetify/lib/types.mjs").DataTableSortItem[];
|
|
109
|
+
pageCount: number;
|
|
110
|
+
toggleSort: ReturnType<typeof import("vuetify/lib/components/VDataTable/composables/sort.mjs").provideSort>["toggleSort"];
|
|
111
|
+
prevPage: ReturnType<typeof import("vuetify/lib/components/VDataTable/composables/paginate.mjs").providePagination>["prevPage"];
|
|
112
|
+
nextPage: ReturnType<typeof import("vuetify/lib/components/VDataTable/composables/paginate.mjs").providePagination>["nextPage"];
|
|
113
|
+
setPage: ReturnType<typeof import("vuetify/lib/components/VDataTable/composables/paginate.mjs").providePagination>["setPage"];
|
|
114
|
+
setItemsPerPage: ReturnType<typeof import("vuetify/lib/components/VDataTable/composables/paginate.mjs").providePagination>["setItemsPerPage"];
|
|
115
|
+
isSelected: ReturnType<typeof import("vuetify/lib/components/VDataTable/composables/select.mjs").provideSelection>["isSelected"];
|
|
116
|
+
select: ReturnType<typeof import("vuetify/lib/components/VDataTable/composables/select.mjs").provideSelection>["select"];
|
|
117
|
+
selectAll: ReturnType<typeof import("vuetify/lib/components/VDataTable/composables/select.mjs").provideSelection>["selectAll"];
|
|
118
|
+
toggleSelect: ReturnType<typeof import("vuetify/lib/components/VDataTable/composables/select.mjs").provideSelection>["toggleSelect"];
|
|
119
|
+
isExpanded: ReturnType<typeof import("vuetify/lib/components/VDataTable/composables/expand.mjs").provideExpanded>["isExpanded"];
|
|
120
|
+
toggleExpand: ReturnType<typeof import("vuetify/lib/components/VDataTable/composables/expand.mjs").provideExpanded>["toggleExpand"];
|
|
121
|
+
isGroupOpen: ReturnType<typeof import("vuetify/lib/components/VDataTable/composables/group.mjs").provideGroupBy>["isGroupOpen"];
|
|
122
|
+
toggleGroup: ReturnType<typeof import("vuetify/lib/components/VDataTable/composables/group.mjs").provideGroupBy>["toggleGroup"];
|
|
123
|
+
itemsCount: number;
|
|
124
|
+
groupedItems: readonly (import("vuetify/lib/components/VDataIterator/composables/items.mjs").DataIteratorItem<Record<string, any>> | import("vuetify/lib/components/VDataTable/composables/group.mjs").Group<import("vuetify/lib/components/VDataIterator/composables/items.mjs").DataIteratorItem<Record<string, any>>> | import("vuetify/lib/components/VDataTable/composables/group.mjs").GroupSummary<import("vuetify/lib/components/VDataIterator/composables/items.mjs").DataIteratorItem<Record<string, any>>>)[];
|
|
125
|
+
}, __VLS_92: {
|
|
126
|
+
reload: () => void;
|
|
127
|
+
}, __VLS_108: {
|
|
128
|
+
items: Record<string, any>[];
|
|
129
|
+
operation: {
|
|
130
|
+
openDialog: typeof openDialog;
|
|
131
|
+
createItem: (item: Record<string, any>, callback?: import("../../types/formDialog.js").FormDialogCallback, importing?: boolean) => Promise<void>;
|
|
132
|
+
importItems: (importItems: Record<string, any>[], callback?: import("../../types/formDialog.js").FormDialogCallback) => void;
|
|
133
|
+
updateItem: (item: Record<string, any>, callback?: import("../../types/formDialog.js").FormDialogCallback) => Promise<void>;
|
|
134
|
+
deleteItem: (item: Record<string, any>, callback?: import("../../types/formDialog.js").FormDialogCallback) => Promise<any>;
|
|
135
|
+
reload: () => void;
|
|
136
|
+
setSearch: (keyword: string) => void;
|
|
137
|
+
canServerPageable: boolean;
|
|
138
|
+
canServerSearch: boolean;
|
|
139
|
+
canCreate: boolean;
|
|
140
|
+
canUpdate: boolean;
|
|
141
|
+
canDelete: boolean;
|
|
142
|
+
};
|
|
143
|
+
}, __VLS_121: {
|
|
144
|
+
items: Record<string, any>[];
|
|
145
|
+
operation: {
|
|
146
|
+
openDialog: typeof openDialog;
|
|
147
|
+
createItem: (item: Record<string, any>, callback?: import("../../types/formDialog.js").FormDialogCallback, importing?: boolean) => Promise<void>;
|
|
148
|
+
importItems: (importItems: Record<string, any>[], callback?: import("../../types/formDialog.js").FormDialogCallback) => void;
|
|
149
|
+
updateItem: (item: Record<string, any>, callback?: import("../../types/formDialog.js").FormDialogCallback) => Promise<void>;
|
|
150
|
+
deleteItem: (item: Record<string, any>, callback?: import("../../types/formDialog.js").FormDialogCallback) => Promise<any>;
|
|
151
|
+
reload: () => void;
|
|
152
|
+
setSearch: (keyword: string) => void;
|
|
153
|
+
canServerPageable: boolean;
|
|
154
|
+
canServerSearch: boolean;
|
|
155
|
+
canCreate: boolean;
|
|
156
|
+
canUpdate: boolean;
|
|
157
|
+
canDelete: boolean;
|
|
158
|
+
};
|
|
159
|
+
}, __VLS_175: never, __VLS_176: {
|
|
160
|
+
operation: {
|
|
161
|
+
openDialog: typeof openDialog;
|
|
162
|
+
createItem: (item: Record<string, any>, callback?: import("../../types/formDialog.js").FormDialogCallback, importing?: boolean) => Promise<void>;
|
|
163
|
+
importItems: (importItems: Record<string, any>[], callback?: import("../../types/formDialog.js").FormDialogCallback) => void;
|
|
164
|
+
updateItem: (item: Record<string, any>, callback?: import("../../types/formDialog.js").FormDialogCallback) => Promise<void>;
|
|
165
|
+
deleteItem: (item: Record<string, any>, callback?: import("../../types/formDialog.js").FormDialogCallback) => Promise<any>;
|
|
166
|
+
reload: () => void;
|
|
167
|
+
setSearch: (keyword: string) => void;
|
|
168
|
+
canServerPageable: boolean;
|
|
169
|
+
canServerSearch: boolean;
|
|
170
|
+
canCreate: boolean;
|
|
171
|
+
canUpdate: boolean;
|
|
172
|
+
canDelete: boolean;
|
|
173
|
+
};
|
|
174
|
+
}, __VLS_201: never, __VLS_202: {
|
|
175
|
+
operation: {
|
|
176
|
+
openDialog: typeof openDialog;
|
|
177
|
+
createItem: (item: Record<string, any>, callback?: import("../../types/formDialog.js").FormDialogCallback, importing?: boolean) => Promise<void>;
|
|
178
|
+
importItems: (importItems: Record<string, any>[], callback?: import("../../types/formDialog.js").FormDialogCallback) => void;
|
|
179
|
+
updateItem: (item: Record<string, any>, callback?: import("../../types/formDialog.js").FormDialogCallback) => Promise<void>;
|
|
180
|
+
deleteItem: (item: Record<string, any>, callback?: import("../../types/formDialog.js").FormDialogCallback) => Promise<any>;
|
|
181
|
+
reload: () => void;
|
|
182
|
+
setSearch: (keyword: string) => void;
|
|
183
|
+
canServerPageable: boolean;
|
|
184
|
+
canServerSearch: boolean;
|
|
185
|
+
canCreate: boolean;
|
|
186
|
+
canUpdate: boolean;
|
|
187
|
+
canDelete: boolean;
|
|
188
|
+
};
|
|
189
|
+
}, __VLS_270: any;
|
|
190
|
+
type __VLS_Slots = {} & {
|
|
191
|
+
[K in NonNullable<typeof __VLS_175>]?: (props: typeof __VLS_176) => any;
|
|
192
|
+
} & {
|
|
193
|
+
[K in NonNullable<typeof __VLS_201>]?: (props: typeof __VLS_202) => any;
|
|
194
|
+
} & {
|
|
195
|
+
default?: (props: typeof __VLS_15) => any;
|
|
196
|
+
} & {
|
|
197
|
+
item?: (props: typeof __VLS_35) => any;
|
|
198
|
+
} & {
|
|
199
|
+
loader?: (props: typeof __VLS_38) => any;
|
|
200
|
+
} & {
|
|
201
|
+
loaderItem?: (props: typeof __VLS_58) => any;
|
|
202
|
+
} & {
|
|
203
|
+
header?: (props: typeof __VLS_66) => any;
|
|
204
|
+
} & {
|
|
205
|
+
title?: (props: typeof __VLS_92) => any;
|
|
206
|
+
} & {
|
|
207
|
+
search?: (props: typeof __VLS_108) => any;
|
|
208
|
+
} & {
|
|
209
|
+
toolbarItems?: (props: typeof __VLS_121) => any;
|
|
210
|
+
} & {
|
|
211
|
+
form?: (props: typeof __VLS_270) => any;
|
|
212
|
+
};
|
|
213
|
+
declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
214
|
+
noDataText: string;
|
|
215
|
+
dialogFullscreen: boolean;
|
|
216
|
+
toolbarColor: string;
|
|
217
|
+
importable: boolean;
|
|
218
|
+
exportable: boolean;
|
|
219
|
+
insertable: boolean;
|
|
220
|
+
searchable: boolean;
|
|
221
|
+
modelKey: string;
|
|
222
|
+
modelBy: undefined;
|
|
223
|
+
fields: () => never[];
|
|
224
|
+
viewSwitch: boolean;
|
|
225
|
+
viewSwitchMultiple: boolean;
|
|
226
|
+
cols: number;
|
|
227
|
+
xxl: boolean;
|
|
228
|
+
xl: boolean;
|
|
229
|
+
lg: number;
|
|
230
|
+
md: number;
|
|
231
|
+
sm: number;
|
|
232
|
+
itemsPerPage: number;
|
|
233
|
+
}>>, {
|
|
234
|
+
reload: () => void;
|
|
235
|
+
operation: import("vue").Ref<{
|
|
236
|
+
openDialog: typeof openDialog;
|
|
237
|
+
createItem: (item: Record<string, any>, callback?: import("../../types/formDialog.js").FormDialogCallback, importing?: boolean) => Promise<void>;
|
|
238
|
+
importItems: (importItems: Record<string, any>[], callback?: import("../../types/formDialog.js").FormDialogCallback) => void;
|
|
239
|
+
updateItem: (item: Record<string, any>, callback?: import("../../types/formDialog.js").FormDialogCallback) => Promise<void>;
|
|
240
|
+
deleteItem: (item: Record<string, any>, callback?: import("../../types/formDialog.js").FormDialogCallback) => Promise<any>;
|
|
241
|
+
reload: () => void;
|
|
242
|
+
setSearch: (keyword: string) => void;
|
|
243
|
+
canServerPageable: boolean;
|
|
244
|
+
canServerSearch: boolean;
|
|
245
|
+
canCreate: boolean;
|
|
246
|
+
canUpdate: boolean;
|
|
247
|
+
canDelete: boolean;
|
|
248
|
+
}, {
|
|
249
|
+
openDialog: typeof openDialog;
|
|
250
|
+
createItem: (item: Record<string, any>, callback?: import("../../types/formDialog.js").FormDialogCallback, importing?: boolean) => Promise<void>;
|
|
251
|
+
importItems: (importItems: Record<string, any>[], callback?: import("../../types/formDialog.js").FormDialogCallback) => void;
|
|
252
|
+
updateItem: (item: Record<string, any>, callback?: import("../../types/formDialog.js").FormDialogCallback) => Promise<void>;
|
|
253
|
+
deleteItem: (item: Record<string, any>, callback?: import("../../types/formDialog.js").FormDialogCallback) => Promise<any>;
|
|
254
|
+
reload: () => void;
|
|
255
|
+
setSearch: (keyword: string) => void;
|
|
256
|
+
canServerPageable: import("vue").ComputedRef<boolean>;
|
|
257
|
+
canServerSearch: import("vue").ComputedRef<boolean>;
|
|
258
|
+
canCreate: import("vue").ComputedRef<boolean>;
|
|
259
|
+
canUpdate: import("vue").ComputedRef<boolean>;
|
|
260
|
+
canDelete: import("vue").ComputedRef<boolean>;
|
|
261
|
+
} | {
|
|
262
|
+
openDialog: typeof openDialog;
|
|
263
|
+
createItem: (item: Record<string, any>, callback?: import("../../types/formDialog.js").FormDialogCallback, importing?: boolean) => Promise<void>;
|
|
264
|
+
importItems: (importItems: Record<string, any>[], callback?: import("../../types/formDialog.js").FormDialogCallback) => void;
|
|
265
|
+
updateItem: (item: Record<string, any>, callback?: import("../../types/formDialog.js").FormDialogCallback) => Promise<void>;
|
|
266
|
+
deleteItem: (item: Record<string, any>, callback?: import("../../types/formDialog.js").FormDialogCallback) => Promise<any>;
|
|
267
|
+
reload: () => void;
|
|
268
|
+
setSearch: (keyword: string) => void;
|
|
269
|
+
canServerPageable: boolean;
|
|
270
|
+
canServerSearch: boolean;
|
|
271
|
+
canCreate: boolean;
|
|
272
|
+
canUpdate: boolean;
|
|
273
|
+
canDelete: boolean;
|
|
274
|
+
}>;
|
|
275
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
276
|
+
noDataText: string;
|
|
277
|
+
dialogFullscreen: boolean;
|
|
278
|
+
toolbarColor: string;
|
|
279
|
+
importable: boolean;
|
|
280
|
+
exportable: boolean;
|
|
281
|
+
insertable: boolean;
|
|
282
|
+
searchable: boolean;
|
|
283
|
+
modelKey: string;
|
|
284
|
+
modelBy: undefined;
|
|
285
|
+
fields: () => never[];
|
|
286
|
+
viewSwitch: boolean;
|
|
287
|
+
viewSwitchMultiple: boolean;
|
|
288
|
+
cols: number;
|
|
289
|
+
xxl: boolean;
|
|
290
|
+
xl: boolean;
|
|
291
|
+
lg: number;
|
|
292
|
+
md: number;
|
|
293
|
+
sm: number;
|
|
294
|
+
itemsPerPage: number;
|
|
295
|
+
}>>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
296
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
297
|
+
declare const _default: typeof __VLS_export;
|
|
298
|
+
export default _default;
|
|
299
|
+
type __VLS_TypePropsToOption<T> = {
|
|
300
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
301
|
+
type: import('vue').PropType<Required<T>[K]>;
|
|
302
|
+
} : {
|
|
303
|
+
type: import('vue').PropType<T[K]>;
|
|
304
|
+
required: true;
|
|
305
|
+
};
|
|
306
|
+
};
|
|
307
|
+
type __VLS_WithDefaults<P, D> = {
|
|
308
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
|
|
309
|
+
default: D[K];
|
|
310
|
+
}> : P[K];
|
|
311
|
+
};
|
|
312
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
313
|
+
new (): {
|
|
314
|
+
$slots: S;
|
|
315
|
+
};
|
|
316
|
+
};
|
|
317
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
318
|
+
[K in keyof T]: T[K];
|
|
319
|
+
} : {
|
|
320
|
+
[K in keyof T as K]: T[K];
|
|
321
|
+
}) & {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
modelName: string;
|
|
3
|
+
modelBy?: object;
|
|
4
|
+
itemTitle: string | ((result: Record<string, any>) => void);
|
|
5
|
+
fields?: Array<string | object>;
|
|
6
|
+
cache?: boolean | number;
|
|
7
|
+
notFoundText?: string;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
}
|
|
10
|
+
declare var __VLS_1: {
|
|
11
|
+
data: Record<string, any>;
|
|
12
|
+
};
|
|
13
|
+
type __VLS_Slots = {} & {
|
|
14
|
+
default?: (props: typeof __VLS_1) => any;
|
|
15
|
+
};
|
|
16
|
+
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
17
|
+
cache: boolean | number;
|
|
18
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
20
|
+
declare const _default: typeof __VLS_export;
|
|
21
|
+
export default _default;
|
|
22
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
23
|
+
new (): {
|
|
24
|
+
$slots: S;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
@@ -1,54 +1,36 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
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'
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computedAsync } from "@vueuse/core";
|
|
3
|
+
import { useGraphQlOperation } from "../../composables/graphqlOperation";
|
|
8
4
|
import { concat } from "lodash-es";
|
|
9
|
-
import { ref } from
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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 () => {
|
|
5
|
+
import { ref } from "vue";
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
modelName: { type: String, required: true },
|
|
8
|
+
modelBy: { type: Object, required: false },
|
|
9
|
+
itemTitle: { type: [String, Function], required: true },
|
|
10
|
+
fields: { type: Array, required: false },
|
|
11
|
+
cache: { type: [Boolean, Number], required: false, default: false },
|
|
12
|
+
notFoundText: { type: String, required: false },
|
|
13
|
+
placeholder: { type: String, required: false }
|
|
14
|
+
});
|
|
15
|
+
const modelItem = ref({});
|
|
16
|
+
const modelItemValue = computedAsync(async () => {
|
|
33
17
|
if (props.modelName && props.itemTitle) {
|
|
34
|
-
let fields
|
|
35
|
-
if (props.fields) fields = concat(fields, props.fields)
|
|
36
|
-
|
|
37
|
-
const
|
|
38
|
-
const result : Record<string, any> = await useGraphQlOperation('Query',props.modelName,fields,variables,props.cache)
|
|
39
|
-
|
|
18
|
+
let fields = typeof props.itemTitle === "string" ? [props.itemTitle] : [];
|
|
19
|
+
if (props.fields) fields = concat(fields, props.fields);
|
|
20
|
+
const variables = Object.assign({}, props.modelBy);
|
|
21
|
+
const result = await useGraphQlOperation("Query", props.modelName, fields, variables, props.cache);
|
|
40
22
|
try {
|
|
41
23
|
if (result) {
|
|
42
|
-
modelItem.value = result
|
|
43
|
-
if (typeof props.itemTitle === "string") return result[props.itemTitle]
|
|
44
|
-
else return props.itemTitle(result)
|
|
24
|
+
modelItem.value = result;
|
|
25
|
+
if (typeof props.itemTitle === "string") return result[props.itemTitle];
|
|
26
|
+
else return props.itemTitle(result);
|
|
45
27
|
}
|
|
46
28
|
} catch (e) {
|
|
47
|
-
console.error(e)
|
|
29
|
+
console.error(e);
|
|
48
30
|
}
|
|
49
31
|
}
|
|
50
|
-
return props.notFoundText
|
|
51
|
-
}, props.placeholder ??
|
|
32
|
+
return props.notFoundText;
|
|
33
|
+
}, props.placeholder ?? "");
|
|
52
34
|
</script>
|
|
53
35
|
|
|
54
36
|
<template>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
modelName: string;
|
|
3
|
+
modelBy?: object;
|
|
4
|
+
itemTitle: string | ((result: Record<string, any>) => void);
|
|
5
|
+
fields?: Array<string | object>;
|
|
6
|
+
cache?: boolean | number;
|
|
7
|
+
notFoundText?: string;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
}
|
|
10
|
+
declare var __VLS_1: {
|
|
11
|
+
data: Record<string, any>;
|
|
12
|
+
};
|
|
13
|
+
type __VLS_Slots = {} & {
|
|
14
|
+
default?: (props: typeof __VLS_1) => any;
|
|
15
|
+
};
|
|
16
|
+
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
17
|
+
cache: boolean | number;
|
|
18
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
20
|
+
declare const _default: typeof __VLS_export;
|
|
21
|
+
export default _default;
|
|
22
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
23
|
+
new (): {
|
|
24
|
+
$slots: S;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
base64String?: string;
|
|
3
|
+
fileName?: string;
|
|
4
|
+
print?: boolean;
|
|
5
|
+
title?: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
9
|
+
"update:print": (...args: any[]) => void;
|
|
10
|
+
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
11
|
+
"onUpdate:print"?: ((...args: any[]) => any) | undefined;
|
|
12
|
+
}>, {
|
|
13
|
+
disabled: boolean;
|
|
14
|
+
print: boolean;
|
|
15
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
declare const _default: typeof __VLS_export;
|
|
17
|
+
export default _default;
|
|
@@ -1,62 +1,39 @@
|
|
|
1
|
-
<script setup
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
1
|
+
<script setup>
|
|
2
|
+
import printJS from "print-js";
|
|
3
|
+
import { ref, watch } from "vue";
|
|
4
|
+
import { useAlert } from "../../composables/alert";
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
base64String: { type: String, required: false },
|
|
7
|
+
fileName: { type: String, required: false },
|
|
8
|
+
print: { type: Boolean, required: false, default: false },
|
|
9
|
+
title: { type: String, required: false },
|
|
10
|
+
disabled: { type: Boolean, required: false, default: false }
|
|
11
|
+
});
|
|
12
|
+
const emit = defineEmits(["update:print"]);
|
|
13
|
+
const isMobile = ref(false);
|
|
14
|
+
const alert = useAlert();
|
|
35
15
|
const openPdf = () => {
|
|
36
16
|
if (/Android|Mobi|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Macintosh/i.test(navigator.userAgent)) {
|
|
37
|
-
isMobile.value = true
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
17
|
+
isMobile.value = true;
|
|
18
|
+
} else {
|
|
40
19
|
printJS({
|
|
41
20
|
printable: props.base64String,
|
|
42
|
-
type:
|
|
21
|
+
type: "pdf",
|
|
43
22
|
base64: true,
|
|
44
23
|
onPrintDialogClose: endLoadPdf,
|
|
45
|
-
onError: (error
|
|
46
|
-
alert?.addAlert({ message: error, alertType:
|
|
47
|
-
}
|
|
48
|
-
})
|
|
24
|
+
onError: (error) => {
|
|
25
|
+
alert?.addAlert({ message: error, alertType: "error" });
|
|
26
|
+
}
|
|
27
|
+
});
|
|
49
28
|
}
|
|
50
|
-
}
|
|
51
|
-
|
|
29
|
+
};
|
|
52
30
|
const endLoadPdf = () => {
|
|
53
|
-
emit(
|
|
54
|
-
isMobile.value = false
|
|
55
|
-
}
|
|
56
|
-
|
|
31
|
+
emit("update:print", false);
|
|
32
|
+
isMobile.value = false;
|
|
33
|
+
};
|
|
57
34
|
watch(() => props.print, () => {
|
|
58
|
-
if (props.print) openPdf()
|
|
59
|
-
})
|
|
35
|
+
if (props.print) openPdf();
|
|
36
|
+
});
|
|
60
37
|
</script>
|
|
61
38
|
|
|
62
39
|
<template>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
base64String?: string;
|
|
3
|
+
fileName?: string;
|
|
4
|
+
print?: boolean;
|
|
5
|
+
title?: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
9
|
+
"update:print": (...args: any[]) => void;
|
|
10
|
+
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
11
|
+
"onUpdate:print"?: ((...args: any[]) => any) | undefined;
|
|
12
|
+
}>, {
|
|
13
|
+
disabled: boolean;
|
|
14
|
+
print: boolean;
|
|
15
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
declare const _default: typeof __VLS_export;
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PdfView displays PDF documents in-app with loading and viewport state management for preview workflows.
|
|
3
|
+
* This doc block is consumed by vue-docgen for generated API documentation.
|
|
4
|
+
*/
|
|
5
|
+
import PDF from 'pdf-vue3';
|
|
6
|
+
interface Props extends /* @vue-ignore */ InstanceType<typeof PDF['$props']> {
|
|
7
|
+
base64String?: string;
|
|
8
|
+
title?: string;
|
|
9
|
+
fileName?: string;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
isPrint?: boolean;
|
|
12
|
+
showBackToTopBtn?: boolean;
|
|
13
|
+
}
|
|
14
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
|
|
15
|
+
base64String: string;
|
|
16
|
+
title: string;
|
|
17
|
+
fileName: string;
|
|
18
|
+
disabled: boolean;
|
|
19
|
+
isPrint: boolean;
|
|
20
|
+
showBackToTopBtn: boolean;
|
|
21
|
+
}>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
22
|
+
closeDialog: (...args: any[]) => void;
|
|
23
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
|
|
24
|
+
base64String: string;
|
|
25
|
+
title: string;
|
|
26
|
+
fileName: string;
|
|
27
|
+
disabled: boolean;
|
|
28
|
+
isPrint: boolean;
|
|
29
|
+
showBackToTopBtn: boolean;
|
|
30
|
+
}>>> & Readonly<{
|
|
31
|
+
onCloseDialog?: ((...args: any[]) => any) | undefined;
|
|
32
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
33
|
+
declare const _default: typeof __VLS_export;
|
|
34
|
+
export default _default;
|
|
35
|
+
type __VLS_TypePropsToOption<T> = {
|
|
36
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
37
|
+
type: import('vue').PropType<Required<T>[K]>;
|
|
38
|
+
} : {
|
|
39
|
+
type: import('vue').PropType<T[K]>;
|
|
40
|
+
required: true;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
type __VLS_WithDefaults<P, D> = {
|
|
44
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
|
|
45
|
+
default: D[K];
|
|
46
|
+
}> : P[K];
|
|
47
|
+
};
|
|
48
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
49
|
+
[K in keyof T]: T[K];
|
|
50
|
+
} : {
|
|
51
|
+
[K in keyof T as K]: T[K];
|
|
52
|
+
}) & {};
|