@zohodesk/library-platform 1.1.9 → 1.1.10-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/app-context/Constants.js +0 -0
- package/es/bc/app-context/Event.js +1 -0
- package/es/bc/app-context/EventHandlers.js +0 -0
- package/es/bc/app-context/Properties.js +68 -0
- package/es/bc/sdk/ResourceNamesEnum.js +1 -0
- package/es/bc/zdata-source/Constants.js +6 -11
- package/es/bc/zform/Constants.js +11 -1
- package/es/bc/zform/Properties.js +29 -27
- package/es/bc/zform/Symbol.js +2 -3
- package/es/bc/zlist/Properties.js +0 -45
- package/es/bc/zrecord/Constants.js +11 -19
- package/es/cc/action-icon/Constants.js +3 -5
- package/es/cc/action-location/Constants.js +5 -9
- package/es/cc/avatar/Constants.js +3 -5
- package/es/cc/breadcrumb/Constants.js +3 -5
- package/es/cc/button/Constants.js +3 -5
- package/es/cc/checkbox/Constants.js +5 -9
- package/es/cc/component/ErrorStructure.js +9 -0
- package/es/cc/date/Constants.js +5 -9
- package/es/cc/email/Constants.js +3 -5
- package/es/cc/error-state/ErrorTypes.js +11 -0
- package/es/cc/error-state/Properties.js +31 -0
- package/es/cc/error-state/index.js +2 -0
- package/es/cc/fields/currency/Model.js +2 -0
- package/es/cc/fields/currency/Properties.js +2 -1
- package/es/cc/fields/field/Constants.js +9 -13
- package/es/cc/fields/field/FormDefaultUIType.js +1 -1
- package/es/cc/fields/field/Properties.js +14 -8
- package/es/cc/fields/lookup/Properties.js +34 -1
- package/es/cc/form/Constants.js +6 -11
- package/es/cc/form/Properties.js +8 -0
- package/es/cc/form-connected/ExternalConstants.js +14 -0
- package/es/cc/form-connected/Properties.js +21 -13
- package/es/cc/form-connected/index.js +1 -1
- package/es/cc/highlighted-value/Constants.js +3 -5
- package/es/cc/icon-button/Constants.js +3 -5
- package/es/cc/link/Constants.js +3 -5
- package/es/cc/list-item/Constants.js +3 -5
- package/es/cc/more-dropdown/Constants.js +3 -5
- package/es/cc/multi-select/Constants.js +5 -9
- package/es/cc/section/Constants.js +5 -9
- package/es/cc/select/Constants.js +6 -11
- package/es/cc/switch/Constants.js +3 -5
- package/es/cc/switch/Properties.js +2 -2
- package/es/cc/table-column-filter/Constants.js +5 -9
- package/es/cc/table-connected/Events.js +1 -1
- package/es/cc/table-connected/Properties.js +6 -0
- package/es/cc/table-connected/SdkContract.js +14 -0
- package/es/cc/table-connected/constants/Events.js +3 -9
- package/es/cc/table-connected/constants/ExternalConstants.js +9 -0
- package/es/cc/table-connected/constants/index.js +2 -1
- package/es/cc/table-list/Constants.js +14 -27
- package/es/cc/table-list/model/index.js +5 -9
- package/es/cc/table-list/row/Constants.js +5 -9
- package/es/cc/table-list/row/Properties.js +8 -0
- package/es/cc/tags/Constants.js +3 -5
- package/es/cc/tags/model/index.js +4 -7
- package/es/cc/text/Constants.js +3 -5
- package/es/cc/textarea/Constants.js +5 -9
- package/es/cc/textarea/Properties.js +11 -0
- package/es/cc/textbox/Constants.js +6 -11
- package/es/index.js +26 -5
- package/es/library/analytics/Analytics.js +36 -0
- package/es/library/analytics/AnalyticsContract.js +13 -0
- package/es/library/analytics/index.js +2 -0
- package/es/library/behaviours/field-focus/frameworks/ui/EventHandlersFactory.js +1 -3
- package/es/library/behaviours/keyboard-controls/adapters/gateways/KeyboardHandler.js +0 -4
- package/es/library/behaviours/keyboard-controls/adapters/gateways/Repository.js +2 -10
- package/es/library/behaviours/keyboard-controls/adapters/gateways/Service.js +0 -14
- package/es/library/behaviours/keyboard-controls/adapters/presenters/Presenter.js +2 -11
- package/es/library/behaviours/list-selection/adapters/gateways/Repository.js +2 -8
- package/es/library/behaviours/list-selection/adapters/gateways/Service.js +0 -16
- package/es/library/behaviours/list-selection/adapters/presenters/Presenter.js +0 -8
- package/es/library/behaviours/local-storage/adapters/gateways/LocalStorageRepository.js +0 -6
- package/es/library/behaviours/local-storage/adapters/gateways/Service.js +0 -4
- package/es/library/behaviours/local-storage/adapters/presenters/Presenter.js +0 -8
- package/es/library/behaviours/local-storage/domain/entities/Storage.js +0 -4
- package/es/library/behaviours/sort-by/adapters/gateway/Repository.js +0 -6
- package/es/library/behaviours/sort-by/adapters/gateway/Service.js +0 -4
- package/es/library/behaviours/sort-by/adapters/presenter/Presenter.js +0 -8
- package/es/library/behaviours/table-column-resizer/adapters/gateways/Repository.js +0 -6
- package/es/library/behaviours/table-column-resizer/adapters/gateways/Service.js +0 -10
- package/es/library/behaviours/table-column-resizer/adapters/gateways/TableElementService.js +0 -8
- package/es/library/behaviours/table-column-resizer/adapters/presenters/AutoScroll.js +0 -12
- package/es/library/behaviours/table-column-resizer/adapters/presenters/Presenter.js +0 -8
- package/es/library/behaviours/table-column-resizer/domain/entities/ColumnResizer.js +0 -12
- package/es/library/behaviours/table-column-resizer/domain/entities/Mouse.js +0 -6
- package/es/library/behaviours/table-column-resizer/domain/entities/ResizeColumnCalculator.js +0 -12
- package/es/library/behaviours/table-column-resizer/domain/entities/ResizerAutoScrollCalculator.js +0 -6
- package/es/library/behaviours/table-column-resizer/domain/entities/ResizingColumn.js +0 -13
- package/es/library/behaviours/table-column-resizer/domain/entities/Table.js +0 -11
- package/es/library/behaviours/text-to-field-click/adapters/gateway/Repository.js +0 -6
- package/es/library/custom-component/adapters/controllers/Controller.js +9 -0
- package/es/library/custom-component/adapters/gateways/event-manager/EventManager.js +6 -7
- package/es/library/custom-component/adapters/gateways/repository/Repository.js +1 -5
- package/es/library/custom-component/adapters/gateways/service/Service.js +2 -14
- package/es/library/custom-component/adapters/presenters/Presenter.js +0 -5
- package/es/library/custom-component/applications/entities-factory/ComponentFactory.js +12 -9
- package/es/library/custom-component/applications/usecases/DispatchUseCase.js +28 -5
- package/es/library/custom-component/applications/usecases/InitializeUseCase.js +5 -4
- package/es/library/custom-component/applications/usecases/MountUseCase.js +10 -6
- package/es/library/custom-component/applications/usecases/SetRefUseCase.js +31 -0
- package/es/library/custom-component/applications/usecases/UnmountUseCase.js +6 -5
- package/es/library/custom-component/applications/usecases/UpdatePropertyUseCase.js +23 -18
- package/es/library/custom-component/applications/usecases/UpdateStateUseCase.js +4 -3
- package/es/library/custom-component/domain/entities/Behaviour.js +4 -11
- package/es/library/custom-component/domain/entities/Component.js +81 -99
- package/es/library/custom-component/domain/entities/ComponentProperties.js +120 -0
- package/es/library/custom-component/domain/entities/Event.js +0 -7
- package/es/library/custom-component/domain/entities/EventHandler.js +0 -6
- package/es/library/custom-component/domain/entities/LifeCycleAction.js +0 -10
- package/es/library/custom-component/domain/entities/Logger.js +93 -0
- package/es/library/custom-component/domain/entities/Payload.js +0 -6
- package/es/library/custom-component/domain/entities/Properties.js +10 -142
- package/es/library/custom-component/domain/entities/Property.js +29 -13
- package/es/library/custom-component/domain/entities/Schema.js +1 -5
- package/es/library/custom-component/domain/entities/State.js +0 -4
- package/es/library/custom-component/domain/entities/Style.js +0 -14
- package/es/library/custom-component/domain/entities/interfaces/IComponentProperties.js +0 -0
- package/es/library/custom-component/frameworks/json-schema-validator/Validator.js +129 -31
- package/es/library/custom-component/frameworks/ui/ComponentRegistry.js +3 -7
- package/es/library/custom-component/frameworks/ui/CreateCustomComponent.js +30 -34
- package/es/library/custom-component/frameworks/ui/CreateSlotComponent.js +4 -2
- package/es/library/custom-component/frameworks/ui/CustomComponentFactory.js +1 -1
- package/es/library/custom-component/frameworks/ui/DependencyFactory.js +1 -2
- package/es/library/dot/components/action-location/adapters/gateway/Repository.js +0 -8
- package/es/library/dot/components/action-location/adapters/presenters/Presenter.js +0 -8
- package/es/library/dot/components/action-location/entities/ActionLocationEntity.js +2 -6
- package/es/library/dot/components/action-location/frameworks/ui/ActionComponentMapping.js +2 -1
- package/es/library/dot/components/actions-renderer/frameworks/ui/ActionsRendererView.js +6 -4
- package/es/library/dot/components/form/adapters/presenter/TransformState.js +3 -1
- package/es/library/dot/components/form/frameworks/ui/DefaultComponentRegister.js +12 -3
- package/es/library/dot/components/form/frameworks/ui/Form.js +2 -0
- package/es/library/dot/components/form/frameworks/ui/FormFallbackView.js +23 -0
- package/es/library/dot/components/form/frameworks/ui/FormView.js +9 -3
- package/es/library/dot/components/form/frameworks/ui/__test__/Form.test.js +14 -20
- package/es/library/dot/components/form/frameworks/ui/css/Form.module.css +13 -16
- package/es/library/dot/components/form/frameworks/ui/sub-components/Footer.js +7 -4
- package/es/library/dot/components/form/frameworks/ui/sub-components/Header.js +7 -4
- package/es/library/dot/components/form/frameworks/ui/sub-components/SectionsWithRightPanelLayout.js +1 -2
- package/es/library/dot/components/form-fields/checkbox/frameworks/ui/CheckboxView.js +1 -3
- package/es/library/dot/components/form-fields/currency/frameworks/ui/Currency.js +3 -3
- package/es/library/dot/components/form-fields/currency/frameworks/ui/CurrencyView.js +15 -3
- package/es/library/dot/components/form-fields/currency/frameworks/ui/EventHandlerFactory.js +8 -0
- package/es/library/dot/components/form-fields/field/__test__/common.js +18 -16
- package/es/library/dot/components/form-fields/field/css/FieldItem.module.css +2 -2
- package/es/library/dot/components/form-fields/index.js +2 -1
- package/es/library/dot/components/form-fields/lookup/frameworks/ui/EventHandlerFactory.js +70 -0
- package/es/library/dot/components/form-fields/lookup/frameworks/ui/Lookup.js +13 -0
- package/es/library/dot/components/form-fields/lookup/frameworks/ui/LookupView.js +51 -0
- package/es/library/dot/components/form-fields/textarea/frameworks/ui/TextAreaView.js +4 -2
- package/es/library/dot/components/section/frameworks/ui/RenderField.js +5 -4
- package/es/library/dot/components/section/frameworks/ui/SectionView.js +12 -3
- package/es/library/dot/components/section/frameworks/ui/css/Section.module.css +3 -0
- package/es/library/dot/components/table-list/adapters/controllers/KeyboardRowClickController.js +2 -2
- package/es/library/dot/components/table-list/adapters/controllers/KeyboardRowSelectController.js +1 -1
- package/es/library/dot/components/table-list/adapters/presenters/TableTranslator.js +1 -1
- package/es/library/dot/components/table-list/frameworks/ui/TableListView.js +14 -7
- package/es/library/dot/components/table-list/frameworks/ui/css/TableList.module.css +16 -15
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/ErrorState.js +4 -7
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/Header.js +9 -6
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/Rows.js +11 -9
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/field/FieldComponent.js +1 -2
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/HeaderData.js +7 -5
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/Headers.js +4 -2
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/MassAction.js +6 -4
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/Columns.js +4 -2
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/Row.js +14 -7
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/RowActions.js +5 -4
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/RowData.js +6 -4
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/RowSelection.js +32 -7
- package/es/library/dot/legacy-to-new-arch/breadcrumb/frameworks/ui/css/Breadcrumb.module.css +4 -4
- package/es/library/dot/legacy-to-new-arch/breadcrumb/frameworks/ui/sub-components/BreadcrumbItem.js +1 -1
- package/es/library/dot/legacy-to-new-arch/button/frameworks/ui/ButtonView.js +3 -3
- package/es/library/dot/legacy-to-new-arch/date/frameworks/ui/DateView.js +10 -5
- package/es/library/dot/legacy-to-new-arch/date/frameworks/ui/css/DateView.module.css +3 -0
- package/es/library/dot/legacy-to-new-arch/error-state/frameworks/ui/ErrorState.js +10 -0
- package/es/library/dot/legacy-to-new-arch/error-state/frameworks/ui/ErrorStateView.js +68 -0
- package/es/library/dot/legacy-to-new-arch/label/frameworks/ui/LabelView.js +6 -8
- package/es/library/dot/legacy-to-new-arch/label/frameworks/ui/css/Label.module.css +5 -7
- package/es/library/dot/legacy-to-new-arch/multi-select/frameworks/ui/MultiSelectView.js +14 -4
- package/es/library/dot/legacy-to-new-arch/multi-select/frameworks/ui/css/MultiSelectView.module.css +37 -0
- package/es/library/dot/legacy-to-new-arch/select/frameworks/ui/SelectView.js +2 -2
- package/es/library/dot/legacy-to-new-arch/switch/frameworks/ui/SwitchView.js +5 -5
- package/es/library/dot/legacy-to-new-arch/table-column-filter/frameworks/ui/TableColumnFilterView.js +5 -3
- package/es/library/dot/legacy-to-new-arch/table-field-components/currency-field/frameworks/ui/CurrencyFieldView.js +10 -2
- package/es/library/dot/legacy-to-new-arch/table-field-components/index.js +1 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/switch-field/frameworks/ui/SwitchFieldView.js +0 -1
- package/es/library/dot/legacy-to-new-arch/text/frameworks/ui/TextView.js +1 -1
- package/es/library/dot/legacy-to-new-arch/text-area/frameworks/ui/TextAreaView.js +22 -4
- package/es/library/dot/legacy-to-new-arch/text-area/frameworks/ui/css/TextAreaView.module.css +40 -0
- package/es/library/dot/legacy-to-new-arch/textbox/frameworks/ui/TextBoxView.js +2 -2
- package/es/library/slot/frameworks/ui/ConvertSlotToComponent.js +5 -4
- package/es/library/translator-common/adapters/presenter/formatCurrency.js +42 -0
- package/es/library/translator-common/index.js +2 -1
- package/es/platform/app-context-behaviour/frameworks/AppContextBehaviourFactory.js +31 -0
- package/es/platform/client-actions/behaviour/zclient-actions/adapters/controllers/MountController.js +15 -18
- package/es/platform/client-actions/behaviour/zclient-actions/adapters/gateways/Repository.js +0 -6
- package/es/platform/client-actions/behaviour/zclient-actions/adapters/gateways/Service.js +0 -16
- package/es/platform/client-actions/behaviour/zclient-actions/adapters/presenters/Presenter.js +0 -8
- package/es/platform/client-actions/behaviour/zclient-actions/adapters/resources/ClientActionResource.js +2 -4
- package/es/platform/client-actions/behaviour/zclient-actions/applications/usecases/GetClientActionLocationUseCase.js +1 -1
- package/es/platform/client-actions/behaviour/zclient-actions/applications/usecases/GetClientActionUIComponentPropertiesUseCase.js +1 -1
- package/es/platform/client-actions/behaviour/zclient-actions/applications/usecases/GetClientActionsUseCase.js +1 -1
- package/es/platform/client-actions/behaviour/zclient-actions/applications/usecases/SetClientActionsUseCase.js +6 -1
- package/es/platform/client-actions/behaviour/zclient-actions/applications/usecases/UpdateClientActionUIComponentPropertiesUseCase.js +1 -1
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/ClientAction.js +0 -26
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/ClientActionManager.js +58 -19
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/ClientActions.js +8 -17
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/EventMapping.js +0 -12
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/EventMappings.js +0 -4
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/UIComponentMapping.js +0 -14
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/interfaces/ClientActionResponse.js +1 -0
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/interfaces/IClientActionFetchResponse.js +0 -0
- package/es/platform/client-actions/behaviour/zclient-actions/frameworks/sdk/ClientActionsSDKFactory.js +2 -2
- package/es/platform/client-actions/cc/action-event-mediator/Properties.js +75 -3
- package/es/platform/client-actions/components/action-event-mediator/adapters/controllers/MountController.js +1 -1
- package/es/platform/client-actions/components/action-event-mediator/adapters/controllers/PropertiesChangeController.js +2 -2
- package/es/platform/client-actions/components/action-event-mediator/adapters/gateway/Repository.js +2 -10
- package/es/platform/client-actions/components/action-event-mediator/adapters/presenters/Presenter.js +0 -8
- package/es/platform/client-actions/components/action-event-mediator/applications/usecases/InitializeUseCase.js +15 -1
- package/es/platform/client-actions/components/action-event-mediator/applications/usecases/PropertiesChangeUseCase.js +3 -3
- package/es/platform/client-actions/components/action-event-mediator/domain/entities/ActionEventMediatorEntity.js +43 -34
- package/es/platform/client-actions/components/action-event-mediator/frameworks/ui/ActionEventMediator.js +3 -1
- package/es/platform/client-actions/components/action-event-mediator/frameworks/ui/ActionEventMediatorView.js +31 -14
- package/es/platform/client-actions/components/action-event-mediator/frameworks/ui/ClientActionsAdapter.js +2 -48
- package/es/platform/client-actions/components/action-event-mediator/frameworks/ui/EventHandlersFactory.js +3 -11
- package/es/platform/client-actions/components/interfaces/ActionViewModel.js +1 -0
- package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/AdaptiveRowActions/AdaptiveRowActionsRenderer.js +12 -0
- package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/AdaptiveRowActions/AdaptiveRowActionsRendererView.js +42 -0
- package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/MoreActions/MoreActionsRenderer.js +10 -0
- package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/MoreActions/MoreActionsRendererView.js +79 -0
- package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/{RowActionsRenderer.js → RowActions/RowActionsRenderer.js} +3 -3
- package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActions/RowActionsRenderer.module.css +19 -0
- package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActions/RowActionsRendererView.js +37 -0
- package/es/platform/client-actions/translators/client-actions-translator/index.js +14 -2
- package/es/platform/client-actions/translators/condition-resolver/index.js +6 -1
- package/es/platform/client-scripts/bc/zclient-scripts-execution/Constants.js +11 -0
- package/es/platform/client-scripts/bc/zclient-scripts-execution/EventHandlers.js +1 -0
- package/es/platform/client-scripts/bc/zclient-scripts-fetch/Constants.js +11 -0
- package/es/platform/client-scripts/bc/zclient-scripts-fetch/EventHandlers.js +1 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-execution/adapters/controllers/AbstractController.js +8 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-execution/adapters/controllers/ClientScriptExecutionController.js +10 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-execution/adapters/controllers/SetClientScriptsMappingController.js +10 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-execution/adapters/gateways/Repository.js +24 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-execution/adapters/gateways/Service.js +9 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-execution/adapters/presenters/Presenter.js +21 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-execution/applications/interfaces/InputDependencies.js +1 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-execution/applications/interfaces/gateways/IRepository.js +1 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-execution/applications/interfaces/gateways/IService.js +0 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-execution/applications/interfaces/output/IPresenter.js +1 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-execution/applications/usecases/AbstractUseCase.js +15 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-execution/applications/usecases/ExecuteClientScriptsUseCase.js +23 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-execution/applications/usecases/SetClientScriptsMappingUseCase.js +16 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-execution/domain/entities/ClientScriptExecutor.js +142 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-execution/domain/entities/State.js +1 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-execution/domain/entities/types/ClientScriptExectionTypeDefintions.js +7 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-execution/frameworks/ClientScriptsExecutionBehaviourFactory.js +12 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-execution/frameworks/ClientScriptsExecutionHandlersFactory.js +30 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-execution/frameworks/ClientScriptsUtils.js +25 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/adapters/controllers/AbstractController.js +8 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/adapters/controllers/FetchClientScriptsController.js +27 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/adapters/controllers/FetchClientScriptsFailureController.js +28 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/adapters/controllers/FetchClientScriptsNoContentController.js +23 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/adapters/controllers/FetchClientScriptsStopController.js +21 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/adapters/controllers/FetchClientScriptsSuccessController.js +28 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/adapters/controllers/MountController.js +22 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/adapters/controllers/SetClientScriptsController.js +24 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/adapters/gateways/Repository.js +22 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/adapters/gateways/Service.js +19 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/adapters/presenters/Presenter.js +16 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/applications/entities-factory/ClientScriptsFactory.js +11 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/applications/entities-factory/ClientScriptsManagerFactory.js +10 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/applications/interfaces/InputDependencies.js +1 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/applications/interfaces/gateways/IRepository.js +1 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/applications/interfaces/gateways/IService.js +0 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/applications/interfaces/output/IPresenter.js +1 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/applications/usecases/AbstractUseCase.js +17 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/applications/usecases/FetchClientScriptUseCase.js +33 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/applications/usecases/FetchClientScriptsFailureUseCase.js +22 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/applications/usecases/FetchClientScriptsNoContentUseCase.js +27 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/applications/usecases/FetchClientScriptsStopUseCase.js +25 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/applications/usecases/FetchClientScriptsSuccessUseCase.js +22 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/applications/usecases/InitializeUseCase.js +17 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/applications/usecases/SetClientScriptsUseCase.js +21 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/domain/entities/ClientScript.js +24 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/domain/entities/ClientScripts.js +41 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/domain/entities/GetClientScriptsStrategy.js +44 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/domain/entities/State.js +1 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/domain/entities/interfaces/ClientScriptEventMappingState.js +1 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/domain/entities/interfaces/ClientScriptModel.js +1 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/domain/entities/interfaces/ClientScriptsModel.js +1 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/domain/entities/interfaces/IClientScript.js +0 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/domain/entities/interfaces/IClientScripts.js +0 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/domain/entities/interfaces/IEvent.js +1 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/frameworks/ClientScriptsBehaviourFactory.js +12 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/frameworks/ClientScriptsHandlersFactory.js +47 -0
- package/es/platform/client-scripts/cc/zclient-scripts-execution/clientScriptsSchema.js +15 -0
- package/es/platform/column-chooser/adapters/gateways/Repository.js +0 -6
- package/es/platform/column-chooser/adapters/gateways/Service.js +0 -14
- package/es/platform/column-chooser/adapters/presenters/Presenter.js +0 -8
- package/es/platform/column-chooser/domain/entities/SelectEntityImp.js +0 -5
- package/es/platform/components/app/adapters/resources/AppResource.js +25 -0
- package/es/platform/components/form-connected/adapters/resources/SmartFormResources.js +20 -4
- package/es/platform/components/form-connected/frameworks/EventHandlersFactory.js +5 -4
- package/es/platform/components/form-connected/frameworks/FormConnectedFactory.js +8 -2
- package/es/platform/components/form-connected/frameworks/FormConnectedView.js +4 -2
- package/es/platform/components/form-connected/frameworks/FormSdkFactory.js +6 -4
- package/es/platform/components/table-connected/adapters/controllers/ColumnChooserUpdateController.js +7 -1
- package/es/platform/components/table-connected/adapters/controllers/ResizeFinishController.js +3 -5
- package/es/platform/components/table-connected/adapters/resources/SmartTableResource.js +52 -4
- package/es/platform/components/table-connected/frameworks/EventHandlersFactory.js +222 -8
- package/es/platform/components/table-connected/frameworks/ListSdkFactory.js +6 -4
- package/es/platform/components/table-connected/frameworks/TableConnectedFactory.js +7 -3
- package/es/platform/data-source/http-template/fetchLookupFields.js +24 -0
- package/es/platform/data-source/http-template/getClientScripts.js +23 -0
- package/es/platform/data-source/http-template/{fetchDependencyMappings.js → getDependencyMappings.js} +3 -3
- package/es/platform/data-source/http-template/{fetchLayoutRules.js → getLayoutRules.js} +3 -3
- package/es/platform/data-source/http-template/{fetchMyForm.js → getMyForm.js} +3 -3
- package/es/platform/data-source/http-template/{fetchMyFormLayout.js → getMyLayout.js} +3 -3
- package/es/platform/data-source/http-template/{fetchValidationRules.js → getValidationRules.js} +3 -3
- package/es/platform/data-source/http-template/updateSelectedFields.js +1 -1
- package/es/platform/data-source/index.js +15 -10
- package/es/platform/data-source/utils/validation-rules/TransFormValidationRules.js +7 -1
- package/es/platform/sdk/adapters/gateways/Repository.js +5 -9
- package/es/platform/sdk/adapters/gateways/Service.js +2 -12
- package/es/platform/sdk/adapters/presenters/Presenter.js +0 -6
- package/es/platform/sdk/application/interfaces/gateways/AbstractResource.js +0 -6
- package/es/platform/sdk/application/usecases/GetResourcesUseCase.js +12 -0
- package/es/platform/sdk/domain/entities/ResourceManager.js +24 -20
- package/es/platform/sdk/frameworks/Sdk.js +23 -2
- package/es/platform/sdk/frameworks/SdkRegistry.js +11 -8
- package/es/platform/sdk-behaviour/adapters/controllers/AbstractController.js +0 -4
- package/es/platform/sdk-behaviour/adapters/gateways/Repository.js +0 -8
- package/es/platform/sdk-behaviour/adapters/gateways/ResourceManagerGateWay.js +0 -6
- package/es/platform/sdk-behaviour/adapters/gateways/Service.js +0 -8
- package/es/platform/zdata-source/adapters/controllers/FailureController.js +26 -29
- package/es/platform/zdata-source/adapters/controllers/NoContentController.js +21 -24
- package/es/platform/zdata-source/adapters/controllers/RegisterController.js +17 -20
- package/es/platform/zdata-source/adapters/controllers/SuccessController.js +26 -29
- package/es/platform/zdata-source/adapters/gateways/Repository.js +0 -6
- package/es/platform/zdata-source/adapters/gateways/Service.js +0 -12
- package/es/platform/zdata-source/adapters/presenters/Presenter.js +1 -9
- package/es/platform/zdata-source/domain/entities/APITemplate.js +3 -17
- package/es/platform/zfield/adapters/gateways/Repository.js +0 -6
- package/es/platform/zfield/adapters/gateways/Service.js +0 -14
- package/es/platform/zfield/adapters/presenters/Presenter.js +0 -8
- package/es/platform/zfield/applications/entities-factory/FieldBuilder.js +0 -30
- package/es/platform/zfield/applications/entities-factory/FieldsManagerBuilder.js +0 -12
- package/es/platform/zfield/domain/entities/fields-manager/FieldsManager.js +6 -1
- package/es/platform/zform/adapters/controllers/ApiFailureController.js +31 -0
- package/es/platform/zform/adapters/controllers/CreateRecordFailedController.js +21 -0
- package/es/platform/zform/adapters/controllers/CreateRecordSuccessController.js +21 -0
- package/es/platform/zform/adapters/controllers/IntializeController.js +4 -2
- package/es/platform/zform/adapters/controllers/LookupFieldController.js +23 -0
- package/es/platform/zform/adapters/controllers/MyLayoutSuccessController.js +4 -2
- package/es/platform/zform/adapters/controllers/SubmitValidationCompletedController.js +5 -1
- package/es/platform/zform/adapters/gateway/FormRepository.js +6 -8
- package/es/platform/zform/adapters/gateway/Service.js +8 -36
- package/es/platform/zform/adapters/presenter/FormPresenter.js +0 -8
- package/es/platform/zform/adapters/presenter/FormTranslator.js +33 -22
- package/es/platform/zform/adapters/presenter/translators/SectionTranslator.js +53 -37
- package/es/platform/zform/adapters/presenter/translators/fields/CurrencyFieldTranslator.js +9 -1
- package/es/platform/zform/adapters/presenter/translators/fields/LookUpFieldTranslator.js +2 -1
- package/es/platform/zform/adapters/presenter/utils/DefaultClientActions.js +83 -73
- package/es/platform/zform/adapters/presenter/utils/sanitizeHtmlString.js +11 -0
- package/es/platform/zform/applications/interfaces/input/ApiFailureInputModel.js +1 -0
- package/es/platform/zform/applications/interfaces/input/CreateRecordFailedUseCaseInputModel.js +1 -0
- package/es/platform/zform/applications/interfaces/input/CreateRecordSuccessUseCaseInputModel.js +1 -0
- package/es/platform/zform/applications/interfaces/input/GetIsFieldValueChangedUseCaseInput.js +1 -0
- package/es/platform/zform/applications/interfaces/input/LookUpFieldSuccessUseCaseInputModel.js +1 -0
- package/es/platform/zform/applications/usecases/ApiFailureUseCase.js +30 -0
- package/es/platform/zform/applications/usecases/CreateRecordFailedUseCase.js +25 -0
- package/es/platform/zform/applications/usecases/CreateRecordSuccessUseCase.js +25 -0
- package/es/platform/zform/applications/usecases/FormSubmitUseCase.js +4 -1
- package/es/platform/zform/applications/usecases/GetFieldValueUseCase.js +1 -1
- package/es/platform/zform/applications/usecases/GetIsFieldValueChanged.js +35 -0
- package/es/platform/zform/applications/usecases/InitializeUseCase.js +54 -26
- package/es/platform/zform/applications/usecases/LookupFieldSuccessUseCase.js +33 -0
- package/es/platform/zform/applications/usecases/MyFormSuccessUseCase.js +41 -7
- package/es/platform/zform/applications/usecases/MyLayoutSuccessUseCase.js +61 -37
- package/es/platform/zform/applications/usecases/SubmitValidationCompletedUseCase.js +14 -8
- package/es/platform/zform/domain/ZDependencyMapping.js +0 -17
- package/es/platform/zform/domain/ZField.js +16 -59
- package/es/platform/zform/domain/ZForm.js +74 -42
- package/es/platform/zform/domain/ZLayout.js +0 -14
- package/es/platform/zform/domain/ZLayoutRule.js +0 -31
- package/es/platform/zform/domain/ZSection.js +0 -19
- package/es/platform/zform/domain/ZValidationRule.js +0 -28
- package/es/platform/zform/frameworks/ui/EventHandlerFactory.js +26 -28
- package/es/platform/zform/frameworks/ui/ZFormBehaviourFactory.js +1 -0
- package/es/platform/zform/frameworks/validation-rules/Validator.js +4 -8
- package/es/platform/zhttp/adapters/controllers/FetchController.js +5 -1
- package/es/platform/zlist/adapters/gateways/Repository.js +4 -8
- package/es/platform/zlist/adapters/gateways/Service.js +0 -33
- package/es/platform/zlist/adapters/presenters/Presenters.js +0 -8
- package/es/platform/zlist/adapters/presenters/SelectionTranslator.js +7 -6
- package/es/platform/zlist/adapters/presenters/TableTranslator.js +19 -12
- package/es/platform/zlist/adapters/presenters/translators/ColumnTranslator.js +33 -26
- package/es/platform/zlist/adapters/presenters/translators/Header.js +5 -6
- package/es/platform/zlist/adapters/presenters/translators/HeadersTranslator.js +4 -2
- package/es/platform/zlist/adapters/presenters/translators/Row.js +6 -3
- package/es/platform/zlist/adapters/presenters/translators/RowsTranslator.js +8 -2
- package/es/platform/zlist/adapters/presenters/translators/actions/ActionsTranslator.js +4 -15
- package/es/platform/zlist/adapters/presenters/translators/fields/CurrencyFieldTranslator.js +7 -2
- package/es/platform/zlist/adapters/presenters/translators/fields/FormulaFieldTranslator.js +7 -2
- package/es/platform/zlist/adapters/presenters/utils/DefaultClientActions.js +1 -1
- package/es/platform/zlist/adapters/presenters/utils/calculateFieldWidths.js +1 -3
- package/es/platform/zlist/applications/usecases/DeleteMultipleRecordUseCase.js +1 -3
- package/es/platform/zlist/applications/usecases/DeleteSingleRecordUseCase.js +1 -3
- package/es/platform/zlist/applications/usecases/GetContextUseCase.js +1 -1
- package/es/platform/zlist/applications/usecases/RecordSuccessCallbackUsecase.js +1 -3
- package/es/platform/zlist/applications/usecases/RecordUpdateUseCase.js +1 -3
- package/es/platform/zlist/applications/usecases/UpdateMultipleRecordUseCase.js +1 -3
- package/es/platform/zlist/domain/entities/List.js +20 -5
- package/es/platform/zrecord/adapters/controllers/AppendRecordsController.js +20 -23
- package/es/platform/zrecord/adapters/controllers/DeleteMultipleRecordLocalController.js +20 -23
- package/es/platform/zrecord/adapters/controllers/FailureController.js +26 -29
- package/es/platform/zrecord/adapters/controllers/FetchStateStopController.js +17 -20
- package/es/platform/zrecord/adapters/controllers/MountController.js +15 -18
- package/es/platform/zrecord/adapters/controllers/NoContentController.js +21 -24
- package/es/platform/zrecord/adapters/controllers/RefetchController.js +26 -29
- package/es/platform/zrecord/adapters/controllers/SetRecordsController.js +24 -27
- package/es/platform/zrecord/adapters/controllers/SuccessController.js +26 -29
- package/es/platform/zrecord/adapters/gateways/Repository.js +0 -6
- package/es/platform/zrecord/adapters/gateways/Service.js +0 -30
- package/es/platform/zrecord/adapters/presenters/Presenter.js +0 -8
- package/es/platform/zrecord/applications/usecases/GetMultipleRecordUseCase.js +1 -1
- package/es/platform/zrecord/applications/usecases/GetSingleRecordUseCase.js +1 -1
- package/es/platform/zrecord/domain/entities/CustomFieldValues.js +0 -4
- package/es/platform/zrecord/domain/entities/Record.js +0 -22
- package/es/platform/zrecord/domain/entities/Records.js +0 -11
- package/package.json +28 -29
- package/es/cc/form-connected/Constants.js +0 -21
- package/es/library/dot/legacy-to-new-arch/label/frameworks/ui/sub-components/ui/LabelAction.js +0 -9
- package/es/library/dot/legacy-to-new-arch/label/frameworks/ui/sub-components/ui/LabelActionView.js +0 -38
- package/es/library/dot/legacy-to-new-arch/label/frameworks/ui/sub-components/ui/css/LabelAction.module.css +0 -4
- package/es/platform/client-actions/cc/dynamic-action-component/Properties.js +0 -51
- package/es/platform/client-actions/components/dynamic-component/frameworks/ui/DynamicActionComponent.js +0 -9
- package/es/platform/client-actions/components/dynamic-component/frameworks/ui/DynamicActionComponentView.js +0 -36
- package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActionsRenderer.module.css +0 -15
- package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActionsRendererView.js +0 -33
- package/es/platform/zlist/adapters/presenters/translators/ColumnAlignmentTranslator.js +0 -11
- /package/es/{platform/client-actions/components/dynamic-component/domain/entities/interfaces/IState.js → library/custom-component/applications/interfaces/input/SetRefInputModel.js} +0 -0
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { ZFORM_SUBMIT } from "../../../../bc/zform/Constants";
|
|
2
2
|
import FormSubmitController from "../../adapters/controllers/FormSubmitController";
|
|
3
|
+
import CreateRecordSuccessController from "../../adapters/controllers/CreateRecordSuccessController";
|
|
4
|
+
import CreateRecordFailedController from "../../adapters/controllers/CreateRecordFailedController";
|
|
3
5
|
import FormRepository from "../../adapters/gateway/FormRepository";
|
|
4
6
|
import FormPresenter from "../../adapters/presenter/FormPresenter";
|
|
5
7
|
import Service from "../../adapters/gateway/Service";
|
|
6
8
|
import LifeCycleEvents from "../../../../cc/component/LifeCycleEventsEnum";
|
|
7
9
|
import InitializeController from "../../adapters/controllers/IntializeController";
|
|
8
|
-
import { ZFORM_DEPENDENCY_MAPPINGS_REQUEST, ZFORM_DEPENDENCY_MAPPINGS_SUCCESS, ZFORM_FIELD_VALUE_CHANGE_REQUEST, ZFORM_MY_FORM_REQUEST, ZFORM_MY_FORM_SUCCESS, ZFORM_MY_LAYOUTS_SUCCESS, ZFORM_SET_FIELD_ERROR_MESSAGE,
|
|
10
|
+
import { ZFORM_DEPENDENCY_MAPPINGS_REQUEST, ZFORM_DEPENDENCY_MAPPINGS_SUCCESS, ZFORM_FIELD_VALUE_CHANGE_REQUEST, ZFORM_MY_FORM_REQUEST, ZFORM_MY_FORM_SUCCESS, ZFORM_MY_LAYOUTS_SUCCESS, ZFORM_SET_FIELD_ERROR_MESSAGE, ZFORM_SUBMIT_VALIDATION_COMPLETED, ZFORM_API_FAILURE, ZFORM_VALIDATE_FIELD_REQUEST, ZFORM_VALIDATION_RULES_REQUEST, ZFORM_VALIDATION_RULES_SUCCESS, ZFORM_VALIDATION_RULES_EXECUTION_RESULT, ZFORM_LOOKUP_FIELD_SUCCESS } from "../../../../bc/zform/Symbol";
|
|
11
|
+
import LookupFieldController from "../../adapters/controllers/LookupFieldController";
|
|
9
12
|
import MyLayoutSuccessController from "../../adapters/controllers/MyLayoutSuccessController";
|
|
10
13
|
import MyFormSuccessController from "../../adapters/controllers/MyFromSuccessController";
|
|
11
14
|
import DependenciesController from "../../adapters/controllers/DependenciesController";
|
|
@@ -23,10 +26,11 @@ import FormValidator from "../validation-rules/Validator";
|
|
|
23
26
|
import SetFieldErrorMessageController from "../../adapters/controllers/SetFieldErrorMessageController";
|
|
24
27
|
import LayoutRuleApplier from "../layout-rules/LayoutRuleApplier";
|
|
25
28
|
import { RECORD_EXECUTE_FAIL_CALLBACK, RECORD_EXECUTE_SUCCESS_CALLBACK } from "../../../../bc/zrecord/Constants";
|
|
26
|
-
import SmartFormConstants from "../../../../cc/form-connected/
|
|
29
|
+
import SmartFormConstants from "../../../../cc/form-connected/ExternalConstants";
|
|
27
30
|
import FieldBlurController from "../../adapters/controllers/FieldBlurController";
|
|
28
31
|
import SubmitValidationCompletedController from "../../adapters/controllers/SubmitValidationCompletedController";
|
|
29
32
|
import ValidationRulesExecutionResultController from "../../adapters/controllers/ValidationRulesExecutionResultController";
|
|
33
|
+
import ApiFailureController from "../../adapters/controllers/ApiFailureController";
|
|
30
34
|
|
|
31
35
|
class EventHandlersFactory {
|
|
32
36
|
static create() {
|
|
@@ -40,6 +44,8 @@ class EventHandlersFactory {
|
|
|
40
44
|
validator,
|
|
41
45
|
layoutRuleApplier
|
|
42
46
|
});
|
|
47
|
+
const createRecordSuccessController = new CreateRecordSuccessController(service);
|
|
48
|
+
const createRecordFailedController = new CreateRecordFailedController(service);
|
|
43
49
|
const initializeController = new InitializeController(service);
|
|
44
50
|
const myLayoutSuccessController = new MyLayoutSuccessController(service);
|
|
45
51
|
const myFormRequestController = new MyFormRequestController(service);
|
|
@@ -50,6 +56,7 @@ class EventHandlersFactory {
|
|
|
50
56
|
const layoutRulesSuccessController = new LayoutRulesSuccessController(service);
|
|
51
57
|
const validationRulesRequestController = new ValidationRulesRequestController(service);
|
|
52
58
|
const validationRulesSuccessController = new ValidationRulesSuccessController(service);
|
|
59
|
+
const lookupFieldController = new LookupFieldController(service);
|
|
53
60
|
const fieldValueChangeController = new FieldValueChangeController(service);
|
|
54
61
|
const validateFieldRequestController = new ValidateFieldRequestController(service);
|
|
55
62
|
const formSubmitController = new FormSubmitController(service);
|
|
@@ -57,29 +64,12 @@ class EventHandlersFactory {
|
|
|
57
64
|
const fieldBlurController = new FieldBlurController(service);
|
|
58
65
|
const submitValidationCompletedController = new SubmitValidationCompletedController(service);
|
|
59
66
|
const validationRulesExecutionResultController = new ValidationRulesExecutionResultController(service);
|
|
67
|
+
const apiFailureController = new ApiFailureController(service);
|
|
60
68
|
return {
|
|
61
69
|
[LifeCycleEvents.MOUNT]: initializeController.handle,
|
|
62
70
|
[ZFORM_MY_LAYOUTS_SUCCESS]: myLayoutSuccessController.handle,
|
|
63
|
-
[RECORD_EXECUTE_SUCCESS_CALLBACK]:
|
|
64
|
-
|
|
65
|
-
action,
|
|
66
|
-
dispatch
|
|
67
|
-
} = _ref;
|
|
68
|
-
dispatch({
|
|
69
|
-
type: ZFORM_SUBMIT_SUCCESS,
|
|
70
|
-
payload: action.payload
|
|
71
|
-
});
|
|
72
|
-
},
|
|
73
|
-
[RECORD_EXECUTE_FAIL_CALLBACK]: _ref2 => {
|
|
74
|
-
let {
|
|
75
|
-
action,
|
|
76
|
-
dispatch
|
|
77
|
-
} = _ref2;
|
|
78
|
-
dispatch({
|
|
79
|
-
type: "SMART_FORM#SUBMIT_FAILED",
|
|
80
|
-
payload: action.payload
|
|
81
|
-
});
|
|
82
|
-
},
|
|
71
|
+
[RECORD_EXECUTE_SUCCESS_CALLBACK]: createRecordSuccessController.handle,
|
|
72
|
+
[RECORD_EXECUTE_FAIL_CALLBACK]: createRecordFailedController.handle,
|
|
83
73
|
[ZFORM_MY_FORM_REQUEST]: myFormRequestController.handle,
|
|
84
74
|
[ZFORM_MY_FORM_SUCCESS]: myFormSuccessController.handle,
|
|
85
75
|
[ZFORM_DEPENDENCY_MAPPINGS_REQUEST]: dependenciesRequestController.handle,
|
|
@@ -88,28 +78,35 @@ class EventHandlersFactory {
|
|
|
88
78
|
[ZFORM_LAYOUT_RULES_SUCCESS]: layoutRulesSuccessController.handle,
|
|
89
79
|
[ZFORM_VALIDATION_RULES_REQUEST]: validationRulesRequestController.handle,
|
|
90
80
|
[ZFORM_VALIDATION_RULES_SUCCESS]: validationRulesSuccessController.handle,
|
|
81
|
+
[ZFORM_API_FAILURE]: apiFailureController.handle,
|
|
91
82
|
[ZFORM_FIELD_VALUE_CHANGE_REQUEST]: fieldValueChangeController.handle,
|
|
92
83
|
[ZFORM_SET_FIELD_ERROR_MESSAGE]: setFieldErrorMessageController.handle,
|
|
93
84
|
[ZFORM_VALIDATE_FIELD_REQUEST]: validateFieldRequestController.handle,
|
|
94
85
|
[SmartFormConstants.SMART_FORM_SUBMIT_CLICKED]: formSubmitController.handle,
|
|
95
86
|
[ZFORM_SUBMIT]: formSubmitController.handle,
|
|
96
|
-
[FormConstants.FORM_SUBMIT]:
|
|
87
|
+
[FormConstants.FORM_SUBMIT]: _ref => {
|
|
97
88
|
let {
|
|
98
89
|
action,
|
|
99
90
|
dispatch
|
|
100
|
-
} =
|
|
91
|
+
} = _ref;
|
|
92
|
+
const {
|
|
93
|
+
metaData,
|
|
94
|
+
payload
|
|
95
|
+
} = action;
|
|
101
96
|
dispatch({
|
|
102
|
-
type: ZFORM_SUBMIT
|
|
97
|
+
type: ZFORM_SUBMIT,
|
|
98
|
+
metaData,
|
|
99
|
+
payload
|
|
103
100
|
});
|
|
104
101
|
},
|
|
105
102
|
[FormConstants.FORM_FIELD_BLURRED]: fieldBlurController.handle,
|
|
106
103
|
[ZFORM_VALIDATION_RULES_EXECUTION_RESULT]: validationRulesExecutionResultController.handle,
|
|
107
104
|
[ZFORM_SUBMIT_VALIDATION_COMPLETED]: submitValidationCompletedController.handle,
|
|
108
|
-
[FormConstants.FORM_FIELD_VALUE_CHANGE_REQUEST]:
|
|
105
|
+
[FormConstants.FORM_FIELD_VALUE_CHANGE_REQUEST]: _ref2 => {
|
|
109
106
|
let {
|
|
110
107
|
action,
|
|
111
108
|
dispatch
|
|
112
|
-
} =
|
|
109
|
+
} = _ref2;
|
|
113
110
|
const {
|
|
114
111
|
sectionId,
|
|
115
112
|
fieldName,
|
|
@@ -124,7 +121,8 @@ class EventHandlersFactory {
|
|
|
124
121
|
},
|
|
125
122
|
metaData: {}
|
|
126
123
|
});
|
|
127
|
-
}
|
|
124
|
+
},
|
|
125
|
+
[ZFORM_LOOKUP_FIELD_SUCCESS]: lookupFieldController.handle
|
|
128
126
|
};
|
|
129
127
|
}
|
|
130
128
|
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
-
|
|
3
1
|
import getValidationRuleActionsData from "./validationRules";
|
|
4
2
|
import * as defaultCustomValidators from "./DefaultCustomValidators"; //need to move to gateway in adapter
|
|
5
3
|
|
|
6
4
|
export default class Validator {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
5
|
+
customValidators = defaultCustomValidators;
|
|
6
|
+
|
|
7
|
+
constructor() {}
|
|
10
8
|
|
|
11
9
|
init(state) {
|
|
12
10
|
this.customValidators = { ...defaultCustomValidators,
|
|
@@ -38,9 +36,7 @@ export default class Validator {
|
|
|
38
36
|
|
|
39
37
|
function handleResult(result) {
|
|
40
38
|
if (result && result.type === 'fail') {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const errorMessage = typeof result.message === 'string' ? result.message : (_result$action = result.action) === null || _result$action === void 0 ? void 0 : _result$action.message;
|
|
39
|
+
const errorMessage = typeof result.message === 'string' ? result.message : result.action?.message;
|
|
44
40
|
return {
|
|
45
41
|
fieldName,
|
|
46
42
|
actions: {
|
|
@@ -16,13 +16,17 @@ class FetchController {
|
|
|
16
16
|
metaData
|
|
17
17
|
} = action;
|
|
18
18
|
const {
|
|
19
|
-
headers
|
|
19
|
+
headers: headersFromProps
|
|
20
20
|
} = state.properties;
|
|
21
|
+
const {
|
|
22
|
+
headers: headersFromContext
|
|
23
|
+
} = state.behaviours.appContext;
|
|
21
24
|
const {
|
|
22
25
|
url,
|
|
23
26
|
method,
|
|
24
27
|
getResponse
|
|
25
28
|
} = payload;
|
|
29
|
+
const headers = headersFromProps ? headersFromProps : headersFromContext;
|
|
26
30
|
this.fetchUseCase.execute({
|
|
27
31
|
url,
|
|
28
32
|
method,
|
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
-
|
|
3
1
|
import ListErrorState from "../../domain/entities/ListErrorState";
|
|
4
2
|
import ListFactory from "../../applications/entities-factory/ListFactory";
|
|
5
3
|
import SortBy from "../../domain/entities/SortBy";
|
|
6
4
|
|
|
7
5
|
class Repository {
|
|
8
|
-
constructor() {
|
|
9
|
-
_defineProperty(this, "state", void 0);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
6
|
init(state) {
|
|
13
7
|
this.state = state;
|
|
14
8
|
}
|
|
@@ -18,9 +12,11 @@ class Repository {
|
|
|
18
12
|
departmentId,
|
|
19
13
|
viewId,
|
|
20
14
|
moduleName,
|
|
21
|
-
query
|
|
22
|
-
context
|
|
15
|
+
query
|
|
23
16
|
} = this.state.properties;
|
|
17
|
+
const {
|
|
18
|
+
context
|
|
19
|
+
} = this.state.behaviours.appContext;
|
|
24
20
|
const {
|
|
25
21
|
sortBy,
|
|
26
22
|
errorState,
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
-
|
|
3
1
|
import InitializeUseCase from "../../applications/usecases/InitializeUseCase";
|
|
4
2
|
import PropertiesChangeUseCase from "../../applications/usecases/PropertiesChangeUseCase";
|
|
5
3
|
import FetchMoreUseCase from "../../applications/usecases/FetchMoreUseCase";
|
|
@@ -19,37 +17,6 @@ import ReOrderFailedUseCase from "../../applications/usecases/ReOrderFailedUseCa
|
|
|
19
17
|
class Service {
|
|
20
18
|
constructor(dependencies) {
|
|
21
19
|
this.dependencies = dependencies;
|
|
22
|
-
|
|
23
|
-
_defineProperty(this, "initializeUseCase", void 0);
|
|
24
|
-
|
|
25
|
-
_defineProperty(this, "propertiesChangeUseCase", void 0);
|
|
26
|
-
|
|
27
|
-
_defineProperty(this, "fieldChangeUseCase", void 0);
|
|
28
|
-
|
|
29
|
-
_defineProperty(this, "fetchMoreUseCase", void 0);
|
|
30
|
-
|
|
31
|
-
_defineProperty(this, "deleteMultipleRecordUseCase", void 0);
|
|
32
|
-
|
|
33
|
-
_defineProperty(this, "deleteSingleRecordUseCase", void 0);
|
|
34
|
-
|
|
35
|
-
_defineProperty(this, "recordExecuteSucceededUseCase", void 0);
|
|
36
|
-
|
|
37
|
-
_defineProperty(this, "recordSuccessCallbackUseCase", void 0);
|
|
38
|
-
|
|
39
|
-
_defineProperty(this, "recordExecuteFailedUseCase", void 0);
|
|
40
|
-
|
|
41
|
-
_defineProperty(this, "sortUseCase", void 0);
|
|
42
|
-
|
|
43
|
-
_defineProperty(this, "recordUpdateUseCase", void 0);
|
|
44
|
-
|
|
45
|
-
_defineProperty(this, "updateSuccessUseCase", void 0);
|
|
46
|
-
|
|
47
|
-
_defineProperty(this, "deleteSuccessUseCase", void 0);
|
|
48
|
-
|
|
49
|
-
_defineProperty(this, "reOrderUseCase", void 0);
|
|
50
|
-
|
|
51
|
-
_defineProperty(this, "reOrderFailedUseCase", void 0);
|
|
52
|
-
|
|
53
20
|
this.initializeUseCase = new InitializeUseCase(this.dependencies);
|
|
54
21
|
this.propertiesChangeUseCase = new PropertiesChangeUseCase(this.dependencies);
|
|
55
22
|
this.fetchMoreUseCase = new FetchMoreUseCase(this.dependencies);
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
-
|
|
3
1
|
class Presenter {
|
|
4
|
-
constructor() {
|
|
5
|
-
_defineProperty(this, "updateState", void 0);
|
|
6
|
-
|
|
7
|
-
_defineProperty(this, "state", void 0);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
2
|
updateDependencies(state, updateState) {
|
|
11
3
|
this.updateState = updateState;
|
|
12
4
|
this.state = state;
|
|
@@ -12,9 +12,12 @@ export default function SelectionTranslator(state) {
|
|
|
12
12
|
const {
|
|
13
13
|
columnChooserConfig,
|
|
14
14
|
selectionConfig,
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
moduleName,
|
|
16
|
+
instanceName
|
|
17
17
|
} = properties;
|
|
18
|
+
const {
|
|
19
|
+
context
|
|
20
|
+
} = state.behaviours.appContext;
|
|
18
21
|
const {
|
|
19
22
|
zfield,
|
|
20
23
|
selection,
|
|
@@ -27,7 +30,7 @@ export default function SelectionTranslator(state) {
|
|
|
27
30
|
const availableFields = zfield.fields;
|
|
28
31
|
const columnChooserProps = getColumnChooserProps(columnChooser, availableFields, context, moduleName);
|
|
29
32
|
const clientActions = generateClientActions(selectionConfig, columnChooserConfig, hasAllSelected, columnChooserProps);
|
|
30
|
-
const contextAppliedActions = ClientActionsTranslator.transform(clientActions, context);
|
|
33
|
+
const contextAppliedActions = ClientActionsTranslator.transform(clientActions, instanceName, moduleName, context);
|
|
31
34
|
return {
|
|
32
35
|
selected,
|
|
33
36
|
hasAllSelected,
|
|
@@ -52,8 +55,6 @@ function generateClientActions(selectionConfig, columnChooserConfig, hasAllSelec
|
|
|
52
55
|
}
|
|
53
56
|
|
|
54
57
|
function getColumnChooserProps(columnChooser) {
|
|
55
|
-
var _context$modules, _context$modules$find;
|
|
56
|
-
|
|
57
58
|
let availableFields = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
58
59
|
let context = arguments.length > 2 ? arguments[2] : undefined;
|
|
59
60
|
let moduleName = arguments.length > 3 ? arguments[3] : undefined;
|
|
@@ -64,7 +65,7 @@ function getColumnChooserProps(columnChooser) {
|
|
|
64
65
|
isMaxSelectionReached
|
|
65
66
|
} = columnChooser;
|
|
66
67
|
const fieldMap = mapFieldsToObject(availableFields);
|
|
67
|
-
const disabledFieldName =
|
|
68
|
+
const disabledFieldName = context.modules?.find(module => module.apiKey === moduleName)?.nameField;
|
|
68
69
|
const columnChooserOptions = fieldsOrder.map(fieldName => getOption(fieldMap[fieldName], !!selected[fieldName], disabledFieldName === fieldName));
|
|
69
70
|
return {
|
|
70
71
|
options: columnChooserOptions,
|
|
@@ -18,17 +18,18 @@ const fallbackToDefault = (value, defaultValue) => [undefined, null].includes(va
|
|
|
18
18
|
|
|
19
19
|
export default class TableTranslator {
|
|
20
20
|
static transformState(state) {
|
|
21
|
-
var _preferences$rowActio, _localStorageBehaviou, _localStorageBehaviou2;
|
|
22
|
-
|
|
23
21
|
const {
|
|
24
22
|
behaviours,
|
|
25
23
|
properties
|
|
26
24
|
} = state;
|
|
27
25
|
const {
|
|
28
26
|
componentMapping,
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
reOrderConfig,
|
|
28
|
+
instanceName
|
|
31
29
|
} = properties;
|
|
30
|
+
const {
|
|
31
|
+
context
|
|
32
|
+
} = behaviours.appContext;
|
|
32
33
|
const {
|
|
33
34
|
localStorage: localStorageBehaviour,
|
|
34
35
|
columnResizer,
|
|
@@ -45,7 +46,8 @@ export default class TableTranslator {
|
|
|
45
46
|
zlist,
|
|
46
47
|
zrecord,
|
|
47
48
|
zfield,
|
|
48
|
-
zclientAction
|
|
49
|
+
zclientAction,
|
|
50
|
+
zclientScriptsEventMapping
|
|
49
51
|
} = fallbackToDefault(behaviours, {}); // FIX: behaviours should be available by default
|
|
50
52
|
|
|
51
53
|
const {
|
|
@@ -68,6 +70,10 @@ export default class TableTranslator {
|
|
|
68
70
|
isFetching: isClientActionsFetching
|
|
69
71
|
} = fallbackToDefault(zclientAction, {}); // FIX: zclientAction should be available by defaultlt
|
|
70
72
|
|
|
73
|
+
const {
|
|
74
|
+
clientScripts,
|
|
75
|
+
isFetching: isClientScriptsFetching
|
|
76
|
+
} = fallbackToDefault(zclientScriptsEventMapping, {});
|
|
71
77
|
const fieldComponentMapping = fallbackToDefault(componentMapping.fields, {});
|
|
72
78
|
const rowActionsUiType = componentMapping.rowActionsComponentName;
|
|
73
79
|
const {
|
|
@@ -82,7 +88,7 @@ export default class TableTranslator {
|
|
|
82
88
|
} = fallbackToDefault(zfield, {}); // FIX: zfield should be available by default
|
|
83
89
|
|
|
84
90
|
const isLoading = !!(isRecordsFetching || isAvailableFieldsFetching || isSelectedFieldsFetching);
|
|
85
|
-
const fields = selectedFields
|
|
91
|
+
const fields = selectedFields?.map(selectedField => availableFields?.find(availableField => availableField.name === selectedField)).filter(f => f != undefined);
|
|
86
92
|
const newClientActions = DefaultClientActions.createSortActions(fields, clientActions || EMPTY_ARRAY);
|
|
87
93
|
const {
|
|
88
94
|
headerActions,
|
|
@@ -92,21 +98,22 @@ export default class TableTranslator {
|
|
|
92
98
|
} = mapClientActions(newClientActions || EMPTY_ARRAY);
|
|
93
99
|
const isRowClickable = noLocation.some(action => action.uiComponentMapping.eventMappings.some(mapping => mapping.sourceEvent === TableListConstants.TABLE_LIST_ROW_CLICKED));
|
|
94
100
|
const rowCursor = isRowClickable ? RowCursor.Pointer : RowCursor.Default;
|
|
95
|
-
const rowActionsWidth = preferences
|
|
101
|
+
const rowActionsWidth = preferences?.rowActions?.width;
|
|
96
102
|
const {
|
|
97
103
|
moduleName,
|
|
98
104
|
viewId
|
|
99
105
|
} = properties; // TODO: move this to a separate file as selector
|
|
100
106
|
|
|
101
|
-
const localStorageFieldWidths = fallbackToDefault(localStorageBehaviour
|
|
107
|
+
const localStorageFieldWidths = fallbackToDefault(localStorageBehaviour?.[moduleName]?.[viewId]?.modifiedWidths, EMPTY_OBJECT);
|
|
102
108
|
const modifiedWidths = calculateFieldWidths(fields, localStorageFieldWidths, preferences);
|
|
103
109
|
const recordsForDisplay = isRecordsShouldBeEmptied ? EMPTY_ARRAY : records;
|
|
104
|
-
const headersTranslator = new HeadersTranslator(fields, headerActions, context, modifiedWidths, sortBy, records);
|
|
105
|
-
const rowsTranslator = new RowsTranslator(recordsForDisplay, fields, rowActions, context, fieldComponentMapping, rowActionsUiType, fieldActions); // const actionTranslator = new ClientActionsTranslator(clientActions, records, fields, pageContext);
|
|
110
|
+
const headersTranslator = new HeadersTranslator(fields, headerActions, context, modifiedWidths, sortBy, records, instanceName, moduleName);
|
|
111
|
+
const rowsTranslator = new RowsTranslator(recordsForDisplay, fields, rowActions, context, preferences, fieldComponentMapping, rowActionsUiType, fieldActions, instanceName, moduleName); // const actionTranslator = new ClientActionsTranslator(clientActions, records, fields, pageContext);
|
|
106
112
|
// const translators = [headersTranslator.getTranslator(), rowsTranslator.getTranslator(), actionTranslator.getTranslator()];
|
|
107
113
|
|
|
108
114
|
const translators = [headersTranslator.getTranslator(), rowsTranslator.getTranslator()];
|
|
109
|
-
|
|
115
|
+
let data = Pipeline.run(translators, {});
|
|
116
|
+
data.clientScripts = clientScripts; // TODO: Implement ModuleTableModel, and move data and isLoading to tableViewModel Object
|
|
110
117
|
|
|
111
118
|
return {
|
|
112
119
|
properties,
|
|
@@ -125,7 +132,7 @@ export default class TableTranslator {
|
|
|
125
132
|
modifiedWidths
|
|
126
133
|
}),
|
|
127
134
|
rowActionsConfig: {
|
|
128
|
-
hasActions: Boolean(rowActions
|
|
135
|
+
hasActions: Boolean(rowActions?.length),
|
|
129
136
|
// Boolean(newRowActions?.length),
|
|
130
137
|
columnWidth: typeof rowActionsWidth === 'number' ? rowActionsWidth : ColumnWidth.XSmall
|
|
131
138
|
},
|
|
@@ -4,8 +4,6 @@ import ClientActionsTranslator from "../../../../client-actions/translators/clie
|
|
|
4
4
|
|
|
5
5
|
//hacking temp url construction for lookup
|
|
6
6
|
function getLookupUrlConstructions(_ref) {
|
|
7
|
-
var _field$lookup, _field$lookup$module;
|
|
8
|
-
|
|
9
7
|
let {
|
|
10
8
|
field,
|
|
11
9
|
value,
|
|
@@ -15,13 +13,11 @@ function getLookupUrlConstructions(_ref) {
|
|
|
15
13
|
orgName,
|
|
16
14
|
departmentName
|
|
17
15
|
} = context;
|
|
18
|
-
let lookupModuleName = field
|
|
16
|
+
let lookupModuleName = field?.lookup?.module?.apiName;
|
|
19
17
|
return `/agent/${orgName}/${departmentName}/${lookupModuleName}/details/${value.id}`;
|
|
20
18
|
}
|
|
21
19
|
|
|
22
|
-
function ColumnTranslator(field, record, fieldComponentMapping, fieldActions, context) {
|
|
23
|
-
var _record$cf;
|
|
24
|
-
|
|
20
|
+
function ColumnTranslator(field, record, fieldComponentMapping, fieldActions, context, preferences, instanceName, moduleName) {
|
|
25
21
|
const {
|
|
26
22
|
isCustomField,
|
|
27
23
|
name,
|
|
@@ -35,8 +31,8 @@ function ColumnTranslator(field, record, fieldComponentMapping, fieldActions, co
|
|
|
35
31
|
}
|
|
36
32
|
|
|
37
33
|
let tempValue = undefined;
|
|
38
|
-
let value = isCustomField ?
|
|
39
|
-
const actions = ClientActionsTranslator.transform(fieldActions, {
|
|
34
|
+
let value = isCustomField ? record.cf?.[name] : record[name];
|
|
35
|
+
const actions = ClientActionsTranslator.transform(fieldActions, instanceName, moduleName, {
|
|
40
36
|
field,
|
|
41
37
|
record
|
|
42
38
|
});
|
|
@@ -75,28 +71,39 @@ function ColumnTranslator(field, record, fieldComponentMapping, fieldActions, co
|
|
|
75
71
|
finalValue = fieldToUiValue;
|
|
76
72
|
}
|
|
77
73
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
actions,
|
|
81
|
-
...fieldTranslator(field, tempValue ? tempValue : finalValue, {
|
|
82
|
-
recordId: record.id
|
|
83
|
-
})
|
|
84
|
-
};
|
|
85
|
-
data.value = fieldEntry.fieldToUIComponentTranslator({
|
|
86
|
-
field,
|
|
87
|
-
record,
|
|
88
|
-
context
|
|
89
|
-
});
|
|
90
|
-
data.type = fieldEntry.UIComponentName;
|
|
91
|
-
return data;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
return {
|
|
74
|
+
finalValue = tempValue ? tempValue : finalValue;
|
|
75
|
+
const viewModel = {
|
|
95
76
|
actions,
|
|
96
77
|
...fieldTranslator(field, finalValue, {
|
|
97
78
|
recordId: record.id
|
|
98
|
-
})
|
|
79
|
+
}, context, preferences)
|
|
99
80
|
};
|
|
81
|
+
|
|
82
|
+
if (fieldEntry && typeof fieldEntry === 'object') {
|
|
83
|
+
viewModel.type = fieldEntry.UIComponentName;
|
|
84
|
+
|
|
85
|
+
if (fieldEntry.fieldToUIComponentTranslator) {
|
|
86
|
+
viewModel.value = fieldEntry.fieldToUIComponentTranslator({
|
|
87
|
+
field,
|
|
88
|
+
record,
|
|
89
|
+
context
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (fieldEntry.translator) {
|
|
94
|
+
const newViewModel = fieldEntry.translator({
|
|
95
|
+
viewModel,
|
|
96
|
+
field,
|
|
97
|
+
context
|
|
98
|
+
});
|
|
99
|
+
newViewModel.type = fieldEntry.UIComponentName;
|
|
100
|
+
return newViewModel;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return viewModel;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return viewModel;
|
|
100
107
|
}
|
|
101
108
|
|
|
102
109
|
export default ColumnTranslator;
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Alignment } from "../../../../../cc/table-list/data-types/Header";
|
|
2
2
|
import ClientActionsTranslator from "../../../../client-actions/translators/client-actions-translator";
|
|
3
3
|
import { SortOrder } from "../../../../zlist/domain/entities/interfaces/Properties";
|
|
4
4
|
import { i18NProviderUtils } from '@zohodesk/i18n';
|
|
5
5
|
|
|
6
|
-
function HeaderTranslator(field, actions, context, modifiedWidths, sortBy, records) {
|
|
6
|
+
function HeaderTranslator(field, actions, context, modifiedWidths, sortBy, records, instanceName, moduleName) {
|
|
7
7
|
const {
|
|
8
8
|
id,
|
|
9
9
|
name,
|
|
10
10
|
displayLabel,
|
|
11
|
-
isSortable
|
|
12
|
-
type
|
|
11
|
+
isSortable
|
|
13
12
|
} = field;
|
|
14
13
|
const newField = { ...field,
|
|
15
14
|
sort: translateSortBy(field.id, sortBy)
|
|
16
15
|
};
|
|
17
|
-
const transformedActions = ClientActionsTranslator.transform(actions, { ...context,
|
|
16
|
+
const transformedActions = ClientActionsTranslator.transform(actions, instanceName, moduleName, { ...context,
|
|
18
17
|
field: newField,
|
|
19
18
|
recordsLength: records.length.toString()
|
|
20
19
|
});
|
|
@@ -24,7 +23,7 @@ function HeaderTranslator(field, actions, context, modifiedWidths, sortBy, recor
|
|
|
24
23
|
name: name,
|
|
25
24
|
text: displayLabel,
|
|
26
25
|
sortable: isSortable,
|
|
27
|
-
alignment:
|
|
26
|
+
alignment: Alignment.Left,
|
|
28
27
|
width,
|
|
29
28
|
actions: transformedActions
|
|
30
29
|
};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import HeaderTranslator from "./Header";
|
|
2
2
|
export default class HeadersTranslator {
|
|
3
|
-
constructor(fields, actions, context, modifiedWidths, sortBy, records) {
|
|
3
|
+
constructor(fields, actions, context, modifiedWidths, sortBy, records, instanceName, moduleName) {
|
|
4
4
|
this.fields = fields;
|
|
5
5
|
this.actions = actions;
|
|
6
6
|
this.context = context;
|
|
7
7
|
this.modifiedWidths = modifiedWidths;
|
|
8
8
|
this.sortBy = sortBy;
|
|
9
9
|
this.records = records;
|
|
10
|
+
this.instanceName = instanceName;
|
|
11
|
+
this.moduleName = moduleName;
|
|
10
12
|
this.pipe = this.pipe.bind(this);
|
|
11
13
|
}
|
|
12
14
|
|
|
@@ -15,7 +17,7 @@ export default class HeadersTranslator {
|
|
|
15
17
|
return [];
|
|
16
18
|
}
|
|
17
19
|
|
|
18
|
-
return this.fields.map(field => HeaderTranslator(field, this.actions, this.context, this.modifiedWidths, this.sortBy, this.records));
|
|
20
|
+
return this.fields.map(field => HeaderTranslator(field, this.actions, this.context, this.modifiedWidths, this.sortBy, this.records, this.instanceName, this.moduleName));
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
pipe(viewModel) {
|
|
@@ -8,14 +8,17 @@ export default function RowTranslator(_ref) {
|
|
|
8
8
|
rowActionsUiType,
|
|
9
9
|
rowActions,
|
|
10
10
|
fieldActions,
|
|
11
|
-
context
|
|
11
|
+
context,
|
|
12
|
+
preferences,
|
|
13
|
+
instanceName,
|
|
14
|
+
moduleName
|
|
12
15
|
} = _ref;
|
|
13
|
-
const actions = ClientActionsTranslator.transform(rowActions, { ...context,
|
|
16
|
+
const actions = ClientActionsTranslator.transform(rowActions, instanceName, moduleName, { ...context,
|
|
14
17
|
record
|
|
15
18
|
});
|
|
16
19
|
return {
|
|
17
20
|
id: record.id,
|
|
18
|
-
columns: fields.map(field => ColumnTranslator(field, record, fieldComponentMapping, fieldActions, context)),
|
|
21
|
+
columns: fields.map(field => ColumnTranslator(field, record, fieldComponentMapping, fieldActions, context, preferences, instanceName, moduleName)),
|
|
19
22
|
rowActionLocation: {
|
|
20
23
|
type: rowActionsUiType,
|
|
21
24
|
actions
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import RowTranslator from "./Row";
|
|
2
2
|
export default class RowsTranslator {
|
|
3
|
-
constructor(records, fields, rowActions, context, fieldComponentMapping, rowActionsUiType, fieldActions) {
|
|
3
|
+
constructor(records, fields, rowActions, context, preferences, fieldComponentMapping, rowActionsUiType, fieldActions, instanceName, moduleName) {
|
|
4
4
|
this.records = records;
|
|
5
5
|
this.fields = fields;
|
|
6
6
|
this.rowActions = rowActions;
|
|
7
7
|
this.context = context;
|
|
8
|
+
this.preferences = preferences;
|
|
8
9
|
this.fieldComponentMapping = fieldComponentMapping;
|
|
9
10
|
this.rowActionsUiType = rowActionsUiType;
|
|
10
11
|
this.fieldActions = fieldActions;
|
|
12
|
+
this.instanceName = instanceName;
|
|
13
|
+
this.moduleName = moduleName;
|
|
11
14
|
this.pipe = this.pipe.bind(this);
|
|
12
15
|
}
|
|
13
16
|
|
|
@@ -23,7 +26,10 @@ export default class RowsTranslator {
|
|
|
23
26
|
rowActionsUiType: this.rowActionsUiType,
|
|
24
27
|
rowActions: this.rowActions,
|
|
25
28
|
fieldActions: this.fieldActions,
|
|
26
|
-
context: this.context
|
|
29
|
+
context: this.context,
|
|
30
|
+
preferences: this.preferences,
|
|
31
|
+
instanceName: this.instanceName,
|
|
32
|
+
moduleName: this.moduleName
|
|
27
33
|
}));
|
|
28
34
|
}
|
|
29
35
|
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
-
|
|
3
1
|
import ClientActionsTranslator from "../../../../../client-actions/translators/client-actions-translator";
|
|
4
2
|
|
|
5
3
|
class ActionsTranslator {
|
|
@@ -11,20 +9,11 @@ class ActionsTranslator {
|
|
|
11
9
|
this.records = records;
|
|
12
10
|
this.fields = fields;
|
|
13
11
|
this.context = context;
|
|
14
|
-
|
|
15
|
-
_defineProperty(this, "headerActions", void 0);
|
|
16
|
-
|
|
17
|
-
_defineProperty(this, "fieldActions", void 0);
|
|
18
|
-
|
|
19
|
-
_defineProperty(this, "rowActions", void 0);
|
|
20
|
-
|
|
21
|
-
_defineProperty(this, "noLocation", void 0);
|
|
22
|
-
|
|
23
12
|
this.pipe = this.pipe.bind(this);
|
|
24
|
-
this.headerActions = actions.filter(action =>
|
|
25
|
-
this.fieldActions = actions.filter(action =>
|
|
26
|
-
this.rowActions = actions.filter(action =>
|
|
27
|
-
this.noLocation = actions.filter(action => !
|
|
13
|
+
this.headerActions = actions.filter(action => action?.location === 'header_actions');
|
|
14
|
+
this.fieldActions = actions.filter(action => action?.location === 'field_actions');
|
|
15
|
+
this.rowActions = actions.filter(action => action?.location === 'row_actions');
|
|
16
|
+
this.noLocation = actions.filter(action => !action?.location);
|
|
28
17
|
}
|
|
29
18
|
|
|
30
19
|
getTranslator() {
|