@ramathibodi/nuxt-commons 0.1.74 → 4.0.0
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 -58
- 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,62 @@
|
|
|
1
|
+
import { VInput } from 'vuetify/components/VInput';
|
|
2
|
+
import { type Base64Asset } from '../../composables/assetFile.js';
|
|
3
|
+
interface SignatureProps extends /* @vue-ignore */ InstanceType<typeof VInput['$props']> {
|
|
4
|
+
title?: string;
|
|
5
|
+
btnName?: string;
|
|
6
|
+
titleConfirm?: string;
|
|
7
|
+
penColor?: string;
|
|
8
|
+
/** hydrate when id is present but base64String is missing */
|
|
9
|
+
autoHydrate?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Public props accepted by FormSignPad.
|
|
13
|
+
* Document each prop field with intent, defaults, and side effects for clear generated docs.
|
|
14
|
+
*/
|
|
15
|
+
type __VLS_Props = SignatureProps;
|
|
16
|
+
type __VLS_ModelProps = {
|
|
17
|
+
modelValue?: Base64Asset | string | null;
|
|
18
|
+
};
|
|
19
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
20
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_PublicProps>, {
|
|
21
|
+
title: string;
|
|
22
|
+
btnName: string;
|
|
23
|
+
titleConfirm: string;
|
|
24
|
+
penColor: string;
|
|
25
|
+
autoHydrate: boolean;
|
|
26
|
+
}>>, {
|
|
27
|
+
errorMessages: import("vue").ComputedRef<(string & string[]) | (readonly string[] & string[]) | undefined>;
|
|
28
|
+
isValid: import("vue").ComputedRef<boolean | null | undefined>;
|
|
29
|
+
reset: () => Promise<void> | undefined;
|
|
30
|
+
resetValidation: () => Promise<void> | undefined;
|
|
31
|
+
validate: () => Promise<string[]> | undefined;
|
|
32
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
33
|
+
"update:modelValue": (value: string | Base64Asset | null) => any;
|
|
34
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_PublicProps>, {
|
|
35
|
+
title: string;
|
|
36
|
+
btnName: string;
|
|
37
|
+
titleConfirm: string;
|
|
38
|
+
penColor: string;
|
|
39
|
+
autoHydrate: boolean;
|
|
40
|
+
}>>> & Readonly<{
|
|
41
|
+
"onUpdate:modelValue"?: ((value: string | Base64Asset | null) => any) | undefined;
|
|
42
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
43
|
+
declare const _default: typeof __VLS_export;
|
|
44
|
+
export default _default;
|
|
45
|
+
type __VLS_TypePropsToOption<T> = {
|
|
46
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
47
|
+
type: import('vue').PropType<Required<T>[K]>;
|
|
48
|
+
} : {
|
|
49
|
+
type: import('vue').PropType<T[K]>;
|
|
50
|
+
required: true;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
type __VLS_WithDefaults<P, D> = {
|
|
54
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
|
|
55
|
+
default: D[K];
|
|
56
|
+
}> : P[K];
|
|
57
|
+
};
|
|
58
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
59
|
+
[K in keyof T]: T[K];
|
|
60
|
+
} : {
|
|
61
|
+
[K in keyof T as K]: T[K];
|
|
62
|
+
}) & {};
|
|
@@ -1,161 +1,115 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Public props accepted by FormSignPad.
|
|
22
|
-
* Document each prop field with intent, defaults, and side effects for clear generated docs.
|
|
23
|
-
*/
|
|
24
|
-
const props = withDefaults(defineProps<SignatureProps>(), {
|
|
25
|
-
title: 'Signature',
|
|
26
|
-
btnName: 'Draw Your Signature',
|
|
27
|
-
titleConfirm: 'I Accept My Signature',
|
|
28
|
-
penColor: '#303F9F',
|
|
29
|
-
autoHydrate: true,
|
|
30
|
-
})
|
|
31
|
-
|
|
32
|
-
const { hydrateAssetFile } = useAssetFile()
|
|
33
|
-
|
|
34
|
-
const model = defineModel<Base64Asset | string | null>({ default: null })
|
|
35
|
-
|
|
36
|
-
// refs
|
|
37
|
-
const inputRef = ref<InstanceType<typeof VInput> | null>(null)
|
|
38
|
-
const signaturePadRef = ref<InstanceType<typeof VueSignaturePad> | null>(null)
|
|
39
|
-
|
|
40
|
-
const isDialogOpen = ref(false)
|
|
41
|
-
|
|
42
|
-
// signature pad options from props
|
|
1
|
+
<script setup>
|
|
2
|
+
import { VueSignaturePad } from "vue-signature-pad";
|
|
3
|
+
import { VInput } from "vuetify/components/VInput";
|
|
4
|
+
import { ref, computed, useAttrs, watch } from "vue";
|
|
5
|
+
import { useAssetFile } from "../../composables/assetFile";
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
title: { type: String, required: false, default: "Signature" },
|
|
8
|
+
btnName: { type: String, required: false, default: "Draw Your Signature" },
|
|
9
|
+
titleConfirm: { type: String, required: false, default: "I Accept My Signature" },
|
|
10
|
+
penColor: { type: String, required: false, default: "#303F9F" },
|
|
11
|
+
autoHydrate: { type: Boolean, required: false, default: true }
|
|
12
|
+
});
|
|
13
|
+
const { hydrateAssetFile } = useAssetFile();
|
|
14
|
+
const attrs = useAttrs();
|
|
15
|
+
const model = defineModel({ type: [Object, String, null], ...{ default: null } });
|
|
16
|
+
const inputRef = ref(null);
|
|
17
|
+
const signaturePadRef = ref(null);
|
|
18
|
+
const isDialogOpen = ref(false);
|
|
43
19
|
const signatureOptions = computed(() => ({
|
|
44
20
|
penColor: props.penColor,
|
|
45
21
|
minWidth: 0.5,
|
|
46
|
-
maxWidth: 4
|
|
47
|
-
}))
|
|
48
|
-
|
|
49
|
-
// internal normalized value
|
|
50
|
-
const normalized = ref<Base64Asset | null>(null)
|
|
22
|
+
maxWidth: 4
|
|
23
|
+
}));
|
|
24
|
+
const normalized = ref(null);
|
|
51
25
|
const imageDataUrl = computed(() => {
|
|
52
|
-
const val = normalized.value
|
|
53
|
-
if (!val?.base64String) return
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
if (input == null) return null
|
|
64
|
-
return typeof input === 'string' ? { base64String: input } : input
|
|
26
|
+
const val = normalized.value;
|
|
27
|
+
if (!val?.base64String) return void 0;
|
|
28
|
+
return useAssetFile().ensureDataUrl(val.base64String.trim(), val.fileType || "image/png");
|
|
29
|
+
});
|
|
30
|
+
const cardVariant = computed(() => {
|
|
31
|
+
return attrs.variant;
|
|
32
|
+
});
|
|
33
|
+
let syncing = false;
|
|
34
|
+
function wrapToAsset(input) {
|
|
35
|
+
if (input == null) return null;
|
|
36
|
+
return typeof input === "string" ? { base64String: input } : input;
|
|
65
37
|
}
|
|
66
|
-
|
|
67
|
-
/** Normalize & (optionally) hydrate whenever external model changes */
|
|
68
38
|
watch(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
if (typeof val === 'string') {
|
|
79
|
-
model.value = asAsset
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
// Hydrate if requested and needed (id present, no base64String)
|
|
83
|
-
if (props.autoHydrate && asAsset?.id != null && !asAsset.base64String) {
|
|
84
|
-
await hydrateAssetFile(asAsset) // mutates asAsset in-place
|
|
85
|
-
// reflect hydrated base64String back to parent (guarded)
|
|
86
|
-
model.value = asAsset
|
|
87
|
-
}
|
|
88
|
-
} finally {
|
|
89
|
-
syncing = false
|
|
39
|
+
model,
|
|
40
|
+
async (val) => {
|
|
41
|
+
if (syncing) return;
|
|
42
|
+
syncing = true;
|
|
43
|
+
try {
|
|
44
|
+
const asAsset = wrapToAsset(val);
|
|
45
|
+
normalized.value = asAsset;
|
|
46
|
+
if (typeof val === "string") {
|
|
47
|
+
model.value = asAsset;
|
|
90
48
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
49
|
+
if (props.autoHydrate && asAsset?.id != null && !asAsset.base64String) {
|
|
50
|
+
await hydrateAssetFile(asAsset);
|
|
51
|
+
model.value = asAsset;
|
|
52
|
+
}
|
|
53
|
+
} finally {
|
|
54
|
+
syncing = false;
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
{ immediate: true }
|
|
58
|
+
);
|
|
59
|
+
const undoSignature = () => signaturePadRef.value?.undoSignature();
|
|
60
|
+
const clearSignature = () => signaturePadRef.value?.clearSignature();
|
|
99
61
|
const closeDialog = () => {
|
|
100
|
-
isDialogOpen.value = false
|
|
101
|
-
signaturePadRef.value?.clearSignature()
|
|
102
|
-
signaturePadRef.value?.clearCacheImages?.()
|
|
103
|
-
}
|
|
104
|
-
|
|
62
|
+
isDialogOpen.value = false;
|
|
63
|
+
signaturePadRef.value?.clearSignature();
|
|
64
|
+
signaturePadRef.value?.clearCacheImages?.();
|
|
65
|
+
};
|
|
105
66
|
const saveSignature = () => {
|
|
106
|
-
isDialogOpen.value = false
|
|
107
|
-
const result = signaturePadRef.value?.saveSignature()
|
|
108
|
-
if (!result) return
|
|
109
|
-
const { isEmpty, data } = result
|
|
67
|
+
isDialogOpen.value = false;
|
|
68
|
+
const result = signaturePadRef.value?.saveSignature();
|
|
69
|
+
if (!result) return;
|
|
70
|
+
const { isEmpty, data } = result;
|
|
110
71
|
if (isEmpty) {
|
|
111
|
-
normalized.value = null
|
|
112
|
-
model.value = null
|
|
72
|
+
normalized.value = null;
|
|
73
|
+
model.value = null;
|
|
113
74
|
} else {
|
|
114
|
-
const asset
|
|
115
|
-
normalized.value = asset
|
|
116
|
-
model.value = asset
|
|
75
|
+
const asset = { base64String: data };
|
|
76
|
+
normalized.value = asset;
|
|
77
|
+
model.value = asset;
|
|
117
78
|
}
|
|
118
|
-
}
|
|
119
|
-
|
|
79
|
+
};
|
|
120
80
|
const openSignatureDialog = async () => {
|
|
121
|
-
// ensure hydration before opening to preview correctly
|
|
122
81
|
if (props.autoHydrate && normalized.value?.id != null && !normalized.value.base64String) {
|
|
123
|
-
await hydrateAssetFile(normalized.value)
|
|
124
|
-
model.value = normalized.value
|
|
82
|
+
await hydrateAssetFile(normalized.value);
|
|
83
|
+
model.value = normalized.value;
|
|
125
84
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
const existing = normalized.value?.base64String
|
|
85
|
+
isDialogOpen.value = true;
|
|
86
|
+
const existing = normalized.value?.base64String;
|
|
130
87
|
if (existing) {
|
|
131
|
-
|
|
132
|
-
requestAnimationFrame(() => signaturePadRef.value?.fromDataURL(existing))
|
|
88
|
+
requestAnimationFrame(() => signaturePadRef.value?.fromDataURL(existing));
|
|
133
89
|
}
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
const isValid = computed(() => inputRef.value?.isValid)
|
|
138
|
-
const errorMessages = computed(() => inputRef.value?.errorMessages)
|
|
139
|
-
|
|
90
|
+
};
|
|
91
|
+
const isValid = computed(() => inputRef.value?.isValid);
|
|
92
|
+
const errorMessages = computed(() => inputRef.value?.errorMessages);
|
|
140
93
|
defineExpose({
|
|
141
94
|
errorMessages,
|
|
142
95
|
isValid,
|
|
143
96
|
reset: () => inputRef.value?.reset(),
|
|
144
97
|
resetValidation: () => inputRef.value?.resetValidation(),
|
|
145
|
-
validate: () => inputRef.value?.validate()
|
|
146
|
-
})
|
|
98
|
+
validate: () => inputRef.value?.validate()
|
|
99
|
+
});
|
|
147
100
|
</script>
|
|
148
101
|
|
|
149
102
|
<template>
|
|
150
103
|
<v-input v-model="model" v-bind="$attrs" ref="inputRef">
|
|
151
104
|
<template #default="{ isReadonly, isDisabled }">
|
|
152
|
-
<v-card class="w-100" flat :variant="
|
|
105
|
+
<v-card class="w-100" flat :variant="cardVariant" :title="props.title">
|
|
153
106
|
<v-card-text v-if="normalized?.base64String">
|
|
154
107
|
<v-img :src="imageDataUrl" cover />
|
|
155
108
|
<v-icon
|
|
156
109
|
class="position-absolute"
|
|
157
110
|
style="top: 8px; right: 8px; z-index: 10;"
|
|
158
|
-
@click="model = null;
|
|
111
|
+
@click="model = null;
|
|
112
|
+
normalized = null"
|
|
159
113
|
v-if="!isReadonly?.value"
|
|
160
114
|
>
|
|
161
115
|
mdi mdi-close-circle
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { VInput } from 'vuetify/components/VInput';
|
|
2
|
+
import { type Base64Asset } from '../../composables/assetFile.js';
|
|
3
|
+
interface SignatureProps extends /* @vue-ignore */ InstanceType<typeof VInput['$props']> {
|
|
4
|
+
title?: string;
|
|
5
|
+
btnName?: string;
|
|
6
|
+
titleConfirm?: string;
|
|
7
|
+
penColor?: string;
|
|
8
|
+
/** hydrate when id is present but base64String is missing */
|
|
9
|
+
autoHydrate?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Public props accepted by FormSignPad.
|
|
13
|
+
* Document each prop field with intent, defaults, and side effects for clear generated docs.
|
|
14
|
+
*/
|
|
15
|
+
type __VLS_Props = SignatureProps;
|
|
16
|
+
type __VLS_ModelProps = {
|
|
17
|
+
modelValue?: Base64Asset | string | null;
|
|
18
|
+
};
|
|
19
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
20
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_PublicProps>, {
|
|
21
|
+
title: string;
|
|
22
|
+
btnName: string;
|
|
23
|
+
titleConfirm: string;
|
|
24
|
+
penColor: string;
|
|
25
|
+
autoHydrate: boolean;
|
|
26
|
+
}>>, {
|
|
27
|
+
errorMessages: import("vue").ComputedRef<(string & string[]) | (readonly string[] & string[]) | undefined>;
|
|
28
|
+
isValid: import("vue").ComputedRef<boolean | null | undefined>;
|
|
29
|
+
reset: () => Promise<void> | undefined;
|
|
30
|
+
resetValidation: () => Promise<void> | undefined;
|
|
31
|
+
validate: () => Promise<string[]> | undefined;
|
|
32
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
33
|
+
"update:modelValue": (value: string | Base64Asset | null) => any;
|
|
34
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_PublicProps>, {
|
|
35
|
+
title: string;
|
|
36
|
+
btnName: string;
|
|
37
|
+
titleConfirm: string;
|
|
38
|
+
penColor: string;
|
|
39
|
+
autoHydrate: boolean;
|
|
40
|
+
}>>> & Readonly<{
|
|
41
|
+
"onUpdate:modelValue"?: ((value: string | Base64Asset | null) => any) | undefined;
|
|
42
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
43
|
+
declare const _default: typeof __VLS_export;
|
|
44
|
+
export default _default;
|
|
45
|
+
type __VLS_TypePropsToOption<T> = {
|
|
46
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
47
|
+
type: import('vue').PropType<Required<T>[K]>;
|
|
48
|
+
} : {
|
|
49
|
+
type: import('vue').PropType<T[K]>;
|
|
50
|
+
required: true;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
type __VLS_WithDefaults<P, D> = {
|
|
54
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
|
|
55
|
+
default: D[K];
|
|
56
|
+
}> : P[K];
|
|
57
|
+
};
|
|
58
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
59
|
+
[K in keyof T]: T[K];
|
|
60
|
+
} : {
|
|
61
|
+
[K in keyof T as K]: T[K];
|
|
62
|
+
}) & {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FormSystem is a schema-driven form field component that binds model data, renders field UI, and emits normalized updates.
|
|
3
|
+
* This doc block is consumed by vue-docgen for generated API documentation.
|
|
4
|
+
*/
|
|
5
|
+
import Pad from './Pad.vue.js';
|
|
6
|
+
interface Props extends /* @vue-ignore */ InstanceType<typeof Pad['$props']> {
|
|
7
|
+
templateId: string;
|
|
8
|
+
cache?: boolean | number;
|
|
9
|
+
}
|
|
10
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
|
|
11
|
+
cache: boolean;
|
|
12
|
+
}>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
|
|
13
|
+
cache: boolean;
|
|
14
|
+
}>>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
declare const _default: typeof __VLS_export;
|
|
16
|
+
export default _default;
|
|
17
|
+
type __VLS_TypePropsToOption<T> = {
|
|
18
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
19
|
+
type: import('vue').PropType<Required<T>[K]>;
|
|
20
|
+
} : {
|
|
21
|
+
type: import('vue').PropType<T[K]>;
|
|
22
|
+
required: true;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
type __VLS_WithDefaults<P, D> = {
|
|
26
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
|
|
27
|
+
default: D[K];
|
|
28
|
+
}> : P[K];
|
|
29
|
+
};
|
|
30
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
31
|
+
[K in keyof T]: T[K];
|
|
32
|
+
} : {
|
|
33
|
+
[K in keyof T as K]: T[K];
|
|
34
|
+
}) & {};
|
|
@@ -1,35 +1,21 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
* Document each prop field with intent, defaults, and side effects for clear generated docs.
|
|
18
|
-
*/
|
|
19
|
-
const props = withDefaults(defineProps<Props>(),{
|
|
20
|
-
cache: false
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
const currentTemplate = ref<any>({})
|
|
24
|
-
|
|
25
|
-
watch(()=>props.templateId, (newValue) => {
|
|
26
|
-
useGraphQlOperation("Query","systemTemplateById",["template","templateScript"],{id: newValue},props.cache).then(result => {
|
|
27
|
-
currentTemplate.value = result
|
|
28
|
-
}).catch(_error => {
|
|
29
|
-
currentTemplate.value = {}
|
|
30
|
-
})
|
|
31
|
-
})
|
|
1
|
+
<script setup>
|
|
2
|
+
import Pad from "./Pad.vue";
|
|
3
|
+
import { ref, watch } from "vue";
|
|
4
|
+
import { useGraphQlOperation } from "../../composables/graphqlOperation";
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
templateId: { type: String, required: true },
|
|
7
|
+
cache: { type: [Boolean, Number], required: false, default: false }
|
|
8
|
+
});
|
|
9
|
+
const currentTemplate = ref({});
|
|
10
|
+
watch(() => props.templateId, (newValue) => {
|
|
11
|
+
useGraphQlOperation("Query", "systemTemplateById", ["template", "templateScript"], { id: newValue }, props.cache).then((result) => {
|
|
12
|
+
currentTemplate.value = result;
|
|
13
|
+
}).catch((_error) => {
|
|
14
|
+
currentTemplate.value = {};
|
|
15
|
+
});
|
|
16
|
+
});
|
|
32
17
|
</script>
|
|
18
|
+
|
|
33
19
|
<template>
|
|
34
20
|
<FormPad v-bind="$attrs" :template="currentTemplate.template" :template-script="currentTemplate.templateScript" />
|
|
35
|
-
</template>
|
|
21
|
+
</template>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FormSystem is a schema-driven form field component that binds model data, renders field UI, and emits normalized updates.
|
|
3
|
+
* This doc block is consumed by vue-docgen for generated API documentation.
|
|
4
|
+
*/
|
|
5
|
+
import Pad from './Pad.vue.js';
|
|
6
|
+
interface Props extends /* @vue-ignore */ InstanceType<typeof Pad['$props']> {
|
|
7
|
+
templateId: string;
|
|
8
|
+
cache?: boolean | number;
|
|
9
|
+
}
|
|
10
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
|
|
11
|
+
cache: boolean;
|
|
12
|
+
}>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
|
|
13
|
+
cache: boolean;
|
|
14
|
+
}>>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
declare const _default: typeof __VLS_export;
|
|
16
|
+
export default _default;
|
|
17
|
+
type __VLS_TypePropsToOption<T> = {
|
|
18
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
19
|
+
type: import('vue').PropType<Required<T>[K]>;
|
|
20
|
+
} : {
|
|
21
|
+
type: import('vue').PropType<T[K]>;
|
|
22
|
+
required: true;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
type __VLS_WithDefaults<P, D> = {
|
|
26
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
|
|
27
|
+
default: D[K];
|
|
28
|
+
}> : P[K];
|
|
29
|
+
};
|
|
30
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
31
|
+
[K in keyof T]: T[K];
|
|
32
|
+
} : {
|
|
33
|
+
[K in keyof T as K]: T[K];
|
|
34
|
+
}) & {};
|