@zohodesk/library-platform 1.0.2 → 1.1.0-exp.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/list-selection/Properties.js +21 -12
- package/es/bc/sort-by/Properties.js +20 -15
- package/es/bc/table-column-resizer/Properties.js +1 -1
- package/es/bc/zclient-actions/Constants.js +11 -0
- package/es/bc/zclient-actions/EventHandlers.js +1 -0
- package/es/bc/zhttp/Properties.js +11 -1
- package/es/bc/zlist/Properties.js +15 -3
- package/es/bc/zrecord/Constants.js +3 -1
- 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/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/table-connected/Properties.js +52 -45
- package/es/cc/table-list/Properties.js +109 -324
- package/es/cc/table-list/data-types/Header.js +8 -7
- package/es/cc/table-list/data-types/RowCursor.js +8 -0
- package/es/cc/table-list/model/RowModel.js +2 -4
- package/es/cc/table-list/row/Properties.js +15 -10
- package/es/desk-frameworks/table-connected/frameworks/TableConnectedFactory.js +4 -1
- package/es/desk-frameworks/table-connected/frameworks/TableConnectedView.js +14 -13
- package/es/desk-frameworks/table-connected/frameworks/__tests__/TableConnectedFactory.spec.js +453 -0
- package/es/desk-frameworks/table-connected/frameworks/__tests__/mock/data-broker/http-template/getAvailableFields.js +86 -0
- package/es/desk-frameworks/table-connected/frameworks/__tests__/mock/data-broker/http-template/getRecords.js +81 -0
- package/es/desk-frameworks/table-connected/frameworks/__tests__/mock/data-broker/http-template/getSelectedFields.js +32 -0
- package/es/desk-frameworks/table-connected/frameworks/__tests__/mock/data-broker/index.js +11 -0
- 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/list-selection/{entities → domain/entities}/ListItemSelection.js +29 -9
- 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 +40 -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/TableListView.js +16 -6
- package/es/library/dot/components/table-list/frameworks/ui/css/TableList.module.css +10 -0
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/Header.js +7 -6
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/Rows.js +12 -14
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/ActionColumn.js +3 -2
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/HeaderData.js +7 -7
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/Headers.js +0 -4
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/SelectAll.js +4 -4
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/Columns.js +2 -6
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/Row.js +24 -14
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/RowActions.js +5 -1
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/RowData.js +2 -4
- 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/data-broker/http-template/deleteRecord.js +1 -1
- package/es/platform/data-broker/http-template/deleteRecords.js +1 -1
- package/es/platform/data-broker/http-template/getAvailableFields.js +1 -1
- package/es/platform/data-broker/http-template/getClientActions.js +23 -0
- package/es/platform/data-broker/http-template/getRecords.js +1 -1
- package/es/platform/data-broker/http-template/getSelectedFields.js +1 -1
- package/es/platform/data-broker/http-template/updateRecord.js +1 -1
- package/es/platform/data-broker/index.js +3 -3
- package/es/platform/zclient-actions/Readme.md +38 -0
- package/es/platform/zclient-actions/adapters/controllers/AbstractController.js +8 -0
- package/es/platform/zclient-actions/adapters/controllers/ClientActionBehaviourExecutorController.js +27 -0
- package/es/platform/zclient-actions/adapters/controllers/FailureController.js +28 -0
- package/es/platform/zclient-actions/adapters/controllers/FetchStateStopController.js +21 -0
- package/es/platform/zclient-actions/adapters/controllers/MountController.js +25 -0
- package/es/platform/zclient-actions/adapters/controllers/NoContentController.js +23 -0
- package/es/platform/zclient-actions/adapters/controllers/SetClientActionsController.js +24 -0
- package/es/platform/zclient-actions/adapters/controllers/SuccessController.js +28 -0
- package/es/platform/zclient-actions/adapters/gateways/Repository.js +28 -0
- package/es/platform/zclient-actions/adapters/gateways/Service.js +35 -0
- package/es/platform/zclient-actions/adapters/presenters/Presenter.js +24 -0
- package/es/platform/zclient-actions/applications/entities-factory/ClientActionFactory.js +12 -0
- package/es/platform/zclient-actions/applications/entities-factory/ClientActionManagerFactory.js +10 -0
- package/es/platform/zclient-actions/applications/usecases/ExecuteActionBehaviourUseCase.js +33 -0
- package/es/platform/zclient-actions/applications/usecases/FailureUseCase.js +22 -0
- package/es/platform/zclient-actions/applications/usecases/FetchStateStopUseCase.js +25 -0
- package/es/platform/zclient-actions/applications/usecases/NoContentUseCase.js +27 -0
- package/es/platform/zclient-actions/applications/usecases/SetClientActionsUseCase.js +21 -0
- package/es/platform/zclient-actions/applications/usecases/SuccessUseCase.js +22 -0
- package/es/platform/zclient-actions/domain/entities/ClientAction.js +57 -0
- package/es/platform/zclient-actions/domain/entities/ClientActionManager.js +141 -0
- package/es/platform/zclient-actions/domain/entities/ClientActions.js +54 -0
- package/es/platform/zclient-actions/domain/entities/EventMapping.js +32 -0
- package/es/platform/zclient-actions/domain/entities/EventMappings.js +15 -0
- package/es/platform/zclient-actions/domain/entities/GetClientActionsStrategy.js +44 -0
- package/es/platform/zclient-actions/domain/entities/UIComponentMapping.js +37 -0
- package/es/platform/zclient-actions/domain/entities/interfaces/IUIComponentMapping.js +0 -0
- package/es/platform/zclient-actions/frameworks/ActionsHandlersFactory.js +47 -0
- package/es/platform/zclient-actions/frameworks/ClientActionBehaviourFactory.js +12 -0
- package/es/platform/zdata-broker/adapters/controllers/{ActionExecutorController.js → DataBrokerExecutorController.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/IService.js +0 -0
- 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/domain/entities/interfaces/IDataBroker.js +0 -0
- package/es/platform/zdata-broker/{entities → domain/entities}/interfaces/MetaData.js +1 -1
- package/es/platform/zdata-broker/frameworks/EventHandlersFactory.js +3 -3
- 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 +4 -2
- package/es/platform/zlist/adapters/gateways/Service.js +10 -10
- package/es/platform/zlist/adapters/presenters/TableTranslator.js +32 -2
- package/es/platform/zlist/adapters/presenters/translators/ColumnAlignmentTranslator.js +11 -0
- package/es/platform/zlist/adapters/presenters/translators/ColumnSizeTranslator.js +23 -0
- package/es/platform/zlist/adapters/presenters/translators/Header.js +4 -3
- 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/applications/entities-factory/ListFactory.js +16 -0
- package/es/platform/zlist/applications/interfaces/gateways/ITransformState.js +0 -0
- package/es/platform/zlist/applications/interfaces/input/SortingInputModel.js +1 -0
- package/es/platform/zlist/{entities → domain/entities}/List.js +15 -24
- package/es/platform/zlist/domain/entities/interfaces/ActionModel.js +1 -0
- package/es/platform/zlist/domain/entities/interfaces/ApiPropsModel.js +1 -0
- package/es/platform/zlist/domain/entities/interfaces/IList.js +1 -0
- package/es/platform/zlist/domain/entities/interfaces/Properties.js +1 -0
- package/es/platform/zlist/domain/entities/interfaces/RecordExecuteAfterMetaData.js +1 -0
- 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/applications/interfaces/InputDependencies.js +1 -0
- package/es/platform/zrecord/applications/interfaces/gateways/IRepository.js +1 -0
- package/es/platform/zrecord/applications/interfaces/gateways/IService.js +0 -0
- package/es/platform/zrecord/applications/interfaces/gateways/State.js +1 -0
- package/es/platform/zrecord/applications/interfaces/input/AppendRecordsInputModel.js +1 -0
- package/es/platform/zrecord/applications/interfaces/input/DeleteMultipleRecordInputModel.js +1 -0
- package/es/platform/zrecord/applications/interfaces/input/ExecuteActionInputModel.js +1 -0
- package/es/platform/zrecord/applications/interfaces/input/FailureInputModel.js +1 -0
- package/es/platform/zrecord/applications/interfaces/input/FetchMoreInputModel.js +1 -0
- package/es/platform/zrecord/applications/interfaces/input/FetchStateStopInputModel.js +1 -0
- package/es/platform/zrecord/applications/interfaces/input/FieldChangeUseCaseInput.js +1 -0
- package/es/platform/zrecord/applications/interfaces/input/InitializeInputModel.js +1 -0
- package/es/platform/zrecord/applications/interfaces/input/NoContentInputModel.js +1 -0
- package/es/platform/zrecord/applications/interfaces/input/RecordUpdateLocalUseCaseInputModel.js +1 -0
- package/es/platform/zrecord/applications/interfaces/input/RefetchInputModel.js +1 -0
- package/es/platform/zrecord/applications/interfaces/input/SetRecordsInputModel.js +1 -0
- package/es/platform/zrecord/applications/interfaces/input/SuccessInputModel.js +1 -0
- package/es/platform/zrecord/applications/interfaces/output/IPresenter.js +1 -0
- package/es/platform/zrecord/applications/usecases/AbstractUseCase.js +17 -0
- package/es/platform/zrecord/applications/usecases/InitializeUseCase.js +17 -0
- 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/BehaviourState.js +1 -0
- package/es/platform/zrecord/domain/entities/interfaces/EventModel.js +1 -0
- package/es/platform/zrecord/domain/entities/interfaces/ICustomFieldValues.js +1 -0
- package/es/platform/zrecord/domain/entities/interfaces/IRecord.js +0 -0
- package/es/platform/zrecord/domain/entities/interfaces/IRecordExecuteStrategy.js +0 -0
- package/es/platform/zrecord/domain/entities/interfaces/IRecordName.js +1 -0
- package/es/platform/zrecord/domain/entities/interfaces/IRecords.js +0 -0
- package/es/platform/zrecord/domain/entities/interfaces/IRecordsManager.js +0 -0
- 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 +28 -21
- 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/data-broker/http-template/getUIActions.js +0 -22
- 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/platform/zlist/usecases/entities-factory/ListFactory.js +0 -15
- /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/behaviours/list-selection/usecases/interfaces/UseCaseDependencies.js → cc/table-list/data-types/RowActionsConfig.js} +0 -0
- /package/es/library/{custom-component/usecases → behaviours/list-selection/applications}/interfaces/UseCase.js +0 -0
- /package/es/library/behaviours/{sort-by/usecases → list-selection/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/{sort-by/entities/interfaces/ISortBy.js → list-selection/domain/entities/interfaces/IListItemSelection.js} +0 -0
- /package/es/library/behaviours/{sort-by/usecases/interfaces/gateways/IRepository.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/{text-to-field-click/usecases → sort-by/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/{custom-component/usecases → behaviours/text-to-field-click/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/{platform/zdata-broker/usecases → library/custom-component/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 → zclient-actions/applications}/interfaces/InputDependencies.js +0 -0
- /package/es/platform/{zfield/usecases → zclient-actions/applications}/interfaces/gateways/IRepository.js +0 -0
- /package/es/platform/{zdata-broker/usecases → zclient-actions/applications}/interfaces/gateways/IService.js +0 -0
- /package/es/platform/{zdata-broker/usecases → zclient-actions/applications}/interfaces/gateways/State.js +0 -0
- /package/es/platform/{zdata-broker/entities/interfaces/APIDetailsModel.js → zclient-actions/applications/interfaces/input/ExecuteActionBehaviourInputModel.js} +0 -0
- /package/es/platform/{zdata-broker/usecases → zclient-actions/applications}/interfaces/input/FailureInputModel.js +0 -0
- /package/es/platform/{zrecord/usecases → zclient-actions/applications}/interfaces/input/FetchStateStopInputModel.js +0 -0
- /package/es/platform/{zrecord/usecases → zclient-actions/applications}/interfaces/input/InitializeInputModel.js +0 -0
- /package/es/platform/{zdata-broker/usecases → zclient-actions/applications}/interfaces/input/NoContentInputModel.js +0 -0
- /package/es/platform/{zdata-broker/entities/interfaces/APITemplateModel.js → zclient-actions/applications/interfaces/input/SetClientActionsInputModel.js} +0 -0
- /package/es/platform/{zdata-broker/usecases → zclient-actions/applications}/interfaces/input/SuccessInputModel.js +0 -0
- /package/es/platform/{zdata-broker/usecases → zclient-actions/applications}/interfaces/output/IPresenter.js +0 -0
- /package/es/platform/{zdata-broker/usecases/interactors → zclient-actions/applications/usecases}/AbstractUseCase.js +0 -0
- /package/es/platform/{zrecord/usecases/interactors → zclient-actions/applications/usecases}/InitializeUseCase.js +0 -0
- /package/es/platform/{zdata-broker → zclient-actions/domain}/entities/interfaces/BehaviourState.js +0 -0
- /package/es/platform/{zdata-broker/entities/interfaces/APITemplatesModel.js → zclient-actions/domain/entities/interfaces/ClientActionModel.js} +0 -0
- /package/es/platform/{zdata-broker/entities/interfaces/EventModel.js → zclient-actions/domain/entities/interfaces/ClientActionsModel.js} +0 -0
- /package/es/platform/{zdata-broker/entities/interfaces/IAPITemplate.js → zclient-actions/domain/entities/interfaces/ComponentPropertiesModel.js} +0 -0
- /package/es/platform/{zdata-broker/entities/interfaces/IAPITemplates.js → zclient-actions/domain/entities/interfaces/EventMappingModel.js} +0 -0
- /package/es/platform/{zrecord → zclient-actions/domain}/entities/interfaces/EventModel.js +0 -0
- /package/es/platform/{zdata-broker/entities/interfaces/ITemplateHelpers.js → zclient-actions/domain/entities/interfaces/IAction.js} +0 -0
- /package/es/platform/{zdata-broker/entities/interfaces/IDataBroker.js → zclient-actions/domain/entities/interfaces/IClientAction.js} +0 -0
- /package/es/platform/{zlist/usecases/interfaces/gateways/ITransformState.js → zclient-actions/domain/entities/interfaces/IClientActionExecuteStrategy.js} +0 -0
- /package/es/platform/{zrecord/entities/interfaces/IRecord.js → zclient-actions/domain/entities/interfaces/IClientActionManager.js} +0 -0
- /package/es/platform/{zrecord/entities/interfaces/IRecordExecuteStrategy.js → zclient-actions/domain/entities/interfaces/IClientActions.js} +0 -0
- /package/es/platform/{zdata-broker/usecases/interfaces/input/ExecuteActionInputModel.js → zclient-actions/domain/entities/interfaces/IError.js} +0 -0
- /package/es/platform/{zdata-broker/usecases/interfaces/input/RegisterInputModel.js → zclient-actions/domain/entities/interfaces/IEvent.js} +0 -0
- /package/es/platform/{zrecord/entities/interfaces/IRecords.js → zclient-actions/domain/entities/interfaces/IEventMapping.js} +0 -0
- /package/es/platform/{zrecord/entities/interfaces/IRecordsManager.js → zclient-actions/domain/entities/interfaces/IEventMappings.js} +0 -0
- /package/es/platform/{zrecord/usecases/interfaces/gateways/IService.js → zclient-actions/domain/entities/interfaces/IPayload.js} +0 -0
- /package/es/platform/{zfield/entities/interfaces/ActionModel.js → zclient-actions/domain/entities/interfaces/PayloadValueMappingModel.js} +0 -0
- /package/es/platform/{zfield/entities/interfaces/BehaviourState.js → zclient-actions/domain/entities/interfaces/PropsMeta.js} +0 -0
- /package/es/platform/{zrecord → zclient-actions/domain}/entities/interfaces/StrategyMeta.js +0 -0
- /package/es/platform/{zfield/entities/interfaces/FieldModel.js → zclient-actions/domain/entities/interfaces/SubMeta.js} +0 -0
- /package/es/platform/{zfield/entities/interfaces/IField.js → zclient-actions/domain/entities/interfaces/UIComponentMappingModel.js} +0 -0
- /package/es/platform/{zfield/entities/interfaces/IFieldManger.js → zclient-actions/domain/entities/interfaces/UserDetailsModel.js} +0 -0
- /package/es/platform/{zhttp/usecases → zdata-broker/applications}/interfaces/InputDependencies.js +0 -0
- /package/es/platform/{zlist/usecases → zdata-broker/applications}/interfaces/gateways/IRepository.js +0 -0
- /package/es/platform/{zlist/usecases/interfaces → zdata-broker/applications/interfaces/gateways}/State.js +0 -0
- /package/es/platform/{zfield/usecases → zdata-broker/applications}/interfaces/input/ExecuteActionInputModel.js +0 -0
- /package/es/platform/{zrecord/usecases → zdata-broker/applications}/interfaces/input/FailureInputModel.js +0 -0
- /package/es/platform/{zrecord/usecases → zdata-broker/applications}/interfaces/input/NoContentInputModel.js +0 -0
- /package/es/platform/{zfield/usecases/interfaces/UsecaseDependencies.js → zdata-broker/applications/interfaces/input/RegisterInputModel.js} +0 -0
- /package/es/platform/{zrecord/usecases → zdata-broker/applications}/interfaces/input/SuccessInputModel.js +0 -0
- /package/es/platform/{zfield/usecases → zdata-broker/applications}/interfaces/output/IPresenter.js +0 -0
- /package/es/platform/{zrecord/usecases/interactors → zdata-broker/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/{zfield/usecases/interfaces/gateways/IRestApi.js → zdata-broker/domain/entities/interfaces/APIDetailsModel.js} +0 -0
- /package/es/platform/{zfield/usecases/interfaces/gateways/IService.js → zdata-broker/domain/entities/interfaces/APITemplateModel.js} +0 -0
- /package/es/platform/{zfield/usecases/interfaces/input/InitialInputModel.js → zdata-broker/domain/entities/interfaces/APITemplatesModel.js} +0 -0
- /package/es/platform/zdata-broker/{entities → domain/entities}/interfaces/ApiEnum.js +0 -0
- /package/es/platform/{zrecord → zdata-broker/domain}/entities/interfaces/BehaviourState.js +0 -0
- /package/es/platform/{zfield/usecases/interfaces/input/InputModel.js → zdata-broker/domain/entities/interfaces/EventModel.js} +0 -0
- /package/es/platform/{zfield/usecases/interfaces/input/RefetchInputModel.js → zdata-broker/domain/entities/interfaces/IAPITemplate.js} +0 -0
- /package/es/platform/{zfield/usecases/interfaces/input/SetValueInputModel.js → zdata-broker/domain/entities/interfaces/IAPITemplates.js} +0 -0
- /package/es/platform/{zhttp/usecases/interfaces/gateway/IFetchGateWay.js → zdata-broker/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/{zhttp/usecases/interfaces/input/FetchInputModel.js → zfield/applications/interfaces/UsecaseDependencies.js} +0 -0
- /package/es/platform/{zrecord/usecases → zfield/applications}/interfaces/gateways/IRepository.js +0 -0
- /package/es/platform/{zlist/entities/interfaces/ActionModel.js → zfield/applications/interfaces/gateways/IRestApi.js} +0 -0
- /package/es/platform/{zlist/usecases → zfield/applications}/interfaces/gateways/IService.js +0 -0
- /package/es/platform/{zrecord/usecases → zfield/applications}/interfaces/input/ExecuteActionInputModel.js +0 -0
- /package/es/platform/{zlist/entities/interfaces/ApiPropsModel.js → zfield/applications/interfaces/input/InitialInputModel.js} +0 -0
- /package/es/platform/{zlist/entities/interfaces/IList.js → zfield/applications/interfaces/input/InputModel.js} +0 -0
- /package/es/platform/{zrecord/usecases → zfield/applications}/interfaces/input/RefetchInputModel.js +0 -0
- /package/es/platform/{zlist/entities/interfaces/Properties.js → zfield/applications/interfaces/input/SetValueInputModel.js} +0 -0
- /package/es/platform/{zrecord/usecases → zfield/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/{zlist/entities/interfaces/RecordExecuteAfterMetaData.js → zfield/domain/entities/interfaces/ActionModel.js} +0 -0
- /package/es/platform/{zlist/usecases/interfaces/input/DeleteMultipleRecordUseCaseInput.js → zfield/domain/entities/interfaces/BehaviourState.js} +0 -0
- /package/es/platform/zfield/{entities → domain/entities}/interfaces/FieldApiName.js +0 -0
- /package/es/platform/{zlist/usecases/interfaces/input/DeleteSingleRecordUseCaseInput.js → zfield/domain/entities/interfaces/FieldModel.js} +0 -0
- /package/es/platform/{zlist/usecases/interfaces/input/FetchMoreInput.js → zfield/domain/entities/interfaces/IField.js} +0 -0
- /package/es/platform/{zlist/usecases/interfaces/input/FieldChangeUseCaseInput.js → zfield/domain/entities/interfaces/IFieldManger.js} +0 -0
- /package/es/platform/{zrecord/usecases → zhttp/applications}/interfaces/InputDependencies.js +0 -0
- /package/es/platform/{zlist/usecases/interfaces/input/InitializeInput.js → zhttp/applications/interfaces/UseCase.js} +0 -0
- /package/es/platform/{zlist/usecases/interfaces/input/PropertiesChangeUseCaseInput.js → zhttp/applications/interfaces/gateway/IFetchGateWay.js} +0 -0
- /package/es/platform/{zlist/usecases/interfaces/input/RecordExecuteFailedUseCaseInput.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/{zrecord/usecases/interfaces/gateways → zlist/applications/interfaces}/State.js +0 -0
- /package/es/platform/zlist/{usecases/interfaces/input/RecordExecuteSucceededUseCaseInput.js → applications/interfaces/UseCaseDependencies.js} +0 -0
- /package/es/platform/zlist/{usecases/interfaces/input/RecordUpdateUseCaseInput.js → applications/interfaces/gateways/IRepository.js} +0 -0
- /package/es/platform/zlist/{usecases/interfaces/input/SortingInputModel.js → applications/interfaces/gateways/IService.js} +0 -0
- /package/es/platform/{zrecord/entities/interfaces/ICustomFieldValues.js → zlist/applications/interfaces/gateways/ISortBy.js} +0 -0
- /package/es/platform/{zrecord/entities/interfaces/IRecordName.js → zlist/applications/interfaces/input/DeleteMultipleRecordUseCaseInput.js} +0 -0
- /package/es/platform/{zrecord/entities/interfaces/RecordModel.js → zlist/applications/interfaces/input/DeleteSingleRecordUseCaseInput.js} +0 -0
- /package/es/platform/{zrecord/entities/interfaces/RecordsModel.js → zlist/applications/interfaces/input/FetchMoreInput.js} +0 -0
- /package/es/platform/{zrecord/usecases → zlist/applications}/interfaces/input/FieldChangeUseCaseInput.js +0 -0
- /package/es/platform/{zrecord/usecases/interfaces/input/AppendRecordsInputModel.js → zlist/applications/interfaces/input/InitializeInput.js} +0 -0
- /package/es/platform/{zrecord/usecases/interfaces/input/DeleteMultipleRecordInputModel.js → zlist/applications/interfaces/input/PropertiesChangeUseCaseInput.js} +0 -0
- /package/es/platform/{zrecord/usecases/interfaces/input/FetchMoreInputModel.js → zlist/applications/interfaces/input/RecordExecuteFailedUseCaseInput.js} +0 -0
- /package/es/platform/{zrecord/usecases/interfaces/input/RecordUpdateLocalUseCaseInputModel.js → zlist/applications/interfaces/input/RecordExecuteSucceededUseCaseInput.js} +0 -0
- /package/es/platform/{zrecord/usecases/interfaces/input/SetRecordsInputModel.js → zlist/applications/interfaces/input/RecordUpdateUseCaseInput.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/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}/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/library/behaviours/list-selection/{entities → domain/entities}/ListItemSelection.js
RENAMED
|
@@ -49,7 +49,9 @@ class ListItemSelection {
|
|
|
49
49
|
break;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
this.
|
|
52
|
+
if (!this.isSelected(id)) {
|
|
53
|
+
this.selectItem(id);
|
|
54
|
+
}
|
|
53
55
|
}
|
|
54
56
|
} else {
|
|
55
57
|
this.selected = [];
|
|
@@ -59,23 +61,41 @@ class ListItemSelection {
|
|
|
59
61
|
toggleRange(startIndex, endIndex) {
|
|
60
62
|
const isForward = startIndex < endIndex;
|
|
61
63
|
const [start, end] = isForward ? [startIndex, endIndex] : [endIndex, startIndex];
|
|
62
|
-
|
|
63
|
-
|
|
64
|
+
const itemsForSelection = this.itemIds.slice(start, end + 1);
|
|
65
|
+
const allSelected = itemsForSelection.every(id => this.isSelected(id));
|
|
64
66
|
const yetToSelectCount = this.maxSelectionCount - this.selected.length;
|
|
67
|
+
const itemsToSelect = itemsForSelection.filter(id => !this.isSelected(id));
|
|
68
|
+
this.rangeSelection(isForward, itemsForSelection, allSelected, yetToSelectCount, itemsToSelect);
|
|
69
|
+
}
|
|
65
70
|
|
|
66
|
-
|
|
71
|
+
rangeSelection(isForward, itemsForSelection, allSelected, yetToSelectCount, itemsToSelect) {
|
|
72
|
+
if (allSelected) {
|
|
67
73
|
if (isForward) {
|
|
68
|
-
itemsForSelection.
|
|
74
|
+
itemsForSelection.forEach(id => this.deselectItem(id));
|
|
69
75
|
} else {
|
|
70
|
-
itemsForSelection.
|
|
76
|
+
itemsForSelection.reverse().forEach(id => this.deselectItem(id));
|
|
77
|
+
}
|
|
78
|
+
} else {
|
|
79
|
+
if (itemsToSelect.length > yetToSelectCount) {
|
|
80
|
+
if (isForward) {
|
|
81
|
+
itemsToSelect.splice(yetToSelectCount);
|
|
82
|
+
} else {
|
|
83
|
+
itemsToSelect.reverse();
|
|
84
|
+
itemsToSelect.splice(yetToSelectCount);
|
|
85
|
+
itemsToSelect.reverse();
|
|
86
|
+
}
|
|
71
87
|
}
|
|
72
|
-
}
|
|
73
88
|
|
|
74
|
-
|
|
89
|
+
if (isForward) {
|
|
90
|
+
itemsToSelect.forEach(id => this.selectItem(id));
|
|
91
|
+
} else {
|
|
92
|
+
itemsToSelect.reverse().forEach(id => this.selectItem(id));
|
|
93
|
+
}
|
|
94
|
+
}
|
|
75
95
|
}
|
|
76
96
|
|
|
77
97
|
toggleUpto(id) {
|
|
78
|
-
let lastItem = this.selected.at(-1);
|
|
98
|
+
let lastItem = this.selected.at(-1) || id;
|
|
79
99
|
let startIndex = this.itemIds.indexOf(lastItem);
|
|
80
100
|
let endIndex = this.itemIds.indexOf(id);
|
|
81
101
|
this.toggleRange(startIndex, endIndex);
|
|
@@ -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 SortBy from "../../entities/SortBy";
|
|
3
|
+
import SortBy from "../../domain/entities/SortBy";
|
|
4
4
|
export default class Repository {
|
|
5
5
|
constructor() {
|
|
6
6
|
_defineProperty(this, "state", void 0);
|
|
@@ -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 SortBy from "../../usecases/
|
|
3
|
+
import SortBy from "../../applications/usecases/SortBy";
|
|
4
4
|
|
|
5
5
|
class Service {
|
|
6
6
|
constructor(dependencies) {
|
|
@@ -10,9 +10,9 @@ class SortByBehaviourFactory {
|
|
|
10
10
|
properties
|
|
11
11
|
} = _ref;
|
|
12
12
|
const {
|
|
13
|
-
|
|
13
|
+
sortBy
|
|
14
14
|
} = properties;
|
|
15
|
-
return
|
|
15
|
+
return sortBy || {};
|
|
16
16
|
},
|
|
17
17
|
properties: Properties,
|
|
18
18
|
eventHandlers: ActionsHandlerFactory.create()
|
|
@@ -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 FieldEventConverter from "../../entities/FieldEventConverter";
|
|
3
|
+
import FieldEventConverter from "../../domain/entities/FieldEventConverter";
|
|
4
4
|
export default class Repository {
|
|
5
5
|
constructor() {
|
|
6
6
|
_defineProperty(this, "state", void 0);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import TextConstants from "../../../../../cc/text/Constants";
|
|
2
2
|
import Repository from "../../adapters/gateway/Repository";
|
|
3
3
|
import ClickController from "../../adapters/controllers/ClickController";
|
|
4
|
-
import ClickUseCase from "../../usecases/
|
|
4
|
+
import ClickUseCase from "../../applications/usecases/ClickUseCase";
|
|
5
5
|
export class EventHandlersFactory {
|
|
6
6
|
static create() {
|
|
7
7
|
const repository = new Repository();
|
|
@@ -76,7 +76,7 @@ class EventManager {
|
|
|
76
76
|
if (__DEVELOPMENT__) {
|
|
77
77
|
if (globalThis.enableEventLogging && type) {
|
|
78
78
|
const index = type.indexOf('#');
|
|
79
|
-
console.log('%cEvent %c' + type.slice(0, index) + '%c' + type.slice(index), '
|
|
79
|
+
console.log('%cEvent %c' + type.slice(0, index) + '%c' + type.slice(index), 'font-weight: bold', 'color: #FF6F61;font-weight: bold', 'color: #FFA500;font-weight: bold', {
|
|
80
80
|
payload,
|
|
81
81
|
metaData
|
|
82
82
|
});
|
|
@@ -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
|
|
|
@@ -89,7 +99,8 @@ export default class Component {
|
|
|
89
99
|
}
|
|
90
100
|
|
|
91
101
|
setBehaviours(behaviours) {
|
|
92
|
-
this._behaviours = behaviours;
|
|
102
|
+
this._behaviours = behaviours;
|
|
103
|
+
/* store behaviour properties */
|
|
93
104
|
|
|
94
105
|
this._behaviours.forEach(behaviour => {
|
|
95
106
|
behaviour.getProperties().data && behaviour.getProperties().data.forEach(obj => {
|
|
@@ -103,17 +114,33 @@ export default class Component {
|
|
|
103
114
|
if (this._behavioursProperties[key]) {
|
|
104
115
|
let property = this._behavioursProperties[key];
|
|
105
116
|
let optionalSchema = property.getTypeMetadata().schema;
|
|
106
|
-
|
|
117
|
+
|
|
118
|
+
let isValid = this._properties.validateSingleProperty(jsonValidator, key, newProps[key], optionalSchema);
|
|
119
|
+
|
|
120
|
+
if (isValid) {
|
|
121
|
+
property.updateValue(newProps[key]);
|
|
122
|
+
}
|
|
123
|
+
/* return isValid */
|
|
124
|
+
|
|
107
125
|
} else if (this._properties.findProperty(key)) {
|
|
108
126
|
let property = this._properties.findProperty(key);
|
|
109
127
|
|
|
110
128
|
let schema = property.getTypeMetadata().schema;
|
|
111
|
-
|
|
129
|
+
|
|
130
|
+
let isValid = this._properties.validateSingleProperty(jsonValidator, key, newProps[key], schema);
|
|
131
|
+
|
|
132
|
+
if (isValid) {
|
|
133
|
+
property.updateValue(newProps[key]);
|
|
134
|
+
}
|
|
135
|
+
/* return isValid */
|
|
136
|
+
|
|
112
137
|
} else {
|
|
113
138
|
throw new Error(`props '${key}' not exist `);
|
|
114
139
|
}
|
|
115
140
|
});
|
|
116
|
-
return this._properties.updateAllPropertiesValue(jsonValidator, newProps);
|
|
141
|
+
/* return this._properties.updateAllPropertiesValue(jsonValidator, newProps); */
|
|
142
|
+
|
|
143
|
+
return true;
|
|
117
144
|
}
|
|
118
145
|
|
|
119
146
|
updateState(state) {
|
|
@@ -137,10 +164,14 @@ export default class Component {
|
|
|
137
164
|
|
|
138
165
|
const properties = this._properties.getAllPropertiesValue();
|
|
139
166
|
|
|
167
|
+
const behavioursProperties = this.getAllBehavioursPropertiesWithValue();
|
|
140
168
|
const behaviours = this.getAllBehavioursInitialState();
|
|
169
|
+
let allProperties = { ...properties,
|
|
170
|
+
...behavioursProperties
|
|
171
|
+
};
|
|
141
172
|
|
|
142
173
|
const initialState = this._stateInitializer({
|
|
143
|
-
properties
|
|
174
|
+
properties: allProperties
|
|
144
175
|
});
|
|
145
176
|
|
|
146
177
|
this.updateState({ ...initialState,
|
|
@@ -149,7 +180,9 @@ export default class Component {
|
|
|
149
180
|
}
|
|
150
181
|
|
|
151
182
|
getProperties() {
|
|
152
|
-
return this._properties.getAllPropertiesValue()
|
|
183
|
+
return { ...this._properties.getAllPropertiesValue(),
|
|
184
|
+
...this.getAllBehavioursPropertiesWithValue()
|
|
185
|
+
};
|
|
153
186
|
}
|
|
154
187
|
|
|
155
188
|
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;
|
|
@@ -24,7 +24,8 @@ function TableListView(_ref2, _ref) {
|
|
|
24
24
|
resizerConfig,
|
|
25
25
|
selectionConfig,
|
|
26
26
|
isFlexibleColumns,
|
|
27
|
-
|
|
27
|
+
rowCursor,
|
|
28
|
+
rowActionsConfig,
|
|
28
29
|
emptyStateUiType
|
|
29
30
|
} = state.properties;
|
|
30
31
|
const {
|
|
@@ -35,6 +36,10 @@ function TableListView(_ref2, _ref) {
|
|
|
35
36
|
headers,
|
|
36
37
|
rows
|
|
37
38
|
} = data;
|
|
39
|
+
const {
|
|
40
|
+
hasActions: hasRowActions,
|
|
41
|
+
columnWidth: rowActionsColumnWidth
|
|
42
|
+
} = rowActionsConfig;
|
|
38
43
|
const hasRows = rows.length > 0; // TODO: derive from state.properties
|
|
39
44
|
|
|
40
45
|
const isDataEmpty = !hasRows && !isLoading; // TODO: derive from state.properties
|
|
@@ -54,14 +59,16 @@ function TableListView(_ref2, _ref) {
|
|
|
54
59
|
selection,
|
|
55
60
|
isFlexibleColumns,
|
|
56
61
|
hasRowActions,
|
|
62
|
+
rowActionsColumnWidth,
|
|
57
63
|
dispatch
|
|
58
64
|
}), renderBody({
|
|
59
65
|
headers,
|
|
60
66
|
rows,
|
|
61
67
|
isFlexibleColumns,
|
|
62
68
|
selectionConfig,
|
|
63
|
-
|
|
69
|
+
rowCursor,
|
|
64
70
|
hasRowActions,
|
|
71
|
+
rowActionsColumnWidth,
|
|
65
72
|
hasRows
|
|
66
73
|
}), /*#__PURE__*/React.createElement(NoData, {
|
|
67
74
|
isDataEmpty: isDataEmpty,
|
|
@@ -81,18 +88,19 @@ function renderHeader(_ref3) {
|
|
|
81
88
|
selection,
|
|
82
89
|
isFlexibleColumns,
|
|
83
90
|
hasRowActions,
|
|
91
|
+
rowActionsColumnWidth,
|
|
84
92
|
dispatch
|
|
85
93
|
} = _ref3;
|
|
86
94
|
return /*#__PURE__*/React.createElement(Header, {
|
|
87
95
|
isSelectionEnabled: selectionConfig.isEnabled,
|
|
88
96
|
hasAllSelected: selection.hasAllSelected,
|
|
89
97
|
isResizerEnabled: resizerConfig.isEnabled,
|
|
90
|
-
resizedColumnsWidth: resizerState.resizedColumnsWidth,
|
|
91
98
|
currentlyResizingColumn: resizerState.currentlyResizingColumn,
|
|
92
99
|
isCurrentlyResizing: resizerState.isCurrentlyResizing,
|
|
93
100
|
resizerExtraWidth: resizerState.extraWidth,
|
|
94
101
|
isFlexibleColumns: isFlexibleColumns,
|
|
95
102
|
hasRowActions: hasRowActions,
|
|
103
|
+
rowActionsColumnWidth: rowActionsColumnWidth,
|
|
96
104
|
headers: headers,
|
|
97
105
|
dispatch: dispatch
|
|
98
106
|
});
|
|
@@ -104,8 +112,9 @@ function renderBody(_ref4) {
|
|
|
104
112
|
rows,
|
|
105
113
|
isFlexibleColumns,
|
|
106
114
|
selectionConfig,
|
|
107
|
-
|
|
115
|
+
rowCursor,
|
|
108
116
|
hasRowActions,
|
|
117
|
+
rowActionsColumnWidth,
|
|
109
118
|
hasRows
|
|
110
119
|
} = _ref4;
|
|
111
120
|
return /*#__PURE__*/React.createElement(Body, {
|
|
@@ -116,8 +125,9 @@ function renderBody(_ref4) {
|
|
|
116
125
|
rows: rows,
|
|
117
126
|
isFlexibleColumns: isFlexibleColumns,
|
|
118
127
|
isSelectionEnabled: selectionConfig.isEnabled,
|
|
119
|
-
|
|
120
|
-
hasRowActions: hasRowActions
|
|
128
|
+
rowCursor: rowCursor,
|
|
129
|
+
hasRowActions: hasRowActions,
|
|
130
|
+
rowActionsColumnWidth: rowActionsColumnWidth
|
|
121
131
|
}));
|
|
122
132
|
}
|
|
123
133
|
|