cja-phoenix 1.2.46 → 1.2.48
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/form/FileInput.d.vue.ts +9 -8
- package/dist/runtime/components/form/FileInput.vue +7 -15
- package/dist/runtime/components/form/FileInput.vue.d.ts +9 -8
- package/dist/runtime/components/form/structure/Title.d.vue.ts +1 -0
- package/dist/runtime/components/form/structure/Title.vue +5 -2
- package/dist/runtime/components/form/structure/Title.vue.d.ts +1 -0
- package/dist/runtime/composables/useFunnelConfig.d.ts +4 -4
- package/dist/runtime/composables/useFunnelConfig.js +24 -7
- package/dist/runtime/utils/uploadFile.d.ts +1 -1
- package/dist/runtime/utils/uploadFile.js +8 -5
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import { type Ref, type InputHTMLAttributes } from
|
|
2
|
-
import type { Lazy, Schema } from
|
|
1
|
+
import { type Ref, type InputHTMLAttributes } from "vue";
|
|
2
|
+
import type { Lazy, Schema } from "yup";
|
|
3
3
|
type __VLS_Props = {
|
|
4
|
-
id?: InputHTMLAttributes[
|
|
5
|
-
layout?:
|
|
6
|
-
size?:
|
|
4
|
+
id?: InputHTMLAttributes["id"];
|
|
5
|
+
layout?: "vertical" | "horizontal";
|
|
6
|
+
size?: "sm" | "md" | "lg";
|
|
7
7
|
title?: string;
|
|
8
8
|
label?: string;
|
|
9
9
|
tooltip?: string;
|
|
10
10
|
placeholder?: string;
|
|
11
11
|
errorDisplay?: boolean;
|
|
12
12
|
description?: string;
|
|
13
|
-
disabled?: InputHTMLAttributes[
|
|
13
|
+
disabled?: InputHTMLAttributes["disabled"];
|
|
14
14
|
validation?: Schema | Lazy<any>;
|
|
15
|
-
validationMode?:
|
|
16
|
-
variant?:
|
|
15
|
+
validationMode?: "change" | "none";
|
|
16
|
+
variant?: "white" | "blue";
|
|
17
17
|
accept?: string[];
|
|
18
18
|
hasDelete?: boolean;
|
|
19
|
+
modal?: any;
|
|
19
20
|
};
|
|
20
21
|
type __VLS_ModelProps = {
|
|
21
22
|
modelValue: any;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<FormStructureContainer v-bind="{ layout }">
|
|
3
3
|
<FormStructureTitle
|
|
4
4
|
v-if="title"
|
|
5
|
-
v-bind="{ title, tooltip, size, disabled }"
|
|
5
|
+
v-bind="{ title, tooltip, size, disabled, modal }"
|
|
6
6
|
/>
|
|
7
7
|
|
|
8
8
|
<div
|
|
@@ -18,10 +18,7 @@
|
|
|
18
18
|
]"
|
|
19
19
|
@click="handleInput"
|
|
20
20
|
>
|
|
21
|
-
<span
|
|
22
|
-
v-if="variant == 'white'"
|
|
23
|
-
class="m-cgg-icon--document"
|
|
24
|
-
/>
|
|
21
|
+
<span v-if="variant == 'white'" class="m-cgg-icon--document" />
|
|
25
22
|
<div class="input-text-wrapper">
|
|
26
23
|
<div class="input-text">
|
|
27
24
|
{{
|
|
@@ -30,19 +27,13 @@
|
|
|
30
27
|
</div>
|
|
31
28
|
</div>
|
|
32
29
|
<div class="icon-wrapper">
|
|
33
|
-
<span
|
|
34
|
-
v-if="!model?.name"
|
|
35
|
-
class="m-cgg-icon--upload"
|
|
36
|
-
/>
|
|
30
|
+
<span v-if="!model?.name" class="m-cgg-icon--upload" />
|
|
37
31
|
<span
|
|
38
32
|
v-else-if="model?.name && hasDelete"
|
|
39
33
|
class="m-cgg-icon--cross"
|
|
40
34
|
@click.stop="deleteFile"
|
|
41
35
|
/>
|
|
42
|
-
<span
|
|
43
|
-
v-else-if="model?.name"
|
|
44
|
-
class="m-cgg-icon--change"
|
|
45
|
-
/>
|
|
36
|
+
<span v-else-if="model?.name" class="m-cgg-icon--change" />
|
|
46
37
|
</div>
|
|
47
38
|
</div>
|
|
48
39
|
|
|
@@ -54,7 +45,7 @@
|
|
|
54
45
|
:aria-label="label || title"
|
|
55
46
|
:accept="accept?.map((a) => `.${a}`).join(',')"
|
|
56
47
|
@change="updateFile"
|
|
57
|
-
|
|
48
|
+
/>
|
|
58
49
|
|
|
59
50
|
<FormStructureDescription
|
|
60
51
|
v-if="description"
|
|
@@ -86,7 +77,8 @@ const props = defineProps({
|
|
|
86
77
|
validationMode: { type: String, required: false, default: "change" },
|
|
87
78
|
variant: { type: String, required: false, default: "white" },
|
|
88
79
|
accept: { type: Array, required: false },
|
|
89
|
-
hasDelete: { type: Boolean, required: false }
|
|
80
|
+
hasDelete: { type: Boolean, required: false },
|
|
81
|
+
modal: { type: null, required: false }
|
|
90
82
|
});
|
|
91
83
|
const model = defineModel({
|
|
92
84
|
required: true
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import { type Ref, type InputHTMLAttributes } from
|
|
2
|
-
import type { Lazy, Schema } from
|
|
1
|
+
import { type Ref, type InputHTMLAttributes } from "vue";
|
|
2
|
+
import type { Lazy, Schema } from "yup";
|
|
3
3
|
type __VLS_Props = {
|
|
4
|
-
id?: InputHTMLAttributes[
|
|
5
|
-
layout?:
|
|
6
|
-
size?:
|
|
4
|
+
id?: InputHTMLAttributes["id"];
|
|
5
|
+
layout?: "vertical" | "horizontal";
|
|
6
|
+
size?: "sm" | "md" | "lg";
|
|
7
7
|
title?: string;
|
|
8
8
|
label?: string;
|
|
9
9
|
tooltip?: string;
|
|
10
10
|
placeholder?: string;
|
|
11
11
|
errorDisplay?: boolean;
|
|
12
12
|
description?: string;
|
|
13
|
-
disabled?: InputHTMLAttributes[
|
|
13
|
+
disabled?: InputHTMLAttributes["disabled"];
|
|
14
14
|
validation?: Schema | Lazy<any>;
|
|
15
|
-
validationMode?:
|
|
16
|
-
variant?:
|
|
15
|
+
validationMode?: "change" | "none";
|
|
16
|
+
variant?: "white" | "blue";
|
|
17
17
|
accept?: string[];
|
|
18
18
|
hasDelete?: boolean;
|
|
19
|
+
modal?: any;
|
|
19
20
|
};
|
|
20
21
|
type __VLS_ModelProps = {
|
|
21
22
|
modelValue: any;
|
|
@@ -4,6 +4,7 @@ type __VLS_Props = {
|
|
|
4
4
|
tooltip?: string;
|
|
5
5
|
disabled?: InputHTMLAttributes["disabled"];
|
|
6
6
|
size?: "sm" | "md" | "lg";
|
|
7
|
+
modal?: any;
|
|
7
8
|
};
|
|
8
9
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
9
10
|
size: "sm" | "md" | "lg";
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
<div v-if="title" class="input-title" :class="[`size-${size}`, { disabled }]">
|
|
3
3
|
<span>{{ title }}</span>
|
|
4
4
|
<span
|
|
5
|
-
v-if="tooltip"
|
|
5
|
+
v-if="tooltip || modal"
|
|
6
6
|
v-tippy="{ content: tooltip }"
|
|
7
7
|
class="tooltip m-cgg-icon--question"
|
|
8
|
+
@click="modal?.openModal()"
|
|
8
9
|
/>
|
|
9
10
|
</div>
|
|
10
11
|
</template>
|
|
@@ -14,7 +15,8 @@ defineProps({
|
|
|
14
15
|
title: { type: String, required: true },
|
|
15
16
|
tooltip: { type: String, required: false },
|
|
16
17
|
disabled: { type: null, required: false },
|
|
17
|
-
size: { type: String, required: false, default: "md" }
|
|
18
|
+
size: { type: String, required: false, default: "md" },
|
|
19
|
+
modal: { type: null, required: false }
|
|
18
20
|
});
|
|
19
21
|
</script>
|
|
20
22
|
|
|
@@ -30,6 +32,7 @@ defineProps({
|
|
|
30
32
|
.tooltip {
|
|
31
33
|
font-size: 18px;
|
|
32
34
|
color: $main-blue;
|
|
35
|
+
cursor: pointer;
|
|
33
36
|
|
|
34
37
|
@include screen-md-min {
|
|
35
38
|
font-size: 20px;
|
|
@@ -4,6 +4,7 @@ type __VLS_Props = {
|
|
|
4
4
|
tooltip?: string;
|
|
5
5
|
disabled?: InputHTMLAttributes["disabled"];
|
|
6
6
|
size?: "sm" | "md" | "lg";
|
|
7
|
+
modal?: any;
|
|
7
8
|
};
|
|
8
9
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
9
10
|
size: "sm" | "md" | "lg";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { type ComputedRef } from
|
|
2
|
-
import type { StepData } from
|
|
1
|
+
import { type ComputedRef } from "vue";
|
|
2
|
+
import type { StepData } from "../types/JourneyConfig.js";
|
|
3
3
|
export declare const useFunnelConfig: (structure: ComputedRef<Map<string, string[]>>) => {
|
|
4
4
|
steps: ComputedRef<string[]>;
|
|
5
5
|
structure: ComputedRef<Map<string, string[]>>;
|
|
6
6
|
currentStep: ComputedRef<StepData>;
|
|
7
7
|
totalSteps: ComputedRef<number>;
|
|
8
8
|
getStep: (step: string | number | undefined) => StepData | undefined;
|
|
9
|
-
goNextStep: () => Promise<void>;
|
|
10
|
-
goPrevStep: () => Promise<void>;
|
|
9
|
+
goNextStep: (relative?: boolean) => Promise<void>;
|
|
10
|
+
goPrevStep: (relative?: boolean) => Promise<void>;
|
|
11
11
|
};
|
|
@@ -3,7 +3,9 @@ import { computed } from "vue";
|
|
|
3
3
|
export const useFunnelConfig = (structure) => {
|
|
4
4
|
const route = useRouter().currentRoute;
|
|
5
5
|
const steps = computed(() => Array.from(structure.value.keys()));
|
|
6
|
-
const currentStep = computed(
|
|
6
|
+
const currentStep = computed(
|
|
7
|
+
() => getStep(route.value.path.split("/").reverse()[0]) || currentStep.value
|
|
8
|
+
);
|
|
7
9
|
const totalSteps = computed(() => structure.value.size);
|
|
8
10
|
const getStep = (step) => {
|
|
9
11
|
if (step === void 0) return;
|
|
@@ -17,9 +19,18 @@ export const useFunnelConfig = (structure) => {
|
|
|
17
19
|
fields: stepFields
|
|
18
20
|
} : void 0;
|
|
19
21
|
};
|
|
20
|
-
const
|
|
22
|
+
const currentStepStatic = getStep(
|
|
23
|
+
route.value.path.split("/").reverse()[0]
|
|
24
|
+
);
|
|
25
|
+
const goNextStep = async (relative) => {
|
|
21
26
|
if (currentStep.value) {
|
|
22
|
-
const nextStep =
|
|
27
|
+
const nextStep = (() => {
|
|
28
|
+
if (relative) {
|
|
29
|
+
return getStep(currentStep.value.index + 1);
|
|
30
|
+
} else if (currentStepStatic) {
|
|
31
|
+
return getStep(currentStepStatic.index + 1);
|
|
32
|
+
}
|
|
33
|
+
})();
|
|
23
34
|
if (nextStep) {
|
|
24
35
|
await navigateTo({
|
|
25
36
|
path: nextStep.path,
|
|
@@ -28,12 +39,18 @@ export const useFunnelConfig = (structure) => {
|
|
|
28
39
|
}
|
|
29
40
|
}
|
|
30
41
|
};
|
|
31
|
-
const goPrevStep = async () => {
|
|
42
|
+
const goPrevStep = async (relative) => {
|
|
32
43
|
if (currentStep.value) {
|
|
33
|
-
const
|
|
34
|
-
|
|
44
|
+
const prevStep = (() => {
|
|
45
|
+
if (relative) {
|
|
46
|
+
return getStep(currentStep.value.index - 1);
|
|
47
|
+
} else if (currentStepStatic) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
})();
|
|
51
|
+
if (prevStep) {
|
|
35
52
|
await navigateTo({
|
|
36
|
-
path:
|
|
53
|
+
path: prevStep.path,
|
|
37
54
|
query: useRoute().query
|
|
38
55
|
});
|
|
39
56
|
}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { useRuntimeConfig } from "#imports";
|
|
2
2
|
export const uploadFile = (options) => {
|
|
3
3
|
const { apiURL } = useRuntimeConfig().public;
|
|
4
|
+
const body = new FormData();
|
|
5
|
+
body.append("file", options.file);
|
|
6
|
+
body.append(
|
|
7
|
+
"path",
|
|
8
|
+
`${options.basePath}/${options.journeyId}/${options.fileName}.${options.extension}`
|
|
9
|
+
);
|
|
10
|
+
body.append("bucketName", options.bucketName);
|
|
4
11
|
return $fetch("/core/apis/data/saveFileToS3", {
|
|
5
12
|
baseURL: apiURL,
|
|
6
13
|
method: "POST",
|
|
7
|
-
body
|
|
8
|
-
path: `${options.basePath}/${options.journeyId}/${options.fileName}.${options.extension}`,
|
|
9
|
-
file: options.file,
|
|
10
|
-
bucketName: options.bucketName
|
|
11
|
-
}
|
|
14
|
+
body
|
|
12
15
|
});
|
|
13
16
|
};
|