@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
|
@@ -5,9 +5,11 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.useDataGridColumnSorting = void 0;
|
|
8
|
+
exports.useDataGridColumnSorting = exports.DataGridSortingControl = void 0;
|
|
9
9
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
10
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
12
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
14
|
var _button = require("../../button");
|
|
13
15
|
var _drag_and_drop = require("../../drag_and_drop");
|
|
@@ -20,8 +22,7 @@ var _data_grid_toolbar_control = require("./data_grid_toolbar_control");
|
|
|
20
22
|
var _column_sorting_draggable = require("./column_sorting_draggable");
|
|
21
23
|
var _data_grid_schema = require("../utils/data_grid_schema");
|
|
22
24
|
var _react2 = require("@emotion/react");
|
|
23
|
-
|
|
24
|
-
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; }
|
|
25
|
+
var _excluded = ["sorting"];
|
|
25
26
|
/*
|
|
26
27
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
27
28
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -29,80 +30,108 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
29
30
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
30
31
|
* Side Public License, v 1.
|
|
31
32
|
*/
|
|
32
|
-
|
|
33
|
-
var
|
|
33
|
+
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); }
|
|
34
|
+
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; }
|
|
35
|
+
var useDataGridColumnSorting = function useDataGridColumnSorting(_ref) {
|
|
36
|
+
var sorting = _ref.sorting,
|
|
37
|
+
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
38
|
+
return sorting == null ? null : (0, _react2.jsx)(DataGridSortingControl, (0, _extends2.default)({
|
|
39
|
+
sorting: sorting
|
|
40
|
+
}, rest));
|
|
41
|
+
};
|
|
42
|
+
exports.useDataGridColumnSorting = useDataGridColumnSorting;
|
|
43
|
+
var DataGridSortingControl = /*#__PURE__*/(0, _react.memo)(function (_ref2) {
|
|
44
|
+
var columns = _ref2.columns,
|
|
45
|
+
sorting = _ref2.sorting,
|
|
46
|
+
schema = _ref2.schema,
|
|
47
|
+
schemaDetectors = _ref2.schemaDetectors,
|
|
48
|
+
displayValues = _ref2.displayValues;
|
|
34
49
|
var _useState = (0, _react.useState)(false),
|
|
35
50
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
36
51
|
isOpen = _useState2[0],
|
|
37
52
|
setIsOpen = _useState2[1];
|
|
53
|
+
var sortingButtonText = (0, _i18n.useEuiI18n)('euiColumnSorting.button', 'Sort fields');
|
|
54
|
+
var sortFieldAriaLabel = (0, _i18n.useEuiI18n)('euiColumnSorting.sortFieldAriaLabel', 'Sort by: ');
|
|
38
55
|
var _useState3 = (0, _react.useState)(false),
|
|
39
56
|
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
40
57
|
availableColumnsIsOpen = _useState4[0],
|
|
41
58
|
setAvailableColumnsIsOpen = _useState4[1];
|
|
59
|
+
var availableColumnIds = (0, _react.useMemo)(function () {
|
|
60
|
+
return new Set(columns.map(function (_ref3) {
|
|
61
|
+
var id = _ref3.id;
|
|
62
|
+
return id;
|
|
63
|
+
}));
|
|
64
|
+
}, [columns]);
|
|
65
|
+
|
|
42
66
|
// prune any non-existent/hidden columns from sorting
|
|
43
67
|
(0, _react.useEffect)(function () {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
var
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}));
|
|
50
|
-
for (var i = 0; i < sorting.columns.length; i++) {
|
|
51
|
-
var column = sorting.columns[i];
|
|
52
|
-
if (availableColumnIds.has(column.id)) {
|
|
53
|
-
nextSortingColumns.push(column);
|
|
54
|
-
}
|
|
68
|
+
var nextSortingColumns = [];
|
|
69
|
+
for (var i = 0; i < sorting.columns.length; i++) {
|
|
70
|
+
var column = sorting.columns[i];
|
|
71
|
+
if (availableColumnIds.has(column.id)) {
|
|
72
|
+
nextSortingColumns.push(column);
|
|
55
73
|
}
|
|
74
|
+
}
|
|
56
75
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
76
|
+
// if the column array lengths differ then the sorting columns have been pruned
|
|
77
|
+
if (nextSortingColumns.length !== sorting.columns.length) {
|
|
78
|
+
sorting.onSort(nextSortingColumns);
|
|
61
79
|
}
|
|
62
|
-
}, [
|
|
63
|
-
var
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}),
|
|
80
|
-
inactiveColumns =
|
|
81
|
-
var onDragEnd = function
|
|
82
|
-
var sourceIndex =
|
|
83
|
-
destination =
|
|
80
|
+
}, [availableColumnIds, sorting]);
|
|
81
|
+
var _useMemo = (0, _react.useMemo)(function () {
|
|
82
|
+
var activeColumnIds = new Set(sorting.columns.map(function (_ref4) {
|
|
83
|
+
var id = _ref4.id;
|
|
84
|
+
return id;
|
|
85
|
+
}));
|
|
86
|
+
return columns.reduce(function (acc, column) {
|
|
87
|
+
if (activeColumnIds.has(column.id)) {
|
|
88
|
+
acc.activeColumns.push(column);
|
|
89
|
+
} else {
|
|
90
|
+
acc.inactiveColumns.push(column);
|
|
91
|
+
}
|
|
92
|
+
return acc;
|
|
93
|
+
}, {
|
|
94
|
+
activeColumns: [],
|
|
95
|
+
inactiveColumns: []
|
|
96
|
+
});
|
|
97
|
+
}, [columns, sorting]),
|
|
98
|
+
inactiveColumns = _useMemo.inactiveColumns;
|
|
99
|
+
var onDragEnd = (0, _react.useCallback)(function (_ref5) {
|
|
100
|
+
var sourceIndex = _ref5.source.index,
|
|
101
|
+
destination = _ref5.destination;
|
|
84
102
|
if (destination) {
|
|
85
103
|
var destinationIndex = destination.index;
|
|
86
104
|
var nextColumns = (0, _drag_and_drop.euiDragDropReorder)(sorting.columns, sourceIndex, destinationIndex);
|
|
87
105
|
sorting.onSort(nextColumns);
|
|
88
106
|
}
|
|
89
|
-
};
|
|
90
|
-
var schemaDetails = function
|
|
107
|
+
}, [sorting]);
|
|
108
|
+
var schemaDetails = (0, _react.useCallback)(function (id) {
|
|
91
109
|
return schema.hasOwnProperty(id) && schema[id].columnType != null ? (0, _data_grid_schema.getDetailsForSchema)(schemaDetectors, schema[id].columnType) : null;
|
|
92
|
-
};
|
|
93
|
-
var inactiveSortableColumns =
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
110
|
+
}, [schema, schemaDetectors]);
|
|
111
|
+
var inactiveSortableColumns = (0, _react.useMemo)(function () {
|
|
112
|
+
return inactiveColumns.filter(function (_ref6) {
|
|
113
|
+
var id = _ref6.id,
|
|
114
|
+
isSortable = _ref6.isSortable;
|
|
115
|
+
var schemaDetail = schemaDetails(id);
|
|
116
|
+
var sortable = true;
|
|
117
|
+
if (isSortable != null) {
|
|
118
|
+
sortable = isSortable;
|
|
119
|
+
} else if (schemaDetail != null) {
|
|
120
|
+
sortable = schemaDetail.hasOwnProperty('isSortable') ? schemaDetail.isSortable : true;
|
|
121
|
+
}
|
|
122
|
+
return sortable;
|
|
123
|
+
});
|
|
124
|
+
}, [inactiveColumns, schemaDetails]);
|
|
125
|
+
var onButtonClick = (0, _react.useCallback)(function (id, defaultSortDirection) {
|
|
126
|
+
var _schemaDetails;
|
|
127
|
+
var nextColumns = (0, _toConsumableArray2.default)(sorting.columns);
|
|
128
|
+
nextColumns.push({
|
|
129
|
+
id: id,
|
|
130
|
+
direction: defaultSortDirection || ((_schemaDetails = schemaDetails(id)) === null || _schemaDetails === void 0 ? void 0 : _schemaDetails.defaultSortDirection) || 'asc'
|
|
131
|
+
});
|
|
132
|
+
sorting.onSort(nextColumns);
|
|
133
|
+
}, [sorting, schemaDetails]);
|
|
134
|
+
return (0, _react2.jsx)(_popover.EuiPopover, {
|
|
106
135
|
"data-test-subj": "dataGridColumnSortingPopover",
|
|
107
136
|
isOpen: isOpen,
|
|
108
137
|
closePopover: function closePopover() {
|
|
@@ -124,9 +153,9 @@ var useDataGridColumnSorting = function useDataGridColumnSorting(columns, sortin
|
|
|
124
153
|
}, (0, _react2.jsx)(_drag_and_drop.EuiDroppable, {
|
|
125
154
|
droppableId: "columnSorting",
|
|
126
155
|
className: "euiDataGrid__controlScroll"
|
|
127
|
-
}, (0, _react2.jsx)(_react.default.Fragment, null, sorting.columns.map(function (
|
|
128
|
-
var id =
|
|
129
|
-
direction =
|
|
156
|
+
}, (0, _react2.jsx)(_react.default.Fragment, null, sorting.columns.map(function (_ref7, index) {
|
|
157
|
+
var id = _ref7.id,
|
|
158
|
+
direction = _ref7.direction;
|
|
130
159
|
return (0, _react2.jsx)(_column_sorting_draggable.EuiDataGridColumnSortingDraggable, {
|
|
131
160
|
key: id,
|
|
132
161
|
id: id,
|
|
@@ -172,49 +201,38 @@ var useDataGridColumnSorting = function useDataGridColumnSorting(columns, sortin
|
|
|
172
201
|
token: "euiColumnSorting.pickFields",
|
|
173
202
|
default: "Pick fields to sort by"
|
|
174
203
|
}))
|
|
175
|
-
}, (0, _react2.jsx)(
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
}, function (
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
grow: false
|
|
208
|
-
}, (0, _react2.jsx)(_token.EuiToken, {
|
|
209
|
-
iconType: schemaDetails(id) != null ? (0, _data_grid_schema.getDetailsForSchema)(schemaDetectors, schema[id].columnType).icon : 'tokenString',
|
|
210
|
-
color: schemaDetails(id) != null ? (0, _data_grid_schema.getDetailsForSchema)(schemaDetectors, schema[id].columnType).color : undefined
|
|
211
|
-
})), (0, _react2.jsx)(_flex.EuiFlexItem, {
|
|
212
|
-
grow: false
|
|
213
|
-
}, (0, _react2.jsx)(_text.EuiText, {
|
|
214
|
-
size: "xs"
|
|
215
|
-
}, displayValues[id]))));
|
|
216
|
-
}));
|
|
217
|
-
}))), sorting.columns.length > 0 ? (0, _react2.jsx)(_flex.EuiFlexItem, {
|
|
204
|
+
}, (0, _react2.jsx)("div", {
|
|
205
|
+
className: "euiDataGridColumnSorting__fieldList",
|
|
206
|
+
role: "listbox"
|
|
207
|
+
}, inactiveSortableColumns.map(function (_ref8) {
|
|
208
|
+
var id = _ref8.id,
|
|
209
|
+
defaultSortDirection = _ref8.defaultSortDirection;
|
|
210
|
+
return (0, _react2.jsx)("button", {
|
|
211
|
+
key: id,
|
|
212
|
+
className: "euiDataGridColumnSorting__field",
|
|
213
|
+
"aria-label": "".concat(sortFieldAriaLabel, " ").concat(id),
|
|
214
|
+
role: "option",
|
|
215
|
+
"aria-selected": "false",
|
|
216
|
+
"data-test-subj": "dataGridColumnSortingPopoverColumnSelection-".concat(id),
|
|
217
|
+
onClick: function onClick() {
|
|
218
|
+
return onButtonClick(id, defaultSortDirection);
|
|
219
|
+
}
|
|
220
|
+
}, (0, _react2.jsx)(_flex.EuiFlexGroup, {
|
|
221
|
+
alignItems: "center",
|
|
222
|
+
gutterSize: "s",
|
|
223
|
+
component: "span",
|
|
224
|
+
responsive: false
|
|
225
|
+
}, (0, _react2.jsx)(_flex.EuiFlexItem, {
|
|
226
|
+
grow: false
|
|
227
|
+
}, (0, _react2.jsx)(_token.EuiToken, {
|
|
228
|
+
iconType: schemaDetails(id) != null ? (0, _data_grid_schema.getDetailsForSchema)(schemaDetectors, schema[id].columnType).icon : 'tokenString',
|
|
229
|
+
color: schemaDetails(id) != null ? (0, _data_grid_schema.getDetailsForSchema)(schemaDetectors, schema[id].columnType).color : undefined
|
|
230
|
+
})), (0, _react2.jsx)(_flex.EuiFlexItem, {
|
|
231
|
+
grow: false
|
|
232
|
+
}, (0, _react2.jsx)(_text.EuiText, {
|
|
233
|
+
size: "xs"
|
|
234
|
+
}, displayValues[id]))));
|
|
235
|
+
})))), sorting.columns.length > 0 ? (0, _react2.jsx)(_flex.EuiFlexItem, {
|
|
218
236
|
grow: false
|
|
219
237
|
}, (0, _react2.jsx)(_button.EuiButtonEmpty, {
|
|
220
238
|
size: "xs",
|
|
@@ -227,6 +245,6 @@ var useDataGridColumnSorting = function useDataGridColumnSorting(columns, sortin
|
|
|
227
245
|
token: "euiColumnSorting.clearAll",
|
|
228
246
|
default: "Clear sorting"
|
|
229
247
|
}))) : null)));
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
248
|
+
});
|
|
249
|
+
exports.DataGridSortingControl = DataGridSortingControl;
|
|
250
|
+
DataGridSortingControl.displayName = 'DataGridSortingControl';
|
|
@@ -1,6 +1,7 @@
|
|
|
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
|
});
|
|
@@ -8,7 +9,7 @@ exports.defaultSortDescLabel = exports.defaultSortAscLabel = exports.EuiDataGrid
|
|
|
8
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
10
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
10
11
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
|
-
var _react =
|
|
12
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
12
13
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
14
|
var _accessibility = require("../../accessibility");
|
|
14
15
|
var _button = require("../../button");
|
|
@@ -28,6 +29,8 @@ var _excluded = ["id", "display", "direction", "index", "sorting", "schema", "sc
|
|
|
28
29
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
29
30
|
* Side Public License, v 1.
|
|
30
31
|
*/
|
|
32
|
+
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); }
|
|
33
|
+
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; }
|
|
31
34
|
var defaultSortAscLabel = (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
32
35
|
token: "euiColumnSortingDraggable.defaultSortAsc",
|
|
33
36
|
default: "A-Z"
|
|
@@ -62,6 +65,27 @@ var EuiDataGridColumnSortingDraggable = function EuiDataGridColumnSortingDraggab
|
|
|
62
65
|
'data-test-subj': "euiDataGridColumnSorting-sortColumn-".concat(id, "-desc")
|
|
63
66
|
}];
|
|
64
67
|
var dragHandleAriaLabel = (0, _i18n.useEuiI18n)('euiColumnSortingDraggable.dragHandleAriaLabel', 'Drag handle');
|
|
68
|
+
var removeSort = (0, _react.useCallback)(function () {
|
|
69
|
+
var nextColumns = (0, _toConsumableArray2.default)(sorting.columns);
|
|
70
|
+
var columnIndex = nextColumns.map(function (_ref2) {
|
|
71
|
+
var id = _ref2.id;
|
|
72
|
+
return id;
|
|
73
|
+
}).indexOf(id);
|
|
74
|
+
nextColumns.splice(columnIndex, 1);
|
|
75
|
+
sorting.onSort(nextColumns);
|
|
76
|
+
}, [id, sorting]);
|
|
77
|
+
var toggleLegendHandler = (0, _react.useCallback)(function (_, direction) {
|
|
78
|
+
var nextColumns = (0, _toConsumableArray2.default)(sorting.columns);
|
|
79
|
+
var columnIndex = nextColumns.map(function (_ref3) {
|
|
80
|
+
var id = _ref3.id;
|
|
81
|
+
return id;
|
|
82
|
+
}).indexOf(id);
|
|
83
|
+
nextColumns.splice(columnIndex, 1, {
|
|
84
|
+
id: id,
|
|
85
|
+
direction: direction
|
|
86
|
+
});
|
|
87
|
+
sorting.onSort(nextColumns);
|
|
88
|
+
}, [id, sorting]);
|
|
65
89
|
return (0, _react2.jsx)(_drag_and_drop.EuiDraggable, (0, _extends2.default)({
|
|
66
90
|
draggableId: id,
|
|
67
91
|
index: index,
|
|
@@ -99,15 +123,7 @@ var EuiDataGridColumnSortingDraggable = function EuiDataGridColumnSortingDraggab
|
|
|
99
123
|
className: "euiDataGridColumnSorting__button",
|
|
100
124
|
"aria-label": removeSortLabel,
|
|
101
125
|
iconType: "cross",
|
|
102
|
-
onClick:
|
|
103
|
-
var nextColumns = (0, _toConsumableArray2.default)(sorting.columns);
|
|
104
|
-
var columnIndex = nextColumns.map(function (_ref2) {
|
|
105
|
-
var id = _ref2.id;
|
|
106
|
-
return id;
|
|
107
|
-
}).indexOf(id);
|
|
108
|
-
nextColumns.splice(columnIndex, 1);
|
|
109
|
-
sorting.onSort(nextColumns);
|
|
110
|
-
}
|
|
126
|
+
onClick: removeSort
|
|
111
127
|
});
|
|
112
128
|
})), (0, _react2.jsx)(_flex.EuiFlexItem, (0, _extends2.default)({
|
|
113
129
|
className: "euiDataGridColumnSorting__name"
|
|
@@ -142,18 +158,7 @@ var EuiDataGridColumnSortingDraggable = function EuiDataGridColumnSortingDraggab
|
|
|
142
158
|
buttonSize: "compressed",
|
|
143
159
|
className: "euiDataGridColumnSorting__order",
|
|
144
160
|
idSelected: direction === 'asc' ? "".concat(id, "Asc") : "".concat(id, "Desc"),
|
|
145
|
-
onChange:
|
|
146
|
-
var nextColumns = (0, _toConsumableArray2.default)(sorting.columns);
|
|
147
|
-
var columnIndex = nextColumns.map(function (_ref3) {
|
|
148
|
-
var id = _ref3.id;
|
|
149
|
-
return id;
|
|
150
|
-
}).indexOf(id);
|
|
151
|
-
nextColumns.splice(columnIndex, 1, {
|
|
152
|
-
id: id,
|
|
153
|
-
direction: direction
|
|
154
|
-
});
|
|
155
|
-
sorting.onSort(nextColumns);
|
|
156
|
-
}
|
|
161
|
+
onChange: toggleLegendHandler
|
|
157
162
|
});
|
|
158
163
|
})), (0, _react2.jsx)(_flex.EuiFlexItem, (0, _extends2.default)({
|
|
159
164
|
grow: false
|
|
@@ -204,114 +204,116 @@ var useDataGridDisplaySelector = function useDataGridDisplaySelector(showDisplay
|
|
|
204
204
|
}, []);
|
|
205
205
|
var buttonLabel = (0, _i18n.useEuiI18n)('euiDisplaySelector.buttonText', 'Display options');
|
|
206
206
|
var resetButtonLabel = (0, _i18n.useEuiI18n)('euiDisplaySelector.resetButtonText', 'Reset to default');
|
|
207
|
-
var displaySelector =
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
anchorPosition: "downRight",
|
|
214
|
-
panelPaddingSize: "s",
|
|
215
|
-
panelClassName: "euiDataGrid__displayPopoverPanel",
|
|
216
|
-
button: (0, _react2.jsx)(_tool_tip.EuiToolTip, {
|
|
217
|
-
content: buttonLabel,
|
|
218
|
-
delay: "long"
|
|
219
|
-
}, (0, _react2.jsx)(_button.EuiButtonIcon, {
|
|
220
|
-
size: "xs",
|
|
221
|
-
iconType: "controlsHorizontal",
|
|
222
|
-
color: "text",
|
|
223
|
-
"data-test-subj": "dataGridDisplaySelectorButton",
|
|
224
|
-
onClick: function onClick() {
|
|
225
|
-
return setIsOpen(!isOpen);
|
|
207
|
+
var displaySelector = (0, _react.useMemo)(function () {
|
|
208
|
+
return showDensityControls || showRowHeightControls || additionalDisplaySettings ? (0, _react2.jsx)(_popover.EuiPopover, {
|
|
209
|
+
"data-test-subj": "dataGridDisplaySelectorPopover",
|
|
210
|
+
isOpen: isOpen,
|
|
211
|
+
closePopover: function closePopover() {
|
|
212
|
+
return setIsOpen(false);
|
|
226
213
|
},
|
|
227
|
-
"
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
label:
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
label:
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
214
|
+
anchorPosition: "downRight",
|
|
215
|
+
panelPaddingSize: "s",
|
|
216
|
+
panelClassName: "euiDataGrid__displayPopoverPanel",
|
|
217
|
+
button: (0, _react2.jsx)(_tool_tip.EuiToolTip, {
|
|
218
|
+
content: buttonLabel,
|
|
219
|
+
delay: "long"
|
|
220
|
+
}, (0, _react2.jsx)(_button.EuiButtonIcon, {
|
|
221
|
+
size: "xs",
|
|
222
|
+
iconType: "controlsHorizontal",
|
|
223
|
+
color: "text",
|
|
224
|
+
"data-test-subj": "dataGridDisplaySelectorButton",
|
|
225
|
+
onClick: function onClick() {
|
|
226
|
+
return setIsOpen(!isOpen);
|
|
227
|
+
},
|
|
228
|
+
"aria-label": buttonLabel
|
|
229
|
+
}))
|
|
230
|
+
}, showDensityControls && (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
231
|
+
tokens: ['euiDisplaySelector.densityLabel', 'euiDisplaySelector.labelCompact', 'euiDisplaySelector.labelNormal', 'euiDisplaySelector.labelExpanded'],
|
|
232
|
+
defaults: ['Density', 'Compact', 'Normal', 'Expanded']
|
|
233
|
+
}, function (_ref) {
|
|
234
|
+
var _ref2 = (0, _slicedToArray2.default)(_ref, 4),
|
|
235
|
+
densityLabel = _ref2[0],
|
|
236
|
+
labelCompact = _ref2[1],
|
|
237
|
+
labelNormal = _ref2[2],
|
|
238
|
+
labelExpanded = _ref2[3];
|
|
239
|
+
return (0, _react2.jsx)(_form.EuiFormRow, {
|
|
240
|
+
label: densityLabel,
|
|
241
|
+
display: "columnCompressed"
|
|
242
|
+
}, (0, _react2.jsx)(_button.EuiButtonGroup, {
|
|
243
|
+
legend: densityLabel,
|
|
244
|
+
buttonSize: "compressed",
|
|
245
|
+
isFullWidth: true,
|
|
246
|
+
options: [{
|
|
247
|
+
id: densityOptions[0],
|
|
248
|
+
label: labelCompact
|
|
249
|
+
}, {
|
|
250
|
+
id: densityOptions[1],
|
|
251
|
+
label: labelNormal
|
|
252
|
+
}, {
|
|
253
|
+
id: densityOptions[2],
|
|
254
|
+
label: labelExpanded
|
|
255
|
+
}],
|
|
256
|
+
onChange: setGridStyles,
|
|
257
|
+
idSelected: gridDensity,
|
|
258
|
+
"data-test-subj": "densityButtonGroup"
|
|
259
|
+
}));
|
|
260
|
+
}), showRowHeightControls && (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
261
|
+
tokens: ['euiDisplaySelector.rowHeightLabel', 'euiDisplaySelector.labelSingle', 'euiDisplaySelector.labelAuto', 'euiDisplaySelector.labelCustom', 'euiDisplaySelector.lineCountLabel'],
|
|
262
|
+
defaults: ['Row height', 'Single', 'Auto fit', 'Custom', 'Lines per row']
|
|
263
|
+
}, function (_ref3) {
|
|
264
|
+
var _ref4 = (0, _slicedToArray2.default)(_ref3, 5),
|
|
265
|
+
rowHeightLabel = _ref4[0],
|
|
266
|
+
labelSingle = _ref4[1],
|
|
267
|
+
labelAuto = _ref4[2],
|
|
268
|
+
labelCustom = _ref4[3],
|
|
269
|
+
lineCountLabel = _ref4[4];
|
|
270
|
+
return (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_form.EuiFormRow, {
|
|
271
|
+
label: rowHeightLabel,
|
|
272
|
+
display: "columnCompressed"
|
|
273
|
+
}, (0, _react2.jsx)(_button.EuiButtonGroup, {
|
|
274
|
+
legend: rowHeightLabel,
|
|
275
|
+
buttonSize: "compressed",
|
|
276
|
+
isFullWidth: true,
|
|
277
|
+
options: [{
|
|
278
|
+
id: rowHeightButtonOptions[0],
|
|
279
|
+
label: labelSingle
|
|
280
|
+
}, {
|
|
281
|
+
id: rowHeightButtonOptions[1],
|
|
282
|
+
label: labelAuto
|
|
283
|
+
}, {
|
|
284
|
+
id: rowHeightButtonOptions[2],
|
|
285
|
+
label: labelCustom
|
|
286
|
+
}],
|
|
287
|
+
onChange: setRowHeight,
|
|
288
|
+
idSelected: rowHeightSelection,
|
|
289
|
+
"data-test-subj": "rowHeightButtonGroup"
|
|
290
|
+
})), rowHeightSelection === rowHeightButtonOptions[2] && (0, _react2.jsx)(_form.EuiFormRow, {
|
|
291
|
+
label: lineCountLabel,
|
|
292
|
+
display: "columnCompressed"
|
|
293
|
+
}, (0, _react2.jsx)(_form.EuiRange, {
|
|
294
|
+
compressed: true,
|
|
295
|
+
fullWidth: true,
|
|
296
|
+
showInput: true,
|
|
297
|
+
min: 1,
|
|
298
|
+
max: 20,
|
|
299
|
+
step: 1,
|
|
300
|
+
required: true,
|
|
301
|
+
value: lineCountInput,
|
|
302
|
+
onChange: setLineCountHeight,
|
|
303
|
+
"data-test-subj": "lineCountNumber"
|
|
304
|
+
})));
|
|
305
|
+
}), additionalDisplaySettings, showResetButton && (0, _react2.jsx)(_popover.EuiPopoverFooter, null, (0, _react2.jsx)(_flex.EuiFlexGroup, {
|
|
306
|
+
justifyContent: "flexEnd",
|
|
307
|
+
responsive: false
|
|
308
|
+
}, (0, _react2.jsx)(_flex.EuiFlexItem, {
|
|
309
|
+
grow: false
|
|
310
|
+
}, (0, _react2.jsx)("div", null, (0, _react2.jsx)(_button.EuiButtonEmpty, {
|
|
311
|
+
flush: "both",
|
|
312
|
+
size: "xs",
|
|
313
|
+
onClick: resetToInitialState,
|
|
314
|
+
"data-test-subj": "resetDisplaySelector"
|
|
315
|
+
}, resetButtonLabel)))))) : null;
|
|
316
|
+
}, [additionalDisplaySettings, buttonLabel, isOpen, resetButtonLabel, showDensityControls, showResetButton, showRowHeightControls, gridDensity, rowHeightSelection, lineCountInput, setGridStyles, setRowHeight, setLineCountHeight, resetToInitialState]);
|
|
315
317
|
return [displaySelector, gridStyles, rowHeightsOptions];
|
|
316
318
|
};
|
|
317
319
|
exports.useDataGridDisplaySelector = useDataGridDisplaySelector;
|