cja-phoenix 1.2.2 → 1.2.5
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/composables/useFunnelConfig.d.ts +1 -0
- package/dist/runtime/composables/useFunnelConfig.js +1 -0
- package/dist/runtime/composables/useFunnelSummary.d.ts +2 -1
- package/dist/runtime/composables/useFunnelSummary.js +2 -2
- package/package.json +1 -1
- package/dist/runtime/components/funnel/Submit.vue +0 -68
- package/dist/runtime/components/funnel/Submit.vue.d.ts +0 -21
package/dist/module.json
CHANGED
|
@@ -2,6 +2,7 @@ import { type ComputedRef } from 'vue';
|
|
|
2
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
|
+
structure: ComputedRef<Map<string, string[]>>;
|
|
5
6
|
currentStep: ComputedRef<StepData>;
|
|
6
7
|
totalSteps: ComputedRef<number>;
|
|
7
8
|
getStep: (step: string | number | undefined) => StepData | undefined;
|
|
@@ -3,9 +3,10 @@ import type { StepData } from '../types/JourneyConfig.js';
|
|
|
3
3
|
import type { ComputedRef } from 'vue';
|
|
4
4
|
export declare const useFunnelSummary: (options: {
|
|
5
5
|
currentStep: ComputedRef<StepData>;
|
|
6
|
+
structure: ComputedRef<Map<string, string[]>>;
|
|
6
7
|
store: any;
|
|
7
8
|
}) => {
|
|
8
|
-
stepIncludes: (field: string) =>
|
|
9
|
+
stepIncludes: (field: string) => boolean;
|
|
9
10
|
displayValue: (value: any, options?: SelectOption[]) => any;
|
|
10
11
|
displayLabel: (value: any, label: string) => string;
|
|
11
12
|
displayCurrency: (value: number | undefined) => string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { formatCurrency, formatPercent } from "../utils/formatValue.js";
|
|
2
2
|
export const useFunnelSummary = (options) => {
|
|
3
|
-
const { currentStep, store } = options;
|
|
4
|
-
const stepIncludes = (field) => currentStep.value.fields.includes(field) || store[field];
|
|
3
|
+
const { currentStep, structure, store } = options;
|
|
4
|
+
const stepIncludes = (field) => (currentStep.value.fields.includes(field) || store[field] !== void 0) && structure.value.values().toArray().flat().includes(field);
|
|
5
5
|
const displayValue = (value, options2) => options2 ? options2.find((o) => o.value == value)?.label ?? "-" : value ?? "-";
|
|
6
6
|
const displayLabel = (value, label) => value !== void 0 ? label : "-";
|
|
7
7
|
const displayCurrency = (value) => value ? formatCurrency(value) : "-";
|
package/package.json
CHANGED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<Teleport
|
|
3
|
-
to="body"
|
|
4
|
-
:disabled="viewport.isGreaterOrEquals('lg')"
|
|
5
|
-
>
|
|
6
|
-
<div class="btn-container">
|
|
7
|
-
<CjaButton
|
|
8
|
-
color="orange"
|
|
9
|
-
:loading="loading"
|
|
10
|
-
:icon-right="icon"
|
|
11
|
-
@click="$emit('btn:click')"
|
|
12
|
-
>
|
|
13
|
-
<slot>{{ t("btn.submit") }}</slot>
|
|
14
|
-
</CjaButton>
|
|
15
|
-
</div>
|
|
16
|
-
</Teleport>
|
|
17
|
-
</template>
|
|
18
|
-
|
|
19
|
-
<script setup>
|
|
20
|
-
const { t } = useI18n();
|
|
21
|
-
const viewport = useViewport();
|
|
22
|
-
defineProps({
|
|
23
|
-
loading: { type: Boolean, required: false },
|
|
24
|
-
icon: { type: null, required: false }
|
|
25
|
-
});
|
|
26
|
-
defineEmits(["btn:click"]);
|
|
27
|
-
</script>
|
|
28
|
-
|
|
29
|
-
<style lang="scss" scoped>
|
|
30
|
-
.btn-container {
|
|
31
|
-
position: fixed;
|
|
32
|
-
bottom: 0;
|
|
33
|
-
left: 0;
|
|
34
|
-
width: 100%;
|
|
35
|
-
padding: 20px 15px;
|
|
36
|
-
background-color: $white;
|
|
37
|
-
display: flex;
|
|
38
|
-
flex-direction: row;
|
|
39
|
-
justify-content: center;
|
|
40
|
-
box-shadow: $box-shadow-m;
|
|
41
|
-
z-index: 2;
|
|
42
|
-
|
|
43
|
-
@media screen and (min-width: $break-lg-min) {
|
|
44
|
-
position: static;
|
|
45
|
-
margin: 32px 0 0;
|
|
46
|
-
padding: 0;
|
|
47
|
-
box-shadow: none;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.cja-btn {
|
|
51
|
-
width: 100%;
|
|
52
|
-
|
|
53
|
-
@media screen and (min-width: $break-xs-min) {
|
|
54
|
-
max-width: 200px;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
</style>
|
|
59
|
-
|
|
60
|
-
<i18n lang="json">
|
|
61
|
-
{
|
|
62
|
-
"pt": {
|
|
63
|
-
"btn": {
|
|
64
|
-
"submit": "Continuar"
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
</i18n>
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { Icon } from '../../types/Icon.js';
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
loading?: boolean;
|
|
4
|
-
icon?: Icon;
|
|
5
|
-
};
|
|
6
|
-
declare var __VLS_14: {};
|
|
7
|
-
type __VLS_Slots = {} & {
|
|
8
|
-
default?: (props: typeof __VLS_14) => any;
|
|
9
|
-
};
|
|
10
|
-
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
-
"btn:click": (...args: any[]) => void;
|
|
12
|
-
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
13
|
-
"onBtn:click"?: ((...args: any[]) => any) | undefined;
|
|
14
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
-
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
16
|
-
export default _default;
|
|
17
|
-
type __VLS_WithSlots<T, S> = T & {
|
|
18
|
-
new (): {
|
|
19
|
-
$slots: S;
|
|
20
|
-
};
|
|
21
|
-
};
|