@elastic/eui 88.5.0 → 88.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eui_theme_dark.css +8 -21
- package/dist/eui_theme_dark.min.css +1 -1
- package/dist/eui_theme_light.css +8 -21
- package/dist/eui_theme_light.min.css +1 -1
- package/es/components/collapsible_nav_beta/collapsible_nav_beta.js +20 -6
- package/es/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +4 -14
- package/es/components/collapsible_nav_beta/collapsible_nav_body_footer.js +57 -0
- package/es/components/collapsible_nav_beta/collapsible_nav_body_footer.styles.js +25 -0
- package/es/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.js +156 -0
- package/es/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.styles.js +19 -0
- package/es/components/collapsible_nav_beta/collapsible_nav_group/index.js +9 -0
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +3 -7
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +3 -7
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +4 -8
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +16 -63
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.styles.js +2 -10
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +122 -41
- package/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.styles.js +13 -3
- package/es/components/combo_box/combo_box.js +12 -25
- package/es/components/combo_box/combo_box_input/combo_box_input.js +61 -54
- package/es/components/text_truncate/index.js +1 -1
- package/es/components/text_truncate/utils.js +88 -138
- package/es/services/canvas/canvas_text_utils.js +64 -0
- package/es/services/canvas/index.js +9 -0
- package/es/services/index.js +1 -0
- package/eui.d.ts +186 -105
- package/i18ntokens.json +8 -8
- package/lib/components/collapsible_nav_beta/collapsible_nav_beta.js +20 -6
- package/lib/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +11 -19
- package/lib/components/collapsible_nav_beta/collapsible_nav_body_footer.js +67 -0
- package/lib/components/collapsible_nav_beta/collapsible_nav_body_footer.styles.js +33 -0
- package/lib/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.js +166 -0
- package/lib/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.styles.js +26 -0
- package/lib/components/collapsible_nav_beta/collapsible_nav_group/index.js +12 -0
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +3 -7
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +3 -7
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +4 -8
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +14 -61
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.styles.js +1 -9
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +122 -39
- package/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.styles.js +13 -4
- package/lib/components/combo_box/combo_box.js +12 -25
- package/lib/components/combo_box/combo_box_input/combo_box_input.js +60 -53
- package/lib/components/text_truncate/index.js +0 -6
- package/lib/components/text_truncate/utils.js +97 -148
- package/lib/services/canvas/canvas_text_utils.js +70 -0
- package/lib/services/canvas/index.js +12 -0
- package/lib/services/index.js +8 -0
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_beta.js +17 -3
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +4 -14
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_body_footer.js +56 -0
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_body_footer.styles.js +25 -0
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.js +48 -0
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.styles.js +19 -0
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_group/index.js +9 -0
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +7 -33
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.styles.js +2 -10
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +54 -21
- package/optimize/es/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.styles.js +13 -3
- package/optimize/es/components/combo_box/combo_box.js +12 -25
- package/optimize/es/components/combo_box/combo_box_input/combo_box_input.js +61 -53
- package/optimize/es/components/text_truncate/index.js +1 -1
- package/optimize/es/components/text_truncate/utils.js +87 -137
- package/optimize/es/services/canvas/canvas_text_utils.js +60 -0
- package/optimize/es/services/canvas/index.js +9 -0
- package/optimize/es/services/index.js +1 -0
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_beta.js +15 -1
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +11 -19
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_body_footer.js +66 -0
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_body_footer.styles.js +33 -0
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.js +58 -0
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.styles.js +26 -0
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_group/index.js +12 -0
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +5 -31
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.styles.js +1 -9
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +54 -20
- package/optimize/lib/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.styles.js +13 -4
- package/optimize/lib/components/combo_box/combo_box.js +12 -25
- package/optimize/lib/components/combo_box/combo_box_input/combo_box_input.js +60 -52
- package/optimize/lib/components/text_truncate/index.js +0 -6
- package/optimize/lib/components/text_truncate/utils.js +96 -147
- package/optimize/lib/services/canvas/canvas_text_utils.js +67 -0
- package/optimize/lib/services/canvas/index.js +12 -0
- package/optimize/lib/services/index.js +8 -0
- package/package.json +2 -5
- package/src/components/combo_box/_combo_box.scss +12 -19
- package/test-env/components/collapsible_nav_beta/collapsible_nav_beta.js +20 -6
- package/test-env/components/collapsible_nav_beta/collapsible_nav_beta.styles.js +11 -19
- package/test-env/components/collapsible_nav_beta/collapsible_nav_body_footer.js +66 -0
- package/test-env/components/collapsible_nav_beta/collapsible_nav_body_footer.styles.js +33 -0
- package/test-env/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.js +165 -0
- package/test-env/components/collapsible_nav_beta/collapsible_nav_group/collapsible_nav_group.styles.js +26 -0
- package/test-env/components/collapsible_nav_beta/collapsible_nav_group/index.js +12 -0
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_button.js +3 -7
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_item.js +3 -7
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsed/collapsed_nav_popover.js +4 -8
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.js +14 -61
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_accordion.styles.js +1 -9
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.js +122 -39
- package/test-env/components/collapsible_nav_beta/collapsible_nav_item/collapsible_nav_item.styles.js +13 -4
- package/test-env/components/combo_box/combo_box.js +12 -25
- package/test-env/components/combo_box/combo_box_input/combo_box_input.js +60 -53
- package/test-env/components/text_truncate/index.js +0 -6
- package/test-env/components/text_truncate/utils.js +96 -147
- package/test-env/services/canvas/canvas_text_utils.js +30 -0
- package/test-env/services/canvas/index.js +12 -0
- package/test-env/services/index.js +8 -0
|
@@ -7,7 +7,6 @@ exports.EuiComboBoxInput = void 0;
|
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
-
var _reactInputAutosize = _interopRequireDefault(require("react-input-autosize"));
|
|
11
10
|
var _services = require("../../../services");
|
|
12
11
|
var _accessibility = require("../../accessibility");
|
|
13
12
|
var _form_control_layout = require("../../form/form_control_layout");
|
|
@@ -52,8 +51,27 @@ var EuiComboBoxInput = /*#__PURE__*/function (_Component) {
|
|
|
52
51
|
}
|
|
53
52
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
54
53
|
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
54
|
+
inputWidth: 2,
|
|
55
55
|
hasFocus: false
|
|
56
56
|
});
|
|
57
|
+
_defineProperty(_assertThisInitialized(_this), "widthUtils", void 0);
|
|
58
|
+
_defineProperty(_assertThisInitialized(_this), "inputRefCallback", function (el) {
|
|
59
|
+
var _this$props$inputRef, _this$props;
|
|
60
|
+
_this.widthUtils = new _services.CanvasTextUtils({
|
|
61
|
+
container: el
|
|
62
|
+
});
|
|
63
|
+
(_this$props$inputRef = (_this$props = _this.props).inputRef) === null || _this$props$inputRef === void 0 ? void 0 : _this$props$inputRef.call(_this$props, el);
|
|
64
|
+
});
|
|
65
|
+
_defineProperty(_assertThisInitialized(_this), "updateInputSize", function (inputValue) {
|
|
66
|
+
if (!_this.widthUtils) return;
|
|
67
|
+
_this.widthUtils.setTextToCheck(inputValue);
|
|
68
|
+
// Canvas has minute subpixel differences in rendering compared to DOM
|
|
69
|
+
// We'll buffer the input by ~2px just to ensure sufficient width
|
|
70
|
+
var inputWidth = Math.ceil(_this.widthUtils.textWidth) + 2;
|
|
71
|
+
_this.setState({
|
|
72
|
+
inputWidth: inputWidth
|
|
73
|
+
});
|
|
74
|
+
});
|
|
57
75
|
_defineProperty(_assertThisInitialized(_this), "updatePosition", function () {
|
|
58
76
|
// Wait a beat for the DOM to update, since we depend on DOM elements' bounds.
|
|
59
77
|
requestAnimationFrame(function () {
|
|
@@ -75,13 +93,13 @@ var EuiComboBoxInput = /*#__PURE__*/function (_Component) {
|
|
|
75
93
|
});
|
|
76
94
|
});
|
|
77
95
|
_defineProperty(_assertThisInitialized(_this), "onKeyDown", function (event) {
|
|
78
|
-
var _this$
|
|
79
|
-
searchValue = _this$
|
|
80
|
-
selectedOptions = _this$
|
|
81
|
-
onRemoveOption = _this$
|
|
82
|
-
singleSelection = _this$
|
|
83
|
-
isListOpen = _this$
|
|
84
|
-
onOpenListClick = _this$
|
|
96
|
+
var _this$props2 = _this.props,
|
|
97
|
+
searchValue = _this$props2.searchValue,
|
|
98
|
+
selectedOptions = _this$props2.selectedOptions,
|
|
99
|
+
onRemoveOption = _this$props2.onRemoveOption,
|
|
100
|
+
singleSelection = _this$props2.singleSelection,
|
|
101
|
+
isListOpen = _this$props2.isListOpen,
|
|
102
|
+
onOpenListClick = _this$props2.onOpenListClick;
|
|
85
103
|
|
|
86
104
|
// When backspacing from an empty input, delete the last pill option in the list
|
|
87
105
|
var searchIsEmpty = !searchValue.length;
|
|
@@ -94,18 +112,10 @@ var EuiComboBoxInput = /*#__PURE__*/function (_Component) {
|
|
|
94
112
|
}
|
|
95
113
|
});
|
|
96
114
|
_defineProperty(_assertThisInitialized(_this), "inputOnChange", function (event) {
|
|
97
|
-
var _this$
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
onChange(event.target.value);
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
_defineProperty(_assertThisInitialized(_this), "inputRefCallback", function (ref) {
|
|
105
|
-
var autoSizeInputRef = _this.props.autoSizeInputRef;
|
|
106
|
-
if (autoSizeInputRef) {
|
|
107
|
-
autoSizeInputRef(ref);
|
|
108
|
-
}
|
|
115
|
+
var _this$props$onChange, _this$props3;
|
|
116
|
+
var value = event.target.value;
|
|
117
|
+
_this.updateInputSize(value);
|
|
118
|
+
(_this$props$onChange = (_this$props3 = _this.props).onChange) === null || _this$props$onChange === void 0 ? void 0 : _this$props$onChange.call(_this$props3, value);
|
|
109
119
|
});
|
|
110
120
|
return _this;
|
|
111
121
|
}
|
|
@@ -123,35 +133,34 @@ var EuiComboBoxInput = /*#__PURE__*/function (_Component) {
|
|
|
123
133
|
}, {
|
|
124
134
|
key: "render",
|
|
125
135
|
value: function render() {
|
|
126
|
-
var _this$
|
|
127
|
-
compressed = _this$
|
|
128
|
-
focusedOptionId = _this$
|
|
129
|
-
fullWidth = _this$
|
|
130
|
-
hasSelectedOptions = _this$
|
|
131
|
-
id = _this$
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
ariaLabelledby = _this$props3['aria-labelledby'];
|
|
136
|
+
var _this$props4 = this.props,
|
|
137
|
+
compressed = _this$props4.compressed,
|
|
138
|
+
focusedOptionId = _this$props4.focusedOptionId,
|
|
139
|
+
fullWidth = _this$props4.fullWidth,
|
|
140
|
+
hasSelectedOptions = _this$props4.hasSelectedOptions,
|
|
141
|
+
id = _this$props4.id,
|
|
142
|
+
isDisabled = _this$props4.isDisabled,
|
|
143
|
+
isListOpen = _this$props4.isListOpen,
|
|
144
|
+
noIcon = _this$props4.noIcon,
|
|
145
|
+
onClear = _this$props4.onClear,
|
|
146
|
+
onClick = _this$props4.onClick,
|
|
147
|
+
onCloseListClick = _this$props4.onCloseListClick,
|
|
148
|
+
onOpenListClick = _this$props4.onOpenListClick,
|
|
149
|
+
onRemoveOption = _this$props4.onRemoveOption,
|
|
150
|
+
placeholder = _this$props4.placeholder,
|
|
151
|
+
rootId = _this$props4.rootId,
|
|
152
|
+
searchValue = _this$props4.searchValue,
|
|
153
|
+
selectedOptions = _this$props4.selectedOptions,
|
|
154
|
+
singleSelectionProp = _this$props4.singleSelection,
|
|
155
|
+
toggleButtonRef = _this$props4.toggleButtonRef,
|
|
156
|
+
value = _this$props4.value,
|
|
157
|
+
prepend = _this$props4.prepend,
|
|
158
|
+
append = _this$props4.append,
|
|
159
|
+
isLoading = _this$props4.isLoading,
|
|
160
|
+
isInvalid = _this$props4.isInvalid,
|
|
161
|
+
autoFocus = _this$props4.autoFocus,
|
|
162
|
+
ariaLabel = _this$props4['aria-label'],
|
|
163
|
+
ariaLabelledby = _this$props4['aria-labelledby'];
|
|
155
164
|
var singleSelection = Boolean(singleSelectionProp);
|
|
156
165
|
var asPlainText = singleSelectionProp && _typeof(singleSelectionProp) === 'object' && singleSelectionProp.asPlainText || false;
|
|
157
166
|
var pills = selectedOptions ? selectedOptions.map(function (option) {
|
|
@@ -243,7 +252,7 @@ var EuiComboBoxInput = /*#__PURE__*/function (_Component) {
|
|
|
243
252
|
"data-test-subj": "comboBoxInput",
|
|
244
253
|
onClick: onClick,
|
|
245
254
|
tabIndex: -1 // becomes onBlur event's relatedTarget, otherwise relatedTarget is null when clicking on this div
|
|
246
|
-
}, !singleSelection || !searchValue ? pills : null, placeholderMessage, (0, _react2.jsx)(
|
|
255
|
+
}, !singleSelection || !searchValue ? pills : null, placeholderMessage, (0, _react2.jsx)("input", {
|
|
247
256
|
"aria-activedescendant": focusedOptionId,
|
|
248
257
|
"aria-autocomplete": "list",
|
|
249
258
|
"aria-controls": isListOpen ? rootId('listbox') : '',
|
|
@@ -255,7 +264,6 @@ var EuiComboBoxInput = /*#__PURE__*/function (_Component) {
|
|
|
255
264
|
"data-test-subj": "comboBoxSearchInput",
|
|
256
265
|
disabled: isDisabled,
|
|
257
266
|
id: id,
|
|
258
|
-
inputRef: inputRef,
|
|
259
267
|
onBlur: this.onBlur,
|
|
260
268
|
onChange: this.inputOnChange,
|
|
261
269
|
onFocus: this.onFocus,
|
|
@@ -263,7 +271,7 @@ var EuiComboBoxInput = /*#__PURE__*/function (_Component) {
|
|
|
263
271
|
ref: this.inputRefCallback,
|
|
264
272
|
role: "combobox",
|
|
265
273
|
style: {
|
|
266
|
-
|
|
274
|
+
inlineSize: this.state.inputWidth
|
|
267
275
|
},
|
|
268
276
|
value: searchValue,
|
|
269
277
|
autoFocus: autoFocus
|
|
@@ -274,7 +282,6 @@ var EuiComboBoxInput = /*#__PURE__*/function (_Component) {
|
|
|
274
282
|
}(_react.Component);
|
|
275
283
|
exports.EuiComboBoxInput = EuiComboBoxInput;
|
|
276
284
|
EuiComboBoxInput.propTypes = {
|
|
277
|
-
autoSizeInputRef: _propTypes.default.any,
|
|
278
285
|
compressed: _propTypes.default.bool.isRequired,
|
|
279
286
|
focusedOptionId: _propTypes.default.string,
|
|
280
287
|
fullWidth: _propTypes.default.bool,
|
|
@@ -3,12 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
Object.defineProperty(exports, "CanvasTextUtils", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _utils.CanvasTextUtils;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
6
|
Object.defineProperty(exports, "EuiTextTruncate", {
|
|
13
7
|
enumerable: true,
|
|
14
8
|
get: function get() {
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.TruncationUtils =
|
|
6
|
+
exports.TruncationUtils = void 0;
|
|
7
|
+
var _canvas = require("../../services/canvas");
|
|
7
8
|
var _excluded = ["fullText", "ellipsis", "availableWidth"];
|
|
8
9
|
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); }
|
|
9
10
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
@@ -14,6 +15,9 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
|
|
|
14
15
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
15
16
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
16
17
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
18
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
19
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
20
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
17
21
|
function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
|
|
18
22
|
function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
|
|
19
23
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
@@ -23,93 +27,38 @@ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) ===
|
|
|
23
27
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
24
28
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
25
29
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
26
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
27
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
28
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
29
30
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
30
31
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
31
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
*/
|
|
39
|
-
/**
|
|
40
|
-
* Under the hood, a temporary Canvas element is created for manipulating text
|
|
41
|
-
* & determining text width.
|
|
42
|
-
*
|
|
43
|
-
* To accurately measure text, canvas rendering requires either a container to
|
|
44
|
-
* compute/derive font styles from, or a static font string (useful for usage
|
|
45
|
-
* outside the DOM). Particular care should be applied when fallback fonts are
|
|
46
|
-
* used, as more fallback fonts can lead to less precision.
|
|
47
|
-
*
|
|
48
|
-
* Please note that while canvas is more significantly more performant than DOM
|
|
49
|
-
* measurement, there are subpixel to single digit pixel differences between
|
|
50
|
-
* DOM and canvas measurement due to the different rendering engines used.
|
|
51
|
-
*/
|
|
52
|
-
var CanvasTextUtils = /*#__PURE__*/function () {
|
|
53
|
-
function CanvasTextUtils(_ref) {
|
|
54
|
-
var _this = this;
|
|
55
|
-
var font = _ref.font,
|
|
56
|
-
container = _ref.container;
|
|
57
|
-
_classCallCheck(this, CanvasTextUtils);
|
|
58
|
-
_defineProperty(this, "context", void 0);
|
|
59
|
-
_defineProperty(this, "currentText", '');
|
|
60
|
-
_defineProperty(this, "computeFontFromElement", function (element) {
|
|
61
|
-
var computedStyles = window.getComputedStyle(element);
|
|
62
|
-
// TODO: font-stretch is not included even though it potentially should be
|
|
63
|
-
// @see https://developer.mozilla.org/en-US/docs/Web/CSS/font#constituent_properties
|
|
64
|
-
// It appears to be unsupported and/or breaks font computation in canvas
|
|
65
|
-
return ['font-style', 'font-variant', 'font-weight', 'font-size', 'font-family'].map(function (prop) {
|
|
66
|
-
return computedStyles.getPropertyValue(prop);
|
|
67
|
-
}).join(' ').trim();
|
|
68
|
-
});
|
|
69
|
-
_defineProperty(this, "setTextToCheck", function (text) {
|
|
70
|
-
_this.currentText = text;
|
|
71
|
-
});
|
|
72
|
-
this.context = document.createElement('canvas').getContext('2d');
|
|
73
|
-
|
|
74
|
-
// Set the canvas font to ensure text width calculations are correct
|
|
75
|
-
if (font) {
|
|
76
|
-
this.context.font = font;
|
|
77
|
-
} else if (container) {
|
|
78
|
-
this.context.font = this.computeFontFromElement(container);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
_createClass(CanvasTextUtils, [{
|
|
82
|
-
key: "textWidth",
|
|
83
|
-
get: function get() {
|
|
84
|
-
return this.context.measureText(this.currentText).width;
|
|
85
|
-
}
|
|
86
|
-
}]);
|
|
87
|
-
return CanvasTextUtils;
|
|
88
|
-
}();
|
|
32
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } /*
|
|
33
|
+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
34
|
+
* or more contributor license agreements. Licensed under the Elastic License
|
|
35
|
+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
36
|
+
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
37
|
+
* Side Public License, v 1.
|
|
38
|
+
*/
|
|
89
39
|
/**
|
|
90
40
|
* Utilities for truncating types at various positions, as well as
|
|
91
41
|
* determining whether truncation is possible or even necessary.
|
|
92
42
|
*/
|
|
93
|
-
exports.CanvasTextUtils = CanvasTextUtils;
|
|
94
43
|
var TruncationUtils = /*#__PURE__*/function (_CanvasTextUtils) {
|
|
95
44
|
_inherits(TruncationUtils, _CanvasTextUtils);
|
|
96
45
|
var _super = _createSuper(TruncationUtils);
|
|
97
|
-
function TruncationUtils(
|
|
98
|
-
var
|
|
99
|
-
var fullText =
|
|
100
|
-
ellipsis =
|
|
101
|
-
_availableWidth =
|
|
102
|
-
rest = _objectWithoutProperties(
|
|
46
|
+
function TruncationUtils(_ref) {
|
|
47
|
+
var _this;
|
|
48
|
+
var fullText = _ref.fullText,
|
|
49
|
+
ellipsis = _ref.ellipsis,
|
|
50
|
+
_availableWidth = _ref.availableWidth,
|
|
51
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
103
52
|
_classCallCheck(this, TruncationUtils);
|
|
104
|
-
|
|
105
|
-
_defineProperty(_assertThisInitialized(
|
|
106
|
-
_defineProperty(_assertThisInitialized(
|
|
107
|
-
_defineProperty(_assertThisInitialized(
|
|
53
|
+
_this = _super.call(this, rest);
|
|
54
|
+
_defineProperty(_assertThisInitialized(_this), "fullText", void 0);
|
|
55
|
+
_defineProperty(_assertThisInitialized(_this), "ellipsis", void 0);
|
|
56
|
+
_defineProperty(_assertThisInitialized(_this), "availableWidth", void 0);
|
|
108
57
|
/**
|
|
109
58
|
* Performance utilities
|
|
110
59
|
*/
|
|
111
|
-
_defineProperty(_assertThisInitialized(
|
|
112
|
-
_defineProperty(_assertThisInitialized(
|
|
60
|
+
_defineProperty(_assertThisInitialized(_this), "debugPerformance", false);
|
|
61
|
+
_defineProperty(_assertThisInitialized(_this), "debugCounter", 0);
|
|
113
62
|
/**
|
|
114
63
|
* Internal utils for calculating a ratio based on the passed available width
|
|
115
64
|
* vs the full text width.
|
|
@@ -117,21 +66,21 @@ var TruncationUtils = /*#__PURE__*/function (_CanvasTextUtils) {
|
|
|
117
66
|
* be slightly over the available width, which we can then remove from
|
|
118
67
|
* character-by-character until the text just fits within the available width.
|
|
119
68
|
*/
|
|
120
|
-
_defineProperty(_assertThisInitialized(
|
|
121
|
-
_defineProperty(_assertThisInitialized(
|
|
122
|
-
var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] :
|
|
69
|
+
_defineProperty(_assertThisInitialized(_this), "widthRatio", 0);
|
|
70
|
+
_defineProperty(_assertThisInitialized(_this), "setTextWidthRatio", function () {
|
|
71
|
+
var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _this.fullText;
|
|
123
72
|
var textToOffset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
124
73
|
// Account for reduced available width due to (e.g.) truncation offset
|
|
125
|
-
var availableWidth =
|
|
74
|
+
var availableWidth = _this.availableWidth;
|
|
126
75
|
if (textToOffset) {
|
|
127
|
-
|
|
128
|
-
availableWidth = availableWidth -
|
|
76
|
+
_this.setTextToCheck(textToOffset);
|
|
77
|
+
availableWidth = availableWidth - _this.textWidth;
|
|
129
78
|
}
|
|
130
|
-
|
|
131
|
-
|
|
79
|
+
_this.setTextToCheck(text);
|
|
80
|
+
_this.widthRatio = availableWidth / _this.textWidth;
|
|
132
81
|
});
|
|
133
|
-
_defineProperty(_assertThisInitialized(
|
|
134
|
-
var characterRatio = Math.ceil(text.length *
|
|
82
|
+
_defineProperty(_assertThisInitialized(_this), "getTextFromRatio", function (text, type) {
|
|
83
|
+
var characterRatio = Math.ceil(text.length * _this.widthRatio);
|
|
135
84
|
var index = type === 'start' ? text.length - characterRatio : characterRatio;
|
|
136
85
|
var _splitText$at = splitText(text).at(index),
|
|
137
86
|
_splitText$at2 = _slicedToArray(_splitText$at, 2),
|
|
@@ -142,24 +91,24 @@ var TruncationUtils = /*#__PURE__*/function (_CanvasTextUtils) {
|
|
|
142
91
|
/**
|
|
143
92
|
* Early return checks
|
|
144
93
|
*/
|
|
145
|
-
_defineProperty(_assertThisInitialized(
|
|
146
|
-
|
|
147
|
-
if (
|
|
94
|
+
_defineProperty(_assertThisInitialized(_this), "checkIfTruncationIsNeeded", function () {
|
|
95
|
+
_this.setTextToCheck(_this.fullText);
|
|
96
|
+
if (_this.availableWidth >= _this.textWidth) {
|
|
148
97
|
return false;
|
|
149
98
|
}
|
|
150
99
|
});
|
|
151
|
-
_defineProperty(_assertThisInitialized(
|
|
152
|
-
var textToCheck = truncation === 'startEnd' ? "".concat(
|
|
153
|
-
:
|
|
154
|
-
|
|
155
|
-
if (
|
|
100
|
+
_defineProperty(_assertThisInitialized(_this), "checkSufficientEllipsisWidth", function (truncation) {
|
|
101
|
+
var textToCheck = truncation === 'startEnd' ? "".concat(_this.ellipsis, " ").concat(_this.ellipsis) // startEnd needs a little more space
|
|
102
|
+
: _this.ellipsis;
|
|
103
|
+
_this.setTextToCheck(textToCheck);
|
|
104
|
+
if (_this.textWidth >= _this.availableWidth * 0.9) {
|
|
156
105
|
console.error('The truncation ellipsis is larger than the available width. No text can be rendered.');
|
|
157
106
|
return false;
|
|
158
107
|
}
|
|
159
108
|
});
|
|
160
|
-
_defineProperty(_assertThisInitialized(
|
|
161
|
-
|
|
162
|
-
if (
|
|
109
|
+
_defineProperty(_assertThisInitialized(_this), "checkTruncationOffsetWidth", function (text) {
|
|
110
|
+
_this.setTextToCheck(text);
|
|
111
|
+
if (_this.textWidth > _this.availableWidth) {
|
|
163
112
|
console.error('The passed truncationOffset is too large for the available width. Truncating the offset instead.');
|
|
164
113
|
return false;
|
|
165
114
|
}
|
|
@@ -167,19 +116,19 @@ var TruncationUtils = /*#__PURE__*/function (_CanvasTextUtils) {
|
|
|
167
116
|
/**
|
|
168
117
|
* Truncation types logic. This is where the magic happens
|
|
169
118
|
*/
|
|
170
|
-
_defineProperty(_assertThisInitialized(
|
|
171
|
-
var truncatedText =
|
|
119
|
+
_defineProperty(_assertThisInitialized(_this), "truncateStart", function (truncationOffset) {
|
|
120
|
+
var truncatedText = _this.fullText;
|
|
172
121
|
var leadingText = '';
|
|
173
122
|
var combinedText = function combinedText() {
|
|
174
123
|
return leadingText + truncatedText;
|
|
175
124
|
};
|
|
176
125
|
if (truncationOffset) {
|
|
177
|
-
var _splitText$at3 = splitText(
|
|
126
|
+
var _splitText$at3 = splitText(_this.fullText).at(truncationOffset);
|
|
178
127
|
var _splitText$at4 = _slicedToArray(_splitText$at3, 2);
|
|
179
128
|
leadingText = _splitText$at4[0];
|
|
180
129
|
truncatedText = _splitText$at4[1];
|
|
181
|
-
var widthCheck = leadingText +
|
|
182
|
-
if (
|
|
130
|
+
var widthCheck = leadingText + _this.ellipsis;
|
|
131
|
+
if (_this.checkTruncationOffsetWidth(widthCheck) === false) {
|
|
183
132
|
truncatedText = leadingText;
|
|
184
133
|
leadingText = '';
|
|
185
134
|
}
|
|
@@ -187,30 +136,30 @@ var TruncationUtils = /*#__PURE__*/function (_CanvasTextUtils) {
|
|
|
187
136
|
|
|
188
137
|
// Get text width ratio width accounting for any truncation offset text,
|
|
189
138
|
// and guesstimate an initial truncated string
|
|
190
|
-
|
|
191
|
-
truncatedText =
|
|
192
|
-
leadingText +=
|
|
193
|
-
|
|
194
|
-
while (
|
|
139
|
+
_this.setTextWidthRatio(truncatedText, leadingText);
|
|
140
|
+
truncatedText = _this.getTextFromRatio(truncatedText, 'start');
|
|
141
|
+
leadingText += _this.ellipsis;
|
|
142
|
+
_this.setTextToCheck(combinedText());
|
|
143
|
+
while (_this.textWidth > _this.availableWidth) {
|
|
195
144
|
truncatedText = removeFirstCharacter(truncatedText);
|
|
196
|
-
|
|
145
|
+
_this.setTextToCheck(combinedText());
|
|
197
146
|
}
|
|
198
147
|
return combinedText();
|
|
199
148
|
});
|
|
200
|
-
_defineProperty(_assertThisInitialized(
|
|
201
|
-
var truncatedText =
|
|
149
|
+
_defineProperty(_assertThisInitialized(_this), "truncateEnd", function (truncationOffset) {
|
|
150
|
+
var truncatedText = _this.fullText;
|
|
202
151
|
var trailingText = '';
|
|
203
152
|
var combinedText = function combinedText() {
|
|
204
153
|
return truncatedText + trailingText;
|
|
205
154
|
};
|
|
206
155
|
if (truncationOffset) {
|
|
207
|
-
var index =
|
|
208
|
-
var _splitText$at5 = splitText(
|
|
156
|
+
var index = _this.fullText.length - truncationOffset;
|
|
157
|
+
var _splitText$at5 = splitText(_this.fullText).at(index);
|
|
209
158
|
var _splitText$at6 = _slicedToArray(_splitText$at5, 2);
|
|
210
159
|
truncatedText = _splitText$at6[0];
|
|
211
160
|
trailingText = _splitText$at6[1];
|
|
212
|
-
var widthCheck =
|
|
213
|
-
if (
|
|
161
|
+
var widthCheck = _this.ellipsis + trailingText;
|
|
162
|
+
if (_this.checkTruncationOffsetWidth(widthCheck) === false) {
|
|
214
163
|
truncatedText = trailingText;
|
|
215
164
|
trailingText = '';
|
|
216
165
|
}
|
|
@@ -218,78 +167,78 @@ var TruncationUtils = /*#__PURE__*/function (_CanvasTextUtils) {
|
|
|
218
167
|
|
|
219
168
|
// Get text width ratio width accounting for any truncation offset text,
|
|
220
169
|
// and guesstimate an initial truncated string
|
|
221
|
-
|
|
222
|
-
truncatedText =
|
|
223
|
-
trailingText =
|
|
224
|
-
|
|
225
|
-
while (
|
|
170
|
+
_this.setTextWidthRatio(truncatedText, trailingText);
|
|
171
|
+
truncatedText = _this.getTextFromRatio(truncatedText, 'end');
|
|
172
|
+
trailingText = _this.ellipsis + trailingText;
|
|
173
|
+
_this.setTextToCheck(combinedText());
|
|
174
|
+
while (_this.textWidth > _this.availableWidth) {
|
|
226
175
|
truncatedText = removeLastCharacter(truncatedText);
|
|
227
|
-
|
|
176
|
+
_this.setTextToCheck(combinedText());
|
|
228
177
|
}
|
|
229
178
|
return combinedText();
|
|
230
179
|
});
|
|
231
|
-
_defineProperty(_assertThisInitialized(
|
|
180
|
+
_defineProperty(_assertThisInitialized(_this), "truncateStartEndAtPosition", function (truncationPosition) {
|
|
232
181
|
// Split the text from the anchor position, using the width ratio
|
|
233
182
|
// to get the starting and ending indices from the position
|
|
234
|
-
|
|
235
|
-
var characterRatio = Math.floor(
|
|
183
|
+
_this.setTextWidthRatio();
|
|
184
|
+
var characterRatio = Math.floor(_this.fullText.length * _this.widthRatio / 2);
|
|
236
185
|
var truncateStart = truncationPosition - characterRatio;
|
|
237
186
|
var truncateEnd = truncationPosition + characterRatio;
|
|
238
187
|
|
|
239
188
|
// If either of the approximate start/end truncation indices go beyond the
|
|
240
189
|
// bounds of the actual text, we can simply use end or start truncation instead
|
|
241
190
|
if (truncateStart < 0) {
|
|
242
|
-
return
|
|
191
|
+
return _this.truncateEnd();
|
|
243
192
|
}
|
|
244
|
-
if (truncateEnd >=
|
|
245
|
-
return
|
|
193
|
+
if (truncateEnd >= _this.fullText.length) {
|
|
194
|
+
return _this.truncateStart();
|
|
246
195
|
}
|
|
247
|
-
var truncatedText =
|
|
196
|
+
var truncatedText = _this.fullText.substring(truncateStart, truncateEnd);
|
|
248
197
|
var combinedText = function combinedText() {
|
|
249
|
-
return
|
|
198
|
+
return _this.ellipsis + truncatedText + _this.ellipsis;
|
|
250
199
|
};
|
|
251
|
-
|
|
200
|
+
_this.setTextToCheck(combinedText());
|
|
252
201
|
var alternating;
|
|
253
|
-
while (
|
|
202
|
+
while (_this.textWidth > _this.availableWidth) {
|
|
254
203
|
truncatedText = alternating ? removeLastCharacter(truncatedText) : removeFirstCharacter(truncatedText);
|
|
255
204
|
alternating = !alternating;
|
|
256
|
-
|
|
205
|
+
_this.setTextToCheck(combinedText());
|
|
257
206
|
}
|
|
258
207
|
return combinedText();
|
|
259
208
|
});
|
|
260
|
-
_defineProperty(_assertThisInitialized(
|
|
261
|
-
var middlePosition = Math.floor(
|
|
262
|
-
return
|
|
209
|
+
_defineProperty(_assertThisInitialized(_this), "truncateStartEndAtMiddle", function () {
|
|
210
|
+
var middlePosition = Math.floor(_this.fullText.length / 2);
|
|
211
|
+
return _this.truncateStartEndAtPosition(middlePosition);
|
|
263
212
|
});
|
|
264
|
-
_defineProperty(_assertThisInitialized(
|
|
265
|
-
var middlePosition = Math.floor(
|
|
266
|
-
var _splitText$at7 = splitText(
|
|
213
|
+
_defineProperty(_assertThisInitialized(_this), "truncateMiddle", function () {
|
|
214
|
+
var middlePosition = Math.floor(_this.fullText.length / 2);
|
|
215
|
+
var _splitText$at7 = splitText(_this.fullText).at(middlePosition),
|
|
267
216
|
_splitText$at8 = _slicedToArray(_splitText$at7, 2),
|
|
268
217
|
firstHalf = _splitText$at8[0],
|
|
269
218
|
secondHalf = _splitText$at8[1];
|
|
270
|
-
|
|
271
|
-
firstHalf =
|
|
272
|
-
secondHalf =
|
|
219
|
+
_this.setTextWidthRatio();
|
|
220
|
+
firstHalf = _this.getTextFromRatio(firstHalf, 'end');
|
|
221
|
+
secondHalf = _this.getTextFromRatio(secondHalf, 'start');
|
|
273
222
|
var combinedText = function combinedText() {
|
|
274
|
-
return firstHalf +
|
|
223
|
+
return firstHalf + _this.ellipsis + secondHalf;
|
|
275
224
|
};
|
|
276
|
-
|
|
225
|
+
_this.setTextToCheck(combinedText());
|
|
277
226
|
var alternating;
|
|
278
|
-
while (
|
|
227
|
+
while (_this.textWidth > _this.availableWidth) {
|
|
279
228
|
alternating = !alternating;
|
|
280
229
|
if (alternating) {
|
|
281
230
|
firstHalf = removeLastCharacter(firstHalf);
|
|
282
231
|
} else {
|
|
283
232
|
secondHalf = removeFirstCharacter(secondHalf);
|
|
284
233
|
}
|
|
285
|
-
|
|
234
|
+
_this.setTextToCheck(combinedText());
|
|
286
235
|
}
|
|
287
236
|
return combinedText();
|
|
288
237
|
});
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
return
|
|
238
|
+
_this.fullText = fullText;
|
|
239
|
+
_this.ellipsis = ellipsis;
|
|
240
|
+
_this.availableWidth = _availableWidth;
|
|
241
|
+
return _this;
|
|
293
242
|
}
|
|
294
243
|
_createClass(TruncationUtils, [{
|
|
295
244
|
key: "textWidth",
|
|
@@ -301,7 +250,7 @@ var TruncationUtils = /*#__PURE__*/function (_CanvasTextUtils) {
|
|
|
301
250
|
}
|
|
302
251
|
}]);
|
|
303
252
|
return TruncationUtils;
|
|
304
|
-
}(CanvasTextUtils);
|
|
253
|
+
}(_canvas.CanvasTextUtils);
|
|
305
254
|
/**
|
|
306
255
|
* DRY character/substring utils
|
|
307
256
|
*/
|