@wise/dynamic-flow-client 5.16.1 → 5.17.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/build/i18n/nl.json +1 -1
- package/build/i18n/pt.json +1 -1
- package/build/i18n/ru.json +1 -1
- package/build/i18n/th.json +1 -1
- package/build/i18n/tr.json +1 -1
- package/build/i18n/zh_CN.json +4 -4
- package/build/main.js +712 -774
- package/build/main.mjs +712 -774
- package/build/tsconfig.types.tsbuildinfo +1 -1
- package/build/types/controller/FlowController.d.ts.map +1 -1
- package/build/types/controller/executeRequest.d.ts.map +1 -1
- package/build/types/domain/components/AlertComponent.d.ts +1 -1
- package/build/types/domain/components/AlertComponent.d.ts.map +1 -1
- package/build/types/domain/components/AllOfComponent.d.ts +1 -1
- package/build/types/domain/components/AllOfComponent.d.ts.map +1 -1
- package/build/types/domain/components/BooleanInputComponent.d.ts +2 -2
- package/build/types/domain/components/BooleanInputComponent.d.ts.map +1 -1
- package/build/types/domain/components/BoxComponent.d.ts +1 -1
- package/build/types/domain/components/BoxComponent.d.ts.map +1 -1
- package/build/types/domain/components/ButtonComponent.d.ts +1 -1
- package/build/types/domain/components/ButtonComponent.d.ts.map +1 -1
- package/build/types/domain/components/ColumnsComponent.d.ts +1 -1
- package/build/types/domain/components/ColumnsComponent.d.ts.map +1 -1
- package/build/types/domain/components/ConstComponent.d.ts +1 -1
- package/build/types/domain/components/ConstComponent.d.ts.map +1 -1
- package/build/types/domain/components/ContainerComponent.d.ts +1 -1
- package/build/types/domain/components/ContainerComponent.d.ts.map +1 -1
- package/build/types/domain/components/DateInputComponent.d.ts +2 -2
- package/build/types/domain/components/DateInputComponent.d.ts.map +1 -1
- package/build/types/domain/components/DecisionComponent.d.ts +3 -2
- package/build/types/domain/components/DecisionComponent.d.ts.map +1 -1
- package/build/types/domain/components/FormComponent.d.ts +1 -1
- package/build/types/domain/components/FormComponent.d.ts.map +1 -1
- package/build/types/domain/components/FormattedValueComponent.d.ts +1 -1
- package/build/types/domain/components/FormattedValueComponent.d.ts.map +1 -1
- package/build/types/domain/components/HeadingComponent.d.ts +1 -1
- package/build/types/domain/components/HeadingComponent.d.ts.map +1 -1
- package/build/types/domain/components/ImageComponent.d.ts +1 -1
- package/build/types/domain/components/ImageComponent.d.ts.map +1 -1
- package/build/types/domain/components/InstructionsComponent.d.ts +1 -1
- package/build/types/domain/components/InstructionsComponent.d.ts.map +1 -1
- package/build/types/domain/components/IntegerInputComponent.d.ts +2 -2
- package/build/types/domain/components/IntegerInputComponent.d.ts.map +1 -1
- package/build/types/domain/components/ListComponent.d.ts +1 -1
- package/build/types/domain/components/ListComponent.d.ts.map +1 -1
- package/build/types/domain/components/LoadingIndicatorComponent.d.ts +1 -1
- package/build/types/domain/components/LoadingIndicatorComponent.d.ts.map +1 -1
- package/build/types/domain/components/MarkdownComponent.d.ts +1 -1
- package/build/types/domain/components/MarkdownComponent.d.ts.map +1 -1
- package/build/types/domain/components/ModalComponent.d.ts +1 -1
- package/build/types/domain/components/ModalComponent.d.ts.map +1 -1
- package/build/types/domain/components/ModalLayoutComponent.d.ts +1 -1
- package/build/types/domain/components/ModalLayoutComponent.d.ts.map +1 -1
- package/build/types/domain/components/MoneyInputComponent.d.ts +1 -1
- package/build/types/domain/components/MoneyInputComponent.d.ts.map +1 -1
- package/build/types/domain/components/MultiSelectInputComponent.d.ts +2 -2
- package/build/types/domain/components/MultiSelectInputComponent.d.ts.map +1 -1
- package/build/types/domain/components/MultiUploadInputComponent.d.ts +3 -3
- package/build/types/domain/components/MultiUploadInputComponent.d.ts.map +1 -1
- package/build/types/domain/components/NumberInputComponent.d.ts +2 -2
- package/build/types/domain/components/NumberInputComponent.d.ts.map +1 -1
- package/build/types/domain/components/ObjectComponent.d.ts +1 -1
- package/build/types/domain/components/ObjectComponent.d.ts.map +1 -1
- package/build/types/domain/components/ParagraphComponent.d.ts +1 -1
- package/build/types/domain/components/ParagraphComponent.d.ts.map +1 -1
- package/build/types/domain/components/PersistAsyncComponent.d.ts.map +1 -1
- package/build/types/domain/components/ProgressComponent.d.ts +1 -1
- package/build/types/domain/components/ProgressComponent.d.ts.map +1 -1
- package/build/types/domain/components/RepeatableComponent.d.ts +5 -5
- package/build/types/domain/components/RepeatableComponent.d.ts.map +1 -1
- package/build/types/domain/components/ReviewComponent.d.ts +1 -1
- package/build/types/domain/components/ReviewComponent.d.ts.map +1 -1
- package/build/types/domain/components/RootDomainComponent.d.ts.map +1 -1
- package/build/types/domain/components/SectionComponent.d.ts.map +1 -1
- package/build/types/domain/components/SelectInputComponent.d.ts +2 -2
- package/build/types/domain/components/SelectInputComponent.d.ts.map +1 -1
- package/build/types/domain/components/StatusListComponent.d.ts +1 -1
- package/build/types/domain/components/StatusListComponent.d.ts.map +1 -1
- package/build/types/domain/components/SubflowComponent.d.ts +1 -1
- package/build/types/domain/components/SubflowComponent.d.ts.map +1 -1
- package/build/types/domain/components/TabsComponent.d.ts +1 -1
- package/build/types/domain/components/TabsComponent.d.ts.map +1 -1
- package/build/types/domain/components/TextInputComponent.d.ts +2 -2
- package/build/types/domain/components/TextInputComponent.d.ts.map +1 -1
- package/build/types/domain/components/TupleComponent.d.ts +1 -1
- package/build/types/domain/components/TupleComponent.d.ts.map +1 -1
- package/build/types/domain/components/UploadInputComponent.d.ts +2 -2
- package/build/types/domain/components/UploadInputComponent.d.ts.map +1 -1
- package/build/types/domain/components/UpsellComponent.d.ts +2 -2
- package/build/types/domain/components/UpsellComponent.d.ts.map +1 -1
- package/build/types/domain/components/searchComponent/SearchComponent.d.ts +3 -3
- package/build/types/domain/components/searchComponent/SearchComponent.d.ts.map +1 -1
- package/build/types/domain/components/step/ExternalConfirmationComponent.d.ts.map +1 -1
- package/build/types/domain/components/step/StepDomainComponent.d.ts +5 -2
- package/build/types/domain/components/step/StepDomainComponent.d.ts.map +1 -1
- package/build/types/domain/features/eventNames.d.ts +1 -1
- package/build/types/domain/features/eventNames.d.ts.map +1 -1
- package/build/types/domain/features/events.d.ts +2 -0
- package/build/types/domain/features/events.d.ts.map +1 -1
- package/build/types/domain/mappers/layout/decisionLayoutToComponent.d.ts.map +1 -1
- package/build/types/domain/mappers/layout/reviewLayoutToComponent.d.ts.map +1 -1
- package/build/types/domain/mappers/mapStepToComponent.d.ts.map +1 -1
- package/build/types/domain/mappers/schema/persistAsyncSchemaToComponent.d.ts +15 -15
- package/build/types/domain/mappers/utils/FeatureFlags.d.ts +1 -1
- package/build/types/domain/mappers/utils/FeatureFlags.d.ts.map +1 -1
- package/build/types/domain/mappers/utils/behavior-utils.d.ts.map +1 -1
- package/build/types/domain/mappers/utils/call-to-action-utils.d.ts.map +1 -1
- package/build/types/domain/mappers/utils/getHrefWithTracking.d.ts +8 -0
- package/build/types/domain/mappers/utils/getHrefWithTracking.d.ts.map +1 -0
- package/build/types/domain/mappers/utils/utils.d.ts.map +1 -1
- package/build/types/domain/types.d.ts +10 -0
- package/build/types/domain/types.d.ts.map +1 -1
- package/build/types/renderers/mappers/alertComponentToProps.d.ts.map +1 -1
- package/build/types/renderers/mappers/booleanInputComponentToProps.d.ts.map +1 -1
- package/build/types/renderers/mappers/columnsComponentToProps.d.ts +1 -1
- package/build/types/renderers/mappers/columnsComponentToProps.d.ts.map +1 -1
- package/build/types/renderers/mappers/containerComponentToProps.d.ts.map +1 -1
- package/build/types/renderers/mappers/dateInputComponentToProps.d.ts.map +1 -1
- package/build/types/renderers/mappers/decisionComponentToProps.d.ts.map +1 -1
- package/build/types/renderers/mappers/externalComponentToProps.d.ts.map +1 -1
- package/build/types/renderers/mappers/formComponentToProps.d.ts.map +1 -1
- package/build/types/renderers/mappers/integerInputComponentToProps.d.ts.map +1 -1
- package/build/types/renderers/mappers/listComponentToProps.d.ts.map +1 -1
- package/build/types/renderers/mappers/modalComponentToProps.d.ts.map +1 -1
- package/build/types/renderers/mappers/modalLayoutComponentToProps.d.ts.map +1 -1
- package/build/types/renderers/mappers/multiSelectComponentToProps.d.ts.map +1 -1
- package/build/types/renderers/mappers/multiUploadInputComponentToProps.d.ts.map +1 -1
- package/build/types/renderers/mappers/numberInputComponentToProps.d.ts.map +1 -1
- package/build/types/renderers/mappers/repeatableComponentToProps.d.ts.map +1 -1
- package/build/types/renderers/mappers/reviewComponentToProps.d.ts.map +1 -1
- package/build/types/renderers/mappers/searchComponentToProps.d.ts.map +1 -1
- package/build/types/renderers/mappers/sectionComponentToProps.d.ts.map +1 -1
- package/build/types/renderers/mappers/selectInputComponentToProps.d.ts.map +1 -1
- package/build/types/renderers/mappers/statusListComponentToProps.d.ts.map +1 -1
- package/build/types/renderers/mappers/textInputComponentToProps.d.ts.map +1 -1
- package/build/types/renderers/mappers/uploadInputComponentToProps.d.ts.map +1 -1
- package/build/types/renderers/mappers/upsellComponentToProps.d.ts.map +1 -1
- package/build/types/renderers/mappers/utils/inputComponentToProps.d.ts +13 -13
- package/build/types/renderers/mappers/utils/inputComponentToProps.d.ts.map +1 -1
- package/build/types/renderers/mappers/utils/mapCallToAction.d.ts +6 -0
- package/build/types/renderers/mappers/utils/mapCallToAction.d.ts.map +1 -0
- package/build/types/stories/utils/render-utils.d.ts.map +1 -1
- package/build/types/test-utils/DynamicFlowWise.d.ts.map +1 -1
- package/package.json +4 -4
- package/build/types/domain/components/utils/WithUpdate.d.ts +0 -5
- package/build/types/domain/components/utils/WithUpdate.d.ts.map +0 -1
package/build/main.mjs
CHANGED
|
@@ -441,7 +441,7 @@ var nl_default = {
|
|
|
441
441
|
"dynamicFlows.ControlFeedback.type": "Onjuist type",
|
|
442
442
|
"dynamicFlows.DownloadFeedback.failed": "Downloaden mislukt",
|
|
443
443
|
"dynamicFlows.DownloadFeedback.started": "Downloaden...",
|
|
444
|
-
"dynamicFlows.DownloadFeedback.successful": "
|
|
444
|
+
"dynamicFlows.DownloadFeedback.successful": "Downloaden gelukt",
|
|
445
445
|
"dynamicFlows.DynamicParagraph.copied": "Naar klembord gekopieerd",
|
|
446
446
|
"dynamicFlows.DynamicParagraph.copy": "Kopi\xEBren",
|
|
447
447
|
"dynamicFlows.ErrorBoundary.errorAlert": "Er is iets misgegaan.",
|
|
@@ -521,7 +521,7 @@ var pt_default = {
|
|
|
521
521
|
"dynamicFlows.ControlFeedback.type": "Tipo incorreto",
|
|
522
522
|
"dynamicFlows.DownloadFeedback.failed": "Falha no envio",
|
|
523
523
|
"dynamicFlows.DownloadFeedback.started": "Baixando...",
|
|
524
|
-
"dynamicFlows.DownloadFeedback.successful": "Download
|
|
524
|
+
"dynamicFlows.DownloadFeedback.successful": "Download realizado",
|
|
525
525
|
"dynamicFlows.DynamicParagraph.copied": "Copiado",
|
|
526
526
|
"dynamicFlows.DynamicParagraph.copy": "Copiar",
|
|
527
527
|
"dynamicFlows.ErrorBoundary.errorAlert": "Algo deu errado.",
|
|
@@ -601,7 +601,7 @@ var ru_default = {
|
|
|
601
601
|
"dynamicFlows.ControlFeedback.type": "\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0442\u0438\u043F",
|
|
602
602
|
"dynamicFlows.DownloadFeedback.failed": "\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043A\u0430\u0447\u0430\u0442\u044C",
|
|
603
603
|
"dynamicFlows.DownloadFeedback.started": "\u0421\u043A\u0430\u0447\u0438\u0432\u0430\u043D\u0438\u0435...",
|
|
604
|
-
"dynamicFlows.DownloadFeedback.successful": "
|
|
604
|
+
"dynamicFlows.DownloadFeedback.successful": "\u0421\u043A\u0430\u0447\u0438\u0432\u0430\u043D\u0438\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u043E",
|
|
605
605
|
"dynamicFlows.DynamicParagraph.copied": "\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043E \u0432 \u0431\u0443\u0444\u0435\u0440 \u043E\u0431\u043C\u0435\u043D\u0430",
|
|
606
606
|
"dynamicFlows.DynamicParagraph.copy": "\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C",
|
|
607
607
|
"dynamicFlows.ErrorBoundary.errorAlert": "\u0427\u0442\u043E-\u0442\u043E \u043F\u043E\u0448\u043B\u043E \u043D\u0435 \u0442\u0430\u043A.",
|
|
@@ -641,7 +641,7 @@ var th_default = {
|
|
|
641
641
|
"dynamicFlows.ControlFeedback.type": "\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
642
642
|
"dynamicFlows.DownloadFeedback.failed": "\u0E14\u0E32\u0E27\u0E19\u0E4C\u0E42\u0E2B\u0E25\u0E14\u0E25\u0E49\u0E21\u0E40\u0E2B\u0E25\u0E27",
|
|
643
643
|
"dynamicFlows.DownloadFeedback.started": "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E14\u0E32\u0E27\u0E19\u0E4C\u0E42\u0E2B\u0E25\u0E14...",
|
|
644
|
-
"dynamicFlows.DownloadFeedback.successful": "
|
|
644
|
+
"dynamicFlows.DownloadFeedback.successful": "\u0E14\u0E32\u0E27\u0E19\u0E4C\u0E42\u0E2B\u0E25\u0E14\u0E40\u0E23\u0E35\u0E22\u0E1A\u0E23\u0E49\u0E2D\u0E22\u0E41\u0E25\u0E49\u0E27",
|
|
645
645
|
"dynamicFlows.DynamicParagraph.copied": "\u0E04\u0E31\u0E14\u0E25\u0E2D\u0E01\u0E44\u0E1B\u0E22\u0E31\u0E07\u0E04\u0E25\u0E34\u0E1B\u0E1A\u0E2D\u0E23\u0E4C\u0E14",
|
|
646
646
|
"dynamicFlows.DynamicParagraph.copy": "\u0E04\u0E31\u0E14\u0E25\u0E2D\u0E01",
|
|
647
647
|
"dynamicFlows.ErrorBoundary.errorAlert": "\u0E40\u0E01\u0E34\u0E14\u0E02\u0E49\u0E2D\u0E1C\u0E34\u0E14\u0E1E\u0E25\u0E32\u0E14\u0E1A\u0E32\u0E07\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E02\u0E36\u0E49\u0E19",
|
|
@@ -681,7 +681,7 @@ var tr_default = {
|
|
|
681
681
|
"dynamicFlows.ControlFeedback.type": "Ge\xE7ersiz se\xE7im",
|
|
682
682
|
"dynamicFlows.DownloadFeedback.failed": "\u0130ndirme ba\u015Far\u0131s\u0131z",
|
|
683
683
|
"dynamicFlows.DownloadFeedback.started": "\u0130ndiriliyor...",
|
|
684
|
-
"dynamicFlows.DownloadFeedback.successful": "
|
|
684
|
+
"dynamicFlows.DownloadFeedback.successful": "\u0130ndirme ba\u015Far\u0131l\u0131",
|
|
685
685
|
"dynamicFlows.DynamicParagraph.copied": "Panoya kopyaland\u0131",
|
|
686
686
|
"dynamicFlows.DynamicParagraph.copy": "Kopyala",
|
|
687
687
|
"dynamicFlows.ErrorBoundary.errorAlert": "Bir sorun olu\u015Ftu.",
|
|
@@ -720,8 +720,8 @@ var zh_CN_default = {
|
|
|
720
720
|
"dynamicFlows.ControlFeedback.required": "\u8BF7\u586B\u5199\u6B64\u5B57\u6BB5\u3002",
|
|
721
721
|
"dynamicFlows.ControlFeedback.type": "\u7C7B\u578B\u9519\u8BEF",
|
|
722
722
|
"dynamicFlows.DownloadFeedback.failed": "\u4E0B\u8F7D\u5931\u8D25",
|
|
723
|
-
"dynamicFlows.DownloadFeedback.started": "\u6B63\u5728\u4E0B\u8F7D
|
|
724
|
-
"dynamicFlows.DownloadFeedback.successful": "
|
|
723
|
+
"dynamicFlows.DownloadFeedback.started": "\u6B63\u5728\u4E0B\u8F7D\u2026\u2026",
|
|
724
|
+
"dynamicFlows.DownloadFeedback.successful": "\u4E0B\u8F7D\u6210\u529F",
|
|
725
725
|
"dynamicFlows.DynamicParagraph.copied": "\u5DF2\u590D\u5236\u5230\u526A\u8D34\u677F",
|
|
726
726
|
"dynamicFlows.DynamicParagraph.copy": "\u590D\u5236",
|
|
727
727
|
"dynamicFlows.ErrorBoundary.errorAlert": "\u51FA\u9519\u4E86\u3002",
|
|
@@ -731,14 +731,14 @@ var zh_CN_default = {
|
|
|
731
731
|
"dynamicFlows.ExternalConfirmation.open": "\u5728\u65B0\u6807\u7B7E\u9875\u4E2D\u6253\u5F00",
|
|
732
732
|
"dynamicFlows.ExternalConfirmation.title": "\u8BF7\u786E\u8BA4",
|
|
733
733
|
"dynamicFlows.FileUploadSchema.maxFileSizeError": "\u62B1\u6B49\uFF0C\u8BE5\u6587\u4EF6\u592A\u5927\u3002\u8BF7\u4E0A\u4F20\u4E00\u4E2A\u66F4\u5C0F\u7684\u6587\u4EF6\u3002",
|
|
734
|
-
"dynamicFlows.FileUploadSchema.wrongFileTypeError": "\u62B1\u6B49\uFF0C\u4E0D\u652F\u6301\u8BE5\u6587\u4EF6\u683C\u5F0F\u3002\u8BF7\u4E0A\u4F20\u5176\u4ED6\u6587\u4EF6\u3002",
|
|
734
|
+
"dynamicFlows.FileUploadSchema.wrongFileTypeError": "\u62B1\u6B49\uFF0C\u7CFB\u7EDF\u6682\u4E0D\u652F\u6301\u8BE5\u6587\u4EF6\u683C\u5F0F\u3002\u8BF7\u4E0A\u4F20\u5176\u4ED6\u6587\u4EF6\u3002",
|
|
735
735
|
"dynamicFlows.Help.ariaLabel": "\u70B9\u51FB\u6B64\u5904\u83B7\u53D6\u66F4\u591A\u4FE1\u606F\u3002",
|
|
736
736
|
"dynamicFlows.MultiSelect.summary": "{first} \u548C\u5176\u4ED6 {count} \u4E2A",
|
|
737
737
|
"dynamicFlows.MultipleFileUploadSchema.maxFileSizeError": "\u62B1\u6B49\uFF0C\u8BE5\u6587\u4EF6\u592A\u5927\u3002\u8BF7\u4E0A\u4F20\u4E00\u4E2A\u66F4\u5C0F\u7684\u6587\u4EF6\u3002",
|
|
738
738
|
"dynamicFlows.MultipleFileUploadSchema.maxItemsError": "\u8BF7\u4E0A\u4F20\u4E0D\u8D85\u8FC7 {maxItems} \u4E2A\u6587\u4EF6\u3002",
|
|
739
739
|
"dynamicFlows.MultipleFileUploadSchema.minItemsError": "\u8BF7\u4E0A\u4F20\u81F3\u5C11 {minItems} \u4E2A\u6587\u4EF6\u3002",
|
|
740
740
|
"dynamicFlows.PersistAsyncSchema.genericError": "\u51FA\u9519\u4E86\uFF0C\u8BF7\u91CD\u8BD5\u3002",
|
|
741
|
-
"dynamicFlows.SearchLayout.loading": "\u6B63\u5728\u52A0\u8F7D\u2026"
|
|
741
|
+
"dynamicFlows.SearchLayout.loading": "\u6B63\u5728\u52A0\u8F7D\u2026\u2026"
|
|
742
742
|
};
|
|
743
743
|
|
|
744
744
|
// src/i18n/zh_HK.json
|
|
@@ -1018,7 +1018,7 @@ var getInputUpdateFunction = (onComponentUpdate) => {
|
|
|
1018
1018
|
// src/domain/components/RootDomainComponent.ts
|
|
1019
1019
|
var createRootDomainComponent = (onComponentUpdate, scrollToTop, backConfig, requestCache) => {
|
|
1020
1020
|
const update = getInputUpdateFunction(onComponentUpdate);
|
|
1021
|
-
const
|
|
1021
|
+
const component = {
|
|
1022
1022
|
type: "root",
|
|
1023
1023
|
kind: "step",
|
|
1024
1024
|
uid: "root",
|
|
@@ -1026,107 +1026,104 @@ var createRootDomainComponent = (onComponentUpdate, scrollToTop, backConfig, req
|
|
|
1026
1026
|
stepStack: [],
|
|
1027
1027
|
backConfig,
|
|
1028
1028
|
requestCache,
|
|
1029
|
-
_update(updateFn) {
|
|
1030
|
-
update(this, updateFn);
|
|
1031
|
-
},
|
|
1032
1029
|
dismissAllModals() {
|
|
1033
1030
|
var _a;
|
|
1034
|
-
(_a =
|
|
1031
|
+
(_a = component.getStep()) == null ? void 0 : _a.dismissAllModals();
|
|
1035
1032
|
},
|
|
1036
1033
|
dismissModal() {
|
|
1037
1034
|
var _a;
|
|
1038
|
-
(_a =
|
|
1035
|
+
(_a = component.getStep()) == null ? void 0 : _a.dismissModal();
|
|
1039
1036
|
},
|
|
1040
1037
|
showModal(modal) {
|
|
1041
1038
|
var _a;
|
|
1042
|
-
(_a =
|
|
1039
|
+
(_a = component.getStep()) == null ? void 0 : _a.showModal(modal);
|
|
1043
1040
|
},
|
|
1044
1041
|
getChildren() {
|
|
1045
|
-
const step =
|
|
1042
|
+
const step = component.getStep();
|
|
1046
1043
|
return step ? [step, ...step.getModals()] : [];
|
|
1047
1044
|
},
|
|
1048
1045
|
getLocalValue() {
|
|
1049
1046
|
var _a, _b;
|
|
1050
|
-
return (_b = (_a =
|
|
1047
|
+
return (_b = (_a = component.getStep()) == null ? void 0 : _a.getLocalValue()) != null ? _b : null;
|
|
1051
1048
|
},
|
|
1052
1049
|
async getSubmittableValue() {
|
|
1053
1050
|
var _a, _b;
|
|
1054
|
-
return (_b = (_a =
|
|
1051
|
+
return (_b = (_a = component.getStep()) == null ? void 0 : _a.getSubmittableValue()) != null ? _b : null;
|
|
1055
1052
|
},
|
|
1056
1053
|
getSubmittableValueSync() {
|
|
1057
1054
|
var _a, _b;
|
|
1058
|
-
return (_b = (_a =
|
|
1055
|
+
return (_b = (_a = component.getStep()) == null ? void 0 : _a.getSubmittableValueSync()) != null ? _b : null;
|
|
1059
1056
|
},
|
|
1060
1057
|
validate() {
|
|
1061
1058
|
var _a, _b;
|
|
1062
|
-
return (_b = (_a =
|
|
1059
|
+
return (_b = (_a = component.getStep()) == null ? void 0 : _a.validate()) != null ? _b : false;
|
|
1063
1060
|
},
|
|
1064
1061
|
setLoadingState(loadingState) {
|
|
1065
1062
|
var _a;
|
|
1066
|
-
(_a =
|
|
1063
|
+
(_a = component.getStep()) == null ? void 0 : _a.setLoadingState(loadingState);
|
|
1067
1064
|
},
|
|
1068
1065
|
getLoadingState() {
|
|
1069
1066
|
var _a, _b;
|
|
1070
|
-
return (_b = (_a =
|
|
1067
|
+
return (_b = (_a = component.getStep()) == null ? void 0 : _a.loadingState) != null ? _b : "initial";
|
|
1071
1068
|
},
|
|
1072
1069
|
getSchemaComponents() {
|
|
1073
1070
|
var _a, _b;
|
|
1074
|
-
return (_b = (_a =
|
|
1071
|
+
return (_b = (_a = component.getStep()) == null ? void 0 : _a.schemaComponents) != null ? _b : [];
|
|
1075
1072
|
},
|
|
1076
1073
|
getTrackEvent() {
|
|
1077
1074
|
var _a, _b;
|
|
1078
|
-
return (_b = (_a =
|
|
1075
|
+
return (_b = (_a = component.getStep()) == null ? void 0 : _a.trackEvent) != null ? _b : null;
|
|
1079
1076
|
},
|
|
1080
1077
|
isBusy() {
|
|
1081
|
-
const loadingState =
|
|
1078
|
+
const loadingState = component.getLoadingState();
|
|
1082
1079
|
return loadingState === "submitting" || loadingState === "refreshing";
|
|
1083
1080
|
},
|
|
1084
1081
|
hasStep() {
|
|
1085
|
-
return Boolean(
|
|
1082
|
+
return Boolean(component.stepStack.length > 0);
|
|
1086
1083
|
},
|
|
1087
1084
|
getStep() {
|
|
1088
1085
|
var _a;
|
|
1089
|
-
return (_a =
|
|
1086
|
+
return (_a = component.stepStack[component.stepStack.length - 1]) != null ? _a : null;
|
|
1090
1087
|
},
|
|
1091
1088
|
addSubflow(subflow) {
|
|
1092
1089
|
var _a;
|
|
1093
|
-
(_a =
|
|
1090
|
+
(_a = component.getStep()) == null ? void 0 : _a.addSubflow(subflow);
|
|
1094
1091
|
},
|
|
1095
1092
|
closeSubflow() {
|
|
1096
1093
|
var _a;
|
|
1097
|
-
(_a =
|
|
1094
|
+
(_a = component.getStep()) == null ? void 0 : _a.closeSubflow();
|
|
1098
1095
|
},
|
|
1099
1096
|
getSubflow() {
|
|
1100
1097
|
var _a, _b;
|
|
1101
|
-
return (_b = (_a =
|
|
1098
|
+
return (_b = (_a = component.getStep()) == null ? void 0 : _a.subflow) != null ? _b : null;
|
|
1102
1099
|
},
|
|
1103
1100
|
start() {
|
|
1104
1101
|
var _a;
|
|
1105
|
-
(_a =
|
|
1102
|
+
(_a = component.getStep()) == null ? void 0 : _a.start();
|
|
1106
1103
|
},
|
|
1107
1104
|
stop() {
|
|
1108
1105
|
var _a;
|
|
1109
|
-
(_a =
|
|
1106
|
+
(_a = component.getStep()) == null ? void 0 : _a.stop();
|
|
1110
1107
|
},
|
|
1111
1108
|
updateStep(stepComponent) {
|
|
1112
1109
|
var _a;
|
|
1113
|
-
|
|
1114
|
-
const shouldScroll = shouldScrollOnStepUpdate(stepComponent,
|
|
1115
|
-
|
|
1110
|
+
component.closeSubflow();
|
|
1111
|
+
const shouldScroll = shouldScrollOnStepUpdate(stepComponent, component.getStep());
|
|
1112
|
+
update(component, (draft) => {
|
|
1116
1113
|
draft.stepStack = draft.stepStack.slice(0, -1);
|
|
1117
1114
|
draft.stepStack.push(stepComponent);
|
|
1118
1115
|
});
|
|
1119
1116
|
if (shouldScroll) {
|
|
1120
1117
|
scrollToTop == null ? void 0 : scrollToTop("smooth");
|
|
1121
1118
|
}
|
|
1122
|
-
(_a =
|
|
1119
|
+
(_a = component.getStep()) == null ? void 0 : _a.start();
|
|
1123
1120
|
},
|
|
1124
1121
|
pushStep(stepComponent) {
|
|
1125
1122
|
var _a;
|
|
1126
|
-
|
|
1127
|
-
const previousStep =
|
|
1123
|
+
component.closeSubflow();
|
|
1124
|
+
const previousStep = component.getStep();
|
|
1128
1125
|
const previousStepHasPolling = previousStep == null ? void 0 : previousStep.step.polling;
|
|
1129
|
-
|
|
1126
|
+
update(component, (draft) => {
|
|
1130
1127
|
switch (stepComponent.stackBehavior) {
|
|
1131
1128
|
case "remove-previous":
|
|
1132
1129
|
case "replace-current":
|
|
@@ -1143,41 +1140,41 @@ var createRootDomainComponent = (onComponentUpdate, scrollToTop, backConfig, req
|
|
|
1143
1140
|
}
|
|
1144
1141
|
});
|
|
1145
1142
|
if (previousStep != null) {
|
|
1146
|
-
(_a =
|
|
1143
|
+
(_a = component.getStep()) == null ? void 0 : _a.start();
|
|
1147
1144
|
scrollToTop == null ? void 0 : scrollToTop("instant");
|
|
1148
1145
|
}
|
|
1149
1146
|
},
|
|
1150
1147
|
clearStack() {
|
|
1151
|
-
const currentStep =
|
|
1148
|
+
const currentStep = component.getStep();
|
|
1152
1149
|
if (currentStep) {
|
|
1153
|
-
|
|
1150
|
+
update(component, (draft) => {
|
|
1154
1151
|
draft.stepStack = [currentStep];
|
|
1155
1152
|
});
|
|
1156
1153
|
}
|
|
1157
1154
|
},
|
|
1158
1155
|
getRefreshUrl() {
|
|
1159
1156
|
var _a, _b, _c, _d;
|
|
1160
|
-
return (_d = (_c = (_a =
|
|
1157
|
+
return (_d = (_c = (_a = component.getStep()) == null ? void 0 : _a.step.refreshUrl) != null ? _c : (_b = component.getStep()) == null ? void 0 : _b.step.refreshFormUrl) != null ? _d : null;
|
|
1161
1158
|
},
|
|
1162
1159
|
navigateBack() {
|
|
1163
1160
|
var _a;
|
|
1164
|
-
|
|
1165
|
-
if (
|
|
1161
|
+
component.closeSubflow();
|
|
1162
|
+
if (component.stepStack.length === 1) {
|
|
1166
1163
|
return;
|
|
1167
1164
|
}
|
|
1168
|
-
|
|
1165
|
+
update(component, (draft) => {
|
|
1169
1166
|
draft.stepStack = draft.stepStack.slice(0, -1);
|
|
1170
1167
|
});
|
|
1171
|
-
(_a =
|
|
1168
|
+
(_a = component.getStep()) == null ? void 0 : _a.start();
|
|
1172
1169
|
},
|
|
1173
1170
|
canPerformBack() {
|
|
1174
1171
|
var _a, _b;
|
|
1175
|
-
const navigation = (_a =
|
|
1172
|
+
const navigation = (_a = component.getStep()) == null ? void 0 : _a.step.navigation;
|
|
1176
1173
|
const stepHasBehavior = Boolean((_b = navigation == null ? void 0 : navigation.back) != null ? _b : navigation == null ? void 0 : navigation.backButton);
|
|
1177
|
-
return
|
|
1174
|
+
return component.backConfig.isFlowCancellable || component.stepStack.length > 1 && component.backConfig.isNativeBackEnabled || stepHasBehavior;
|
|
1178
1175
|
}
|
|
1179
1176
|
};
|
|
1180
|
-
return
|
|
1177
|
+
return component;
|
|
1181
1178
|
};
|
|
1182
1179
|
var shouldScrollOnStepUpdate = (newStep, currentStep) => {
|
|
1183
1180
|
if (!currentStep) {
|
|
@@ -1186,6 +1183,15 @@ var shouldScrollOnStepUpdate = (newStep, currentStep) => {
|
|
|
1186
1183
|
return newStep.error != null && newStep.error !== currentStep.error;
|
|
1187
1184
|
};
|
|
1188
1185
|
|
|
1186
|
+
// src/domain/features/events.ts
|
|
1187
|
+
var trackBehaviorTriggered = (trackEvent, behavior) => {
|
|
1188
|
+
if (behavior.track) {
|
|
1189
|
+
trackEvent("Behavior Triggered", __spreadProps(__spreadValues({}, behavior.analytics), {
|
|
1190
|
+
behaviorType: behavior.type
|
|
1191
|
+
}));
|
|
1192
|
+
}
|
|
1193
|
+
};
|
|
1194
|
+
|
|
1189
1195
|
// src/domain/features/prefetch/request-cache.ts
|
|
1190
1196
|
var makeRequestCacheWithParent = (parent) => {
|
|
1191
1197
|
const map = /* @__PURE__ */ new Map();
|
|
@@ -1236,36 +1242,33 @@ var makeRequestCacheKey = (requestParams) => {
|
|
|
1236
1242
|
};
|
|
1237
1243
|
|
|
1238
1244
|
// src/domain/components/ModalComponent.ts
|
|
1239
|
-
var createModalContentComponent = (
|
|
1245
|
+
var createModalContentComponent = (props, onComponentUpdate) => {
|
|
1240
1246
|
const update = getInputUpdateFunction(onComponentUpdate);
|
|
1241
|
-
const
|
|
1247
|
+
const component = __spreadProps(__spreadValues({
|
|
1242
1248
|
type: "modal",
|
|
1243
1249
|
kind: "layout",
|
|
1244
1250
|
open: true
|
|
1245
|
-
},
|
|
1246
|
-
_update(updateFn) {
|
|
1247
|
-
update(this, updateFn);
|
|
1248
|
-
},
|
|
1251
|
+
}, props), {
|
|
1249
1252
|
getChildren() {
|
|
1250
|
-
return
|
|
1253
|
+
return component.components;
|
|
1251
1254
|
},
|
|
1252
1255
|
close() {
|
|
1253
|
-
update(
|
|
1256
|
+
update(component, (draft) => {
|
|
1254
1257
|
draft.open = false;
|
|
1255
1258
|
});
|
|
1256
1259
|
}
|
|
1257
1260
|
});
|
|
1258
|
-
return
|
|
1261
|
+
return component;
|
|
1259
1262
|
};
|
|
1260
1263
|
|
|
1261
1264
|
// src/domain/components/utils/getRandomId.ts
|
|
1262
1265
|
var getRandomId = () => Math.random().toString(36).substring(2);
|
|
1263
1266
|
|
|
1264
1267
|
// src/domain/components/AlertComponent.ts
|
|
1265
|
-
var createAlertComponent = (
|
|
1268
|
+
var createAlertComponent = (props) => __spreadValues({
|
|
1266
1269
|
type: "alert",
|
|
1267
1270
|
kind: "layout"
|
|
1268
|
-
},
|
|
1271
|
+
}, props);
|
|
1269
1272
|
|
|
1270
1273
|
// src/domain/mappers/utils/behavior-utils.ts
|
|
1271
1274
|
var getDomainLayerBehavior = ({ action, behavior: specBehavior }, stepActions, registerSubmissionBehavior) => {
|
|
@@ -1279,29 +1282,31 @@ var getDomainLayerBehavior = ({ action, behavior: specBehavior }, stepActions, r
|
|
|
1279
1282
|
registerSubmissionBehavior == null ? void 0 : registerSubmissionBehavior(behavior);
|
|
1280
1283
|
return behavior;
|
|
1281
1284
|
}
|
|
1282
|
-
return { type: "none" };
|
|
1285
|
+
return { type: "none", track: false };
|
|
1283
1286
|
};
|
|
1284
1287
|
var normaliseBehavior = (behavior, stepActions) => {
|
|
1285
1288
|
if ("type" in behavior) {
|
|
1286
1289
|
if (behavior.type === "subflow") {
|
|
1287
1290
|
return __spreadProps(__spreadValues({}, behavior), {
|
|
1291
|
+
track: true,
|
|
1288
1292
|
onCompletion: behavior.onCompletion ? normaliseBehavior(behavior.onCompletion, stepActions) : void 0,
|
|
1289
1293
|
onError: behavior.onError ? normaliseBehavior(behavior.onError, stepActions) : void 0
|
|
1290
1294
|
});
|
|
1291
1295
|
}
|
|
1292
|
-
return behavior;
|
|
1296
|
+
return __spreadProps(__spreadValues({}, behavior), { track: true });
|
|
1293
1297
|
}
|
|
1294
1298
|
if ("action" in behavior && behavior.action) {
|
|
1295
1299
|
return actionToBehavior(behavior.action, stepActions);
|
|
1296
1300
|
}
|
|
1297
1301
|
if ("link" in behavior && behavior.link) {
|
|
1298
|
-
return { type: "link", url: behavior.link.url };
|
|
1302
|
+
return { type: "link", url: behavior.link.url, track: true };
|
|
1299
1303
|
}
|
|
1300
|
-
return { type: "none" };
|
|
1304
|
+
return { type: "none", track: false };
|
|
1301
1305
|
};
|
|
1302
1306
|
var actionToBehavior = (action, stepActions) => ({
|
|
1303
1307
|
type: "action",
|
|
1304
|
-
action: inlineAction(action, stepActions)
|
|
1308
|
+
action: inlineAction(action, stepActions),
|
|
1309
|
+
track: false
|
|
1305
1310
|
});
|
|
1306
1311
|
var inlineAction = (action, stepActions = []) => action.$ref ? __spreadValues(__spreadValues({}, getActionByReference(action.$ref, stepActions)), action) : action;
|
|
1307
1312
|
var getActionByReference = ($ref, actions = []) => {
|
|
@@ -1312,6 +1317,30 @@ var getActionByReference = ($ref, actions = []) => {
|
|
|
1312
1317
|
return action;
|
|
1313
1318
|
};
|
|
1314
1319
|
|
|
1320
|
+
// src/domain/mappers/utils/getHrefWithTracking.ts
|
|
1321
|
+
var getHrefWithTracking = ({
|
|
1322
|
+
behavior,
|
|
1323
|
+
onBehavior,
|
|
1324
|
+
trackEvent
|
|
1325
|
+
}) => {
|
|
1326
|
+
if (behavior.type === "link" && behavior.url) {
|
|
1327
|
+
return () => ({
|
|
1328
|
+
href: behavior.url,
|
|
1329
|
+
target: "_blank",
|
|
1330
|
+
onClick: () => {
|
|
1331
|
+
trackEvent("Behavior Triggered", __spreadProps(__spreadValues({}, behavior.analytics), {
|
|
1332
|
+
behaviorType: behavior.type
|
|
1333
|
+
}));
|
|
1334
|
+
}
|
|
1335
|
+
});
|
|
1336
|
+
}
|
|
1337
|
+
return () => ({
|
|
1338
|
+
onClick: () => {
|
|
1339
|
+
void onBehavior(behavior);
|
|
1340
|
+
}
|
|
1341
|
+
});
|
|
1342
|
+
};
|
|
1343
|
+
|
|
1315
1344
|
// src/domain/mappers/utils/legacy-utils.ts
|
|
1316
1345
|
var mapLegacyContext = (context) => {
|
|
1317
1346
|
switch (context) {
|
|
@@ -1369,15 +1398,17 @@ function getDomainLayerCallToAction(cta, mapperProps) {
|
|
|
1369
1398
|
if (!cta) {
|
|
1370
1399
|
return void 0;
|
|
1371
1400
|
}
|
|
1372
|
-
const { step, onBehavior, registerSubmissionBehavior } = mapperProps;
|
|
1401
|
+
const { step, onBehavior, trackEvent, registerSubmissionBehavior } = mapperProps;
|
|
1373
1402
|
const stepActions = (_a = step.actions) != null ? _a : [];
|
|
1374
1403
|
const behavior = getDomainLayerBehavior(cta, stepActions, registerSubmissionBehavior);
|
|
1404
|
+
const isLink = behavior.type === "link";
|
|
1375
1405
|
return {
|
|
1376
1406
|
type: behavior.type,
|
|
1377
1407
|
title: (_b = cta.title) != null ? _b : "",
|
|
1378
1408
|
context: cta.context ? mapLegacyContext(cta.context) : void 0,
|
|
1379
1409
|
accessibilityDescription: cta.accessibilityDescription,
|
|
1380
|
-
href:
|
|
1410
|
+
href: isLink ? behavior.url : void 0,
|
|
1411
|
+
hrefWithTracking: getHrefWithTracking({ behavior, onBehavior, trackEvent }),
|
|
1381
1412
|
onClick: () => {
|
|
1382
1413
|
void onBehavior(behavior);
|
|
1383
1414
|
}
|
|
@@ -1408,11 +1439,11 @@ var alertLayoutToComponent = (uid, {
|
|
|
1408
1439
|
};
|
|
1409
1440
|
|
|
1410
1441
|
// src/domain/components/BoxComponent.ts
|
|
1411
|
-
var createBoxComponent = (
|
|
1442
|
+
var createBoxComponent = (props) => __spreadProps(__spreadValues({}, props), {
|
|
1412
1443
|
type: "box",
|
|
1413
1444
|
kind: "layout",
|
|
1414
1445
|
getChildren() {
|
|
1415
|
-
return
|
|
1446
|
+
return props.components;
|
|
1416
1447
|
}
|
|
1417
1448
|
});
|
|
1418
1449
|
|
|
@@ -1439,10 +1470,10 @@ var boxLayoutToComponent = (uid, { border = false, components, control, margin,
|
|
|
1439
1470
|
});
|
|
1440
1471
|
|
|
1441
1472
|
// src/domain/components/ButtonComponent.ts
|
|
1442
|
-
var createButtonComponent = (
|
|
1473
|
+
var createButtonComponent = (props) => __spreadValues({
|
|
1443
1474
|
type: "button",
|
|
1444
1475
|
kind: "layout"
|
|
1445
|
-
},
|
|
1476
|
+
}, props);
|
|
1446
1477
|
|
|
1447
1478
|
// src/domain/mappers/utils/image.ts
|
|
1448
1479
|
var mapSpecImage = (image) => {
|
|
@@ -1526,7 +1557,7 @@ var buttonLayoutToComponentWithAction = (uid, button, mapperProps) => {
|
|
|
1526
1557
|
const { action } = button;
|
|
1527
1558
|
const inlinedAction = action ? inlineAction(action, step == null ? void 0 : step.actions) : {};
|
|
1528
1559
|
const onClick = () => {
|
|
1529
|
-
void onBehavior({ type: "action", action: inlinedAction });
|
|
1560
|
+
void onBehavior({ type: "action", action: inlinedAction, track: false });
|
|
1530
1561
|
};
|
|
1531
1562
|
return createButtonComponent({
|
|
1532
1563
|
uid,
|
|
@@ -1568,11 +1599,11 @@ var getButtonContext = ({ context, action }) => {
|
|
|
1568
1599
|
};
|
|
1569
1600
|
|
|
1570
1601
|
// src/domain/components/ColumnsComponent.ts
|
|
1571
|
-
var createColumnsComponent = (
|
|
1602
|
+
var createColumnsComponent = (props) => __spreadProps(__spreadValues({}, props), {
|
|
1572
1603
|
type: "columns",
|
|
1573
1604
|
kind: "layout",
|
|
1574
1605
|
getChildren() {
|
|
1575
|
-
return [...
|
|
1606
|
+
return [...props.startComponents, ...props.endComponents];
|
|
1576
1607
|
}
|
|
1577
1608
|
});
|
|
1578
1609
|
|
|
@@ -1598,10 +1629,10 @@ var columnsLayoutToComponent = (uid, { control, left, right, bias, margin, analy
|
|
|
1598
1629
|
});
|
|
1599
1630
|
|
|
1600
1631
|
// src/domain/components/DecisionComponent.ts
|
|
1601
|
-
var createDecisionComponent = (
|
|
1632
|
+
var createDecisionComponent = (props) => __spreadValues({
|
|
1602
1633
|
type: "decision",
|
|
1603
1634
|
kind: "layout"
|
|
1604
|
-
},
|
|
1635
|
+
}, props);
|
|
1605
1636
|
|
|
1606
1637
|
// src/domain/mappers/utils/tags-utils.ts
|
|
1607
1638
|
var mapTags = ({ tag, tags }) => tags != null ? tags : tag != null ? [tag] : void 0;
|
|
@@ -1614,12 +1645,18 @@ var mapInlineAlert = (alert) => {
|
|
|
1614
1645
|
} : void 0;
|
|
1615
1646
|
};
|
|
1616
1647
|
var mapAdditionalInfo = (info, mapperProps) => {
|
|
1617
|
-
const { onBehavior, registerSubmissionBehavior } = mapperProps;
|
|
1648
|
+
const { onBehavior, trackEvent, registerSubmissionBehavior } = mapperProps;
|
|
1618
1649
|
if (info) {
|
|
1619
1650
|
const behavior = getDomainLayerBehavior(info, [], registerSubmissionBehavior);
|
|
1651
|
+
const isLink = behavior.type === "link";
|
|
1620
1652
|
return {
|
|
1621
1653
|
text: info.text,
|
|
1622
|
-
href:
|
|
1654
|
+
href: isLink ? behavior.url : void 0,
|
|
1655
|
+
hrefWithTracking: getHrefWithTracking({
|
|
1656
|
+
behavior,
|
|
1657
|
+
onBehavior,
|
|
1658
|
+
trackEvent
|
|
1659
|
+
}),
|
|
1623
1660
|
accessibilityDescription: info.accessibilityDescription,
|
|
1624
1661
|
onClick: behavior.type === "none" ? void 0 : () => {
|
|
1625
1662
|
void onBehavior(behavior);
|
|
@@ -1654,14 +1691,16 @@ var decisionLayoutToComponent = (uid, {
|
|
|
1654
1691
|
});
|
|
1655
1692
|
var mapOption = (option, mapperProps) => {
|
|
1656
1693
|
var _a, _b;
|
|
1657
|
-
const { step, onBehavior, registerSubmissionBehavior } = mapperProps;
|
|
1694
|
+
const { step, onBehavior, trackEvent, registerSubmissionBehavior } = mapperProps;
|
|
1658
1695
|
const behavior = getDomainLayerBehavior(option, (_a = step.actions) != null ? _a : [], registerSubmissionBehavior);
|
|
1696
|
+
const isLink = behavior.type === "link";
|
|
1659
1697
|
return __spreadProps(__spreadValues({}, option), {
|
|
1660
1698
|
disabled: (_b = option.disabled) != null ? _b : false,
|
|
1661
|
-
href:
|
|
1699
|
+
href: isLink ? behavior.url : void 0,
|
|
1662
1700
|
media: getDomainLayerMedia(option),
|
|
1663
1701
|
inlineAlert: mapInlineAlert(option.inlineAlert),
|
|
1664
1702
|
tags: mapTags(option),
|
|
1703
|
+
hrefWithTracking: getHrefWithTracking({ behavior, onBehavior, trackEvent }),
|
|
1665
1704
|
onClick: () => {
|
|
1666
1705
|
void onBehavior(behavior);
|
|
1667
1706
|
}
|
|
@@ -1669,10 +1708,10 @@ var mapOption = (option, mapperProps) => {
|
|
|
1669
1708
|
};
|
|
1670
1709
|
|
|
1671
1710
|
// src/domain/components/StatusListComponent.ts
|
|
1672
|
-
var createStatusListComponent = (
|
|
1711
|
+
var createStatusListComponent = (props) => __spreadValues({
|
|
1673
1712
|
type: "status-list",
|
|
1674
1713
|
kind: "layout"
|
|
1675
|
-
},
|
|
1714
|
+
}, props);
|
|
1676
1715
|
|
|
1677
1716
|
// src/domain/mappers/layout/deprecatedListLayoutToComponent.ts
|
|
1678
1717
|
var isDeprecatedListLayout = (layout) => {
|
|
@@ -1715,11 +1754,11 @@ var createDividerComponent = (props) => __spreadValues({
|
|
|
1715
1754
|
var dividerLayoutToComponent = (uid, { control, margin, analyticsId, tags }) => createDividerComponent({ uid, analyticsId, control, margin: margin != null ? margin : "md", tags });
|
|
1716
1755
|
|
|
1717
1756
|
// src/domain/components/FormComponent.ts
|
|
1718
|
-
var createFormComponent = (
|
|
1757
|
+
var createFormComponent = (props) => __spreadProps(__spreadValues({}, props), {
|
|
1719
1758
|
type: "form",
|
|
1720
1759
|
kind: "layout",
|
|
1721
1760
|
getChildren() {
|
|
1722
|
-
return [
|
|
1761
|
+
return [props.schemaComponent];
|
|
1723
1762
|
}
|
|
1724
1763
|
});
|
|
1725
1764
|
|
|
@@ -1748,10 +1787,10 @@ var formLayoutToComponent = (uid, { analyticsId, schemaId, schema: schemaRef, co
|
|
|
1748
1787
|
};
|
|
1749
1788
|
|
|
1750
1789
|
// src/domain/components/HeadingComponent.ts
|
|
1751
|
-
var createHeadingComponent = (
|
|
1790
|
+
var createHeadingComponent = (props) => __spreadValues({
|
|
1752
1791
|
type: "heading",
|
|
1753
1792
|
kind: "layout"
|
|
1754
|
-
},
|
|
1793
|
+
}, props);
|
|
1755
1794
|
|
|
1756
1795
|
// src/domain/mappers/layout/headingLayoutToComponent.ts
|
|
1757
1796
|
var headingLayoutToComponent = (uid, { analyticsId, align, margin, size, control, tags, text }) => createHeadingComponent({
|
|
@@ -1766,10 +1805,10 @@ var headingLayoutToComponent = (uid, { analyticsId, align, margin, size, control
|
|
|
1766
1805
|
});
|
|
1767
1806
|
|
|
1768
1807
|
// src/domain/components/ImageComponent.ts
|
|
1769
|
-
var createImageComponent = (
|
|
1808
|
+
var createImageComponent = (props) => __spreadValues({
|
|
1770
1809
|
type: "image",
|
|
1771
1810
|
kind: "layout"
|
|
1772
|
-
},
|
|
1811
|
+
}, props);
|
|
1773
1812
|
|
|
1774
1813
|
// src/domain/mappers/layout/imageLayoutToComponent.ts
|
|
1775
1814
|
var imageLayoutToComponent = (uid, {
|
|
@@ -1801,10 +1840,10 @@ var imageLayoutToComponent = (uid, {
|
|
|
1801
1840
|
};
|
|
1802
1841
|
|
|
1803
1842
|
// src/domain/components/MarkdownComponent.ts
|
|
1804
|
-
var createMarkdownComponent = (
|
|
1843
|
+
var createMarkdownComponent = (props) => __spreadValues({
|
|
1805
1844
|
type: "markdown",
|
|
1806
1845
|
kind: "layout"
|
|
1807
|
-
},
|
|
1846
|
+
}, props);
|
|
1808
1847
|
|
|
1809
1848
|
// src/domain/mappers/layout/infoLayoutToComponent.ts
|
|
1810
1849
|
var infoLayoutToComponent = (uid, { analyticsId, align, control, margin, markdown: content, tags }) => createMarkdownComponent({
|
|
@@ -1819,10 +1858,10 @@ var infoLayoutToComponent = (uid, { analyticsId, align, control, margin, markdow
|
|
|
1819
1858
|
});
|
|
1820
1859
|
|
|
1821
1860
|
// src/domain/components/InstructionsComponent.ts
|
|
1822
|
-
var createInstructionsComponent = (
|
|
1861
|
+
var createInstructionsComponent = (props) => __spreadValues({
|
|
1823
1862
|
type: "instructions",
|
|
1824
1863
|
kind: "layout"
|
|
1825
|
-
},
|
|
1864
|
+
}, props);
|
|
1826
1865
|
|
|
1827
1866
|
// src/domain/mappers/layout/instructionsLayoutToComponent.ts
|
|
1828
1867
|
var instructionsLayoutToComponent = (uid, { analyticsId, control, items, margin, tags, title }) => createInstructionsComponent({
|
|
@@ -1839,10 +1878,10 @@ var instructionsLayoutToComponent = (uid, { analyticsId, control, items, margin,
|
|
|
1839
1878
|
});
|
|
1840
1879
|
|
|
1841
1880
|
// src/domain/components/ListComponent.ts
|
|
1842
|
-
var createListComponent = (
|
|
1881
|
+
var createListComponent = (props) => __spreadValues({
|
|
1843
1882
|
type: "list",
|
|
1844
1883
|
kind: "layout"
|
|
1845
|
-
},
|
|
1884
|
+
}, props);
|
|
1846
1885
|
|
|
1847
1886
|
// src/domain/mappers/layout/listLayoutToComponent.ts
|
|
1848
1887
|
var listLayoutToComponent = (uid, { analyticsId, callToAction, control, items, margin, tags, title }, mapperProps) => {
|
|
@@ -1900,10 +1939,10 @@ var mapSupportingValues = (item) => {
|
|
|
1900
1939
|
};
|
|
1901
1940
|
|
|
1902
1941
|
// src/domain/components/LoadingIndicatorComponent.ts
|
|
1903
|
-
var createLoadingIndicatorComponent = (
|
|
1942
|
+
var createLoadingIndicatorComponent = (props) => __spreadValues({
|
|
1904
1943
|
type: "loading-indicator",
|
|
1905
1944
|
kind: "layout"
|
|
1906
|
-
},
|
|
1945
|
+
}, props);
|
|
1907
1946
|
|
|
1908
1947
|
// src/domain/mappers/layout/loadingIndicatorLayoutToComponent.ts
|
|
1909
1948
|
var loadingIndicatorLayoutToComponent = (uid, { analyticsId, control, margin, size, tags }) => createLoadingIndicatorComponent({
|
|
@@ -1954,12 +1993,12 @@ var mediaLayoutToComponent = (uid, { analyticsId, align, control, margin, media,
|
|
|
1954
1993
|
});
|
|
1955
1994
|
|
|
1956
1995
|
// src/domain/components/ModalLayoutComponent.ts
|
|
1957
|
-
var createModalComponent = (
|
|
1996
|
+
var createModalComponent = (props) => __spreadProps(__spreadValues({
|
|
1958
1997
|
type: "modal-layout",
|
|
1959
1998
|
kind: "layout"
|
|
1960
|
-
},
|
|
1999
|
+
}, props), {
|
|
1961
2000
|
getChildren() {
|
|
1962
|
-
return
|
|
2001
|
+
return props.content.components;
|
|
1963
2002
|
}
|
|
1964
2003
|
});
|
|
1965
2004
|
|
|
@@ -1983,10 +2022,10 @@ var modalLayoutToComponent = (uid, { analyticsId, content, control, margin, tags
|
|
|
1983
2022
|
};
|
|
1984
2023
|
|
|
1985
2024
|
// src/domain/components/ParagraphComponent.ts
|
|
1986
|
-
var createParagraphComponent = (
|
|
2025
|
+
var createParagraphComponent = (props) => __spreadValues({
|
|
1987
2026
|
type: "paragraph",
|
|
1988
2027
|
kind: "layout"
|
|
1989
|
-
},
|
|
2028
|
+
}, props);
|
|
1990
2029
|
|
|
1991
2030
|
// src/domain/mappers/layout/paragraphLayoutToComponent.ts
|
|
1992
2031
|
var paragraphLayoutToComponent = (uid, { analyticsId, align, control, margin, size, tags, text }) => createParagraphComponent({
|
|
@@ -2001,10 +2040,10 @@ var paragraphLayoutToComponent = (uid, { analyticsId, align, control, margin, si
|
|
|
2001
2040
|
});
|
|
2002
2041
|
|
|
2003
2042
|
// src/domain/components/ProgressComponent.ts
|
|
2004
|
-
var createProgressComponent = (
|
|
2043
|
+
var createProgressComponent = (props) => __spreadValues({
|
|
2005
2044
|
type: "progress",
|
|
2006
2045
|
kind: "layout"
|
|
2007
|
-
},
|
|
2046
|
+
}, props);
|
|
2008
2047
|
|
|
2009
2048
|
// src/domain/mappers/layout/progressLayoutToComponent.ts
|
|
2010
2049
|
var progressLayoutToComponent = (uid, {
|
|
@@ -2033,10 +2072,10 @@ var progressLayoutToComponent = (uid, {
|
|
|
2033
2072
|
});
|
|
2034
2073
|
|
|
2035
2074
|
// src/domain/components/ReviewComponent.ts
|
|
2036
|
-
var createReviewComponent = (
|
|
2075
|
+
var createReviewComponent = (props) => __spreadValues({
|
|
2037
2076
|
type: "review",
|
|
2038
2077
|
kind: "layout"
|
|
2039
|
-
},
|
|
2078
|
+
}, props);
|
|
2040
2079
|
|
|
2041
2080
|
// src/domain/mappers/layout/reviewLayoutToComponent.ts
|
|
2042
2081
|
var reviewLayoutToComponent = (uid, {
|
|
@@ -2068,12 +2107,15 @@ var getCallToAction = ({
|
|
|
2068
2107
|
return getDomainLayerCallToAction(callToAction, mapperProps);
|
|
2069
2108
|
}
|
|
2070
2109
|
if (action == null ? void 0 : action.title) {
|
|
2110
|
+
const behavior = { type: "action", action, track: true };
|
|
2111
|
+
const { onBehavior, trackEvent } = mapperProps;
|
|
2071
2112
|
return {
|
|
2072
2113
|
type: "action",
|
|
2073
2114
|
title: action.title,
|
|
2074
2115
|
onClick: () => {
|
|
2075
|
-
void
|
|
2076
|
-
}
|
|
2116
|
+
void onBehavior(behavior);
|
|
2117
|
+
},
|
|
2118
|
+
hrefWithTracking: getHrefWithTracking({ behavior, onBehavior, trackEvent })
|
|
2077
2119
|
};
|
|
2078
2120
|
}
|
|
2079
2121
|
return void 0;
|
|
@@ -2143,8 +2185,8 @@ var debounce = (callback, waitMs) => {
|
|
|
2143
2185
|
|
|
2144
2186
|
// src/domain/components/searchComponent/SearchComponent.ts
|
|
2145
2187
|
var DEBOUNCE_TIME = 400;
|
|
2146
|
-
var createSearchComponent = (
|
|
2147
|
-
const { uid, analyticsId, control, emptyMessage, initialState, hint, margin, tags, title } =
|
|
2188
|
+
var createSearchComponent = (props, performSearch, onBehavior, onComponentUpdate) => {
|
|
2189
|
+
const { uid, analyticsId, control, emptyMessage, initialState, hint, margin, tags, title } = props;
|
|
2148
2190
|
const update = getInputUpdateFunction(onComponentUpdate);
|
|
2149
2191
|
let abortController = new AbortController();
|
|
2150
2192
|
const search = (component2, query, searchConfig) => {
|
|
@@ -2188,16 +2230,13 @@ var createSearchComponent = (searchProps, performSearch, onBehavior, onComponent
|
|
|
2188
2230
|
title,
|
|
2189
2231
|
isLoading: false,
|
|
2190
2232
|
query: "",
|
|
2191
|
-
|
|
2192
|
-
update(this, updateFn);
|
|
2193
|
-
},
|
|
2194
|
-
onChange(query) {
|
|
2233
|
+
setQuery(query) {
|
|
2195
2234
|
if (query.trim()) {
|
|
2196
|
-
|
|
2235
|
+
update(component, (draft) => {
|
|
2197
2236
|
draft.query = query;
|
|
2198
2237
|
draft.isLoading = true;
|
|
2199
2238
|
});
|
|
2200
|
-
debouncedSearch(
|
|
2239
|
+
debouncedSearch(component, query.trim());
|
|
2201
2240
|
} else {
|
|
2202
2241
|
abortController.abort();
|
|
2203
2242
|
debouncedSearch.cancel();
|
|
@@ -2209,15 +2248,15 @@ var createSearchComponent = (searchProps, performSearch, onBehavior, onComponent
|
|
|
2209
2248
|
});
|
|
2210
2249
|
}
|
|
2211
2250
|
},
|
|
2212
|
-
|
|
2251
|
+
selectResult({ type, value }) {
|
|
2213
2252
|
if (type === "action") {
|
|
2214
|
-
void onBehavior({ type: "action", action: value });
|
|
2253
|
+
void onBehavior({ type: "action", action: value, track: false });
|
|
2215
2254
|
} else {
|
|
2216
|
-
|
|
2255
|
+
update(component, (draft) => {
|
|
2217
2256
|
draft.query = value.query;
|
|
2218
2257
|
draft.isLoading = true;
|
|
2219
2258
|
});
|
|
2220
|
-
search(
|
|
2259
|
+
search(component, value.query, {
|
|
2221
2260
|
method: value.method,
|
|
2222
2261
|
param: value.param,
|
|
2223
2262
|
url: value.url
|
|
@@ -2368,15 +2407,13 @@ var emptyInitialState = {
|
|
|
2368
2407
|
};
|
|
2369
2408
|
|
|
2370
2409
|
// src/domain/components/SectionComponent.ts
|
|
2371
|
-
var createSectionComponent = (props) => {
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
});
|
|
2379
|
-
};
|
|
2410
|
+
var createSectionComponent = (props) => __spreadProps(__spreadValues({}, props), {
|
|
2411
|
+
type: "section",
|
|
2412
|
+
kind: "layout",
|
|
2413
|
+
getChildren() {
|
|
2414
|
+
return props.components;
|
|
2415
|
+
}
|
|
2416
|
+
});
|
|
2380
2417
|
|
|
2381
2418
|
// src/domain/mappers/layout/sectionLayoutToComponent.ts
|
|
2382
2419
|
var sectionLayoutToComponent = (uid, { analyticsId, control, title, components, callToAction, margin, tags }, mapperProps, schemaComponents) => {
|
|
@@ -2409,7 +2446,7 @@ var statusListLayoutToComponent = (uid, { analyticsId, control, items, margin, t
|
|
|
2409
2446
|
});
|
|
2410
2447
|
|
|
2411
2448
|
// src/domain/components/TabsComponent.ts
|
|
2412
|
-
var createTabsComponent = (
|
|
2449
|
+
var createTabsComponent = (props) => __spreadProps(__spreadValues({}, props), {
|
|
2413
2450
|
type: "tabs",
|
|
2414
2451
|
kind: "layout"
|
|
2415
2452
|
});
|
|
@@ -2437,19 +2474,19 @@ var mapTabs = (tabs, uid, mapperProps, schemaComponents) => tabs.map(({ componen
|
|
|
2437
2474
|
}));
|
|
2438
2475
|
|
|
2439
2476
|
// src/domain/components/UpsellComponent.ts
|
|
2440
|
-
var createUpsellComponent = (
|
|
2477
|
+
var createUpsellComponent = (props, onComponentUpdate) => {
|
|
2441
2478
|
const update = getInputUpdateFunction(onComponentUpdate);
|
|
2442
|
-
const _a =
|
|
2479
|
+
const _a = props, { dismiss } = _a, restProps = __objRest(_a, ["dismiss"]);
|
|
2443
2480
|
const component = __spreadProps(__spreadValues({
|
|
2444
2481
|
type: "upsell",
|
|
2445
2482
|
kind: "layout"
|
|
2446
2483
|
}, restProps), {
|
|
2447
2484
|
visible: true,
|
|
2448
|
-
|
|
2485
|
+
dismiss: dismiss ? () => {
|
|
2449
2486
|
update(component, (draft) => {
|
|
2450
2487
|
draft.visible = false;
|
|
2451
2488
|
});
|
|
2452
|
-
|
|
2489
|
+
dismiss();
|
|
2453
2490
|
} : void 0
|
|
2454
2491
|
});
|
|
2455
2492
|
return component;
|
|
@@ -2468,7 +2505,7 @@ var upsellLayoutToComponent = (uid, { analyticsId, callToAction, control, margin
|
|
|
2468
2505
|
media: getDomainLayerMedia({ media }),
|
|
2469
2506
|
tags,
|
|
2470
2507
|
text,
|
|
2471
|
-
|
|
2508
|
+
dismiss: onDismiss ? () => {
|
|
2472
2509
|
const { url, method } = onDismiss;
|
|
2473
2510
|
const body = method === "GET" ? void 0 : JSON.stringify(onDismiss.body);
|
|
2474
2511
|
void mapperProps.httpClient(url, { method, body }).catch(() => {
|
|
@@ -2550,26 +2587,27 @@ var modalToComponent = (uid, { content, title }, mapperProps, schemaComponents)
|
|
|
2550
2587
|
// src/domain/components/step/ExternalConfirmationComponent.ts
|
|
2551
2588
|
var createExternalConfirmation = (uid, url, onLink, onComponentUpdate) => {
|
|
2552
2589
|
const update = getInputUpdateFunction(onComponentUpdate);
|
|
2553
|
-
|
|
2590
|
+
const component = {
|
|
2554
2591
|
type: "external-confirmation",
|
|
2555
2592
|
kind: "layout",
|
|
2556
2593
|
uid,
|
|
2557
2594
|
url,
|
|
2558
2595
|
status: "initial",
|
|
2559
2596
|
open() {
|
|
2560
|
-
if (
|
|
2561
|
-
const success = onLink(
|
|
2562
|
-
update(
|
|
2597
|
+
if (component.status === "initial" || component.status === "failure") {
|
|
2598
|
+
const success = onLink(component.url);
|
|
2599
|
+
update(component, (draft) => {
|
|
2563
2600
|
draft.status = success ? "success" : "failure";
|
|
2564
2601
|
});
|
|
2565
2602
|
}
|
|
2566
2603
|
},
|
|
2567
2604
|
onCancel() {
|
|
2568
|
-
update(
|
|
2605
|
+
update(component, (draft) => {
|
|
2569
2606
|
draft.status = "dismissed";
|
|
2570
2607
|
});
|
|
2571
2608
|
}
|
|
2572
2609
|
};
|
|
2610
|
+
return component;
|
|
2573
2611
|
};
|
|
2574
2612
|
|
|
2575
2613
|
// src/utils/recursiveMerge.ts
|
|
@@ -2619,8 +2657,26 @@ var getSubmittableDataSync = (components) => components.map((component) => compo
|
|
|
2619
2657
|
var getLocalValues = (components) => components.map((component) => component.getLocalValue()).reduce((acc, value) => recursiveMerge(acc, value), null);
|
|
2620
2658
|
|
|
2621
2659
|
// src/domain/components/step/StepDomainComponent.ts
|
|
2622
|
-
var createStepComponent = (
|
|
2623
|
-
const _a =
|
|
2660
|
+
var createStepComponent = (props) => {
|
|
2661
|
+
const _a = props, {
|
|
2662
|
+
uid,
|
|
2663
|
+
stepPolling,
|
|
2664
|
+
stepRefreshAfter,
|
|
2665
|
+
stepPrefetch,
|
|
2666
|
+
features,
|
|
2667
|
+
logEvent,
|
|
2668
|
+
onComponentUpdate,
|
|
2669
|
+
onLoad
|
|
2670
|
+
} = _a, rest = __objRest(_a, [
|
|
2671
|
+
"uid",
|
|
2672
|
+
"stepPolling",
|
|
2673
|
+
"stepRefreshAfter",
|
|
2674
|
+
"stepPrefetch",
|
|
2675
|
+
"features",
|
|
2676
|
+
"logEvent",
|
|
2677
|
+
"onComponentUpdate",
|
|
2678
|
+
"onLoad"
|
|
2679
|
+
]);
|
|
2624
2680
|
const update = getInputUpdateFunction(onComponentUpdate);
|
|
2625
2681
|
const component = __spreadProps(__spreadValues({
|
|
2626
2682
|
uid
|
|
@@ -2633,78 +2689,73 @@ var createStepComponent = (stepProps) => {
|
|
|
2633
2689
|
subflow: null,
|
|
2634
2690
|
dismissModal() {
|
|
2635
2691
|
var _a2;
|
|
2636
|
-
(_a2 =
|
|
2692
|
+
(_a2 = component.modals.at(-1)) == null ? void 0 : _a2.close();
|
|
2637
2693
|
},
|
|
2638
2694
|
dismissAllModals() {
|
|
2639
|
-
|
|
2695
|
+
update(component, (draft) => {
|
|
2640
2696
|
draft.modals = draft.modals.map((m) => __spreadProps(__spreadValues({}, m), { open: false }));
|
|
2641
2697
|
});
|
|
2642
2698
|
},
|
|
2643
2699
|
showModal(modal) {
|
|
2644
|
-
|
|
2700
|
+
update(component, (draft) => {
|
|
2645
2701
|
draft.modals = [...draft.modals, modal];
|
|
2646
2702
|
});
|
|
2647
2703
|
},
|
|
2648
|
-
_update(updateFn) {
|
|
2649
|
-
update(this, updateFn);
|
|
2650
|
-
},
|
|
2651
2704
|
getChildren() {
|
|
2652
|
-
return
|
|
2705
|
+
return component.externalConfirmation ? [...component.layoutComponents, component.externalConfirmation] : component.layoutComponents;
|
|
2653
2706
|
},
|
|
2654
2707
|
getModals() {
|
|
2655
|
-
return
|
|
2708
|
+
return component.modals;
|
|
2656
2709
|
},
|
|
2657
2710
|
async getSubmittableValue() {
|
|
2658
|
-
return getSubmittableData(
|
|
2711
|
+
return getSubmittableData(component.schemaComponents);
|
|
2659
2712
|
},
|
|
2660
2713
|
getSubmittableValueSync() {
|
|
2661
|
-
return getSubmittableDataSync(
|
|
2714
|
+
return getSubmittableDataSync(component.schemaComponents);
|
|
2662
2715
|
},
|
|
2663
2716
|
getLocalValue() {
|
|
2664
|
-
return getLocalValues(
|
|
2717
|
+
return getLocalValues(component.schemaComponents);
|
|
2665
2718
|
},
|
|
2666
2719
|
validate() {
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
}
|
|
2672
|
-
);
|
|
2720
|
+
const isStrict = features.isEnabled("validateUnreferencedSchemas");
|
|
2721
|
+
return component.schemaComponents.map(
|
|
2722
|
+
(inputComponent) => validateInputComponent(component, inputComponent, isStrict, logEvent)
|
|
2723
|
+
).every(Boolean);
|
|
2673
2724
|
},
|
|
2674
2725
|
setLoadingState(loadingState) {
|
|
2675
|
-
|
|
2726
|
+
update(component, (draft) => {
|
|
2676
2727
|
draft.loadingState = loadingState;
|
|
2677
2728
|
});
|
|
2678
2729
|
},
|
|
2679
2730
|
addSubflow(subflow) {
|
|
2680
|
-
|
|
2731
|
+
update(component, (draft) => {
|
|
2681
2732
|
draft.subflow = subflow;
|
|
2682
2733
|
});
|
|
2683
2734
|
},
|
|
2684
2735
|
closeSubflow() {
|
|
2685
|
-
if (!
|
|
2736
|
+
if (!component.subflow) {
|
|
2686
2737
|
return;
|
|
2687
2738
|
}
|
|
2688
|
-
|
|
2739
|
+
update(component, (draft) => {
|
|
2689
2740
|
draft.subflow = null;
|
|
2690
2741
|
});
|
|
2691
2742
|
},
|
|
2692
2743
|
start() {
|
|
2693
|
-
if (
|
|
2744
|
+
if (component.state === "initial") {
|
|
2694
2745
|
onLoad == null ? void 0 : onLoad();
|
|
2695
2746
|
}
|
|
2696
|
-
|
|
2747
|
+
update(component, (draft) => {
|
|
2697
2748
|
draft.state = "started";
|
|
2698
2749
|
});
|
|
2699
2750
|
stepPolling == null ? void 0 : stepPolling.start();
|
|
2700
2751
|
stepRefreshAfter == null ? void 0 : stepRefreshAfter.start();
|
|
2701
|
-
stepPrefetch.start(
|
|
2752
|
+
stepPrefetch.start(component.getSubmittableValueSync());
|
|
2702
2753
|
},
|
|
2703
2754
|
stop() {
|
|
2704
2755
|
stepPolling == null ? void 0 : stepPolling.stop();
|
|
2705
2756
|
stepRefreshAfter == null ? void 0 : stepRefreshAfter.stop();
|
|
2706
2757
|
stepPrefetch.stop();
|
|
2707
|
-
|
|
2758
|
+
update(component, (draft) => {
|
|
2708
2759
|
draft.state = "stopped";
|
|
2709
2760
|
draft.modals = [];
|
|
2710
2761
|
});
|
|
@@ -2712,6 +2763,22 @@ var createStepComponent = (stepProps) => {
|
|
|
2712
2763
|
});
|
|
2713
2764
|
return component;
|
|
2714
2765
|
};
|
|
2766
|
+
var validateInputComponent = (component, inputComponent, isStrict, logEvent) => {
|
|
2767
|
+
var _a;
|
|
2768
|
+
const isSchemaReferenced = component.referencedSchemaIds.includes((_a = inputComponent.schemaId) != null ? _a : "");
|
|
2769
|
+
const isValid = inputComponent.validate();
|
|
2770
|
+
if (!isSchemaReferenced && !isValid) {
|
|
2771
|
+
logEvent(
|
|
2772
|
+
isStrict ? "error" : "warning",
|
|
2773
|
+
isStrict ? "Unreferenced schema does not pass validation. This blocks submission. You must fix your step." : "Unreferenced schema does not pass validation. This blocks submission on iOS and Android, and soon it will on web. You should fix your step.",
|
|
2774
|
+
{
|
|
2775
|
+
unreferencedSchemaId: inputComponent.schemaId,
|
|
2776
|
+
componentUid: component.uid
|
|
2777
|
+
}
|
|
2778
|
+
);
|
|
2779
|
+
}
|
|
2780
|
+
return isSchemaReferenced || isStrict ? isValid : true;
|
|
2781
|
+
};
|
|
2715
2782
|
|
|
2716
2783
|
// src/domain/features/polling/getStepPolling.ts
|
|
2717
2784
|
var getStepPolling = ({
|
|
@@ -2950,7 +3017,8 @@ var executeRequest = async (props) => {
|
|
|
2950
3017
|
type: "behavior",
|
|
2951
3018
|
behavior: {
|
|
2952
3019
|
type: "action",
|
|
2953
|
-
action: responseBody.action
|
|
3020
|
+
action: responseBody.action,
|
|
3021
|
+
track: false
|
|
2954
3022
|
}
|
|
2955
3023
|
};
|
|
2956
3024
|
}
|
|
@@ -2961,7 +3029,8 @@ var executeRequest = async (props) => {
|
|
|
2961
3029
|
behavior: __spreadProps(__spreadValues({}, responseBody), {
|
|
2962
3030
|
type: "subflow",
|
|
2963
3031
|
onCompletion: responseBody.onCompletion ? normaliseBehavior(responseBody.onCompletion, []) : void 0,
|
|
2964
|
-
onError: responseBody.onError ? normaliseBehavior(responseBody.onError, []) : void 0
|
|
3032
|
+
onError: responseBody.onError ? normaliseBehavior(responseBody.onError, []) : void 0,
|
|
3033
|
+
track: false
|
|
2965
3034
|
})
|
|
2966
3035
|
} : {
|
|
2967
3036
|
type: "error",
|
|
@@ -2970,7 +3039,7 @@ var executeRequest = async (props) => {
|
|
|
2970
3039
|
}
|
|
2971
3040
|
case "modal": {
|
|
2972
3041
|
assertModalResponseBody(responseBody);
|
|
2973
|
-
return !isInitial ? { type: "behavior", behavior: __spreadProps(__spreadValues({}, responseBody), { type: "modal" }) } : {
|
|
3042
|
+
return !isInitial ? { type: "behavior", behavior: __spreadProps(__spreadValues({}, responseBody), { type: "modal", track: false }) } : {
|
|
2974
3043
|
type: "error",
|
|
2975
3044
|
body: { errors: { error: "Cannot show modal without a current step" } }
|
|
2976
3045
|
};
|
|
@@ -3132,7 +3201,7 @@ var getStepRefreshAfter = ({
|
|
|
3132
3201
|
const start = () => {
|
|
3133
3202
|
const timeLeft = Math.max(targetTime - Date.now(), ONE_SECOND);
|
|
3134
3203
|
timeout = setTimeout(() => {
|
|
3135
|
-
void onBehavior({ type: "refresh", analytics: { schema: "refreshAfter" } });
|
|
3204
|
+
void onBehavior({ type: "refresh", analytics: { schema: "refreshAfter" }, track: false });
|
|
3136
3205
|
}, timeLeft);
|
|
3137
3206
|
};
|
|
3138
3207
|
return {
|
|
@@ -3285,8 +3354,8 @@ var getComponentValidationAsync = (update, performValidationAsync) => (
|
|
|
3285
3354
|
var getDebouncedComponentValidationAsync = (update, performValidationAsync) => debounce(getComponentValidationAsync(update, performValidationAsync), 1e3);
|
|
3286
3355
|
|
|
3287
3356
|
// src/domain/components/NumberInputComponent.ts
|
|
3288
|
-
var createNumberInputComponent = (
|
|
3289
|
-
const _a =
|
|
3357
|
+
var createNumberInputComponent = (props, onComponentUpdate) => {
|
|
3358
|
+
const _a = props, {
|
|
3290
3359
|
uid,
|
|
3291
3360
|
id,
|
|
3292
3361
|
checks,
|
|
@@ -3309,16 +3378,13 @@ var createNumberInputComponent = (numberInputProps, onComponentUpdate) => {
|
|
|
3309
3378
|
const getValidationErrors = getLocalValueValidator(checks);
|
|
3310
3379
|
const performOnChange = getDebouncedSchemaOnChange(schemaOnChange, getValidationErrors);
|
|
3311
3380
|
const validateAsync = performValidationAsync ? getDebouncedComponentValidationAsync(update, performValidationAsync) : void 0;
|
|
3312
|
-
const
|
|
3381
|
+
const component = __spreadValues({
|
|
3313
3382
|
type: "number",
|
|
3314
3383
|
kind: "input",
|
|
3315
3384
|
uid,
|
|
3316
3385
|
id,
|
|
3317
|
-
_update(updateFn) {
|
|
3318
|
-
update(this, updateFn);
|
|
3319
|
-
},
|
|
3320
3386
|
onBlur() {
|
|
3321
|
-
const isValid =
|
|
3387
|
+
const isValid = component.validate();
|
|
3322
3388
|
performOnChange == null ? void 0 : performOnChange.flush();
|
|
3323
3389
|
if (isValid) {
|
|
3324
3390
|
void (onPersistAsync == null ? void 0 : onPersistAsync().catch(() => {
|
|
@@ -3329,9 +3395,9 @@ var createNumberInputComponent = (numberInputProps, onComponentUpdate) => {
|
|
|
3329
3395
|
onFocus() {
|
|
3330
3396
|
},
|
|
3331
3397
|
// Noop
|
|
3332
|
-
|
|
3333
|
-
const prevValue =
|
|
3334
|
-
|
|
3398
|
+
setValue(updatedValue) {
|
|
3399
|
+
const prevValue = component.value;
|
|
3400
|
+
update(component, (draft) => {
|
|
3335
3401
|
draft.errors = [];
|
|
3336
3402
|
draft.validationAsyncState.messages = {};
|
|
3337
3403
|
draft.value = updatedValue;
|
|
@@ -3339,32 +3405,32 @@ var createNumberInputComponent = (numberInputProps, onComponentUpdate) => {
|
|
|
3339
3405
|
performOnChange == null ? void 0 : performOnChange(prevValue, updatedValue);
|
|
3340
3406
|
const isValid = getValidationErrors(updatedValue).length === 0;
|
|
3341
3407
|
if (isValid) {
|
|
3342
|
-
validateAsync == null ? void 0 : validateAsync(
|
|
3408
|
+
validateAsync == null ? void 0 : validateAsync(component, updatedValue);
|
|
3343
3409
|
}
|
|
3344
3410
|
onValueChange();
|
|
3345
3411
|
},
|
|
3346
3412
|
async getSubmittableValue() {
|
|
3347
|
-
return
|
|
3413
|
+
return component.getSubmittableValueSync();
|
|
3348
3414
|
},
|
|
3349
3415
|
getSubmittableValueSync() {
|
|
3350
3416
|
var _a2;
|
|
3351
|
-
return (_a2 =
|
|
3417
|
+
return (_a2 = component.getLocalValue()) != null ? _a2 : null;
|
|
3352
3418
|
},
|
|
3353
3419
|
getSummary() {
|
|
3354
|
-
return summariser(
|
|
3420
|
+
return summariser(component.getLocalValue());
|
|
3355
3421
|
},
|
|
3356
3422
|
getLocalValue() {
|
|
3357
|
-
return
|
|
3423
|
+
return component.value;
|
|
3358
3424
|
},
|
|
3359
3425
|
validate() {
|
|
3360
|
-
const errors = getValidationErrors(
|
|
3361
|
-
|
|
3426
|
+
const errors = getValidationErrors(component.getLocalValue());
|
|
3427
|
+
update(component, (draft) => {
|
|
3362
3428
|
draft.errors = errors;
|
|
3363
3429
|
});
|
|
3364
3430
|
return errors.length === 0;
|
|
3365
3431
|
}
|
|
3366
3432
|
}, rest);
|
|
3367
|
-
return
|
|
3433
|
+
return component;
|
|
3368
3434
|
};
|
|
3369
3435
|
|
|
3370
3436
|
// src/domain/features/schema-on-change/getSchemaOnChange.ts
|
|
@@ -3396,7 +3462,8 @@ var getBehaviorFromSchemaRefreshStepOnChange = (schema) => {
|
|
|
3396
3462
|
const behavior = {
|
|
3397
3463
|
type: "refresh",
|
|
3398
3464
|
analytics: { schema: (_c = analyticsId != null ? analyticsId : $id) != null ? _c : "" },
|
|
3399
|
-
url: refreshUrl != null ? refreshUrl : refreshFormUrl
|
|
3465
|
+
url: refreshUrl != null ? refreshUrl : refreshFormUrl,
|
|
3466
|
+
track: false
|
|
3400
3467
|
};
|
|
3401
3468
|
return behavior;
|
|
3402
3469
|
}
|
|
@@ -3852,7 +3919,7 @@ var isStringSchemaWithUpload = (schema) => isStringSchema(schema) && schema.form
|
|
|
3852
3919
|
var isSchemaWithPersistAsync = (schema) => "persistAsync" in schema && !isNullish(schema.persistAsync);
|
|
3853
3920
|
|
|
3854
3921
|
// src/domain/components/AllOfComponent.ts
|
|
3855
|
-
var createAllOfComponent = (
|
|
3922
|
+
var createAllOfComponent = (props) => {
|
|
3856
3923
|
const {
|
|
3857
3924
|
uid,
|
|
3858
3925
|
schemaId,
|
|
@@ -3866,8 +3933,8 @@ var createAllOfComponent = (allOfProps) => {
|
|
|
3866
3933
|
media,
|
|
3867
3934
|
title,
|
|
3868
3935
|
tags
|
|
3869
|
-
} =
|
|
3870
|
-
|
|
3936
|
+
} = props;
|
|
3937
|
+
const component = {
|
|
3871
3938
|
type: "all-of",
|
|
3872
3939
|
kind: "input",
|
|
3873
3940
|
uid,
|
|
@@ -3883,24 +3950,25 @@ var createAllOfComponent = (allOfProps) => {
|
|
|
3883
3950
|
title,
|
|
3884
3951
|
tags,
|
|
3885
3952
|
getChildren() {
|
|
3886
|
-
return
|
|
3953
|
+
return component.components;
|
|
3887
3954
|
},
|
|
3888
3955
|
getSummary() {
|
|
3889
|
-
return summariseFromChildren(
|
|
3956
|
+
return summariseFromChildren(component.getChildren());
|
|
3890
3957
|
},
|
|
3891
3958
|
async getSubmittableValue() {
|
|
3892
|
-
return getSubmittableData(
|
|
3959
|
+
return getSubmittableData(component.components);
|
|
3893
3960
|
},
|
|
3894
3961
|
getSubmittableValueSync() {
|
|
3895
|
-
return getSubmittableDataSync(
|
|
3962
|
+
return getSubmittableDataSync(component.components);
|
|
3896
3963
|
},
|
|
3897
3964
|
getLocalValue() {
|
|
3898
|
-
return getLocalValues(
|
|
3965
|
+
return getLocalValues(component.components);
|
|
3899
3966
|
},
|
|
3900
3967
|
validate() {
|
|
3901
|
-
return hidden ? true : validateComponents(
|
|
3968
|
+
return hidden ? true : validateComponents(component.getChildren());
|
|
3902
3969
|
}
|
|
3903
3970
|
};
|
|
3971
|
+
return component;
|
|
3904
3972
|
};
|
|
3905
3973
|
|
|
3906
3974
|
// src/domain/mappers/schema/allOfSchemaToComponent.ts
|
|
@@ -3926,8 +3994,8 @@ var allOfSchemaToComponent = (schemaMapperProps, mapperProps) => {
|
|
|
3926
3994
|
};
|
|
3927
3995
|
|
|
3928
3996
|
// src/domain/components/RepeatableComponent.ts
|
|
3929
|
-
var createRepeatableComponent = (
|
|
3930
|
-
const _a =
|
|
3997
|
+
var createRepeatableComponent = (props, onComponentUpdate) => {
|
|
3998
|
+
const _a = props, {
|
|
3931
3999
|
uid,
|
|
3932
4000
|
schemaId,
|
|
3933
4001
|
analyticsId,
|
|
@@ -3950,7 +4018,7 @@ var createRepeatableComponent = (repeatableProps, onComponentUpdate) => {
|
|
|
3950
4018
|
]);
|
|
3951
4019
|
const update = getInputUpdateFunction(onComponentUpdate);
|
|
3952
4020
|
const getValidationErrors = getLocalValueValidator(checks);
|
|
3953
|
-
const
|
|
4021
|
+
const component = __spreadProps(__spreadValues({
|
|
3954
4022
|
uid,
|
|
3955
4023
|
schemaId,
|
|
3956
4024
|
analyticsId,
|
|
@@ -3965,37 +4033,34 @@ var createRepeatableComponent = (repeatableProps, onComponentUpdate) => {
|
|
|
3965
4033
|
media: summary == null ? void 0 : summary.defaultMedia
|
|
3966
4034
|
}
|
|
3967
4035
|
}, componentProps), {
|
|
3968
|
-
|
|
3969
|
-
update(
|
|
3970
|
-
},
|
|
3971
|
-
onEdit(itemIndex) {
|
|
3972
|
-
this._update((draft) => {
|
|
4036
|
+
editComponent(itemIndex) {
|
|
4037
|
+
update(component, (draft) => {
|
|
3973
4038
|
draft.editableComponent = createEditableComponent(
|
|
3974
4039
|
draft.components[itemIndex].getLocalValue()
|
|
3975
4040
|
);
|
|
3976
4041
|
draft.editableIndex = itemIndex;
|
|
3977
4042
|
});
|
|
3978
4043
|
},
|
|
3979
|
-
|
|
3980
|
-
|
|
4044
|
+
addComponent() {
|
|
4045
|
+
update(component, (draft) => {
|
|
3981
4046
|
draft.editableComponent = createEditableComponent(null);
|
|
3982
4047
|
draft.editableIndex = null;
|
|
3983
4048
|
draft.errors = [];
|
|
3984
4049
|
});
|
|
3985
4050
|
},
|
|
3986
|
-
|
|
4051
|
+
saveComponent() {
|
|
3987
4052
|
var _a2;
|
|
3988
|
-
const isValid = (_a2 =
|
|
4053
|
+
const isValid = (_a2 = component.editableComponent) == null ? void 0 : _a2.validate();
|
|
3989
4054
|
if (!isValid) {
|
|
3990
4055
|
return false;
|
|
3991
4056
|
}
|
|
3992
|
-
|
|
4057
|
+
update(component, (draft) => {
|
|
3993
4058
|
if (draft.editableComponent === null) {
|
|
3994
4059
|
return;
|
|
3995
4060
|
}
|
|
3996
4061
|
if (draft.editableIndex === null) {
|
|
3997
4062
|
const newComponent = __spreadValues({}, draft.editableComponent);
|
|
3998
|
-
draft.components = [...
|
|
4063
|
+
draft.components = [...component.components, newComponent];
|
|
3999
4064
|
} else {
|
|
4000
4065
|
draft.components[draft.editableIndex] = __spreadProps(__spreadValues({}, draft.editableComponent), {
|
|
4001
4066
|
uid: draft.components[draft.editableIndex].uid
|
|
@@ -4007,8 +4072,8 @@ var createRepeatableComponent = (repeatableProps, onComponentUpdate) => {
|
|
|
4007
4072
|
onValueChange();
|
|
4008
4073
|
return true;
|
|
4009
4074
|
},
|
|
4010
|
-
|
|
4011
|
-
|
|
4075
|
+
removeComponent() {
|
|
4076
|
+
update(component, (draft) => {
|
|
4012
4077
|
if (draft.editableIndex === null) {
|
|
4013
4078
|
return;
|
|
4014
4079
|
}
|
|
@@ -4019,30 +4084,32 @@ var createRepeatableComponent = (repeatableProps, onComponentUpdate) => {
|
|
|
4019
4084
|
onValueChange();
|
|
4020
4085
|
},
|
|
4021
4086
|
getChildren() {
|
|
4022
|
-
return
|
|
4087
|
+
return component.editableComponent !== null ? [...component.components, component.editableComponent] : component.components;
|
|
4023
4088
|
},
|
|
4024
4089
|
async getSubmittableValue() {
|
|
4025
|
-
return Promise.all(
|
|
4090
|
+
return Promise.all(
|
|
4091
|
+
component.components.map(async (childComponent) => childComponent.getSubmittableValue())
|
|
4092
|
+
);
|
|
4026
4093
|
},
|
|
4027
4094
|
getSubmittableValueSync() {
|
|
4028
|
-
return
|
|
4095
|
+
return component.components.map((childComponent) => childComponent.getSubmittableValueSync());
|
|
4029
4096
|
},
|
|
4030
4097
|
getSummary() {
|
|
4031
4098
|
return summariser(null);
|
|
4032
4099
|
},
|
|
4033
4100
|
getLocalValue() {
|
|
4034
|
-
return
|
|
4101
|
+
return component.components.map((childComponent) => childComponent.getLocalValue());
|
|
4035
4102
|
},
|
|
4036
4103
|
validate() {
|
|
4037
|
-
const messages = getValidationErrors(
|
|
4038
|
-
const childComponentsValid = validateComponents(
|
|
4039
|
-
|
|
4104
|
+
const messages = getValidationErrors(component.getLocalValue());
|
|
4105
|
+
const childComponentsValid = validateComponents(component.getChildren());
|
|
4106
|
+
update(component, (draft) => {
|
|
4040
4107
|
draft.errors = messages;
|
|
4041
4108
|
});
|
|
4042
4109
|
return messages.length === 0 && childComponentsValid;
|
|
4043
4110
|
}
|
|
4044
4111
|
});
|
|
4045
|
-
return
|
|
4112
|
+
return component;
|
|
4046
4113
|
};
|
|
4047
4114
|
|
|
4048
4115
|
// src/domain/mappers/schema/arraySchemaToComponent/arraySchemaToRepeatableComponent.ts
|
|
@@ -4192,8 +4259,8 @@ var base64ToBytes = (base64) => {
|
|
|
4192
4259
|
};
|
|
4193
4260
|
|
|
4194
4261
|
// src/domain/components/MultiUploadInputComponent.ts
|
|
4195
|
-
var createMultiUploadInputComponent = (
|
|
4196
|
-
const _a =
|
|
4262
|
+
var createMultiUploadInputComponent = (props, onComponentUpdate) => {
|
|
4263
|
+
const _a = props, {
|
|
4197
4264
|
uid,
|
|
4198
4265
|
id,
|
|
4199
4266
|
checks,
|
|
@@ -4216,77 +4283,74 @@ var createMultiUploadInputComponent = (uploadInputProps, onComponentUpdate) => {
|
|
|
4216
4283
|
const getValidationErrors = getLocalValueValidator(checks);
|
|
4217
4284
|
const getFileValidationErrors = getLocalValueValidator(fileChecks);
|
|
4218
4285
|
const persist = performPersistAsync ? getComponentMultiPersistAsync(update, performPersistAsync) : void 0;
|
|
4219
|
-
const
|
|
4286
|
+
const component = __spreadValues({
|
|
4220
4287
|
type: "multi-upload",
|
|
4221
4288
|
kind: "input",
|
|
4222
4289
|
uid,
|
|
4223
4290
|
id,
|
|
4224
4291
|
format,
|
|
4225
4292
|
files: [],
|
|
4226
|
-
_update(updateFn) {
|
|
4227
|
-
update(this, updateFn);
|
|
4228
|
-
},
|
|
4229
4293
|
onBlur() {
|
|
4230
|
-
|
|
4294
|
+
component.validate();
|
|
4231
4295
|
},
|
|
4232
4296
|
onFocus() {
|
|
4233
4297
|
},
|
|
4234
4298
|
// Noop
|
|
4235
|
-
async
|
|
4299
|
+
async removeFile(index) {
|
|
4236
4300
|
var _a2;
|
|
4237
|
-
|
|
4301
|
+
update(component, (draft) => {
|
|
4238
4302
|
draft.value.splice(index, 1);
|
|
4239
4303
|
draft.files.splice(index, 1);
|
|
4240
4304
|
});
|
|
4241
4305
|
if (persist) {
|
|
4242
|
-
(_a2 =
|
|
4243
|
-
|
|
4306
|
+
(_a2 = component.persistedState[index]) == null ? void 0 : _a2.abortController.abort();
|
|
4307
|
+
update(component, (draft) => {
|
|
4244
4308
|
draft.persistedState.splice(index, 1);
|
|
4245
4309
|
});
|
|
4246
4310
|
}
|
|
4247
4311
|
},
|
|
4248
|
-
async
|
|
4312
|
+
async insertFile(index, file) {
|
|
4249
4313
|
const fileErrors = getFileValidationErrors(file);
|
|
4250
4314
|
const fileId = getRandomId();
|
|
4251
4315
|
const base64Value = format === "base64" ? await toBase64(file) : null;
|
|
4252
|
-
|
|
4316
|
+
update(component, (draft) => {
|
|
4253
4317
|
draft.value.splice(index, 0, file);
|
|
4254
4318
|
draft.files.splice(index, 0, { file, id: fileId, errors: fileErrors, base64Value });
|
|
4255
4319
|
draft.errors = [];
|
|
4256
4320
|
});
|
|
4257
4321
|
if (persist) {
|
|
4258
|
-
await persist(
|
|
4322
|
+
await persist(component, index, format === "blob" ? file : base64Value);
|
|
4259
4323
|
}
|
|
4260
4324
|
onValueChange();
|
|
4261
4325
|
return fileId;
|
|
4262
4326
|
},
|
|
4263
4327
|
async getSubmittableValue() {
|
|
4264
4328
|
if (persist) {
|
|
4265
|
-
return Promise.all(
|
|
4329
|
+
return Promise.all(component.persistedState.map(async ({ submission }) => submission));
|
|
4266
4330
|
}
|
|
4267
|
-
return
|
|
4331
|
+
return component.files.map(({ base64Value }) => base64Value);
|
|
4268
4332
|
},
|
|
4269
4333
|
getSubmittableValueSync() {
|
|
4270
4334
|
if (persist) {
|
|
4271
|
-
return
|
|
4335
|
+
return component.persistedState.map(({ lastResponse }) => lastResponse);
|
|
4272
4336
|
}
|
|
4273
|
-
return
|
|
4337
|
+
return component.files.map(({ base64Value }) => base64Value);
|
|
4274
4338
|
},
|
|
4275
4339
|
getSummary() {
|
|
4276
|
-
return summariser(
|
|
4340
|
+
return summariser(component.getLocalValue().map(({ name }) => name));
|
|
4277
4341
|
},
|
|
4278
4342
|
getLocalValue() {
|
|
4279
|
-
return
|
|
4343
|
+
return component.value;
|
|
4280
4344
|
},
|
|
4281
4345
|
validate() {
|
|
4282
|
-
const errorMsgs = getValidationErrors(
|
|
4283
|
-
|
|
4346
|
+
const errorMsgs = getValidationErrors(component.getLocalValue());
|
|
4347
|
+
update(component, (draft) => {
|
|
4284
4348
|
draft.errors = errorMsgs;
|
|
4285
4349
|
});
|
|
4286
|
-
return errorMsgs.length === 0 &&
|
|
4350
|
+
return errorMsgs.length === 0 && component.files.every(({ errors }) => errors.length === 0);
|
|
4287
4351
|
}
|
|
4288
4352
|
}, rest);
|
|
4289
|
-
return
|
|
4353
|
+
return component;
|
|
4290
4354
|
};
|
|
4291
4355
|
|
|
4292
4356
|
// src/domain/features/persistAsync/getInitialPersistedState.ts
|
|
@@ -4440,8 +4504,8 @@ var getPersistAsyncConfig = (schema) => {
|
|
|
4440
4504
|
var getValueForPersistAsync = (localValue) => isArray(localValue) && localValue.every(isFile) ? localValue : [];
|
|
4441
4505
|
|
|
4442
4506
|
// src/domain/components/MultiSelectInputComponent.ts
|
|
4443
|
-
var createMultiSelectComponent = (
|
|
4444
|
-
const _a =
|
|
4507
|
+
var createMultiSelectComponent = (props, onComponentUpdate) => {
|
|
4508
|
+
const _a = props, {
|
|
4445
4509
|
uid,
|
|
4446
4510
|
checks,
|
|
4447
4511
|
options,
|
|
@@ -4472,21 +4536,18 @@ var createMultiSelectComponent = (multiSelectProps, onComponentUpdate) => {
|
|
|
4472
4536
|
selectedIndices,
|
|
4473
4537
|
value: null
|
|
4474
4538
|
}, rest), {
|
|
4475
|
-
|
|
4476
|
-
update(
|
|
4477
|
-
},
|
|
4478
|
-
onSelect(indices) {
|
|
4479
|
-
this._update((draft) => {
|
|
4539
|
+
selectIndices(indices) {
|
|
4540
|
+
update(component, (draft) => {
|
|
4480
4541
|
draft.selectedIndices = indices;
|
|
4481
4542
|
draft.errors = [];
|
|
4482
4543
|
});
|
|
4483
4544
|
void (schemaOnChange == null ? void 0 : schemaOnChange());
|
|
4484
|
-
const errors = getValidationErrors(
|
|
4485
|
-
|
|
4545
|
+
const errors = getValidationErrors(component.getLocalValue());
|
|
4546
|
+
update(component, (draft) => {
|
|
4486
4547
|
draft.errors = errors;
|
|
4487
4548
|
});
|
|
4488
|
-
if (
|
|
4489
|
-
validateAsync == null ? void 0 : validateAsync(
|
|
4549
|
+
if (component.validate()) {
|
|
4550
|
+
validateAsync == null ? void 0 : validateAsync(component, component.getLocalValue()).catch(() => {
|
|
4490
4551
|
});
|
|
4491
4552
|
}
|
|
4492
4553
|
onValueChange();
|
|
@@ -4499,17 +4560,17 @@ var createMultiSelectComponent = (multiSelectProps, onComponentUpdate) => {
|
|
|
4499
4560
|
// Noop
|
|
4500
4561
|
getLocalValue() {
|
|
4501
4562
|
var _a2, _b;
|
|
4502
|
-
return (_b = (_a2 =
|
|
4563
|
+
return (_b = (_a2 = component.getSelectedChildren()) == null ? void 0 : _a2.map((child) => child.getLocalValue())) != null ? _b : null;
|
|
4503
4564
|
},
|
|
4504
4565
|
validate() {
|
|
4505
|
-
const errors = getValidationErrors(
|
|
4506
|
-
|
|
4566
|
+
const errors = getValidationErrors(component.getLocalValue());
|
|
4567
|
+
update(component, (draft) => {
|
|
4507
4568
|
draft.errors = errors;
|
|
4508
4569
|
});
|
|
4509
4570
|
return errors.length === 0;
|
|
4510
4571
|
},
|
|
4511
4572
|
async getSubmittableValue() {
|
|
4512
|
-
const selected =
|
|
4573
|
+
const selected = component.getSelectedChildren();
|
|
4513
4574
|
if (selected) {
|
|
4514
4575
|
return Promise.all(selected.map(async (child) => child.getSubmittableValue()));
|
|
4515
4576
|
}
|
|
@@ -4517,14 +4578,14 @@ var createMultiSelectComponent = (multiSelectProps, onComponentUpdate) => {
|
|
|
4517
4578
|
},
|
|
4518
4579
|
getSubmittableValueSync() {
|
|
4519
4580
|
var _a2, _b;
|
|
4520
|
-
return (_b = (_a2 =
|
|
4581
|
+
return (_b = (_a2 = component.getSelectedChildren()) == null ? void 0 : _a2.map((child) => child.getSubmittableValueSync())) != null ? _b : null;
|
|
4521
4582
|
},
|
|
4522
4583
|
getSummary: () => ({}),
|
|
4523
4584
|
getChildren() {
|
|
4524
|
-
return
|
|
4585
|
+
return component.children;
|
|
4525
4586
|
},
|
|
4526
4587
|
getSelectedChildren() {
|
|
4527
|
-
return
|
|
4588
|
+
return component.selectedIndices.map((i) => component.children[i]);
|
|
4528
4589
|
}
|
|
4529
4590
|
});
|
|
4530
4591
|
return component;
|
|
@@ -4606,7 +4667,7 @@ var arraySchemaToMultiSelectComponent = (schemaMapperProps, mapperProps) => {
|
|
|
4606
4667
|
};
|
|
4607
4668
|
|
|
4608
4669
|
// src/domain/components/TupleComponent.ts
|
|
4609
|
-
var createTupleComponent = (
|
|
4670
|
+
var createTupleComponent = (props) => {
|
|
4610
4671
|
const {
|
|
4611
4672
|
uid,
|
|
4612
4673
|
schemaId,
|
|
@@ -4621,8 +4682,8 @@ var createTupleComponent = (tupleProps) => {
|
|
|
4621
4682
|
summariser,
|
|
4622
4683
|
title,
|
|
4623
4684
|
tags
|
|
4624
|
-
} =
|
|
4625
|
-
|
|
4685
|
+
} = props;
|
|
4686
|
+
const component = {
|
|
4626
4687
|
type: "tuple",
|
|
4627
4688
|
kind: "input",
|
|
4628
4689
|
uid,
|
|
@@ -4638,26 +4699,27 @@ var createTupleComponent = (tupleProps) => {
|
|
|
4638
4699
|
title,
|
|
4639
4700
|
tags,
|
|
4640
4701
|
getChildren() {
|
|
4641
|
-
return
|
|
4702
|
+
return component.components;
|
|
4642
4703
|
},
|
|
4643
4704
|
async getSubmittableValue() {
|
|
4644
|
-
return Promise.all(
|
|
4705
|
+
return Promise.all(component.components.map(async (child) => child.getSubmittableValue()));
|
|
4645
4706
|
},
|
|
4646
4707
|
getSubmittableValueSync() {
|
|
4647
|
-
return
|
|
4708
|
+
return component.components.map((child) => child.getSubmittableValueSync());
|
|
4648
4709
|
},
|
|
4649
4710
|
getSummary() {
|
|
4650
|
-
const summary = summariser(
|
|
4651
|
-
const childSummary = summariseFromChildren(
|
|
4711
|
+
const summary = summariser(component.getLocalValue());
|
|
4712
|
+
const childSummary = summariseFromChildren(component.getChildren());
|
|
4652
4713
|
return mergeSummaries(summary, childSummary);
|
|
4653
4714
|
},
|
|
4654
4715
|
getLocalValue() {
|
|
4655
|
-
return
|
|
4716
|
+
return component.components.map((child) => child.getLocalValue());
|
|
4656
4717
|
},
|
|
4657
4718
|
validate() {
|
|
4658
|
-
return hidden ? true : validateComponents(
|
|
4719
|
+
return hidden ? true : validateComponents(component.getChildren());
|
|
4659
4720
|
}
|
|
4660
4721
|
};
|
|
4722
|
+
return component;
|
|
4661
4723
|
};
|
|
4662
4724
|
|
|
4663
4725
|
// src/domain/mappers/schema/arraySchemaToComponent/arraySchemaToTupleComponent.ts
|
|
@@ -4712,8 +4774,8 @@ var isPersistAsyncWithUploadSchema = (schema) => isSchemaWithPersistAsync(schema
|
|
|
4712
4774
|
var isArraySchemaListWithMultiSelect = (schema) => isArrayListSchema(schema) && "oneOf" in schema.items && schema.items.oneOf.every(isConstSchema);
|
|
4713
4775
|
|
|
4714
4776
|
// src/domain/components/UploadInputComponent.ts
|
|
4715
|
-
var createUploadInputComponent = (
|
|
4716
|
-
const _a =
|
|
4777
|
+
var createUploadInputComponent = (props, onComponentUpdate) => {
|
|
4778
|
+
const _a = props, {
|
|
4717
4779
|
uid,
|
|
4718
4780
|
id,
|
|
4719
4781
|
checks,
|
|
@@ -4736,7 +4798,7 @@ var createUploadInputComponent = (uploadInputProps, onComponentUpdate) => {
|
|
|
4736
4798
|
]);
|
|
4737
4799
|
const update = getInputUpdateFunction(onComponentUpdate);
|
|
4738
4800
|
const getValidationErrors = getLocalValueValidator(checks);
|
|
4739
|
-
const
|
|
4801
|
+
const component = __spreadValues({
|
|
4740
4802
|
type: "upload",
|
|
4741
4803
|
kind: "input",
|
|
4742
4804
|
uid,
|
|
@@ -4744,18 +4806,15 @@ var createUploadInputComponent = (uploadInputProps, onComponentUpdate) => {
|
|
|
4744
4806
|
format,
|
|
4745
4807
|
value,
|
|
4746
4808
|
base64Value: null,
|
|
4747
|
-
_update(updateFn) {
|
|
4748
|
-
update(this, updateFn);
|
|
4749
|
-
},
|
|
4750
4809
|
onBlur() {
|
|
4751
|
-
|
|
4810
|
+
component.validate();
|
|
4752
4811
|
},
|
|
4753
4812
|
onFocus() {
|
|
4754
4813
|
},
|
|
4755
4814
|
// Noop
|
|
4756
|
-
async
|
|
4757
|
-
const base64Value =
|
|
4758
|
-
|
|
4815
|
+
async setValue(updatedValue) {
|
|
4816
|
+
const base64Value = component.format === "base64" && updatedValue ? await toBase64(updatedValue) : null;
|
|
4817
|
+
update(component, (draft) => {
|
|
4759
4818
|
draft.errors = [];
|
|
4760
4819
|
draft.value = updatedValue;
|
|
4761
4820
|
draft.base64Value = base64Value;
|
|
@@ -4763,50 +4822,47 @@ var createUploadInputComponent = (uploadInputProps, onComponentUpdate) => {
|
|
|
4763
4822
|
void (schemaOnChange == null ? void 0 : schemaOnChange());
|
|
4764
4823
|
onValueChange();
|
|
4765
4824
|
await (onPersistAsync == null ? void 0 : onPersistAsync().catch((e) => {
|
|
4766
|
-
|
|
4825
|
+
update(component, (draft) => {
|
|
4767
4826
|
draft.value = null;
|
|
4768
4827
|
});
|
|
4769
4828
|
throw e;
|
|
4770
4829
|
}));
|
|
4771
4830
|
},
|
|
4772
4831
|
async getSubmittableValue() {
|
|
4773
|
-
const file =
|
|
4774
|
-
if (
|
|
4832
|
+
const file = component.getLocalValue();
|
|
4833
|
+
if (component.format === "base64" && file) {
|
|
4775
4834
|
return toBase64(file);
|
|
4776
4835
|
}
|
|
4777
4836
|
return null;
|
|
4778
4837
|
},
|
|
4779
4838
|
getSubmittableValueSync() {
|
|
4780
|
-
return
|
|
4839
|
+
return component.base64Value;
|
|
4781
4840
|
},
|
|
4782
4841
|
getSummary() {
|
|
4783
4842
|
var _a2, _b;
|
|
4784
|
-
return summariser((_b = (_a2 =
|
|
4843
|
+
return summariser((_b = (_a2 = component.getLocalValue()) == null ? void 0 : _a2.name) != null ? _b : null);
|
|
4785
4844
|
},
|
|
4786
4845
|
getLocalValue() {
|
|
4787
|
-
return
|
|
4846
|
+
return component.value;
|
|
4788
4847
|
},
|
|
4789
4848
|
validate() {
|
|
4790
|
-
const errors = getValidationErrors(
|
|
4791
|
-
|
|
4849
|
+
const errors = getValidationErrors(component.getLocalValue());
|
|
4850
|
+
update(component, (draft) => {
|
|
4792
4851
|
draft.errors = errors;
|
|
4793
4852
|
});
|
|
4794
4853
|
return errors.length === 0;
|
|
4795
4854
|
}
|
|
4796
4855
|
}, rest);
|
|
4797
4856
|
if (format === "base64" && value && !onPersistAsync) {
|
|
4798
|
-
void
|
|
4799
|
-
|
|
4800
|
-
|
|
4801
|
-
|
|
4802
|
-
|
|
4803
|
-
|
|
4804
|
-
const base64Value = format === "base64" && value ? await toBase64(value) : null;
|
|
4805
|
-
if (base64Value) {
|
|
4806
|
-
uploadComponent._update((draft) => {
|
|
4807
|
-
draft.base64Value = base64Value;
|
|
4857
|
+
void toBase64(value).then((base64Value) => {
|
|
4858
|
+
if (base64Value) {
|
|
4859
|
+
update(component, (draft) => {
|
|
4860
|
+
draft.base64Value = base64Value;
|
|
4861
|
+
});
|
|
4862
|
+
}
|
|
4808
4863
|
});
|
|
4809
4864
|
}
|
|
4865
|
+
return component;
|
|
4810
4866
|
};
|
|
4811
4867
|
|
|
4812
4868
|
// src/domain/mappers/schema/blobSchemaToComponent.ts
|
|
@@ -4835,8 +4891,8 @@ var blobSchemaToComponent = (schemaMapperProps, mapperProps) => {
|
|
|
4835
4891
|
};
|
|
4836
4892
|
|
|
4837
4893
|
// src/domain/components/BooleanInputComponent.ts
|
|
4838
|
-
var createBooleanInputComponent = (
|
|
4839
|
-
const _a =
|
|
4894
|
+
var createBooleanInputComponent = (props, onComponentUpdate) => {
|
|
4895
|
+
const _a = props, {
|
|
4840
4896
|
uid,
|
|
4841
4897
|
id,
|
|
4842
4898
|
value,
|
|
@@ -4857,49 +4913,46 @@ var createBooleanInputComponent = (booleanInputProps, onComponentUpdate) => {
|
|
|
4857
4913
|
]);
|
|
4858
4914
|
const update = getInputUpdateFunction(onComponentUpdate);
|
|
4859
4915
|
const validateAsync = performValidationAsync ? getComponentValidationAsync(update, performValidationAsync) : void 0;
|
|
4860
|
-
const
|
|
4916
|
+
const component = __spreadValues({
|
|
4861
4917
|
type: "boolean",
|
|
4862
4918
|
kind: "input",
|
|
4863
4919
|
uid,
|
|
4864
4920
|
id,
|
|
4865
4921
|
autoComplete: "",
|
|
4866
4922
|
value,
|
|
4867
|
-
_update(updateFn) {
|
|
4868
|
-
update(this, updateFn);
|
|
4869
|
-
},
|
|
4870
4923
|
onBlur() {
|
|
4871
4924
|
},
|
|
4872
4925
|
// Noop
|
|
4873
4926
|
onFocus() {
|
|
4874
4927
|
},
|
|
4875
4928
|
// Noop
|
|
4876
|
-
|
|
4877
|
-
|
|
4929
|
+
setValue(updatedValue) {
|
|
4930
|
+
update(component, (draft) => {
|
|
4878
4931
|
draft.errors = [];
|
|
4879
4932
|
draft.value = updatedValue;
|
|
4880
4933
|
});
|
|
4881
4934
|
void (schemaOnChange == null ? void 0 : schemaOnChange());
|
|
4882
4935
|
void (onPersistAsync == null ? void 0 : onPersistAsync().catch(() => {
|
|
4883
4936
|
}));
|
|
4884
|
-
validateAsync == null ? void 0 : validateAsync(
|
|
4937
|
+
validateAsync == null ? void 0 : validateAsync(component, component.getLocalValue()).catch(() => {
|
|
4885
4938
|
});
|
|
4886
4939
|
onValueChange();
|
|
4887
4940
|
},
|
|
4888
4941
|
async getSubmittableValue() {
|
|
4889
|
-
return
|
|
4942
|
+
return component.getSubmittableValueSync();
|
|
4890
4943
|
},
|
|
4891
4944
|
getSubmittableValueSync() {
|
|
4892
|
-
return
|
|
4945
|
+
return component.getLocalValue();
|
|
4893
4946
|
},
|
|
4894
4947
|
getSummary() {
|
|
4895
|
-
return summariser(
|
|
4948
|
+
return summariser(component.getLocalValue());
|
|
4896
4949
|
},
|
|
4897
4950
|
getLocalValue() {
|
|
4898
|
-
return
|
|
4951
|
+
return component.value;
|
|
4899
4952
|
},
|
|
4900
4953
|
validate: () => true
|
|
4901
4954
|
}, rest);
|
|
4902
|
-
return
|
|
4955
|
+
return component;
|
|
4903
4956
|
};
|
|
4904
4957
|
|
|
4905
4958
|
// src/domain/mappers/schema/booleanSchemaToComponent.ts
|
|
@@ -4940,8 +4993,8 @@ var getValidModel = (model, defaultValue) => {
|
|
|
4940
4993
|
};
|
|
4941
4994
|
|
|
4942
4995
|
// src/domain/components/ConstComponent.ts
|
|
4943
|
-
var createConstComponent = (
|
|
4944
|
-
const { uid, schemaId, analyticsId, value, summary, layout, hidden, tags } =
|
|
4996
|
+
var createConstComponent = (props) => {
|
|
4997
|
+
const { uid, schemaId, analyticsId, value, summary, layout, hidden, tags } = props;
|
|
4945
4998
|
return {
|
|
4946
4999
|
type: "const",
|
|
4947
5000
|
kind: "input",
|
|
@@ -4984,8 +5037,8 @@ var getConstLayout = (uid, mapperProps, layout, alert) => {
|
|
|
4984
5037
|
};
|
|
4985
5038
|
|
|
4986
5039
|
// src/domain/components/IntegerInputComponent.ts
|
|
4987
|
-
var createIntegerInputComponent = (
|
|
4988
|
-
const _a =
|
|
5040
|
+
var createIntegerInputComponent = (props, onComponentUpdate) => {
|
|
5041
|
+
const _a = props, {
|
|
4989
5042
|
uid,
|
|
4990
5043
|
id,
|
|
4991
5044
|
checks,
|
|
@@ -5010,17 +5063,14 @@ var createIntegerInputComponent = (integerInputProps, onComponentUpdate) => {
|
|
|
5010
5063
|
const getValidationErrors = getLocalValueValidator(checks);
|
|
5011
5064
|
const performOnChange = getDebouncedSchemaOnChange(schemaOnChange, getValidationErrors);
|
|
5012
5065
|
const validateAsync = performValidationAsync ? getDebouncedComponentValidationAsync(update, performValidationAsync) : void 0;
|
|
5013
|
-
const
|
|
5066
|
+
const component = __spreadValues({
|
|
5014
5067
|
type: "integer",
|
|
5015
5068
|
kind: "input",
|
|
5016
5069
|
uid,
|
|
5017
5070
|
id,
|
|
5018
5071
|
value,
|
|
5019
|
-
_update(updateFn) {
|
|
5020
|
-
update(this, updateFn);
|
|
5021
|
-
},
|
|
5022
5072
|
onBlur() {
|
|
5023
|
-
const isValid =
|
|
5073
|
+
const isValid = component.validate();
|
|
5024
5074
|
performOnChange == null ? void 0 : performOnChange.flush();
|
|
5025
5075
|
if (isValid) {
|
|
5026
5076
|
void (onPersistAsync == null ? void 0 : onPersistAsync().catch(() => {
|
|
@@ -5031,9 +5081,9 @@ var createIntegerInputComponent = (integerInputProps, onComponentUpdate) => {
|
|
|
5031
5081
|
onFocus() {
|
|
5032
5082
|
},
|
|
5033
5083
|
// Noop
|
|
5034
|
-
|
|
5035
|
-
const prevValue =
|
|
5036
|
-
|
|
5084
|
+
setValue(updatedValue) {
|
|
5085
|
+
const prevValue = component.value;
|
|
5086
|
+
update(component, (draft) => {
|
|
5037
5087
|
draft.errors = [];
|
|
5038
5088
|
draft.validationAsyncState.messages = {};
|
|
5039
5089
|
draft.value = updatedValue;
|
|
@@ -5041,32 +5091,32 @@ var createIntegerInputComponent = (integerInputProps, onComponentUpdate) => {
|
|
|
5041
5091
|
performOnChange == null ? void 0 : performOnChange(prevValue, updatedValue);
|
|
5042
5092
|
const isValid = getValidationErrors(updatedValue).length === 0;
|
|
5043
5093
|
if (isValid) {
|
|
5044
|
-
validateAsync == null ? void 0 : validateAsync(
|
|
5094
|
+
validateAsync == null ? void 0 : validateAsync(component, updatedValue);
|
|
5045
5095
|
}
|
|
5046
5096
|
onValueChange();
|
|
5047
5097
|
},
|
|
5048
5098
|
async getSubmittableValue() {
|
|
5049
|
-
return
|
|
5099
|
+
return component.getSubmittableValueSync();
|
|
5050
5100
|
},
|
|
5051
5101
|
getSubmittableValueSync() {
|
|
5052
5102
|
var _a2;
|
|
5053
|
-
return (_a2 =
|
|
5103
|
+
return (_a2 = component.getLocalValue()) != null ? _a2 : null;
|
|
5054
5104
|
},
|
|
5055
5105
|
getSummary() {
|
|
5056
|
-
return summariser(
|
|
5106
|
+
return summariser(component.getLocalValue());
|
|
5057
5107
|
},
|
|
5058
5108
|
getLocalValue() {
|
|
5059
|
-
return
|
|
5109
|
+
return component.value;
|
|
5060
5110
|
},
|
|
5061
5111
|
validate() {
|
|
5062
|
-
const errors = getValidationErrors(
|
|
5063
|
-
|
|
5112
|
+
const errors = getValidationErrors(component.getLocalValue());
|
|
5113
|
+
update(component, (draft) => {
|
|
5064
5114
|
draft.errors = errors;
|
|
5065
5115
|
});
|
|
5066
5116
|
return errors.length === 0;
|
|
5067
5117
|
}
|
|
5068
5118
|
}, rest);
|
|
5069
|
-
return
|
|
5119
|
+
return component;
|
|
5070
5120
|
};
|
|
5071
5121
|
|
|
5072
5122
|
// src/domain/mappers/schema/integerSchemaToComponent.ts
|
|
@@ -5124,7 +5174,7 @@ var createFormattedValueComponent = (props, onComponentUpdate) => {
|
|
|
5124
5174
|
schemaOnChange
|
|
5125
5175
|
} = props;
|
|
5126
5176
|
const update = getInputUpdateFunction(onComponentUpdate);
|
|
5127
|
-
|
|
5177
|
+
const component = {
|
|
5128
5178
|
type: "formatted-value",
|
|
5129
5179
|
kind: "input",
|
|
5130
5180
|
uid,
|
|
@@ -5142,27 +5192,28 @@ var createFormattedValueComponent = (props, onComponentUpdate) => {
|
|
|
5142
5192
|
tags,
|
|
5143
5193
|
value,
|
|
5144
5194
|
async getSubmittableValue() {
|
|
5145
|
-
return
|
|
5195
|
+
return component.getSubmittableValueSync();
|
|
5146
5196
|
},
|
|
5147
5197
|
getSubmittableValueSync() {
|
|
5148
|
-
return
|
|
5198
|
+
return component.getLocalValue();
|
|
5149
5199
|
},
|
|
5150
5200
|
getSummary() {
|
|
5151
|
-
return summariser(
|
|
5201
|
+
return summariser(component.getLocalValue());
|
|
5152
5202
|
},
|
|
5153
5203
|
getLocalValue() {
|
|
5154
|
-
return
|
|
5204
|
+
return component.value;
|
|
5155
5205
|
},
|
|
5156
5206
|
validate() {
|
|
5157
5207
|
return true;
|
|
5158
5208
|
},
|
|
5159
|
-
|
|
5160
|
-
update(
|
|
5209
|
+
setValue(newValue) {
|
|
5210
|
+
update(component, (draft) => {
|
|
5161
5211
|
draft.value = newValue;
|
|
5162
5212
|
});
|
|
5163
5213
|
void (schemaOnChange == null ? void 0 : schemaOnChange());
|
|
5164
5214
|
}
|
|
5165
5215
|
};
|
|
5216
|
+
return component;
|
|
5166
5217
|
};
|
|
5167
5218
|
|
|
5168
5219
|
// src/domain/mappers/schema/objectSchemaToComponent/objectSchemaToFormattedValueComponent.ts
|
|
@@ -5181,8 +5232,8 @@ var objectSchemaToFormattedValueComponent = (schemaMapperProps, mapperProps) =>
|
|
|
5181
5232
|
};
|
|
5182
5233
|
|
|
5183
5234
|
// src/domain/components/MoneyInputComponent.ts
|
|
5184
|
-
var createMoneyInputComponent = (
|
|
5185
|
-
const _a =
|
|
5235
|
+
var createMoneyInputComponent = (props, onComponentUpdate) => {
|
|
5236
|
+
const _a = props, {
|
|
5186
5237
|
id,
|
|
5187
5238
|
uid,
|
|
5188
5239
|
schemaId,
|
|
@@ -5223,7 +5274,7 @@ var createMoneyInputComponent = (moneyInputProps, onComponentUpdate) => {
|
|
|
5223
5274
|
]);
|
|
5224
5275
|
const getValidationErrors = getLocalValueValidator(checks);
|
|
5225
5276
|
const update = getInputUpdateFunction(onComponentUpdate);
|
|
5226
|
-
const
|
|
5277
|
+
const component = __spreadValues({
|
|
5227
5278
|
type: "money-input",
|
|
5228
5279
|
kind: "input",
|
|
5229
5280
|
id,
|
|
@@ -5242,9 +5293,6 @@ var createMoneyInputComponent = (moneyInputProps, onComponentUpdate) => {
|
|
|
5242
5293
|
[amountKey]: amountComponent.getLocalValue(),
|
|
5243
5294
|
[currencyKey]: currencyComponent.getLocalValue()
|
|
5244
5295
|
},
|
|
5245
|
-
_update(updateFn) {
|
|
5246
|
-
update(this, updateFn);
|
|
5247
|
-
},
|
|
5248
5296
|
components: {
|
|
5249
5297
|
amount: amountComponent,
|
|
5250
5298
|
currency: currencyComponent
|
|
@@ -5268,11 +5316,11 @@ var createMoneyInputComponent = (moneyInputProps, onComponentUpdate) => {
|
|
|
5268
5316
|
}, extraValues);
|
|
5269
5317
|
},
|
|
5270
5318
|
getSummary() {
|
|
5271
|
-
return summariser(
|
|
5319
|
+
return summariser(component.getLocalValue());
|
|
5272
5320
|
},
|
|
5273
5321
|
validate() {
|
|
5274
5322
|
const errors = getValidationErrors(amountComponent.getLocalValue());
|
|
5275
|
-
|
|
5323
|
+
update(component, (draft) => {
|
|
5276
5324
|
draft.errors = errors;
|
|
5277
5325
|
});
|
|
5278
5326
|
return amountComponent.validate() && currencyComponent.validate() && errors.length === 0;
|
|
@@ -5283,11 +5331,11 @@ var createMoneyInputComponent = (moneyInputProps, onComponentUpdate) => {
|
|
|
5283
5331
|
onFocus() {
|
|
5284
5332
|
}
|
|
5285
5333
|
}, rest);
|
|
5286
|
-
return
|
|
5334
|
+
return component;
|
|
5287
5335
|
};
|
|
5288
5336
|
|
|
5289
5337
|
// src/domain/components/ObjectComponent.ts
|
|
5290
|
-
var createObjectComponent = (
|
|
5338
|
+
var createObjectComponent = (props) => {
|
|
5291
5339
|
const {
|
|
5292
5340
|
uid,
|
|
5293
5341
|
schemaId,
|
|
@@ -5303,8 +5351,8 @@ var createObjectComponent = (objectProps) => {
|
|
|
5303
5351
|
summariser,
|
|
5304
5352
|
title,
|
|
5305
5353
|
tags
|
|
5306
|
-
} =
|
|
5307
|
-
|
|
5354
|
+
} = props;
|
|
5355
|
+
const component = {
|
|
5308
5356
|
type: "object",
|
|
5309
5357
|
kind: "input",
|
|
5310
5358
|
uid,
|
|
@@ -5320,12 +5368,12 @@ var createObjectComponent = (objectProps) => {
|
|
|
5320
5368
|
title,
|
|
5321
5369
|
tags,
|
|
5322
5370
|
getChildren() {
|
|
5323
|
-
return displayOrder.map((propName) =>
|
|
5371
|
+
return displayOrder.map((propName) => component.componentMap[propName]);
|
|
5324
5372
|
},
|
|
5325
5373
|
async getSubmittableValue() {
|
|
5326
5374
|
return Promise.all(
|
|
5327
5375
|
displayOrder.map(
|
|
5328
|
-
async (propName) =>
|
|
5376
|
+
async (propName) => component.componentMap[propName].getSubmittableValue().then((value) => ({ value, propName }))
|
|
5329
5377
|
)
|
|
5330
5378
|
).then(
|
|
5331
5379
|
(values) => values.reduce(
|
|
@@ -5337,24 +5385,25 @@ var createObjectComponent = (objectProps) => {
|
|
|
5337
5385
|
getSubmittableValueSync() {
|
|
5338
5386
|
return mergeChildrenValues(
|
|
5339
5387
|
displayOrder,
|
|
5340
|
-
(propName) =>
|
|
5388
|
+
(propName) => component.componentMap[propName].getSubmittableValueSync()
|
|
5341
5389
|
);
|
|
5342
5390
|
},
|
|
5343
5391
|
getSummary() {
|
|
5344
|
-
const summary = summariser(
|
|
5345
|
-
const childSummary = summariseFromChildren(
|
|
5392
|
+
const summary = summariser(component.getLocalValue());
|
|
5393
|
+
const childSummary = summariseFromChildren(component.getChildren());
|
|
5346
5394
|
return mergeSummaries(summary, childSummary);
|
|
5347
5395
|
},
|
|
5348
5396
|
getLocalValue() {
|
|
5349
5397
|
return mergeChildrenValues(
|
|
5350
5398
|
displayOrder,
|
|
5351
|
-
(propName) =>
|
|
5399
|
+
(propName) => component.componentMap[propName].getLocalValue()
|
|
5352
5400
|
);
|
|
5353
5401
|
},
|
|
5354
5402
|
validate() {
|
|
5355
|
-
return hidden ? true : validateComponents(
|
|
5403
|
+
return hidden ? true : validateComponents(component.getChildren());
|
|
5356
5404
|
}
|
|
5357
5405
|
};
|
|
5406
|
+
return component;
|
|
5358
5407
|
};
|
|
5359
5408
|
var mergeChildrenValues = (displayOrder, getComponentValue) => displayOrder.reduce((acc, propName) => {
|
|
5360
5409
|
const componentValue = getComponentValue(propName);
|
|
@@ -5540,8 +5589,8 @@ var isPartialModelMatch = (localModel, incomingModel) => {
|
|
|
5540
5589
|
var nonNullishKeys = (model) => Object.keys(model).filter((key) => !isNullish(model[key]));
|
|
5541
5590
|
|
|
5542
5591
|
// src/domain/components/SelectInputComponent.ts
|
|
5543
|
-
var createSelectInputComponent = (
|
|
5544
|
-
const _a =
|
|
5592
|
+
var createSelectInputComponent = (props, onComponentUpdate) => {
|
|
5593
|
+
const _a = props, { uid, checks, initialModel, options, schemaOnChange, onValueChange, summariser } = _a, rest = __objRest(_a, ["uid", "checks", "initialModel", "options", "schemaOnChange", "onValueChange", "summariser"]);
|
|
5545
5594
|
const children = options.map((option) => option.component);
|
|
5546
5595
|
const matchingOptions = options.map(
|
|
5547
5596
|
(option) => isPartialModelMatch(option.component.getSubmittableValueSync(), initialModel)
|
|
@@ -5558,54 +5607,51 @@ var createSelectInputComponent = (selectProps, onComponentUpdate) => {
|
|
|
5558
5607
|
selectedIndex,
|
|
5559
5608
|
value: null
|
|
5560
5609
|
}, rest), {
|
|
5561
|
-
_update(updateFn) {
|
|
5562
|
-
update(this, updateFn);
|
|
5563
|
-
},
|
|
5564
5610
|
getChildren() {
|
|
5565
|
-
return
|
|
5611
|
+
return component.children;
|
|
5566
5612
|
},
|
|
5567
5613
|
getSelectedChild() {
|
|
5568
|
-
return
|
|
5614
|
+
return component.selectedIndex !== null ? component.children[component.selectedIndex] : null;
|
|
5569
5615
|
},
|
|
5570
5616
|
async getSubmittableValue() {
|
|
5571
5617
|
var _a2, _b;
|
|
5572
|
-
return (_b = await ((_a2 =
|
|
5618
|
+
return (_b = await ((_a2 = component.getSelectedChild()) == null ? void 0 : _a2.getSubmittableValue())) != null ? _b : null;
|
|
5573
5619
|
},
|
|
5574
5620
|
getSubmittableValueSync() {
|
|
5575
5621
|
var _a2, _b;
|
|
5576
|
-
return (_b = (_a2 =
|
|
5622
|
+
return (_b = (_a2 = component.getSelectedChild()) == null ? void 0 : _a2.getSubmittableValueSync()) != null ? _b : null;
|
|
5577
5623
|
},
|
|
5578
5624
|
getSummary() {
|
|
5579
5625
|
var _a2, _b;
|
|
5580
|
-
return (_b = (_a2 =
|
|
5626
|
+
return (_b = (_a2 = component.getSelectedChild()) == null ? void 0 : _a2.getSummary()) != null ? _b : {};
|
|
5581
5627
|
},
|
|
5582
5628
|
getLocalValue() {
|
|
5583
5629
|
var _a2, _b;
|
|
5584
|
-
return (_b = (_a2 =
|
|
5630
|
+
return (_b = (_a2 = component.getSelectedChild()) == null ? void 0 : _a2.getLocalValue()) != null ? _b : null;
|
|
5585
5631
|
},
|
|
5586
5632
|
onBlur() {
|
|
5587
|
-
|
|
5633
|
+
component.validate();
|
|
5588
5634
|
},
|
|
5589
5635
|
onFocus() {
|
|
5590
5636
|
},
|
|
5591
5637
|
// noop
|
|
5592
|
-
|
|
5593
|
-
if (updatedIndex ===
|
|
5638
|
+
selectIndex(updatedIndex) {
|
|
5639
|
+
if (updatedIndex === component.selectedIndex) {
|
|
5594
5640
|
return;
|
|
5595
5641
|
}
|
|
5596
5642
|
if (updatedIndex !== null) {
|
|
5597
|
-
|
|
5598
|
-
schema:
|
|
5599
|
-
selectedOption:
|
|
5643
|
+
props.trackEvent("OneOf Option Selected", {
|
|
5644
|
+
schema: component.analyticsId,
|
|
5645
|
+
selectedOption: component.children[updatedIndex].analyticsId
|
|
5600
5646
|
});
|
|
5601
|
-
if (
|
|
5602
|
-
|
|
5603
|
-
oneOfId:
|
|
5604
|
-
schemaId:
|
|
5647
|
+
if (component.analyticsId) {
|
|
5648
|
+
props.trackEvent("OneOf Selected", {
|
|
5649
|
+
oneOfId: component.analyticsId,
|
|
5650
|
+
schemaId: component.children[updatedIndex].analyticsId
|
|
5605
5651
|
});
|
|
5606
5652
|
}
|
|
5607
5653
|
}
|
|
5608
|
-
|
|
5654
|
+
update(component, (draft) => {
|
|
5609
5655
|
draft.errors = [];
|
|
5610
5656
|
draft.selectedIndex = updatedIndex;
|
|
5611
5657
|
});
|
|
@@ -5614,9 +5660,9 @@ var createSelectInputComponent = (selectProps, onComponentUpdate) => {
|
|
|
5614
5660
|
},
|
|
5615
5661
|
validate() {
|
|
5616
5662
|
var _a2, _b;
|
|
5617
|
-
const validChild = (_b = (_a2 =
|
|
5618
|
-
const errors = getValidationErrors(
|
|
5619
|
-
|
|
5663
|
+
const validChild = (_b = (_a2 = component.getSelectedChild()) == null ? void 0 : _a2.validate()) != null ? _b : true;
|
|
5664
|
+
const errors = getValidationErrors(component.getLocalValue());
|
|
5665
|
+
update(component, (draft) => {
|
|
5620
5666
|
draft.errors = errors;
|
|
5621
5667
|
});
|
|
5622
5668
|
return errors.length === 0 && validChild;
|
|
@@ -5712,15 +5758,24 @@ var isExactLocalValueMatch = (valueA, valueB) => {
|
|
|
5712
5758
|
|
|
5713
5759
|
// src/domain/components/PersistAsyncComponent.ts
|
|
5714
5760
|
var createPersistAsyncComponent = (props, performPersistAsync, schemaOnChange, onComponentUpdate) => {
|
|
5715
|
-
const {
|
|
5761
|
+
const {
|
|
5762
|
+
uid,
|
|
5763
|
+
analyticsId,
|
|
5764
|
+
schemaId,
|
|
5765
|
+
component: childComponent,
|
|
5766
|
+
hidden,
|
|
5767
|
+
model,
|
|
5768
|
+
localValue,
|
|
5769
|
+
tags
|
|
5770
|
+
} = props;
|
|
5716
5771
|
const update = getInputUpdateFunction(onComponentUpdate);
|
|
5717
|
-
const
|
|
5772
|
+
const component = {
|
|
5718
5773
|
type: "persist-async",
|
|
5719
5774
|
kind: "input",
|
|
5720
5775
|
uid,
|
|
5721
5776
|
analyticsId,
|
|
5722
5777
|
schemaId,
|
|
5723
|
-
component,
|
|
5778
|
+
component: childComponent,
|
|
5724
5779
|
hidden,
|
|
5725
5780
|
status: "idle",
|
|
5726
5781
|
lastSubmitted: model != null ? localValue != null ? localValue : null : null,
|
|
@@ -5729,33 +5784,30 @@ var createPersistAsyncComponent = (props, performPersistAsync, schemaOnChange, o
|
|
|
5729
5784
|
abortController: new AbortController(),
|
|
5730
5785
|
errors: [],
|
|
5731
5786
|
tags,
|
|
5732
|
-
_update(updateFn) {
|
|
5733
|
-
update(this, updateFn);
|
|
5734
|
-
},
|
|
5735
5787
|
validate() {
|
|
5736
|
-
return
|
|
5788
|
+
return component.component.validate();
|
|
5737
5789
|
},
|
|
5738
5790
|
getLocalValue() {
|
|
5739
|
-
return
|
|
5791
|
+
return component.component.getLocalValue();
|
|
5740
5792
|
},
|
|
5741
5793
|
async getSubmittableValue() {
|
|
5742
|
-
return
|
|
5794
|
+
return component.persist();
|
|
5743
5795
|
},
|
|
5744
5796
|
getSubmittableValueSync() {
|
|
5745
|
-
return
|
|
5797
|
+
return component.lastResponse;
|
|
5746
5798
|
},
|
|
5747
5799
|
getSummary() {
|
|
5748
|
-
return
|
|
5800
|
+
return component.component.getSummary();
|
|
5749
5801
|
},
|
|
5750
5802
|
async persist() {
|
|
5751
|
-
const childLocalValue =
|
|
5752
|
-
if (isExactLocalValueMatch(childLocalValue,
|
|
5753
|
-
return
|
|
5803
|
+
const childLocalValue = component.component.getLocalValue();
|
|
5804
|
+
if (isExactLocalValueMatch(childLocalValue, component.lastSubmitted)) {
|
|
5805
|
+
return component.submission;
|
|
5754
5806
|
}
|
|
5755
|
-
const newAbortController = abortAndResetController(
|
|
5807
|
+
const newAbortController = abortAndResetController(component.abortController);
|
|
5756
5808
|
if (childLocalValue == null || childLocalValue === "") {
|
|
5757
5809
|
const resolvedNull = Promise.resolve(null);
|
|
5758
|
-
|
|
5810
|
+
update(component, (draft) => {
|
|
5759
5811
|
draft.abortController = newAbortController;
|
|
5760
5812
|
draft.lastResponse = null;
|
|
5761
5813
|
draft.lastSubmitted = childLocalValue;
|
|
@@ -5768,7 +5820,7 @@ var createPersistAsyncComponent = (props, performPersistAsync, schemaOnChange, o
|
|
|
5768
5820
|
}
|
|
5769
5821
|
const { signal } = newAbortController;
|
|
5770
5822
|
const newSubmission = performPersistAsync({ value: childLocalValue, signal }).then((token) => {
|
|
5771
|
-
|
|
5823
|
+
update(component, (draft) => {
|
|
5772
5824
|
draft.lastResponse = token;
|
|
5773
5825
|
draft.errors = [];
|
|
5774
5826
|
draft.status = "success";
|
|
@@ -5779,18 +5831,18 @@ var createPersistAsyncComponent = (props, performPersistAsync, schemaOnChange, o
|
|
|
5779
5831
|
if (error instanceof DOMException && error.name === "AbortError") {
|
|
5780
5832
|
return null;
|
|
5781
5833
|
}
|
|
5782
|
-
|
|
5834
|
+
update(component, (draft) => {
|
|
5783
5835
|
draft.lastResponse = null;
|
|
5784
5836
|
draft.lastSubmitted = null;
|
|
5785
5837
|
draft.submission = Promise.resolve(null);
|
|
5786
5838
|
draft.status = "error";
|
|
5787
|
-
if (
|
|
5839
|
+
if (component.component.type !== "upload") {
|
|
5788
5840
|
draft.errors = error instanceof Error ? [error.message] : [];
|
|
5789
5841
|
}
|
|
5790
5842
|
});
|
|
5791
5843
|
throw error;
|
|
5792
5844
|
});
|
|
5793
|
-
|
|
5845
|
+
update(component, (draft) => {
|
|
5794
5846
|
draft.abortController = newAbortController;
|
|
5795
5847
|
draft.lastSubmitted = childLocalValue;
|
|
5796
5848
|
draft.lastResponse = null;
|
|
@@ -5801,7 +5853,7 @@ var createPersistAsyncComponent = (props, performPersistAsync, schemaOnChange, o
|
|
|
5801
5853
|
return newSubmission;
|
|
5802
5854
|
}
|
|
5803
5855
|
};
|
|
5804
|
-
return
|
|
5856
|
+
return component;
|
|
5805
5857
|
};
|
|
5806
5858
|
|
|
5807
5859
|
// src/domain/mappers/schema/persistAsyncSchemaToComponent.ts
|
|
@@ -5840,8 +5892,8 @@ var persistAsyncSchemaToComponent = (schemaMapperProps, mapperProps) => {
|
|
|
5840
5892
|
};
|
|
5841
5893
|
|
|
5842
5894
|
// src/domain/components/DateInputComponent.ts
|
|
5843
|
-
var createDateInputComponent = (
|
|
5844
|
-
const _a =
|
|
5895
|
+
var createDateInputComponent = (props, onComponentUpdate) => {
|
|
5896
|
+
const _a = props, {
|
|
5845
5897
|
uid,
|
|
5846
5898
|
id,
|
|
5847
5899
|
checks,
|
|
@@ -5865,28 +5917,25 @@ var createDateInputComponent = (textInputProps, onComponentUpdate) => {
|
|
|
5865
5917
|
const update = getInputUpdateFunction(onComponentUpdate);
|
|
5866
5918
|
const getValidationErrors = getLocalValueValidator(checks);
|
|
5867
5919
|
const validateAsync = performValidationAsync ? getComponentValidationAsync(update, performValidationAsync) : void 0;
|
|
5868
|
-
const
|
|
5920
|
+
const component = __spreadValues({
|
|
5869
5921
|
type: "date",
|
|
5870
5922
|
kind: "input",
|
|
5871
5923
|
uid,
|
|
5872
5924
|
id,
|
|
5873
5925
|
value,
|
|
5874
|
-
_update(updateFn) {
|
|
5875
|
-
update(this, updateFn);
|
|
5876
|
-
},
|
|
5877
5926
|
onBlur() {
|
|
5878
|
-
const isValid =
|
|
5927
|
+
const isValid = component.validate();
|
|
5879
5928
|
if (isValid) {
|
|
5880
|
-
validateAsync == null ? void 0 : validateAsync(
|
|
5929
|
+
validateAsync == null ? void 0 : validateAsync(component, component.getLocalValue()).catch(() => {
|
|
5881
5930
|
});
|
|
5882
5931
|
}
|
|
5883
5932
|
},
|
|
5884
5933
|
onFocus() {
|
|
5885
5934
|
},
|
|
5886
5935
|
// Noop
|
|
5887
|
-
|
|
5888
|
-
const prevValue =
|
|
5889
|
-
|
|
5936
|
+
setValue(updatedValue) {
|
|
5937
|
+
const prevValue = component.value;
|
|
5938
|
+
update(component, (draft) => {
|
|
5890
5939
|
draft.errors = [];
|
|
5891
5940
|
draft.validationAsyncState.messages = {};
|
|
5892
5941
|
draft.value = updatedValue;
|
|
@@ -5901,29 +5950,29 @@ var createDateInputComponent = (textInputProps, onComponentUpdate) => {
|
|
|
5901
5950
|
}
|
|
5902
5951
|
},
|
|
5903
5952
|
async getSubmittableValue() {
|
|
5904
|
-
return
|
|
5953
|
+
return component.getSubmittableValueSync();
|
|
5905
5954
|
},
|
|
5906
5955
|
getSubmittableValueSync() {
|
|
5907
|
-
if (isValidDate(
|
|
5908
|
-
return
|
|
5956
|
+
if (isValidDate(component.getLocalValue())) {
|
|
5957
|
+
return component.getLocalValue();
|
|
5909
5958
|
}
|
|
5910
5959
|
return null;
|
|
5911
5960
|
},
|
|
5912
5961
|
getSummary() {
|
|
5913
|
-
return summariser(
|
|
5962
|
+
return summariser(component.getLocalValue());
|
|
5914
5963
|
},
|
|
5915
5964
|
getLocalValue() {
|
|
5916
|
-
return
|
|
5965
|
+
return component.value;
|
|
5917
5966
|
},
|
|
5918
5967
|
validate() {
|
|
5919
|
-
const errors = getValidationErrors(
|
|
5920
|
-
|
|
5968
|
+
const errors = getValidationErrors(component.getLocalValue());
|
|
5969
|
+
update(component, (draft) => {
|
|
5921
5970
|
draft.errors = errors;
|
|
5922
5971
|
});
|
|
5923
5972
|
return errors.length === 0;
|
|
5924
5973
|
}
|
|
5925
5974
|
}, rest);
|
|
5926
|
-
return
|
|
5975
|
+
return component;
|
|
5927
5976
|
};
|
|
5928
5977
|
|
|
5929
5978
|
// src/domain/mappers/utils/suggestions-utils.ts
|
|
@@ -6037,8 +6086,8 @@ var stringSchemaToUploadInputComponent = (schemaMapperProps, mapperProps) => {
|
|
|
6037
6086
|
var getFileFromModel = (model) => isString(model) ? base64dataUrltoFile(model, "") : null;
|
|
6038
6087
|
|
|
6039
6088
|
// src/domain/components/TextInputComponent.ts
|
|
6040
|
-
var createTextInputComponent = (
|
|
6041
|
-
const _a =
|
|
6089
|
+
var createTextInputComponent = (props, onComponentUpdate) => {
|
|
6090
|
+
const _a = props, {
|
|
6042
6091
|
uid,
|
|
6043
6092
|
id,
|
|
6044
6093
|
checks,
|
|
@@ -6063,17 +6112,14 @@ var createTextInputComponent = (textInputProps, onComponentUpdate) => {
|
|
|
6063
6112
|
const getValidationErrors = getLocalValueValidator(checks);
|
|
6064
6113
|
const performOnChange = getDebouncedSchemaOnChange(schemaOnChange, getValidationErrors);
|
|
6065
6114
|
const validateAsync = performValidationAsync ? getDebouncedComponentValidationAsync(update, performValidationAsync) : void 0;
|
|
6066
|
-
const
|
|
6115
|
+
const component = __spreadValues({
|
|
6067
6116
|
type: "text",
|
|
6068
6117
|
kind: "input",
|
|
6069
6118
|
uid,
|
|
6070
6119
|
id,
|
|
6071
6120
|
value,
|
|
6072
|
-
_update(updateFn) {
|
|
6073
|
-
update(this, updateFn);
|
|
6074
|
-
},
|
|
6075
6121
|
onBlur() {
|
|
6076
|
-
const isValid =
|
|
6122
|
+
const isValid = component.validate();
|
|
6077
6123
|
performOnChange == null ? void 0 : performOnChange.flush();
|
|
6078
6124
|
if (isValid) {
|
|
6079
6125
|
void (onPersistAsync == null ? void 0 : onPersistAsync().catch(() => {
|
|
@@ -6084,9 +6130,9 @@ var createTextInputComponent = (textInputProps, onComponentUpdate) => {
|
|
|
6084
6130
|
onFocus() {
|
|
6085
6131
|
},
|
|
6086
6132
|
// Noop
|
|
6087
|
-
|
|
6088
|
-
const prevValue =
|
|
6089
|
-
|
|
6133
|
+
setValue(updatedValue) {
|
|
6134
|
+
const prevValue = component.value;
|
|
6135
|
+
update(component, (draft) => {
|
|
6090
6136
|
draft.errors = [];
|
|
6091
6137
|
draft.validationAsyncState.messages = {};
|
|
6092
6138
|
draft.value = updatedValue;
|
|
@@ -6094,7 +6140,7 @@ var createTextInputComponent = (textInputProps, onComponentUpdate) => {
|
|
|
6094
6140
|
performOnChange == null ? void 0 : performOnChange(prevValue, updatedValue);
|
|
6095
6141
|
const isValid = getValidationErrors(updatedValue).length === 0;
|
|
6096
6142
|
if (isValid) {
|
|
6097
|
-
validateAsync == null ? void 0 : validateAsync(
|
|
6143
|
+
validateAsync == null ? void 0 : validateAsync(component, updatedValue);
|
|
6098
6144
|
}
|
|
6099
6145
|
if (!updatedValue) {
|
|
6100
6146
|
validateAsync == null ? void 0 : validateAsync.cancel();
|
|
@@ -6102,26 +6148,26 @@ var createTextInputComponent = (textInputProps, onComponentUpdate) => {
|
|
|
6102
6148
|
onValueChange();
|
|
6103
6149
|
},
|
|
6104
6150
|
async getSubmittableValue() {
|
|
6105
|
-
return
|
|
6151
|
+
return component.getSubmittableValueSync();
|
|
6106
6152
|
},
|
|
6107
6153
|
getSubmittableValueSync() {
|
|
6108
|
-
return
|
|
6154
|
+
return component.getLocalValue() || null;
|
|
6109
6155
|
},
|
|
6110
6156
|
getSummary() {
|
|
6111
|
-
return summariser(
|
|
6157
|
+
return summariser(component.getLocalValue());
|
|
6112
6158
|
},
|
|
6113
6159
|
getLocalValue() {
|
|
6114
|
-
return
|
|
6160
|
+
return component.value;
|
|
6115
6161
|
},
|
|
6116
6162
|
validate() {
|
|
6117
|
-
const errors = getValidationErrors(
|
|
6118
|
-
|
|
6163
|
+
const errors = getValidationErrors(component.getLocalValue());
|
|
6164
|
+
update(component, (draft) => {
|
|
6119
6165
|
draft.errors = errors;
|
|
6120
6166
|
});
|
|
6121
6167
|
return errors.length === 0;
|
|
6122
6168
|
}
|
|
6123
6169
|
}, rest);
|
|
6124
|
-
return
|
|
6170
|
+
return component;
|
|
6125
6171
|
};
|
|
6126
6172
|
|
|
6127
6173
|
// src/domain/mappers/schema/stringSchemaToComponent/stringSchemaToTextInputComponent.ts
|
|
@@ -6445,8 +6491,10 @@ var mapStepToComponent = (_a) => {
|
|
|
6445
6491
|
stepPrefetch,
|
|
6446
6492
|
step,
|
|
6447
6493
|
referencedSchemaIds,
|
|
6494
|
+
features,
|
|
6448
6495
|
onComponentUpdate,
|
|
6449
6496
|
trackEvent,
|
|
6497
|
+
logEvent,
|
|
6450
6498
|
onBehavior,
|
|
6451
6499
|
onLoad: stepOnLoad
|
|
6452
6500
|
});
|
|
@@ -6462,7 +6510,7 @@ var getReferencedSchemaId = (step) => {
|
|
|
6462
6510
|
var mapBackNavigation = (navigation, onBehavior, isNativeBackEnabled) => {
|
|
6463
6511
|
var _a;
|
|
6464
6512
|
const backNavigation = (_a = navigation == null ? void 0 : navigation.back) != null ? _a : navigation == null ? void 0 : navigation.backButton;
|
|
6465
|
-
const backBehavior = { type: "back", action: backNavigation == null ? void 0 : backNavigation.action };
|
|
6513
|
+
const backBehavior = { type: "back", action: backNavigation == null ? void 0 : backNavigation.action, track: false };
|
|
6466
6514
|
return backNavigation || isNativeBackEnabled ? {
|
|
6467
6515
|
title: backNavigation == null ? void 0 : backNavigation.title,
|
|
6468
6516
|
onClick: () => {
|
|
@@ -6678,10 +6726,10 @@ var executePoll = async (props) => {
|
|
|
6678
6726
|
}
|
|
6679
6727
|
case "modal": {
|
|
6680
6728
|
assertModalResponseBody(body);
|
|
6681
|
-
return { type: "behavior", behavior: __spreadValues({ type: "modal" }, body) };
|
|
6729
|
+
return { type: "behavior", behavior: __spreadProps(__spreadValues({ type: "modal" }, body), { track: false }) };
|
|
6682
6730
|
}
|
|
6683
6731
|
case "no-op": {
|
|
6684
|
-
return { type: "behavior", behavior: { type: "none" } };
|
|
6732
|
+
return { type: "behavior", behavior: { type: "none", track: false } };
|
|
6685
6733
|
}
|
|
6686
6734
|
case "subflow": {
|
|
6687
6735
|
assertSubflowResponseBody(body);
|
|
@@ -6706,7 +6754,8 @@ var executePoll = async (props) => {
|
|
|
6706
6754
|
};
|
|
6707
6755
|
var actionResponseBodyToBehavior = (body) => ({
|
|
6708
6756
|
type: "non-merging-action",
|
|
6709
|
-
action: body.action
|
|
6757
|
+
action: body.action,
|
|
6758
|
+
track: false
|
|
6710
6759
|
});
|
|
6711
6760
|
|
|
6712
6761
|
// src/controller/executeRefresh.ts
|
|
@@ -6761,36 +6810,30 @@ var executeRefresh = async (props) => {
|
|
|
6761
6810
|
};
|
|
6762
6811
|
|
|
6763
6812
|
// src/domain/components/SubflowComponent.ts
|
|
6764
|
-
var createSubflowComponent = (
|
|
6765
|
-
switch (
|
|
6813
|
+
var createSubflowComponent = (props, onComponentUpdate) => {
|
|
6814
|
+
switch (props.subflowType) {
|
|
6766
6815
|
case "dynamic":
|
|
6767
|
-
return createDynamicSubflowComponent(
|
|
6816
|
+
return createDynamicSubflowComponent(props, onComponentUpdate);
|
|
6768
6817
|
case "native":
|
|
6769
|
-
return createNativeSubflowComponent(
|
|
6818
|
+
return createNativeSubflowComponent(props);
|
|
6770
6819
|
}
|
|
6771
6820
|
};
|
|
6772
|
-
var createDynamicSubflowComponent = (
|
|
6821
|
+
var createDynamicSubflowComponent = (props, onComponentUpdate) => {
|
|
6773
6822
|
const update = getInputUpdateFunction(onComponentUpdate);
|
|
6774
|
-
|
|
6823
|
+
return __spreadValues({
|
|
6775
6824
|
uid: `subflow-dynamic-${getRandomId()}`,
|
|
6776
6825
|
type: "subflow",
|
|
6777
6826
|
subflowType: "dynamic",
|
|
6778
6827
|
kind: "layout"
|
|
6779
|
-
},
|
|
6780
|
-
_update(updateFn) {
|
|
6781
|
-
update(this, updateFn);
|
|
6782
|
-
}
|
|
6783
|
-
});
|
|
6784
|
-
return subflowComponent;
|
|
6828
|
+
}, props);
|
|
6785
6829
|
};
|
|
6786
|
-
var createNativeSubflowComponent = (
|
|
6787
|
-
|
|
6830
|
+
var createNativeSubflowComponent = (props) => {
|
|
6831
|
+
return __spreadValues({
|
|
6788
6832
|
uid: `subflow-native-${getRandomId()}`,
|
|
6789
6833
|
type: "subflow",
|
|
6790
6834
|
subflowType: "native",
|
|
6791
6835
|
kind: "layout"
|
|
6792
|
-
},
|
|
6793
|
-
return subflowComponent;
|
|
6836
|
+
}, props);
|
|
6794
6837
|
};
|
|
6795
6838
|
|
|
6796
6839
|
// src/controller/executeSubflow.ts
|
|
@@ -7044,6 +7087,7 @@ var createFlowController = (props) => {
|
|
|
7044
7087
|
};
|
|
7045
7088
|
const onBehavior = async (behavior) => {
|
|
7046
7089
|
var _a;
|
|
7090
|
+
trackBehaviorTriggered(trackEvent, behavior);
|
|
7047
7091
|
switch (behavior.type) {
|
|
7048
7092
|
case "download": {
|
|
7049
7093
|
try {
|
|
@@ -7646,6 +7690,28 @@ var formatDateOptions = {
|
|
|
7646
7690
|
dateStyle: "long"
|
|
7647
7691
|
};
|
|
7648
7692
|
|
|
7693
|
+
// src/renderers/mappers/utils/mapCallToAction.ts
|
|
7694
|
+
var mapCallToAction = (_a) => {
|
|
7695
|
+
var _b = _a, {
|
|
7696
|
+
hrefWithTracking
|
|
7697
|
+
} = _b, cta = __objRest(_b, [
|
|
7698
|
+
"hrefWithTracking"
|
|
7699
|
+
]);
|
|
7700
|
+
return __spreadProps(__spreadValues({}, cta), {
|
|
7701
|
+
getAnchorProps: hrefWithTracking
|
|
7702
|
+
});
|
|
7703
|
+
};
|
|
7704
|
+
var mapCallToActionOptional = (cta) => cta ? mapCallToAction(cta) : void 0;
|
|
7705
|
+
var mapAdditionalInfo2 = (info) => {
|
|
7706
|
+
if (info) {
|
|
7707
|
+
const _a = info, { hrefWithTracking } = _a, rest = __objRest(_a, ["hrefWithTracking"]);
|
|
7708
|
+
return __spreadProps(__spreadValues({}, rest), {
|
|
7709
|
+
getAnchorProps: hrefWithTracking
|
|
7710
|
+
});
|
|
7711
|
+
}
|
|
7712
|
+
return void 0;
|
|
7713
|
+
};
|
|
7714
|
+
|
|
7649
7715
|
// src/renderers/mappers/utils/pick.ts
|
|
7650
7716
|
function pick(obj, ...keys) {
|
|
7651
7717
|
const result = {};
|
|
@@ -7656,18 +7722,9 @@ function pick(obj, ...keys) {
|
|
|
7656
7722
|
}
|
|
7657
7723
|
|
|
7658
7724
|
// src/renderers/mappers/alertComponentToProps.ts
|
|
7659
|
-
var alertComponentToProps = (component, rendererMapperProps) => __spreadValues(__spreadValues({}, pick(
|
|
7660
|
-
component
|
|
7661
|
-
|
|
7662
|
-
"analyticsId",
|
|
7663
|
-
"type",
|
|
7664
|
-
"callToAction",
|
|
7665
|
-
"context",
|
|
7666
|
-
"control",
|
|
7667
|
-
"margin",
|
|
7668
|
-
"markdown",
|
|
7669
|
-
"tags"
|
|
7670
|
-
)), rendererMapperProps);
|
|
7725
|
+
var alertComponentToProps = (component, rendererMapperProps) => __spreadValues(__spreadProps(__spreadValues({}, pick(component, "uid", "analyticsId", "type", "context", "control", "margin", "markdown", "tags")), {
|
|
7726
|
+
callToAction: mapCallToActionOptional(component.callToAction)
|
|
7727
|
+
}), rendererMapperProps);
|
|
7671
7728
|
|
|
7672
7729
|
// src/renderers/mappers/allOfComponentToProps.ts
|
|
7673
7730
|
var allOfComponentToProps = (component, rendererMapperProps) => {
|
|
@@ -7719,48 +7776,32 @@ var getValidationState = (errors, validationAsyncState) => {
|
|
|
7719
7776
|
// src/renderers/mappers/utils/inputComponentToProps.ts
|
|
7720
7777
|
var inputComponentToProps = (component, type) => {
|
|
7721
7778
|
var _a;
|
|
7722
|
-
const {
|
|
7723
|
-
uid,
|
|
7724
|
-
analyticsId,
|
|
7725
|
-
control,
|
|
7726
|
-
description,
|
|
7727
|
-
disabled,
|
|
7728
|
-
errors,
|
|
7729
|
-
help,
|
|
7730
|
-
id,
|
|
7731
|
-
media,
|
|
7732
|
-
placeholder,
|
|
7733
|
-
required,
|
|
7734
|
-
title,
|
|
7735
|
-
tags,
|
|
7736
|
-
validationAsyncState,
|
|
7737
|
-
inlineAlert,
|
|
7738
|
-
onBlur,
|
|
7739
|
-
onFocus
|
|
7740
|
-
} = component;
|
|
7779
|
+
const { errors, validationAsyncState } = component;
|
|
7741
7780
|
const { messages } = validationAsyncState != null ? validationAsyncState : {};
|
|
7742
|
-
return {
|
|
7743
|
-
|
|
7744
|
-
|
|
7781
|
+
return __spreadProps(__spreadValues({}, pick(
|
|
7782
|
+
component,
|
|
7783
|
+
"uid",
|
|
7784
|
+
"analyticsId",
|
|
7785
|
+
"control",
|
|
7786
|
+
"description",
|
|
7787
|
+
"disabled",
|
|
7788
|
+
"help",
|
|
7789
|
+
"id",
|
|
7790
|
+
"media",
|
|
7791
|
+
"placeholder",
|
|
7792
|
+
"required",
|
|
7793
|
+
"title",
|
|
7794
|
+
"tags",
|
|
7795
|
+
"inlineAlert",
|
|
7796
|
+
"onBlur",
|
|
7797
|
+
"onFocus"
|
|
7798
|
+
)), {
|
|
7745
7799
|
type,
|
|
7746
|
-
control,
|
|
7747
|
-
description,
|
|
7748
|
-
disabled,
|
|
7749
7800
|
error: (_a = messages == null ? void 0 : messages.error) != null ? _a : errors == null ? void 0 : errors[0],
|
|
7750
|
-
help,
|
|
7751
|
-
id,
|
|
7752
|
-
media,
|
|
7753
|
-
placeholder,
|
|
7754
|
-
required,
|
|
7755
|
-
title,
|
|
7756
|
-
tags,
|
|
7757
7801
|
value: component.getLocalValue(),
|
|
7758
7802
|
validationState: getValidationState(errors, validationAsyncState),
|
|
7759
|
-
|
|
7760
|
-
|
|
7761
|
-
onBlur: onBlur.bind(component),
|
|
7762
|
-
onFocus: onFocus.bind(component)
|
|
7763
|
-
};
|
|
7803
|
+
fieldLoadingState: getFieldLoadingState(component)
|
|
7804
|
+
});
|
|
7764
7805
|
};
|
|
7765
7806
|
var getFieldLoadingState = (component) => {
|
|
7766
7807
|
const { validationAsyncState } = component;
|
|
@@ -7773,12 +7814,9 @@ var getFieldLoadingState = (component) => {
|
|
|
7773
7814
|
// src/renderers/mappers/booleanInputComponentToProps.ts
|
|
7774
7815
|
var booleanInputComponentToProps = (component, rendererMapperProps) => {
|
|
7775
7816
|
var _a;
|
|
7776
|
-
return __spreadProps(__spreadValues(__spreadValues({}, inputComponentToProps(component, "input-checkbox")), rendererMapperProps), {
|
|
7777
|
-
|
|
7778
|
-
|
|
7779
|
-
inlineAlert: component.inlineAlert,
|
|
7780
|
-
value: (_a = component.value) != null ? _a : false,
|
|
7781
|
-
onChange: component.onChange.bind(component)
|
|
7817
|
+
return __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, inputComponentToProps(component, "input-checkbox")), rendererMapperProps), pick(component, "additionalText", "supportingValues", "inlineAlert")), {
|
|
7818
|
+
onChange: component.setValue,
|
|
7819
|
+
value: (_a = component.value) != null ? _a : false
|
|
7782
7820
|
});
|
|
7783
7821
|
};
|
|
7784
7822
|
|
|
@@ -7827,30 +7865,14 @@ var buttonComponentToProps = (component, rendererMapperProps) => {
|
|
|
7827
7865
|
};
|
|
7828
7866
|
|
|
7829
7867
|
// src/renderers/mappers/columnsComponentToProps.ts
|
|
7830
|
-
var columnsComponentToProps = ({
|
|
7831
|
-
|
|
7832
|
-
analyticsId,
|
|
7833
|
-
bias,
|
|
7834
|
-
control,
|
|
7835
|
-
margin,
|
|
7836
|
-
tags,
|
|
7837
|
-
startComponents,
|
|
7838
|
-
endComponents
|
|
7839
|
-
}, rendererMapperProps) => {
|
|
7840
|
-
const startChildrenProps = startComponents.map(
|
|
7868
|
+
var columnsComponentToProps = (component, rendererMapperProps) => {
|
|
7869
|
+
const startChildrenProps = component.startComponents.map(
|
|
7841
7870
|
(c) => componentToRendererProps(c, rendererMapperProps)
|
|
7842
7871
|
);
|
|
7843
|
-
const endChildrenProps = endComponents.map(
|
|
7872
|
+
const endChildrenProps = component.endComponents.map(
|
|
7844
7873
|
(c) => componentToRendererProps(c, rendererMapperProps)
|
|
7845
7874
|
);
|
|
7846
|
-
return __spreadProps(__spreadValues({}, rendererMapperProps), {
|
|
7847
|
-
uid,
|
|
7848
|
-
analyticsId,
|
|
7849
|
-
type: "columns",
|
|
7850
|
-
bias,
|
|
7851
|
-
control,
|
|
7852
|
-
margin,
|
|
7853
|
-
tags,
|
|
7875
|
+
return __spreadProps(__spreadValues(__spreadValues({}, rendererMapperProps), pick(component, "uid", "analyticsId", "type", "bias", "control", "margin", "tags")), {
|
|
7854
7876
|
startChildren: startChildrenProps.map(rendererMapperProps.render),
|
|
7855
7877
|
endChildren: endChildrenProps.map(rendererMapperProps.render),
|
|
7856
7878
|
startChildrenProps,
|
|
@@ -7874,29 +7896,24 @@ var constComponentToProps = (component, rendererMapperProps) => {
|
|
|
7874
7896
|
// src/renderers/mappers/containerComponentToProps.ts
|
|
7875
7897
|
var containerComponentToProps = (component, rendererMapperProps) => {
|
|
7876
7898
|
const childrenProps = component.getChildren().map((c) => componentToRendererProps(c, rendererMapperProps));
|
|
7877
|
-
return __spreadValues({
|
|
7878
|
-
type: "container",
|
|
7879
|
-
uid: component.uid,
|
|
7899
|
+
return __spreadValues(__spreadProps(__spreadValues({}, pick(component, "type", "uid")), {
|
|
7880
7900
|
children: childrenProps.map(rendererMapperProps.render),
|
|
7881
7901
|
childrenProps
|
|
7882
|
-
}, rendererMapperProps);
|
|
7902
|
+
}), rendererMapperProps);
|
|
7883
7903
|
};
|
|
7884
7904
|
|
|
7885
7905
|
// src/renderers/mappers/dateInputComponentToProps.ts
|
|
7886
|
-
var dateInputComponentToProps = (component, rendererMapperProps) => __spreadProps(__spreadValues(__spreadValues({}, inputComponentToProps(component, "input-date")), rendererMapperProps), {
|
|
7887
|
-
|
|
7888
|
-
minimumDate: component.minimumDate,
|
|
7889
|
-
maximumDate: component.maximumDate,
|
|
7890
|
-
suggestions: component.suggestions,
|
|
7891
|
-
onChange: component.onChange.bind(component)
|
|
7906
|
+
var dateInputComponentToProps = (component, rendererMapperProps) => __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, inputComponentToProps(component, "input-date")), rendererMapperProps), pick(component, "autoComplete", "minimumDate", "maximumDate", "suggestions")), {
|
|
7907
|
+
onChange: component.setValue
|
|
7892
7908
|
});
|
|
7893
7909
|
|
|
7894
7910
|
// src/renderers/mappers/decisionComponentToProps.ts
|
|
7895
7911
|
var decisionComponentToProps = (component, rendererMapperProps) => __spreadProps(__spreadValues(__spreadValues({}, pick(component, "uid", "analyticsId", "type", "control", "margin", "title", "tags")), rendererMapperProps), {
|
|
7896
7912
|
options: component.options.map((_a) => {
|
|
7897
|
-
var _b = _a, { disabled } = _b,
|
|
7898
|
-
return __spreadProps(__spreadValues({},
|
|
7899
|
-
disabled: disabled || rendererMapperProps.stepLoadingState !== "idle"
|
|
7913
|
+
var _b = _a, { disabled } = _b, option = __objRest(_b, ["disabled"]);
|
|
7914
|
+
return __spreadProps(__spreadValues({}, option), {
|
|
7915
|
+
disabled: disabled || rendererMapperProps.stepLoadingState !== "idle",
|
|
7916
|
+
getAnchorProps: option.hrefWithTracking
|
|
7900
7917
|
});
|
|
7901
7918
|
})
|
|
7902
7919
|
});
|
|
@@ -7906,14 +7923,11 @@ var dividerComponentToProps = (component, rendererMapperProps) => __spreadValues
|
|
|
7906
7923
|
|
|
7907
7924
|
// src/renderers/mappers/externalComponentToProps.ts
|
|
7908
7925
|
var externalComponentToProps = (component, rendererMapperProps) => {
|
|
7909
|
-
return __spreadValues({
|
|
7910
|
-
type: "external-confirmation"
|
|
7911
|
-
|
|
7912
|
-
|
|
7913
|
-
|
|
7914
|
-
open: component.open.bind(component),
|
|
7915
|
-
onCancel: component.onCancel.bind(component)
|
|
7916
|
-
}, rendererMapperProps);
|
|
7926
|
+
return __spreadValues(__spreadProps(__spreadValues({
|
|
7927
|
+
type: "external-confirmation"
|
|
7928
|
+
}, pick(component, "uid", "url", "open", "onCancel")), {
|
|
7929
|
+
visible: component.status === "failure"
|
|
7930
|
+
}), rendererMapperProps);
|
|
7917
7931
|
};
|
|
7918
7932
|
|
|
7919
7933
|
// src/renderers/mappers/formattedValueComponentToProps.ts
|
|
@@ -7934,25 +7948,18 @@ var formattedValueComponentToProps = (component, rendererMapperProps) => {
|
|
|
7934
7948
|
// for now, we don't want to pass `value` down to the renderer to avoid the "WhateverComponent".
|
|
7935
7949
|
// 'value',
|
|
7936
7950
|
)), {
|
|
7937
|
-
|
|
7938
|
-
|
|
7951
|
+
onChange: component.setValue,
|
|
7952
|
+
validationState: getValidationState(component.errors, void 0)
|
|
7939
7953
|
}), rendererMapperProps);
|
|
7940
7954
|
};
|
|
7941
7955
|
|
|
7942
7956
|
// src/renderers/mappers/formComponentToProps.ts
|
|
7943
7957
|
var formComponentToProps = (component, rendererMapperProps) => {
|
|
7944
7958
|
const childrenProps = component.getChildren().map((c) => componentToRendererProps(c, rendererMapperProps));
|
|
7945
|
-
|
|
7946
|
-
return __spreadValues({
|
|
7947
|
-
uid,
|
|
7948
|
-
analyticsId,
|
|
7949
|
-
type: "form",
|
|
7959
|
+
return __spreadValues(__spreadProps(__spreadValues({}, pick(component, "uid", "analyticsId", "type", "control", "margin", "tags")), {
|
|
7950
7960
|
children: childrenProps.map(rendererMapperProps.render),
|
|
7951
|
-
childrenProps
|
|
7952
|
-
|
|
7953
|
-
margin,
|
|
7954
|
-
tags
|
|
7955
|
-
}, rendererMapperProps);
|
|
7961
|
+
childrenProps
|
|
7962
|
+
}), rendererMapperProps);
|
|
7956
7963
|
};
|
|
7957
7964
|
|
|
7958
7965
|
// src/renderers/mappers/headingComponentToProps.ts
|
|
@@ -7985,26 +7992,18 @@ var imageComponentToProps = (component, rendererMapperProps) => __spreadProps(__
|
|
|
7985
7992
|
var instructionsComponentToProps = (component, rendererMapperProps) => __spreadValues(__spreadValues({}, pick(component, "uid", "analyticsId", "type", "control", "items", "margin", "title", "tags")), rendererMapperProps);
|
|
7986
7993
|
|
|
7987
7994
|
// src/renderers/mappers/integerInputComponentToProps.ts
|
|
7988
|
-
var integerInputComponentToProps = (component, rendererMapperProps) => __spreadProps(__spreadValues(__spreadValues({}, inputComponentToProps(component, "input-integer")), rendererMapperProps), {
|
|
7989
|
-
|
|
7990
|
-
maximum: component.maximum,
|
|
7991
|
-
minimum: component.minimum,
|
|
7992
|
-
onChange: component.onChange.bind(component)
|
|
7995
|
+
var integerInputComponentToProps = (component, rendererMapperProps) => __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, inputComponentToProps(component, "input-integer")), rendererMapperProps), pick(component, "autoComplete", "maximum", "minimum")), {
|
|
7996
|
+
onChange: component.setValue
|
|
7993
7997
|
});
|
|
7994
7998
|
|
|
7995
7999
|
// src/renderers/mappers/listComponentToProps.ts
|
|
7996
|
-
var listComponentToProps = (component, rendererMapperProps) => __spreadValues(__spreadValues({}, pick(
|
|
7997
|
-
component,
|
|
7998
|
-
|
|
7999
|
-
|
|
8000
|
-
|
|
8001
|
-
|
|
8002
|
-
|
|
8003
|
-
"items",
|
|
8004
|
-
"margin",
|
|
8005
|
-
"title",
|
|
8006
|
-
"tags"
|
|
8007
|
-
)), rendererMapperProps);
|
|
8000
|
+
var listComponentToProps = (component, rendererMapperProps) => __spreadValues(__spreadProps(__spreadValues({}, pick(component, "uid", "analyticsId", "type", "control", "margin", "title", "tags")), {
|
|
8001
|
+
callToAction: mapCallToActionOptional(component.callToAction),
|
|
8002
|
+
items: component.items.map((item) => __spreadProps(__spreadValues({}, item), {
|
|
8003
|
+
callToAction: mapCallToActionOptional(item.callToAction),
|
|
8004
|
+
additionalInfo: mapAdditionalInfo2(item.additionalInfo)
|
|
8005
|
+
}))
|
|
8006
|
+
}), rendererMapperProps);
|
|
8008
8007
|
|
|
8009
8008
|
// src/renderers/mappers/loadingIndicatorComponentToProps.ts
|
|
8010
8009
|
var loadingIndicatorComponentToProps = (component, rendererMapperProps) => __spreadValues(__spreadValues({}, pick(component, "uid", "analyticsId", "type", "control", "margin", "size", "tags")), rendererMapperProps);
|
|
@@ -8028,39 +8027,25 @@ var mediaComponentToProps = (component, rendererMapperProps) => __spreadValues(_
|
|
|
8028
8027
|
|
|
8029
8028
|
// src/renderers/mappers/modalComponentToProps.ts
|
|
8030
8029
|
var modalComponentToProps = (component, rendererMapperProps) => {
|
|
8031
|
-
const { uid, analyticsId, open, tags, title, close } = component;
|
|
8032
8030
|
const childrenProps = component.getChildren().map((c) => componentToRendererProps(c, rendererMapperProps));
|
|
8033
|
-
return __spreadValues({
|
|
8034
|
-
uid,
|
|
8035
|
-
analyticsId,
|
|
8036
|
-
type: "modal",
|
|
8037
|
-
open,
|
|
8038
|
-
tags,
|
|
8039
|
-
title,
|
|
8031
|
+
return __spreadValues(__spreadProps(__spreadValues({}, pick(component, "uid", "analyticsId", "type", "open", "tags", "title")), {
|
|
8040
8032
|
children: childrenProps.map(rendererMapperProps.render),
|
|
8041
8033
|
childrenProps,
|
|
8042
|
-
onClose: close
|
|
8043
|
-
}, rendererMapperProps);
|
|
8034
|
+
onClose: component.close
|
|
8035
|
+
}), rendererMapperProps);
|
|
8044
8036
|
};
|
|
8045
8037
|
|
|
8046
8038
|
// src/renderers/mappers/modalLayoutComponentToProps.ts
|
|
8047
8039
|
var modalLayoutComponentToProps = (component, rendererMapperProps) => {
|
|
8048
|
-
const {
|
|
8040
|
+
const { content } = component;
|
|
8049
8041
|
const childrenProps = component.getChildren().map((c) => componentToRendererProps(c, rendererMapperProps));
|
|
8050
|
-
return __spreadValues({
|
|
8051
|
-
uid,
|
|
8052
|
-
analyticsId,
|
|
8053
|
-
type: "modal-layout",
|
|
8042
|
+
return __spreadValues(__spreadProps(__spreadValues({}, pick(component, "uid", "analyticsId", "type", "control", "margin", "tags", "trigger")), {
|
|
8054
8043
|
content: {
|
|
8055
8044
|
children: childrenProps.map(rendererMapperProps.render),
|
|
8056
8045
|
childrenProps,
|
|
8057
8046
|
title: content.title
|
|
8058
|
-
}
|
|
8059
|
-
|
|
8060
|
-
margin,
|
|
8061
|
-
tags,
|
|
8062
|
-
trigger
|
|
8063
|
-
}, rendererMapperProps);
|
|
8047
|
+
}
|
|
8048
|
+
}), rendererMapperProps);
|
|
8064
8049
|
};
|
|
8065
8050
|
|
|
8066
8051
|
// src/renderers/mappers/moneyInputComponentToProps.ts
|
|
@@ -8087,8 +8072,8 @@ var moneyInputComponentToProps = (component, rendererMapperProps) => {
|
|
|
8087
8072
|
return __spreadValues(__spreadProps(__spreadValues({}, inputComponentToProps(component, "money-input")), {
|
|
8088
8073
|
amountValue: amountComponent.getLocalValue(),
|
|
8089
8074
|
selectedCurrencyIndex: currencyComponent.selectedIndex,
|
|
8090
|
-
onAmountChange: amountComponent.
|
|
8091
|
-
onCurrencyChange: currencyComponent.
|
|
8075
|
+
onAmountChange: amountComponent.setValue,
|
|
8076
|
+
onCurrencyChange: currencyComponent.selectIndex,
|
|
8092
8077
|
placeholder: amountComponent.placeholder,
|
|
8093
8078
|
currencies,
|
|
8094
8079
|
validationState
|
|
@@ -8120,47 +8105,42 @@ var selectInputOptionsToProps = (options, children, rendererMapperProps) => {
|
|
|
8120
8105
|
|
|
8121
8106
|
// src/renderers/mappers/multiSelectComponentToProps.ts
|
|
8122
8107
|
var multiSelectInputComponentToProps = (component, rendererMapperProps) => {
|
|
8123
|
-
const { autoComplete, maxItems, minItems, selectedIndices, onSelect } = component;
|
|
8124
8108
|
const _a = inputComponentToProps(component, "input-multi-select"), { required, value } = _a, props = __objRest(_a, ["required", "value"]);
|
|
8125
8109
|
const options = selectInputOptionsToProps(
|
|
8126
8110
|
component.options,
|
|
8127
8111
|
component.getChildren(),
|
|
8128
8112
|
rendererMapperProps
|
|
8129
8113
|
);
|
|
8130
|
-
return __spreadProps(__spreadValues(__spreadValues({}, props), rendererMapperProps), {
|
|
8131
|
-
|
|
8132
|
-
|
|
8133
|
-
minItems,
|
|
8134
|
-
options,
|
|
8135
|
-
selectedIndices,
|
|
8136
|
-
onSelect: onSelect.bind(component)
|
|
8114
|
+
return __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, props), rendererMapperProps), pick(component, "autoComplete", "maxItems", "minItems", "selectedIndices")), {
|
|
8115
|
+
onSelect: component.selectIndices,
|
|
8116
|
+
options
|
|
8137
8117
|
});
|
|
8138
8118
|
};
|
|
8139
8119
|
|
|
8140
8120
|
// src/renderers/mappers/multiUploadInputComponentToProps.ts
|
|
8141
8121
|
var multiUploadInputComponentToProps = (component, rendererMapperProps) => {
|
|
8142
|
-
const {
|
|
8143
|
-
return __spreadProps(__spreadValues(__spreadValues({}, inputComponentToProps(component, "input-upload-multi")), rendererMapperProps),
|
|
8144
|
-
|
|
8145
|
-
|
|
8146
|
-
|
|
8147
|
-
|
|
8148
|
-
|
|
8149
|
-
|
|
8150
|
-
|
|
8122
|
+
const { files } = component;
|
|
8123
|
+
return __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, inputComponentToProps(component, "input-upload-multi")), rendererMapperProps), pick(
|
|
8124
|
+
component,
|
|
8125
|
+
"accepts",
|
|
8126
|
+
"cameraConfig",
|
|
8127
|
+
"maxSize",
|
|
8128
|
+
"minItems",
|
|
8129
|
+
"maxItems",
|
|
8130
|
+
"source",
|
|
8131
|
+
"uploadLabel"
|
|
8132
|
+
)), {
|
|
8151
8133
|
value: files.map((file) => __spreadProps(__spreadValues({}, file), {
|
|
8152
8134
|
validationState: mapErrorsToValidationState(file.errors)
|
|
8153
8135
|
})),
|
|
8154
|
-
onInsertFile: component.
|
|
8155
|
-
onRemoveFile: component.
|
|
8136
|
+
onInsertFile: component.insertFile,
|
|
8137
|
+
onRemoveFile: component.removeFile
|
|
8156
8138
|
});
|
|
8157
8139
|
};
|
|
8158
8140
|
|
|
8159
8141
|
// src/renderers/mappers/numberInputComponentToProps.ts
|
|
8160
|
-
var numberInputComponentToProps = (component, rendererMapperProps) => __spreadProps(__spreadValues(__spreadValues({}, inputComponentToProps(component, "input-number")), rendererMapperProps), {
|
|
8161
|
-
|
|
8162
|
-
minimum: component.minimum,
|
|
8163
|
-
onChange: component.onChange.bind(component)
|
|
8142
|
+
var numberInputComponentToProps = (component, rendererMapperProps) => __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, inputComponentToProps(component, "input-number")), rendererMapperProps), pick(component, "maximum", "minimum")), {
|
|
8143
|
+
onChange: component.setValue
|
|
8164
8144
|
});
|
|
8165
8145
|
|
|
8166
8146
|
// src/renderers/mappers/objectComponentToProps.ts
|
|
@@ -8225,27 +8205,7 @@ var progressComponentToProps = (component, rendererMapperProps) => __spreadValue
|
|
|
8225
8205
|
|
|
8226
8206
|
// src/renderers/mappers/repeatableComponentToProps.ts
|
|
8227
8207
|
var repeatableComponentToProps = (component, rendererMapperProps) => {
|
|
8228
|
-
const {
|
|
8229
|
-
uid,
|
|
8230
|
-
analyticsId,
|
|
8231
|
-
addItemTitle,
|
|
8232
|
-
control,
|
|
8233
|
-
components,
|
|
8234
|
-
description,
|
|
8235
|
-
editableComponent,
|
|
8236
|
-
editItemTitle,
|
|
8237
|
-
errors,
|
|
8238
|
-
maxItems,
|
|
8239
|
-
media,
|
|
8240
|
-
minItems,
|
|
8241
|
-
summaryDefaults,
|
|
8242
|
-
title = "",
|
|
8243
|
-
tags,
|
|
8244
|
-
onEdit,
|
|
8245
|
-
onAdd,
|
|
8246
|
-
onSave,
|
|
8247
|
-
onRemove
|
|
8248
|
-
} = component;
|
|
8208
|
+
const { components, editableComponent, errors, summaryDefaults, title = "" } = component;
|
|
8249
8209
|
const childrenProps = component.getChildren().map((c) => componentToRendererProps(c, rendererMapperProps));
|
|
8250
8210
|
const editableItemProps = editableComponent ? componentToRendererProps(editableComponent, rendererMapperProps) : null;
|
|
8251
8211
|
const getSummary = (componentSummary) => {
|
|
@@ -8259,75 +8219,63 @@ var repeatableComponentToProps = (component, rendererMapperProps) => {
|
|
|
8259
8219
|
const itemProps = components.map((childComponent) => __spreadProps(__spreadValues({}, getSummary(childComponent.getSummary())), {
|
|
8260
8220
|
id: `${childComponent.uid}-summary`
|
|
8261
8221
|
}));
|
|
8262
|
-
return __spreadValues({
|
|
8263
|
-
uid,
|
|
8264
|
-
analyticsId,
|
|
8222
|
+
return __spreadValues(__spreadProps(__spreadValues({
|
|
8265
8223
|
type: "repeatable",
|
|
8224
|
+
title
|
|
8225
|
+
}, pick(
|
|
8226
|
+
component,
|
|
8227
|
+
"control",
|
|
8228
|
+
"description",
|
|
8229
|
+
"media",
|
|
8230
|
+
"tags",
|
|
8231
|
+
"uid",
|
|
8232
|
+
"analyticsId",
|
|
8233
|
+
"editItemTitle",
|
|
8234
|
+
"addItemTitle",
|
|
8235
|
+
"maxItems",
|
|
8236
|
+
"minItems"
|
|
8237
|
+
)), {
|
|
8266
8238
|
children: childrenProps.map(rendererMapperProps.render),
|
|
8267
8239
|
childrenProps,
|
|
8268
|
-
addItemTitle,
|
|
8269
|
-
control,
|
|
8270
|
-
description,
|
|
8271
8240
|
editableItem: rendererMapperProps.render(editableItemProps),
|
|
8272
8241
|
editableItemProps,
|
|
8273
|
-
editItemTitle,
|
|
8274
8242
|
items: itemProps,
|
|
8275
|
-
maxItems,
|
|
8276
|
-
media,
|
|
8277
|
-
minItems,
|
|
8278
|
-
title,
|
|
8279
|
-
tags,
|
|
8280
8243
|
validationState: mapErrorsToValidationState(errors),
|
|
8281
|
-
onAdd:
|
|
8282
|
-
onEdit:
|
|
8283
|
-
|
|
8284
|
-
|
|
8285
|
-
}, rendererMapperProps);
|
|
8244
|
+
onAdd: component.addComponent,
|
|
8245
|
+
onEdit: component.editComponent,
|
|
8246
|
+
onRemove: component.removeComponent,
|
|
8247
|
+
onSave: component.saveComponent
|
|
8248
|
+
}), rendererMapperProps);
|
|
8286
8249
|
};
|
|
8287
8250
|
|
|
8288
8251
|
// src/renderers/mappers/reviewComponentToProps.ts
|
|
8289
|
-
var reviewComponentToProps = (component, rendererMapperProps) => __spreadValues(__spreadValues({}, pick(
|
|
8290
|
-
component,
|
|
8291
|
-
|
|
8292
|
-
|
|
8293
|
-
|
|
8294
|
-
|
|
8295
|
-
|
|
8296
|
-
"fields",
|
|
8297
|
-
"margin",
|
|
8298
|
-
"title",
|
|
8299
|
-
"tags"
|
|
8300
|
-
)), rendererMapperProps);
|
|
8252
|
+
var reviewComponentToProps = (component, rendererMapperProps) => __spreadValues(__spreadProps(__spreadValues({}, pick(component, "uid", "analyticsId", "type", "control", "margin", "title", "tags")), {
|
|
8253
|
+
callToAction: mapCallToActionOptional(component.callToAction),
|
|
8254
|
+
fields: component.fields.map((field) => __spreadProps(__spreadValues({}, field), {
|
|
8255
|
+
callToAction: mapCallToActionOptional(field.callToAction),
|
|
8256
|
+
additionalInfo: mapAdditionalInfo2(field.additionalInfo)
|
|
8257
|
+
}))
|
|
8258
|
+
}), rendererMapperProps);
|
|
8301
8259
|
|
|
8302
8260
|
// src/renderers/mappers/searchComponentToProps.ts
|
|
8303
8261
|
var searchComponentToProps = (component, rendererMapperProps) => {
|
|
8304
|
-
const { uid,
|
|
8305
|
-
const onChange = component.onChange.bind(component);
|
|
8306
|
-
const onSelect = component.onSelect.bind(component);
|
|
8262
|
+
const { uid, emptyMessage, error, query, setQuery, selectResult } = component;
|
|
8307
8263
|
const state = getSearchState({
|
|
8308
8264
|
emptyMessage,
|
|
8309
8265
|
error,
|
|
8310
|
-
isLoading,
|
|
8266
|
+
isLoading: component.isLoading,
|
|
8311
8267
|
query,
|
|
8312
8268
|
state: component.state,
|
|
8313
8269
|
rendererMapperProps,
|
|
8314
|
-
|
|
8315
|
-
|
|
8270
|
+
setQuery,
|
|
8271
|
+
selectResult
|
|
8316
8272
|
});
|
|
8317
|
-
return __spreadValues({
|
|
8318
|
-
|
|
8273
|
+
return __spreadValues(__spreadProps(__spreadValues({}, pick(component, "uid", "control", "hint", "isLoading", "margin", "query", "title", "tags")), {
|
|
8274
|
+
onChange: setQuery,
|
|
8319
8275
|
type: "search",
|
|
8320
8276
|
id: uid,
|
|
8321
|
-
|
|
8322
|
-
|
|
8323
|
-
isLoading,
|
|
8324
|
-
margin,
|
|
8325
|
-
query,
|
|
8326
|
-
state,
|
|
8327
|
-
title,
|
|
8328
|
-
tags,
|
|
8329
|
-
onChange
|
|
8330
|
-
}, rendererMapperProps);
|
|
8277
|
+
state
|
|
8278
|
+
}), rendererMapperProps);
|
|
8331
8279
|
};
|
|
8332
8280
|
var getSearchState = ({
|
|
8333
8281
|
emptyMessage,
|
|
@@ -8336,14 +8284,14 @@ var getSearchState = ({
|
|
|
8336
8284
|
query,
|
|
8337
8285
|
state,
|
|
8338
8286
|
rendererMapperProps,
|
|
8339
|
-
|
|
8340
|
-
|
|
8287
|
+
setQuery,
|
|
8288
|
+
selectResult
|
|
8341
8289
|
}) => {
|
|
8342
8290
|
if (isLoading) {
|
|
8343
8291
|
return { type: "pending" };
|
|
8344
8292
|
}
|
|
8345
8293
|
if (error) {
|
|
8346
|
-
return { type: "error", onRetry: () =>
|
|
8294
|
+
return { type: "error", onRetry: () => setQuery(query) };
|
|
8347
8295
|
}
|
|
8348
8296
|
if (!state) {
|
|
8349
8297
|
return { type: "noResults", message: emptyMessage };
|
|
@@ -8370,7 +8318,7 @@ var getSearchState = ({
|
|
|
8370
8318
|
id: result.type === "action" ? (_a = result.value.id) != null ? _a : result.value.$id : void 0,
|
|
8371
8319
|
image: mapSpecImage(result.image),
|
|
8372
8320
|
media: getDomainLayerMedia(result),
|
|
8373
|
-
onClick: () =>
|
|
8321
|
+
onClick: () => selectResult(result)
|
|
8374
8322
|
});
|
|
8375
8323
|
})
|
|
8376
8324
|
};
|
|
@@ -8381,17 +8329,9 @@ var sectionComponentToProps = (component, rendererMapperProps) => {
|
|
|
8381
8329
|
const childrenProps = component.components.map(
|
|
8382
8330
|
(c) => componentToRendererProps(c, rendererMapperProps)
|
|
8383
8331
|
);
|
|
8384
|
-
return __spreadProps(__spreadValues(__spreadValues({}, pick(
|
|
8385
|
-
component
|
|
8386
|
-
|
|
8387
|
-
"analyticsId",
|
|
8388
|
-
"type",
|
|
8389
|
-
"title",
|
|
8390
|
-
"margin",
|
|
8391
|
-
"control",
|
|
8392
|
-
"callToAction",
|
|
8393
|
-
"tags"
|
|
8394
|
-
)), rendererMapperProps), {
|
|
8332
|
+
return __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, pick(component, "uid", "analyticsId", "type", "title", "margin", "control", "tags")), {
|
|
8333
|
+
callToAction: mapCallToActionOptional(component.callToAction)
|
|
8334
|
+
}), rendererMapperProps), {
|
|
8395
8335
|
children: childrenProps.map(rendererMapperProps.render),
|
|
8396
8336
|
childrenProps
|
|
8397
8337
|
});
|
|
@@ -8400,7 +8340,7 @@ var sectionComponentToProps = (component, rendererMapperProps) => {
|
|
|
8400
8340
|
// src/renderers/mappers/selectInputComponentToProps.ts
|
|
8401
8341
|
var selectInputComponentToProps = (component, rendererMapperProps) => {
|
|
8402
8342
|
var _b;
|
|
8403
|
-
const { autoComplete, selectedIndex,
|
|
8343
|
+
const { autoComplete, selectedIndex, selectIndex } = component;
|
|
8404
8344
|
const selectedChild = component.getSelectedChild();
|
|
8405
8345
|
const childrenProps = selectedChild ? componentToRendererProps(selectedChild, rendererMapperProps) : null;
|
|
8406
8346
|
const _a = inputComponentToProps(component, "input-select"), { value } = _a, props = __objRest(_a, ["value"]);
|
|
@@ -8412,7 +8352,7 @@ var selectInputComponentToProps = (component, rendererMapperProps) => {
|
|
|
8412
8352
|
if (options.length === 1 && ((_b = options[0].childrenProps) == null ? void 0 : _b.type) === "form-section") {
|
|
8413
8353
|
if (selectedIndex == null) {
|
|
8414
8354
|
rendererMapperProps.trackEvent("OneOf Option Selected - Auto-select single-option", {});
|
|
8415
|
-
|
|
8355
|
+
selectIndex(0);
|
|
8416
8356
|
}
|
|
8417
8357
|
return options[0].childrenProps;
|
|
8418
8358
|
}
|
|
@@ -8420,14 +8360,18 @@ var selectInputComponentToProps = (component, rendererMapperProps) => {
|
|
|
8420
8360
|
autoComplete,
|
|
8421
8361
|
options,
|
|
8422
8362
|
selectedIndex,
|
|
8423
|
-
onSelect:
|
|
8363
|
+
onSelect: component.selectIndex,
|
|
8424
8364
|
children: rendererMapperProps.render(childrenProps),
|
|
8425
8365
|
childrenProps
|
|
8426
8366
|
});
|
|
8427
8367
|
};
|
|
8428
8368
|
|
|
8429
8369
|
// src/renderers/mappers/statusListComponentToProps.ts
|
|
8430
|
-
var statusListComponentToProps = (component, rendererMapperProps) => __spreadValues(__spreadValues({}, pick(component, "uid", "analyticsId", "type", "control", "
|
|
8370
|
+
var statusListComponentToProps = (component, rendererMapperProps) => __spreadValues(__spreadProps(__spreadValues({}, pick(component, "uid", "analyticsId", "type", "control", "margin", "title", "tags")), {
|
|
8371
|
+
items: component.items.map((item) => __spreadProps(__spreadValues({}, item), {
|
|
8372
|
+
callToAction: mapCallToActionOptional(item.callToAction)
|
|
8373
|
+
}))
|
|
8374
|
+
}), rendererMapperProps);
|
|
8431
8375
|
|
|
8432
8376
|
// src/renderers/mappers/tabsComponentToProps.ts
|
|
8433
8377
|
var tabsComponentToProps = (component, rendererMapperProps) => {
|
|
@@ -8446,15 +8390,17 @@ var tabsComponentToProps = (component, rendererMapperProps) => {
|
|
|
8446
8390
|
};
|
|
8447
8391
|
|
|
8448
8392
|
// src/renderers/mappers/textInputComponentToProps.ts
|
|
8449
|
-
var textInputComponentToProps = (component, rendererMapperProps) => __spreadProps(__spreadValues(__spreadValues({}, inputComponentToProps(component, "input-text")), rendererMapperProps),
|
|
8450
|
-
|
|
8451
|
-
|
|
8452
|
-
displayFormat
|
|
8453
|
-
maxLength
|
|
8454
|
-
minLength
|
|
8455
|
-
pattern
|
|
8456
|
-
suggestions
|
|
8457
|
-
|
|
8393
|
+
var textInputComponentToProps = (component, rendererMapperProps) => __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, inputComponentToProps(component, "input-text")), rendererMapperProps), pick(
|
|
8394
|
+
component,
|
|
8395
|
+
"autoComplete",
|
|
8396
|
+
"displayFormat",
|
|
8397
|
+
"maxLength",
|
|
8398
|
+
"minLength",
|
|
8399
|
+
"pattern",
|
|
8400
|
+
"suggestions"
|
|
8401
|
+
)), {
|
|
8402
|
+
onChange: component.setValue,
|
|
8403
|
+
autoCapitalize: component == null ? void 0 : component.autocapitalization
|
|
8458
8404
|
});
|
|
8459
8405
|
|
|
8460
8406
|
// src/renderers/mappers/tupleComponentToProps.ts
|
|
@@ -8480,30 +8426,15 @@ var tupleComponentToProps = (component, rendererMapperProps) => {
|
|
|
8480
8426
|
|
|
8481
8427
|
// src/renderers/mappers/uploadInputComponentToProps.ts
|
|
8482
8428
|
var uploadInputComponentToProps = (component, rendererMapperProps) => {
|
|
8483
|
-
|
|
8484
|
-
|
|
8485
|
-
cameraConfig,
|
|
8486
|
-
source,
|
|
8487
|
-
accepts,
|
|
8488
|
-
maxSize,
|
|
8489
|
-
onUpload: component.onUpload.bind(component)
|
|
8429
|
+
return __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, inputComponentToProps(component, "input-upload")), rendererMapperProps), pick(component, "accepts", "cameraConfig", "maxSize", "source")), {
|
|
8430
|
+
onUpload: component.setValue
|
|
8490
8431
|
});
|
|
8491
8432
|
};
|
|
8492
8433
|
|
|
8493
8434
|
// src/renderers/mappers/upsellComponentToProps.ts
|
|
8494
|
-
var upsellComponentToProps = (component, rendererMapperProps) => __spreadValues(__spreadProps(__spreadValues({}, pick(
|
|
8495
|
-
component,
|
|
8496
|
-
|
|
8497
|
-
"analyticsId",
|
|
8498
|
-
"type",
|
|
8499
|
-
"callToAction",
|
|
8500
|
-
"control",
|
|
8501
|
-
"margin",
|
|
8502
|
-
"media",
|
|
8503
|
-
"tags",
|
|
8504
|
-
"text"
|
|
8505
|
-
)), {
|
|
8506
|
-
onDismiss: component.onDismiss ? component.onDismiss.bind(component) : void 0
|
|
8435
|
+
var upsellComponentToProps = (component, rendererMapperProps) => __spreadValues(__spreadProps(__spreadValues({}, pick(component, "uid", "analyticsId", "type", "control", "margin", "media", "tags", "text")), {
|
|
8436
|
+
callToAction: mapCallToAction(component.callToAction),
|
|
8437
|
+
onDismiss: component.dismiss
|
|
8507
8438
|
}), rendererMapperProps);
|
|
8508
8439
|
|
|
8509
8440
|
// src/renderers/mappers/componentToRendererProps.ts
|
|
@@ -8660,7 +8591,7 @@ var stepComponentToProps = (component, rendererMapperProps) => {
|
|
|
8660
8591
|
footer: footerProps.map(rendererMapperProps.render),
|
|
8661
8592
|
footerProps,
|
|
8662
8593
|
__onAction: (action) => {
|
|
8663
|
-
void onBehavior({ type: "action", action });
|
|
8594
|
+
void onBehavior({ type: "action", action, track: false });
|
|
8664
8595
|
}
|
|
8665
8596
|
}, restMapperProps);
|
|
8666
8597
|
};
|
|
@@ -8703,27 +8634,33 @@ var subflowComponentToRendererProps = (subflow, rendererMapperProps, nativeSubfl
|
|
|
8703
8634
|
}
|
|
8704
8635
|
};
|
|
8705
8636
|
var dynamicSubflowComponentToRendererProps = (component, rendererMapperProps) => {
|
|
8706
|
-
return __spreadValues(
|
|
8707
|
-
uid: component.uid,
|
|
8637
|
+
return __spreadValues(__spreadValues({
|
|
8708
8638
|
type: "subflow-dynamic"
|
|
8709
|
-
}, pick(
|
|
8710
|
-
|
|
8711
|
-
|
|
8712
|
-
|
|
8713
|
-
|
|
8714
|
-
|
|
8639
|
+
}, pick(
|
|
8640
|
+
component,
|
|
8641
|
+
"uid",
|
|
8642
|
+
"requestCache",
|
|
8643
|
+
"presentation",
|
|
8644
|
+
"initialRequest",
|
|
8645
|
+
"onCancellation",
|
|
8646
|
+
"onCompletion",
|
|
8647
|
+
"onError",
|
|
8648
|
+
"onEvent"
|
|
8649
|
+
)), rendererMapperProps);
|
|
8715
8650
|
};
|
|
8716
8651
|
var nativeSubflowComponentToRendererProps = (component, rendererMapperProps) => {
|
|
8717
|
-
return __spreadValues({
|
|
8718
|
-
|
|
8719
|
-
|
|
8720
|
-
|
|
8721
|
-
|
|
8722
|
-
|
|
8723
|
-
|
|
8724
|
-
|
|
8725
|
-
|
|
8726
|
-
|
|
8652
|
+
return __spreadValues(__spreadValues({
|
|
8653
|
+
type: "subflow-native"
|
|
8654
|
+
}, pick(
|
|
8655
|
+
component,
|
|
8656
|
+
"uid",
|
|
8657
|
+
"id",
|
|
8658
|
+
"payload",
|
|
8659
|
+
"onCancellation",
|
|
8660
|
+
"onCompletion",
|
|
8661
|
+
"onError",
|
|
8662
|
+
"onEvent"
|
|
8663
|
+
)), rendererMapperProps);
|
|
8727
8664
|
};
|
|
8728
8665
|
|
|
8729
8666
|
// src/renderers/mappers/rootComponentToProps.ts
|
|
@@ -9000,7 +8937,8 @@ var eventNames = [
|
|
|
9000
8937
|
"Native Subflow Triggered",
|
|
9001
8938
|
"Native Subflow Succeeded",
|
|
9002
8939
|
"Native Subflow Failed",
|
|
9003
|
-
"Native Subflow Cancelled"
|
|
8940
|
+
"Native Subflow Cancelled",
|
|
8941
|
+
"Behavior Triggered"
|
|
9004
8942
|
];
|
|
9005
8943
|
|
|
9006
8944
|
// src/renderers/subflow/getDynamicSubflowRenderer.tsx
|