cja-phoenix 1.2.45 → 1.2.47
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/assets/scss/variables/_colors.scss +1 -0
- 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/useFunnelSummary.d.ts +9 -2
- package/dist/runtime/composables/useFunnelSummary.js +6 -4
- 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,14 +1,21 @@
|
|
|
1
1
|
import type { SelectOption } from "../types/Form.js";
|
|
2
2
|
import type { StepData } from "../types/JourneyConfig.js";
|
|
3
3
|
import type { ComputedRef } from "vue";
|
|
4
|
-
export declare
|
|
4
|
+
export declare function useFunnelSummary(options: {
|
|
5
5
|
currentStep: ComputedRef<StepData>;
|
|
6
6
|
structure: ComputedRef<Map<string, string[]>>;
|
|
7
7
|
store: any;
|
|
8
|
-
})
|
|
8
|
+
}): {
|
|
9
9
|
stepIncludes: (field: string) => boolean;
|
|
10
10
|
displayValue: (value: any, options?: SelectOption[]) => any;
|
|
11
11
|
displayLabel: (value: any, label: string) => string;
|
|
12
12
|
displayCurrency: (value: number | undefined) => string;
|
|
13
13
|
displayPercent: (value: number | undefined, maxDigits?: number) => string;
|
|
14
14
|
};
|
|
15
|
+
export declare function useFunnelSummary(): {
|
|
16
|
+
stepIncludes: undefined;
|
|
17
|
+
displayValue: (value: any, options?: SelectOption[]) => any;
|
|
18
|
+
displayLabel: (value: any, label: string) => string;
|
|
19
|
+
displayCurrency: (value: number | undefined) => string;
|
|
20
|
+
displayPercent: (value: number | undefined, maxDigits?: number) => string;
|
|
21
|
+
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { formatCurrency, formatPercent } from "../utils/formatValue.js";
|
|
2
|
-
export
|
|
3
|
-
const
|
|
4
|
-
|
|
2
|
+
export function useFunnelSummary(options) {
|
|
3
|
+
const stepIncludes = options ? (() => {
|
|
4
|
+
const { currentStep, structure, store } = options;
|
|
5
|
+
return (field) => (currentStep.value.fields.includes(field) || store[field] !== void 0) && Array.from(structure.value.values()).flat().includes(field);
|
|
6
|
+
})() : void 0;
|
|
5
7
|
const displayValue = (value, options2) => options2 ? options2.find((o) => o.value == value)?.label ?? "-" : value ?? "-";
|
|
6
8
|
const displayLabel = (value, label) => value !== void 0 ? label : "-";
|
|
7
9
|
const displayCurrency = (value) => value ? formatCurrency(value) : "-";
|
|
@@ -13,4 +15,4 @@ export const useFunnelSummary = (options) => {
|
|
|
13
15
|
displayCurrency,
|
|
14
16
|
displayPercent
|
|
15
17
|
};
|
|
16
|
-
}
|
|
18
|
+
}
|
|
@@ -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
|
};
|