@zohodesk/library-platform 1.1.3-exp.2 → 1.1.3-temp-1
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/cc/table-list/Properties.js +9 -0
- package/es/cc/table-list/row/Properties.js +9 -0
- package/es/index.js +2 -1
- package/es/library/dot/components/table-list/frameworks/hooks/useTableRowReorder.js +17 -5
- package/es/library/dot/components/table-list/frameworks/ui/TableListView.js +35 -26
- package/es/library/dot/components/table-list/frameworks/ui/css/TableList.module.css +153 -56
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/Header.js +22 -16
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/Rows.js +7 -4
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/MassAction.js +5 -13
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/Row.js +31 -34
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/RowSelection.js +3 -8
- package/es/library/dot/components/table-list/frameworks/utils/getHeaderClasses.js +37 -0
- package/es/library/dot/components/table-list/frameworks/utils/getTableListClassName.js +37 -0
- package/es/library/dot/components/table-list/frameworks/utils/reOrder.js +28 -14
- package/es/library/dot/legacy-to-new-arch/text-area/frameworks/ui/TextAreaView.js +1 -1
- package/es/platform/client-actions/components/action-event-mediator/frameworks/ui/ClientActionsAdapter.js +96 -0
- package/es/platform/client-actions/components/action-event-mediator/frameworks/ui/EventHandlersFactory.js +11 -3
- package/es/platform/client-actions/template-resolver/index.js +1 -0
- package/es/platform/client-actions/translators/context-resolver/index.js +6 -6
- package/es/platform/components/table-connected/frameworks/TableConnectedView.js +2 -0
- package/es/platform/zform/adapters/presenter/FormTranslator.js +6 -127
- package/es/platform/zform/adapters/presenter/translators/SectionTranslator.js +32 -0
- package/es/platform/zform/adapters/presenter/translators/fields/BooleanFieldTranslator.js +20 -0
- package/es/platform/zform/adapters/presenter/translators/fields/CurrencyFieldTranslator.js +30 -0
- package/es/platform/zform/adapters/presenter/translators/fields/DateFieldTranslator.js +21 -0
- package/es/platform/zform/adapters/presenter/translators/fields/DateTimeFieldTranslator.js +21 -0
- package/es/platform/zform/adapters/presenter/translators/fields/DecimalFieldTranslator.js +30 -0
- package/es/platform/zform/adapters/presenter/translators/fields/EmailFieldTranslator.js +30 -0
- package/es/platform/zform/adapters/presenter/translators/fields/LookUpFieldTranslator.js +30 -0
- package/es/platform/zform/adapters/presenter/translators/fields/MultiselectFieldTranslator.js +29 -0
- package/es/platform/zform/adapters/presenter/translators/fields/NumberFieldTranslator.js +30 -0
- package/es/platform/zform/adapters/presenter/translators/fields/PercentageFieldTranslator.js +30 -0
- package/es/platform/zform/adapters/presenter/translators/fields/PhoneFieldTranslator.js +30 -0
- package/es/platform/zform/adapters/presenter/translators/fields/PicklistFieldTranslator.js +29 -0
- package/es/platform/zform/adapters/presenter/translators/fields/TextAreaFieldTranslator.js +30 -0
- package/es/platform/zform/adapters/presenter/translators/fields/TextFieldTranslator.js +27 -0
- package/es/platform/zform/adapters/presenter/translators/fields/URLFieldTranslator.js +30 -0
- package/es/platform/zform/adapters/presenter/translators/fields/index.js +15 -0
- package/es/platform/zform/applications/usecases/MyFormSuccessUseCase.js +3 -1
- package/es/platform/zform/domain/ZField.js +66 -17
- package/es/platform/zform/domain/ZSection.js +20 -7
- package/es/platform/zlist/adapters/presenters/TableTranslator.js +3 -3
- package/package.json +3 -3
|
@@ -18,6 +18,15 @@ import PickListProperties from "../fields/pick-list/Properties";
|
|
|
18
18
|
import TextProperties from "../fields/text/Properties";
|
|
19
19
|
import UrlProperties from "../fields/url/Properties";
|
|
20
20
|
const TableListProperties = {
|
|
21
|
+
isReOrderLoading: {
|
|
22
|
+
required: false,
|
|
23
|
+
typeMetadata: {
|
|
24
|
+
schema: {
|
|
25
|
+
type: 'boolean'
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
defaultValue: false
|
|
29
|
+
},
|
|
21
30
|
isLoading: {
|
|
22
31
|
required: false,
|
|
23
32
|
typeMetadata: {
|
|
@@ -154,6 +154,15 @@ const TableRowProperties = {
|
|
|
154
154
|
type: "string"
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
|
+
},
|
|
158
|
+
isReOrderLoading: {
|
|
159
|
+
required: false,
|
|
160
|
+
defaultValue: false,
|
|
161
|
+
typeMetadata: {
|
|
162
|
+
schema: {
|
|
163
|
+
type: 'boolean'
|
|
164
|
+
}
|
|
165
|
+
}
|
|
157
166
|
}
|
|
158
167
|
};
|
|
159
168
|
export default TableRowProperties;
|
package/es/index.js
CHANGED
|
@@ -9,4 +9,5 @@ import * as _Components from "./library/dot/legacy-to-new-arch";
|
|
|
9
9
|
export { _Components as Components };
|
|
10
10
|
export { platformSDK } from "./platform/sdk/frameworks/Sdk";
|
|
11
11
|
export { sdkRegistry } from "./platform/sdk/frameworks/SdkRegistry";
|
|
12
|
-
export { validations as defaultFieldValidations } from "./library/behaviours/field-validation/frameworks/utils/FormBasicValidationAdaptor";
|
|
12
|
+
export { validations as defaultFieldValidations } from "./library/behaviours/field-validation/frameworks/utils/FormBasicValidationAdaptor";
|
|
13
|
+
export { getClientActionsAdapter, fetchClientActions } from "./platform/client-actions/components/action-event-mediator/frameworks/ui/ClientActionsAdapter";
|
|
@@ -2,7 +2,7 @@ import { useCallback } from 'react';
|
|
|
2
2
|
import TableListEventConstants from "../../../../../../cc/table-list/Constants";
|
|
3
3
|
import { useRowData } from "./useRowData";
|
|
4
4
|
import { useDropIndicator } from "./useDropIndicator";
|
|
5
|
-
import { reorderArray,
|
|
5
|
+
import { reorderArray, setTableInteractionClass, adjustHelperElementPosition, getDropIndicator } from "../utils/reOrder"; // @ts-ignore
|
|
6
6
|
|
|
7
7
|
import style from "./../ui/css/TableList.module.css";
|
|
8
8
|
export function useTableRowReorder(_ref) {
|
|
@@ -22,8 +22,9 @@ export function useTableRowReorder(_ref) {
|
|
|
22
22
|
let {
|
|
23
23
|
index
|
|
24
24
|
} = _ref2;
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
setTableInteractionClass(TableRef, style.preventTextSelection, true);
|
|
26
|
+
setTableInteractionClass(TableRef, style.preventPointerEvents, true);
|
|
27
|
+
adjustHelperElementPosition(TableRef, getHelperClass());
|
|
27
28
|
dispatch({
|
|
28
29
|
type: TABLE_LIST_ROW_DRAG_START,
|
|
29
30
|
payload: {
|
|
@@ -37,7 +38,8 @@ export function useTableRowReorder(_ref) {
|
|
|
37
38
|
oldIndex,
|
|
38
39
|
newIndex
|
|
39
40
|
} = _ref3;
|
|
40
|
-
|
|
41
|
+
setTableInteractionClass(TableRef, style.preventTextSelection, false);
|
|
42
|
+
setTableInteractionClass(TableRef, style.preventPointerEvents, false);
|
|
41
43
|
let arr = reorderArray(rowData, oldIndex, newIndex);
|
|
42
44
|
setRowData(arr);
|
|
43
45
|
setDropIndicator({
|
|
@@ -80,6 +82,14 @@ export function useTableRowReorder(_ref) {
|
|
|
80
82
|
width: TableRef.current.offsetWidth
|
|
81
83
|
};
|
|
82
84
|
}, [TableRef]);
|
|
85
|
+
const getHelperContainer = useCallback(() => {
|
|
86
|
+
return TableRef.current;
|
|
87
|
+
}, [TableRef]);
|
|
88
|
+
|
|
89
|
+
const getHelperClass = () => {
|
|
90
|
+
return style.dragging;
|
|
91
|
+
};
|
|
92
|
+
|
|
83
93
|
return {
|
|
84
94
|
rowData,
|
|
85
95
|
dropIndicator,
|
|
@@ -88,6 +98,8 @@ export function useTableRowReorder(_ref) {
|
|
|
88
98
|
handleSortOver,
|
|
89
99
|
getHelperDimensions,
|
|
90
100
|
setRowData,
|
|
91
|
-
setDropIndicator
|
|
101
|
+
setDropIndicator,
|
|
102
|
+
getHelperContainer,
|
|
103
|
+
getHelperClass
|
|
92
104
|
};
|
|
93
105
|
}
|
|
@@ -9,7 +9,8 @@ import Loading from "./sub-components/Loading";
|
|
|
9
9
|
import ColumnResizingLine from "./sub-components/ColumnResizingLine";
|
|
10
10
|
import handleScroll from "./handlers/HandleScroll";
|
|
11
11
|
import { useTableRowReorder } from "../hooks/useTableRowReorder";
|
|
12
|
-
import { SortableContainer } from 'react-sortable-hoc';
|
|
12
|
+
import { SortableContainer } from 'react-sortable-hoc';
|
|
13
|
+
import getTableListClassName from "../utils/getTableListClassName"; // @ts-ignore
|
|
13
14
|
|
|
14
15
|
import style from "./css/TableList.module.css";
|
|
15
16
|
|
|
@@ -25,6 +26,7 @@ function TableListView(_ref2, _ref) {
|
|
|
25
26
|
const {
|
|
26
27
|
data,
|
|
27
28
|
isLoading,
|
|
29
|
+
isReOrderLoading,
|
|
28
30
|
resizerState,
|
|
29
31
|
reOrderConfig,
|
|
30
32
|
selectionConfig,
|
|
@@ -49,24 +51,26 @@ function TableListView(_ref2, _ref) {
|
|
|
49
51
|
const isDataEmpty = !hasRows && !isLoading && !isError; // TODO: derive from state.properties
|
|
50
52
|
|
|
51
53
|
const isKeyboardControlsEnabled = keyboardControlsConfig.isEnabled;
|
|
52
|
-
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
const isReorderEnabled = reOrderConfig.isEnabled;
|
|
55
|
+
const isSelectionEnabled = selectionConfig.isEnabled;
|
|
56
|
+
const className = getTableListClassName({
|
|
57
|
+
isKeyboardControlsEnabled,
|
|
58
|
+
isReorderEnabled,
|
|
59
|
+
isSelectionEnabled
|
|
60
|
+
});
|
|
57
61
|
return /*#__PURE__*/React.createElement("div", {
|
|
58
|
-
className: style.wrapper
|
|
62
|
+
className: `${style.wrapper} ${style[className]}`,
|
|
59
63
|
ref: _ref
|
|
60
64
|
}, /*#__PURE__*/React.createElement(Table, {
|
|
61
|
-
ref:
|
|
65
|
+
ref: TableRef,
|
|
62
66
|
$event_onScroll: e => handleScroll(dispatch, {
|
|
63
67
|
scrollEvent: e
|
|
64
68
|
})
|
|
65
69
|
}, renderHeader({
|
|
66
70
|
headers,
|
|
67
71
|
resizerState,
|
|
68
|
-
|
|
69
|
-
|
|
72
|
+
isReorderEnabled,
|
|
73
|
+
isSelectionEnabled,
|
|
70
74
|
selection,
|
|
71
75
|
isKeyboardControlsEnabled,
|
|
72
76
|
isFlexibleColumns,
|
|
@@ -79,13 +83,14 @@ function TableListView(_ref2, _ref) {
|
|
|
79
83
|
headers,
|
|
80
84
|
rows,
|
|
81
85
|
isFlexibleColumns,
|
|
82
|
-
|
|
83
|
-
|
|
86
|
+
isReorderEnabled,
|
|
87
|
+
isSelectionEnabled,
|
|
84
88
|
isKeyboardControlsEnabled,
|
|
85
89
|
rowCursor,
|
|
86
90
|
hasRowActions,
|
|
87
91
|
rowActionsColumnWidth,
|
|
88
|
-
hasRows
|
|
92
|
+
hasRows,
|
|
93
|
+
isReOrderLoading
|
|
89
94
|
}), /*#__PURE__*/React.createElement(NoData, {
|
|
90
95
|
isDataEmpty: isDataEmpty,
|
|
91
96
|
emptyStateUiType: emptyStateUiType
|
|
@@ -101,8 +106,8 @@ function renderHeader(_ref3) {
|
|
|
101
106
|
let {
|
|
102
107
|
headers,
|
|
103
108
|
resizerState,
|
|
104
|
-
|
|
105
|
-
|
|
109
|
+
isReorderEnabled,
|
|
110
|
+
isSelectionEnabled,
|
|
106
111
|
selection,
|
|
107
112
|
isKeyboardControlsEnabled,
|
|
108
113
|
isFlexibleColumns,
|
|
@@ -111,8 +116,8 @@ function renderHeader(_ref3) {
|
|
|
111
116
|
dispatch
|
|
112
117
|
} = _ref3;
|
|
113
118
|
return /*#__PURE__*/React.createElement(Header, {
|
|
114
|
-
isReorderEnabled:
|
|
115
|
-
isSelectionEnabled:
|
|
119
|
+
isReorderEnabled: isReorderEnabled,
|
|
120
|
+
isSelectionEnabled: isSelectionEnabled,
|
|
116
121
|
isResizerEnabled: resizerState.isEnabled,
|
|
117
122
|
isKeyboardControlsEnabled: isKeyboardControlsEnabled,
|
|
118
123
|
currentlyResizingColumn: resizerState.currentlyResizingColumn,
|
|
@@ -146,13 +151,14 @@ function renderBody(_ref4) {
|
|
|
146
151
|
headers,
|
|
147
152
|
rows,
|
|
148
153
|
isFlexibleColumns,
|
|
149
|
-
|
|
150
|
-
|
|
154
|
+
isReorderEnabled,
|
|
155
|
+
isSelectionEnabled,
|
|
151
156
|
isKeyboardControlsEnabled,
|
|
152
157
|
rowCursor,
|
|
153
158
|
hasRowActions,
|
|
154
159
|
rowActionsColumnWidth,
|
|
155
|
-
hasRows
|
|
160
|
+
hasRows,
|
|
161
|
+
isReOrderLoading
|
|
156
162
|
} = _ref4;
|
|
157
163
|
const {
|
|
158
164
|
rowData,
|
|
@@ -160,7 +166,9 @@ function renderBody(_ref4) {
|
|
|
160
166
|
handleSortStart,
|
|
161
167
|
handleSortEnd,
|
|
162
168
|
handleSortOver,
|
|
163
|
-
getHelperDimensions
|
|
169
|
+
getHelperDimensions,
|
|
170
|
+
getHelperContainer,
|
|
171
|
+
getHelperClass
|
|
164
172
|
} = useTableRowReorder({
|
|
165
173
|
rows,
|
|
166
174
|
TableRef,
|
|
@@ -174,9 +182,9 @@ function renderBody(_ref4) {
|
|
|
174
182
|
return /*#__PURE__*/React.createElement(SortableTableContainer, {
|
|
175
183
|
hasRows: hasRows,
|
|
176
184
|
isFlexibleColumns: isFlexibleColumns,
|
|
177
|
-
helperClass:
|
|
185
|
+
helperClass: getHelperClass(),
|
|
178
186
|
useDragHandle: true,
|
|
179
|
-
helperContainer:
|
|
187
|
+
helperContainer: getHelperContainer,
|
|
180
188
|
onSortStart: handleSortStart,
|
|
181
189
|
onSortEnd: handleSortEnd,
|
|
182
190
|
onSortOver: handleSortOver,
|
|
@@ -189,13 +197,14 @@ function renderBody(_ref4) {
|
|
|
189
197
|
headers: headers,
|
|
190
198
|
rows: rowData,
|
|
191
199
|
isFlexibleColumns: isFlexibleColumns,
|
|
192
|
-
isReorderEnabled:
|
|
193
|
-
isSelectionEnabled:
|
|
200
|
+
isReorderEnabled: isReorderEnabled,
|
|
201
|
+
isSelectionEnabled: isSelectionEnabled,
|
|
194
202
|
rowCursor: rowCursor,
|
|
195
203
|
hasRowActions: hasRowActions,
|
|
196
204
|
rowActionsColumnWidth: rowActionsColumnWidth,
|
|
197
205
|
isKeyboardControlsEnabled: isKeyboardControlsEnabled,
|
|
198
|
-
dropIndicator: dropIndicator
|
|
206
|
+
dropIndicator: dropIndicator,
|
|
207
|
+
isReOrderLoading: isReOrderLoading
|
|
199
208
|
}));
|
|
200
209
|
}
|
|
201
210
|
|
|
@@ -1,3 +1,107 @@
|
|
|
1
|
+
/* Default: no special styles */
|
|
2
|
+
.tableListRow {
|
|
3
|
+
/* */
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
/* Keyboard + Reorder + Selection */
|
|
7
|
+
.tableListRow-kbdReorderSelection {
|
|
8
|
+
--local-tableList-selectionColumn-width: 56px;
|
|
9
|
+
--local-tableList-selectionColumn-left: 24px;
|
|
10
|
+
--local-tableList-reorder-left: 8px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/* Keyboard + Reorder, no Selection */
|
|
14
|
+
.tableListRow-kbdReorder {
|
|
15
|
+
--local-tableList-reorder-left: 8px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* Keyboard + Selection, no Reorder */
|
|
19
|
+
.tableListRow-kbdSelection {
|
|
20
|
+
--local-tableList-row-paddingLeft: 8px;
|
|
21
|
+
--local-tableList-selectionColumn-width: 72px;
|
|
22
|
+
--local-tableList-selectionColumn-left: 8px;
|
|
23
|
+
--local-tableList-selectionColumn-paddingRight: 8px;
|
|
24
|
+
--local-tableList-selectionColumn-justifyContent: center;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/* Keyboard only */
|
|
28
|
+
.tableListRow-kbd {
|
|
29
|
+
--local-tableList-reorder-left: 8px;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* Reorder + Selection, no Keyboard */
|
|
33
|
+
.tableListRow-reorderSelection {
|
|
34
|
+
--local-tableList-selectionColumn-width: 56px;
|
|
35
|
+
--local-tableList-selectionColumn-left: 24px;
|
|
36
|
+
--local-tableList-selectionColumn-paddingRight: 16px;
|
|
37
|
+
--local-tableList-reorder-paddingLeft: 8px;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* Reorder only */
|
|
41
|
+
.tableListRow-reorder {
|
|
42
|
+
--local-tableList-reorder-paddingLeft: 8px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/* Selection only */
|
|
46
|
+
.tableListRow-selection {
|
|
47
|
+
--local-tableList-selectionColumn-justifyContent: center;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* Default: no special styles */
|
|
51
|
+
.tableListHeader {
|
|
52
|
+
/* */
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* Keyboard + Reorder + Selection */
|
|
56
|
+
.tableListHeader-kbdReorderSelection {
|
|
57
|
+
--local-tableList-reorderHeader-paddingRight: 8px;
|
|
58
|
+
--local-tableList-massActionHeader-left: 24px;
|
|
59
|
+
--local-tableList-reorderHeader-left: 8px;
|
|
60
|
+
--local-tableList-reorderHeader-width: 16px;
|
|
61
|
+
|
|
62
|
+
--local-tableList-massActionHeader-left: 24px;
|
|
63
|
+
--local-tableList-massActionHeader-paddingRight: 24px;
|
|
64
|
+
--local-tableList-massActionHeader-width: 56px;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/* Keyboard + Reorder, no Selection */
|
|
68
|
+
.tableListHeader-kbdReorder {
|
|
69
|
+
--local-tableList-reorderHeader-left: 8px;
|
|
70
|
+
--local-tableList-reorderHeader-paddingRight: 8px;
|
|
71
|
+
--local-tableList-reorderHeader-width: 16px;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* Reorder only */
|
|
75
|
+
.tableListHeader-reorder {
|
|
76
|
+
--local-tableList-reorderHeader-width: 24px;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/* Keyboard + Selection, no Reorder */
|
|
80
|
+
.tableListHeader-kbdSelection {
|
|
81
|
+
--local-tableList-header-paddingLeft: 8px;
|
|
82
|
+
--local-tableList-massActionHeader-left: 8px;
|
|
83
|
+
--local-tableList-massActionHeader-paddingRight: 8px;
|
|
84
|
+
--local-tableList-massActionHeader-width: 72px;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/* Keyboard only */
|
|
88
|
+
.tableListHeader-kbd {
|
|
89
|
+
--local-tableList-header-paddingLeft: 24px;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/* Reorder + Selection, no Keyboard */
|
|
93
|
+
.tableListHeader-reorderSelection {
|
|
94
|
+
--local-tableList-reorderHeader-width: 24px;
|
|
95
|
+
--local-tableList-massActionHeader-left: 24px;
|
|
96
|
+
--local-tableList-massActionHeader-paddingRight: 24px;
|
|
97
|
+
--local-tableList-massActionHeader-width: 56px;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/* Selection only */
|
|
101
|
+
.tableListHeader-selection {
|
|
102
|
+
/* */
|
|
103
|
+
}
|
|
104
|
+
|
|
1
105
|
.loader {
|
|
2
106
|
padding: var(--zd_size40) 0
|
|
3
107
|
}
|
|
@@ -58,6 +162,17 @@
|
|
|
58
162
|
cursor: not-allowed
|
|
59
163
|
}
|
|
60
164
|
|
|
165
|
+
.preventTextSelection {
|
|
166
|
+
-webkit-user-select: none;
|
|
167
|
+
-moz-user-select: none;
|
|
168
|
+
-ms-user-select: none;
|
|
169
|
+
user-select: none;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.preventPointerEvents {
|
|
173
|
+
pointer-events: none;
|
|
174
|
+
}
|
|
175
|
+
|
|
61
176
|
.dragging {
|
|
62
177
|
overflow: hidden;
|
|
63
178
|
box-shadow: var(--local_tablelist_box_shadow);
|
|
@@ -86,16 +201,17 @@
|
|
|
86
201
|
composes: sticky from '~@zohodesk/components/es/common/common.module.css';
|
|
87
202
|
z-index: 1;
|
|
88
203
|
/* css:theme-validation:ignore */
|
|
89
|
-
padding: 0 ;
|
|
90
204
|
background-color: var(--local_tablelist_bg);
|
|
91
205
|
}
|
|
92
206
|
|
|
93
207
|
[dir=ltr] .dragHandleWrapper {
|
|
94
|
-
left:
|
|
208
|
+
left: var(--local-tableList-reorder-left, var(--zd_size0));
|
|
209
|
+
padding: 0 var(--local-tableList-reorder-paddingRight, var(--zd_size0)) 0 var(--local-tableList-reorder-paddingLeft, var(--zd_size0));
|
|
95
210
|
}
|
|
96
211
|
|
|
97
212
|
[dir=rtl] .dragHandleWrapper {
|
|
98
|
-
right:
|
|
213
|
+
right: var(--local-tableList-reorder-left, var(--zd_size0));
|
|
214
|
+
padding: 0 var(--local-tableList-reorder-paddingLeft, var(--zd_size0)) 0 var(--local-tableList-reorder-paddingRight, var(--zd_size0));
|
|
99
215
|
}
|
|
100
216
|
|
|
101
217
|
.rowDropIndicator {
|
|
@@ -104,7 +220,7 @@
|
|
|
104
220
|
/* css:theme-validation:ignore */
|
|
105
221
|
position: absolute;
|
|
106
222
|
z-index: 2;
|
|
107
|
-
background-color: var(--
|
|
223
|
+
background-color: var(--local_tablelist_reorder_placeholderline_bg);
|
|
108
224
|
}
|
|
109
225
|
|
|
110
226
|
.dropIndicatorTop {
|
|
@@ -115,75 +231,56 @@
|
|
|
115
231
|
bottom: calc( var(--zd_size3) * -1 ) ;
|
|
116
232
|
}
|
|
117
233
|
|
|
118
|
-
|
|
119
|
-
|
|
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;
|
|
234
|
+
.row {
|
|
235
|
+
--local_padding_left: var(--local-tableList-row-paddingLeft);
|
|
236
|
+
--local_margin_right: var(--local-tableList-row-marginRight);
|
|
152
237
|
}
|
|
153
238
|
|
|
154
|
-
|
|
155
|
-
|
|
239
|
+
.tableListSelectContainer {
|
|
240
|
+
--local_column_width: var(--local-tableList-selectionColumn-width);
|
|
241
|
+
justify-content: var(--local-tableList-selectionColumn-justifyContent, start);
|
|
156
242
|
}
|
|
157
243
|
|
|
158
|
-
[dir=ltr] .
|
|
159
|
-
|
|
244
|
+
[dir=ltr] .tableListSelectContainer {
|
|
245
|
+
left: var(--local-tableList-selectionColumn-left, var(--zd_size0));
|
|
246
|
+
padding-left: var(--local-tableList-selectionColumn-paddingLeft, var(--zd_size0));
|
|
247
|
+
padding-right: var(--local-tableList-selectionColumn-paddingRight, var(--zd_size0));
|
|
160
248
|
}
|
|
161
249
|
|
|
162
|
-
[dir=rtl] .
|
|
163
|
-
|
|
250
|
+
[dir=rtl] .tableListSelectContainer {
|
|
251
|
+
right: var(--local-tableList-selectionColumn-left, var(--zd_size0));
|
|
252
|
+
padding-right: var(--local-tableList-selectionColumn-paddingLeft, var(--zd_size0));
|
|
253
|
+
padding-left: var(--local-tableList-selectionColumn-paddingRight, var(--zd_size0));
|
|
164
254
|
}
|
|
165
255
|
|
|
166
|
-
|
|
167
|
-
|
|
256
|
+
.header {
|
|
257
|
+
--local_padding_left: var(--local-tableList-header-paddingLeft);
|
|
168
258
|
}
|
|
169
259
|
|
|
170
|
-
|
|
171
|
-
|
|
260
|
+
.reOrderHeader {
|
|
261
|
+
--local_column_width: var(--local-tableList-reorderHeader-width);
|
|
172
262
|
}
|
|
173
263
|
|
|
174
|
-
[dir=ltr] .
|
|
175
|
-
|
|
264
|
+
[dir=ltr] .reOrderHeader {
|
|
265
|
+
left: var(--local-tableList-reorderHeader-left, var(--zd_size0));
|
|
266
|
+
padding-right: var(--local-tableList-reorderHeader-paddingRight, var(--zd_size0));
|
|
176
267
|
}
|
|
177
268
|
|
|
178
|
-
[dir=rtl] .
|
|
179
|
-
|
|
269
|
+
[dir=rtl] .reOrderHeader {
|
|
270
|
+
right: var(--local-tableList-reorderHeader-left, var(--zd_size0));
|
|
271
|
+
padding-left: var(--local-tableList-reorderHeader-paddingRight, var(--zd_size0));
|
|
180
272
|
}
|
|
181
273
|
|
|
182
|
-
|
|
183
|
-
|
|
274
|
+
.massActionHeader {
|
|
275
|
+
--local_column_width: var(--local-tableList-massActionHeader-width);
|
|
184
276
|
}
|
|
185
277
|
|
|
186
|
-
[dir=
|
|
187
|
-
|
|
278
|
+
[dir=ltr] .massActionHeader {
|
|
279
|
+
left: var(--local-tableList-massActionHeader-left, var(--zd_size0));
|
|
280
|
+
padding-right: var(--local-tableList-massActionHeader-paddingRight, var(--zd_size0));
|
|
188
281
|
}
|
|
189
282
|
|
|
283
|
+
[dir=rtl] .massActionHeader {
|
|
284
|
+
right: var(--local-tableList-massActionHeader-left, var(--zd_size0));
|
|
285
|
+
padding-left: var(--local-tableList-massActionHeader-paddingRight, var(--zd_size0));
|
|
286
|
+
}
|
|
@@ -13,7 +13,8 @@ import MassAction from "./header/MassAction";
|
|
|
13
13
|
import Headers from "./header/Headers";
|
|
14
14
|
import ActionColumn from "./header/ActionColumn";
|
|
15
15
|
import ResizerExtraSpace from "./header/ResizerExtraSpace";
|
|
16
|
-
import
|
|
16
|
+
import getHeaderClasses from "./../../utils/getHeaderClasses";
|
|
17
|
+
import style from "./../css/TableList.module.css";
|
|
17
18
|
|
|
18
19
|
function Header(_ref2) {
|
|
19
20
|
let {
|
|
@@ -36,33 +37,38 @@ function Header(_ref2) {
|
|
|
36
37
|
return null;
|
|
37
38
|
}
|
|
38
39
|
|
|
40
|
+
const headerClasses = getHeaderClasses({
|
|
41
|
+
isReorderEnabled,
|
|
42
|
+
isSelectionEnabled,
|
|
43
|
+
isKeyboardControlsEnabled
|
|
44
|
+
});
|
|
39
45
|
return /*#__PURE__*/React.createElement(TableHeader, {
|
|
40
46
|
$flag_isColumnsFlexible: isFlexibleColumns,
|
|
41
47
|
$flag_padding: !isSelectionEnabled && !isReorderEnabled,
|
|
42
|
-
$flag_hasHighlighter: isKeyboardControlsEnabled
|
|
43
|
-
|
|
48
|
+
$flag_hasHighlighter: isKeyboardControlsEnabled,
|
|
49
|
+
customStyle: {
|
|
50
|
+
tableHeader: `${style.header} ${style[headerClasses]}`
|
|
51
|
+
}
|
|
52
|
+
}, /*#__PURE__*/React.createElement(TableHeaderRow, null, renderReOrderColumn(isReorderEnabled), rendermassAction(isSelectionEnabled, actions), renderHeaders(headers, currentlyResizingColumn, isResizerEnabled, isFlexibleColumns, dispatch), renderActionColumn(hasRowActions, rowActionsColumnWidth), renderResizerExtraSpace(isCurrentlyResizing, resizerExtraWidth)));
|
|
44
53
|
}
|
|
45
54
|
|
|
46
|
-
function rendermassAction(isSelectionEnabled,
|
|
55
|
+
function rendermassAction(isSelectionEnabled, actions) {
|
|
47
56
|
return /*#__PURE__*/React.createElement(MassAction, {
|
|
48
57
|
isSelectionEnabled: isSelectionEnabled,
|
|
49
|
-
isReorderEnabled: isReorderEnabled,
|
|
50
|
-
isKeyboardControlsEnabled: isKeyboardControlsEnabled,
|
|
51
58
|
actions: actions
|
|
52
59
|
});
|
|
53
60
|
}
|
|
54
61
|
|
|
55
|
-
function renderReOrderColumn(
|
|
56
|
-
if (isReorderEnabled) {
|
|
57
|
-
return
|
|
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));
|
|
62
|
+
function renderReOrderColumn(isReorderEnabled) {
|
|
63
|
+
if (!isReorderEnabled) {
|
|
64
|
+
return null;
|
|
65
65
|
}
|
|
66
|
+
|
|
67
|
+
return /*#__PURE__*/React.createElement(TableHeadFirstNode, {
|
|
68
|
+
customStyle: {
|
|
69
|
+
container: style.reOrderHeader
|
|
70
|
+
}
|
|
71
|
+
}, /*#__PURE__*/React.createElement(React.Fragment, null));
|
|
66
72
|
}
|
|
67
73
|
|
|
68
74
|
function renderHeaders(headers, currentlyResizingColumn, isResizerEnabled, isFlexibleColumns, dispatch) {
|
|
@@ -15,7 +15,8 @@ const Rows = _ref => {
|
|
|
15
15
|
hasRowActions,
|
|
16
16
|
rowActionsColumnWidth,
|
|
17
17
|
isKeyboardControlsEnabled,
|
|
18
|
-
dropIndicator
|
|
18
|
+
dropIndicator,
|
|
19
|
+
isReOrderLoading
|
|
19
20
|
} = _ref;
|
|
20
21
|
return rows.map((row, index) => {
|
|
21
22
|
const isDroppable = dropIndicator.index !== null ? dropIndicator.index === index ? true : false : false;
|
|
@@ -23,12 +24,13 @@ const Rows = _ref => {
|
|
|
23
24
|
return /*#__PURE__*/React.createElement(SortableRow, {
|
|
24
25
|
key: `${row.id}`,
|
|
25
26
|
index: index,
|
|
26
|
-
|
|
27
|
+
disabled: isReOrderLoading,
|
|
28
|
+
...getRowProps(row, headers, isFlexibleColumns, isReorderEnabled, isSelectionEnabled, rowCursor, hasRowActions, rowActionsColumnWidth, isKeyboardControlsEnabled, isDroppable, dropPosition, isReOrderLoading)
|
|
27
29
|
});
|
|
28
30
|
});
|
|
29
31
|
};
|
|
30
32
|
|
|
31
|
-
function getRowProps(row, headers, isFlexibleColumns, isReorderEnabled, isSelectionEnabled, rowCursor, hasRowActions, rowActionsColumnWidth, isKeyboardControlsEnabled, isDroppable, dropPosition) {
|
|
33
|
+
function getRowProps(row, headers, isFlexibleColumns, isReorderEnabled, isSelectionEnabled, rowCursor, hasRowActions, rowActionsColumnWidth, isKeyboardControlsEnabled, isDroppable, dropPosition, isReOrderLoading) {
|
|
32
34
|
const {
|
|
33
35
|
id,
|
|
34
36
|
columns,
|
|
@@ -55,7 +57,8 @@ function getRowProps(row, headers, isFlexibleColumns, isReorderEnabled, isSelect
|
|
|
55
57
|
isKeyboardControlsEnabled,
|
|
56
58
|
rowActionsColumnWidth,
|
|
57
59
|
isDroppable,
|
|
58
|
-
dropPosition
|
|
60
|
+
dropPosition,
|
|
61
|
+
isReOrderLoading
|
|
59
62
|
};
|
|
60
63
|
}
|
|
61
64
|
|
package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/MassAction.js
CHANGED
|
@@ -2,13 +2,11 @@ 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 "
|
|
5
|
+
import style from "./../../css/TableList.module.css";
|
|
6
6
|
|
|
7
7
|
function MassAction(_ref) {
|
|
8
8
|
let {
|
|
9
9
|
isSelectionEnabled,
|
|
10
|
-
isReorderEnabled,
|
|
11
|
-
isKeyboardControlsEnabled,
|
|
12
10
|
actions
|
|
13
11
|
} = _ref;
|
|
14
12
|
|
|
@@ -16,16 +14,11 @@ function MassAction(_ref) {
|
|
|
16
14
|
return null;
|
|
17
15
|
}
|
|
18
16
|
|
|
19
|
-
const customPropsContainer = isReorderEnabled && isSelectionEnabled ? {
|
|
20
|
-
$data_width: 56
|
|
21
|
-
} : {};
|
|
22
|
-
|
|
23
17
|
if (!actions || actions.length === 0) {
|
|
24
18
|
return /*#__PURE__*/React.createElement(TableHeadFirstNode, {
|
|
25
19
|
customStyle: {
|
|
26
|
-
container:
|
|
27
|
-
}
|
|
28
|
-
$customProps_container: customPropsContainer
|
|
20
|
+
container: style.massActionHeader
|
|
21
|
+
}
|
|
29
22
|
}, /*#__PURE__*/React.createElement(TableHeading, {
|
|
30
23
|
$i18n_text: "M/A",
|
|
31
24
|
$i18n_tooltip: "Mass Action"
|
|
@@ -34,9 +27,8 @@ function MassAction(_ref) {
|
|
|
34
27
|
|
|
35
28
|
return /*#__PURE__*/React.createElement(TableHeadFirstNode, {
|
|
36
29
|
customStyle: {
|
|
37
|
-
container:
|
|
38
|
-
}
|
|
39
|
-
$customProps_container: customPropsContainer
|
|
30
|
+
container: style.massActionHeader
|
|
31
|
+
}
|
|
40
32
|
}, /*#__PURE__*/React.createElement(ActionEventMediator, {
|
|
41
33
|
actions: actions
|
|
42
34
|
}));
|