@elastic/eui 85.1.0 → 86.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eui_charts_theme.js +26 -2
- package/dist/eui_charts_theme.js.map +1 -1
- package/es/components/combo_box/combo_box_options_list/combo_box_title.js +1 -3
- package/es/components/datagrid/body/data_grid_body.js +7 -7
- package/es/components/datagrid/body/data_grid_body_custom.js +7 -7
- package/es/components/datagrid/body/data_grid_body_virtualized.js +7 -7
- package/es/components/datagrid/body/data_grid_cell.js +14 -13
- package/es/components/datagrid/body/header/data_grid_control_header_cell.js +2 -2
- package/es/components/datagrid/body/header/data_grid_header_cell.js +1 -1
- package/es/components/datagrid/body/header/data_grid_header_row.js +5 -5
- package/es/components/datagrid/controls/data_grid_toolbar.js +31 -26
- package/es/components/datagrid/controls/display_selector.js +1 -1
- package/es/components/datagrid/data_grid.js +7 -7
- package/es/components/datagrid/utils/in_memory.js +4 -4
- package/es/components/datagrid/utils/row_heights.js +4 -4
- package/es/components/date_picker/date_picker.js +1 -1
- package/es/components/drag_and_drop/drag_drop_context.js +1 -1
- package/es/components/drag_and_drop/draggable.js +2 -2
- package/es/components/drag_and_drop/droppable.js +1 -1
- package/es/components/drag_and_drop/index.js +3 -2
- package/es/components/header/header_section/header_section_item_button.js +94 -0
- package/es/components/highlight/highlight.js +2 -2
- package/es/components/inline_edit/inline_edit_text.js +2 -3
- package/es/components/inline_edit/inline_edit_title.js +2 -3
- package/es/components/inner_text/index.js +1 -2
- package/es/components/markdown_editor/markdown_actions.js +1 -1
- package/es/components/markdown_editor/markdown_editor_text_area.js +10 -4
- package/es/components/modal/confirm_modal.js +11 -29
- package/es/components/outside_click_detector/outside_click_detector.js +10 -11
- package/es/components/page/page_template.js +8 -8
- package/es/components/popover/wrapping_popover.js +1 -9
- package/es/components/portal/portal.js +34 -24
- package/es/components/tabs/tabs.js +25 -0
- package/es/components/timeline/timeline_item_icon.js +3 -3
- package/es/components/tour/tour_step.js +16 -12
- package/es/services/color/eui_palettes.js +7 -1
- package/es/services/color/index.js +1 -1
- package/es/services/index.js +1 -1
- package/es/services/time/timer.js +3 -5
- package/es/test/rtl/component_helpers.js +1 -1
- package/es/test/rtl/index.js +2 -1
- package/es/test/rtl/render_hook.js +23 -0
- package/eui.d.ts +1234 -748
- package/i18ntokens.json +144 -144
- package/lib/components/combo_box/combo_box_options_list/combo_box_title.js +1 -3
- package/lib/components/datagrid/body/data_grid_body.js +7 -7
- package/lib/components/datagrid/body/data_grid_body_custom.js +7 -7
- package/lib/components/datagrid/body/data_grid_body_virtualized.js +7 -7
- package/lib/components/datagrid/body/data_grid_cell.js +14 -13
- package/lib/components/datagrid/body/header/data_grid_control_header_cell.js +2 -2
- package/lib/components/datagrid/body/header/data_grid_header_cell.js +1 -1
- package/lib/components/datagrid/body/header/data_grid_header_row.js +5 -5
- package/lib/components/datagrid/controls/data_grid_toolbar.js +41 -38
- package/lib/components/datagrid/controls/display_selector.js +1 -1
- package/lib/components/datagrid/data_grid.js +7 -7
- package/lib/components/datagrid/utils/in_memory.js +4 -4
- package/lib/components/datagrid/utils/row_heights.js +4 -4
- package/lib/components/date_picker/date_picker.js +1 -1
- package/lib/components/drag_and_drop/drag_drop_context.js +2 -2
- package/lib/components/drag_and_drop/draggable.js +3 -3
- package/lib/components/drag_and_drop/droppable.js +2 -2
- package/lib/components/header/header_section/header_section_item_button.js +94 -0
- package/lib/components/highlight/highlight.js +2 -2
- package/lib/components/inline_edit/inline_edit_text.js +2 -3
- package/lib/components/inline_edit/inline_edit_title.js +2 -3
- package/lib/components/inner_text/index.js +1 -8
- package/lib/components/markdown_editor/markdown_actions.js +1 -1
- package/lib/components/markdown_editor/markdown_editor_text_area.js +10 -4
- package/lib/components/modal/confirm_modal.js +10 -28
- package/lib/components/outside_click_detector/outside_click_detector.js +10 -11
- package/lib/components/page/page_template.js +8 -8
- package/lib/components/popover/wrapping_popover.js +1 -9
- package/lib/components/portal/portal.js +34 -24
- package/lib/components/tabs/tabs.js +25 -0
- package/lib/components/timeline/timeline_item_icon.js +6 -3
- package/lib/components/tour/tour_step.js +15 -11
- package/lib/services/color/eui_palettes.js +9 -2
- package/lib/services/color/index.js +7 -0
- package/lib/services/index.js +7 -0
- package/lib/services/time/timer.js +3 -5
- package/lib/test/rtl/component_helpers.js +1 -1
- package/lib/test/rtl/index.js +13 -1
- package/lib/test/rtl/render_hook.js +29 -0
- package/optimize/es/components/datagrid/body/data_grid_cell.js +10 -9
- package/optimize/es/components/datagrid/controls/data_grid_toolbar.js +31 -26
- package/optimize/es/components/datagrid/controls/display_selector.js +1 -1
- package/optimize/es/components/datagrid/utils/in_memory.js +2 -2
- package/optimize/es/components/datagrid/utils/row_heights.js +4 -4
- package/optimize/es/components/date_picker/date_picker.js +1 -1
- package/optimize/es/components/drag_and_drop/drag_drop_context.js +1 -1
- package/optimize/es/components/drag_and_drop/draggable.js +2 -2
- package/optimize/es/components/drag_and_drop/droppable.js +1 -1
- package/optimize/es/components/drag_and_drop/index.js +3 -2
- package/optimize/es/components/highlight/highlight.js +2 -2
- package/optimize/es/components/inline_edit/inline_edit_text.js +2 -3
- package/optimize/es/components/inline_edit/inline_edit_title.js +2 -3
- package/optimize/es/components/inner_text/index.js +1 -2
- package/optimize/es/components/markdown_editor/markdown_actions.js +1 -1
- package/optimize/es/components/markdown_editor/markdown_editor_text_area.js +10 -4
- package/optimize/es/components/modal/confirm_modal.js +11 -24
- package/optimize/es/components/outside_click_detector/outside_click_detector.js +10 -11
- package/optimize/es/components/popover/wrapping_popover.js +1 -9
- package/optimize/es/components/portal/portal.js +34 -25
- package/optimize/es/components/timeline/timeline_item_icon.js +3 -3
- package/optimize/es/components/tour/tour_step.js +16 -12
- package/optimize/es/services/color/eui_palettes.js +7 -1
- package/optimize/es/services/color/index.js +1 -1
- package/optimize/es/services/index.js +1 -1
- package/optimize/es/services/time/timer.js +3 -5
- package/optimize/es/test/rtl/component_helpers.js +1 -1
- package/optimize/es/test/rtl/index.js +2 -1
- package/optimize/es/test/rtl/render_hook.js +23 -0
- package/optimize/lib/components/datagrid/body/data_grid_cell.js +10 -9
- package/optimize/lib/components/datagrid/controls/data_grid_toolbar.js +36 -28
- package/optimize/lib/components/datagrid/controls/display_selector.js +1 -1
- package/optimize/lib/components/datagrid/utils/in_memory.js +2 -2
- package/optimize/lib/components/datagrid/utils/row_heights.js +4 -4
- package/optimize/lib/components/date_picker/date_picker.js +1 -1
- package/optimize/lib/components/drag_and_drop/drag_drop_context.js +2 -2
- package/optimize/lib/components/drag_and_drop/draggable.js +3 -3
- package/optimize/lib/components/drag_and_drop/droppable.js +2 -2
- package/optimize/lib/components/highlight/highlight.js +2 -2
- package/optimize/lib/components/inline_edit/inline_edit_text.js +2 -3
- package/optimize/lib/components/inline_edit/inline_edit_title.js +2 -3
- package/optimize/lib/components/inner_text/index.js +1 -8
- package/optimize/lib/components/markdown_editor/markdown_actions.js +1 -1
- package/optimize/lib/components/markdown_editor/markdown_editor_text_area.js +10 -4
- package/optimize/lib/components/modal/confirm_modal.js +10 -23
- package/optimize/lib/components/outside_click_detector/outside_click_detector.js +10 -11
- package/optimize/lib/components/popover/wrapping_popover.js +1 -9
- package/optimize/lib/components/portal/portal.js +34 -25
- package/optimize/lib/components/timeline/timeline_item_icon.js +6 -4
- package/optimize/lib/components/tour/tour_step.js +15 -11
- package/optimize/lib/services/color/eui_palettes.js +9 -2
- package/optimize/lib/services/color/index.js +7 -0
- package/optimize/lib/services/index.js +7 -0
- package/optimize/lib/services/time/timer.js +3 -5
- package/optimize/lib/test/rtl/component_helpers.js +1 -1
- package/optimize/lib/test/rtl/index.js +13 -1
- package/optimize/lib/test/rtl/render_hook.js +29 -0
- package/package.json +23 -16
- package/test-env/components/combo_box/combo_box_options_list/combo_box_title.js +1 -3
- package/test-env/components/datagrid/body/data_grid_body.js +7 -7
- package/test-env/components/datagrid/body/data_grid_body_custom.js +7 -7
- package/test-env/components/datagrid/body/data_grid_body_virtualized.js +7 -7
- package/test-env/components/datagrid/body/data_grid_cell.js +14 -13
- package/test-env/components/datagrid/body/header/data_grid_control_header_cell.js +2 -2
- package/test-env/components/datagrid/body/header/data_grid_header_cell.js +1 -1
- package/test-env/components/datagrid/body/header/data_grid_header_row.js +5 -5
- package/test-env/components/datagrid/controls/data_grid_toolbar.js +36 -28
- package/test-env/components/datagrid/controls/display_selector.js +1 -1
- package/test-env/components/datagrid/data_grid.js +7 -7
- package/test-env/components/datagrid/utils/in_memory.js +4 -4
- package/test-env/components/datagrid/utils/row_heights.js +4 -4
- package/test-env/components/date_picker/date_picker.js +1 -1
- package/test-env/components/drag_and_drop/drag_drop_context.js +2 -2
- package/test-env/components/drag_and_drop/draggable.js +3 -3
- package/test-env/components/drag_and_drop/droppable.js +2 -2
- package/test-env/components/header/header_section/header_section_item_button.js +94 -0
- package/test-env/components/highlight/highlight.js +2 -2
- package/test-env/components/inline_edit/inline_edit_text.js +2 -3
- package/test-env/components/inline_edit/inline_edit_title.js +2 -3
- package/test-env/components/inner_text/index.js +1 -8
- package/test-env/components/markdown_editor/markdown_actions.js +1 -1
- package/test-env/components/markdown_editor/markdown_editor_text_area.js +10 -4
- package/test-env/components/modal/confirm_modal.js +10 -23
- package/test-env/components/outside_click_detector/outside_click_detector.js +10 -11
- package/test-env/components/page/page_template.js +8 -8
- package/test-env/components/popover/wrapping_popover.js +1 -9
- package/test-env/components/portal/portal.js +34 -25
- package/test-env/components/tabs/tabs.js +25 -0
- package/test-env/components/timeline/timeline_item_icon.js +6 -3
- package/test-env/components/tour/tour_step.js +15 -11
- package/test-env/services/color/eui_palettes.js +9 -2
- package/test-env/services/color/index.js +7 -0
- package/test-env/services/index.js +7 -0
- package/test-env/services/time/timer.js +3 -5
- package/test-env/test/rtl/component_helpers.js +1 -1
- package/test-env/test/rtl/index.js +13 -1
- package/test-env/test/rtl/render_hook.js +29 -0
- package/es/components/inner_text/render_to_text.js +0 -47
- package/lib/components/inner_text/render_to_text.js +0 -54
- package/optimize/es/components/inner_text/render_to_text.js +0 -42
- package/optimize/lib/components/inner_text/render_to_text.js +0 -52
- package/test-env/components/inner_text/render_to_text.js +0 -52
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.euiPaletteWarm = exports.euiPalettePositive = exports.euiPaletteNegative = exports.euiPaletteGray = exports.euiPaletteForTemperature = exports.euiPaletteForStatus = exports.euiPaletteForLightBackground = exports.euiPaletteForDarkBackground = exports.euiPaletteCool = exports.euiPaletteComplimentary = exports.euiPaletteColorBlindBehindText = exports.euiPaletteColorBlind = void 0;
|
|
7
|
+
exports.euiPaletteWarm = exports.euiPalettePositive = exports.euiPaletteNegative = exports.euiPaletteGray = exports.euiPaletteForTemperature = exports.euiPaletteForStatus = exports.euiPaletteForLightBackground = exports.euiPaletteForDarkBackground = exports.euiPaletteCool = exports.euiPaletteComplimentary = exports.euiPaletteComplementary = exports.euiPaletteColorBlindBehindText = exports.euiPaletteColorBlind = void 0;
|
|
8
8
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
9
|
var _chromaJs = _interopRequireDefault(require("chroma-js"));
|
|
10
10
|
var _color_palette = require("./color_palette");
|
|
@@ -155,12 +155,19 @@ var euiPaletteForTemperature = function euiPaletteForTemperature(steps) {
|
|
|
155
155
|
return euiPalette([].concat((0, _toConsumableArray2.default)(cools), (0, _toConsumableArray2.default)(warms)), steps, true);
|
|
156
156
|
};
|
|
157
157
|
exports.euiPaletteForTemperature = euiPaletteForTemperature;
|
|
158
|
-
var
|
|
158
|
+
var euiPaletteComplementary = function euiPaletteComplementary(steps) {
|
|
159
159
|
if (steps === 1) {
|
|
160
160
|
return [euiPaletteColorBlind()[1]];
|
|
161
161
|
}
|
|
162
162
|
return euiPalette([euiPaletteColorBlind()[1], euiPaletteColorBlind()[7]], steps, true);
|
|
163
163
|
};
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* The old typo'd name for this palette remains exported until the end of its deprecation period
|
|
167
|
+
* @deprecated Use euiPaletteComplementary instead
|
|
168
|
+
*/
|
|
169
|
+
exports.euiPaletteComplementary = euiPaletteComplementary;
|
|
170
|
+
var euiPaletteComplimentary = euiPaletteComplementary;
|
|
164
171
|
exports.euiPaletteComplimentary = euiPaletteComplimentary;
|
|
165
172
|
var euiPaletteNegative = function euiPaletteNegative(steps) {
|
|
166
173
|
if (steps === 1) {
|
|
@@ -24,6 +24,7 @@ var _exportNames = {
|
|
|
24
24
|
euiPaletteForStatus: true,
|
|
25
25
|
euiPaletteForTemperature: true,
|
|
26
26
|
euiPaletteComplimentary: true,
|
|
27
|
+
euiPaletteComplementary: true,
|
|
27
28
|
euiPaletteNegative: true,
|
|
28
29
|
euiPalettePositive: true,
|
|
29
30
|
euiPaletteCool: true,
|
|
@@ -73,6 +74,12 @@ Object.defineProperty(exports, "euiPaletteColorBlindBehindText", {
|
|
|
73
74
|
return _eui_palettes.euiPaletteColorBlindBehindText;
|
|
74
75
|
}
|
|
75
76
|
});
|
|
77
|
+
Object.defineProperty(exports, "euiPaletteComplementary", {
|
|
78
|
+
enumerable: true,
|
|
79
|
+
get: function get() {
|
|
80
|
+
return _eui_palettes.euiPaletteComplementary;
|
|
81
|
+
}
|
|
82
|
+
});
|
|
76
83
|
Object.defineProperty(exports, "euiPaletteComplimentary", {
|
|
77
84
|
enumerable: true,
|
|
78
85
|
get: function get() {
|
|
@@ -30,6 +30,7 @@ var _exportNames = {
|
|
|
30
30
|
euiPaletteColorBlind: true,
|
|
31
31
|
euiPaletteColorBlindBehindText: true,
|
|
32
32
|
euiPaletteComplimentary: true,
|
|
33
|
+
euiPaletteComplementary: true,
|
|
33
34
|
euiPaletteCool: true,
|
|
34
35
|
euiPaletteForDarkBackground: true,
|
|
35
36
|
euiPaletteForLightBackground: true,
|
|
@@ -264,6 +265,12 @@ Object.defineProperty(exports, "euiPaletteColorBlindBehindText", {
|
|
|
264
265
|
return _color.euiPaletteColorBlindBehindText;
|
|
265
266
|
}
|
|
266
267
|
});
|
|
268
|
+
Object.defineProperty(exports, "euiPaletteComplementary", {
|
|
269
|
+
enumerable: true,
|
|
270
|
+
get: function get() {
|
|
271
|
+
return _color.euiPaletteComplementary;
|
|
272
|
+
}
|
|
273
|
+
});
|
|
267
274
|
Object.defineProperty(exports, "euiPaletteComplimentary", {
|
|
268
275
|
enumerable: true,
|
|
269
276
|
get: function get() {
|
|
@@ -15,13 +15,11 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
15
15
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
16
16
|
* Side Public License, v 1.
|
|
17
17
|
*/
|
|
18
|
-
var Timer = /*#__PURE__*/(0, _createClass2.default)(
|
|
19
|
-
// In a browser this is a number, but in node it's a NodeJS.Time (a
|
|
20
|
-
// class). We don't care about this difference.
|
|
21
|
-
|
|
22
|
-
function Timer(callback, timeMs) {
|
|
18
|
+
var Timer = /*#__PURE__*/(0, _createClass2.default)(function Timer(callback, timeMs) {
|
|
23
19
|
var _this = this;
|
|
24
20
|
(0, _classCallCheck2.default)(this, Timer);
|
|
21
|
+
// In a browser this is a number, but in node it's a NodeJS.Time (a
|
|
22
|
+
// class). We don't care about this difference.
|
|
25
23
|
(0, _defineProperty2.default)(this, "id", void 0);
|
|
26
24
|
(0, _defineProperty2.default)(this, "callback", void 0);
|
|
27
25
|
(0, _defineProperty2.default)(this, "finishTime", void 0);
|
|
@@ -81,4 +81,16 @@ Object.keys(_component_helpers).forEach(function (key) {
|
|
|
81
81
|
});
|
|
82
82
|
});
|
|
83
83
|
var _data_test_subj_queries = require("./data_test_subj_queries");
|
|
84
|
-
var _custom_render = require("./custom_render");
|
|
84
|
+
var _custom_render = require("./custom_render");
|
|
85
|
+
var _render_hook = require("./render_hook");
|
|
86
|
+
Object.keys(_render_hook).forEach(function (key) {
|
|
87
|
+
if (key === "default" || key === "__esModule") return;
|
|
88
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
89
|
+
if (key in exports && exports[key] === _render_hook[key]) return;
|
|
90
|
+
Object.defineProperty(exports, key, {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
get: function get() {
|
|
93
|
+
return _render_hook[key];
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.renderHookAct = exports.renderHook = void 0;
|
|
7
|
+
/*
|
|
8
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
9
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
10
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
11
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
12
|
+
* Side Public License, v 1.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
16
|
+
|
|
17
|
+
var renderHook;
|
|
18
|
+
exports.renderHook = renderHook;
|
|
19
|
+
var renderHookAct;
|
|
20
|
+
exports.renderHookAct = renderHookAct;
|
|
21
|
+
if (process.env.REACT_VERSION === '18') {
|
|
22
|
+
exports.renderHook = renderHook = require('@testing-library/react').renderHook;
|
|
23
|
+
exports.renderHookAct = renderHookAct = require('@testing-library/react').act;
|
|
24
|
+
} else {
|
|
25
|
+
exports.renderHook = renderHook = require('@testing-library/react-hooks').renderHook;
|
|
26
|
+
exports.renderHookAct = renderHookAct = require('@testing-library/react-hooks').act;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/* eslint-enable @typescript-eslint/no-var-requires */
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
6
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
-
/*
|
|
8
|
-
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
9
|
-
* or more contributor license agreements. Licensed under the Elastic License
|
|
10
|
-
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
11
|
-
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
12
|
-
* Side Public License, v 1.
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
import React, { useCallback, useEffect, useRef } from 'react';
|
|
16
|
-
import { render, unmountComponentAtNode } from 'react-dom';
|
|
17
|
-
import { useInnerText } from './inner_text';
|
|
18
|
-
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
19
|
-
export function useRenderToText(node) {
|
|
20
|
-
var placeholder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
21
|
-
var _useInnerText = useInnerText(placeholder),
|
|
22
|
-
_useInnerText2 = _slicedToArray(_useInnerText, 2),
|
|
23
|
-
ref = _useInnerText2[0],
|
|
24
|
-
text = _useInnerText2[1];
|
|
25
|
-
var hostNode = useRef(null);
|
|
26
|
-
var onUnmount = function onUnmount() {
|
|
27
|
-
if (hostNode.current) {
|
|
28
|
-
unmountComponentAtNode(hostNode.current);
|
|
29
|
-
hostNode.current = null;
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
var setRef = useCallback(function (node) {
|
|
33
|
-
if (hostNode.current) {
|
|
34
|
-
ref(node);
|
|
35
|
-
}
|
|
36
|
-
}, [ref]);
|
|
37
|
-
useEffect(function () {
|
|
38
|
-
hostNode.current = document.createDocumentFragment();
|
|
39
|
-
render(___EmotionJSX("div", {
|
|
40
|
-
ref: setRef
|
|
41
|
-
}, node), hostNode.current);
|
|
42
|
-
return function () {
|
|
43
|
-
onUnmount();
|
|
44
|
-
};
|
|
45
|
-
}, [node, setRef]);
|
|
46
|
-
return text || placeholder;
|
|
47
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.useRenderToText = useRenderToText;
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _reactDom = require("react-dom");
|
|
10
|
-
var _inner_text = require("./inner_text");
|
|
11
|
-
var _react2 = require("@emotion/react");
|
|
12
|
-
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); }
|
|
13
|
-
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; }
|
|
14
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
15
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
16
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
17
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
18
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
19
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } /*
|
|
20
|
-
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
21
|
-
* or more contributor license agreements. Licensed under the Elastic License
|
|
22
|
-
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
23
|
-
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
24
|
-
* Side Public License, v 1.
|
|
25
|
-
*/
|
|
26
|
-
function useRenderToText(node) {
|
|
27
|
-
var placeholder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
28
|
-
var _useInnerText = (0, _inner_text.useInnerText)(placeholder),
|
|
29
|
-
_useInnerText2 = _slicedToArray(_useInnerText, 2),
|
|
30
|
-
ref = _useInnerText2[0],
|
|
31
|
-
text = _useInnerText2[1];
|
|
32
|
-
var hostNode = (0, _react.useRef)(null);
|
|
33
|
-
var onUnmount = function onUnmount() {
|
|
34
|
-
if (hostNode.current) {
|
|
35
|
-
(0, _reactDom.unmountComponentAtNode)(hostNode.current);
|
|
36
|
-
hostNode.current = null;
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
var setRef = (0, _react.useCallback)(function (node) {
|
|
40
|
-
if (hostNode.current) {
|
|
41
|
-
ref(node);
|
|
42
|
-
}
|
|
43
|
-
}, [ref]);
|
|
44
|
-
(0, _react.useEffect)(function () {
|
|
45
|
-
hostNode.current = document.createDocumentFragment();
|
|
46
|
-
(0, _reactDom.render)((0, _react2.jsx)("div", {
|
|
47
|
-
ref: setRef
|
|
48
|
-
}, node), hostNode.current);
|
|
49
|
-
return function () {
|
|
50
|
-
onUnmount();
|
|
51
|
-
};
|
|
52
|
-
}, [node, setRef]);
|
|
53
|
-
return text || placeholder;
|
|
54
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
4
|
-
* or more contributor license agreements. Licensed under the Elastic License
|
|
5
|
-
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
6
|
-
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
7
|
-
* Side Public License, v 1.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import React, { useCallback, useEffect, useRef } from 'react';
|
|
11
|
-
import { render, unmountComponentAtNode } from 'react-dom';
|
|
12
|
-
import { useInnerText } from './inner_text';
|
|
13
|
-
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
14
|
-
export function useRenderToText(node) {
|
|
15
|
-
var placeholder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
16
|
-
var _useInnerText = useInnerText(placeholder),
|
|
17
|
-
_useInnerText2 = _slicedToArray(_useInnerText, 2),
|
|
18
|
-
ref = _useInnerText2[0],
|
|
19
|
-
text = _useInnerText2[1];
|
|
20
|
-
var hostNode = useRef(null);
|
|
21
|
-
var onUnmount = function onUnmount() {
|
|
22
|
-
if (hostNode.current) {
|
|
23
|
-
unmountComponentAtNode(hostNode.current);
|
|
24
|
-
hostNode.current = null;
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
var setRef = useCallback(function (node) {
|
|
28
|
-
if (hostNode.current) {
|
|
29
|
-
ref(node);
|
|
30
|
-
}
|
|
31
|
-
}, [ref]);
|
|
32
|
-
useEffect(function () {
|
|
33
|
-
hostNode.current = document.createDocumentFragment();
|
|
34
|
-
render(___EmotionJSX("div", {
|
|
35
|
-
ref: setRef
|
|
36
|
-
}, node), hostNode.current);
|
|
37
|
-
return function () {
|
|
38
|
-
onUnmount();
|
|
39
|
-
};
|
|
40
|
-
}, [node, setRef]);
|
|
41
|
-
return text || placeholder;
|
|
42
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.useRenderToText = useRenderToText;
|
|
9
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
var _reactDom = require("react-dom");
|
|
12
|
-
var _inner_text = require("./inner_text");
|
|
13
|
-
var _react2 = require("@emotion/react");
|
|
14
|
-
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); }
|
|
15
|
-
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; }
|
|
16
|
-
/*
|
|
17
|
-
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
18
|
-
* or more contributor license agreements. Licensed under the Elastic License
|
|
19
|
-
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
20
|
-
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
21
|
-
* Side Public License, v 1.
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
function useRenderToText(node) {
|
|
25
|
-
var placeholder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
26
|
-
var _useInnerText = (0, _inner_text.useInnerText)(placeholder),
|
|
27
|
-
_useInnerText2 = (0, _slicedToArray2.default)(_useInnerText, 2),
|
|
28
|
-
ref = _useInnerText2[0],
|
|
29
|
-
text = _useInnerText2[1];
|
|
30
|
-
var hostNode = (0, _react.useRef)(null);
|
|
31
|
-
var onUnmount = function onUnmount() {
|
|
32
|
-
if (hostNode.current) {
|
|
33
|
-
(0, _reactDom.unmountComponentAtNode)(hostNode.current);
|
|
34
|
-
hostNode.current = null;
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
var setRef = (0, _react.useCallback)(function (node) {
|
|
38
|
-
if (hostNode.current) {
|
|
39
|
-
ref(node);
|
|
40
|
-
}
|
|
41
|
-
}, [ref]);
|
|
42
|
-
(0, _react.useEffect)(function () {
|
|
43
|
-
hostNode.current = document.createDocumentFragment();
|
|
44
|
-
(0, _reactDom.render)((0, _react2.jsx)("div", {
|
|
45
|
-
ref: setRef
|
|
46
|
-
}, node), hostNode.current);
|
|
47
|
-
return function () {
|
|
48
|
-
onUnmount();
|
|
49
|
-
};
|
|
50
|
-
}, [node, setRef]);
|
|
51
|
-
return text || placeholder;
|
|
52
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.useRenderToText = useRenderToText;
|
|
9
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
var _reactDom = require("react-dom");
|
|
12
|
-
var _inner_text = require("./inner_text");
|
|
13
|
-
var _react2 = require("@emotion/react");
|
|
14
|
-
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); }
|
|
15
|
-
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; }
|
|
16
|
-
/*
|
|
17
|
-
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
18
|
-
* or more contributor license agreements. Licensed under the Elastic License
|
|
19
|
-
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
20
|
-
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
21
|
-
* Side Public License, v 1.
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
function useRenderToText(node) {
|
|
25
|
-
var placeholder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
26
|
-
var _useInnerText = (0, _inner_text.useInnerText)(placeholder),
|
|
27
|
-
_useInnerText2 = (0, _slicedToArray2.default)(_useInnerText, 2),
|
|
28
|
-
ref = _useInnerText2[0],
|
|
29
|
-
text = _useInnerText2[1];
|
|
30
|
-
var hostNode = (0, _react.useRef)(null);
|
|
31
|
-
var onUnmount = function onUnmount() {
|
|
32
|
-
if (hostNode.current) {
|
|
33
|
-
(0, _reactDom.unmountComponentAtNode)(hostNode.current);
|
|
34
|
-
hostNode.current = null;
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
var setRef = (0, _react.useCallback)(function (node) {
|
|
38
|
-
if (hostNode.current) {
|
|
39
|
-
ref(node);
|
|
40
|
-
}
|
|
41
|
-
}, [ref]);
|
|
42
|
-
(0, _react.useEffect)(function () {
|
|
43
|
-
hostNode.current = document.createDocumentFragment();
|
|
44
|
-
(0, _reactDom.render)((0, _react2.jsx)("div", {
|
|
45
|
-
ref: setRef
|
|
46
|
-
}, node), hostNode.current);
|
|
47
|
-
return function () {
|
|
48
|
-
onUnmount();
|
|
49
|
-
};
|
|
50
|
-
}, [node, setRef]);
|
|
51
|
-
return text || placeholder;
|
|
52
|
-
}
|