@legalplace/wizardx-core 2.6.4 → 2.7.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 +35 -0
- package/dist/App.js +13 -4
- package/dist/PluginLoader.d.ts +3 -1
- package/dist/PluginLoader.js +12 -0
- package/dist/ThemeLoader.d.ts +2 -2
- package/dist/componentsConnectors/connectBox.d.ts +3 -1
- package/dist/componentsConnectors/connectDocument.d.ts +3 -1
- package/dist/componentsConnectors/connectHeader.d.ts +3 -1
- package/dist/componentsConnectors/connectMetaTitle.d.ts +3 -1
- package/dist/componentsConnectors/connectOption.d.ts +6 -2
- package/dist/componentsConnectors/connectOption.js +1 -1
- package/dist/componentsConnectors/connectPagination.d.ts +3 -1
- package/dist/componentsConnectors/connectPreview.d.ts +3 -1
- package/dist/componentsConnectors/connectProgress.d.ts +3 -1
- package/dist/componentsConnectors/connectRootOption.d.ts +3 -1
- package/dist/componentsConnectors/connectSection.d.ts +3 -1
- package/dist/componentsConnectors/connectSection.js +7 -10
- package/dist/componentsConnectors/connectSummary.d.ts +3 -1
- package/dist/componentsConnectors/connectSummaryItem.d.ts +3 -1
- package/dist/componentsConnectors/connectVariable.d.ts +6 -2
- package/dist/componentsConnectors/connectVariable.js +1 -1
- package/dist/componentsConnectors/connectWizardWrapper.d.ts +3 -1
- package/dist/componentsConnectors/connector/componentConnector.d.ts +5 -1
- package/dist/componentsConnectors/connector/componentConnector.js +44 -4
- package/dist/componentsConnectors/connector/index.d.ts +1 -0
- package/dist/componentsConnectors/connector/index.js +1 -0
- package/dist/componentsConnectors/index.d.ts +17 -0
- package/dist/componentsConnectors/index.js +17 -0
- package/dist/componentsConnectors/library.d.ts +43 -15
- package/dist/helpers/apiEndpoint.d.ts +1 -0
- package/dist/helpers/apiEndpoint.js +4 -0
- package/dist/helpers/index.d.ts +4 -0
- package/dist/helpers/index.js +4 -0
- package/dist/helpers/propsEqualityCheck.d.ts +1 -0
- package/dist/helpers/propsEqualityCheck.js +9 -0
- package/dist/hooks/index.d.ts +4 -0
- package/dist/hooks/index.js +4 -0
- package/dist/hooks/useActions.d.ts +2 -0
- package/dist/hooks/useActions.js +4 -0
- package/dist/hooks/useDispatch.d.ts +1 -0
- package/dist/hooks/useDispatch.js +4 -0
- package/dist/hooks/useSelectors.d.ts +2 -0
- package/dist/hooks/useSelectors.js +4 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +13 -0
- package/dist/libs/PathReader.d.ts +10 -6
- package/dist/libs/PathReader.js +47 -28
- package/dist/libs/index.d.ts +5 -0
- package/dist/libs/index.js +5 -0
- package/dist/redux/actions/index.d.ts +9 -0
- package/dist/redux/actions/index.js +9 -0
- package/dist/redux/actions/library.d.ts +59 -63
- package/dist/redux/actions/sagas/index.d.ts +3 -0
- package/dist/redux/actions/sagas/index.js +3 -0
- package/dist/redux/actions/sagas/model.d.ts +1 -5
- package/dist/redux/constants/app.d.ts +2 -0
- package/dist/redux/constants/app.js +2 -0
- package/dist/redux/constants/index.d.ts +8 -0
- package/dist/redux/constants/index.js +8 -0
- package/dist/redux/constants/sagas/index.d.ts +3 -0
- package/dist/redux/constants/sagas/index.js +3 -0
- package/dist/redux/index.d.ts +5 -0
- package/dist/redux/index.js +5 -0
- package/dist/redux/middlewares/conditionsWatcherMiddleware.js +11 -5
- package/dist/redux/middlewares/conditionsWatcherMiddleware.test.js +120 -113
- package/dist/redux/middlewares/paginationWatcherMiddleware.js +2 -2
- package/dist/redux/middlewares/smartscriptMiddleware.js +8 -0
- package/dist/redux/reducers/pluginsStore.d.ts +3 -0
- package/dist/redux/reducers/pluginsStore.js +12 -0
- package/dist/redux/routerHistory.js +2 -2
- package/dist/redux/sagas/fetchModel.js +22 -6
- package/dist/redux/sagas/initInputs.js +6 -7
- package/dist/redux/sagas/saveData.js +2 -0
- package/dist/redux/selectors/app.js +13 -18
- package/dist/redux/selectors/cache.d.ts +17 -0
- package/dist/redux/selectors/cache.js +35 -0
- package/dist/redux/selectors/conditions.js +7 -7
- package/dist/redux/selectors/index.d.ts +8 -0
- package/dist/redux/selectors/index.js +8 -0
- package/dist/redux/selectors/inputs.js +3 -3
- package/dist/redux/selectors/library.d.ts +2 -2
- package/dist/redux/selectors/references.js +26 -26
- package/dist/redux/selectors/selectors.d.ts +2 -2
- package/dist/redux/selectors/selectors.js +19 -8
- package/dist/redux/selectors/selectors.test.js +6 -6
- package/dist/redux/selectors/user.js +5 -5
- package/dist/redux/store.d.ts +1 -1
- package/dist/redux/store.js +12 -4
- package/dist/service/api.manager.d.ts +1 -6
- package/dist/service/index.d.ts +3 -0
- package/dist/service/index.js +3 -0
- package/dist/types/PluginConfig.type.d.ts +57 -0
- package/dist/types/PluginConfig.type.js +1 -0
- package/dist/types/State.type.d.ts +6 -0
- package/dist/types/config.type.d.ts +3 -1
- package/dist/types/index.d.ts +11 -0
- package/dist/types/index.js +11 -0
- package/package.json +11 -11
- package/.depcheckrc +0 -1
- package/.eslintignore +0 -2
- package/.eslintrc +0 -5
- package/__mocks__/fileMock.js +0 -1
- package/babel.config.json +0 -3
- package/jest.config.ts +0 -193
- package/setupJest.ts +0 -8
- package/src/App.test.tsx +0 -41
- package/src/App.tsx +0 -152
- package/src/Globals.ts +0 -69
- package/src/Loader.tsx +0 -8
- package/src/PluginLoader.test.tsx +0 -70
- package/src/PluginLoader.tsx +0 -407
- package/src/Shimmer.tsx +0 -108
- package/src/ThemeLoader.test.tsx +0 -82
- package/src/ThemeLoader.tsx +0 -95
- package/src/components/PluginRoute.tsx +0 -48
- package/src/components/SmartScript.tsx +0 -166
- package/src/components/UserLocked/UserLockedComponent.tsx +0 -33
- package/src/components/View.test.tsx +0 -110
- package/src/components/View.tsx +0 -114
- package/src/componentsConnectors/connectBox.test.tsx +0 -226
- package/src/componentsConnectors/connectBox.tsx +0 -70
- package/src/componentsConnectors/connectDocument.test.tsx +0 -108
- package/src/componentsConnectors/connectDocument.tsx +0 -64
- package/src/componentsConnectors/connectHeader.tsx +0 -21
- package/src/componentsConnectors/connectMetaTitle.test.tsx +0 -40
- package/src/componentsConnectors/connectMetaTitle.tsx +0 -8
- package/src/componentsConnectors/connectOption.tsx +0 -222
- package/src/componentsConnectors/connectPagination.tsx +0 -102
- package/src/componentsConnectors/connectPreview.tsx +0 -5
- package/src/componentsConnectors/connectProgress.tsx +0 -59
- package/src/componentsConnectors/connectRootOption.tsx +0 -95
- package/src/componentsConnectors/connectSection.tsx +0 -79
- package/src/componentsConnectors/connectSummary.tsx +0 -21
- package/src/componentsConnectors/connectSummaryItem.tsx +0 -102
- package/src/componentsConnectors/connectTermsheet.tsx +0 -359
- package/src/componentsConnectors/connectVariable.tsx +0 -191
- package/src/componentsConnectors/connectWizardWrapper.tsx +0 -30
- package/src/componentsConnectors/connector/componentConnector.tsx +0 -219
- package/src/componentsConnectors/library.ts +0 -35
- package/src/config.test.ts +0 -63
- package/src/config.ts +0 -11
- package/src/constants/emailValidation.ts +0 -2
- package/src/constants/phoneValidation.ts +0 -4
- package/src/definitions/path.join.d.ts +0 -4
- package/src/helpers/outputsParsing.ts +0 -412
- package/src/helpers/preloadTheme.ts +0 -17
- package/src/helpers/scriptsLoader.ts +0 -20
- package/src/hooks/usePrevious.ts +0 -9
- package/src/libs/ConditionsInitiator.ts +0 -164
- package/src/libs/ConditionsRunner/DataPopulator.ts +0 -266
- package/src/libs/ConditionsRunner.ts +0 -454
- package/src/libs/DocumentsOutputs.ts +0 -171
- package/src/libs/Eval/EvalBase.ts +0 -116
- package/src/libs/Eval/EvalFunctions.ts +0 -724
- package/src/libs/Eval/NumbersToLetters.ts +0 -185
- package/src/libs/EvalVariable.ts +0 -265
- package/src/libs/EventsTracking.ts +0 -250
- package/src/libs/InputsInitiator.ts +0 -136
- package/src/libs/NumAuto.test.ts +0 -55
- package/src/libs/NumAuto.ts +0 -56
- package/src/libs/OvcConverter.ts +0 -285
- package/src/libs/PathReader.ts +0 -272
- package/src/libs/SectionValidity.test.ts +0 -146
- package/src/libs/SectionValidity.ts +0 -110
- package/src/libs/SmartScriptStore.ts +0 -492
- package/src/misc/test_model.ts +0 -14603
- package/src/misc/test_models/connectDocumen.testmodel.json +0 -178
- package/src/misc/test_models/setDefaults.testmodel.json +0 -279
- package/src/misc/test_models/testmodel.json +0 -1
- package/src/polyfills/index.ts +0 -5
- package/src/polyfills/objectValues.ts +0 -4
- package/src/polyfills/prepend.ts +0 -31
- package/src/polyfills/stringRepeat.ts +0 -44
- package/src/redux/actions/app.test.ts +0 -123
- package/src/redux/actions/app.ts +0 -249
- package/src/redux/actions/conditions.test.ts +0 -84
- package/src/redux/actions/conditions.ts +0 -135
- package/src/redux/actions/inputs.test.ts +0 -85
- package/src/redux/actions/inputs.ts +0 -111
- package/src/redux/actions/library.ts +0 -23
- package/src/redux/actions/mandatories.ts +0 -98
- package/src/redux/actions/references.test.ts +0 -48
- package/src/redux/actions/references.ts +0 -37
- package/src/redux/actions/sagas/data.test.ts +0 -11
- package/src/redux/actions/sagas/data.ts +0 -18
- package/src/redux/actions/sagas/model.test.ts +0 -14
- package/src/redux/actions/sagas/model.ts +0 -48
- package/src/redux/actions/sagas/user.ts +0 -25
- package/src/redux/actions/smartscript.ts +0 -55
- package/src/redux/actions/user.test.ts +0 -18
- package/src/redux/actions/user.ts +0 -41
- package/src/redux/constants/app.ts +0 -36
- package/src/redux/constants/conditions.ts +0 -25
- package/src/redux/constants/inputs.ts +0 -15
- package/src/redux/constants/mandatories.ts +0 -11
- package/src/redux/constants/references.ts +0 -7
- package/src/redux/constants/sagas/data.ts +0 -1
- package/src/redux/constants/sagas/model.ts +0 -2
- package/src/redux/constants/sagas/user.ts +0 -2
- package/src/redux/constants/smartscript.ts +0 -9
- package/src/redux/constants/user.ts +0 -6
- package/src/redux/listeners/subscriber.test.ts +0 -45
- package/src/redux/listeners/subscriber.ts +0 -29
- package/src/redux/middlewares/conditionsWatcherMiddleware.test.ts +0 -370
- package/src/redux/middlewares/conditionsWatcherMiddleware.ts +0 -321
- package/src/redux/middlewares/evaluationsWatcherMiddleware.test.ts +0 -323
- package/src/redux/middlewares/evaluationsWatcherMiddleware.ts +0 -250
- package/src/redux/middlewares/mandatoriesWatcherMiddleware.ts +0 -473
- package/src/redux/middlewares/multiplesActionsMiddleware.test.ts +0 -230
- package/src/redux/middlewares/multiplesActionsMiddleware.ts +0 -121
- package/src/redux/middlewares/paginationWatcherMiddleware.ts +0 -251
- package/src/redux/middlewares/pluginsHookMiddleware.ts +0 -24
- package/src/redux/middlewares/prefillerWatcherMiddleware.test.ts +0 -118
- package/src/redux/middlewares/prefillerWatcherMiddleware.ts +0 -462
- package/src/redux/middlewares/smartscriptMiddleware.ts +0 -228
- package/src/redux/middlewares/thirdpartyScriptsMiddleware.ts +0 -41
- package/src/redux/reducers/app/customizations/initCustomizationAutoDefault.ts +0 -16
- package/src/redux/reducers/app/customizations/initCustomizationMeta.ts +0 -16
- package/src/redux/reducers/app/instance/initInstance.ts +0 -29
- package/src/redux/reducers/app/instance/setDataStatus.ts +0 -16
- package/src/redux/reducers/app/instance/updateInstance.ts +0 -30
- package/src/redux/reducers/app/instance/updateInstancePaid.ts +0 -20
- package/src/redux/reducers/app/instance.test.ts +0 -106
- package/src/redux/reducers/app/meta/fetchModelFailed.ts +0 -11
- package/src/redux/reducers/app/meta/fetchModelNonBlocking.ts +0 -11
- package/src/redux/reducers/app/meta/fetchModelSucceeded.ts +0 -11
- package/src/redux/reducers/app/meta/fetchModelUnhealthy.ts +0 -18
- package/src/redux/reducers/app/meta/fetchModelUserLocked.ts +0 -11
- package/src/redux/reducers/app/meta/initMeta.ts +0 -22
- package/src/redux/reducers/app/meta/setModelUuid.ts +0 -17
- package/src/redux/reducers/app/meta.test.ts +0 -90
- package/src/redux/reducers/app/pagination/goNextPage.ts +0 -69
- package/src/redux/reducers/app/pagination/goPage.ts +0 -81
- package/src/redux/reducers/app/pagination/goPreviousPage.ts +0 -60
- package/src/redux/reducers/app/pagination/initPagination.ts +0 -46
- package/src/redux/reducers/app/pagination/updateAvailableAppStates.ts +0 -77
- package/src/redux/reducers/app/pagination.test.ts +0 -363
- package/src/redux/reducers/app/wizard/updateAvailableSections.ts +0 -40
- package/src/redux/reducers/app/wizard.test.ts +0 -84
- package/src/redux/reducers/app.test.ts +0 -336
- package/src/redux/reducers/app.ts +0 -150
- package/src/redux/reducers/conditions/addMultipleOccurency.test.ts +0 -131
- package/src/redux/reducers/conditions/addMultipleOccurency.ts +0 -155
- package/src/redux/reducers/conditions/deleteMultipleOccurency.test.ts +0 -95
- package/src/redux/reducers/conditions/deleteMultipleOccurency.ts +0 -141
- package/src/redux/reducers/conditions/initConditions.ts +0 -18
- package/src/redux/reducers/conditions/updateDocumentConditions.test.ts +0 -47
- package/src/redux/reducers/conditions/updateDocumentConditions.ts +0 -21
- package/src/redux/reducers/conditions/updateOptionConditions.ts +0 -24
- package/src/redux/reducers/conditions/updateOptionValidatorCondition.test.ts +0 -50
- package/src/redux/reducers/conditions/updateOptionValidatorCondition.ts +0 -28
- package/src/redux/reducers/conditions/updatePrefillerConditions.ts +0 -29
- package/src/redux/reducers/conditions/updateSectionConditions.ts +0 -28
- package/src/redux/reducers/conditions/updateVariableConditions.ts +0 -25
- package/src/redux/reducers/conditions/updateVariableValidatorCondition.test.ts +0 -50
- package/src/redux/reducers/conditions/updateVariableValidatorCondition.ts +0 -28
- package/src/redux/reducers/conditions.test.ts +0 -241
- package/src/redux/reducers/conditions.ts +0 -68
- package/src/redux/reducers/inputs/addMultipleOccurency.test.ts +0 -117
- package/src/redux/reducers/inputs/addMultipleOccurency.ts +0 -50
- package/src/redux/reducers/inputs/deleteMultipleOccurency.test.ts +0 -70
- package/src/redux/reducers/inputs/deleteMultipleOccurency.ts +0 -50
- package/src/redux/reducers/inputs/initOption.ts +0 -16
- package/src/redux/reducers/inputs/initVariable.ts +0 -16
- package/src/redux/reducers/inputs/updateOptionInput.ts +0 -24
- package/src/redux/reducers/inputs/updateVariableInput.ts +0 -24
- package/src/redux/reducers/inputs.test.ts +0 -221
- package/src/redux/reducers/inputs.ts +0 -51
- package/src/redux/reducers/mandatories/addMultipleOccurency.ts +0 -52
- package/src/redux/reducers/mandatories/deleteMultipleOccurency.ts +0 -55
- package/src/redux/reducers/mandatories/initMandatoryOption.ts +0 -17
- package/src/redux/reducers/mandatories/initMandatoryVariable.ts +0 -17
- package/src/redux/reducers/mandatories/setMandatoryIgnore.ts +0 -17
- package/src/redux/reducers/mandatories/setMandatoryOption.ts +0 -25
- package/src/redux/reducers/mandatories/setMandatorySection.ts +0 -20
- package/src/redux/reducers/mandatories/setMandatoryVariable.ts +0 -24
- package/src/redux/reducers/mandatories.ts +0 -56
- package/src/redux/reducers/references/initReferences.ts +0 -37
- package/src/redux/reducers/references/updateOptionMeta.ts +0 -73
- package/src/redux/reducers/references/updateVariableMeta.ts +0 -72
- package/src/redux/reducers/references.ts +0 -59
- package/src/redux/reducers/smartscript/enableSmartScript.ts +0 -13
- package/src/redux/reducers/smartscript/initSmartScriptTriggers.ts +0 -14
- package/src/redux/reducers/smartscript/updateSmartscriptOptionHidden.ts +0 -30
- package/src/redux/reducers/smartscript/updateSmartscriptVariableHidden.ts +0 -30
- package/src/redux/reducers/smartscript.ts +0 -47
- package/src/redux/reducers/user/initUser.ts +0 -15
- package/src/redux/reducers/user/setUserStatus.ts +0 -13
- package/src/redux/reducers/user/setUserValidToken.ts +0 -13
- package/src/redux/reducers/user.test.ts +0 -51
- package/src/redux/reducers/user.ts +0 -40
- package/src/redux/routerHistore.test.ts +0 -19
- package/src/redux/routerHistory.ts +0 -26
- package/src/redux/sagas/fetchModel.test.ts +0 -76
- package/src/redux/sagas/fetchModel.ts +0 -683
- package/src/redux/sagas/homogeneousRadioInputsSaga.ts +0 -42
- package/src/redux/sagas/initInputs.ts +0 -110
- package/src/redux/sagas/runner.test.ts +0 -12
- package/src/redux/sagas/runner.ts +0 -26
- package/src/redux/sagas/saveData.test.ts +0 -125
- package/src/redux/sagas/saveData.ts +0 -55
- package/src/redux/sagas/setDefaults.test.ts +0 -100
- package/src/redux/sagas/setDefaults.ts +0 -167
- package/src/redux/sagas/setUserEmail.ts +0 -175
- package/src/redux/selectors/app.test.ts +0 -162
- package/src/redux/selectors/app.ts +0 -331
- package/src/redux/selectors/conditions.test.ts +0 -92
- package/src/redux/selectors/conditions.ts +0 -293
- package/src/redux/selectors/inputs.test.ts +0 -72
- package/src/redux/selectors/inputs.ts +0 -76
- package/src/redux/selectors/library.ts +0 -17
- package/src/redux/selectors/mandatories.ts +0 -83
- package/src/redux/selectors/references.test.ts +0 -660
- package/src/redux/selectors/references.ts +0 -413
- package/src/redux/selectors/selectors.test.ts +0 -21
- package/src/redux/selectors/selectors.ts +0 -87
- package/src/redux/selectors/smartscript.ts +0 -30
- package/src/redux/selectors/user.test.ts +0 -39
- package/src/redux/selectors/user.ts +0 -45
- package/src/redux/store.test.ts +0 -22
- package/src/redux/store.ts +0 -100
- package/src/service/api.manager.ts +0 -261
- package/src/service/auth.service.ts +0 -5
- package/src/service/pardot.service.ts +0 -10
- package/src/tests-misc/plugins/jestTestPlugin/after.tsx +0 -5
- package/src/tests-misc/plugins/jestTestPlugin/before.tsx +0 -11
- package/src/tests-misc/plugins/jestTestPlugin/index.ts +0 -11
- package/src/tests-misc/plugins/jestTestPlugin/title.tsx +0 -8
- package/src/tests-misc/themes/jestTestTheme/components/EmailComponent.tsx +0 -5
- package/src/tests-misc/themes/jestTestTheme/components/TermsheetComponent.tsx +0 -5
- package/src/tests-misc/themes/jestTestTheme/components/WizardComponent.tsx +0 -5
- package/src/tests-misc/themes/jestTestTheme/faltyIndex.ts +0 -3
- package/src/tests-misc/themes/jestTestTheme/faltyIndexLoader.ts +0 -1
- package/src/tests-misc/themes/jestTestTheme/index.ts +0 -13
- package/src/types/Actions.type.ts +0 -612
- package/src/types/Components.type.ts +0 -181
- package/src/types/State.type.ts +0 -323
- package/src/types/Termsheet.type.ts +0 -28
- package/src/types/api.type.ts +0 -37
- package/src/types/config.type.ts +0 -55
- package/src/types/env.type.ts +0 -5
- package/src/types/getActions.type.ts +0 -3
- package/src/types/getConnectors.type.ts +0 -5
- package/src/types/getSelectors.type.ts +0 -3
- package/src/wizard-params.ts +0 -56
- package/tsconfig.json +0 -43
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"documents": {
|
|
3
|
-
"main": {
|
|
4
|
-
"name": "Votre document",
|
|
5
|
-
"sections": [{
|
|
6
|
-
"id": 1,
|
|
7
|
-
"label": "My first section",
|
|
8
|
-
"tags": [],
|
|
9
|
-
"options": [1, 2, 5, 6]
|
|
10
|
-
}]
|
|
11
|
-
}
|
|
12
|
-
},
|
|
13
|
-
"options": {
|
|
14
|
-
"1": {
|
|
15
|
-
"meta": {
|
|
16
|
-
"id": 1,
|
|
17
|
-
"type": "static",
|
|
18
|
-
"label": "Simple question",
|
|
19
|
-
"step": "*",
|
|
20
|
-
"tags": [],
|
|
21
|
-
"defaultRadio": 0,
|
|
22
|
-
"validator": {}
|
|
23
|
-
},
|
|
24
|
-
"options": [],
|
|
25
|
-
"variables": [1]
|
|
26
|
-
},
|
|
27
|
-
"2": {
|
|
28
|
-
"meta": {
|
|
29
|
-
"id": 2,
|
|
30
|
-
"type": "static",
|
|
31
|
-
"label": "Multiple question",
|
|
32
|
-
"step": "*",
|
|
33
|
-
"tags": [],
|
|
34
|
-
"defaultRadio": 0,
|
|
35
|
-
"multiple": {
|
|
36
|
-
"enabled": true
|
|
37
|
-
},
|
|
38
|
-
"validator": {}
|
|
39
|
-
},
|
|
40
|
-
"options": [3, 4],
|
|
41
|
-
"variables": [2, 3]
|
|
42
|
-
},
|
|
43
|
-
"3": {
|
|
44
|
-
"meta": {
|
|
45
|
-
"id": 3,
|
|
46
|
-
"type": "radio",
|
|
47
|
-
"label": "Option 1",
|
|
48
|
-
"step": "*",
|
|
49
|
-
"output": "Output of Option 1 not under repeated, [var:2] [var:3]",
|
|
50
|
-
"tags": [],
|
|
51
|
-
"defaultRadio": 0,
|
|
52
|
-
"validator": {}
|
|
53
|
-
},
|
|
54
|
-
"options": [],
|
|
55
|
-
"variables": []
|
|
56
|
-
},
|
|
57
|
-
"4": {
|
|
58
|
-
"meta": {
|
|
59
|
-
"id": 4,
|
|
60
|
-
"type": "radio",
|
|
61
|
-
"label": "Option 2",
|
|
62
|
-
"step": "*",
|
|
63
|
-
"output": "Output of Option 2 not under repeated, [var:2] [var:3]",
|
|
64
|
-
"tags": [],
|
|
65
|
-
"defaultRadio": 0,
|
|
66
|
-
"validator": {}
|
|
67
|
-
},
|
|
68
|
-
"options": [],
|
|
69
|
-
"variables": []
|
|
70
|
-
},
|
|
71
|
-
"5": {
|
|
72
|
-
"meta": {
|
|
73
|
-
"id": 5,
|
|
74
|
-
"type": "hidden",
|
|
75
|
-
"label": "My simple output",
|
|
76
|
-
"step": "*",
|
|
77
|
-
"tags": [],
|
|
78
|
-
"output": "<p>Should output <strong>Variable 1</strong> [var:1]</p>\n",
|
|
79
|
-
"defaultRadio": 0,
|
|
80
|
-
"validator": {}
|
|
81
|
-
},
|
|
82
|
-
"options": [],
|
|
83
|
-
"variables": []
|
|
84
|
-
},
|
|
85
|
-
"6": {
|
|
86
|
-
"meta": {
|
|
87
|
-
"id": 6,
|
|
88
|
-
"type": "repeated",
|
|
89
|
-
"label": "Repeated outputs",
|
|
90
|
-
"step": "*",
|
|
91
|
-
"tags": [],
|
|
92
|
-
"defaultRadio": 0,
|
|
93
|
-
"repeatOption": 2,
|
|
94
|
-
"validator": {}
|
|
95
|
-
},
|
|
96
|
-
"options": [7, 8],
|
|
97
|
-
"variables": []
|
|
98
|
-
},
|
|
99
|
-
"7": {
|
|
100
|
-
"meta": {
|
|
101
|
-
"id": 7,
|
|
102
|
-
"type": "hidden",
|
|
103
|
-
"label": "Output for Option 1",
|
|
104
|
-
"step": "*",
|
|
105
|
-
"tags": [],
|
|
106
|
-
"output": "<p>Output for Option 1, Should display Variable 2 & 3 when Option 1 is selected, [var:2] [var:3]</p>\n",
|
|
107
|
-
"defaultRadio": 0,
|
|
108
|
-
"conditions": {
|
|
109
|
-
"selected": [{
|
|
110
|
-
"var": "o.3"
|
|
111
|
-
}]
|
|
112
|
-
},
|
|
113
|
-
"validator": {}
|
|
114
|
-
},
|
|
115
|
-
"options": [],
|
|
116
|
-
"variables": []
|
|
117
|
-
},
|
|
118
|
-
"8": {
|
|
119
|
-
"meta": {
|
|
120
|
-
"id": 8,
|
|
121
|
-
"type": "hidden",
|
|
122
|
-
"label": "Output for Option 2",
|
|
123
|
-
"step": "*",
|
|
124
|
-
"tags": [],
|
|
125
|
-
"output": "<p>Output for Option 2, Should display Variable 2 & 3 when Option 2 is selected, [var:2] [var:3]</p>\n",
|
|
126
|
-
"defaultRadio": 0,
|
|
127
|
-
"conditions": {
|
|
128
|
-
"selected": [{
|
|
129
|
-
"var": "o.4"
|
|
130
|
-
}]
|
|
131
|
-
},
|
|
132
|
-
"validator": {}
|
|
133
|
-
},
|
|
134
|
-
"options": [],
|
|
135
|
-
"variables": []
|
|
136
|
-
}
|
|
137
|
-
},
|
|
138
|
-
"variables": {
|
|
139
|
-
"1": {
|
|
140
|
-
"id": 1,
|
|
141
|
-
"label": "Variable 1",
|
|
142
|
-
"type": "text",
|
|
143
|
-
"placeholderLength": 16,
|
|
144
|
-
"step": "*"
|
|
145
|
-
},
|
|
146
|
-
"2": {
|
|
147
|
-
"id": 2,
|
|
148
|
-
"label": "Variable 2",
|
|
149
|
-
"type": "text",
|
|
150
|
-
"placeholderLength": 16,
|
|
151
|
-
"step": "*"
|
|
152
|
-
},
|
|
153
|
-
"3": {
|
|
154
|
-
"id": 3,
|
|
155
|
-
"label": "Variable 3",
|
|
156
|
-
"type": "text",
|
|
157
|
-
"placeholderLength": 16,
|
|
158
|
-
"step": "*"
|
|
159
|
-
}
|
|
160
|
-
},
|
|
161
|
-
"customization": {},
|
|
162
|
-
"theme": {
|
|
163
|
-
"name": "social",
|
|
164
|
-
"params": {
|
|
165
|
-
"sidebar": {
|
|
166
|
-
"default": "summary",
|
|
167
|
-
"states": {
|
|
168
|
-
"wizard": "summary"
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
},
|
|
173
|
-
"plugins": {
|
|
174
|
-
"b2c_actions": "1.0.0",
|
|
175
|
-
"datalayer": "1.0.0",
|
|
176
|
-
"checkoutX": "1.0.0"
|
|
177
|
-
}
|
|
178
|
-
}
|
|
@@ -1,279 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"documents": {
|
|
3
|
-
"main": {
|
|
4
|
-
"name": "Votre document",
|
|
5
|
-
"sections": [{
|
|
6
|
-
"id": 1,
|
|
7
|
-
"label": "My first section",
|
|
8
|
-
"tags": [],
|
|
9
|
-
"options": [1, 2, 5, 6]
|
|
10
|
-
}, {
|
|
11
|
-
"id": 2,
|
|
12
|
-
"label": "Titre de la section",
|
|
13
|
-
"tags": [],
|
|
14
|
-
"options": [9],
|
|
15
|
-
"conditions": {
|
|
16
|
-
"selected": [{
|
|
17
|
-
"var": "o.4"
|
|
18
|
-
}]
|
|
19
|
-
}
|
|
20
|
-
}, {
|
|
21
|
-
"id": 3,
|
|
22
|
-
"label": "Titre de la section",
|
|
23
|
-
"tags": [],
|
|
24
|
-
"options": [12]
|
|
25
|
-
}]
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
"options": {
|
|
29
|
-
"1": {
|
|
30
|
-
"meta": {
|
|
31
|
-
"id": 1,
|
|
32
|
-
"type": "static",
|
|
33
|
-
"label": "Simple question",
|
|
34
|
-
"step": "*",
|
|
35
|
-
"tags": [],
|
|
36
|
-
"defaultRadio": 0,
|
|
37
|
-
"validator": {}
|
|
38
|
-
},
|
|
39
|
-
"options": [],
|
|
40
|
-
"variables": [1]
|
|
41
|
-
},
|
|
42
|
-
"2": {
|
|
43
|
-
"meta": {
|
|
44
|
-
"id": 2,
|
|
45
|
-
"type": "static",
|
|
46
|
-
"label": "Multiple question",
|
|
47
|
-
"step": "*",
|
|
48
|
-
"tags": [],
|
|
49
|
-
"defaultRadio": 4,
|
|
50
|
-
"multiple": {
|
|
51
|
-
"enabled": true
|
|
52
|
-
},
|
|
53
|
-
"validator": {}
|
|
54
|
-
},
|
|
55
|
-
"options": [3, 4],
|
|
56
|
-
"variables": [2, 3]
|
|
57
|
-
},
|
|
58
|
-
"3": {
|
|
59
|
-
"meta": {
|
|
60
|
-
"id": 3,
|
|
61
|
-
"type": "radio",
|
|
62
|
-
"label": "Option 1",
|
|
63
|
-
"step": "*",
|
|
64
|
-
"tags": [],
|
|
65
|
-
"defaultRadio": 0,
|
|
66
|
-
"validator": {}
|
|
67
|
-
},
|
|
68
|
-
"options": [],
|
|
69
|
-
"variables": []
|
|
70
|
-
},
|
|
71
|
-
"4": {
|
|
72
|
-
"meta": {
|
|
73
|
-
"id": 4,
|
|
74
|
-
"type": "radio",
|
|
75
|
-
"label": "Option 2",
|
|
76
|
-
"step": "*",
|
|
77
|
-
"tags": [],
|
|
78
|
-
"defaultRadio": 0,
|
|
79
|
-
"validator": {}
|
|
80
|
-
},
|
|
81
|
-
"options": [],
|
|
82
|
-
"variables": []
|
|
83
|
-
},
|
|
84
|
-
"5": {
|
|
85
|
-
"meta": {
|
|
86
|
-
"id": 5,
|
|
87
|
-
"type": "hidden",
|
|
88
|
-
"label": "My simple output",
|
|
89
|
-
"step": "*",
|
|
90
|
-
"tags": [],
|
|
91
|
-
"output": "<p>Should output <strong>Variable 1</strong> [var:1]</p>\n",
|
|
92
|
-
"defaultRadio": 0,
|
|
93
|
-
"validator": {}
|
|
94
|
-
},
|
|
95
|
-
"options": [],
|
|
96
|
-
"variables": []
|
|
97
|
-
},
|
|
98
|
-
"6": {
|
|
99
|
-
"meta": {
|
|
100
|
-
"id": 6,
|
|
101
|
-
"type": "repeated",
|
|
102
|
-
"label": "Repeated outputs",
|
|
103
|
-
"step": "*",
|
|
104
|
-
"tags": [],
|
|
105
|
-
"defaultRadio": 0,
|
|
106
|
-
"repeatOption": 2,
|
|
107
|
-
"validator": {}
|
|
108
|
-
},
|
|
109
|
-
"options": [7, 8],
|
|
110
|
-
"variables": []
|
|
111
|
-
},
|
|
112
|
-
"7": {
|
|
113
|
-
"meta": {
|
|
114
|
-
"id": 7,
|
|
115
|
-
"type": "hidden",
|
|
116
|
-
"label": "Output for Option 1",
|
|
117
|
-
"step": "*",
|
|
118
|
-
"tags": [],
|
|
119
|
-
"output": "<p>Output for Option 1, Should display Variable 2 & 3 when Option 1 is selected, [var:2] [var:3]</p>\n",
|
|
120
|
-
"defaultRadio": 0,
|
|
121
|
-
"conditions": {
|
|
122
|
-
"selected": [{
|
|
123
|
-
"var": "o.3"
|
|
124
|
-
}]
|
|
125
|
-
},
|
|
126
|
-
"validator": {}
|
|
127
|
-
},
|
|
128
|
-
"options": [],
|
|
129
|
-
"variables": []
|
|
130
|
-
},
|
|
131
|
-
"8": {
|
|
132
|
-
"meta": {
|
|
133
|
-
"id": 8,
|
|
134
|
-
"type": "hidden",
|
|
135
|
-
"label": "Output for Option 2",
|
|
136
|
-
"step": "*",
|
|
137
|
-
"tags": [],
|
|
138
|
-
"output": "<p>Output for Option 2, Should display Variable 2 & 3 when Option 2 is selected, [var:2] [var:3]</p>\n",
|
|
139
|
-
"defaultRadio": 0,
|
|
140
|
-
"conditions": {
|
|
141
|
-
"selected": [{
|
|
142
|
-
"var": "o.4"
|
|
143
|
-
}]
|
|
144
|
-
},
|
|
145
|
-
"validator": {}
|
|
146
|
-
},
|
|
147
|
-
"options": [],
|
|
148
|
-
"variables": []
|
|
149
|
-
},
|
|
150
|
-
"9": {
|
|
151
|
-
"meta": {
|
|
152
|
-
"id": 9,
|
|
153
|
-
"type": "static",
|
|
154
|
-
"label": "Texte de la question",
|
|
155
|
-
"step": "*",
|
|
156
|
-
"tags": [],
|
|
157
|
-
"defaultRadio": 0,
|
|
158
|
-
"validator": {}
|
|
159
|
-
},
|
|
160
|
-
"options": [10, 11],
|
|
161
|
-
"variables": []
|
|
162
|
-
},
|
|
163
|
-
"10": {
|
|
164
|
-
"meta": {
|
|
165
|
-
"id": 10,
|
|
166
|
-
"type": "radio",
|
|
167
|
-
"label": "Text de l'option",
|
|
168
|
-
"step": "*",
|
|
169
|
-
"tags": [],
|
|
170
|
-
"defaultRadio": 0,
|
|
171
|
-
"validator": {}
|
|
172
|
-
},
|
|
173
|
-
"options": [],
|
|
174
|
-
"variables": []
|
|
175
|
-
},
|
|
176
|
-
"11": {
|
|
177
|
-
"meta": {
|
|
178
|
-
"id": 11,
|
|
179
|
-
"type": "radio",
|
|
180
|
-
"label": "Text de l'option",
|
|
181
|
-
"step": "*",
|
|
182
|
-
"tags": [],
|
|
183
|
-
"defaultRadio": 0,
|
|
184
|
-
"validator": {}
|
|
185
|
-
},
|
|
186
|
-
"options": [],
|
|
187
|
-
"variables": []
|
|
188
|
-
},
|
|
189
|
-
"12": {
|
|
190
|
-
"meta": {
|
|
191
|
-
"id": 12,
|
|
192
|
-
"type": "static",
|
|
193
|
-
"label": "Texte de la question",
|
|
194
|
-
"step": "*",
|
|
195
|
-
"tags": [],
|
|
196
|
-
"defaultRadio": 14,
|
|
197
|
-
"validator": {}
|
|
198
|
-
},
|
|
199
|
-
"options": [13, 14, 15, 16],
|
|
200
|
-
"variables": []
|
|
201
|
-
},
|
|
202
|
-
"13": {
|
|
203
|
-
"meta": {
|
|
204
|
-
"id": 13,
|
|
205
|
-
"type": "radio",
|
|
206
|
-
"label": "Text de l'option",
|
|
207
|
-
"step": "*",
|
|
208
|
-
"tags": [],
|
|
209
|
-
"defaultRadio": 0,
|
|
210
|
-
"validator": {}
|
|
211
|
-
},
|
|
212
|
-
"options": [],
|
|
213
|
-
"variables": []
|
|
214
|
-
},
|
|
215
|
-
"14": {
|
|
216
|
-
"meta": {
|
|
217
|
-
"id": 14,
|
|
218
|
-
"type": "radio",
|
|
219
|
-
"label": "Text de l'option",
|
|
220
|
-
"step": "*",
|
|
221
|
-
"tags": [],
|
|
222
|
-
"defaultRadio": 0,
|
|
223
|
-
"validator": {}
|
|
224
|
-
},
|
|
225
|
-
"options": [],
|
|
226
|
-
"variables": []
|
|
227
|
-
},
|
|
228
|
-
"15": {
|
|
229
|
-
"meta": {
|
|
230
|
-
"id": 15,
|
|
231
|
-
"type": "radio",
|
|
232
|
-
"label": "Text de l'option",
|
|
233
|
-
"step": "*",
|
|
234
|
-
"tags": [],
|
|
235
|
-
"defaultRadio": 0,
|
|
236
|
-
"validator": {}
|
|
237
|
-
},
|
|
238
|
-
"options": [],
|
|
239
|
-
"variables": []
|
|
240
|
-
},
|
|
241
|
-
"16": {
|
|
242
|
-
"meta": {
|
|
243
|
-
"id": 16,
|
|
244
|
-
"type": "radio",
|
|
245
|
-
"label": "Text de l'option",
|
|
246
|
-
"step": "*",
|
|
247
|
-
"tags": [],
|
|
248
|
-
"defaultRadio": 0,
|
|
249
|
-
"validator": {}
|
|
250
|
-
},
|
|
251
|
-
"options": [],
|
|
252
|
-
"variables": []
|
|
253
|
-
}
|
|
254
|
-
},
|
|
255
|
-
"variables": {
|
|
256
|
-
"1": {
|
|
257
|
-
"id": 1,
|
|
258
|
-
"label": "Variable 1",
|
|
259
|
-
"type": "text",
|
|
260
|
-
"placeholderLength": 16,
|
|
261
|
-
"step": "*"
|
|
262
|
-
},
|
|
263
|
-
"2": {
|
|
264
|
-
"id": 2,
|
|
265
|
-
"label": "Variable 2",
|
|
266
|
-
"type": "text",
|
|
267
|
-
"placeholderLength": 16,
|
|
268
|
-
"step": "*"
|
|
269
|
-
},
|
|
270
|
-
"3": {
|
|
271
|
-
"id": 3,
|
|
272
|
-
"label": "Variable 3",
|
|
273
|
-
"type": "text",
|
|
274
|
-
"placeholderLength": 16,
|
|
275
|
-
"step": "*"
|
|
276
|
-
}
|
|
277
|
-
},
|
|
278
|
-
"customization": {}
|
|
279
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"documents":{"main":{"name":"Votre document","sections":[{"id":1,"label":"My first section","tags":[],"options":[1,2,17,5,6]},{"id":2,"label":"Titre de la section","tags":[],"options":[9]},{"id":3,"label":"Titre de la section","tags":[],"options":[12]}]}},"options":{"1":{"meta":{"id":1,"type":"static","label":"Simple question","step":"*","tags":[],"defaultRadio":0,"validator":{}},"options":[],"variables":[1]},"2":{"meta":{"id":2,"type":"static","label":"Multiple question","step":"*","tags":[],"defaultRadio":4,"multiple":{"enabled":true},"validator":{}},"options":[3,4],"variables":[2,3]},"3":{"meta":{"id":3,"type":"radio","label":"Option 1","step":"*","tags":[],"defaultRadio":0,"validator":{}},"options":[],"variables":[]},"4":{"meta":{"id":4,"type":"radio","label":"Option 2","step":"*","tags":[],"defaultRadio":0,"validator":{}},"options":[],"variables":[]},"5":{"meta":{"id":5,"type":"hidden","label":"My simple output","step":"*","tags":[],"output":"<p>Should output <strong>Variable 1</strong> [var:1]</p>\n","defaultRadio":0,"validator":{}},"options":[],"variables":[]},"6":{"meta":{"id":6,"type":"repeated","label":"Repeated outputs","step":"*","tags":[],"defaultRadio":0,"repeatOption":2,"validator":{}},"options":[7,8],"variables":[]},"7":{"meta":{"id":7,"type":"hidden","label":"Output for Option 1","step":"*","tags":[],"output":"<p>Output for Option 1, Should display Variable 2 & 3 when Option 1 is selected, [var:2] [var:3]</p>\n","defaultRadio":0,"conditions":{"selected":[{"var":"o.3"}]},"validator":{}},"options":[],"variables":[]},"8":{"meta":{"id":8,"type":"hidden","label":"Output for Option 2","step":"*","tags":[],"output":"<p>Output for Option 2, Should display Variable 2 & 3 when Option 2 is selected, [var:2] [var:3]</p>\n","defaultRadio":0,"conditions":{"selected":[{"var":"o.4"}]},"validator":{}},"options":[],"variables":[]},"9":{"meta":{"id":9,"type":"static","label":"Texte de la question","step":"*","tags":[],"defaultRadio":0,"validator":{}},"options":[10,11],"variables":[]},"10":{"meta":{"id":10,"type":"radio","label":"Text de l'option","step":"*","tags":[],"defaultRadio":0,"validator":{}},"options":[],"variables":[]},"11":{"meta":{"id":11,"type":"radio","label":"Text de l'option","step":"*","tags":[],"defaultRadio":0,"validator":{}},"options":[],"variables":[]},"12":{"meta":{"id":12,"type":"static","label":"Texte de la question","step":"*","tags":[],"defaultRadio":14,"validator":{}},"options":[13,14,15,16],"variables":[]},"13":{"meta":{"id":13,"type":"radio","label":"Text de l'option","step":"*","tags":[],"defaultRadio":0,"validator":{}},"options":[],"variables":[]},"14":{"meta":{"id":14,"type":"radio","label":"Text de l'option","step":"*","tags":[],"defaultRadio":0,"validator":{}},"options":[],"variables":[]},"15":{"meta":{"id":15,"type":"radio","label":"Text de l'option","step":"*","tags":[],"defaultRadio":0,"validator":{}},"options":[],"variables":[]},"16":{"meta":{"id":16,"type":"radio","label":"Text de l'option","step":"*","tags":[],"defaultRadio":0,"validator":{}},"options":[],"variables":[]},"17":{"meta":{"id":17,"type":"repeated","label":"Repeated on - Multiple question","step":"*","output":"","repeatOption":2},"options":[],"variables":[]}},"variables":{"1":{"id":1,"label":"Variable 1","type":"text","placeholderLength":16,"step":"*"},"2":{"id":2,"label":"Variable 2","type":"text","placeholderLength":16,"step":"*"},"3":{"id":3,"label":"Variable 3","type":"text","placeholderLength":16,"step":"*"}},"customization":{}}
|
package/src/polyfills/index.ts
DELETED
package/src/polyfills/prepend.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/* eslint-disable func-names */
|
|
2
|
-
/* eslint-disable prefer-rest-params */
|
|
3
|
-
/* eslint-disable no-prototype-builtins */
|
|
4
|
-
// Source: https://github.com/jserz/js_piece/blob/master/DOM/ParentNode/prepend()/prepend().md
|
|
5
|
-
(function (arr) {
|
|
6
|
-
arr.forEach((item) => {
|
|
7
|
-
if (item.hasOwnProperty("prepend")) {
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
Object.defineProperty(item, "prepend", {
|
|
11
|
-
configurable: true,
|
|
12
|
-
enumerable: true,
|
|
13
|
-
writable: true,
|
|
14
|
-
value: function prepend() {
|
|
15
|
-
const argArr = Array.prototype.slice.call(arguments);
|
|
16
|
-
const docFrag = document.createDocumentFragment();
|
|
17
|
-
|
|
18
|
-
argArr.forEach((argItem) => {
|
|
19
|
-
const isNode = argItem instanceof Node;
|
|
20
|
-
docFrag.appendChild(
|
|
21
|
-
isNode ? argItem : document.createTextNode(String(argItem))
|
|
22
|
-
);
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
this.insertBefore(docFrag, this.firstChild);
|
|
26
|
-
},
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
})([Element.prototype, Document.prototype, DocumentFragment.prototype]);
|
|
30
|
-
|
|
31
|
-
export default true;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/* eslint-disable func-names */
|
|
2
|
-
/* eslint-disable no-bitwise */
|
|
3
|
-
/* eslint-disable no-plusplus */
|
|
4
|
-
/* eslint-disable no-restricted-globals */
|
|
5
|
-
/* eslint-disable no-param-reassign */
|
|
6
|
-
/* eslint-disable no-extend-native */
|
|
7
|
-
if (!String.prototype.repeat) {
|
|
8
|
-
String.prototype.repeat = function (count) {
|
|
9
|
-
if (this === null) throw new TypeError(`can't convert ${this} to object`);
|
|
10
|
-
|
|
11
|
-
let str = `${this}`;
|
|
12
|
-
// To convert string to integer.
|
|
13
|
-
count = +count;
|
|
14
|
-
// Check NaN
|
|
15
|
-
if (isNaN(count)) count = 0;
|
|
16
|
-
|
|
17
|
-
if (count < 0) throw new RangeError("repeat count must be non-negative");
|
|
18
|
-
|
|
19
|
-
if (count === Infinity)
|
|
20
|
-
throw new RangeError("repeat count must be less than infinity");
|
|
21
|
-
|
|
22
|
-
count = Math.floor(count);
|
|
23
|
-
if (str.length === 0 || count === 0) return "";
|
|
24
|
-
|
|
25
|
-
// Ensuring count is a 31-bit integer allows us to heavily optimize the
|
|
26
|
-
// main part. But anyway, most current (August 2014) browsers can't handle
|
|
27
|
-
// strings 1 << 28 chars or longer, so:
|
|
28
|
-
if (str.length * count >= 1 << 28)
|
|
29
|
-
throw new RangeError(
|
|
30
|
-
"repeat count must not overflow maximum string size"
|
|
31
|
-
);
|
|
32
|
-
|
|
33
|
-
const maxCount = str.length * count;
|
|
34
|
-
count = Math.floor(Math.log(count) / Math.log(2));
|
|
35
|
-
while (count) {
|
|
36
|
-
str += str;
|
|
37
|
-
count--;
|
|
38
|
-
}
|
|
39
|
-
str += str.substring(0, maxCount - str.length);
|
|
40
|
-
return str;
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export default true;
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
initMetaAction,
|
|
3
|
-
initInstanceAction,
|
|
4
|
-
updateInstancePaidAction,
|
|
5
|
-
initPaginationAction,
|
|
6
|
-
goPageAction,
|
|
7
|
-
goNextPageAction,
|
|
8
|
-
goPreviousPageAction,
|
|
9
|
-
updateAvailableSectionsAction,
|
|
10
|
-
} from './app';
|
|
11
|
-
|
|
12
|
-
describe('App actions test suit', () => {
|
|
13
|
-
// Init meta action
|
|
14
|
-
it('initMeta Action', () => {
|
|
15
|
-
const action = initMetaAction({
|
|
16
|
-
id: 123,
|
|
17
|
-
prefix: '',
|
|
18
|
-
permalink: 'document-permalink',
|
|
19
|
-
title: 'Title',
|
|
20
|
-
modelVersion: 1,
|
|
21
|
-
productType: 'demarche',
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
return expect(action).toStrictEqual({
|
|
25
|
-
type: 'INIT_META',
|
|
26
|
-
id: 123,
|
|
27
|
-
prefix: '',
|
|
28
|
-
permalink: 'document-permalink',
|
|
29
|
-
title: 'Title',
|
|
30
|
-
modelVersion: 1,
|
|
31
|
-
productType: 'demarche',
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
// Init instance action
|
|
36
|
-
it('initInstance Action', () => {
|
|
37
|
-
const action = initInstanceAction({
|
|
38
|
-
dataStatus: 'saved',
|
|
39
|
-
uniqid: 'ubsd989ded3',
|
|
40
|
-
isPaid: false,
|
|
41
|
-
steps: '*',
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
return expect(action).toStrictEqual({
|
|
45
|
-
type: 'INIT_INSTANCE',
|
|
46
|
-
dataStatus: 'saved',
|
|
47
|
-
uniqid: 'ubsd989ded3',
|
|
48
|
-
isPaid: false,
|
|
49
|
-
steps: '*',
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
// updateInstancePaid
|
|
54
|
-
it('updateInstancePaid Action', () => {
|
|
55
|
-
const action = updateInstancePaidAction(true);
|
|
56
|
-
|
|
57
|
-
return expect(action).toStrictEqual({
|
|
58
|
-
type: 'UPDATE_INSTANCE_PAID',
|
|
59
|
-
isPaid: true,
|
|
60
|
-
});
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
// initPagination
|
|
64
|
-
it('initPagination Action', () => {
|
|
65
|
-
const action = initPaginationAction({
|
|
66
|
-
currentSectionId: 1,
|
|
67
|
-
currentPage: 1,
|
|
68
|
-
greatestPage: 1,
|
|
69
|
-
availableSections: [1, 2, 3],
|
|
70
|
-
availableAppStates: ['wizard'],
|
|
71
|
-
currentAppState: 'wizard',
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
return expect(action).toStrictEqual({
|
|
75
|
-
type: 'INIT_PAGINATION',
|
|
76
|
-
currentSectionId: 1,
|
|
77
|
-
currentPage: 1,
|
|
78
|
-
greatestPage: 1,
|
|
79
|
-
availableSections: [1, 2, 3],
|
|
80
|
-
availableAppStates: ['wizard'],
|
|
81
|
-
currentAppState: 'wizard',
|
|
82
|
-
});
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
// goPage
|
|
86
|
-
it('goPage Action', () => {
|
|
87
|
-
const action = goPageAction(9);
|
|
88
|
-
|
|
89
|
-
return expect(action).toStrictEqual({
|
|
90
|
-
type: 'GO_PAGE',
|
|
91
|
-
currentPage: 9,
|
|
92
|
-
pushHistory: true,
|
|
93
|
-
});
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
// goNextPage
|
|
97
|
-
it('goNextPage Action', () => {
|
|
98
|
-
const action = goNextPageAction();
|
|
99
|
-
|
|
100
|
-
return expect(action).toStrictEqual({
|
|
101
|
-
type: 'GO_NEXT_PAGE',
|
|
102
|
-
});
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
// goPreviousPage
|
|
106
|
-
it('goPreviousPage Action', () => {
|
|
107
|
-
const action = goPreviousPageAction();
|
|
108
|
-
|
|
109
|
-
return expect(action).toStrictEqual({
|
|
110
|
-
type: 'GO_PREVIOUS_PAGE',
|
|
111
|
-
});
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
// updateAvailableSections
|
|
115
|
-
it('updateAvailableSections Action', () => {
|
|
116
|
-
const action = updateAvailableSectionsAction([1, 2, 3]);
|
|
117
|
-
|
|
118
|
-
return expect(action).toStrictEqual({
|
|
119
|
-
type: 'UPDATE_AVAILABLE_SECTIONS',
|
|
120
|
-
availableSections: [1, 2, 3],
|
|
121
|
-
});
|
|
122
|
-
});
|
|
123
|
-
});
|