@zohodesk/library-platform 1.1.3-exp.3 → 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/bc/zlist/Constants.js +3 -1
- package/es/bc/zrecord/Constants.js +3 -1
- package/es/cc/table-connected/Properties.js +16 -0
- package/es/cc/table-list/Constants.js +4 -0
- package/es/cc/table-list/Properties.js +25 -0
- package/es/cc/table-list/row/Properties.js +44 -0
- package/es/index.js +2 -1
- package/es/library/dot/components/table-list/frameworks/hooks/useDropIndicator.js +8 -0
- package/es/library/dot/components/table-list/frameworks/hooks/useRowData.js +8 -0
- package/es/library/dot/components/table-list/frameworks/hooks/useTableRowReorder.js +105 -0
- package/es/library/dot/components/table-list/frameworks/ui/TableListView.js +85 -15
- package/es/library/dot/components/table-list/frameworks/ui/css/TableList.module.css +241 -1
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/Header.js +28 -4
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/Rows.js +25 -9
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/MassAction.js +11 -2
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/Row.js +50 -8
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/RowSelection.js +6 -1
- 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 +90 -0
- 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/adapters/controllers/ReOrderFinishController.js +21 -0
- package/es/platform/components/table-connected/adapters/resources/SmartTableResource.js +14 -0
- package/es/platform/components/table-connected/frameworks/EventHandlersFactory.js +5 -2
- package/es/platform/components/table-connected/frameworks/ListSdkFactory.js +4 -2
- package/es/platform/components/table-connected/frameworks/TableConnectedView.js +5 -1
- package/es/platform/data-source/http-template/reOrderRecord.js +44 -0
- package/es/platform/data-source/index.js +2 -0
- package/es/platform/sdk/application/interfaces/gateways/AbstractResource.js +1 -2
- package/es/platform/sdk/domain/entities/ResourceManager.js +1 -1
- 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/controllers/ReOrderController.js +25 -0
- package/es/platform/zlist/adapters/controllers/ReOrderFailedController.js +26 -0
- package/es/platform/zlist/adapters/gateways/Repository.js +7 -0
- package/es/platform/zlist/adapters/gateways/Service.js +8 -0
- package/es/platform/zlist/adapters/presenters/TableTranslator.js +6 -2
- package/es/platform/zlist/adapters/presenters/translators/ColumnTranslator.js +9 -10
- package/es/platform/zlist/adapters/presenters/utils/DefaultClientActions.js +1 -1
- package/es/platform/zlist/applications/interfaces/input/ReOrderRecordUseCaseInput.js +1 -0
- package/es/platform/zlist/applications/usecases/ReOrderFailedUseCase.js +22 -0
- package/es/platform/zlist/applications/usecases/ReOrderUseCase.js +25 -0
- package/es/platform/zlist/applications/usecases/RecordSuccessCallbackUsecase.js +24 -3
- package/es/platform/zlist/domain/entities/List.js +66 -2
- package/es/platform/zlist/frameworks/EventHandlersFactory.js +7 -3
- package/es/platform/zlist/frameworks/ZListBehaviourFactory.js +2 -1
- package/es/platform/zrecord/domain/entities/GetReOrderRecordsStrategy.js +40 -0
- package/es/platform/zrecord/domain/entities/RecordsManager.js +3 -1
- package/package.json +6 -3
|
@@ -1,36 +1,151 @@
|
|
|
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
|
}
|
|
108
|
+
|
|
4
109
|
.wrapper {
|
|
5
110
|
height: 100% ;
|
|
6
111
|
width: 100% ;
|
|
7
112
|
position: relative
|
|
8
113
|
}
|
|
114
|
+
|
|
9
115
|
.resizerSpace {
|
|
10
116
|
width: calc(var(--local_table_resizer_extra_space, 0) * var(--zd_size1));
|
|
11
117
|
flex-shrink: 0
|
|
12
118
|
}
|
|
119
|
+
|
|
13
120
|
.contentWrapper {
|
|
14
121
|
composes: sticky from '~@zohodesk/components/es/common/common.module.css';
|
|
15
122
|
}
|
|
123
|
+
|
|
16
124
|
[dir=ltr] .contentWrapper {
|
|
17
125
|
left: 0 ;
|
|
18
126
|
}
|
|
127
|
+
|
|
19
128
|
[dir=rtl] .contentWrapper {
|
|
20
129
|
right: 0 ;
|
|
21
130
|
}
|
|
131
|
+
|
|
22
132
|
.initialLoading {
|
|
23
133
|
height: calc(100% - (var(--zd_size100)))
|
|
24
134
|
}
|
|
135
|
+
|
|
25
136
|
.emptyContent {
|
|
26
137
|
padding: var(--zd_size160) 0 var(--zd_size60)
|
|
27
138
|
}
|
|
139
|
+
|
|
28
140
|
.errorContent {
|
|
29
141
|
padding: var(--zd_size60) 0
|
|
30
142
|
}
|
|
31
|
-
|
|
143
|
+
|
|
144
|
+
.headerWithActions,
|
|
145
|
+
.fieldWithActions {
|
|
32
146
|
gap: var(--zd_size6)
|
|
33
147
|
}
|
|
148
|
+
|
|
34
149
|
.actions {
|
|
35
150
|
gap: var(--zd_size8)
|
|
36
151
|
}
|
|
@@ -38,9 +153,134 @@
|
|
|
38
153
|
.rowCursor_default {
|
|
39
154
|
cursor: default
|
|
40
155
|
}
|
|
156
|
+
|
|
41
157
|
.rowCursor_pointer {
|
|
42
158
|
cursor: pointer
|
|
43
159
|
}
|
|
160
|
+
|
|
44
161
|
.rowCursor_not-allowed {
|
|
45
162
|
cursor: not-allowed
|
|
163
|
+
}
|
|
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
|
+
|
|
176
|
+
.dragging {
|
|
177
|
+
overflow: hidden;
|
|
178
|
+
box-shadow: var(--local_tablelist_box_shadow);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
:global(.GLOBAL_ZDDC_tableList).dragging .dragHandleContainer {
|
|
182
|
+
/* css:theme-validation:ignore */
|
|
183
|
+
color: var(--local_drag_handle_hover_color);
|
|
184
|
+
background-color: var(--local_drag_handle_dragging_bg);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
:global(.GLOBAL_ZDDC_tableList).dragging .dragHandleContainer,
|
|
188
|
+
:global(.GLOBAL_ZDDC_tableList:hover) .dragHandleContainer,
|
|
189
|
+
:global(.GLOBAL_ZDDC_tableList:focus-within) .dragHandleContainer {
|
|
190
|
+
visibility: visible;
|
|
191
|
+
opacity: 1;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.dragHandleContainer {
|
|
195
|
+
opacity: 0;
|
|
196
|
+
visibility: hidden;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.dragHandleWrapper {
|
|
200
|
+
align-self: stretch;
|
|
201
|
+
composes: sticky from '~@zohodesk/components/es/common/common.module.css';
|
|
202
|
+
z-index: 1;
|
|
203
|
+
/* css:theme-validation:ignore */
|
|
204
|
+
background-color: var(--local_tablelist_bg);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
[dir=ltr] .dragHandleWrapper {
|
|
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));
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
[dir=rtl] .dragHandleWrapper {
|
|
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));
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.rowDropIndicator {
|
|
218
|
+
width: 100% ;
|
|
219
|
+
height: var(--zd_size2) ;
|
|
220
|
+
/* css:theme-validation:ignore */
|
|
221
|
+
position: absolute;
|
|
222
|
+
z-index: 2;
|
|
223
|
+
background-color: var(--local_tablelist_reorder_placeholderline_bg);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.dropIndicatorTop {
|
|
227
|
+
top: 0 ;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.dropIndicatorBottom {
|
|
231
|
+
bottom: calc( var(--zd_size3) * -1 ) ;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.row {
|
|
235
|
+
--local_padding_left: var(--local-tableList-row-paddingLeft);
|
|
236
|
+
--local_margin_right: var(--local-tableList-row-marginRight);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.tableListSelectContainer {
|
|
240
|
+
--local_column_width: var(--local-tableList-selectionColumn-width);
|
|
241
|
+
justify-content: var(--local-tableList-selectionColumn-justifyContent, start);
|
|
242
|
+
}
|
|
243
|
+
|
|
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));
|
|
248
|
+
}
|
|
249
|
+
|
|
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));
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.header {
|
|
257
|
+
--local_padding_left: var(--local-tableList-header-paddingLeft);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.reOrderHeader {
|
|
261
|
+
--local_column_width: var(--local-tableList-reorderHeader-width);
|
|
262
|
+
}
|
|
263
|
+
|
|
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));
|
|
267
|
+
}
|
|
268
|
+
|
|
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));
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.massActionHeader {
|
|
275
|
+
--local_column_width: var(--local-tableList-massActionHeader-width);
|
|
276
|
+
}
|
|
277
|
+
|
|
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));
|
|
281
|
+
}
|
|
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));
|
|
46
286
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import TableHeader from '@zohodesk-private/desk-components/es/table/TableHeader/TableHeader';
|
|
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';
|
|
3
4
|
|
|
4
5
|
const TableHeaderRow = _ref => {
|
|
5
6
|
let {
|
|
@@ -12,9 +13,12 @@ import MassAction from "./header/MassAction";
|
|
|
12
13
|
import Headers from "./header/Headers";
|
|
13
14
|
import ActionColumn from "./header/ActionColumn";
|
|
14
15
|
import ResizerExtraSpace from "./header/ResizerExtraSpace";
|
|
16
|
+
import getHeaderClasses from "./../../utils/getHeaderClasses";
|
|
17
|
+
import style from "./../css/TableList.module.css";
|
|
15
18
|
|
|
16
19
|
function Header(_ref2) {
|
|
17
20
|
let {
|
|
21
|
+
isReorderEnabled,
|
|
18
22
|
isSelectionEnabled,
|
|
19
23
|
actions,
|
|
20
24
|
isKeyboardControlsEnabled,
|
|
@@ -33,11 +37,19 @@ function Header(_ref2) {
|
|
|
33
37
|
return null;
|
|
34
38
|
}
|
|
35
39
|
|
|
40
|
+
const headerClasses = getHeaderClasses({
|
|
41
|
+
isReorderEnabled,
|
|
42
|
+
isSelectionEnabled,
|
|
43
|
+
isKeyboardControlsEnabled
|
|
44
|
+
});
|
|
36
45
|
return /*#__PURE__*/React.createElement(TableHeader, {
|
|
37
46
|
$flag_isColumnsFlexible: isFlexibleColumns,
|
|
38
|
-
$flag_padding: !isSelectionEnabled,
|
|
39
|
-
$flag_hasHighlighter: isKeyboardControlsEnabled
|
|
40
|
-
|
|
47
|
+
$flag_padding: !isSelectionEnabled && !isReorderEnabled,
|
|
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)));
|
|
41
53
|
}
|
|
42
54
|
|
|
43
55
|
function rendermassAction(isSelectionEnabled, actions) {
|
|
@@ -47,6 +59,18 @@ function rendermassAction(isSelectionEnabled, actions) {
|
|
|
47
59
|
});
|
|
48
60
|
}
|
|
49
61
|
|
|
62
|
+
function renderReOrderColumn(isReorderEnabled) {
|
|
63
|
+
if (!isReorderEnabled) {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return /*#__PURE__*/React.createElement(TableHeadFirstNode, {
|
|
68
|
+
customStyle: {
|
|
69
|
+
container: style.reOrderHeader
|
|
70
|
+
}
|
|
71
|
+
}, /*#__PURE__*/React.createElement(React.Fragment, null));
|
|
72
|
+
}
|
|
73
|
+
|
|
50
74
|
function renderHeaders(headers, currentlyResizingColumn, isResizerEnabled, isFlexibleColumns, dispatch) {
|
|
51
75
|
return /*#__PURE__*/React.createElement(Headers, {
|
|
52
76
|
headers: headers,
|
|
@@ -1,24 +1,36 @@
|
|
|
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
|
+
}));
|
|
3
6
|
|
|
4
|
-
|
|
7
|
+
const Rows = _ref => {
|
|
5
8
|
let {
|
|
6
9
|
headers,
|
|
7
10
|
rows,
|
|
8
11
|
isFlexibleColumns,
|
|
12
|
+
isReorderEnabled,
|
|
9
13
|
isSelectionEnabled,
|
|
10
14
|
rowCursor,
|
|
11
15
|
hasRowActions,
|
|
12
16
|
rowActionsColumnWidth,
|
|
13
|
-
isKeyboardControlsEnabled
|
|
17
|
+
isKeyboardControlsEnabled,
|
|
18
|
+
dropIndicator,
|
|
19
|
+
isReOrderLoading
|
|
14
20
|
} = _ref;
|
|
15
|
-
return rows.map((row, index) =>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
21
|
+
return rows.map((row, index) => {
|
|
22
|
+
const isDroppable = dropIndicator.index !== null ? dropIndicator.index === index ? true : false : false;
|
|
23
|
+
const dropPosition = dropIndicator.position;
|
|
24
|
+
return /*#__PURE__*/React.createElement(SortableRow, {
|
|
25
|
+
key: `${row.id}`,
|
|
26
|
+
index: index,
|
|
27
|
+
disabled: isReOrderLoading,
|
|
28
|
+
...getRowProps(row, headers, isFlexibleColumns, isReorderEnabled, isSelectionEnabled, rowCursor, hasRowActions, rowActionsColumnWidth, isKeyboardControlsEnabled, isDroppable, dropPosition, isReOrderLoading)
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
};
|
|
20
32
|
|
|
21
|
-
function getRowProps(row, headers, isFlexibleColumns, isSelectionEnabled, rowCursor, hasRowActions, rowActionsColumnWidth, isKeyboardControlsEnabled) {
|
|
33
|
+
function getRowProps(row, headers, isFlexibleColumns, isReorderEnabled, isSelectionEnabled, rowCursor, hasRowActions, rowActionsColumnWidth, isKeyboardControlsEnabled, isDroppable, dropPosition, isReOrderLoading) {
|
|
22
34
|
const {
|
|
23
35
|
id,
|
|
24
36
|
columns,
|
|
@@ -38,11 +50,15 @@ function getRowProps(row, headers, isFlexibleColumns, isSelectionEnabled, rowCur
|
|
|
38
50
|
isFocussed,
|
|
39
51
|
selectionTooltip,
|
|
40
52
|
isFlexibleColumns,
|
|
53
|
+
isReorderEnabled,
|
|
41
54
|
isSelectionEnabled,
|
|
42
55
|
cursor: rowCursor,
|
|
43
56
|
hasActions: hasRowActions,
|
|
44
57
|
isKeyboardControlsEnabled,
|
|
45
|
-
rowActionsColumnWidth
|
|
58
|
+
rowActionsColumnWidth,
|
|
59
|
+
isDroppable,
|
|
60
|
+
dropPosition,
|
|
61
|
+
isReOrderLoading
|
|
46
62
|
};
|
|
47
63
|
}
|
|
48
64
|
|
package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/MassAction.js
CHANGED
|
@@ -2,6 +2,7 @@ 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 "./../../css/TableList.module.css";
|
|
5
6
|
|
|
6
7
|
function MassAction(_ref) {
|
|
7
8
|
let {
|
|
@@ -14,13 +15,21 @@ function MassAction(_ref) {
|
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
if (!actions || actions.length === 0) {
|
|
17
|
-
return /*#__PURE__*/React.createElement(TableHeadFirstNode,
|
|
18
|
+
return /*#__PURE__*/React.createElement(TableHeadFirstNode, {
|
|
19
|
+
customStyle: {
|
|
20
|
+
container: style.massActionHeader
|
|
21
|
+
}
|
|
22
|
+
}, /*#__PURE__*/React.createElement(TableHeading, {
|
|
18
23
|
$i18n_text: "M/A",
|
|
19
24
|
$i18n_tooltip: "Mass Action"
|
|
20
25
|
}));
|
|
21
26
|
}
|
|
22
27
|
|
|
23
|
-
return /*#__PURE__*/React.createElement(TableHeadFirstNode,
|
|
28
|
+
return /*#__PURE__*/React.createElement(TableHeadFirstNode, {
|
|
29
|
+
customStyle: {
|
|
30
|
+
container: style.massActionHeader
|
|
31
|
+
}
|
|
32
|
+
}, /*#__PURE__*/React.createElement(ActionEventMediator, {
|
|
24
33
|
actions: actions
|
|
25
34
|
}));
|
|
26
35
|
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import TableRow from '@zohodesk-private/desk-components/es/table/TableList/TableList';
|
|
3
|
+
import DragHandle from '@zohodesk-private/desk-components/es/DragHandle/DragHandle';
|
|
3
4
|
import RowSelection from "./RowSelection";
|
|
4
5
|
import Columns from "./Columns";
|
|
5
6
|
import RowActions from "./RowActions";
|
|
6
7
|
import { createCustomComponent } from "../../../../../../../custom-component";
|
|
7
8
|
import { RowEventHandlersFactory } from "./RowEventHandlersFactory";
|
|
8
9
|
import TableRowProperties from "../../../../../../../../cc/table-list/row/Properties";
|
|
9
|
-
import TableRowConstants from "../../../../../../../../cc/table-list/row/Constants";
|
|
10
|
+
import TableRowConstants from "../../../../../../../../cc/table-list/row/Constants";
|
|
11
|
+
import { SortableHandle } from 'react-sortable-hoc'; // @ts-ignore
|
|
10
12
|
|
|
11
13
|
import style from "../../css/TableList.module.css";
|
|
12
14
|
|
|
@@ -19,12 +21,16 @@ function RowView(_ref, ref) {
|
|
|
19
21
|
dispatch
|
|
20
22
|
} = helpers;
|
|
21
23
|
const {
|
|
24
|
+
isReorderEnabled,
|
|
22
25
|
isSelectionEnabled,
|
|
23
26
|
isSelected,
|
|
24
27
|
isSelectable,
|
|
25
28
|
isKeyboardControlsEnabled,
|
|
26
29
|
isFocussed,
|
|
27
|
-
selectionTooltip
|
|
30
|
+
selectionTooltip,
|
|
31
|
+
isDroppable,
|
|
32
|
+
dropPosition,
|
|
33
|
+
isReOrderLoading
|
|
28
34
|
} = state.properties;
|
|
29
35
|
const {
|
|
30
36
|
id,
|
|
@@ -43,7 +49,7 @@ function RowView(_ref, ref) {
|
|
|
43
49
|
key: id,
|
|
44
50
|
ref: ref,
|
|
45
51
|
testId: id,
|
|
46
|
-
$flag_padding: !isSelectionEnabled,
|
|
52
|
+
$flag_padding: !isSelectionEnabled && !isReorderEnabled,
|
|
47
53
|
$flag_active: isSelected,
|
|
48
54
|
$flag_hasHighlighter: isKeyboardControlsEnabled,
|
|
49
55
|
$flag_isHighlighted: isFocussed,
|
|
@@ -54,9 +60,13 @@ function RowView(_ref, ref) {
|
|
|
54
60
|
}
|
|
55
61
|
}),
|
|
56
62
|
customStyle: {
|
|
63
|
+
tableList: isSelectionEnabled || isReorderEnabled ? style.row : '',
|
|
57
64
|
$pointer: style[`rowCursor_${cursor}`]
|
|
58
65
|
}
|
|
59
|
-
},
|
|
66
|
+
}, renderReorderer({
|
|
67
|
+
isReorderEnabled,
|
|
68
|
+
isReOrderLoading
|
|
69
|
+
}), renderRowSelection({
|
|
60
70
|
isSelectionEnabled,
|
|
61
71
|
id,
|
|
62
72
|
selectionTooltip,
|
|
@@ -71,6 +81,8 @@ function RowView(_ref, ref) {
|
|
|
71
81
|
columnWidth: rowActionsColumnWidth,
|
|
72
82
|
type,
|
|
73
83
|
actions
|
|
84
|
+
}), isDroppable && /*#__PURE__*/React.createElement("div", {
|
|
85
|
+
className: `${style.rowDropIndicator} ${dropPosition === 'downward' && style.dropIndicatorTop} ${dropPosition === 'upward' && style.dropIndicatorBottom}`
|
|
74
86
|
}));
|
|
75
87
|
}
|
|
76
88
|
|
|
@@ -93,24 +105,54 @@ function renderRowSelection(_ref2) {
|
|
|
93
105
|
});
|
|
94
106
|
}
|
|
95
107
|
|
|
96
|
-
|
|
108
|
+
const DragHandler = SortableHandle(_ref3 => {
|
|
109
|
+
let {
|
|
110
|
+
isDisabled
|
|
111
|
+
} = _ref3;
|
|
112
|
+
return /*#__PURE__*/React.createElement(DragHandle, {
|
|
113
|
+
isDisabled: isDisabled,
|
|
114
|
+
customStyle: {
|
|
115
|
+
container: style.dragHandleContainer
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
function renderReorderer(_ref4) {
|
|
121
|
+
let {
|
|
122
|
+
isReorderEnabled,
|
|
123
|
+
isReOrderLoading
|
|
124
|
+
} = _ref4;
|
|
125
|
+
|
|
126
|
+
if (!isReorderEnabled) {
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return /*#__PURE__*/React.createElement("td", {
|
|
131
|
+
tabIndex: 0,
|
|
132
|
+
className: style.dragHandleWrapper
|
|
133
|
+
}, /*#__PURE__*/React.createElement(DragHandler, {
|
|
134
|
+
isDisabled: isReOrderLoading
|
|
135
|
+
}));
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function renderColumns(_ref5) {
|
|
97
139
|
let {
|
|
98
140
|
columns,
|
|
99
141
|
isFlexibleColumns
|
|
100
|
-
} =
|
|
142
|
+
} = _ref5;
|
|
101
143
|
return /*#__PURE__*/React.createElement(Columns, {
|
|
102
144
|
data: columns,
|
|
103
145
|
isFlexibleColumns: isFlexibleColumns
|
|
104
146
|
});
|
|
105
147
|
}
|
|
106
148
|
|
|
107
|
-
function renderRowActions(
|
|
149
|
+
function renderRowActions(_ref6) {
|
|
108
150
|
let {
|
|
109
151
|
hasActions,
|
|
110
152
|
columnWidth,
|
|
111
153
|
actions,
|
|
112
154
|
type
|
|
113
|
-
} =
|
|
155
|
+
} = _ref6;
|
|
114
156
|
return /*#__PURE__*/React.createElement(RowActions, {
|
|
115
157
|
hasActions: hasActions,
|
|
116
158
|
columnWidth: columnWidth,
|
package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/RowSelection.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import TableListSelect from '@zohodesk-private/desk-components/es/table/TableListSelect/TableListSelect';
|
|
3
|
-
import { TableListConstants } from "../../../../../../../../cc/table-list";
|
|
3
|
+
import { TableListConstants } from "../../../../../../../../cc/table-list"; // @ts-ignore
|
|
4
|
+
|
|
5
|
+
import style from "./../../css/TableList.module.css";
|
|
4
6
|
|
|
5
7
|
function RowSelection(_ref) {
|
|
6
8
|
let {
|
|
@@ -20,6 +22,9 @@ function RowSelection(_ref) {
|
|
|
20
22
|
$data_id: id,
|
|
21
23
|
$i18n_tooltip: tooltip,
|
|
22
24
|
$flag_checked: selected,
|
|
25
|
+
customStyle: {
|
|
26
|
+
container: style.tableListSelectContainer
|
|
27
|
+
},
|
|
23
28
|
$flag_disabled: !selectable,
|
|
24
29
|
$event_onChange: (_, event) => dispatch({
|
|
25
30
|
type: TableListConstants.TABLE_LIST_TOGGLE_ITEM_SELECTION,
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export default function getTableListHeaderClassName(_ref) {
|
|
2
|
+
let {
|
|
3
|
+
isKeyboardControlsEnabled,
|
|
4
|
+
isReorderEnabled,
|
|
5
|
+
isSelectionEnabled
|
|
6
|
+
} = _ref;
|
|
7
|
+
|
|
8
|
+
if (isKeyboardControlsEnabled && isReorderEnabled && isSelectionEnabled) {
|
|
9
|
+
return 'tableListHeader-kbdReorderSelection';
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
if (isKeyboardControlsEnabled && isReorderEnabled && !isSelectionEnabled) {
|
|
13
|
+
return 'tableListHeader-kbdReorder';
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
if (isKeyboardControlsEnabled && isSelectionEnabled && !isReorderEnabled) {
|
|
17
|
+
return 'tableListHeader-kbdSelection';
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (isKeyboardControlsEnabled && !isReorderEnabled && !isSelectionEnabled) {
|
|
21
|
+
return 'tableListHeader-kbd';
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (isReorderEnabled && isSelectionEnabled && !isKeyboardControlsEnabled) {
|
|
25
|
+
return 'tableListHeader-reorderSelection';
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (isReorderEnabled && !isSelectionEnabled && !isKeyboardControlsEnabled) {
|
|
29
|
+
return 'tableListHeader-reorder';
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (isSelectionEnabled && !isReorderEnabled && !isKeyboardControlsEnabled) {
|
|
33
|
+
return 'tableListHeader-selection';
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return 'tableListHeader';
|
|
37
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export default function getTableListClassName(_ref) {
|
|
2
|
+
let {
|
|
3
|
+
isKeyboardControlsEnabled,
|
|
4
|
+
isReorderEnabled,
|
|
5
|
+
isSelectionEnabled
|
|
6
|
+
} = _ref;
|
|
7
|
+
|
|
8
|
+
if (isKeyboardControlsEnabled && isReorderEnabled && isSelectionEnabled) {
|
|
9
|
+
return 'tableListRow-kbdReorderSelection';
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
if (isKeyboardControlsEnabled && isReorderEnabled && !isSelectionEnabled) {
|
|
13
|
+
return 'tableListRow-kbdReorder';
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
if (isKeyboardControlsEnabled && isSelectionEnabled && !isReorderEnabled) {
|
|
17
|
+
return 'tableListRow-kbdSelection';
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (isKeyboardControlsEnabled && !isReorderEnabled && !isSelectionEnabled) {
|
|
21
|
+
return 'tableListRow-kbd';
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (isReorderEnabled && isSelectionEnabled && !isKeyboardControlsEnabled) {
|
|
25
|
+
return 'tableListRow-reorderSelection';
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (isReorderEnabled && !isSelectionEnabled && !isKeyboardControlsEnabled) {
|
|
29
|
+
return 'tableListRow-reorder';
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (isSelectionEnabled && !isReorderEnabled && !isKeyboardControlsEnabled) {
|
|
33
|
+
return 'tableListRow-selection';
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return 'tableListRow';
|
|
37
|
+
}
|