@zohodesk/library-platform 1.1.3-exp.2 → 1.1.3-exp.3
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/zlist/Constants.js +1 -3
- package/es/bc/zrecord/Constants.js +1 -3
- package/es/cc/table-connected/Properties.js +0 -16
- package/es/cc/table-list/Constants.js +0 -4
- package/es/cc/table-list/Properties.js +0 -16
- package/es/cc/table-list/row/Properties.js +0 -35
- package/es/library/dot/components/table-list/frameworks/ui/TableListView.js +6 -67
- package/es/library/dot/components/table-list/frameworks/ui/css/TableList.module.css +2 -145
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/Header.js +4 -22
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/Rows.js +9 -22
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/MassAction.js +2 -19
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/Row.js +10 -55
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/RowSelection.js +0 -10
- package/es/platform/components/table-connected/adapters/resources/SmartTableResource.js +0 -14
- package/es/platform/components/table-connected/frameworks/EventHandlersFactory.js +2 -5
- package/es/platform/components/table-connected/frameworks/ListSdkFactory.js +2 -4
- package/es/platform/components/table-connected/frameworks/TableConnectedView.js +1 -3
- package/es/platform/data-source/index.js +0 -2
- package/es/platform/sdk/application/interfaces/gateways/AbstractResource.js +2 -1
- package/es/platform/sdk/domain/entities/ResourceManager.js +1 -1
- package/es/platform/zlist/adapters/gateways/Repository.js +0 -7
- package/es/platform/zlist/adapters/gateways/Service.js +0 -8
- package/es/platform/zlist/adapters/presenters/TableTranslator.js +1 -5
- package/es/platform/zlist/adapters/presenters/translators/ColumnTranslator.js +10 -9
- package/es/platform/zlist/adapters/presenters/utils/DefaultClientActions.js +1 -1
- package/es/platform/zlist/applications/usecases/RecordSuccessCallbackUsecase.js +3 -24
- package/es/platform/zlist/domain/entities/List.js +2 -66
- package/es/platform/zlist/frameworks/EventHandlersFactory.js +3 -7
- package/es/platform/zlist/frameworks/ZListBehaviourFactory.js +1 -2
- package/es/platform/zrecord/domain/entities/RecordsManager.js +1 -3
- package/package.json +3 -6
- package/es/library/dot/components/table-list/frameworks/hooks/useDropIndicator.js +0 -8
- package/es/library/dot/components/table-list/frameworks/hooks/useRowData.js +0 -8
- package/es/library/dot/components/table-list/frameworks/hooks/useTableRowReorder.js +0 -93
- package/es/library/dot/components/table-list/frameworks/utils/reOrder.js +0 -76
- package/es/platform/components/table-connected/adapters/controllers/ReOrderFinishController.js +0 -21
- package/es/platform/data-source/http-template/reOrderRecord.js +0 -44
- package/es/platform/zlist/adapters/controllers/ReOrderController.js +0 -25
- package/es/platform/zlist/adapters/controllers/ReOrderFailedController.js +0 -26
- package/es/platform/zlist/applications/interfaces/input/ReOrderRecordUseCaseInput.js +0 -1
- package/es/platform/zlist/applications/usecases/ReOrderFailedUseCase.js +0 -22
- package/es/platform/zlist/applications/usecases/ReOrderUseCase.js +0 -25
- package/es/platform/zrecord/domain/entities/GetReOrderRecordsStrategy.js +0 -40
package/es/bc/zlist/Constants.js
CHANGED
|
@@ -7,6 +7,4 @@ export const ZLIST_FETCH_SORTED = 'ZLIST#FETCH_SORTED';
|
|
|
7
7
|
export const ZLIST_RECORD_UPDATE_SUCCEEDED = 'ZLIST#RECORD_UPDATE_SUCCEEDED';
|
|
8
8
|
export const ZLIST_RECORD_UPDATE_FAILED = 'ZLIST#RECORD_UPDATE_FAILED';
|
|
9
9
|
export const ZLIST_RECORD_DELETE_SUCCEEDED = 'ZLIST#RECORD_DELETE_SUCCEEDED';
|
|
10
|
-
export const ZLIST_RECORD_DELETE_FAILED = 'ZLIST#RECORD_DELETE_FAILED';
|
|
11
|
-
export const ZLIST_RECORD_REORDER = 'ZLIST#RECORD_REORDER';
|
|
12
|
-
export const ZLIST_RECORD_REORDER_FAILED = 'ZLIST#RECORD_REORDER_FAILED';
|
|
10
|
+
export const ZLIST_RECORD_DELETE_FAILED = 'ZLIST#RECORD_DELETE_FAILED';
|
|
@@ -27,6 +27,4 @@ _defineProperty(RecordApiActionName, "UPDATE_RECORD", 'updateRecord');
|
|
|
27
27
|
|
|
28
28
|
_defineProperty(RecordApiActionName, "GET_CLIENTACTIONS", 'getClientActions');
|
|
29
29
|
|
|
30
|
-
_defineProperty(RecordApiActionName, "CREATE_RECORD", 'createRecord');
|
|
31
|
-
|
|
32
|
-
_defineProperty(RecordApiActionName, "GET_REORDERRECORD", 'reorderRecord');
|
|
30
|
+
_defineProperty(RecordApiActionName, "CREATE_RECORD", 'createRecord');
|
|
@@ -45,22 +45,6 @@ export default {
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
|
-
reOrderConfig: {
|
|
49
|
-
required: false,
|
|
50
|
-
defaultValue: {
|
|
51
|
-
isEnabled: false
|
|
52
|
-
},
|
|
53
|
-
typeMetadata: {
|
|
54
|
-
schema: {
|
|
55
|
-
type: 'object',
|
|
56
|
-
properties: {
|
|
57
|
-
isEnabled: {
|
|
58
|
-
type: 'boolean'
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
48
|
componentMapping: {
|
|
65
49
|
required: false,
|
|
66
50
|
defaultValue: {
|
|
@@ -22,8 +22,4 @@ _defineProperty(Constants, "TABLE_LIST_FIELD_CHANGED", 'TABLE_LIST#FIELD_CHANGED
|
|
|
22
22
|
|
|
23
23
|
_defineProperty(Constants, "TABLE_LIST_ROW_CLICKED", 'TABLE_LIST#ROW_CLICKED');
|
|
24
24
|
|
|
25
|
-
_defineProperty(Constants, "TABLE_LIST_ROW_DRAG_START", 'TABLE_LIST#ROW_DRAG_START');
|
|
26
|
-
|
|
27
|
-
_defineProperty(Constants, "TABLE_LIST_ROW_DRAG_END", 'TABLE_LIST#ROW_DRAG_END');
|
|
28
|
-
|
|
29
25
|
export default Constants;
|
|
@@ -308,22 +308,6 @@ const TableListProperties = {
|
|
|
308
308
|
}
|
|
309
309
|
}
|
|
310
310
|
},
|
|
311
|
-
reOrderConfig: {
|
|
312
|
-
required: false,
|
|
313
|
-
defaultValue: {
|
|
314
|
-
isEnabled: false
|
|
315
|
-
},
|
|
316
|
-
typeMetadata: {
|
|
317
|
-
schema: {
|
|
318
|
-
type: 'object',
|
|
319
|
-
properties: {
|
|
320
|
-
isEnabled: {
|
|
321
|
-
type: 'boolean'
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
},
|
|
327
311
|
...SelectionConfigProperties
|
|
328
312
|
};
|
|
329
313
|
export default TableListProperties;
|
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
import { Width } from "../data-types/Header";
|
|
2
2
|
import RowCursor from "../data-types/RowCursor";
|
|
3
3
|
const TableRowProperties = {
|
|
4
|
-
isReorderEnabled: {
|
|
5
|
-
required: false,
|
|
6
|
-
defaultValue: false,
|
|
7
|
-
typeMetadata: {
|
|
8
|
-
schema: {
|
|
9
|
-
type: 'boolean'
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
},
|
|
13
4
|
isSelectionEnabled: {
|
|
14
5
|
required: false,
|
|
15
6
|
defaultValue: false,
|
|
@@ -128,32 +119,6 @@ const TableRowProperties = {
|
|
|
128
119
|
type: 'boolean'
|
|
129
120
|
}
|
|
130
121
|
}
|
|
131
|
-
},
|
|
132
|
-
isSorting: {
|
|
133
|
-
required: false,
|
|
134
|
-
defaultValue: false,
|
|
135
|
-
typeMetadata: {
|
|
136
|
-
schema: {
|
|
137
|
-
type: 'boolean'
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
},
|
|
141
|
-
isDroppable: {
|
|
142
|
-
required: false,
|
|
143
|
-
defaultValue: false,
|
|
144
|
-
typeMetadata: {
|
|
145
|
-
schema: {
|
|
146
|
-
type: 'boolean'
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
},
|
|
150
|
-
dropPosition: {
|
|
151
|
-
required: false,
|
|
152
|
-
typeMetadata: {
|
|
153
|
-
schema: {
|
|
154
|
-
type: "string"
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
122
|
}
|
|
158
123
|
};
|
|
159
124
|
export default TableRowProperties;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import Table from '@zohodesk-private/desk-components/es/table/Table/Table';
|
|
3
3
|
import Header from "./sub-components/Header";
|
|
4
4
|
import Body from "./sub-components/Body";
|
|
@@ -7,9 +7,7 @@ import NoData from "./sub-components/NoData";
|
|
|
7
7
|
import ErrorState from "./sub-components/ErrorState";
|
|
8
8
|
import Loading from "./sub-components/Loading";
|
|
9
9
|
import ColumnResizingLine from "./sub-components/ColumnResizingLine";
|
|
10
|
-
import handleScroll from "./handlers/HandleScroll";
|
|
11
|
-
import { useTableRowReorder } from "../hooks/useTableRowReorder";
|
|
12
|
-
import { SortableContainer } from 'react-sortable-hoc'; // @ts-ignore
|
|
10
|
+
import handleScroll from "./handlers/HandleScroll"; // @ts-ignore
|
|
13
11
|
|
|
14
12
|
import style from "./css/TableList.module.css";
|
|
15
13
|
|
|
@@ -18,7 +16,6 @@ function TableListView(_ref2, _ref) {
|
|
|
18
16
|
state,
|
|
19
17
|
helpers
|
|
20
18
|
} = _ref2;
|
|
21
|
-
const TableRef = useRef(null);
|
|
22
19
|
const {
|
|
23
20
|
dispatch
|
|
24
21
|
} = helpers;
|
|
@@ -26,7 +23,6 @@ function TableListView(_ref2, _ref) {
|
|
|
26
23
|
data,
|
|
27
24
|
isLoading,
|
|
28
25
|
resizerState,
|
|
29
|
-
reOrderConfig,
|
|
30
26
|
selectionConfig,
|
|
31
27
|
isFlexibleColumns,
|
|
32
28
|
rowCursor,
|
|
@@ -49,23 +45,16 @@ function TableListView(_ref2, _ref) {
|
|
|
49
45
|
const isDataEmpty = !hasRows && !isLoading && !isError; // TODO: derive from state.properties
|
|
50
46
|
|
|
51
47
|
const isKeyboardControlsEnabled = keyboardControlsConfig.isEnabled;
|
|
52
|
-
|
|
53
|
-
const getTableRef = ref => {
|
|
54
|
-
TableRef.current = ref;
|
|
55
|
-
};
|
|
56
|
-
|
|
57
48
|
return /*#__PURE__*/React.createElement("div", {
|
|
58
49
|
className: style.wrapper,
|
|
59
50
|
ref: _ref
|
|
60
51
|
}, /*#__PURE__*/React.createElement(Table, {
|
|
61
|
-
ref: getTableRef,
|
|
62
52
|
$event_onScroll: e => handleScroll(dispatch, {
|
|
63
53
|
scrollEvent: e
|
|
64
54
|
})
|
|
65
55
|
}, renderHeader({
|
|
66
56
|
headers,
|
|
67
57
|
resizerState,
|
|
68
|
-
reOrderConfig,
|
|
69
58
|
selectionConfig,
|
|
70
59
|
selection,
|
|
71
60
|
isKeyboardControlsEnabled,
|
|
@@ -74,12 +63,9 @@ function TableListView(_ref2, _ref) {
|
|
|
74
63
|
rowActionsColumnWidth,
|
|
75
64
|
dispatch
|
|
76
65
|
}), renderBody({
|
|
77
|
-
TableRef,
|
|
78
|
-
dispatch,
|
|
79
66
|
headers,
|
|
80
67
|
rows,
|
|
81
68
|
isFlexibleColumns,
|
|
82
|
-
reOrderConfig,
|
|
83
69
|
selectionConfig,
|
|
84
70
|
isKeyboardControlsEnabled,
|
|
85
71
|
rowCursor,
|
|
@@ -101,7 +87,6 @@ function renderHeader(_ref3) {
|
|
|
101
87
|
let {
|
|
102
88
|
headers,
|
|
103
89
|
resizerState,
|
|
104
|
-
reOrderConfig,
|
|
105
90
|
selectionConfig,
|
|
106
91
|
selection,
|
|
107
92
|
isKeyboardControlsEnabled,
|
|
@@ -111,7 +96,6 @@ function renderHeader(_ref3) {
|
|
|
111
96
|
dispatch
|
|
112
97
|
} = _ref3;
|
|
113
98
|
return /*#__PURE__*/React.createElement(Header, {
|
|
114
|
-
isReorderEnabled: reOrderConfig.isEnabled,
|
|
115
99
|
isSelectionEnabled: selectionConfig.isEnabled,
|
|
116
100
|
isResizerEnabled: resizerState.isEnabled,
|
|
117
101
|
isKeyboardControlsEnabled: isKeyboardControlsEnabled,
|
|
@@ -127,26 +111,11 @@ function renderHeader(_ref3) {
|
|
|
127
111
|
});
|
|
128
112
|
}
|
|
129
113
|
|
|
130
|
-
const SortableTableContainer = SortableContainer(props => {
|
|
131
|
-
const {
|
|
132
|
-
hasRows,
|
|
133
|
-
isFlexibleColumns,
|
|
134
|
-
children
|
|
135
|
-
} = props;
|
|
136
|
-
return /*#__PURE__*/React.createElement(Body, {
|
|
137
|
-
hasRows: hasRows,
|
|
138
|
-
isFlexibleColumns: isFlexibleColumns
|
|
139
|
-
}, children);
|
|
140
|
-
});
|
|
141
|
-
|
|
142
114
|
function renderBody(_ref4) {
|
|
143
115
|
let {
|
|
144
|
-
TableRef,
|
|
145
|
-
dispatch,
|
|
146
116
|
headers,
|
|
147
117
|
rows,
|
|
148
118
|
isFlexibleColumns,
|
|
149
|
-
reOrderConfig,
|
|
150
119
|
selectionConfig,
|
|
151
120
|
isKeyboardControlsEnabled,
|
|
152
121
|
rowCursor,
|
|
@@ -154,48 +123,18 @@ function renderBody(_ref4) {
|
|
|
154
123
|
rowActionsColumnWidth,
|
|
155
124
|
hasRows
|
|
156
125
|
} = _ref4;
|
|
157
|
-
|
|
158
|
-
rowData,
|
|
159
|
-
dropIndicator,
|
|
160
|
-
handleSortStart,
|
|
161
|
-
handleSortEnd,
|
|
162
|
-
handleSortOver,
|
|
163
|
-
getHelperDimensions
|
|
164
|
-
} = useTableRowReorder({
|
|
165
|
-
rows,
|
|
166
|
-
TableRef,
|
|
167
|
-
dispatch
|
|
168
|
-
});
|
|
169
|
-
|
|
170
|
-
if (!hasRows) {
|
|
171
|
-
return null;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
return /*#__PURE__*/React.createElement(SortableTableContainer, {
|
|
126
|
+
return /*#__PURE__*/React.createElement(Body, {
|
|
175
127
|
hasRows: hasRows,
|
|
176
|
-
isFlexibleColumns: isFlexibleColumns
|
|
177
|
-
helperClass: `${style.dragging}`,
|
|
178
|
-
useDragHandle: true,
|
|
179
|
-
helperContainer: () => TableRef.current,
|
|
180
|
-
onSortStart: handleSortStart,
|
|
181
|
-
onSortEnd: handleSortEnd,
|
|
182
|
-
onSortOver: handleSortOver,
|
|
183
|
-
getHelperDimensions: getHelperDimensions,
|
|
184
|
-
axis: "y",
|
|
185
|
-
lockAxis: "y",
|
|
186
|
-
lockToContainerEdges: true,
|
|
187
|
-
distance: 1
|
|
128
|
+
isFlexibleColumns: isFlexibleColumns
|
|
188
129
|
}, /*#__PURE__*/React.createElement(Rows, {
|
|
189
130
|
headers: headers,
|
|
190
|
-
rows:
|
|
131
|
+
rows: rows,
|
|
191
132
|
isFlexibleColumns: isFlexibleColumns,
|
|
192
|
-
isReorderEnabled: reOrderConfig.isEnabled,
|
|
193
133
|
isSelectionEnabled: selectionConfig.isEnabled,
|
|
194
134
|
rowCursor: rowCursor,
|
|
195
135
|
hasRowActions: hasRowActions,
|
|
196
136
|
rowActionsColumnWidth: rowActionsColumnWidth,
|
|
197
|
-
isKeyboardControlsEnabled: isKeyboardControlsEnabled
|
|
198
|
-
dropIndicator: dropIndicator
|
|
137
|
+
isKeyboardControlsEnabled: isKeyboardControlsEnabled
|
|
199
138
|
}));
|
|
200
139
|
}
|
|
201
140
|
|
|
@@ -1,47 +1,36 @@
|
|
|
1
1
|
.loader {
|
|
2
2
|
padding: var(--zd_size40) 0
|
|
3
3
|
}
|
|
4
|
-
|
|
5
4
|
.wrapper {
|
|
6
5
|
height: 100% ;
|
|
7
6
|
width: 100% ;
|
|
8
7
|
position: relative
|
|
9
8
|
}
|
|
10
|
-
|
|
11
9
|
.resizerSpace {
|
|
12
10
|
width: calc(var(--local_table_resizer_extra_space, 0) * var(--zd_size1));
|
|
13
11
|
flex-shrink: 0
|
|
14
12
|
}
|
|
15
|
-
|
|
16
13
|
.contentWrapper {
|
|
17
14
|
composes: sticky from '~@zohodesk/components/es/common/common.module.css';
|
|
18
15
|
}
|
|
19
|
-
|
|
20
16
|
[dir=ltr] .contentWrapper {
|
|
21
17
|
left: 0 ;
|
|
22
18
|
}
|
|
23
|
-
|
|
24
19
|
[dir=rtl] .contentWrapper {
|
|
25
20
|
right: 0 ;
|
|
26
21
|
}
|
|
27
|
-
|
|
28
22
|
.initialLoading {
|
|
29
23
|
height: calc(100% - (var(--zd_size100)))
|
|
30
24
|
}
|
|
31
|
-
|
|
32
25
|
.emptyContent {
|
|
33
26
|
padding: var(--zd_size160) 0 var(--zd_size60)
|
|
34
27
|
}
|
|
35
|
-
|
|
36
28
|
.errorContent {
|
|
37
29
|
padding: var(--zd_size60) 0
|
|
38
30
|
}
|
|
39
|
-
|
|
40
|
-
.headerWithActions,
|
|
41
|
-
.fieldWithActions {
|
|
31
|
+
.headerWithActions, .fieldWithActions {
|
|
42
32
|
gap: var(--zd_size6)
|
|
43
33
|
}
|
|
44
|
-
|
|
45
34
|
.actions {
|
|
46
35
|
gap: var(--zd_size8)
|
|
47
36
|
}
|
|
@@ -49,141 +38,9 @@
|
|
|
49
38
|
.rowCursor_default {
|
|
50
39
|
cursor: default
|
|
51
40
|
}
|
|
52
|
-
|
|
53
41
|
.rowCursor_pointer {
|
|
54
42
|
cursor: pointer
|
|
55
43
|
}
|
|
56
|
-
|
|
57
44
|
.rowCursor_not-allowed {
|
|
58
45
|
cursor: not-allowed
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.dragging {
|
|
62
|
-
overflow: hidden;
|
|
63
|
-
box-shadow: var(--local_tablelist_box_shadow);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
:global(.GLOBAL_ZDDC_tableList).dragging .dragHandleContainer {
|
|
67
|
-
/* css:theme-validation:ignore */
|
|
68
|
-
color: var(--local_drag_handle_hover_color);
|
|
69
|
-
background-color: var(--local_drag_handle_dragging_bg);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
:global(.GLOBAL_ZDDC_tableList).dragging .dragHandleContainer,
|
|
73
|
-
:global(.GLOBAL_ZDDC_tableList:hover) .dragHandleContainer,
|
|
74
|
-
:global(.GLOBAL_ZDDC_tableList:focus-within) .dragHandleContainer {
|
|
75
|
-
visibility: visible;
|
|
76
|
-
opacity: 1;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.dragHandleContainer {
|
|
80
|
-
opacity: 0;
|
|
81
|
-
visibility: hidden;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.dragHandleWrapper {
|
|
85
|
-
align-self: stretch;
|
|
86
|
-
composes: sticky from '~@zohodesk/components/es/common/common.module.css';
|
|
87
|
-
z-index: 1;
|
|
88
|
-
/* css:theme-validation:ignore */
|
|
89
|
-
padding: 0 ;
|
|
90
|
-
background-color: var(--local_tablelist_bg);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
[dir=ltr] .dragHandleWrapper {
|
|
94
|
-
left: 0 ;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
[dir=rtl] .dragHandleWrapper {
|
|
98
|
-
right: 0 ;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.rowDropIndicator {
|
|
102
|
-
width: 100% ;
|
|
103
|
-
height: var(--zd_size2) ;
|
|
104
|
-
/* css:theme-validation:ignore */
|
|
105
|
-
position: absolute;
|
|
106
|
-
z-index: 2;
|
|
107
|
-
background-color: var(--local_tablelist_drop_highlight_bg);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
.dropIndicatorTop {
|
|
111
|
-
top: 0 ;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
.dropIndicatorBottom {
|
|
115
|
-
bottom: calc( var(--zd_size3) * -1 ) ;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
[dir=ltr] .offsetLeft0 {
|
|
119
|
-
left: 0 !important;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
[dir=rtl] .offsetLeft0 {
|
|
123
|
-
right: 0 !important;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
[dir=ltr] .offsetLeft8 {
|
|
127
|
-
left: var(--zd_size8) !important;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
[dir=rtl] .offsetLeft8 {
|
|
131
|
-
right: var(--zd_size8) !important;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
[dir=ltr] .offsetLeft24 {
|
|
135
|
-
left: var(--zd_size24) !important;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
[dir=rtl] .offsetLeft24 {
|
|
139
|
-
right: var(--zd_size24) !important;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
[dir=ltr] .paddingLeft0 {
|
|
143
|
-
padding-left: 0 ;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
[dir=rtl] .paddingLeft0 {
|
|
147
|
-
padding-right: 0 ;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
[dir=ltr] .paddingLeft8 {
|
|
151
|
-
padding-left: var(--zd_size8) !important;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
[dir=rtl] .paddingLeft8 {
|
|
155
|
-
padding-right: var(--zd_size8) !important;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
[dir=ltr] .paddingLeft16 {
|
|
159
|
-
padding-left: var(--zd_size16) !important;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
[dir=rtl] .paddingLeft16 {
|
|
163
|
-
padding-right: var(--zd_size16) !important;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
[dir=ltr] .paddingRight8 {
|
|
167
|
-
padding-right: var(--zd_size8) !important;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
[dir=rtl] .paddingRight8 {
|
|
171
|
-
padding-left: var(--zd_size8) !important;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
[dir=ltr] .paddingRight16 {
|
|
175
|
-
padding-right: var(--zd_size16) !important;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
[dir=rtl] .paddingRight16 {
|
|
179
|
-
padding-left: var(--zd_size16) !important;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
[dir=ltr] .paddingRight24 {
|
|
183
|
-
padding-right: var(--zd_size24) !important;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
[dir=rtl] .paddingRight24 {
|
|
187
|
-
padding-left: var(--zd_size24) !important;
|
|
188
|
-
}
|
|
189
|
-
|
|
46
|
+
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import TableHeader from '@zohodesk-private/desk-components/es/table/TableHeader/TableHeader';
|
|
3
|
-
import TableHeadFirstNode from '@zohodesk-private/desk-components/es/table/TableHeadFirstNode/TableHeadFirstNode'; // import TableHeaderRow from '@zohodesk-private/desk-components/es/table/TableHeader/TableHeaderRow';
|
|
2
|
+
import TableHeader from '@zohodesk-private/desk-components/es/table/TableHeader/TableHeader'; // import TableHeaderRow from '@zohodesk-private/desk-components/es/table/TableHeader/TableHeaderRow';
|
|
4
3
|
|
|
5
4
|
const TableHeaderRow = _ref => {
|
|
6
5
|
let {
|
|
@@ -13,11 +12,9 @@ import MassAction from "./header/MassAction";
|
|
|
13
12
|
import Headers from "./header/Headers";
|
|
14
13
|
import ActionColumn from "./header/ActionColumn";
|
|
15
14
|
import ResizerExtraSpace from "./header/ResizerExtraSpace";
|
|
16
|
-
import style from "./../../ui/css/TableList.module.css";
|
|
17
15
|
|
|
18
16
|
function Header(_ref2) {
|
|
19
17
|
let {
|
|
20
|
-
isReorderEnabled,
|
|
21
18
|
isSelectionEnabled,
|
|
22
19
|
actions,
|
|
23
20
|
isKeyboardControlsEnabled,
|
|
@@ -38,33 +35,18 @@ function Header(_ref2) {
|
|
|
38
35
|
|
|
39
36
|
return /*#__PURE__*/React.createElement(TableHeader, {
|
|
40
37
|
$flag_isColumnsFlexible: isFlexibleColumns,
|
|
41
|
-
$flag_padding: !isSelectionEnabled
|
|
38
|
+
$flag_padding: !isSelectionEnabled,
|
|
42
39
|
$flag_hasHighlighter: isKeyboardControlsEnabled
|
|
43
|
-
}, /*#__PURE__*/React.createElement(TableHeaderRow, null,
|
|
40
|
+
}, /*#__PURE__*/React.createElement(TableHeaderRow, null, rendermassAction(isSelectionEnabled, actions), renderHeaders(headers, currentlyResizingColumn, isResizerEnabled, isFlexibleColumns, dispatch), renderActionColumn(hasRowActions, rowActionsColumnWidth), renderResizerExtraSpace(isCurrentlyResizing, resizerExtraWidth)));
|
|
44
41
|
}
|
|
45
42
|
|
|
46
|
-
function rendermassAction(isSelectionEnabled,
|
|
43
|
+
function rendermassAction(isSelectionEnabled, actions) {
|
|
47
44
|
return /*#__PURE__*/React.createElement(MassAction, {
|
|
48
45
|
isSelectionEnabled: isSelectionEnabled,
|
|
49
|
-
isReorderEnabled: isReorderEnabled,
|
|
50
|
-
isKeyboardControlsEnabled: isKeyboardControlsEnabled,
|
|
51
46
|
actions: actions
|
|
52
47
|
});
|
|
53
48
|
}
|
|
54
49
|
|
|
55
|
-
function renderReOrderColumn(isSelectionEnabled, isReorderEnabled, isKeyboardControlsEnabled) {
|
|
56
|
-
if (isReorderEnabled) {
|
|
57
|
-
return /*#__PURE__*/React.createElement(TableHeadFirstNode, {
|
|
58
|
-
customStyle: {
|
|
59
|
-
container: isKeyboardControlsEnabled && isSelectionEnabled ? style.paddingRight16 : isKeyboardControlsEnabled ? `${style.offsetLeft8} ${style.paddingRight8}` : style.offsetLeft0
|
|
60
|
-
},
|
|
61
|
-
$customProps_container: {
|
|
62
|
-
$data_width: 24
|
|
63
|
-
}
|
|
64
|
-
}, /*#__PURE__*/React.createElement(React.Fragment, null));
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
50
|
function renderHeaders(headers, currentlyResizingColumn, isResizerEnabled, isFlexibleColumns, dispatch) {
|
|
69
51
|
return /*#__PURE__*/React.createElement(Headers, {
|
|
70
52
|
headers: headers,
|
|
@@ -1,34 +1,24 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Row from "./row/Row";
|
|
3
|
-
import { SortableElement } from 'react-sortable-hoc';
|
|
4
|
-
const SortableRow = SortableElement(props => /*#__PURE__*/React.createElement(Row, { ...props
|
|
5
|
-
}));
|
|
6
3
|
|
|
7
|
-
|
|
4
|
+
function Rows(_ref) {
|
|
8
5
|
let {
|
|
9
6
|
headers,
|
|
10
7
|
rows,
|
|
11
8
|
isFlexibleColumns,
|
|
12
|
-
isReorderEnabled,
|
|
13
9
|
isSelectionEnabled,
|
|
14
10
|
rowCursor,
|
|
15
11
|
hasRowActions,
|
|
16
12
|
rowActionsColumnWidth,
|
|
17
|
-
isKeyboardControlsEnabled
|
|
18
|
-
dropIndicator
|
|
13
|
+
isKeyboardControlsEnabled
|
|
19
14
|
} = _ref;
|
|
20
|
-
return rows.map((row, index) => {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
index: index,
|
|
26
|
-
...getRowProps(row, headers, isFlexibleColumns, isReorderEnabled, isSelectionEnabled, rowCursor, hasRowActions, rowActionsColumnWidth, isKeyboardControlsEnabled, isDroppable, dropPosition)
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
};
|
|
15
|
+
return rows.map((row, index) => /*#__PURE__*/React.createElement(Row, {
|
|
16
|
+
key: index,
|
|
17
|
+
...getRowProps(row, headers, isFlexibleColumns, isSelectionEnabled, rowCursor, hasRowActions, rowActionsColumnWidth, isKeyboardControlsEnabled)
|
|
18
|
+
}));
|
|
19
|
+
}
|
|
30
20
|
|
|
31
|
-
function getRowProps(row, headers, isFlexibleColumns,
|
|
21
|
+
function getRowProps(row, headers, isFlexibleColumns, isSelectionEnabled, rowCursor, hasRowActions, rowActionsColumnWidth, isKeyboardControlsEnabled) {
|
|
32
22
|
const {
|
|
33
23
|
id,
|
|
34
24
|
columns,
|
|
@@ -48,14 +38,11 @@ function getRowProps(row, headers, isFlexibleColumns, isReorderEnabled, isSelect
|
|
|
48
38
|
isFocussed,
|
|
49
39
|
selectionTooltip,
|
|
50
40
|
isFlexibleColumns,
|
|
51
|
-
isReorderEnabled,
|
|
52
41
|
isSelectionEnabled,
|
|
53
42
|
cursor: rowCursor,
|
|
54
43
|
hasActions: hasRowActions,
|
|
55
44
|
isKeyboardControlsEnabled,
|
|
56
|
-
rowActionsColumnWidth
|
|
57
|
-
isDroppable,
|
|
58
|
-
dropPosition
|
|
45
|
+
rowActionsColumnWidth
|
|
59
46
|
};
|
|
60
47
|
}
|
|
61
48
|
|
package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/MassAction.js
CHANGED
|
@@ -2,13 +2,10 @@ import React from 'react';
|
|
|
2
2
|
import TableHeadFirstNode from '@zohodesk-private/desk-components/es/table/TableHeadFirstNode/TableHeadFirstNode';
|
|
3
3
|
import TableHeading from '@zohodesk-private/desk-components/es/table/TableHeading/TableHeading';
|
|
4
4
|
import ActionEventMediator from "../../../../../../../../platform/client-actions/components/action-event-mediator/frameworks/ui/ActionEventMediator";
|
|
5
|
-
import style from "./../../../ui/css/TableList.module.css";
|
|
6
5
|
|
|
7
6
|
function MassAction(_ref) {
|
|
8
7
|
let {
|
|
9
8
|
isSelectionEnabled,
|
|
10
|
-
isReorderEnabled,
|
|
11
|
-
isKeyboardControlsEnabled,
|
|
12
9
|
actions
|
|
13
10
|
} = _ref;
|
|
14
11
|
|
|
@@ -16,28 +13,14 @@ function MassAction(_ref) {
|
|
|
16
13
|
return null;
|
|
17
14
|
}
|
|
18
15
|
|
|
19
|
-
const customPropsContainer = isReorderEnabled && isSelectionEnabled ? {
|
|
20
|
-
$data_width: 56
|
|
21
|
-
} : {};
|
|
22
|
-
|
|
23
16
|
if (!actions || actions.length === 0) {
|
|
24
|
-
return /*#__PURE__*/React.createElement(TableHeadFirstNode, {
|
|
25
|
-
customStyle: {
|
|
26
|
-
container: isReorderEnabled && isSelectionEnabled ? `${style.offsetLeft24} ${style.paddingRight24}` : isKeyboardControlsEnabled && isSelectionEnabled ? `${style.offsetLeft8} ${style.paddingRight16}` : isKeyboardControlsEnabled ? style.offsetLeft8 : style.offsetLeft0
|
|
27
|
-
},
|
|
28
|
-
$customProps_container: customPropsContainer
|
|
29
|
-
}, /*#__PURE__*/React.createElement(TableHeading, {
|
|
17
|
+
return /*#__PURE__*/React.createElement(TableHeadFirstNode, null, /*#__PURE__*/React.createElement(TableHeading, {
|
|
30
18
|
$i18n_text: "M/A",
|
|
31
19
|
$i18n_tooltip: "Mass Action"
|
|
32
20
|
}));
|
|
33
21
|
}
|
|
34
22
|
|
|
35
|
-
return /*#__PURE__*/React.createElement(TableHeadFirstNode, {
|
|
36
|
-
customStyle: {
|
|
37
|
-
container: isReorderEnabled && isSelectionEnabled ? `${style.offsetLeft24} ${style.paddingRight24}` : isKeyboardControlsEnabled && isSelectionEnabled ? `${style.offsetLeft8} ${style.paddingRight16}` : isKeyboardControlsEnabled ? style.offsetLeft8 : style.offsetLeft0
|
|
38
|
-
},
|
|
39
|
-
$customProps_container: customPropsContainer
|
|
40
|
-
}, /*#__PURE__*/React.createElement(ActionEventMediator, {
|
|
23
|
+
return /*#__PURE__*/React.createElement(TableHeadFirstNode, null, /*#__PURE__*/React.createElement(ActionEventMediator, {
|
|
41
24
|
actions: actions
|
|
42
25
|
}));
|
|
43
26
|
}
|