@zohodesk/library-platform 1.1.1 → 1.1.2
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/list-selection/Properties.js +1 -1
- package/es/bc/local-storage/Constants.js +2 -1
- package/es/bc/local-storage/Event.js +21 -0
- package/es/bc/local-storage/Properties.js +1 -10
- package/es/bc/table-column-resizer/Constants.js +5 -5
- package/es/bc/table-column-resizer/Events.js +114 -0
- package/es/bc/table-column-resizer/Properties.js +27 -14
- package/es/bc/table-column-resizer/types/ResizerBehaviourState.js +1 -0
- package/es/bc/zform/Constants.js +1 -0
- package/es/bc/zform/EventHandlers.js +1 -0
- package/es/bc/zform/Events.js +6 -0
- package/es/bc/zform/Properties.js +87 -0
- package/es/bc/zform/Symbol.js +24 -0
- package/es/bc/zform/ZFormModeEnum.js +8 -0
- package/es/bc/zhttp/Properties.js +1 -1
- package/es/bc/zlist/Constants.js +1 -0
- package/es/bc/zlist/Properties.js +3 -0
- package/es/bc/zrecord/Actions.js +13 -1
- package/es/bc/zrecord/Constants.js +4 -1
- package/es/cc/action-icon/Properties.js +6 -46
- package/es/cc/checkbox/Constants.js +4 -0
- package/es/cc/checkbox/Properties.js +17 -0
- package/es/cc/component/Slot.js +1 -0
- package/es/cc/component/SlotComponent.js +1 -0
- package/es/cc/component/properties/slotName.js +1 -0
- package/es/cc/date/Constants.js +11 -0
- package/es/cc/date/Events.js +20 -0
- package/es/cc/date/Properties.js +74 -0
- package/es/cc/date/index.js +3 -0
- package/es/cc/ephi-tag/Properties.js +1 -0
- package/es/cc/ephi-tag/index.js +1 -0
- package/es/cc/fields/coloured-multi-select/Events.js +3 -0
- package/es/cc/fields/coloured-multi-select/Model.js +18 -0
- package/es/cc/fields/coloured-multi-select/Properties.js +37 -0
- package/es/cc/fields/coloured-pick-list/Events.js +3 -0
- package/es/cc/fields/coloured-pick-list/Model.js +16 -0
- package/es/cc/fields/coloured-pick-list/Properties.js +37 -0
- package/es/cc/fields/currency/Properties.js +26 -0
- package/es/cc/fields/decimal/Properties.js +19 -0
- package/es/cc/fields/email/Properties.js +10 -0
- package/es/cc/fields/field/Constants.js +7 -1
- package/es/cc/fields/field/Properties.js +64 -3
- package/es/cc/fields/field/Types.js +2 -0
- package/es/cc/fields/formula/Events.js +3 -0
- package/es/cc/fields/formula/Model.js +14 -0
- package/es/cc/fields/formula/Properties.js +3 -0
- package/es/cc/fields/index.js +3 -0
- package/es/cc/fields/multi-line/Properties.js +22 -19
- package/es/cc/fields/multi-select/Model.js +2 -0
- package/es/cc/fields/multi-select/Properties.js +4 -4
- package/es/cc/fields/number/Properties.js +19 -0
- package/es/cc/fields/percent/Properties.js +19 -0
- package/es/cc/fields/phone/Properties.js +19 -0
- package/es/cc/fields/pick-list/Model.js +1 -3
- package/es/cc/fields/pick-list/Properties.js +5 -4
- package/es/cc/fields/text/Properties.js +28 -0
- package/es/cc/fields/url/Properties.js +19 -0
- package/es/cc/form/Constants.js +11 -0
- package/es/cc/form/Events.js +53 -0
- package/es/cc/form/Properties.js +22 -0
- package/es/cc/form/index.js +0 -0
- package/es/cc/form-connected/Properties.js +1 -0
- package/es/cc/index.js +3 -0
- package/es/cc/info-icon/Properties.js +10 -0
- package/es/cc/info-icon/index.js +1 -0
- package/es/cc/label/Data.js +1 -0
- package/es/cc/label/Properties.js +36 -0
- package/es/cc/label/index.js +1 -0
- package/es/cc/multi-select/Constants.js +11 -0
- package/es/cc/multi-select/Events.js +23 -0
- package/es/cc/multi-select/Properties.js +85 -0
- package/es/cc/multi-select/index.js +3 -0
- package/es/cc/section/Constants.js +9 -0
- package/es/cc/section/Events.js +51 -0
- package/es/cc/section/Properties.js +86 -0
- package/es/cc/section/index.js +2 -0
- package/es/cc/select/Constants.js +13 -0
- package/es/cc/select/Events.js +20 -0
- package/es/cc/select/Properties.js +74 -0
- package/es/cc/select/index.js +3 -0
- package/es/cc/slot/Properties.js +24 -0
- package/es/cc/switch/{Actions.js → Events.js} +2 -2
- package/es/cc/switch/index.js +1 -1
- package/es/cc/table-column-filter/Constants.js +11 -0
- package/es/cc/table-column-filter/EventHandlers.js +1 -0
- package/es/cc/table-column-filter/Events.js +38 -0
- package/es/cc/table-column-filter/Model.js +28 -0
- package/es/cc/table-column-filter/Properties.js +146 -0
- package/es/cc/table-column-filter/index.js +5 -0
- package/es/cc/table-column-sort/Constants.js +1 -0
- package/es/cc/table-column-sort/Properties.js +30 -0
- package/es/cc/table-column-sort/index.js +3 -0
- package/es/cc/table-connected/Properties.js +12 -0
- package/es/cc/table-connected/constants/Events.js +2 -0
- package/es/cc/table-list/Constants.js +6 -0
- package/es/cc/table-list/Properties.js +82 -43
- package/es/cc/table-list/data-types/ResizerUiState.js +1 -0
- package/es/cc/table-list/model/TableModel.js +2 -2
- package/es/cc/textarea/Constants.js +11 -0
- package/es/cc/textarea/Events.js +20 -0
- package/es/cc/textarea/Properties.js +68 -0
- package/es/cc/textarea/index.js +3 -0
- package/es/cc/textbox/Constants.js +13 -0
- package/es/cc/textbox/Data.js +8 -0
- package/es/cc/textbox/Events.js +22 -0
- package/es/cc/textbox/Properties.js +83 -0
- package/es/cc/textbox/index.js +3 -0
- package/es/desk-frameworks/form-connected/frameworks/EventHandlersFactory.js +24 -0
- package/es/desk-frameworks/form-connected/frameworks/FormConnected.js +5 -0
- package/es/desk-frameworks/form-connected/frameworks/FormConnectedFactory.js +33 -0
- package/es/desk-frameworks/form-connected/frameworks/FormConnectedView.js +28 -0
- package/es/desk-frameworks/form-connected/frameworks/FormSdkFactory.js +35 -0
- package/es/desk-frameworks/index.js +2 -1
- package/es/desk-frameworks/table-connected/adapters/controllers/AbstractController.js +8 -0
- package/es/desk-frameworks/table-connected/adapters/controllers/ResizeByMouseController.js +20 -0
- package/es/desk-frameworks/table-connected/adapters/controllers/ResizeEndController.js +16 -0
- package/es/desk-frameworks/table-connected/adapters/controllers/ResizeFinishController.js +45 -0
- package/es/desk-frameworks/table-connected/adapters/controllers/ResizeStartController.js +33 -0
- package/es/desk-frameworks/table-connected/adapters/controllers/ScrollController.js +15 -0
- package/es/desk-frameworks/table-connected/frameworks/EventHandlersFactory.js +34 -5
- package/es/desk-frameworks/table-connected/frameworks/TableConnectedFactory.js +4 -2
- package/es/desk-frameworks/table-connected/frameworks/TableConnectedView.js +6 -0
- 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/list-selection/adapters/gateways/Repository.js +1 -1
- package/es/library/behaviours/list-selection/applications/usecases/Deselect.js +1 -1
- package/es/library/behaviours/list-selection/applications/usecases/ItemsSelection.js +1 -1
- package/es/library/behaviours/list-selection/domain/entities/ListItemSelection.js +2 -2
- package/es/library/behaviours/local-storage/adapters/controllers/AbstractController.js +7 -0
- package/es/library/behaviours/local-storage/adapters/controllers/SetDataController.js +22 -0
- package/es/library/behaviours/local-storage/adapters/gateways/LocalStorageRepository.js +26 -0
- package/es/library/behaviours/local-storage/adapters/gateways/Service.js +14 -0
- package/es/library/behaviours/local-storage/adapters/presenters/Presenter.js +38 -0
- package/es/library/behaviours/local-storage/applications/interfaces/InputDependencies.js +1 -0
- package/es/library/behaviours/local-storage/applications/interfaces/gateways/IRepository.js +1 -0
- package/es/library/behaviours/local-storage/applications/interfaces/gateways/IService.js +1 -0
- package/es/library/behaviours/local-storage/applications/interfaces/input/SetDataInput.js +1 -0
- package/es/library/behaviours/local-storage/applications/interfaces/input/StateStructure.js +1 -0
- package/es/library/behaviours/local-storage/applications/interfaces/output/BehaviourState.js +1 -0
- package/es/library/behaviours/local-storage/applications/interfaces/output/IPresenter.js +0 -0
- package/es/library/behaviours/local-storage/applications/usecases/AbstractUseCase.js +17 -0
- package/es/library/behaviours/local-storage/applications/usecases/SetDataUseCase.js +17 -0
- package/es/library/behaviours/local-storage/domain/entities/Storage.js +28 -0
- package/es/library/behaviours/local-storage/domain/entities/interfaces/IStorage.js +1 -0
- package/es/library/behaviours/local-storage/frameworks/LocalStorageBehaviourFactory.js +28 -0
- package/es/library/behaviours/table-column-resizer/Readme.md +141 -0
- package/es/library/behaviours/table-column-resizer/ReadmeActionAsEvent.md +141 -0
- package/es/library/behaviours/table-column-resizer/adapters/controllers/AbstractController.js +7 -0
- package/es/library/behaviours/table-column-resizer/adapters/controllers/ResizeByMouseController.js +21 -0
- package/es/library/behaviours/table-column-resizer/adapters/controllers/ResizeByScrollController.js +18 -0
- package/es/library/behaviours/table-column-resizer/adapters/controllers/ResizeEndController.js +21 -0
- package/es/library/behaviours/table-column-resizer/adapters/controllers/ResizeStartController.js +32 -0
- package/es/library/behaviours/table-column-resizer/adapters/controllers/interfaces/ActionHandlerParams.js +1 -0
- package/es/library/behaviours/table-column-resizer/adapters/controllers/interfaces/IController.js +1 -0
- package/es/library/behaviours/table-column-resizer/adapters/controllers/interfaces/ResizeByMouseActionHandlerParams.js +1 -0
- package/es/library/behaviours/table-column-resizer/adapters/controllers/interfaces/ResizeByScrollActionHandlerParams.js +1 -0
- package/es/library/behaviours/table-column-resizer/adapters/controllers/interfaces/ResizeEndActionHandlerParams.js +1 -0
- package/es/library/behaviours/table-column-resizer/adapters/controllers/interfaces/ResizeStartActionHandlerParams.js +1 -0
- package/es/library/behaviours/table-column-resizer/adapters/gateways/Repository.js +32 -0
- package/es/library/behaviours/table-column-resizer/adapters/gateways/Service.js +23 -0
- package/es/library/behaviours/table-column-resizer/adapters/gateways/TableElementService.js +36 -0
- package/es/library/behaviours/table-column-resizer/adapters/presenters/AutoScroll.js +50 -0
- package/es/library/behaviours/table-column-resizer/adapters/presenters/Presenter.js +53 -0
- package/es/library/behaviours/table-column-resizer/applications/interfaces/InputDependencies.js +1 -0
- package/es/library/behaviours/table-column-resizer/applications/interfaces/gateways/IRepo.js +1 -0
- package/es/library/behaviours/table-column-resizer/applications/interfaces/gateways/IService.js +1 -0
- package/es/library/behaviours/table-column-resizer/applications/interfaces/gateways/ITableElementService.js +1 -0
- package/es/library/behaviours/table-column-resizer/applications/interfaces/input/ResizeByMouseInputModel.js +1 -0
- package/es/library/behaviours/table-column-resizer/applications/interfaces/input/ResizeByScrollInputModel.js +1 -0
- package/es/library/behaviours/table-column-resizer/applications/interfaces/input/ResizeEndInputModel.js +1 -0
- package/es/library/behaviours/table-column-resizer/applications/interfaces/input/ResizeStartInputModel.js +1 -0
- package/es/library/behaviours/table-column-resizer/applications/interfaces/input/StateStructure.js +1 -0
- package/es/library/behaviours/table-column-resizer/applications/interfaces/output/BehaviourState.js +1 -0
- package/es/library/behaviours/table-column-resizer/applications/interfaces/output/IPresenter.js +1 -0
- package/es/library/behaviours/table-column-resizer/applications/usecases/AbstractUsecase.js +20 -0
- package/es/library/behaviours/table-column-resizer/applications/usecases/ResizeByMouseUsecase.js +30 -0
- package/es/library/behaviours/table-column-resizer/applications/usecases/ResizeByScrollUsecase.js +27 -0
- package/es/library/behaviours/table-column-resizer/applications/usecases/ResizeEndUsecase.js +33 -0
- package/es/library/behaviours/table-column-resizer/applications/usecases/ResizeStartUsecase.js +39 -0
- package/es/library/behaviours/table-column-resizer/domain/entities/ColumnResizer.js +125 -0
- package/es/library/behaviours/table-column-resizer/domain/entities/Constants.js +3 -0
- package/es/library/behaviours/table-column-resizer/domain/entities/MinMaxLimiter.js +11 -0
- package/es/library/behaviours/table-column-resizer/domain/entities/Mouse.js +16 -0
- package/es/library/behaviours/table-column-resizer/domain/entities/ResizeColumnCalculator.js +84 -0
- package/es/library/behaviours/table-column-resizer/domain/entities/ResizerAutoScrollCalculator.js +44 -0
- package/es/library/behaviours/table-column-resizer/domain/entities/ResizingColumn.js +83 -0
- package/es/library/behaviours/table-column-resizer/domain/entities/Table.js +68 -0
- package/es/library/behaviours/table-column-resizer/domain/entities/interfaces/ColumnResizerRestoreModel.js +1 -0
- package/es/library/behaviours/table-column-resizer/domain/entities/interfaces/ElementResizeInfo.js +1 -0
- package/es/library/behaviours/table-column-resizer/domain/entities/interfaces/IColumnResizer.js +1 -0
- package/es/library/behaviours/table-column-resizer/domain/entities/interfaces/ResizeColumnCalculatorRestoreModel.js +1 -0
- package/es/library/behaviours/table-column-resizer/domain/entities/interfaces/ResizerEndResult.js +1 -0
- package/es/library/behaviours/table-column-resizer/domain/entities/interfaces/ResizingColumnRestoreModel.js +1 -0
- package/es/library/behaviours/table-column-resizer/frameworks/TableColumnResizerBehaviorFactory.js +38 -0
- package/es/library/custom-component/applications/entities-factory/BehavioursFactory.js +2 -1
- package/es/library/custom-component/applications/entities-factory/PropertiesFactory.js +1 -0
- package/es/library/custom-component/applications/usecases/UpdatePropertyUseCase.js +1 -1
- package/es/library/custom-component/applications/usecases/UpdateStateUseCase.js +5 -2
- package/es/library/custom-component/domain/entities/Behaviour.js +2 -2
- package/es/library/custom-component/domain/entities/Component.js +25 -19
- package/es/library/custom-component/domain/entities/DefaultSlotNameAppend.js +10 -0
- package/es/library/custom-component/domain/entities/Properties.js +10 -3
- package/es/library/custom-component/domain/entities/Property.js +2 -0
- package/es/library/custom-component/frameworks/json-schema-validator/Validator.js +19 -3
- package/es/library/custom-component/frameworks/ui/Compare.js +25 -0
- package/es/library/custom-component/frameworks/ui/CreateCustomComponent.js +37 -6
- package/es/library/custom-component/frameworks/ui/CreateSlotComponent.js +89 -0
- package/es/library/custom-component/frameworks/ui/__testcases__/CreateCustomComponent.spec.js +17 -10
- package/es/library/custom-component/frameworks/ui/__testcases__/CreateSlotComponent.spec.js +211 -0
- package/es/library/dot/components/action-location/frameworks/ui/ActionComponentMapping.js +6 -4
- package/es/library/dot/components/form/adapters/presenter/TransformState.js +57 -0
- package/es/library/dot/components/form/frameworks/ui/EventHandlerFactory.js +54 -0
- package/es/library/dot/components/form/frameworks/ui/Form.js +14 -0
- package/es/library/dot/components/form/frameworks/ui/FormView.js +43 -0
- package/es/library/dot/components/form/frameworks/ui/__test__/Form.test.js +146 -0
- package/es/library/dot/components/form/frameworks/ui/css/Form.module.css +29 -0
- package/es/library/dot/components/form/frameworks/ui/sub-components/Sections.js +32 -0
- package/es/library/dot/components/form-fields/checkbox/adapters/presenter/TransformState.js +22 -0
- package/es/library/dot/components/form-fields/checkbox/frameworks/ui/Checkbox.js +14 -0
- package/es/library/dot/components/form-fields/checkbox/frameworks/ui/CheckboxView.js +78 -0
- package/es/library/dot/components/form-fields/checkbox/frameworks/ui/EventHandlerFactory.js +68 -0
- package/es/library/dot/components/form-fields/checkbox/frameworks/ui/__test__/Checkbox.test.js +78 -0
- package/es/library/dot/components/form-fields/currency/adapters/presenter/TransformState.js +81 -0
- package/es/library/dot/components/form-fields/currency/frameworks/ui/Currency.js +14 -0
- package/es/library/dot/components/form-fields/currency/frameworks/ui/CurrencyView.js +47 -0
- package/es/library/dot/components/form-fields/currency/frameworks/ui/EventHandlerFactory.js +70 -0
- package/es/library/dot/components/form-fields/currency/frameworks/ui/__test__/Currency.test.js +40 -0
- package/es/library/dot/components/form-fields/date/adapters/presenter/TransformState.js +22 -0
- package/es/library/dot/components/form-fields/date/frameworks/ui/Date.js +14 -0
- package/es/library/dot/components/form-fields/date/frameworks/ui/DateView.js +45 -0
- package/es/library/dot/components/form-fields/date/frameworks/ui/EventHandlerFactory.js +70 -0
- package/es/library/dot/components/form-fields/date/frameworks/ui/__test__/Date.test.js +32 -0
- package/es/library/dot/components/form-fields/datetime/adapters/presenter/TransformState.js +22 -0
- package/es/library/dot/components/form-fields/datetime/frameworks/ui/DateTime.js +14 -0
- package/es/library/dot/components/form-fields/datetime/frameworks/ui/DateTimeView.js +46 -0
- package/es/library/dot/components/form-fields/datetime/frameworks/ui/EventHandlerFactory.js +70 -0
- package/es/library/dot/components/form-fields/datetime/frameworks/ui/__test__/DateTime.test.js +32 -0
- package/es/library/dot/components/form-fields/decimal/adapters/presenter/TransformState.js +31 -0
- package/es/library/dot/components/form-fields/decimal/frameworks/ui/Decimal.js +14 -0
- package/es/library/dot/components/form-fields/decimal/frameworks/ui/DecimalView.js +47 -0
- package/es/library/dot/components/form-fields/decimal/frameworks/ui/EventHandlerFactory.js +70 -0
- package/es/library/dot/components/form-fields/decimal/frameworks/ui/__test__/Decimal.test.js +43 -0
- package/es/library/dot/components/form-fields/email/adapters/presenter/TransformState.js +23 -0
- package/es/library/dot/components/form-fields/email/frameworks/ui/Email.js +14 -0
- package/es/library/dot/components/form-fields/email/frameworks/ui/EmailView.js +47 -0
- package/es/library/dot/components/form-fields/email/frameworks/ui/EventHandlerFactory.js +70 -0
- package/es/library/dot/components/form-fields/email/frameworks/ui/__test__/Email.test.js +40 -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 +163 -0
- package/es/library/dot/components/form-fields/index.js +15 -0
- 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/multi-select/adapters/presenter/TransformState.js +31 -0
- package/es/library/dot/components/form-fields/multi-select/frameworks/ui/EventHandlerFactory.js +70 -0
- package/es/library/dot/components/form-fields/multi-select/frameworks/ui/MultiSelect.js +14 -0
- package/es/library/dot/components/form-fields/multi-select/frameworks/ui/MultiSelectView.js +59 -0
- package/es/library/dot/components/form-fields/multi-select/frameworks/ui/__test__/MultiSelect.test.js +74 -0
- package/es/library/dot/components/form-fields/number/adapters/presenter/TransformState.js +31 -0
- package/es/library/dot/components/form-fields/number/frameworks/ui/EventHandlerFactory.js +70 -0
- package/es/library/dot/components/form-fields/number/frameworks/ui/Number.js +14 -0
- package/es/library/dot/components/form-fields/number/frameworks/ui/NumberView.js +47 -0
- package/es/library/dot/components/form-fields/number/frameworks/ui/__test__/Number.test.js +43 -0
- package/es/library/dot/components/form-fields/percentage/adapters/presenter/TransformState.js +31 -0
- package/es/library/dot/components/form-fields/percentage/frameworks/ui/EventHandlerFactory.js +70 -0
- package/es/library/dot/components/form-fields/percentage/frameworks/ui/Percentage.js +14 -0
- package/es/library/dot/components/form-fields/percentage/frameworks/ui/PercentageView.js +47 -0
- package/es/library/dot/components/form-fields/percentage/frameworks/ui/__test__/Percentage.test.js +43 -0
- package/es/library/dot/components/form-fields/phone/adapters/presenter/TransformState.js +31 -0
- package/es/library/dot/components/form-fields/phone/frameworks/ui/EventHandlerFactory.js +70 -0
- package/es/library/dot/components/form-fields/phone/frameworks/ui/Phone.js +14 -0
- package/es/library/dot/components/form-fields/phone/frameworks/ui/PhoneView.js +47 -0
- package/es/library/dot/components/form-fields/phone/frameworks/ui/__test__/Phone.test.js +43 -0
- package/es/library/dot/components/form-fields/pick-list/adapters/presenter/TransformState.js +23 -0
- package/es/library/dot/components/form-fields/pick-list/frameworks/ui/EventHandlerFactory.js +70 -0
- package/es/library/dot/components/form-fields/pick-list/frameworks/ui/PickList.js +14 -0
- package/es/library/dot/components/form-fields/pick-list/frameworks/ui/PickListView.js +59 -0
- package/es/library/dot/components/form-fields/pick-list/frameworks/ui/__test__/PickList.test.js +72 -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/EventHandlerFactory.js +70 -0
- package/es/library/dot/components/form-fields/textarea/frameworks/ui/TextArea.js +14 -0
- package/es/library/dot/components/form-fields/textarea/frameworks/ui/TextAreaView.js +47 -0
- package/es/library/dot/components/form-fields/textarea/frameworks/ui/__test__/TextArea.test.js +59 -0
- package/es/library/dot/components/form-fields/textbox/adapters/presenter/TransformState.js +32 -0
- package/es/library/dot/components/form-fields/textbox/frameworks/ui/EventHandlerFactory.js +70 -0
- package/es/library/dot/components/form-fields/textbox/frameworks/ui/TextBox.js +14 -0
- package/es/library/dot/components/form-fields/textbox/frameworks/ui/TextBoxView.js +47 -0
- package/es/library/dot/components/form-fields/textbox/frameworks/ui/__test__/TextBox.test.js +85 -0
- package/es/library/dot/components/form-fields/url/adapters/presenter/TransformState.js +31 -0
- package/es/library/dot/components/form-fields/url/frameworks/ui/EventHandlerFactory.js +70 -0
- package/es/library/dot/components/form-fields/url/frameworks/ui/Url.js +14 -0
- package/es/library/dot/components/form-fields/url/frameworks/ui/UrlView.js +47 -0
- package/es/library/dot/components/form-fields/url/frameworks/ui/__test__/Url.test.js +43 -0
- package/es/library/dot/components/section/adapters/presenter/TransFormState.js +26 -0
- package/es/library/dot/components/section/frameworks/ui/EventHandlerFactory.js +60 -0
- package/es/library/dot/components/section/frameworks/ui/Section.js +15 -0
- package/es/library/dot/components/section/frameworks/ui/SectionView.js +51 -0
- package/es/library/dot/components/section/frameworks/ui/__test__/Section.test.js +76 -0
- package/es/library/dot/components/table-list/adapters/presenters/TableTranslator.js +5 -10
- package/es/library/dot/components/table-list/frameworks/hooks/useLatestCallBack.js +9 -0
- package/es/library/dot/components/table-list/frameworks/hooks/useMouseResizable.js +49 -0
- package/es/library/dot/components/table-list/frameworks/ui/EventHandlersFactory.js +1 -3
- package/es/library/dot/components/table-list/frameworks/ui/TableList.js +1 -15
- package/es/library/dot/components/table-list/frameworks/ui/TableListView.js +8 -9
- package/es/library/dot/components/table-list/frameworks/ui/css/TableList.module.css +3 -0
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/ErrorState.js +28 -0
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/Header.js +11 -4
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/ColumnResizer.js +43 -1
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/HeaderData.js +8 -12
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/Headers.js +1 -3
- package/es/library/dot/legacy-to-new-arch/action-icon/frameworks/ui/ActionIcon.js +4 -20
- package/es/library/dot/legacy-to-new-arch/action-icon/frameworks/ui/ActionIconView.js +4 -84
- package/es/library/dot/legacy-to-new-arch/checkbox/frameworks/ui/Checkbox.js +3 -3
- package/es/library/dot/legacy-to-new-arch/checkbox/frameworks/ui/CheckboxView.js +12 -1
- package/es/library/dot/legacy-to-new-arch/date/frameworks/ui/Date.js +12 -0
- package/es/library/dot/legacy-to-new-arch/date/frameworks/ui/DateView.js +56 -0
- package/es/library/dot/legacy-to-new-arch/label/frameworks/ui/Label.js +10 -0
- package/es/library/dot/legacy-to-new-arch/label/frameworks/ui/LabelView.js +31 -0
- package/es/library/dot/legacy-to-new-arch/label/frameworks/ui/css/Label.module.css +21 -0
- package/es/library/dot/legacy-to-new-arch/label/frameworks/ui/sub-components/ui/LabelAction.js +9 -0
- package/es/library/dot/legacy-to-new-arch/label/frameworks/ui/sub-components/ui/LabelActionView.js +38 -0
- package/es/library/dot/legacy-to-new-arch/label/frameworks/ui/sub-components/ui/css/LabelAction.module.css +4 -0
- package/es/library/dot/legacy-to-new-arch/multi-select/frameworks/ui/MultiSelect.js +11 -0
- package/es/library/dot/legacy-to-new-arch/multi-select/frameworks/ui/MultiSelectView.js +55 -0
- package/es/library/dot/legacy-to-new-arch/select/frameworks/ui/Select.js +12 -0
- package/es/library/dot/legacy-to-new-arch/select/frameworks/ui/SelectView.js +59 -0
- package/es/library/dot/legacy-to-new-arch/table-column-filter/frameworks/ui/TableColumnFilter.js +12 -0
- package/es/library/dot/legacy-to-new-arch/table-column-filter/frameworks/ui/TableColumnFilterView.js +101 -0
- package/es/library/dot/legacy-to-new-arch/table-column-filter/frameworks/ui/css/TableColumnFilter.module.css +15 -0
- package/es/library/dot/legacy-to-new-arch/table-column-sort/frameworks/ui/TableColumnSort.js +11 -0
- package/es/library/dot/legacy-to-new-arch/table-column-sort/frameworks/ui/TableColumnSortView.js +51 -0
- package/es/library/dot/legacy-to-new-arch/table-column-sort/frameworks/ui/css/TableColumnSort.module.css +15 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/coloured-multiselect-field/frameworks/ui/ColouredMultiSelectField.js +12 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/coloured-multiselect-field/frameworks/ui/ColouredMultiSelectFieldView.js +23 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/coloured-picklist-field/frameworks/ui/ColouredPickListField.js +14 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/coloured-picklist-field/frameworks/ui/ColouredPickListFieldView.js +33 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/index.js +4 -0
- package/es/library/dot/legacy-to-new-arch/text-area/frameworks/ui/TextArea.js +11 -0
- package/es/library/dot/legacy-to-new-arch/text-area/frameworks/ui/TextAreaView.js +52 -0
- package/es/library/dot/legacy-to-new-arch/textbox/frameworks/ui/TextBox.js +12 -0
- package/es/library/dot/legacy-to-new-arch/textbox/frameworks/ui/TextBoxView.js +55 -0
- package/es/library/index.js +6 -1
- package/es/library/slot/frameworks/ui/ConvertSlotToComponent.js +23 -0
- package/es/library/slot/index.js +1 -0
- package/es/library/translator-common/adapters/presenter/TransFormState.js +6 -0
- package/es/library/translator-common/index.js +1 -0
- package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActionsRenderer.module.css +2 -2
- package/es/platform/data-source/http-template/createRecord.js +27 -0
- package/es/platform/data-source/http-template/fetchDependencyMappings.js +18 -0
- package/es/platform/data-source/http-template/fetchLayoutRules.js +29 -0
- package/es/platform/data-source/http-template/fetchMyForm.js +19 -0
- package/es/platform/data-source/http-template/fetchMyFormLayout.js +43 -0
- package/es/platform/data-source/http-template/fetchValidationRules.js +29 -0
- package/es/platform/data-source/http-template/getAvailableFields.js +63 -0
- package/es/platform/data-source/http-template/getClientActions.js +1 -1
- package/es/platform/data-source/index.js +13 -1
- package/es/platform/zdata-source/domain/entities/APITemplate.js +3 -2
- package/es/platform/zform/adapters/controllers/AbstractController.js +10 -0
- package/es/platform/zform/adapters/controllers/DependenciesController.js +23 -0
- package/es/platform/zform/adapters/controllers/DependenciesRequestController.js +20 -0
- package/es/platform/zform/adapters/controllers/FieldValueChangeController.js +23 -0
- package/es/platform/zform/adapters/controllers/FormSubmitController.js +22 -0
- package/es/platform/zform/adapters/controllers/IntializeController.js +28 -0
- package/es/platform/zform/adapters/controllers/LayoutRulesRequestController.js +20 -0
- package/es/platform/zform/adapters/controllers/LayoutRulesSuccessController.js +22 -0
- package/es/platform/zform/adapters/controllers/MyFormRequestController.js +20 -0
- package/es/platform/zform/adapters/controllers/MyFromSuccessController.js +23 -0
- package/es/platform/zform/adapters/controllers/MyLayoutSuccessController.js +29 -0
- package/es/platform/zform/adapters/controllers/SetFieldErrorMessageController.js +22 -0
- package/es/platform/zform/adapters/controllers/ValidateErrorMessageController.js +22 -0
- package/es/platform/zform/adapters/controllers/ValidateFieldRequestController.js +23 -0
- package/es/platform/zform/adapters/controllers/ValidationRulesRequestController.js +20 -0
- package/es/platform/zform/adapters/controllers/ValidationRulesSuccessController.js +23 -0
- package/es/platform/zform/adapters/gateway/FormRepository.js +79 -0
- package/es/platform/zform/adapters/gateway/Service.js +68 -0
- package/es/platform/zform/adapters/presenter/FormPresenter.js +24 -0
- package/es/platform/zform/adapters/presenter/FormTranslator.js +185 -0
- package/es/platform/zform/applications/interfaces/UsecaseDependencies.js +1 -0
- package/es/platform/zform/applications/interfaces/gateways/ILayoutRuleApplier.js +0 -0
- package/es/platform/zform/applications/interfaces/gateways/IRepository.js +1 -0
- package/es/platform/zform/applications/interfaces/gateways/IService.js +1 -0
- package/es/platform/zform/applications/interfaces/gateways/IValidator.js +0 -0
- package/es/platform/zform/applications/interfaces/input/Actions.js +0 -0
- package/es/platform/zform/applications/interfaces/input/Condition.js +0 -0
- package/es/platform/zform/applications/interfaces/input/DependenciesSuccessUseCaseInputModel.js +0 -0
- package/es/platform/zform/applications/interfaces/input/FieldCondition.js +0 -0
- package/es/platform/zform/applications/interfaces/input/FieldValueChangeRequestInputModel.js +1 -0
- package/es/platform/zform/applications/interfaces/input/InitializeInputModel.js +1 -0
- package/es/platform/zform/applications/interfaces/input/LayoutRulesSuccessUseCaseInputModel.js +0 -0
- package/es/platform/zform/applications/interfaces/input/MyFormSuccessUseCaseInputModel.js +1 -0
- package/es/platform/zform/applications/interfaces/input/MyLayoutSuccessUseCaseInputModel.js +1 -0
- package/es/platform/zform/applications/interfaces/input/SetFieldErrorMessageInputModel.js +1 -0
- package/es/platform/zform/applications/interfaces/input/ValidateErrorMessageInputModel.js +1 -0
- package/es/platform/zform/applications/interfaces/input/ValidateFieldRequestInputModel.js +1 -0
- package/es/platform/zform/applications/interfaces/input/ValidationRulesSuccessInputModel.js +1 -0
- package/es/platform/zform/applications/interfaces/input/ZFormInputModel.js +1 -0
- package/es/platform/zform/applications/interfaces/output/IPresenter.js +0 -0
- package/es/platform/zform/applications/interfaces/output/ZFormOutputModel.js +1 -0
- package/es/platform/zform/applications/usecases/AbstractUseCase.js +18 -0
- package/es/platform/zform/applications/usecases/DependenciesRequestUseCase.js +13 -0
- package/es/platform/zform/applications/usecases/DependenciesSuccessUseCase.js +21 -0
- package/es/platform/zform/applications/usecases/FieldValueChangeRequestUseCase.js +36 -0
- package/es/platform/zform/applications/usecases/FormSubmitUseCase.js +55 -0
- package/es/platform/zform/applications/usecases/InitializeUseCase.js +43 -0
- package/es/platform/zform/applications/usecases/LayoutRulesRequestUseCase.js +13 -0
- package/es/platform/zform/applications/usecases/LayoutRulesSuccessUseCase.js +32 -0
- package/es/platform/zform/applications/usecases/MyFormRequestUseCase.js +13 -0
- package/es/platform/zform/applications/usecases/MyFormSuccessUseCase.js +52 -0
- package/es/platform/zform/applications/usecases/MyLayoutSuccessUseCase.js +136 -0
- package/es/platform/zform/applications/usecases/SetFieldErrorMessageUseCase.js +17 -0
- package/es/platform/zform/applications/usecases/ValidateErrorMessageUseCase.js +33 -0
- package/es/platform/zform/applications/usecases/ValidateFieldRequestUseCase.js +56 -0
- package/es/platform/zform/applications/usecases/ValidationRulesRequestUseCase.js +13 -0
- package/es/platform/zform/applications/usecases/ValidationRulesSuccessUseCase.js +20 -0
- package/es/platform/zform/domain/ZDependencyMapping.js +62 -0
- package/es/platform/zform/domain/ZField.js +170 -0
- package/es/platform/zform/domain/ZForm.js +478 -0
- package/es/platform/zform/domain/ZLayout.js +25 -0
- package/es/platform/zform/domain/ZLayoutRule.js +86 -0
- package/es/platform/zform/domain/ZSection.js +113 -0
- package/es/platform/zform/domain/ZValidationRule.js +79 -0
- package/es/platform/zform/domain/interfaces/FieldCondition.js +1 -0
- package/es/platform/zform/domain/interfaces/IDependencyMapping.js +0 -0
- package/es/platform/zform/domain/interfaces/ILayout.js +0 -0
- package/es/platform/zform/domain/interfaces/ILayoutRuleHelper.js +1 -0
- package/es/platform/zform/domain/interfaces/IValidationRule.js +0 -0
- package/es/platform/zform/domain/interfaces/IValidationRuleHelper.js +1 -0
- package/es/platform/zform/domain/interfaces/IZField.js +0 -0
- package/es/platform/zform/domain/interfaces/IZForm.js +1 -0
- package/es/platform/zform/domain/interfaces/IZLayoutRule.js +0 -0
- package/es/platform/zform/domain/interfaces/IZSection.js +0 -0
- package/es/platform/zform/domain/interfaces/ZLayoutRuleData.js +1 -0
- package/es/platform/zform/domain/interfaces/ZValidationRuleData.js +1 -0
- package/es/platform/zform/frameworks/layout-rules/LayoutRuleApplier.js +64 -0
- package/es/platform/zform/frameworks/layout-rules/applyFieldLayoutRules.js +29 -0
- package/es/platform/zform/frameworks/layout-rules/applySectionLayoutRules.js +28 -0
- package/es/platform/zform/frameworks/layout-rules/calculateLayoutRulesResult.js +228 -0
- package/es/platform/zform/frameworks/layout-rules/constructFieldIdAndSectionIdMap.js +10 -0
- package/es/platform/zform/frameworks/layout-rules/expressionEval.js +130 -0
- package/es/platform/zform/frameworks/layout-rules/getLayoutRuleAppliedFieldProperties.js +60 -0
- package/es/platform/zform/frameworks/layout-rules/getLayoutRuleAppliedSectionProperties.js +35 -0
- package/es/platform/zform/frameworks/layout-rules/runSingleFieldCondition.js +60 -0
- package/es/platform/zform/frameworks/layout-rules/selectors.js +9 -0
- package/es/platform/zform/frameworks/layout-rules/validationTypeMapper.js +20 -0
- package/es/platform/zform/frameworks/layout-rules/validator.js +331 -0
- package/es/platform/zform/frameworks/ui/EventHandlerFactory.js +226 -0
- package/es/platform/zform/frameworks/ui/ZFormBehaviourFactory.js +31 -0
- package/es/platform/zform/frameworks/validation-rules/Validator.js +44 -0
- package/es/platform/zform/frameworks/validation-rules/expressionEval.js +123 -0
- package/es/platform/zform/frameworks/validation-rules/utils.js +552 -0
- package/es/platform/zform/frameworks/validation-rules/validationRules.js +126 -0
- package/es/platform/zhttp/applications/usecases/FetchUseCase.js +1 -1
- package/es/platform/zlist/adapters/controllers/RecordSuccessCallbackController.js +28 -0
- package/es/platform/zlist/adapters/controllers/SortController.js +1 -3
- package/es/platform/zlist/adapters/gateways/Repository.js +12 -2
- package/es/platform/zlist/adapters/gateways/Service.js +4 -0
- package/es/platform/zlist/adapters/presenters/Presenters.js +26 -0
- package/es/platform/zlist/adapters/presenters/TableTranslator.js +38 -3
- package/es/platform/zlist/adapters/presenters/translators/ColumnTranslator.js +3 -1
- package/es/platform/zlist/adapters/presenters/translators/Header.js +30 -5
- package/es/platform/zlist/adapters/presenters/translators/HeadersTranslator.js +4 -2
- package/es/platform/zlist/adapters/presenters/translators/ResizerStateTranslator.js +98 -0
- package/es/platform/zlist/adapters/presenters/translators/fields/FormulaFieldTranslator.js +26 -0
- package/es/platform/zlist/adapters/presenters/translators/fields/MultiSelectFieldTranslator.js +28 -8
- package/es/platform/zlist/adapters/presenters/translators/fields/PickListFieldTranslator.js +28 -2
- package/es/platform/zlist/adapters/presenters/translators/fields/index.js +2 -1
- package/es/platform/zlist/adapters/presenters/translators/interfaces/ModifiedFieldWidths.js +1 -0
- package/es/platform/zlist/adapters/presenters/translators/interfaces/PreferencesProperties.js +1 -0
- package/es/platform/zlist/adapters/presenters/utils/DefaultClientActions.js +54 -0
- package/es/platform/zlist/adapters/presenters/utils/calculateFieldWidths.js +34 -0
- package/es/platform/zlist/applications/interfaces/output/IPresenter.js +1 -0
- package/es/platform/zlist/applications/usecases/AbstractUseCase.js +4 -2
- package/es/platform/zlist/applications/usecases/RecordSuccessCallbackUsecase.js +24 -0
- package/es/platform/zlist/applications/usecases/SortUseCase.js +9 -3
- package/es/platform/zlist/domain/entities/List.js +32 -8
- package/es/platform/zlist/domain/entities/SortBy.js +58 -0
- package/es/platform/zlist/domain/entities/interfaces/ISortBy.js +1 -0
- package/es/platform/zlist/domain/entities/interfaces/ListModel.js +1 -0
- package/es/platform/zlist/domain/entities/interfaces/Properties.js +6 -1
- package/es/platform/zlist/frameworks/EventHandlersFactory.js +9 -4
- package/es/platform/zlist/frameworks/ZListBehaviourFactory.js +7 -1
- package/es/platform/zrecord/adapters/controllers/ActionExecutorController.js +2 -1
- package/es/platform/zrecord/adapters/controllers/CreateRecordController.js +28 -0
- package/es/platform/zrecord/adapters/controllers/RefetchController.js +2 -1
- package/es/platform/zrecord/adapters/gateways/Service.js +4 -0
- package/es/platform/zrecord/applications/interfaces/input/CreateRecordInputModel.js +1 -0
- package/es/platform/zrecord/applications/usecases/CreateRecordUseCase.js +28 -0
- package/es/platform/zrecord/applications/usecases/ExecuteActionUseCase.js +3 -2
- package/es/platform/zrecord/applications/usecases/RefetchUseCase.js +3 -2
- package/es/platform/zrecord/domain/entities/RecordsManager.js +33 -2
- package/es/platform/zrecord/frameworks/ActionsHandlersFactory.js +5 -2
- package/package.json +27 -15
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/HeaderText.js +0 -34
- package/es/library/dot/legacy-to-new-arch/action-icon/frameworks/ui/css/ActionIcon.module.css +0 -3
- /package/es/bc/local-storage/{ActionHandlers.js → EventHandlers.js} +0 -0
- /package/es/bc/table-column-resizer/{ActionHandlers.js → EventHandlers.js} +0 -0
- /package/es/{cc/table-list/data-types/ResizerConfig.js → bc/table-column-resizer/types/ResizeConfig.js} +0 -0
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
/** Libraries * */
|
|
2
|
+
// import { i18NProviderUtils } from '@zohodesk/i18n';
|
|
3
|
+
const i18NProviderUtils = {
|
|
4
|
+
getI18NValue(key, values) {
|
|
5
|
+
return key;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
};
|
|
9
|
+
/** Methods * */
|
|
10
|
+
|
|
11
|
+
const formatWebsiteUrl = url => {
|
|
12
|
+
const whitelistedDomains = ['htt' + 'p://', 'htt' + 'ps://', 'ftp://', 'simplehelp://', 'dynamicsnav://'];
|
|
13
|
+
const site = url.toLowerCase();
|
|
14
|
+
const isValidWebsite = whitelistedDomains.some(domain => site.startsWith(domain));
|
|
15
|
+
|
|
16
|
+
if (!isValidWebsite) {
|
|
17
|
+
return `htt${''}p://${url}`;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return url;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
function getNoneText() {
|
|
24
|
+
const valueNoneText = '-None-';
|
|
25
|
+
return {
|
|
26
|
+
valueNoneText
|
|
27
|
+
};
|
|
28
|
+
} // let ticketFieldTypes = [
|
|
29
|
+
// 'LookUp String',
|
|
30
|
+
// 'Picklist String',
|
|
31
|
+
// 'Multiselect Array',
|
|
32
|
+
// 'Email String',
|
|
33
|
+
// 'Text String',
|
|
34
|
+
// 'Textarea String',
|
|
35
|
+
// 'Date String',
|
|
36
|
+
// 'DateTime String',
|
|
37
|
+
// 'Boolean boolean',
|
|
38
|
+
// 'URL String',
|
|
39
|
+
// 'Phone phone',
|
|
40
|
+
// 'Number Number',
|
|
41
|
+
// 'Percent String',
|
|
42
|
+
// 'Decimal String',
|
|
43
|
+
// 'Currency String'
|
|
44
|
+
// ];
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
export const validator = {
|
|
48
|
+
isEmpty(value) {
|
|
49
|
+
const valueType = typeof value;
|
|
50
|
+
|
|
51
|
+
if (valueType === 'string') {
|
|
52
|
+
return this.isEmptyString(value);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (Array.isArray(value)) {
|
|
56
|
+
return this.isEmptyArr(value);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if (valueType === 'object') {
|
|
60
|
+
return this.isEmptyObj(value);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (valueType === 'boolean' || value) {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return true;
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
isEmptyString(value) {
|
|
71
|
+
if (value && typeof value === 'string' && value.trim()) {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return true;
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
isEmptyArr(value) {
|
|
79
|
+
if (Array.isArray(value) && value.length > 0) {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return true;
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
isEmptyMultiSelect(value) {
|
|
87
|
+
if (!this.isEmpty(value) && !(value.length <= 2 && value.every(val => this.isNoneValue(val)))) {
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return true;
|
|
92
|
+
},
|
|
93
|
+
|
|
94
|
+
isEmptyPicklist(value) {
|
|
95
|
+
if (!this.isEmpty(value) && !this.isNoneValue(value)) {
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return true;
|
|
100
|
+
},
|
|
101
|
+
|
|
102
|
+
isEmptyObj(value) {
|
|
103
|
+
for (const key in value) {
|
|
104
|
+
if (value.hasOwnProperty(key)) {
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
return true;
|
|
110
|
+
},
|
|
111
|
+
|
|
112
|
+
isValidLength(value, length) {
|
|
113
|
+
let type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'max';
|
|
114
|
+
const valueType = typeof value;
|
|
115
|
+
const inpVal = valueType === 'number' ? value.toString() : value;
|
|
116
|
+
const valueLength = (inpVal || '').length;
|
|
117
|
+
|
|
118
|
+
if (valueType === 'string' || valueType === 'number' || Array.isArray(value)) {
|
|
119
|
+
if (type === 'max' && valueLength > length) {
|
|
120
|
+
return true;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
if (type === 'min' && valueLength < length) {
|
|
124
|
+
return true;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
return false;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return false;
|
|
131
|
+
},
|
|
132
|
+
|
|
133
|
+
isMaxLength(value, argum) {
|
|
134
|
+
return this.isValidLength(value, argum, 'max');
|
|
135
|
+
},
|
|
136
|
+
|
|
137
|
+
isMinLength(value, argum) {
|
|
138
|
+
return this.isValidLength(value, argum, 'min');
|
|
139
|
+
},
|
|
140
|
+
|
|
141
|
+
isValidInteger(value) {
|
|
142
|
+
const valueType = typeof value;
|
|
143
|
+
const inpVal = valueType === 'number' ? value.toString() : value;
|
|
144
|
+
|
|
145
|
+
if (inpVal) {
|
|
146
|
+
const re = /(^-?\d\d*$)/;
|
|
147
|
+
|
|
148
|
+
if (isNaN(inpVal) || inpVal.indexOf('.') !== -1 || !re.test(inpVal)) {
|
|
149
|
+
return false;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
return true;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
return false;
|
|
156
|
+
},
|
|
157
|
+
|
|
158
|
+
isValidDecimal(value) {
|
|
159
|
+
const valueType = typeof value;
|
|
160
|
+
const inpVal = valueType === 'number' ? value.toString() : value;
|
|
161
|
+
const restr = '^-?[0-9]\\d*(|\\.\\d[0-9]*)$';
|
|
162
|
+
const re = new RegExp(restr);
|
|
163
|
+
|
|
164
|
+
if (re.test(inpVal)) {
|
|
165
|
+
return true;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
return false;
|
|
169
|
+
},
|
|
170
|
+
|
|
171
|
+
isValidDecimalPlaces(value, decimalPlaces) {
|
|
172
|
+
const valueType = typeof value;
|
|
173
|
+
const inpVal = valueType === 'number' ? value.toString() : value;
|
|
174
|
+
const restr = `^-?\\d*(|\\.\\d[0-9]{0,${decimalPlaces - 1}})$`;
|
|
175
|
+
const re = new RegExp(restr);
|
|
176
|
+
|
|
177
|
+
if (re.test(inpVal)) {
|
|
178
|
+
return true;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
return false;
|
|
182
|
+
},
|
|
183
|
+
|
|
184
|
+
isValidPhone(value) {
|
|
185
|
+
// old validation
|
|
186
|
+
const phoneRegEx = /^[0-9a-zA-Z_()\+\-\.\$@\?\,\:\'\/\!\s]+/;
|
|
187
|
+
const match = value.match(phoneRegEx);
|
|
188
|
+
|
|
189
|
+
if (!match || value !== match[0]) {
|
|
190
|
+
return false;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
return true; // let valueType = typeof value;
|
|
194
|
+
// let inpVal = valueType === 'number' ? value.toString() : value;
|
|
195
|
+
// let re = new RegExp(/^\+?\d+(-\d+)*$/);
|
|
196
|
+
// if (re.test(inpVal)) {
|
|
197
|
+
// return true;
|
|
198
|
+
// }
|
|
199
|
+
// return false;
|
|
200
|
+
},
|
|
201
|
+
|
|
202
|
+
isValidEmail(value, isReplyValidation) {
|
|
203
|
+
const re = isReplyValidation ? /^[\wÀ-ž\+\#]([\wÀ-ž\-\.\+\'\&\/\#\~]*)@([\wÀ-ž\-\.]*)(\.[a-zA-ZÀ-ž]{2,22}(\.[a-zA-ZÀ-ž]{2}){0,2})$/ : /^[\wÀ-ž]([\wÀ-ž\-\.\+\'\&\/]*)@([\wÀ-ž\-\.]*)(\.[a-zA-ZÀ-ž]{2,22}(\.[a-zA-ZÀ-ž]{2}){0,2})$/; // swedish character support
|
|
204
|
+
// let re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
|
205
|
+
|
|
206
|
+
if (re.test(value)) {
|
|
207
|
+
return true;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
return false;
|
|
211
|
+
},
|
|
212
|
+
|
|
213
|
+
isValidWebsite(value) {
|
|
214
|
+
const newValue = formatWebsiteUrl(value);
|
|
215
|
+
const re = /^(ht|f)tp(s?):\/\/[-.\w]*(\/?)([a-zA-Z0-9\-\.\?,:'\/\\\+=&%\$#_@]*)?$/;
|
|
216
|
+
|
|
217
|
+
if (re.test(newValue)) {
|
|
218
|
+
return true;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
return false;
|
|
222
|
+
},
|
|
223
|
+
|
|
224
|
+
isValidDate(dateObj) {
|
|
225
|
+
if (dateObj || dateObj instanceof Date && dateObj.getFullYear() > 1000) {
|
|
226
|
+
return true;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
return false;
|
|
230
|
+
},
|
|
231
|
+
|
|
232
|
+
isReminder(value) {
|
|
233
|
+
const alerTypes = value.alertTypes || [];
|
|
234
|
+
return !!alerTypes.length;
|
|
235
|
+
},
|
|
236
|
+
|
|
237
|
+
isNoneValue() {
|
|
238
|
+
let value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
239
|
+
const inpVal = value.trim && value.trim();
|
|
240
|
+
const {
|
|
241
|
+
valueNoneText: noneText
|
|
242
|
+
} = getNoneText();
|
|
243
|
+
const i18nNoneValue = i18NProviderUtils.getI18NValue('-None-');
|
|
244
|
+
|
|
245
|
+
if (typeof inpVal === 'string' && (inpVal === noneText || inpVal === i18nNoneValue)) {
|
|
246
|
+
return true;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
return false;
|
|
250
|
+
},
|
|
251
|
+
|
|
252
|
+
isValidDuration() {
|
|
253
|
+
let value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
254
|
+
const {
|
|
255
|
+
hoursSpent,
|
|
256
|
+
minutesSpent
|
|
257
|
+
} = value;
|
|
258
|
+
|
|
259
|
+
if (hoursSpent < 24 && minutesSpent < 60) {
|
|
260
|
+
return true;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
return false;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
};
|
|
267
|
+
export function fieldValidate(value, fieldDetails) {
|
|
268
|
+
const patternMapping = {
|
|
269
|
+
LookUp: '',
|
|
270
|
+
Email: 'isValidEmail',
|
|
271
|
+
Number: 'isValidInteger',
|
|
272
|
+
Text: '',
|
|
273
|
+
// No Check
|
|
274
|
+
Picklist: '',
|
|
275
|
+
// No Check
|
|
276
|
+
Textarea: '',
|
|
277
|
+
// No Check
|
|
278
|
+
DateTime: 'isValidDate',
|
|
279
|
+
// valid date check or valid dateTime check
|
|
280
|
+
Currency: 'isValidDecimal',
|
|
281
|
+
// check only decimal & decimal places, server side convert rouding option
|
|
282
|
+
Decimal: 'isValidDecimal',
|
|
283
|
+
Percent: 'isValidDecimal',
|
|
284
|
+
Boolean: '',
|
|
285
|
+
// No Check
|
|
286
|
+
Phone: 'isValidPhone',
|
|
287
|
+
// URL: 'isValidWebsite',// remove for validation
|
|
288
|
+
Date: 'isValidDate',
|
|
289
|
+
Radio: '',
|
|
290
|
+
// No Check
|
|
291
|
+
Duration: '',
|
|
292
|
+
// No Check
|
|
293
|
+
Multiselect: '' // No Check
|
|
294
|
+
|
|
295
|
+
};
|
|
296
|
+
const emptyValidateMapping = {
|
|
297
|
+
Multiselect: 'isEmptyMultiSelect',
|
|
298
|
+
Picklist: 'isEmptyPicklist'
|
|
299
|
+
};
|
|
300
|
+
const {
|
|
301
|
+
isMandatory,
|
|
302
|
+
i18NLabel,
|
|
303
|
+
type: fieldType,
|
|
304
|
+
maxLength,
|
|
305
|
+
decimalPlaces,
|
|
306
|
+
apiName: fieldName,
|
|
307
|
+
localizedValue = ''
|
|
308
|
+
} = fieldDetails;
|
|
309
|
+
const fieldLabel = localizedValue || i18NLabel;
|
|
310
|
+
const validationMethod = patternMapping[fieldType];
|
|
311
|
+
let isError = false;
|
|
312
|
+
let message = '';
|
|
313
|
+
const emptyValidationMethod = emptyValidateMapping[fieldType];
|
|
314
|
+
const isEmptyValue = emptyValidationMethod ? validator[emptyValidationMethod](value) : validator.isEmpty(value);
|
|
315
|
+
|
|
316
|
+
if (isMandatory && isEmptyValue || isMandatory && fieldType === 'Boolean' && (value === false || value === 'false')) {
|
|
317
|
+
isError = true;
|
|
318
|
+
message = i18NProviderUtils.getI18NValue('crm.field.empty.check', fieldLabel);
|
|
319
|
+
} else if (maxLength && fieldType !== 'Boolean' && fieldType !== 'DateTime' && fieldType !== 'Date' && validator.isMaxLength(value, maxLength)) {
|
|
320
|
+
isError = true;
|
|
321
|
+
message = i18NProviderUtils.getI18NValue('support.form.more.than.max.length', [fieldLabel, maxLength]);
|
|
322
|
+
} else if (!isEmptyValue && validationMethod && !validator[validationMethod](value)) {
|
|
323
|
+
isError = true;
|
|
324
|
+
message = i18NProviderUtils.getI18NValue('crm.field.valid.check', fieldLabel);
|
|
325
|
+
} else if (!isEmptyValue && (fieldType === 'Currency' || fieldType === 'Decimal') && !validator.isValidDecimalPlaces(value, decimalPlaces)) {
|
|
326
|
+
isError = true;
|
|
327
|
+
message = i18NProviderUtils.getI18NValue('support.form.decimal.places.length.error.message', decimalPlaces);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
return {
|
|
331
|
+
isError,
|
|
332
|
+
message
|
|
333
|
+
};
|
|
334
|
+
}
|
|
@@ -27,7 +27,7 @@ class Repository {
|
|
|
27
27
|
const {
|
|
28
28
|
selectionConfig
|
|
29
29
|
} = properties || {};
|
|
30
|
-
const itemIds =
|
|
30
|
+
const itemIds = behaviours.zrecord.records.map(item => item.id);
|
|
31
31
|
const maxSelectionCount = selectionConfig === null || selectionConfig === void 0 ? void 0 : selectionConfig.maxSelectionCount;
|
|
32
32
|
return new ListItemSelection(selected, itemIds, maxSelectionCount);
|
|
33
33
|
}
|
|
@@ -12,7 +12,7 @@ class Deselect extends AbstractUseCase {
|
|
|
12
12
|
} = inputModel;
|
|
13
13
|
const listItemSelection = repository.getListItemSelection();
|
|
14
14
|
listItemSelection.deselectItems(ids);
|
|
15
|
-
listItemSelection.createDispatchProps().map(event => dispatch(event));
|
|
15
|
+
listItemSelection.createDispatchProps(ids).map(event => dispatch(event));
|
|
16
16
|
presenter.updateListItemSelection(listItemSelection.toObject());
|
|
17
17
|
}
|
|
18
18
|
|
|
@@ -12,7 +12,7 @@ class ItemsSelection extends AbstractUseCase {
|
|
|
12
12
|
} = inputModel;
|
|
13
13
|
const listItemSelection = repository.getListItemSelection();
|
|
14
14
|
listItemSelection.toggleItems(selected);
|
|
15
|
-
listItemSelection.createDispatchProps().map(event => dispatch(event));
|
|
15
|
+
listItemSelection.createDispatchProps(selected).map(event => dispatch(event));
|
|
16
16
|
presenter.updateListItemSelection(listItemSelection.toObject());
|
|
17
17
|
}
|
|
18
18
|
|
|
@@ -84,7 +84,7 @@ class ListItemSelection {
|
|
|
84
84
|
};
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
createDispatchProps() {
|
|
87
|
+
createDispatchProps(ids) {
|
|
88
88
|
const events = [];
|
|
89
89
|
|
|
90
90
|
if (this.selectionStatus === 'selected') {
|
|
@@ -95,7 +95,7 @@ class ListItemSelection {
|
|
|
95
95
|
|
|
96
96
|
if (this.selectionStatus === 'deselected') {
|
|
97
97
|
events.push(new Event(LIST_SELECTION_RECORDS_DESELECTED, {
|
|
98
|
-
recordIds:
|
|
98
|
+
recordIds: ids
|
|
99
99
|
}));
|
|
100
100
|
}
|
|
101
101
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import AbstractController from "./AbstractController";
|
|
2
|
+
export class SetDataController extends AbstractController {
|
|
3
|
+
handle(event) {
|
|
4
|
+
const {
|
|
5
|
+
storeKey,
|
|
6
|
+
data
|
|
7
|
+
} = event.action.payload;
|
|
8
|
+
const {
|
|
9
|
+
state,
|
|
10
|
+
updateState
|
|
11
|
+
} = event;
|
|
12
|
+
const {
|
|
13
|
+
setDataUseCase
|
|
14
|
+
} = this.service;
|
|
15
|
+
setDataUseCase.updateDependency(state, updateState);
|
|
16
|
+
setDataUseCase.execute({
|
|
17
|
+
id: storeKey,
|
|
18
|
+
data
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
import Storage from "../../domain/entities/Storage";
|
|
4
|
+
import { STORE_KEY } from "../../../../../bc/local-storage/Constants";
|
|
5
|
+
export class LocalStorageRepository {
|
|
6
|
+
constructor() {
|
|
7
|
+
_defineProperty(this, "state", void 0);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
init(state) {
|
|
11
|
+
this.state = state;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
getStorage() {
|
|
15
|
+
const dataString = window.localStorage.getItem(STORE_KEY);
|
|
16
|
+
const data = typeof dataString === 'string' ? JSON.parse(dataString) : {};
|
|
17
|
+
const storage = new Storage(data);
|
|
18
|
+
return storage;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
setStorage(storage) {
|
|
22
|
+
const data = storage.toObject();
|
|
23
|
+
window.localStorage.setItem(STORE_KEY, JSON.stringify(data));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
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
|
+
import SetDataUseCase from "../../applications/usecases/SetDataUseCase";
|
|
4
|
+
|
|
5
|
+
class Service {
|
|
6
|
+
constructor(dependencies) {
|
|
7
|
+
_defineProperty(this, "setDataUseCase", void 0);
|
|
8
|
+
|
|
9
|
+
this.setDataUseCase = new SetDataUseCase(dependencies);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default Service;
|
|
@@ -0,0 +1,38 @@
|
|
|
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
|
+
export default class Presenter {
|
|
4
|
+
constructor() {
|
|
5
|
+
_defineProperty(this, "updateState", void 0);
|
|
6
|
+
|
|
7
|
+
_defineProperty(this, "state", void 0);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
updateDependencies(state, updateState) {
|
|
11
|
+
this.state = state;
|
|
12
|
+
this.updateState = updateState; // this.updateState =
|
|
13
|
+
// typeof updateState === 'function' ? updateState : () => {};
|
|
14
|
+
} // getViewModel(): BehaviourState | null {
|
|
15
|
+
// return this.state.behaviours.localStorage;
|
|
16
|
+
// }
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
setBehaviourState(newState) {
|
|
20
|
+
const {
|
|
21
|
+
state
|
|
22
|
+
} = this;
|
|
23
|
+
this.state = { ...state,
|
|
24
|
+
behaviours: { ...state.behaviours,
|
|
25
|
+
localStorage: newState
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
this.updateState(this.state);
|
|
29
|
+
} // clearBehaviourState() {
|
|
30
|
+
// this.setBehaviourState(null);
|
|
31
|
+
// }
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
updateBehaviourState(newState) {
|
|
35
|
+
this.setBehaviourState(newState);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
File without changes
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
class AbstractUseCase {
|
|
2
|
+
constructor(dependencies) {
|
|
3
|
+
this.dependencies = dependencies;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
updateDependency(state, updateState) {
|
|
7
|
+
const {
|
|
8
|
+
repository,
|
|
9
|
+
presenter
|
|
10
|
+
} = this.dependencies;
|
|
11
|
+
repository.init(state);
|
|
12
|
+
presenter.updateDependencies(state, updateState);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default AbstractUseCase;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import AbstractUseCase from "./AbstractUseCase";
|
|
2
|
+
|
|
3
|
+
class SetDataUseCase extends AbstractUseCase {
|
|
4
|
+
execute(input) {
|
|
5
|
+
const {
|
|
6
|
+
repository,
|
|
7
|
+
presenter
|
|
8
|
+
} = this.dependencies;
|
|
9
|
+
const storage = repository.getStorage();
|
|
10
|
+
storage.setData(input.id, input.data);
|
|
11
|
+
repository.setStorage(storage);
|
|
12
|
+
presenter.updateBehaviourState(storage.toObject());
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default SetDataUseCase;
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
class Storage {
|
|
4
|
+
constructor(data) {
|
|
5
|
+
_defineProperty(this, "data", void 0);
|
|
6
|
+
|
|
7
|
+
this.data = data;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
setData(id, data) {
|
|
11
|
+
this.data[id] = data;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
getData(id) {
|
|
15
|
+
return this.data[id];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
deleteData(id) {
|
|
19
|
+
delete this.data[id];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
toObject() {
|
|
23
|
+
return this.data;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default Storage;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { STORE_KEY, STORE_REQUESTED } from "../../../../bc/local-storage/Constants";
|
|
2
|
+
import Properties from "../../../../bc/local-storage/Properties";
|
|
3
|
+
import { SetDataController } from "../adapters/controllers/SetDataController";
|
|
4
|
+
import { LocalStorageRepository } from "../adapters/gateways/LocalStorageRepository";
|
|
5
|
+
import Service from "../adapters/gateways/Service";
|
|
6
|
+
import Presenter from "../adapters/presenters/Presenter";
|
|
7
|
+
export default class LocalStorageBehaviourFactory {
|
|
8
|
+
static create() {
|
|
9
|
+
const presenter = new Presenter();
|
|
10
|
+
const repository = new LocalStorageRepository();
|
|
11
|
+
const service = new Service({
|
|
12
|
+
repository,
|
|
13
|
+
presenter
|
|
14
|
+
});
|
|
15
|
+
return {
|
|
16
|
+
name: 'localStorage',
|
|
17
|
+
setInitialState: () => {
|
|
18
|
+
const data = localStorage.getItem(STORE_KEY);
|
|
19
|
+
return typeof data === 'string' ? JSON.parse(data) : {};
|
|
20
|
+
},
|
|
21
|
+
properties: Properties,
|
|
22
|
+
eventHandlers: {
|
|
23
|
+
[STORE_REQUESTED]: new SetDataController(service).handle
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
}
|