@elastic/eui 72.2.0 → 74.0.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/dist/eui_theme_dark.css +15 -67
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +15 -67
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/basic_table/basic_table.js +56 -101
- package/es/components/basic_table/basic_table.styles.js +45 -0
- package/es/components/datagrid/controls/column_selector.js +23 -7
- package/es/components/datagrid/controls/column_sorting_draggable.js +17 -8
- package/es/components/datagrid/data_grid.a11y.js +3 -2
- package/es/components/modal/confirm_modal.js +5 -3
- package/es/components/modal/modal.a11y.js +1 -1
- package/es/components/modal/modal_header_title.js +12 -3
- package/es/components/notification/notification_event.a11y.js +113 -0
- package/es/components/page/page_header/page_header.a11y.js +32 -0
- package/es/components/portal/portal.a11y.js +70 -0
- package/es/components/resizable_container/resizable_panel.js +5 -0
- package/es/components/tool_tip/tool_tip.js +10 -5
- package/es/components/tool_tip/tool_tip_manager.js +42 -0
- package/es/services/security/get_secure_rel_for_target.js +2 -8
- package/es/services/theme/hooks.js +18 -0
- package/es/services/theme/index.js +1 -1
- package/eui.d.ts +57 -19
- package/i18ntokens.json +54 -38
- package/lib/components/basic_table/basic_table.js +56 -100
- package/lib/components/basic_table/basic_table.styles.js +54 -0
- package/lib/components/datagrid/controls/column_selector.js +21 -6
- package/lib/components/datagrid/controls/column_sorting_draggable.js +17 -8
- package/lib/components/datagrid/data_grid.a11y.js +3 -2
- package/lib/components/modal/confirm_modal.js +5 -3
- package/lib/components/modal/modal.a11y.js +1 -1
- package/lib/components/modal/modal_header_title.js +12 -3
- package/lib/components/notification/notification_event.a11y.js +117 -0
- package/lib/components/page/page_header/page_header.a11y.js +40 -0
- package/lib/components/portal/portal.a11y.js +73 -0
- package/lib/components/resizable_container/resizable_panel.js +5 -0
- package/lib/components/tool_tip/tool_tip.js +13 -7
- package/lib/components/tool_tip/tool_tip_manager.js +50 -0
- package/lib/services/security/get_secure_rel_for_target.js +2 -9
- package/lib/services/theme/hooks.js +22 -2
- package/lib/services/theme/index.js +6 -0
- package/optimize/es/components/basic_table/basic_table.js +56 -101
- package/optimize/es/components/basic_table/basic_table.styles.js +45 -0
- package/optimize/es/components/datagrid/controls/column_selector.js +22 -7
- package/optimize/es/components/datagrid/controls/column_sorting_draggable.js +17 -8
- package/optimize/es/components/datagrid/data_grid.a11y.js +3 -2
- package/optimize/es/components/modal/confirm_modal.js +4 -3
- package/optimize/es/components/modal/modal.a11y.js +1 -1
- package/optimize/es/components/modal/modal_header_title.js +4 -2
- package/optimize/es/components/notification/notification_event.a11y.js +103 -0
- package/optimize/es/components/page/page_header/page_header.a11y.js +32 -0
- package/optimize/es/components/portal/portal.a11y.js +60 -0
- package/optimize/es/components/tool_tip/tool_tip.js +10 -5
- package/optimize/es/components/tool_tip/tool_tip_manager.js +41 -0
- package/optimize/es/services/security/get_secure_rel_for_target.js +2 -8
- package/optimize/es/services/theme/hooks.js +18 -0
- package/optimize/es/services/theme/index.js +1 -1
- package/optimize/lib/components/basic_table/basic_table.js +56 -95
- package/optimize/lib/components/basic_table/basic_table.styles.js +56 -0
- package/optimize/lib/components/datagrid/controls/column_selector.js +21 -6
- package/optimize/lib/components/datagrid/controls/column_sorting_draggable.js +17 -8
- package/optimize/lib/components/datagrid/data_grid.a11y.js +3 -2
- package/optimize/lib/components/modal/confirm_modal.js +4 -3
- package/optimize/lib/components/modal/modal.a11y.js +1 -1
- package/optimize/lib/components/modal/modal_header_title.js +4 -2
- package/optimize/lib/components/notification/notification_event.a11y.js +117 -0
- package/optimize/lib/components/page/page_header/page_header.a11y.js +40 -0
- package/optimize/lib/components/portal/portal.a11y.js +73 -0
- package/optimize/lib/components/tool_tip/tool_tip.js +13 -7
- package/optimize/lib/components/tool_tip/tool_tip_manager.js +49 -0
- package/optimize/lib/services/security/get_secure_rel_for_target.js +2 -9
- package/optimize/lib/services/theme/hooks.js +22 -2
- package/optimize/lib/services/theme/index.js +6 -0
- package/package.json +1 -1
- package/src/components/datagrid/controls/_data_grid_column_sorting.scss +14 -13
- package/src/components/index.scss +0 -1
- package/test-env/components/basic_table/basic_table.js +56 -95
- package/test-env/components/basic_table/basic_table.styles.js +56 -0
- package/test-env/components/datagrid/controls/column_selector.js +21 -6
- package/test-env/components/datagrid/controls/column_sorting_draggable.js +17 -8
- package/test-env/components/datagrid/data_grid.a11y.js +3 -2
- package/test-env/components/modal/confirm_modal.js +5 -3
- package/test-env/components/modal/modal.a11y.js +1 -1
- package/test-env/components/modal/modal_header_title.js +12 -3
- package/test-env/components/notification/notification_event.a11y.js +117 -0
- package/test-env/components/page/page_header/page_header.a11y.js +40 -0
- package/test-env/components/portal/portal.a11y.js +73 -0
- package/test-env/components/resizable_container/resizable_panel.js +5 -0
- package/test-env/components/tool_tip/tool_tip.js +13 -7
- package/test-env/components/tool_tip/tool_tip_manager.js +49 -0
- package/test-env/services/security/get_secure_rel_for_target.js +2 -9
- package/test-env/services/theme/hooks.js +22 -2
- package/test-env/services/theme/index.js +6 -0
- package/es/services/url.js +0 -23
- package/lib/services/url.js +0 -32
- package/optimize/es/services/url.js +0 -23
- package/optimize/lib/services/url.js +0 -32
- package/src/components/basic_table/_basic_table.scss +0 -41
- package/src/components/basic_table/_index.scss +0 -1
- package/test-env/services/url.js +0 -32
package/i18ntokens.json
CHANGED
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
"highlighting": "string",
|
|
22
22
|
"loc": {
|
|
23
23
|
"start": {
|
|
24
|
-
"line":
|
|
24
|
+
"line": 319,
|
|
25
25
|
"column": 6
|
|
26
26
|
},
|
|
27
27
|
"end": {
|
|
28
|
-
"line":
|
|
28
|
+
"line": 319,
|
|
29
29
|
"column": 79
|
|
30
30
|
}
|
|
31
31
|
},
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
"highlighting": "string",
|
|
38
38
|
"loc": {
|
|
39
39
|
"start": {
|
|
40
|
-
"line":
|
|
40
|
+
"line": 621,
|
|
41
41
|
"column": 10
|
|
42
42
|
},
|
|
43
43
|
"end": {
|
|
44
|
-
"line":
|
|
44
|
+
"line": 625,
|
|
45
45
|
"column": 12
|
|
46
46
|
}
|
|
47
47
|
},
|
|
@@ -53,11 +53,11 @@
|
|
|
53
53
|
"highlighting": "string",
|
|
54
54
|
"loc": {
|
|
55
55
|
"start": {
|
|
56
|
-
"line":
|
|
56
|
+
"line": 634,
|
|
57
57
|
"column": 12
|
|
58
58
|
},
|
|
59
59
|
"end": {
|
|
60
|
-
"line":
|
|
60
|
+
"line": 638,
|
|
61
61
|
"column": 14
|
|
62
62
|
}
|
|
63
63
|
},
|
|
@@ -69,11 +69,11 @@
|
|
|
69
69
|
"highlighting": "string",
|
|
70
70
|
"loc": {
|
|
71
71
|
"start": {
|
|
72
|
-
"line":
|
|
72
|
+
"line": 642,
|
|
73
73
|
"column": 12
|
|
74
74
|
},
|
|
75
75
|
"end": {
|
|
76
|
-
"line":
|
|
76
|
+
"line": 646,
|
|
77
77
|
"column": 14
|
|
78
78
|
}
|
|
79
79
|
},
|
|
@@ -85,11 +85,11 @@
|
|
|
85
85
|
"highlighting": "string",
|
|
86
86
|
"loc": {
|
|
87
87
|
"start": {
|
|
88
|
-
"line":
|
|
88
|
+
"line": 651,
|
|
89
89
|
"column": 10
|
|
90
90
|
},
|
|
91
91
|
"end": {
|
|
92
|
-
"line":
|
|
92
|
+
"line": 655,
|
|
93
93
|
"column": 12
|
|
94
94
|
}
|
|
95
95
|
},
|
|
@@ -101,11 +101,11 @@
|
|
|
101
101
|
"highlighting": "string",
|
|
102
102
|
"loc": {
|
|
103
103
|
"start": {
|
|
104
|
-
"line":
|
|
104
|
+
"line": 697,
|
|
105
105
|
"column": 6
|
|
106
106
|
},
|
|
107
107
|
"end": {
|
|
108
|
-
"line":
|
|
108
|
+
"line": 697,
|
|
109
109
|
"column": 77
|
|
110
110
|
}
|
|
111
111
|
},
|
|
@@ -117,11 +117,11 @@
|
|
|
117
117
|
"highlighting": "string",
|
|
118
118
|
"loc": {
|
|
119
119
|
"start": {
|
|
120
|
-
"line":
|
|
120
|
+
"line": 1097,
|
|
121
121
|
"column": 8
|
|
122
122
|
},
|
|
123
123
|
"end": {
|
|
124
|
-
"line":
|
|
124
|
+
"line": 1097,
|
|
125
125
|
"column": 79
|
|
126
126
|
}
|
|
127
127
|
},
|
|
@@ -133,11 +133,11 @@
|
|
|
133
133
|
"highlighting": "string",
|
|
134
134
|
"loc": {
|
|
135
135
|
"start": {
|
|
136
|
-
"line":
|
|
136
|
+
"line": 1318,
|
|
137
137
|
"column": 8
|
|
138
138
|
},
|
|
139
139
|
"end": {
|
|
140
|
-
"line":
|
|
140
|
+
"line": 1322,
|
|
141
141
|
"column": 9
|
|
142
142
|
}
|
|
143
143
|
},
|
|
@@ -1071,17 +1071,33 @@
|
|
|
1071
1071
|
},
|
|
1072
1072
|
"filepath": "src/components/datagrid/body/header/data_grid_header_cell.tsx"
|
|
1073
1073
|
},
|
|
1074
|
+
{
|
|
1075
|
+
"token": "euiColumnSelector.dragHandleAriaLabel",
|
|
1076
|
+
"defString": "Drag handle",
|
|
1077
|
+
"highlighting": "string",
|
|
1078
|
+
"loc": {
|
|
1079
|
+
"start": {
|
|
1080
|
+
"line": 119,
|
|
1081
|
+
"column": 30
|
|
1082
|
+
},
|
|
1083
|
+
"end": {
|
|
1084
|
+
"line": 122,
|
|
1085
|
+
"column": 3
|
|
1086
|
+
}
|
|
1087
|
+
},
|
|
1088
|
+
"filepath": "src/components/datagrid/controls/column_selector.tsx"
|
|
1089
|
+
},
|
|
1074
1090
|
{
|
|
1075
1091
|
"token": "euiColumnSelector.button",
|
|
1076
1092
|
"defString": "Columns",
|
|
1077
1093
|
"highlighting": "string",
|
|
1078
1094
|
"loc": {
|
|
1079
1095
|
"start": {
|
|
1080
|
-
"line":
|
|
1096
|
+
"line": 125,
|
|
1081
1097
|
"column": 4
|
|
1082
1098
|
},
|
|
1083
1099
|
"end": {
|
|
1084
|
-
"line":
|
|
1100
|
+
"line": 125,
|
|
1085
1101
|
"column": 66
|
|
1086
1102
|
}
|
|
1087
1103
|
},
|
|
@@ -1093,11 +1109,11 @@
|
|
|
1093
1109
|
"highlighting": "string",
|
|
1094
1110
|
"loc": {
|
|
1095
1111
|
"start": {
|
|
1096
|
-
"line":
|
|
1112
|
+
"line": 130,
|
|
1097
1113
|
"column": 6
|
|
1098
1114
|
},
|
|
1099
1115
|
"end": {
|
|
1100
|
-
"line":
|
|
1116
|
+
"line": 134,
|
|
1101
1117
|
"column": 8
|
|
1102
1118
|
}
|
|
1103
1119
|
},
|
|
@@ -1109,11 +1125,11 @@
|
|
|
1109
1125
|
"highlighting": "string",
|
|
1110
1126
|
"loc": {
|
|
1111
1127
|
"start": {
|
|
1112
|
-
"line":
|
|
1128
|
+
"line": 138,
|
|
1113
1129
|
"column": 6
|
|
1114
1130
|
},
|
|
1115
1131
|
"end": {
|
|
1116
|
-
"line":
|
|
1132
|
+
"line": 142,
|
|
1117
1133
|
"column": 8
|
|
1118
1134
|
}
|
|
1119
1135
|
},
|
|
@@ -1125,11 +1141,11 @@
|
|
|
1125
1141
|
"highlighting": "string",
|
|
1126
1142
|
"loc": {
|
|
1127
1143
|
"start": {
|
|
1128
|
-
"line":
|
|
1144
|
+
"line": 171,
|
|
1129
1145
|
"column": 14
|
|
1130
1146
|
},
|
|
1131
1147
|
"end": {
|
|
1132
|
-
"line":
|
|
1148
|
+
"line": 177,
|
|
1133
1149
|
"column": 15
|
|
1134
1150
|
}
|
|
1135
1151
|
},
|
|
@@ -1141,11 +1157,11 @@
|
|
|
1141
1157
|
"highlighting": "string",
|
|
1142
1158
|
"loc": {
|
|
1143
1159
|
"start": {
|
|
1144
|
-
"line":
|
|
1160
|
+
"line": 171,
|
|
1145
1161
|
"column": 14
|
|
1146
1162
|
},
|
|
1147
1163
|
"end": {
|
|
1148
|
-
"line":
|
|
1164
|
+
"line": 177,
|
|
1149
1165
|
"column": 15
|
|
1150
1166
|
}
|
|
1151
1167
|
},
|
|
@@ -1157,11 +1173,11 @@
|
|
|
1157
1173
|
"highlighting": "string",
|
|
1158
1174
|
"loc": {
|
|
1159
1175
|
"start": {
|
|
1160
|
-
"line":
|
|
1176
|
+
"line": 293,
|
|
1161
1177
|
"column": 18
|
|
1162
1178
|
},
|
|
1163
1179
|
"end": {
|
|
1164
|
-
"line":
|
|
1180
|
+
"line": 296,
|
|
1165
1181
|
"column": 20
|
|
1166
1182
|
}
|
|
1167
1183
|
},
|
|
@@ -1173,11 +1189,11 @@
|
|
|
1173
1189
|
"highlighting": "string",
|
|
1174
1190
|
"loc": {
|
|
1175
1191
|
"start": {
|
|
1176
|
-
"line":
|
|
1192
|
+
"line": 306,
|
|
1177
1193
|
"column": 18
|
|
1178
1194
|
},
|
|
1179
1195
|
"end": {
|
|
1180
|
-
"line":
|
|
1196
|
+
"line": 309,
|
|
1181
1197
|
"column": 20
|
|
1182
1198
|
}
|
|
1183
1199
|
},
|
|
@@ -1237,11 +1253,11 @@
|
|
|
1237
1253
|
"highlighting": "string",
|
|
1238
1254
|
"loc": {
|
|
1239
1255
|
"start": {
|
|
1240
|
-
"line":
|
|
1256
|
+
"line": 85,
|
|
1241
1257
|
"column": 14
|
|
1242
1258
|
},
|
|
1243
1259
|
"end": {
|
|
1244
|
-
"line":
|
|
1260
|
+
"line": 89,
|
|
1245
1261
|
"column": 15
|
|
1246
1262
|
}
|
|
1247
1263
|
},
|
|
@@ -1253,11 +1269,11 @@
|
|
|
1253
1269
|
"highlighting": "string",
|
|
1254
1270
|
"loc": {
|
|
1255
1271
|
"start": {
|
|
1256
|
-
"line":
|
|
1272
|
+
"line": 101,
|
|
1257
1273
|
"column": 14
|
|
1258
1274
|
},
|
|
1259
1275
|
"end": {
|
|
1260
|
-
"line":
|
|
1276
|
+
"line": 105,
|
|
1261
1277
|
"column": 15
|
|
1262
1278
|
}
|
|
1263
1279
|
},
|
|
@@ -1269,11 +1285,11 @@
|
|
|
1269
1285
|
"highlighting": "string",
|
|
1270
1286
|
"loc": {
|
|
1271
1287
|
"start": {
|
|
1272
|
-
"line":
|
|
1288
|
+
"line": 157,
|
|
1273
1289
|
"column": 14
|
|
1274
1290
|
},
|
|
1275
1291
|
"end": {
|
|
1276
|
-
"line":
|
|
1292
|
+
"line": 161,
|
|
1277
1293
|
"column": 15
|
|
1278
1294
|
}
|
|
1279
1295
|
},
|
|
@@ -5173,11 +5189,11 @@
|
|
|
5173
5189
|
"highlighting": "string",
|
|
5174
5190
|
"loc": {
|
|
5175
5191
|
"start": {
|
|
5176
|
-
"line":
|
|
5192
|
+
"line": 318,
|
|
5177
5193
|
"column": 32
|
|
5178
5194
|
},
|
|
5179
5195
|
"end": {
|
|
5180
|
-
"line":
|
|
5196
|
+
"line": 321,
|
|
5181
5197
|
"column": 3
|
|
5182
5198
|
}
|
|
5183
5199
|
},
|
|
@@ -42,6 +42,8 @@ var _delay_render = require("../delay_render");
|
|
|
42
42
|
|
|
43
43
|
var _accessibility2 = require("../../services/accessibility");
|
|
44
44
|
|
|
45
|
+
var _basic_table = require("./basic_table.styles");
|
|
46
|
+
|
|
45
47
|
var _react2 = require("@emotion/react");
|
|
46
48
|
|
|
47
49
|
var _excluded = ["className", "loading", "items", "itemId", "columns", "pagination", "sorting", "selection", "onChange", "error", "noItemsMessage", "compressed", "itemIdToExpandedRowMap", "responsive", "isSelectable", "isExpandable", "hasActions", "rowProps", "cellProps", "tableCaption", "rowHeader", "tableLayout"],
|
|
@@ -202,45 +204,6 @@ var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
202
204
|
|
|
203
205
|
_this = _super.call(this, props);
|
|
204
206
|
|
|
205
|
-
_defineProperty(_assertThisInitialized(_this), "cleanups", []);
|
|
206
|
-
|
|
207
|
-
_defineProperty(_assertThisInitialized(_this), "tbody", null);
|
|
208
|
-
|
|
209
|
-
_defineProperty(_assertThisInitialized(_this), "setTbody", function (tbody) {
|
|
210
|
-
// remove listeners from an existing element
|
|
211
|
-
_this.removeLoadingListeners(); // update the ref
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
_this.tbody = tbody; // if loading, add listeners
|
|
215
|
-
|
|
216
|
-
if (_this.props.loading === true && tbody) {
|
|
217
|
-
_this.addLoadingListeners(tbody);
|
|
218
|
-
}
|
|
219
|
-
});
|
|
220
|
-
|
|
221
|
-
_defineProperty(_assertThisInitialized(_this), "addLoadingListeners", function (tbody) {
|
|
222
|
-
var listener = function listener(event) {
|
|
223
|
-
event.stopPropagation();
|
|
224
|
-
event.preventDefault();
|
|
225
|
-
};
|
|
226
|
-
|
|
227
|
-
['mousedown', 'mouseup', 'mouseover', 'mouseout', 'mouseenter', 'mouseleave', 'click', 'dblclick', 'keydown', 'keyup', 'keypress'].forEach(function (event) {
|
|
228
|
-
tbody.addEventListener(event, listener, true);
|
|
229
|
-
|
|
230
|
-
_this.cleanups.push(function () {
|
|
231
|
-
tbody.removeEventListener(event, listener, true);
|
|
232
|
-
});
|
|
233
|
-
});
|
|
234
|
-
});
|
|
235
|
-
|
|
236
|
-
_defineProperty(_assertThisInitialized(_this), "removeLoadingListeners", function () {
|
|
237
|
-
_this.cleanups.forEach(function (cleanup) {
|
|
238
|
-
return cleanup();
|
|
239
|
-
});
|
|
240
|
-
|
|
241
|
-
_this.cleanups.length = 0;
|
|
242
|
-
});
|
|
243
|
-
|
|
244
207
|
_defineProperty(_assertThisInitialized(_this), "tableId", (0, _accessibility2.htmlIdGenerator)('__table')());
|
|
245
208
|
|
|
246
209
|
_defineProperty(_assertThisInitialized(_this), "selectAllIdGenerator", (0, _accessibility2.htmlIdGenerator)('_selection_column-checkbox'));
|
|
@@ -332,27 +295,13 @@ var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
332
295
|
_createClass(EuiBasicTable, [{
|
|
333
296
|
key: "componentDidMount",
|
|
334
297
|
value: function componentDidMount() {
|
|
335
|
-
if (this.props.loading && this.tbody) this.addLoadingListeners(this.tbody);
|
|
336
298
|
this.getInitialSelection();
|
|
337
299
|
}
|
|
338
300
|
}, {
|
|
339
301
|
key: "componentDidUpdate",
|
|
340
|
-
value: function componentDidUpdate(
|
|
341
|
-
if (prevProps.loading !== this.props.loading) {
|
|
342
|
-
if (this.props.loading && this.tbody) {
|
|
343
|
-
this.addLoadingListeners(this.tbody);
|
|
344
|
-
} else {
|
|
345
|
-
this.removeLoadingListeners();
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
|
|
302
|
+
value: function componentDidUpdate() {
|
|
349
303
|
this.getInitialSelection();
|
|
350
304
|
}
|
|
351
|
-
}, {
|
|
352
|
-
key: "componentWillUnmount",
|
|
353
|
-
value: function componentWillUnmount() {
|
|
354
|
-
this.removeLoadingListeners();
|
|
355
|
-
}
|
|
356
305
|
}, {
|
|
357
306
|
key: "getInitialSelection",
|
|
358
307
|
value: function getInitialSelection() {
|
|
@@ -513,7 +462,8 @@ var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
513
462
|
var _this$props3 = this.props,
|
|
514
463
|
compressed = _this$props3.compressed,
|
|
515
464
|
responsive = _this$props3.responsive,
|
|
516
|
-
tableLayout = _this$props3.tableLayout
|
|
465
|
+
tableLayout = _this$props3.tableLayout,
|
|
466
|
+
loading = _this$props3.loading;
|
|
517
467
|
var mobileHeader = responsive ? (0, _react2.jsx)(_table.EuiTableHeaderMobile, null, (0, _react2.jsx)(_flex.EuiFlexGroup, {
|
|
518
468
|
responsive: false,
|
|
519
469
|
justifyContent: "spaceBetween",
|
|
@@ -531,7 +481,8 @@ var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
531
481
|
id: this.tableId,
|
|
532
482
|
tableLayout: tableLayout,
|
|
533
483
|
responsive: responsive,
|
|
534
|
-
compressed: compressed
|
|
484
|
+
compressed: compressed,
|
|
485
|
+
css: loading && _basic_table.safariLoadingWorkaround
|
|
535
486
|
}, caption, head, body, footer));
|
|
536
487
|
}
|
|
537
488
|
}, {
|
|
@@ -794,30 +745,35 @@ var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
794
745
|
value: function renderTableBody() {
|
|
795
746
|
var _this4 = this;
|
|
796
747
|
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
var
|
|
802
|
-
|
|
803
|
-
if (
|
|
804
|
-
|
|
748
|
+
var _this$props8 = this.props,
|
|
749
|
+
error = _this$props8.error,
|
|
750
|
+
loading = _this$props8.loading,
|
|
751
|
+
items = _this$props8.items;
|
|
752
|
+
var content;
|
|
753
|
+
|
|
754
|
+
if (error) {
|
|
755
|
+
content = this.renderErrorMessage(error);
|
|
756
|
+
} else if (items.length === 0) {
|
|
757
|
+
content = this.renderEmptyMessage();
|
|
758
|
+
} else {
|
|
759
|
+
content = items.map(function (item, index) {
|
|
760
|
+
// if there's pagination the item's index must be adjusted to the where it is in the whole dataset
|
|
761
|
+
var tableItemIndex = hasPagination(_this4.props) && _this4.props.pagination.pageSize > 0 ? _this4.props.pagination.pageIndex * _this4.props.pagination.pageSize + index : index;
|
|
762
|
+
return _this4.renderItemRow(item, tableItemIndex);
|
|
763
|
+
});
|
|
805
764
|
}
|
|
806
765
|
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
766
|
+
return (0, _react2.jsx)(_services.RenderWithEuiTheme, null, function (theme) {
|
|
767
|
+
return (0, _react2.jsx)(_table.EuiTableBody, {
|
|
768
|
+
css: loading && (0, _basic_table.euiBasicTableBodyLoading)(theme)
|
|
769
|
+
}, content);
|
|
811
770
|
});
|
|
812
|
-
return (0, _react2.jsx)(_table.EuiTableBody, {
|
|
813
|
-
bodyRef: this.setTbody
|
|
814
|
-
}, rows);
|
|
815
771
|
}
|
|
816
772
|
}, {
|
|
817
|
-
key: "
|
|
818
|
-
value: function
|
|
773
|
+
key: "renderErrorMessage",
|
|
774
|
+
value: function renderErrorMessage(error) {
|
|
819
775
|
var colSpan = this.props.columns.length + (this.props.selection ? 1 : 0);
|
|
820
|
-
return (0, _react2.jsx)(_table.
|
|
776
|
+
return (0, _react2.jsx)(_table.EuiTableRow, null, (0, _react2.jsx)(_table.EuiTableRowCell, {
|
|
821
777
|
align: "center",
|
|
822
778
|
colSpan: colSpan,
|
|
823
779
|
mobileOptions: {
|
|
@@ -826,38 +782,38 @@ var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
826
782
|
}, (0, _react2.jsx)(_icon.EuiIcon, {
|
|
827
783
|
type: "minusInCircle",
|
|
828
784
|
color: "danger"
|
|
829
|
-
}), " ", error))
|
|
785
|
+
}), " ", error));
|
|
830
786
|
}
|
|
831
787
|
}, {
|
|
832
|
-
key: "
|
|
833
|
-
value: function
|
|
834
|
-
var _this$
|
|
835
|
-
columns = _this$
|
|
836
|
-
selection = _this$
|
|
837
|
-
noItemsMessage = _this$
|
|
788
|
+
key: "renderEmptyMessage",
|
|
789
|
+
value: function renderEmptyMessage() {
|
|
790
|
+
var _this$props9 = this.props,
|
|
791
|
+
columns = _this$props9.columns,
|
|
792
|
+
selection = _this$props9.selection,
|
|
793
|
+
noItemsMessage = _this$props9.noItemsMessage;
|
|
838
794
|
var colSpan = columns.length + (selection ? 1 : 0);
|
|
839
|
-
return (0, _react2.jsx)(_table.
|
|
795
|
+
return (0, _react2.jsx)(_table.EuiTableRow, null, (0, _react2.jsx)(_table.EuiTableRowCell, {
|
|
840
796
|
align: "center",
|
|
841
797
|
colSpan: colSpan,
|
|
842
798
|
mobileOptions: {
|
|
843
799
|
width: '100%'
|
|
844
800
|
}
|
|
845
|
-
}, noItemsMessage))
|
|
801
|
+
}, noItemsMessage));
|
|
846
802
|
}
|
|
847
803
|
}, {
|
|
848
804
|
key: "renderItemRow",
|
|
849
805
|
value: function renderItemRow(item, rowIndex) {
|
|
850
806
|
var _this5 = this;
|
|
851
807
|
|
|
852
|
-
var _this$
|
|
853
|
-
columns = _this$
|
|
854
|
-
selection = _this$
|
|
855
|
-
isSelectable = _this$
|
|
856
|
-
hasActions = _this$
|
|
857
|
-
rowHeader = _this$
|
|
858
|
-
_this$
|
|
859
|
-
itemIdToExpandedRowMap = _this$
|
|
860
|
-
isExpandable = _this$
|
|
808
|
+
var _this$props10 = this.props,
|
|
809
|
+
columns = _this$props10.columns,
|
|
810
|
+
selection = _this$props10.selection,
|
|
811
|
+
isSelectable = _this$props10.isSelectable,
|
|
812
|
+
hasActions = _this$props10.hasActions,
|
|
813
|
+
rowHeader = _this$props10.rowHeader,
|
|
814
|
+
_this$props10$itemIdT = _this$props10.itemIdToExpandedRowMap,
|
|
815
|
+
itemIdToExpandedRowMap = _this$props10$itemIdT === void 0 ? {} : _this$props10$itemIdT,
|
|
816
|
+
isExpandable = _this$props10.isExpandable;
|
|
861
817
|
var cells = [];
|
|
862
818
|
var itemIdCallback = this.props.itemId;
|
|
863
819
|
var itemId = getItemId(item, itemIdCallback) != null ? getItemId(item, itemIdCallback) : rowIndex;
|
|
@@ -1009,7 +965,8 @@ var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
1009
965
|
key: key,
|
|
1010
966
|
align: "right",
|
|
1011
967
|
textOnly: false,
|
|
1012
|
-
hasActions: true
|
|
968
|
+
hasActions: true,
|
|
969
|
+
css: _basic_table.euiBasicTableActionsWrapper
|
|
1013
970
|
}, tools);
|
|
1014
971
|
}
|
|
1015
972
|
}, {
|
|
@@ -1094,11 +1051,11 @@ var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
1094
1051
|
value: function renderPaginationBar() {
|
|
1095
1052
|
var _this8 = this;
|
|
1096
1053
|
|
|
1097
|
-
var _this$
|
|
1098
|
-
error = _this$
|
|
1099
|
-
pagination = _this$
|
|
1100
|
-
tableCaption = _this$
|
|
1101
|
-
onChange = _this$
|
|
1054
|
+
var _this$props11 = this.props,
|
|
1055
|
+
error = _this$props11.error,
|
|
1056
|
+
pagination = _this$props11.pagination,
|
|
1057
|
+
tableCaption = _this$props11.tableCaption,
|
|
1058
|
+
onChange = _this$props11.onChange;
|
|
1102
1059
|
|
|
1103
1060
|
if (!error && pagination && pagination.totalItemCount > 0) {
|
|
1104
1061
|
if (!onChange) {
|
|
@@ -1150,8 +1107,7 @@ var EuiBasicTable = /*#__PURE__*/function (_Component) {
|
|
|
1150
1107
|
}
|
|
1151
1108
|
|
|
1152
1109
|
return null;
|
|
1153
|
-
}
|
|
1154
|
-
|
|
1110
|
+
}
|
|
1155
1111
|
}]);
|
|
1156
1112
|
|
|
1157
1113
|
return EuiBasicTable;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.safariLoadingWorkaround = exports.euiBasicTableBodyLoading = exports.euiBasicTableActionsWrapper = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = require("@emotion/react");
|
|
9
|
+
|
|
10
|
+
var _global_styling = require("../../global_styling");
|
|
11
|
+
|
|
12
|
+
var _templateObject;
|
|
13
|
+
|
|
14
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
15
|
+
|
|
16
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
17
|
+
|
|
18
|
+
var tableLoadingLine = (0, _react.keyframes)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n from {\n ", "\n ", "\n }\n\n 20% {\n ", "\n ", "\n }\n\n 80% {\n ", "\n ", "\n }\n\n 100% {\n ", "\n ", "\n }\n"])), (0, _global_styling.logicalCSS)('left', 0), (0, _global_styling.logicalCSS)('width', 0), (0, _global_styling.logicalCSS)('left', 0), (0, _global_styling.logicalCSS)('width', '40%'), (0, _global_styling.logicalCSS)('left', '60%'), (0, _global_styling.logicalCSS)('width', '40%'), (0, _global_styling.logicalCSS)('left', '100%'), (0, _global_styling.logicalCSS)('width', 0));
|
|
19
|
+
|
|
20
|
+
var euiBasicTableBodyLoading = function euiBasicTableBodyLoading(_ref2) {
|
|
21
|
+
var euiTheme = _ref2.euiTheme;
|
|
22
|
+
return /*#__PURE__*/(0, _react.css)("position:relative;overflow:hidden;&::before{position:absolute;content:'';", (0, _global_styling.logicalCSS)('width', '100%'), " ", (0, _global_styling.logicalCSS)('height', euiTheme.border.width.thick), " background-color:", euiTheme.colors.primary, ";animation:", tableLoadingLine, " 1s linear infinite;", _global_styling.euiCantAnimate, "{animation-duration:2s;}};label:euiBasicTableBodyLoading;");
|
|
23
|
+
}; // Fix to make the loading indicator position correctly in Safari
|
|
24
|
+
// For whatever annoying reason, Safari doesn't respect `position: relative;`
|
|
25
|
+
// on `tbody` without `position: relative` on the parent `table`
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
exports.euiBasicTableBodyLoading = euiBasicTableBodyLoading;
|
|
29
|
+
|
|
30
|
+
var _ref = process.env.NODE_ENV === "production" ? {
|
|
31
|
+
name: "6xbnw4-safariLoadingWorkaround",
|
|
32
|
+
styles: "position:relative;label:safariLoadingWorkaround;"
|
|
33
|
+
} : {
|
|
34
|
+
name: "6xbnw4-safariLoadingWorkaround",
|
|
35
|
+
styles: "position:relative;label:safariLoadingWorkaround;",
|
|
36
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
var safariLoadingWorkaround = function safariLoadingWorkaround() {
|
|
40
|
+
return _ref;
|
|
41
|
+
}; // Unsets the extra height caused by tooltip/popover wrappers around table action buttons
|
|
42
|
+
// Without this, the row height jumps whenever actions are disabled
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
exports.safariLoadingWorkaround = safariLoadingWorkaround;
|
|
46
|
+
var euiBasicTableActionsWrapper = process.env.NODE_ENV === "production" ? {
|
|
47
|
+
name: "1mshepa-euiBasicTableActionsWrapper",
|
|
48
|
+
styles: "line-height:1;label:euiBasicTableActionsWrapper;"
|
|
49
|
+
} : {
|
|
50
|
+
name: "1mshepa-euiBasicTableActionsWrapper",
|
|
51
|
+
styles: "line-height:1;label:euiBasicTableActionsWrapper;",
|
|
52
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
53
|
+
};
|
|
54
|
+
exports.euiBasicTableActionsWrapper = euiBasicTableActionsWrapper;
|
|
@@ -45,6 +45,8 @@ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symb
|
|
|
45
45
|
|
|
46
46
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
47
47
|
|
|
48
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
49
|
+
|
|
48
50
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
49
51
|
|
|
50
52
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -116,6 +118,7 @@ var useDataGridColumnSelector = function useDataGridColumnSelector(availableColu
|
|
|
116
118
|
}, [sortedColumns, columnSearchText, displayValues]);
|
|
117
119
|
var isDragEnabled = allowColumnReorder && columnSearchText.length === 0; // only allow drag-and-drop when not filtering columns
|
|
118
120
|
|
|
121
|
+
var dragHandleAriaLabel = (0, _i18n.useEuiI18n)('euiColumnSelector.dragHandleAriaLabel', 'Drag handle');
|
|
119
122
|
var buttonText = (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
120
123
|
token: "euiColumnSelector.button",
|
|
121
124
|
default: "Columns"
|
|
@@ -188,18 +191,23 @@ var useDataGridColumnSelector = function useDataGridColumnSelector(availableColu
|
|
|
188
191
|
key: id,
|
|
189
192
|
draggableId: id,
|
|
190
193
|
index: index,
|
|
191
|
-
isDragDisabled: !isDragEnabled
|
|
194
|
+
isDragDisabled: !isDragEnabled,
|
|
195
|
+
hasInteractiveChildren: true,
|
|
196
|
+
customDragHandle: true
|
|
192
197
|
}, function (provided, state) {
|
|
193
198
|
return (0, _react2.jsx)("div", {
|
|
194
199
|
className: "euiDataGridColumnSelector__item ".concat(state.isDragging && 'euiDataGridColumnSelector__item-isDragging'),
|
|
195
200
|
"data-test-subj": "dataGridColumnSelectorColumnItem-".concat(id)
|
|
196
201
|
}, (0, _react2.jsx)(_flex.EuiFlexGroup, {
|
|
197
202
|
responsive: false,
|
|
198
|
-
gutterSize: "
|
|
203
|
+
gutterSize: "s",
|
|
199
204
|
alignItems: "center"
|
|
200
|
-
},
|
|
205
|
+
}, allowColumnHiding && (0, _react2.jsx)(_flex.EuiFlexItem, {
|
|
206
|
+
grow: false
|
|
207
|
+
}, (0, _react2.jsx)(_form.EuiSwitch, {
|
|
201
208
|
name: id,
|
|
202
209
|
label: displayValues[id] || id,
|
|
210
|
+
showLabel: false,
|
|
203
211
|
checked: visibleColumnIds.has(id),
|
|
204
212
|
compressed: true,
|
|
205
213
|
className: "euiSwitch--mini",
|
|
@@ -211,11 +219,18 @@ var useDataGridColumnSelector = function useDataGridColumnSelector(availableColu
|
|
|
211
219
|
setVisibleColumns(nextVisibleColumns);
|
|
212
220
|
},
|
|
213
221
|
"data-test-subj": "dataGridColumnSelectorToggleColumnVisibility-".concat(id)
|
|
214
|
-
})
|
|
222
|
+
})), (0, _react2.jsx)(_flex.EuiFlexItem // This extra column name flex item affords the column more grabbable real estate
|
|
223
|
+
// for mouse users, while hiding repetition for keyboard/screen reader users
|
|
224
|
+
, _extends({}, provided.dragHandleProps, {
|
|
225
|
+
"aria-hidden": true,
|
|
226
|
+
tabIndex: -1
|
|
227
|
+
}), (0, _react2.jsx)("span", {
|
|
215
228
|
className: "euiDataGridColumnSelector__itemLabel"
|
|
216
|
-
}, id)), isDragEnabled && (0, _react2.jsx)(_flex.EuiFlexItem, {
|
|
229
|
+
}, displayValues[id] || id)), isDragEnabled && (0, _react2.jsx)(_flex.EuiFlexItem, _extends({
|
|
217
230
|
grow: false
|
|
218
|
-
},
|
|
231
|
+
}, provided.dragHandleProps, {
|
|
232
|
+
"aria-label": dragHandleAriaLabel
|
|
233
|
+
}), (0, _react2.jsx)(_icon.EuiIcon, {
|
|
219
234
|
type: "grab",
|
|
220
235
|
color: "subdued"
|
|
221
236
|
}))));
|