@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.js
CHANGED
|
@@ -472,7 +472,7 @@ var nl_default = {
|
|
|
472
472
|
"dynamicFlows.ControlFeedback.type": "Onjuist type",
|
|
473
473
|
"dynamicFlows.DownloadFeedback.failed": "Downloaden mislukt",
|
|
474
474
|
"dynamicFlows.DownloadFeedback.started": "Downloaden...",
|
|
475
|
-
"dynamicFlows.DownloadFeedback.successful": "
|
|
475
|
+
"dynamicFlows.DownloadFeedback.successful": "Downloaden gelukt",
|
|
476
476
|
"dynamicFlows.DynamicParagraph.copied": "Naar klembord gekopieerd",
|
|
477
477
|
"dynamicFlows.DynamicParagraph.copy": "Kopi\xEBren",
|
|
478
478
|
"dynamicFlows.ErrorBoundary.errorAlert": "Er is iets misgegaan.",
|
|
@@ -552,7 +552,7 @@ var pt_default = {
|
|
|
552
552
|
"dynamicFlows.ControlFeedback.type": "Tipo incorreto",
|
|
553
553
|
"dynamicFlows.DownloadFeedback.failed": "Falha no envio",
|
|
554
554
|
"dynamicFlows.DownloadFeedback.started": "Baixando...",
|
|
555
|
-
"dynamicFlows.DownloadFeedback.successful": "Download
|
|
555
|
+
"dynamicFlows.DownloadFeedback.successful": "Download realizado",
|
|
556
556
|
"dynamicFlows.DynamicParagraph.copied": "Copiado",
|
|
557
557
|
"dynamicFlows.DynamicParagraph.copy": "Copiar",
|
|
558
558
|
"dynamicFlows.ErrorBoundary.errorAlert": "Algo deu errado.",
|
|
@@ -632,7 +632,7 @@ var ru_default = {
|
|
|
632
632
|
"dynamicFlows.ControlFeedback.type": "\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0442\u0438\u043F",
|
|
633
633
|
"dynamicFlows.DownloadFeedback.failed": "\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043A\u0430\u0447\u0430\u0442\u044C",
|
|
634
634
|
"dynamicFlows.DownloadFeedback.started": "\u0421\u043A\u0430\u0447\u0438\u0432\u0430\u043D\u0438\u0435...",
|
|
635
|
-
"dynamicFlows.DownloadFeedback.successful": "
|
|
635
|
+
"dynamicFlows.DownloadFeedback.successful": "\u0421\u043A\u0430\u0447\u0438\u0432\u0430\u043D\u0438\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u043E",
|
|
636
636
|
"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",
|
|
637
637
|
"dynamicFlows.DynamicParagraph.copy": "\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C",
|
|
638
638
|
"dynamicFlows.ErrorBoundary.errorAlert": "\u0427\u0442\u043E-\u0442\u043E \u043F\u043E\u0448\u043B\u043E \u043D\u0435 \u0442\u0430\u043A.",
|
|
@@ -672,7 +672,7 @@ var th_default = {
|
|
|
672
672
|
"dynamicFlows.ControlFeedback.type": "\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",
|
|
673
673
|
"dynamicFlows.DownloadFeedback.failed": "\u0E14\u0E32\u0E27\u0E19\u0E4C\u0E42\u0E2B\u0E25\u0E14\u0E25\u0E49\u0E21\u0E40\u0E2B\u0E25\u0E27",
|
|
674
674
|
"dynamicFlows.DownloadFeedback.started": "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E14\u0E32\u0E27\u0E19\u0E4C\u0E42\u0E2B\u0E25\u0E14...",
|
|
675
|
-
"dynamicFlows.DownloadFeedback.successful": "
|
|
675
|
+
"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",
|
|
676
676
|
"dynamicFlows.DynamicParagraph.copied": "\u0E04\u0E31\u0E14\u0E25\u0E2D\u0E01\u0E44\u0E1B\u0E22\u0E31\u0E07\u0E04\u0E25\u0E34\u0E1B\u0E1A\u0E2D\u0E23\u0E4C\u0E14",
|
|
677
677
|
"dynamicFlows.DynamicParagraph.copy": "\u0E04\u0E31\u0E14\u0E25\u0E2D\u0E01",
|
|
678
678
|
"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",
|
|
@@ -712,7 +712,7 @@ var tr_default = {
|
|
|
712
712
|
"dynamicFlows.ControlFeedback.type": "Ge\xE7ersiz se\xE7im",
|
|
713
713
|
"dynamicFlows.DownloadFeedback.failed": "\u0130ndirme ba\u015Far\u0131s\u0131z",
|
|
714
714
|
"dynamicFlows.DownloadFeedback.started": "\u0130ndiriliyor...",
|
|
715
|
-
"dynamicFlows.DownloadFeedback.successful": "
|
|
715
|
+
"dynamicFlows.DownloadFeedback.successful": "\u0130ndirme ba\u015Far\u0131l\u0131",
|
|
716
716
|
"dynamicFlows.DynamicParagraph.copied": "Panoya kopyaland\u0131",
|
|
717
717
|
"dynamicFlows.DynamicParagraph.copy": "Kopyala",
|
|
718
718
|
"dynamicFlows.ErrorBoundary.errorAlert": "Bir sorun olu\u015Ftu.",
|
|
@@ -751,8 +751,8 @@ var zh_CN_default = {
|
|
|
751
751
|
"dynamicFlows.ControlFeedback.required": "\u8BF7\u586B\u5199\u6B64\u5B57\u6BB5\u3002",
|
|
752
752
|
"dynamicFlows.ControlFeedback.type": "\u7C7B\u578B\u9519\u8BEF",
|
|
753
753
|
"dynamicFlows.DownloadFeedback.failed": "\u4E0B\u8F7D\u5931\u8D25",
|
|
754
|
-
"dynamicFlows.DownloadFeedback.started": "\u6B63\u5728\u4E0B\u8F7D
|
|
755
|
-
"dynamicFlows.DownloadFeedback.successful": "
|
|
754
|
+
"dynamicFlows.DownloadFeedback.started": "\u6B63\u5728\u4E0B\u8F7D\u2026\u2026",
|
|
755
|
+
"dynamicFlows.DownloadFeedback.successful": "\u4E0B\u8F7D\u6210\u529F",
|
|
756
756
|
"dynamicFlows.DynamicParagraph.copied": "\u5DF2\u590D\u5236\u5230\u526A\u8D34\u677F",
|
|
757
757
|
"dynamicFlows.DynamicParagraph.copy": "\u590D\u5236",
|
|
758
758
|
"dynamicFlows.ErrorBoundary.errorAlert": "\u51FA\u9519\u4E86\u3002",
|
|
@@ -762,14 +762,14 @@ var zh_CN_default = {
|
|
|
762
762
|
"dynamicFlows.ExternalConfirmation.open": "\u5728\u65B0\u6807\u7B7E\u9875\u4E2D\u6253\u5F00",
|
|
763
763
|
"dynamicFlows.ExternalConfirmation.title": "\u8BF7\u786E\u8BA4",
|
|
764
764
|
"dynamicFlows.FileUploadSchema.maxFileSizeError": "\u62B1\u6B49\uFF0C\u8BE5\u6587\u4EF6\u592A\u5927\u3002\u8BF7\u4E0A\u4F20\u4E00\u4E2A\u66F4\u5C0F\u7684\u6587\u4EF6\u3002",
|
|
765
|
-
"dynamicFlows.FileUploadSchema.wrongFileTypeError": "\u62B1\u6B49\uFF0C\u4E0D\u652F\u6301\u8BE5\u6587\u4EF6\u683C\u5F0F\u3002\u8BF7\u4E0A\u4F20\u5176\u4ED6\u6587\u4EF6\u3002",
|
|
765
|
+
"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",
|
|
766
766
|
"dynamicFlows.Help.ariaLabel": "\u70B9\u51FB\u6B64\u5904\u83B7\u53D6\u66F4\u591A\u4FE1\u606F\u3002",
|
|
767
767
|
"dynamicFlows.MultiSelect.summary": "{first} \u548C\u5176\u4ED6 {count} \u4E2A",
|
|
768
768
|
"dynamicFlows.MultipleFileUploadSchema.maxFileSizeError": "\u62B1\u6B49\uFF0C\u8BE5\u6587\u4EF6\u592A\u5927\u3002\u8BF7\u4E0A\u4F20\u4E00\u4E2A\u66F4\u5C0F\u7684\u6587\u4EF6\u3002",
|
|
769
769
|
"dynamicFlows.MultipleFileUploadSchema.maxItemsError": "\u8BF7\u4E0A\u4F20\u4E0D\u8D85\u8FC7 {maxItems} \u4E2A\u6587\u4EF6\u3002",
|
|
770
770
|
"dynamicFlows.MultipleFileUploadSchema.minItemsError": "\u8BF7\u4E0A\u4F20\u81F3\u5C11 {minItems} \u4E2A\u6587\u4EF6\u3002",
|
|
771
771
|
"dynamicFlows.PersistAsyncSchema.genericError": "\u51FA\u9519\u4E86\uFF0C\u8BF7\u91CD\u8BD5\u3002",
|
|
772
|
-
"dynamicFlows.SearchLayout.loading": "\u6B63\u5728\u52A0\u8F7D\u2026"
|
|
772
|
+
"dynamicFlows.SearchLayout.loading": "\u6B63\u5728\u52A0\u8F7D\u2026\u2026"
|
|
773
773
|
};
|
|
774
774
|
|
|
775
775
|
// src/i18n/zh_HK.json
|
|
@@ -1049,7 +1049,7 @@ var getInputUpdateFunction = (onComponentUpdate) => {
|
|
|
1049
1049
|
// src/domain/components/RootDomainComponent.ts
|
|
1050
1050
|
var createRootDomainComponent = (onComponentUpdate, scrollToTop, backConfig, requestCache) => {
|
|
1051
1051
|
const update = getInputUpdateFunction(onComponentUpdate);
|
|
1052
|
-
const
|
|
1052
|
+
const component = {
|
|
1053
1053
|
type: "root",
|
|
1054
1054
|
kind: "step",
|
|
1055
1055
|
uid: "root",
|
|
@@ -1057,107 +1057,104 @@ var createRootDomainComponent = (onComponentUpdate, scrollToTop, backConfig, req
|
|
|
1057
1057
|
stepStack: [],
|
|
1058
1058
|
backConfig,
|
|
1059
1059
|
requestCache,
|
|
1060
|
-
_update(updateFn) {
|
|
1061
|
-
update(this, updateFn);
|
|
1062
|
-
},
|
|
1063
1060
|
dismissAllModals() {
|
|
1064
1061
|
var _a;
|
|
1065
|
-
(_a =
|
|
1062
|
+
(_a = component.getStep()) == null ? void 0 : _a.dismissAllModals();
|
|
1066
1063
|
},
|
|
1067
1064
|
dismissModal() {
|
|
1068
1065
|
var _a;
|
|
1069
|
-
(_a =
|
|
1066
|
+
(_a = component.getStep()) == null ? void 0 : _a.dismissModal();
|
|
1070
1067
|
},
|
|
1071
1068
|
showModal(modal) {
|
|
1072
1069
|
var _a;
|
|
1073
|
-
(_a =
|
|
1070
|
+
(_a = component.getStep()) == null ? void 0 : _a.showModal(modal);
|
|
1074
1071
|
},
|
|
1075
1072
|
getChildren() {
|
|
1076
|
-
const step =
|
|
1073
|
+
const step = component.getStep();
|
|
1077
1074
|
return step ? [step, ...step.getModals()] : [];
|
|
1078
1075
|
},
|
|
1079
1076
|
getLocalValue() {
|
|
1080
1077
|
var _a, _b;
|
|
1081
|
-
return (_b = (_a =
|
|
1078
|
+
return (_b = (_a = component.getStep()) == null ? void 0 : _a.getLocalValue()) != null ? _b : null;
|
|
1082
1079
|
},
|
|
1083
1080
|
async getSubmittableValue() {
|
|
1084
1081
|
var _a, _b;
|
|
1085
|
-
return (_b = (_a =
|
|
1082
|
+
return (_b = (_a = component.getStep()) == null ? void 0 : _a.getSubmittableValue()) != null ? _b : null;
|
|
1086
1083
|
},
|
|
1087
1084
|
getSubmittableValueSync() {
|
|
1088
1085
|
var _a, _b;
|
|
1089
|
-
return (_b = (_a =
|
|
1086
|
+
return (_b = (_a = component.getStep()) == null ? void 0 : _a.getSubmittableValueSync()) != null ? _b : null;
|
|
1090
1087
|
},
|
|
1091
1088
|
validate() {
|
|
1092
1089
|
var _a, _b;
|
|
1093
|
-
return (_b = (_a =
|
|
1090
|
+
return (_b = (_a = component.getStep()) == null ? void 0 : _a.validate()) != null ? _b : false;
|
|
1094
1091
|
},
|
|
1095
1092
|
setLoadingState(loadingState) {
|
|
1096
1093
|
var _a;
|
|
1097
|
-
(_a =
|
|
1094
|
+
(_a = component.getStep()) == null ? void 0 : _a.setLoadingState(loadingState);
|
|
1098
1095
|
},
|
|
1099
1096
|
getLoadingState() {
|
|
1100
1097
|
var _a, _b;
|
|
1101
|
-
return (_b = (_a =
|
|
1098
|
+
return (_b = (_a = component.getStep()) == null ? void 0 : _a.loadingState) != null ? _b : "initial";
|
|
1102
1099
|
},
|
|
1103
1100
|
getSchemaComponents() {
|
|
1104
1101
|
var _a, _b;
|
|
1105
|
-
return (_b = (_a =
|
|
1102
|
+
return (_b = (_a = component.getStep()) == null ? void 0 : _a.schemaComponents) != null ? _b : [];
|
|
1106
1103
|
},
|
|
1107
1104
|
getTrackEvent() {
|
|
1108
1105
|
var _a, _b;
|
|
1109
|
-
return (_b = (_a =
|
|
1106
|
+
return (_b = (_a = component.getStep()) == null ? void 0 : _a.trackEvent) != null ? _b : null;
|
|
1110
1107
|
},
|
|
1111
1108
|
isBusy() {
|
|
1112
|
-
const loadingState =
|
|
1109
|
+
const loadingState = component.getLoadingState();
|
|
1113
1110
|
return loadingState === "submitting" || loadingState === "refreshing";
|
|
1114
1111
|
},
|
|
1115
1112
|
hasStep() {
|
|
1116
|
-
return Boolean(
|
|
1113
|
+
return Boolean(component.stepStack.length > 0);
|
|
1117
1114
|
},
|
|
1118
1115
|
getStep() {
|
|
1119
1116
|
var _a;
|
|
1120
|
-
return (_a =
|
|
1117
|
+
return (_a = component.stepStack[component.stepStack.length - 1]) != null ? _a : null;
|
|
1121
1118
|
},
|
|
1122
1119
|
addSubflow(subflow) {
|
|
1123
1120
|
var _a;
|
|
1124
|
-
(_a =
|
|
1121
|
+
(_a = component.getStep()) == null ? void 0 : _a.addSubflow(subflow);
|
|
1125
1122
|
},
|
|
1126
1123
|
closeSubflow() {
|
|
1127
1124
|
var _a;
|
|
1128
|
-
(_a =
|
|
1125
|
+
(_a = component.getStep()) == null ? void 0 : _a.closeSubflow();
|
|
1129
1126
|
},
|
|
1130
1127
|
getSubflow() {
|
|
1131
1128
|
var _a, _b;
|
|
1132
|
-
return (_b = (_a =
|
|
1129
|
+
return (_b = (_a = component.getStep()) == null ? void 0 : _a.subflow) != null ? _b : null;
|
|
1133
1130
|
},
|
|
1134
1131
|
start() {
|
|
1135
1132
|
var _a;
|
|
1136
|
-
(_a =
|
|
1133
|
+
(_a = component.getStep()) == null ? void 0 : _a.start();
|
|
1137
1134
|
},
|
|
1138
1135
|
stop() {
|
|
1139
1136
|
var _a;
|
|
1140
|
-
(_a =
|
|
1137
|
+
(_a = component.getStep()) == null ? void 0 : _a.stop();
|
|
1141
1138
|
},
|
|
1142
1139
|
updateStep(stepComponent) {
|
|
1143
1140
|
var _a;
|
|
1144
|
-
|
|
1145
|
-
const shouldScroll = shouldScrollOnStepUpdate(stepComponent,
|
|
1146
|
-
|
|
1141
|
+
component.closeSubflow();
|
|
1142
|
+
const shouldScroll = shouldScrollOnStepUpdate(stepComponent, component.getStep());
|
|
1143
|
+
update(component, (draft) => {
|
|
1147
1144
|
draft.stepStack = draft.stepStack.slice(0, -1);
|
|
1148
1145
|
draft.stepStack.push(stepComponent);
|
|
1149
1146
|
});
|
|
1150
1147
|
if (shouldScroll) {
|
|
1151
1148
|
scrollToTop == null ? void 0 : scrollToTop("smooth");
|
|
1152
1149
|
}
|
|
1153
|
-
(_a =
|
|
1150
|
+
(_a = component.getStep()) == null ? void 0 : _a.start();
|
|
1154
1151
|
},
|
|
1155
1152
|
pushStep(stepComponent) {
|
|
1156
1153
|
var _a;
|
|
1157
|
-
|
|
1158
|
-
const previousStep =
|
|
1154
|
+
component.closeSubflow();
|
|
1155
|
+
const previousStep = component.getStep();
|
|
1159
1156
|
const previousStepHasPolling = previousStep == null ? void 0 : previousStep.step.polling;
|
|
1160
|
-
|
|
1157
|
+
update(component, (draft) => {
|
|
1161
1158
|
switch (stepComponent.stackBehavior) {
|
|
1162
1159
|
case "remove-previous":
|
|
1163
1160
|
case "replace-current":
|
|
@@ -1174,41 +1171,41 @@ var createRootDomainComponent = (onComponentUpdate, scrollToTop, backConfig, req
|
|
|
1174
1171
|
}
|
|
1175
1172
|
});
|
|
1176
1173
|
if (previousStep != null) {
|
|
1177
|
-
(_a =
|
|
1174
|
+
(_a = component.getStep()) == null ? void 0 : _a.start();
|
|
1178
1175
|
scrollToTop == null ? void 0 : scrollToTop("instant");
|
|
1179
1176
|
}
|
|
1180
1177
|
},
|
|
1181
1178
|
clearStack() {
|
|
1182
|
-
const currentStep =
|
|
1179
|
+
const currentStep = component.getStep();
|
|
1183
1180
|
if (currentStep) {
|
|
1184
|
-
|
|
1181
|
+
update(component, (draft) => {
|
|
1185
1182
|
draft.stepStack = [currentStep];
|
|
1186
1183
|
});
|
|
1187
1184
|
}
|
|
1188
1185
|
},
|
|
1189
1186
|
getRefreshUrl() {
|
|
1190
1187
|
var _a, _b, _c, _d;
|
|
1191
|
-
return (_d = (_c = (_a =
|
|
1188
|
+
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;
|
|
1192
1189
|
},
|
|
1193
1190
|
navigateBack() {
|
|
1194
1191
|
var _a;
|
|
1195
|
-
|
|
1196
|
-
if (
|
|
1192
|
+
component.closeSubflow();
|
|
1193
|
+
if (component.stepStack.length === 1) {
|
|
1197
1194
|
return;
|
|
1198
1195
|
}
|
|
1199
|
-
|
|
1196
|
+
update(component, (draft) => {
|
|
1200
1197
|
draft.stepStack = draft.stepStack.slice(0, -1);
|
|
1201
1198
|
});
|
|
1202
|
-
(_a =
|
|
1199
|
+
(_a = component.getStep()) == null ? void 0 : _a.start();
|
|
1203
1200
|
},
|
|
1204
1201
|
canPerformBack() {
|
|
1205
1202
|
var _a, _b;
|
|
1206
|
-
const navigation = (_a =
|
|
1203
|
+
const navigation = (_a = component.getStep()) == null ? void 0 : _a.step.navigation;
|
|
1207
1204
|
const stepHasBehavior = Boolean((_b = navigation == null ? void 0 : navigation.back) != null ? _b : navigation == null ? void 0 : navigation.backButton);
|
|
1208
|
-
return
|
|
1205
|
+
return component.backConfig.isFlowCancellable || component.stepStack.length > 1 && component.backConfig.isNativeBackEnabled || stepHasBehavior;
|
|
1209
1206
|
}
|
|
1210
1207
|
};
|
|
1211
|
-
return
|
|
1208
|
+
return component;
|
|
1212
1209
|
};
|
|
1213
1210
|
var shouldScrollOnStepUpdate = (newStep, currentStep) => {
|
|
1214
1211
|
if (!currentStep) {
|
|
@@ -1217,6 +1214,15 @@ var shouldScrollOnStepUpdate = (newStep, currentStep) => {
|
|
|
1217
1214
|
return newStep.error != null && newStep.error !== currentStep.error;
|
|
1218
1215
|
};
|
|
1219
1216
|
|
|
1217
|
+
// src/domain/features/events.ts
|
|
1218
|
+
var trackBehaviorTriggered = (trackEvent, behavior) => {
|
|
1219
|
+
if (behavior.track) {
|
|
1220
|
+
trackEvent("Behavior Triggered", __spreadProps(__spreadValues({}, behavior.analytics), {
|
|
1221
|
+
behaviorType: behavior.type
|
|
1222
|
+
}));
|
|
1223
|
+
}
|
|
1224
|
+
};
|
|
1225
|
+
|
|
1220
1226
|
// src/domain/features/prefetch/request-cache.ts
|
|
1221
1227
|
var makeRequestCacheWithParent = (parent) => {
|
|
1222
1228
|
const map = /* @__PURE__ */ new Map();
|
|
@@ -1267,36 +1273,33 @@ var makeRequestCacheKey = (requestParams) => {
|
|
|
1267
1273
|
};
|
|
1268
1274
|
|
|
1269
1275
|
// src/domain/components/ModalComponent.ts
|
|
1270
|
-
var createModalContentComponent = (
|
|
1276
|
+
var createModalContentComponent = (props, onComponentUpdate) => {
|
|
1271
1277
|
const update = getInputUpdateFunction(onComponentUpdate);
|
|
1272
|
-
const
|
|
1278
|
+
const component = __spreadProps(__spreadValues({
|
|
1273
1279
|
type: "modal",
|
|
1274
1280
|
kind: "layout",
|
|
1275
1281
|
open: true
|
|
1276
|
-
},
|
|
1277
|
-
_update(updateFn) {
|
|
1278
|
-
update(this, updateFn);
|
|
1279
|
-
},
|
|
1282
|
+
}, props), {
|
|
1280
1283
|
getChildren() {
|
|
1281
|
-
return
|
|
1284
|
+
return component.components;
|
|
1282
1285
|
},
|
|
1283
1286
|
close() {
|
|
1284
|
-
update(
|
|
1287
|
+
update(component, (draft) => {
|
|
1285
1288
|
draft.open = false;
|
|
1286
1289
|
});
|
|
1287
1290
|
}
|
|
1288
1291
|
});
|
|
1289
|
-
return
|
|
1292
|
+
return component;
|
|
1290
1293
|
};
|
|
1291
1294
|
|
|
1292
1295
|
// src/domain/components/utils/getRandomId.ts
|
|
1293
1296
|
var getRandomId = () => Math.random().toString(36).substring(2);
|
|
1294
1297
|
|
|
1295
1298
|
// src/domain/components/AlertComponent.ts
|
|
1296
|
-
var createAlertComponent = (
|
|
1299
|
+
var createAlertComponent = (props) => __spreadValues({
|
|
1297
1300
|
type: "alert",
|
|
1298
1301
|
kind: "layout"
|
|
1299
|
-
},
|
|
1302
|
+
}, props);
|
|
1300
1303
|
|
|
1301
1304
|
// src/domain/mappers/utils/behavior-utils.ts
|
|
1302
1305
|
var getDomainLayerBehavior = ({ action, behavior: specBehavior }, stepActions, registerSubmissionBehavior) => {
|
|
@@ -1310,29 +1313,31 @@ var getDomainLayerBehavior = ({ action, behavior: specBehavior }, stepActions, r
|
|
|
1310
1313
|
registerSubmissionBehavior == null ? void 0 : registerSubmissionBehavior(behavior);
|
|
1311
1314
|
return behavior;
|
|
1312
1315
|
}
|
|
1313
|
-
return { type: "none" };
|
|
1316
|
+
return { type: "none", track: false };
|
|
1314
1317
|
};
|
|
1315
1318
|
var normaliseBehavior = (behavior, stepActions) => {
|
|
1316
1319
|
if ("type" in behavior) {
|
|
1317
1320
|
if (behavior.type === "subflow") {
|
|
1318
1321
|
return __spreadProps(__spreadValues({}, behavior), {
|
|
1322
|
+
track: true,
|
|
1319
1323
|
onCompletion: behavior.onCompletion ? normaliseBehavior(behavior.onCompletion, stepActions) : void 0,
|
|
1320
1324
|
onError: behavior.onError ? normaliseBehavior(behavior.onError, stepActions) : void 0
|
|
1321
1325
|
});
|
|
1322
1326
|
}
|
|
1323
|
-
return behavior;
|
|
1327
|
+
return __spreadProps(__spreadValues({}, behavior), { track: true });
|
|
1324
1328
|
}
|
|
1325
1329
|
if ("action" in behavior && behavior.action) {
|
|
1326
1330
|
return actionToBehavior(behavior.action, stepActions);
|
|
1327
1331
|
}
|
|
1328
1332
|
if ("link" in behavior && behavior.link) {
|
|
1329
|
-
return { type: "link", url: behavior.link.url };
|
|
1333
|
+
return { type: "link", url: behavior.link.url, track: true };
|
|
1330
1334
|
}
|
|
1331
|
-
return { type: "none" };
|
|
1335
|
+
return { type: "none", track: false };
|
|
1332
1336
|
};
|
|
1333
1337
|
var actionToBehavior = (action, stepActions) => ({
|
|
1334
1338
|
type: "action",
|
|
1335
|
-
action: inlineAction(action, stepActions)
|
|
1339
|
+
action: inlineAction(action, stepActions),
|
|
1340
|
+
track: false
|
|
1336
1341
|
});
|
|
1337
1342
|
var inlineAction = (action, stepActions = []) => action.$ref ? __spreadValues(__spreadValues({}, getActionByReference(action.$ref, stepActions)), action) : action;
|
|
1338
1343
|
var getActionByReference = ($ref, actions = []) => {
|
|
@@ -1343,6 +1348,30 @@ var getActionByReference = ($ref, actions = []) => {
|
|
|
1343
1348
|
return action;
|
|
1344
1349
|
};
|
|
1345
1350
|
|
|
1351
|
+
// src/domain/mappers/utils/getHrefWithTracking.ts
|
|
1352
|
+
var getHrefWithTracking = ({
|
|
1353
|
+
behavior,
|
|
1354
|
+
onBehavior,
|
|
1355
|
+
trackEvent
|
|
1356
|
+
}) => {
|
|
1357
|
+
if (behavior.type === "link" && behavior.url) {
|
|
1358
|
+
return () => ({
|
|
1359
|
+
href: behavior.url,
|
|
1360
|
+
target: "_blank",
|
|
1361
|
+
onClick: () => {
|
|
1362
|
+
trackEvent("Behavior Triggered", __spreadProps(__spreadValues({}, behavior.analytics), {
|
|
1363
|
+
behaviorType: behavior.type
|
|
1364
|
+
}));
|
|
1365
|
+
}
|
|
1366
|
+
});
|
|
1367
|
+
}
|
|
1368
|
+
return () => ({
|
|
1369
|
+
onClick: () => {
|
|
1370
|
+
void onBehavior(behavior);
|
|
1371
|
+
}
|
|
1372
|
+
});
|
|
1373
|
+
};
|
|
1374
|
+
|
|
1346
1375
|
// src/domain/mappers/utils/legacy-utils.ts
|
|
1347
1376
|
var mapLegacyContext = (context) => {
|
|
1348
1377
|
switch (context) {
|
|
@@ -1400,15 +1429,17 @@ function getDomainLayerCallToAction(cta, mapperProps) {
|
|
|
1400
1429
|
if (!cta) {
|
|
1401
1430
|
return void 0;
|
|
1402
1431
|
}
|
|
1403
|
-
const { step, onBehavior, registerSubmissionBehavior } = mapperProps;
|
|
1432
|
+
const { step, onBehavior, trackEvent, registerSubmissionBehavior } = mapperProps;
|
|
1404
1433
|
const stepActions = (_a = step.actions) != null ? _a : [];
|
|
1405
1434
|
const behavior = getDomainLayerBehavior(cta, stepActions, registerSubmissionBehavior);
|
|
1435
|
+
const isLink = behavior.type === "link";
|
|
1406
1436
|
return {
|
|
1407
1437
|
type: behavior.type,
|
|
1408
1438
|
title: (_b = cta.title) != null ? _b : "",
|
|
1409
1439
|
context: cta.context ? mapLegacyContext(cta.context) : void 0,
|
|
1410
1440
|
accessibilityDescription: cta.accessibilityDescription,
|
|
1411
|
-
href:
|
|
1441
|
+
href: isLink ? behavior.url : void 0,
|
|
1442
|
+
hrefWithTracking: getHrefWithTracking({ behavior, onBehavior, trackEvent }),
|
|
1412
1443
|
onClick: () => {
|
|
1413
1444
|
void onBehavior(behavior);
|
|
1414
1445
|
}
|
|
@@ -1439,11 +1470,11 @@ var alertLayoutToComponent = (uid, {
|
|
|
1439
1470
|
};
|
|
1440
1471
|
|
|
1441
1472
|
// src/domain/components/BoxComponent.ts
|
|
1442
|
-
var createBoxComponent = (
|
|
1473
|
+
var createBoxComponent = (props) => __spreadProps(__spreadValues({}, props), {
|
|
1443
1474
|
type: "box",
|
|
1444
1475
|
kind: "layout",
|
|
1445
1476
|
getChildren() {
|
|
1446
|
-
return
|
|
1477
|
+
return props.components;
|
|
1447
1478
|
}
|
|
1448
1479
|
});
|
|
1449
1480
|
|
|
@@ -1470,10 +1501,10 @@ var boxLayoutToComponent = (uid, { border = false, components, control, margin,
|
|
|
1470
1501
|
});
|
|
1471
1502
|
|
|
1472
1503
|
// src/domain/components/ButtonComponent.ts
|
|
1473
|
-
var createButtonComponent = (
|
|
1504
|
+
var createButtonComponent = (props) => __spreadValues({
|
|
1474
1505
|
type: "button",
|
|
1475
1506
|
kind: "layout"
|
|
1476
|
-
},
|
|
1507
|
+
}, props);
|
|
1477
1508
|
|
|
1478
1509
|
// src/domain/mappers/utils/image.ts
|
|
1479
1510
|
var mapSpecImage = (image) => {
|
|
@@ -1557,7 +1588,7 @@ var buttonLayoutToComponentWithAction = (uid, button, mapperProps) => {
|
|
|
1557
1588
|
const { action } = button;
|
|
1558
1589
|
const inlinedAction = action ? inlineAction(action, step == null ? void 0 : step.actions) : {};
|
|
1559
1590
|
const onClick = () => {
|
|
1560
|
-
void onBehavior({ type: "action", action: inlinedAction });
|
|
1591
|
+
void onBehavior({ type: "action", action: inlinedAction, track: false });
|
|
1561
1592
|
};
|
|
1562
1593
|
return createButtonComponent({
|
|
1563
1594
|
uid,
|
|
@@ -1599,11 +1630,11 @@ var getButtonContext = ({ context, action }) => {
|
|
|
1599
1630
|
};
|
|
1600
1631
|
|
|
1601
1632
|
// src/domain/components/ColumnsComponent.ts
|
|
1602
|
-
var createColumnsComponent = (
|
|
1633
|
+
var createColumnsComponent = (props) => __spreadProps(__spreadValues({}, props), {
|
|
1603
1634
|
type: "columns",
|
|
1604
1635
|
kind: "layout",
|
|
1605
1636
|
getChildren() {
|
|
1606
|
-
return [...
|
|
1637
|
+
return [...props.startComponents, ...props.endComponents];
|
|
1607
1638
|
}
|
|
1608
1639
|
});
|
|
1609
1640
|
|
|
@@ -1629,10 +1660,10 @@ var columnsLayoutToComponent = (uid, { control, left, right, bias, margin, analy
|
|
|
1629
1660
|
});
|
|
1630
1661
|
|
|
1631
1662
|
// src/domain/components/DecisionComponent.ts
|
|
1632
|
-
var createDecisionComponent = (
|
|
1663
|
+
var createDecisionComponent = (props) => __spreadValues({
|
|
1633
1664
|
type: "decision",
|
|
1634
1665
|
kind: "layout"
|
|
1635
|
-
},
|
|
1666
|
+
}, props);
|
|
1636
1667
|
|
|
1637
1668
|
// src/domain/mappers/utils/tags-utils.ts
|
|
1638
1669
|
var mapTags = ({ tag, tags }) => tags != null ? tags : tag != null ? [tag] : void 0;
|
|
@@ -1645,12 +1676,18 @@ var mapInlineAlert = (alert) => {
|
|
|
1645
1676
|
} : void 0;
|
|
1646
1677
|
};
|
|
1647
1678
|
var mapAdditionalInfo = (info, mapperProps) => {
|
|
1648
|
-
const { onBehavior, registerSubmissionBehavior } = mapperProps;
|
|
1679
|
+
const { onBehavior, trackEvent, registerSubmissionBehavior } = mapperProps;
|
|
1649
1680
|
if (info) {
|
|
1650
1681
|
const behavior = getDomainLayerBehavior(info, [], registerSubmissionBehavior);
|
|
1682
|
+
const isLink = behavior.type === "link";
|
|
1651
1683
|
return {
|
|
1652
1684
|
text: info.text,
|
|
1653
|
-
href:
|
|
1685
|
+
href: isLink ? behavior.url : void 0,
|
|
1686
|
+
hrefWithTracking: getHrefWithTracking({
|
|
1687
|
+
behavior,
|
|
1688
|
+
onBehavior,
|
|
1689
|
+
trackEvent
|
|
1690
|
+
}),
|
|
1654
1691
|
accessibilityDescription: info.accessibilityDescription,
|
|
1655
1692
|
onClick: behavior.type === "none" ? void 0 : () => {
|
|
1656
1693
|
void onBehavior(behavior);
|
|
@@ -1685,14 +1722,16 @@ var decisionLayoutToComponent = (uid, {
|
|
|
1685
1722
|
});
|
|
1686
1723
|
var mapOption = (option, mapperProps) => {
|
|
1687
1724
|
var _a, _b;
|
|
1688
|
-
const { step, onBehavior, registerSubmissionBehavior } = mapperProps;
|
|
1725
|
+
const { step, onBehavior, trackEvent, registerSubmissionBehavior } = mapperProps;
|
|
1689
1726
|
const behavior = getDomainLayerBehavior(option, (_a = step.actions) != null ? _a : [], registerSubmissionBehavior);
|
|
1727
|
+
const isLink = behavior.type === "link";
|
|
1690
1728
|
return __spreadProps(__spreadValues({}, option), {
|
|
1691
1729
|
disabled: (_b = option.disabled) != null ? _b : false,
|
|
1692
|
-
href:
|
|
1730
|
+
href: isLink ? behavior.url : void 0,
|
|
1693
1731
|
media: getDomainLayerMedia(option),
|
|
1694
1732
|
inlineAlert: mapInlineAlert(option.inlineAlert),
|
|
1695
1733
|
tags: mapTags(option),
|
|
1734
|
+
hrefWithTracking: getHrefWithTracking({ behavior, onBehavior, trackEvent }),
|
|
1696
1735
|
onClick: () => {
|
|
1697
1736
|
void onBehavior(behavior);
|
|
1698
1737
|
}
|
|
@@ -1700,10 +1739,10 @@ var mapOption = (option, mapperProps) => {
|
|
|
1700
1739
|
};
|
|
1701
1740
|
|
|
1702
1741
|
// src/domain/components/StatusListComponent.ts
|
|
1703
|
-
var createStatusListComponent = (
|
|
1742
|
+
var createStatusListComponent = (props) => __spreadValues({
|
|
1704
1743
|
type: "status-list",
|
|
1705
1744
|
kind: "layout"
|
|
1706
|
-
},
|
|
1745
|
+
}, props);
|
|
1707
1746
|
|
|
1708
1747
|
// src/domain/mappers/layout/deprecatedListLayoutToComponent.ts
|
|
1709
1748
|
var isDeprecatedListLayout = (layout) => {
|
|
@@ -1746,11 +1785,11 @@ var createDividerComponent = (props) => __spreadValues({
|
|
|
1746
1785
|
var dividerLayoutToComponent = (uid, { control, margin, analyticsId, tags }) => createDividerComponent({ uid, analyticsId, control, margin: margin != null ? margin : "md", tags });
|
|
1747
1786
|
|
|
1748
1787
|
// src/domain/components/FormComponent.ts
|
|
1749
|
-
var createFormComponent = (
|
|
1788
|
+
var createFormComponent = (props) => __spreadProps(__spreadValues({}, props), {
|
|
1750
1789
|
type: "form",
|
|
1751
1790
|
kind: "layout",
|
|
1752
1791
|
getChildren() {
|
|
1753
|
-
return [
|
|
1792
|
+
return [props.schemaComponent];
|
|
1754
1793
|
}
|
|
1755
1794
|
});
|
|
1756
1795
|
|
|
@@ -1779,10 +1818,10 @@ var formLayoutToComponent = (uid, { analyticsId, schemaId, schema: schemaRef, co
|
|
|
1779
1818
|
};
|
|
1780
1819
|
|
|
1781
1820
|
// src/domain/components/HeadingComponent.ts
|
|
1782
|
-
var createHeadingComponent = (
|
|
1821
|
+
var createHeadingComponent = (props) => __spreadValues({
|
|
1783
1822
|
type: "heading",
|
|
1784
1823
|
kind: "layout"
|
|
1785
|
-
},
|
|
1824
|
+
}, props);
|
|
1786
1825
|
|
|
1787
1826
|
// src/domain/mappers/layout/headingLayoutToComponent.ts
|
|
1788
1827
|
var headingLayoutToComponent = (uid, { analyticsId, align, margin, size, control, tags, text }) => createHeadingComponent({
|
|
@@ -1797,10 +1836,10 @@ var headingLayoutToComponent = (uid, { analyticsId, align, margin, size, control
|
|
|
1797
1836
|
});
|
|
1798
1837
|
|
|
1799
1838
|
// src/domain/components/ImageComponent.ts
|
|
1800
|
-
var createImageComponent = (
|
|
1839
|
+
var createImageComponent = (props) => __spreadValues({
|
|
1801
1840
|
type: "image",
|
|
1802
1841
|
kind: "layout"
|
|
1803
|
-
},
|
|
1842
|
+
}, props);
|
|
1804
1843
|
|
|
1805
1844
|
// src/domain/mappers/layout/imageLayoutToComponent.ts
|
|
1806
1845
|
var imageLayoutToComponent = (uid, {
|
|
@@ -1832,10 +1871,10 @@ var imageLayoutToComponent = (uid, {
|
|
|
1832
1871
|
};
|
|
1833
1872
|
|
|
1834
1873
|
// src/domain/components/MarkdownComponent.ts
|
|
1835
|
-
var createMarkdownComponent = (
|
|
1874
|
+
var createMarkdownComponent = (props) => __spreadValues({
|
|
1836
1875
|
type: "markdown",
|
|
1837
1876
|
kind: "layout"
|
|
1838
|
-
},
|
|
1877
|
+
}, props);
|
|
1839
1878
|
|
|
1840
1879
|
// src/domain/mappers/layout/infoLayoutToComponent.ts
|
|
1841
1880
|
var infoLayoutToComponent = (uid, { analyticsId, align, control, margin, markdown: content, tags }) => createMarkdownComponent({
|
|
@@ -1850,10 +1889,10 @@ var infoLayoutToComponent = (uid, { analyticsId, align, control, margin, markdow
|
|
|
1850
1889
|
});
|
|
1851
1890
|
|
|
1852
1891
|
// src/domain/components/InstructionsComponent.ts
|
|
1853
|
-
var createInstructionsComponent = (
|
|
1892
|
+
var createInstructionsComponent = (props) => __spreadValues({
|
|
1854
1893
|
type: "instructions",
|
|
1855
1894
|
kind: "layout"
|
|
1856
|
-
},
|
|
1895
|
+
}, props);
|
|
1857
1896
|
|
|
1858
1897
|
// src/domain/mappers/layout/instructionsLayoutToComponent.ts
|
|
1859
1898
|
var instructionsLayoutToComponent = (uid, { analyticsId, control, items, margin, tags, title }) => createInstructionsComponent({
|
|
@@ -1870,10 +1909,10 @@ var instructionsLayoutToComponent = (uid, { analyticsId, control, items, margin,
|
|
|
1870
1909
|
});
|
|
1871
1910
|
|
|
1872
1911
|
// src/domain/components/ListComponent.ts
|
|
1873
|
-
var createListComponent = (
|
|
1912
|
+
var createListComponent = (props) => __spreadValues({
|
|
1874
1913
|
type: "list",
|
|
1875
1914
|
kind: "layout"
|
|
1876
|
-
},
|
|
1915
|
+
}, props);
|
|
1877
1916
|
|
|
1878
1917
|
// src/domain/mappers/layout/listLayoutToComponent.ts
|
|
1879
1918
|
var listLayoutToComponent = (uid, { analyticsId, callToAction, control, items, margin, tags, title }, mapperProps) => {
|
|
@@ -1931,10 +1970,10 @@ var mapSupportingValues = (item) => {
|
|
|
1931
1970
|
};
|
|
1932
1971
|
|
|
1933
1972
|
// src/domain/components/LoadingIndicatorComponent.ts
|
|
1934
|
-
var createLoadingIndicatorComponent = (
|
|
1973
|
+
var createLoadingIndicatorComponent = (props) => __spreadValues({
|
|
1935
1974
|
type: "loading-indicator",
|
|
1936
1975
|
kind: "layout"
|
|
1937
|
-
},
|
|
1976
|
+
}, props);
|
|
1938
1977
|
|
|
1939
1978
|
// src/domain/mappers/layout/loadingIndicatorLayoutToComponent.ts
|
|
1940
1979
|
var loadingIndicatorLayoutToComponent = (uid, { analyticsId, control, margin, size, tags }) => createLoadingIndicatorComponent({
|
|
@@ -1985,12 +2024,12 @@ var mediaLayoutToComponent = (uid, { analyticsId, align, control, margin, media,
|
|
|
1985
2024
|
});
|
|
1986
2025
|
|
|
1987
2026
|
// src/domain/components/ModalLayoutComponent.ts
|
|
1988
|
-
var createModalComponent = (
|
|
2027
|
+
var createModalComponent = (props) => __spreadProps(__spreadValues({
|
|
1989
2028
|
type: "modal-layout",
|
|
1990
2029
|
kind: "layout"
|
|
1991
|
-
},
|
|
2030
|
+
}, props), {
|
|
1992
2031
|
getChildren() {
|
|
1993
|
-
return
|
|
2032
|
+
return props.content.components;
|
|
1994
2033
|
}
|
|
1995
2034
|
});
|
|
1996
2035
|
|
|
@@ -2014,10 +2053,10 @@ var modalLayoutToComponent = (uid, { analyticsId, content, control, margin, tags
|
|
|
2014
2053
|
};
|
|
2015
2054
|
|
|
2016
2055
|
// src/domain/components/ParagraphComponent.ts
|
|
2017
|
-
var createParagraphComponent = (
|
|
2056
|
+
var createParagraphComponent = (props) => __spreadValues({
|
|
2018
2057
|
type: "paragraph",
|
|
2019
2058
|
kind: "layout"
|
|
2020
|
-
},
|
|
2059
|
+
}, props);
|
|
2021
2060
|
|
|
2022
2061
|
// src/domain/mappers/layout/paragraphLayoutToComponent.ts
|
|
2023
2062
|
var paragraphLayoutToComponent = (uid, { analyticsId, align, control, margin, size, tags, text }) => createParagraphComponent({
|
|
@@ -2032,10 +2071,10 @@ var paragraphLayoutToComponent = (uid, { analyticsId, align, control, margin, si
|
|
|
2032
2071
|
});
|
|
2033
2072
|
|
|
2034
2073
|
// src/domain/components/ProgressComponent.ts
|
|
2035
|
-
var createProgressComponent = (
|
|
2074
|
+
var createProgressComponent = (props) => __spreadValues({
|
|
2036
2075
|
type: "progress",
|
|
2037
2076
|
kind: "layout"
|
|
2038
|
-
},
|
|
2077
|
+
}, props);
|
|
2039
2078
|
|
|
2040
2079
|
// src/domain/mappers/layout/progressLayoutToComponent.ts
|
|
2041
2080
|
var progressLayoutToComponent = (uid, {
|
|
@@ -2064,10 +2103,10 @@ var progressLayoutToComponent = (uid, {
|
|
|
2064
2103
|
});
|
|
2065
2104
|
|
|
2066
2105
|
// src/domain/components/ReviewComponent.ts
|
|
2067
|
-
var createReviewComponent = (
|
|
2106
|
+
var createReviewComponent = (props) => __spreadValues({
|
|
2068
2107
|
type: "review",
|
|
2069
2108
|
kind: "layout"
|
|
2070
|
-
},
|
|
2109
|
+
}, props);
|
|
2071
2110
|
|
|
2072
2111
|
// src/domain/mappers/layout/reviewLayoutToComponent.ts
|
|
2073
2112
|
var reviewLayoutToComponent = (uid, {
|
|
@@ -2099,12 +2138,15 @@ var getCallToAction = ({
|
|
|
2099
2138
|
return getDomainLayerCallToAction(callToAction, mapperProps);
|
|
2100
2139
|
}
|
|
2101
2140
|
if (action == null ? void 0 : action.title) {
|
|
2141
|
+
const behavior = { type: "action", action, track: true };
|
|
2142
|
+
const { onBehavior, trackEvent } = mapperProps;
|
|
2102
2143
|
return {
|
|
2103
2144
|
type: "action",
|
|
2104
2145
|
title: action.title,
|
|
2105
2146
|
onClick: () => {
|
|
2106
|
-
void
|
|
2107
|
-
}
|
|
2147
|
+
void onBehavior(behavior);
|
|
2148
|
+
},
|
|
2149
|
+
hrefWithTracking: getHrefWithTracking({ behavior, onBehavior, trackEvent })
|
|
2108
2150
|
};
|
|
2109
2151
|
}
|
|
2110
2152
|
return void 0;
|
|
@@ -2174,8 +2216,8 @@ var debounce = (callback, waitMs) => {
|
|
|
2174
2216
|
|
|
2175
2217
|
// src/domain/components/searchComponent/SearchComponent.ts
|
|
2176
2218
|
var DEBOUNCE_TIME = 400;
|
|
2177
|
-
var createSearchComponent = (
|
|
2178
|
-
const { uid, analyticsId, control, emptyMessage, initialState, hint, margin, tags, title } =
|
|
2219
|
+
var createSearchComponent = (props, performSearch, onBehavior, onComponentUpdate) => {
|
|
2220
|
+
const { uid, analyticsId, control, emptyMessage, initialState, hint, margin, tags, title } = props;
|
|
2179
2221
|
const update = getInputUpdateFunction(onComponentUpdate);
|
|
2180
2222
|
let abortController = new AbortController();
|
|
2181
2223
|
const search = (component2, query, searchConfig) => {
|
|
@@ -2219,16 +2261,13 @@ var createSearchComponent = (searchProps, performSearch, onBehavior, onComponent
|
|
|
2219
2261
|
title,
|
|
2220
2262
|
isLoading: false,
|
|
2221
2263
|
query: "",
|
|
2222
|
-
|
|
2223
|
-
update(this, updateFn);
|
|
2224
|
-
},
|
|
2225
|
-
onChange(query) {
|
|
2264
|
+
setQuery(query) {
|
|
2226
2265
|
if (query.trim()) {
|
|
2227
|
-
|
|
2266
|
+
update(component, (draft) => {
|
|
2228
2267
|
draft.query = query;
|
|
2229
2268
|
draft.isLoading = true;
|
|
2230
2269
|
});
|
|
2231
|
-
debouncedSearch(
|
|
2270
|
+
debouncedSearch(component, query.trim());
|
|
2232
2271
|
} else {
|
|
2233
2272
|
abortController.abort();
|
|
2234
2273
|
debouncedSearch.cancel();
|
|
@@ -2240,15 +2279,15 @@ var createSearchComponent = (searchProps, performSearch, onBehavior, onComponent
|
|
|
2240
2279
|
});
|
|
2241
2280
|
}
|
|
2242
2281
|
},
|
|
2243
|
-
|
|
2282
|
+
selectResult({ type, value }) {
|
|
2244
2283
|
if (type === "action") {
|
|
2245
|
-
void onBehavior({ type: "action", action: value });
|
|
2284
|
+
void onBehavior({ type: "action", action: value, track: false });
|
|
2246
2285
|
} else {
|
|
2247
|
-
|
|
2286
|
+
update(component, (draft) => {
|
|
2248
2287
|
draft.query = value.query;
|
|
2249
2288
|
draft.isLoading = true;
|
|
2250
2289
|
});
|
|
2251
|
-
search(
|
|
2290
|
+
search(component, value.query, {
|
|
2252
2291
|
method: value.method,
|
|
2253
2292
|
param: value.param,
|
|
2254
2293
|
url: value.url
|
|
@@ -2399,15 +2438,13 @@ var emptyInitialState = {
|
|
|
2399
2438
|
};
|
|
2400
2439
|
|
|
2401
2440
|
// src/domain/components/SectionComponent.ts
|
|
2402
|
-
var createSectionComponent = (props) => {
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
});
|
|
2410
|
-
};
|
|
2441
|
+
var createSectionComponent = (props) => __spreadProps(__spreadValues({}, props), {
|
|
2442
|
+
type: "section",
|
|
2443
|
+
kind: "layout",
|
|
2444
|
+
getChildren() {
|
|
2445
|
+
return props.components;
|
|
2446
|
+
}
|
|
2447
|
+
});
|
|
2411
2448
|
|
|
2412
2449
|
// src/domain/mappers/layout/sectionLayoutToComponent.ts
|
|
2413
2450
|
var sectionLayoutToComponent = (uid, { analyticsId, control, title, components, callToAction, margin, tags }, mapperProps, schemaComponents) => {
|
|
@@ -2440,7 +2477,7 @@ var statusListLayoutToComponent = (uid, { analyticsId, control, items, margin, t
|
|
|
2440
2477
|
});
|
|
2441
2478
|
|
|
2442
2479
|
// src/domain/components/TabsComponent.ts
|
|
2443
|
-
var createTabsComponent = (
|
|
2480
|
+
var createTabsComponent = (props) => __spreadProps(__spreadValues({}, props), {
|
|
2444
2481
|
type: "tabs",
|
|
2445
2482
|
kind: "layout"
|
|
2446
2483
|
});
|
|
@@ -2468,19 +2505,19 @@ var mapTabs = (tabs, uid, mapperProps, schemaComponents) => tabs.map(({ componen
|
|
|
2468
2505
|
}));
|
|
2469
2506
|
|
|
2470
2507
|
// src/domain/components/UpsellComponent.ts
|
|
2471
|
-
var createUpsellComponent = (
|
|
2508
|
+
var createUpsellComponent = (props, onComponentUpdate) => {
|
|
2472
2509
|
const update = getInputUpdateFunction(onComponentUpdate);
|
|
2473
|
-
const _a =
|
|
2510
|
+
const _a = props, { dismiss } = _a, restProps = __objRest(_a, ["dismiss"]);
|
|
2474
2511
|
const component = __spreadProps(__spreadValues({
|
|
2475
2512
|
type: "upsell",
|
|
2476
2513
|
kind: "layout"
|
|
2477
2514
|
}, restProps), {
|
|
2478
2515
|
visible: true,
|
|
2479
|
-
|
|
2516
|
+
dismiss: dismiss ? () => {
|
|
2480
2517
|
update(component, (draft) => {
|
|
2481
2518
|
draft.visible = false;
|
|
2482
2519
|
});
|
|
2483
|
-
|
|
2520
|
+
dismiss();
|
|
2484
2521
|
} : void 0
|
|
2485
2522
|
});
|
|
2486
2523
|
return component;
|
|
@@ -2499,7 +2536,7 @@ var upsellLayoutToComponent = (uid, { analyticsId, callToAction, control, margin
|
|
|
2499
2536
|
media: getDomainLayerMedia({ media }),
|
|
2500
2537
|
tags,
|
|
2501
2538
|
text,
|
|
2502
|
-
|
|
2539
|
+
dismiss: onDismiss ? () => {
|
|
2503
2540
|
const { url, method } = onDismiss;
|
|
2504
2541
|
const body = method === "GET" ? void 0 : JSON.stringify(onDismiss.body);
|
|
2505
2542
|
void mapperProps.httpClient(url, { method, body }).catch(() => {
|
|
@@ -2581,26 +2618,27 @@ var modalToComponent = (uid, { content, title }, mapperProps, schemaComponents)
|
|
|
2581
2618
|
// src/domain/components/step/ExternalConfirmationComponent.ts
|
|
2582
2619
|
var createExternalConfirmation = (uid, url, onLink, onComponentUpdate) => {
|
|
2583
2620
|
const update = getInputUpdateFunction(onComponentUpdate);
|
|
2584
|
-
|
|
2621
|
+
const component = {
|
|
2585
2622
|
type: "external-confirmation",
|
|
2586
2623
|
kind: "layout",
|
|
2587
2624
|
uid,
|
|
2588
2625
|
url,
|
|
2589
2626
|
status: "initial",
|
|
2590
2627
|
open() {
|
|
2591
|
-
if (
|
|
2592
|
-
const success = onLink(
|
|
2593
|
-
update(
|
|
2628
|
+
if (component.status === "initial" || component.status === "failure") {
|
|
2629
|
+
const success = onLink(component.url);
|
|
2630
|
+
update(component, (draft) => {
|
|
2594
2631
|
draft.status = success ? "success" : "failure";
|
|
2595
2632
|
});
|
|
2596
2633
|
}
|
|
2597
2634
|
},
|
|
2598
2635
|
onCancel() {
|
|
2599
|
-
update(
|
|
2636
|
+
update(component, (draft) => {
|
|
2600
2637
|
draft.status = "dismissed";
|
|
2601
2638
|
});
|
|
2602
2639
|
}
|
|
2603
2640
|
};
|
|
2641
|
+
return component;
|
|
2604
2642
|
};
|
|
2605
2643
|
|
|
2606
2644
|
// src/utils/recursiveMerge.ts
|
|
@@ -2650,8 +2688,26 @@ var getSubmittableDataSync = (components) => components.map((component) => compo
|
|
|
2650
2688
|
var getLocalValues = (components) => components.map((component) => component.getLocalValue()).reduce((acc, value) => recursiveMerge(acc, value), null);
|
|
2651
2689
|
|
|
2652
2690
|
// src/domain/components/step/StepDomainComponent.ts
|
|
2653
|
-
var createStepComponent = (
|
|
2654
|
-
const _a =
|
|
2691
|
+
var createStepComponent = (props) => {
|
|
2692
|
+
const _a = props, {
|
|
2693
|
+
uid,
|
|
2694
|
+
stepPolling,
|
|
2695
|
+
stepRefreshAfter,
|
|
2696
|
+
stepPrefetch,
|
|
2697
|
+
features,
|
|
2698
|
+
logEvent,
|
|
2699
|
+
onComponentUpdate,
|
|
2700
|
+
onLoad
|
|
2701
|
+
} = _a, rest = __objRest(_a, [
|
|
2702
|
+
"uid",
|
|
2703
|
+
"stepPolling",
|
|
2704
|
+
"stepRefreshAfter",
|
|
2705
|
+
"stepPrefetch",
|
|
2706
|
+
"features",
|
|
2707
|
+
"logEvent",
|
|
2708
|
+
"onComponentUpdate",
|
|
2709
|
+
"onLoad"
|
|
2710
|
+
]);
|
|
2655
2711
|
const update = getInputUpdateFunction(onComponentUpdate);
|
|
2656
2712
|
const component = __spreadProps(__spreadValues({
|
|
2657
2713
|
uid
|
|
@@ -2664,78 +2720,73 @@ var createStepComponent = (stepProps) => {
|
|
|
2664
2720
|
subflow: null,
|
|
2665
2721
|
dismissModal() {
|
|
2666
2722
|
var _a2;
|
|
2667
|
-
(_a2 =
|
|
2723
|
+
(_a2 = component.modals.at(-1)) == null ? void 0 : _a2.close();
|
|
2668
2724
|
},
|
|
2669
2725
|
dismissAllModals() {
|
|
2670
|
-
|
|
2726
|
+
update(component, (draft) => {
|
|
2671
2727
|
draft.modals = draft.modals.map((m) => __spreadProps(__spreadValues({}, m), { open: false }));
|
|
2672
2728
|
});
|
|
2673
2729
|
},
|
|
2674
2730
|
showModal(modal) {
|
|
2675
|
-
|
|
2731
|
+
update(component, (draft) => {
|
|
2676
2732
|
draft.modals = [...draft.modals, modal];
|
|
2677
2733
|
});
|
|
2678
2734
|
},
|
|
2679
|
-
_update(updateFn) {
|
|
2680
|
-
update(this, updateFn);
|
|
2681
|
-
},
|
|
2682
2735
|
getChildren() {
|
|
2683
|
-
return
|
|
2736
|
+
return component.externalConfirmation ? [...component.layoutComponents, component.externalConfirmation] : component.layoutComponents;
|
|
2684
2737
|
},
|
|
2685
2738
|
getModals() {
|
|
2686
|
-
return
|
|
2739
|
+
return component.modals;
|
|
2687
2740
|
},
|
|
2688
2741
|
async getSubmittableValue() {
|
|
2689
|
-
return getSubmittableData(
|
|
2742
|
+
return getSubmittableData(component.schemaComponents);
|
|
2690
2743
|
},
|
|
2691
2744
|
getSubmittableValueSync() {
|
|
2692
|
-
return getSubmittableDataSync(
|
|
2745
|
+
return getSubmittableDataSync(component.schemaComponents);
|
|
2693
2746
|
},
|
|
2694
2747
|
getLocalValue() {
|
|
2695
|
-
return getLocalValues(
|
|
2748
|
+
return getLocalValues(component.schemaComponents);
|
|
2696
2749
|
},
|
|
2697
2750
|
validate() {
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
}
|
|
2703
|
-
);
|
|
2751
|
+
const isStrict = features.isEnabled("validateUnreferencedSchemas");
|
|
2752
|
+
return component.schemaComponents.map(
|
|
2753
|
+
(inputComponent) => validateInputComponent(component, inputComponent, isStrict, logEvent)
|
|
2754
|
+
).every(Boolean);
|
|
2704
2755
|
},
|
|
2705
2756
|
setLoadingState(loadingState) {
|
|
2706
|
-
|
|
2757
|
+
update(component, (draft) => {
|
|
2707
2758
|
draft.loadingState = loadingState;
|
|
2708
2759
|
});
|
|
2709
2760
|
},
|
|
2710
2761
|
addSubflow(subflow) {
|
|
2711
|
-
|
|
2762
|
+
update(component, (draft) => {
|
|
2712
2763
|
draft.subflow = subflow;
|
|
2713
2764
|
});
|
|
2714
2765
|
},
|
|
2715
2766
|
closeSubflow() {
|
|
2716
|
-
if (!
|
|
2767
|
+
if (!component.subflow) {
|
|
2717
2768
|
return;
|
|
2718
2769
|
}
|
|
2719
|
-
|
|
2770
|
+
update(component, (draft) => {
|
|
2720
2771
|
draft.subflow = null;
|
|
2721
2772
|
});
|
|
2722
2773
|
},
|
|
2723
2774
|
start() {
|
|
2724
|
-
if (
|
|
2775
|
+
if (component.state === "initial") {
|
|
2725
2776
|
onLoad == null ? void 0 : onLoad();
|
|
2726
2777
|
}
|
|
2727
|
-
|
|
2778
|
+
update(component, (draft) => {
|
|
2728
2779
|
draft.state = "started";
|
|
2729
2780
|
});
|
|
2730
2781
|
stepPolling == null ? void 0 : stepPolling.start();
|
|
2731
2782
|
stepRefreshAfter == null ? void 0 : stepRefreshAfter.start();
|
|
2732
|
-
stepPrefetch.start(
|
|
2783
|
+
stepPrefetch.start(component.getSubmittableValueSync());
|
|
2733
2784
|
},
|
|
2734
2785
|
stop() {
|
|
2735
2786
|
stepPolling == null ? void 0 : stepPolling.stop();
|
|
2736
2787
|
stepRefreshAfter == null ? void 0 : stepRefreshAfter.stop();
|
|
2737
2788
|
stepPrefetch.stop();
|
|
2738
|
-
|
|
2789
|
+
update(component, (draft) => {
|
|
2739
2790
|
draft.state = "stopped";
|
|
2740
2791
|
draft.modals = [];
|
|
2741
2792
|
});
|
|
@@ -2743,6 +2794,22 @@ var createStepComponent = (stepProps) => {
|
|
|
2743
2794
|
});
|
|
2744
2795
|
return component;
|
|
2745
2796
|
};
|
|
2797
|
+
var validateInputComponent = (component, inputComponent, isStrict, logEvent) => {
|
|
2798
|
+
var _a;
|
|
2799
|
+
const isSchemaReferenced = component.referencedSchemaIds.includes((_a = inputComponent.schemaId) != null ? _a : "");
|
|
2800
|
+
const isValid = inputComponent.validate();
|
|
2801
|
+
if (!isSchemaReferenced && !isValid) {
|
|
2802
|
+
logEvent(
|
|
2803
|
+
isStrict ? "error" : "warning",
|
|
2804
|
+
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.",
|
|
2805
|
+
{
|
|
2806
|
+
unreferencedSchemaId: inputComponent.schemaId,
|
|
2807
|
+
componentUid: component.uid
|
|
2808
|
+
}
|
|
2809
|
+
);
|
|
2810
|
+
}
|
|
2811
|
+
return isSchemaReferenced || isStrict ? isValid : true;
|
|
2812
|
+
};
|
|
2746
2813
|
|
|
2747
2814
|
// src/domain/features/polling/getStepPolling.ts
|
|
2748
2815
|
var getStepPolling = ({
|
|
@@ -2981,7 +3048,8 @@ var executeRequest = async (props) => {
|
|
|
2981
3048
|
type: "behavior",
|
|
2982
3049
|
behavior: {
|
|
2983
3050
|
type: "action",
|
|
2984
|
-
action: responseBody.action
|
|
3051
|
+
action: responseBody.action,
|
|
3052
|
+
track: false
|
|
2985
3053
|
}
|
|
2986
3054
|
};
|
|
2987
3055
|
}
|
|
@@ -2992,7 +3060,8 @@ var executeRequest = async (props) => {
|
|
|
2992
3060
|
behavior: __spreadProps(__spreadValues({}, responseBody), {
|
|
2993
3061
|
type: "subflow",
|
|
2994
3062
|
onCompletion: responseBody.onCompletion ? normaliseBehavior(responseBody.onCompletion, []) : void 0,
|
|
2995
|
-
onError: responseBody.onError ? normaliseBehavior(responseBody.onError, []) : void 0
|
|
3063
|
+
onError: responseBody.onError ? normaliseBehavior(responseBody.onError, []) : void 0,
|
|
3064
|
+
track: false
|
|
2996
3065
|
})
|
|
2997
3066
|
} : {
|
|
2998
3067
|
type: "error",
|
|
@@ -3001,7 +3070,7 @@ var executeRequest = async (props) => {
|
|
|
3001
3070
|
}
|
|
3002
3071
|
case "modal": {
|
|
3003
3072
|
assertModalResponseBody(responseBody);
|
|
3004
|
-
return !isInitial ? { type: "behavior", behavior: __spreadProps(__spreadValues({}, responseBody), { type: "modal" }) } : {
|
|
3073
|
+
return !isInitial ? { type: "behavior", behavior: __spreadProps(__spreadValues({}, responseBody), { type: "modal", track: false }) } : {
|
|
3005
3074
|
type: "error",
|
|
3006
3075
|
body: { errors: { error: "Cannot show modal without a current step" } }
|
|
3007
3076
|
};
|
|
@@ -3163,7 +3232,7 @@ var getStepRefreshAfter = ({
|
|
|
3163
3232
|
const start = () => {
|
|
3164
3233
|
const timeLeft = Math.max(targetTime - Date.now(), ONE_SECOND);
|
|
3165
3234
|
timeout = setTimeout(() => {
|
|
3166
|
-
void onBehavior({ type: "refresh", analytics: { schema: "refreshAfter" } });
|
|
3235
|
+
void onBehavior({ type: "refresh", analytics: { schema: "refreshAfter" }, track: false });
|
|
3167
3236
|
}, timeLeft);
|
|
3168
3237
|
};
|
|
3169
3238
|
return {
|
|
@@ -3316,8 +3385,8 @@ var getComponentValidationAsync = (update, performValidationAsync) => (
|
|
|
3316
3385
|
var getDebouncedComponentValidationAsync = (update, performValidationAsync) => debounce(getComponentValidationAsync(update, performValidationAsync), 1e3);
|
|
3317
3386
|
|
|
3318
3387
|
// src/domain/components/NumberInputComponent.ts
|
|
3319
|
-
var createNumberInputComponent = (
|
|
3320
|
-
const _a =
|
|
3388
|
+
var createNumberInputComponent = (props, onComponentUpdate) => {
|
|
3389
|
+
const _a = props, {
|
|
3321
3390
|
uid,
|
|
3322
3391
|
id,
|
|
3323
3392
|
checks,
|
|
@@ -3340,16 +3409,13 @@ var createNumberInputComponent = (numberInputProps, onComponentUpdate) => {
|
|
|
3340
3409
|
const getValidationErrors = getLocalValueValidator(checks);
|
|
3341
3410
|
const performOnChange = getDebouncedSchemaOnChange(schemaOnChange, getValidationErrors);
|
|
3342
3411
|
const validateAsync = performValidationAsync ? getDebouncedComponentValidationAsync(update, performValidationAsync) : void 0;
|
|
3343
|
-
const
|
|
3412
|
+
const component = __spreadValues({
|
|
3344
3413
|
type: "number",
|
|
3345
3414
|
kind: "input",
|
|
3346
3415
|
uid,
|
|
3347
3416
|
id,
|
|
3348
|
-
_update(updateFn) {
|
|
3349
|
-
update(this, updateFn);
|
|
3350
|
-
},
|
|
3351
3417
|
onBlur() {
|
|
3352
|
-
const isValid =
|
|
3418
|
+
const isValid = component.validate();
|
|
3353
3419
|
performOnChange == null ? void 0 : performOnChange.flush();
|
|
3354
3420
|
if (isValid) {
|
|
3355
3421
|
void (onPersistAsync == null ? void 0 : onPersistAsync().catch(() => {
|
|
@@ -3360,9 +3426,9 @@ var createNumberInputComponent = (numberInputProps, onComponentUpdate) => {
|
|
|
3360
3426
|
onFocus() {
|
|
3361
3427
|
},
|
|
3362
3428
|
// Noop
|
|
3363
|
-
|
|
3364
|
-
const prevValue =
|
|
3365
|
-
|
|
3429
|
+
setValue(updatedValue) {
|
|
3430
|
+
const prevValue = component.value;
|
|
3431
|
+
update(component, (draft) => {
|
|
3366
3432
|
draft.errors = [];
|
|
3367
3433
|
draft.validationAsyncState.messages = {};
|
|
3368
3434
|
draft.value = updatedValue;
|
|
@@ -3370,32 +3436,32 @@ var createNumberInputComponent = (numberInputProps, onComponentUpdate) => {
|
|
|
3370
3436
|
performOnChange == null ? void 0 : performOnChange(prevValue, updatedValue);
|
|
3371
3437
|
const isValid = getValidationErrors(updatedValue).length === 0;
|
|
3372
3438
|
if (isValid) {
|
|
3373
|
-
validateAsync == null ? void 0 : validateAsync(
|
|
3439
|
+
validateAsync == null ? void 0 : validateAsync(component, updatedValue);
|
|
3374
3440
|
}
|
|
3375
3441
|
onValueChange();
|
|
3376
3442
|
},
|
|
3377
3443
|
async getSubmittableValue() {
|
|
3378
|
-
return
|
|
3444
|
+
return component.getSubmittableValueSync();
|
|
3379
3445
|
},
|
|
3380
3446
|
getSubmittableValueSync() {
|
|
3381
3447
|
var _a2;
|
|
3382
|
-
return (_a2 =
|
|
3448
|
+
return (_a2 = component.getLocalValue()) != null ? _a2 : null;
|
|
3383
3449
|
},
|
|
3384
3450
|
getSummary() {
|
|
3385
|
-
return summariser(
|
|
3451
|
+
return summariser(component.getLocalValue());
|
|
3386
3452
|
},
|
|
3387
3453
|
getLocalValue() {
|
|
3388
|
-
return
|
|
3454
|
+
return component.value;
|
|
3389
3455
|
},
|
|
3390
3456
|
validate() {
|
|
3391
|
-
const errors = getValidationErrors(
|
|
3392
|
-
|
|
3457
|
+
const errors = getValidationErrors(component.getLocalValue());
|
|
3458
|
+
update(component, (draft) => {
|
|
3393
3459
|
draft.errors = errors;
|
|
3394
3460
|
});
|
|
3395
3461
|
return errors.length === 0;
|
|
3396
3462
|
}
|
|
3397
3463
|
}, rest);
|
|
3398
|
-
return
|
|
3464
|
+
return component;
|
|
3399
3465
|
};
|
|
3400
3466
|
|
|
3401
3467
|
// src/domain/features/schema-on-change/getSchemaOnChange.ts
|
|
@@ -3427,7 +3493,8 @@ var getBehaviorFromSchemaRefreshStepOnChange = (schema) => {
|
|
|
3427
3493
|
const behavior = {
|
|
3428
3494
|
type: "refresh",
|
|
3429
3495
|
analytics: { schema: (_c = analyticsId != null ? analyticsId : $id) != null ? _c : "" },
|
|
3430
|
-
url: refreshUrl != null ? refreshUrl : refreshFormUrl
|
|
3496
|
+
url: refreshUrl != null ? refreshUrl : refreshFormUrl,
|
|
3497
|
+
track: false
|
|
3431
3498
|
};
|
|
3432
3499
|
return behavior;
|
|
3433
3500
|
}
|
|
@@ -3883,7 +3950,7 @@ var isStringSchemaWithUpload = (schema) => isStringSchema(schema) && schema.form
|
|
|
3883
3950
|
var isSchemaWithPersistAsync = (schema) => "persistAsync" in schema && !isNullish(schema.persistAsync);
|
|
3884
3951
|
|
|
3885
3952
|
// src/domain/components/AllOfComponent.ts
|
|
3886
|
-
var createAllOfComponent = (
|
|
3953
|
+
var createAllOfComponent = (props) => {
|
|
3887
3954
|
const {
|
|
3888
3955
|
uid,
|
|
3889
3956
|
schemaId,
|
|
@@ -3897,8 +3964,8 @@ var createAllOfComponent = (allOfProps) => {
|
|
|
3897
3964
|
media,
|
|
3898
3965
|
title,
|
|
3899
3966
|
tags
|
|
3900
|
-
} =
|
|
3901
|
-
|
|
3967
|
+
} = props;
|
|
3968
|
+
const component = {
|
|
3902
3969
|
type: "all-of",
|
|
3903
3970
|
kind: "input",
|
|
3904
3971
|
uid,
|
|
@@ -3914,24 +3981,25 @@ var createAllOfComponent = (allOfProps) => {
|
|
|
3914
3981
|
title,
|
|
3915
3982
|
tags,
|
|
3916
3983
|
getChildren() {
|
|
3917
|
-
return
|
|
3984
|
+
return component.components;
|
|
3918
3985
|
},
|
|
3919
3986
|
getSummary() {
|
|
3920
|
-
return summariseFromChildren(
|
|
3987
|
+
return summariseFromChildren(component.getChildren());
|
|
3921
3988
|
},
|
|
3922
3989
|
async getSubmittableValue() {
|
|
3923
|
-
return getSubmittableData(
|
|
3990
|
+
return getSubmittableData(component.components);
|
|
3924
3991
|
},
|
|
3925
3992
|
getSubmittableValueSync() {
|
|
3926
|
-
return getSubmittableDataSync(
|
|
3993
|
+
return getSubmittableDataSync(component.components);
|
|
3927
3994
|
},
|
|
3928
3995
|
getLocalValue() {
|
|
3929
|
-
return getLocalValues(
|
|
3996
|
+
return getLocalValues(component.components);
|
|
3930
3997
|
},
|
|
3931
3998
|
validate() {
|
|
3932
|
-
return hidden ? true : validateComponents(
|
|
3999
|
+
return hidden ? true : validateComponents(component.getChildren());
|
|
3933
4000
|
}
|
|
3934
4001
|
};
|
|
4002
|
+
return component;
|
|
3935
4003
|
};
|
|
3936
4004
|
|
|
3937
4005
|
// src/domain/mappers/schema/allOfSchemaToComponent.ts
|
|
@@ -3957,8 +4025,8 @@ var allOfSchemaToComponent = (schemaMapperProps, mapperProps) => {
|
|
|
3957
4025
|
};
|
|
3958
4026
|
|
|
3959
4027
|
// src/domain/components/RepeatableComponent.ts
|
|
3960
|
-
var createRepeatableComponent = (
|
|
3961
|
-
const _a =
|
|
4028
|
+
var createRepeatableComponent = (props, onComponentUpdate) => {
|
|
4029
|
+
const _a = props, {
|
|
3962
4030
|
uid,
|
|
3963
4031
|
schemaId,
|
|
3964
4032
|
analyticsId,
|
|
@@ -3981,7 +4049,7 @@ var createRepeatableComponent = (repeatableProps, onComponentUpdate) => {
|
|
|
3981
4049
|
]);
|
|
3982
4050
|
const update = getInputUpdateFunction(onComponentUpdate);
|
|
3983
4051
|
const getValidationErrors = getLocalValueValidator(checks);
|
|
3984
|
-
const
|
|
4052
|
+
const component = __spreadProps(__spreadValues({
|
|
3985
4053
|
uid,
|
|
3986
4054
|
schemaId,
|
|
3987
4055
|
analyticsId,
|
|
@@ -3996,37 +4064,34 @@ var createRepeatableComponent = (repeatableProps, onComponentUpdate) => {
|
|
|
3996
4064
|
media: summary == null ? void 0 : summary.defaultMedia
|
|
3997
4065
|
}
|
|
3998
4066
|
}, componentProps), {
|
|
3999
|
-
|
|
4000
|
-
update(
|
|
4001
|
-
},
|
|
4002
|
-
onEdit(itemIndex) {
|
|
4003
|
-
this._update((draft) => {
|
|
4067
|
+
editComponent(itemIndex) {
|
|
4068
|
+
update(component, (draft) => {
|
|
4004
4069
|
draft.editableComponent = createEditableComponent(
|
|
4005
4070
|
draft.components[itemIndex].getLocalValue()
|
|
4006
4071
|
);
|
|
4007
4072
|
draft.editableIndex = itemIndex;
|
|
4008
4073
|
});
|
|
4009
4074
|
},
|
|
4010
|
-
|
|
4011
|
-
|
|
4075
|
+
addComponent() {
|
|
4076
|
+
update(component, (draft) => {
|
|
4012
4077
|
draft.editableComponent = createEditableComponent(null);
|
|
4013
4078
|
draft.editableIndex = null;
|
|
4014
4079
|
draft.errors = [];
|
|
4015
4080
|
});
|
|
4016
4081
|
},
|
|
4017
|
-
|
|
4082
|
+
saveComponent() {
|
|
4018
4083
|
var _a2;
|
|
4019
|
-
const isValid = (_a2 =
|
|
4084
|
+
const isValid = (_a2 = component.editableComponent) == null ? void 0 : _a2.validate();
|
|
4020
4085
|
if (!isValid) {
|
|
4021
4086
|
return false;
|
|
4022
4087
|
}
|
|
4023
|
-
|
|
4088
|
+
update(component, (draft) => {
|
|
4024
4089
|
if (draft.editableComponent === null) {
|
|
4025
4090
|
return;
|
|
4026
4091
|
}
|
|
4027
4092
|
if (draft.editableIndex === null) {
|
|
4028
4093
|
const newComponent = __spreadValues({}, draft.editableComponent);
|
|
4029
|
-
draft.components = [...
|
|
4094
|
+
draft.components = [...component.components, newComponent];
|
|
4030
4095
|
} else {
|
|
4031
4096
|
draft.components[draft.editableIndex] = __spreadProps(__spreadValues({}, draft.editableComponent), {
|
|
4032
4097
|
uid: draft.components[draft.editableIndex].uid
|
|
@@ -4038,8 +4103,8 @@ var createRepeatableComponent = (repeatableProps, onComponentUpdate) => {
|
|
|
4038
4103
|
onValueChange();
|
|
4039
4104
|
return true;
|
|
4040
4105
|
},
|
|
4041
|
-
|
|
4042
|
-
|
|
4106
|
+
removeComponent() {
|
|
4107
|
+
update(component, (draft) => {
|
|
4043
4108
|
if (draft.editableIndex === null) {
|
|
4044
4109
|
return;
|
|
4045
4110
|
}
|
|
@@ -4050,30 +4115,32 @@ var createRepeatableComponent = (repeatableProps, onComponentUpdate) => {
|
|
|
4050
4115
|
onValueChange();
|
|
4051
4116
|
},
|
|
4052
4117
|
getChildren() {
|
|
4053
|
-
return
|
|
4118
|
+
return component.editableComponent !== null ? [...component.components, component.editableComponent] : component.components;
|
|
4054
4119
|
},
|
|
4055
4120
|
async getSubmittableValue() {
|
|
4056
|
-
return Promise.all(
|
|
4121
|
+
return Promise.all(
|
|
4122
|
+
component.components.map(async (childComponent) => childComponent.getSubmittableValue())
|
|
4123
|
+
);
|
|
4057
4124
|
},
|
|
4058
4125
|
getSubmittableValueSync() {
|
|
4059
|
-
return
|
|
4126
|
+
return component.components.map((childComponent) => childComponent.getSubmittableValueSync());
|
|
4060
4127
|
},
|
|
4061
4128
|
getSummary() {
|
|
4062
4129
|
return summariser(null);
|
|
4063
4130
|
},
|
|
4064
4131
|
getLocalValue() {
|
|
4065
|
-
return
|
|
4132
|
+
return component.components.map((childComponent) => childComponent.getLocalValue());
|
|
4066
4133
|
},
|
|
4067
4134
|
validate() {
|
|
4068
|
-
const messages = getValidationErrors(
|
|
4069
|
-
const childComponentsValid = validateComponents(
|
|
4070
|
-
|
|
4135
|
+
const messages = getValidationErrors(component.getLocalValue());
|
|
4136
|
+
const childComponentsValid = validateComponents(component.getChildren());
|
|
4137
|
+
update(component, (draft) => {
|
|
4071
4138
|
draft.errors = messages;
|
|
4072
4139
|
});
|
|
4073
4140
|
return messages.length === 0 && childComponentsValid;
|
|
4074
4141
|
}
|
|
4075
4142
|
});
|
|
4076
|
-
return
|
|
4143
|
+
return component;
|
|
4077
4144
|
};
|
|
4078
4145
|
|
|
4079
4146
|
// src/domain/mappers/schema/arraySchemaToComponent/arraySchemaToRepeatableComponent.ts
|
|
@@ -4223,8 +4290,8 @@ var base64ToBytes = (base64) => {
|
|
|
4223
4290
|
};
|
|
4224
4291
|
|
|
4225
4292
|
// src/domain/components/MultiUploadInputComponent.ts
|
|
4226
|
-
var createMultiUploadInputComponent = (
|
|
4227
|
-
const _a =
|
|
4293
|
+
var createMultiUploadInputComponent = (props, onComponentUpdate) => {
|
|
4294
|
+
const _a = props, {
|
|
4228
4295
|
uid,
|
|
4229
4296
|
id,
|
|
4230
4297
|
checks,
|
|
@@ -4247,77 +4314,74 @@ var createMultiUploadInputComponent = (uploadInputProps, onComponentUpdate) => {
|
|
|
4247
4314
|
const getValidationErrors = getLocalValueValidator(checks);
|
|
4248
4315
|
const getFileValidationErrors = getLocalValueValidator(fileChecks);
|
|
4249
4316
|
const persist = performPersistAsync ? getComponentMultiPersistAsync(update, performPersistAsync) : void 0;
|
|
4250
|
-
const
|
|
4317
|
+
const component = __spreadValues({
|
|
4251
4318
|
type: "multi-upload",
|
|
4252
4319
|
kind: "input",
|
|
4253
4320
|
uid,
|
|
4254
4321
|
id,
|
|
4255
4322
|
format,
|
|
4256
4323
|
files: [],
|
|
4257
|
-
_update(updateFn) {
|
|
4258
|
-
update(this, updateFn);
|
|
4259
|
-
},
|
|
4260
4324
|
onBlur() {
|
|
4261
|
-
|
|
4325
|
+
component.validate();
|
|
4262
4326
|
},
|
|
4263
4327
|
onFocus() {
|
|
4264
4328
|
},
|
|
4265
4329
|
// Noop
|
|
4266
|
-
async
|
|
4330
|
+
async removeFile(index) {
|
|
4267
4331
|
var _a2;
|
|
4268
|
-
|
|
4332
|
+
update(component, (draft) => {
|
|
4269
4333
|
draft.value.splice(index, 1);
|
|
4270
4334
|
draft.files.splice(index, 1);
|
|
4271
4335
|
});
|
|
4272
4336
|
if (persist) {
|
|
4273
|
-
(_a2 =
|
|
4274
|
-
|
|
4337
|
+
(_a2 = component.persistedState[index]) == null ? void 0 : _a2.abortController.abort();
|
|
4338
|
+
update(component, (draft) => {
|
|
4275
4339
|
draft.persistedState.splice(index, 1);
|
|
4276
4340
|
});
|
|
4277
4341
|
}
|
|
4278
4342
|
},
|
|
4279
|
-
async
|
|
4343
|
+
async insertFile(index, file) {
|
|
4280
4344
|
const fileErrors = getFileValidationErrors(file);
|
|
4281
4345
|
const fileId = getRandomId();
|
|
4282
4346
|
const base64Value = format === "base64" ? await toBase64(file) : null;
|
|
4283
|
-
|
|
4347
|
+
update(component, (draft) => {
|
|
4284
4348
|
draft.value.splice(index, 0, file);
|
|
4285
4349
|
draft.files.splice(index, 0, { file, id: fileId, errors: fileErrors, base64Value });
|
|
4286
4350
|
draft.errors = [];
|
|
4287
4351
|
});
|
|
4288
4352
|
if (persist) {
|
|
4289
|
-
await persist(
|
|
4353
|
+
await persist(component, index, format === "blob" ? file : base64Value);
|
|
4290
4354
|
}
|
|
4291
4355
|
onValueChange();
|
|
4292
4356
|
return fileId;
|
|
4293
4357
|
},
|
|
4294
4358
|
async getSubmittableValue() {
|
|
4295
4359
|
if (persist) {
|
|
4296
|
-
return Promise.all(
|
|
4360
|
+
return Promise.all(component.persistedState.map(async ({ submission }) => submission));
|
|
4297
4361
|
}
|
|
4298
|
-
return
|
|
4362
|
+
return component.files.map(({ base64Value }) => base64Value);
|
|
4299
4363
|
},
|
|
4300
4364
|
getSubmittableValueSync() {
|
|
4301
4365
|
if (persist) {
|
|
4302
|
-
return
|
|
4366
|
+
return component.persistedState.map(({ lastResponse }) => lastResponse);
|
|
4303
4367
|
}
|
|
4304
|
-
return
|
|
4368
|
+
return component.files.map(({ base64Value }) => base64Value);
|
|
4305
4369
|
},
|
|
4306
4370
|
getSummary() {
|
|
4307
|
-
return summariser(
|
|
4371
|
+
return summariser(component.getLocalValue().map(({ name }) => name));
|
|
4308
4372
|
},
|
|
4309
4373
|
getLocalValue() {
|
|
4310
|
-
return
|
|
4374
|
+
return component.value;
|
|
4311
4375
|
},
|
|
4312
4376
|
validate() {
|
|
4313
|
-
const errorMsgs = getValidationErrors(
|
|
4314
|
-
|
|
4377
|
+
const errorMsgs = getValidationErrors(component.getLocalValue());
|
|
4378
|
+
update(component, (draft) => {
|
|
4315
4379
|
draft.errors = errorMsgs;
|
|
4316
4380
|
});
|
|
4317
|
-
return errorMsgs.length === 0 &&
|
|
4381
|
+
return errorMsgs.length === 0 && component.files.every(({ errors }) => errors.length === 0);
|
|
4318
4382
|
}
|
|
4319
4383
|
}, rest);
|
|
4320
|
-
return
|
|
4384
|
+
return component;
|
|
4321
4385
|
};
|
|
4322
4386
|
|
|
4323
4387
|
// src/domain/features/persistAsync/getInitialPersistedState.ts
|
|
@@ -4471,8 +4535,8 @@ var getPersistAsyncConfig = (schema) => {
|
|
|
4471
4535
|
var getValueForPersistAsync = (localValue) => isArray(localValue) && localValue.every(isFile) ? localValue : [];
|
|
4472
4536
|
|
|
4473
4537
|
// src/domain/components/MultiSelectInputComponent.ts
|
|
4474
|
-
var createMultiSelectComponent = (
|
|
4475
|
-
const _a =
|
|
4538
|
+
var createMultiSelectComponent = (props, onComponentUpdate) => {
|
|
4539
|
+
const _a = props, {
|
|
4476
4540
|
uid,
|
|
4477
4541
|
checks,
|
|
4478
4542
|
options,
|
|
@@ -4503,21 +4567,18 @@ var createMultiSelectComponent = (multiSelectProps, onComponentUpdate) => {
|
|
|
4503
4567
|
selectedIndices,
|
|
4504
4568
|
value: null
|
|
4505
4569
|
}, rest), {
|
|
4506
|
-
|
|
4507
|
-
update(
|
|
4508
|
-
},
|
|
4509
|
-
onSelect(indices) {
|
|
4510
|
-
this._update((draft) => {
|
|
4570
|
+
selectIndices(indices) {
|
|
4571
|
+
update(component, (draft) => {
|
|
4511
4572
|
draft.selectedIndices = indices;
|
|
4512
4573
|
draft.errors = [];
|
|
4513
4574
|
});
|
|
4514
4575
|
void (schemaOnChange == null ? void 0 : schemaOnChange());
|
|
4515
|
-
const errors = getValidationErrors(
|
|
4516
|
-
|
|
4576
|
+
const errors = getValidationErrors(component.getLocalValue());
|
|
4577
|
+
update(component, (draft) => {
|
|
4517
4578
|
draft.errors = errors;
|
|
4518
4579
|
});
|
|
4519
|
-
if (
|
|
4520
|
-
validateAsync == null ? void 0 : validateAsync(
|
|
4580
|
+
if (component.validate()) {
|
|
4581
|
+
validateAsync == null ? void 0 : validateAsync(component, component.getLocalValue()).catch(() => {
|
|
4521
4582
|
});
|
|
4522
4583
|
}
|
|
4523
4584
|
onValueChange();
|
|
@@ -4530,17 +4591,17 @@ var createMultiSelectComponent = (multiSelectProps, onComponentUpdate) => {
|
|
|
4530
4591
|
// Noop
|
|
4531
4592
|
getLocalValue() {
|
|
4532
4593
|
var _a2, _b;
|
|
4533
|
-
return (_b = (_a2 =
|
|
4594
|
+
return (_b = (_a2 = component.getSelectedChildren()) == null ? void 0 : _a2.map((child) => child.getLocalValue())) != null ? _b : null;
|
|
4534
4595
|
},
|
|
4535
4596
|
validate() {
|
|
4536
|
-
const errors = getValidationErrors(
|
|
4537
|
-
|
|
4597
|
+
const errors = getValidationErrors(component.getLocalValue());
|
|
4598
|
+
update(component, (draft) => {
|
|
4538
4599
|
draft.errors = errors;
|
|
4539
4600
|
});
|
|
4540
4601
|
return errors.length === 0;
|
|
4541
4602
|
},
|
|
4542
4603
|
async getSubmittableValue() {
|
|
4543
|
-
const selected =
|
|
4604
|
+
const selected = component.getSelectedChildren();
|
|
4544
4605
|
if (selected) {
|
|
4545
4606
|
return Promise.all(selected.map(async (child) => child.getSubmittableValue()));
|
|
4546
4607
|
}
|
|
@@ -4548,14 +4609,14 @@ var createMultiSelectComponent = (multiSelectProps, onComponentUpdate) => {
|
|
|
4548
4609
|
},
|
|
4549
4610
|
getSubmittableValueSync() {
|
|
4550
4611
|
var _a2, _b;
|
|
4551
|
-
return (_b = (_a2 =
|
|
4612
|
+
return (_b = (_a2 = component.getSelectedChildren()) == null ? void 0 : _a2.map((child) => child.getSubmittableValueSync())) != null ? _b : null;
|
|
4552
4613
|
},
|
|
4553
4614
|
getSummary: () => ({}),
|
|
4554
4615
|
getChildren() {
|
|
4555
|
-
return
|
|
4616
|
+
return component.children;
|
|
4556
4617
|
},
|
|
4557
4618
|
getSelectedChildren() {
|
|
4558
|
-
return
|
|
4619
|
+
return component.selectedIndices.map((i) => component.children[i]);
|
|
4559
4620
|
}
|
|
4560
4621
|
});
|
|
4561
4622
|
return component;
|
|
@@ -4637,7 +4698,7 @@ var arraySchemaToMultiSelectComponent = (schemaMapperProps, mapperProps) => {
|
|
|
4637
4698
|
};
|
|
4638
4699
|
|
|
4639
4700
|
// src/domain/components/TupleComponent.ts
|
|
4640
|
-
var createTupleComponent = (
|
|
4701
|
+
var createTupleComponent = (props) => {
|
|
4641
4702
|
const {
|
|
4642
4703
|
uid,
|
|
4643
4704
|
schemaId,
|
|
@@ -4652,8 +4713,8 @@ var createTupleComponent = (tupleProps) => {
|
|
|
4652
4713
|
summariser,
|
|
4653
4714
|
title,
|
|
4654
4715
|
tags
|
|
4655
|
-
} =
|
|
4656
|
-
|
|
4716
|
+
} = props;
|
|
4717
|
+
const component = {
|
|
4657
4718
|
type: "tuple",
|
|
4658
4719
|
kind: "input",
|
|
4659
4720
|
uid,
|
|
@@ -4669,26 +4730,27 @@ var createTupleComponent = (tupleProps) => {
|
|
|
4669
4730
|
title,
|
|
4670
4731
|
tags,
|
|
4671
4732
|
getChildren() {
|
|
4672
|
-
return
|
|
4733
|
+
return component.components;
|
|
4673
4734
|
},
|
|
4674
4735
|
async getSubmittableValue() {
|
|
4675
|
-
return Promise.all(
|
|
4736
|
+
return Promise.all(component.components.map(async (child) => child.getSubmittableValue()));
|
|
4676
4737
|
},
|
|
4677
4738
|
getSubmittableValueSync() {
|
|
4678
|
-
return
|
|
4739
|
+
return component.components.map((child) => child.getSubmittableValueSync());
|
|
4679
4740
|
},
|
|
4680
4741
|
getSummary() {
|
|
4681
|
-
const summary = summariser(
|
|
4682
|
-
const childSummary = summariseFromChildren(
|
|
4742
|
+
const summary = summariser(component.getLocalValue());
|
|
4743
|
+
const childSummary = summariseFromChildren(component.getChildren());
|
|
4683
4744
|
return mergeSummaries(summary, childSummary);
|
|
4684
4745
|
},
|
|
4685
4746
|
getLocalValue() {
|
|
4686
|
-
return
|
|
4747
|
+
return component.components.map((child) => child.getLocalValue());
|
|
4687
4748
|
},
|
|
4688
4749
|
validate() {
|
|
4689
|
-
return hidden ? true : validateComponents(
|
|
4750
|
+
return hidden ? true : validateComponents(component.getChildren());
|
|
4690
4751
|
}
|
|
4691
4752
|
};
|
|
4753
|
+
return component;
|
|
4692
4754
|
};
|
|
4693
4755
|
|
|
4694
4756
|
// src/domain/mappers/schema/arraySchemaToComponent/arraySchemaToTupleComponent.ts
|
|
@@ -4743,8 +4805,8 @@ var isPersistAsyncWithUploadSchema = (schema) => isSchemaWithPersistAsync(schema
|
|
|
4743
4805
|
var isArraySchemaListWithMultiSelect = (schema) => isArrayListSchema(schema) && "oneOf" in schema.items && schema.items.oneOf.every(isConstSchema);
|
|
4744
4806
|
|
|
4745
4807
|
// src/domain/components/UploadInputComponent.ts
|
|
4746
|
-
var createUploadInputComponent = (
|
|
4747
|
-
const _a =
|
|
4808
|
+
var createUploadInputComponent = (props, onComponentUpdate) => {
|
|
4809
|
+
const _a = props, {
|
|
4748
4810
|
uid,
|
|
4749
4811
|
id,
|
|
4750
4812
|
checks,
|
|
@@ -4767,7 +4829,7 @@ var createUploadInputComponent = (uploadInputProps, onComponentUpdate) => {
|
|
|
4767
4829
|
]);
|
|
4768
4830
|
const update = getInputUpdateFunction(onComponentUpdate);
|
|
4769
4831
|
const getValidationErrors = getLocalValueValidator(checks);
|
|
4770
|
-
const
|
|
4832
|
+
const component = __spreadValues({
|
|
4771
4833
|
type: "upload",
|
|
4772
4834
|
kind: "input",
|
|
4773
4835
|
uid,
|
|
@@ -4775,18 +4837,15 @@ var createUploadInputComponent = (uploadInputProps, onComponentUpdate) => {
|
|
|
4775
4837
|
format,
|
|
4776
4838
|
value,
|
|
4777
4839
|
base64Value: null,
|
|
4778
|
-
_update(updateFn) {
|
|
4779
|
-
update(this, updateFn);
|
|
4780
|
-
},
|
|
4781
4840
|
onBlur() {
|
|
4782
|
-
|
|
4841
|
+
component.validate();
|
|
4783
4842
|
},
|
|
4784
4843
|
onFocus() {
|
|
4785
4844
|
},
|
|
4786
4845
|
// Noop
|
|
4787
|
-
async
|
|
4788
|
-
const base64Value =
|
|
4789
|
-
|
|
4846
|
+
async setValue(updatedValue) {
|
|
4847
|
+
const base64Value = component.format === "base64" && updatedValue ? await toBase64(updatedValue) : null;
|
|
4848
|
+
update(component, (draft) => {
|
|
4790
4849
|
draft.errors = [];
|
|
4791
4850
|
draft.value = updatedValue;
|
|
4792
4851
|
draft.base64Value = base64Value;
|
|
@@ -4794,50 +4853,47 @@ var createUploadInputComponent = (uploadInputProps, onComponentUpdate) => {
|
|
|
4794
4853
|
void (schemaOnChange == null ? void 0 : schemaOnChange());
|
|
4795
4854
|
onValueChange();
|
|
4796
4855
|
await (onPersistAsync == null ? void 0 : onPersistAsync().catch((e) => {
|
|
4797
|
-
|
|
4856
|
+
update(component, (draft) => {
|
|
4798
4857
|
draft.value = null;
|
|
4799
4858
|
});
|
|
4800
4859
|
throw e;
|
|
4801
4860
|
}));
|
|
4802
4861
|
},
|
|
4803
4862
|
async getSubmittableValue() {
|
|
4804
|
-
const file =
|
|
4805
|
-
if (
|
|
4863
|
+
const file = component.getLocalValue();
|
|
4864
|
+
if (component.format === "base64" && file) {
|
|
4806
4865
|
return toBase64(file);
|
|
4807
4866
|
}
|
|
4808
4867
|
return null;
|
|
4809
4868
|
},
|
|
4810
4869
|
getSubmittableValueSync() {
|
|
4811
|
-
return
|
|
4870
|
+
return component.base64Value;
|
|
4812
4871
|
},
|
|
4813
4872
|
getSummary() {
|
|
4814
4873
|
var _a2, _b;
|
|
4815
|
-
return summariser((_b = (_a2 =
|
|
4874
|
+
return summariser((_b = (_a2 = component.getLocalValue()) == null ? void 0 : _a2.name) != null ? _b : null);
|
|
4816
4875
|
},
|
|
4817
4876
|
getLocalValue() {
|
|
4818
|
-
return
|
|
4877
|
+
return component.value;
|
|
4819
4878
|
},
|
|
4820
4879
|
validate() {
|
|
4821
|
-
const errors = getValidationErrors(
|
|
4822
|
-
|
|
4880
|
+
const errors = getValidationErrors(component.getLocalValue());
|
|
4881
|
+
update(component, (draft) => {
|
|
4823
4882
|
draft.errors = errors;
|
|
4824
4883
|
});
|
|
4825
4884
|
return errors.length === 0;
|
|
4826
4885
|
}
|
|
4827
4886
|
}, rest);
|
|
4828
4887
|
if (format === "base64" && value && !onPersistAsync) {
|
|
4829
|
-
void
|
|
4830
|
-
|
|
4831
|
-
|
|
4832
|
-
|
|
4833
|
-
|
|
4834
|
-
|
|
4835
|
-
const base64Value = format === "base64" && value ? await toBase64(value) : null;
|
|
4836
|
-
if (base64Value) {
|
|
4837
|
-
uploadComponent._update((draft) => {
|
|
4838
|
-
draft.base64Value = base64Value;
|
|
4888
|
+
void toBase64(value).then((base64Value) => {
|
|
4889
|
+
if (base64Value) {
|
|
4890
|
+
update(component, (draft) => {
|
|
4891
|
+
draft.base64Value = base64Value;
|
|
4892
|
+
});
|
|
4893
|
+
}
|
|
4839
4894
|
});
|
|
4840
4895
|
}
|
|
4896
|
+
return component;
|
|
4841
4897
|
};
|
|
4842
4898
|
|
|
4843
4899
|
// src/domain/mappers/schema/blobSchemaToComponent.ts
|
|
@@ -4866,8 +4922,8 @@ var blobSchemaToComponent = (schemaMapperProps, mapperProps) => {
|
|
|
4866
4922
|
};
|
|
4867
4923
|
|
|
4868
4924
|
// src/domain/components/BooleanInputComponent.ts
|
|
4869
|
-
var createBooleanInputComponent = (
|
|
4870
|
-
const _a =
|
|
4925
|
+
var createBooleanInputComponent = (props, onComponentUpdate) => {
|
|
4926
|
+
const _a = props, {
|
|
4871
4927
|
uid,
|
|
4872
4928
|
id,
|
|
4873
4929
|
value,
|
|
@@ -4888,49 +4944,46 @@ var createBooleanInputComponent = (booleanInputProps, onComponentUpdate) => {
|
|
|
4888
4944
|
]);
|
|
4889
4945
|
const update = getInputUpdateFunction(onComponentUpdate);
|
|
4890
4946
|
const validateAsync = performValidationAsync ? getComponentValidationAsync(update, performValidationAsync) : void 0;
|
|
4891
|
-
const
|
|
4947
|
+
const component = __spreadValues({
|
|
4892
4948
|
type: "boolean",
|
|
4893
4949
|
kind: "input",
|
|
4894
4950
|
uid,
|
|
4895
4951
|
id,
|
|
4896
4952
|
autoComplete: "",
|
|
4897
4953
|
value,
|
|
4898
|
-
_update(updateFn) {
|
|
4899
|
-
update(this, updateFn);
|
|
4900
|
-
},
|
|
4901
4954
|
onBlur() {
|
|
4902
4955
|
},
|
|
4903
4956
|
// Noop
|
|
4904
4957
|
onFocus() {
|
|
4905
4958
|
},
|
|
4906
4959
|
// Noop
|
|
4907
|
-
|
|
4908
|
-
|
|
4960
|
+
setValue(updatedValue) {
|
|
4961
|
+
update(component, (draft) => {
|
|
4909
4962
|
draft.errors = [];
|
|
4910
4963
|
draft.value = updatedValue;
|
|
4911
4964
|
});
|
|
4912
4965
|
void (schemaOnChange == null ? void 0 : schemaOnChange());
|
|
4913
4966
|
void (onPersistAsync == null ? void 0 : onPersistAsync().catch(() => {
|
|
4914
4967
|
}));
|
|
4915
|
-
validateAsync == null ? void 0 : validateAsync(
|
|
4968
|
+
validateAsync == null ? void 0 : validateAsync(component, component.getLocalValue()).catch(() => {
|
|
4916
4969
|
});
|
|
4917
4970
|
onValueChange();
|
|
4918
4971
|
},
|
|
4919
4972
|
async getSubmittableValue() {
|
|
4920
|
-
return
|
|
4973
|
+
return component.getSubmittableValueSync();
|
|
4921
4974
|
},
|
|
4922
4975
|
getSubmittableValueSync() {
|
|
4923
|
-
return
|
|
4976
|
+
return component.getLocalValue();
|
|
4924
4977
|
},
|
|
4925
4978
|
getSummary() {
|
|
4926
|
-
return summariser(
|
|
4979
|
+
return summariser(component.getLocalValue());
|
|
4927
4980
|
},
|
|
4928
4981
|
getLocalValue() {
|
|
4929
|
-
return
|
|
4982
|
+
return component.value;
|
|
4930
4983
|
},
|
|
4931
4984
|
validate: () => true
|
|
4932
4985
|
}, rest);
|
|
4933
|
-
return
|
|
4986
|
+
return component;
|
|
4934
4987
|
};
|
|
4935
4988
|
|
|
4936
4989
|
// src/domain/mappers/schema/booleanSchemaToComponent.ts
|
|
@@ -4971,8 +5024,8 @@ var getValidModel = (model, defaultValue) => {
|
|
|
4971
5024
|
};
|
|
4972
5025
|
|
|
4973
5026
|
// src/domain/components/ConstComponent.ts
|
|
4974
|
-
var createConstComponent = (
|
|
4975
|
-
const { uid, schemaId, analyticsId, value, summary, layout, hidden, tags } =
|
|
5027
|
+
var createConstComponent = (props) => {
|
|
5028
|
+
const { uid, schemaId, analyticsId, value, summary, layout, hidden, tags } = props;
|
|
4976
5029
|
return {
|
|
4977
5030
|
type: "const",
|
|
4978
5031
|
kind: "input",
|
|
@@ -5015,8 +5068,8 @@ var getConstLayout = (uid, mapperProps, layout, alert) => {
|
|
|
5015
5068
|
};
|
|
5016
5069
|
|
|
5017
5070
|
// src/domain/components/IntegerInputComponent.ts
|
|
5018
|
-
var createIntegerInputComponent = (
|
|
5019
|
-
const _a =
|
|
5071
|
+
var createIntegerInputComponent = (props, onComponentUpdate) => {
|
|
5072
|
+
const _a = props, {
|
|
5020
5073
|
uid,
|
|
5021
5074
|
id,
|
|
5022
5075
|
checks,
|
|
@@ -5041,17 +5094,14 @@ var createIntegerInputComponent = (integerInputProps, onComponentUpdate) => {
|
|
|
5041
5094
|
const getValidationErrors = getLocalValueValidator(checks);
|
|
5042
5095
|
const performOnChange = getDebouncedSchemaOnChange(schemaOnChange, getValidationErrors);
|
|
5043
5096
|
const validateAsync = performValidationAsync ? getDebouncedComponentValidationAsync(update, performValidationAsync) : void 0;
|
|
5044
|
-
const
|
|
5097
|
+
const component = __spreadValues({
|
|
5045
5098
|
type: "integer",
|
|
5046
5099
|
kind: "input",
|
|
5047
5100
|
uid,
|
|
5048
5101
|
id,
|
|
5049
5102
|
value,
|
|
5050
|
-
_update(updateFn) {
|
|
5051
|
-
update(this, updateFn);
|
|
5052
|
-
},
|
|
5053
5103
|
onBlur() {
|
|
5054
|
-
const isValid =
|
|
5104
|
+
const isValid = component.validate();
|
|
5055
5105
|
performOnChange == null ? void 0 : performOnChange.flush();
|
|
5056
5106
|
if (isValid) {
|
|
5057
5107
|
void (onPersistAsync == null ? void 0 : onPersistAsync().catch(() => {
|
|
@@ -5062,9 +5112,9 @@ var createIntegerInputComponent = (integerInputProps, onComponentUpdate) => {
|
|
|
5062
5112
|
onFocus() {
|
|
5063
5113
|
},
|
|
5064
5114
|
// Noop
|
|
5065
|
-
|
|
5066
|
-
const prevValue =
|
|
5067
|
-
|
|
5115
|
+
setValue(updatedValue) {
|
|
5116
|
+
const prevValue = component.value;
|
|
5117
|
+
update(component, (draft) => {
|
|
5068
5118
|
draft.errors = [];
|
|
5069
5119
|
draft.validationAsyncState.messages = {};
|
|
5070
5120
|
draft.value = updatedValue;
|
|
@@ -5072,32 +5122,32 @@ var createIntegerInputComponent = (integerInputProps, onComponentUpdate) => {
|
|
|
5072
5122
|
performOnChange == null ? void 0 : performOnChange(prevValue, updatedValue);
|
|
5073
5123
|
const isValid = getValidationErrors(updatedValue).length === 0;
|
|
5074
5124
|
if (isValid) {
|
|
5075
|
-
validateAsync == null ? void 0 : validateAsync(
|
|
5125
|
+
validateAsync == null ? void 0 : validateAsync(component, updatedValue);
|
|
5076
5126
|
}
|
|
5077
5127
|
onValueChange();
|
|
5078
5128
|
},
|
|
5079
5129
|
async getSubmittableValue() {
|
|
5080
|
-
return
|
|
5130
|
+
return component.getSubmittableValueSync();
|
|
5081
5131
|
},
|
|
5082
5132
|
getSubmittableValueSync() {
|
|
5083
5133
|
var _a2;
|
|
5084
|
-
return (_a2 =
|
|
5134
|
+
return (_a2 = component.getLocalValue()) != null ? _a2 : null;
|
|
5085
5135
|
},
|
|
5086
5136
|
getSummary() {
|
|
5087
|
-
return summariser(
|
|
5137
|
+
return summariser(component.getLocalValue());
|
|
5088
5138
|
},
|
|
5089
5139
|
getLocalValue() {
|
|
5090
|
-
return
|
|
5140
|
+
return component.value;
|
|
5091
5141
|
},
|
|
5092
5142
|
validate() {
|
|
5093
|
-
const errors = getValidationErrors(
|
|
5094
|
-
|
|
5143
|
+
const errors = getValidationErrors(component.getLocalValue());
|
|
5144
|
+
update(component, (draft) => {
|
|
5095
5145
|
draft.errors = errors;
|
|
5096
5146
|
});
|
|
5097
5147
|
return errors.length === 0;
|
|
5098
5148
|
}
|
|
5099
5149
|
}, rest);
|
|
5100
|
-
return
|
|
5150
|
+
return component;
|
|
5101
5151
|
};
|
|
5102
5152
|
|
|
5103
5153
|
// src/domain/mappers/schema/integerSchemaToComponent.ts
|
|
@@ -5155,7 +5205,7 @@ var createFormattedValueComponent = (props, onComponentUpdate) => {
|
|
|
5155
5205
|
schemaOnChange
|
|
5156
5206
|
} = props;
|
|
5157
5207
|
const update = getInputUpdateFunction(onComponentUpdate);
|
|
5158
|
-
|
|
5208
|
+
const component = {
|
|
5159
5209
|
type: "formatted-value",
|
|
5160
5210
|
kind: "input",
|
|
5161
5211
|
uid,
|
|
@@ -5173,27 +5223,28 @@ var createFormattedValueComponent = (props, onComponentUpdate) => {
|
|
|
5173
5223
|
tags,
|
|
5174
5224
|
value,
|
|
5175
5225
|
async getSubmittableValue() {
|
|
5176
|
-
return
|
|
5226
|
+
return component.getSubmittableValueSync();
|
|
5177
5227
|
},
|
|
5178
5228
|
getSubmittableValueSync() {
|
|
5179
|
-
return
|
|
5229
|
+
return component.getLocalValue();
|
|
5180
5230
|
},
|
|
5181
5231
|
getSummary() {
|
|
5182
|
-
return summariser(
|
|
5232
|
+
return summariser(component.getLocalValue());
|
|
5183
5233
|
},
|
|
5184
5234
|
getLocalValue() {
|
|
5185
|
-
return
|
|
5235
|
+
return component.value;
|
|
5186
5236
|
},
|
|
5187
5237
|
validate() {
|
|
5188
5238
|
return true;
|
|
5189
5239
|
},
|
|
5190
|
-
|
|
5191
|
-
update(
|
|
5240
|
+
setValue(newValue) {
|
|
5241
|
+
update(component, (draft) => {
|
|
5192
5242
|
draft.value = newValue;
|
|
5193
5243
|
});
|
|
5194
5244
|
void (schemaOnChange == null ? void 0 : schemaOnChange());
|
|
5195
5245
|
}
|
|
5196
5246
|
};
|
|
5247
|
+
return component;
|
|
5197
5248
|
};
|
|
5198
5249
|
|
|
5199
5250
|
// src/domain/mappers/schema/objectSchemaToComponent/objectSchemaToFormattedValueComponent.ts
|
|
@@ -5212,8 +5263,8 @@ var objectSchemaToFormattedValueComponent = (schemaMapperProps, mapperProps) =>
|
|
|
5212
5263
|
};
|
|
5213
5264
|
|
|
5214
5265
|
// src/domain/components/MoneyInputComponent.ts
|
|
5215
|
-
var createMoneyInputComponent = (
|
|
5216
|
-
const _a =
|
|
5266
|
+
var createMoneyInputComponent = (props, onComponentUpdate) => {
|
|
5267
|
+
const _a = props, {
|
|
5217
5268
|
id,
|
|
5218
5269
|
uid,
|
|
5219
5270
|
schemaId,
|
|
@@ -5254,7 +5305,7 @@ var createMoneyInputComponent = (moneyInputProps, onComponentUpdate) => {
|
|
|
5254
5305
|
]);
|
|
5255
5306
|
const getValidationErrors = getLocalValueValidator(checks);
|
|
5256
5307
|
const update = getInputUpdateFunction(onComponentUpdate);
|
|
5257
|
-
const
|
|
5308
|
+
const component = __spreadValues({
|
|
5258
5309
|
type: "money-input",
|
|
5259
5310
|
kind: "input",
|
|
5260
5311
|
id,
|
|
@@ -5273,9 +5324,6 @@ var createMoneyInputComponent = (moneyInputProps, onComponentUpdate) => {
|
|
|
5273
5324
|
[amountKey]: amountComponent.getLocalValue(),
|
|
5274
5325
|
[currencyKey]: currencyComponent.getLocalValue()
|
|
5275
5326
|
},
|
|
5276
|
-
_update(updateFn) {
|
|
5277
|
-
update(this, updateFn);
|
|
5278
|
-
},
|
|
5279
5327
|
components: {
|
|
5280
5328
|
amount: amountComponent,
|
|
5281
5329
|
currency: currencyComponent
|
|
@@ -5299,11 +5347,11 @@ var createMoneyInputComponent = (moneyInputProps, onComponentUpdate) => {
|
|
|
5299
5347
|
}, extraValues);
|
|
5300
5348
|
},
|
|
5301
5349
|
getSummary() {
|
|
5302
|
-
return summariser(
|
|
5350
|
+
return summariser(component.getLocalValue());
|
|
5303
5351
|
},
|
|
5304
5352
|
validate() {
|
|
5305
5353
|
const errors = getValidationErrors(amountComponent.getLocalValue());
|
|
5306
|
-
|
|
5354
|
+
update(component, (draft) => {
|
|
5307
5355
|
draft.errors = errors;
|
|
5308
5356
|
});
|
|
5309
5357
|
return amountComponent.validate() && currencyComponent.validate() && errors.length === 0;
|
|
@@ -5314,11 +5362,11 @@ var createMoneyInputComponent = (moneyInputProps, onComponentUpdate) => {
|
|
|
5314
5362
|
onFocus() {
|
|
5315
5363
|
}
|
|
5316
5364
|
}, rest);
|
|
5317
|
-
return
|
|
5365
|
+
return component;
|
|
5318
5366
|
};
|
|
5319
5367
|
|
|
5320
5368
|
// src/domain/components/ObjectComponent.ts
|
|
5321
|
-
var createObjectComponent = (
|
|
5369
|
+
var createObjectComponent = (props) => {
|
|
5322
5370
|
const {
|
|
5323
5371
|
uid,
|
|
5324
5372
|
schemaId,
|
|
@@ -5334,8 +5382,8 @@ var createObjectComponent = (objectProps) => {
|
|
|
5334
5382
|
summariser,
|
|
5335
5383
|
title,
|
|
5336
5384
|
tags
|
|
5337
|
-
} =
|
|
5338
|
-
|
|
5385
|
+
} = props;
|
|
5386
|
+
const component = {
|
|
5339
5387
|
type: "object",
|
|
5340
5388
|
kind: "input",
|
|
5341
5389
|
uid,
|
|
@@ -5351,12 +5399,12 @@ var createObjectComponent = (objectProps) => {
|
|
|
5351
5399
|
title,
|
|
5352
5400
|
tags,
|
|
5353
5401
|
getChildren() {
|
|
5354
|
-
return displayOrder.map((propName) =>
|
|
5402
|
+
return displayOrder.map((propName) => component.componentMap[propName]);
|
|
5355
5403
|
},
|
|
5356
5404
|
async getSubmittableValue() {
|
|
5357
5405
|
return Promise.all(
|
|
5358
5406
|
displayOrder.map(
|
|
5359
|
-
async (propName) =>
|
|
5407
|
+
async (propName) => component.componentMap[propName].getSubmittableValue().then((value) => ({ value, propName }))
|
|
5360
5408
|
)
|
|
5361
5409
|
).then(
|
|
5362
5410
|
(values) => values.reduce(
|
|
@@ -5368,24 +5416,25 @@ var createObjectComponent = (objectProps) => {
|
|
|
5368
5416
|
getSubmittableValueSync() {
|
|
5369
5417
|
return mergeChildrenValues(
|
|
5370
5418
|
displayOrder,
|
|
5371
|
-
(propName) =>
|
|
5419
|
+
(propName) => component.componentMap[propName].getSubmittableValueSync()
|
|
5372
5420
|
);
|
|
5373
5421
|
},
|
|
5374
5422
|
getSummary() {
|
|
5375
|
-
const summary = summariser(
|
|
5376
|
-
const childSummary = summariseFromChildren(
|
|
5423
|
+
const summary = summariser(component.getLocalValue());
|
|
5424
|
+
const childSummary = summariseFromChildren(component.getChildren());
|
|
5377
5425
|
return mergeSummaries(summary, childSummary);
|
|
5378
5426
|
},
|
|
5379
5427
|
getLocalValue() {
|
|
5380
5428
|
return mergeChildrenValues(
|
|
5381
5429
|
displayOrder,
|
|
5382
|
-
(propName) =>
|
|
5430
|
+
(propName) => component.componentMap[propName].getLocalValue()
|
|
5383
5431
|
);
|
|
5384
5432
|
},
|
|
5385
5433
|
validate() {
|
|
5386
|
-
return hidden ? true : validateComponents(
|
|
5434
|
+
return hidden ? true : validateComponents(component.getChildren());
|
|
5387
5435
|
}
|
|
5388
5436
|
};
|
|
5437
|
+
return component;
|
|
5389
5438
|
};
|
|
5390
5439
|
var mergeChildrenValues = (displayOrder, getComponentValue) => displayOrder.reduce((acc, propName) => {
|
|
5391
5440
|
const componentValue = getComponentValue(propName);
|
|
@@ -5571,8 +5620,8 @@ var isPartialModelMatch = (localModel, incomingModel) => {
|
|
|
5571
5620
|
var nonNullishKeys = (model) => Object.keys(model).filter((key) => !isNullish(model[key]));
|
|
5572
5621
|
|
|
5573
5622
|
// src/domain/components/SelectInputComponent.ts
|
|
5574
|
-
var createSelectInputComponent = (
|
|
5575
|
-
const _a =
|
|
5623
|
+
var createSelectInputComponent = (props, onComponentUpdate) => {
|
|
5624
|
+
const _a = props, { uid, checks, initialModel, options, schemaOnChange, onValueChange, summariser } = _a, rest = __objRest(_a, ["uid", "checks", "initialModel", "options", "schemaOnChange", "onValueChange", "summariser"]);
|
|
5576
5625
|
const children = options.map((option) => option.component);
|
|
5577
5626
|
const matchingOptions = options.map(
|
|
5578
5627
|
(option) => isPartialModelMatch(option.component.getSubmittableValueSync(), initialModel)
|
|
@@ -5589,54 +5638,51 @@ var createSelectInputComponent = (selectProps, onComponentUpdate) => {
|
|
|
5589
5638
|
selectedIndex,
|
|
5590
5639
|
value: null
|
|
5591
5640
|
}, rest), {
|
|
5592
|
-
_update(updateFn) {
|
|
5593
|
-
update(this, updateFn);
|
|
5594
|
-
},
|
|
5595
5641
|
getChildren() {
|
|
5596
|
-
return
|
|
5642
|
+
return component.children;
|
|
5597
5643
|
},
|
|
5598
5644
|
getSelectedChild() {
|
|
5599
|
-
return
|
|
5645
|
+
return component.selectedIndex !== null ? component.children[component.selectedIndex] : null;
|
|
5600
5646
|
},
|
|
5601
5647
|
async getSubmittableValue() {
|
|
5602
5648
|
var _a2, _b;
|
|
5603
|
-
return (_b = await ((_a2 =
|
|
5649
|
+
return (_b = await ((_a2 = component.getSelectedChild()) == null ? void 0 : _a2.getSubmittableValue())) != null ? _b : null;
|
|
5604
5650
|
},
|
|
5605
5651
|
getSubmittableValueSync() {
|
|
5606
5652
|
var _a2, _b;
|
|
5607
|
-
return (_b = (_a2 =
|
|
5653
|
+
return (_b = (_a2 = component.getSelectedChild()) == null ? void 0 : _a2.getSubmittableValueSync()) != null ? _b : null;
|
|
5608
5654
|
},
|
|
5609
5655
|
getSummary() {
|
|
5610
5656
|
var _a2, _b;
|
|
5611
|
-
return (_b = (_a2 =
|
|
5657
|
+
return (_b = (_a2 = component.getSelectedChild()) == null ? void 0 : _a2.getSummary()) != null ? _b : {};
|
|
5612
5658
|
},
|
|
5613
5659
|
getLocalValue() {
|
|
5614
5660
|
var _a2, _b;
|
|
5615
|
-
return (_b = (_a2 =
|
|
5661
|
+
return (_b = (_a2 = component.getSelectedChild()) == null ? void 0 : _a2.getLocalValue()) != null ? _b : null;
|
|
5616
5662
|
},
|
|
5617
5663
|
onBlur() {
|
|
5618
|
-
|
|
5664
|
+
component.validate();
|
|
5619
5665
|
},
|
|
5620
5666
|
onFocus() {
|
|
5621
5667
|
},
|
|
5622
5668
|
// noop
|
|
5623
|
-
|
|
5624
|
-
if (updatedIndex ===
|
|
5669
|
+
selectIndex(updatedIndex) {
|
|
5670
|
+
if (updatedIndex === component.selectedIndex) {
|
|
5625
5671
|
return;
|
|
5626
5672
|
}
|
|
5627
5673
|
if (updatedIndex !== null) {
|
|
5628
|
-
|
|
5629
|
-
schema:
|
|
5630
|
-
selectedOption:
|
|
5674
|
+
props.trackEvent("OneOf Option Selected", {
|
|
5675
|
+
schema: component.analyticsId,
|
|
5676
|
+
selectedOption: component.children[updatedIndex].analyticsId
|
|
5631
5677
|
});
|
|
5632
|
-
if (
|
|
5633
|
-
|
|
5634
|
-
oneOfId:
|
|
5635
|
-
schemaId:
|
|
5678
|
+
if (component.analyticsId) {
|
|
5679
|
+
props.trackEvent("OneOf Selected", {
|
|
5680
|
+
oneOfId: component.analyticsId,
|
|
5681
|
+
schemaId: component.children[updatedIndex].analyticsId
|
|
5636
5682
|
});
|
|
5637
5683
|
}
|
|
5638
5684
|
}
|
|
5639
|
-
|
|
5685
|
+
update(component, (draft) => {
|
|
5640
5686
|
draft.errors = [];
|
|
5641
5687
|
draft.selectedIndex = updatedIndex;
|
|
5642
5688
|
});
|
|
@@ -5645,9 +5691,9 @@ var createSelectInputComponent = (selectProps, onComponentUpdate) => {
|
|
|
5645
5691
|
},
|
|
5646
5692
|
validate() {
|
|
5647
5693
|
var _a2, _b;
|
|
5648
|
-
const validChild = (_b = (_a2 =
|
|
5649
|
-
const errors = getValidationErrors(
|
|
5650
|
-
|
|
5694
|
+
const validChild = (_b = (_a2 = component.getSelectedChild()) == null ? void 0 : _a2.validate()) != null ? _b : true;
|
|
5695
|
+
const errors = getValidationErrors(component.getLocalValue());
|
|
5696
|
+
update(component, (draft) => {
|
|
5651
5697
|
draft.errors = errors;
|
|
5652
5698
|
});
|
|
5653
5699
|
return errors.length === 0 && validChild;
|
|
@@ -5743,15 +5789,24 @@ var isExactLocalValueMatch = (valueA, valueB) => {
|
|
|
5743
5789
|
|
|
5744
5790
|
// src/domain/components/PersistAsyncComponent.ts
|
|
5745
5791
|
var createPersistAsyncComponent = (props, performPersistAsync, schemaOnChange, onComponentUpdate) => {
|
|
5746
|
-
const {
|
|
5792
|
+
const {
|
|
5793
|
+
uid,
|
|
5794
|
+
analyticsId,
|
|
5795
|
+
schemaId,
|
|
5796
|
+
component: childComponent,
|
|
5797
|
+
hidden,
|
|
5798
|
+
model,
|
|
5799
|
+
localValue,
|
|
5800
|
+
tags
|
|
5801
|
+
} = props;
|
|
5747
5802
|
const update = getInputUpdateFunction(onComponentUpdate);
|
|
5748
|
-
const
|
|
5803
|
+
const component = {
|
|
5749
5804
|
type: "persist-async",
|
|
5750
5805
|
kind: "input",
|
|
5751
5806
|
uid,
|
|
5752
5807
|
analyticsId,
|
|
5753
5808
|
schemaId,
|
|
5754
|
-
component,
|
|
5809
|
+
component: childComponent,
|
|
5755
5810
|
hidden,
|
|
5756
5811
|
status: "idle",
|
|
5757
5812
|
lastSubmitted: model != null ? localValue != null ? localValue : null : null,
|
|
@@ -5760,33 +5815,30 @@ var createPersistAsyncComponent = (props, performPersistAsync, schemaOnChange, o
|
|
|
5760
5815
|
abortController: new AbortController(),
|
|
5761
5816
|
errors: [],
|
|
5762
5817
|
tags,
|
|
5763
|
-
_update(updateFn) {
|
|
5764
|
-
update(this, updateFn);
|
|
5765
|
-
},
|
|
5766
5818
|
validate() {
|
|
5767
|
-
return
|
|
5819
|
+
return component.component.validate();
|
|
5768
5820
|
},
|
|
5769
5821
|
getLocalValue() {
|
|
5770
|
-
return
|
|
5822
|
+
return component.component.getLocalValue();
|
|
5771
5823
|
},
|
|
5772
5824
|
async getSubmittableValue() {
|
|
5773
|
-
return
|
|
5825
|
+
return component.persist();
|
|
5774
5826
|
},
|
|
5775
5827
|
getSubmittableValueSync() {
|
|
5776
|
-
return
|
|
5828
|
+
return component.lastResponse;
|
|
5777
5829
|
},
|
|
5778
5830
|
getSummary() {
|
|
5779
|
-
return
|
|
5831
|
+
return component.component.getSummary();
|
|
5780
5832
|
},
|
|
5781
5833
|
async persist() {
|
|
5782
|
-
const childLocalValue =
|
|
5783
|
-
if (isExactLocalValueMatch(childLocalValue,
|
|
5784
|
-
return
|
|
5834
|
+
const childLocalValue = component.component.getLocalValue();
|
|
5835
|
+
if (isExactLocalValueMatch(childLocalValue, component.lastSubmitted)) {
|
|
5836
|
+
return component.submission;
|
|
5785
5837
|
}
|
|
5786
|
-
const newAbortController = abortAndResetController(
|
|
5838
|
+
const newAbortController = abortAndResetController(component.abortController);
|
|
5787
5839
|
if (childLocalValue == null || childLocalValue === "") {
|
|
5788
5840
|
const resolvedNull = Promise.resolve(null);
|
|
5789
|
-
|
|
5841
|
+
update(component, (draft) => {
|
|
5790
5842
|
draft.abortController = newAbortController;
|
|
5791
5843
|
draft.lastResponse = null;
|
|
5792
5844
|
draft.lastSubmitted = childLocalValue;
|
|
@@ -5799,7 +5851,7 @@ var createPersistAsyncComponent = (props, performPersistAsync, schemaOnChange, o
|
|
|
5799
5851
|
}
|
|
5800
5852
|
const { signal } = newAbortController;
|
|
5801
5853
|
const newSubmission = performPersistAsync({ value: childLocalValue, signal }).then((token) => {
|
|
5802
|
-
|
|
5854
|
+
update(component, (draft) => {
|
|
5803
5855
|
draft.lastResponse = token;
|
|
5804
5856
|
draft.errors = [];
|
|
5805
5857
|
draft.status = "success";
|
|
@@ -5810,18 +5862,18 @@ var createPersistAsyncComponent = (props, performPersistAsync, schemaOnChange, o
|
|
|
5810
5862
|
if (error instanceof DOMException && error.name === "AbortError") {
|
|
5811
5863
|
return null;
|
|
5812
5864
|
}
|
|
5813
|
-
|
|
5865
|
+
update(component, (draft) => {
|
|
5814
5866
|
draft.lastResponse = null;
|
|
5815
5867
|
draft.lastSubmitted = null;
|
|
5816
5868
|
draft.submission = Promise.resolve(null);
|
|
5817
5869
|
draft.status = "error";
|
|
5818
|
-
if (
|
|
5870
|
+
if (component.component.type !== "upload") {
|
|
5819
5871
|
draft.errors = error instanceof Error ? [error.message] : [];
|
|
5820
5872
|
}
|
|
5821
5873
|
});
|
|
5822
5874
|
throw error;
|
|
5823
5875
|
});
|
|
5824
|
-
|
|
5876
|
+
update(component, (draft) => {
|
|
5825
5877
|
draft.abortController = newAbortController;
|
|
5826
5878
|
draft.lastSubmitted = childLocalValue;
|
|
5827
5879
|
draft.lastResponse = null;
|
|
@@ -5832,7 +5884,7 @@ var createPersistAsyncComponent = (props, performPersistAsync, schemaOnChange, o
|
|
|
5832
5884
|
return newSubmission;
|
|
5833
5885
|
}
|
|
5834
5886
|
};
|
|
5835
|
-
return
|
|
5887
|
+
return component;
|
|
5836
5888
|
};
|
|
5837
5889
|
|
|
5838
5890
|
// src/domain/mappers/schema/persistAsyncSchemaToComponent.ts
|
|
@@ -5871,8 +5923,8 @@ var persistAsyncSchemaToComponent = (schemaMapperProps, mapperProps) => {
|
|
|
5871
5923
|
};
|
|
5872
5924
|
|
|
5873
5925
|
// src/domain/components/DateInputComponent.ts
|
|
5874
|
-
var createDateInputComponent = (
|
|
5875
|
-
const _a =
|
|
5926
|
+
var createDateInputComponent = (props, onComponentUpdate) => {
|
|
5927
|
+
const _a = props, {
|
|
5876
5928
|
uid,
|
|
5877
5929
|
id,
|
|
5878
5930
|
checks,
|
|
@@ -5896,28 +5948,25 @@ var createDateInputComponent = (textInputProps, onComponentUpdate) => {
|
|
|
5896
5948
|
const update = getInputUpdateFunction(onComponentUpdate);
|
|
5897
5949
|
const getValidationErrors = getLocalValueValidator(checks);
|
|
5898
5950
|
const validateAsync = performValidationAsync ? getComponentValidationAsync(update, performValidationAsync) : void 0;
|
|
5899
|
-
const
|
|
5951
|
+
const component = __spreadValues({
|
|
5900
5952
|
type: "date",
|
|
5901
5953
|
kind: "input",
|
|
5902
5954
|
uid,
|
|
5903
5955
|
id,
|
|
5904
5956
|
value,
|
|
5905
|
-
_update(updateFn) {
|
|
5906
|
-
update(this, updateFn);
|
|
5907
|
-
},
|
|
5908
5957
|
onBlur() {
|
|
5909
|
-
const isValid =
|
|
5958
|
+
const isValid = component.validate();
|
|
5910
5959
|
if (isValid) {
|
|
5911
|
-
validateAsync == null ? void 0 : validateAsync(
|
|
5960
|
+
validateAsync == null ? void 0 : validateAsync(component, component.getLocalValue()).catch(() => {
|
|
5912
5961
|
});
|
|
5913
5962
|
}
|
|
5914
5963
|
},
|
|
5915
5964
|
onFocus() {
|
|
5916
5965
|
},
|
|
5917
5966
|
// Noop
|
|
5918
|
-
|
|
5919
|
-
const prevValue =
|
|
5920
|
-
|
|
5967
|
+
setValue(updatedValue) {
|
|
5968
|
+
const prevValue = component.value;
|
|
5969
|
+
update(component, (draft) => {
|
|
5921
5970
|
draft.errors = [];
|
|
5922
5971
|
draft.validationAsyncState.messages = {};
|
|
5923
5972
|
draft.value = updatedValue;
|
|
@@ -5932,29 +5981,29 @@ var createDateInputComponent = (textInputProps, onComponentUpdate) => {
|
|
|
5932
5981
|
}
|
|
5933
5982
|
},
|
|
5934
5983
|
async getSubmittableValue() {
|
|
5935
|
-
return
|
|
5984
|
+
return component.getSubmittableValueSync();
|
|
5936
5985
|
},
|
|
5937
5986
|
getSubmittableValueSync() {
|
|
5938
|
-
if (isValidDate(
|
|
5939
|
-
return
|
|
5987
|
+
if (isValidDate(component.getLocalValue())) {
|
|
5988
|
+
return component.getLocalValue();
|
|
5940
5989
|
}
|
|
5941
5990
|
return null;
|
|
5942
5991
|
},
|
|
5943
5992
|
getSummary() {
|
|
5944
|
-
return summariser(
|
|
5993
|
+
return summariser(component.getLocalValue());
|
|
5945
5994
|
},
|
|
5946
5995
|
getLocalValue() {
|
|
5947
|
-
return
|
|
5996
|
+
return component.value;
|
|
5948
5997
|
},
|
|
5949
5998
|
validate() {
|
|
5950
|
-
const errors = getValidationErrors(
|
|
5951
|
-
|
|
5999
|
+
const errors = getValidationErrors(component.getLocalValue());
|
|
6000
|
+
update(component, (draft) => {
|
|
5952
6001
|
draft.errors = errors;
|
|
5953
6002
|
});
|
|
5954
6003
|
return errors.length === 0;
|
|
5955
6004
|
}
|
|
5956
6005
|
}, rest);
|
|
5957
|
-
return
|
|
6006
|
+
return component;
|
|
5958
6007
|
};
|
|
5959
6008
|
|
|
5960
6009
|
// src/domain/mappers/utils/suggestions-utils.ts
|
|
@@ -6068,8 +6117,8 @@ var stringSchemaToUploadInputComponent = (schemaMapperProps, mapperProps) => {
|
|
|
6068
6117
|
var getFileFromModel = (model) => isString(model) ? base64dataUrltoFile(model, "") : null;
|
|
6069
6118
|
|
|
6070
6119
|
// src/domain/components/TextInputComponent.ts
|
|
6071
|
-
var createTextInputComponent = (
|
|
6072
|
-
const _a =
|
|
6120
|
+
var createTextInputComponent = (props, onComponentUpdate) => {
|
|
6121
|
+
const _a = props, {
|
|
6073
6122
|
uid,
|
|
6074
6123
|
id,
|
|
6075
6124
|
checks,
|
|
@@ -6094,17 +6143,14 @@ var createTextInputComponent = (textInputProps, onComponentUpdate) => {
|
|
|
6094
6143
|
const getValidationErrors = getLocalValueValidator(checks);
|
|
6095
6144
|
const performOnChange = getDebouncedSchemaOnChange(schemaOnChange, getValidationErrors);
|
|
6096
6145
|
const validateAsync = performValidationAsync ? getDebouncedComponentValidationAsync(update, performValidationAsync) : void 0;
|
|
6097
|
-
const
|
|
6146
|
+
const component = __spreadValues({
|
|
6098
6147
|
type: "text",
|
|
6099
6148
|
kind: "input",
|
|
6100
6149
|
uid,
|
|
6101
6150
|
id,
|
|
6102
6151
|
value,
|
|
6103
|
-
_update(updateFn) {
|
|
6104
|
-
update(this, updateFn);
|
|
6105
|
-
},
|
|
6106
6152
|
onBlur() {
|
|
6107
|
-
const isValid =
|
|
6153
|
+
const isValid = component.validate();
|
|
6108
6154
|
performOnChange == null ? void 0 : performOnChange.flush();
|
|
6109
6155
|
if (isValid) {
|
|
6110
6156
|
void (onPersistAsync == null ? void 0 : onPersistAsync().catch(() => {
|
|
@@ -6115,9 +6161,9 @@ var createTextInputComponent = (textInputProps, onComponentUpdate) => {
|
|
|
6115
6161
|
onFocus() {
|
|
6116
6162
|
},
|
|
6117
6163
|
// Noop
|
|
6118
|
-
|
|
6119
|
-
const prevValue =
|
|
6120
|
-
|
|
6164
|
+
setValue(updatedValue) {
|
|
6165
|
+
const prevValue = component.value;
|
|
6166
|
+
update(component, (draft) => {
|
|
6121
6167
|
draft.errors = [];
|
|
6122
6168
|
draft.validationAsyncState.messages = {};
|
|
6123
6169
|
draft.value = updatedValue;
|
|
@@ -6125,7 +6171,7 @@ var createTextInputComponent = (textInputProps, onComponentUpdate) => {
|
|
|
6125
6171
|
performOnChange == null ? void 0 : performOnChange(prevValue, updatedValue);
|
|
6126
6172
|
const isValid = getValidationErrors(updatedValue).length === 0;
|
|
6127
6173
|
if (isValid) {
|
|
6128
|
-
validateAsync == null ? void 0 : validateAsync(
|
|
6174
|
+
validateAsync == null ? void 0 : validateAsync(component, updatedValue);
|
|
6129
6175
|
}
|
|
6130
6176
|
if (!updatedValue) {
|
|
6131
6177
|
validateAsync == null ? void 0 : validateAsync.cancel();
|
|
@@ -6133,26 +6179,26 @@ var createTextInputComponent = (textInputProps, onComponentUpdate) => {
|
|
|
6133
6179
|
onValueChange();
|
|
6134
6180
|
},
|
|
6135
6181
|
async getSubmittableValue() {
|
|
6136
|
-
return
|
|
6182
|
+
return component.getSubmittableValueSync();
|
|
6137
6183
|
},
|
|
6138
6184
|
getSubmittableValueSync() {
|
|
6139
|
-
return
|
|
6185
|
+
return component.getLocalValue() || null;
|
|
6140
6186
|
},
|
|
6141
6187
|
getSummary() {
|
|
6142
|
-
return summariser(
|
|
6188
|
+
return summariser(component.getLocalValue());
|
|
6143
6189
|
},
|
|
6144
6190
|
getLocalValue() {
|
|
6145
|
-
return
|
|
6191
|
+
return component.value;
|
|
6146
6192
|
},
|
|
6147
6193
|
validate() {
|
|
6148
|
-
const errors = getValidationErrors(
|
|
6149
|
-
|
|
6194
|
+
const errors = getValidationErrors(component.getLocalValue());
|
|
6195
|
+
update(component, (draft) => {
|
|
6150
6196
|
draft.errors = errors;
|
|
6151
6197
|
});
|
|
6152
6198
|
return errors.length === 0;
|
|
6153
6199
|
}
|
|
6154
6200
|
}, rest);
|
|
6155
|
-
return
|
|
6201
|
+
return component;
|
|
6156
6202
|
};
|
|
6157
6203
|
|
|
6158
6204
|
// src/domain/mappers/schema/stringSchemaToComponent/stringSchemaToTextInputComponent.ts
|
|
@@ -6476,8 +6522,10 @@ var mapStepToComponent = (_a) => {
|
|
|
6476
6522
|
stepPrefetch,
|
|
6477
6523
|
step,
|
|
6478
6524
|
referencedSchemaIds,
|
|
6525
|
+
features,
|
|
6479
6526
|
onComponentUpdate,
|
|
6480
6527
|
trackEvent,
|
|
6528
|
+
logEvent,
|
|
6481
6529
|
onBehavior,
|
|
6482
6530
|
onLoad: stepOnLoad
|
|
6483
6531
|
});
|
|
@@ -6493,7 +6541,7 @@ var getReferencedSchemaId = (step) => {
|
|
|
6493
6541
|
var mapBackNavigation = (navigation, onBehavior, isNativeBackEnabled) => {
|
|
6494
6542
|
var _a;
|
|
6495
6543
|
const backNavigation = (_a = navigation == null ? void 0 : navigation.back) != null ? _a : navigation == null ? void 0 : navigation.backButton;
|
|
6496
|
-
const backBehavior = { type: "back", action: backNavigation == null ? void 0 : backNavigation.action };
|
|
6544
|
+
const backBehavior = { type: "back", action: backNavigation == null ? void 0 : backNavigation.action, track: false };
|
|
6497
6545
|
return backNavigation || isNativeBackEnabled ? {
|
|
6498
6546
|
title: backNavigation == null ? void 0 : backNavigation.title,
|
|
6499
6547
|
onClick: () => {
|
|
@@ -6709,10 +6757,10 @@ var executePoll = async (props) => {
|
|
|
6709
6757
|
}
|
|
6710
6758
|
case "modal": {
|
|
6711
6759
|
assertModalResponseBody(body);
|
|
6712
|
-
return { type: "behavior", behavior: __spreadValues({ type: "modal" }, body) };
|
|
6760
|
+
return { type: "behavior", behavior: __spreadProps(__spreadValues({ type: "modal" }, body), { track: false }) };
|
|
6713
6761
|
}
|
|
6714
6762
|
case "no-op": {
|
|
6715
|
-
return { type: "behavior", behavior: { type: "none" } };
|
|
6763
|
+
return { type: "behavior", behavior: { type: "none", track: false } };
|
|
6716
6764
|
}
|
|
6717
6765
|
case "subflow": {
|
|
6718
6766
|
assertSubflowResponseBody(body);
|
|
@@ -6737,7 +6785,8 @@ var executePoll = async (props) => {
|
|
|
6737
6785
|
};
|
|
6738
6786
|
var actionResponseBodyToBehavior = (body) => ({
|
|
6739
6787
|
type: "non-merging-action",
|
|
6740
|
-
action: body.action
|
|
6788
|
+
action: body.action,
|
|
6789
|
+
track: false
|
|
6741
6790
|
});
|
|
6742
6791
|
|
|
6743
6792
|
// src/controller/executeRefresh.ts
|
|
@@ -6792,36 +6841,30 @@ var executeRefresh = async (props) => {
|
|
|
6792
6841
|
};
|
|
6793
6842
|
|
|
6794
6843
|
// src/domain/components/SubflowComponent.ts
|
|
6795
|
-
var createSubflowComponent = (
|
|
6796
|
-
switch (
|
|
6844
|
+
var createSubflowComponent = (props, onComponentUpdate) => {
|
|
6845
|
+
switch (props.subflowType) {
|
|
6797
6846
|
case "dynamic":
|
|
6798
|
-
return createDynamicSubflowComponent(
|
|
6847
|
+
return createDynamicSubflowComponent(props, onComponentUpdate);
|
|
6799
6848
|
case "native":
|
|
6800
|
-
return createNativeSubflowComponent(
|
|
6849
|
+
return createNativeSubflowComponent(props);
|
|
6801
6850
|
}
|
|
6802
6851
|
};
|
|
6803
|
-
var createDynamicSubflowComponent = (
|
|
6852
|
+
var createDynamicSubflowComponent = (props, onComponentUpdate) => {
|
|
6804
6853
|
const update = getInputUpdateFunction(onComponentUpdate);
|
|
6805
|
-
|
|
6854
|
+
return __spreadValues({
|
|
6806
6855
|
uid: `subflow-dynamic-${getRandomId()}`,
|
|
6807
6856
|
type: "subflow",
|
|
6808
6857
|
subflowType: "dynamic",
|
|
6809
6858
|
kind: "layout"
|
|
6810
|
-
},
|
|
6811
|
-
_update(updateFn) {
|
|
6812
|
-
update(this, updateFn);
|
|
6813
|
-
}
|
|
6814
|
-
});
|
|
6815
|
-
return subflowComponent;
|
|
6859
|
+
}, props);
|
|
6816
6860
|
};
|
|
6817
|
-
var createNativeSubflowComponent = (
|
|
6818
|
-
|
|
6861
|
+
var createNativeSubflowComponent = (props) => {
|
|
6862
|
+
return __spreadValues({
|
|
6819
6863
|
uid: `subflow-native-${getRandomId()}`,
|
|
6820
6864
|
type: "subflow",
|
|
6821
6865
|
subflowType: "native",
|
|
6822
6866
|
kind: "layout"
|
|
6823
|
-
},
|
|
6824
|
-
return subflowComponent;
|
|
6867
|
+
}, props);
|
|
6825
6868
|
};
|
|
6826
6869
|
|
|
6827
6870
|
// src/controller/executeSubflow.ts
|
|
@@ -7075,6 +7118,7 @@ var createFlowController = (props) => {
|
|
|
7075
7118
|
};
|
|
7076
7119
|
const onBehavior = async (behavior) => {
|
|
7077
7120
|
var _a;
|
|
7121
|
+
trackBehaviorTriggered(trackEvent, behavior);
|
|
7078
7122
|
switch (behavior.type) {
|
|
7079
7123
|
case "download": {
|
|
7080
7124
|
try {
|
|
@@ -7677,6 +7721,28 @@ var formatDateOptions = {
|
|
|
7677
7721
|
dateStyle: "long"
|
|
7678
7722
|
};
|
|
7679
7723
|
|
|
7724
|
+
// src/renderers/mappers/utils/mapCallToAction.ts
|
|
7725
|
+
var mapCallToAction = (_a) => {
|
|
7726
|
+
var _b = _a, {
|
|
7727
|
+
hrefWithTracking
|
|
7728
|
+
} = _b, cta = __objRest(_b, [
|
|
7729
|
+
"hrefWithTracking"
|
|
7730
|
+
]);
|
|
7731
|
+
return __spreadProps(__spreadValues({}, cta), {
|
|
7732
|
+
getAnchorProps: hrefWithTracking
|
|
7733
|
+
});
|
|
7734
|
+
};
|
|
7735
|
+
var mapCallToActionOptional = (cta) => cta ? mapCallToAction(cta) : void 0;
|
|
7736
|
+
var mapAdditionalInfo2 = (info) => {
|
|
7737
|
+
if (info) {
|
|
7738
|
+
const _a = info, { hrefWithTracking } = _a, rest = __objRest(_a, ["hrefWithTracking"]);
|
|
7739
|
+
return __spreadProps(__spreadValues({}, rest), {
|
|
7740
|
+
getAnchorProps: hrefWithTracking
|
|
7741
|
+
});
|
|
7742
|
+
}
|
|
7743
|
+
return void 0;
|
|
7744
|
+
};
|
|
7745
|
+
|
|
7680
7746
|
// src/renderers/mappers/utils/pick.ts
|
|
7681
7747
|
function pick(obj, ...keys) {
|
|
7682
7748
|
const result = {};
|
|
@@ -7687,18 +7753,9 @@ function pick(obj, ...keys) {
|
|
|
7687
7753
|
}
|
|
7688
7754
|
|
|
7689
7755
|
// src/renderers/mappers/alertComponentToProps.ts
|
|
7690
|
-
var alertComponentToProps = (component, rendererMapperProps) => __spreadValues(__spreadValues({}, pick(
|
|
7691
|
-
component
|
|
7692
|
-
|
|
7693
|
-
"analyticsId",
|
|
7694
|
-
"type",
|
|
7695
|
-
"callToAction",
|
|
7696
|
-
"context",
|
|
7697
|
-
"control",
|
|
7698
|
-
"margin",
|
|
7699
|
-
"markdown",
|
|
7700
|
-
"tags"
|
|
7701
|
-
)), rendererMapperProps);
|
|
7756
|
+
var alertComponentToProps = (component, rendererMapperProps) => __spreadValues(__spreadProps(__spreadValues({}, pick(component, "uid", "analyticsId", "type", "context", "control", "margin", "markdown", "tags")), {
|
|
7757
|
+
callToAction: mapCallToActionOptional(component.callToAction)
|
|
7758
|
+
}), rendererMapperProps);
|
|
7702
7759
|
|
|
7703
7760
|
// src/renderers/mappers/allOfComponentToProps.ts
|
|
7704
7761
|
var allOfComponentToProps = (component, rendererMapperProps) => {
|
|
@@ -7750,48 +7807,32 @@ var getValidationState = (errors, validationAsyncState) => {
|
|
|
7750
7807
|
// src/renderers/mappers/utils/inputComponentToProps.ts
|
|
7751
7808
|
var inputComponentToProps = (component, type) => {
|
|
7752
7809
|
var _a;
|
|
7753
|
-
const {
|
|
7754
|
-
uid,
|
|
7755
|
-
analyticsId,
|
|
7756
|
-
control,
|
|
7757
|
-
description,
|
|
7758
|
-
disabled,
|
|
7759
|
-
errors,
|
|
7760
|
-
help,
|
|
7761
|
-
id,
|
|
7762
|
-
media,
|
|
7763
|
-
placeholder,
|
|
7764
|
-
required,
|
|
7765
|
-
title,
|
|
7766
|
-
tags,
|
|
7767
|
-
validationAsyncState,
|
|
7768
|
-
inlineAlert,
|
|
7769
|
-
onBlur,
|
|
7770
|
-
onFocus
|
|
7771
|
-
} = component;
|
|
7810
|
+
const { errors, validationAsyncState } = component;
|
|
7772
7811
|
const { messages } = validationAsyncState != null ? validationAsyncState : {};
|
|
7773
|
-
return {
|
|
7774
|
-
|
|
7775
|
-
|
|
7812
|
+
return __spreadProps(__spreadValues({}, pick(
|
|
7813
|
+
component,
|
|
7814
|
+
"uid",
|
|
7815
|
+
"analyticsId",
|
|
7816
|
+
"control",
|
|
7817
|
+
"description",
|
|
7818
|
+
"disabled",
|
|
7819
|
+
"help",
|
|
7820
|
+
"id",
|
|
7821
|
+
"media",
|
|
7822
|
+
"placeholder",
|
|
7823
|
+
"required",
|
|
7824
|
+
"title",
|
|
7825
|
+
"tags",
|
|
7826
|
+
"inlineAlert",
|
|
7827
|
+
"onBlur",
|
|
7828
|
+
"onFocus"
|
|
7829
|
+
)), {
|
|
7776
7830
|
type,
|
|
7777
|
-
control,
|
|
7778
|
-
description,
|
|
7779
|
-
disabled,
|
|
7780
7831
|
error: (_a = messages == null ? void 0 : messages.error) != null ? _a : errors == null ? void 0 : errors[0],
|
|
7781
|
-
help,
|
|
7782
|
-
id,
|
|
7783
|
-
media,
|
|
7784
|
-
placeholder,
|
|
7785
|
-
required,
|
|
7786
|
-
title,
|
|
7787
|
-
tags,
|
|
7788
7832
|
value: component.getLocalValue(),
|
|
7789
7833
|
validationState: getValidationState(errors, validationAsyncState),
|
|
7790
|
-
|
|
7791
|
-
|
|
7792
|
-
onBlur: onBlur.bind(component),
|
|
7793
|
-
onFocus: onFocus.bind(component)
|
|
7794
|
-
};
|
|
7834
|
+
fieldLoadingState: getFieldLoadingState(component)
|
|
7835
|
+
});
|
|
7795
7836
|
};
|
|
7796
7837
|
var getFieldLoadingState = (component) => {
|
|
7797
7838
|
const { validationAsyncState } = component;
|
|
@@ -7804,12 +7845,9 @@ var getFieldLoadingState = (component) => {
|
|
|
7804
7845
|
// src/renderers/mappers/booleanInputComponentToProps.ts
|
|
7805
7846
|
var booleanInputComponentToProps = (component, rendererMapperProps) => {
|
|
7806
7847
|
var _a;
|
|
7807
|
-
return __spreadProps(__spreadValues(__spreadValues({}, inputComponentToProps(component, "input-checkbox")), rendererMapperProps), {
|
|
7808
|
-
|
|
7809
|
-
|
|
7810
|
-
inlineAlert: component.inlineAlert,
|
|
7811
|
-
value: (_a = component.value) != null ? _a : false,
|
|
7812
|
-
onChange: component.onChange.bind(component)
|
|
7848
|
+
return __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, inputComponentToProps(component, "input-checkbox")), rendererMapperProps), pick(component, "additionalText", "supportingValues", "inlineAlert")), {
|
|
7849
|
+
onChange: component.setValue,
|
|
7850
|
+
value: (_a = component.value) != null ? _a : false
|
|
7813
7851
|
});
|
|
7814
7852
|
};
|
|
7815
7853
|
|
|
@@ -7858,30 +7896,14 @@ var buttonComponentToProps = (component, rendererMapperProps) => {
|
|
|
7858
7896
|
};
|
|
7859
7897
|
|
|
7860
7898
|
// src/renderers/mappers/columnsComponentToProps.ts
|
|
7861
|
-
var columnsComponentToProps = ({
|
|
7862
|
-
|
|
7863
|
-
analyticsId,
|
|
7864
|
-
bias,
|
|
7865
|
-
control,
|
|
7866
|
-
margin,
|
|
7867
|
-
tags,
|
|
7868
|
-
startComponents,
|
|
7869
|
-
endComponents
|
|
7870
|
-
}, rendererMapperProps) => {
|
|
7871
|
-
const startChildrenProps = startComponents.map(
|
|
7899
|
+
var columnsComponentToProps = (component, rendererMapperProps) => {
|
|
7900
|
+
const startChildrenProps = component.startComponents.map(
|
|
7872
7901
|
(c) => componentToRendererProps(c, rendererMapperProps)
|
|
7873
7902
|
);
|
|
7874
|
-
const endChildrenProps = endComponents.map(
|
|
7903
|
+
const endChildrenProps = component.endComponents.map(
|
|
7875
7904
|
(c) => componentToRendererProps(c, rendererMapperProps)
|
|
7876
7905
|
);
|
|
7877
|
-
return __spreadProps(__spreadValues({}, rendererMapperProps), {
|
|
7878
|
-
uid,
|
|
7879
|
-
analyticsId,
|
|
7880
|
-
type: "columns",
|
|
7881
|
-
bias,
|
|
7882
|
-
control,
|
|
7883
|
-
margin,
|
|
7884
|
-
tags,
|
|
7906
|
+
return __spreadProps(__spreadValues(__spreadValues({}, rendererMapperProps), pick(component, "uid", "analyticsId", "type", "bias", "control", "margin", "tags")), {
|
|
7885
7907
|
startChildren: startChildrenProps.map(rendererMapperProps.render),
|
|
7886
7908
|
endChildren: endChildrenProps.map(rendererMapperProps.render),
|
|
7887
7909
|
startChildrenProps,
|
|
@@ -7905,29 +7927,24 @@ var constComponentToProps = (component, rendererMapperProps) => {
|
|
|
7905
7927
|
// src/renderers/mappers/containerComponentToProps.ts
|
|
7906
7928
|
var containerComponentToProps = (component, rendererMapperProps) => {
|
|
7907
7929
|
const childrenProps = component.getChildren().map((c) => componentToRendererProps(c, rendererMapperProps));
|
|
7908
|
-
return __spreadValues({
|
|
7909
|
-
type: "container",
|
|
7910
|
-
uid: component.uid,
|
|
7930
|
+
return __spreadValues(__spreadProps(__spreadValues({}, pick(component, "type", "uid")), {
|
|
7911
7931
|
children: childrenProps.map(rendererMapperProps.render),
|
|
7912
7932
|
childrenProps
|
|
7913
|
-
}, rendererMapperProps);
|
|
7933
|
+
}), rendererMapperProps);
|
|
7914
7934
|
};
|
|
7915
7935
|
|
|
7916
7936
|
// src/renderers/mappers/dateInputComponentToProps.ts
|
|
7917
|
-
var dateInputComponentToProps = (component, rendererMapperProps) => __spreadProps(__spreadValues(__spreadValues({}, inputComponentToProps(component, "input-date")), rendererMapperProps), {
|
|
7918
|
-
|
|
7919
|
-
minimumDate: component.minimumDate,
|
|
7920
|
-
maximumDate: component.maximumDate,
|
|
7921
|
-
suggestions: component.suggestions,
|
|
7922
|
-
onChange: component.onChange.bind(component)
|
|
7937
|
+
var dateInputComponentToProps = (component, rendererMapperProps) => __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, inputComponentToProps(component, "input-date")), rendererMapperProps), pick(component, "autoComplete", "minimumDate", "maximumDate", "suggestions")), {
|
|
7938
|
+
onChange: component.setValue
|
|
7923
7939
|
});
|
|
7924
7940
|
|
|
7925
7941
|
// src/renderers/mappers/decisionComponentToProps.ts
|
|
7926
7942
|
var decisionComponentToProps = (component, rendererMapperProps) => __spreadProps(__spreadValues(__spreadValues({}, pick(component, "uid", "analyticsId", "type", "control", "margin", "title", "tags")), rendererMapperProps), {
|
|
7927
7943
|
options: component.options.map((_a) => {
|
|
7928
|
-
var _b = _a, { disabled } = _b,
|
|
7929
|
-
return __spreadProps(__spreadValues({},
|
|
7930
|
-
disabled: disabled || rendererMapperProps.stepLoadingState !== "idle"
|
|
7944
|
+
var _b = _a, { disabled } = _b, option = __objRest(_b, ["disabled"]);
|
|
7945
|
+
return __spreadProps(__spreadValues({}, option), {
|
|
7946
|
+
disabled: disabled || rendererMapperProps.stepLoadingState !== "idle",
|
|
7947
|
+
getAnchorProps: option.hrefWithTracking
|
|
7931
7948
|
});
|
|
7932
7949
|
})
|
|
7933
7950
|
});
|
|
@@ -7937,14 +7954,11 @@ var dividerComponentToProps = (component, rendererMapperProps) => __spreadValues
|
|
|
7937
7954
|
|
|
7938
7955
|
// src/renderers/mappers/externalComponentToProps.ts
|
|
7939
7956
|
var externalComponentToProps = (component, rendererMapperProps) => {
|
|
7940
|
-
return __spreadValues({
|
|
7941
|
-
type: "external-confirmation"
|
|
7942
|
-
|
|
7943
|
-
|
|
7944
|
-
|
|
7945
|
-
open: component.open.bind(component),
|
|
7946
|
-
onCancel: component.onCancel.bind(component)
|
|
7947
|
-
}, rendererMapperProps);
|
|
7957
|
+
return __spreadValues(__spreadProps(__spreadValues({
|
|
7958
|
+
type: "external-confirmation"
|
|
7959
|
+
}, pick(component, "uid", "url", "open", "onCancel")), {
|
|
7960
|
+
visible: component.status === "failure"
|
|
7961
|
+
}), rendererMapperProps);
|
|
7948
7962
|
};
|
|
7949
7963
|
|
|
7950
7964
|
// src/renderers/mappers/formattedValueComponentToProps.ts
|
|
@@ -7965,25 +7979,18 @@ var formattedValueComponentToProps = (component, rendererMapperProps) => {
|
|
|
7965
7979
|
// for now, we don't want to pass `value` down to the renderer to avoid the "WhateverComponent".
|
|
7966
7980
|
// 'value',
|
|
7967
7981
|
)), {
|
|
7968
|
-
|
|
7969
|
-
|
|
7982
|
+
onChange: component.setValue,
|
|
7983
|
+
validationState: getValidationState(component.errors, void 0)
|
|
7970
7984
|
}), rendererMapperProps);
|
|
7971
7985
|
};
|
|
7972
7986
|
|
|
7973
7987
|
// src/renderers/mappers/formComponentToProps.ts
|
|
7974
7988
|
var formComponentToProps = (component, rendererMapperProps) => {
|
|
7975
7989
|
const childrenProps = component.getChildren().map((c) => componentToRendererProps(c, rendererMapperProps));
|
|
7976
|
-
|
|
7977
|
-
return __spreadValues({
|
|
7978
|
-
uid,
|
|
7979
|
-
analyticsId,
|
|
7980
|
-
type: "form",
|
|
7990
|
+
return __spreadValues(__spreadProps(__spreadValues({}, pick(component, "uid", "analyticsId", "type", "control", "margin", "tags")), {
|
|
7981
7991
|
children: childrenProps.map(rendererMapperProps.render),
|
|
7982
|
-
childrenProps
|
|
7983
|
-
|
|
7984
|
-
margin,
|
|
7985
|
-
tags
|
|
7986
|
-
}, rendererMapperProps);
|
|
7992
|
+
childrenProps
|
|
7993
|
+
}), rendererMapperProps);
|
|
7987
7994
|
};
|
|
7988
7995
|
|
|
7989
7996
|
// src/renderers/mappers/headingComponentToProps.ts
|
|
@@ -8016,26 +8023,18 @@ var imageComponentToProps = (component, rendererMapperProps) => __spreadProps(__
|
|
|
8016
8023
|
var instructionsComponentToProps = (component, rendererMapperProps) => __spreadValues(__spreadValues({}, pick(component, "uid", "analyticsId", "type", "control", "items", "margin", "title", "tags")), rendererMapperProps);
|
|
8017
8024
|
|
|
8018
8025
|
// src/renderers/mappers/integerInputComponentToProps.ts
|
|
8019
|
-
var integerInputComponentToProps = (component, rendererMapperProps) => __spreadProps(__spreadValues(__spreadValues({}, inputComponentToProps(component, "input-integer")), rendererMapperProps), {
|
|
8020
|
-
|
|
8021
|
-
maximum: component.maximum,
|
|
8022
|
-
minimum: component.minimum,
|
|
8023
|
-
onChange: component.onChange.bind(component)
|
|
8026
|
+
var integerInputComponentToProps = (component, rendererMapperProps) => __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, inputComponentToProps(component, "input-integer")), rendererMapperProps), pick(component, "autoComplete", "maximum", "minimum")), {
|
|
8027
|
+
onChange: component.setValue
|
|
8024
8028
|
});
|
|
8025
8029
|
|
|
8026
8030
|
// src/renderers/mappers/listComponentToProps.ts
|
|
8027
|
-
var listComponentToProps = (component, rendererMapperProps) => __spreadValues(__spreadValues({}, pick(
|
|
8028
|
-
component,
|
|
8029
|
-
|
|
8030
|
-
|
|
8031
|
-
|
|
8032
|
-
|
|
8033
|
-
|
|
8034
|
-
"items",
|
|
8035
|
-
"margin",
|
|
8036
|
-
"title",
|
|
8037
|
-
"tags"
|
|
8038
|
-
)), rendererMapperProps);
|
|
8031
|
+
var listComponentToProps = (component, rendererMapperProps) => __spreadValues(__spreadProps(__spreadValues({}, pick(component, "uid", "analyticsId", "type", "control", "margin", "title", "tags")), {
|
|
8032
|
+
callToAction: mapCallToActionOptional(component.callToAction),
|
|
8033
|
+
items: component.items.map((item) => __spreadProps(__spreadValues({}, item), {
|
|
8034
|
+
callToAction: mapCallToActionOptional(item.callToAction),
|
|
8035
|
+
additionalInfo: mapAdditionalInfo2(item.additionalInfo)
|
|
8036
|
+
}))
|
|
8037
|
+
}), rendererMapperProps);
|
|
8039
8038
|
|
|
8040
8039
|
// src/renderers/mappers/loadingIndicatorComponentToProps.ts
|
|
8041
8040
|
var loadingIndicatorComponentToProps = (component, rendererMapperProps) => __spreadValues(__spreadValues({}, pick(component, "uid", "analyticsId", "type", "control", "margin", "size", "tags")), rendererMapperProps);
|
|
@@ -8059,39 +8058,25 @@ var mediaComponentToProps = (component, rendererMapperProps) => __spreadValues(_
|
|
|
8059
8058
|
|
|
8060
8059
|
// src/renderers/mappers/modalComponentToProps.ts
|
|
8061
8060
|
var modalComponentToProps = (component, rendererMapperProps) => {
|
|
8062
|
-
const { uid, analyticsId, open, tags, title, close } = component;
|
|
8063
8061
|
const childrenProps = component.getChildren().map((c) => componentToRendererProps(c, rendererMapperProps));
|
|
8064
|
-
return __spreadValues({
|
|
8065
|
-
uid,
|
|
8066
|
-
analyticsId,
|
|
8067
|
-
type: "modal",
|
|
8068
|
-
open,
|
|
8069
|
-
tags,
|
|
8070
|
-
title,
|
|
8062
|
+
return __spreadValues(__spreadProps(__spreadValues({}, pick(component, "uid", "analyticsId", "type", "open", "tags", "title")), {
|
|
8071
8063
|
children: childrenProps.map(rendererMapperProps.render),
|
|
8072
8064
|
childrenProps,
|
|
8073
|
-
onClose: close
|
|
8074
|
-
}, rendererMapperProps);
|
|
8065
|
+
onClose: component.close
|
|
8066
|
+
}), rendererMapperProps);
|
|
8075
8067
|
};
|
|
8076
8068
|
|
|
8077
8069
|
// src/renderers/mappers/modalLayoutComponentToProps.ts
|
|
8078
8070
|
var modalLayoutComponentToProps = (component, rendererMapperProps) => {
|
|
8079
|
-
const {
|
|
8071
|
+
const { content } = component;
|
|
8080
8072
|
const childrenProps = component.getChildren().map((c) => componentToRendererProps(c, rendererMapperProps));
|
|
8081
|
-
return __spreadValues({
|
|
8082
|
-
uid,
|
|
8083
|
-
analyticsId,
|
|
8084
|
-
type: "modal-layout",
|
|
8073
|
+
return __spreadValues(__spreadProps(__spreadValues({}, pick(component, "uid", "analyticsId", "type", "control", "margin", "tags", "trigger")), {
|
|
8085
8074
|
content: {
|
|
8086
8075
|
children: childrenProps.map(rendererMapperProps.render),
|
|
8087
8076
|
childrenProps,
|
|
8088
8077
|
title: content.title
|
|
8089
|
-
}
|
|
8090
|
-
|
|
8091
|
-
margin,
|
|
8092
|
-
tags,
|
|
8093
|
-
trigger
|
|
8094
|
-
}, rendererMapperProps);
|
|
8078
|
+
}
|
|
8079
|
+
}), rendererMapperProps);
|
|
8095
8080
|
};
|
|
8096
8081
|
|
|
8097
8082
|
// src/renderers/mappers/moneyInputComponentToProps.ts
|
|
@@ -8118,8 +8103,8 @@ var moneyInputComponentToProps = (component, rendererMapperProps) => {
|
|
|
8118
8103
|
return __spreadValues(__spreadProps(__spreadValues({}, inputComponentToProps(component, "money-input")), {
|
|
8119
8104
|
amountValue: amountComponent.getLocalValue(),
|
|
8120
8105
|
selectedCurrencyIndex: currencyComponent.selectedIndex,
|
|
8121
|
-
onAmountChange: amountComponent.
|
|
8122
|
-
onCurrencyChange: currencyComponent.
|
|
8106
|
+
onAmountChange: amountComponent.setValue,
|
|
8107
|
+
onCurrencyChange: currencyComponent.selectIndex,
|
|
8123
8108
|
placeholder: amountComponent.placeholder,
|
|
8124
8109
|
currencies,
|
|
8125
8110
|
validationState
|
|
@@ -8151,47 +8136,42 @@ var selectInputOptionsToProps = (options, children, rendererMapperProps) => {
|
|
|
8151
8136
|
|
|
8152
8137
|
// src/renderers/mappers/multiSelectComponentToProps.ts
|
|
8153
8138
|
var multiSelectInputComponentToProps = (component, rendererMapperProps) => {
|
|
8154
|
-
const { autoComplete, maxItems, minItems, selectedIndices, onSelect } = component;
|
|
8155
8139
|
const _a = inputComponentToProps(component, "input-multi-select"), { required, value } = _a, props = __objRest(_a, ["required", "value"]);
|
|
8156
8140
|
const options = selectInputOptionsToProps(
|
|
8157
8141
|
component.options,
|
|
8158
8142
|
component.getChildren(),
|
|
8159
8143
|
rendererMapperProps
|
|
8160
8144
|
);
|
|
8161
|
-
return __spreadProps(__spreadValues(__spreadValues({}, props), rendererMapperProps), {
|
|
8162
|
-
|
|
8163
|
-
|
|
8164
|
-
minItems,
|
|
8165
|
-
options,
|
|
8166
|
-
selectedIndices,
|
|
8167
|
-
onSelect: onSelect.bind(component)
|
|
8145
|
+
return __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, props), rendererMapperProps), pick(component, "autoComplete", "maxItems", "minItems", "selectedIndices")), {
|
|
8146
|
+
onSelect: component.selectIndices,
|
|
8147
|
+
options
|
|
8168
8148
|
});
|
|
8169
8149
|
};
|
|
8170
8150
|
|
|
8171
8151
|
// src/renderers/mappers/multiUploadInputComponentToProps.ts
|
|
8172
8152
|
var multiUploadInputComponentToProps = (component, rendererMapperProps) => {
|
|
8173
|
-
const {
|
|
8174
|
-
return __spreadProps(__spreadValues(__spreadValues({}, inputComponentToProps(component, "input-upload-multi")), rendererMapperProps),
|
|
8175
|
-
|
|
8176
|
-
|
|
8177
|
-
|
|
8178
|
-
|
|
8179
|
-
|
|
8180
|
-
|
|
8181
|
-
|
|
8153
|
+
const { files } = component;
|
|
8154
|
+
return __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, inputComponentToProps(component, "input-upload-multi")), rendererMapperProps), pick(
|
|
8155
|
+
component,
|
|
8156
|
+
"accepts",
|
|
8157
|
+
"cameraConfig",
|
|
8158
|
+
"maxSize",
|
|
8159
|
+
"minItems",
|
|
8160
|
+
"maxItems",
|
|
8161
|
+
"source",
|
|
8162
|
+
"uploadLabel"
|
|
8163
|
+
)), {
|
|
8182
8164
|
value: files.map((file) => __spreadProps(__spreadValues({}, file), {
|
|
8183
8165
|
validationState: mapErrorsToValidationState(file.errors)
|
|
8184
8166
|
})),
|
|
8185
|
-
onInsertFile: component.
|
|
8186
|
-
onRemoveFile: component.
|
|
8167
|
+
onInsertFile: component.insertFile,
|
|
8168
|
+
onRemoveFile: component.removeFile
|
|
8187
8169
|
});
|
|
8188
8170
|
};
|
|
8189
8171
|
|
|
8190
8172
|
// src/renderers/mappers/numberInputComponentToProps.ts
|
|
8191
|
-
var numberInputComponentToProps = (component, rendererMapperProps) => __spreadProps(__spreadValues(__spreadValues({}, inputComponentToProps(component, "input-number")), rendererMapperProps), {
|
|
8192
|
-
|
|
8193
|
-
minimum: component.minimum,
|
|
8194
|
-
onChange: component.onChange.bind(component)
|
|
8173
|
+
var numberInputComponentToProps = (component, rendererMapperProps) => __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, inputComponentToProps(component, "input-number")), rendererMapperProps), pick(component, "maximum", "minimum")), {
|
|
8174
|
+
onChange: component.setValue
|
|
8195
8175
|
});
|
|
8196
8176
|
|
|
8197
8177
|
// src/renderers/mappers/objectComponentToProps.ts
|
|
@@ -8256,27 +8236,7 @@ var progressComponentToProps = (component, rendererMapperProps) => __spreadValue
|
|
|
8256
8236
|
|
|
8257
8237
|
// src/renderers/mappers/repeatableComponentToProps.ts
|
|
8258
8238
|
var repeatableComponentToProps = (component, rendererMapperProps) => {
|
|
8259
|
-
const {
|
|
8260
|
-
uid,
|
|
8261
|
-
analyticsId,
|
|
8262
|
-
addItemTitle,
|
|
8263
|
-
control,
|
|
8264
|
-
components,
|
|
8265
|
-
description,
|
|
8266
|
-
editableComponent,
|
|
8267
|
-
editItemTitle,
|
|
8268
|
-
errors,
|
|
8269
|
-
maxItems,
|
|
8270
|
-
media,
|
|
8271
|
-
minItems,
|
|
8272
|
-
summaryDefaults,
|
|
8273
|
-
title = "",
|
|
8274
|
-
tags,
|
|
8275
|
-
onEdit,
|
|
8276
|
-
onAdd,
|
|
8277
|
-
onSave,
|
|
8278
|
-
onRemove
|
|
8279
|
-
} = component;
|
|
8239
|
+
const { components, editableComponent, errors, summaryDefaults, title = "" } = component;
|
|
8280
8240
|
const childrenProps = component.getChildren().map((c) => componentToRendererProps(c, rendererMapperProps));
|
|
8281
8241
|
const editableItemProps = editableComponent ? componentToRendererProps(editableComponent, rendererMapperProps) : null;
|
|
8282
8242
|
const getSummary = (componentSummary) => {
|
|
@@ -8290,75 +8250,63 @@ var repeatableComponentToProps = (component, rendererMapperProps) => {
|
|
|
8290
8250
|
const itemProps = components.map((childComponent) => __spreadProps(__spreadValues({}, getSummary(childComponent.getSummary())), {
|
|
8291
8251
|
id: `${childComponent.uid}-summary`
|
|
8292
8252
|
}));
|
|
8293
|
-
return __spreadValues({
|
|
8294
|
-
uid,
|
|
8295
|
-
analyticsId,
|
|
8253
|
+
return __spreadValues(__spreadProps(__spreadValues({
|
|
8296
8254
|
type: "repeatable",
|
|
8255
|
+
title
|
|
8256
|
+
}, pick(
|
|
8257
|
+
component,
|
|
8258
|
+
"control",
|
|
8259
|
+
"description",
|
|
8260
|
+
"media",
|
|
8261
|
+
"tags",
|
|
8262
|
+
"uid",
|
|
8263
|
+
"analyticsId",
|
|
8264
|
+
"editItemTitle",
|
|
8265
|
+
"addItemTitle",
|
|
8266
|
+
"maxItems",
|
|
8267
|
+
"minItems"
|
|
8268
|
+
)), {
|
|
8297
8269
|
children: childrenProps.map(rendererMapperProps.render),
|
|
8298
8270
|
childrenProps,
|
|
8299
|
-
addItemTitle,
|
|
8300
|
-
control,
|
|
8301
|
-
description,
|
|
8302
8271
|
editableItem: rendererMapperProps.render(editableItemProps),
|
|
8303
8272
|
editableItemProps,
|
|
8304
|
-
editItemTitle,
|
|
8305
8273
|
items: itemProps,
|
|
8306
|
-
maxItems,
|
|
8307
|
-
media,
|
|
8308
|
-
minItems,
|
|
8309
|
-
title,
|
|
8310
|
-
tags,
|
|
8311
8274
|
validationState: mapErrorsToValidationState(errors),
|
|
8312
|
-
onAdd:
|
|
8313
|
-
onEdit:
|
|
8314
|
-
|
|
8315
|
-
|
|
8316
|
-
}, rendererMapperProps);
|
|
8275
|
+
onAdd: component.addComponent,
|
|
8276
|
+
onEdit: component.editComponent,
|
|
8277
|
+
onRemove: component.removeComponent,
|
|
8278
|
+
onSave: component.saveComponent
|
|
8279
|
+
}), rendererMapperProps);
|
|
8317
8280
|
};
|
|
8318
8281
|
|
|
8319
8282
|
// src/renderers/mappers/reviewComponentToProps.ts
|
|
8320
|
-
var reviewComponentToProps = (component, rendererMapperProps) => __spreadValues(__spreadValues({}, pick(
|
|
8321
|
-
component,
|
|
8322
|
-
|
|
8323
|
-
|
|
8324
|
-
|
|
8325
|
-
|
|
8326
|
-
|
|
8327
|
-
"fields",
|
|
8328
|
-
"margin",
|
|
8329
|
-
"title",
|
|
8330
|
-
"tags"
|
|
8331
|
-
)), rendererMapperProps);
|
|
8283
|
+
var reviewComponentToProps = (component, rendererMapperProps) => __spreadValues(__spreadProps(__spreadValues({}, pick(component, "uid", "analyticsId", "type", "control", "margin", "title", "tags")), {
|
|
8284
|
+
callToAction: mapCallToActionOptional(component.callToAction),
|
|
8285
|
+
fields: component.fields.map((field) => __spreadProps(__spreadValues({}, field), {
|
|
8286
|
+
callToAction: mapCallToActionOptional(field.callToAction),
|
|
8287
|
+
additionalInfo: mapAdditionalInfo2(field.additionalInfo)
|
|
8288
|
+
}))
|
|
8289
|
+
}), rendererMapperProps);
|
|
8332
8290
|
|
|
8333
8291
|
// src/renderers/mappers/searchComponentToProps.ts
|
|
8334
8292
|
var searchComponentToProps = (component, rendererMapperProps) => {
|
|
8335
|
-
const { uid,
|
|
8336
|
-
const onChange = component.onChange.bind(component);
|
|
8337
|
-
const onSelect = component.onSelect.bind(component);
|
|
8293
|
+
const { uid, emptyMessage, error, query, setQuery, selectResult } = component;
|
|
8338
8294
|
const state = getSearchState({
|
|
8339
8295
|
emptyMessage,
|
|
8340
8296
|
error,
|
|
8341
|
-
isLoading,
|
|
8297
|
+
isLoading: component.isLoading,
|
|
8342
8298
|
query,
|
|
8343
8299
|
state: component.state,
|
|
8344
8300
|
rendererMapperProps,
|
|
8345
|
-
|
|
8346
|
-
|
|
8301
|
+
setQuery,
|
|
8302
|
+
selectResult
|
|
8347
8303
|
});
|
|
8348
|
-
return __spreadValues({
|
|
8349
|
-
|
|
8304
|
+
return __spreadValues(__spreadProps(__spreadValues({}, pick(component, "uid", "control", "hint", "isLoading", "margin", "query", "title", "tags")), {
|
|
8305
|
+
onChange: setQuery,
|
|
8350
8306
|
type: "search",
|
|
8351
8307
|
id: uid,
|
|
8352
|
-
|
|
8353
|
-
|
|
8354
|
-
isLoading,
|
|
8355
|
-
margin,
|
|
8356
|
-
query,
|
|
8357
|
-
state,
|
|
8358
|
-
title,
|
|
8359
|
-
tags,
|
|
8360
|
-
onChange
|
|
8361
|
-
}, rendererMapperProps);
|
|
8308
|
+
state
|
|
8309
|
+
}), rendererMapperProps);
|
|
8362
8310
|
};
|
|
8363
8311
|
var getSearchState = ({
|
|
8364
8312
|
emptyMessage,
|
|
@@ -8367,14 +8315,14 @@ var getSearchState = ({
|
|
|
8367
8315
|
query,
|
|
8368
8316
|
state,
|
|
8369
8317
|
rendererMapperProps,
|
|
8370
|
-
|
|
8371
|
-
|
|
8318
|
+
setQuery,
|
|
8319
|
+
selectResult
|
|
8372
8320
|
}) => {
|
|
8373
8321
|
if (isLoading) {
|
|
8374
8322
|
return { type: "pending" };
|
|
8375
8323
|
}
|
|
8376
8324
|
if (error) {
|
|
8377
|
-
return { type: "error", onRetry: () =>
|
|
8325
|
+
return { type: "error", onRetry: () => setQuery(query) };
|
|
8378
8326
|
}
|
|
8379
8327
|
if (!state) {
|
|
8380
8328
|
return { type: "noResults", message: emptyMessage };
|
|
@@ -8401,7 +8349,7 @@ var getSearchState = ({
|
|
|
8401
8349
|
id: result.type === "action" ? (_a = result.value.id) != null ? _a : result.value.$id : void 0,
|
|
8402
8350
|
image: mapSpecImage(result.image),
|
|
8403
8351
|
media: getDomainLayerMedia(result),
|
|
8404
|
-
onClick: () =>
|
|
8352
|
+
onClick: () => selectResult(result)
|
|
8405
8353
|
});
|
|
8406
8354
|
})
|
|
8407
8355
|
};
|
|
@@ -8412,17 +8360,9 @@ var sectionComponentToProps = (component, rendererMapperProps) => {
|
|
|
8412
8360
|
const childrenProps = component.components.map(
|
|
8413
8361
|
(c) => componentToRendererProps(c, rendererMapperProps)
|
|
8414
8362
|
);
|
|
8415
|
-
return __spreadProps(__spreadValues(__spreadValues({}, pick(
|
|
8416
|
-
component
|
|
8417
|
-
|
|
8418
|
-
"analyticsId",
|
|
8419
|
-
"type",
|
|
8420
|
-
"title",
|
|
8421
|
-
"margin",
|
|
8422
|
-
"control",
|
|
8423
|
-
"callToAction",
|
|
8424
|
-
"tags"
|
|
8425
|
-
)), rendererMapperProps), {
|
|
8363
|
+
return __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, pick(component, "uid", "analyticsId", "type", "title", "margin", "control", "tags")), {
|
|
8364
|
+
callToAction: mapCallToActionOptional(component.callToAction)
|
|
8365
|
+
}), rendererMapperProps), {
|
|
8426
8366
|
children: childrenProps.map(rendererMapperProps.render),
|
|
8427
8367
|
childrenProps
|
|
8428
8368
|
});
|
|
@@ -8431,7 +8371,7 @@ var sectionComponentToProps = (component, rendererMapperProps) => {
|
|
|
8431
8371
|
// src/renderers/mappers/selectInputComponentToProps.ts
|
|
8432
8372
|
var selectInputComponentToProps = (component, rendererMapperProps) => {
|
|
8433
8373
|
var _b;
|
|
8434
|
-
const { autoComplete, selectedIndex,
|
|
8374
|
+
const { autoComplete, selectedIndex, selectIndex } = component;
|
|
8435
8375
|
const selectedChild = component.getSelectedChild();
|
|
8436
8376
|
const childrenProps = selectedChild ? componentToRendererProps(selectedChild, rendererMapperProps) : null;
|
|
8437
8377
|
const _a = inputComponentToProps(component, "input-select"), { value } = _a, props = __objRest(_a, ["value"]);
|
|
@@ -8443,7 +8383,7 @@ var selectInputComponentToProps = (component, rendererMapperProps) => {
|
|
|
8443
8383
|
if (options.length === 1 && ((_b = options[0].childrenProps) == null ? void 0 : _b.type) === "form-section") {
|
|
8444
8384
|
if (selectedIndex == null) {
|
|
8445
8385
|
rendererMapperProps.trackEvent("OneOf Option Selected - Auto-select single-option", {});
|
|
8446
|
-
|
|
8386
|
+
selectIndex(0);
|
|
8447
8387
|
}
|
|
8448
8388
|
return options[0].childrenProps;
|
|
8449
8389
|
}
|
|
@@ -8451,14 +8391,18 @@ var selectInputComponentToProps = (component, rendererMapperProps) => {
|
|
|
8451
8391
|
autoComplete,
|
|
8452
8392
|
options,
|
|
8453
8393
|
selectedIndex,
|
|
8454
|
-
onSelect:
|
|
8394
|
+
onSelect: component.selectIndex,
|
|
8455
8395
|
children: rendererMapperProps.render(childrenProps),
|
|
8456
8396
|
childrenProps
|
|
8457
8397
|
});
|
|
8458
8398
|
};
|
|
8459
8399
|
|
|
8460
8400
|
// src/renderers/mappers/statusListComponentToProps.ts
|
|
8461
|
-
var statusListComponentToProps = (component, rendererMapperProps) => __spreadValues(__spreadValues({}, pick(component, "uid", "analyticsId", "type", "control", "
|
|
8401
|
+
var statusListComponentToProps = (component, rendererMapperProps) => __spreadValues(__spreadProps(__spreadValues({}, pick(component, "uid", "analyticsId", "type", "control", "margin", "title", "tags")), {
|
|
8402
|
+
items: component.items.map((item) => __spreadProps(__spreadValues({}, item), {
|
|
8403
|
+
callToAction: mapCallToActionOptional(item.callToAction)
|
|
8404
|
+
}))
|
|
8405
|
+
}), rendererMapperProps);
|
|
8462
8406
|
|
|
8463
8407
|
// src/renderers/mappers/tabsComponentToProps.ts
|
|
8464
8408
|
var tabsComponentToProps = (component, rendererMapperProps) => {
|
|
@@ -8477,15 +8421,17 @@ var tabsComponentToProps = (component, rendererMapperProps) => {
|
|
|
8477
8421
|
};
|
|
8478
8422
|
|
|
8479
8423
|
// src/renderers/mappers/textInputComponentToProps.ts
|
|
8480
|
-
var textInputComponentToProps = (component, rendererMapperProps) => __spreadProps(__spreadValues(__spreadValues({}, inputComponentToProps(component, "input-text")), rendererMapperProps),
|
|
8481
|
-
|
|
8482
|
-
|
|
8483
|
-
displayFormat
|
|
8484
|
-
maxLength
|
|
8485
|
-
minLength
|
|
8486
|
-
pattern
|
|
8487
|
-
suggestions
|
|
8488
|
-
|
|
8424
|
+
var textInputComponentToProps = (component, rendererMapperProps) => __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, inputComponentToProps(component, "input-text")), rendererMapperProps), pick(
|
|
8425
|
+
component,
|
|
8426
|
+
"autoComplete",
|
|
8427
|
+
"displayFormat",
|
|
8428
|
+
"maxLength",
|
|
8429
|
+
"minLength",
|
|
8430
|
+
"pattern",
|
|
8431
|
+
"suggestions"
|
|
8432
|
+
)), {
|
|
8433
|
+
onChange: component.setValue,
|
|
8434
|
+
autoCapitalize: component == null ? void 0 : component.autocapitalization
|
|
8489
8435
|
});
|
|
8490
8436
|
|
|
8491
8437
|
// src/renderers/mappers/tupleComponentToProps.ts
|
|
@@ -8511,30 +8457,15 @@ var tupleComponentToProps = (component, rendererMapperProps) => {
|
|
|
8511
8457
|
|
|
8512
8458
|
// src/renderers/mappers/uploadInputComponentToProps.ts
|
|
8513
8459
|
var uploadInputComponentToProps = (component, rendererMapperProps) => {
|
|
8514
|
-
|
|
8515
|
-
|
|
8516
|
-
cameraConfig,
|
|
8517
|
-
source,
|
|
8518
|
-
accepts,
|
|
8519
|
-
maxSize,
|
|
8520
|
-
onUpload: component.onUpload.bind(component)
|
|
8460
|
+
return __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, inputComponentToProps(component, "input-upload")), rendererMapperProps), pick(component, "accepts", "cameraConfig", "maxSize", "source")), {
|
|
8461
|
+
onUpload: component.setValue
|
|
8521
8462
|
});
|
|
8522
8463
|
};
|
|
8523
8464
|
|
|
8524
8465
|
// src/renderers/mappers/upsellComponentToProps.ts
|
|
8525
|
-
var upsellComponentToProps = (component, rendererMapperProps) => __spreadValues(__spreadProps(__spreadValues({}, pick(
|
|
8526
|
-
component,
|
|
8527
|
-
|
|
8528
|
-
"analyticsId",
|
|
8529
|
-
"type",
|
|
8530
|
-
"callToAction",
|
|
8531
|
-
"control",
|
|
8532
|
-
"margin",
|
|
8533
|
-
"media",
|
|
8534
|
-
"tags",
|
|
8535
|
-
"text"
|
|
8536
|
-
)), {
|
|
8537
|
-
onDismiss: component.onDismiss ? component.onDismiss.bind(component) : void 0
|
|
8466
|
+
var upsellComponentToProps = (component, rendererMapperProps) => __spreadValues(__spreadProps(__spreadValues({}, pick(component, "uid", "analyticsId", "type", "control", "margin", "media", "tags", "text")), {
|
|
8467
|
+
callToAction: mapCallToAction(component.callToAction),
|
|
8468
|
+
onDismiss: component.dismiss
|
|
8538
8469
|
}), rendererMapperProps);
|
|
8539
8470
|
|
|
8540
8471
|
// src/renderers/mappers/componentToRendererProps.ts
|
|
@@ -8691,7 +8622,7 @@ var stepComponentToProps = (component, rendererMapperProps) => {
|
|
|
8691
8622
|
footer: footerProps.map(rendererMapperProps.render),
|
|
8692
8623
|
footerProps,
|
|
8693
8624
|
__onAction: (action) => {
|
|
8694
|
-
void onBehavior({ type: "action", action });
|
|
8625
|
+
void onBehavior({ type: "action", action, track: false });
|
|
8695
8626
|
}
|
|
8696
8627
|
}, restMapperProps);
|
|
8697
8628
|
};
|
|
@@ -8734,27 +8665,33 @@ var subflowComponentToRendererProps = (subflow, rendererMapperProps, nativeSubfl
|
|
|
8734
8665
|
}
|
|
8735
8666
|
};
|
|
8736
8667
|
var dynamicSubflowComponentToRendererProps = (component, rendererMapperProps) => {
|
|
8737
|
-
return __spreadValues(
|
|
8738
|
-
uid: component.uid,
|
|
8668
|
+
return __spreadValues(__spreadValues({
|
|
8739
8669
|
type: "subflow-dynamic"
|
|
8740
|
-
}, pick(
|
|
8741
|
-
|
|
8742
|
-
|
|
8743
|
-
|
|
8744
|
-
|
|
8745
|
-
|
|
8670
|
+
}, pick(
|
|
8671
|
+
component,
|
|
8672
|
+
"uid",
|
|
8673
|
+
"requestCache",
|
|
8674
|
+
"presentation",
|
|
8675
|
+
"initialRequest",
|
|
8676
|
+
"onCancellation",
|
|
8677
|
+
"onCompletion",
|
|
8678
|
+
"onError",
|
|
8679
|
+
"onEvent"
|
|
8680
|
+
)), rendererMapperProps);
|
|
8746
8681
|
};
|
|
8747
8682
|
var nativeSubflowComponentToRendererProps = (component, rendererMapperProps) => {
|
|
8748
|
-
return __spreadValues({
|
|
8749
|
-
|
|
8750
|
-
|
|
8751
|
-
|
|
8752
|
-
|
|
8753
|
-
|
|
8754
|
-
|
|
8755
|
-
|
|
8756
|
-
|
|
8757
|
-
|
|
8683
|
+
return __spreadValues(__spreadValues({
|
|
8684
|
+
type: "subflow-native"
|
|
8685
|
+
}, pick(
|
|
8686
|
+
component,
|
|
8687
|
+
"uid",
|
|
8688
|
+
"id",
|
|
8689
|
+
"payload",
|
|
8690
|
+
"onCancellation",
|
|
8691
|
+
"onCompletion",
|
|
8692
|
+
"onError",
|
|
8693
|
+
"onEvent"
|
|
8694
|
+
)), rendererMapperProps);
|
|
8758
8695
|
};
|
|
8759
8696
|
|
|
8760
8697
|
// src/renderers/mappers/rootComponentToProps.ts
|
|
@@ -9031,7 +8968,8 @@ var eventNames = [
|
|
|
9031
8968
|
"Native Subflow Triggered",
|
|
9032
8969
|
"Native Subflow Succeeded",
|
|
9033
8970
|
"Native Subflow Failed",
|
|
9034
|
-
"Native Subflow Cancelled"
|
|
8971
|
+
"Native Subflow Cancelled",
|
|
8972
|
+
"Behavior Triggered"
|
|
9035
8973
|
];
|
|
9036
8974
|
|
|
9037
8975
|
// src/renderers/subflow/getDynamicSubflowRenderer.tsx
|