@zohodesk/library-platform 1.1.9 → 1.1.10
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/field-validation/Constants.js +4 -0
- package/es/bc/field-validation/EventHandlers.js +1 -0
- package/es/bc/field-validation/Events.js +106 -0
- package/es/bc/field-validation/FieldTypes.js +20 -0
- package/es/bc/field-validation/Properties.js +11 -0
- package/es/bc/field-validation/index.js +5 -0
- package/es/bc/zdata-source/Constants.js +6 -11
- package/es/bc/zform/Properties.js +6 -0
- package/es/bc/zform/Symbol.js +1 -0
- package/es/bc/zlist/Properties.js +6 -0
- package/es/bc/zrecord/Constants.js +10 -19
- 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/email/Constants.js +3 -5
- package/es/cc/ephi-tag/Properties.js +1 -0
- package/es/cc/ephi-tag/index.js +1 -0
- package/es/cc/fields/currency/Model.js +2 -0
- package/es/cc/fields/field/Constants.js +9 -13
- package/es/cc/fields/field/FormDefaultUIType.js +1 -1
- package/es/cc/fields/text/Properties.js +9 -0
- package/es/cc/form/Constants.js +6 -11
- package/es/cc/form-connected/Constants.js +10 -19
- package/es/cc/form-connected/ExternalConstants.js +11 -0
- package/es/cc/form-connected/index.js +1 -1
- package/es/cc/highlighted-value/Constants.js +3 -5
- package/es/cc/icon-button/Constants.js +3 -5
- package/es/cc/info-icon/Properties.js +10 -0
- package/es/cc/info-icon/index.js +1 -0
- 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/section/Constants.js +5 -9
- package/es/cc/select/Constants.js +6 -11
- package/es/cc/switch/Constants.js +3 -5
- package/es/cc/switch/Properties.js +2 -2
- package/es/cc/table-column-filter/Constants.js +5 -9
- package/es/cc/table-connected/Events.js +1 -1
- package/es/cc/table-connected/Properties.js +6 -0
- package/es/cc/table-connected/constants/Events.js +1 -8
- package/es/cc/table-connected/constants/ExternalConstants.js +9 -0
- package/es/cc/table-connected/constants/index.js +2 -1
- 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/index.js +14 -3
- package/es/library/behaviours/field-focus/frameworks/ui/EventHandlersFactory.js +1 -3
- package/es/library/behaviours/field-validation/adapters/controllers/AbstractController.js +9 -0
- package/es/library/behaviours/field-validation/adapters/controllers/ValidateFieldController.js +32 -0
- package/es/library/behaviours/field-validation/adapters/controllers/ValidateFieldsController.js +31 -0
- package/es/library/behaviours/field-validation/adapters/gateway/Repository.js +23 -0
- package/es/library/behaviours/field-validation/adapters/gateway/Service.js +18 -0
- package/es/library/behaviours/field-validation/applications/interfaces/UseCaseDependencies.js +1 -0
- package/es/library/behaviours/field-validation/applications/interfaces/gateways/IRepository.js +1 -0
- package/es/library/behaviours/field-validation/applications/interfaces/gateways/IService.js +1 -0
- package/es/library/behaviours/field-validation/applications/interfaces/input/FieldData.js +17 -0
- package/es/library/behaviours/field-validation/applications/interfaces/input/FieldValidationInputModel.js +1 -0
- package/es/library/behaviours/field-validation/applications/interfaces/input/ValidateFieldsInputModel.js +1 -0
- package/es/library/behaviours/field-validation/applications/usecases/AbstractUseCase.js +15 -0
- package/es/library/behaviours/field-validation/applications/usecases/ValidateField.js +29 -0
- package/es/library/behaviours/field-validation/applications/usecases/ValidateFields.js +28 -0
- package/es/library/behaviours/field-validation/domain/FieldValidation.js +94 -0
- package/es/library/behaviours/field-validation/domain/field-vise-validations/BooleanValidation.js +28 -0
- package/es/library/behaviours/field-validation/domain/field-vise-validations/CurrencyValidation.js +49 -0
- package/es/library/behaviours/field-validation/domain/field-vise-validations/DateTimeValidation.js +24 -0
- package/es/library/behaviours/field-validation/domain/field-vise-validations/DateValidation.js +24 -0
- package/es/library/behaviours/field-validation/domain/field-vise-validations/DecimalValidation.js +49 -0
- package/es/library/behaviours/field-validation/domain/field-vise-validations/EmailValidation.js +28 -0
- package/es/library/behaviours/field-validation/domain/field-vise-validations/IntegerValidation.js +39 -0
- package/es/library/behaviours/field-validation/domain/field-vise-validations/LookUpValidation.js +24 -0
- package/es/library/behaviours/field-validation/domain/field-vise-validations/MultiSelectValidation.js +26 -0
- package/es/library/behaviours/field-validation/domain/field-vise-validations/PercentValidation.js +28 -0
- package/es/library/behaviours/field-validation/domain/field-vise-validations/PhoneValidation.js +39 -0
- package/es/library/behaviours/field-validation/domain/field-vise-validations/PicklistValidation.js +24 -0
- package/es/library/behaviours/field-validation/domain/field-vise-validations/TextAreaValidation.js +39 -0
- package/es/library/behaviours/field-validation/domain/field-vise-validations/TextBoxValidation.js +39 -0
- package/es/library/behaviours/field-validation/domain/field-vise-validations/URLValidation.js +28 -0
- package/es/library/behaviours/field-validation/domain/interfaces/FieldTypes.js +20 -0
- package/es/library/behaviours/field-validation/domain/interfaces/IField.js +0 -0
- package/es/library/behaviours/field-validation/domain/interfaces/IFieldValidation.js +1 -0
- package/es/library/behaviours/field-validation/domain/interfaces/IFieldViseValidation.js +1 -0
- package/es/library/behaviours/field-validation/domain/interfaces/ValidationResult.js +1 -0
- package/es/library/behaviours/field-validation/domain/interfaces/ValidationsArray.js +1 -0
- package/es/library/behaviours/field-validation/domain/interfaces/ValidationsEnum.js +22 -0
- package/es/library/behaviours/field-validation/domain/interfaces/ValidationsMap.js +1 -0
- 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 +23 -0
- package/es/library/behaviours/field-validation/frameworks/ui/FieldValidationBehaviourFactory.js +27 -0
- package/es/library/behaviours/field-validation/frameworks/ui/__tests__/BooleanFieldValidation.test.js +137 -0
- package/es/library/behaviours/field-validation/frameworks/ui/__tests__/CurrencyFieldValidation.test.js +228 -0
- package/es/library/behaviours/field-validation/frameworks/ui/__tests__/DateFieldValidation.test.js +108 -0
- package/es/library/behaviours/field-validation/frameworks/ui/__tests__/DateTimeFieldValidation.test.js +108 -0
- package/es/library/behaviours/field-validation/frameworks/ui/__tests__/DecimalFieldValidation.test.js +257 -0
- package/es/library/behaviours/field-validation/frameworks/ui/__tests__/EmailFieldValidation.test.js +139 -0
- package/es/library/behaviours/field-validation/frameworks/ui/__tests__/FieldValidationBehaviour.test.js +171 -0
- package/es/library/behaviours/field-validation/frameworks/ui/__tests__/IntegerFieldValidation.test.js +168 -0
- package/es/library/behaviours/field-validation/frameworks/ui/__tests__/LookUpFieldValidation.test.js +108 -0
- package/es/library/behaviours/field-validation/frameworks/ui/__tests__/MultiSelectFieldValidation.test.js +79 -0
- package/es/library/behaviours/field-validation/frameworks/ui/__tests__/PercentFieldValidation.test.js +108 -0
- package/es/library/behaviours/field-validation/frameworks/ui/__tests__/PhoneFieldValidation.test.js +168 -0
- package/es/library/behaviours/field-validation/frameworks/ui/__tests__/PicklistFieldValidation.test.js +79 -0
- package/es/library/behaviours/field-validation/frameworks/ui/__tests__/TextAreaFieldValidation.test.js +170 -0
- package/es/library/behaviours/field-validation/frameworks/ui/__tests__/TextBoxFieldValidation.test.js +170 -0
- package/es/library/behaviours/field-validation/frameworks/ui/__tests__/URLFieldValidation.test.js +108 -0
- package/es/library/behaviours/field-validation/frameworks/utils/FormBasicValidationAdaptor.js +228 -0
- package/es/library/behaviours/field-validation/frameworks/utils/__tests__/formValidate.test.js +284 -0
- package/es/library/behaviours/field-validation/frameworks/utils/formValidate.js +334 -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/json-schema-validator/Validator.js +71 -10
- 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/actions-renderer/frameworks/ui/ActionsRendererView.js +6 -4
- package/es/library/dot/components/form/frameworks/ui/DefaultComponentRegister.js +2 -1
- package/es/library/dot/components/form/frameworks/ui/FormView.js +3 -1
- 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 +0 -3
- package/es/library/dot/components/form/frameworks/ui/sub-components/SectionsWithRightPanelLayout.js +1 -2
- package/es/library/dot/components/form-fields/checkbox/adapters/presenter/TransformState.js +22 -0
- package/es/library/dot/components/form-fields/checkbox/frameworks/ui/CheckboxView.js +1 -3
- package/es/library/dot/components/form-fields/currency/adapters/presenter/TransformState.js +81 -0
- package/es/library/dot/components/form-fields/currency/frameworks/ui/CurrencyView.js +15 -3
- package/es/library/dot/components/form-fields/currency/frameworks/ui/EventHandlerFactory.js +8 -0
- package/es/library/dot/components/form-fields/date/adapters/presenter/TransformState.js +22 -0
- package/es/library/dot/components/form-fields/datetime/adapters/presenter/TransformState.js +22 -0
- package/es/library/dot/components/form-fields/decimal/adapters/presenter/TransformState.js +31 -0
- package/es/library/dot/components/form-fields/email/adapters/presenter/TransformState.js +23 -0
- package/es/library/dot/components/form-fields/ephi-tag/frameworks/ui/EPHITag.js +10 -0
- package/es/library/dot/components/form-fields/ephi-tag/frameworks/ui/EPHITagView.js +21 -0
- package/es/library/dot/components/form-fields/ephi-tag/frameworks/ui/css/EPHITag.module.css +3 -0
- package/es/library/dot/components/form-fields/field/__test__/common.js +18 -16
- package/es/library/dot/components/form-fields/index.js +2 -1
- package/es/library/dot/components/form-fields/info-icon/frameworks/ui/InfoIcon.js +10 -0
- package/es/library/dot/components/form-fields/info-icon/frameworks/ui/InfoIconView.js +21 -0
- package/es/library/dot/components/form-fields/info-icon/frameworks/ui/css/InfoIcon.module.css +3 -0
- 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/adapters/presenter/TransformState.js +31 -0
- package/es/library/dot/components/form-fields/number/adapters/presenter/TransformState.js +31 -0
- package/es/library/dot/components/form-fields/percentage/adapters/presenter/TransformState.js +31 -0
- package/es/library/dot/components/form-fields/phone/adapters/presenter/TransformState.js +31 -0
- package/es/library/dot/components/form-fields/pick-list/adapters/presenter/TransformState.js +23 -0
- package/es/library/dot/components/form-fields/textarea/adapters/presenter/TransformState.js +23 -0
- package/es/library/dot/components/form-fields/textarea/frameworks/ui/TextAreaView.js +4 -2
- package/es/library/dot/components/form-fields/textbox/adapters/presenter/TransformState.js +32 -0
- package/es/library/dot/components/form-fields/url/adapters/presenter/TransformState.js +31 -0
- package/es/library/dot/components/section/adapters/presenter/TransFormState.js +26 -0
- package/es/library/dot/components/section/frameworks/ui/RenderField.js +5 -4
- package/es/library/dot/components/section/frameworks/ui/SectionView.js +1 -0
- package/es/library/dot/components/table-list/adapters/controllers/KeyboardRowClickController.js +2 -2
- 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/css/TableList.module.css +1 -0
- 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/date/frameworks/ui/DateView.js +8 -3
- 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/label/frameworks/ui/LabelView.js +5 -7
- 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 +13 -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 +1 -1
- package/es/library/dot/legacy-to-new-arch/switch/frameworks/ui/SwitchView.js +5 -5
- 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/table-field-components/currency-field/frameworks/ui/CurrencyFieldView.js +10 -2
- package/es/library/dot/legacy-to-new-arch/table-field-components/switch-field/frameworks/ui/SwitchFieldView.js +0 -1
- package/es/library/dot/legacy-to-new-arch/text-area/frameworks/ui/TextAreaView.js +22 -4
- 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 +1 -1
- package/es/library/slot/frameworks/ui/ConvertSlotToComponent.js +5 -4
- package/es/library/translator-common/adapters/presenter/formatCurrency.js +42 -0
- package/es/library/translator-common/index.js +2 -1
- 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/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 +20 -4
- package/es/platform/components/form-connected/frameworks/EventHandlersFactory.js +3 -3
- package/es/platform/components/form-connected/frameworks/FormConnectedFactory.js +1 -1
- package/es/platform/components/form-connected/frameworks/FormSdkFactory.js +6 -4
- 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 +6 -6
- 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/fetchLookupFields.js +24 -0
- package/es/platform/data-source/index.js +3 -1
- package/es/platform/data-source/utils/validation-rules/TransFormValidationRules.js +6 -1
- 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/domain/entities/APITemplate.js +2 -17
- 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/LookupFieldController.js +23 -0
- package/es/platform/zform/adapters/controllers/ValidateErrorMessageController.js +22 -0
- package/es/platform/zform/adapters/gateway/FormRepository.js +0 -6
- package/es/platform/zform/adapters/gateway/Service.js +2 -36
- package/es/platform/zform/adapters/presenter/FormPresenter.js +0 -8
- package/es/platform/zform/adapters/presenter/translators/SectionTranslator.js +50 -36
- package/es/platform/zform/adapters/presenter/translators/fields/CurrencyFieldTranslator.js +9 -1
- package/es/platform/zform/adapters/presenter/translators/fields/LookUpFieldTranslator.js +2 -1
- package/es/platform/zform/adapters/presenter/utils/DefaultClientActions.js +81 -73
- package/es/platform/zform/adapters/presenter/utils/sanitizeHtmlString.js +11 -0
- package/es/platform/zform/applications/interfaces/input/GetIsFieldValueChangedUseCaseInput.js +1 -0
- package/es/platform/zform/applications/interfaces/input/LookUpFieldSuccessUseCaseInputModel.js +1 -0
- package/es/platform/zform/applications/interfaces/input/ValidateErrorMessageInputModel.js +1 -0
- package/es/platform/zform/applications/usecases/GetFieldValueUseCase.js +1 -1
- package/es/platform/zform/applications/usecases/GetIsFieldValueChanged.js +35 -0
- package/es/platform/zform/applications/usecases/LookupFieldSuccessUseCase.js +33 -0
- package/es/platform/zform/applications/usecases/MyFormSuccessUseCase.js +35 -1
- package/es/platform/zform/applications/usecases/MyLayoutSuccessUseCase.js +1 -1
- package/es/platform/zform/applications/usecases/ValidateErrorMessageUseCase.js +33 -0
- package/es/platform/zform/applications/usecases/ValidateFieldRequestUseCase.js +56 -0
- package/es/platform/zform/domain/ZDependencyMapping.js +0 -17
- package/es/platform/zform/domain/ZField.js +16 -59
- package/es/platform/zform/domain/ZForm.js +2 -42
- 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/frameworks/ui/EventHandlerFactory.js +7 -4
- package/es/platform/zform/frameworks/validation-rules/Validator.js +4 -8
- 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 +5 -7
- package/es/platform/zlist/adapters/presenters/translators/ColumnTranslator.js +5 -9
- package/es/platform/zlist/adapters/presenters/translators/Row.js +3 -2
- package/es/platform/zlist/adapters/presenters/translators/RowsTranslator.js +4 -2
- package/es/platform/zlist/adapters/presenters/translators/actions/ActionsTranslator.js +4 -15
- package/es/platform/zlist/adapters/presenters/translators/fields/CurrencyFieldTranslator.js +7 -2
- package/es/platform/zlist/adapters/presenters/translators/fields/FormulaFieldTranslator.js +7 -2
- 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 -3
- 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 +28 -29
|
@@ -1,18 +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 Style {
|
|
4
|
-
constructor() {
|
|
5
|
-
_defineProperty(this, "name", void 0);
|
|
6
|
-
|
|
7
|
-
_defineProperty(this, "label", void 0);
|
|
8
|
-
|
|
9
|
-
_defineProperty(this, "required", void 0);
|
|
10
|
-
|
|
11
|
-
_defineProperty(this, "defaultValue", void 0);
|
|
12
|
-
|
|
13
|
-
_defineProperty(this, "typeMetadata", void 0);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
2
|
getLabel() {
|
|
17
3
|
return this.label;
|
|
18
4
|
}
|
|
@@ -6,28 +6,89 @@ let jsonValidator = new Ajv({
|
|
|
6
6
|
class Validator {
|
|
7
7
|
static validate(schema, value) {
|
|
8
8
|
let errors = [];
|
|
9
|
+
Validator.checkFunctionsRecursively(schema, value, '', '#', errors); // Use AJV for the rest of the validation, ignoring functions
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
isValid: true,
|
|
13
|
-
errors
|
|
14
|
-
};
|
|
15
|
-
} // validate is a type guard for MyData - type is inferred from schema type
|
|
11
|
+
const ajvSchema = JSON.parse(JSON.stringify(schema, (key, val) => val === 'function' ? undefined : val)); // validate is a type guard for MyData - type is inferred from schema type
|
|
12
|
+
// const validate = jsonValidator.compile(schema);
|
|
16
13
|
|
|
17
|
-
|
|
18
|
-
const validate = jsonValidator.compile(schema);
|
|
14
|
+
const validate = jsonValidator.compile(ajvSchema);
|
|
19
15
|
const isValid = validate(value);
|
|
20
16
|
|
|
21
17
|
if (!isValid) {
|
|
22
|
-
errors = validate.errors;
|
|
18
|
+
// errors = validate.errors;
|
|
19
|
+
errors.push(...(validate.errors || []));
|
|
23
20
|
}
|
|
24
21
|
|
|
25
22
|
return {
|
|
26
|
-
isValid,
|
|
23
|
+
isValid: isValid && errors.length === 0,
|
|
27
24
|
errors
|
|
28
25
|
};
|
|
29
26
|
}
|
|
30
27
|
|
|
28
|
+
static checkFunctionsRecursively(schema, value) {
|
|
29
|
+
let path = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
30
|
+
let schemaPath = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '#';
|
|
31
|
+
let errors = arguments.length > 4 ? arguments[4] : undefined;
|
|
32
|
+
|
|
33
|
+
if (schema.type === 'function') {
|
|
34
|
+
if (typeof value !== 'function') {
|
|
35
|
+
errors.push({
|
|
36
|
+
keyword: "type",
|
|
37
|
+
dataPath: path ? `.${path}` : "",
|
|
38
|
+
schemaPath: `${schemaPath}/type`,
|
|
39
|
+
params: {
|
|
40
|
+
type: "function"
|
|
41
|
+
},
|
|
42
|
+
message: "should be function"
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (schema.type === 'object' && schema.properties && typeof value === 'object' && value !== null) {
|
|
50
|
+
for (const key in schema.properties) {
|
|
51
|
+
Validator.checkFunctionsRecursively(schema.properties[key], value[key], path ? `${path}.${key}` : key, `${schemaPath}/properties/${key}`, errors);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (schema.type === 'array' && Array.isArray(value) && schema.items) {
|
|
56
|
+
value.forEach((item, index) => {
|
|
57
|
+
Validator.checkFunctionsRecursively(schema.items, item, `${path}[${index}]`, `${schemaPath}/items`, errors);
|
|
58
|
+
});
|
|
59
|
+
} // if (schema.anyOf && Array.isArray(schema.anyOf)) {
|
|
60
|
+
// const subErrors = [];
|
|
61
|
+
// const valid = schema.anyOf.some((subSchema, idx) => {
|
|
62
|
+
// const tmpErrors = [];
|
|
63
|
+
// Validator.checkFunctionsRecursively(subSchema, value, path, `${schemaPath}/anyOf/${idx}`, tmpErrors);
|
|
64
|
+
// return tmpErrors.length === 0;
|
|
65
|
+
// });
|
|
66
|
+
// if (!valid) {
|
|
67
|
+
// errors.push({ keyword: "anyOf", dataPath: path ? `.${path}` : "", schemaPath: `${schemaPath}/anyOf`, params: {}, message: "should match some schema in anyOf" });
|
|
68
|
+
// }
|
|
69
|
+
// return;
|
|
70
|
+
// }
|
|
71
|
+
// if (schema.allOf && Array.isArray(schema.allOf)) {
|
|
72
|
+
// schema.allOf.forEach((subSchema, idx) => {
|
|
73
|
+
// Validator.checkFunctionsRecursively(subSchema, value, path, `${schemaPath}/allOf/${idx}`, errors);
|
|
74
|
+
// });
|
|
75
|
+
// return;
|
|
76
|
+
// }
|
|
77
|
+
// if (schema.oneOf && Array.isArray(schema.oneOf)) {
|
|
78
|
+
// let matchCount = 0;
|
|
79
|
+
// schema.oneOf.forEach((subSchema, idx) => {
|
|
80
|
+
// const tmpErrors = [];
|
|
81
|
+
// Validator.checkFunctionsRecursively(subSchema, value, path, `${schemaPath}/oneOf/${idx}`, tmpErrors);
|
|
82
|
+
// if (tmpErrors.length === 0) matchCount++;
|
|
83
|
+
// });
|
|
84
|
+
// if (matchCount !== 1) {
|
|
85
|
+
// errors.push({ keyword: "oneOf", dataPath: path ? `.${path}` : "", schemaPath: `${schemaPath}/oneOf`, params: {}, message: "should match exactly one schema in oneOf" });
|
|
86
|
+
// }
|
|
87
|
+
// return;
|
|
88
|
+
// }
|
|
89
|
+
|
|
90
|
+
}
|
|
91
|
+
|
|
31
92
|
static validatePropsAgainstSchema(schemaProps, props) {
|
|
32
93
|
const warnings = [];
|
|
33
94
|
const errors = [];
|
|
@@ -1,9 +1,7 @@
|
|
|
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
|
class ComponentRegistry {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
2
|
+
components = new Map();
|
|
3
|
+
|
|
4
|
+
constructor() {}
|
|
7
5
|
|
|
8
6
|
static getInstance() {
|
|
9
7
|
if (!ComponentRegistry.instance) {
|
|
@@ -31,6 +29,4 @@ class ComponentRegistry {
|
|
|
31
29
|
|
|
32
30
|
}
|
|
33
31
|
|
|
34
|
-
_defineProperty(ComponentRegistry, "instance", void 0);
|
|
35
|
-
|
|
36
32
|
export default ComponentRegistry.getInstance();
|
|
@@ -1,5 +1,3 @@
|
|
|
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 React, { forwardRef } from 'react';
|
|
4
2
|
import DependencyFactory from "./DependencyFactory";
|
|
5
3
|
import Compare from "./Compare";
|
|
@@ -19,30 +17,6 @@ const createCustomComponent = input => {
|
|
|
19
17
|
class Component extends React.Component {
|
|
20
18
|
constructor(props) {
|
|
21
19
|
super(props);
|
|
22
|
-
|
|
23
|
-
_defineProperty(this, "controller", void 0);
|
|
24
|
-
|
|
25
|
-
_defineProperty(this, "elementRef", void 0);
|
|
26
|
-
|
|
27
|
-
_defineProperty(this, "state", void 0);
|
|
28
|
-
|
|
29
|
-
_defineProperty(this, "presenter", void 0);
|
|
30
|
-
|
|
31
|
-
_defineProperty(this, "eventManager", void 0);
|
|
32
|
-
|
|
33
|
-
_defineProperty(this, "View", void 0);
|
|
34
|
-
|
|
35
|
-
_defineProperty(this, "helpers", void 0);
|
|
36
|
-
|
|
37
|
-
_defineProperty(this, "setRef", element => {
|
|
38
|
-
const {
|
|
39
|
-
setElement
|
|
40
|
-
} = this.eventManager;
|
|
41
|
-
setElement.bind(this.eventManager)(element);
|
|
42
|
-
this.eventManager.setElement(element);
|
|
43
|
-
this.props.getRef && this.props.getRef(element);
|
|
44
|
-
});
|
|
45
|
-
|
|
46
20
|
this.state = null;
|
|
47
21
|
let {
|
|
48
22
|
controller,
|
|
@@ -105,6 +79,15 @@ const createCustomComponent = input => {
|
|
|
105
79
|
componentDidUpdate() {// this.controller.updateProperties(this.props);
|
|
106
80
|
}
|
|
107
81
|
|
|
82
|
+
setRef = element => {
|
|
83
|
+
const {
|
|
84
|
+
setElement
|
|
85
|
+
} = this.eventManager;
|
|
86
|
+
setElement.bind(this.eventManager)(element);
|
|
87
|
+
this.eventManager.setElement(element);
|
|
88
|
+
this.props.getRef && this.props.getRef(element);
|
|
89
|
+
};
|
|
90
|
+
|
|
108
91
|
render() {
|
|
109
92
|
let View = this.View;
|
|
110
93
|
let {
|
|
@@ -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, { Children } from "react";
|
|
2
4
|
import ComponentRegistry from "./ComponentRegistry";
|
|
3
5
|
|
|
@@ -58,9 +60,9 @@ export function generateSlotChildren() {
|
|
|
58
60
|
}
|
|
59
61
|
|
|
60
62
|
if (View) {
|
|
61
|
-
slotChildren[name].push( /*#__PURE__*/React.createElement(View, {
|
|
63
|
+
slotChildren[name].push( /*#__PURE__*/React.createElement(View, _extends({}, finalisedProps, {
|
|
62
64
|
key: `${name}_${elementName}_${index}`
|
|
63
|
-
}, childProps.children));
|
|
65
|
+
}), childProps.children));
|
|
64
66
|
}
|
|
65
67
|
});
|
|
66
68
|
});
|
|
@@ -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
|
|
|
@@ -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
|
|
|
@@ -1,6 +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";
|
|
3
|
+
import { TextArea, TextBox, Email, PickList, Currency, MultiSelect, Url, Percentage, Phone, Number, Decimal, Date, DateTime, Checkbox, LookUp } from "../../../form-fields";
|
|
4
4
|
import Section from "../../../section/frameworks/ui/Section";
|
|
5
5
|
export function registerDefaultComponents() {
|
|
6
6
|
// Registering components in the ComponentRegistry
|
|
@@ -20,5 +20,6 @@ export function registerDefaultComponents() {
|
|
|
20
20
|
ComponentRegistry.register('Date', Date);
|
|
21
21
|
ComponentRegistry.register('DateTime', DateTime);
|
|
22
22
|
ComponentRegistry.register('Checkbox', Checkbox);
|
|
23
|
+
ComponentRegistry.register('LookUp', LookUp);
|
|
23
24
|
ComponentRegistry.register(DefaultFormSectionUIType, Section);
|
|
24
25
|
}
|
|
@@ -20,10 +20,12 @@ function FormView(_ref, ref) {
|
|
|
20
20
|
isFooterEnabled
|
|
21
21
|
} = state.viewModel;
|
|
22
22
|
return /*#__PURE__*/React.createElement(Flex, {
|
|
23
|
-
$ui_tagName: "form",
|
|
24
23
|
$ui_displayMode: "flex",
|
|
25
24
|
$ui_direction: "column",
|
|
26
25
|
$flag_fullsize: true,
|
|
26
|
+
$a11y_attributes: {
|
|
27
|
+
role: 'form'
|
|
28
|
+
},
|
|
27
29
|
ref: ref
|
|
28
30
|
}, /*#__PURE__*/React.createElement(Header, {
|
|
29
31
|
hasHeader: isHeaderEnabled,
|
|
@@ -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
|
});
|
package/es/library/dot/components/form/frameworks/ui/sub-components/SectionsWithRightPanelLayout.js
CHANGED
|
@@ -25,8 +25,7 @@ export default function SectionsWithRightPanelLayout(_ref) {
|
|
|
25
25
|
}, children), /*#__PURE__*/React.createElement(Flex, {
|
|
26
26
|
$flag_shrink: false,
|
|
27
27
|
$ui_className: style.rightPanel
|
|
28
|
-
}, /*#__PURE__*/React.createElement(RightPanelComponent,
|
|
29
|
-
})));
|
|
28
|
+
}, /*#__PURE__*/React.createElement(RightPanelComponent, properties)));
|
|
30
29
|
}
|
|
31
30
|
|
|
32
31
|
function updateRightPanelHeight(ref) {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export function TransformState(state) {
|
|
2
|
+
const {
|
|
3
|
+
tooltip
|
|
4
|
+
} = state.properties;
|
|
5
|
+
let actions = [];
|
|
6
|
+
|
|
7
|
+
if (tooltip) {
|
|
8
|
+
actions.push({
|
|
9
|
+
type: 'InfoIcon',
|
|
10
|
+
eventMappings: [],
|
|
11
|
+
properties: {
|
|
12
|
+
tooltip
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return { ...state,
|
|
18
|
+
viewModel: { ...state.properties,
|
|
19
|
+
actions
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -64,15 +64,13 @@ function CheckboxView(_ref2, ref) {
|
|
|
64
64
|
type: CheckboxConstants.CHECKBOX_TOGGLED
|
|
65
65
|
})
|
|
66
66
|
} : undefined
|
|
67
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
68
|
-
className: style.checkboxWrapper
|
|
69
67
|
}, /*#__PURE__*/React.createElement(Checkbox, {
|
|
70
68
|
id: id,
|
|
71
69
|
checked: value,
|
|
72
70
|
required: required,
|
|
73
71
|
disabled: disabled,
|
|
74
72
|
readonly: readonly
|
|
75
|
-
})
|
|
73
|
+
}), /*#__PURE__*/React.createElement(Label, {
|
|
76
74
|
for: id,
|
|
77
75
|
label: label,
|
|
78
76
|
actions: labelActions,
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
// import TransFormState from '../../adapters/presenter/TransFormState';
|
|
2
|
+
function isValidInteger() {
|
|
3
|
+
let value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
4
|
+
const rejexPattern = new RegExp('^(\\d+\\.?\\d*|\\.\\d+)$');
|
|
5
|
+
const isValidInt = rejexPattern.test(value);
|
|
6
|
+
return isValidInt;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function formatCurrency(amount) {
|
|
10
|
+
let symbol = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
11
|
+
let currencyLocale = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'US';
|
|
12
|
+
const isFormatNeeded = typeof amount === 'string' && amount.match(/(e|E)/) != null;
|
|
13
|
+
let number = isFormatNeeded ? Number(amount) : amount;
|
|
14
|
+
const isValidInt = isValidInteger(number);
|
|
15
|
+
|
|
16
|
+
if (isValidInt && symbol) {
|
|
17
|
+
number = number.toString();
|
|
18
|
+
const currencyArr = new Intl.NumberFormat(`en-${currencyLocale}`).formatToParts(number);
|
|
19
|
+
let currencyVal = '';
|
|
20
|
+
currencyArr.map(val => {
|
|
21
|
+
if (val.type == 'group') {
|
|
22
|
+
currencyVal += ',';
|
|
23
|
+
} else if (val.type == 'integer') {
|
|
24
|
+
currencyVal += val.value;
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
if (number.indexOf('.') != -1) {
|
|
29
|
+
const fractionVal = number.split(".")[1];
|
|
30
|
+
|
|
31
|
+
for (let i = fractionVal.length - 1; i >= 0; i--) {
|
|
32
|
+
if (fractionVal[i] != 0) {
|
|
33
|
+
currencyVal += `.${fractionVal.slice(0, i + 1)}`;
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return `${symbol}${currencyVal}`;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return number || amount;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function TransformState(state) {
|
|
46
|
+
const {
|
|
47
|
+
ePHI,
|
|
48
|
+
tooltip,
|
|
49
|
+
value,
|
|
50
|
+
currencySymbol,
|
|
51
|
+
currencyLocale
|
|
52
|
+
} = state.properties;
|
|
53
|
+
let actions = [];
|
|
54
|
+
|
|
55
|
+
if (tooltip) {
|
|
56
|
+
actions.push({
|
|
57
|
+
type: 'InfoIcon',
|
|
58
|
+
eventMappings: [],
|
|
59
|
+
properties: {
|
|
60
|
+
tooltip
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (ePHI) {
|
|
66
|
+
actions.push({
|
|
67
|
+
type: 'EPHITag',
|
|
68
|
+
properties: {},
|
|
69
|
+
eventMappings: []
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const formattedValue = formatCurrency(value, currencySymbol, currencyLocale);
|
|
74
|
+
return { ...state,
|
|
75
|
+
formattedValue,
|
|
76
|
+
properties: { ...state.properties,
|
|
77
|
+
actions,
|
|
78
|
+
value
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import TextBox from "../../../../../legacy-to-new-arch/textbox/frameworks/ui/TextBox";
|
|
3
|
-
import FieldItem from "../../../field/FieldItem";
|
|
3
|
+
import FieldItem from "../../../field/FieldItem";
|
|
4
|
+
import { formatCurrency } from "../../../../../../translator-common"; // @ts-ignore
|
|
4
5
|
|
|
5
6
|
import style from "../../../../form/frameworks/ui/css/Form.module.css";
|
|
6
7
|
|
|
@@ -8,6 +9,10 @@ function CurrencyView(_ref, ref) {
|
|
|
8
9
|
let {
|
|
9
10
|
state
|
|
10
11
|
} = _ref;
|
|
12
|
+
const {
|
|
13
|
+
isFocused,
|
|
14
|
+
properties
|
|
15
|
+
} = state;
|
|
11
16
|
const {
|
|
12
17
|
id,
|
|
13
18
|
label,
|
|
@@ -17,14 +22,21 @@ function CurrencyView(_ref, ref) {
|
|
|
17
22
|
disabled,
|
|
18
23
|
readonly,
|
|
19
24
|
required,
|
|
25
|
+
currencyLocale,
|
|
26
|
+
currencySymbol,
|
|
20
27
|
labelActions,
|
|
21
28
|
actions,
|
|
22
29
|
uiConfig
|
|
23
|
-
} =
|
|
30
|
+
} = properties;
|
|
24
31
|
const {
|
|
25
32
|
size,
|
|
26
33
|
breakRow
|
|
27
34
|
} = uiConfig;
|
|
35
|
+
const formattedValue = isFocused ? value : formatCurrency({
|
|
36
|
+
value,
|
|
37
|
+
symbol: currencySymbol,
|
|
38
|
+
locale: currencyLocale
|
|
39
|
+
});
|
|
28
40
|
return /*#__PURE__*/React.createElement(FieldItem, {
|
|
29
41
|
ref: ref,
|
|
30
42
|
id: id,
|
|
@@ -39,7 +51,7 @@ function CurrencyView(_ref, ref) {
|
|
|
39
51
|
className: style.field
|
|
40
52
|
}, /*#__PURE__*/React.createElement(TextBox, {
|
|
41
53
|
id: id,
|
|
42
|
-
value:
|
|
54
|
+
value: formattedValue,
|
|
43
55
|
placeholder: placeholder,
|
|
44
56
|
disabled: disabled,
|
|
45
57
|
readonly: readonly,
|
|
@@ -13,8 +13,12 @@ class EventHandlersFactory {
|
|
|
13
13
|
static handleTextBoxFocused(_ref) {
|
|
14
14
|
let {
|
|
15
15
|
state,
|
|
16
|
+
updateState,
|
|
16
17
|
dispatch
|
|
17
18
|
} = _ref;
|
|
19
|
+
updateState({ ...state,
|
|
20
|
+
isFocused: true
|
|
21
|
+
});
|
|
18
22
|
const {
|
|
19
23
|
name
|
|
20
24
|
} = state.properties;
|
|
@@ -30,8 +34,12 @@ class EventHandlersFactory {
|
|
|
30
34
|
static handleTextBoxBlurred(_ref2) {
|
|
31
35
|
let {
|
|
32
36
|
state,
|
|
37
|
+
updateState,
|
|
33
38
|
dispatch
|
|
34
39
|
} = _ref2;
|
|
40
|
+
updateState({ ...state,
|
|
41
|
+
isFocused: false
|
|
42
|
+
});
|
|
35
43
|
const {
|
|
36
44
|
name
|
|
37
45
|
} = state.properties;
|