@elastic/eui 93.3.0 → 93.4.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_charts_theme.d.ts +9 -0
- package/dist/eui_charts_theme.js +56 -14
- package/dist/eui_charts_theme.js.map +1 -1
- package/es/components/breadcrumbs/_breadcrumb_content.js +362 -0
- package/es/components/breadcrumbs/_breadcrumb_content.styles.js +48 -0
- package/es/components/breadcrumbs/breadcrumb.js +10 -327
- package/es/components/breadcrumbs/breadcrumb.styles.js +5 -27
- package/es/components/breadcrumbs/breadcrumbs.js +4 -4
- package/es/components/breadcrumbs/types.js +1 -0
- package/es/components/button/button_group/button_group.js +16 -2
- package/es/components/button/button_group/button_group.styles.js +1 -1
- package/es/components/button/button_group/button_group_button.js +59 -5
- package/es/components/button/button_group/button_group_button.styles.js +39 -3
- package/es/components/datagrid/body/cell/data_grid_cell.js +97 -58
- package/es/components/datagrid/body/cell/data_grid_cell_actions.js +24 -18
- package/es/components/datagrid/body/cell/data_grid_cell_popover.js +64 -56
- package/es/components/datagrid/body/cell/data_grid_cell_wrapper.js +32 -31
- package/es/components/datagrid/body/cell/index.js +1 -1
- package/es/components/datagrid/body/data_grid_body.js +13 -0
- package/es/components/datagrid/body/data_grid_body_custom.js +52 -36
- package/es/components/datagrid/body/data_grid_body_virtualized.js +84 -56
- package/es/components/datagrid/body/data_grid_row_manager.js +6 -4
- package/es/components/datagrid/body/footer/use_data_grid_footer.js +1 -2
- package/es/components/datagrid/body/header/data_grid_control_header_cell.js +5 -4
- package/es/components/datagrid/body/header/data_grid_header_cell.js +73 -53
- package/es/components/datagrid/body/header/data_grid_header_row.js +15 -551
- package/es/components/datagrid/body/header/use_data_grid_header.js +7 -6
- package/es/components/datagrid/controls/column_selector.js +126 -123
- package/es/components/datagrid/controls/column_sorting.js +605 -103
- package/es/components/datagrid/controls/column_sorting_draggable.js +24 -22
- package/es/components/datagrid/controls/display_selector.js +109 -107
- package/es/components/datagrid/data_grid.a11y.js +13 -12
- package/es/components/datagrid/data_grid.js +45 -22
- package/es/components/datagrid/utils/col_widths.js +12 -8
- package/es/components/datagrid/utils/focus.js +10 -8
- package/es/components/datagrid/utils/grid_height_width.js +31 -30
- package/es/components/datagrid/utils/ref.js +1 -1
- package/es/components/datagrid/utils/row_heights.js +2 -2
- package/es/components/datagrid/utils/sorting.js +29 -27
- package/es/components/date_picker/super_date_picker/super_date_picker.js +9 -0
- package/es/components/date_picker/super_date_picker/super_update_button.js +57 -29
- package/es/components/flex/flex_grid.js +22 -8
- package/es/components/flex/flex_grid.styles.js +13 -6
- package/es/components/flex/flex_group.js +10 -11
- package/es/components/flex/flex_item.js +9 -11
- package/es/components/flex/flex_item.styles.js +107 -122
- package/es/components/flyout/flyout.js +16 -18
- package/es/components/header/header_breadcrumbs/header_breadcrumbs.js +3 -5
- package/es/components/modal/confirm_modal.js +2 -1
- package/es/components/modal/modal.js +12 -3
- package/es/components/observer/resize_observer/resize_observer.js +15 -24
- package/es/components/spacer/spacer.js +2 -3
- package/es/components/toast/global_toast_list.js +70 -73
- package/es/components/toast/toast.js +27 -42
- package/es/components/toast/toast.styles.js +2 -17
- package/es/services/color/eui_palettes.js +21 -13
- package/es/services/color/index.js +1 -1
- package/es/services/hooks/index.js +1 -0
- package/es/services/hooks/useDeepEqual.js +23 -0
- package/es/services/index.js +1 -1
- package/eui.d.ts +2442 -2337
- package/i18ntokens.json +259 -259
- package/lib/components/breadcrumbs/_breadcrumb_content.js +372 -0
- package/lib/components/breadcrumbs/_breadcrumb_content.styles.js +55 -0
- package/lib/components/breadcrumbs/breadcrumb.js +11 -331
- package/lib/components/breadcrumbs/breadcrumb.styles.js +5 -29
- package/lib/components/breadcrumbs/breadcrumbs.js +3 -3
- package/lib/components/breadcrumbs/types.js +5 -0
- package/lib/components/button/button_group/button_group.js +16 -2
- package/lib/components/button/button_group/button_group.styles.js +1 -1
- package/lib/components/button/button_group/button_group_button.js +59 -5
- package/lib/components/button/button_group/button_group_button.styles.js +45 -11
- package/lib/components/datagrid/body/cell/data_grid_cell.js +95 -57
- package/lib/components/datagrid/body/cell/data_grid_cell_actions.js +24 -18
- package/lib/components/datagrid/body/cell/data_grid_cell_popover.js +63 -55
- package/lib/components/datagrid/body/cell/data_grid_cell_wrapper.js +32 -31
- package/lib/components/datagrid/body/cell/index.js +2 -2
- package/lib/components/datagrid/body/data_grid_body.js +13 -0
- package/lib/components/datagrid/body/data_grid_body_custom.js +51 -35
- package/lib/components/datagrid/body/data_grid_body_virtualized.js +83 -55
- package/lib/components/datagrid/body/data_grid_row_manager.js +5 -3
- package/lib/components/datagrid/body/footer/use_data_grid_footer.js +1 -2
- package/lib/components/datagrid/body/header/data_grid_control_header_cell.js +8 -4
- package/lib/components/datagrid/body/header/data_grid_header_cell.js +72 -52
- package/lib/components/datagrid/body/header/data_grid_header_row.js +14 -550
- package/lib/components/datagrid/body/header/use_data_grid_header.js +7 -6
- package/lib/components/datagrid/controls/column_selector.js +126 -123
- package/lib/components/datagrid/controls/column_sorting.js +615 -110
- package/lib/components/datagrid/controls/column_sorting_draggable.js +27 -22
- package/lib/components/datagrid/controls/display_selector.js +109 -107
- package/lib/components/datagrid/data_grid.a11y.js +13 -12
- package/lib/components/datagrid/data_grid.js +43 -20
- package/lib/components/datagrid/utils/col_widths.js +12 -8
- package/lib/components/datagrid/utils/focus.js +10 -8
- package/lib/components/datagrid/utils/grid_height_width.js +29 -28
- package/lib/components/datagrid/utils/ref.js +1 -1
- package/lib/components/datagrid/utils/row_heights.js +1 -1
- package/lib/components/datagrid/utils/sorting.js +31 -29
- package/lib/components/date_picker/super_date_picker/super_date_picker.js +9 -0
- package/lib/components/date_picker/super_date_picker/super_update_button.js +57 -29
- package/lib/components/flex/flex_grid.js +23 -7
- package/lib/components/flex/flex_grid.styles.js +13 -6
- package/lib/components/flex/flex_group.js +10 -10
- package/lib/components/flex/flex_item.js +13 -13
- package/lib/components/flex/flex_item.styles.js +107 -122
- package/lib/components/flyout/flyout.js +16 -18
- package/lib/components/header/header_breadcrumbs/header_breadcrumbs.js +3 -5
- package/lib/components/modal/confirm_modal.js +2 -1
- package/lib/components/modal/modal.js +12 -3
- package/lib/components/observer/resize_observer/resize_observer.js +15 -24
- package/lib/components/spacer/spacer.js +1 -2
- package/lib/components/toast/global_toast_list.js +68 -71
- package/lib/components/toast/toast.js +25 -40
- package/lib/components/toast/toast.styles.js +11 -25
- package/lib/services/color/eui_palettes.js +24 -14
- package/lib/services/color/index.js +14 -0
- package/lib/services/hooks/index.js +11 -0
- package/lib/services/hooks/useDeepEqual.js +30 -0
- package/lib/services/index.js +15 -1
- package/optimize/es/components/breadcrumbs/_breadcrumb_content.js +153 -0
- package/optimize/es/components/breadcrumbs/_breadcrumb_content.styles.js +48 -0
- package/optimize/es/components/breadcrumbs/breadcrumb.js +10 -110
- package/optimize/es/components/breadcrumbs/breadcrumb.styles.js +5 -27
- package/optimize/es/components/breadcrumbs/breadcrumbs.js +4 -4
- package/optimize/es/components/breadcrumbs/types.js +1 -0
- package/optimize/es/components/button/button_group/button_group.js +2 -2
- package/optimize/es/components/button/button_group/button_group.styles.js +1 -1
- package/optimize/es/components/button/button_group/button_group_button.js +36 -4
- package/optimize/es/components/button/button_group/button_group_button.styles.js +39 -3
- package/optimize/es/components/datagrid/body/cell/data_grid_cell.js +80 -55
- package/optimize/es/components/datagrid/body/cell/data_grid_cell_actions.js +24 -18
- package/optimize/es/components/datagrid/body/cell/data_grid_cell_popover.js +64 -56
- package/optimize/es/components/datagrid/body/cell/data_grid_cell_wrapper.js +32 -31
- package/optimize/es/components/datagrid/body/cell/index.js +1 -1
- package/optimize/es/components/datagrid/body/data_grid_body_custom.js +39 -36
- package/optimize/es/components/datagrid/body/data_grid_body_virtualized.js +69 -49
- package/optimize/es/components/datagrid/body/data_grid_row_manager.js +6 -4
- package/optimize/es/components/datagrid/body/footer/use_data_grid_footer.js +1 -2
- package/optimize/es/components/datagrid/body/header/data_grid_control_header_cell.js +4 -3
- package/optimize/es/components/datagrid/body/header/data_grid_header_cell.js +65 -49
- package/optimize/es/components/datagrid/body/header/data_grid_header_row.js +15 -13
- package/optimize/es/components/datagrid/body/header/use_data_grid_header.js +7 -6
- package/optimize/es/components/datagrid/controls/column_selector.js +126 -123
- package/optimize/es/components/datagrid/controls/column_sorting.js +121 -103
- package/optimize/es/components/datagrid/controls/column_sorting_draggable.js +24 -22
- package/optimize/es/components/datagrid/controls/display_selector.js +109 -107
- package/optimize/es/components/datagrid/data_grid.a11y.js +13 -12
- package/optimize/es/components/datagrid/data_grid.js +45 -22
- package/optimize/es/components/datagrid/utils/col_widths.js +9 -5
- package/optimize/es/components/datagrid/utils/focus.js +10 -8
- package/optimize/es/components/datagrid/utils/grid_height_width.js +31 -30
- package/optimize/es/components/datagrid/utils/ref.js +1 -1
- package/optimize/es/components/datagrid/utils/row_heights.js +2 -2
- package/optimize/es/components/datagrid/utils/sorting.js +29 -27
- package/optimize/es/components/date_picker/super_date_picker/super_update_button.js +49 -29
- package/optimize/es/components/flex/flex_grid.js +19 -8
- package/optimize/es/components/flex/flex_grid.styles.js +13 -6
- package/optimize/es/components/flex/flex_group.js +9 -10
- package/optimize/es/components/flex/flex_item.js +9 -11
- package/optimize/es/components/flex/flex_item.styles.js +107 -122
- package/optimize/es/components/flyout/flyout.js +16 -18
- package/optimize/es/components/header/header_breadcrumbs/header_breadcrumbs.js +3 -5
- package/optimize/es/components/modal/confirm_modal.js +2 -1
- package/optimize/es/components/modal/modal.js +6 -2
- package/optimize/es/components/observer/resize_observer/resize_observer.js +15 -24
- package/optimize/es/components/spacer/spacer.js +2 -3
- package/optimize/es/components/toast/global_toast_list.js +70 -73
- package/optimize/es/components/toast/toast.js +27 -42
- package/optimize/es/components/toast/toast.styles.js +2 -17
- package/optimize/es/services/color/eui_palettes.js +21 -13
- package/optimize/es/services/color/index.js +1 -1
- package/optimize/es/services/hooks/index.js +1 -0
- package/optimize/es/services/hooks/useDeepEqual.js +23 -0
- package/optimize/es/services/index.js +1 -1
- package/optimize/lib/components/breadcrumbs/_breadcrumb_content.js +163 -0
- package/optimize/lib/components/breadcrumbs/_breadcrumb_content.styles.js +55 -0
- package/optimize/lib/components/breadcrumbs/breadcrumb.js +10 -113
- package/optimize/lib/components/breadcrumbs/breadcrumb.styles.js +5 -29
- package/optimize/lib/components/breadcrumbs/breadcrumbs.js +3 -3
- package/optimize/lib/components/breadcrumbs/types.js +5 -0
- package/optimize/lib/components/button/button_group/button_group.js +2 -2
- package/optimize/lib/components/button/button_group/button_group.styles.js +1 -1
- package/optimize/lib/components/button/button_group/button_group_button.js +37 -5
- package/optimize/lib/components/button/button_group/button_group_button.styles.js +45 -11
- package/optimize/lib/components/datagrid/body/cell/data_grid_cell.js +78 -54
- package/optimize/lib/components/datagrid/body/cell/data_grid_cell_actions.js +24 -18
- package/optimize/lib/components/datagrid/body/cell/data_grid_cell_popover.js +63 -55
- package/optimize/lib/components/datagrid/body/cell/data_grid_cell_wrapper.js +32 -31
- package/optimize/lib/components/datagrid/body/cell/index.js +2 -2
- package/optimize/lib/components/datagrid/body/data_grid_body_custom.js +38 -35
- package/optimize/lib/components/datagrid/body/data_grid_body_virtualized.js +70 -50
- package/optimize/lib/components/datagrid/body/data_grid_row_manager.js +5 -3
- package/optimize/lib/components/datagrid/body/footer/use_data_grid_footer.js +1 -2
- package/optimize/lib/components/datagrid/body/header/data_grid_control_header_cell.js +8 -4
- package/optimize/lib/components/datagrid/body/header/data_grid_header_cell.js +65 -49
- package/optimize/lib/components/datagrid/body/header/data_grid_header_row.js +14 -12
- package/optimize/lib/components/datagrid/body/header/use_data_grid_header.js +7 -6
- package/optimize/lib/components/datagrid/controls/column_selector.js +126 -123
- package/optimize/lib/components/datagrid/controls/column_sorting.js +125 -107
- package/optimize/lib/components/datagrid/controls/column_sorting_draggable.js +27 -22
- package/optimize/lib/components/datagrid/controls/display_selector.js +109 -107
- package/optimize/lib/components/datagrid/data_grid.a11y.js +13 -12
- package/optimize/lib/components/datagrid/data_grid.js +43 -20
- package/optimize/lib/components/datagrid/utils/col_widths.js +9 -5
- package/optimize/lib/components/datagrid/utils/focus.js +10 -8
- package/optimize/lib/components/datagrid/utils/grid_height_width.js +29 -28
- package/optimize/lib/components/datagrid/utils/ref.js +1 -1
- package/optimize/lib/components/datagrid/utils/row_heights.js +1 -1
- package/optimize/lib/components/datagrid/utils/sorting.js +31 -29
- package/optimize/lib/components/date_picker/super_date_picker/super_update_button.js +49 -29
- package/optimize/lib/components/flex/flex_grid.js +21 -7
- package/optimize/lib/components/flex/flex_grid.styles.js +13 -6
- package/optimize/lib/components/flex/flex_group.js +9 -9
- package/optimize/lib/components/flex/flex_item.js +13 -13
- package/optimize/lib/components/flex/flex_item.styles.js +107 -122
- package/optimize/lib/components/flyout/flyout.js +16 -18
- package/optimize/lib/components/header/header_breadcrumbs/header_breadcrumbs.js +3 -5
- package/optimize/lib/components/modal/confirm_modal.js +2 -1
- package/optimize/lib/components/modal/modal.js +6 -2
- package/optimize/lib/components/observer/resize_observer/resize_observer.js +15 -24
- package/optimize/lib/components/spacer/spacer.js +1 -2
- package/optimize/lib/components/toast/global_toast_list.js +68 -71
- package/optimize/lib/components/toast/toast.js +25 -40
- package/optimize/lib/components/toast/toast.styles.js +11 -25
- package/optimize/lib/services/color/eui_palettes.js +24 -14
- package/optimize/lib/services/color/index.js +14 -0
- package/optimize/lib/services/hooks/index.js +11 -0
- package/optimize/lib/services/hooks/useDeepEqual.js +30 -0
- package/optimize/lib/services/index.js +15 -1
- package/package.json +2 -2
- package/test-env/components/breadcrumbs/_breadcrumb_content.js +363 -0
- package/test-env/components/breadcrumbs/_breadcrumb_content.styles.js +55 -0
- package/test-env/components/breadcrumbs/breadcrumb.js +11 -326
- package/test-env/components/breadcrumbs/breadcrumb.styles.js +5 -29
- package/test-env/components/breadcrumbs/breadcrumbs.js +3 -3
- package/test-env/components/breadcrumbs/types.js +5 -0
- package/test-env/components/button/button_group/button_group.js +16 -2
- package/test-env/components/button/button_group/button_group.styles.js +1 -1
- package/test-env/components/button/button_group/button_group_button.js +56 -5
- package/test-env/components/button/button_group/button_group_button.styles.js +45 -11
- package/test-env/components/datagrid/body/cell/data_grid_cell.js +95 -57
- package/test-env/components/datagrid/body/cell/data_grid_cell_actions.js +24 -18
- package/test-env/components/datagrid/body/cell/data_grid_cell_popover.js +63 -55
- package/test-env/components/datagrid/body/cell/data_grid_cell_wrapper.js +32 -31
- package/test-env/components/datagrid/body/cell/index.js +2 -2
- package/test-env/components/datagrid/body/data_grid_body.js +13 -0
- package/test-env/components/datagrid/body/data_grid_body_custom.js +51 -35
- package/test-env/components/datagrid/body/data_grid_body_virtualized.js +83 -55
- package/test-env/components/datagrid/body/data_grid_row_manager.js +5 -3
- package/test-env/components/datagrid/body/footer/use_data_grid_footer.js +1 -2
- package/test-env/components/datagrid/body/header/data_grid_control_header_cell.js +8 -4
- package/test-env/components/datagrid/body/header/data_grid_header_cell.js +72 -52
- package/test-env/components/datagrid/body/header/data_grid_header_row.js +14 -550
- package/test-env/components/datagrid/body/header/use_data_grid_header.js +7 -6
- package/test-env/components/datagrid/controls/column_selector.js +126 -123
- package/test-env/components/datagrid/controls/column_sorting.js +607 -106
- package/test-env/components/datagrid/controls/column_sorting_draggable.js +27 -22
- package/test-env/components/datagrid/controls/display_selector.js +109 -107
- package/test-env/components/datagrid/data_grid.a11y.js +13 -12
- package/test-env/components/datagrid/data_grid.js +43 -20
- package/test-env/components/datagrid/utils/col_widths.js +9 -5
- package/test-env/components/datagrid/utils/focus.js +10 -8
- package/test-env/components/datagrid/utils/grid_height_width.js +29 -28
- package/test-env/components/datagrid/utils/ref.js +1 -1
- package/test-env/components/datagrid/utils/row_heights.js +1 -1
- package/test-env/components/datagrid/utils/sorting.js +31 -29
- package/test-env/components/date_picker/super_date_picker/super_date_picker.js +9 -0
- package/test-env/components/date_picker/super_date_picker/super_update_button.js +57 -29
- package/test-env/components/flex/flex_grid.js +21 -7
- package/test-env/components/flex/flex_grid.styles.js +13 -6
- package/test-env/components/flex/flex_group.js +10 -10
- package/test-env/components/flex/flex_item.js +13 -13
- package/test-env/components/flex/flex_item.styles.js +107 -122
- package/test-env/components/header/header_breadcrumbs/header_breadcrumbs.js +3 -5
- package/test-env/components/modal/confirm_modal.js +2 -1
- package/test-env/components/modal/modal.js +12 -3
- package/test-env/components/spacer/spacer.js +1 -2
- package/test-env/components/toast/global_toast_list.js +68 -71
- package/test-env/components/toast/toast.js +25 -40
- package/test-env/components/toast/toast.styles.js +11 -25
- package/test-env/services/color/eui_palettes.js +24 -14
- package/test-env/services/color/index.js +14 -0
- package/test-env/services/hooks/index.js +11 -0
- package/test-env/services/hooks/useDeepEqual.js +30 -0
- package/test-env/services/index.js +15 -1
- package/src/themes/charts/theme.scss +0 -5
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.useSorting = exports.
|
|
6
|
+
exports.useSorting = exports.DataGridSortedContext = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
|
+
var _services = require("../../../services");
|
|
8
9
|
var _data_grid_schema = require("./data_grid_schema");
|
|
9
10
|
/*
|
|
10
11
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
@@ -14,14 +15,13 @@ var _data_grid_schema = require("./data_grid_schema");
|
|
|
14
15
|
* Side Public License, v 1.
|
|
15
16
|
*/
|
|
16
17
|
|
|
17
|
-
var
|
|
18
|
-
sorting: undefined,
|
|
18
|
+
var DataGridSortedContext = /*#__PURE__*/(0, _react.createContext)({
|
|
19
19
|
sortedRowMap: [],
|
|
20
20
|
getCorrectRowIndex: function getCorrectRowIndex(number) {
|
|
21
21
|
return number;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
exports.
|
|
24
|
+
exports.DataGridSortedContext = DataGridSortedContext;
|
|
25
25
|
var useSorting = function useSorting(_ref) {
|
|
26
26
|
var sorting = _ref.sorting,
|
|
27
27
|
inMemory = _ref.inMemory,
|
|
@@ -29,22 +29,18 @@ var useSorting = function useSorting(_ref) {
|
|
|
29
29
|
schema = _ref.schema,
|
|
30
30
|
schemaDetectors = _ref.schemaDetectors,
|
|
31
31
|
startRow = _ref.startRow;
|
|
32
|
-
var sortingColumns = sorting === null || sorting === void 0 ? void 0 : sorting.columns;
|
|
33
|
-
var
|
|
34
|
-
var rowMap = [];
|
|
32
|
+
var sortingColumns = (0, _services.useDeepEqual)(sorting === null || sorting === void 0 ? void 0 : sorting.columns);
|
|
33
|
+
var sortedWrappedValues = (0, _react.useMemo)(function () {
|
|
35
34
|
if ((inMemory === null || inMemory === void 0 ? void 0 : inMemory.level) === 'sorting' && sortingColumns != null && sortingColumns.length > 0) {
|
|
36
35
|
var inMemoryRowIndices = Object.keys(inMemoryValues);
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
wrappedValues.sort(function (a, b) {
|
|
46
|
-
for (var _i = 0; _i < sortingColumns.length; _i++) {
|
|
47
|
-
var column = sortingColumns[_i];
|
|
36
|
+
return inMemoryRowIndices.map(function (row, index) {
|
|
37
|
+
return {
|
|
38
|
+
index: index,
|
|
39
|
+
values: inMemoryValues[row]
|
|
40
|
+
};
|
|
41
|
+
}).sort(function (a, b) {
|
|
42
|
+
for (var i = 0; i < sortingColumns.length; i++) {
|
|
43
|
+
var column = sortingColumns[i];
|
|
48
44
|
var aValue = a.values[column.id];
|
|
49
45
|
var bValue = b.values[column.id];
|
|
50
46
|
|
|
@@ -52,8 +48,8 @@ var useSorting = function useSorting(_ref) {
|
|
|
52
48
|
var comparator = _data_grid_schema.defaultComparator;
|
|
53
49
|
if (schema.hasOwnProperty(column.id)) {
|
|
54
50
|
var columnType = schema[column.id].columnType;
|
|
55
|
-
for (var
|
|
56
|
-
var detector = schemaDetectors[
|
|
51
|
+
for (var _i = 0; _i < schemaDetectors.length; _i++) {
|
|
52
|
+
var detector = schemaDetectors[_i];
|
|
57
53
|
if (detector.type === columnType && detector.hasOwnProperty('comparator')) {
|
|
58
54
|
comparator = detector.comparator;
|
|
59
55
|
}
|
|
@@ -68,12 +64,17 @@ var useSorting = function useSorting(_ref) {
|
|
|
68
64
|
}
|
|
69
65
|
return 0;
|
|
70
66
|
});
|
|
71
|
-
for (var _i3 = 0; _i3 < wrappedValues.length; _i3++) {
|
|
72
|
-
rowMap[_i3] = wrappedValues[_i3].index;
|
|
73
|
-
}
|
|
74
67
|
}
|
|
75
|
-
return rowMap;
|
|
76
68
|
}, [inMemory === null || inMemory === void 0 ? void 0 : inMemory.level, inMemoryValues, sortingColumns, schema, schemaDetectors]);
|
|
69
|
+
var sortedRowMap = (0, _react.useMemo)(function () {
|
|
70
|
+
if ((inMemory === null || inMemory === void 0 ? void 0 : inMemory.level) === 'sorting' && sortingColumns != null && sortingColumns.length > 0 && sortedWrappedValues != null) {
|
|
71
|
+
return sortedWrappedValues.map(function (row) {
|
|
72
|
+
return row.index;
|
|
73
|
+
});
|
|
74
|
+
} else {
|
|
75
|
+
return [];
|
|
76
|
+
}
|
|
77
|
+
}, [inMemory === null || inMemory === void 0 ? void 0 : inMemory.level, sortingColumns, sortedWrappedValues]);
|
|
77
78
|
|
|
78
79
|
// Given a visible row index, obtain the unpaginated & unsorted
|
|
79
80
|
// row index from the passed cell data
|
|
@@ -83,10 +84,11 @@ var useSorting = function useSorting(_ref) {
|
|
|
83
84
|
var unsortedRowIndex = unpaginatedRowIndex in sortedRowMap ? sortedRowMap[unpaginatedRowIndex] : unpaginatedRowIndex;
|
|
84
85
|
return unsortedRowIndex;
|
|
85
86
|
}, [startRow, sortedRowMap]);
|
|
86
|
-
return {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
87
|
+
return (0, _react.useMemo)(function () {
|
|
88
|
+
return {
|
|
89
|
+
sortedRowMap: sortedRowMap,
|
|
90
|
+
getCorrectRowIndex: getCorrectRowIndex
|
|
91
|
+
};
|
|
92
|
+
}, [sortedRowMap, getCorrectRowIndex]);
|
|
91
93
|
};
|
|
92
94
|
exports.useSorting = useSorting;
|
|
@@ -605,6 +605,14 @@ EuiSuperDatePickerInternal.propTypes = {
|
|
|
605
605
|
* Props passed to the update button #EuiSuperUpdateButtonProps
|
|
606
606
|
*/
|
|
607
607
|
updateButtonProps: _propTypes.default.shape({
|
|
608
|
+
/**
|
|
609
|
+
* Overrides the default button label with a custom React node.
|
|
610
|
+
*
|
|
611
|
+
* When defined, you're responsible for updating the custom label
|
|
612
|
+
* when the data needs updating (the `needsUpdate` prop)
|
|
613
|
+
* or is loading (the `isLoading` prop).
|
|
614
|
+
*/
|
|
615
|
+
children: _propTypes.default.node,
|
|
608
616
|
/**
|
|
609
617
|
* Show the "Click to apply" tooltip
|
|
610
618
|
*/
|
|
@@ -839,6 +847,7 @@ EuiSuperDatePicker.propTypes = {
|
|
|
839
847
|
* Props passed to the update button #EuiSuperUpdateButtonProps
|
|
840
848
|
*/
|
|
841
849
|
updateButtonProps: _propTypes.default.shape({
|
|
850
|
+
children: _propTypes.default.node,
|
|
842
851
|
showTooltip: _propTypes.default.bool,
|
|
843
852
|
toolTipProps: _propTypes.default.shape({
|
|
844
853
|
anchorClassName: _propTypes.default.string,
|
|
@@ -23,7 +23,7 @@ var _i18n = require("../../i18n");
|
|
|
23
23
|
var _tool_tip = require("../../tool_tip");
|
|
24
24
|
var _responsive2 = require("../../responsive");
|
|
25
25
|
var _react2 = require("@emotion/react");
|
|
26
|
-
var _excluded = ["className", "needsUpdate", "isLoading", "isDisabled", "onClick", "toolTipProps", "showTooltip", "iconOnly", "responsive", "textProps", "fill"];
|
|
26
|
+
var _excluded = ["children", "className", "needsUpdate", "isLoading", "isDisabled", "onClick", "toolTipProps", "showTooltip", "iconOnly", "responsive", "textProps", "fill"];
|
|
27
27
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
28
28
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
29
29
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -91,6 +91,7 @@ var EuiSuperUpdateButton = /*#__PURE__*/function (_Component) {
|
|
|
91
91
|
key: "render",
|
|
92
92
|
value: function render() {
|
|
93
93
|
var _this$props = this.props,
|
|
94
|
+
children = _this$props.children,
|
|
94
95
|
className = _this$props.className,
|
|
95
96
|
needsUpdate = _this$props.needsUpdate,
|
|
96
97
|
isLoading = _this$props.isLoading,
|
|
@@ -106,31 +107,6 @@ var EuiSuperUpdateButton = /*#__PURE__*/function (_Component) {
|
|
|
106
107
|
// Force responsive for "all" if `iconOnly = true`
|
|
107
108
|
var responsive = iconOnly ? 'all' : _responsive;
|
|
108
109
|
var classes = (0, _classnames.default)('euiSuperUpdateButton', className);
|
|
109
|
-
var buttonText = (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
110
|
-
token: "euiSuperUpdateButton.refreshButtonLabel",
|
|
111
|
-
default: "Refresh"
|
|
112
|
-
});
|
|
113
|
-
if (needsUpdate || isLoading) {
|
|
114
|
-
buttonText = isLoading ? (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
115
|
-
token: "euiSuperUpdateButton.updatingButtonLabel",
|
|
116
|
-
default: "Updating"
|
|
117
|
-
}) : (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
118
|
-
token: "euiSuperUpdateButton.updateButtonLabel",
|
|
119
|
-
default: "Update"
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
var tooltipContent;
|
|
123
|
-
if (isDisabled) {
|
|
124
|
-
tooltipContent = (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
125
|
-
token: "euiSuperUpdateButton.cannotUpdateTooltip",
|
|
126
|
-
default: "Cannot update"
|
|
127
|
-
});
|
|
128
|
-
} else if (needsUpdate && !isLoading) {
|
|
129
|
-
tooltipContent = (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
130
|
-
token: "euiSuperUpdateButton.clickToApplyTooltip",
|
|
131
|
-
default: "Click to apply"
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
110
|
var sharedButtonProps = {
|
|
135
111
|
color: needsUpdate || isLoading ? 'success' : 'primary',
|
|
136
112
|
iconType: needsUpdate || isLoading ? 'kqlFunction' : 'refresh',
|
|
@@ -138,9 +114,10 @@ var EuiSuperUpdateButton = /*#__PURE__*/function (_Component) {
|
|
|
138
114
|
onClick: onClick,
|
|
139
115
|
isLoading: isLoading
|
|
140
116
|
};
|
|
117
|
+
var buttonContent = this.renderButtonContent();
|
|
141
118
|
return (0, _react2.jsx)(_tool_tip.EuiToolTip, (0, _extends2.default)({
|
|
142
119
|
ref: this.setTootipRef,
|
|
143
|
-
content:
|
|
120
|
+
content: this.renderTooltipContent(),
|
|
144
121
|
position: "bottom"
|
|
145
122
|
}, toolTipProps), (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_responsive2.EuiShowFor, {
|
|
146
123
|
sizes: responsive || 'none'
|
|
@@ -152,7 +129,7 @@ var EuiSuperUpdateButton = /*#__PURE__*/function (_Component) {
|
|
|
152
129
|
textProps: _objectSpread(_objectSpread({}, restTextProps), {}, {
|
|
153
130
|
className: (0, _classnames.default)('euiScreenReaderOnly', restTextProps && restTextProps.className)
|
|
154
131
|
})
|
|
155
|
-
}, rest),
|
|
132
|
+
}, rest), buttonContent)), (0, _react2.jsx)(_responsive2.EuiHideFor, {
|
|
156
133
|
sizes: responsive || 'none'
|
|
157
134
|
}, (0, _react2.jsx)(_button.EuiButton, (0, _extends2.default)({
|
|
158
135
|
className: classes,
|
|
@@ -160,7 +137,50 @@ var EuiSuperUpdateButton = /*#__PURE__*/function (_Component) {
|
|
|
160
137
|
}, sharedButtonProps, {
|
|
161
138
|
fill: fill,
|
|
162
139
|
textProps: restTextProps
|
|
163
|
-
}, rest),
|
|
140
|
+
}, rest), buttonContent))));
|
|
141
|
+
}
|
|
142
|
+
}, {
|
|
143
|
+
key: "renderButtonContent",
|
|
144
|
+
value: function renderButtonContent() {
|
|
145
|
+
var _this$props2 = this.props,
|
|
146
|
+
children = _this$props2.children,
|
|
147
|
+
isLoading = _this$props2.isLoading,
|
|
148
|
+
needsUpdate = _this$props2.needsUpdate;
|
|
149
|
+
if (children) {
|
|
150
|
+
return children;
|
|
151
|
+
}
|
|
152
|
+
if (isLoading) {
|
|
153
|
+
return (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
154
|
+
token: "euiSuperUpdateButton.updatingButtonLabel",
|
|
155
|
+
default: "Updating"
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
if (needsUpdate) {
|
|
159
|
+
return (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
160
|
+
token: "euiSuperUpdateButton.updateButtonLabel",
|
|
161
|
+
default: "Update"
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
return (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
165
|
+
token: "euiSuperUpdateButton.refreshButtonLabel",
|
|
166
|
+
default: "Refresh"
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
}, {
|
|
170
|
+
key: "renderTooltipContent",
|
|
171
|
+
value: function renderTooltipContent() {
|
|
172
|
+
if (this.props.isDisabled) {
|
|
173
|
+
return (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
174
|
+
token: "euiSuperUpdateButton.cannotUpdateTooltip",
|
|
175
|
+
default: "Cannot update"
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
if (this.props.needsUpdate && !this.props.isLoading) {
|
|
179
|
+
return (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
180
|
+
token: "euiSuperUpdateButton.clickToApplyTooltip",
|
|
181
|
+
default: "Click to apply"
|
|
182
|
+
});
|
|
183
|
+
}
|
|
164
184
|
}
|
|
165
185
|
}]);
|
|
166
186
|
return EuiSuperUpdateButton;
|
|
@@ -179,6 +199,14 @@ EuiSuperUpdateButton.propTypes = {
|
|
|
179
199
|
isLoading: _propTypes.default.bool,
|
|
180
200
|
needsUpdate: _propTypes.default.bool,
|
|
181
201
|
onClick: _propTypes.default.func.isRequired,
|
|
202
|
+
/**
|
|
203
|
+
* Overrides the default button label with a custom React node.
|
|
204
|
+
*
|
|
205
|
+
* When defined, you're responsible for updating the custom label
|
|
206
|
+
* when the data needs updating (the `needsUpdate` prop)
|
|
207
|
+
* or is loading (the `isLoading` prop).
|
|
208
|
+
*/
|
|
209
|
+
children: _propTypes.default.node,
|
|
182
210
|
/**
|
|
183
211
|
* Show the "Click to apply" tooltip
|
|
184
212
|
*/
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.GUTTER_SIZES = exports.EuiFlexGrid = exports.DIRECTIONS = exports.ALIGN_ITEMS = void 0;
|
|
8
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
11
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
-
var _react =
|
|
12
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
13
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
14
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
15
|
var _services = require("../../services");
|
|
14
16
|
var _flex_grid = require("./flex_grid.styles");
|
|
15
17
|
var _react2 = require("@emotion/react");
|
|
16
|
-
var _excluded = ["children", "className", "gutterSize", "direction", "alignItems", "responsive", "columns", "component"];
|
|
18
|
+
var _excluded = ["children", "className", "style", "gutterSize", "direction", "alignItems", "responsive", "columns", "component"];
|
|
17
19
|
/*
|
|
18
20
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
19
21
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -21,6 +23,10 @@ var _excluded = ["children", "className", "gutterSize", "direction", "alignItems
|
|
|
21
23
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
22
24
|
* Side Public License, v 1.
|
|
23
25
|
*/
|
|
26
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
27
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
28
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
29
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
24
30
|
var DIRECTIONS = ['row', 'column'];
|
|
25
31
|
exports.DIRECTIONS = DIRECTIONS;
|
|
26
32
|
var ALIGN_ITEMS = ['stretch', 'start', 'end', 'center', 'baseline'];
|
|
@@ -30,6 +36,7 @@ exports.GUTTER_SIZES = GUTTER_SIZES;
|
|
|
30
36
|
var EuiFlexGrid = function EuiFlexGrid(_ref) {
|
|
31
37
|
var children = _ref.children,
|
|
32
38
|
className = _ref.className,
|
|
39
|
+
style = _ref.style,
|
|
33
40
|
_ref$gutterSize = _ref.gutterSize,
|
|
34
41
|
gutterSize = _ref$gutterSize === void 0 ? 'l' : _ref$gutterSize,
|
|
35
42
|
_ref$direction = _ref.direction,
|
|
@@ -43,14 +50,21 @@ var EuiFlexGrid = function EuiFlexGrid(_ref) {
|
|
|
43
50
|
_ref$component = _ref.component,
|
|
44
51
|
Component = _ref$component === void 0 ? 'div' : _ref$component,
|
|
45
52
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
46
|
-
var gridTemplateRows = direction === 'column' ? Math.ceil(_react.default.Children.count(children) / columns) : 0;
|
|
47
|
-
var euiTheme = (0, _services.useEuiTheme)();
|
|
48
|
-
var styles = (0, _flex_grid.euiFlexGridStyles)(euiTheme, gridTemplateRows);
|
|
49
|
-
var cssStyles = [styles.euiFlexGrid, styles.gutterSizes[gutterSize], styles.direction[direction], styles.alignItems[alignItems], styles.columnCount[columns], responsive && styles.responsive];
|
|
50
53
|
var classes = (0, _classnames.default)('euiFlexGrid', className);
|
|
54
|
+
var styles = (0, _services.useEuiMemoizedStyles)(_flex_grid.euiFlexGridStyles);
|
|
55
|
+
var cssStyles = [styles.euiFlexGrid, styles.gutterSizes[gutterSize], styles.direction[direction], styles.alignItems[alignItems], styles.columnCount[columns], responsive && styles.responsive];
|
|
56
|
+
var columnDirectionStyles = (0, _react.useMemo)(function () {
|
|
57
|
+
if (direction === 'column') {
|
|
58
|
+
var rowsToRender = Math.ceil(_react.default.Children.count(children) / columns);
|
|
59
|
+
return {
|
|
60
|
+
gridTemplateRows: "repeat(".concat(rowsToRender, ", 1fr)")
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
}, [direction, columns, children]);
|
|
51
64
|
return (0, _react2.jsx)(Component, (0, _extends2.default)({
|
|
52
65
|
css: cssStyles,
|
|
53
|
-
className: classes
|
|
66
|
+
className: classes,
|
|
67
|
+
style: columnDirectionStyles ? _objectSpread(_objectSpread({}, style), columnDirectionStyles) : style
|
|
54
68
|
}, rest), children);
|
|
55
69
|
};
|
|
56
70
|
exports.EuiFlexGrid = EuiFlexGrid;
|
|
@@ -86,6 +86,14 @@ var _ref9 = process.env.NODE_ENV === "production" ? {
|
|
|
86
86
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
87
87
|
};
|
|
88
88
|
var _ref10 = process.env.NODE_ENV === "production" ? {
|
|
89
|
+
name: "1t690q7-column",
|
|
90
|
+
styles: "grid-auto-flow:column;label:column;"
|
|
91
|
+
} : {
|
|
92
|
+
name: "1t690q7-column",
|
|
93
|
+
styles: "grid-auto-flow:column;label:column;",
|
|
94
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
95
|
+
};
|
|
96
|
+
var _ref11 = process.env.NODE_ENV === "production" ? {
|
|
89
97
|
name: "1uinx0j-euiFlexGrid",
|
|
90
98
|
styles: "display:grid;label:euiFlexGrid;"
|
|
91
99
|
} : {
|
|
@@ -93,18 +101,17 @@ var _ref10 = process.env.NODE_ENV === "production" ? {
|
|
|
93
101
|
styles: "display:grid;label:euiFlexGrid;",
|
|
94
102
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
95
103
|
};
|
|
96
|
-
// Note: the only way to get column direction working with `display: grid`
|
|
97
|
-
// the same way `display: flex` works is to manually set `grid-template-rows`,
|
|
98
|
-
// calculated based on the number of children in the grid
|
|
99
104
|
var euiFlexGridStyles = function euiFlexGridStyles(euiThemeContext) {
|
|
100
|
-
var gridTemplateRows = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
101
105
|
var euiTheme = euiThemeContext.euiTheme;
|
|
102
106
|
return {
|
|
103
|
-
euiFlexGrid:
|
|
107
|
+
euiFlexGrid: _ref11,
|
|
104
108
|
responsive: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiMaxBreakpoint)(euiThemeContext, 'm'), "{grid-template-columns:repeat(1, 1fr);grid-auto-flow:row;};label:responsive;"),
|
|
105
109
|
direction: {
|
|
106
110
|
row: /*#__PURE__*/(0, _react.css)(";label:row;"),
|
|
107
|
-
|
|
111
|
+
// Note: the only way to get column direction working with `display: grid`
|
|
112
|
+
// the same way `display: flex` works is to manually set `grid-template-rows`,
|
|
113
|
+
// calculated based on the number of children in the grid
|
|
114
|
+
column: _ref10
|
|
108
115
|
},
|
|
109
116
|
columnCount: {
|
|
110
117
|
'1': _ref9,
|
|
@@ -5,7 +5,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.JUSTIFY_CONTENTS = exports.GUTTER_SIZES = exports.EuiFlexGroup = exports.DIRECTIONS = exports.ALIGN_ITEMS = void 0;
|
|
8
|
+
exports.JUSTIFY_CONTENTS = exports.GUTTER_SIZES = exports.EuiFlexGroup = exports.DIRECTIONS = exports.COMPONENT_TYPES = exports.ALIGN_ITEMS = void 0;
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
@@ -32,9 +32,8 @@ var JUSTIFY_CONTENTS = ['flexStart', 'flexEnd', 'center', 'spaceBetween', 'space
|
|
|
32
32
|
exports.JUSTIFY_CONTENTS = JUSTIFY_CONTENTS;
|
|
33
33
|
var DIRECTIONS = ['row', 'rowReverse', 'column', 'columnReverse'];
|
|
34
34
|
exports.DIRECTIONS = DIRECTIONS;
|
|
35
|
-
var
|
|
36
|
-
|
|
37
|
-
};
|
|
35
|
+
var COMPONENT_TYPES = ['div', 'span'];
|
|
36
|
+
exports.COMPONENT_TYPES = COMPONENT_TYPES;
|
|
38
37
|
var EuiFlexGroup = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
39
38
|
var children = _ref.children,
|
|
40
39
|
className = _ref.className,
|
|
@@ -53,13 +52,14 @@ var EuiFlexGroup = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
53
52
|
_ref$component = _ref.component,
|
|
54
53
|
component = _ref$component === void 0 ? 'div' : _ref$component,
|
|
55
54
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
56
|
-
var
|
|
57
|
-
var styles = (0, _flex_group.euiFlexGroupStyles)(euiTheme);
|
|
55
|
+
var styles = (0, _services.useEuiMemoizedStyles)(_flex_group.euiFlexGroupStyles);
|
|
58
56
|
var cssStyles = [styles.euiFlexGroup, responsive && !direction.includes('column') && styles.responsive, wrap && styles.wrap, styles.gutterSizes[gutterSize], styles.justifyContent[justifyContent], styles.alignItems[alignItems], styles.direction[direction]];
|
|
59
57
|
var classes = (0, _classnames.default)('euiFlexGroup', className);
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
58
|
+
(0, _react.useEffect)(function () {
|
|
59
|
+
if (!COMPONENT_TYPES.includes(component)) {
|
|
60
|
+
throw new Error("".concat(component, " is not a valid element type. Use `div` or `span`."));
|
|
61
|
+
}
|
|
62
|
+
}, [component]);
|
|
63
63
|
return component === 'span' ? (0, _react2.jsx)("span", (0, _extends2.default)({
|
|
64
64
|
css: cssStyles,
|
|
65
65
|
className: classes,
|
|
@@ -73,7 +73,7 @@ var EuiFlexGroup = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
73
73
|
exports.EuiFlexGroup = EuiFlexGroup;
|
|
74
74
|
EuiFlexGroup.propTypes = {
|
|
75
75
|
alignItems: _propTypes.default.any,
|
|
76
|
-
component: _propTypes.default.
|
|
76
|
+
component: _propTypes.default.any,
|
|
77
77
|
direction: _propTypes.default.any,
|
|
78
78
|
gutterSize: _propTypes.default.any,
|
|
79
79
|
justifyContent: _propTypes.default.any,
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
|
-
exports.
|
|
8
|
+
exports.EuiFlexItem = void 0;
|
|
8
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
10
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
-
var _react =
|
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
13
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
14
|
var _flex_item = require("./flex_item.styles");
|
|
@@ -20,6 +21,9 @@ var _excluded = ["children", "className", "grow", "component"];
|
|
|
20
21
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
21
22
|
* Side Public License, v 1.
|
|
22
23
|
*/
|
|
24
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
25
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
26
|
+
var VALID_GROW_VALUES = [null, undefined, true, false, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
|
23
27
|
var EuiFlexItem = function EuiFlexItem(_ref) {
|
|
24
28
|
var children = _ref.children,
|
|
25
29
|
className = _ref.className,
|
|
@@ -28,9 +32,12 @@ var EuiFlexItem = function EuiFlexItem(_ref) {
|
|
|
28
32
|
_ref$component = _ref.component,
|
|
29
33
|
Component = _ref$component === void 0 ? 'div' : _ref$component,
|
|
30
34
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
35
|
+
(0, _react.useEffect)(function () {
|
|
36
|
+
if (VALID_GROW_VALUES.indexOf(grow) === -1) {
|
|
37
|
+
throw new Error("Prop `grow` passed to `EuiFlexItem` must be a boolean or an integer between 0 and 10, received `".concat(grow, "`"));
|
|
38
|
+
}
|
|
39
|
+
}, [grow]);
|
|
40
|
+
var cssStyles = [_flex_item.euiFlexItemStyles.euiFlexItem, !grow ? _flex_item.euiFlexItemStyles.growZero : _flex_item.euiFlexItemStyles.grow, grow && (typeof grow === 'number' ? _flex_item.euiFlexItemStyles.growSizes[grow] : _flex_item.euiFlexItemStyles.growSizes['1'])];
|
|
34
41
|
var classes = (0, _classnames.default)('euiFlexItem', className);
|
|
35
42
|
return (0, _react2.jsx)(Component, (0, _extends2.default)({
|
|
36
43
|
css: cssStyles,
|
|
@@ -49,11 +56,4 @@ EuiFlexItem.propTypes = {
|
|
|
49
56
|
* @default div
|
|
50
57
|
*/
|
|
51
58
|
component: _propTypes.default.any
|
|
52
|
-
};
|
|
53
|
-
var VALID_GROW_VALUES = [null, undefined, true, false, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
|
54
|
-
exports.VALID_GROW_VALUES = VALID_GROW_VALUES;
|
|
55
|
-
function validateGrowValue(value) {
|
|
56
|
-
if (VALID_GROW_VALUES.indexOf(value) === -1) {
|
|
57
|
-
throw new Error("Prop `grow` passed to `EuiFlexItem` must be a boolean or an integer between 0 and 10, received `".concat(value, "`"));
|
|
58
|
-
}
|
|
59
|
-
}
|
|
59
|
+
};
|