@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
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { SMART_TABLE_ACTION_TRIGGERED, SMART_TABLE_SELECTION_TOGGLED } from "../../../../../cc/table-connected/constants/Events";
|
|
2
|
+
|
|
3
|
+
class KeyboardControls {
|
|
4
|
+
constructor(focussedIndex, totalLists) {
|
|
5
|
+
this.focussedIndex = focussedIndex;
|
|
6
|
+
this.totalLists = totalLists;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
setFocussedIndex(index) {
|
|
10
|
+
this.focussedIndex = index;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
getFocussedIndex() {
|
|
14
|
+
return this.focussedIndex;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
focusPrevious() {
|
|
18
|
+
if (this.focussedIndex > 0) {
|
|
19
|
+
this.focussedIndex -= 1;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
focusNext() {
|
|
24
|
+
if (this.totalLists > 1 && this.focussedIndex < this.totalLists - 1) {
|
|
25
|
+
this.focussedIndex += 1;
|
|
26
|
+
}
|
|
27
|
+
} // focusPrevious(): void {
|
|
28
|
+
// if (this.focussedIndex > 0) {
|
|
29
|
+
// this.focussedIndex -= 1;
|
|
30
|
+
// } else if (this.focussedIndex === 0 && this.totalLists > 1) {
|
|
31
|
+
// this.focussedIndex = this.totalLists - 1;
|
|
32
|
+
// }
|
|
33
|
+
// }
|
|
34
|
+
// focusNext(): void {
|
|
35
|
+
// if ((this.totalLists > 1) && (this.focussedIndex <= this.totalLists - 1)) {
|
|
36
|
+
// if (this.focussedIndex >= this.totalLists - 1) {
|
|
37
|
+
// this.focussedIndex = 0;
|
|
38
|
+
// } else {
|
|
39
|
+
// this.focussedIndex += 1;
|
|
40
|
+
// }
|
|
41
|
+
// }
|
|
42
|
+
// }
|
|
43
|
+
// getPreviousFocusEvent(event: KeyboardEvent): EventModel {
|
|
44
|
+
// return {
|
|
45
|
+
// type: SMART_TABLE_PREVIOUS_FOCUS,
|
|
46
|
+
// payload: {
|
|
47
|
+
// event
|
|
48
|
+
// }
|
|
49
|
+
// }
|
|
50
|
+
// }
|
|
51
|
+
// getNextFocusEvent(event: KeyboardEvent): EventModel {
|
|
52
|
+
// return {
|
|
53
|
+
// type: SMART_TABLE_NEXT_FOCUS,
|
|
54
|
+
// payload: {
|
|
55
|
+
// event
|
|
56
|
+
// }
|
|
57
|
+
// }
|
|
58
|
+
// }
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
getSelectionEvent(event) {
|
|
62
|
+
return {
|
|
63
|
+
type: SMART_TABLE_SELECTION_TOGGLED,
|
|
64
|
+
payload: {
|
|
65
|
+
event
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
getClickActionEvent(event) {
|
|
71
|
+
return {
|
|
72
|
+
type: SMART_TABLE_ACTION_TRIGGERED,
|
|
73
|
+
payload: {
|
|
74
|
+
event
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
toObject() {
|
|
80
|
+
return {
|
|
81
|
+
focussedIndex: this.focussedIndex
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export default KeyboardControls;
|
package/es/library/behaviours/keyboard-controls/domain/entities/interface/IKeyboardControls.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/es/library/behaviours/keyboard-controls/domain/entities/interface/KeyboardControlModel.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { KEYBOARD_CONTROL_DOWN_ARROW_PRESSED, KEYBOARD_CONTROL_ENTER_PRESSED, KEYBOARD_CONTROL_SPACE_PRESSED, KEYBOARD_CONTROL_UP_ARROW_PRESSED } from "../../../../bc/keyboard-controls/Constants";
|
|
2
|
+
import UpArrowPressController from "../adapters/controllers/UpArrowPressController";
|
|
3
|
+
import DownArrowPressController from "../adapters/controllers/DownArrowPressController";
|
|
4
|
+
import SpacePressController from "../adapters/controllers/SpacePressController";
|
|
5
|
+
import EnterPressController from "../adapters/controllers/EnterPressController";
|
|
6
|
+
import Service from "../adapters/gateways/Service";
|
|
7
|
+
import Repository from "../adapters/gateways/Repository";
|
|
8
|
+
import Presenter from "../adapters/presenters/Presenter";
|
|
9
|
+
import KeyboardHandler from "../adapters/gateways/KeyboardHandler"; // import FocusPreviousController from "../adapters/controllers/FocusPreviousController";
|
|
10
|
+
// import FocusNextController from "../adapters/controllers/FocusNextController";
|
|
11
|
+
|
|
12
|
+
import LifeCycleAction from "../../../../cc/architecture/LifeCycleActionEnum";
|
|
13
|
+
import InitializeController from "../adapters/controllers/InitializeController";
|
|
14
|
+
import DestructController from "../adapters/controllers/DestructController";
|
|
15
|
+
|
|
16
|
+
class EventHandlerFactory {
|
|
17
|
+
static create() {
|
|
18
|
+
const service = this.createService();
|
|
19
|
+
return this.createHandlers(service);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
static createService() {
|
|
23
|
+
const repository = new Repository();
|
|
24
|
+
const presenter = new Presenter();
|
|
25
|
+
const keyboardHandler = new KeyboardHandler();
|
|
26
|
+
return new Service({
|
|
27
|
+
repository: repository,
|
|
28
|
+
presenter,
|
|
29
|
+
keyboardHandler
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
static createHandlers(service) {
|
|
34
|
+
return {
|
|
35
|
+
[LifeCycleAction.MOUNT]: new InitializeController(service).handle,
|
|
36
|
+
[LifeCycleAction.UN_MOUNT]: new DestructController(service).handle,
|
|
37
|
+
// [SMART_TABLE_PREVIOUS_FOCUS]: new FocusPreviousController(service).handle,
|
|
38
|
+
// [SMART_TABLE_NEXT_FOCUS]: new FocusNextController(service).handle,
|
|
39
|
+
[KEYBOARD_CONTROL_UP_ARROW_PRESSED]: new UpArrowPressController(service).handle,
|
|
40
|
+
[KEYBOARD_CONTROL_DOWN_ARROW_PRESSED]: new DownArrowPressController(service).handle,
|
|
41
|
+
[KEYBOARD_CONTROL_SPACE_PRESSED]: new SpacePressController(service).handle,
|
|
42
|
+
[KEYBOARD_CONTROL_ENTER_PRESSED]: new EnterPressController(service).handle
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export default EventHandlerFactory;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import EventHandlerFactory from "./EventHandlerFactory";
|
|
2
|
+
import events from "../../../../bc/keyboard-controls/Events";
|
|
3
|
+
import properties from "../../../../bc/keyboard-controls/Properties";
|
|
4
|
+
|
|
5
|
+
class KeyboardControlBehaviourFactory {
|
|
6
|
+
static create() {
|
|
7
|
+
return {
|
|
8
|
+
name: 'keyboardControls',
|
|
9
|
+
setInitialState: () => {
|
|
10
|
+
return {
|
|
11
|
+
focussedIndex: 0,
|
|
12
|
+
totalLists: 0
|
|
13
|
+
};
|
|
14
|
+
},
|
|
15
|
+
eventHandlers: EventHandlerFactory.create(),
|
|
16
|
+
events,
|
|
17
|
+
properties
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export default KeyboardControlBehaviourFactory;
|
|
@@ -3,6 +3,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
3
3
|
import Property from "./Property";
|
|
4
4
|
import defaultAppendToActionPayload from "./DefaultAppendToActionPayload";
|
|
5
5
|
import getRefPropertySchema from "../../../../cc/component/properties/getRefPropertySchema";
|
|
6
|
+
import defaultSlotNameAppend from "./DefaultSlotNameAppend";
|
|
6
7
|
export default class Properties {
|
|
7
8
|
constructor(properties, componentName) {
|
|
8
9
|
this.componentName = componentName;
|
|
@@ -12,6 +13,7 @@ export default class Properties {
|
|
|
12
13
|
this.data = properties;
|
|
13
14
|
this.data.set('appendToActionPayload', new Property(defaultAppendToActionPayload));
|
|
14
15
|
this.data.set('getRef', new Property(getRefPropertySchema));
|
|
16
|
+
typeof properties.get("slotName") === "undefined" && this.data.set('slotName', new Property(defaultSlotNameAppend));
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
getAllPropertiesValue() {
|
|
@@ -3,9 +3,18 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
3
3
|
import React, { forwardRef } from 'react';
|
|
4
4
|
import DependencyFactory from "./DependencyFactory";
|
|
5
5
|
import Compare from "./Compare";
|
|
6
|
+
import { generateSlotChildren } from "./CreateSlotComponent";
|
|
7
|
+
|
|
8
|
+
function discardChildren(props) {
|
|
9
|
+
const newObject = { ...props
|
|
10
|
+
};
|
|
11
|
+
delete newObject.children;
|
|
12
|
+
return newObject;
|
|
13
|
+
}
|
|
6
14
|
/* eslint-disable max-lines-per-function */
|
|
7
15
|
// TODO: Refactor this function to reduce the number of lines
|
|
8
16
|
|
|
17
|
+
|
|
9
18
|
const createCustomComponent = input => {
|
|
10
19
|
class Component extends React.Component {
|
|
11
20
|
constructor(props) {
|
|
@@ -55,7 +64,7 @@ const createCustomComponent = input => {
|
|
|
55
64
|
dispatch: dispatch.bind(controller)
|
|
56
65
|
};
|
|
57
66
|
this.controller.initialize({ ...input,
|
|
58
|
-
newProps: props,
|
|
67
|
+
newProps: discardChildren(props),
|
|
59
68
|
helpers: this.helpers
|
|
60
69
|
});
|
|
61
70
|
let proptypes = input.View.propTypes;
|
|
@@ -70,7 +79,7 @@ const createCustomComponent = input => {
|
|
|
70
79
|
}
|
|
71
80
|
|
|
72
81
|
shouldComponentUpdate(nextProps, nextState) {
|
|
73
|
-
return !Compare.deepEqual(this.props, nextProps) || !Compare.deepEqual(this.state, nextState); // return true;
|
|
82
|
+
return !Compare.deepEqual(discardChildren(this.props), discardChildren(nextProps)) || !Compare.deepEqual(this.state, nextState); // return true;
|
|
74
83
|
}
|
|
75
84
|
|
|
76
85
|
componentWillUnmount() {
|
|
@@ -82,7 +91,7 @@ const createCustomComponent = input => {
|
|
|
82
91
|
}
|
|
83
92
|
|
|
84
93
|
componentWillReceiveProps(nextProps, nextContext) {
|
|
85
|
-
this.controller.updateProperties(nextProps);
|
|
94
|
+
this.controller.updateProperties(discardChildren(nextProps));
|
|
86
95
|
}
|
|
87
96
|
|
|
88
97
|
componentDidUpdate() {// this.controller.updateProperties(this.props);
|
|
@@ -90,6 +99,10 @@ const createCustomComponent = input => {
|
|
|
90
99
|
|
|
91
100
|
render() {
|
|
92
101
|
let View = this.View;
|
|
102
|
+
let {
|
|
103
|
+
slots,
|
|
104
|
+
children
|
|
105
|
+
} = this.props;
|
|
93
106
|
|
|
94
107
|
if (this.state.error) {
|
|
95
108
|
if (__TEST__) {
|
|
@@ -113,7 +126,8 @@ const createCustomComponent = input => {
|
|
|
113
126
|
this.props.getRef && this.props.getRef(element);
|
|
114
127
|
},
|
|
115
128
|
helpers: this.helpers,
|
|
116
|
-
state: this.state
|
|
129
|
+
state: this.state,
|
|
130
|
+
slotChildren: generateSlotChildren(slots, children)
|
|
117
131
|
});
|
|
118
132
|
}
|
|
119
133
|
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import React, { Children } from "react";
|
|
2
|
+
import ComponentRegistry from "./ComponentRegistry";
|
|
3
|
+
|
|
4
|
+
/*
|
|
5
|
+
Enhancements
|
|
6
|
+
1.Without named slot handling
|
|
7
|
+
2.Warning error for component name wrong
|
|
8
|
+
3.Change createSlotComponent with react-dep and add into domatin,entities,usecases way of impl
|
|
9
|
+
4.UAT
|
|
10
|
+
*/
|
|
11
|
+
export function generateSlotChildren() {
|
|
12
|
+
let slots = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
13
|
+
let children = arguments.length > 1 ? arguments[1] : undefined;
|
|
14
|
+
let slotChildren = {},
|
|
15
|
+
slotChildrenMap = {};
|
|
16
|
+
Children.forEach(children, child => {
|
|
17
|
+
if (typeof child.type === "function" && child.props && child.props.slotName) {
|
|
18
|
+
const {
|
|
19
|
+
slotName
|
|
20
|
+
} = child.props;
|
|
21
|
+
const displayName = child.type.displayName;
|
|
22
|
+
slotChildrenMap[slotName] = slotChildrenMap[slotName] || {};
|
|
23
|
+
slotChildrenMap[slotName][displayName] = {
|
|
24
|
+
props: child.props,
|
|
25
|
+
type: child.type
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
slots.map(slot => {
|
|
30
|
+
const {
|
|
31
|
+
name,
|
|
32
|
+
elements
|
|
33
|
+
} = slot;
|
|
34
|
+
slotChildren[name] = [];
|
|
35
|
+
elements.map((element, index) => {
|
|
36
|
+
const {
|
|
37
|
+
type,
|
|
38
|
+
name: elementName,
|
|
39
|
+
styles,
|
|
40
|
+
slots,
|
|
41
|
+
properties = {}
|
|
42
|
+
} = element;
|
|
43
|
+
const {
|
|
44
|
+
props: childProps = {},
|
|
45
|
+
type: ChildType
|
|
46
|
+
} = (slotChildrenMap[name] || {})[`Custom(${elementName})`] || {};
|
|
47
|
+
let View = ComponentRegistry.get(type) || ChildType;
|
|
48
|
+
let finalisedProps = { ...properties,
|
|
49
|
+
...childProps
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
if (styles) {
|
|
53
|
+
finalisedProps.styles = styles;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (slots) {
|
|
57
|
+
finalisedProps.slots = slots;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (View) {
|
|
61
|
+
slotChildren[name].push( /*#__PURE__*/React.createElement(View, { ...finalisedProps,
|
|
62
|
+
key: `${name}_${elementName}_${index}`
|
|
63
|
+
}, childProps.children));
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
return slotChildren;
|
|
68
|
+
}
|
|
69
|
+
/*export default function createSlotComponent(slotShape: Slot, children: any): any {
|
|
70
|
+
let {elements} = slotShape;
|
|
71
|
+
let finalElements = elements.map((element) => {
|
|
72
|
+
let {
|
|
73
|
+
type,
|
|
74
|
+
styles = {},
|
|
75
|
+
slots = [],
|
|
76
|
+
properties={}
|
|
77
|
+
} = element;
|
|
78
|
+
let View = ComponentRegistry.get(type);
|
|
79
|
+
if(View) {
|
|
80
|
+
return (<View
|
|
81
|
+
{...properties}
|
|
82
|
+
styles={styles}
|
|
83
|
+
slots={slots}
|
|
84
|
+
/>)
|
|
85
|
+
}
|
|
86
|
+
return null
|
|
87
|
+
});
|
|
88
|
+
return finalElements
|
|
89
|
+
}*/
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
/* eslint-disable react/prop-types */
|
|
2
|
+
import React, { Component } from "react";
|
|
3
|
+
import createCustomComponent from "../CreateCustomComponent.tsx";
|
|
4
|
+
import ComponentRegistry from "../ComponentRegistry";
|
|
5
|
+
import { render, cleanup } from '@testing-library/react';
|
|
6
|
+
import '@testing-library/jest-dom';
|
|
7
|
+
const Parent = createCustomComponent({
|
|
8
|
+
name: "parent",
|
|
9
|
+
View: (_ref, ref) => {
|
|
10
|
+
let {
|
|
11
|
+
slotChildren
|
|
12
|
+
} = _ref;
|
|
13
|
+
const {
|
|
14
|
+
child = null,
|
|
15
|
+
siblingChild = null
|
|
16
|
+
} = slotChildren;
|
|
17
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
18
|
+
ref: ref
|
|
19
|
+
}, "Hi, I am the Parent.", /*#__PURE__*/React.createElement("div", null, child), /*#__PURE__*/React.createElement("div", null, siblingChild));
|
|
20
|
+
},
|
|
21
|
+
properties: {
|
|
22
|
+
slots: {
|
|
23
|
+
required: false,
|
|
24
|
+
typeMetadata: {
|
|
25
|
+
schema: {
|
|
26
|
+
type: "array"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
eventHandlers: {}
|
|
32
|
+
});
|
|
33
|
+
const Child = createCustomComponent({
|
|
34
|
+
name: "child",
|
|
35
|
+
View: (_ref2, ref) => {
|
|
36
|
+
let {
|
|
37
|
+
slotChildren
|
|
38
|
+
} = _ref2;
|
|
39
|
+
const {
|
|
40
|
+
nestedChildren = null
|
|
41
|
+
} = slotChildren;
|
|
42
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
43
|
+
ref: ref
|
|
44
|
+
}, "Hi, I am the Child.", /*#__PURE__*/React.createElement("div", null, nestedChildren));
|
|
45
|
+
},
|
|
46
|
+
eventHandlers: {},
|
|
47
|
+
properties: {
|
|
48
|
+
slots: {
|
|
49
|
+
required: false,
|
|
50
|
+
typeMetadata: {
|
|
51
|
+
schema: {
|
|
52
|
+
type: "array"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
const SiblingChild = createCustomComponent({
|
|
59
|
+
name: "siblingChild",
|
|
60
|
+
View: (props, ref) => {
|
|
61
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
62
|
+
ref: ref
|
|
63
|
+
}, "Hi, I am the sibling Child.");
|
|
64
|
+
},
|
|
65
|
+
eventHandlers: {},
|
|
66
|
+
properties: {}
|
|
67
|
+
});
|
|
68
|
+
const NestedChild = createCustomComponent({
|
|
69
|
+
name: "nestedChild",
|
|
70
|
+
View: (_, ref) => {
|
|
71
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
72
|
+
ref: ref
|
|
73
|
+
}, "Hi, I am the nested Child.");
|
|
74
|
+
},
|
|
75
|
+
eventHandlers: {},
|
|
76
|
+
properties: {}
|
|
77
|
+
});
|
|
78
|
+
const NoSlotName = createCustomComponent({
|
|
79
|
+
name: "noSlotName",
|
|
80
|
+
View: (_, ref) => {
|
|
81
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
82
|
+
ref: ref
|
|
83
|
+
}, "Hi, It should not be rendered.");
|
|
84
|
+
},
|
|
85
|
+
eventHandlers: {},
|
|
86
|
+
properties: {}
|
|
87
|
+
});
|
|
88
|
+
ComponentRegistry.register("Parent", Parent);
|
|
89
|
+
ComponentRegistry.register("Child", Child);
|
|
90
|
+
ComponentRegistry.register("SiblingChild", SiblingChild);
|
|
91
|
+
describe("Slot Integration test suite", () => {
|
|
92
|
+
beforeEach(() => {
|
|
93
|
+
jest.clearAllMocks();
|
|
94
|
+
cleanup();
|
|
95
|
+
});
|
|
96
|
+
it("slot Information passed to parent and check children rendering", () => {
|
|
97
|
+
const slots = [{
|
|
98
|
+
name: "child",
|
|
99
|
+
elements: [{
|
|
100
|
+
name: "child",
|
|
101
|
+
type: "Child"
|
|
102
|
+
}]
|
|
103
|
+
}];
|
|
104
|
+
const {
|
|
105
|
+
getByText
|
|
106
|
+
} = render( /*#__PURE__*/React.createElement(Parent, {
|
|
107
|
+
slots: slots
|
|
108
|
+
}, /*#__PURE__*/React.createElement(Child, {
|
|
109
|
+
slotName: "child"
|
|
110
|
+
})));
|
|
111
|
+
const component = getByText("Hi, I am the Child.");
|
|
112
|
+
expect(component).toBeInTheDocument();
|
|
113
|
+
});
|
|
114
|
+
it("slots with nested child and check nested child rendering", () => {
|
|
115
|
+
const slots = [{
|
|
116
|
+
name: "child",
|
|
117
|
+
elements: [{
|
|
118
|
+
name: "child",
|
|
119
|
+
type: "Child",
|
|
120
|
+
slots: [{
|
|
121
|
+
name: "nestedChildren",
|
|
122
|
+
elements: [{
|
|
123
|
+
name: "nestedChild",
|
|
124
|
+
type: "NestedChild"
|
|
125
|
+
}]
|
|
126
|
+
}]
|
|
127
|
+
}]
|
|
128
|
+
}];
|
|
129
|
+
const {
|
|
130
|
+
getByText
|
|
131
|
+
} = render( /*#__PURE__*/React.createElement(Parent, {
|
|
132
|
+
slots: slots
|
|
133
|
+
}, /*#__PURE__*/React.createElement(Child, {
|
|
134
|
+
slotName: "child"
|
|
135
|
+
}, /*#__PURE__*/React.createElement(NestedChild, {
|
|
136
|
+
slotName: "nestedChildren"
|
|
137
|
+
}))));
|
|
138
|
+
const component = getByText("Hi, I am the nested Child.");
|
|
139
|
+
expect(component).toBeInTheDocument();
|
|
140
|
+
});
|
|
141
|
+
it("slots with sibling child and check sibling child rendering", () => {
|
|
142
|
+
const slots = [{
|
|
143
|
+
name: "child",
|
|
144
|
+
elements: [{
|
|
145
|
+
name: "child",
|
|
146
|
+
type: "Child",
|
|
147
|
+
slots: [{
|
|
148
|
+
name: "nestedChildren",
|
|
149
|
+
elements: [{
|
|
150
|
+
name: "nestedChild",
|
|
151
|
+
type: "NestedChild"
|
|
152
|
+
}]
|
|
153
|
+
}]
|
|
154
|
+
}]
|
|
155
|
+
}, {
|
|
156
|
+
name: "siblingChild",
|
|
157
|
+
elements: [{
|
|
158
|
+
name: "siblingChild",
|
|
159
|
+
type: "SiblingChild"
|
|
160
|
+
}]
|
|
161
|
+
}];
|
|
162
|
+
const {
|
|
163
|
+
getByText
|
|
164
|
+
} = render( /*#__PURE__*/React.createElement(Parent, {
|
|
165
|
+
slots: slots
|
|
166
|
+
}, /*#__PURE__*/React.createElement(Child, {
|
|
167
|
+
slotName: "child"
|
|
168
|
+
}, /*#__PURE__*/React.createElement(NestedChild, {
|
|
169
|
+
slotName: "nestedChildren"
|
|
170
|
+
})), /*#__PURE__*/React.createElement(SiblingChild, null)));
|
|
171
|
+
const component = getByText("Hi, I am the sibling Child.");
|
|
172
|
+
expect(component).toBeInTheDocument();
|
|
173
|
+
});
|
|
174
|
+
it("children with no slot support should not be rendered", () => {
|
|
175
|
+
const slots = [{
|
|
176
|
+
name: "child",
|
|
177
|
+
elements: [{
|
|
178
|
+
name: "child",
|
|
179
|
+
type: "Child",
|
|
180
|
+
slots: [{
|
|
181
|
+
name: "nestedChildren",
|
|
182
|
+
elements: [{
|
|
183
|
+
name: "nestedChild",
|
|
184
|
+
type: "NestedChild"
|
|
185
|
+
}]
|
|
186
|
+
}]
|
|
187
|
+
}]
|
|
188
|
+
}, {
|
|
189
|
+
name: "siblingChild",
|
|
190
|
+
elements: [{
|
|
191
|
+
name: "siblingChild",
|
|
192
|
+
type: "SiblingChild"
|
|
193
|
+
}]
|
|
194
|
+
}];
|
|
195
|
+
const {
|
|
196
|
+
queryByText
|
|
197
|
+
} = render( /*#__PURE__*/React.createElement(Parent, {
|
|
198
|
+
slots: slots
|
|
199
|
+
}, /*#__PURE__*/React.createElement(Child, {
|
|
200
|
+
slotName: "child"
|
|
201
|
+
}, /*#__PURE__*/React.createElement(NestedChild, {
|
|
202
|
+
slotName: "nestedChildren"
|
|
203
|
+
})), /*#__PURE__*/React.createElement(SiblingChild, {
|
|
204
|
+
slotName: "siblingChild"
|
|
205
|
+
}), /*#__PURE__*/React.createElement(NoSlotName, {
|
|
206
|
+
slotName: "noslotname"
|
|
207
|
+
})));
|
|
208
|
+
const component = queryByText("Hi, It should not be rendered.");
|
|
209
|
+
expect(component).toBeNull();
|
|
210
|
+
});
|
|
211
|
+
});
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import ActionIcon from "../../../../legacy-to-new-arch/action-icon/frameworks/ui/ActionIcon";
|
|
2
2
|
import TableColumnSort from "../../../../legacy-to-new-arch/table-column-sort/frameworks/ui/TableColumnSort";
|
|
3
|
+
import TableColumnChooser from "../../../../legacy-to-new-arch/table-column-chooser/frameworks/ui/TableColumnChooser";
|
|
4
|
+
import Checkbox from "../../../../legacy-to-new-arch/checkbox/frameworks/ui/Checkbox";
|
|
3
5
|
import TableColumnFilter from "../../../../legacy-to-new-arch/table-column-filter/frameworks/ui/TableColumnFilter";
|
|
4
6
|
const ActionComponentMapping = {
|
|
5
7
|
['ActionIcon']: ActionIcon,
|
|
6
8
|
['TableColumnSort']: TableColumnSort,
|
|
9
|
+
['TableColumnChooser']: TableColumnChooser,
|
|
10
|
+
['TableSelectAll']: Checkbox,
|
|
7
11
|
['TableColumnFilter']: TableColumnFilter
|
|
8
12
|
};
|
|
9
13
|
export default ActionComponentMapping;
|
package/es/library/dot/components/table-list/adapters/controllers/KeyboardRowClickController.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import SmartTableConstants from "../../../../../../cc/table-connected/constants/Events";
|
|
2
|
+
import AbstractController from "./AbstractController";
|
|
3
|
+
|
|
4
|
+
class KeyboardRowClickController extends AbstractController {
|
|
5
|
+
handle(event) {
|
|
6
|
+
const {
|
|
7
|
+
state,
|
|
8
|
+
dispatch,
|
|
9
|
+
action
|
|
10
|
+
} = event;
|
|
11
|
+
const {
|
|
12
|
+
event: keyboardEvent
|
|
13
|
+
} = action.payload;
|
|
14
|
+
const {
|
|
15
|
+
focussedRow,
|
|
16
|
+
data
|
|
17
|
+
} = state.properties || {};
|
|
18
|
+
const record = data === null || data === void 0 ? void 0 : data.rows[focussedRow];
|
|
19
|
+
|
|
20
|
+
if (!record) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
let id = record.id;
|
|
25
|
+
dispatch({
|
|
26
|
+
type: SmartTableConstants.SMART_TABLE_ROW_ACTION_TRIGGERED,
|
|
27
|
+
payload: {
|
|
28
|
+
id,
|
|
29
|
+
event: keyboardEvent
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export default KeyboardRowClickController;
|
package/es/library/dot/components/table-list/adapters/controllers/KeyboardRowSelectController.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { LIST_SELECTION_TOGGLE_ITEMS } from "../../../../../../bc/list-selection/Constants";
|
|
2
|
+
import AbstractController from "./AbstractController";
|
|
3
|
+
|
|
4
|
+
class KeyboardRowSelectController extends AbstractController {
|
|
5
|
+
handle(event) {
|
|
6
|
+
const {
|
|
7
|
+
state,
|
|
8
|
+
dispatch
|
|
9
|
+
} = event;
|
|
10
|
+
const {
|
|
11
|
+
focussedRow,
|
|
12
|
+
data
|
|
13
|
+
} = state.properties || {};
|
|
14
|
+
const record = data === null || data === void 0 ? void 0 : data.rows[focussedRow];
|
|
15
|
+
|
|
16
|
+
if (!record) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
let id = record.id;
|
|
21
|
+
dispatch({
|
|
22
|
+
type: LIST_SELECTION_TOGGLE_ITEMS,
|
|
23
|
+
payload: {
|
|
24
|
+
selected: [id]
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export default KeyboardRowSelectController;
|
|
@@ -4,4 +4,6 @@ export { default as ScrollController } from "./ScrollController";
|
|
|
4
4
|
export { default as SortByController } from "./SortByController";
|
|
5
5
|
export { default as SortedController } from "./SortedController";
|
|
6
6
|
export { default as FieldChangeController } from "./FieldChangeController";
|
|
7
|
-
export { default as FieldClickController } from "./FieldClickController";
|
|
7
|
+
export { default as FieldClickController } from "./FieldClickController";
|
|
8
|
+
export { default as KeyboardRowSelectController } from "./KeyboardRowSelectController";
|
|
9
|
+
export { default as KeyboardRowClickController } from "./KeyboardRowClickController";
|
|
@@ -4,10 +4,11 @@ class TableTranslator {
|
|
|
4
4
|
data,
|
|
5
5
|
selectionConfig,
|
|
6
6
|
selection,
|
|
7
|
-
sortBy
|
|
7
|
+
sortBy,
|
|
8
|
+
focussedRow
|
|
8
9
|
} = state.properties;
|
|
9
10
|
const headers = TableTranslator.translateHeaders(data.headers, sortBy);
|
|
10
|
-
const rows = TableTranslator.translateRows(data.rows, selection, selectionConfig);
|
|
11
|
+
const rows = TableTranslator.translateRows(data.rows, selection, selectionConfig, focussedRow);
|
|
11
12
|
state = { ...state,
|
|
12
13
|
properties: { ...state.properties,
|
|
13
14
|
data: { ...data,
|
|
@@ -28,13 +29,14 @@ class TableTranslator {
|
|
|
28
29
|
});
|
|
29
30
|
}
|
|
30
31
|
|
|
31
|
-
static translateRows(rows, selection, selectionConfig) {
|
|
32
|
+
static translateRows(rows, selection, selectionConfig, focussedRow) {
|
|
32
33
|
const {
|
|
33
34
|
selected,
|
|
34
35
|
hasAllSelected
|
|
35
36
|
} = selection;
|
|
36
37
|
return rows.map((row, index) => {
|
|
37
38
|
return { ...row,
|
|
39
|
+
isFocussed: focussedRow === index,
|
|
38
40
|
isSelected: selected.includes(row.id),
|
|
39
41
|
isSelectable: selected.includes(row.id) || !hasAllSelected,
|
|
40
42
|
selectionTooltip: this.getSelectionTooltip(row.id, index, selected, hasAllSelected, selectionConfig)
|