@clxmedia/clxforms-client 1.0.12 → 1.0.13
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/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { CLXFormLayoutProcessor, ProcessedCLXFormSection, ProcessedCLXFormStep, ProcessedCLXFormLayout } from './layout-processor';
|
|
1
|
+
export { CLXFormLayoutProcessor, FilteredCLXFormLayout, ProcessedCLXFormSection, ProcessedCLXFormStep, ProcessedCLXFormLayout } from './layout-processor';
|
|
2
2
|
export { CLXRulesetProcessor } from './rules-processor';
|
|
3
3
|
export { CLXRulesEngine } from './rules-engine';
|
|
4
4
|
export { CLXFormConstants } from './constants';
|
|
@@ -22,7 +22,7 @@ export type ProcessedCLXFormLayout = {
|
|
|
22
22
|
stats?: FormStats;
|
|
23
23
|
};
|
|
24
24
|
export type FilteredCLXFormLayout = ProcessedCLXFormLayout & {
|
|
25
|
-
usedSlugs: string
|
|
25
|
+
usedSlugs: Set<string>;
|
|
26
26
|
};
|
|
27
27
|
export declare const CLXFormLayoutProcessor: ({ mode, responseData, formRights }: {
|
|
28
28
|
mode: CLXFormMode;
|
package/dist/layout-processor.js
CHANGED
|
@@ -87,7 +87,7 @@ const CLXFormLayoutProcessor = ({ mode, responseData, formRights }) => {
|
|
|
87
87
|
}, []);
|
|
88
88
|
};
|
|
89
89
|
const determineUsedSlugs = (steps) => {
|
|
90
|
-
|
|
90
|
+
return steps.reduce((acc, step) => {
|
|
91
91
|
var _a, _b;
|
|
92
92
|
for (const section of step.sections) {
|
|
93
93
|
for (const ql of section.question_layouts) {
|
|
@@ -102,11 +102,11 @@ const CLXFormLayoutProcessor = ({ mode, responseData, formRights }) => {
|
|
|
102
102
|
}
|
|
103
103
|
return acc;
|
|
104
104
|
}, new Set());
|
|
105
|
-
return Array.from(activeSlugs);
|
|
106
105
|
};
|
|
107
106
|
const filter = (pl) => {
|
|
108
107
|
const filtered = {
|
|
109
108
|
form: pl.form,
|
|
109
|
+
usedSlugs: new Set(),
|
|
110
110
|
steps: pl.steps
|
|
111
111
|
.map((step) => {
|
|
112
112
|
return {
|