@zohodesk/library-platform 1.1.8 → 1.1.9-alpha.1
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/es/bc/zdata-source/Constants.js +6 -11
- package/es/bc/zfield/FieldApiTypes.js +20 -0
- package/es/bc/zform/Properties.js +9 -0
- package/es/bc/zform/Symbol.js +6 -0
- package/es/bc/zlist/Properties.js +3 -0
- package/es/bc/zrecord/Constants.js +10 -17
- package/es/cc/action-icon/Constants.js +3 -5
- package/es/cc/action-location/Constants.js +5 -9
- package/es/cc/avatar/Constants.js +3 -5
- package/es/cc/breadcrumb/Constants.js +3 -5
- package/es/cc/button/Constants.js +3 -5
- package/es/cc/checkbox/Constants.js +5 -9
- package/es/cc/date/Constants.js +5 -9
- package/es/cc/date/Properties.js +9 -0
- package/es/cc/email/Constants.js +3 -5
- package/es/cc/fields/field/Constants.js +9 -13
- package/es/cc/fields/field/FormDefaultUIType.js +1 -1
- package/es/cc/fields/field/Properties.js +63 -0
- package/es/cc/fields/multi-select/Properties.js +9 -0
- package/es/cc/fields/pick-list/Properties.js +9 -0
- package/es/cc/fields/text/Properties.js +9 -0
- package/es/cc/form/Constants.js +6 -11
- package/es/cc/form/Properties.js +17 -0
- package/es/cc/form-connected/Constants.js +10 -19
- package/es/cc/form-connected/Properties.js +35 -0
- package/es/cc/form-connected/SdkContract.js +61 -0
- package/es/cc/form-connected/index.js +2 -0
- package/es/cc/highlighted-value/Constants.js +3 -5
- package/es/cc/highlighted-value/Properties.js +10 -0
- package/es/cc/icon-button/Constants.js +3 -5
- package/es/cc/index.js +1 -1
- package/es/cc/link/Constants.js +3 -5
- package/es/cc/list-item/Constants.js +3 -5
- package/es/cc/more-dropdown/Constants.js +3 -5
- package/es/cc/multi-select/Constants.js +5 -9
- package/es/cc/multi-select/Properties.js +9 -0
- package/es/cc/section/Constants.js +5 -9
- package/es/cc/select/Constants.js +6 -11
- package/es/cc/select/Properties.js +12 -0
- package/es/cc/switch/Constants.js +3 -5
- package/es/cc/table-column-filter/Constants.js +5 -9
- package/es/cc/table-list/Constants.js +14 -27
- package/es/cc/table-list/model/index.js +5 -9
- package/es/cc/table-list/row/Constants.js +5 -9
- package/es/cc/tags/Constants.js +3 -5
- package/es/cc/tags/model/index.js +4 -7
- package/es/cc/text/Constants.js +3 -5
- package/es/cc/textarea/Constants.js +5 -9
- package/es/cc/textarea/Properties.js +11 -0
- package/es/cc/textbox/Constants.js +6 -11
- package/es/cc/textbox/Properties.js +11 -0
- package/es/index.js +4 -2
- package/es/library/behaviours/field-focus/frameworks/ui/EventHandlersFactory.js +24 -0
- package/es/library/behaviours/field-focus/frameworks/ui/FocusFieldBehaviourFactory.js +20 -0
- package/es/library/behaviours/keyboard-controls/adapters/gateways/KeyboardHandler.js +0 -4
- package/es/library/behaviours/keyboard-controls/adapters/gateways/Repository.js +2 -10
- package/es/library/behaviours/keyboard-controls/adapters/gateways/Service.js +0 -14
- package/es/library/behaviours/keyboard-controls/adapters/presenters/Presenter.js +2 -11
- package/es/library/behaviours/list-selection/adapters/gateways/Repository.js +2 -8
- package/es/library/behaviours/list-selection/adapters/gateways/Service.js +0 -16
- package/es/library/behaviours/list-selection/adapters/presenters/Presenter.js +0 -8
- package/es/library/behaviours/local-storage/adapters/gateways/LocalStorageRepository.js +0 -6
- package/es/library/behaviours/local-storage/adapters/gateways/Service.js +0 -4
- package/es/library/behaviours/local-storage/adapters/presenters/Presenter.js +0 -8
- package/es/library/behaviours/local-storage/domain/entities/Storage.js +0 -4
- package/es/library/behaviours/sort-by/adapters/gateway/Repository.js +0 -6
- package/es/library/behaviours/sort-by/adapters/gateway/Service.js +0 -4
- package/es/library/behaviours/sort-by/adapters/presenter/Presenter.js +0 -8
- package/es/library/behaviours/table-column-resizer/adapters/gateways/Repository.js +0 -6
- package/es/library/behaviours/table-column-resizer/adapters/gateways/Service.js +0 -10
- package/es/library/behaviours/table-column-resizer/adapters/gateways/TableElementService.js +0 -8
- package/es/library/behaviours/table-column-resizer/adapters/presenters/AutoScroll.js +0 -12
- package/es/library/behaviours/table-column-resizer/adapters/presenters/Presenter.js +0 -8
- package/es/library/behaviours/table-column-resizer/domain/entities/ColumnResizer.js +0 -12
- package/es/library/behaviours/table-column-resizer/domain/entities/Mouse.js +0 -6
- package/es/library/behaviours/table-column-resizer/domain/entities/ResizeColumnCalculator.js +0 -12
- package/es/library/behaviours/table-column-resizer/domain/entities/ResizerAutoScrollCalculator.js +0 -6
- package/es/library/behaviours/table-column-resizer/domain/entities/ResizingColumn.js +0 -13
- package/es/library/behaviours/table-column-resizer/domain/entities/Table.js +0 -11
- package/es/library/behaviours/text-to-field-click/adapters/gateway/Repository.js +0 -6
- package/es/library/custom-component/adapters/gateways/event-manager/EventManager.js +2 -7
- package/es/library/custom-component/adapters/gateways/repository/Repository.js +1 -5
- package/es/library/custom-component/adapters/gateways/service/Service.js +0 -14
- package/es/library/custom-component/adapters/presenters/Presenter.js +0 -5
- package/es/library/custom-component/domain/entities/Behaviour.js +0 -11
- package/es/library/custom-component/domain/entities/Component.js +0 -24
- package/es/library/custom-component/domain/entities/Event.js +0 -7
- package/es/library/custom-component/domain/entities/EventHandler.js +0 -6
- package/es/library/custom-component/domain/entities/LifeCycleAction.js +0 -10
- package/es/library/custom-component/domain/entities/Payload.js +0 -6
- package/es/library/custom-component/domain/entities/Properties.js +0 -5
- package/es/library/custom-component/domain/entities/Property.js +0 -13
- package/es/library/custom-component/domain/entities/Schema.js +1 -5
- package/es/library/custom-component/domain/entities/State.js +0 -4
- package/es/library/custom-component/domain/entities/Style.js +0 -14
- package/es/library/custom-component/frameworks/ui/ComponentRegistry.js +3 -7
- package/es/library/custom-component/frameworks/ui/CreateCustomComponent.js +9 -26
- package/es/library/custom-component/frameworks/ui/CreateSlotComponent.js +4 -2
- package/es/library/custom-component/frameworks/ui/CustomComponentFactory.js +1 -1
- package/es/library/dot/components/action-location/adapters/gateway/Repository.js +0 -8
- package/es/library/dot/components/action-location/adapters/presenters/Presenter.js +0 -8
- package/es/library/dot/components/action-location/entities/ActionLocationEntity.js +2 -6
- package/es/library/dot/components/action-location/frameworks/ui/ActionComponentMapping.js +3 -1
- package/es/library/dot/components/actions-renderer/frameworks/ui/ActionsRendererView.js +6 -4
- package/es/library/dot/components/form/adapters/presenter/TransformState.js +5 -58
- package/es/library/dot/components/form/frameworks/ui/DefaultComponentRegister.js +2 -5
- package/es/library/dot/components/form/frameworks/ui/FormView.js +18 -42
- package/es/library/dot/components/form/frameworks/ui/__test__/Form.test.js +14 -20
- package/es/library/dot/components/form/frameworks/ui/css/Form.module.css +29 -4
- package/es/library/dot/components/form/frameworks/ui/sub-components/Footer.js +27 -0
- package/es/library/dot/components/form/frameworks/ui/sub-components/Header.js +24 -0
- package/es/library/dot/components/form/frameworks/ui/sub-components/MiddleSection.js +24 -0
- package/es/library/dot/components/form/frameworks/ui/sub-components/Sections.js +7 -2
- package/es/library/dot/components/form/frameworks/ui/sub-components/SectionsLayout.js +20 -0
- package/es/library/dot/components/form/frameworks/ui/sub-components/SectionsWithRightPanelLayout.js +41 -0
- package/es/library/dot/components/form-fields/checkbox/frameworks/ui/Checkbox.js +4 -3
- package/es/library/dot/components/form-fields/checkbox/frameworks/ui/CheckboxView.js +19 -17
- package/es/library/dot/components/form-fields/currency/frameworks/ui/Currency.js +3 -3
- package/es/library/dot/components/form-fields/currency/frameworks/ui/CurrencyView.js +20 -17
- package/es/library/dot/components/form-fields/date/frameworks/ui/Date.js +2 -3
- package/es/library/dot/components/form-fields/date/frameworks/ui/DateView.js +22 -19
- package/es/library/dot/components/form-fields/datetime/frameworks/ui/DateTime.js +2 -3
- package/es/library/dot/components/form-fields/datetime/frameworks/ui/DateTimeView.js +21 -18
- package/es/library/dot/components/form-fields/decimal/frameworks/ui/Decimal.js +2 -3
- package/es/library/dot/components/form-fields/decimal/frameworks/ui/DecimalView.js +22 -19
- package/es/library/dot/components/form-fields/email/frameworks/ui/Email.js +2 -3
- package/es/library/dot/components/form-fields/email/frameworks/ui/EmailView.js +22 -19
- package/es/library/dot/components/form-fields/field/FieldItem.js +36 -0
- package/es/library/dot/components/form-fields/field/__test__/common.js +18 -16
- package/es/library/dot/components/form-fields/field/css/FieldItem.module.css +13 -0
- package/es/library/dot/components/form-fields/index.js +2 -1
- package/es/library/dot/components/form-fields/lookup/frameworks/ui/EventHandlerFactory.js +70 -0
- package/es/library/dot/components/form-fields/lookup/frameworks/ui/Lookup.js +13 -0
- package/es/library/dot/components/form-fields/lookup/frameworks/ui/LookupView.js +51 -0
- package/es/library/dot/components/form-fields/multi-select/frameworks/ui/MultiSelect.js +2 -3
- package/es/library/dot/components/form-fields/multi-select/frameworks/ui/MultiSelectView.js +21 -18
- package/es/library/dot/components/form-fields/number/frameworks/ui/Number.js +2 -3
- package/es/library/dot/components/form-fields/number/frameworks/ui/NumberView.js +22 -19
- package/es/library/dot/components/form-fields/percentage/frameworks/ui/Percentage.js +2 -3
- package/es/library/dot/components/form-fields/percentage/frameworks/ui/PercentageView.js +22 -19
- package/es/library/dot/components/form-fields/phone/frameworks/ui/Phone.js +2 -3
- package/es/library/dot/components/form-fields/phone/frameworks/ui/PhoneView.js +22 -19
- package/es/library/dot/components/form-fields/pick-list/frameworks/ui/PickList.js +2 -3
- package/es/library/dot/components/form-fields/pick-list/frameworks/ui/PickListView.js +21 -18
- package/es/library/dot/components/form-fields/textarea/frameworks/ui/TextArea.js +4 -3
- package/es/library/dot/components/form-fields/textarea/frameworks/ui/TextAreaView.js +21 -18
- package/es/library/dot/components/form-fields/textbox/frameworks/ui/TextBox.js +2 -3
- package/es/library/dot/components/form-fields/textbox/frameworks/ui/TextBoxView.js +21 -18
- package/es/library/dot/components/form-fields/url/frameworks/ui/Url.js +2 -3
- package/es/library/dot/components/form-fields/url/frameworks/ui/UrlView.js +22 -19
- package/es/library/dot/components/section/frameworks/ui/RenderField.js +5 -4
- package/es/library/dot/components/table-list/adapters/controllers/KeyboardRowClickController.js +1 -1
- package/es/library/dot/components/table-list/adapters/controllers/KeyboardRowSelectController.js +1 -1
- package/es/library/dot/components/table-list/adapters/presenters/TableTranslator.js +1 -1
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/ErrorState.js +3 -3
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/Rows.js +6 -6
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/field/FieldComponent.js +1 -2
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/HeaderData.js +1 -1
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/RowData.js +1 -1
- package/es/library/dot/legacy-to-new-arch/action-icon/frameworks/ui/ActionIconView.js +1 -1
- package/es/library/dot/legacy-to-new-arch/date/frameworks/ui/DateView.js +18 -1
- package/es/library/dot/legacy-to-new-arch/date/frameworks/ui/css/DateView.module.css +3 -0
- package/es/library/dot/legacy-to-new-arch/highlighted-value/frameworks/ui/HighlightedValueView.js +6 -1
- package/es/library/dot/{components/form-fields/ephi-tag/frameworks/ui/css/EPHITag.module.css → legacy-to-new-arch/highlighted-value/frameworks/ui/css/HighlightedValue.module.css} +1 -1
- package/es/library/dot/legacy-to-new-arch/label/frameworks/ui/LabelView.js +16 -12
- package/es/library/dot/legacy-to-new-arch/label/frameworks/ui/css/Label.module.css +3 -5
- package/es/library/dot/legacy-to-new-arch/multi-select/frameworks/ui/MultiSelectView.js +23 -3
- package/es/library/dot/legacy-to-new-arch/multi-select/frameworks/ui/css/MultiSelectView.module.css +37 -0
- package/es/library/dot/legacy-to-new-arch/select/frameworks/ui/SelectView.js +16 -4
- package/es/library/dot/legacy-to-new-arch/table-column-filter/frameworks/ui/TableColumnFilterView.js +5 -3
- package/es/library/dot/legacy-to-new-arch/text-area/frameworks/ui/TextAreaView.js +23 -5
- package/es/library/dot/legacy-to-new-arch/text-area/frameworks/ui/css/TextAreaView.module.css +40 -0
- package/es/library/dot/legacy-to-new-arch/textbox/frameworks/ui/TextBoxView.js +13 -3
- package/es/library/slot/frameworks/ui/ConvertSlotToComponent.js +5 -4
- package/es/platform/client-actions/behaviour/zclient-actions/adapters/controllers/MountController.js +15 -18
- package/es/platform/client-actions/behaviour/zclient-actions/adapters/gateways/Repository.js +0 -6
- package/es/platform/client-actions/behaviour/zclient-actions/adapters/gateways/Service.js +0 -16
- package/es/platform/client-actions/behaviour/zclient-actions/adapters/presenters/Presenter.js +0 -8
- package/es/platform/client-actions/behaviour/zclient-actions/adapters/resources/ClientActionResource.js +2 -4
- package/es/platform/client-actions/behaviour/zclient-actions/applications/usecases/GetClientActionLocationUseCase.js +1 -1
- package/es/platform/client-actions/behaviour/zclient-actions/applications/usecases/GetClientActionUIComponentPropertiesUseCase.js +1 -1
- package/es/platform/client-actions/behaviour/zclient-actions/applications/usecases/GetClientActionsUseCase.js +1 -1
- package/es/platform/client-actions/behaviour/zclient-actions/applications/usecases/UpdateClientActionUIComponentPropertiesUseCase.js +1 -1
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/ClientAction.js +0 -26
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/ClientActions.js +0 -9
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/EventMapping.js +0 -12
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/EventMappings.js +0 -4
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/UIComponentMapping.js +0 -14
- package/es/platform/client-actions/behaviour/zclient-actions/frameworks/sdk/ClientActionsSDKFactory.js +2 -2
- package/es/platform/client-actions/cc/dynamic-action-component/Properties.js +1 -1
- package/es/platform/client-actions/components/action-event-mediator/adapters/gateway/Repository.js +0 -8
- package/es/platform/client-actions/components/action-event-mediator/adapters/presenters/Presenter.js +0 -8
- package/es/platform/client-actions/components/action-event-mediator/domain/entities/ActionEventMediatorEntity.js +2 -10
- package/es/platform/client-actions/components/dynamic-component/frameworks/ui/DynamicActionComponentView.js +6 -4
- package/es/platform/client-actions/components/interfaces/ActionViewModel.js +1 -0
- package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActionsRenderer.module.css +5 -1
- package/es/platform/column-chooser/adapters/gateways/Repository.js +0 -6
- package/es/platform/column-chooser/adapters/gateways/Service.js +0 -14
- package/es/platform/column-chooser/adapters/presenters/Presenter.js +0 -8
- package/es/platform/column-chooser/domain/entities/SelectEntityImp.js +0 -5
- package/es/platform/components/app/adapters/resources/AppResource.js +15 -0
- package/es/platform/components/form-connected/adapters/resources/SmartFormResources.js +90 -10
- package/es/platform/components/form-connected/frameworks/EventHandlersFactory.js +30 -58
- package/es/platform/components/form-connected/frameworks/FormConnectedFactory.js +2 -6
- package/es/platform/components/form-connected/frameworks/FormConnectedView.js +3 -1
- package/es/platform/components/form-connected/frameworks/FormSdkFactory.js +2 -2
- package/es/platform/components/table-connected/adapters/controllers/ResizeFinishController.js +3 -5
- package/es/platform/components/table-connected/adapters/resources/SmartTableResource.js +2 -4
- package/es/platform/components/table-connected/frameworks/EventHandlersFactory.js +2 -2
- package/es/platform/components/table-connected/frameworks/ListSdkFactory.js +2 -2
- package/es/platform/components/table-connected/frameworks/TableConnectedFactory.js +1 -1
- package/es/platform/data-source/http-template/deleteRecords.js +1 -1
- package/es/platform/data-source/http-template/fetchLookupFields.js +24 -0
- package/es/platform/data-source/http-template/fetchValidationRules.js +2 -1
- package/es/platform/data-source/http-template/moveToTrash.js +28 -0
- package/es/platform/data-source/index.js +5 -1
- package/es/platform/data-source/utils/validation-rules/FieldConditions.js +167 -0
- package/es/platform/data-source/utils/validation-rules/TransFormValidationRules.js +98 -0
- package/es/platform/sdk/adapters/gateways/Repository.js +5 -9
- package/es/platform/sdk/adapters/gateways/Service.js +2 -12
- package/es/platform/sdk/adapters/presenters/Presenter.js +0 -6
- package/es/platform/sdk/application/interfaces/gateways/AbstractResource.js +0 -6
- package/es/platform/sdk/application/usecases/GetResourcesUseCase.js +12 -0
- package/es/platform/sdk/domain/entities/ResourceManager.js +24 -20
- package/es/platform/sdk/frameworks/Sdk.js +23 -2
- package/es/platform/sdk/frameworks/SdkRegistry.js +11 -8
- package/es/platform/sdk-behaviour/adapters/controllers/AbstractController.js +0 -4
- package/es/platform/sdk-behaviour/adapters/gateways/Repository.js +0 -8
- package/es/platform/sdk-behaviour/adapters/gateways/ResourceManagerGateWay.js +0 -6
- package/es/platform/sdk-behaviour/adapters/gateways/Service.js +0 -8
- package/es/platform/zdata-source/adapters/controllers/FailureController.js +26 -29
- package/es/platform/zdata-source/adapters/controllers/NoContentController.js +21 -24
- package/es/platform/zdata-source/adapters/controllers/RegisterController.js +17 -20
- package/es/platform/zdata-source/adapters/controllers/SuccessController.js +26 -29
- package/es/platform/zdata-source/adapters/gateways/Repository.js +0 -6
- package/es/platform/zdata-source/adapters/gateways/Service.js +0 -12
- package/es/platform/zdata-source/adapters/presenters/Presenter.js +1 -9
- package/es/platform/zdata-source/applications/usecases/SuccessUseCase.js +1 -1
- package/es/platform/zdata-source/domain/entities/APITemplate.js +0 -16
- package/es/platform/zfield/adapters/gateways/Repository.js +0 -6
- package/es/platform/zfield/adapters/gateways/Service.js +0 -14
- package/es/platform/zfield/adapters/presenters/Presenter.js +0 -8
- package/es/platform/zfield/applications/entities-factory/FieldBuilder.js +0 -30
- package/es/platform/zfield/applications/entities-factory/FieldsManagerBuilder.js +0 -12
- package/es/platform/zform/adapters/controllers/FieldBlurController.js +26 -0
- package/es/platform/zform/adapters/controllers/LookupFieldController.js +23 -0
- package/es/platform/zform/adapters/controllers/MyFromSuccessController.js +8 -2
- package/es/platform/zform/adapters/controllers/SubmitValidationCompletedController.js +21 -0
- package/es/platform/zform/adapters/controllers/ValidateFieldRequestController.js +10 -5
- package/es/platform/zform/adapters/controllers/ValidationRulesExecutionResultController.js +23 -0
- package/es/platform/zform/adapters/controllers/ValidationRulesRequestController.js +2 -4
- package/es/platform/zform/adapters/controllers/ValidationRulesSuccessController.js +2 -4
- package/es/platform/zform/adapters/gateway/FormRepository.js +0 -6
- package/es/platform/zform/adapters/gateway/Service.js +10 -36
- package/es/platform/zform/adapters/presenter/FormPresenter.js +0 -8
- package/es/platform/zform/adapters/presenter/FormTranslator.js +28 -3
- package/es/platform/zform/adapters/presenter/translators/SectionTranslator.js +70 -10
- package/es/platform/zform/adapters/presenter/translators/fields/BooleanFieldTranslator.js +7 -3
- package/es/platform/zform/adapters/presenter/translators/fields/CurrencyFieldTranslator.js +5 -9
- package/es/platform/zform/adapters/presenter/translators/fields/DateFieldTranslator.js +7 -3
- package/es/platform/zform/adapters/presenter/translators/fields/DateTimeFieldTranslator.js +7 -3
- package/es/platform/zform/adapters/presenter/translators/fields/DecimalFieldTranslator.js +6 -9
- package/es/platform/zform/adapters/presenter/translators/fields/EmailFieldTranslator.js +6 -9
- package/es/platform/zform/adapters/presenter/translators/fields/LookUpFieldTranslator.js +7 -10
- package/es/platform/zform/adapters/presenter/translators/fields/MultiselectFieldTranslator.js +6 -3
- package/es/platform/zform/adapters/presenter/translators/fields/NumberFieldTranslator.js +6 -9
- package/es/platform/zform/adapters/presenter/translators/fields/PercentageFieldTranslator.js +6 -9
- package/es/platform/zform/adapters/presenter/translators/fields/PhoneFieldTranslator.js +6 -9
- package/es/platform/zform/adapters/presenter/translators/fields/PicklistFieldTranslator.js +6 -3
- package/es/platform/zform/adapters/presenter/translators/fields/TextAreaFieldTranslator.js +5 -9
- package/es/platform/zform/adapters/presenter/translators/fields/TextFieldTranslator.js +8 -8
- package/es/platform/zform/adapters/presenter/translators/fields/URLFieldTranslator.js +6 -9
- package/es/platform/zform/adapters/presenter/utils/DefaultClientActions.js +114 -36
- package/es/platform/zform/applications/usecases/AbstractUseCase.js +3 -1
- package/es/platform/zform/applications/usecases/FieldBlurUseCase.js +39 -0
- package/es/platform/zform/applications/usecases/FieldValueChangeRequestUseCase.js +9 -13
- package/es/platform/zform/applications/usecases/FocusFieldUseCase.js +19 -0
- package/es/platform/zform/applications/usecases/FormSubmitUseCase.js +19 -38
- package/es/platform/zform/applications/usecases/GetFieldErrorMessageUseCase.js +16 -0
- package/es/platform/zform/applications/usecases/GetFieldValueUseCase.js +1 -1
- package/es/platform/zform/applications/usecases/InsertValidationRuleSuccessUseCase.js +22 -0
- package/es/platform/zform/applications/usecases/LookupFieldSuccessUseCase.js +33 -0
- package/es/platform/zform/applications/usecases/MyFormSuccessUseCase.js +97 -13
- package/es/platform/zform/applications/usecases/MyLayoutSuccessUseCase.js +4 -33
- package/es/platform/zform/applications/usecases/SetFieldErrorMessageUseCase.js +4 -4
- package/es/platform/zform/applications/usecases/SetFieldValueUseCase.js +4 -21
- package/es/platform/zform/applications/usecases/SetFieldsValuesUseCase.js +4 -26
- package/es/platform/zform/applications/usecases/SubmitValidationCompletedUseCase.js +62 -0
- package/es/platform/zform/applications/usecases/ValidateFieldUseCase.js +33 -0
- package/es/platform/zform/applications/usecases/ValidationRulesExecutionResultUseCase.js +23 -0
- package/es/platform/zform/domain/ZDependencyMapping.js +0 -17
- package/es/platform/zform/domain/ZField.js +26 -54
- package/es/platform/zform/domain/ZForm.js +110 -82
- package/es/platform/zform/domain/ZLayout.js +0 -14
- package/es/platform/zform/domain/ZLayoutRule.js +0 -31
- package/es/platform/zform/domain/ZSection.js +0 -19
- package/es/platform/zform/domain/ZValidationRule.js +0 -28
- package/es/platform/zform/domain/interfaces/IZForm.js +5 -1
- package/es/platform/zform/domain/interfaces/ValidationConditions.js +142 -0
- package/es/platform/zform/frameworks/ui/EventHandlerFactory.js +27 -145
- package/es/platform/zform/frameworks/ui/ZFormBehaviourFactory.js +4 -9
- package/es/platform/zform/frameworks/validation-rules/DefaultCustomValidators.js +340 -0
- package/es/platform/zform/frameworks/validation-rules/Validator.js +94 -16
- package/es/platform/zform/frameworks/validation-rules/formUtils.js +7 -0
- package/es/platform/zform/frameworks/validation-rules/localization_utils.js +15 -0
- package/es/platform/zform/frameworks/validation-rules/utils.js +402 -351
- package/es/platform/zform/frameworks/validation-rules/validationRules.js +80 -79
- package/es/platform/zlist/adapters/gateways/Repository.js +0 -6
- package/es/platform/zlist/adapters/gateways/Service.js +0 -33
- package/es/platform/zlist/adapters/presenters/Presenters.js +0 -8
- package/es/platform/zlist/adapters/presenters/SelectionTranslator.js +1 -3
- package/es/platform/zlist/adapters/presenters/TableTranslator.js +4 -6
- package/es/platform/zlist/adapters/presenters/translators/ColumnTranslator.js +2 -6
- package/es/platform/zlist/adapters/presenters/translators/actions/ActionsTranslator.js +4 -15
- package/es/platform/zlist/adapters/presenters/utils/calculateFieldWidths.js +1 -3
- package/es/platform/zlist/applications/usecases/DeleteMultipleRecordUseCase.js +1 -3
- package/es/platform/zlist/applications/usecases/DeleteSingleRecordUseCase.js +1 -3
- package/es/platform/zlist/applications/usecases/GetContextUseCase.js +1 -1
- package/es/platform/zlist/applications/usecases/RecordSuccessCallbackUsecase.js +1 -3
- package/es/platform/zlist/applications/usecases/RecordUpdateUseCase.js +1 -3
- package/es/platform/zlist/applications/usecases/UpdateMultipleRecordUseCase.js +1 -3
- package/es/platform/zlist/domain/entities/List.js +3 -2
- package/es/platform/zrecord/adapters/controllers/AppendRecordsController.js +20 -23
- package/es/platform/zrecord/adapters/controllers/DeleteMultipleRecordLocalController.js +20 -23
- package/es/platform/zrecord/adapters/controllers/FailureController.js +26 -29
- package/es/platform/zrecord/adapters/controllers/FetchStateStopController.js +17 -20
- package/es/platform/zrecord/adapters/controllers/MountController.js +15 -18
- package/es/platform/zrecord/adapters/controllers/NoContentController.js +21 -24
- package/es/platform/zrecord/adapters/controllers/RefetchController.js +26 -29
- package/es/platform/zrecord/adapters/controllers/SetRecordsController.js +24 -27
- package/es/platform/zrecord/adapters/controllers/SuccessController.js +26 -29
- package/es/platform/zrecord/adapters/gateways/Repository.js +0 -6
- package/es/platform/zrecord/adapters/gateways/Service.js +0 -30
- package/es/platform/zrecord/adapters/presenters/Presenter.js +0 -8
- package/es/platform/zrecord/applications/usecases/GetMultipleRecordUseCase.js +1 -1
- package/es/platform/zrecord/applications/usecases/GetSingleRecordUseCase.js +1 -1
- package/es/platform/zrecord/domain/entities/CustomFieldValues.js +0 -4
- package/es/platform/zrecord/domain/entities/Record.js +0 -22
- package/es/platform/zrecord/domain/entities/Records.js +0 -11
- package/package.json +12 -17
- package/es/bc/field-validation/Constants.js +0 -4
- package/es/bc/field-validation/EventHandlers.js +0 -1
- package/es/bc/field-validation/Events.js +0 -106
- package/es/bc/field-validation/FieldTypes.js +0 -20
- package/es/bc/field-validation/Properties.js +0 -11
- package/es/bc/field-validation/index.js +0 -5
- package/es/cc/ephi-tag/Properties.js +0 -1
- package/es/cc/ephi-tag/index.js +0 -1
- package/es/cc/info-icon/Properties.js +0 -10
- package/es/cc/info-icon/index.js +0 -1
- package/es/library/behaviours/field-validation/adapters/controllers/AbstractController.js +0 -9
- package/es/library/behaviours/field-validation/adapters/controllers/ValidateFieldController.js +0 -32
- package/es/library/behaviours/field-validation/adapters/controllers/ValidateFieldsController.js +0 -31
- package/es/library/behaviours/field-validation/adapters/gateway/Repository.js +0 -23
- package/es/library/behaviours/field-validation/adapters/gateway/Service.js +0 -18
- package/es/library/behaviours/field-validation/applications/interfaces/input/FieldData.js +0 -17
- package/es/library/behaviours/field-validation/applications/usecases/AbstractUseCase.js +0 -15
- package/es/library/behaviours/field-validation/applications/usecases/ValidateField.js +0 -29
- package/es/library/behaviours/field-validation/applications/usecases/ValidateFields.js +0 -28
- package/es/library/behaviours/field-validation/domain/FieldValidation.js +0 -94
- package/es/library/behaviours/field-validation/domain/field-vise-validations/BooleanValidation.js +0 -28
- package/es/library/behaviours/field-validation/domain/field-vise-validations/CurrencyValidation.js +0 -49
- package/es/library/behaviours/field-validation/domain/field-vise-validations/DateTimeValidation.js +0 -24
- package/es/library/behaviours/field-validation/domain/field-vise-validations/DateValidation.js +0 -24
- package/es/library/behaviours/field-validation/domain/field-vise-validations/DecimalValidation.js +0 -49
- package/es/library/behaviours/field-validation/domain/field-vise-validations/EmailValidation.js +0 -28
- package/es/library/behaviours/field-validation/domain/field-vise-validations/IntegerValidation.js +0 -39
- package/es/library/behaviours/field-validation/domain/field-vise-validations/LookUpValidation.js +0 -24
- package/es/library/behaviours/field-validation/domain/field-vise-validations/MultiSelectValidation.js +0 -26
- package/es/library/behaviours/field-validation/domain/field-vise-validations/PercentValidation.js +0 -28
- package/es/library/behaviours/field-validation/domain/field-vise-validations/PhoneValidation.js +0 -39
- package/es/library/behaviours/field-validation/domain/field-vise-validations/PicklistValidation.js +0 -24
- package/es/library/behaviours/field-validation/domain/field-vise-validations/TextAreaValidation.js +0 -39
- package/es/library/behaviours/field-validation/domain/field-vise-validations/TextBoxValidation.js +0 -39
- package/es/library/behaviours/field-validation/domain/field-vise-validations/URLValidation.js +0 -28
- package/es/library/behaviours/field-validation/domain/interfaces/FieldTypes.js +0 -20
- package/es/library/behaviours/field-validation/domain/interfaces/IFieldViseValidation.js +0 -1
- package/es/library/behaviours/field-validation/domain/interfaces/ValidationResult.js +0 -1
- package/es/library/behaviours/field-validation/domain/interfaces/ValidationsArray.js +0 -1
- package/es/library/behaviours/field-validation/domain/interfaces/ValidationsEnum.js +0 -22
- package/es/library/behaviours/field-validation/domain/interfaces/ValidationsMap.js +0 -1
- package/es/library/behaviours/field-validation/domain/interfaces/fields/IBooleanField.js +0 -0
- package/es/library/behaviours/field-validation/domain/interfaces/fields/ICurrencyField.js +0 -0
- package/es/library/behaviours/field-validation/domain/interfaces/fields/IDateField.js +0 -0
- package/es/library/behaviours/field-validation/domain/interfaces/fields/IDateTimeField.js +0 -0
- package/es/library/behaviours/field-validation/domain/interfaces/fields/IDecimalField.js +0 -0
- package/es/library/behaviours/field-validation/domain/interfaces/fields/IEmailField.js +0 -0
- package/es/library/behaviours/field-validation/domain/interfaces/fields/IIntegerField.js +0 -0
- package/es/library/behaviours/field-validation/domain/interfaces/fields/ILookUpField.js +0 -0
- package/es/library/behaviours/field-validation/domain/interfaces/fields/IMultiSelectField.js +0 -0
- package/es/library/behaviours/field-validation/domain/interfaces/fields/IPercentField.js +0 -0
- package/es/library/behaviours/field-validation/domain/interfaces/fields/IPhoneField.js +0 -0
- package/es/library/behaviours/field-validation/domain/interfaces/fields/IPicklistField.js +0 -0
- package/es/library/behaviours/field-validation/domain/interfaces/fields/ITextAreaField.js +0 -0
- package/es/library/behaviours/field-validation/domain/interfaces/fields/ITextBoxField.js +0 -0
- package/es/library/behaviours/field-validation/domain/interfaces/fields/IURLField.js +0 -0
- package/es/library/behaviours/field-validation/frameworks/ui/EventHandlerFactory.js +0 -23
- package/es/library/behaviours/field-validation/frameworks/ui/FieldValidationBehaviourFactory.js +0 -27
- package/es/library/behaviours/field-validation/frameworks/ui/__tests__/BooleanFieldValidation.test.js +0 -137
- package/es/library/behaviours/field-validation/frameworks/ui/__tests__/CurrencyFieldValidation.test.js +0 -228
- package/es/library/behaviours/field-validation/frameworks/ui/__tests__/DateFieldValidation.test.js +0 -108
- package/es/library/behaviours/field-validation/frameworks/ui/__tests__/DateTimeFieldValidation.test.js +0 -108
- package/es/library/behaviours/field-validation/frameworks/ui/__tests__/DecimalFieldValidation.test.js +0 -257
- package/es/library/behaviours/field-validation/frameworks/ui/__tests__/EmailFieldValidation.test.js +0 -139
- package/es/library/behaviours/field-validation/frameworks/ui/__tests__/FieldValidationBehaviour.test.js +0 -171
- package/es/library/behaviours/field-validation/frameworks/ui/__tests__/IntegerFieldValidation.test.js +0 -168
- package/es/library/behaviours/field-validation/frameworks/ui/__tests__/LookUpFieldValidation.test.js +0 -108
- package/es/library/behaviours/field-validation/frameworks/ui/__tests__/MultiSelectFieldValidation.test.js +0 -79
- package/es/library/behaviours/field-validation/frameworks/ui/__tests__/PercentFieldValidation.test.js +0 -108
- package/es/library/behaviours/field-validation/frameworks/ui/__tests__/PhoneFieldValidation.test.js +0 -168
- package/es/library/behaviours/field-validation/frameworks/ui/__tests__/PicklistFieldValidation.test.js +0 -79
- package/es/library/behaviours/field-validation/frameworks/ui/__tests__/TextAreaFieldValidation.test.js +0 -170
- package/es/library/behaviours/field-validation/frameworks/ui/__tests__/TextBoxFieldValidation.test.js +0 -170
- package/es/library/behaviours/field-validation/frameworks/ui/__tests__/URLFieldValidation.test.js +0 -108
- package/es/library/behaviours/field-validation/frameworks/utils/FormBasicValidationAdaptor.js +0 -228
- package/es/library/behaviours/field-validation/frameworks/utils/__tests__/formValidate.test.js +0 -284
- package/es/library/behaviours/field-validation/frameworks/utils/formValidate.js +0 -334
- package/es/library/dot/components/form-fields/checkbox/adapters/presenter/TransformState.js +0 -22
- package/es/library/dot/components/form-fields/currency/adapters/presenter/TransformState.js +0 -81
- package/es/library/dot/components/form-fields/date/adapters/presenter/TransformState.js +0 -22
- package/es/library/dot/components/form-fields/datetime/adapters/presenter/TransformState.js +0 -22
- package/es/library/dot/components/form-fields/decimal/adapters/presenter/TransformState.js +0 -31
- package/es/library/dot/components/form-fields/email/adapters/presenter/TransformState.js +0 -23
- package/es/library/dot/components/form-fields/ephi-tag/frameworks/ui/EPHITag.js +0 -10
- package/es/library/dot/components/form-fields/ephi-tag/frameworks/ui/EPHITagView.js +0 -21
- package/es/library/dot/components/form-fields/info-icon/frameworks/ui/InfoIcon.js +0 -10
- package/es/library/dot/components/form-fields/info-icon/frameworks/ui/InfoIconView.js +0 -21
- package/es/library/dot/components/form-fields/info-icon/frameworks/ui/css/InfoIcon.module.css +0 -3
- package/es/library/dot/components/form-fields/multi-select/adapters/presenter/TransformState.js +0 -31
- package/es/library/dot/components/form-fields/number/adapters/presenter/TransformState.js +0 -31
- package/es/library/dot/components/form-fields/percentage/adapters/presenter/TransformState.js +0 -31
- package/es/library/dot/components/form-fields/phone/adapters/presenter/TransformState.js +0 -31
- package/es/library/dot/components/form-fields/pick-list/adapters/presenter/TransformState.js +0 -23
- package/es/library/dot/components/form-fields/textarea/adapters/presenter/TransformState.js +0 -23
- package/es/library/dot/components/form-fields/textbox/adapters/presenter/TransformState.js +0 -32
- package/es/library/dot/components/form-fields/url/adapters/presenter/TransformState.js +0 -31
- package/es/library/dot/legacy-to-new-arch/label/frameworks/ui/sub-components/ui/LabelAction.js +0 -9
- package/es/library/dot/legacy-to-new-arch/label/frameworks/ui/sub-components/ui/LabelActionView.js +0 -38
- package/es/library/dot/legacy-to-new-arch/label/frameworks/ui/sub-components/ui/css/LabelAction.module.css +0 -4
- package/es/platform/zform/adapters/controllers/ValidateErrorMessageController.js +0 -22
- package/es/platform/zform/applications/interfaces/input/ValidateErrorMessageInputModel.js +0 -1
- package/es/platform/zform/applications/usecases/ValidateErrorMessageUseCase.js +0 -33
- package/es/platform/zform/applications/usecases/ValidateFieldRequestUseCase.js +0 -56
- /package/es/{library/behaviours/field-validation/applications/interfaces/UseCaseDependencies.js → platform/zform/applications/interfaces/input/FieldBlurUsecaseInputModel.js} +0 -0
- /package/es/{library/behaviours/field-validation/applications/interfaces/gateways/IRepository.js → platform/zform/applications/interfaces/input/FocusFieldUseCaseInputModel.js} +0 -0
- /package/es/{library/behaviours/field-validation/applications/interfaces/gateways/IService.js → platform/zform/applications/interfaces/input/GetFieldErrorMessageInputModel.js} +0 -0
- /package/es/{library/behaviours/field-validation/applications/interfaces/input/FieldValidationInputModel.js → platform/zform/applications/interfaces/input/InsertValidationRuleInputModel.js} +0 -0
- /package/es/{library/behaviours/field-validation/applications/interfaces/input/ValidateFieldsInputModel.js → platform/zform/applications/interfaces/input/LookUpFieldSuccessUseCaseInputModel.js} +0 -0
- /package/es/{library/behaviours/field-validation/domain/interfaces/IField.js → platform/zform/applications/interfaces/input/SubmitValidationCompletedUsecaseInputModel.js} +0 -0
- /package/es/{library/behaviours/field-validation/domain/interfaces/IFieldValidation.js → platform/zform/applications/interfaces/input/ValidateFieldUseCaseInputModel.js} +0 -0
|
@@ -40,7 +40,7 @@ function Component(props) {
|
|
|
40
40
|
}, [props]);
|
|
41
41
|
const View = /*#__PURE__*/forwardRef(input.View);
|
|
42
42
|
|
|
43
|
-
if (state
|
|
43
|
+
if (state?.error) {
|
|
44
44
|
console.log(state.error);
|
|
45
45
|
return /*#__PURE__*/React.createElement("div", null, "error");
|
|
46
46
|
} else {
|
|
@@ -1,14 +1,6 @@
|
|
|
1
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
-
|
|
3
1
|
import ActionLocationEntity from "../../entities/ActionLocationEntity";
|
|
4
2
|
export default class Repository {
|
|
5
3
|
constructor() {
|
|
6
|
-
_defineProperty(this, "element", void 0);
|
|
7
|
-
|
|
8
|
-
_defineProperty(this, "dispatch", void 0);
|
|
9
|
-
|
|
10
|
-
_defineProperty(this, "state", void 0);
|
|
11
|
-
|
|
12
4
|
this.element = null;
|
|
13
5
|
}
|
|
14
6
|
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
-
|
|
3
1
|
export default class Presenter {
|
|
4
|
-
constructor() {
|
|
5
|
-
_defineProperty(this, "updateState", void 0);
|
|
6
|
-
|
|
7
|
-
_defineProperty(this, "state", void 0);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
2
|
updateDependencies(state, updateState) {
|
|
11
3
|
this.updateState = updateState;
|
|
12
4
|
this.state = state;
|
|
@@ -40,18 +40,14 @@ export default class ActionLocationEntity {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
listen(eventName) {
|
|
43
|
-
var _this$element;
|
|
44
|
-
|
|
45
43
|
const handler = this.createEventHandlers(eventName);
|
|
46
44
|
this.handlers[eventName] = handler;
|
|
47
|
-
|
|
45
|
+
this.element?.addEventListener(eventName, handler);
|
|
48
46
|
}
|
|
49
47
|
|
|
50
48
|
unListen(eventName) {
|
|
51
|
-
var _this$element2;
|
|
52
|
-
|
|
53
49
|
const handler = this.handlers[eventName];
|
|
54
|
-
|
|
50
|
+
this.element?.removeEventListener(eventName, handler);
|
|
55
51
|
this.handlers[eventName] = undefined;
|
|
56
52
|
}
|
|
57
53
|
|
|
@@ -8,6 +8,7 @@ import TableColumnFilter from "../../../../legacy-to-new-arch/table-column-filte
|
|
|
8
8
|
import MoreDropdown from "../../../../legacy-to-new-arch/more-dropdown/frameworks/ui/MoreDropdown";
|
|
9
9
|
import Breadcrumb from "../../../../legacy-to-new-arch/breadcrumb/frameworks/ui/Breadcrumb";
|
|
10
10
|
import IconButton from "../../../../legacy-to-new-arch/icon-button/frameworks/ui/IconButton";
|
|
11
|
+
import HighlightedValue from "../../../../legacy-to-new-arch/highlighted-value/frameworks/ui/HighlightedValue";
|
|
11
12
|
const ActionComponentMapping = {
|
|
12
13
|
['ActionIcon']: ActionIcon,
|
|
13
14
|
['Button']: Button,
|
|
@@ -18,6 +19,7 @@ const ActionComponentMapping = {
|
|
|
18
19
|
['TableSelectAll']: Checkbox,
|
|
19
20
|
['TableColumnFilter']: TableColumnFilter,
|
|
20
21
|
['Breadcrumb']: Breadcrumb,
|
|
21
|
-
['IconButton']: IconButton
|
|
22
|
+
['IconButton']: IconButton,
|
|
23
|
+
['HighlightedValue']: HighlightedValue
|
|
22
24
|
};
|
|
23
25
|
export default ActionComponentMapping;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
1
3
|
import React from 'react';
|
|
2
4
|
import ComponentRegistry from "../../../../../custom-component/frameworks/ui/ComponentRegistry";
|
|
3
5
|
import ActionComponentMapping from "../../../action-location/frameworks/ui/ActionComponentMapping";
|
|
@@ -23,13 +25,13 @@ function ActionsRendererView(_ref, ref) {
|
|
|
23
25
|
/* eslint-disable-next-line @zohodesk/architecturerules/no-defaultProps-rule */
|
|
24
26
|
|
|
25
27
|
const ActionUiType = ActionComponentMapping[type] || ComponentRegistry.get(type);
|
|
26
|
-
return /*#__PURE__*/React.createElement(ActionUiType, {
|
|
27
|
-
key: index
|
|
28
|
-
|
|
28
|
+
return /*#__PURE__*/React.createElement(ActionUiType, _extends({
|
|
29
|
+
key: index
|
|
30
|
+
}, properties, {
|
|
29
31
|
appendToActionPayload: {
|
|
30
32
|
eventMappings
|
|
31
33
|
}
|
|
32
|
-
});
|
|
34
|
+
}));
|
|
33
35
|
}));
|
|
34
36
|
}
|
|
35
37
|
|
|
@@ -32,63 +32,8 @@ function updateFieldValues(_ref) {
|
|
|
32
32
|
fields
|
|
33
33
|
};
|
|
34
34
|
});
|
|
35
|
-
}
|
|
36
|
-
// component: 'Button',
|
|
37
|
-
// location: 'footer_left_actions',
|
|
38
|
-
// properties: {
|
|
39
|
-
// text: 'Submit',
|
|
40
|
-
// palette: 'primaryFilled'
|
|
41
|
-
// },
|
|
42
|
-
// eventMappings: [
|
|
43
|
-
// {
|
|
44
|
-
// payloadValueMapping: {},
|
|
45
|
-
// sourceEvent: "BUTTON#CLICKED",
|
|
46
|
-
// id: "1234567890",
|
|
47
|
-
// targetEvent: "FORM#SUBMIT"
|
|
48
|
-
// }
|
|
49
|
-
// ]
|
|
50
|
-
// },
|
|
51
|
-
// {
|
|
52
|
-
// component: 'Button',
|
|
53
|
-
// location: 'footer_left_actions',
|
|
54
|
-
// properties: {
|
|
55
|
-
// text: 'Cancel',
|
|
56
|
-
// palette: 'secondary'
|
|
57
|
-
// },
|
|
58
|
-
// eventMappings: []
|
|
59
|
-
// }];
|
|
35
|
+
}
|
|
60
36
|
|
|
61
|
-
|
|
62
|
-
const headerLeftActions = [{
|
|
63
|
-
component: 'Breadcrumb',
|
|
64
|
-
properties: {
|
|
65
|
-
items: [{
|
|
66
|
-
id: 'customization',
|
|
67
|
-
text: 'Customization',
|
|
68
|
-
isLink: true
|
|
69
|
-
}, {
|
|
70
|
-
id: 'buttons',
|
|
71
|
-
text: 'Buttons',
|
|
72
|
-
isLink: true
|
|
73
|
-
}, {
|
|
74
|
-
id: 'new-button',
|
|
75
|
-
text: 'New Button',
|
|
76
|
-
isActive: true
|
|
77
|
-
}, {
|
|
78
|
-
id: 'kakarot',
|
|
79
|
-
text: 'Kakarot',
|
|
80
|
-
iconName: 'ZD-GN-department'
|
|
81
|
-
}]
|
|
82
|
-
},
|
|
83
|
-
eventMappings: []
|
|
84
|
-
}];
|
|
85
|
-
const headerRightActions = [{
|
|
86
|
-
component: 'IconButton',
|
|
87
|
-
properties: {
|
|
88
|
-
iconName: 'ZD-GN-infoStroke',
|
|
89
|
-
title: 'Help'
|
|
90
|
-
}
|
|
91
|
-
}];
|
|
92
37
|
export function TransformState(state) {
|
|
93
38
|
const {
|
|
94
39
|
sections,
|
|
@@ -100,7 +45,8 @@ export function TransformState(state) {
|
|
|
100
45
|
headerLeftActions,
|
|
101
46
|
headerRightActions,
|
|
102
47
|
footerLeftActions,
|
|
103
|
-
footerRightActions
|
|
48
|
+
footerRightActions,
|
|
49
|
+
rightPanel
|
|
104
50
|
} = state.properties; // const { values, errorMessages } = state.behaviours.form;
|
|
105
51
|
|
|
106
52
|
const updatedSections = updateFieldValues({
|
|
@@ -118,7 +64,8 @@ export function TransformState(state) {
|
|
|
118
64
|
headerLeftActions,
|
|
119
65
|
headerRightActions,
|
|
120
66
|
footerLeftActions,
|
|
121
|
-
footerRightActions
|
|
67
|
+
footerRightActions,
|
|
68
|
+
rightPanel
|
|
122
69
|
}
|
|
123
70
|
};
|
|
124
71
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { DefaultFormSectionUIType } from "../../../../../../cc/fields/field/FormDefaultUIType";
|
|
2
2
|
import ComponentRegistry from "../../../../../custom-component/frameworks/ui/ComponentRegistry";
|
|
3
|
-
import { TextArea, TextBox, Email, PickList, Currency, MultiSelect, Url, Percentage, Phone, Number, Decimal, Date, DateTime, Checkbox } from "../../../form-fields";
|
|
4
|
-
import EPHITag from "../../../form-fields/ephi-tag/frameworks/ui/EPHITag";
|
|
5
|
-
import InfoIcon from "../../../form-fields/info-icon/frameworks/ui/InfoIcon";
|
|
3
|
+
import { TextArea, TextBox, Email, PickList, Currency, MultiSelect, Url, Percentage, Phone, Number, Decimal, Date, DateTime, Checkbox, LookUp } from "../../../form-fields";
|
|
6
4
|
import Section from "../../../section/frameworks/ui/Section";
|
|
7
5
|
export function registerDefaultComponents() {
|
|
8
6
|
// Registering components in the ComponentRegistry
|
|
@@ -22,7 +20,6 @@ export function registerDefaultComponents() {
|
|
|
22
20
|
ComponentRegistry.register('Date', Date);
|
|
23
21
|
ComponentRegistry.register('DateTime', DateTime);
|
|
24
22
|
ComponentRegistry.register('Checkbox', Checkbox);
|
|
25
|
-
ComponentRegistry.register('
|
|
26
|
-
ComponentRegistry.register('InfoIcon', InfoIcon);
|
|
23
|
+
ComponentRegistry.register('LookUp', LookUp);
|
|
27
24
|
ComponentRegistry.register(DefaultFormSectionUIType, Section);
|
|
28
25
|
}
|
|
@@ -1,24 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import Loader from '@zohodesk/svg/es/v1/Loader/Loader';
|
|
3
2
|
import Flex from '@zohodesk/layout/es/Flex/Flex';
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import MiddleContainer from '@zohodesk-private/desk-components/es/setup/SetupContent/SetupContent';
|
|
8
|
-
import Sections from "./sub-components/Sections";
|
|
9
|
-
import ActionEventMediator from "../../../../../../platform/client-actions/components/action-event-mediator/frameworks/ui/ActionEventMediator";
|
|
10
|
-
import { ActionViewGap } from "../../../../../../platform/client-actions/components/interfaces/ActionViewModel"; // @ts-ignore
|
|
11
|
-
|
|
12
|
-
import style from "./css/Form.module.css";
|
|
3
|
+
import Header from "./sub-components/Header";
|
|
4
|
+
import MiddleSection from "./sub-components/MiddleSection";
|
|
5
|
+
import Footer from "./sub-components/Footer";
|
|
13
6
|
|
|
14
7
|
function FormView(_ref, ref) {
|
|
15
8
|
let {
|
|
16
|
-
state
|
|
17
|
-
helpers
|
|
9
|
+
state
|
|
18
10
|
} = _ref;
|
|
19
11
|
const {
|
|
20
12
|
sections,
|
|
21
13
|
isLoading,
|
|
14
|
+
rightPanel,
|
|
22
15
|
headerLeftActions,
|
|
23
16
|
headerRightActions,
|
|
24
17
|
footerLeftActions,
|
|
@@ -32,36 +25,19 @@ function FormView(_ref, ref) {
|
|
|
32
25
|
$ui_direction: "column",
|
|
33
26
|
$flag_fullsize: true,
|
|
34
27
|
ref: ref
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
$flag_greyBg: true,
|
|
49
|
-
$flag_childrenWrapper: true
|
|
50
|
-
}, isLoading ? /*#__PURE__*/React.createElement(Loader, null) : /*#__PURE__*/React.createElement(SectionsWrapper, null, /*#__PURE__*/React.createElement(Sections, {
|
|
51
|
-
sections: sections
|
|
52
|
-
}))), isFooterEnabled && /*#__PURE__*/React.createElement(FormAction, {
|
|
53
|
-
size: "small",
|
|
54
|
-
paddingLeftSize: "xmedium",
|
|
55
|
-
paddingRightClass: style.footer
|
|
56
|
-
}, /*#__PURE__*/React.createElement(LeftSide, null, footerLeftActions.length > 0 && /*#__PURE__*/React.createElement(ActionEventMediator, {
|
|
57
|
-
testId: "formFooter_leftActions",
|
|
58
|
-
actions: footerLeftActions,
|
|
59
|
-
gap: ActionViewGap.LARGE
|
|
60
|
-
})), /*#__PURE__*/React.createElement(RightSide, null, footerRightActions.length > 0 && /*#__PURE__*/React.createElement(ActionEventMediator, {
|
|
61
|
-
testId: "formFooter_rightActions",
|
|
62
|
-
actions: footerRightActions,
|
|
63
|
-
gap: ActionViewGap.LARGE
|
|
64
|
-
}))));
|
|
28
|
+
}, /*#__PURE__*/React.createElement(Header, {
|
|
29
|
+
hasHeader: isHeaderEnabled,
|
|
30
|
+
headerLeftActions: headerLeftActions,
|
|
31
|
+
headerRightActions: headerRightActions
|
|
32
|
+
}), /*#__PURE__*/React.createElement(MiddleSection, {
|
|
33
|
+
sections: sections,
|
|
34
|
+
isLoading: isLoading,
|
|
35
|
+
rightPanel: rightPanel
|
|
36
|
+
}), /*#__PURE__*/React.createElement(Footer, {
|
|
37
|
+
hasFooter: isFooterEnabled,
|
|
38
|
+
footerLeftActions: footerLeftActions,
|
|
39
|
+
footerRightActions: footerRightActions
|
|
40
|
+
}));
|
|
65
41
|
}
|
|
66
42
|
|
|
67
43
|
export default FormView;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
1
3
|
import React from 'react';
|
|
2
4
|
import { render, cleanup } from '@testing-library/react';
|
|
3
5
|
import '@testing-library/jest-dom/extend-expect';
|
|
@@ -24,8 +26,7 @@ describe('Form Sections', () => {
|
|
|
24
26
|
test('Sections are vertically aligned', () => {
|
|
25
27
|
const {
|
|
26
28
|
getByText
|
|
27
|
-
} = render( /*#__PURE__*/React.createElement(Form,
|
|
28
|
-
}));
|
|
29
|
+
} = render( /*#__PURE__*/React.createElement(Form, formProperties));
|
|
29
30
|
expect(getByText('User Details')).toBeInTheDocument();
|
|
30
31
|
expect(getByText('Address Information')).toBeInTheDocument();
|
|
31
32
|
});
|
|
@@ -42,24 +43,21 @@ describe('Form Sections', () => {
|
|
|
42
43
|
const {
|
|
43
44
|
getByText,
|
|
44
45
|
queryByText
|
|
45
|
-
} = render( /*#__PURE__*/React.createElement(Form,
|
|
46
|
-
}));
|
|
46
|
+
} = render( /*#__PURE__*/React.createElement(Form, singleSectionProperties));
|
|
47
47
|
expect(getByText('User Details')).toBeInTheDocument();
|
|
48
48
|
expect(queryByText('Address Information')).not.toBeInTheDocument();
|
|
49
49
|
});
|
|
50
50
|
test('Multiple sections in a layout', () => {
|
|
51
51
|
const {
|
|
52
52
|
getByText
|
|
53
|
-
} = render( /*#__PURE__*/React.createElement(Form,
|
|
54
|
-
}));
|
|
53
|
+
} = render( /*#__PURE__*/React.createElement(Form, formProperties));
|
|
55
54
|
expect(getByText('User Details')).toBeInTheDocument();
|
|
56
55
|
expect(getByText('Address Information')).toBeInTheDocument();
|
|
57
56
|
});
|
|
58
57
|
test('Maintain section order during rendering', () => {
|
|
59
58
|
const {
|
|
60
59
|
getAllByText
|
|
61
|
-
} = render( /*#__PURE__*/React.createElement(Form,
|
|
62
|
-
}));
|
|
60
|
+
} = render( /*#__PURE__*/React.createElement(Form, formProperties));
|
|
63
61
|
const sections = getAllByText(/Details|Information/);
|
|
64
62
|
expect(sections[0]).toHaveTextContent('User Details');
|
|
65
63
|
expect(sections[1]).toHaveTextContent('Address Information');
|
|
@@ -68,8 +66,7 @@ describe('Form Sections', () => {
|
|
|
68
66
|
const {
|
|
69
67
|
getAllByText,
|
|
70
68
|
rerender
|
|
71
|
-
} = render( /*#__PURE__*/React.createElement(Form,
|
|
72
|
-
}));
|
|
69
|
+
} = render( /*#__PURE__*/React.createElement(Form, formProperties));
|
|
73
70
|
const sections = getAllByText(/Details|Information/);
|
|
74
71
|
expect(sections[0]).toHaveTextContent('User Details');
|
|
75
72
|
expect(sections[1]).toHaveTextContent('Address Information');
|
|
@@ -94,8 +91,7 @@ describe('Form Sections', () => {
|
|
|
94
91
|
isVisible: true
|
|
95
92
|
}]
|
|
96
93
|
};
|
|
97
|
-
rerender( /*#__PURE__*/React.createElement(Form,
|
|
98
|
-
}));
|
|
94
|
+
rerender( /*#__PURE__*/React.createElement(Form, updatedProperties));
|
|
99
95
|
const updatedSections = getAllByText(/Details|Summary|Information/);
|
|
100
96
|
expect(updatedSections[0]).toHaveTextContent('User Details');
|
|
101
97
|
expect(updatedSections[1]).toHaveTextContent('Order Summary');
|
|
@@ -107,8 +103,7 @@ describe('Form Sections', () => {
|
|
|
107
103
|
getByText,
|
|
108
104
|
queryByText,
|
|
109
105
|
rerender
|
|
110
|
-
} = render( /*#__PURE__*/React.createElement(Form,
|
|
111
|
-
}));
|
|
106
|
+
} = render( /*#__PURE__*/React.createElement(Form, formProperties));
|
|
112
107
|
const sections = getAllByText(/Details|Information/);
|
|
113
108
|
expect(sections[0]).toHaveTextContent('User Details');
|
|
114
109
|
expect(sections[1]).toHaveTextContent('Address Information');
|
|
@@ -121,8 +116,7 @@ describe('Form Sections', () => {
|
|
|
121
116
|
isVisible: true
|
|
122
117
|
}]
|
|
123
118
|
};
|
|
124
|
-
rerender( /*#__PURE__*/React.createElement(Form,
|
|
125
|
-
}));
|
|
119
|
+
rerender( /*#__PURE__*/React.createElement(Form, updatedProperties));
|
|
126
120
|
expect(getByText('User Details')).toBeInTheDocument();
|
|
127
121
|
expect(queryByText('Address Information')).not.toBeInTheDocument();
|
|
128
122
|
}); // Loading tests
|
|
@@ -130,17 +124,17 @@ describe('Form Sections', () => {
|
|
|
130
124
|
test('Display loading indicator during form loading', () => {
|
|
131
125
|
const {
|
|
132
126
|
getByText
|
|
133
|
-
} = render( /*#__PURE__*/React.createElement(Form, {
|
|
127
|
+
} = render( /*#__PURE__*/React.createElement(Form, _extends({}, formProperties, {
|
|
134
128
|
isLoading: true
|
|
135
|
-
}));
|
|
129
|
+
})));
|
|
136
130
|
expect(getByText('Loading...')).toBeInTheDocument();
|
|
137
131
|
});
|
|
138
132
|
test('No loading indicator when form is not loading', () => {
|
|
139
133
|
const {
|
|
140
134
|
queryByText
|
|
141
|
-
} = render( /*#__PURE__*/React.createElement(Form, {
|
|
135
|
+
} = render( /*#__PURE__*/React.createElement(Form, _extends({}, formProperties, {
|
|
142
136
|
isLoading: false
|
|
143
|
-
}));
|
|
137
|
+
})));
|
|
144
138
|
expect(queryByText('Loading...')).not.toBeInTheDocument();
|
|
145
139
|
});
|
|
146
140
|
});
|
|
@@ -11,12 +11,10 @@
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
.checkboxField {
|
|
14
|
-
composes:
|
|
14
|
+
composes: dInflex alignFstart from '~@zohodesk/components/es/common/common.module.css';
|
|
15
|
+
max-width: 100% ;
|
|
15
16
|
gap: var(--zd_size8)
|
|
16
17
|
}
|
|
17
|
-
.checkboxWrapper {
|
|
18
|
-
margin-top: var(--zd_size3)
|
|
19
|
-
}
|
|
20
18
|
|
|
21
19
|
.cursor_pointer {
|
|
22
20
|
cursor: pointer
|
|
@@ -34,4 +32,31 @@
|
|
|
34
32
|
|
|
35
33
|
[dir=rtl] .footer {
|
|
36
34
|
padding-left: var(--zd_size32)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/* Sections layout */
|
|
38
|
+
|
|
39
|
+
.sectionsWrapper {
|
|
40
|
+
padding-bottom: var(--zd_size8)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.sectionsLayout, .sectionsTwoLayout {
|
|
44
|
+
margin: 0 auto
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.sectionsLayout {
|
|
48
|
+
max-width: var(--local-form-layout-max-width, var(--zd_size1080))
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.sectionsTwoLayout {
|
|
52
|
+
column-gap: var(--zd_size8) ;
|
|
53
|
+
max-width: var(--local-form-layout-max-width, var(--zd_size1210))
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.rightPanel {
|
|
57
|
+
height: var(--local-form-right-panel-height, 100%);
|
|
58
|
+
position: -webkit-sticky;
|
|
59
|
+
position: sticky;
|
|
60
|
+
top: 0 ;
|
|
61
|
+
padding: var(--zd_size8) 0
|
|
37
62
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import FormAction, { LeftSide, RightSide } from '@zohodesk/dot/es/FormAction/FormAction';
|
|
3
|
+
import ActionEventMediator from "../../../../../../../platform/client-actions/components/action-event-mediator/frameworks/ui/ActionEventMediator";
|
|
4
|
+
import { ActionViewGap } from "../../../../../../../platform/client-actions/components/interfaces/ActionViewModel"; // @ts-ignore
|
|
5
|
+
|
|
6
|
+
import style from "../css/Form.module.css";
|
|
7
|
+
export default function Footer(_ref) {
|
|
8
|
+
let {
|
|
9
|
+
hasFooter,
|
|
10
|
+
footerLeftActions,
|
|
11
|
+
footerRightActions
|
|
12
|
+
} = _ref;
|
|
13
|
+
if (!hasFooter) return null;
|
|
14
|
+
return /*#__PURE__*/React.createElement(FormAction, {
|
|
15
|
+
size: "small",
|
|
16
|
+
paddingLeftSize: "xmedium",
|
|
17
|
+
paddingRightClass: style.footer
|
|
18
|
+
}, /*#__PURE__*/React.createElement(LeftSide, null, footerLeftActions.length > 0 && /*#__PURE__*/React.createElement(ActionEventMediator, {
|
|
19
|
+
testId: "formFooter_leftActions",
|
|
20
|
+
actions: footerLeftActions,
|
|
21
|
+
gap: ActionViewGap.LARGE
|
|
22
|
+
})), /*#__PURE__*/React.createElement(RightSide, null, footerRightActions.length > 0 && /*#__PURE__*/React.createElement(ActionEventMediator, {
|
|
23
|
+
testId: "formFooter_rightActions",
|
|
24
|
+
actions: footerRightActions,
|
|
25
|
+
gap: ActionViewGap.LARGE
|
|
26
|
+
})));
|
|
27
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import FormHeader from '@zohodesk-private/desk-components/es/setup/SetupHeader/SetupHeader';
|
|
3
|
+
import ActionEventMediator from "../../../../../../../platform/client-actions/components/action-event-mediator/frameworks/ui/ActionEventMediator";
|
|
4
|
+
import { ActionViewGap } from "../../../../../../../platform/client-actions/components/interfaces/ActionViewModel";
|
|
5
|
+
export default function Header(_ref) {
|
|
6
|
+
let {
|
|
7
|
+
hasHeader,
|
|
8
|
+
headerLeftActions,
|
|
9
|
+
headerRightActions
|
|
10
|
+
} = _ref;
|
|
11
|
+
if (!hasHeader) return null;
|
|
12
|
+
return /*#__PURE__*/React.createElement(FormHeader, {
|
|
13
|
+
customId: "formHeader",
|
|
14
|
+
testId: "formHeader",
|
|
15
|
+
$render_leftElement: headerLeftActions.length > 0 ? /*#__PURE__*/React.createElement(ActionEventMediator, {
|
|
16
|
+
actions: headerLeftActions,
|
|
17
|
+
gap: ActionViewGap.MEDIUM
|
|
18
|
+
}) : null,
|
|
19
|
+
$render_rightElement: headerRightActions.length > 0 ? /*#__PURE__*/React.createElement(ActionEventMediator, {
|
|
20
|
+
actions: headerRightActions,
|
|
21
|
+
gap: ActionViewGap.MEDIUM
|
|
22
|
+
}) : null
|
|
23
|
+
});
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import MiddleContainer from '@zohodesk-private/desk-components/es/setup/SetupContent/SetupContent';
|
|
3
|
+
import SectionStencil from '@zohodesk-private/desk-components/es/form/SectionStencil/SectionStencil';
|
|
4
|
+
import SectionsLayout from "./SectionsLayout";
|
|
5
|
+
import Sections from "./Sections";
|
|
6
|
+
export default function MiddleSection(_ref) {
|
|
7
|
+
let {
|
|
8
|
+
sections,
|
|
9
|
+
isLoading,
|
|
10
|
+
rightPanel
|
|
11
|
+
} = _ref;
|
|
12
|
+
return /*#__PURE__*/React.createElement(MiddleContainer, {
|
|
13
|
+
$flag_padding: true,
|
|
14
|
+
$flag_greyBg: true,
|
|
15
|
+
customId: "formContent",
|
|
16
|
+
testId: "formContent"
|
|
17
|
+
}, isLoading ? /*#__PURE__*/React.createElement(SectionStencil, {
|
|
18
|
+
fieldSizes: ['half', 'half', 'half', 'half', 'full']
|
|
19
|
+
}) : /*#__PURE__*/React.createElement(SectionsLayout, {
|
|
20
|
+
rightPanel: rightPanel
|
|
21
|
+
}, /*#__PURE__*/React.createElement(Sections, {
|
|
22
|
+
sections: sections
|
|
23
|
+
})));
|
|
24
|
+
}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import ComponentRegistry from "../../../../../../custom-component/frameworks/ui/ComponentRegistry";
|
|
3
|
+
import SectionsWrapper from '@zohodesk-private/desk-components/es/form/SectionsWrapper/SectionsWrapper'; // @ts-ignore
|
|
4
|
+
|
|
5
|
+
import style from "../css/Form.module.css";
|
|
3
6
|
export default function Sections(_ref) {
|
|
4
7
|
let {
|
|
5
8
|
sections
|
|
6
9
|
} = _ref;
|
|
7
|
-
return
|
|
10
|
+
return /*#__PURE__*/React.createElement(SectionsWrapper, {
|
|
11
|
+
$ui_className: style.sectionsWrapper
|
|
12
|
+
}, sections.map(section => {
|
|
8
13
|
const {
|
|
9
14
|
id,
|
|
10
15
|
name,
|
|
@@ -28,5 +33,5 @@ export default function Sections(_ref) {
|
|
|
28
33
|
isCollapsed: isCollapsed,
|
|
29
34
|
additionalDetails: additionalDetails
|
|
30
35
|
});
|
|
31
|
-
});
|
|
36
|
+
}));
|
|
32
37
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import SectionsWithRightPanelLayout from "./SectionsWithRightPanelLayout"; // @ts-ignore
|
|
3
|
+
|
|
4
|
+
import style from "../css/Form.module.css";
|
|
5
|
+
export default function SectionsLayout(_ref) {
|
|
6
|
+
let {
|
|
7
|
+
rightPanel,
|
|
8
|
+
children
|
|
9
|
+
} = _ref;
|
|
10
|
+
|
|
11
|
+
if (!!rightPanel.componentName) {
|
|
12
|
+
return /*#__PURE__*/React.createElement(SectionsWithRightPanelLayout, {
|
|
13
|
+
rightPanel: rightPanel
|
|
14
|
+
}, children);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
18
|
+
className: style.sectionsLayout
|
|
19
|
+
}, children);
|
|
20
|
+
}
|
package/es/library/dot/components/form/frameworks/ui/sub-components/SectionsWithRightPanelLayout.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React, { useRef, useCallback } from 'react';
|
|
2
|
+
import Flex from '@zohodesk/layout/es/Flex/Flex';
|
|
3
|
+
import useResizeObserver from '@zohodesk/hooks/es/utils/useResizeObserver';
|
|
4
|
+
import ComponentRegistry from "../../../../../../custom-component/frameworks/ui/ComponentRegistry"; // @ts-ignore
|
|
5
|
+
|
|
6
|
+
import style from "../css/Form.module.css";
|
|
7
|
+
export default function SectionsWithRightPanelLayout(_ref) {
|
|
8
|
+
let {
|
|
9
|
+
rightPanel,
|
|
10
|
+
children
|
|
11
|
+
} = _ref;
|
|
12
|
+
const {
|
|
13
|
+
componentName,
|
|
14
|
+
properties
|
|
15
|
+
} = rightPanel;
|
|
16
|
+
const RightPanelComponent = ComponentRegistry.get(componentName);
|
|
17
|
+
const containerRef = useRef(null);
|
|
18
|
+
updateRightPanelHeight(containerRef);
|
|
19
|
+
return /*#__PURE__*/React.createElement(Flex, {
|
|
20
|
+
ref: containerRef,
|
|
21
|
+
$ui_displayMode: "flex",
|
|
22
|
+
$ui_className: style.sectionsTwoLayout
|
|
23
|
+
}, /*#__PURE__*/React.createElement(Flex, {
|
|
24
|
+
$flag_flexible: true
|
|
25
|
+
}, children), /*#__PURE__*/React.createElement(Flex, {
|
|
26
|
+
$flag_shrink: false,
|
|
27
|
+
$ui_className: style.rightPanel
|
|
28
|
+
}, /*#__PURE__*/React.createElement(RightPanelComponent, properties)));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function updateRightPanelHeight(ref) {
|
|
32
|
+
const getElement = useCallback(() => ref.current.parentElement, [ref]);
|
|
33
|
+
const callback = useCallback(entry => {
|
|
34
|
+
entry.target.style.setProperty('--local-form-right-panel-height', `${entry.target.clientHeight}px`);
|
|
35
|
+
}, []);
|
|
36
|
+
useResizeObserver({
|
|
37
|
+
getElement,
|
|
38
|
+
callback,
|
|
39
|
+
isObserve: true
|
|
40
|
+
});
|
|
41
|
+
}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { createCustomComponent } from "../../../../../../custom-component";
|
|
2
2
|
import CheckboxProperties from "../../../../../../../cc/fields/boolean/Properties";
|
|
3
3
|
import CheckboxView from "./CheckboxView";
|
|
4
|
-
import { TransformState } from "../../adapters/presenter/TransformState";
|
|
5
4
|
import EventHandlersFactory from "./EventHandlerFactory";
|
|
5
|
+
import FocusFieldBehaviourFactory from "../../../../../../behaviours/field-focus/frameworks/ui/FocusFieldBehaviourFactory";
|
|
6
6
|
let Checkbox = createCustomComponent({
|
|
7
7
|
name: 'FormCheckboxField',
|
|
8
8
|
View: CheckboxView,
|
|
9
|
-
transformState: TransformState,
|
|
10
9
|
properties: CheckboxProperties,
|
|
11
10
|
eventHandlers: EventHandlersFactory.create(),
|
|
12
|
-
behaviours: [
|
|
11
|
+
behaviours: [FocusFieldBehaviourFactory.create({
|
|
12
|
+
selector: '[role="checkbox"]'
|
|
13
|
+
})]
|
|
13
14
|
});
|
|
14
15
|
export default Checkbox;
|