@zohodesk/library-platform 1.1.12 → 1.1.13
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/action-band/Constants.js +4 -0
- package/es/bc/action-band/Properties.js +10 -0
- package/es/bc/action-band/index.js +1 -0
- package/es/bc/app-context/Properties.js +19 -0
- package/es/bc/float-pagination/ActionHandlers.js +1 -0
- package/es/bc/float-pagination/Constants.js +4 -0
- package/es/bc/float-pagination/Properties.js +18 -0
- package/es/bc/float-pagination/index.js +2 -0
- package/es/bc/index.js +0 -1
- package/es/bc/sdk/ResourceNamesEnum.js +1 -0
- package/es/bc/search/Constants.js +3 -0
- package/es/bc/search/EventHandlers.js +1 -0
- package/es/bc/search/Properties.js +11 -0
- package/es/bc/search/index.js +2 -0
- package/es/bc/search-box/ActionHandlers.js +1 -0
- package/es/bc/search-box/Constants.js +4 -0
- package/es/bc/search-box/Properties.js +18 -0
- package/es/bc/search-box/index.js +2 -0
- package/es/bc/sort-by/ActionHandlers.js +1 -1
- package/es/bc/sort-by/Constants.js +2 -2
- package/es/bc/sort-by/Properties.js +13 -11
- package/es/bc/sort-by/Types.js +10 -0
- package/es/bc/sort-by/types/SortByBehaviourState.js +1 -0
- package/es/bc/zfield/Constants.js +5 -1
- package/es/bc/zlist/Constants.js +0 -1
- package/es/bc/zlist/Types.js +27 -0
- package/es/bc/zrecord/Constants.js +2 -0
- package/es/bc/zrecord/Schemas.js +29 -0
- package/es/bc/zrecord/Types.js +45 -0
- package/es/cc/action-band/Properties.js +83 -0
- package/es/cc/action-band/SdkContract.js +13 -0
- package/es/cc/action-band/constants/Events.js +1 -0
- package/es/cc/action-band/constants/ExternalConstants.js +7 -0
- package/es/cc/action-band/constants/index.js +2 -0
- package/es/cc/action-band/index.js +3 -0
- package/es/cc/action-icon/Properties.js +20 -1
- package/es/cc/checkbox/Properties.js +2 -1
- package/es/cc/email/Properties.js +8 -0
- package/es/cc/fields/field/Types.js +31 -23
- package/es/cc/floating-pagination/Constants.js +6 -0
- package/es/cc/floating-pagination/Events.js +8 -0
- package/es/cc/floating-pagination/Properties.js +56 -0
- package/es/cc/floating-pagination/index.js +3 -0
- package/es/cc/highlighted-value/Properties.js +18 -0
- package/es/cc/link/Properties.js +13 -3
- package/es/cc/list-item/Properties.js +10 -0
- package/es/cc/more-dropdown/Properties.js +4 -0
- package/es/cc/radio-dropdown/Constants.js +6 -0
- package/es/cc/radio-dropdown/Data.js +1 -0
- package/es/cc/radio-dropdown/Events.js +42 -0
- package/es/cc/radio-dropdown/Properties.js +142 -0
- package/es/cc/radio-dropdown/index.js +4 -0
- package/es/cc/ribbon/Properties.js +59 -0
- package/es/cc/ribbon/index.js +1 -0
- package/es/cc/search/Constants.js +6 -0
- package/es/cc/search/Events.js +17 -0
- package/es/cc/search/Properties.js +11 -0
- package/es/cc/search/index.js +3 -0
- package/es/cc/sort-dropdown/Constants.js +7 -0
- package/es/cc/sort-dropdown/Events.js +46 -0
- package/es/cc/sort-dropdown/Properties.js +135 -0
- package/es/cc/sort-dropdown/index.js +3 -0
- package/es/cc/switch/Properties.js +2 -2
- package/es/cc/table-connected/Properties.js +16 -0
- package/es/cc/table-connected/SdkContract.js +24 -0
- package/es/cc/table-connected/constants/Events.js +2 -0
- package/es/cc/table-list/Actions.js +0 -2
- package/es/cc/table-list/Constants.js +1 -1
- package/es/cc/table-list/Events.js +0 -2
- package/es/cc/table-list/Properties.js +35 -38
- package/es/cc/table-list/data-types/FloatPaginationConfig.js +1 -0
- package/es/cc/tag/Constants.js +6 -0
- package/es/cc/tag/Data.js +14 -0
- package/es/cc/tag/EventHandlers.js +1 -0
- package/es/cc/tag/Events.js +26 -0
- package/es/cc/{tags/model/TagModel.js → tag/Model.js} +6 -2
- package/es/cc/tag/Properties.js +104 -0
- package/es/cc/tag/index.js +6 -0
- package/es/cc/tags/Data.js +0 -6
- package/es/cc/tags/model/index.js +1 -1
- package/es/cc/tags-list-dropdown/Constants.js +5 -0
- package/es/cc/tags-list-dropdown/Data.js +1 -0
- package/es/cc/tags-list-dropdown/Events.js +14 -0
- package/es/cc/tags-list-dropdown/Properties.js +96 -0
- package/es/cc/tags-list-dropdown/index.js +4 -0
- package/es/index.js +1 -1
- package/es/library/behaviours/action-band/adapters/controllers/AbstractController.js +10 -0
- package/es/library/behaviours/action-band/adapters/controllers/MountController.js +21 -0
- package/es/library/behaviours/action-band/adapters/gateways/Repository.js +24 -0
- package/es/library/behaviours/action-band/adapters/gateways/Service.js +11 -0
- package/es/library/behaviours/action-band/applications/interfaces/State.js +1 -0
- package/es/library/behaviours/action-band/applications/interfaces/UseCaseDependencies.js +1 -0
- package/es/library/behaviours/action-band/applications/interfaces/gateways/IRepository.js +1 -0
- package/es/library/behaviours/action-band/applications/interfaces/gateways/IService.js +1 -0
- package/es/library/behaviours/action-band/applications/interfaces/input/InitializeInput.js +1 -0
- package/es/library/behaviours/action-band/applications/usecases/AbstractUseCase.js +17 -0
- package/es/library/behaviours/action-band/applications/usecases/InitializeUseCase.js +20 -0
- package/es/library/behaviours/action-band/domain/entities/ActionBand.js +95 -0
- package/es/library/behaviours/action-band/domain/entities/interfaces/IActionBand.js +1 -0
- package/es/library/behaviours/action-band/domain/entities/interfaces/IActionModel.js +1 -0
- package/es/library/behaviours/action-band/domain/entities/interfaces/IApiPropsModel.js +1 -0
- package/es/library/behaviours/action-band/domain/entities/interfaces/Properties.js +1 -0
- package/es/library/behaviours/action-band/frameworks/ActionBandBehaviourFactory.js +21 -0
- package/es/library/behaviours/action-band/frameworks/ActionHandlersFactory.js +17 -0
- package/es/library/behaviours/clip-wrap/adapters/controllers/DestructController.js +3 -3
- package/es/library/behaviours/clip-wrap/adapters/controllers/InitializeController.js +3 -3
- package/es/library/behaviours/clip-wrap/adapters/gateway/Service.js +4 -0
- package/es/library/behaviours/float-pagination/adapters/controllers/AbstractController.js +9 -0
- package/es/library/behaviours/float-pagination/adapters/controllers/DestructController.js +18 -0
- package/es/library/behaviours/float-pagination/adapters/controllers/FloatPaginationController.js +25 -0
- package/es/library/behaviours/float-pagination/adapters/controllers/InitializeController.js +18 -0
- package/es/library/behaviours/float-pagination/adapters/controllers/ScrollBottomController.js +23 -0
- package/es/library/behaviours/float-pagination/adapters/controllers/ScrollTopController.js +23 -0
- package/es/library/behaviours/float-pagination/adapters/controllers/UpdateIndexController.js +30 -0
- package/es/library/behaviours/float-pagination/adapters/gateway/Repository.js +27 -0
- package/es/library/behaviours/float-pagination/adapters/gateway/Service.js +20 -0
- package/es/library/behaviours/float-pagination/adapters/presenter/Presenter.js +16 -0
- package/es/library/behaviours/float-pagination/applications/interfaces/UseCaseDependencies.js +1 -0
- package/es/library/behaviours/float-pagination/applications/interfaces/gateways/IRepository.js +1 -0
- package/es/library/behaviours/float-pagination/applications/interfaces/gateways/IService.js +1 -0
- package/es/library/behaviours/float-pagination/applications/interfaces/input/DestructInputModel.js +1 -0
- package/es/library/behaviours/float-pagination/applications/interfaces/input/FloatPaginationInputModel.js +1 -0
- package/es/library/behaviours/float-pagination/applications/interfaces/input/InitializeInputModel.js +1 -0
- package/es/library/behaviours/float-pagination/applications/interfaces/input/ScrollTopInputModel.js +1 -0
- package/es/library/behaviours/float-pagination/applications/interfaces/input/ScrollbottomInputModel.js +1 -0
- package/es/library/behaviours/float-pagination/applications/interfaces/input/UpdateIndexInputModel.js +1 -0
- package/es/library/behaviours/float-pagination/applications/interfaces/output/FloatPaginationOutputModel.js +1 -0
- package/es/library/behaviours/float-pagination/applications/interfaces/output/IPresenter.js +1 -0
- package/es/library/behaviours/float-pagination/applications/usecases/AbstractUseCase.js +17 -0
- package/es/library/behaviours/float-pagination/applications/usecases/DestructUsecase.js +15 -0
- package/es/library/behaviours/float-pagination/applications/usecases/FloatPaginationUseCase.js +31 -0
- package/es/library/behaviours/float-pagination/applications/usecases/InitializeUsecase.js +16 -0
- package/es/library/behaviours/float-pagination/applications/usecases/ScrollBottomUseCase.js +23 -0
- package/es/library/behaviours/float-pagination/applications/usecases/ScrollTopUseCase.js +23 -0
- package/es/library/behaviours/float-pagination/applications/usecases/UpdateIndexUseCase.js +28 -0
- package/es/library/behaviours/float-pagination/domain/entities/FloatPagination.js +28 -0
- package/es/library/behaviours/float-pagination/domain/entities/interfaces/IFloatPagination.js +1 -0
- package/es/library/behaviours/float-pagination/frameworks/ui/ActionsHandlerFactory.js +37 -0
- package/es/library/behaviours/float-pagination/frameworks/ui/FloatPaginationBehaviourFactory.js +21 -0
- package/es/library/behaviours/float-pagination/frameworks/utils.js +70 -0
- package/es/library/behaviours/keyboard-controls/adapters/gateways/Repository.js +2 -1
- package/es/library/behaviours/keyboard-controls/applications/usecases/SpacePress.js +1 -1
- package/es/library/behaviours/keyboard-controls/domain/entities/KeyboardControls.js +6 -1
- package/es/library/behaviours/list-selection/domain/entities/ListItemSelection.js +21 -18
- package/es/library/behaviours/search/adapters/controllers/AbstractController.js +9 -0
- package/es/library/behaviours/search/adapters/controllers/SearchController.js +26 -0
- package/es/library/behaviours/search/adapters/controllers/UpdatePropertiesController.js +27 -0
- package/es/library/behaviours/search/adapters/gateway/Repository.js +20 -0
- package/es/library/behaviours/search/adapters/gateway/Service.js +12 -0
- package/es/library/behaviours/search/adapters/presenter/Presenter.js +16 -0
- package/es/library/behaviours/search/adapters/presenter/SearchTranslator.js +6 -0
- package/es/library/behaviours/search/applications/interfaces/UseCaseDependencies.js +1 -0
- package/es/library/behaviours/search/applications/interfaces/gateways/IRepository.js +1 -0
- package/es/library/behaviours/search/applications/interfaces/gateways/IService.js +1 -0
- package/es/library/behaviours/search/applications/interfaces/input/SearchInputModel.js +1 -0
- package/es/library/behaviours/search/applications/interfaces/input/UpdatePropertiesInputModel.js +1 -0
- package/es/library/behaviours/search/applications/interfaces/output/IPresenter.js +1 -0
- package/es/library/behaviours/search/applications/interfaces/output/SearchOutputModel.js +1 -0
- package/es/library/behaviours/search/applications/usecases/AbstractUseCase.js +17 -0
- package/es/library/behaviours/search/applications/usecases/SearchUseCase.js +28 -0
- package/es/library/behaviours/search/applications/usecases/UpdatePropertiesUsecase.js +25 -0
- package/es/library/behaviours/search/domain/entities/Search.js +23 -0
- package/es/library/behaviours/search/domain/entities/interfaces/ISearch.js +1 -0
- package/es/library/behaviours/search/frameworks/ui/EventHandlerFactory.js +25 -0
- package/es/library/behaviours/search/frameworks/ui/SearchStringStoreBehaviourFactory.js +26 -0
- package/es/library/behaviours/search-box/adapters/controllers/AbstractController.js +9 -0
- package/es/library/behaviours/search-box/adapters/controllers/ClearSearchController.js +21 -0
- package/es/library/behaviours/search-box/adapters/controllers/SearchController.js +26 -0
- package/es/library/behaviours/search-box/adapters/gateway/Repository.js +28 -0
- package/es/library/behaviours/search-box/adapters/gateway/Service.js +12 -0
- package/es/library/behaviours/search-box/adapters/presenter/Presenter.js +21 -0
- package/es/library/behaviours/search-box/applications/interfaces/UseCaseDependencies.js +1 -0
- package/es/library/behaviours/search-box/applications/interfaces/gateways/IRepository.js +1 -0
- package/es/library/behaviours/search-box/applications/interfaces/gateways/IService.js +1 -0
- package/es/library/behaviours/search-box/applications/interfaces/input/ClearSearchInputModel.js +1 -0
- package/es/library/behaviours/search-box/applications/interfaces/input/SearchInputModel.js +1 -0
- package/es/library/behaviours/search-box/applications/interfaces/output/IPresenter.js +1 -0
- package/es/library/behaviours/search-box/applications/interfaces/output/SearchOutputModel.js +1 -0
- package/es/library/behaviours/search-box/applications/usecases/AbstractUseCase.js +17 -0
- package/es/library/behaviours/search-box/applications/usecases/ClearSearchUseCase.js +24 -0
- package/es/library/behaviours/search-box/applications/usecases/SearchUseCase.js +25 -0
- package/es/library/behaviours/search-box/domain/entities/Search.js +22 -0
- package/es/library/behaviours/search-box/domain/entities/interfaces/ISearch.js +1 -0
- package/es/library/behaviours/search-box/frameworks/ui/ActionsHandlerFactory.js +24 -0
- package/es/library/behaviours/search-box/frameworks/ui/SearchBehaviourFactory.js +26 -0
- package/es/library/behaviours/sort-by/adapters/controllers/{SortBy.js → SortByController.js} +6 -6
- package/es/library/behaviours/sort-by/adapters/gateway/Repository.js +18 -6
- package/es/library/behaviours/sort-by/adapters/gateway/Service.js +2 -2
- package/es/library/behaviours/sort-by/adapters/presenter/Presenter.js +8 -1
- package/es/library/behaviours/sort-by/applications/interfaces/input/UpdateSortByUseCaseInputModel.js +1 -0
- package/es/library/behaviours/sort-by/applications/interfaces/output/SearchOutputModel.js +1 -0
- package/es/library/behaviours/sort-by/applications/usecases/{SortBy.js → SortByUseCase.js} +12 -13
- package/es/library/behaviours/sort-by/applications/usecases/UpdateSortByUseCase.js +25 -0
- package/es/library/behaviours/sort-by/domain/entities/SortBy.js +11 -25
- package/es/library/behaviours/sort-by/frameworks/ui/ActionsHandlerFactory.js +7 -5
- package/es/library/behaviours/sort-by/frameworks/ui/SortByBehaviourFactory.js +17 -7
- package/es/library/custom-component/adapters/gateways/event-manager/EventManager.js +5 -0
- package/es/library/custom-component/domain/entities/ComponentProperties.js +1 -1
- package/es/library/custom-component/domain/entities/Logger.js +3 -3
- package/es/library/dot/components/action-location/frameworks/ui/ActionComponentMapping.js +7 -1
- package/es/library/dot/components/table-list/adapters/controllers/ScrollController.js +2 -2
- package/es/library/dot/components/table-list/adapters/controllers/index.js +0 -2
- package/es/library/dot/components/table-list/frameworks/ui/EventHandlersFactory.js +1 -2
- package/es/library/dot/components/table-list/frameworks/ui/TableListView.js +24 -1
- package/es/library/dot/components/table-list/frameworks/ui/css/TableList.module.css +19 -2
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/Row.js +4 -6
- package/es/library/dot/legacy-to-new-arch/action-band-components/search/frameworks/ui/Search.js +41 -0
- package/es/library/dot/legacy-to-new-arch/action-band-components/search/frameworks/ui/SearchTranslator.js +16 -0
- package/es/library/dot/legacy-to-new-arch/action-band-components/search/frameworks/ui/SearchView.js +37 -0
- package/es/library/dot/legacy-to-new-arch/action-icon/frameworks/ui/ActionIconView.js +5 -1
- package/es/library/dot/legacy-to-new-arch/email/frameworks/ui/EmailView.js +4 -2
- package/es/library/dot/legacy-to-new-arch/floating-pagination/frameworks/ui/FloatingPagination.js +10 -0
- package/es/library/dot/legacy-to-new-arch/floating-pagination/frameworks/ui/FloatingPaginationView.js +47 -0
- package/es/library/dot/legacy-to-new-arch/highlighted-value/frameworks/ui/HighlightedValueView.js +6 -1
- package/es/library/dot/legacy-to-new-arch/index.js +3 -1
- package/es/library/dot/legacy-to-new-arch/link/frameworks/ui/LinkView.js +4 -2
- package/es/library/dot/legacy-to-new-arch/list-item/frameworks/ui/ListItemView.js +4 -0
- package/es/library/dot/legacy-to-new-arch/radio-dropdown/frameworks/ui/RadioDropdown.js +12 -0
- package/es/library/dot/legacy-to-new-arch/radio-dropdown/frameworks/ui/RadioDropdownView.js +125 -0
- package/es/library/dot/legacy-to-new-arch/radio-dropdown/frameworks/ui/css/RadioDropdown.module.css +23 -0
- package/es/library/dot/legacy-to-new-arch/ribbon/frameworks/ui/Ribbon.js +10 -0
- package/es/library/dot/legacy-to-new-arch/ribbon/frameworks/ui/RibbonView.js +37 -0
- package/es/library/dot/legacy-to-new-arch/sort-dropdown/frameworks/ui/SortDropdown.js +31 -0
- package/es/library/dot/legacy-to-new-arch/sort-dropdown/frameworks/ui/SortDropdownTranslator.js +33 -0
- package/es/library/dot/legacy-to-new-arch/sort-dropdown/frameworks/ui/SortDropdownView.js +83 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/checkbox-field/frameworks/ui/CheckboxField.js +12 -2
- package/es/library/dot/legacy-to-new-arch/table-field-components/checkbox-field/frameworks/ui/CheckboxFieldView.js +8 -5
- package/es/library/dot/legacy-to-new-arch/table-field-components/checkbox-field/frameworks/ui/EventHandlersFactory.js +3 -3
- package/es/library/dot/legacy-to-new-arch/table-field-components/email-field/frameworks/ui/EmailField.js +3 -3
- package/es/library/dot/legacy-to-new-arch/table-field-components/email-field/frameworks/ui/EmailFieldView.js +8 -6
- package/es/library/dot/legacy-to-new-arch/table-field-components/highlighted-value-field/frameworks/ui/EventHandlersFactory.js +26 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/highlighted-value-field/frameworks/ui/HighlightedValueField.js +23 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/highlighted-value-field/frameworks/ui/HighlightedValueFieldView.js +24 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/index.js +22 -5
- package/es/library/dot/legacy-to-new-arch/table-field-components/labeled-avatar-field/frameworks/ui/EventHandlersFactory.js +26 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/labeled-avatar-field/frameworks/ui/LabeledAvatarField.js +23 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/labeled-avatar-field/frameworks/ui/LabeledAvatarFieldView.js +22 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/link-field/frameworks/ui/EventHandlersFactory.js +26 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/link-field/frameworks/ui/LinkField.js +23 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/link-field/frameworks/ui/LinkFieldView.js +26 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/lookup-field/frameworks/ui/LookupFieldView.js +1 -1
- package/es/library/dot/legacy-to-new-arch/table-field-components/phone-field/frameworks/ui/PhoneFieldView.js +1 -1
- package/es/library/dot/legacy-to-new-arch/table-field-components/radio-dropdown-field/frameworks/ui/EventHandlersFactory.js +46 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/radio-dropdown-field/frameworks/ui/RadioDropdownField.js +49 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/radio-dropdown-field/frameworks/ui/RadioDropdownFieldView.js +43 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/radio-dropdown-field/frameworks/ui/css/RadioDropdownField.module.css +3 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/switch-field/frameworks/ui/EventHandlersFactory.js +3 -3
- package/es/library/dot/legacy-to-new-arch/table-field-components/switch-field/frameworks/ui/SwitchField.js +14 -4
- package/es/library/dot/legacy-to-new-arch/table-field-components/switch-field/frameworks/ui/SwitchFieldView.js +8 -4
- package/es/library/dot/legacy-to-new-arch/table-field-components/tag-field/frameworks/ui/EventHandlersFactory.js +26 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/tag-field/frameworks/ui/TagField.js +23 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/tag-field/frameworks/ui/TagFieldView.js +34 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/tags-field/frameworks/ui/EventHandlersFactory.js +26 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/tags-field/frameworks/ui/TagsField.js +23 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/tags-field/frameworks/ui/TagsFieldView.js +18 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/tags-list-dropdown-field/frameworks/ui/TagsListDropdownField.js +44 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/tags-list-dropdown-field/frameworks/ui/TagsListDropdownFieldView.js +24 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/text-field/frameworks/ui/EventHandlersFactory.js +26 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/text-field/frameworks/ui/TextField.js +23 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/text-field/frameworks/ui/TextFieldView.js +20 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/url-field/frameworks/ui/UrlFieldView.js +1 -1
- package/es/library/dot/legacy-to-new-arch/tag/frameworks/ui/Tag.js +11 -0
- package/es/library/dot/legacy-to-new-arch/tag/frameworks/ui/Tag.module.css +8 -0
- package/es/library/dot/legacy-to-new-arch/tag/frameworks/ui/TagView.js +96 -0
- package/es/library/dot/legacy-to-new-arch/tags-list-dropdown/frameworks/ui/TagContractAdapter.js +24 -0
- package/es/library/dot/legacy-to-new-arch/tags-list-dropdown/frameworks/ui/TagsListDropdown.js +12 -0
- package/es/library/dot/legacy-to-new-arch/tags-list-dropdown/frameworks/ui/TagsListDropdownView.js +42 -0
- package/es/platform/client-actions/components/interfaces/ActionViewModel.js +1 -0
- package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActions/RowActionsRenderer.module.css +4 -0
- package/es/platform/client-scripts/bc/zclient-scripts-execution/Constants.js +2 -4
- package/es/platform/client-scripts/behaviour/zclient-scripts-execution/domain/entities/ClientScriptExecutor.js +33 -60
- package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/domain/entities/interfaces/ClientScriptModel.js +5 -1
- package/es/platform/components/index.js +2 -1
- package/es/platform/components/smart-action-band/adapters/presenters/ActionBandTranslator.js +73 -0
- package/es/platform/components/smart-action-band/adapters/presenters/translators/interfaces/ActionBandTranslatorState.js +1 -0
- package/es/platform/components/smart-action-band/adapters/presenters/utils/DefaultClientActions.js +147 -0
- package/es/platform/components/smart-action-band/adapters/resources/SmartActionBandResource.js +46 -0
- package/es/platform/components/smart-action-band/applications/interfaces/ISmartActionBandResource.js +1 -0
- package/es/platform/components/smart-action-band/applications/interfaces/State.js +1 -0
- package/es/platform/components/smart-action-band/applications/interfaces/UseCaseDependencies.js +1 -0
- package/es/platform/components/smart-action-band/applications/interfaces/output/IPresenter.js +1 -0
- package/es/platform/components/smart-action-band/applications/usecases/AbstractUseCase.js +18 -0
- package/es/platform/components/smart-action-band/domain/entities/interfaces/Properties.js +1 -0
- package/es/platform/components/smart-action-band/frameworks/EventHandlersFactory.js +106 -0
- package/es/platform/components/smart-action-band/frameworks/SmartActionBand.js +5 -0
- package/es/platform/components/smart-action-band/frameworks/SmartActionBandFactory.js +55 -0
- package/es/platform/components/smart-action-band/frameworks/SmartActionBandSdkFactory.js +24 -0
- package/es/platform/components/smart-action-band/frameworks/SmartActionBandView.js +48 -0
- package/es/platform/components/table-connected/adapters/controllers/ScrollController.js +29 -8
- package/es/platform/components/table-connected/adapters/controllers/ScrollEndReachedController.js +23 -0
- package/es/platform/components/table-connected/adapters/resources/SmartTableResource.js +172 -8
- package/es/platform/components/table-connected/frameworks/EventHandlersFactory.js +39 -6
- package/es/platform/components/table-connected/frameworks/TableConnectedFactory.js +7 -1
- package/es/platform/components/table-connected/frameworks/TableConnectedView.js +2 -0
- package/es/platform/data-source/http-template/getComponentMapping.js +17 -0
- package/es/platform/data-source/http-template/getRecords.js +1 -0
- package/es/platform/data-source/index.js +3 -1
- package/es/platform/sdk/frameworks/Sdk.js +7 -0
- package/es/platform/zfield/applications/usecases/FetchSuccessUseCase.js +33 -0
- package/es/platform/zfield/domain/entities/fields-manager/FieldsManager.js +5 -0
- package/es/platform/zlist/adapters/controllers/RefreshRecordsRequestedController.js +21 -0
- package/es/platform/zlist/adapters/controllers/SortController.js +2 -2
- package/es/platform/zlist/adapters/gateways/Repository.js +6 -11
- package/es/platform/zlist/adapters/gateways/Service.js +2 -0
- package/es/platform/zlist/adapters/presenters/TableTranslator.js +57 -13
- package/es/platform/zlist/adapters/presenters/translators/ColumnTranslator.js +57 -49
- package/es/platform/zlist/adapters/presenters/translators/FieldVariations.js +25 -0
- package/es/platform/zlist/adapters/presenters/translators/Header.js +29 -21
- package/es/platform/zlist/adapters/presenters/translators/HeadersTranslator.js +3 -3
- package/es/platform/zlist/adapters/presenters/translators/Row.js +16 -2
- package/es/platform/zlist/adapters/presenters/translators/RowsTranslator.js +3 -1
- package/es/platform/zlist/adapters/presenters/translators/fields/BooleanFieldTranslator.js +87 -12
- package/es/platform/zlist/adapters/presenters/translators/fields/CurrencyFieldTranslator.js +66 -11
- package/es/platform/zlist/adapters/presenters/translators/fields/DateFieldTranslator.js +33 -8
- package/es/platform/zlist/adapters/presenters/translators/fields/DateTimeFieldTranslator.js +33 -8
- package/es/platform/zlist/adapters/presenters/translators/fields/DecimalFieldTranslator.js +16 -9
- package/es/platform/zlist/adapters/presenters/translators/fields/EmailFieldTranslator.js +29 -9
- package/es/platform/zlist/adapters/presenters/translators/fields/FormulaFieldTranslator.js +23 -27
- package/es/platform/zlist/adapters/presenters/translators/fields/LookUpFieldTranslator.js +106 -17
- package/es/platform/zlist/adapters/presenters/translators/fields/MultiLineFieldTranslator.js +16 -9
- package/es/platform/zlist/adapters/presenters/translators/fields/MultiSelectFieldTranslator.js +100 -26
- package/es/platform/zlist/adapters/presenters/translators/fields/NumberFieldTranslator.js +16 -9
- package/es/platform/zlist/adapters/presenters/translators/fields/PercentageFieldTranslator.js +16 -9
- package/es/platform/zlist/adapters/presenters/translators/fields/PhoneFieldTranslator.js +32 -9
- package/es/platform/zlist/adapters/presenters/translators/fields/PickListFieldTranslator.js +167 -26
- package/es/platform/zlist/adapters/presenters/translators/fields/SingleLineFieldTranslator.js +16 -9
- package/es/platform/zlist/adapters/presenters/translators/fields/URLFieldTranslator.js +32 -9
- package/es/platform/zlist/adapters/presenters/utils/DateAndTimeFormat.js +25 -0
- package/es/platform/zlist/adapters/presenters/utils/DefaultClientActions.js +7 -4
- package/es/platform/zlist/adapters/presenters/utils/fieldSortLabels.js +38 -0
- package/es/platform/zlist/applications/entities-factory/ListFactory.js +2 -2
- package/es/platform/zlist/applications/interfaces/input/GetSortConfigUseCaseInputModel.js +1 -0
- package/es/platform/zlist/applications/interfaces/input/RefreshRecordsRequestedUseCaseInputModel.js +1 -0
- package/es/platform/zlist/applications/interfaces/input/SetSortConfigUseCaseInputModel.js +1 -0
- package/es/platform/zlist/applications/usecases/GetSortConfigUseCase.js +17 -0
- package/es/platform/zlist/applications/usecases/RecordSuccessCallbackUsecase.js +1 -1
- package/es/platform/zlist/applications/usecases/RefreshRecordsRequestedUseCase.js +17 -0
- package/es/platform/zlist/applications/usecases/SetSortConfigUseCase.js +26 -0
- package/es/platform/zlist/applications/usecases/SortUseCase.js +6 -6
- package/es/platform/zlist/domain/entities/List.js +32 -16
- package/es/platform/zlist/domain/entities/interfaces/Properties.js +5 -5
- package/es/platform/zlist/frameworks/EventHandlersFactory.js +3 -4
- package/es/platform/zlist/frameworks/ZListBehaviourFactory.js +15 -13
- package/es/platform/zrecord/adapters/controllers/FilterRecordLocalController.js +28 -0
- package/es/platform/zrecord/adapters/gateways/Repository.js +5 -2
- package/es/platform/zrecord/adapters/gateways/Service.js +2 -0
- package/es/platform/zrecord/applications/entities-factory/RecordsManagerFactory.js +2 -2
- package/es/platform/zrecord/applications/interfaces/input/ClearAllFiltersUseCaseInputModel.js +1 -0
- package/es/platform/zrecord/applications/interfaces/input/FilterRecordInputModel.js +1 -0
- package/es/platform/zrecord/applications/interfaces/input/GetFilterConditionUseCaseInputModel.js +1 -0
- package/es/platform/zrecord/applications/interfaces/input/GetFilterConfigUseCaseInputModel.js +1 -0
- package/es/platform/zrecord/applications/interfaces/input/RefreshRecordsUseCaseInputModel.js +1 -0
- package/es/platform/zrecord/applications/interfaces/input/SetFilterUseCaseInputModel.js +1 -0
- package/es/platform/zrecord/applications/usecases/ClearAllFiltersUseCase.js +24 -0
- package/es/platform/zrecord/applications/usecases/FilterRecordUseCase.js +21 -0
- package/es/platform/zrecord/applications/usecases/GetFilterConditionUseCase.js +15 -0
- package/es/platform/zrecord/applications/usecases/GetFilterConfigUseCase.js +15 -0
- package/es/platform/zrecord/applications/usecases/RefreshRecordsUseCase.js +14 -0
- package/es/platform/zrecord/applications/usecases/SetFilterUseCase.js +29 -0
- package/es/platform/zrecord/domain/entities/Filter.js +247 -0
- package/es/platform/zrecord/domain/entities/RecordsManager.js +43 -1
- package/es/platform/zrecord/domain/entities/interfaces/IFilter.js +1 -0
- package/es/platform/zrecord/frameworks/ActionsHandlersFactory.js +4 -1
- package/es/platform/zrecord/frameworks/RecordBehaviourFactory.js +11 -1
- package/package.json +20 -19
- package/es/bc/sort-by/SortOrderEnum.js +0 -8
- package/es/library/behaviours/sort-by/frameworks/ui/DemoBehaviour.js +0 -20
- package/es/library/dot/components/table-list/adapters/controllers/SortByController.js +0 -25
- package/es/library/dot/components/table-list/adapters/controllers/SortedController.js +0 -18
- package/es/library/dot/components/table-list/frameworks/ui/handlers/HandleSortClick.js +0 -12
- package/es/platform/zlist/adapters/gateways/SortBy.js +0 -38
- package/es/platform/zlist/domain/entities/SortBy.js +0 -58
- /package/es/{library/behaviours/sort-by/applications/interfaces/output/SortByOutputModel.js → bc/float-pagination/types/FloatPaginationBehaviourState.js} +0 -0
- /package/es/{platform/zlist/applications/interfaces/gateways/ISortBy.js → bc/list-selection/Types.js} +0 -0
- /package/es/{platform/zlist/domain/entities/interfaces/ISortBy.js → bc/search-box/types/SearchBehaviourState.js} +0 -0
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { CLIENT_SCRIPT_ARGUMENT, CLIENT_SCRIPT_ERROR_MESSAGE,
|
|
1
|
+
import { CLIENT_SCRIPT_ARGUMENT, CLIENT_SCRIPT_ERROR_MESSAGE, CLIENT_SCRIPT_ID_PREFIX, CLIENT_SCRIPT_INVALID_SCRIPT_ERROR_MESSAGE, CLIENT_SCRIPT_NO_MAPPING_FOUND_ERROR_MESSAGE } from "../../../../bc/zclient-scripts-execution/Constants";
|
|
2
2
|
import { platformSDK } from "../../../../../sdk/frameworks/Sdk";
|
|
3
|
-
import { ClientScriptExecutionStatus } from "./types/ClientScriptExectionTypeDefintions";
|
|
4
3
|
export default class ClientScriptExecutor {
|
|
5
4
|
constructor(clientScriptsMapping, context) {
|
|
6
5
|
this.clientScriptsMapping = clientScriptsMapping;
|
|
@@ -33,77 +32,51 @@ export default class ClientScriptExecutor {
|
|
|
33
32
|
};
|
|
34
33
|
}
|
|
35
34
|
|
|
36
|
-
|
|
37
|
-
const
|
|
38
|
-
status
|
|
39
|
-
} = result;
|
|
40
|
-
|
|
41
|
-
switch (status) {
|
|
42
|
-
case ClientScriptExecutionStatus.FAILURE:
|
|
43
|
-
const {
|
|
44
|
-
error: {
|
|
45
|
-
message
|
|
46
|
-
}
|
|
47
|
-
} = result;
|
|
48
|
-
console.error(CLIENT_SCRIPT_ERROR_MESSAGE, message);
|
|
49
|
-
break;
|
|
35
|
+
executeClientScript(targetEvent) {
|
|
36
|
+
const clientScript = window.__CLIENT_SCRIPTS__[targetEvent];
|
|
50
37
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
break;
|
|
38
|
+
if (!clientScript) {
|
|
39
|
+
console.error(CLIENT_SCRIPT_NO_MAPPING_FOUND_ERROR_MESSAGE, targetEvent);
|
|
54
40
|
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
getClientScriptExecutionPromise(clientScript, clientScriptArguments) {
|
|
58
|
-
return new Promise((resolve, reject) => {
|
|
59
|
-
try {
|
|
60
|
-
clientScript(clientScriptArguments);
|
|
61
|
-
resolve({
|
|
62
|
-
status: ClientScriptExecutionStatus.SUCCESS
|
|
63
|
-
});
|
|
64
|
-
} catch (e) {
|
|
65
|
-
resolve({
|
|
66
|
-
status: ClientScriptExecutionStatus.FAILURE,
|
|
67
|
-
error: e
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
getClientScriptTimeoutPromise(timeout) {
|
|
74
|
-
return new Promise((resolve, reject) => {
|
|
75
|
-
setTimeout(() => {
|
|
76
|
-
resolve({
|
|
77
|
-
status: ClientScriptExecutionStatus.TIMEDOUT
|
|
78
|
-
});
|
|
79
|
-
}, timeout);
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
41
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
42
|
+
try {
|
|
43
|
+
clientScript(this.getClientScriptArguments(targetEvent));
|
|
44
|
+
} catch (err) {
|
|
45
|
+
console.error(CLIENT_SCRIPT_ERROR_MESSAGE, err);
|
|
46
|
+
}
|
|
87
47
|
}
|
|
88
48
|
|
|
89
|
-
constructClientScriptFunction(clientScriptFnBody) {
|
|
49
|
+
constructClientScriptFunction(targetEvent, clientScriptFnBody) {
|
|
90
50
|
try {
|
|
91
|
-
const
|
|
92
|
-
|
|
51
|
+
const scriptElement = document.createElement("script");
|
|
52
|
+
scriptElement.nonce = window.nonce;
|
|
53
|
+
scriptElement.textContent = `
|
|
54
|
+
window.__CLIENT_SCRIPTS__ = window.__CLIENT_SCRIPTS__ || {};
|
|
55
|
+
window.__CLIENT_SCRIPTS__["${targetEvent}"] = function (${CLIENT_SCRIPT_ARGUMENT}) {
|
|
56
|
+
"use strict";
|
|
57
|
+
${clientScriptFnBody}
|
|
58
|
+
};
|
|
59
|
+
`;
|
|
60
|
+
scriptElement.id = `${CLIENT_SCRIPT_ID_PREFIX}-${targetEvent}`;
|
|
61
|
+
document.head.appendChild(scriptElement);
|
|
93
62
|
} catch (e) {
|
|
94
63
|
console.error(CLIENT_SCRIPT_INVALID_SCRIPT_ERROR_MESSAGE, e.message);
|
|
95
64
|
}
|
|
96
65
|
}
|
|
97
66
|
|
|
67
|
+
cleanupClientScript(targetEvent) {
|
|
68
|
+
const scriptElement = document.getElementById(`${CLIENT_SCRIPT_ID_PREFIX}-${targetEvent}`);
|
|
69
|
+
|
|
70
|
+
if (scriptElement) {
|
|
71
|
+
document.head.removeChild(scriptElement);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
98
75
|
handleClientScriptExecution(targetEvent, clientScript) {
|
|
99
76
|
if (!clientScript) return;
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
this.
|
|
103
|
-
this.handleClientScriptExecutionResult(result);
|
|
104
|
-
}).catch(error => {
|
|
105
|
-
console.error(CLIENT_SCRIPT_RUNTIME_ERROR_MESSAGE, error);
|
|
106
|
-
});
|
|
77
|
+
this.constructClientScriptFunction(targetEvent, clientScript);
|
|
78
|
+
this.executeClientScript(targetEvent);
|
|
79
|
+
this.cleanupClientScript(targetEvent);
|
|
107
80
|
}
|
|
108
81
|
|
|
109
82
|
executeTargetAction() {
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export { default as TableConnectedFactory } from "./table-connected/frameworks/TableConnectedFactory";
|
|
2
|
-
export { default as FormConnectedFactory } from "./form-connected/frameworks/FormConnectedFactory";
|
|
2
|
+
export { default as FormConnectedFactory } from "./form-connected/frameworks/FormConnectedFactory";
|
|
3
|
+
export { default as SmartActionBandFactory } from "./smart-action-band/frameworks/SmartActionBandFactory";
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import ClientActionsTranslator from "../../../../client-actions/translators/client-actions-translator";
|
|
2
|
+
import DefaultClientActions from "./utils/DefaultClientActions";
|
|
3
|
+
import { ActionBandLocations } from "../../../../../bc/action-band/Constants";
|
|
4
|
+
export default class ActionBandTranslator {
|
|
5
|
+
static transformState(state) {
|
|
6
|
+
const {
|
|
7
|
+
instanceName,
|
|
8
|
+
moduleName,
|
|
9
|
+
reloadConfig,
|
|
10
|
+
searchConfig,
|
|
11
|
+
sortConfig
|
|
12
|
+
} = state.properties;
|
|
13
|
+
const {
|
|
14
|
+
zclientAction,
|
|
15
|
+
zclientScriptsEventMapping,
|
|
16
|
+
zfield,
|
|
17
|
+
sortBy
|
|
18
|
+
} = state.behaviours;
|
|
19
|
+
const {
|
|
20
|
+
context
|
|
21
|
+
} = state.behaviours.appContext;
|
|
22
|
+
const {
|
|
23
|
+
clientActions,
|
|
24
|
+
isFetching: isClientActionsFetching
|
|
25
|
+
} = zclientAction || {};
|
|
26
|
+
let sorttableFields = zfield.fields.filter(field => field.isSortable === true);
|
|
27
|
+
const combinedClientActions = Array.isArray(clientActions) ? [...clientActions] : [];
|
|
28
|
+
|
|
29
|
+
if (reloadConfig?.isEnabled) {
|
|
30
|
+
combinedClientActions.push(DefaultClientActions.createReloadAction());
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (searchConfig?.isEnabled) {
|
|
34
|
+
combinedClientActions.push(DefaultClientActions.createSearchAction());
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (sortConfig?.isEnabled) {
|
|
38
|
+
combinedClientActions.push(DefaultClientActions.createSortByAction(sortBy, sortConfig, sorttableFields));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const mappedClientActions = mapper(combinedClientActions || []);
|
|
42
|
+
const transformedClientActions = {};
|
|
43
|
+
Object.entries(mappedClientActions).forEach(_ref => {
|
|
44
|
+
let [key, value] = _ref;
|
|
45
|
+
let bandActions = ClientActionsTranslator.transform(value, instanceName, moduleName, { ...context,
|
|
46
|
+
defaultSortField: sortConfig.defaultSortField
|
|
47
|
+
});
|
|
48
|
+
transformedClientActions[key] = bandActions;
|
|
49
|
+
});
|
|
50
|
+
const {
|
|
51
|
+
clientScripts,
|
|
52
|
+
isFetching: isClientScriptsFetching
|
|
53
|
+
} = zclientScriptsEventMapping;
|
|
54
|
+
const {
|
|
55
|
+
actionBandLeftActions,
|
|
56
|
+
actionBandRightActions
|
|
57
|
+
} = transformedClientActions;
|
|
58
|
+
return { ...state,
|
|
59
|
+
...zclientAction,
|
|
60
|
+
viewModel: {
|
|
61
|
+
actionBandLeftActions,
|
|
62
|
+
actionBandRightActions,
|
|
63
|
+
clientScripts
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const mapper = clientAction => ({
|
|
71
|
+
actionBandLeftActions: clientAction.filter(action => action.location === ActionBandLocations.LEFT_ACTIONS),
|
|
72
|
+
actionBandRightActions: clientAction.filter(action => action.location === ActionBandLocations.RIGHT_ACTIONS)
|
|
73
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/es/platform/components/smart-action-band/adapters/presenters/utils/DefaultClientActions.js
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/* eslint-disable max-lines-per-function */
|
|
2
|
+
import { i18NProviderUtils } from '@zohodesk/i18n';
|
|
3
|
+
import { SORT_BY_UPDATE_REQUESTED } from "../../../../../../bc/sort-by/Constants";
|
|
4
|
+
import { SortOrder } from "../../../../../../bc/zlist/Types";
|
|
5
|
+
import { SmartActionBandConstants } from "../../../../../../cc/action-band";
|
|
6
|
+
import { SortDropdownConstants } from "../../../../../../cc/sort-dropdown";
|
|
7
|
+
import ClientAction from "../../../../../client-actions/behaviour/zclient-actions/domain/entities/ClientAction";
|
|
8
|
+
import { SortModelOrder } from "../../../../../zlist/domain/entities/interfaces/Properties";
|
|
9
|
+
import { IconButtonConstants } from "../../../../../../cc/icon-button";
|
|
10
|
+
import { SEARCH_TYPE_UPDATED } from "../../../../../../bc/search-box/Constants";
|
|
11
|
+
import { ActionBandLocations } from "../../../../../../bc/action-band/Constants";
|
|
12
|
+
import { getFieldTypeSortLabels } from "../../../../../zlist/adapters/presenters/utils/fieldSortLabels";
|
|
13
|
+
import { SMART_ACTION_BAND_COMPONENT_NAME } from "../../../../../../cc/action-band/constants/ExternalConstants"; // import SortDropdownConstants from "@cc/sort-dropdown/Constants";
|
|
14
|
+
|
|
15
|
+
class DefaultClientActions {
|
|
16
|
+
static constructAction(clientAction) {
|
|
17
|
+
return new ClientAction({ ...clientAction,
|
|
18
|
+
modules: ['MODULE'],
|
|
19
|
+
component: SMART_ACTION_BAND_COMPONENT_NAME,
|
|
20
|
+
modifiedTime: '2024-11-21T06:11:59.000Z',
|
|
21
|
+
createdTime: '2024-11-21T06:11:59.000Z'
|
|
22
|
+
}).toObject();
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
static createSearchAction() {
|
|
26
|
+
return this.constructAction({
|
|
27
|
+
uiComponentMapping: {
|
|
28
|
+
component: 'Search',
|
|
29
|
+
name: 'Action Band Search Action',
|
|
30
|
+
id: '4000000080003',
|
|
31
|
+
propertiesValueMapping: {},
|
|
32
|
+
eventMappings: [{
|
|
33
|
+
payloadValueMapping: {
|
|
34
|
+
searchQuery: '{{@payload.searchQuery}}'
|
|
35
|
+
},
|
|
36
|
+
sourceEvent: SEARCH_TYPE_UPDATED,
|
|
37
|
+
id: '4000000080005',
|
|
38
|
+
targetEvent: SmartActionBandConstants.ExternalConstants.SMART_ACTION_BAND_SEARCH_ON_TYPE
|
|
39
|
+
}]
|
|
40
|
+
},
|
|
41
|
+
conditions: {
|
|
42
|
+
fields: [],
|
|
43
|
+
pattern: '1'
|
|
44
|
+
},
|
|
45
|
+
location: ActionBandLocations.LEFT_ACTIONS,
|
|
46
|
+
id: '4000000080009',
|
|
47
|
+
name: 'SEARCH ACTION'
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
static createReloadAction() {
|
|
52
|
+
return this.constructAction({
|
|
53
|
+
uiComponentMapping: {
|
|
54
|
+
component: 'IconButton',
|
|
55
|
+
name: 'Action Band Reload Action',
|
|
56
|
+
id: '4000000080003',
|
|
57
|
+
propertiesValueMapping: {
|
|
58
|
+
iconName: 'ZD-reload',
|
|
59
|
+
iconSize: '12',
|
|
60
|
+
title: 'Refresh'
|
|
61
|
+
},
|
|
62
|
+
eventMappings: [{
|
|
63
|
+
payloadValueMapping: {},
|
|
64
|
+
sourceEvent: IconButtonConstants.ICON_BUTTON_CLICKED,
|
|
65
|
+
id: '4000000080005',
|
|
66
|
+
targetEvent: SmartActionBandConstants.ExternalConstants.SMART_ACTION_BAND_RELOAD_CLICKED
|
|
67
|
+
}]
|
|
68
|
+
},
|
|
69
|
+
conditions: {
|
|
70
|
+
fields: [],
|
|
71
|
+
pattern: '1'
|
|
72
|
+
},
|
|
73
|
+
location: ActionBandLocations.RIGHT_ACTIONS,
|
|
74
|
+
id: '4000000080009',
|
|
75
|
+
name: 'RELOAD ACTION'
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
static createSortByAction(sortBy, sortConfigFromProps, sorttableFields) {
|
|
80
|
+
const {
|
|
81
|
+
defaultSortField,
|
|
82
|
+
defaultSortOrder,
|
|
83
|
+
sortI18NLabels
|
|
84
|
+
} = sortConfigFromProps;
|
|
85
|
+
const {
|
|
86
|
+
order,
|
|
87
|
+
fieldName
|
|
88
|
+
} = sortBy;
|
|
89
|
+
const currentSortOrder = order === SortOrder.DES ? SortModelOrder.DES : SortModelOrder.ASC;
|
|
90
|
+
const currentSortFieldName = fieldName !== undefined ? fieldName : defaultSortField;
|
|
91
|
+
const defaultFieldObj = sorttableFields.find(field => field.name === defaultSortField);
|
|
92
|
+
const currentSortField = sorttableFields.find(field => field.name === currentSortFieldName);
|
|
93
|
+
const fieldOptions = sorttableFields.map(field => ({
|
|
94
|
+
name: field.name,
|
|
95
|
+
label: field.i18NLabel
|
|
96
|
+
}));
|
|
97
|
+
const fieldLabels = sortI18NLabels?.find(fieldObj => fieldObj.fieldName === currentSortFieldName);
|
|
98
|
+
const defaultSortLabels = getFieldTypeSortLabels(currentSortField?.type);
|
|
99
|
+
const ascendingLabel = (fieldLabels?.ascending === undefined ? fieldLabels?.ascending : i18NProviderUtils.getI18NValue('support.platform.smart.libraries.sort.tooltip', fieldLabels.ascending)) ?? defaultSortLabels?.ascendLabel;
|
|
100
|
+
const descendingLabel = (fieldLabels?.descending === undefined ? fieldLabels?.descending : i18NProviderUtils.getI18NValue('support.platform.smart.libraries.sort.tooltip', fieldLabels.descending)) ?? defaultSortLabels?.descendLabel;
|
|
101
|
+
return this.constructAction({
|
|
102
|
+
uiComponentMapping: {
|
|
103
|
+
component: 'SortDropdown',
|
|
104
|
+
name: 'Action Band Sort Action',
|
|
105
|
+
id: '4000000080003',
|
|
106
|
+
propertiesValueMapping: {
|
|
107
|
+
options: fieldOptions,
|
|
108
|
+
selectedOption: {
|
|
109
|
+
name: currentSortFieldName,
|
|
110
|
+
label: currentSortField?.i18NLabel || currentSortFieldName,
|
|
111
|
+
order: currentSortOrder
|
|
112
|
+
},
|
|
113
|
+
taggedOption: defaultSortField,
|
|
114
|
+
isResetDisabled: currentSortFieldName === defaultSortField && currentSortOrder === defaultSortOrder ? true : false,
|
|
115
|
+
iconTooltip: currentSortOrder === SortModelOrder.ASC ? descendingLabel : ascendingLabel
|
|
116
|
+
},
|
|
117
|
+
eventMappings: [{
|
|
118
|
+
payloadValueMapping: {
|
|
119
|
+
fieldName: '{{@payload.name}}',
|
|
120
|
+
order: '{{@payload.order}}'
|
|
121
|
+
},
|
|
122
|
+
sourceEvent: SortDropdownConstants.SORT_DROPDOWN_SORT_REQUESTED,
|
|
123
|
+
id: '4000000080005',
|
|
124
|
+
targetEvent: SORT_BY_UPDATE_REQUESTED
|
|
125
|
+
}, {
|
|
126
|
+
payloadValueMapping: {
|
|
127
|
+
fieldName: defaultSortField,
|
|
128
|
+
order: defaultSortOrder
|
|
129
|
+
},
|
|
130
|
+
sourceEvent: SortDropdownConstants.SORT_DROPDOWN_RESET_REQUESTED,
|
|
131
|
+
id: '4000000080005',
|
|
132
|
+
targetEvent: SORT_BY_UPDATE_REQUESTED
|
|
133
|
+
}]
|
|
134
|
+
},
|
|
135
|
+
conditions: {
|
|
136
|
+
fields: [],
|
|
137
|
+
pattern: '1'
|
|
138
|
+
},
|
|
139
|
+
location: ActionBandLocations.LEFT_ACTIONS,
|
|
140
|
+
id: '4000000080009',
|
|
141
|
+
name: 'SORT ACTION'
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export default DefaultClientActions;
|
package/es/platform/components/smart-action-band/adapters/resources/SmartActionBandResource.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { AbstractResource } from "../../../../sdk/application/interfaces/gateways/AbstractResource";
|
|
2
|
+
import SortByRepository from "../../../../../library/behaviours/sort-by/adapters/gateway/Repository";
|
|
3
|
+
import SortByPresenters from "../../../../../library/behaviours/sort-by/adapters/presenter/Presenter";
|
|
4
|
+
import { SdkContracts } from "../../../../../cc/action-band/SdkContract";
|
|
5
|
+
import UpdateSortByUseCase from "../../../../../library/behaviours/sort-by/applications/usecases/UpdateSortByUseCase";
|
|
6
|
+
export class SmartActionBandResource extends AbstractResource {
|
|
7
|
+
initialize() {}
|
|
8
|
+
|
|
9
|
+
destroy() {}
|
|
10
|
+
|
|
11
|
+
getSortByDependencies() {
|
|
12
|
+
const dependencies = {
|
|
13
|
+
repository: new SortByRepository(),
|
|
14
|
+
presenter: new SortByPresenters()
|
|
15
|
+
};
|
|
16
|
+
return dependencies;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
createUseCase(dependencies, UseCaseClass) {
|
|
20
|
+
const {
|
|
21
|
+
state,
|
|
22
|
+
updateState
|
|
23
|
+
} = this.dependencies;
|
|
24
|
+
const usecase = new UseCaseClass(dependencies);
|
|
25
|
+
usecase.updateDependency?.(state, updateState);
|
|
26
|
+
usecase.updateDependencies?.(state, updateState);
|
|
27
|
+
return usecase;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
updateSortBy(sortBy) {
|
|
31
|
+
this.validateInput('updateSortBy', {
|
|
32
|
+
sortBy
|
|
33
|
+
}, SdkContracts.updateSortByInputMeta);
|
|
34
|
+
const {
|
|
35
|
+
dispatch
|
|
36
|
+
} = this.dependencies;
|
|
37
|
+
const dependencies = this.getSortByDependencies();
|
|
38
|
+
const usecase = this.createUseCase(dependencies, UpdateSortByUseCase);
|
|
39
|
+
usecase.execute({
|
|
40
|
+
fieldName: sortBy.fieldName,
|
|
41
|
+
order: sortBy.order,
|
|
42
|
+
dispatch
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
}
|
package/es/platform/components/smart-action-band/applications/interfaces/ISmartActionBandResource.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/es/platform/components/smart-action-band/applications/interfaces/UseCaseDependencies.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
class AbstractUseCase {
|
|
2
|
+
constructor(dependencies) {
|
|
3
|
+
this.dependencies = dependencies;
|
|
4
|
+
this.execute = this.execute.bind(this);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
updateDependency(state, updateState) {
|
|
8
|
+
const {
|
|
9
|
+
repository,
|
|
10
|
+
presenter
|
|
11
|
+
} = this.dependencies;
|
|
12
|
+
repository.init(state);
|
|
13
|
+
presenter.updateDependencies(state, updateState);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export default AbstractUseCase;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
// import Repository from '../adapters/gateways/Repository';
|
|
2
|
+
// import Presenter from '../adapters/presenters/Presenters';
|
|
3
|
+
// import Service from '../adapters/gateways/Service';
|
|
4
|
+
import { platformSDK } from "../../../sdk/frameworks/Sdk";
|
|
5
|
+
import ActionBandSdkFactory from "./SmartActionBandSdkFactory";
|
|
6
|
+
import { SEARCH_TYPE_CLEARED } from "../../../../bc/search-box/Constants";
|
|
7
|
+
import { SmartActionBandConstants } from "../../../../cc/action-band";
|
|
8
|
+
import { SORT_BY_UPDATED } from "../../../../bc/sort-by/Constants"; // NOTE: Remove unused import
|
|
9
|
+
// import SortByInitializeController from '@platform/components/smart-action-band/adapters/controllers/SortByInitializeController';
|
|
10
|
+
|
|
11
|
+
function createHandlerWithSdk(handler) {
|
|
12
|
+
return input => {
|
|
13
|
+
const {
|
|
14
|
+
state
|
|
15
|
+
} = input;
|
|
16
|
+
const instanceName = state.properties.instanceName;
|
|
17
|
+
handler({ ...input,
|
|
18
|
+
platformSDK
|
|
19
|
+
}, ActionBandSdkFactory.create({
|
|
20
|
+
instanceName
|
|
21
|
+
}));
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export default class EventHandlersFactory {
|
|
26
|
+
static getSdkWrappedEventHandler(eventHandlers) {
|
|
27
|
+
return Object.fromEntries(Object.keys(eventHandlers).map(eventName => {
|
|
28
|
+
const handler = createHandlerWithSdk(eventHandlers[eventName]);
|
|
29
|
+
return [eventName, handler];
|
|
30
|
+
}));
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
static create(eventHandlers, name) {
|
|
34
|
+
const wrapped = EventHandlersFactory.getSdkWrappedEventHandler(eventHandlers); // TODO: Remove unused code
|
|
35
|
+
// const repository = new Repository();
|
|
36
|
+
// const presenter = new Presenter();
|
|
37
|
+
// const service = new Service({ repository, presenter });
|
|
38
|
+
|
|
39
|
+
const defaultEventHandlers = {
|
|
40
|
+
// [SEARCH_TYPE_UPDATED]: ({ action, dispatch }) => {
|
|
41
|
+
// const { payload } = action;
|
|
42
|
+
// dispatch({ type: SmartActionBandConstants.ExternalConstants.SMART_ACTION_BAND_SEARCH_ON_TYPE, payload });
|
|
43
|
+
// },
|
|
44
|
+
// [`${name}#MOUNT`]: new SortByInitializeController(service).handle,
|
|
45
|
+
[SEARCH_TYPE_CLEARED]: _ref => {
|
|
46
|
+
let {
|
|
47
|
+
action,
|
|
48
|
+
dispatch
|
|
49
|
+
} = _ref;
|
|
50
|
+
const {
|
|
51
|
+
payload
|
|
52
|
+
} = action;
|
|
53
|
+
dispatch({
|
|
54
|
+
type: SmartActionBandConstants.ExternalConstants.SMART_ACTION_BAND_SEARCH_CLEARED,
|
|
55
|
+
payload
|
|
56
|
+
});
|
|
57
|
+
},
|
|
58
|
+
[SORT_BY_UPDATED]: _ref2 => {
|
|
59
|
+
let {
|
|
60
|
+
action,
|
|
61
|
+
dispatch
|
|
62
|
+
} = _ref2;
|
|
63
|
+
const {
|
|
64
|
+
payload
|
|
65
|
+
} = action;
|
|
66
|
+
dispatch({
|
|
67
|
+
type: SmartActionBandConstants.ExternalConstants.SMART_ACTION_BAND_SORT_APPLIED,
|
|
68
|
+
payload
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
return mergeEventHandlers([defaultEventHandlers, wrapped]);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function mergeEventHandlers(eventHandlersList) {
|
|
78
|
+
const mergedEventHandlers = {};
|
|
79
|
+
const allEventNames = new Set();
|
|
80
|
+
|
|
81
|
+
for (const handlers of eventHandlersList) {
|
|
82
|
+
Object.keys(handlers).forEach(eventName => allEventNames.add(eventName));
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
for (const eventName of allEventNames) {
|
|
86
|
+
mergedEventHandlers[eventName] = createMergedHandler(eventHandlersList, eventName);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return mergedEventHandlers;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function createMergedHandler(eventHandlersList, eventName) {
|
|
93
|
+
return function () {
|
|
94
|
+
for (const handlers of eventHandlersList) {
|
|
95
|
+
const handler = handlers[eventName];
|
|
96
|
+
|
|
97
|
+
if (typeof handler === 'function') {
|
|
98
|
+
try {
|
|
99
|
+
handler(...arguments);
|
|
100
|
+
} catch (error) {
|
|
101
|
+
__DEVELOPMENT__ && console.error(error);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import Properties from "../../../../cc/action-band/Properties";
|
|
2
|
+
import defaultDataSource from "../../../data-source";
|
|
3
|
+
import { createCustomComponent } from "../../../../library/custom-component";
|
|
4
|
+
import EventHandlersFactory from "./EventHandlersFactory";
|
|
5
|
+
import DataBrokerBehaviourFactory from "../../../zdata-source/frameworks/DataBrokerBehaviourFactory";
|
|
6
|
+
import ActionBandConnectedView from "./SmartActionBandView";
|
|
7
|
+
import SdkBehaviourFactory from "../../../sdk-behaviour/frameworks/SdkBehaviourFactory";
|
|
8
|
+
import ResourceNamesEnum from "../../../../bc/sdk/ResourceNamesEnum";
|
|
9
|
+
import ActionBandTranslator from "../adapters/presenters/ActionBandTranslator";
|
|
10
|
+
import ClientActionsBehaviourFactory from "../../../client-actions/behaviour/zclient-actions/frameworks/ClientActionsBehaviourFactory";
|
|
11
|
+
import ClientScriptsBehaviourFactory from "../../../client-scripts/behaviour/zclient-scripts-fetch/frameworks/ClientScriptsBehaviourFactory";
|
|
12
|
+
import AppContextBehaviourFactory from "../../../app-context-behaviour/frameworks/AppContextBehaviourFactory";
|
|
13
|
+
import ZHttpBehaviourFactory from "../../../zhttp/frameworks/ZHttpBehaviourFactory";
|
|
14
|
+
import ActionBandBehaviourFactory from "../../../../library/behaviours/action-band/frameworks/ActionBandBehaviourFactory";
|
|
15
|
+
import ZFieldBehaviourFactory from "../../../zfield/frameworks/ZFieldBehaviourFactory";
|
|
16
|
+
import SortByBehaviourFactory from "../../../../library/behaviours/sort-by/frameworks/ui/SortByBehaviourFactory";
|
|
17
|
+
|
|
18
|
+
function combineDataSourceWithDefault(dataSource) {
|
|
19
|
+
return { ...defaultDataSource,
|
|
20
|
+
...dataSource,
|
|
21
|
+
httpTemplates: { ...defaultDataSource.httpTemplates,
|
|
22
|
+
...dataSource?.httpTemplates
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export default class SmartActionBandFactory {
|
|
28
|
+
static create(_ref) {
|
|
29
|
+
let {
|
|
30
|
+
name,
|
|
31
|
+
dataSource,
|
|
32
|
+
eventHandlers = {},
|
|
33
|
+
View = ActionBandConnectedView
|
|
34
|
+
} = _ref;
|
|
35
|
+
|
|
36
|
+
const _dataSource = combineDataSourceWithDefault(dataSource);
|
|
37
|
+
|
|
38
|
+
return createCustomComponent({
|
|
39
|
+
name: name,
|
|
40
|
+
View: View,
|
|
41
|
+
properties: Properties,
|
|
42
|
+
eventHandlers: EventHandlersFactory.create(eventHandlers, name),
|
|
43
|
+
transformState: ActionBandTranslator.transformState,
|
|
44
|
+
behaviours: [SdkBehaviourFactory.create([ResourceNamesEnum.SMART_ACTION_BAND, ResourceNamesEnum.SMART_TABLE]), ZHttpBehaviourFactory.create(), DataBrokerBehaviourFactory.create(), AppContextBehaviourFactory.create(), ClientActionsBehaviourFactory.create({
|
|
45
|
+
getClientActions: _dataSource.httpTemplates.getClientActions
|
|
46
|
+
}), ClientScriptsBehaviourFactory.create({
|
|
47
|
+
getClientScripts: _dataSource.httpTemplates.getClientScripts
|
|
48
|
+
}), ZFieldBehaviourFactory.create({
|
|
49
|
+
availableFields: _dataSource.httpTemplates.getAvailableFields,
|
|
50
|
+
selectedFields: _dataSource.httpTemplates.getSelectedFields
|
|
51
|
+
}), ActionBandBehaviourFactory.create(), SortByBehaviourFactory.create()]
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// /* eslint-disable max-lines-per-function */
|
|
2
|
+
import { platformSDK_old } from "../../../sdk/frameworks/Sdk";
|
|
3
|
+
import ResourceNamesEnum from "../../../../bc/sdk/ResourceNamesEnum";
|
|
4
|
+
export default class ActionBandSdkFactory {
|
|
5
|
+
static getActionBandSdks(smartActionBand) {
|
|
6
|
+
return {
|
|
7
|
+
updateSortBy: sortBy => smartActionBand.updateSortBy(sortBy)
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
static create(_ref) {
|
|
12
|
+
let {
|
|
13
|
+
instanceName
|
|
14
|
+
} = _ref;
|
|
15
|
+
const smartActionBand = platformSDK_old[ResourceNamesEnum.SMART_ACTION_BAND](instanceName);
|
|
16
|
+
const actionBandSdks = ActionBandSdkFactory.getActionBandSdks(smartActionBand);
|
|
17
|
+
return {
|
|
18
|
+
actionBand: {
|
|
19
|
+
updateSortBy: actionBandSdks.updateSortBy
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
}
|