@zohodesk/library-platform 1.0.1 → 1.1.0-exp.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/bc/index.js +2 -0
- package/es/bc/list-selection/Properties.js +21 -12
- package/es/bc/sort-by/Properties.js +20 -15
- package/es/bc/sort-by/index.js +2 -0
- package/es/bc/table-column-resizer/Properties.js +1 -1
- package/es/bc/zhttp/Properties.js +11 -1
- package/es/bc/zhttp/index.js +2 -0
- package/es/bc/zlist/Properties.js +12 -3
- package/es/cc/action-icon/Model.js +6 -2
- package/es/cc/action-icon/Properties.js +18 -0
- package/es/cc/action-location/Properties.js +54 -3
- package/es/cc/component/properties/PropertiesConverter.js +23 -0
- package/es/cc/empty-state/index.js +1 -0
- package/es/cc/fields/field/Properties.js +9 -1
- package/es/cc/fields/field/Types.js +16 -16
- package/es/cc/fields/multi-select/Properties.js +1 -1
- package/es/cc/fields/pick-list/Properties.js +1 -1
- package/es/cc/index.js +1 -0
- package/es/cc/table-connected/Properties.js +49 -45
- package/es/cc/table-list/Properties.js +79 -318
- package/es/cc/table-list/model/RowModel.js +2 -4
- package/es/cc/table-list/row/Properties.js +3 -11
- package/es/desk-frameworks/table-connected/frameworks/TableConnectedView.js +10 -11
- package/es/index.js +1 -2
- package/es/library/behaviours/list-selection/adapters/gateways/Repository.js +1 -1
- package/es/library/behaviours/list-selection/adapters/gateways/Service.js +5 -5
- package/es/library/behaviours/sort-by/adapters/gateway/Repository.js +1 -1
- package/es/library/behaviours/sort-by/adapters/gateway/Service.js +1 -1
- package/es/library/behaviours/sort-by/{entities → domain/entities}/SortBy.js +1 -1
- package/es/library/behaviours/sort-by/frameworks/ui/SortByBehaviourFactory.js +2 -2
- package/es/library/behaviours/text-to-field-click/adapters/gateway/Repository.js +1 -1
- package/es/library/behaviours/text-to-field-click/{entities → domain/entities}/FieldEventConverter.js +1 -1
- package/es/library/behaviours/text-to-field-click/frameworks/ui/EventHandlersFactory.js +1 -1
- package/es/library/custom-component/adapters/gateways/event-manager/EventManager.js +1 -1
- package/es/library/custom-component/adapters/gateways/service/Service.js +6 -6
- package/es/library/custom-component/{usecases → applications}/entities-factory/BehavioursFactory.js +1 -1
- package/es/library/custom-component/{usecases → applications}/entities-factory/ComponentFactory.js +3 -3
- package/es/library/custom-component/{usecases → applications}/entities-factory/EventHandlersFactory.js +1 -1
- package/es/library/custom-component/{usecases → applications}/entities-factory/PropertiesFactory.js +9 -3
- package/es/library/custom-component/{usecases/interactors → applications/usecases}/UnmountUseCase.js +1 -1
- package/es/library/custom-component/{entities → domain/entities}/Component.js +36 -7
- package/es/library/custom-component/{entities → domain/entities}/DefaultAppendToActionPayload.js +2 -2
- package/es/library/custom-component/{entities → domain/entities}/Properties.js +4 -5
- package/es/library/custom-component/frameworks/ui/__testcases__/CreateCustomComponent.spec.js +106 -0
- package/es/library/dot/components/action-location/frameworks/ui/ActionComponentMapping.js +5 -0
- package/es/library/dot/components/action-location/frameworks/ui/ActionLocationView.js +8 -29
- package/es/library/dot/components/actions-renderer/frameworks/ui/ActionsRenderer.js +9 -0
- package/es/library/dot/components/actions-renderer/frameworks/ui/ActionsRendererView.js +37 -0
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/Rows.js +3 -7
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/HeaderData.js +5 -3
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/Row.js +11 -7
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/RowActions.js +3 -0
- package/es/library/dot/legacy-to-new-arch/action-icon/{ActionIcon.js → frameworks/ui/ActionIcon.js} +2 -2
- package/es/library/dot/legacy-to-new-arch/action-icon/{ActionIconView.js → frameworks/ui/ActionIconView.js} +11 -5
- package/es/library/dot/legacy-to-new-arch/action-icon/frameworks/ui/css/ActionIcon.module.css +3 -0
- package/es/library/dot/legacy-to-new-arch/index.js +1 -1
- package/es/platform/zdata-broker/adapters/gateways/Repository.js +1 -1
- package/es/platform/zdata-broker/adapters/gateways/Service.js +5 -5
- package/es/platform/zdata-broker/adapters/gateways/TemplateHelpers.js +21 -0
- package/es/platform/zdata-broker/{usecases → applications}/entities-factory/APITemplatesFactory.js +2 -2
- package/es/platform/zdata-broker/{usecases → applications}/entities-factory/DataBrokerFactory.js +1 -1
- package/es/platform/zdata-broker/applications/interfaces/gateways/ITemplateHelpers.js +1 -0
- package/es/platform/zdata-broker/{entities → domain/entities}/DataBroker.js +3 -3
- package/es/platform/zdata-broker/{entities → domain/entities}/interfaces/MetaData.js +1 -1
- package/es/platform/zfield/adapters/gateways/Repository.js +1 -1
- package/es/platform/zfield/adapters/gateways/Service.js +6 -6
- package/es/platform/zfield/{usecases → applications}/entities-factory/FieldsManagerBuilder.js +1 -1
- package/es/platform/zfield/applications/interfaces/input/FetchInputModel.js +2 -0
- package/es/platform/zfield/{entities → domain/entities}/fields-manager/AvailableFieldsManager.js +2 -2
- package/es/platform/zfield/{entities → domain/entities}/fields-manager/FieldsManager.js +3 -3
- package/es/platform/zfield/{entities → domain/entities}/fields-manager/SelectedFieldsManager.js +2 -2
- package/es/platform/zfield/{entities → domain/entities}/interfaces/MetaData.js +1 -1
- package/es/platform/zhttp/frameworks/ActionsHandlerFactory.js +1 -1
- package/es/platform/zhttp/frameworks/ZHttpBehaviourFactory.js +2 -1
- package/es/platform/zlist/adapters/gateways/Repository.js +1 -1
- package/es/platform/zlist/adapters/gateways/Service.js +10 -10
- package/es/platform/zlist/adapters/presenters/TableTranslator.js +2 -1
- package/es/platform/zlist/adapters/presenters/translators/Row.js +5 -1
- package/es/platform/zlist/adapters/presenters/translators/RowActionTranslator.js +18 -11
- package/es/platform/zlist/adapters/presenters/translators/RowsTranslator.js +3 -1
- package/es/platform/zlist/{usecases → applications}/entities-factory/ListFactory.js +1 -1
- package/es/platform/zlist/{entities → domain/entities}/List.js +3 -3
- package/es/platform/zrecord/adapters/gateways/Repository.js +1 -1
- package/es/platform/zrecord/adapters/gateways/Service.js +13 -13
- package/es/platform/zrecord/{usecases → applications}/entities-factory/RecordFactory.js +1 -1
- package/es/platform/zrecord/{usecases → applications}/entities-factory/RecordsManagerFactory.js +2 -2
- package/es/platform/zrecord/{entities → domain/entities}/DeleteMultipleRecordStrategy.js +1 -1
- package/es/platform/zrecord/{entities → domain/entities}/DeleteRecordStrategy.js +1 -1
- package/es/platform/zrecord/{entities → domain/entities}/GetRecordsStrategy.js +1 -1
- package/es/platform/zrecord/{entities → domain/entities}/RecordsManager.js +3 -3
- package/es/platform/zrecord/{entities → domain/entities}/UpdateRecordStrategy.js +1 -1
- package/es/platform/zrecord/domain/entities/interfaces/RecordModel.js +1 -0
- package/es/platform/zrecord/domain/entities/interfaces/RecordsModel.js +1 -0
- package/es/platform/zrecord/domain/entities/interfaces/StrategyMeta.js +1 -0
- package/package.json +10 -4
- package/es/cc/table-list/behaviour-properties/ResizerConfig.js +0 -18
- package/es/cc/table-list/behaviour-properties/SelectionConfig.js +0 -17
- package/es/cc/table-list/behaviour-properties/SortByConfig.js +0 -14
- package/es/cc/table-list/behaviour-properties/index.js +0 -3
- package/es/library/custom-component/entities/__tests__/Action.spec.js +0 -19
- package/es/library/custom-component/entities/__tests__/ActionHandlers.spec.js +0 -15
- package/es/library/custom-component/entities/__tests__/Behaviour.spec.js +0 -52
- package/es/library/custom-component/entities/__tests__/Component.spec.js +0 -109
- package/es/platform/zdata-broker/usecases/interfaces/gateways/ITemplateHelpers.js +0 -1
- package/es/platform/zfield/usecases/interfaces/gateways/ITemplateHelpers.js +0 -1
- package/es/platform/zfield/usecases/interfaces/input/FetchInputModel.js +0 -2
- /package/es/{library/behaviours/list-selection/entities/interfaces/IListItemSelection.js → cc/action-location/Action.js} +0 -0
- /package/es/{library/behaviours/list-selection/entities/interfaces/ListSelectionModel.js → cc/action-location/ActionLocation.js} +0 -0
- /package/es/{library/behaviours/list-selection/usecases/interfaces/UseCase.js → cc/table-list/data-types/RowAction.js} +0 -0
- /package/es/library/{custom-component/usecases → behaviours/list-selection/applications}/interfaces/UseCase.js +0 -0
- /package/es/library/behaviours/list-selection/{usecases → applications}/interfaces/UseCaseDependencies.js +0 -0
- /package/es/library/behaviours/list-selection/{usecases → applications}/interfaces/gateways/IRepository.js +0 -0
- /package/es/library/behaviours/list-selection/{usecases → applications}/interfaces/gateways/IService.js +0 -0
- /package/es/library/behaviours/list-selection/{usecases → applications}/interfaces/input/AllSelectionInputModel.js +0 -0
- /package/es/library/behaviours/list-selection/{usecases → applications}/interfaces/input/DestructInputModel.js +0 -0
- /package/es/library/behaviours/list-selection/{usecases → applications}/interfaces/input/InitializeInputModel.js +0 -0
- /package/es/library/behaviours/list-selection/{usecases → applications}/interfaces/input/RangeSelectionInputModel.js +0 -0
- /package/es/library/behaviours/list-selection/{usecases → applications}/interfaces/input/SelectionInputModel.js +0 -0
- /package/es/library/behaviours/list-selection/{usecases → applications}/interfaces/output/BehaviourStateModel.js +0 -0
- /package/es/library/behaviours/list-selection/{usecases → applications}/interfaces/output/IPresenter.js +0 -0
- /package/es/library/behaviours/list-selection/{usecases/interactors → applications/usecases}/AbstractUseCase.js +0 -0
- /package/es/library/behaviours/list-selection/{usecases/interactors → applications/usecases}/AllItemSelection.js +0 -0
- /package/es/library/behaviours/list-selection/{usecases/interactors → applications/usecases}/Destruct.js +0 -0
- /package/es/library/behaviours/list-selection/{usecases/interactors → applications/usecases}/Initialize.js +0 -0
- /package/es/library/behaviours/list-selection/{usecases/interactors → applications/usecases}/ItemsSelection.js +0 -0
- /package/es/library/behaviours/list-selection/{usecases/interactors → applications/usecases}/RangeSelection.js +0 -0
- /package/es/library/behaviours/list-selection/{entities → domain/entities}/ListItemSelection.js +0 -0
- /package/es/library/behaviours/{sort-by/entities/interfaces/ISortBy.js → list-selection/domain/entities/interfaces/IListItemSelection.js} +0 -0
- /package/es/library/behaviours/{sort-by/usecases/interfaces/UseCaseDependencies.js → list-selection/domain/entities/interfaces/ListSelectionModel.js} +0 -0
- /package/es/library/behaviours/{text-to-field-click/usecases → sort-by/applications}/interfaces/UseCaseDependencies.js +0 -0
- /package/es/library/behaviours/sort-by/{usecases → applications}/interfaces/gateways/IRepository.js +0 -0
- /package/es/library/behaviours/sort-by/{usecases → applications}/interfaces/gateways/IService.js +0 -0
- /package/es/library/behaviours/sort-by/{usecases → applications}/interfaces/input/SortByInputModel.js +0 -0
- /package/es/library/behaviours/sort-by/{usecases → applications}/interfaces/output/IPresenter.js +0 -0
- /package/es/library/behaviours/sort-by/{usecases → applications}/interfaces/output/SortByOutputModel.js +0 -0
- /package/es/library/behaviours/sort-by/{usecases/interactors → applications/usecases}/AbstractUseCase.js +0 -0
- /package/es/library/behaviours/sort-by/{usecases/interactors → applications/usecases}/SortBy.js +0 -0
- /package/es/{platform/zlist/usecases/interfaces/gateways → library/behaviours/sort-by/domain/entities/interfaces}/ISortBy.js +0 -0
- /package/es/{platform/zlist/usecases → library/behaviours/text-to-field-click/applications}/interfaces/UseCaseDependencies.js +0 -0
- /package/es/library/behaviours/text-to-field-click/{usecases → applications}/interfaces/gateways/IRepository.js +0 -0
- /package/es/library/behaviours/text-to-field-click/{usecases → applications}/interfaces/input/ClickUseCaseInputModel.js +0 -0
- /package/es/library/behaviours/text-to-field-click/{usecases/interactors → applications/usecases}/AbstractUseCase.js +0 -0
- /package/es/library/behaviours/text-to-field-click/{usecases/interactors → applications/usecases}/ClickUseCase.js +0 -0
- /package/es/library/behaviours/text-to-field-click/{entities → domain/entities}/interfaces/IFieldEventConverter.js +0 -0
- /package/es/library/custom-component/{usecases → applications}/interfaces/InputDependencies.js +0 -0
- /package/es/library/custom-component/{usecases → applications}/interfaces/OutputDependencies.js +0 -0
- /package/es/{platform/zhttp/usecases → library/custom-component/applications}/interfaces/UseCase.js +0 -0
- /package/es/library/custom-component/{usecases → applications}/interfaces/gateways/IEventManager.js +0 -0
- /package/es/library/custom-component/{usecases → applications}/interfaces/gateways/IJSONValidator.js +0 -0
- /package/es/library/custom-component/{usecases → applications}/interfaces/gateways/IRepository.js +0 -0
- /package/es/library/custom-component/{usecases → applications}/interfaces/gateways/IService.js +0 -0
- /package/es/library/custom-component/{usecases → applications}/interfaces/input/DispatchInputModel.js +0 -0
- /package/es/library/custom-component/{usecases → applications}/interfaces/input/InitailizeInputModel.js +0 -0
- /package/es/library/custom-component/{usecases → applications}/interfaces/input/UpdatePropertiesInputModel.js +0 -0
- /package/es/library/custom-component/{usecases → applications}/interfaces/input/UpdateStateInputModel.js +0 -0
- /package/es/library/custom-component/{usecases → applications}/interfaces/output/OutputBoundary.js +0 -0
- /package/es/library/custom-component/{usecases/interactors → applications/usecases}/AbstractUseCase.js +0 -0
- /package/es/library/custom-component/{usecases/interactors → applications/usecases}/DispatchUseCase.js +0 -0
- /package/es/library/custom-component/{usecases/interactors → applications/usecases}/InitializeUseCase.js +0 -0
- /package/es/library/custom-component/{usecases/interactors → applications/usecases}/MountUseCase.js +0 -0
- /package/es/library/custom-component/{usecases/interactors → applications/usecases}/UpdatePropertyUseCase.js +0 -0
- /package/es/library/custom-component/{usecases/interactors → applications/usecases}/UpdateStateUseCase.js +0 -0
- /package/es/library/custom-component/{entities → domain/entities}/Behaviour.js +0 -0
- /package/es/library/custom-component/{entities → domain/entities}/EventHandler.js +0 -0
- /package/es/library/custom-component/{entities → domain/entities}/EventHandlers.js +0 -0
- /package/es/library/custom-component/{entities → domain/entities}/Events.js +0 -0
- /package/es/library/custom-component/{entities → domain/entities}/LifeCycleAction.js +0 -0
- /package/es/library/custom-component/{entities → domain/entities}/Payload.js +0 -0
- /package/es/library/custom-component/{entities → domain/entities}/Property.js +0 -0
- /package/es/library/custom-component/{entities → domain/entities}/Schema.js +0 -0
- /package/es/library/custom-component/{entities → domain/entities}/State.js +0 -0
- /package/es/library/custom-component/{entities → domain/entities}/Style.js +0 -0
- /package/es/library/custom-component/{entities → domain/entities}/interfaces/IBehaviour.js +0 -0
- /package/es/library/custom-component/{entities → domain/entities}/interfaces/IComponent.js +0 -0
- /package/es/library/custom-component/{entities → domain/entities}/interfaces/IEvent.js +0 -0
- /package/es/library/custom-component/{entities → domain/entities}/interfaces/IEventHandler.js +0 -0
- /package/es/library/custom-component/{entities → domain/entities}/interfaces/IEventHandlerHelpers.js +0 -0
- /package/es/library/custom-component/{entities → domain/entities}/interfaces/IEventHandlers.js +0 -0
- /package/es/library/custom-component/{entities → domain/entities}/interfaces/IEventWrapper.js +0 -0
- /package/es/library/custom-component/{entities → domain/entities}/interfaces/ILifeCycleAction.js +0 -0
- /package/es/library/custom-component/{entities → domain/entities}/interfaces/IPayload.js +0 -0
- /package/es/library/custom-component/{entities → domain/entities}/interfaces/IProperties.js +0 -0
- /package/es/library/custom-component/{entities → domain/entities}/interfaces/IProperty.js +0 -0
- /package/es/library/custom-component/{entities → domain/entities}/interfaces/ISchema.js +0 -0
- /package/es/library/custom-component/{entities → domain/entities}/interfaces/IState.js +0 -0
- /package/es/library/custom-component/{entities → domain/entities}/interfaces/IStyle.js +0 -0
- /package/es/library/custom-component/{entities → domain/entities}/interfaces/IUpdateHelper.js +0 -0
- /package/es/library/custom-component/{entities → domain/entities}/interfaces/IValidator.js +0 -0
- /package/es/platform/zdata-broker/{usecases → applications}/interfaces/InputDependencies.js +0 -0
- /package/es/platform/zdata-broker/{usecases → applications}/interfaces/gateways/IRepository.js +0 -0
- /package/es/platform/zdata-broker/{usecases → applications}/interfaces/gateways/IService.js +0 -0
- /package/es/platform/zdata-broker/{usecases → applications}/interfaces/gateways/State.js +0 -0
- /package/es/platform/zdata-broker/{usecases → applications}/interfaces/input/ExecuteActionInputModel.js +0 -0
- /package/es/platform/zdata-broker/{usecases → applications}/interfaces/input/FailureInputModel.js +0 -0
- /package/es/platform/zdata-broker/{usecases → applications}/interfaces/input/NoContentInputModel.js +0 -0
- /package/es/platform/zdata-broker/{usecases → applications}/interfaces/input/RegisterInputModel.js +0 -0
- /package/es/platform/zdata-broker/{usecases → applications}/interfaces/input/SuccessInputModel.js +0 -0
- /package/es/platform/zdata-broker/{usecases → applications}/interfaces/output/IPresenter.js +0 -0
- /package/es/platform/zdata-broker/{usecases/interactors → applications/usecases}/AbstractUseCase.js +0 -0
- /package/es/platform/zdata-broker/{usecases/interactors → applications/usecases}/ExecuteActionUseCase.js +0 -0
- /package/es/platform/zdata-broker/{usecases/interactors → applications/usecases}/FailureUseCase.js +0 -0
- /package/es/platform/zdata-broker/{usecases/interactors → applications/usecases}/NoContentUseCase.js +0 -0
- /package/es/platform/zdata-broker/{usecases/interactors → applications/usecases}/RegisterUseCase.js +0 -0
- /package/es/platform/zdata-broker/{usecases/interactors → applications/usecases}/SuccessUseCase.js +0 -0
- /package/es/platform/zdata-broker/{entities → domain/entities}/APITemplate.js +0 -0
- /package/es/platform/zdata-broker/{entities → domain/entities}/APITemplates.js +0 -0
- /package/es/platform/zdata-broker/{entities → domain/entities}/interfaces/APIDetailsModel.js +0 -0
- /package/es/platform/zdata-broker/{entities → domain/entities}/interfaces/APITemplateModel.js +0 -0
- /package/es/platform/zdata-broker/{entities → domain/entities}/interfaces/APITemplatesModel.js +0 -0
- /package/es/platform/zdata-broker/{entities → domain/entities}/interfaces/ApiEnum.js +0 -0
- /package/es/platform/zdata-broker/{entities → domain/entities}/interfaces/BehaviourState.js +0 -0
- /package/es/platform/zdata-broker/{entities → domain/entities}/interfaces/EventModel.js +0 -0
- /package/es/platform/zdata-broker/{entities → domain/entities}/interfaces/IAPITemplate.js +0 -0
- /package/es/platform/zdata-broker/{entities → domain/entities}/interfaces/IAPITemplates.js +0 -0
- /package/es/platform/zdata-broker/{entities → domain/entities}/interfaces/IDataBroker.js +0 -0
- /package/es/platform/zdata-broker/{entities → domain/entities}/interfaces/ITemplateHelpers.js +0 -0
- /package/es/platform/zfield/{usecases → applications}/entities-factory/FieldBuilder.js +0 -0
- /package/es/platform/zfield/{usecases → applications}/entities-factory/FieldFactory.js +0 -0
- /package/es/platform/zfield/{usecases → applications}/interfaces/UsecaseDependencies.js +0 -0
- /package/es/platform/zfield/{usecases → applications}/interfaces/gateways/IRepository.js +0 -0
- /package/es/platform/zfield/{usecases → applications}/interfaces/gateways/IRestApi.js +0 -0
- /package/es/platform/zfield/{usecases → applications}/interfaces/gateways/IService.js +0 -0
- /package/es/platform/zfield/{usecases → applications}/interfaces/input/ExecuteActionInputModel.js +0 -0
- /package/es/platform/zfield/{usecases → applications}/interfaces/input/InitialInputModel.js +0 -0
- /package/es/platform/zfield/{usecases → applications}/interfaces/input/InputModel.js +0 -0
- /package/es/platform/zfield/{usecases → applications}/interfaces/input/RefetchInputModel.js +0 -0
- /package/es/platform/zfield/{usecases → applications}/interfaces/input/SetValueInputModel.js +0 -0
- /package/es/platform/zfield/{usecases → applications}/interfaces/output/IPresenter.js +0 -0
- /package/es/platform/zfield/{usecases/interactors → applications/usecases}/AbstractUseCase.js +0 -0
- /package/es/platform/zfield/{usecases/interactors → applications/usecases}/ExecuteActionUseCase.js +0 -0
- /package/es/platform/zfield/{usecases/interactors → applications/usecases}/FetchFailureUseCase.js +0 -0
- /package/es/platform/zfield/{usecases/interactors → applications/usecases}/FetchNoContentUseCase.js +0 -0
- /package/es/platform/zfield/{usecases/interactors → applications/usecases}/FetchSuccessUseCase.js +0 -0
- /package/es/platform/zfield/{usecases/interactors → applications/usecases}/InitializeUseCase.js +0 -0
- /package/es/platform/zfield/{usecases/interactors → applications/usecases}/RefetchUseCase.js +0 -0
- /package/es/platform/zfield/{entities → domain/entities}/BooleanField.js +0 -0
- /package/es/platform/zfield/{entities → domain/entities}/CurrencyField.js +0 -0
- /package/es/platform/zfield/{entities → domain/entities}/DateField.js +0 -0
- /package/es/platform/zfield/{entities → domain/entities}/DateTimeField.js +0 -0
- /package/es/platform/zfield/{entities → domain/entities}/EmailField.js +0 -0
- /package/es/platform/zfield/{entities → domain/entities}/Field.js +0 -0
- /package/es/platform/zfield/{entities → domain/entities}/LookupField.js +0 -0
- /package/es/platform/zfield/{entities → domain/entities}/MultiLineField.js +0 -0
- /package/es/platform/zfield/{entities → domain/entities}/MultiSelectField.js +0 -0
- /package/es/platform/zfield/{entities → domain/entities}/PercentageField.js +0 -0
- /package/es/platform/zfield/{entities → domain/entities}/PhoneField.js +0 -0
- /package/es/platform/zfield/{entities → domain/entities}/PickListField.js +0 -0
- /package/es/platform/zfield/{entities → domain/entities}/SingleLineField.js +0 -0
- /package/es/platform/zfield/{entities → domain/entities}/URLField.js +0 -0
- /package/es/platform/zfield/{entities → domain/entities}/index.js +0 -0
- /package/es/platform/zfield/{entities → domain/entities}/interfaces/ActionModel.js +0 -0
- /package/es/platform/zfield/{entities → domain/entities}/interfaces/BehaviourState.js +0 -0
- /package/es/platform/zfield/{entities → domain/entities}/interfaces/FieldApiName.js +0 -0
- /package/es/platform/zfield/{entities → domain/entities}/interfaces/FieldModel.js +0 -0
- /package/es/platform/zfield/{entities → domain/entities}/interfaces/IField.js +0 -0
- /package/es/platform/zfield/{entities → domain/entities}/interfaces/IFieldManger.js +0 -0
- /package/es/platform/zhttp/{usecases → applications}/interfaces/InputDependencies.js +0 -0
- /package/es/platform/zhttp/{usecases/interfaces/gateway/IFetchGateWay.js → applications/interfaces/UseCase.js} +0 -0
- /package/es/platform/zhttp/{usecases/interfaces/input/FetchInputModel.js → applications/interfaces/gateway/IFetchGateWay.js} +0 -0
- /package/es/platform/{zlist/entities/interfaces/ActionModel.js → zhttp/applications/interfaces/input/FetchInputModel.js} +0 -0
- /package/es/platform/zhttp/{usecases/interactors → applications/usecases}/AbstractUseCase.js +0 -0
- /package/es/platform/zhttp/{usecases/interactors → applications/usecases}/FetchUseCase.js +0 -0
- /package/es/platform/zlist/{usecases → applications}/interfaces/State.js +0 -0
- /package/es/platform/zlist/{entities/interfaces/ApiPropsModel.js → applications/interfaces/UseCaseDependencies.js} +0 -0
- /package/es/platform/zlist/{usecases → applications}/interfaces/gateways/IRepository.js +0 -0
- /package/es/platform/zlist/{usecases → applications}/interfaces/gateways/IService.js +0 -0
- /package/es/platform/zlist/{entities/interfaces/IList.js → applications/interfaces/gateways/ISortBy.js} +0 -0
- /package/es/platform/zlist/{usecases → applications}/interfaces/gateways/ITransformState.js +0 -0
- /package/es/platform/zlist/{usecases → applications}/interfaces/input/DeleteMultipleRecordUseCaseInput.js +0 -0
- /package/es/platform/zlist/{usecases → applications}/interfaces/input/DeleteSingleRecordUseCaseInput.js +0 -0
- /package/es/platform/zlist/{usecases → applications}/interfaces/input/FetchMoreInput.js +0 -0
- /package/es/platform/zlist/{usecases → applications}/interfaces/input/FieldChangeUseCaseInput.js +0 -0
- /package/es/platform/zlist/{usecases → applications}/interfaces/input/InitializeInput.js +0 -0
- /package/es/platform/zlist/{usecases → applications}/interfaces/input/PropertiesChangeUseCaseInput.js +0 -0
- /package/es/platform/zlist/{usecases → applications}/interfaces/input/RecordExecuteFailedUseCaseInput.js +0 -0
- /package/es/platform/zlist/{usecases → applications}/interfaces/input/RecordExecuteSucceededUseCaseInput.js +0 -0
- /package/es/platform/zlist/{usecases → applications}/interfaces/input/RecordUpdateUseCaseInput.js +0 -0
- /package/es/platform/zlist/{usecases → applications}/interfaces/input/SortingInputModel.js +0 -0
- /package/es/platform/zlist/{usecases/interactors → applications/usecases}/AbstractUseCase.js +0 -0
- /package/es/platform/zlist/{usecases/interactors → applications/usecases}/DeleteMultipleRecordUseCase.js +0 -0
- /package/es/platform/zlist/{usecases/interactors → applications/usecases}/DeleteSingleRecordUseCase.js +0 -0
- /package/es/platform/zlist/{usecases/interactors → applications/usecases}/FetchMoreUseCase.js +0 -0
- /package/es/platform/zlist/{usecases/interactors → applications/usecases}/FieldChangeUseCase.js +0 -0
- /package/es/platform/zlist/{usecases/interactors → applications/usecases}/InitializeUseCase.js +0 -0
- /package/es/platform/zlist/{usecases/interactors → applications/usecases}/PropertiesChangeUseCase.js +0 -0
- /package/es/platform/zlist/{usecases/interactors → applications/usecases}/RecordExecuteFailedUseCase.js +0 -0
- /package/es/platform/zlist/{usecases/interactors → applications/usecases}/RecordExecuteSucceededUseCase.js +0 -0
- /package/es/platform/zlist/{usecases/interactors → applications/usecases}/RecordUpdateUseCase.js +0 -0
- /package/es/platform/zlist/{usecases/interactors → applications/usecases}/SortUseCase.js +0 -0
- /package/es/platform/zlist/{entities/interfaces/Properties.js → domain/entities/interfaces/ActionModel.js} +0 -0
- /package/es/platform/zlist/{entities/interfaces/RecordExecuteAfterMetaData.js → domain/entities/interfaces/ApiPropsModel.js} +0 -0
- /package/es/platform/{zrecord/entities/interfaces/BehaviourState.js → zlist/domain/entities/interfaces/IList.js} +0 -0
- /package/es/platform/{zrecord/entities/interfaces/EventModel.js → zlist/domain/entities/interfaces/Properties.js} +0 -0
- /package/es/platform/{zrecord/entities/interfaces/ICustomFieldValues.js → zlist/domain/entities/interfaces/RecordExecuteAfterMetaData.js} +0 -0
- /package/es/platform/zrecord/{usecases → applications}/interfaces/InputDependencies.js +0 -0
- /package/es/platform/zrecord/{usecases → applications}/interfaces/gateways/IRepository.js +0 -0
- /package/es/platform/zrecord/{usecases → applications}/interfaces/gateways/IService.js +0 -0
- /package/es/platform/zrecord/{usecases → applications}/interfaces/gateways/State.js +0 -0
- /package/es/platform/zrecord/{usecases → applications}/interfaces/input/AppendRecordsInputModel.js +0 -0
- /package/es/platform/zrecord/{usecases → applications}/interfaces/input/DeleteMultipleRecordInputModel.js +0 -0
- /package/es/platform/zrecord/{usecases → applications}/interfaces/input/ExecuteActionInputModel.js +0 -0
- /package/es/platform/zrecord/{usecases → applications}/interfaces/input/FailureInputModel.js +0 -0
- /package/es/platform/zrecord/{usecases → applications}/interfaces/input/FetchMoreInputModel.js +0 -0
- /package/es/platform/zrecord/{usecases → applications}/interfaces/input/FetchStateStopInputModel.js +0 -0
- /package/es/platform/zrecord/{usecases → applications}/interfaces/input/FieldChangeUseCaseInput.js +0 -0
- /package/es/platform/zrecord/{usecases → applications}/interfaces/input/InitializeInputModel.js +0 -0
- /package/es/platform/zrecord/{usecases → applications}/interfaces/input/NoContentInputModel.js +0 -0
- /package/es/platform/zrecord/{usecases → applications}/interfaces/input/RecordUpdateLocalUseCaseInputModel.js +0 -0
- /package/es/platform/zrecord/{usecases → applications}/interfaces/input/RefetchInputModel.js +0 -0
- /package/es/platform/zrecord/{usecases → applications}/interfaces/input/SetRecordsInputModel.js +0 -0
- /package/es/platform/zrecord/{usecases → applications}/interfaces/input/SuccessInputModel.js +0 -0
- /package/es/platform/zrecord/{usecases → applications}/interfaces/output/IPresenter.js +0 -0
- /package/es/platform/zrecord/{usecases/interactors → applications/usecases}/AbstractUseCase.js +0 -0
- /package/es/platform/zrecord/{usecases/interactors → applications/usecases}/AppendRecordsUseCase.js +0 -0
- /package/es/platform/zrecord/{usecases/interactors → applications/usecases}/DeleteMultipleRecordUseCase.js +0 -0
- /package/es/platform/zrecord/{usecases/interactors → applications/usecases}/ExecuteActionUseCase.js +0 -0
- /package/es/platform/zrecord/{usecases/interactors → applications/usecases}/FailureUseCase.js +0 -0
- /package/es/platform/zrecord/{usecases/interactors → applications/usecases}/FetchMoreUseCase.js +0 -0
- /package/es/platform/zrecord/{usecases/interactors → applications/usecases}/FetchStateStopUseCase.js +0 -0
- /package/es/platform/zrecord/{usecases/interactors → applications/usecases}/FieldChangeUseCase.js +0 -0
- /package/es/platform/zrecord/{usecases/interactors → applications/usecases}/InitializeUseCase.js +0 -0
- /package/es/platform/zrecord/{usecases/interactors → applications/usecases}/NoContentUseCase.js +0 -0
- /package/es/platform/zrecord/{usecases/interactors → applications/usecases}/RecordUpdateLocalUseCase.js +0 -0
- /package/es/platform/zrecord/{usecases/interactors → applications/usecases}/RefetchUseCase.js +0 -0
- /package/es/platform/zrecord/{usecases/interactors → applications/usecases}/SetRecordsUseCase.js +0 -0
- /package/es/platform/zrecord/{usecases/interactors → applications/usecases}/SuccessUseCase.js +0 -0
- /package/es/platform/zrecord/{entities → domain/entities}/CustomFieldValues.js +0 -0
- /package/es/platform/zrecord/{entities → domain/entities}/Record.js +0 -0
- /package/es/platform/zrecord/{entities → domain/entities}/Records.js +0 -0
- /package/es/platform/zrecord/{entities → domain/entities}/interfaces/ApiEnum.js +0 -0
- /package/es/platform/zrecord/{entities/interfaces/IRecordName.js → domain/entities/interfaces/BehaviourState.js} +0 -0
- /package/es/platform/zrecord/{entities/interfaces/RecordModel.js → domain/entities/interfaces/EventModel.js} +0 -0
- /package/es/platform/zrecord/{entities/interfaces/RecordsModel.js → domain/entities/interfaces/ICustomFieldValues.js} +0 -0
- /package/es/platform/zrecord/{entities → domain/entities}/interfaces/IRecord.js +0 -0
- /package/es/platform/zrecord/{entities → domain/entities}/interfaces/IRecordExecuteStrategy.js +0 -0
- /package/es/platform/zrecord/{entities/interfaces/StrategyMeta.js → domain/entities/interfaces/IRecordName.js} +0 -0
- /package/es/platform/zrecord/{entities → domain/entities}/interfaces/IRecords.js +0 -0
- /package/es/platform/zrecord/{entities → domain/entities}/interfaces/IRecordsManager.js +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
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
2
|
|
|
3
|
-
import DispatchUseCase from "../../../usecases/
|
|
4
|
-
import InitializeUseCase from "../../../usecases/
|
|
5
|
-
import MountUsecase from "../../../usecases/
|
|
6
|
-
import UnmountUsecase from "../../../usecases/
|
|
7
|
-
import UpdatePropertyUseCase from "../../../usecases/
|
|
8
|
-
import UpdateStateUseCase from "../../../usecases/
|
|
3
|
+
import DispatchUseCase from "../../../applications/usecases/DispatchUseCase";
|
|
4
|
+
import InitializeUseCase from "../../../applications/usecases/InitializeUseCase";
|
|
5
|
+
import MountUsecase from "../../../applications/usecases/MountUseCase";
|
|
6
|
+
import UnmountUsecase from "../../../applications/usecases/UnmountUseCase";
|
|
7
|
+
import UpdatePropertyUseCase from "../../../applications/usecases/UpdatePropertyUseCase";
|
|
8
|
+
import UpdateStateUseCase from "../../../applications/usecases/UpdateStateUseCase";
|
|
9
9
|
|
|
10
10
|
class Service {
|
|
11
11
|
constructor(dependencies) {
|
package/es/library/custom-component/{usecases → applications}/entities-factory/BehavioursFactory.js
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Behaviour from "../../entities/Behaviour";
|
|
1
|
+
import Behaviour from "../../domain/entities/Behaviour";
|
|
2
2
|
import EventHandlersFactory from "./EventHandlersFactory";
|
|
3
3
|
import PropertiesFactory from "./PropertiesFactory";
|
|
4
4
|
/* eslint-disable max-lines-per-function, @zohodesk/architecturerules/no-returnStatement-rule */
|
package/es/library/custom-component/{usecases → applications}/entities-factory/ComponentFactory.js
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import Component from "../../entities/Component";
|
|
2
|
-
import LifeCycleAction from "../../entities/LifeCycleAction";
|
|
3
|
-
import State from "../../entities/State";
|
|
1
|
+
import Component from "../../domain/entities/Component";
|
|
2
|
+
import LifeCycleAction from "../../domain/entities/LifeCycleAction";
|
|
3
|
+
import State from "../../domain/entities/State";
|
|
4
4
|
import EventHandlersFactory from "./EventHandlersFactory";
|
|
5
5
|
import BehavioursFactory from "./BehavioursFactory";
|
|
6
6
|
import PropertiesFactory from "./PropertiesFactory";
|
package/es/library/custom-component/{usecases → applications}/entities-factory/PropertiesFactory.js
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import Properties from "../../entities/Properties";
|
|
2
|
-
import Property from "../../entities/Property";
|
|
1
|
+
import Properties from "../../domain/entities/Properties";
|
|
2
|
+
import Property from "../../domain/entities/Property";
|
|
3
3
|
export default function PropertiesFactory(_ref) {
|
|
4
4
|
let {
|
|
5
5
|
properties,
|
|
@@ -7,7 +7,13 @@ export default function PropertiesFactory(_ref) {
|
|
|
7
7
|
} = _ref;
|
|
8
8
|
let propertyMap = new Map();
|
|
9
9
|
Object.keys(properties).forEach(key => {
|
|
10
|
-
let
|
|
10
|
+
let propertyData = properties[key];
|
|
11
|
+
|
|
12
|
+
if (propertyData.name === undefined) {
|
|
13
|
+
propertyData.name = key;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
let property = new Property(propertyData);
|
|
11
17
|
propertyMap.set(key, property);
|
|
12
18
|
});
|
|
13
19
|
let propertiesObject = new Properties(propertyMap, componentName);
|
package/es/library/custom-component/{usecases/interactors → applications/usecases}/UnmountUseCase.js
RENAMED
|
@@ -12,8 +12,8 @@ class UnmountUsecase extends AbstractUseCase {
|
|
|
12
12
|
let unmountAction = component.getUnmountAction();
|
|
13
13
|
|
|
14
14
|
try {
|
|
15
|
-
eventManager.unSubscribe(eventHanlders);
|
|
16
15
|
eventManager.dispatch(unmountAction);
|
|
16
|
+
eventManager.unSubscribe(eventHanlders);
|
|
17
17
|
repository.clear();
|
|
18
18
|
} catch (e) {
|
|
19
19
|
presenter.setError([]);
|
|
@@ -28,9 +28,19 @@ export default class Component {
|
|
|
28
28
|
this._behavioursProperties = {};
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
getAllBehavioursPropertiesWithValue() {
|
|
32
|
+
let output = {};
|
|
33
|
+
Object.keys(this._behavioursProperties).forEach((value, key) => {
|
|
34
|
+
output[value] = this._behavioursProperties[value].getValue();
|
|
35
|
+
});
|
|
36
|
+
return output;
|
|
37
|
+
}
|
|
38
|
+
|
|
31
39
|
mergeStateAndProps() {
|
|
32
40
|
return { ...this._state.getState(),
|
|
33
|
-
properties: this._properties.getAllPropertiesValue()
|
|
41
|
+
properties: { ...this._properties.getAllPropertiesValue(),
|
|
42
|
+
...this.getAllBehavioursPropertiesWithValue()
|
|
43
|
+
}
|
|
34
44
|
};
|
|
35
45
|
}
|
|
36
46
|
|
|
@@ -103,17 +113,30 @@ export default class Component {
|
|
|
103
113
|
if (this._behavioursProperties[key]) {
|
|
104
114
|
let property = this._behavioursProperties[key];
|
|
105
115
|
let optionalSchema = property.getTypeMetadata().schema;
|
|
106
|
-
|
|
116
|
+
|
|
117
|
+
let isValid = this._properties.validateSingleProperty(jsonValidator, key, newProps[key], optionalSchema);
|
|
118
|
+
|
|
119
|
+
if (isValid) {
|
|
120
|
+
property.updateValue(newProps[key]);
|
|
121
|
+
} // return isValid
|
|
122
|
+
|
|
107
123
|
} else if (this._properties.findProperty(key)) {
|
|
108
124
|
let property = this._properties.findProperty(key);
|
|
109
125
|
|
|
110
126
|
let schema = property.getTypeMetadata().schema;
|
|
111
|
-
|
|
127
|
+
|
|
128
|
+
let isValid = this._properties.validateSingleProperty(jsonValidator, key, newProps[key], schema);
|
|
129
|
+
|
|
130
|
+
if (isValid) {
|
|
131
|
+
property.updateValue(newProps[key]);
|
|
132
|
+
} // return isValid
|
|
133
|
+
|
|
112
134
|
} else {
|
|
113
135
|
throw new Error(`props '${key}' not exist `);
|
|
114
136
|
}
|
|
115
|
-
});
|
|
116
|
-
|
|
137
|
+
}); // return this._properties.updateAllPropertiesValue(jsonValidator, newProps);
|
|
138
|
+
|
|
139
|
+
return true;
|
|
117
140
|
}
|
|
118
141
|
|
|
119
142
|
updateState(state) {
|
|
@@ -137,10 +160,14 @@ export default class Component {
|
|
|
137
160
|
|
|
138
161
|
const properties = this._properties.getAllPropertiesValue();
|
|
139
162
|
|
|
163
|
+
const behavioursProperties = this.getAllBehavioursPropertiesWithValue();
|
|
140
164
|
const behaviours = this.getAllBehavioursInitialState();
|
|
165
|
+
let allProperties = { ...properties,
|
|
166
|
+
...behavioursProperties
|
|
167
|
+
};
|
|
141
168
|
|
|
142
169
|
const initialState = this._stateInitializer({
|
|
143
|
-
properties
|
|
170
|
+
properties: allProperties
|
|
144
171
|
});
|
|
145
172
|
|
|
146
173
|
this.updateState({ ...initialState,
|
|
@@ -149,7 +176,9 @@ export default class Component {
|
|
|
149
176
|
}
|
|
150
177
|
|
|
151
178
|
getProperties() {
|
|
152
|
-
return this._properties.getAllPropertiesValue()
|
|
179
|
+
return { ...this._properties.getAllPropertiesValue(),
|
|
180
|
+
...this.getAllBehavioursPropertiesWithValue()
|
|
181
|
+
};
|
|
153
182
|
}
|
|
154
183
|
|
|
155
184
|
getEventHandlersWrapper() {
|
|
@@ -2,7 +2,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
2
2
|
|
|
3
3
|
import Property from "./Property";
|
|
4
4
|
import defaultAppendToActionPayload from "./DefaultAppendToActionPayload";
|
|
5
|
-
import getRefPropertySchema from "
|
|
5
|
+
import getRefPropertySchema from "../../../../cc/component/properties/getRefPropertySchema";
|
|
6
6
|
export default class Properties {
|
|
7
7
|
constructor(properties, componentName) {
|
|
8
8
|
this.componentName = componentName;
|
|
@@ -27,18 +27,17 @@ export default class Properties {
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
updateAllPropertiesValue(validator, propertyValue) {
|
|
30
|
-
this.validateProperties(validator, propertyValue);
|
|
31
|
-
|
|
30
|
+
// this.validateProperties(validator, propertyValue);
|
|
32
31
|
if (!this.isEqual(propertyValue)) {
|
|
33
32
|
let isChanged = false;
|
|
34
33
|
Object.keys(propertyValue).forEach(key => {
|
|
35
34
|
let property = this.findProperty(key);
|
|
36
35
|
|
|
37
36
|
if (property.getValue() == null || property.getValue() == undefined) {
|
|
38
|
-
property.updateValue(propertyValue[key]);
|
|
37
|
+
// property.updateValue(propertyValue[key]);
|
|
39
38
|
isChanged = true;
|
|
40
39
|
} else if (property.getValue() != propertyValue[key]) {
|
|
41
|
-
property.updateValue(propertyValue[key]);
|
|
40
|
+
// property.updateValue(propertyValue[key]);
|
|
42
41
|
isChanged = true;
|
|
43
42
|
}
|
|
44
43
|
});
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/* eslint-disable react/prop-types */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import createCustomComponent from "../createCustomComponent";
|
|
4
|
+
import { render, screen } from '@testing-library/react';
|
|
5
|
+
import '@testing-library/jest-dom';
|
|
6
|
+
|
|
7
|
+
let View = (_ref, ref) => {
|
|
8
|
+
let {
|
|
9
|
+
state
|
|
10
|
+
} = _ref;
|
|
11
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
12
|
+
ref: ref,
|
|
13
|
+
"data-testid": "custom-component",
|
|
14
|
+
"data-title": state.properties.title
|
|
15
|
+
}, "Hey");
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
let mockComponentCC = {
|
|
19
|
+
name: 'mockComponent',
|
|
20
|
+
View: View,
|
|
21
|
+
properties: {},
|
|
22
|
+
eventHandlers: {
|
|
23
|
+
"mockComponent#MOUNT": jest.fn(),
|
|
24
|
+
"mockComponent#UN_MOUNT": jest.fn(),
|
|
25
|
+
"mockComponent#UPDATE_PROPERTIES": jest.fn()
|
|
26
|
+
},
|
|
27
|
+
properties: {
|
|
28
|
+
title: {
|
|
29
|
+
name: 'titile',
|
|
30
|
+
defaultValue: 'default',
|
|
31
|
+
typeMetadata: {
|
|
32
|
+
schema: {
|
|
33
|
+
type: 'string'
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
behaviour: [{
|
|
39
|
+
name: 'test',
|
|
40
|
+
properties: {},
|
|
41
|
+
setInitialState: () => ({}),
|
|
42
|
+
eventHandlers: {}
|
|
43
|
+
}]
|
|
44
|
+
};
|
|
45
|
+
describe('createCustomComponent integration test', () => {
|
|
46
|
+
// basic rendering test
|
|
47
|
+
it('should mount the component and check the rendering', () => {
|
|
48
|
+
const CustomComponent = createCustomComponent(mockComponentCC);
|
|
49
|
+
let {
|
|
50
|
+
container
|
|
51
|
+
} = render( /*#__PURE__*/React.createElement(CustomComponent, null));
|
|
52
|
+
expect(container).toBeInTheDocument();
|
|
53
|
+
}); // test if the ref is passed to the component
|
|
54
|
+
|
|
55
|
+
it('should pass the ref to the component', () => {
|
|
56
|
+
const CustomComponent = createCustomComponent(mockComponentCC);
|
|
57
|
+
let ref = /*#__PURE__*/React.createRef();
|
|
58
|
+
render( /*#__PURE__*/React.createElement(CustomComponent, {
|
|
59
|
+
ref: ref
|
|
60
|
+
}));
|
|
61
|
+
expect(typeof ref.current).toBe('object');
|
|
62
|
+
});
|
|
63
|
+
it('should pass props to the custom component', () => {
|
|
64
|
+
const CustomComponent = createCustomComponent(mockComponentCC);
|
|
65
|
+
render( /*#__PURE__*/React.createElement(CustomComponent, null));
|
|
66
|
+
const component = screen.getByTestId('custom-component');
|
|
67
|
+
expect(component).toHaveAttribute('data-testid', 'custom-component');
|
|
68
|
+
});
|
|
69
|
+
it('should initialize custom behavior state', () => {
|
|
70
|
+
const CustomComponent = createCustomComponent(mockComponentCC);
|
|
71
|
+
render( /*#__PURE__*/React.createElement(CustomComponent, null));
|
|
72
|
+
const {
|
|
73
|
+
behaviour
|
|
74
|
+
} = mockComponentCC;
|
|
75
|
+
expect(behaviour[0].setInitialState()).toEqual({});
|
|
76
|
+
});
|
|
77
|
+
it('should call the MOUNT event handler on mounting', () => {
|
|
78
|
+
const CustomComponent = createCustomComponent(mockComponentCC);
|
|
79
|
+
render( /*#__PURE__*/React.createElement(CustomComponent, null));
|
|
80
|
+
expect(mockComponentCC.eventHandlers['mockComponent#MOUNT']).toHaveBeenCalled();
|
|
81
|
+
});
|
|
82
|
+
it('should update component when props change and update property event', () => {
|
|
83
|
+
const CustomComponent = createCustomComponent(mockComponentCC);
|
|
84
|
+
const {
|
|
85
|
+
rerender
|
|
86
|
+
} = render( /*#__PURE__*/React.createElement(CustomComponent, {
|
|
87
|
+
title: "Initial Title"
|
|
88
|
+
}));
|
|
89
|
+
let component = screen.getByTestId('custom-component');
|
|
90
|
+
expect(component).toHaveAttribute('data-title', 'Initial Title');
|
|
91
|
+
rerender( /*#__PURE__*/React.createElement(CustomComponent, {
|
|
92
|
+
title: "Updated Title"
|
|
93
|
+
}));
|
|
94
|
+
component = screen.getByTestId('custom-component');
|
|
95
|
+
expect(component).toHaveAttribute('data-title', 'Updated Title');
|
|
96
|
+
expect(mockComponentCC.eventHandlers['mockComponent#UPDATE_PROPERTIES']).toHaveBeenCalled();
|
|
97
|
+
});
|
|
98
|
+
it('should clean up properly on unmount', () => {
|
|
99
|
+
const CustomComponent = createCustomComponent(mockComponentCC);
|
|
100
|
+
const {
|
|
101
|
+
unmount
|
|
102
|
+
} = render( /*#__PURE__*/React.createElement(CustomComponent, null));
|
|
103
|
+
unmount();
|
|
104
|
+
expect(mockComponentCC.eventHandlers['mockComponent#UN_MOUNT']).toHaveBeenCalled();
|
|
105
|
+
});
|
|
106
|
+
});
|
|
@@ -1,38 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import Flex from '@zohodesk/layout/es/Flex/Flex';
|
|
3
2
|
import ComponentRegistry from "../../../../../custom-component/frameworks/ui/ComponentRegistry";
|
|
4
|
-
import
|
|
5
|
-
const defaultUiMapping = {
|
|
6
|
-
ActionIcon: ActionIcon
|
|
7
|
-
};
|
|
3
|
+
import ActionsRenderer from "../../../actions-renderer/frameworks/ui/ActionsRenderer";
|
|
8
4
|
export default function ActionLocationView(_ref, ref) {
|
|
9
5
|
let {
|
|
10
6
|
state
|
|
11
7
|
} = _ref;
|
|
12
8
|
const {
|
|
13
|
-
actions
|
|
9
|
+
actions,
|
|
10
|
+
type
|
|
14
11
|
} = state.properties;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
$ui_justifyContent: "end"
|
|
21
|
-
}, actions.map((action, index) => {
|
|
22
|
-
const {
|
|
23
|
-
type,
|
|
24
|
-
properties,
|
|
25
|
-
eventMappings
|
|
26
|
-
} = action;
|
|
27
|
-
/* eslint-disable-next-line @zohodesk/architecturerules/no-defaultProps-rule */
|
|
28
|
-
|
|
29
|
-
const ActionUiType = defaultUiMapping[type] || ComponentRegistry.get(type);
|
|
30
|
-
return /*#__PURE__*/React.createElement(ActionUiType, {
|
|
31
|
-
key: index,
|
|
32
|
-
...properties,
|
|
33
|
-
appendToActionPayload: {
|
|
34
|
-
eventMappings
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
}));
|
|
12
|
+
const ActionsRendererComponent = ComponentRegistry.get(type) || ActionsRenderer;
|
|
13
|
+
return /*#__PURE__*/React.createElement(ActionsRendererComponent, {
|
|
14
|
+
actions: actions,
|
|
15
|
+
getRef: ref
|
|
16
|
+
});
|
|
38
17
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createCustomComponent } from "../../../../../custom-component";
|
|
2
|
+
import ActionLocationProperties from "../../../../../../cc/action-location/Properties";
|
|
3
|
+
import ActionsRendererView from "./ActionsRendererView";
|
|
4
|
+
export default createCustomComponent({
|
|
5
|
+
name: 'ActionsRenderer',
|
|
6
|
+
properties: ActionLocationProperties,
|
|
7
|
+
eventHandlers: {},
|
|
8
|
+
View: ActionsRendererView
|
|
9
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ComponentRegistry from "../../../../../custom-component/frameworks/ui/ComponentRegistry";
|
|
3
|
+
import ActionComponentMapping from "../../../action-location/frameworks/ui/ActionComponentMapping";
|
|
4
|
+
import Flex from '@zohodesk/layout/es/Flex/Flex';
|
|
5
|
+
|
|
6
|
+
function ActionsRendererView(_ref, ref) {
|
|
7
|
+
let {
|
|
8
|
+
state
|
|
9
|
+
} = _ref;
|
|
10
|
+
const {
|
|
11
|
+
actions
|
|
12
|
+
} = state.properties;
|
|
13
|
+
return /*#__PURE__*/React.createElement(Flex, {
|
|
14
|
+
ref: ref,
|
|
15
|
+
$ui_displayMode: "inline",
|
|
16
|
+
$ui_alignItems: "center"
|
|
17
|
+
}, actions.map((action, index) => {
|
|
18
|
+
const {
|
|
19
|
+
type,
|
|
20
|
+
properties,
|
|
21
|
+
eventMappings
|
|
22
|
+
} = action;
|
|
23
|
+
/* eslint-disable-next-line @zohodesk/architecturerules/no-defaultProps-rule */
|
|
24
|
+
|
|
25
|
+
const ActionUiType = ActionComponentMapping[type] || ComponentRegistry.get(type);
|
|
26
|
+
return /*#__PURE__*/React.createElement(ActionUiType, {
|
|
27
|
+
key: index,
|
|
28
|
+
...properties,
|
|
29
|
+
appendToActionPayload: {
|
|
30
|
+
eventMappings
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
;
|
|
37
|
+
export default ActionsRendererView;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Row from "./row/Row";
|
|
3
|
-
const emptyArray = Object.freeze([]);
|
|
4
|
-
const emptyObject = {};
|
|
5
3
|
|
|
6
4
|
function Rows(_ref) {
|
|
7
5
|
let {
|
|
@@ -25,15 +23,13 @@ function getRowProps(row, headers, isFlexibleColumns, isSelectionEnabled, resize
|
|
|
25
23
|
isSelected,
|
|
26
24
|
isSelectable,
|
|
27
25
|
selectionTooltip,
|
|
28
|
-
|
|
29
|
-
rowActions
|
|
26
|
+
rowActionLocation
|
|
30
27
|
} = row;
|
|
31
28
|
const updatedColumns = getUpdatedColumns(columns, headers);
|
|
32
29
|
return {
|
|
33
30
|
id,
|
|
34
|
-
columns: updatedColumns
|
|
35
|
-
|
|
36
|
-
rowActions: rowActions || emptyArray,
|
|
31
|
+
columns: updatedColumns,
|
|
32
|
+
rowActionLocation,
|
|
37
33
|
isSelected,
|
|
38
34
|
isSelectable,
|
|
39
35
|
selectionTooltip,
|
package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/HeaderData.js
CHANGED
|
@@ -29,15 +29,17 @@ function HeaderData(_ref) {
|
|
|
29
29
|
$ui_size: size,
|
|
30
30
|
$ui_align: alignment,
|
|
31
31
|
$data_width: resizedWidth,
|
|
32
|
-
$flag_flexible: isFlexibleColumns
|
|
32
|
+
$flag_flexible: isFlexibleColumns,
|
|
33
|
+
$a11yAttributes_container: {
|
|
34
|
+
'aria-sort': sortable ? sortedBy : 'none'
|
|
35
|
+
}
|
|
33
36
|
}, /*#__PURE__*/React.createElement(HeaderText, {
|
|
34
37
|
id: id,
|
|
35
38
|
name: name,
|
|
36
39
|
text: text,
|
|
37
40
|
sortable: sortable,
|
|
38
41
|
sortedBy: sortedBy,
|
|
39
|
-
sortTooltip: sortTooltip
|
|
40
|
-
,
|
|
42
|
+
sortTooltip: sortTooltip,
|
|
41
43
|
dispatch: dispatch
|
|
42
44
|
}), /*#__PURE__*/React.createElement(ColumnResizer, {
|
|
43
45
|
isResizerEnabled: isResizerEnabled,
|
|
@@ -25,11 +25,15 @@ function RowView(_ref, ref) {
|
|
|
25
25
|
const {
|
|
26
26
|
id,
|
|
27
27
|
columns,
|
|
28
|
-
|
|
28
|
+
rowActionLocation,
|
|
29
29
|
isFlexibleColumns,
|
|
30
30
|
resizedColumnsWidth,
|
|
31
31
|
hasActions
|
|
32
32
|
} = state.properties;
|
|
33
|
+
const {
|
|
34
|
+
type,
|
|
35
|
+
actions
|
|
36
|
+
} = rowActionLocation;
|
|
33
37
|
return /*#__PURE__*/React.createElement(TableRow, {
|
|
34
38
|
key: id,
|
|
35
39
|
ref: ref,
|
|
@@ -54,8 +58,8 @@ function RowView(_ref, ref) {
|
|
|
54
58
|
isFlexibleColumns
|
|
55
59
|
}), renderRowActions({
|
|
56
60
|
hasActions,
|
|
57
|
-
|
|
58
|
-
|
|
61
|
+
type,
|
|
62
|
+
actions
|
|
59
63
|
}));
|
|
60
64
|
}
|
|
61
65
|
|
|
@@ -94,13 +98,13 @@ function renderColumns(_ref3) {
|
|
|
94
98
|
function renderRowActions(_ref4) {
|
|
95
99
|
let {
|
|
96
100
|
hasActions,
|
|
97
|
-
|
|
98
|
-
|
|
101
|
+
actions,
|
|
102
|
+
type
|
|
99
103
|
} = _ref4;
|
|
100
104
|
return /*#__PURE__*/React.createElement(RowActions, {
|
|
101
105
|
hasActions: hasActions,
|
|
102
|
-
|
|
103
|
-
|
|
106
|
+
type: type,
|
|
107
|
+
actions: actions
|
|
104
108
|
});
|
|
105
109
|
}
|
|
106
110
|
|
|
@@ -4,13 +4,16 @@ import ActionLocation from "../../../../../action-location/frameworks/ui/ActionL
|
|
|
4
4
|
export default function RowActions(_ref) {
|
|
5
5
|
let {
|
|
6
6
|
hasActions,
|
|
7
|
+
type = '',
|
|
7
8
|
actions
|
|
8
9
|
} = _ref;
|
|
9
10
|
|
|
11
|
+
// TODO: Need to fix the defaultValue from properties => CC
|
|
10
12
|
if (hasActions) {
|
|
11
13
|
return /*#__PURE__*/React.createElement(TableAction, {
|
|
12
14
|
$ui_size: "medium"
|
|
13
15
|
}, /*#__PURE__*/React.createElement(ActionLocation, {
|
|
16
|
+
type: type,
|
|
14
17
|
actions: actions
|
|
15
18
|
}));
|
|
16
19
|
}
|
package/es/library/dot/legacy-to-new-arch/action-icon/{ActionIcon.js → frameworks/ui/ActionIcon.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createCustomComponent } from "
|
|
2
|
-
import Properties from "
|
|
1
|
+
import { createCustomComponent } from "../../../../../custom-component";
|
|
2
|
+
import Properties from "../../../../../../cc/action-icon/Properties";
|
|
3
3
|
import ActionIconView from "./ActionIconView";
|
|
4
4
|
const ActionIcon = createCustomComponent({
|
|
5
5
|
name: 'ActionIcon',
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import ActionIcon from '@zohodesk-private/desk-components/es/ActionIcon/ActionIcon';
|
|
3
|
-
import Constants from "
|
|
3
|
+
import Constants from "../../../../../../cc/action-icon/Constants"; // @ts-ignore
|
|
4
|
+
|
|
5
|
+
import style from "./css/ActionIcon.module.css";
|
|
4
6
|
export default function ActionIconView(_ref, ref) {
|
|
5
7
|
let {
|
|
6
8
|
state,
|
|
@@ -9,22 +11,26 @@ export default function ActionIconView(_ref, ref) {
|
|
|
9
11
|
const {
|
|
10
12
|
icon,
|
|
11
13
|
label,
|
|
12
|
-
hoverVariant
|
|
14
|
+
hoverVariant,
|
|
15
|
+
isDisabled,
|
|
16
|
+
isVisible
|
|
13
17
|
} = state.properties;
|
|
14
18
|
const {
|
|
15
19
|
dispatch
|
|
16
20
|
} = helpers;
|
|
17
21
|
return /*#__PURE__*/React.createElement("span", {
|
|
18
|
-
ref: ref
|
|
22
|
+
ref: ref,
|
|
23
|
+
className: isVisible ? '' : style.hide
|
|
19
24
|
}, /*#__PURE__*/React.createElement(ActionIcon, {
|
|
20
25
|
$ui_iconName: icon,
|
|
21
26
|
$ui_hoverVariant: hoverVariant,
|
|
22
27
|
$flag_gap: true,
|
|
28
|
+
$flag_disabled: isDisabled,
|
|
23
29
|
$i18n_tooltip: label,
|
|
24
|
-
$event_onClick: () => {
|
|
30
|
+
$event_onClick: !isDisabled ? () => {
|
|
25
31
|
dispatch({
|
|
26
32
|
type: Constants.ACTION_ICON_CLICKED
|
|
27
33
|
});
|
|
28
|
-
}
|
|
34
|
+
} : null
|
|
29
35
|
}));
|
|
30
36
|
}
|
|
@@ -6,4 +6,4 @@ export { default as Link } from "./link/frameworks/ui/Link";
|
|
|
6
6
|
export { default as Switch } from "./switch/frameworks/ui/Switch";
|
|
7
7
|
export { default as Tags } from "./tags/frameworks/ui/Tags";
|
|
8
8
|
export { default as Text } from "./text/frameworks/ui/Text";
|
|
9
|
-
export { default as ActionIcon } from "./action-icon/ActionIcon";
|
|
9
|
+
export { default as ActionIcon } from "./action-icon/frameworks/ui/ActionIcon";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
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
2
|
|
|
3
|
-
import DataBrokerFactory from "../../
|
|
3
|
+
import DataBrokerFactory from "../../applications/entities-factory/DataBrokerFactory";
|
|
4
4
|
export default class Repository {
|
|
5
5
|
constructor() {
|
|
6
6
|
_defineProperty(this, "state", void 0);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
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
2
|
|
|
3
|
-
import RegisterUseCase from "../../usecases/
|
|
4
|
-
import ExecuteActionUseCase from "../../usecases/
|
|
5
|
-
import FailureUseCase from "../../usecases/
|
|
6
|
-
import SuccessUseCase from "../../usecases/
|
|
7
|
-
import NoContentUseCase from "../../usecases/
|
|
3
|
+
import RegisterUseCase from "../../applications/usecases/RegisterUseCase";
|
|
4
|
+
import ExecuteActionUseCase from "../../applications/usecases/ExecuteActionUseCase";
|
|
5
|
+
import FailureUseCase from "../../applications/usecases/FailureUseCase";
|
|
6
|
+
import SuccessUseCase from "../../applications/usecases/SuccessUseCase";
|
|
7
|
+
import NoContentUseCase from "../../applications/usecases/NoContentUseCase";
|
|
8
8
|
export default class Service {
|
|
9
9
|
constructor(dependencies) {
|
|
10
10
|
_defineProperty(this, "registerUseCase", void 0);
|
|
@@ -17,6 +17,27 @@ export default class TemplateHelpers {
|
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
isOnlyTemplateVariables(inputString) {
|
|
21
|
+
return /^{{(.*?)}}$/.test(inputString);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
replaceTemplateVariablesInObject(properties, replacementObj) {
|
|
25
|
+
const replaced = {};
|
|
26
|
+
Object.entries(properties).forEach(_ref => {
|
|
27
|
+
let [key, value] = _ref;
|
|
28
|
+
|
|
29
|
+
if (typeof value === 'string' && this.isOnlyTemplateVariables(value)) {
|
|
30
|
+
const path = value.replace(/{{(.*?)}}/g, '$1');
|
|
31
|
+
replaced[key] = this.getPathValue(path, replacementObj);
|
|
32
|
+
} else if (typeof value === 'string' && value.includes('{{')) {
|
|
33
|
+
replaced[key] = this.replaceTemplateVariables(value, replacementObj);
|
|
34
|
+
} else {
|
|
35
|
+
replaced[key] = value;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
return replaced;
|
|
39
|
+
}
|
|
40
|
+
|
|
20
41
|
objectToQueryString(obj) {
|
|
21
42
|
return Object.keys(obj).map(key => encodeURIComponent(key) + '=' + encodeURIComponent(obj[key])).join('&');
|
|
22
43
|
}
|
package/es/platform/zdata-broker/{usecases → applications}/entities-factory/APITemplatesFactory.js
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import APITemplate from "../../entities/APITemplate";
|
|
2
|
-
import APITemplates from "../../entities/APITemplates";
|
|
1
|
+
import APITemplate from "../../domain/entities/APITemplate";
|
|
2
|
+
import APITemplates from "../../domain/entities/APITemplates";
|
|
3
3
|
export default class APITemplatesFactory {
|
|
4
4
|
static create(httpTemplates, templateHelpers) {
|
|
5
5
|
const apiTemplatesMap = new Map();
|