@hostlink/nuxt-light 1.67.2 → 1.67.3
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/dist/module.json +1 -1
- package/dist/runtime/components/L/ActionBtn.d.vue.ts +12 -10
- package/dist/runtime/components/L/ActionBtn.vue +8 -2
- package/dist/runtime/components/L/ActionBtn.vue.d.ts +12 -10
- package/dist/runtime/components/L/DeleteBtn.d.vue.ts +26 -16
- package/dist/runtime/components/L/DeleteBtn.vue +7 -3
- package/dist/runtime/components/L/DeleteBtn.vue.d.ts +26 -16
- package/dist/runtime/components/L/Table.d.vue.ts +6 -6
- package/dist/runtime/components/L/Table.vue +6 -9
- package/dist/runtime/components/L/Table.vue.d.ts +6 -6
- package/dist/runtime/formkit/Checkbox.vue +2 -2
- package/dist/runtime/formkit/DatePicker.vue +2 -2
- package/dist/runtime/formkit/Editor.vue +2 -2
- package/dist/runtime/formkit/File.vue +2 -2
- package/dist/runtime/formkit/FilePicker.vue +2 -2
- package/dist/runtime/formkit/FileUpload.vue +2 -2
- package/dist/runtime/formkit/GroupSelect.vue +2 -2
- package/dist/runtime/formkit/Input.vue +5 -3
- package/dist/runtime/formkit/InputSelect.vue +2 -2
- package/dist/runtime/formkit/InputXlsx.vue +2 -2
- package/dist/runtime/formkit/OptionGroup.vue +2 -2
- package/dist/runtime/formkit/Radio.vue +2 -2
- package/dist/runtime/formkit/Select.vue +2 -2
- package/dist/runtime/formkit/Textarea.vue +2 -2
- package/dist/runtime/formkit/TimePicker.vue +2 -2
- package/dist/runtime/formkit/useErrorMessage.d.ts +3 -0
- package/dist/runtime/formkit/useErrorMessage.js +34 -0
- package/dist/runtime/plugin.js +1 -2
- package/package.json +6 -2
package/dist/module.json
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
declare var __VLS_8: {};
|
|
2
|
-
type __VLS_Slots = {} & {
|
|
3
|
-
default?: (props: typeof __VLS_8) => any;
|
|
4
|
-
};
|
|
5
|
-
declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
-
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
7
1
|
declare const _default: typeof __VLS_export;
|
|
8
2
|
export default _default;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
+
tooltip: {
|
|
5
|
+
type: StringConstructor;
|
|
6
|
+
default: string;
|
|
12
7
|
};
|
|
13
|
-
}
|
|
8
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
9
|
+
tooltip: {
|
|
10
|
+
type: StringConstructor;
|
|
11
|
+
default: string;
|
|
12
|
+
};
|
|
13
|
+
}>> & Readonly<{}>, {
|
|
14
|
+
tooltip: string;
|
|
15
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
declare var __VLS_8: {};
|
|
2
|
-
type __VLS_Slots = {} & {
|
|
3
|
-
default?: (props: typeof __VLS_8) => any;
|
|
4
|
-
};
|
|
5
|
-
declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
-
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
7
1
|
declare const _default: typeof __VLS_export;
|
|
8
2
|
export default _default;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
+
tooltip: {
|
|
5
|
+
type: StringConstructor;
|
|
6
|
+
default: string;
|
|
12
7
|
};
|
|
13
|
-
}
|
|
8
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
9
|
+
tooltip: {
|
|
10
|
+
type: StringConstructor;
|
|
11
|
+
default: string;
|
|
12
|
+
};
|
|
13
|
+
}>> & Readonly<{}>, {
|
|
14
|
+
tooltip: string;
|
|
15
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -1,20 +1,30 @@
|
|
|
1
1
|
declare const _default: typeof __VLS_export;
|
|
2
2
|
export default _default;
|
|
3
|
-
declare const __VLS_export:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
+
to: (ObjectConstructor | StringConstructor)[];
|
|
5
|
+
icon: {
|
|
6
|
+
type: StringConstructor;
|
|
7
|
+
default: string;
|
|
8
|
+
};
|
|
9
|
+
tooltip: {
|
|
10
|
+
type: StringConstructor;
|
|
11
|
+
default: string;
|
|
12
|
+
};
|
|
13
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
14
|
submit: (...args: any[]) => void;
|
|
12
|
-
}, string, import("vue").PublicProps, Readonly<{
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
16
|
+
to: (ObjectConstructor | StringConstructor)[];
|
|
17
|
+
icon: {
|
|
18
|
+
type: StringConstructor;
|
|
19
|
+
default: string;
|
|
20
|
+
};
|
|
21
|
+
tooltip: {
|
|
22
|
+
type: StringConstructor;
|
|
23
|
+
default: string;
|
|
24
|
+
};
|
|
25
|
+
}>> & Readonly<{
|
|
16
26
|
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
17
|
-
}>, {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
27
|
+
}>, {
|
|
28
|
+
icon: string;
|
|
29
|
+
tooltip: string;
|
|
30
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
import { useQuasar } from "quasar";
|
|
3
3
|
import { useI18n } from "vue-i18n";
|
|
4
4
|
const { t } = useI18n();
|
|
5
|
-
const props = defineProps(
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
to: [String, Object],
|
|
7
|
+
icon: { type: String, default: "sym_o_delete" },
|
|
8
|
+
tooltip: { type: String, default: "" }
|
|
9
|
+
});
|
|
6
10
|
const emit = defineEmits(["submit"]);
|
|
7
11
|
const qua = useQuasar();
|
|
8
12
|
const onDelete = () => {
|
|
@@ -19,7 +23,7 @@ const onDelete = () => {
|
|
|
19
23
|
</script>
|
|
20
24
|
|
|
21
25
|
<template>
|
|
22
|
-
<q-btn flat round :icon="icon
|
|
23
|
-
<
|
|
26
|
+
<q-btn flat round :icon="icon" @click="onDelete">
|
|
27
|
+
<q-tooltip v-if="tooltip">{{ tooltip }}</q-tooltip>
|
|
24
28
|
</q-btn>
|
|
25
29
|
</template>
|
|
@@ -1,20 +1,30 @@
|
|
|
1
1
|
declare const _default: typeof __VLS_export;
|
|
2
2
|
export default _default;
|
|
3
|
-
declare const __VLS_export:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
+
to: (ObjectConstructor | StringConstructor)[];
|
|
5
|
+
icon: {
|
|
6
|
+
type: StringConstructor;
|
|
7
|
+
default: string;
|
|
8
|
+
};
|
|
9
|
+
tooltip: {
|
|
10
|
+
type: StringConstructor;
|
|
11
|
+
default: string;
|
|
12
|
+
};
|
|
13
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
14
|
submit: (...args: any[]) => void;
|
|
12
|
-
}, string, import("vue").PublicProps, Readonly<{
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
16
|
+
to: (ObjectConstructor | StringConstructor)[];
|
|
17
|
+
icon: {
|
|
18
|
+
type: StringConstructor;
|
|
19
|
+
default: string;
|
|
20
|
+
};
|
|
21
|
+
tooltip: {
|
|
22
|
+
type: StringConstructor;
|
|
23
|
+
default: string;
|
|
24
|
+
};
|
|
25
|
+
}>> & Readonly<{
|
|
16
26
|
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
17
|
-
}>, {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
27
|
+
}>, {
|
|
28
|
+
icon: string;
|
|
29
|
+
tooltip: string;
|
|
30
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -79,17 +79,17 @@ export interface LTableRequest {
|
|
|
79
79
|
}) => void;
|
|
80
80
|
}
|
|
81
81
|
declare function requestServerInteraction(): void;
|
|
82
|
-
declare var
|
|
82
|
+
declare var __VLS_114: any, __VLS_117: string, __VLS_118: any, __VLS_149: any, __VLS_152: any, __VLS_322: string, __VLS_323: any;
|
|
83
83
|
type __VLS_Slots = {} & {
|
|
84
|
-
[K in NonNullable<typeof
|
|
84
|
+
[K in NonNullable<typeof __VLS_117>]?: (props: typeof __VLS_118) => any;
|
|
85
85
|
} & {
|
|
86
|
-
[K in NonNullable<typeof
|
|
86
|
+
[K in NonNullable<typeof __VLS_322>]?: (props: typeof __VLS_323) => any;
|
|
87
87
|
} & {
|
|
88
|
-
actions?: (props: typeof
|
|
88
|
+
actions?: (props: typeof __VLS_114) => any;
|
|
89
89
|
} & {
|
|
90
|
-
'row-expand'?: (props: typeof
|
|
90
|
+
'row-expand'?: (props: typeof __VLS_149) => any;
|
|
91
91
|
} & {
|
|
92
|
-
'top-right'?: (props: typeof
|
|
92
|
+
'top-right'?: (props: typeof __VLS_152) => any;
|
|
93
93
|
};
|
|
94
94
|
declare const __VLS_base: import("vue").DefineComponent<LTableProps, {
|
|
95
95
|
requestServerInteraction: typeof requestServerInteraction;
|
|
@@ -597,21 +597,18 @@ const hasFilters = computed(() => {
|
|
|
597
597
|
|
|
598
598
|
<l-action-btn v-if="actionView && props.row.canView"
|
|
599
599
|
:to="`/${modelName}/${props.row[primaryKey]}/view`"
|
|
600
|
-
:icon="light.styles.table.actionIcons.view"
|
|
601
|
-
|
|
602
|
-
</l-action-btn>
|
|
600
|
+
:icon="light.styles.table.actionIcons.view"
|
|
601
|
+
:tooltip="$t('View')" />
|
|
603
602
|
|
|
604
603
|
<l-action-btn v-if="activeEdit && props.row.canUpdate"
|
|
605
604
|
:to="`/${modelName}/${props.row[primaryKey]}/edit`"
|
|
606
|
-
:icon="light.styles.table.actionIcons.edit"
|
|
607
|
-
|
|
608
|
-
</l-action-btn>
|
|
605
|
+
:icon="light.styles.table.actionIcons.edit"
|
|
606
|
+
:tooltip="$t('Edit')" />
|
|
609
607
|
|
|
610
608
|
<l-delete-btn v-if="actionDelete && props.row.canDelete"
|
|
611
609
|
:icon="light.styles.table.actionIcons.delete"
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
</l-delete-btn>
|
|
610
|
+
:tooltip="$t('Delete')"
|
|
611
|
+
@submit="onDelete(props.row[primaryKey])" size="sm" />
|
|
615
612
|
|
|
616
613
|
<slot name="actions" v-bind="props"></slot>
|
|
617
614
|
</div>
|
|
@@ -79,17 +79,17 @@ export interface LTableRequest {
|
|
|
79
79
|
}) => void;
|
|
80
80
|
}
|
|
81
81
|
declare function requestServerInteraction(): void;
|
|
82
|
-
declare var
|
|
82
|
+
declare var __VLS_114: any, __VLS_117: string, __VLS_118: any, __VLS_149: any, __VLS_152: any, __VLS_322: string, __VLS_323: any;
|
|
83
83
|
type __VLS_Slots = {} & {
|
|
84
|
-
[K in NonNullable<typeof
|
|
84
|
+
[K in NonNullable<typeof __VLS_117>]?: (props: typeof __VLS_118) => any;
|
|
85
85
|
} & {
|
|
86
|
-
[K in NonNullable<typeof
|
|
86
|
+
[K in NonNullable<typeof __VLS_322>]?: (props: typeof __VLS_323) => any;
|
|
87
87
|
} & {
|
|
88
|
-
actions?: (props: typeof
|
|
88
|
+
actions?: (props: typeof __VLS_114) => any;
|
|
89
89
|
} & {
|
|
90
|
-
'row-expand'?: (props: typeof
|
|
90
|
+
'row-expand'?: (props: typeof __VLS_149) => any;
|
|
91
91
|
} & {
|
|
92
|
-
'top-right'?: (props: typeof
|
|
92
|
+
'top-right'?: (props: typeof __VLS_152) => any;
|
|
93
93
|
};
|
|
94
94
|
declare const __VLS_base: import("vue").DefineComponent<LTableProps, {
|
|
95
95
|
requestServerInteraction: typeof requestServerInteraction;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import {
|
|
2
|
+
import { useErrorMessage } from "./useErrorMessage";
|
|
3
3
|
import { computed } from "vue";
|
|
4
4
|
const props = defineProps({
|
|
5
5
|
context: Object
|
|
@@ -8,7 +8,7 @@ const value = computed({
|
|
|
8
8
|
get: () => props.context.value,
|
|
9
9
|
set: (val) => props.context.node.input(val)
|
|
10
10
|
});
|
|
11
|
-
const { error, errorMessage } =
|
|
11
|
+
const { error, errorMessage } = useErrorMessage(props.context.node);
|
|
12
12
|
</script>
|
|
13
13
|
|
|
14
14
|
<template>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed } from "vue";
|
|
3
|
-
import {
|
|
3
|
+
import { useErrorMessage } from "./useErrorMessage";
|
|
4
4
|
const props = defineProps({
|
|
5
5
|
context: Object
|
|
6
6
|
});
|
|
7
|
-
const { error, errorMessage } =
|
|
7
|
+
const { error, errorMessage } = useErrorMessage(props.context.node);
|
|
8
8
|
const value = computed({
|
|
9
9
|
get: () => props.context.value,
|
|
10
10
|
set: (val) => props.context.node.input(val)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed } from "vue";
|
|
3
|
-
import {
|
|
3
|
+
import { useErrorMessage } from "./useErrorMessage";
|
|
4
4
|
const props = defineProps({
|
|
5
5
|
context: Object
|
|
6
6
|
});
|
|
7
|
-
const { error, errorMessage } =
|
|
7
|
+
const { error, errorMessage } = useErrorMessage(props.context.node);
|
|
8
8
|
const value = computed({
|
|
9
9
|
get: () => props.context.value,
|
|
10
10
|
set: (val) => props.context.node.input(val)
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed } from "vue";
|
|
3
|
-
import {
|
|
3
|
+
import { useErrorMessage } from "./useErrorMessage";
|
|
4
4
|
import { useLight } from "#imports";
|
|
5
5
|
const props = defineProps({
|
|
6
6
|
context: Object
|
|
7
7
|
});
|
|
8
|
-
const { error, errorMessage } =
|
|
8
|
+
const { error, errorMessage } = useErrorMessage(props.context.node);
|
|
9
9
|
const value = computed({
|
|
10
10
|
get: () => props.context.value,
|
|
11
11
|
set: (val) => props.context.node.input(val)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed } from "vue";
|
|
3
|
-
import {
|
|
3
|
+
import { useErrorMessage } from "./useErrorMessage";
|
|
4
4
|
const props = defineProps({
|
|
5
5
|
context: Object
|
|
6
6
|
});
|
|
7
|
-
const { error, errorMessage } =
|
|
7
|
+
const { error, errorMessage } = useErrorMessage(props.context.node);
|
|
8
8
|
const value = computed({
|
|
9
9
|
get: () => props.context.value,
|
|
10
10
|
set: (val) => props.context.node.input(val)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed } from "vue";
|
|
3
|
-
import {
|
|
3
|
+
import { useErrorMessage } from "./useErrorMessage";
|
|
4
4
|
const props = defineProps({
|
|
5
5
|
context: Object
|
|
6
6
|
});
|
|
7
|
-
const { error, errorMessage } =
|
|
7
|
+
const { error, errorMessage } = useErrorMessage(props.context.node);
|
|
8
8
|
const value = computed({
|
|
9
9
|
get: () => props.context.value,
|
|
10
10
|
set: (val) => props.context.node.input(val)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import {
|
|
2
|
+
import { useErrorMessage } from "./useErrorMessage";
|
|
3
3
|
import { computed } from "vue";
|
|
4
4
|
const props = defineProps({
|
|
5
5
|
context: Object
|
|
6
6
|
});
|
|
7
|
-
const { error, errorMessage } =
|
|
7
|
+
const { error, errorMessage } = useErrorMessage(props.context.node);
|
|
8
8
|
const value = computed({
|
|
9
9
|
get: () => props.context.value,
|
|
10
10
|
set: (val) => props.context.node.input(val)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { computed } from "vue";
|
|
3
|
-
import {
|
|
2
|
+
import { computed, ref } from "vue";
|
|
3
|
+
import { useErrorMessage } from "./useErrorMessage";
|
|
4
4
|
import { useI18n } from "vue-i18n";
|
|
5
5
|
const props = defineProps({
|
|
6
6
|
context: {
|
|
@@ -9,7 +9,9 @@ const props = defineProps({
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const { t } = useI18n();
|
|
12
|
-
const
|
|
12
|
+
const error = ref(false);
|
|
13
|
+
const errorMessage = ref("");
|
|
14
|
+
useErrorMessage(props.context.node, error, errorMessage);
|
|
13
15
|
const value = computed({
|
|
14
16
|
get: () => props.context?.value,
|
|
15
17
|
set: (val) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed } from "vue";
|
|
3
|
-
import {
|
|
3
|
+
import { useErrorMessage } from "./useErrorMessage";
|
|
4
4
|
import { useI18n } from "vue-i18n";
|
|
5
5
|
const props = defineProps({
|
|
6
6
|
context: {
|
|
@@ -9,7 +9,7 @@ const props = defineProps({
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const { t } = useI18n();
|
|
12
|
-
const { error, errorMessage } =
|
|
12
|
+
const { error, errorMessage } = useErrorMessage(props.context.node);
|
|
13
13
|
const value = computed({
|
|
14
14
|
get: () => props.context?.value,
|
|
15
15
|
set: (val) => props.context.node.input(val)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed } from "vue";
|
|
3
|
-
import {
|
|
3
|
+
import { useErrorMessage } from "./useErrorMessage";
|
|
4
4
|
const props = defineProps({
|
|
5
5
|
context: Object
|
|
6
6
|
});
|
|
7
|
-
const { error, errorMessage } =
|
|
7
|
+
const { error, errorMessage } = useErrorMessage(props.context.node);
|
|
8
8
|
const value = computed({
|
|
9
9
|
get: () => props.context.value,
|
|
10
10
|
set: (val) => props.context.node.input(val)
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { useLight } from "#imports";
|
|
3
3
|
import { computed } from "vue";
|
|
4
|
-
import {
|
|
4
|
+
import { useErrorMessage } from "./useErrorMessage";
|
|
5
5
|
const light = useLight();
|
|
6
6
|
const props = defineProps({
|
|
7
7
|
context: Object
|
|
8
8
|
});
|
|
9
|
-
const { error, errorMessage } =
|
|
9
|
+
const { error, errorMessage } = useErrorMessage(props.context.node);
|
|
10
10
|
const value = computed({
|
|
11
11
|
get: () => props.context.value,
|
|
12
12
|
set: (val) => props.context.node.input(val)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed } from "vue";
|
|
3
|
-
import {
|
|
3
|
+
import { useErrorMessage } from "./useErrorMessage";
|
|
4
4
|
const props = defineProps({
|
|
5
5
|
context: Object
|
|
6
6
|
});
|
|
7
|
-
const { error, errorMessage } =
|
|
7
|
+
const { error, errorMessage } = useErrorMessage(props.context.node);
|
|
8
8
|
const value = computed({
|
|
9
9
|
get: () => props.context.value,
|
|
10
10
|
set: (val) => props.context.node.input(val)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import {
|
|
2
|
+
import { useErrorMessage } from "./useErrorMessage";
|
|
3
3
|
import { computed } from "vue";
|
|
4
4
|
const props = defineProps({
|
|
5
5
|
context: Object
|
|
6
6
|
});
|
|
7
|
-
const { error, errorMessage } =
|
|
7
|
+
const { error, errorMessage } = useErrorMessage(props.context.node);
|
|
8
8
|
const value = computed({
|
|
9
9
|
get: () => props.context.value,
|
|
10
10
|
set: (val) => props.context.node.input(val)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed } from "vue";
|
|
3
|
-
import {
|
|
3
|
+
import { useErrorMessage } from "./useErrorMessage";
|
|
4
4
|
import { useI18n } from "vue-i18n";
|
|
5
5
|
const props = defineProps({
|
|
6
6
|
context: {
|
|
@@ -9,7 +9,7 @@ const props = defineProps({
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const { t } = useI18n();
|
|
12
|
-
const { error, errorMessage } =
|
|
12
|
+
const { error, errorMessage } = useErrorMessage(props.context.node);
|
|
13
13
|
const value = computed({
|
|
14
14
|
get: () => props.context?.value,
|
|
15
15
|
set: (val) => {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed } from "vue";
|
|
3
|
-
import {
|
|
3
|
+
import { useErrorMessage } from "./useErrorMessage";
|
|
4
4
|
const props = defineProps({
|
|
5
5
|
context: Object
|
|
6
6
|
});
|
|
7
|
-
const { error, errorMessage } =
|
|
7
|
+
const { error, errorMessage } = useErrorMessage(props.context.node);
|
|
8
8
|
const value = computed({
|
|
9
9
|
get: () => props.context.value,
|
|
10
10
|
set: (val) => props.context.node.input(val)
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { getValidationMessages } from "@formkit/validation";
|
|
2
|
+
export function useErrorMessage(node, error, errorMessage) {
|
|
3
|
+
const showErrorMessage = (msg) => {
|
|
4
|
+
if (msg.name === "message-updated") {
|
|
5
|
+
if (msg.payload.type === "validation") {
|
|
6
|
+
errorMessage.value = msg.payload.value;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
if (msg.name === "message-removed") {
|
|
10
|
+
if (msg.payload.type === "validation") {
|
|
11
|
+
errorMessage.value = "";
|
|
12
|
+
error.value = false;
|
|
13
|
+
}
|
|
14
|
+
if (msg.payload.type === "state") {
|
|
15
|
+
error.value = false;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
if (msg.name === "message-added") {
|
|
19
|
+
errorMessage.value = "";
|
|
20
|
+
error.value = false;
|
|
21
|
+
const messages = getValidationMessages(node);
|
|
22
|
+
for (const message of messages) {
|
|
23
|
+
if (message[0]) {
|
|
24
|
+
errorMessage.value = message[1][0].value;
|
|
25
|
+
error.value = true;
|
|
26
|
+
break;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
const events = ["message-added", "message-removed", "message-updated"];
|
|
32
|
+
const receipts = events.map((event) => node.on(event, showErrorMessage));
|
|
33
|
+
return () => receipts.forEach((receipt) => node.off(receipt));
|
|
34
|
+
}
|
package/dist/runtime/plugin.js
CHANGED
|
@@ -8,7 +8,6 @@ import "./assets/main.css";
|
|
|
8
8
|
import message_en from "./locales/en.json";
|
|
9
9
|
import message_zh from "./locales/zh-hk.json";
|
|
10
10
|
localStorage.getItem("locale") || localStorage.setItem("locale", "en");
|
|
11
|
-
import { createQuasarPlugin } from "formkit-quasar";
|
|
12
11
|
import { createLightPlugin } from "./formkit/index.js";
|
|
13
12
|
import { plugin, defaultConfig } from "@formkit/vue";
|
|
14
13
|
import getApiBase from "./composables/getApiBase.js";
|
|
@@ -61,7 +60,7 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|
|
61
60
|
locale = "zhTW";
|
|
62
61
|
}
|
|
63
62
|
nuxtApp.vueApp.use(plugin, defaultConfig({
|
|
64
|
-
plugins: [
|
|
63
|
+
plugins: [createLightPlugin()],
|
|
65
64
|
locales: {
|
|
66
65
|
zhTW
|
|
67
66
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hostlink/nuxt-light",
|
|
3
|
-
"version": "1.67.
|
|
3
|
+
"version": "1.67.3",
|
|
4
4
|
"description": "HostLink Nuxt Light Framework",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -32,7 +32,12 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@azure/msal-browser": "^4.26.2",
|
|
35
|
+
"@formkit/core": "^1.7.2",
|
|
35
36
|
"@formkit/drag-and-drop": "^0.5.3",
|
|
37
|
+
"@formkit/i18n": "^1.7.2",
|
|
38
|
+
"@formkit/inputs": "^1.7.2",
|
|
39
|
+
"@formkit/validation": "^1.7.2",
|
|
40
|
+
"@formkit/vue": "^1.7.2",
|
|
36
41
|
"@hostlink/light": "^3.2.7",
|
|
37
42
|
"@nuxt/module-builder": "^1.0.1",
|
|
38
43
|
"@quasar/extras": "^1.17.0",
|
|
@@ -42,7 +47,6 @@
|
|
|
42
47
|
"defu": "^6.1.4",
|
|
43
48
|
"diff2html": "^3.4.47",
|
|
44
49
|
"dompurify": "^3.3.1",
|
|
45
|
-
"formkit-quasar": "^0.0.15",
|
|
46
50
|
"json-to-graphql-query": "^2.3.0",
|
|
47
51
|
"nuxt-quasar-ui": "^3.0.0",
|
|
48
52
|
"quasar": "^2.18.5",
|