cja-phoenix 1.2.4 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cja-phoenix",
3
3
  "configKey": "cja-phoenix",
4
- "version": "1.2.4",
4
+ "version": "1.2.5",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -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;
@@ -41,6 +41,7 @@ export const useFunnelConfig = (structure) => {
41
41
  };
42
42
  return {
43
43
  steps,
44
+ structure,
44
45
  currentStep,
45
46
  totalSteps,
46
47
  getStep,
@@ -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) => any;
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,6 +1,6 @@
1
1
  {
2
2
  "name": "cja-phoenix",
3
- "version": "1.2.4",
3
+ "version": "1.2.5",
4
4
  "description": "Phoenix utility",
5
5
  "repository": "comparaja/phoenix",
6
6
  "license": "MIT",