@zohodesk/library-platform 1.1.1-exp.6 → 1.1.2-exp.0
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/column-chooser/Constants.js +4 -0
- package/es/bc/column-chooser/EventHandlers.js +2 -0
- package/es/bc/column-chooser/Events.js +59 -0
- package/es/bc/column-chooser/Properties.js +18 -0
- package/es/bc/keyboard-controls/Constants.js +5 -0
- package/es/bc/keyboard-controls/Events.js +51 -0
- package/es/bc/keyboard-controls/Properties.js +11 -0
- package/es/bc/keyboard-controls/types/KeyboardControlBehaviourState.js +1 -0
- package/es/bc/zlist/Properties.js +15 -0
- package/es/cc/component/Slot.js +1 -0
- package/es/cc/component/SlotComponent.js +1 -0
- package/es/cc/component/properties/slotName.js +1 -0
- package/es/cc/fields/formula/Events.js +3 -0
- package/es/cc/fields/formula/Model.js +14 -0
- package/es/cc/fields/formula/Properties.js +3 -0
- package/es/cc/fields/index.js +1 -0
- package/es/cc/table-column-chooser/Constants.js +6 -0
- package/es/cc/table-column-chooser/Events.js +69 -0
- package/es/cc/table-column-chooser/Properties.js +122 -0
- package/es/cc/table-column-chooser/index.js +3 -0
- package/es/cc/table-connected/Properties.js +16 -0
- package/es/cc/table-connected/constants/Events.js +4 -1
- package/es/cc/table-list/Properties.js +27 -1
- package/es/cc/table-list/data-types/KeyboardControlsConfig.js +1 -0
- package/es/cc/table-list/row/Properties.js +18 -0
- package/es/desk-frameworks/table-connected/adapters/controllers/ColumnChooserOpenedController.js +36 -0
- package/es/desk-frameworks/table-connected/adapters/controllers/ColumnChooserUpdateController.js +25 -0
- package/es/desk-frameworks/table-connected/frameworks/EventHandlersFactory.js +8 -2
- package/es/desk-frameworks/table-connected/frameworks/TableConnectedFactory.js +5 -2
- package/es/desk-frameworks/table-connected/frameworks/TableConnectedView.js +9 -6
- package/es/library/behaviours/keyboard-controls/adapters/controllers/AbstractController.js +9 -0
- package/es/library/behaviours/keyboard-controls/adapters/controllers/DestructController.js +20 -0
- package/es/library/behaviours/keyboard-controls/adapters/controllers/DownArrowPressController.js +20 -0
- package/es/library/behaviours/keyboard-controls/adapters/controllers/EnterPressController.js +24 -0
- package/es/library/behaviours/keyboard-controls/adapters/controllers/FocusNextController.js +20 -0
- package/es/library/behaviours/keyboard-controls/adapters/controllers/FocusPreviousController.js +20 -0
- package/es/library/behaviours/keyboard-controls/adapters/controllers/InitializeController.js +20 -0
- package/es/library/behaviours/keyboard-controls/adapters/controllers/SpacePressController.js +24 -0
- package/es/library/behaviours/keyboard-controls/adapters/controllers/UpArrowPressController.js +20 -0
- package/es/library/behaviours/keyboard-controls/adapters/gateways/KeyboardHandler.js +81 -0
- package/es/library/behaviours/keyboard-controls/adapters/gateways/Repository.js +47 -0
- package/es/library/behaviours/keyboard-controls/adapters/gateways/Service.js +40 -0
- package/es/library/behaviours/keyboard-controls/adapters/presenters/Presenter.js +39 -0
- package/es/library/behaviours/keyboard-controls/applications/interfaces/UseCase.js +0 -0
- package/es/library/behaviours/keyboard-controls/applications/interfaces/UseCaseDependencies.js +1 -0
- package/es/library/behaviours/keyboard-controls/applications/interfaces/gateways/IKeyboardHandler.js +1 -0
- package/es/library/behaviours/keyboard-controls/applications/interfaces/gateways/IRepository.js +1 -0
- package/es/library/behaviours/keyboard-controls/applications/interfaces/gateways/IService.js +1 -0
- package/es/library/behaviours/keyboard-controls/applications/interfaces/input/DestructInputModel.js +1 -0
- package/es/library/behaviours/keyboard-controls/applications/interfaces/input/DownArrowPressInputModel.js +1 -0
- package/es/library/behaviours/keyboard-controls/applications/interfaces/input/EnterPressInputModel.js +1 -0
- package/es/library/behaviours/keyboard-controls/applications/interfaces/input/FocusNextInputModel.js +1 -0
- package/es/library/behaviours/keyboard-controls/applications/interfaces/input/FocusPreviousInputModel.js +1 -0
- package/es/library/behaviours/keyboard-controls/applications/interfaces/input/InitializeInputModel.js +1 -0
- package/es/library/behaviours/keyboard-controls/applications/interfaces/input/RowActionInputModel.js +1 -0
- package/es/library/behaviours/keyboard-controls/applications/interfaces/input/SelectionInputModel.js +1 -0
- package/es/library/behaviours/keyboard-controls/applications/interfaces/input/SpacePressInputModel.js +1 -0
- package/es/library/behaviours/keyboard-controls/applications/interfaces/input/UpArrowPressInputModel.js +1 -0
- package/es/library/behaviours/keyboard-controls/applications/interfaces/output/IPresenter.js +1 -0
- package/es/library/behaviours/keyboard-controls/applications/interfaces/output/OutputModel.js +1 -0
- package/es/library/behaviours/keyboard-controls/applications/usecases/AbstractUseCase.js +19 -0
- package/es/library/behaviours/keyboard-controls/applications/usecases/DestructUsecase.js +17 -0
- package/es/library/behaviours/keyboard-controls/applications/usecases/DownArrowPress.js +16 -0
- package/es/library/behaviours/keyboard-controls/applications/usecases/EnterPress.js +19 -0
- package/es/library/behaviours/keyboard-controls/applications/usecases/FocusNextUsecase.js +16 -0
- package/es/library/behaviours/keyboard-controls/applications/usecases/FocusPreviousUsecase.js +16 -0
- package/es/library/behaviours/keyboard-controls/applications/usecases/InitializeUsecase.js +20 -0
- package/es/library/behaviours/keyboard-controls/applications/usecases/SpacePress.js +19 -0
- package/es/library/behaviours/keyboard-controls/applications/usecases/UpArrowPress.js +16 -0
- package/es/library/behaviours/keyboard-controls/domain/entities/KeyboardControls.js +87 -0
- package/es/library/behaviours/keyboard-controls/domain/entities/interface/IKeyboardControls.js +1 -0
- package/es/library/behaviours/keyboard-controls/domain/entities/interface/KeyboardControlModel.js +1 -0
- package/es/library/behaviours/keyboard-controls/frameworks/EventHandlerFactory.js +48 -0
- package/es/library/behaviours/keyboard-controls/frameworks/KeyboardControlBehaviourFactory.js +23 -0
- package/es/library/custom-component/domain/entities/DefaultSlotNameAppend.js +10 -0
- package/es/library/custom-component/domain/entities/Properties.js +2 -0
- package/es/library/custom-component/frameworks/ui/CreateCustomComponent.js +18 -4
- package/es/library/custom-component/frameworks/ui/CreateSlotComponent.js +89 -0
- package/es/library/custom-component/frameworks/ui/__testcases__/CreateSlotComponent.spec.js +211 -0
- package/es/library/dot/components/action-location/frameworks/ui/ActionComponentMapping.js +4 -0
- package/es/library/dot/components/table-list/adapters/controllers/KeyboardRowClickController.js +36 -0
- package/es/library/dot/components/table-list/adapters/controllers/KeyboardRowSelectController.js +31 -0
- package/es/library/dot/components/table-list/adapters/controllers/index.js +3 -1
- package/es/library/dot/components/table-list/adapters/presenters/TableTranslator.js +5 -3
- package/es/library/dot/components/table-list/frameworks/ui/EventHandlersFactory.js +4 -1
- package/es/library/dot/components/table-list/frameworks/ui/TableListView.js +10 -3
- package/es/library/dot/components/table-list/frameworks/ui/css/TableList.module.css +3 -0
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/Header.js +9 -10
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/Rows.js +7 -3
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/HeaderData.js +7 -2
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/MassAction.js +28 -0
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/Row.js +5 -0
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/RowData.js +7 -2
- package/es/library/dot/legacy-to-new-arch/table-column-chooser/frameworks/ui/TableColumnChooser.js +11 -0
- package/es/library/dot/legacy-to-new-arch/table-column-chooser/frameworks/ui/TableColumnChooserView.js +79 -0
- package/es/library/dot/legacy-to-new-arch/table-column-filter/frameworks/ui/TableColumnFilterView.js +5 -0
- package/es/library/dot/legacy-to-new-arch/table-column-filter/frameworks/ui/css/TableColumnFilter.module.css +5 -1
- package/es/library/dot/legacy-to-new-arch/table-column-sort/frameworks/ui/TableColumnSortView.js +7 -0
- package/es/library/dot/legacy-to-new-arch/table-column-sort/frameworks/ui/css/TableColumnSort.module.css +5 -1
- package/es/library/dot/legacy-to-new-arch/table-field-components/lookup-field/frameworks/ui/LookupFieldView.js +6 -8
- package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActionsRenderer.module.css +0 -6
- package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActionsRendererView.js +1 -1
- package/es/platform/column-chooser/adapters/controllers/AbstractController.js +10 -0
- package/es/platform/column-chooser/adapters/controllers/ColumnChooserCloseController.js +21 -0
- package/es/platform/column-chooser/adapters/controllers/ColumnChooserOpenController.js +26 -0
- package/es/platform/column-chooser/adapters/controllers/ColumnChooserReorderController.js +26 -0
- package/es/platform/column-chooser/adapters/controllers/ColumnChooserSaveController.js +21 -0
- package/es/platform/column-chooser/adapters/controllers/ColumnChooserSearchController.js +24 -0
- package/es/platform/column-chooser/adapters/controllers/ColumnChooserSelectController.js +26 -0
- package/es/platform/column-chooser/adapters/gateways/Repository.js +38 -0
- package/es/platform/column-chooser/adapters/gateways/Service.js +34 -0
- package/es/platform/column-chooser/adapters/gateways/State.js +1 -0
- package/es/platform/column-chooser/adapters/presenters/Presenter.js +25 -0
- package/es/platform/column-chooser/applications/interfaces/UsecaseDependencies.js +1 -0
- package/es/platform/column-chooser/applications/interfaces/gateways/IRepository.js +1 -0
- package/es/platform/column-chooser/applications/interfaces/gateways/IService.js +1 -0
- package/es/platform/column-chooser/applications/interfaces/input/ColumnChooserCloseInput.js +1 -0
- package/es/platform/column-chooser/applications/interfaces/input/ColumnChooserOpenInput.js +1 -0
- package/es/platform/column-chooser/applications/interfaces/input/ColumnChooserReorderInput.js +1 -0
- package/es/platform/column-chooser/applications/interfaces/input/ColumnChooserSaveInput.js +1 -0
- package/es/platform/column-chooser/applications/interfaces/input/ColumnChooserSearchInput.js +1 -0
- package/es/platform/column-chooser/applications/interfaces/input/ColumnChooserSelectInput.js +1 -0
- package/es/platform/column-chooser/applications/interfaces/output/BehaviourState.js +1 -0
- package/es/platform/column-chooser/applications/interfaces/output/IPresenter.js +1 -0
- package/es/platform/column-chooser/applications/usecases/AbstractUseCase.js +18 -0
- package/es/platform/column-chooser/applications/usecases/ColumnChooserCloseUseCase.js +34 -0
- package/es/platform/column-chooser/applications/usecases/ColumnChooserOpenUseCase.js +20 -0
- package/es/platform/column-chooser/applications/usecases/ColumnChooserReorderUseCase.js +20 -0
- package/es/platform/column-chooser/applications/usecases/ColumnChooserSaveUseCase.js +31 -0
- package/es/platform/column-chooser/applications/usecases/ColumnChooserSearchUseCase.js +19 -0
- package/es/platform/column-chooser/applications/usecases/ColumnChooserSelectUseCase.js +26 -0
- package/es/platform/column-chooser/domain/entities/ColumnChooserImp.js +95 -0
- package/es/platform/column-chooser/domain/entities/ReorderEntityImp.js +35 -0
- package/es/platform/column-chooser/domain/entities/SearchEntityImp.js +28 -0
- package/es/platform/column-chooser/domain/entities/SelectEntityImp.js +58 -0
- package/es/platform/column-chooser/domain/entities/interfaces/ColumnChooser.js +1 -0
- package/es/platform/column-chooser/domain/entities/interfaces/ReorderEntity.js +1 -0
- package/es/platform/column-chooser/domain/entities/interfaces/SearchEntity.js +1 -0
- package/es/platform/column-chooser/domain/entities/interfaces/SelectEntity.js +1 -0
- package/es/platform/column-chooser/frameworks/ColumnChooserBehaviourFactory.js +19 -0
- package/es/platform/column-chooser/frameworks/EventHandlersFactory.js +30 -0
- package/es/platform/data-source/http-template/getAvailableFields.js +1 -0
- package/es/platform/data-source/http-template/getClientActions.js +1 -1
- package/es/platform/data-source/http-template/updateSelectedFields.js +28 -0
- package/es/platform/data-source/index.js +2 -0
- package/es/platform/zfield/domain/entities/fields-manager/FieldsManager.js +3 -1
- package/es/platform/zfield/domain/entities/interfaces/FieldApiName.js +1 -0
- package/es/platform/zfield/frameworks/ZFieldBehaviourFactory.js +6 -1
- package/es/platform/zlist/adapters/gateways/Repository.js +4 -2
- package/es/platform/zlist/adapters/presenters/SelectionTranslator.js +92 -0
- package/es/platform/zlist/adapters/presenters/TableTranslator.js +32 -19
- package/es/platform/zlist/adapters/presenters/translators/ColumnTranslator.js +26 -3
- package/es/platform/zlist/adapters/presenters/translators/Row.js +1 -1
- package/es/platform/zlist/adapters/presenters/translators/fields/FormulaFieldTranslator.js +26 -0
- package/es/platform/zlist/adapters/presenters/translators/fields/LookUpFieldTranslator.js +6 -6
- package/es/platform/zlist/adapters/presenters/translators/fields/index.js +2 -1
- package/es/platform/zlist/adapters/presenters/translators/interfaces/State.js +2 -1
- package/es/platform/zlist/adapters/presenters/utils/DefaultClientActions.js +78 -6
- package/es/platform/zlist/applications/entities-factory/ListFactory.js +3 -2
- package/es/platform/zlist/applications/usecases/FetchMoreUseCase.js +4 -1
- package/es/platform/zlist/applications/usecases/RecordExecuteFailedUseCase.js +3 -1
- package/es/platform/zlist/domain/entities/List.js +14 -2
- package/package.json +6 -4
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/SelectAll.js +0 -26
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { TableListConstants } from "../../../../../../cc/table-list";
|
|
2
|
-
import { SelectItemController, SelectAllController, ScrollController, FieldChangeController, FieldClickController, SortByController } from "../../adapters/controllers";
|
|
2
|
+
import { SelectItemController, SelectAllController, ScrollController, FieldChangeController, FieldClickController, SortByController, KeyboardRowSelectController, KeyboardRowClickController } from "../../adapters/controllers";
|
|
3
3
|
import TableRowConstants from "../../../../../../cc/table-list/row/Constants";
|
|
4
4
|
import RowClickController from "../../adapters/controllers/RowClickController";
|
|
5
|
+
import { SMART_TABLE_ACTION_TRIGGERED, SMART_TABLE_SELECTION_TOGGLED } from "../../../../../../cc/table-connected/constants/Events";
|
|
5
6
|
|
|
6
7
|
class EventHandlersFactory {
|
|
7
8
|
static create() {
|
|
8
9
|
return {
|
|
10
|
+
[SMART_TABLE_SELECTION_TOGGLED]: new KeyboardRowSelectController().handle,
|
|
11
|
+
[SMART_TABLE_ACTION_TRIGGERED]: new KeyboardRowClickController().handle,
|
|
9
12
|
[TableRowConstants.TABLE_ROW_CLICKED]: new RowClickController().handle,
|
|
10
13
|
[TableListConstants.TABLE_LIST_TOGGLE_ITEM_SELECTION]: new SelectItemController().handle,
|
|
11
14
|
[TableListConstants.TABLE_LIST_TOGGLE_ALL_SELECTION]: new SelectAllController().handle,
|
|
@@ -27,6 +27,7 @@ function TableListView(_ref2, _ref) {
|
|
|
27
27
|
isFlexibleColumns,
|
|
28
28
|
rowCursor,
|
|
29
29
|
rowActionsConfig,
|
|
30
|
+
keyboardControlsConfig,
|
|
30
31
|
selection,
|
|
31
32
|
emptyStateUiType,
|
|
32
33
|
isError
|
|
@@ -43,6 +44,7 @@ function TableListView(_ref2, _ref) {
|
|
|
43
44
|
|
|
44
45
|
const isDataEmpty = !hasRows && !isLoading && !isError; // TODO: derive from state.properties
|
|
45
46
|
|
|
47
|
+
const isKeyboardControlsEnabled = keyboardControlsConfig.isEnabled;
|
|
46
48
|
return /*#__PURE__*/React.createElement("div", {
|
|
47
49
|
className: style.wrapper,
|
|
48
50
|
ref: _ref
|
|
@@ -55,6 +57,7 @@ function TableListView(_ref2, _ref) {
|
|
|
55
57
|
resizerState,
|
|
56
58
|
selectionConfig,
|
|
57
59
|
selection,
|
|
60
|
+
isKeyboardControlsEnabled,
|
|
58
61
|
isFlexibleColumns,
|
|
59
62
|
hasRowActions,
|
|
60
63
|
rowActionsColumnWidth,
|
|
@@ -64,6 +67,7 @@ function TableListView(_ref2, _ref) {
|
|
|
64
67
|
rows,
|
|
65
68
|
isFlexibleColumns,
|
|
66
69
|
selectionConfig,
|
|
70
|
+
isKeyboardControlsEnabled,
|
|
67
71
|
rowCursor,
|
|
68
72
|
hasRowActions,
|
|
69
73
|
rowActionsColumnWidth,
|
|
@@ -85,6 +89,7 @@ function renderHeader(_ref3) {
|
|
|
85
89
|
resizerState,
|
|
86
90
|
selectionConfig,
|
|
87
91
|
selection,
|
|
92
|
+
isKeyboardControlsEnabled,
|
|
88
93
|
isFlexibleColumns,
|
|
89
94
|
hasRowActions,
|
|
90
95
|
rowActionsColumnWidth,
|
|
@@ -92,15 +97,15 @@ function renderHeader(_ref3) {
|
|
|
92
97
|
} = _ref3;
|
|
93
98
|
return /*#__PURE__*/React.createElement(Header, {
|
|
94
99
|
isSelectionEnabled: selectionConfig.isEnabled,
|
|
95
|
-
isSelectAllEnabled: selectionConfig.isSelectAllEnabled,
|
|
96
|
-
hasAllSelected: selection.hasAllSelected,
|
|
97
100
|
isResizerEnabled: resizerState.isEnabled,
|
|
101
|
+
isKeyboardControlsEnabled: isKeyboardControlsEnabled,
|
|
98
102
|
currentlyResizingColumn: resizerState.currentlyResizingColumn,
|
|
99
103
|
isCurrentlyResizing: resizerState.isCurrentlyResizing,
|
|
100
104
|
resizerExtraWidth: resizerState.extraWidth,
|
|
101
105
|
isFlexibleColumns: isFlexibleColumns,
|
|
102
106
|
hasRowActions: hasRowActions,
|
|
103
107
|
rowActionsColumnWidth: rowActionsColumnWidth,
|
|
108
|
+
actions: selection.actions,
|
|
104
109
|
headers: headers,
|
|
105
110
|
dispatch: dispatch
|
|
106
111
|
});
|
|
@@ -112,6 +117,7 @@ function renderBody(_ref4) {
|
|
|
112
117
|
rows,
|
|
113
118
|
isFlexibleColumns,
|
|
114
119
|
selectionConfig,
|
|
120
|
+
isKeyboardControlsEnabled,
|
|
115
121
|
rowCursor,
|
|
116
122
|
hasRowActions,
|
|
117
123
|
rowActionsColumnWidth,
|
|
@@ -127,7 +133,8 @@ function renderBody(_ref4) {
|
|
|
127
133
|
isSelectionEnabled: selectionConfig.isEnabled,
|
|
128
134
|
rowCursor: rowCursor,
|
|
129
135
|
hasRowActions: hasRowActions,
|
|
130
|
-
rowActionsColumnWidth: rowActionsColumnWidth
|
|
136
|
+
rowActionsColumnWidth: rowActionsColumnWidth,
|
|
137
|
+
isKeyboardControlsEnabled: isKeyboardControlsEnabled
|
|
131
138
|
}));
|
|
132
139
|
}
|
|
133
140
|
|
|
@@ -8,7 +8,7 @@ const TableHeaderRow = _ref => {
|
|
|
8
8
|
return /*#__PURE__*/React.createElement(React.Fragment, null, children);
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
-
import
|
|
11
|
+
import MassAction from "./header/MassAction";
|
|
12
12
|
import Headers from "./header/Headers";
|
|
13
13
|
import ActionColumn from "./header/ActionColumn";
|
|
14
14
|
import ResizerExtraSpace from "./header/ResizerExtraSpace";
|
|
@@ -16,8 +16,8 @@ import ResizerExtraSpace from "./header/ResizerExtraSpace";
|
|
|
16
16
|
function Header(_ref2) {
|
|
17
17
|
let {
|
|
18
18
|
isSelectionEnabled,
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
actions,
|
|
20
|
+
isKeyboardControlsEnabled,
|
|
21
21
|
isResizerEnabled,
|
|
22
22
|
currentlyResizingColumn,
|
|
23
23
|
isCurrentlyResizing,
|
|
@@ -35,16 +35,15 @@ function Header(_ref2) {
|
|
|
35
35
|
|
|
36
36
|
return /*#__PURE__*/React.createElement(TableHeader, {
|
|
37
37
|
$flag_isColumnsFlexible: isFlexibleColumns,
|
|
38
|
-
$flag_padding: !isSelectionEnabled
|
|
39
|
-
|
|
38
|
+
$flag_padding: !isSelectionEnabled,
|
|
39
|
+
$flag_hasHighlighter: isKeyboardControlsEnabled
|
|
40
|
+
}, /*#__PURE__*/React.createElement(TableHeaderRow, null, rendermassAction(isSelectionEnabled, actions), renderHeaders(headers, currentlyResizingColumn, isResizerEnabled, isFlexibleColumns, dispatch), renderActionColumn(hasRowActions, rowActionsColumnWidth), renderResizerExtraSpace(isCurrentlyResizing, resizerExtraWidth)));
|
|
40
41
|
}
|
|
41
42
|
|
|
42
|
-
function
|
|
43
|
-
return /*#__PURE__*/React.createElement(
|
|
43
|
+
function rendermassAction(isSelectionEnabled, actions) {
|
|
44
|
+
return /*#__PURE__*/React.createElement(MassAction, {
|
|
44
45
|
isSelectionEnabled: isSelectionEnabled,
|
|
45
|
-
|
|
46
|
-
hasAllSelected: hasAllSelected,
|
|
47
|
-
dispatch: dispatch
|
|
46
|
+
actions: actions
|
|
48
47
|
});
|
|
49
48
|
}
|
|
50
49
|
|
|
@@ -9,20 +9,22 @@ function Rows(_ref) {
|
|
|
9
9
|
isSelectionEnabled,
|
|
10
10
|
rowCursor,
|
|
11
11
|
hasRowActions,
|
|
12
|
-
rowActionsColumnWidth
|
|
12
|
+
rowActionsColumnWidth,
|
|
13
|
+
isKeyboardControlsEnabled
|
|
13
14
|
} = _ref;
|
|
14
15
|
return rows.map((row, index) => /*#__PURE__*/React.createElement(Row, {
|
|
15
16
|
key: index,
|
|
16
|
-
...getRowProps(row, headers, isFlexibleColumns, isSelectionEnabled, rowCursor, hasRowActions, rowActionsColumnWidth)
|
|
17
|
+
...getRowProps(row, headers, isFlexibleColumns, isSelectionEnabled, rowCursor, hasRowActions, rowActionsColumnWidth, isKeyboardControlsEnabled)
|
|
17
18
|
}));
|
|
18
19
|
}
|
|
19
20
|
|
|
20
|
-
function getRowProps(row, headers, isFlexibleColumns, isSelectionEnabled, rowCursor, hasRowActions, rowActionsColumnWidth) {
|
|
21
|
+
function getRowProps(row, headers, isFlexibleColumns, isSelectionEnabled, rowCursor, hasRowActions, rowActionsColumnWidth, isKeyboardControlsEnabled) {
|
|
21
22
|
const {
|
|
22
23
|
id,
|
|
23
24
|
columns,
|
|
24
25
|
isSelected,
|
|
25
26
|
isSelectable,
|
|
27
|
+
isFocussed,
|
|
26
28
|
selectionTooltip,
|
|
27
29
|
rowActionLocation
|
|
28
30
|
} = row;
|
|
@@ -33,11 +35,13 @@ function getRowProps(row, headers, isFlexibleColumns, isSelectionEnabled, rowCur
|
|
|
33
35
|
rowActionLocation,
|
|
34
36
|
isSelected,
|
|
35
37
|
isSelectable,
|
|
38
|
+
isFocussed,
|
|
36
39
|
selectionTooltip,
|
|
37
40
|
isFlexibleColumns,
|
|
38
41
|
isSelectionEnabled,
|
|
39
42
|
cursor: rowCursor,
|
|
40
43
|
hasActions: hasRowActions,
|
|
44
|
+
isKeyboardControlsEnabled,
|
|
41
45
|
rowActionsColumnWidth
|
|
42
46
|
};
|
|
43
47
|
}
|
package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/HeaderData.js
CHANGED
|
@@ -4,7 +4,9 @@ import TableHeading from '@zohodesk-private/desk-components/es/table/TableHeadin
|
|
|
4
4
|
import { AlignmentOfFlex } from "../../../../../../../../cc/table-list/data-types/Header";
|
|
5
5
|
import ActionEventMediator from "../../../../../../../../platform/client-actions/components/action-event-mediator/frameworks/ui/ActionEventMediator";
|
|
6
6
|
import { ActionViewGap } from "../../../../../../../../platform/client-actions/components/interfaces/ActionViewModel";
|
|
7
|
-
import ColumnResizer from "./ColumnResizer";
|
|
7
|
+
import ColumnResizer from "./ColumnResizer"; // @ts-ignore
|
|
8
|
+
|
|
9
|
+
import style from "./../../css/TableList.module.css";
|
|
8
10
|
|
|
9
11
|
function HeaderData(_ref) {
|
|
10
12
|
let {
|
|
@@ -39,7 +41,10 @@ function HeaderData(_ref) {
|
|
|
39
41
|
$ui_displayMode: 'flex',
|
|
40
42
|
$ui_alignItems: 'center',
|
|
41
43
|
$ui_justifyContent: AlignmentOfFlex[alignment]
|
|
42
|
-
} : null
|
|
44
|
+
} : null,
|
|
45
|
+
customStyle: hasActions ? {
|
|
46
|
+
tableHead: style.headerWithActions
|
|
47
|
+
} : undefined
|
|
43
48
|
}, /*#__PURE__*/React.createElement(TableHeading, {
|
|
44
49
|
$i18n_text: text
|
|
45
50
|
}), hasActions ? /*#__PURE__*/React.createElement(ActionEventMediator, {
|
package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/MassAction.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import TableHeadFirstNode from '@zohodesk-private/desk-components/es/table/TableHeadFirstNode/TableHeadFirstNode';
|
|
3
|
+
import TableHeading from '@zohodesk-private/desk-components/es/table/TableHeading/TableHeading';
|
|
4
|
+
import ActionEventMediator from "../../../../../../../../platform/client-actions/components/action-event-mediator/frameworks/ui/ActionEventMediator";
|
|
5
|
+
|
|
6
|
+
function MassAction(_ref) {
|
|
7
|
+
let {
|
|
8
|
+
isSelectionEnabled,
|
|
9
|
+
actions
|
|
10
|
+
} = _ref;
|
|
11
|
+
|
|
12
|
+
if (!isSelectionEnabled) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
if (!actions || actions.length === 0) {
|
|
17
|
+
return /*#__PURE__*/React.createElement(TableHeadFirstNode, null, /*#__PURE__*/React.createElement(TableHeading, {
|
|
18
|
+
$i18n_text: "M/A",
|
|
19
|
+
$i18n_tooltip: "Mass Action"
|
|
20
|
+
}));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return /*#__PURE__*/React.createElement(TableHeadFirstNode, null, /*#__PURE__*/React.createElement(ActionEventMediator, {
|
|
24
|
+
actions: actions
|
|
25
|
+
}));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default MassAction;
|
|
@@ -22,6 +22,8 @@ function RowView(_ref, ref) {
|
|
|
22
22
|
isSelectionEnabled,
|
|
23
23
|
isSelected,
|
|
24
24
|
isSelectable,
|
|
25
|
+
isKeyboardControlsEnabled,
|
|
26
|
+
isFocussed,
|
|
25
27
|
selectionTooltip
|
|
26
28
|
} = state.properties;
|
|
27
29
|
const {
|
|
@@ -42,6 +44,9 @@ function RowView(_ref, ref) {
|
|
|
42
44
|
ref: ref,
|
|
43
45
|
testId: id,
|
|
44
46
|
$flag_padding: !isSelectionEnabled,
|
|
47
|
+
$flag_active: isSelected,
|
|
48
|
+
$flag_hasHighlighter: isKeyboardControlsEnabled,
|
|
49
|
+
$flag_isHighlighted: isFocussed,
|
|
45
50
|
$event_onClick: () => dispatch({
|
|
46
51
|
type: TableRowConstants.TABLE_ROW_CLICKED,
|
|
47
52
|
payload: {
|
|
@@ -3,7 +3,9 @@ import TableData from '@zohodesk-private/desk-components/es/table/TableData/Tabl
|
|
|
3
3
|
import ActionEventMediator from "../../../../../../../../platform/client-actions/components/action-event-mediator/frameworks/ui/ActionEventMediator";
|
|
4
4
|
import { ActionViewGap } from "../../../../../../../../platform/client-actions/components/interfaces/ActionViewModel";
|
|
5
5
|
import { AlignmentOfFlex } from "../../../../../../../../cc/table-list/data-types/Header";
|
|
6
|
-
import FieldComponent from "../field/FieldComponent";
|
|
6
|
+
import FieldComponent from "../field/FieldComponent"; // @ts-ignore
|
|
7
|
+
|
|
8
|
+
import style from "./../../css/TableList.module.css";
|
|
7
9
|
export default function RowData(_ref) {
|
|
8
10
|
let {
|
|
9
11
|
field,
|
|
@@ -25,7 +27,10 @@ export default function RowData(_ref) {
|
|
|
25
27
|
$ui_displayMode: 'flex',
|
|
26
28
|
$ui_alignItems: 'center',
|
|
27
29
|
$ui_justifyContent: AlignmentOfFlex[alignment]
|
|
28
|
-
} : null
|
|
30
|
+
} : null,
|
|
31
|
+
customStyle: hasActions ? {
|
|
32
|
+
tableData: style.fieldWithActions
|
|
33
|
+
} : undefined
|
|
29
34
|
}, /*#__PURE__*/React.createElement(FieldComponent, {
|
|
30
35
|
type: type,
|
|
31
36
|
fieldProps: props
|
package/es/library/dot/legacy-to-new-arch/table-column-chooser/frameworks/ui/TableColumnChooser.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createCustomComponent } from "../../../../../custom-component";
|
|
2
|
+
import { TableColumnChooserProperties } from "../../../../../../cc/table-column-chooser";
|
|
3
|
+
import TableColumnChooserView from "./TableColumnChooserView";
|
|
4
|
+
const TableColumnChooser = createCustomComponent({
|
|
5
|
+
name: 'TableColumnChooser',
|
|
6
|
+
View: TableColumnChooserView,
|
|
7
|
+
properties: TableColumnChooserProperties,
|
|
8
|
+
events: [],
|
|
9
|
+
eventHandlers: {}
|
|
10
|
+
});
|
|
11
|
+
export default TableColumnChooser;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/* eslint-disable max-lines-per-function */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import ColumnChooser from '@zohodesk-private/desk-components/es/ColumnChooser/ColumnChooser';
|
|
4
|
+
import { TableColumnChooserConstants } from "../../../../../../cc/table-column-chooser";
|
|
5
|
+
|
|
6
|
+
function TableColumnChooserView(_ref, ref) {
|
|
7
|
+
let {
|
|
8
|
+
state,
|
|
9
|
+
helpers
|
|
10
|
+
} = _ref;
|
|
11
|
+
const {
|
|
12
|
+
dispatch
|
|
13
|
+
} = helpers;
|
|
14
|
+
const {
|
|
15
|
+
options,
|
|
16
|
+
tooltip,
|
|
17
|
+
heading,
|
|
18
|
+
infoText,
|
|
19
|
+
hasSearch,
|
|
20
|
+
searchString,
|
|
21
|
+
searchPlaceholder
|
|
22
|
+
} = state.properties;
|
|
23
|
+
const {
|
|
24
|
+
emptyMessage,
|
|
25
|
+
errorMessage,
|
|
26
|
+
saveLabel,
|
|
27
|
+
cancelLabel
|
|
28
|
+
} = state.properties;
|
|
29
|
+
return /*#__PURE__*/React.createElement(ColumnChooser, {
|
|
30
|
+
options: options,
|
|
31
|
+
getRef: ref,
|
|
32
|
+
tooltip: tooltip,
|
|
33
|
+
heading: heading,
|
|
34
|
+
infoText: infoText,
|
|
35
|
+
emptyMessage: emptyMessage,
|
|
36
|
+
getHelperContainer: () => document.querySelector('[data-id="table"]'),
|
|
37
|
+
hasSearch: hasSearch,
|
|
38
|
+
searchString: searchString,
|
|
39
|
+
searchPlacholder: searchPlaceholder,
|
|
40
|
+
onSearch: searchString => dispatch({
|
|
41
|
+
type: TableColumnChooserConstants.COLUMN_CHOOSER_SEARCH_REQUESTED,
|
|
42
|
+
payload: {
|
|
43
|
+
searchString
|
|
44
|
+
}
|
|
45
|
+
}),
|
|
46
|
+
onClearSearch: () => dispatch({
|
|
47
|
+
type: TableColumnChooserConstants.COLUMN_CHOOSER_SEARCH_REQUESTED,
|
|
48
|
+
payload: {
|
|
49
|
+
searchString: ''
|
|
50
|
+
}
|
|
51
|
+
}),
|
|
52
|
+
onOpen: () => dispatch({
|
|
53
|
+
type: TableColumnChooserConstants.COLUMN_CHOOSER_OPEN_REQUESTED
|
|
54
|
+
}),
|
|
55
|
+
onClose: () => dispatch({
|
|
56
|
+
type: TableColumnChooserConstants.COLUMN_CHOOSER_CLOSE_REQUESTED
|
|
57
|
+
}),
|
|
58
|
+
onSelect: data => dispatch({
|
|
59
|
+
type: TableColumnChooserConstants.COLUMN_CHOOSER_SELECT_REQUESTED,
|
|
60
|
+
payload: {
|
|
61
|
+
data
|
|
62
|
+
}
|
|
63
|
+
}),
|
|
64
|
+
onReorder: reOrderedIndex => dispatch({
|
|
65
|
+
type: TableColumnChooserConstants.COLUMN_CHOOSER_REORDER_REQUESTED,
|
|
66
|
+
payload: {
|
|
67
|
+
reOrderedIndex
|
|
68
|
+
}
|
|
69
|
+
}),
|
|
70
|
+
onSave: () => dispatch({
|
|
71
|
+
type: TableColumnChooserConstants.COLUMN_CHOOSER_SAVE_REQUESTED
|
|
72
|
+
}),
|
|
73
|
+
errorMessage: errorMessage,
|
|
74
|
+
saveLabel: saveLabel,
|
|
75
|
+
cancelLabel: cancelLabel
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export default TableColumnChooserView;
|
package/es/library/dot/legacy-to-new-arch/table-column-filter/frameworks/ui/TableColumnFilterView.js
CHANGED
|
@@ -66,6 +66,11 @@ function TableColumnFilterView(_ref, ref) {
|
|
|
66
66
|
$tagAttributes_container: {
|
|
67
67
|
ref: ref
|
|
68
68
|
},
|
|
69
|
+
$customProps_dropbox: {
|
|
70
|
+
customClass: {
|
|
71
|
+
customDropBoxWrap: style.filterDropbox
|
|
72
|
+
}
|
|
73
|
+
},
|
|
69
74
|
customStyle: {
|
|
70
75
|
container: `${style.container} ${(isMultiSelect ? Array.isArray(selectedOptions) && selectedOptions.length > 0 : selectedOptions && Object.keys(selectedOptions).length > 0) ? style.active : ''}`
|
|
71
76
|
}
|
|
@@ -4,8 +4,12 @@
|
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
:global(.GLOBAL_ZDDC_tableHead:hover) .container,
|
|
7
|
-
:global(.GLOBAL_ZDDC_tableHead:has(
|
|
7
|
+
:global(.GLOBAL_ZDDC_tableHead):has(.filterDropbox) .container,
|
|
8
8
|
.active {
|
|
9
9
|
visibility: visible;
|
|
10
10
|
opacity: 1;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.filterDropbox {
|
|
14
|
+
/* ** */
|
|
11
15
|
}
|
|
@@ -4,8 +4,12 @@
|
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
:global(.GLOBAL_ZDDC_tableHead:hover) .parentContainer,
|
|
7
|
-
:global(.GLOBAL_ZDDC_tableHead:has(
|
|
7
|
+
:global(.GLOBAL_ZDDC_tableHead):has(.sortDropbox) .parentContainer,
|
|
8
8
|
.active {
|
|
9
9
|
visibility: visible;
|
|
10
10
|
opacity: 1;
|
|
11
11
|
}
|
|
12
|
+
|
|
13
|
+
.sortDropbox {
|
|
14
|
+
/** **/
|
|
15
|
+
}
|
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import Link from "../../../../link/frameworks/ui/Link";
|
|
3
3
|
export function LookupFieldView(_ref, ref) {
|
|
4
4
|
let {
|
|
5
5
|
state
|
|
6
6
|
} = _ref;
|
|
7
7
|
const {
|
|
8
8
|
name,
|
|
9
|
-
|
|
9
|
+
url
|
|
10
10
|
} = state.properties.value;
|
|
11
|
-
return /*#__PURE__*/React.createElement(
|
|
11
|
+
return /*#__PURE__*/React.createElement(Link, {
|
|
12
12
|
getRef: ref,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
imageURL: photoURL,
|
|
17
|
-
tooltip: name
|
|
13
|
+
label: name,
|
|
14
|
+
variant: "secondary",
|
|
15
|
+
href: url
|
|
18
16
|
});
|
|
19
17
|
}
|
|
@@ -17,7 +17,7 @@ function RowActionsRendererView(_ref, ref) {
|
|
|
17
17
|
ref: ref,
|
|
18
18
|
$ui_displayMode: "inline",
|
|
19
19
|
$ui_alignItems: "center",
|
|
20
|
-
$ui_className: `${
|
|
20
|
+
$ui_className: `${gap !== ActionViewGap.NONE ? style[`gap_${gap}`] : ''}`
|
|
21
21
|
}, actions.map((action, index) => {
|
|
22
22
|
return /*#__PURE__*/React.createElement(DynamicActionComponent, {
|
|
23
23
|
action: action,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import AbstractController from "./AbstractController";
|
|
2
|
+
|
|
3
|
+
class ColumnChooserCloseController extends AbstractController {
|
|
4
|
+
handle(event) {
|
|
5
|
+
const {
|
|
6
|
+
state,
|
|
7
|
+
updateState,
|
|
8
|
+
dispatch
|
|
9
|
+
} = event;
|
|
10
|
+
const {
|
|
11
|
+
columnChooserCloseUseCase
|
|
12
|
+
} = this.service;
|
|
13
|
+
columnChooserCloseUseCase.updateDependencies(state, updateState);
|
|
14
|
+
columnChooserCloseUseCase.execute({
|
|
15
|
+
dispatch
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export default ColumnChooserCloseController;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import AbstractController from "./AbstractController";
|
|
2
|
+
|
|
3
|
+
class ColumnChooserOpenController extends AbstractController {
|
|
4
|
+
handle(event) {
|
|
5
|
+
const {
|
|
6
|
+
state,
|
|
7
|
+
action,
|
|
8
|
+
updateState
|
|
9
|
+
} = event;
|
|
10
|
+
const {
|
|
11
|
+
order,
|
|
12
|
+
selectedArray
|
|
13
|
+
} = action.payload;
|
|
14
|
+
const {
|
|
15
|
+
columnChooserOpenUseCase
|
|
16
|
+
} = this.service;
|
|
17
|
+
columnChooserOpenUseCase.updateDependencies(state, updateState);
|
|
18
|
+
columnChooserOpenUseCase.execute({
|
|
19
|
+
order,
|
|
20
|
+
selectedArray
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export default ColumnChooserOpenController;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import AbstractController from "./AbstractController";
|
|
2
|
+
|
|
3
|
+
class ColumnChooserReorderController extends AbstractController {
|
|
4
|
+
handle(event) {
|
|
5
|
+
const {
|
|
6
|
+
state,
|
|
7
|
+
action,
|
|
8
|
+
updateState
|
|
9
|
+
} = event;
|
|
10
|
+
const {
|
|
11
|
+
oldIndex: fromIndex,
|
|
12
|
+
newIndex: toIndex
|
|
13
|
+
} = action.payload.reOrderedIndex;
|
|
14
|
+
const {
|
|
15
|
+
columnChooserReorderUseCase
|
|
16
|
+
} = this.service;
|
|
17
|
+
columnChooserReorderUseCase.updateDependencies(state, updateState);
|
|
18
|
+
columnChooserReorderUseCase.execute({
|
|
19
|
+
fromIndex,
|
|
20
|
+
toIndex
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export default ColumnChooserReorderController;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import AbstractController from "./AbstractController";
|
|
2
|
+
|
|
3
|
+
class ColumnChooserSaveController extends AbstractController {
|
|
4
|
+
handle(event) {
|
|
5
|
+
const {
|
|
6
|
+
state,
|
|
7
|
+
updateState,
|
|
8
|
+
dispatch
|
|
9
|
+
} = event;
|
|
10
|
+
const {
|
|
11
|
+
columnChooserSaveUseCase
|
|
12
|
+
} = this.service;
|
|
13
|
+
columnChooserSaveUseCase.updateDependencies(state, updateState);
|
|
14
|
+
columnChooserSaveUseCase.execute({
|
|
15
|
+
dispatch
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export default ColumnChooserSaveController;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import AbstractController from "./AbstractController";
|
|
2
|
+
|
|
3
|
+
class ColumnChooserSearchController extends AbstractController {
|
|
4
|
+
handle(event) {
|
|
5
|
+
const {
|
|
6
|
+
state,
|
|
7
|
+
action,
|
|
8
|
+
updateState
|
|
9
|
+
} = event;
|
|
10
|
+
const {
|
|
11
|
+
searchString: searchText
|
|
12
|
+
} = action.payload;
|
|
13
|
+
const {
|
|
14
|
+
columnChooserSearchUseCase
|
|
15
|
+
} = this.service;
|
|
16
|
+
columnChooserSearchUseCase.updateDependencies(state, updateState);
|
|
17
|
+
columnChooserSearchUseCase.execute({
|
|
18
|
+
searchText
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export default ColumnChooserSearchController;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import AbstractController from "./AbstractController";
|
|
2
|
+
|
|
3
|
+
class ColumnChooserSelectController extends AbstractController {
|
|
4
|
+
handle(event) {
|
|
5
|
+
const {
|
|
6
|
+
state,
|
|
7
|
+
action,
|
|
8
|
+
updateState
|
|
9
|
+
} = event;
|
|
10
|
+
const {
|
|
11
|
+
id: columnId,
|
|
12
|
+
isChecked
|
|
13
|
+
} = action.payload.data;
|
|
14
|
+
const {
|
|
15
|
+
columnChooserSelectUseCase
|
|
16
|
+
} = this.service;
|
|
17
|
+
columnChooserSelectUseCase.updateDependencies(state, updateState);
|
|
18
|
+
columnChooserSelectUseCase.execute({
|
|
19
|
+
columnId,
|
|
20
|
+
isChecked
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export default ColumnChooserSelectController;
|