@legalplace/wizardx-core 2.14.0 → 2.15.0

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/CHANGELOG.md CHANGED
@@ -3,6 +3,28 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [2.15.0](https://git.legalplace.eu/legalplace/monorepo/compare/@legalplace/wizardx-core@2.14.1...@legalplace/wizardx-core@2.15.0) (2023-01-18)
7
+
8
+
9
+ ### Features
10
+
11
+ * supporting multiple replacements in wizardx api[#7119](https://git.legalplace.eu/legalplace/monorepo/issues/7119) ([6002531](https://git.legalplace.eu/legalplace/monorepo/commits/60025314634fb679acaef9a12d2a4e6ae3704ded))
12
+
13
+
14
+
15
+
16
+
17
+ ## [2.14.1](https://git.legalplace.eu/legalplace/monorepo/compare/@legalplace/wizardx-core@2.14.0...@legalplace/wizardx-core@2.14.1) (2023-01-10)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * fix updateInputs api[#7333](https://git.legalplace.eu/legalplace/monorepo/issues/7333) ([d5958dd](https://git.legalplace.eu/legalplace/monorepo/commits/d5958dde32b6b5a42bfd60e7197cba933672e10b))
23
+
24
+
25
+
26
+
27
+
6
28
  # [2.14.0](https://git.legalplace.eu/legalplace/monorepo/compare/@legalplace/wizardx-core@2.13.0...@legalplace/wizardx-core@2.14.0) (2023-01-04)
7
29
 
8
30
 
@@ -82,7 +82,10 @@ const loadPluginFiles = (pluginsList) => __awaiter(void 0, void 0, void 0, funct
82
82
  Object.keys(anchors).forEach((anchor) => {
83
83
  if (anchor === "replace") {
84
84
  Object.keys(anchors[anchor]).forEach((replacer) => {
85
- replacers[replacer] = anchors[anchor][replacer];
85
+ if (!Object.prototype.hasOwnProperty.call(replacers, replacer)) {
86
+ replacers[replacer] = [];
87
+ }
88
+ replacers[replacer].push(anchors[anchor][replacer]);
86
89
  });
87
90
  return;
88
91
  }
@@ -190,8 +193,11 @@ export function ReplaceComponent(replacerName, OriginalComponent, componentName)
190
193
  }
191
194
  let FinalComponent;
192
195
  if (Replacer !== null) {
193
- const ReplacerComponent = replacers[Replacer];
194
- const FinalReplacedComponent = (props) => (_jsx(React.Suspense, Object.assign({ fallback: null }, { children: _jsx(ReplacerComponent, Object.assign({}, props, { OriginalComponent: OriginalComponent }, { children: props.children }), void 0) }), void 0));
196
+ const BaseComponent = (props) => (_jsx(OriginalComponent, Object.assign({}, props, { children: props.children }), void 0));
197
+ const FinalReplacedComponent = replacers[Replacer].reduce((PreviousReplacer, CurrentReplacer) => {
198
+ const ReplacedComponent = (props) => (_jsx(React.Suspense, Object.assign({ fallback: null }, { children: _jsx(CurrentReplacer, Object.assign({}, props, { OriginalComponent: PreviousReplacer }, { children: props.children }), void 0) }), void 0));
199
+ return ReplacedComponent;
200
+ }, BaseComponent);
195
201
  FinalComponent = FinalReplacedComponent;
196
202
  FinalComponent.displayName = `replacedComponent(${displayName})`;
197
203
  }
@@ -2,3 +2,4 @@ export * from "./OvcConverter";
2
2
  export * from "./InputsInitiator";
3
3
  export * from "./PathReader";
4
4
  export * from "./SectionValidity";
5
+ export * from "./ConditionsInitiator";
@@ -2,3 +2,4 @@ export * from "./OvcConverter";
2
2
  export * from "./InputsInitiator";
3
3
  export * from "./PathReader";
4
4
  export * from "./SectionValidity";
5
+ export * from "./ConditionsInitiator";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legalplace/wizardx-core",
3
- "version": "2.14.0",
3
+ "version": "2.15.0",
4
4
  "author": "Moncef Hammou (moncef@legalplace.fr)",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -93,5 +93,5 @@
93
93
  "*.test.ts",
94
94
  "*.test.tsx"
95
95
  ],
96
- "gitHead": "6f4cf6365562ef14c67d69bcd6d5a03c1f3915a1"
96
+ "gitHead": "4047f4cc45c4f443a146859bbaf5003af601d161"
97
97
  }