@rhc-shared-components/packages-table 1.0.4 → 2.0.1
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/components/ExcludedPackagesTable.d.ts +6 -6
- package/dist/components/FilterInput.d.ts +6 -6
- package/dist/components/FilterableTable.d.ts +19 -19
- package/dist/components/Select.d.ts +9 -9
- package/dist/components/ToggleGroup.d.ts +10 -10
- package/dist/components/VulnerabilitiesTable.d.ts +7 -7
- package/dist/index.d.ts +14 -14
- package/dist/index.js +2995 -1018
- package/dist/index.modern.js +2781 -753
- package/dist/index.test.d.ts +1 -1
- package/package.json +9 -12
- package/CHANGELOG.md +0 -79
package/dist/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
1
2
|
var React = require('react');
|
|
2
3
|
var reactCore = require('@patternfly/react-core');
|
|
3
|
-
var
|
|
4
|
+
var KeyboardHandler = require('@patternfly/react-core/dist/esm/helpers/KeyboardHandler');
|
|
5
|
+
var ouia = require('@patternfly/react-core/dist/esm/helpers/OUIA/ouia');
|
|
4
6
|
var helpers = require('@patternfly/react-core/dist/esm/helpers');
|
|
5
|
-
var mergeWith = require('lodash/mergeWith');
|
|
6
7
|
var Tooltip = require('@patternfly/react-core/dist/esm/components/Tooltip');
|
|
7
8
|
var Button = require('@patternfly/react-core/dist/esm/components/Button');
|
|
8
9
|
var Popover = require('@patternfly/react-core/dist/esm/components/Popover');
|
|
@@ -14,8 +15,6 @@ var Checkbox = require('@patternfly/react-core/dist/esm/components/Checkbox');
|
|
|
14
15
|
var deprecated = require('@patternfly/react-core/deprecated');
|
|
15
16
|
var dateFns = require('date-fns');
|
|
16
17
|
|
|
17
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
18
|
-
|
|
19
18
|
function _interopNamespace(e) {
|
|
20
19
|
if (e && e.__esModule) return e;
|
|
21
20
|
var n = Object.create(null);
|
|
@@ -35,11 +34,27 @@ function _interopNamespace(e) {
|
|
|
35
34
|
}
|
|
36
35
|
|
|
37
36
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
38
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
39
|
-
var mergeWith__default = /*#__PURE__*/_interopDefaultLegacy(mergeWith);
|
|
40
37
|
|
|
41
38
|
var css_248z = ".vulnerabilities-table .impact-icon {\n font-size: 1.5rem;\n padding-right: 0.5rem;\n}\n.vulnerabilities-table .impact-icon.color-critical {\n color: #a30000;\n}\n.vulnerabilities-table .impact-icon.color-important {\n color: #ec7a08;\n}\n.vulnerabilities-table .impact-icon.color-moderate {\n color: #f5c12e;\n}\n.vulnerabilities-table .impact-icon.color-low {\n color: #777;\n}\n.vulnerabilities-table__affected-packages-cell {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n}\n.vulnerabilities-table__impact-cell {\n display: flex;\n align-items: center;\n flex-wrap: nowrap;\n}\n\n.filterable-table {\n padding-bottom: var(--pf-v5-global--spacer--lg);\n}\n.filterable-table__bottom-pagination[class] {\n margin-top: 1rem;\n}\n.filterable-table .pf-v5-c-toolbar__content {\n --pf-v5-c-toolbar__content--PaddingRight: 0;\n --pf-v5-c-toolbar__content--PaddingLeft: 0;\n}\n.filterable-table .pf-v5-c-input-group__text {\n --pf-v5-c-input-group__text--PaddingRight: 0;\n}\n.filterable-table .pf-v5-c-pagination.pf-m-bottom {\n --pf-v5-c-pagination--m-bottom--md--PaddingRight: 0;\n}\n\n.packages-table .pf-v5-c-tabs__item > button {\n padding: 1rem 1.5rem;\n}\n.packages-table__excluded-packages-disclaimer {\n margin: 1rem 0 0 0.5rem;\n}\n\n.filter-input {\n width: 18rem;\n}";
|
|
42
39
|
|
|
40
|
+
function _extends() {
|
|
41
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
42
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
43
|
+
var t = arguments[e];
|
|
44
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
45
|
+
}
|
|
46
|
+
return n;
|
|
47
|
+
}, _extends.apply(null, arguments);
|
|
48
|
+
}
|
|
49
|
+
function _inheritsLoose(t, o) {
|
|
50
|
+
t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
|
|
51
|
+
}
|
|
52
|
+
function _setPrototypeOf(t, e) {
|
|
53
|
+
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
54
|
+
return t.__proto__ = e, t;
|
|
55
|
+
}, _setPrototypeOf(t, e);
|
|
56
|
+
}
|
|
57
|
+
|
|
43
58
|
/******************************************************************************
|
|
44
59
|
Copyright (c) Microsoft Corporation.
|
|
45
60
|
|
|
@@ -54,103 +69,47 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
54
69
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
55
70
|
PERFORMANCE OF THIS SOFTWARE.
|
|
56
71
|
***************************************************************************** */
|
|
57
|
-
function __rest
|
|
72
|
+
function __rest(s, e) {
|
|
58
73
|
var t = {};
|
|
59
|
-
|
|
60
|
-
for (var p in s) {
|
|
61
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
62
|
-
}
|
|
63
|
-
|
|
74
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
64
75
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
65
76
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
66
77
|
}
|
|
67
78
|
return t;
|
|
68
79
|
}
|
|
69
|
-
|
|
70
80
|
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
71
81
|
var e = new Error(message);
|
|
72
82
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
73
83
|
};
|
|
74
84
|
|
|
75
|
-
function _inheritsLoose(subClass, superClass) {
|
|
76
|
-
subClass.prototype = Object.create(superClass.prototype);
|
|
77
|
-
subClass.prototype.constructor = subClass;
|
|
78
|
-
|
|
79
|
-
_setPrototypeOf(subClass, superClass);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
function _setPrototypeOf(o, p) {
|
|
83
|
-
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
|
84
|
-
o.__proto__ = p;
|
|
85
|
-
return o;
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
return _setPrototypeOf(o, p);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/*! *****************************************************************************
|
|
92
|
-
Copyright (c) Microsoft Corporation.
|
|
93
|
-
|
|
94
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
95
|
-
purpose with or without fee is hereby granted.
|
|
96
|
-
|
|
97
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
98
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
99
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
100
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
101
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
102
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
103
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
104
|
-
***************************************************************************** */
|
|
105
|
-
function __rest(s, e) {
|
|
106
|
-
var t = {};
|
|
107
|
-
|
|
108
|
-
for (var p in s) {
|
|
109
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
113
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
114
|
-
}
|
|
115
|
-
return t;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
85
|
var currentId = 0;
|
|
119
86
|
/**
|
|
120
87
|
* Factory to create Icon class components for consumers
|
|
121
88
|
*/
|
|
122
|
-
|
|
123
89
|
function createIcon(_ref) {
|
|
124
90
|
var name = _ref.name,
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
91
|
+
_ref$xOffset = _ref.xOffset,
|
|
92
|
+
xOffset = _ref$xOffset === void 0 ? 0 : _ref$xOffset,
|
|
93
|
+
_ref$yOffset = _ref.yOffset,
|
|
94
|
+
yOffset = _ref$yOffset === void 0 ? 0 : _ref$yOffset,
|
|
95
|
+
width = _ref.width,
|
|
96
|
+
height = _ref.height,
|
|
97
|
+
svgPath = _ref.svgPath;
|
|
133
98
|
var _a;
|
|
134
|
-
|
|
135
99
|
return _a = /*#__PURE__*/function (_React$Component) {
|
|
136
|
-
_inheritsLoose(SVGIcon, _React$Component);
|
|
137
|
-
|
|
138
100
|
function SVGIcon() {
|
|
139
101
|
var _this;
|
|
140
|
-
|
|
141
102
|
_this = _React$Component.apply(this, arguments) || this;
|
|
142
103
|
_this.id = "icon-title-" + currentId++;
|
|
143
104
|
return _this;
|
|
144
105
|
}
|
|
145
|
-
|
|
106
|
+
_inheritsLoose(SVGIcon, _React$Component);
|
|
146
107
|
var _proto = SVGIcon.prototype;
|
|
147
|
-
|
|
148
108
|
_proto.render = function render() {
|
|
149
|
-
var
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
109
|
+
var _b = this.props,
|
|
110
|
+
title = _b.title,
|
|
111
|
+
className = _b.className,
|
|
112
|
+
props = __rest(_b, ["title", "className"]);
|
|
154
113
|
var classes = className ? "pf-v5-svg " + className : 'pf-v5-svg';
|
|
155
114
|
var hasTitle = Boolean(title);
|
|
156
115
|
var viewBox = [xOffset, yOffset, width, height].join(' ');
|
|
@@ -169,7 +128,6 @@ function createIcon(_ref) {
|
|
|
169
128
|
d: svgPath
|
|
170
129
|
}));
|
|
171
130
|
};
|
|
172
|
-
|
|
173
131
|
return SVGIcon;
|
|
174
132
|
}(React__namespace.Component), _a.displayName = name, _a;
|
|
175
133
|
}
|
|
@@ -187,47 +145,43 @@ var EllipsisVIcon$1 = EllipsisVIcon;
|
|
|
187
145
|
|
|
188
146
|
var ActionsColumnBase = function ActionsColumnBase(_a) {
|
|
189
147
|
var items = _a.items,
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
148
|
+
isDisabled = _a.isDisabled,
|
|
149
|
+
rowData = _a.rowData,
|
|
150
|
+
extraData = _a.extraData,
|
|
151
|
+
actionsToggle = _a.actionsToggle,
|
|
152
|
+
_a$popperProps = _a.popperProps,
|
|
153
|
+
popperProps = _a$popperProps === void 0 ? {
|
|
154
|
+
position: 'end',
|
|
155
|
+
direction: 'down'
|
|
156
|
+
} : _a$popperProps,
|
|
157
|
+
innerRef = _a.innerRef,
|
|
158
|
+
firstActionItemRef = _a.firstActionItemRef,
|
|
159
|
+
_a$isOnOpenChangeDisa = _a.isOnOpenChangeDisabled,
|
|
160
|
+
isOnOpenChangeDisabled = _a$isOnOpenChangeDisa === void 0 ? false : _a$isOnOpenChangeDisa,
|
|
161
|
+
props = __rest(_a, ["items", "isDisabled", "rowData", "extraData", "actionsToggle", "popperProps", "innerRef", "firstActionItemRef", "isOnOpenChangeDisabled"]);
|
|
205
162
|
var _React$useState = React__namespace.useState(false),
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
163
|
+
isOpen = _React$useState[0],
|
|
164
|
+
setIsOpen = _React$useState[1];
|
|
209
165
|
var onToggle = function onToggle() {
|
|
210
166
|
setIsOpen(!isOpen);
|
|
211
167
|
};
|
|
212
|
-
|
|
213
168
|
var onActionClick = function onActionClick(event, onClick) {
|
|
214
169
|
// Only prevent default if onClick is provided. This allows href support.
|
|
215
170
|
if (onClick) {
|
|
216
|
-
event.preventDefault();
|
|
217
|
-
|
|
171
|
+
event.preventDefault();
|
|
172
|
+
// tslint:disable-next-line:no-unused-expression
|
|
218
173
|
onClick(event, extraData && extraData.rowIndex, rowData, extraData);
|
|
219
174
|
}
|
|
220
175
|
};
|
|
221
|
-
|
|
222
176
|
return React__namespace.createElement(React__namespace.Fragment, null, items.filter(function (item) {
|
|
223
177
|
return item.isOutsideDropdown;
|
|
224
|
-
})
|
|
178
|
+
})
|
|
179
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
225
180
|
.map(function (_a, key) {
|
|
226
181
|
var title = _a.title,
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
182
|
+
itemKey = _a.itemKey,
|
|
183
|
+
_onClick = _a.onClick,
|
|
184
|
+
props = __rest(_a, ["title", "itemKey", "onClick", "isOutsideDropdown"]);
|
|
231
185
|
return typeof title === 'string' ? React__namespace.createElement(Button.Button, Object.assign({
|
|
232
186
|
onClick: function onClick(event) {
|
|
233
187
|
return onActionClick(event, _onClick);
|
|
@@ -268,21 +222,19 @@ var ActionsColumnBase = function ActionsColumnBase(_a) {
|
|
|
268
222
|
return !item.isOutsideDropdown;
|
|
269
223
|
}).map(function (_a, index) {
|
|
270
224
|
var title = _a.title,
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
225
|
+
itemKey = _a.itemKey,
|
|
226
|
+
_onClick2 = _a.onClick,
|
|
227
|
+
tooltipProps = _a.tooltipProps,
|
|
228
|
+
isSeparator = _a.isSeparator,
|
|
229
|
+
_a$shouldCloseOnClick = _a.shouldCloseOnClick,
|
|
230
|
+
shouldCloseOnClick = _a$shouldCloseOnClick === void 0 ? true : _a$shouldCloseOnClick,
|
|
231
|
+
props = __rest(_a, ["title", "itemKey", "onClick", "tooltipProps", "isSeparator", "shouldCloseOnClick"]);
|
|
279
232
|
if (isSeparator) {
|
|
280
233
|
return React__namespace.createElement(Divider.Divider, {
|
|
281
234
|
key: itemKey || index,
|
|
282
235
|
"data-key": itemKey || index
|
|
283
236
|
});
|
|
284
237
|
}
|
|
285
|
-
|
|
286
238
|
var item = React__namespace.createElement(Dropdown.DropdownItem, Object.assign({
|
|
287
239
|
onClick: function onClick(event) {
|
|
288
240
|
onActionClick(event, _onClick2);
|
|
@@ -293,7 +245,6 @@ var ActionsColumnBase = function ActionsColumnBase(_a) {
|
|
|
293
245
|
"data-key": itemKey || index,
|
|
294
246
|
ref: index === 0 ? firstActionItemRef : undefined
|
|
295
247
|
}), title);
|
|
296
|
-
|
|
297
248
|
if (tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.content) {
|
|
298
249
|
return React__namespace.createElement(Tooltip.Tooltip, Object.assign({
|
|
299
250
|
key: itemKey || index
|
|
@@ -303,7 +254,6 @@ var ActionsColumnBase = function ActionsColumnBase(_a) {
|
|
|
303
254
|
}
|
|
304
255
|
}))));
|
|
305
256
|
};
|
|
306
|
-
|
|
307
257
|
var ActionsColumn = React__namespace.forwardRef(function (props, ref) {
|
|
308
258
|
return React__namespace.createElement(ActionsColumnBase, Object.assign({}, props, {
|
|
309
259
|
innerRef: ref
|
|
@@ -332,12 +282,10 @@ function css() {
|
|
|
332
282
|
var hasOwn = {}.hasOwnProperty;
|
|
333
283
|
[].slice.call(arguments).filter(Boolean).forEach(function (arg) {
|
|
334
284
|
var argType = typeof arg;
|
|
335
|
-
|
|
336
285
|
if (argType === 'string' || argType === 'number') {
|
|
337
286
|
classes.push(arg);
|
|
338
287
|
} else if (Array.isArray(arg) && arg.length) {
|
|
339
288
|
var inner = css.apply(void 0, arg);
|
|
340
|
-
|
|
341
289
|
if (inner) {
|
|
342
290
|
classes.push(inner);
|
|
343
291
|
}
|
|
@@ -445,13 +393,12 @@ var styles$1 = {
|
|
|
445
393
|
|
|
446
394
|
var CollapseColumn = function CollapseColumn(_a) {
|
|
447
395
|
var _a$className = _a.className,
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
396
|
+
className = _a$className === void 0 ? '' : _a$className,
|
|
397
|
+
_a$children = _a.children,
|
|
398
|
+
children = _a$children === void 0 ? null : _a$children,
|
|
399
|
+
isOpen = _a.isOpen,
|
|
400
|
+
onToggle = _a.onToggle,
|
|
401
|
+
props = __rest(_a, ["className", "children", "isOpen", "onToggle"]);
|
|
455
402
|
return React__namespace.createElement(React__namespace.Fragment, null, isOpen !== undefined && React__namespace.createElement(Button.Button, Object.assign({
|
|
456
403
|
className: css(className, isOpen && styles$1.modifiers.expanded)
|
|
457
404
|
}, props, {
|
|
@@ -478,11 +425,10 @@ var GripVerticalIcon$1 = GripVerticalIcon;
|
|
|
478
425
|
|
|
479
426
|
var DraggableCell = function DraggableCell(_a) {
|
|
480
427
|
var className = _a.className,
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
428
|
+
onClick = _a.onClick,
|
|
429
|
+
ariaLabel = _a['aria-label'],
|
|
430
|
+
id = _a.id,
|
|
431
|
+
props = __rest(_a, ["className", "onClick", 'aria-label', "id"]);
|
|
486
432
|
return React__namespace.createElement(Button.Button, Object.assign({
|
|
487
433
|
id: id,
|
|
488
434
|
variant: "plain",
|
|
@@ -531,14 +477,11 @@ var HelpIcon = createIcon(HelpIconConfig);
|
|
|
531
477
|
var HelpIcon$1 = HelpIcon;
|
|
532
478
|
|
|
533
479
|
var TableTextVariant;
|
|
534
|
-
|
|
535
480
|
(function (TableTextVariant) {
|
|
536
481
|
TableTextVariant["div"] = "div";
|
|
537
482
|
TableTextVariant["nav"] = "nav";
|
|
538
483
|
})(TableTextVariant || (TableTextVariant = {}));
|
|
539
|
-
|
|
540
484
|
var WrapModifier;
|
|
541
|
-
|
|
542
485
|
(function (WrapModifier) {
|
|
543
486
|
WrapModifier["wrap"] = "wrap";
|
|
544
487
|
WrapModifier["nowrap"] = "nowrap";
|
|
@@ -546,45 +489,39 @@ var WrapModifier;
|
|
|
546
489
|
WrapModifier["breakWord"] = "breakWord";
|
|
547
490
|
WrapModifier["fitContent"] = "fitContent";
|
|
548
491
|
})(WrapModifier || (WrapModifier = {}));
|
|
549
|
-
|
|
550
492
|
var TableText = function TableText(_a) {
|
|
551
493
|
var _a$children = _a.children,
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
494
|
+
children = _a$children === void 0 ? null : _a$children,
|
|
495
|
+
_a$className = _a.className,
|
|
496
|
+
className = _a$className === void 0 ? '' : _a$className,
|
|
497
|
+
_a$variant = _a.variant,
|
|
498
|
+
variant = _a$variant === void 0 ? 'span' : _a$variant,
|
|
499
|
+
_a$wrapModifier = _a.wrapModifier,
|
|
500
|
+
wrapModifier = _a$wrapModifier === void 0 ? null : _a$wrapModifier,
|
|
501
|
+
_a$tooltip = _a.tooltip,
|
|
502
|
+
tooltipProp = _a$tooltip === void 0 ? '' : _a$tooltip,
|
|
503
|
+
_a$tooltipProps = _a.tooltipProps,
|
|
504
|
+
tooltipProps = _a$tooltipProps === void 0 ? {} : _a$tooltipProps,
|
|
505
|
+
_a$onMouseEnter = _a.onMouseEnter,
|
|
506
|
+
onMouseEnterProp = _a$onMouseEnter === void 0 ? function () {} : _a$onMouseEnter,
|
|
507
|
+
_a$focused = _a.focused,
|
|
508
|
+
focused = _a$focused === void 0 ? false : _a$focused,
|
|
509
|
+
_a$tooltipHasDefaultB = _a.tooltipHasDefaultBehavior,
|
|
510
|
+
tooltipHasDefaultBehavior = _a$tooltipHasDefaultB === void 0 ? false : _a$tooltipHasDefaultB,
|
|
511
|
+
props = __rest(_a, ["children", "className", "variant", "wrapModifier", "tooltip", "tooltipProps", "onMouseEnter", "focused", "tooltipHasDefaultBehavior"]);
|
|
571
512
|
var Component = variant;
|
|
572
513
|
var textRef = React__namespace.createRef();
|
|
573
|
-
|
|
574
514
|
var _React$useState = React__namespace.useState(tooltipProp),
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
515
|
+
tooltip = _React$useState[0],
|
|
516
|
+
setTooltip = _React$useState[1];
|
|
578
517
|
var onMouseEnter = function onMouseEnter(event) {
|
|
579
518
|
if (event.target.offsetWidth < event.target.scrollWidth) {
|
|
580
519
|
setTooltip(tooltipProp || event.target.innerText);
|
|
581
520
|
} else {
|
|
582
521
|
setTooltip('');
|
|
583
522
|
}
|
|
584
|
-
|
|
585
523
|
onMouseEnterProp(event);
|
|
586
524
|
};
|
|
587
|
-
|
|
588
525
|
var onFocus = function onFocus(element) {
|
|
589
526
|
if (element.offsetWidth < element.scrollWidth) {
|
|
590
527
|
setTooltip(tooltipProp || element.innerText);
|
|
@@ -592,7 +529,6 @@ var TableText = function TableText(_a) {
|
|
|
592
529
|
setTooltip('');
|
|
593
530
|
}
|
|
594
531
|
};
|
|
595
|
-
|
|
596
532
|
var text = React__namespace.createElement(Component, Object.assign({
|
|
597
533
|
ref: textRef,
|
|
598
534
|
onMouseEnter: !tooltipHasDefaultBehavior ? onMouseEnter : undefined,
|
|
@@ -618,13 +554,13 @@ TableText.displayName = 'TableText';
|
|
|
618
554
|
|
|
619
555
|
var HeaderCellInfoWrapper = function HeaderCellInfoWrapper(_ref) {
|
|
620
556
|
var children = _ref.children,
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
557
|
+
info = _ref.info,
|
|
558
|
+
className = _ref.className,
|
|
559
|
+
_ref$variant = _ref.variant,
|
|
560
|
+
variant = _ref$variant === void 0 ? 'tooltip' : _ref$variant,
|
|
561
|
+
popoverProps = _ref.popoverProps,
|
|
562
|
+
tooltipProps = _ref.tooltipProps,
|
|
563
|
+
ariaLabel = _ref.ariaLabel;
|
|
628
564
|
return React__namespace.createElement("div", {
|
|
629
565
|
className: css(styles$1.tableColumnHelp, className)
|
|
630
566
|
}, typeof children === 'string' ? React__namespace.createElement(TableText, null, children) : children, React__namespace.createElement("span", {
|
|
@@ -712,22 +648,19 @@ var treeViewStyles = {
|
|
|
712
648
|
};
|
|
713
649
|
|
|
714
650
|
var RowSelectVariant;
|
|
715
|
-
|
|
716
651
|
(function (RowSelectVariant) {
|
|
717
652
|
RowSelectVariant["radio"] = "radio";
|
|
718
653
|
RowSelectVariant["checkbox"] = "checkbox";
|
|
719
654
|
})(RowSelectVariant || (RowSelectVariant = {}));
|
|
720
|
-
|
|
721
655
|
var SelectColumn = function SelectColumn(_a) {
|
|
722
656
|
var _a$children = _a.children,
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
657
|
+
children = _a$children === void 0 ? null : _a$children,
|
|
658
|
+
_a$onSelect = _a.onSelect,
|
|
659
|
+
onSelect = _a$onSelect === void 0 ? null : _a$onSelect,
|
|
660
|
+
selectVariant = _a.selectVariant,
|
|
661
|
+
tooltip = _a.tooltip,
|
|
662
|
+
tooltipProps = _a.tooltipProps,
|
|
663
|
+
props = __rest(_a, ["children", "className", "onSelect", "selectVariant", "tooltip", "tooltipProps"]);
|
|
731
664
|
var inputRef = React__namespace.createRef();
|
|
732
665
|
var content = React__namespace.createElement(React__namespace.Fragment, null, React__namespace.createElement("label", null, React__namespace.createElement("input", Object.assign({}, props, {
|
|
733
666
|
ref: inputRef,
|
|
@@ -756,41 +689,37 @@ var checkStyles = {
|
|
|
756
689
|
|
|
757
690
|
var selectable = function selectable(label, _ref) {
|
|
758
691
|
var rowIndex = _ref.rowIndex,
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
692
|
+
columnIndex = _ref.columnIndex,
|
|
693
|
+
rowData = _ref.rowData,
|
|
694
|
+
column = _ref.column,
|
|
695
|
+
property = _ref.property,
|
|
696
|
+
tooltip = _ref.tooltip;
|
|
764
697
|
var _column$extraParams = column.extraParams,
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
698
|
+
onSelect = _column$extraParams.onSelect,
|
|
699
|
+
selectVariant = _column$extraParams.selectVariant,
|
|
700
|
+
allRowsSelected = _column$extraParams.allRowsSelected,
|
|
701
|
+
isHeaderSelectDisabled = _column$extraParams.isHeaderSelectDisabled;
|
|
769
702
|
var extraData = {
|
|
770
703
|
rowIndex: rowIndex,
|
|
771
704
|
columnIndex: columnIndex,
|
|
772
705
|
column: column,
|
|
773
706
|
property: property
|
|
774
707
|
};
|
|
775
|
-
|
|
776
708
|
if (rowData && rowData.hasOwnProperty('parent') && !rowData.showSelect && !rowData.fullWidth) {
|
|
777
709
|
return {
|
|
778
710
|
component: 'td',
|
|
779
711
|
isVisible: true
|
|
780
712
|
};
|
|
781
713
|
}
|
|
782
|
-
|
|
783
714
|
var rowId = rowIndex !== undefined ? rowIndex : -1;
|
|
784
715
|
/**
|
|
785
716
|
* @param {React.FormEvent} event - React form event
|
|
786
717
|
*/
|
|
787
|
-
|
|
788
718
|
function selectClick(event) {
|
|
789
|
-
var selected = rowIndex === undefined ? event.currentTarget.checked : rowData && !rowData.selected;
|
|
790
|
-
|
|
719
|
+
var selected = rowIndex === undefined ? event.currentTarget.checked : rowData && !rowData.selected;
|
|
720
|
+
// tslint:disable-next-line:no-unused-expression
|
|
791
721
|
onSelect && onSelect(event, selected, rowId, rowData, extraData);
|
|
792
722
|
}
|
|
793
|
-
|
|
794
723
|
var customProps = Object.assign(Object.assign(Object.assign({}, rowId !== -1 ? {
|
|
795
724
|
checked: rowData && !!rowData.selected,
|
|
796
725
|
'aria-label': "Select row " + rowIndex
|
|
@@ -804,13 +733,11 @@ var selectable = function selectable(label, _ref) {
|
|
|
804
733
|
disabled: true
|
|
805
734
|
});
|
|
806
735
|
var selectName = 'check-all';
|
|
807
|
-
|
|
808
736
|
if (rowId !== -1 && selectVariant === RowSelectVariant.checkbox) {
|
|
809
737
|
selectName = "checkrow" + rowIndex;
|
|
810
738
|
} else if (rowId !== -1) {
|
|
811
739
|
selectName = 'radioGroup';
|
|
812
740
|
}
|
|
813
|
-
|
|
814
741
|
return {
|
|
815
742
|
className: css(styles$1.tableCheck),
|
|
816
743
|
component: rowId !== -1 ? 'td' : 'th',
|
|
@@ -858,42 +785,36 @@ var ArrowsAltVIcon = createIcon(ArrowsAltVIconConfig);
|
|
|
858
785
|
var ArrowsAltVIcon$1 = ArrowsAltVIcon;
|
|
859
786
|
|
|
860
787
|
var SortByDirection;
|
|
861
|
-
|
|
862
788
|
(function (SortByDirection) {
|
|
863
789
|
SortByDirection["asc"] = "asc";
|
|
864
790
|
SortByDirection["desc"] = "desc";
|
|
865
791
|
})(SortByDirection || (SortByDirection = {}));
|
|
866
|
-
|
|
867
792
|
var SortColumn = function SortColumn(_a) {
|
|
868
793
|
var _a$children = _a.children,
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
794
|
+
children = _a$children === void 0 ? null : _a$children,
|
|
795
|
+
_a$className = _a.className,
|
|
796
|
+
className = _a$className === void 0 ? '' : _a$className,
|
|
797
|
+
_a$isSortedBy = _a.isSortedBy,
|
|
798
|
+
isSortedBy = _a$isSortedBy === void 0 ? false : _a$isSortedBy,
|
|
799
|
+
_a$onSort = _a.onSort,
|
|
800
|
+
onSort = _a$onSort === void 0 ? null : _a$onSort,
|
|
801
|
+
_a$sortDirection = _a.sortDirection,
|
|
802
|
+
sortDirection = _a$sortDirection === void 0 ? '' : _a$sortDirection,
|
|
803
|
+
_a$type = _a.type,
|
|
804
|
+
type = _a$type === void 0 ? 'button' : _a$type,
|
|
805
|
+
tooltip = _a.tooltip,
|
|
806
|
+
tooltipProps = _a.tooltipProps,
|
|
807
|
+
tooltipHasDefaultBehavior = _a.tooltipHasDefaultBehavior,
|
|
808
|
+
props = __rest(_a, ["children", "className", "isSortedBy", "onSort", "sortDirection", "type", "tooltip", "tooltipProps", "tooltipHasDefaultBehavior"]);
|
|
885
809
|
var SortedByIcon;
|
|
886
|
-
|
|
887
810
|
var _React$useState = React__namespace.useState(false),
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
811
|
+
focused = _React$useState[0],
|
|
812
|
+
setFocused = _React$useState[1];
|
|
891
813
|
if (isSortedBy) {
|
|
892
814
|
SortedByIcon = sortDirection === SortByDirection.asc ? LongArrowAltUpIcon$1 : LongArrowAltDownIcon$1;
|
|
893
815
|
} else {
|
|
894
816
|
SortedByIcon = ArrowsAltVIcon$1;
|
|
895
817
|
}
|
|
896
|
-
|
|
897
818
|
return React__namespace.createElement("button", Object.assign({}, props, {
|
|
898
819
|
type: type,
|
|
899
820
|
className: css(className, styles$1.tableButton),
|
|
@@ -952,16 +873,16 @@ var sortableFavorites = function sortableFavorites(sort) {
|
|
|
952
873
|
};
|
|
953
874
|
var sortable = function sortable(label, _ref) {
|
|
954
875
|
var columnIndex = _ref.columnIndex,
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
876
|
+
column = _ref.column,
|
|
877
|
+
property = _ref.property,
|
|
878
|
+
className = _ref.className,
|
|
879
|
+
ariaLabel = _ref.ariaLabel,
|
|
880
|
+
tooltip = _ref.tooltip,
|
|
881
|
+
tooltipProps = _ref.tooltipProps,
|
|
882
|
+
tooltipHasDefaultBehavior = _ref.tooltipHasDefaultBehavior;
|
|
962
883
|
var _column$extraParams = column.extraParams,
|
|
963
|
-
|
|
964
|
-
|
|
884
|
+
sortBy = _column$extraParams.sortBy,
|
|
885
|
+
onSort = _column$extraParams.onSort;
|
|
965
886
|
var extraData = {
|
|
966
887
|
columnIndex: columnIndex,
|
|
967
888
|
column: column,
|
|
@@ -971,23 +892,21 @@ var sortable = function sortable(label, _ref) {
|
|
|
971
892
|
/**
|
|
972
893
|
* @param {React.MouseEvent} event - React mouse event
|
|
973
894
|
*/
|
|
974
|
-
|
|
975
895
|
function sortClicked(event) {
|
|
976
896
|
var reversedDirection;
|
|
977
|
-
|
|
978
897
|
if (!isSortedBy) {
|
|
979
898
|
reversedDirection = sortBy.defaultDirection ? sortBy.defaultDirection : SortByDirection.asc;
|
|
980
899
|
} else {
|
|
981
900
|
reversedDirection = sortBy.direction === SortByDirection.asc ? SortByDirection.desc : SortByDirection.asc;
|
|
982
|
-
}
|
|
983
|
-
|
|
984
|
-
|
|
901
|
+
}
|
|
902
|
+
// tslint:disable-next-line:no-unused-expression
|
|
985
903
|
onSort && onSort(event, columnIndex, reversedDirection, extraData);
|
|
986
904
|
}
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
'aria-sort':
|
|
905
|
+
return Object.assign(Object.assign({
|
|
906
|
+
className: css(styles$1.tableSort, isSortedBy && styles$1.modifiers.selected, className)
|
|
907
|
+
}, isSortedBy && {
|
|
908
|
+
'aria-sort': sortBy.direction + "ending"
|
|
909
|
+
}), {
|
|
991
910
|
children: React__namespace.createElement(SortColumn, {
|
|
992
911
|
isSortedBy: isSortedBy,
|
|
993
912
|
sortDirection: isSortedBy ? sortBy.direction : '',
|
|
@@ -997,23 +916,22 @@ var sortable = function sortable(label, _ref) {
|
|
|
997
916
|
tooltipProps: tooltipProps,
|
|
998
917
|
tooltipHasDefaultBehavior: tooltipHasDefaultBehavior
|
|
999
918
|
}, label)
|
|
1000
|
-
};
|
|
919
|
+
});
|
|
1001
920
|
};
|
|
1002
921
|
|
|
1003
922
|
var resolveOrDefault = function resolveOrDefault(resolver, defaultValue, rowData, extraData) {
|
|
1004
923
|
return typeof resolver === 'function' ? resolver(rowData, extraData) : defaultValue;
|
|
1005
924
|
};
|
|
1006
|
-
|
|
1007
925
|
var cellActions = function cellActions(actions, actionResolver, areActionsDisabled) {
|
|
1008
926
|
return function (label, _ref) {
|
|
1009
927
|
var rowData = _ref.rowData,
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
928
|
+
column = _ref.column,
|
|
929
|
+
rowIndex = _ref.rowIndex,
|
|
930
|
+
columnIndex = _ref.columnIndex,
|
|
931
|
+
_ref$column$extraPara = _ref.column.extraParams,
|
|
932
|
+
actionsToggle = _ref$column$extraPara.actionsToggle,
|
|
933
|
+
actionsPopperProps = _ref$column$extraPara.actionsPopperProps,
|
|
934
|
+
property = _ref.property;
|
|
1017
935
|
var extraData = {
|
|
1018
936
|
rowIndex: rowIndex,
|
|
1019
937
|
columnIndex: columnIndex,
|
|
@@ -1045,14 +963,12 @@ var cellActions = function cellActions(actions, actionResolver, areActionsDisabl
|
|
|
1045
963
|
var camelize = function camelize(s) {
|
|
1046
964
|
return s.toUpperCase().replace('-', '').replace('_', '');
|
|
1047
965
|
};
|
|
1048
|
-
|
|
1049
966
|
var toCamel = function toCamel(s) {
|
|
1050
967
|
return s.replace(/([-_][a-z])/gi, camelize);
|
|
1051
968
|
};
|
|
1052
969
|
/**
|
|
1053
970
|
* @param {string} input - String to capitalize
|
|
1054
971
|
*/
|
|
1055
|
-
|
|
1056
972
|
function capitalize(input) {
|
|
1057
973
|
return input[0].toUpperCase() + input.substring(1);
|
|
1058
974
|
}
|
|
@@ -1067,18 +983,18 @@ var cellWidth = function cellWidth(width) {
|
|
|
1067
983
|
|
|
1068
984
|
var collapsible = function collapsible(value, _ref) {
|
|
1069
985
|
var rowIndex = _ref.rowIndex,
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
986
|
+
columnIndex = _ref.columnIndex,
|
|
987
|
+
rowData = _ref.rowData,
|
|
988
|
+
column = _ref.column,
|
|
989
|
+
property = _ref.property;
|
|
1074
990
|
var _column$extraParams = column.extraParams,
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
991
|
+
onCollapse = _column$extraParams.onCollapse,
|
|
992
|
+
_column$extraParams$r = _column$extraParams.rowLabeledBy,
|
|
993
|
+
rowLabeledBy = _column$extraParams$r === void 0 ? 'simple-node' : _column$extraParams$r,
|
|
994
|
+
_column$extraParams$e = _column$extraParams.expandId,
|
|
995
|
+
expandId = _column$extraParams$e === void 0 ? 'expand-toggle' : _column$extraParams$e,
|
|
996
|
+
allRowsExpanded = _column$extraParams.allRowsExpanded,
|
|
997
|
+
collapseAllAriaLabel = _column$extraParams.collapseAllAriaLabel;
|
|
1082
998
|
var extraData = {
|
|
1083
999
|
rowIndex: rowIndex,
|
|
1084
1000
|
columnIndex: columnIndex,
|
|
@@ -1096,13 +1012,11 @@ var collapsible = function collapsible(value, _ref) {
|
|
|
1096
1012
|
/**
|
|
1097
1013
|
* @param {React.MouseEvent} event - Mouse event
|
|
1098
1014
|
*/
|
|
1099
|
-
|
|
1100
1015
|
function onToggle(event) {
|
|
1101
|
-
var open = rowData ? !rowData.isOpen : !allRowsExpanded;
|
|
1102
|
-
|
|
1016
|
+
var open = rowData ? !rowData.isOpen : !allRowsExpanded;
|
|
1017
|
+
// tslint:disable-next-line:no-unused-expression
|
|
1103
1018
|
onCollapse && onCollapse(event, rowIndex, open, rowData, extraData);
|
|
1104
1019
|
}
|
|
1105
|
-
|
|
1106
1020
|
return {
|
|
1107
1021
|
className: ((rowData === null || rowData === void 0 ? void 0 : rowData.isOpen) !== undefined || rowId === -1) && css(styles$1.tableToggle),
|
|
1108
1022
|
isVisible: !(rowData === null || rowData === void 0 ? void 0 : rowData.fullWidth),
|
|
@@ -1116,21 +1030,19 @@ var collapsible = function collapsible(value, _ref) {
|
|
|
1116
1030
|
|
|
1117
1031
|
var compoundExpand = function compoundExpand(value, _ref) {
|
|
1118
1032
|
var rowIndex = _ref.rowIndex,
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1033
|
+
columnIndex = _ref.columnIndex,
|
|
1034
|
+
rowData = _ref.rowData,
|
|
1035
|
+
column = _ref.column,
|
|
1036
|
+
property = _ref.property;
|
|
1124
1037
|
if (!value) {
|
|
1125
1038
|
return null;
|
|
1126
1039
|
}
|
|
1127
|
-
|
|
1128
1040
|
var title = value.title,
|
|
1129
|
-
|
|
1041
|
+
props = value.props;
|
|
1130
1042
|
var _column$extraParams = column.extraParams,
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1043
|
+
onExpand = _column$extraParams.onExpand,
|
|
1044
|
+
_column$extraParams$e = _column$extraParams.expandId,
|
|
1045
|
+
expandId = _column$extraParams$e === void 0 ? 'expand-toggle' : _column$extraParams$e;
|
|
1134
1046
|
var extraData = {
|
|
1135
1047
|
rowIndex: rowIndex,
|
|
1136
1048
|
columnIndex: columnIndex,
|
|
@@ -1140,12 +1052,10 @@ var compoundExpand = function compoundExpand(value, _ref) {
|
|
|
1140
1052
|
/**
|
|
1141
1053
|
* @param {React.MouseEvent} event - Mouse event
|
|
1142
1054
|
*/
|
|
1143
|
-
|
|
1144
1055
|
function onToggle(event) {
|
|
1145
1056
|
// tslint:disable-next-line:no-unused-expression
|
|
1146
1057
|
onExpand && onExpand(event, rowIndex, columnIndex, props.isOpen, rowData, extraData);
|
|
1147
1058
|
}
|
|
1148
|
-
|
|
1149
1059
|
return {
|
|
1150
1060
|
className: css(styles$1.tableCompoundExpansionToggle, props.isOpen && styles$1.modifiers.expanded),
|
|
1151
1061
|
children: props.isOpen !== undefined && React__namespace.createElement("button", {
|
|
@@ -1178,12 +1088,11 @@ var classNames = function classNames() {
|
|
|
1178
1088
|
|
|
1179
1089
|
var info = function info(_ref) {
|
|
1180
1090
|
var tooltip = _ref.tooltip,
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1091
|
+
tooltipProps = _ref.tooltipProps,
|
|
1092
|
+
popover = _ref.popover,
|
|
1093
|
+
popoverProps = _ref.popoverProps,
|
|
1094
|
+
className = _ref.className,
|
|
1095
|
+
ariaLabel = _ref.ariaLabel;
|
|
1187
1096
|
var infoObj = function infoObj(value) {
|
|
1188
1097
|
return {
|
|
1189
1098
|
className: styles$1.modifiers.help,
|
|
@@ -1202,18 +1111,16 @@ var info = function info(_ref) {
|
|
|
1202
1111
|
}, value)
|
|
1203
1112
|
};
|
|
1204
1113
|
};
|
|
1205
|
-
|
|
1206
1114
|
return infoObj;
|
|
1207
1115
|
};
|
|
1208
1116
|
|
|
1209
1117
|
var FavoritesCell = function FavoritesCell(_a) {
|
|
1210
1118
|
var _a$className = _a.className,
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1119
|
+
className = _a$className === void 0 ? '' : _a$className,
|
|
1120
|
+
onFavorite = _a.onFavorite,
|
|
1121
|
+
isFavorited = _a.isFavorited,
|
|
1122
|
+
rowIndex = _a.rowIndex,
|
|
1123
|
+
props = __rest(_a, ["className", "onFavorite", "isFavorited", "rowIndex"]);
|
|
1217
1124
|
var ariaProps = rowIndex === undefined ? {} : {
|
|
1218
1125
|
id: "favorites-button-" + rowIndex,
|
|
1219
1126
|
'aria-labelledby': "favorites-button-" + rowIndex
|
|
@@ -1232,18 +1139,18 @@ FavoritesCell.displayName = 'FavoritesCell';
|
|
|
1232
1139
|
|
|
1233
1140
|
var favoritable = function favoritable(value, _ref) {
|
|
1234
1141
|
var rowIndex = _ref.rowIndex,
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1142
|
+
columnIndex = _ref.columnIndex,
|
|
1143
|
+
rowData = _ref.rowData,
|
|
1144
|
+
column = _ref.column,
|
|
1145
|
+
property = _ref.property;
|
|
1239
1146
|
var onFavorite = column.extraParams.onFavorite;
|
|
1240
1147
|
var extraData = {
|
|
1241
1148
|
rowIndex: rowIndex,
|
|
1242
1149
|
columnIndex: columnIndex,
|
|
1243
1150
|
column: column,
|
|
1244
1151
|
property: property
|
|
1245
|
-
};
|
|
1246
|
-
|
|
1152
|
+
};
|
|
1153
|
+
// this is a child row which should not display the favorites icon
|
|
1247
1154
|
if (rowData && rowData.hasOwnProperty('parent') && !rowData.fullWidth) {
|
|
1248
1155
|
return {
|
|
1249
1156
|
component: 'td',
|
|
@@ -1253,13 +1160,10 @@ var favoritable = function favoritable(value, _ref) {
|
|
|
1253
1160
|
/**
|
|
1254
1161
|
* @param {React.MouseEvent} event - Mouse event
|
|
1255
1162
|
*/
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
1163
|
function favoritesClick(event) {
|
|
1259
1164
|
// tslint:disable-next-line:no-unused-expression
|
|
1260
1165
|
onFavorite && onFavorite(event, rowData && !rowData.favorited, rowIndex, rowData, extraData);
|
|
1261
1166
|
}
|
|
1262
|
-
|
|
1263
1167
|
var additionalProps = rowData.favoritesProps || {};
|
|
1264
1168
|
return {
|
|
1265
1169
|
className: css(styles$1.tableFavorite, rowData && rowData.favorited && styles$1.modifiers.favorited),
|
|
@@ -1286,18 +1190,18 @@ var EllipsisHIcon$1 = EllipsisHIcon;
|
|
|
1286
1190
|
var treeRow = function treeRow(onCollapse, onCheckChange, onToggleRowDetails) {
|
|
1287
1191
|
return function (value, _ref) {
|
|
1288
1192
|
var rowIndex = _ref.rowIndex,
|
|
1289
|
-
|
|
1193
|
+
rowData = _ref.rowData;
|
|
1290
1194
|
var _rowData$props = rowData.props,
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1195
|
+
isExpanded = _rowData$props.isExpanded,
|
|
1196
|
+
isDetailsExpanded = _rowData$props.isDetailsExpanded,
|
|
1197
|
+
level = _rowData$props['aria-level'],
|
|
1198
|
+
setsize = _rowData$props['aria-setsize'],
|
|
1199
|
+
toggleAriaLabel = _rowData$props.toggleAriaLabel,
|
|
1200
|
+
checkAriaLabel = _rowData$props.checkAriaLabel,
|
|
1201
|
+
showDetailsAriaLabel = _rowData$props.showDetailsAriaLabel,
|
|
1202
|
+
isChecked = _rowData$props.isChecked,
|
|
1203
|
+
checkboxId = _rowData$props.checkboxId,
|
|
1204
|
+
icon = _rowData$props.icon;
|
|
1301
1205
|
var content = value.title || value;
|
|
1302
1206
|
var text = React__namespace.createElement("div", {
|
|
1303
1207
|
className: css(treeViewStyles.tableTreeViewText),
|
|
@@ -1309,11 +1213,9 @@ var treeRow = function treeRow(onCollapse, onCheckChange, onToggleRowDetails) {
|
|
|
1309
1213
|
className: styles$1.tableText,
|
|
1310
1214
|
key: "table-text"
|
|
1311
1215
|
}, content));
|
|
1312
|
-
|
|
1313
1216
|
var _onChange = function onChange(isChecked, event) {
|
|
1314
1217
|
onCheckChange(event, isChecked, rowIndex, content, rowData);
|
|
1315
1218
|
};
|
|
1316
|
-
|
|
1317
1219
|
return {
|
|
1318
1220
|
component: 'th',
|
|
1319
1221
|
className: treeViewStyles.tableTreeViewTitleCell,
|
|
@@ -1366,7 +1268,6 @@ var treeRow = function treeRow(onCollapse, onCheckChange, onToggleRowDetails) {
|
|
|
1366
1268
|
};
|
|
1367
1269
|
|
|
1368
1270
|
var TableGridBreakpoint;
|
|
1369
|
-
|
|
1370
1271
|
(function (TableGridBreakpoint) {
|
|
1371
1272
|
TableGridBreakpoint["none"] = "";
|
|
1372
1273
|
TableGridBreakpoint["grid"] = "grid";
|
|
@@ -1375,9 +1276,7 @@ var TableGridBreakpoint;
|
|
|
1375
1276
|
TableGridBreakpoint["gridXl"] = "grid-xl";
|
|
1376
1277
|
TableGridBreakpoint["grid2xl"] = "grid-2xl";
|
|
1377
1278
|
})(TableGridBreakpoint || (TableGridBreakpoint = {}));
|
|
1378
|
-
|
|
1379
1279
|
var TableVariant;
|
|
1380
|
-
|
|
1381
1280
|
(function (TableVariant) {
|
|
1382
1281
|
TableVariant["compact"] = "compact";
|
|
1383
1282
|
})(TableVariant || (TableVariant = {}));
|
|
@@ -1385,58 +1284,51 @@ var TableVariant;
|
|
|
1385
1284
|
var TableContext = React__namespace.createContext({
|
|
1386
1285
|
registerSelectableRow: function registerSelectableRow() {}
|
|
1387
1286
|
});
|
|
1388
|
-
|
|
1389
1287
|
var TableBase = function TableBase(_a) {
|
|
1390
1288
|
var _b, _c;
|
|
1391
|
-
|
|
1392
1289
|
var children = _a.children,
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1290
|
+
className = _a.className,
|
|
1291
|
+
variant = _a.variant,
|
|
1292
|
+
_a$borders = _a.borders,
|
|
1293
|
+
borders = _a$borders === void 0 ? true : _a$borders,
|
|
1294
|
+
_a$isStickyHeader = _a.isStickyHeader,
|
|
1295
|
+
isStickyHeader = _a$isStickyHeader === void 0 ? false : _a$isStickyHeader,
|
|
1296
|
+
_a$gridBreakPoint = _a.gridBreakPoint,
|
|
1297
|
+
gridBreakPoint = _a$gridBreakPoint === void 0 ? TableGridBreakpoint.gridMd : _a$gridBreakPoint,
|
|
1298
|
+
ariaLabel = _a['aria-label'],
|
|
1299
|
+
_a$role = _a.role,
|
|
1300
|
+
role = _a$role === void 0 ? 'grid' : _a$role,
|
|
1301
|
+
innerRef = _a.innerRef,
|
|
1302
|
+
ouiaId = _a.ouiaId,
|
|
1303
|
+
_a$ouiaSafe = _a.ouiaSafe,
|
|
1304
|
+
ouiaSafe = _a$ouiaSafe === void 0 ? true : _a$ouiaSafe,
|
|
1305
|
+
_a$isTreeTable = _a.isTreeTable,
|
|
1306
|
+
isTreeTable = _a$isTreeTable === void 0 ? false : _a$isTreeTable,
|
|
1307
|
+
_a$isNested = _a.isNested,
|
|
1308
|
+
isNested = _a$isNested === void 0 ? false : _a$isNested,
|
|
1309
|
+
_a$isStriped = _a.isStriped,
|
|
1310
|
+
isStriped = _a$isStriped === void 0 ? false : _a$isStriped,
|
|
1311
|
+
_a$isExpandable = _a.isExpandable,
|
|
1312
|
+
isExpandable = _a$isExpandable === void 0 ? false : _a$isExpandable,
|
|
1313
|
+
_a$hasNoInset = _a.hasNoInset,
|
|
1314
|
+
hasNoInset = _a$hasNoInset === void 0 ? false : _a$hasNoInset,
|
|
1315
|
+
selectableRowCaptionText = _a.selectableRowCaptionText,
|
|
1316
|
+
props = __rest(_a, ["children", "className", "variant", "borders", "isStickyHeader", "gridBreakPoint", 'aria-label', "role", "innerRef", "ouiaId", "ouiaSafe", "isTreeTable", "isNested", "isStriped", "isExpandable", "hasNoInset", "nestedHeaderColumnSpans", "selectableRowCaptionText"]);
|
|
1421
1317
|
var ref = React__namespace.useRef(null);
|
|
1422
1318
|
var tableRef = innerRef || ref;
|
|
1423
|
-
|
|
1424
1319
|
var _React$useState = React__namespace.useState(false),
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1320
|
+
hasSelectableRows = _React$useState[0],
|
|
1321
|
+
setHasSelectableRows = _React$useState[1];
|
|
1428
1322
|
var _React$useState2 = React__namespace.useState(),
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1323
|
+
tableCaption = _React$useState2[0],
|
|
1324
|
+
setTableCaption = _React$useState2[1];
|
|
1432
1325
|
React__namespace.useEffect(function () {
|
|
1433
|
-
document.addEventListener('keydown', handleKeys);
|
|
1434
|
-
|
|
1326
|
+
document.addEventListener('keydown', handleKeys);
|
|
1327
|
+
// sets up roving tab-index to tree tables only
|
|
1435
1328
|
if (tableRef && tableRef.current && tableRef.current.classList.contains('pf-m-tree-view')) {
|
|
1436
1329
|
var tbody = tableRef.current.querySelector('tbody');
|
|
1437
|
-
tbody &&
|
|
1330
|
+
tbody && KeyboardHandler.setTabIndex(Array.from(tbody.querySelectorAll('button, a, input')));
|
|
1438
1331
|
}
|
|
1439
|
-
|
|
1440
1332
|
return function cleanup() {
|
|
1441
1333
|
document.removeEventListener('keydown', handleKeys);
|
|
1442
1334
|
};
|
|
@@ -1452,41 +1344,35 @@ var TableBase = function TableBase(_a) {
|
|
|
1452
1344
|
}, "This table has selectable rows. It can be navigated by row using tab, and each row can be selected using space or enter."));
|
|
1453
1345
|
}
|
|
1454
1346
|
}, [selectableRowCaptionText]);
|
|
1455
|
-
var ouiaProps =
|
|
1347
|
+
var ouiaProps = ouia.useOUIAProps('Table', ouiaId, ouiaSafe);
|
|
1456
1348
|
var grid = (_b = stylesGrid.modifiers) === null || _b === void 0 ? void 0 : _b[toCamel(gridBreakPoint || '').replace(/-?2xl/, '_2xl')];
|
|
1457
1349
|
var breakPointPrefix = "treeView" + (gridBreakPoint.charAt(0).toUpperCase() + gridBreakPoint.slice(1));
|
|
1458
1350
|
var treeGrid = (_c = treeViewStyles.modifiers) === null || _c === void 0 ? void 0 : _c[toCamel(breakPointPrefix || '').replace(/-?2xl/, '_2xl')];
|
|
1459
|
-
|
|
1460
1351
|
var handleKeys = function handleKeys(event) {
|
|
1461
|
-
if (isNested || !(tableRef && tableRef.current && tableRef.current.classList.contains(treeViewStyles.modifiers.treeView)) ||
|
|
1352
|
+
if (isNested || !(tableRef && tableRef.current && tableRef.current.classList.contains(treeViewStyles.modifiers.treeView)) ||
|
|
1353
|
+
// implements roving tab-index to tree tables only
|
|
1462
1354
|
tableRef && tableRef.current !== event.target.closest("." + styles$1.table + ":not(.pf-m-nested)")) {
|
|
1463
1355
|
return;
|
|
1464
1356
|
}
|
|
1465
|
-
|
|
1466
1357
|
var activeElement = document.activeElement;
|
|
1467
1358
|
var key = event.key;
|
|
1468
1359
|
var rows = Array.from(tableRef.current.querySelectorAll('tbody tr')).filter(function (el) {
|
|
1469
1360
|
return !el.classList.contains('pf-m-disabled') && !el.hidden;
|
|
1470
1361
|
});
|
|
1471
|
-
|
|
1472
1362
|
if (key === 'Space' || key === 'Enter') {
|
|
1473
1363
|
activeElement.click();
|
|
1474
1364
|
event.preventDefault();
|
|
1475
1365
|
}
|
|
1476
|
-
|
|
1477
1366
|
var getFocusableElement = function getFocusableElement(element) {
|
|
1478
1367
|
return element.querySelectorAll('button:not(:disabled), input:not(:disabled), a:not(:disabled)')[0];
|
|
1479
1368
|
};
|
|
1480
|
-
|
|
1481
|
-
reactCore.handleArrows(event, rows, function (element) {
|
|
1369
|
+
KeyboardHandler.handleArrows(event, rows, function (element) {
|
|
1482
1370
|
return element === activeElement.closest('tr');
|
|
1483
1371
|
}, getFocusableElement, ['button', 'input', 'a'], undefined, false, true, false);
|
|
1484
1372
|
};
|
|
1485
|
-
|
|
1486
1373
|
var registerSelectableRow = function registerSelectableRow() {
|
|
1487
1374
|
!hasSelectableRows && setHasSelectableRows(true);
|
|
1488
1375
|
};
|
|
1489
|
-
|
|
1490
1376
|
return React__namespace.createElement(TableContext.Provider, {
|
|
1491
1377
|
value: {
|
|
1492
1378
|
registerSelectableRow: registerSelectableRow
|
|
@@ -1500,7 +1386,6 @@ var TableBase = function TableBase(_a) {
|
|
|
1500
1386
|
role: 'treegrid'
|
|
1501
1387
|
}, ouiaProps, props), hasSelectableRows && tableCaption, children));
|
|
1502
1388
|
};
|
|
1503
|
-
|
|
1504
1389
|
var Table = React__namespace.forwardRef(function (props, ref) {
|
|
1505
1390
|
return React__namespace.createElement(TableBase, Object.assign({}, props, {
|
|
1506
1391
|
innerRef: ref
|
|
@@ -1510,38 +1395,36 @@ Table.displayName = 'Table';
|
|
|
1510
1395
|
|
|
1511
1396
|
var TrBase = function TrBase(_a) {
|
|
1512
1397
|
var children = _a.children,
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1398
|
+
className = _a.className,
|
|
1399
|
+
isExpanded = _a.isExpanded,
|
|
1400
|
+
isEditable = _a.isEditable,
|
|
1401
|
+
_a$isHidden = _a.isHidden,
|
|
1402
|
+
isHidden = _a$isHidden === void 0 ? false : _a$isHidden,
|
|
1403
|
+
_a$isClickable = _a.isClickable,
|
|
1404
|
+
isClickable = _a$isClickable === void 0 ? false : _a$isClickable,
|
|
1405
|
+
_a$isRowSelected = _a.isRowSelected,
|
|
1406
|
+
isRowSelected = _a$isRowSelected === void 0 ? false : _a$isRowSelected,
|
|
1407
|
+
_a$isStriped = _a.isStriped,
|
|
1408
|
+
isStriped = _a$isStriped === void 0 ? false : _a$isStriped,
|
|
1409
|
+
_a$isBorderRow = _a.isBorderRow,
|
|
1410
|
+
isBorderRow = _a$isBorderRow === void 0 ? false : _a$isBorderRow,
|
|
1411
|
+
_a$isControlRow = _a.isControlRow,
|
|
1412
|
+
isControlRow = _a$isControlRow === void 0 ? false : _a$isControlRow,
|
|
1413
|
+
innerRef = _a.innerRef,
|
|
1414
|
+
ouiaId = _a.ouiaId,
|
|
1415
|
+
_a$ouiaSafe = _a.ouiaSafe,
|
|
1416
|
+
ouiaSafe = _a$ouiaSafe === void 0 ? true : _a$ouiaSafe,
|
|
1417
|
+
_a$resetOffset = _a.resetOffset,
|
|
1418
|
+
resetOffset = _a$resetOffset === void 0 ? false : _a$resetOffset,
|
|
1419
|
+
onRowClick = _a.onRowClick,
|
|
1420
|
+
isSelectable = _a.isSelectable,
|
|
1421
|
+
passedAriaLabel = _a['aria-label'],
|
|
1422
|
+
props = __rest(_a, ["children", "className", "isExpanded", "isEditable", "isHidden", "isClickable", "isRowSelected", "isStriped", "isBorderRow", "isControlRow", "innerRef", "ouiaId", "ouiaSafe", "resetOffset", "onRowClick", "isSelectable", 'aria-label']);
|
|
1537
1423
|
var ouiaProps = helpers.useOUIAProps('TableRow', ouiaId, ouiaSafe);
|
|
1538
|
-
|
|
1539
1424
|
var _React$useState = React__namespace.useState(''),
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1425
|
+
computedAriaLabel = _React$useState[0],
|
|
1426
|
+
setComputedAriaLabel = _React$useState[1];
|
|
1543
1427
|
var onKeyDown = null;
|
|
1544
|
-
|
|
1545
1428
|
if (onRowClick) {
|
|
1546
1429
|
onKeyDown = function onKeyDown(e) {
|
|
1547
1430
|
if (e.key === 'Enter' || e.key === ' ') {
|
|
@@ -1550,12 +1433,9 @@ var TrBase = function TrBase(_a) {
|
|
|
1550
1433
|
}
|
|
1551
1434
|
};
|
|
1552
1435
|
}
|
|
1553
|
-
|
|
1554
1436
|
var rowIsHidden = isHidden || isExpanded !== undefined && !isExpanded;
|
|
1555
|
-
|
|
1556
1437
|
var _React$useContext = React__namespace.useContext(TableContext),
|
|
1557
|
-
|
|
1558
|
-
|
|
1438
|
+
registerSelectableRow = _React$useContext.registerSelectableRow;
|
|
1559
1439
|
React__namespace.useEffect(function () {
|
|
1560
1440
|
if (isSelectable && !rowIsHidden) {
|
|
1561
1441
|
setComputedAriaLabel("" + (isRowSelected ? 'Row selected' : ''));
|
|
@@ -1566,7 +1446,7 @@ var TrBase = function TrBase(_a) {
|
|
|
1566
1446
|
}, [isRowSelected, isSelectable, registerSelectableRow, rowIsHidden]);
|
|
1567
1447
|
var ariaLabel = passedAriaLabel || computedAriaLabel;
|
|
1568
1448
|
return React__namespace.createElement(React__namespace.Fragment, null, React__namespace.createElement("tr", Object.assign({
|
|
1569
|
-
className: css(styles$1.tableTr, className, isExpanded !== undefined && styles$1.tableExpandableRow, isExpanded && styles$1.modifiers.expanded, isEditable && inlineStyles.modifiers.inlineEditable, isClickable && styles$1.modifiers.clickable, isRowSelected && styles$1.modifiers.selected, isStriped && styles$1.modifiers.striped, isBorderRow && styles$1.modifiers.borderRow, resetOffset && styles$1.modifiers.firstCellOffsetReset),
|
|
1449
|
+
className: css(styles$1.tableTr, className, isExpanded !== undefined && styles$1.tableExpandableRow, isExpanded && styles$1.modifiers.expanded, isEditable && inlineStyles.modifiers.inlineEditable, isClickable && styles$1.modifiers.clickable, isRowSelected && styles$1.modifiers.selected, isStriped && styles$1.modifiers.striped, isBorderRow && styles$1.modifiers.borderRow, isControlRow && styles$1.tableControlRow, resetOffset && styles$1.modifiers.firstCellOffsetReset),
|
|
1570
1450
|
hidden: rowIsHidden
|
|
1571
1451
|
}, isClickable && {
|
|
1572
1452
|
tabIndex: 0
|
|
@@ -1578,7 +1458,6 @@ var TrBase = function TrBase(_a) {
|
|
|
1578
1458
|
onKeyDown: onKeyDown
|
|
1579
1459
|
}, ouiaProps, props), children));
|
|
1580
1460
|
};
|
|
1581
|
-
|
|
1582
1461
|
var Tr = React__namespace.forwardRef(function (props, ref) {
|
|
1583
1462
|
return React__namespace.createElement(TrBase, Object.assign({}, props, {
|
|
1584
1463
|
innerRef: ref
|
|
@@ -1588,19 +1467,17 @@ Tr.displayName = 'Tr';
|
|
|
1588
1467
|
|
|
1589
1468
|
var TheadBase = function TheadBase(_a) {
|
|
1590
1469
|
var children = _a.children,
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1470
|
+
className = _a.className,
|
|
1471
|
+
_a$noWrap = _a.noWrap,
|
|
1472
|
+
noWrap = _a$noWrap === void 0 ? false : _a$noWrap,
|
|
1473
|
+
innerRef = _a.innerRef,
|
|
1474
|
+
hasNestedHeader = _a.hasNestedHeader,
|
|
1475
|
+
props = __rest(_a, ["children", "className", "noWrap", "innerRef", "hasNestedHeader"]);
|
|
1598
1476
|
return React__namespace.createElement("thead", Object.assign({
|
|
1599
1477
|
className: css(styles$1.tableThead, className, noWrap && styles$1.modifiers.nowrap, hasNestedHeader && styles$1.modifiers.nestedColumnHeader),
|
|
1600
1478
|
ref: innerRef
|
|
1601
1479
|
}, props), children);
|
|
1602
1480
|
};
|
|
1603
|
-
|
|
1604
1481
|
var Thead = React__namespace.forwardRef(function (props, ref) {
|
|
1605
1482
|
return React__namespace.createElement(TheadBase, Object.assign({}, props, {
|
|
1606
1483
|
innerRef: ref
|
|
@@ -1610,22 +1487,20 @@ Thead.displayName = 'Thead';
|
|
|
1610
1487
|
|
|
1611
1488
|
var TbodyBase = function TbodyBase(_a) {
|
|
1612
1489
|
var children = _a.children,
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1490
|
+
className = _a.className,
|
|
1491
|
+
isExpanded = _a.isExpanded,
|
|
1492
|
+
innerRef = _a.innerRef,
|
|
1493
|
+
_a$isEvenStriped = _a.isEvenStriped,
|
|
1494
|
+
isEvenStriped = _a$isEvenStriped === void 0 ? false : _a$isEvenStriped,
|
|
1495
|
+
_a$isOddStriped = _a.isOddStriped,
|
|
1496
|
+
isOddStriped = _a$isOddStriped === void 0 ? false : _a$isOddStriped,
|
|
1497
|
+
props = __rest(_a, ["children", "className", "isExpanded", "innerRef", "isEvenStriped", "isOddStriped"]);
|
|
1622
1498
|
return React__namespace.createElement("tbody", Object.assign({
|
|
1623
1499
|
role: "rowgroup",
|
|
1624
1500
|
className: css(styles$1.tableTbody, className, isExpanded && styles$1.modifiers.expanded, isOddStriped && styles$1.modifiers.striped, isEvenStriped && styles$1.modifiers.stripedEven),
|
|
1625
1501
|
ref: innerRef
|
|
1626
1502
|
}, props), children);
|
|
1627
1503
|
};
|
|
1628
|
-
|
|
1629
1504
|
var Tbody = React__namespace.forwardRef(function (props, ref) {
|
|
1630
1505
|
return React__namespace.createElement(TbodyBase, Object.assign({}, props, {
|
|
1631
1506
|
innerRef: ref
|
|
@@ -1649,141 +1524,2255 @@ var styles = {
|
|
|
1649
1524
|
};
|
|
1650
1525
|
|
|
1651
1526
|
/**
|
|
1652
|
-
*
|
|
1527
|
+
* Removes all key-value entries from the list cache.
|
|
1653
1528
|
*
|
|
1654
|
-
*
|
|
1655
|
-
*
|
|
1529
|
+
* @private
|
|
1530
|
+
* @name clear
|
|
1531
|
+
* @memberOf ListCache
|
|
1656
1532
|
*/
|
|
1533
|
+
function listCacheClear() {
|
|
1534
|
+
this.__data__ = [];
|
|
1535
|
+
this.size = 0;
|
|
1536
|
+
}
|
|
1537
|
+
var _listCacheClear = listCacheClear;
|
|
1538
|
+
|
|
1657
1539
|
/**
|
|
1658
|
-
*
|
|
1540
|
+
* Performs a
|
|
1541
|
+
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
|
1542
|
+
* comparison between two values to determine if they are equivalent.
|
|
1543
|
+
*
|
|
1544
|
+
* @static
|
|
1545
|
+
* @memberOf _
|
|
1546
|
+
* @since 4.0.0
|
|
1547
|
+
* @category Lang
|
|
1548
|
+
* @param {*} value The value to compare.
|
|
1549
|
+
* @param {*} other The other value to compare.
|
|
1550
|
+
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
|
1551
|
+
* @example
|
|
1552
|
+
*
|
|
1553
|
+
* var object = { 'a': 1 };
|
|
1554
|
+
* var other = { 'a': 1 };
|
|
1555
|
+
*
|
|
1556
|
+
* _.eq(object, object);
|
|
1557
|
+
* // => true
|
|
1558
|
+
*
|
|
1559
|
+
* _.eq(object, other);
|
|
1560
|
+
* // => false
|
|
1561
|
+
*
|
|
1562
|
+
* _.eq('a', 'a');
|
|
1563
|
+
* // => true
|
|
1564
|
+
*
|
|
1565
|
+
* _.eq('a', Object('a'));
|
|
1566
|
+
* // => false
|
|
1567
|
+
*
|
|
1568
|
+
* _.eq(NaN, NaN);
|
|
1569
|
+
* // => true
|
|
1659
1570
|
*/
|
|
1571
|
+
function eq(value, other) {
|
|
1572
|
+
return value === other || value !== value && other !== other;
|
|
1573
|
+
}
|
|
1574
|
+
var eq_1 = eq;
|
|
1660
1575
|
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1576
|
+
/**
|
|
1577
|
+
* Gets the index at which the `key` is found in `array` of key-value pairs.
|
|
1578
|
+
*
|
|
1579
|
+
* @private
|
|
1580
|
+
* @param {Array} array The array to inspect.
|
|
1581
|
+
* @param {*} key The key to search for.
|
|
1582
|
+
* @returns {number} Returns the index of the matched value, else `-1`.
|
|
1583
|
+
*/
|
|
1584
|
+
function assocIndexOf(array, key) {
|
|
1585
|
+
var length = array.length;
|
|
1586
|
+
while (length--) {
|
|
1587
|
+
if (eq_1(array[length][0], key)) {
|
|
1588
|
+
return length;
|
|
1589
|
+
}
|
|
1590
|
+
}
|
|
1591
|
+
return -1;
|
|
1592
|
+
}
|
|
1593
|
+
var _assocIndexOf = assocIndexOf;
|
|
1669
1594
|
|
|
1595
|
+
/** Used for built-in method references. */
|
|
1596
|
+
var arrayProto = Array.prototype;
|
|
1670
1597
|
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
if (a && b) {
|
|
1674
|
-
// compose the two
|
|
1675
|
-
return React__namespace.cloneElement(a, {
|
|
1676
|
-
children: b
|
|
1677
|
-
});
|
|
1678
|
-
} // Children have to be merged in reverse order for Reactabular
|
|
1679
|
-
// logic to work.
|
|
1598
|
+
/** Built-in value references. */
|
|
1599
|
+
var splice = arrayProto.splice;
|
|
1680
1600
|
|
|
1601
|
+
/**
|
|
1602
|
+
* Removes `key` and its value from the list cache.
|
|
1603
|
+
*
|
|
1604
|
+
* @private
|
|
1605
|
+
* @name delete
|
|
1606
|
+
* @memberOf ListCache
|
|
1607
|
+
* @param {string} key The key of the value to remove.
|
|
1608
|
+
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
1609
|
+
*/
|
|
1610
|
+
function listCacheDelete(key) {
|
|
1611
|
+
var data = this.__data__,
|
|
1612
|
+
index = _assocIndexOf(data, key);
|
|
1613
|
+
if (index < 0) {
|
|
1614
|
+
return false;
|
|
1615
|
+
}
|
|
1616
|
+
var lastIndex = data.length - 1;
|
|
1617
|
+
if (index == lastIndex) {
|
|
1618
|
+
data.pop();
|
|
1619
|
+
} else {
|
|
1620
|
+
splice.call(data, index, 1);
|
|
1621
|
+
}
|
|
1622
|
+
--this.size;
|
|
1623
|
+
return true;
|
|
1624
|
+
}
|
|
1625
|
+
var _listCacheDelete = listCacheDelete;
|
|
1681
1626
|
|
|
1682
|
-
|
|
1683
|
-
|
|
1627
|
+
/**
|
|
1628
|
+
* Gets the list cache value for `key`.
|
|
1629
|
+
*
|
|
1630
|
+
* @private
|
|
1631
|
+
* @name get
|
|
1632
|
+
* @memberOf ListCache
|
|
1633
|
+
* @param {string} key The key of the value to get.
|
|
1634
|
+
* @returns {*} Returns the entry value.
|
|
1635
|
+
*/
|
|
1636
|
+
function listCacheGet(key) {
|
|
1637
|
+
var data = this.__data__,
|
|
1638
|
+
index = _assocIndexOf(data, key);
|
|
1639
|
+
return index < 0 ? undefined : data[index][1];
|
|
1640
|
+
}
|
|
1641
|
+
var _listCacheGet = listCacheGet;
|
|
1684
1642
|
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1643
|
+
/**
|
|
1644
|
+
* Checks if a list cache value for `key` exists.
|
|
1645
|
+
*
|
|
1646
|
+
* @private
|
|
1647
|
+
* @name has
|
|
1648
|
+
* @memberOf ListCache
|
|
1649
|
+
* @param {string} key The key of the entry to check.
|
|
1650
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
1651
|
+
*/
|
|
1652
|
+
function listCacheHas(key) {
|
|
1653
|
+
return _assocIndexOf(this.__data__, key) > -1;
|
|
1654
|
+
}
|
|
1655
|
+
var _listCacheHas = listCacheHas;
|
|
1690
1656
|
|
|
1691
|
-
|
|
1692
|
-
|
|
1657
|
+
/**
|
|
1658
|
+
* Sets the list cache `key` to `value`.
|
|
1659
|
+
*
|
|
1660
|
+
* @private
|
|
1661
|
+
* @name set
|
|
1662
|
+
* @memberOf ListCache
|
|
1663
|
+
* @param {string} key The key of the value to set.
|
|
1664
|
+
* @param {*} value The value to set.
|
|
1665
|
+
* @returns {Object} Returns the list cache instance.
|
|
1666
|
+
*/
|
|
1667
|
+
function listCacheSet(key, value) {
|
|
1668
|
+
var data = this.__data__,
|
|
1669
|
+
index = _assocIndexOf(data, key);
|
|
1670
|
+
if (index < 0) {
|
|
1671
|
+
++this.size;
|
|
1672
|
+
data.push([key, value]);
|
|
1673
|
+
} else {
|
|
1674
|
+
data[index][1] = value;
|
|
1675
|
+
}
|
|
1676
|
+
return this;
|
|
1693
1677
|
}
|
|
1678
|
+
var _listCacheSet = listCacheSet;
|
|
1694
1679
|
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1680
|
+
/**
|
|
1681
|
+
* Creates an list cache object.
|
|
1682
|
+
*
|
|
1683
|
+
* @private
|
|
1684
|
+
* @constructor
|
|
1685
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
|
1686
|
+
*/
|
|
1687
|
+
function ListCache(entries) {
|
|
1688
|
+
var index = -1,
|
|
1689
|
+
length = entries == null ? 0 : entries.length;
|
|
1690
|
+
this.clear();
|
|
1691
|
+
while (++index < length) {
|
|
1692
|
+
var entry = entries[index];
|
|
1693
|
+
this.set(entry[0], entry[1]);
|
|
1694
|
+
}
|
|
1695
|
+
}
|
|
1701
1696
|
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1697
|
+
// Add methods to `ListCache`.
|
|
1698
|
+
ListCache.prototype.clear = _listCacheClear;
|
|
1699
|
+
ListCache.prototype['delete'] = _listCacheDelete;
|
|
1700
|
+
ListCache.prototype.get = _listCacheGet;
|
|
1701
|
+
ListCache.prototype.has = _listCacheHas;
|
|
1702
|
+
ListCache.prototype.set = _listCacheSet;
|
|
1703
|
+
var _ListCache = ListCache;
|
|
1708
1704
|
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1705
|
+
/**
|
|
1706
|
+
* Removes all key-value entries from the stack.
|
|
1707
|
+
*
|
|
1708
|
+
* @private
|
|
1709
|
+
* @name clear
|
|
1710
|
+
* @memberOf Stack
|
|
1711
|
+
*/
|
|
1712
|
+
function stackClear() {
|
|
1713
|
+
this.__data__ = new _ListCache();
|
|
1714
|
+
this.size = 0;
|
|
1715
|
+
}
|
|
1716
|
+
var _stackClear = stackClear;
|
|
1715
1717
|
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
+
/**
|
|
1719
|
+
* Removes `key` and its value from the stack.
|
|
1720
|
+
*
|
|
1721
|
+
* @private
|
|
1722
|
+
* @name delete
|
|
1723
|
+
* @memberOf Stack
|
|
1724
|
+
* @param {string} key The key of the value to remove.
|
|
1725
|
+
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
1726
|
+
*/
|
|
1727
|
+
function stackDelete(key) {
|
|
1728
|
+
var data = this.__data__,
|
|
1729
|
+
result = data['delete'](key);
|
|
1730
|
+
this.size = data.size;
|
|
1731
|
+
return result;
|
|
1732
|
+
}
|
|
1733
|
+
var _stackDelete = stackDelete;
|
|
1718
1734
|
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1735
|
+
/**
|
|
1736
|
+
* Gets the stack value for `key`.
|
|
1737
|
+
*
|
|
1738
|
+
* @private
|
|
1739
|
+
* @name get
|
|
1740
|
+
* @memberOf Stack
|
|
1741
|
+
* @param {string} key The key of the value to get.
|
|
1742
|
+
* @returns {*} Returns the entry value.
|
|
1743
|
+
*/
|
|
1744
|
+
function stackGet(key) {
|
|
1745
|
+
return this.__data__.get(key);
|
|
1746
|
+
}
|
|
1747
|
+
var _stackGet = stackGet;
|
|
1748
|
+
|
|
1749
|
+
/**
|
|
1750
|
+
* Checks if a stack value for `key` exists.
|
|
1751
|
+
*
|
|
1752
|
+
* @private
|
|
1753
|
+
* @name has
|
|
1754
|
+
* @memberOf Stack
|
|
1755
|
+
* @param {string} key The key of the entry to check.
|
|
1756
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
1757
|
+
*/
|
|
1758
|
+
function stackHas(key) {
|
|
1759
|
+
return this.__data__.has(key);
|
|
1760
|
+
}
|
|
1761
|
+
var _stackHas = stackHas;
|
|
1762
|
+
|
|
1763
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
1764
|
+
|
|
1765
|
+
function createCommonjsModule(fn) {
|
|
1766
|
+
var module = { exports: {} };
|
|
1767
|
+
return fn(module, module.exports), module.exports;
|
|
1768
|
+
}
|
|
1769
|
+
|
|
1770
|
+
/** Detect free variable `global` from Node.js. */
|
|
1771
|
+
var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
1772
|
+
var _freeGlobal = freeGlobal;
|
|
1773
|
+
|
|
1774
|
+
/** Detect free variable `self`. */
|
|
1775
|
+
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
1776
|
+
|
|
1777
|
+
/** Used as a reference to the global object. */
|
|
1778
|
+
var root = _freeGlobal || freeSelf || Function('return this')();
|
|
1779
|
+
var _root = root;
|
|
1780
|
+
|
|
1781
|
+
/** Built-in value references. */
|
|
1782
|
+
var Symbol = _root.Symbol;
|
|
1783
|
+
var _Symbol = Symbol;
|
|
1784
|
+
|
|
1785
|
+
/** Used for built-in method references. */
|
|
1786
|
+
var objectProto$a = Object.prototype;
|
|
1787
|
+
|
|
1788
|
+
/** Used to check objects for own properties. */
|
|
1789
|
+
var hasOwnProperty$8 = objectProto$a.hasOwnProperty;
|
|
1790
|
+
|
|
1791
|
+
/**
|
|
1792
|
+
* Used to resolve the
|
|
1793
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
1794
|
+
* of values.
|
|
1795
|
+
*/
|
|
1796
|
+
var nativeObjectToString$1 = objectProto$a.toString;
|
|
1797
|
+
|
|
1798
|
+
/** Built-in value references. */
|
|
1799
|
+
var symToStringTag$1 = _Symbol ? _Symbol.toStringTag : undefined;
|
|
1800
|
+
|
|
1801
|
+
/**
|
|
1802
|
+
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
|
|
1803
|
+
*
|
|
1804
|
+
* @private
|
|
1805
|
+
* @param {*} value The value to query.
|
|
1806
|
+
* @returns {string} Returns the raw `toStringTag`.
|
|
1807
|
+
*/
|
|
1808
|
+
function getRawTag(value) {
|
|
1809
|
+
var isOwn = hasOwnProperty$8.call(value, symToStringTag$1),
|
|
1810
|
+
tag = value[symToStringTag$1];
|
|
1811
|
+
try {
|
|
1812
|
+
value[symToStringTag$1] = undefined;
|
|
1813
|
+
var unmasked = true;
|
|
1814
|
+
} catch (e) {}
|
|
1815
|
+
var result = nativeObjectToString$1.call(value);
|
|
1816
|
+
if (unmasked) {
|
|
1817
|
+
if (isOwn) {
|
|
1818
|
+
value[symToStringTag$1] = tag;
|
|
1819
|
+
} else {
|
|
1820
|
+
delete value[symToStringTag$1];
|
|
1821
|
+
}
|
|
1822
|
+
}
|
|
1823
|
+
return result;
|
|
1824
|
+
}
|
|
1825
|
+
var _getRawTag = getRawTag;
|
|
1826
|
+
|
|
1827
|
+
/** Used for built-in method references. */
|
|
1828
|
+
var objectProto$9 = Object.prototype;
|
|
1829
|
+
|
|
1830
|
+
/**
|
|
1831
|
+
* Used to resolve the
|
|
1832
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
1833
|
+
* of values.
|
|
1834
|
+
*/
|
|
1835
|
+
var nativeObjectToString = objectProto$9.toString;
|
|
1836
|
+
|
|
1837
|
+
/**
|
|
1838
|
+
* Converts `value` to a string using `Object.prototype.toString`.
|
|
1839
|
+
*
|
|
1840
|
+
* @private
|
|
1841
|
+
* @param {*} value The value to convert.
|
|
1842
|
+
* @returns {string} Returns the converted string.
|
|
1843
|
+
*/
|
|
1844
|
+
function objectToString(value) {
|
|
1845
|
+
return nativeObjectToString.call(value);
|
|
1846
|
+
}
|
|
1847
|
+
var _objectToString = objectToString;
|
|
1848
|
+
|
|
1849
|
+
/** `Object#toString` result references. */
|
|
1850
|
+
var nullTag = '[object Null]',
|
|
1851
|
+
undefinedTag = '[object Undefined]';
|
|
1852
|
+
|
|
1853
|
+
/** Built-in value references. */
|
|
1854
|
+
var symToStringTag = _Symbol ? _Symbol.toStringTag : undefined;
|
|
1855
|
+
|
|
1856
|
+
/**
|
|
1857
|
+
* The base implementation of `getTag` without fallbacks for buggy environments.
|
|
1858
|
+
*
|
|
1859
|
+
* @private
|
|
1860
|
+
* @param {*} value The value to query.
|
|
1861
|
+
* @returns {string} Returns the `toStringTag`.
|
|
1862
|
+
*/
|
|
1863
|
+
function baseGetTag(value) {
|
|
1864
|
+
if (value == null) {
|
|
1865
|
+
return value === undefined ? undefinedTag : nullTag;
|
|
1866
|
+
}
|
|
1867
|
+
return symToStringTag && symToStringTag in Object(value) ? _getRawTag(value) : _objectToString(value);
|
|
1868
|
+
}
|
|
1869
|
+
var _baseGetTag = baseGetTag;
|
|
1870
|
+
|
|
1871
|
+
/**
|
|
1872
|
+
* Checks if `value` is the
|
|
1873
|
+
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
|
1874
|
+
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
|
1875
|
+
*
|
|
1876
|
+
* @static
|
|
1877
|
+
* @memberOf _
|
|
1878
|
+
* @since 0.1.0
|
|
1879
|
+
* @category Lang
|
|
1880
|
+
* @param {*} value The value to check.
|
|
1881
|
+
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
|
1882
|
+
* @example
|
|
1883
|
+
*
|
|
1884
|
+
* _.isObject({});
|
|
1885
|
+
* // => true
|
|
1886
|
+
*
|
|
1887
|
+
* _.isObject([1, 2, 3]);
|
|
1888
|
+
* // => true
|
|
1889
|
+
*
|
|
1890
|
+
* _.isObject(_.noop);
|
|
1891
|
+
* // => true
|
|
1892
|
+
*
|
|
1893
|
+
* _.isObject(null);
|
|
1894
|
+
* // => false
|
|
1895
|
+
*/
|
|
1896
|
+
function isObject(value) {
|
|
1897
|
+
var type = typeof value;
|
|
1898
|
+
return value != null && (type == 'object' || type == 'function');
|
|
1899
|
+
}
|
|
1900
|
+
var isObject_1 = isObject;
|
|
1901
|
+
|
|
1902
|
+
/** `Object#toString` result references. */
|
|
1903
|
+
var asyncTag = '[object AsyncFunction]',
|
|
1904
|
+
funcTag$1 = '[object Function]',
|
|
1905
|
+
genTag = '[object GeneratorFunction]',
|
|
1906
|
+
proxyTag = '[object Proxy]';
|
|
1907
|
+
|
|
1908
|
+
/**
|
|
1909
|
+
* Checks if `value` is classified as a `Function` object.
|
|
1910
|
+
*
|
|
1911
|
+
* @static
|
|
1912
|
+
* @memberOf _
|
|
1913
|
+
* @since 0.1.0
|
|
1914
|
+
* @category Lang
|
|
1915
|
+
* @param {*} value The value to check.
|
|
1916
|
+
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
|
|
1917
|
+
* @example
|
|
1918
|
+
*
|
|
1919
|
+
* _.isFunction(_);
|
|
1920
|
+
* // => true
|
|
1921
|
+
*
|
|
1922
|
+
* _.isFunction(/abc/);
|
|
1923
|
+
* // => false
|
|
1924
|
+
*/
|
|
1925
|
+
function isFunction(value) {
|
|
1926
|
+
if (!isObject_1(value)) {
|
|
1927
|
+
return false;
|
|
1928
|
+
}
|
|
1929
|
+
// The use of `Object#toString` avoids issues with the `typeof` operator
|
|
1930
|
+
// in Safari 9 which returns 'object' for typed arrays and other constructors.
|
|
1931
|
+
var tag = _baseGetTag(value);
|
|
1932
|
+
return tag == funcTag$1 || tag == genTag || tag == asyncTag || tag == proxyTag;
|
|
1933
|
+
}
|
|
1934
|
+
var isFunction_1 = isFunction;
|
|
1935
|
+
|
|
1936
|
+
/** Used to detect overreaching core-js shims. */
|
|
1937
|
+
var coreJsData = _root['__core-js_shared__'];
|
|
1938
|
+
var _coreJsData = coreJsData;
|
|
1939
|
+
|
|
1940
|
+
/** Used to detect methods masquerading as native. */
|
|
1941
|
+
var maskSrcKey = function () {
|
|
1942
|
+
var uid = /[^.]+$/.exec(_coreJsData && _coreJsData.keys && _coreJsData.keys.IE_PROTO || '');
|
|
1943
|
+
return uid ? 'Symbol(src)_1.' + uid : '';
|
|
1944
|
+
}();
|
|
1945
|
+
|
|
1946
|
+
/**
|
|
1947
|
+
* Checks if `func` has its source masked.
|
|
1948
|
+
*
|
|
1949
|
+
* @private
|
|
1950
|
+
* @param {Function} func The function to check.
|
|
1951
|
+
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
|
|
1952
|
+
*/
|
|
1953
|
+
function isMasked(func) {
|
|
1954
|
+
return !!maskSrcKey && maskSrcKey in func;
|
|
1955
|
+
}
|
|
1956
|
+
var _isMasked = isMasked;
|
|
1957
|
+
|
|
1958
|
+
/** Used for built-in method references. */
|
|
1959
|
+
var funcProto$2 = Function.prototype;
|
|
1960
|
+
|
|
1961
|
+
/** Used to resolve the decompiled source of functions. */
|
|
1962
|
+
var funcToString$2 = funcProto$2.toString;
|
|
1963
|
+
|
|
1964
|
+
/**
|
|
1965
|
+
* Converts `func` to its source code.
|
|
1966
|
+
*
|
|
1967
|
+
* @private
|
|
1968
|
+
* @param {Function} func The function to convert.
|
|
1969
|
+
* @returns {string} Returns the source code.
|
|
1970
|
+
*/
|
|
1971
|
+
function toSource(func) {
|
|
1972
|
+
if (func != null) {
|
|
1973
|
+
try {
|
|
1974
|
+
return funcToString$2.call(func);
|
|
1975
|
+
} catch (e) {}
|
|
1976
|
+
try {
|
|
1977
|
+
return func + '';
|
|
1978
|
+
} catch (e) {}
|
|
1979
|
+
}
|
|
1980
|
+
return '';
|
|
1981
|
+
}
|
|
1982
|
+
var _toSource = toSource;
|
|
1983
|
+
|
|
1984
|
+
/**
|
|
1985
|
+
* Used to match `RegExp`
|
|
1986
|
+
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
|
|
1987
|
+
*/
|
|
1988
|
+
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
1989
|
+
|
|
1990
|
+
/** Used to detect host constructors (Safari). */
|
|
1991
|
+
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
1992
|
+
|
|
1993
|
+
/** Used for built-in method references. */
|
|
1994
|
+
var funcProto$1 = Function.prototype,
|
|
1995
|
+
objectProto$8 = Object.prototype;
|
|
1996
|
+
|
|
1997
|
+
/** Used to resolve the decompiled source of functions. */
|
|
1998
|
+
var funcToString$1 = funcProto$1.toString;
|
|
1999
|
+
|
|
2000
|
+
/** Used to check objects for own properties. */
|
|
2001
|
+
var hasOwnProperty$7 = objectProto$8.hasOwnProperty;
|
|
2002
|
+
|
|
2003
|
+
/** Used to detect if a method is native. */
|
|
2004
|
+
var reIsNative = RegExp('^' + funcToString$1.call(hasOwnProperty$7).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
|
|
2005
|
+
|
|
2006
|
+
/**
|
|
2007
|
+
* The base implementation of `_.isNative` without bad shim checks.
|
|
2008
|
+
*
|
|
2009
|
+
* @private
|
|
2010
|
+
* @param {*} value The value to check.
|
|
2011
|
+
* @returns {boolean} Returns `true` if `value` is a native function,
|
|
2012
|
+
* else `false`.
|
|
2013
|
+
*/
|
|
2014
|
+
function baseIsNative(value) {
|
|
2015
|
+
if (!isObject_1(value) || _isMasked(value)) {
|
|
2016
|
+
return false;
|
|
2017
|
+
}
|
|
2018
|
+
var pattern = isFunction_1(value) ? reIsNative : reIsHostCtor;
|
|
2019
|
+
return pattern.test(_toSource(value));
|
|
2020
|
+
}
|
|
2021
|
+
var _baseIsNative = baseIsNative;
|
|
2022
|
+
|
|
2023
|
+
/**
|
|
2024
|
+
* Gets the value at `key` of `object`.
|
|
2025
|
+
*
|
|
2026
|
+
* @private
|
|
2027
|
+
* @param {Object} [object] The object to query.
|
|
2028
|
+
* @param {string} key The key of the property to get.
|
|
2029
|
+
* @returns {*} Returns the property value.
|
|
2030
|
+
*/
|
|
2031
|
+
function getValue(object, key) {
|
|
2032
|
+
return object == null ? undefined : object[key];
|
|
2033
|
+
}
|
|
2034
|
+
var _getValue = getValue;
|
|
2035
|
+
|
|
2036
|
+
/**
|
|
2037
|
+
* Gets the native function at `key` of `object`.
|
|
2038
|
+
*
|
|
2039
|
+
* @private
|
|
2040
|
+
* @param {Object} object The object to query.
|
|
2041
|
+
* @param {string} key The key of the method to get.
|
|
2042
|
+
* @returns {*} Returns the function if it's native, else `undefined`.
|
|
2043
|
+
*/
|
|
2044
|
+
function getNative(object, key) {
|
|
2045
|
+
var value = _getValue(object, key);
|
|
2046
|
+
return _baseIsNative(value) ? value : undefined;
|
|
2047
|
+
}
|
|
2048
|
+
var _getNative = getNative;
|
|
2049
|
+
|
|
2050
|
+
/* Built-in method references that are verified to be native. */
|
|
2051
|
+
var Map = _getNative(_root, 'Map');
|
|
2052
|
+
var _Map = Map;
|
|
2053
|
+
|
|
2054
|
+
/* Built-in method references that are verified to be native. */
|
|
2055
|
+
var nativeCreate = _getNative(Object, 'create');
|
|
2056
|
+
var _nativeCreate = nativeCreate;
|
|
2057
|
+
|
|
2058
|
+
/**
|
|
2059
|
+
* Removes all key-value entries from the hash.
|
|
2060
|
+
*
|
|
2061
|
+
* @private
|
|
2062
|
+
* @name clear
|
|
2063
|
+
* @memberOf Hash
|
|
2064
|
+
*/
|
|
2065
|
+
function hashClear() {
|
|
2066
|
+
this.__data__ = _nativeCreate ? _nativeCreate(null) : {};
|
|
2067
|
+
this.size = 0;
|
|
2068
|
+
}
|
|
2069
|
+
var _hashClear = hashClear;
|
|
2070
|
+
|
|
2071
|
+
/**
|
|
2072
|
+
* Removes `key` and its value from the hash.
|
|
2073
|
+
*
|
|
2074
|
+
* @private
|
|
2075
|
+
* @name delete
|
|
2076
|
+
* @memberOf Hash
|
|
2077
|
+
* @param {Object} hash The hash to modify.
|
|
2078
|
+
* @param {string} key The key of the value to remove.
|
|
2079
|
+
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
2080
|
+
*/
|
|
2081
|
+
function hashDelete(key) {
|
|
2082
|
+
var result = this.has(key) && delete this.__data__[key];
|
|
2083
|
+
this.size -= result ? 1 : 0;
|
|
2084
|
+
return result;
|
|
2085
|
+
}
|
|
2086
|
+
var _hashDelete = hashDelete;
|
|
2087
|
+
|
|
2088
|
+
/** Used to stand-in for `undefined` hash values. */
|
|
2089
|
+
var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
|
|
2090
|
+
|
|
2091
|
+
/** Used for built-in method references. */
|
|
2092
|
+
var objectProto$7 = Object.prototype;
|
|
2093
|
+
|
|
2094
|
+
/** Used to check objects for own properties. */
|
|
2095
|
+
var hasOwnProperty$6 = objectProto$7.hasOwnProperty;
|
|
2096
|
+
|
|
2097
|
+
/**
|
|
2098
|
+
* Gets the hash value for `key`.
|
|
2099
|
+
*
|
|
2100
|
+
* @private
|
|
2101
|
+
* @name get
|
|
2102
|
+
* @memberOf Hash
|
|
2103
|
+
* @param {string} key The key of the value to get.
|
|
2104
|
+
* @returns {*} Returns the entry value.
|
|
2105
|
+
*/
|
|
2106
|
+
function hashGet(key) {
|
|
2107
|
+
var data = this.__data__;
|
|
2108
|
+
if (_nativeCreate) {
|
|
2109
|
+
var result = data[key];
|
|
2110
|
+
return result === HASH_UNDEFINED$1 ? undefined : result;
|
|
2111
|
+
}
|
|
2112
|
+
return hasOwnProperty$6.call(data, key) ? data[key] : undefined;
|
|
2113
|
+
}
|
|
2114
|
+
var _hashGet = hashGet;
|
|
2115
|
+
|
|
2116
|
+
/** Used for built-in method references. */
|
|
2117
|
+
var objectProto$6 = Object.prototype;
|
|
2118
|
+
|
|
2119
|
+
/** Used to check objects for own properties. */
|
|
2120
|
+
var hasOwnProperty$5 = objectProto$6.hasOwnProperty;
|
|
2121
|
+
|
|
2122
|
+
/**
|
|
2123
|
+
* Checks if a hash value for `key` exists.
|
|
2124
|
+
*
|
|
2125
|
+
* @private
|
|
2126
|
+
* @name has
|
|
2127
|
+
* @memberOf Hash
|
|
2128
|
+
* @param {string} key The key of the entry to check.
|
|
2129
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
2130
|
+
*/
|
|
2131
|
+
function hashHas(key) {
|
|
2132
|
+
var data = this.__data__;
|
|
2133
|
+
return _nativeCreate ? data[key] !== undefined : hasOwnProperty$5.call(data, key);
|
|
2134
|
+
}
|
|
2135
|
+
var _hashHas = hashHas;
|
|
2136
|
+
|
|
2137
|
+
/** Used to stand-in for `undefined` hash values. */
|
|
2138
|
+
var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
|
2139
|
+
|
|
2140
|
+
/**
|
|
2141
|
+
* Sets the hash `key` to `value`.
|
|
2142
|
+
*
|
|
2143
|
+
* @private
|
|
2144
|
+
* @name set
|
|
2145
|
+
* @memberOf Hash
|
|
2146
|
+
* @param {string} key The key of the value to set.
|
|
2147
|
+
* @param {*} value The value to set.
|
|
2148
|
+
* @returns {Object} Returns the hash instance.
|
|
2149
|
+
*/
|
|
2150
|
+
function hashSet(key, value) {
|
|
2151
|
+
var data = this.__data__;
|
|
2152
|
+
this.size += this.has(key) ? 0 : 1;
|
|
2153
|
+
data[key] = _nativeCreate && value === undefined ? HASH_UNDEFINED : value;
|
|
2154
|
+
return this;
|
|
2155
|
+
}
|
|
2156
|
+
var _hashSet = hashSet;
|
|
2157
|
+
|
|
2158
|
+
/**
|
|
2159
|
+
* Creates a hash object.
|
|
2160
|
+
*
|
|
2161
|
+
* @private
|
|
2162
|
+
* @constructor
|
|
2163
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
|
2164
|
+
*/
|
|
2165
|
+
function Hash(entries) {
|
|
2166
|
+
var index = -1,
|
|
2167
|
+
length = entries == null ? 0 : entries.length;
|
|
2168
|
+
this.clear();
|
|
2169
|
+
while (++index < length) {
|
|
2170
|
+
var entry = entries[index];
|
|
2171
|
+
this.set(entry[0], entry[1]);
|
|
2172
|
+
}
|
|
2173
|
+
}
|
|
2174
|
+
|
|
2175
|
+
// Add methods to `Hash`.
|
|
2176
|
+
Hash.prototype.clear = _hashClear;
|
|
2177
|
+
Hash.prototype['delete'] = _hashDelete;
|
|
2178
|
+
Hash.prototype.get = _hashGet;
|
|
2179
|
+
Hash.prototype.has = _hashHas;
|
|
2180
|
+
Hash.prototype.set = _hashSet;
|
|
2181
|
+
var _Hash = Hash;
|
|
2182
|
+
|
|
2183
|
+
/**
|
|
2184
|
+
* Removes all key-value entries from the map.
|
|
2185
|
+
*
|
|
2186
|
+
* @private
|
|
2187
|
+
* @name clear
|
|
2188
|
+
* @memberOf MapCache
|
|
2189
|
+
*/
|
|
2190
|
+
function mapCacheClear() {
|
|
2191
|
+
this.size = 0;
|
|
2192
|
+
this.__data__ = {
|
|
2193
|
+
'hash': new _Hash(),
|
|
2194
|
+
'map': new (_Map || _ListCache)(),
|
|
2195
|
+
'string': new _Hash()
|
|
2196
|
+
};
|
|
2197
|
+
}
|
|
2198
|
+
var _mapCacheClear = mapCacheClear;
|
|
2199
|
+
|
|
2200
|
+
/**
|
|
2201
|
+
* Checks if `value` is suitable for use as unique object key.
|
|
2202
|
+
*
|
|
2203
|
+
* @private
|
|
2204
|
+
* @param {*} value The value to check.
|
|
2205
|
+
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
|
|
2206
|
+
*/
|
|
2207
|
+
function isKeyable(value) {
|
|
2208
|
+
var type = typeof value;
|
|
2209
|
+
return type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean' ? value !== '__proto__' : value === null;
|
|
2210
|
+
}
|
|
2211
|
+
var _isKeyable = isKeyable;
|
|
2212
|
+
|
|
2213
|
+
/**
|
|
2214
|
+
* Gets the data for `map`.
|
|
2215
|
+
*
|
|
2216
|
+
* @private
|
|
2217
|
+
* @param {Object} map The map to query.
|
|
2218
|
+
* @param {string} key The reference key.
|
|
2219
|
+
* @returns {*} Returns the map data.
|
|
2220
|
+
*/
|
|
2221
|
+
function getMapData(map, key) {
|
|
2222
|
+
var data = map.__data__;
|
|
2223
|
+
return _isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map;
|
|
2224
|
+
}
|
|
2225
|
+
var _getMapData = getMapData;
|
|
2226
|
+
|
|
2227
|
+
/**
|
|
2228
|
+
* Removes `key` and its value from the map.
|
|
2229
|
+
*
|
|
2230
|
+
* @private
|
|
2231
|
+
* @name delete
|
|
2232
|
+
* @memberOf MapCache
|
|
2233
|
+
* @param {string} key The key of the value to remove.
|
|
2234
|
+
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
2235
|
+
*/
|
|
2236
|
+
function mapCacheDelete(key) {
|
|
2237
|
+
var result = _getMapData(this, key)['delete'](key);
|
|
2238
|
+
this.size -= result ? 1 : 0;
|
|
2239
|
+
return result;
|
|
2240
|
+
}
|
|
2241
|
+
var _mapCacheDelete = mapCacheDelete;
|
|
2242
|
+
|
|
2243
|
+
/**
|
|
2244
|
+
* Gets the map value for `key`.
|
|
2245
|
+
*
|
|
2246
|
+
* @private
|
|
2247
|
+
* @name get
|
|
2248
|
+
* @memberOf MapCache
|
|
2249
|
+
* @param {string} key The key of the value to get.
|
|
2250
|
+
* @returns {*} Returns the entry value.
|
|
2251
|
+
*/
|
|
2252
|
+
function mapCacheGet(key) {
|
|
2253
|
+
return _getMapData(this, key).get(key);
|
|
2254
|
+
}
|
|
2255
|
+
var _mapCacheGet = mapCacheGet;
|
|
2256
|
+
|
|
2257
|
+
/**
|
|
2258
|
+
* Checks if a map value for `key` exists.
|
|
2259
|
+
*
|
|
2260
|
+
* @private
|
|
2261
|
+
* @name has
|
|
2262
|
+
* @memberOf MapCache
|
|
2263
|
+
* @param {string} key The key of the entry to check.
|
|
2264
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
2265
|
+
*/
|
|
2266
|
+
function mapCacheHas(key) {
|
|
2267
|
+
return _getMapData(this, key).has(key);
|
|
2268
|
+
}
|
|
2269
|
+
var _mapCacheHas = mapCacheHas;
|
|
2270
|
+
|
|
2271
|
+
/**
|
|
2272
|
+
* Sets the map `key` to `value`.
|
|
2273
|
+
*
|
|
2274
|
+
* @private
|
|
2275
|
+
* @name set
|
|
2276
|
+
* @memberOf MapCache
|
|
2277
|
+
* @param {string} key The key of the value to set.
|
|
2278
|
+
* @param {*} value The value to set.
|
|
2279
|
+
* @returns {Object} Returns the map cache instance.
|
|
2280
|
+
*/
|
|
2281
|
+
function mapCacheSet(key, value) {
|
|
2282
|
+
var data = _getMapData(this, key),
|
|
2283
|
+
size = data.size;
|
|
2284
|
+
data.set(key, value);
|
|
2285
|
+
this.size += data.size == size ? 0 : 1;
|
|
2286
|
+
return this;
|
|
2287
|
+
}
|
|
2288
|
+
var _mapCacheSet = mapCacheSet;
|
|
2289
|
+
|
|
2290
|
+
/**
|
|
2291
|
+
* Creates a map cache object to store key-value pairs.
|
|
2292
|
+
*
|
|
2293
|
+
* @private
|
|
2294
|
+
* @constructor
|
|
2295
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
|
2296
|
+
*/
|
|
2297
|
+
function MapCache(entries) {
|
|
2298
|
+
var index = -1,
|
|
2299
|
+
length = entries == null ? 0 : entries.length;
|
|
2300
|
+
this.clear();
|
|
2301
|
+
while (++index < length) {
|
|
2302
|
+
var entry = entries[index];
|
|
2303
|
+
this.set(entry[0], entry[1]);
|
|
2304
|
+
}
|
|
2305
|
+
}
|
|
2306
|
+
|
|
2307
|
+
// Add methods to `MapCache`.
|
|
2308
|
+
MapCache.prototype.clear = _mapCacheClear;
|
|
2309
|
+
MapCache.prototype['delete'] = _mapCacheDelete;
|
|
2310
|
+
MapCache.prototype.get = _mapCacheGet;
|
|
2311
|
+
MapCache.prototype.has = _mapCacheHas;
|
|
2312
|
+
MapCache.prototype.set = _mapCacheSet;
|
|
2313
|
+
var _MapCache = MapCache;
|
|
2314
|
+
|
|
2315
|
+
/** Used as the size to enable large array optimizations. */
|
|
2316
|
+
var LARGE_ARRAY_SIZE = 200;
|
|
2317
|
+
|
|
2318
|
+
/**
|
|
2319
|
+
* Sets the stack `key` to `value`.
|
|
2320
|
+
*
|
|
2321
|
+
* @private
|
|
2322
|
+
* @name set
|
|
2323
|
+
* @memberOf Stack
|
|
2324
|
+
* @param {string} key The key of the value to set.
|
|
2325
|
+
* @param {*} value The value to set.
|
|
2326
|
+
* @returns {Object} Returns the stack cache instance.
|
|
2327
|
+
*/
|
|
2328
|
+
function stackSet(key, value) {
|
|
2329
|
+
var data = this.__data__;
|
|
2330
|
+
if (data instanceof _ListCache) {
|
|
2331
|
+
var pairs = data.__data__;
|
|
2332
|
+
if (!_Map || pairs.length < LARGE_ARRAY_SIZE - 1) {
|
|
2333
|
+
pairs.push([key, value]);
|
|
2334
|
+
this.size = ++data.size;
|
|
2335
|
+
return this;
|
|
2336
|
+
}
|
|
2337
|
+
data = this.__data__ = new _MapCache(pairs);
|
|
2338
|
+
}
|
|
2339
|
+
data.set(key, value);
|
|
2340
|
+
this.size = data.size;
|
|
2341
|
+
return this;
|
|
2342
|
+
}
|
|
2343
|
+
var _stackSet = stackSet;
|
|
2344
|
+
|
|
2345
|
+
/**
|
|
2346
|
+
* Creates a stack cache object to store key-value pairs.
|
|
2347
|
+
*
|
|
2348
|
+
* @private
|
|
2349
|
+
* @constructor
|
|
2350
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
|
2351
|
+
*/
|
|
2352
|
+
function Stack(entries) {
|
|
2353
|
+
var data = this.__data__ = new _ListCache(entries);
|
|
2354
|
+
this.size = data.size;
|
|
2355
|
+
}
|
|
2356
|
+
|
|
2357
|
+
// Add methods to `Stack`.
|
|
2358
|
+
Stack.prototype.clear = _stackClear;
|
|
2359
|
+
Stack.prototype['delete'] = _stackDelete;
|
|
2360
|
+
Stack.prototype.get = _stackGet;
|
|
2361
|
+
Stack.prototype.has = _stackHas;
|
|
2362
|
+
Stack.prototype.set = _stackSet;
|
|
2363
|
+
var _Stack = Stack;
|
|
2364
|
+
|
|
2365
|
+
var defineProperty = function () {
|
|
2366
|
+
try {
|
|
2367
|
+
var func = _getNative(Object, 'defineProperty');
|
|
2368
|
+
func({}, '', {});
|
|
2369
|
+
return func;
|
|
2370
|
+
} catch (e) {}
|
|
2371
|
+
}();
|
|
2372
|
+
var _defineProperty = defineProperty;
|
|
2373
|
+
|
|
2374
|
+
/**
|
|
2375
|
+
* The base implementation of `assignValue` and `assignMergeValue` without
|
|
2376
|
+
* value checks.
|
|
2377
|
+
*
|
|
2378
|
+
* @private
|
|
2379
|
+
* @param {Object} object The object to modify.
|
|
2380
|
+
* @param {string} key The key of the property to assign.
|
|
2381
|
+
* @param {*} value The value to assign.
|
|
2382
|
+
*/
|
|
2383
|
+
function baseAssignValue(object, key, value) {
|
|
2384
|
+
if (key == '__proto__' && _defineProperty) {
|
|
2385
|
+
_defineProperty(object, key, {
|
|
2386
|
+
'configurable': true,
|
|
2387
|
+
'enumerable': true,
|
|
2388
|
+
'value': value,
|
|
2389
|
+
'writable': true
|
|
2390
|
+
});
|
|
2391
|
+
} else {
|
|
2392
|
+
object[key] = value;
|
|
2393
|
+
}
|
|
2394
|
+
}
|
|
2395
|
+
var _baseAssignValue = baseAssignValue;
|
|
2396
|
+
|
|
2397
|
+
/**
|
|
2398
|
+
* This function is like `assignValue` except that it doesn't assign
|
|
2399
|
+
* `undefined` values.
|
|
2400
|
+
*
|
|
2401
|
+
* @private
|
|
2402
|
+
* @param {Object} object The object to modify.
|
|
2403
|
+
* @param {string} key The key of the property to assign.
|
|
2404
|
+
* @param {*} value The value to assign.
|
|
2405
|
+
*/
|
|
2406
|
+
function assignMergeValue(object, key, value) {
|
|
2407
|
+
if (value !== undefined && !eq_1(object[key], value) || value === undefined && !(key in object)) {
|
|
2408
|
+
_baseAssignValue(object, key, value);
|
|
2409
|
+
}
|
|
2410
|
+
}
|
|
2411
|
+
var _assignMergeValue = assignMergeValue;
|
|
2412
|
+
|
|
2413
|
+
/**
|
|
2414
|
+
* Creates a base function for methods like `_.forIn` and `_.forOwn`.
|
|
2415
|
+
*
|
|
2416
|
+
* @private
|
|
2417
|
+
* @param {boolean} [fromRight] Specify iterating from right to left.
|
|
2418
|
+
* @returns {Function} Returns the new base function.
|
|
2419
|
+
*/
|
|
2420
|
+
function createBaseFor(fromRight) {
|
|
2421
|
+
return function (object, iteratee, keysFunc) {
|
|
2422
|
+
var index = -1,
|
|
2423
|
+
iterable = Object(object),
|
|
2424
|
+
props = keysFunc(object),
|
|
2425
|
+
length = props.length;
|
|
2426
|
+
while (length--) {
|
|
2427
|
+
var key = props[fromRight ? length : ++index];
|
|
2428
|
+
if (iteratee(iterable[key], key, iterable) === false) {
|
|
2429
|
+
break;
|
|
2430
|
+
}
|
|
2431
|
+
}
|
|
2432
|
+
return object;
|
|
2433
|
+
};
|
|
2434
|
+
}
|
|
2435
|
+
var _createBaseFor = createBaseFor;
|
|
2436
|
+
|
|
2437
|
+
/**
|
|
2438
|
+
* The base implementation of `baseForOwn` which iterates over `object`
|
|
2439
|
+
* properties returned by `keysFunc` and invokes `iteratee` for each property.
|
|
2440
|
+
* Iteratee functions may exit iteration early by explicitly returning `false`.
|
|
2441
|
+
*
|
|
2442
|
+
* @private
|
|
2443
|
+
* @param {Object} object The object to iterate over.
|
|
2444
|
+
* @param {Function} iteratee The function invoked per iteration.
|
|
2445
|
+
* @param {Function} keysFunc The function to get the keys of `object`.
|
|
2446
|
+
* @returns {Object} Returns `object`.
|
|
2447
|
+
*/
|
|
2448
|
+
var baseFor = _createBaseFor();
|
|
2449
|
+
var _baseFor = baseFor;
|
|
2450
|
+
|
|
2451
|
+
var _cloneBuffer = createCommonjsModule(function (module, exports) {
|
|
2452
|
+
/** Detect free variable `exports`. */
|
|
2453
|
+
var freeExports = exports && !exports.nodeType && exports;
|
|
2454
|
+
|
|
2455
|
+
/** Detect free variable `module`. */
|
|
2456
|
+
var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
|
|
2457
|
+
|
|
2458
|
+
/** Detect the popular CommonJS extension `module.exports`. */
|
|
2459
|
+
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
2460
|
+
|
|
2461
|
+
/** Built-in value references. */
|
|
2462
|
+
var Buffer = moduleExports ? _root.Buffer : undefined,
|
|
2463
|
+
allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
|
|
2464
|
+
|
|
2465
|
+
/**
|
|
2466
|
+
* Creates a clone of `buffer`.
|
|
2467
|
+
*
|
|
2468
|
+
* @private
|
|
2469
|
+
* @param {Buffer} buffer The buffer to clone.
|
|
2470
|
+
* @param {boolean} [isDeep] Specify a deep clone.
|
|
2471
|
+
* @returns {Buffer} Returns the cloned buffer.
|
|
2472
|
+
*/
|
|
2473
|
+
function cloneBuffer(buffer, isDeep) {
|
|
2474
|
+
if (isDeep) {
|
|
2475
|
+
return buffer.slice();
|
|
2476
|
+
}
|
|
2477
|
+
var length = buffer.length,
|
|
2478
|
+
result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
|
|
2479
|
+
buffer.copy(result);
|
|
2480
|
+
return result;
|
|
2481
|
+
}
|
|
2482
|
+
module.exports = cloneBuffer;
|
|
2483
|
+
});
|
|
2484
|
+
|
|
2485
|
+
/** Built-in value references. */
|
|
2486
|
+
var Uint8Array = _root.Uint8Array;
|
|
2487
|
+
var _Uint8Array = Uint8Array;
|
|
2488
|
+
|
|
2489
|
+
/**
|
|
2490
|
+
* Creates a clone of `arrayBuffer`.
|
|
2491
|
+
*
|
|
2492
|
+
* @private
|
|
2493
|
+
* @param {ArrayBuffer} arrayBuffer The array buffer to clone.
|
|
2494
|
+
* @returns {ArrayBuffer} Returns the cloned array buffer.
|
|
2495
|
+
*/
|
|
2496
|
+
function cloneArrayBuffer(arrayBuffer) {
|
|
2497
|
+
var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
|
|
2498
|
+
new _Uint8Array(result).set(new _Uint8Array(arrayBuffer));
|
|
2499
|
+
return result;
|
|
2500
|
+
}
|
|
2501
|
+
var _cloneArrayBuffer = cloneArrayBuffer;
|
|
2502
|
+
|
|
2503
|
+
/**
|
|
2504
|
+
* Creates a clone of `typedArray`.
|
|
2505
|
+
*
|
|
2506
|
+
* @private
|
|
2507
|
+
* @param {Object} typedArray The typed array to clone.
|
|
2508
|
+
* @param {boolean} [isDeep] Specify a deep clone.
|
|
2509
|
+
* @returns {Object} Returns the cloned typed array.
|
|
2510
|
+
*/
|
|
2511
|
+
function cloneTypedArray(typedArray, isDeep) {
|
|
2512
|
+
var buffer = isDeep ? _cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
|
|
2513
|
+
return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
|
|
2514
|
+
}
|
|
2515
|
+
var _cloneTypedArray = cloneTypedArray;
|
|
2516
|
+
|
|
2517
|
+
/**
|
|
2518
|
+
* Copies the values of `source` to `array`.
|
|
2519
|
+
*
|
|
2520
|
+
* @private
|
|
2521
|
+
* @param {Array} source The array to copy values from.
|
|
2522
|
+
* @param {Array} [array=[]] The array to copy values to.
|
|
2523
|
+
* @returns {Array} Returns `array`.
|
|
2524
|
+
*/
|
|
2525
|
+
function copyArray(source, array) {
|
|
2526
|
+
var index = -1,
|
|
2527
|
+
length = source.length;
|
|
2528
|
+
array || (array = Array(length));
|
|
2529
|
+
while (++index < length) {
|
|
2530
|
+
array[index] = source[index];
|
|
2531
|
+
}
|
|
2532
|
+
return array;
|
|
2533
|
+
}
|
|
2534
|
+
var _copyArray = copyArray;
|
|
2535
|
+
|
|
2536
|
+
/** Built-in value references. */
|
|
2537
|
+
var objectCreate = Object.create;
|
|
2538
|
+
|
|
2539
|
+
/**
|
|
2540
|
+
* The base implementation of `_.create` without support for assigning
|
|
2541
|
+
* properties to the created object.
|
|
2542
|
+
*
|
|
2543
|
+
* @private
|
|
2544
|
+
* @param {Object} proto The object to inherit from.
|
|
2545
|
+
* @returns {Object} Returns the new object.
|
|
2546
|
+
*/
|
|
2547
|
+
var baseCreate = function () {
|
|
2548
|
+
function object() {}
|
|
2549
|
+
return function (proto) {
|
|
2550
|
+
if (!isObject_1(proto)) {
|
|
2551
|
+
return {};
|
|
2552
|
+
}
|
|
2553
|
+
if (objectCreate) {
|
|
2554
|
+
return objectCreate(proto);
|
|
2555
|
+
}
|
|
2556
|
+
object.prototype = proto;
|
|
2557
|
+
var result = new object();
|
|
2558
|
+
object.prototype = undefined;
|
|
2559
|
+
return result;
|
|
2560
|
+
};
|
|
2561
|
+
}();
|
|
2562
|
+
var _baseCreate = baseCreate;
|
|
2563
|
+
|
|
2564
|
+
/**
|
|
2565
|
+
* Creates a unary function that invokes `func` with its argument transformed.
|
|
2566
|
+
*
|
|
2567
|
+
* @private
|
|
2568
|
+
* @param {Function} func The function to wrap.
|
|
2569
|
+
* @param {Function} transform The argument transform.
|
|
2570
|
+
* @returns {Function} Returns the new function.
|
|
2571
|
+
*/
|
|
2572
|
+
function overArg(func, transform) {
|
|
2573
|
+
return function (arg) {
|
|
2574
|
+
return func(transform(arg));
|
|
2575
|
+
};
|
|
2576
|
+
}
|
|
2577
|
+
var _overArg = overArg;
|
|
2578
|
+
|
|
2579
|
+
/** Built-in value references. */
|
|
2580
|
+
var getPrototype = _overArg(Object.getPrototypeOf, Object);
|
|
2581
|
+
var _getPrototype = getPrototype;
|
|
2582
|
+
|
|
2583
|
+
/** Used for built-in method references. */
|
|
2584
|
+
var objectProto$5 = Object.prototype;
|
|
2585
|
+
|
|
2586
|
+
/**
|
|
2587
|
+
* Checks if `value` is likely a prototype object.
|
|
2588
|
+
*
|
|
2589
|
+
* @private
|
|
2590
|
+
* @param {*} value The value to check.
|
|
2591
|
+
* @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
|
|
2592
|
+
*/
|
|
2593
|
+
function isPrototype(value) {
|
|
2594
|
+
var Ctor = value && value.constructor,
|
|
2595
|
+
proto = typeof Ctor == 'function' && Ctor.prototype || objectProto$5;
|
|
2596
|
+
return value === proto;
|
|
2597
|
+
}
|
|
2598
|
+
var _isPrototype = isPrototype;
|
|
2599
|
+
|
|
2600
|
+
/**
|
|
2601
|
+
* Initializes an object clone.
|
|
2602
|
+
*
|
|
2603
|
+
* @private
|
|
2604
|
+
* @param {Object} object The object to clone.
|
|
2605
|
+
* @returns {Object} Returns the initialized clone.
|
|
2606
|
+
*/
|
|
2607
|
+
function initCloneObject(object) {
|
|
2608
|
+
return typeof object.constructor == 'function' && !_isPrototype(object) ? _baseCreate(_getPrototype(object)) : {};
|
|
2609
|
+
}
|
|
2610
|
+
var _initCloneObject = initCloneObject;
|
|
2611
|
+
|
|
2612
|
+
/**
|
|
2613
|
+
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
2614
|
+
* and has a `typeof` result of "object".
|
|
2615
|
+
*
|
|
2616
|
+
* @static
|
|
2617
|
+
* @memberOf _
|
|
2618
|
+
* @since 4.0.0
|
|
2619
|
+
* @category Lang
|
|
2620
|
+
* @param {*} value The value to check.
|
|
2621
|
+
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
|
2622
|
+
* @example
|
|
2623
|
+
*
|
|
2624
|
+
* _.isObjectLike({});
|
|
2625
|
+
* // => true
|
|
2626
|
+
*
|
|
2627
|
+
* _.isObjectLike([1, 2, 3]);
|
|
2628
|
+
* // => true
|
|
2629
|
+
*
|
|
2630
|
+
* _.isObjectLike(_.noop);
|
|
2631
|
+
* // => false
|
|
2632
|
+
*
|
|
2633
|
+
* _.isObjectLike(null);
|
|
2634
|
+
* // => false
|
|
2635
|
+
*/
|
|
2636
|
+
function isObjectLike(value) {
|
|
2637
|
+
return value != null && typeof value == 'object';
|
|
2638
|
+
}
|
|
2639
|
+
var isObjectLike_1 = isObjectLike;
|
|
2640
|
+
|
|
2641
|
+
/** `Object#toString` result references. */
|
|
2642
|
+
var argsTag$1 = '[object Arguments]';
|
|
2643
|
+
|
|
2644
|
+
/**
|
|
2645
|
+
* The base implementation of `_.isArguments`.
|
|
2646
|
+
*
|
|
2647
|
+
* @private
|
|
2648
|
+
* @param {*} value The value to check.
|
|
2649
|
+
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
|
|
2650
|
+
*/
|
|
2651
|
+
function baseIsArguments(value) {
|
|
2652
|
+
return isObjectLike_1(value) && _baseGetTag(value) == argsTag$1;
|
|
2653
|
+
}
|
|
2654
|
+
var _baseIsArguments = baseIsArguments;
|
|
2655
|
+
|
|
2656
|
+
/** Used for built-in method references. */
|
|
2657
|
+
var objectProto$4 = Object.prototype;
|
|
2658
|
+
|
|
2659
|
+
/** Used to check objects for own properties. */
|
|
2660
|
+
var hasOwnProperty$4 = objectProto$4.hasOwnProperty;
|
|
2661
|
+
|
|
2662
|
+
/** Built-in value references. */
|
|
2663
|
+
var propertyIsEnumerable = objectProto$4.propertyIsEnumerable;
|
|
2664
|
+
|
|
2665
|
+
/**
|
|
2666
|
+
* Checks if `value` is likely an `arguments` object.
|
|
2667
|
+
*
|
|
2668
|
+
* @static
|
|
2669
|
+
* @memberOf _
|
|
2670
|
+
* @since 0.1.0
|
|
2671
|
+
* @category Lang
|
|
2672
|
+
* @param {*} value The value to check.
|
|
2673
|
+
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
|
|
2674
|
+
* else `false`.
|
|
2675
|
+
* @example
|
|
2676
|
+
*
|
|
2677
|
+
* _.isArguments(function() { return arguments; }());
|
|
2678
|
+
* // => true
|
|
2679
|
+
*
|
|
2680
|
+
* _.isArguments([1, 2, 3]);
|
|
2681
|
+
* // => false
|
|
2682
|
+
*/
|
|
2683
|
+
var isArguments = _baseIsArguments(function () {
|
|
2684
|
+
return arguments;
|
|
2685
|
+
}()) ? _baseIsArguments : function (value) {
|
|
2686
|
+
return isObjectLike_1(value) && hasOwnProperty$4.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee');
|
|
2687
|
+
};
|
|
2688
|
+
var isArguments_1 = isArguments;
|
|
2689
|
+
|
|
2690
|
+
/**
|
|
2691
|
+
* Checks if `value` is classified as an `Array` object.
|
|
2692
|
+
*
|
|
2693
|
+
* @static
|
|
2694
|
+
* @memberOf _
|
|
2695
|
+
* @since 0.1.0
|
|
2696
|
+
* @category Lang
|
|
2697
|
+
* @param {*} value The value to check.
|
|
2698
|
+
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
|
|
2699
|
+
* @example
|
|
2700
|
+
*
|
|
2701
|
+
* _.isArray([1, 2, 3]);
|
|
2702
|
+
* // => true
|
|
2703
|
+
*
|
|
2704
|
+
* _.isArray(document.body.children);
|
|
2705
|
+
* // => false
|
|
2706
|
+
*
|
|
2707
|
+
* _.isArray('abc');
|
|
2708
|
+
* // => false
|
|
2709
|
+
*
|
|
2710
|
+
* _.isArray(_.noop);
|
|
2711
|
+
* // => false
|
|
2712
|
+
*/
|
|
2713
|
+
var isArray = Array.isArray;
|
|
2714
|
+
var isArray_1 = isArray;
|
|
2715
|
+
|
|
2716
|
+
/** Used as references for various `Number` constants. */
|
|
2717
|
+
var MAX_SAFE_INTEGER$1 = 9007199254740991;
|
|
2718
|
+
|
|
2719
|
+
/**
|
|
2720
|
+
* Checks if `value` is a valid array-like length.
|
|
2721
|
+
*
|
|
2722
|
+
* **Note:** This method is loosely based on
|
|
2723
|
+
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
|
|
2724
|
+
*
|
|
2725
|
+
* @static
|
|
2726
|
+
* @memberOf _
|
|
2727
|
+
* @since 4.0.0
|
|
2728
|
+
* @category Lang
|
|
2729
|
+
* @param {*} value The value to check.
|
|
2730
|
+
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
|
|
2731
|
+
* @example
|
|
2732
|
+
*
|
|
2733
|
+
* _.isLength(3);
|
|
2734
|
+
* // => true
|
|
2735
|
+
*
|
|
2736
|
+
* _.isLength(Number.MIN_VALUE);
|
|
2737
|
+
* // => false
|
|
2738
|
+
*
|
|
2739
|
+
* _.isLength(Infinity);
|
|
2740
|
+
* // => false
|
|
2741
|
+
*
|
|
2742
|
+
* _.isLength('3');
|
|
2743
|
+
* // => false
|
|
2744
|
+
*/
|
|
2745
|
+
function isLength(value) {
|
|
2746
|
+
return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER$1;
|
|
2747
|
+
}
|
|
2748
|
+
var isLength_1 = isLength;
|
|
2749
|
+
|
|
2750
|
+
/**
|
|
2751
|
+
* Checks if `value` is array-like. A value is considered array-like if it's
|
|
2752
|
+
* not a function and has a `value.length` that's an integer greater than or
|
|
2753
|
+
* equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
|
|
2754
|
+
*
|
|
2755
|
+
* @static
|
|
2756
|
+
* @memberOf _
|
|
2757
|
+
* @since 4.0.0
|
|
2758
|
+
* @category Lang
|
|
2759
|
+
* @param {*} value The value to check.
|
|
2760
|
+
* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
|
|
2761
|
+
* @example
|
|
2762
|
+
*
|
|
2763
|
+
* _.isArrayLike([1, 2, 3]);
|
|
2764
|
+
* // => true
|
|
2765
|
+
*
|
|
2766
|
+
* _.isArrayLike(document.body.children);
|
|
2767
|
+
* // => true
|
|
2768
|
+
*
|
|
2769
|
+
* _.isArrayLike('abc');
|
|
2770
|
+
* // => true
|
|
2771
|
+
*
|
|
2772
|
+
* _.isArrayLike(_.noop);
|
|
2773
|
+
* // => false
|
|
2774
|
+
*/
|
|
2775
|
+
function isArrayLike(value) {
|
|
2776
|
+
return value != null && isLength_1(value.length) && !isFunction_1(value);
|
|
2777
|
+
}
|
|
2778
|
+
var isArrayLike_1 = isArrayLike;
|
|
2779
|
+
|
|
2780
|
+
/**
|
|
2781
|
+
* This method is like `_.isArrayLike` except that it also checks if `value`
|
|
2782
|
+
* is an object.
|
|
2783
|
+
*
|
|
2784
|
+
* @static
|
|
2785
|
+
* @memberOf _
|
|
2786
|
+
* @since 4.0.0
|
|
2787
|
+
* @category Lang
|
|
2788
|
+
* @param {*} value The value to check.
|
|
2789
|
+
* @returns {boolean} Returns `true` if `value` is an array-like object,
|
|
2790
|
+
* else `false`.
|
|
2791
|
+
* @example
|
|
2792
|
+
*
|
|
2793
|
+
* _.isArrayLikeObject([1, 2, 3]);
|
|
2794
|
+
* // => true
|
|
2795
|
+
*
|
|
2796
|
+
* _.isArrayLikeObject(document.body.children);
|
|
2797
|
+
* // => true
|
|
2798
|
+
*
|
|
2799
|
+
* _.isArrayLikeObject('abc');
|
|
2800
|
+
* // => false
|
|
2801
|
+
*
|
|
2802
|
+
* _.isArrayLikeObject(_.noop);
|
|
2803
|
+
* // => false
|
|
2804
|
+
*/
|
|
2805
|
+
function isArrayLikeObject(value) {
|
|
2806
|
+
return isObjectLike_1(value) && isArrayLike_1(value);
|
|
2807
|
+
}
|
|
2808
|
+
var isArrayLikeObject_1 = isArrayLikeObject;
|
|
2809
|
+
|
|
2810
|
+
/**
|
|
2811
|
+
* This method returns `false`.
|
|
2812
|
+
*
|
|
2813
|
+
* @static
|
|
2814
|
+
* @memberOf _
|
|
2815
|
+
* @since 4.13.0
|
|
2816
|
+
* @category Util
|
|
2817
|
+
* @returns {boolean} Returns `false`.
|
|
2818
|
+
* @example
|
|
2819
|
+
*
|
|
2820
|
+
* _.times(2, _.stubFalse);
|
|
2821
|
+
* // => [false, false]
|
|
2822
|
+
*/
|
|
2823
|
+
function stubFalse() {
|
|
2824
|
+
return false;
|
|
2825
|
+
}
|
|
2826
|
+
var stubFalse_1 = stubFalse;
|
|
2827
|
+
|
|
2828
|
+
var isBuffer_1 = createCommonjsModule(function (module, exports) {
|
|
2829
|
+
/** Detect free variable `exports`. */
|
|
2830
|
+
var freeExports = exports && !exports.nodeType && exports;
|
|
2831
|
+
|
|
2832
|
+
/** Detect free variable `module`. */
|
|
2833
|
+
var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
|
|
2834
|
+
|
|
2835
|
+
/** Detect the popular CommonJS extension `module.exports`. */
|
|
2836
|
+
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
2837
|
+
|
|
2838
|
+
/** Built-in value references. */
|
|
2839
|
+
var Buffer = moduleExports ? _root.Buffer : undefined;
|
|
2840
|
+
|
|
2841
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
2842
|
+
var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
|
|
2843
|
+
|
|
2844
|
+
/**
|
|
2845
|
+
* Checks if `value` is a buffer.
|
|
2846
|
+
*
|
|
2847
|
+
* @static
|
|
2848
|
+
* @memberOf _
|
|
2849
|
+
* @since 4.3.0
|
|
2850
|
+
* @category Lang
|
|
2851
|
+
* @param {*} value The value to check.
|
|
2852
|
+
* @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
|
|
2853
|
+
* @example
|
|
2854
|
+
*
|
|
2855
|
+
* _.isBuffer(new Buffer(2));
|
|
2856
|
+
* // => true
|
|
2857
|
+
*
|
|
2858
|
+
* _.isBuffer(new Uint8Array(2));
|
|
2859
|
+
* // => false
|
|
2860
|
+
*/
|
|
2861
|
+
var isBuffer = nativeIsBuffer || stubFalse_1;
|
|
2862
|
+
module.exports = isBuffer;
|
|
2863
|
+
});
|
|
2864
|
+
|
|
2865
|
+
/** `Object#toString` result references. */
|
|
2866
|
+
var objectTag$1 = '[object Object]';
|
|
2867
|
+
|
|
2868
|
+
/** Used for built-in method references. */
|
|
2869
|
+
var funcProto = Function.prototype,
|
|
2870
|
+
objectProto$3 = Object.prototype;
|
|
2871
|
+
|
|
2872
|
+
/** Used to resolve the decompiled source of functions. */
|
|
2873
|
+
var funcToString = funcProto.toString;
|
|
2874
|
+
|
|
2875
|
+
/** Used to check objects for own properties. */
|
|
2876
|
+
var hasOwnProperty$3 = objectProto$3.hasOwnProperty;
|
|
2877
|
+
|
|
2878
|
+
/** Used to infer the `Object` constructor. */
|
|
2879
|
+
var objectCtorString = funcToString.call(Object);
|
|
2880
|
+
|
|
2881
|
+
/**
|
|
2882
|
+
* Checks if `value` is a plain object, that is, an object created by the
|
|
2883
|
+
* `Object` constructor or one with a `[[Prototype]]` of `null`.
|
|
2884
|
+
*
|
|
2885
|
+
* @static
|
|
2886
|
+
* @memberOf _
|
|
2887
|
+
* @since 0.8.0
|
|
2888
|
+
* @category Lang
|
|
2889
|
+
* @param {*} value The value to check.
|
|
2890
|
+
* @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
|
|
2891
|
+
* @example
|
|
2892
|
+
*
|
|
2893
|
+
* function Foo() {
|
|
2894
|
+
* this.a = 1;
|
|
2895
|
+
* }
|
|
2896
|
+
*
|
|
2897
|
+
* _.isPlainObject(new Foo);
|
|
2898
|
+
* // => false
|
|
2899
|
+
*
|
|
2900
|
+
* _.isPlainObject([1, 2, 3]);
|
|
2901
|
+
* // => false
|
|
2902
|
+
*
|
|
2903
|
+
* _.isPlainObject({ 'x': 0, 'y': 0 });
|
|
2904
|
+
* // => true
|
|
2905
|
+
*
|
|
2906
|
+
* _.isPlainObject(Object.create(null));
|
|
2907
|
+
* // => true
|
|
2908
|
+
*/
|
|
2909
|
+
function isPlainObject(value) {
|
|
2910
|
+
if (!isObjectLike_1(value) || _baseGetTag(value) != objectTag$1) {
|
|
2911
|
+
return false;
|
|
2912
|
+
}
|
|
2913
|
+
var proto = _getPrototype(value);
|
|
2914
|
+
if (proto === null) {
|
|
2915
|
+
return true;
|
|
2916
|
+
}
|
|
2917
|
+
var Ctor = hasOwnProperty$3.call(proto, 'constructor') && proto.constructor;
|
|
2918
|
+
return typeof Ctor == 'function' && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
|
|
2919
|
+
}
|
|
2920
|
+
var isPlainObject_1 = isPlainObject;
|
|
2921
|
+
|
|
2922
|
+
/** `Object#toString` result references. */
|
|
2923
|
+
var argsTag = '[object Arguments]',
|
|
2924
|
+
arrayTag = '[object Array]',
|
|
2925
|
+
boolTag = '[object Boolean]',
|
|
2926
|
+
dateTag = '[object Date]',
|
|
2927
|
+
errorTag = '[object Error]',
|
|
2928
|
+
funcTag = '[object Function]',
|
|
2929
|
+
mapTag = '[object Map]',
|
|
2930
|
+
numberTag = '[object Number]',
|
|
2931
|
+
objectTag = '[object Object]',
|
|
2932
|
+
regexpTag = '[object RegExp]',
|
|
2933
|
+
setTag = '[object Set]',
|
|
2934
|
+
stringTag = '[object String]',
|
|
2935
|
+
weakMapTag = '[object WeakMap]';
|
|
2936
|
+
var arrayBufferTag = '[object ArrayBuffer]',
|
|
2937
|
+
dataViewTag = '[object DataView]',
|
|
2938
|
+
float32Tag = '[object Float32Array]',
|
|
2939
|
+
float64Tag = '[object Float64Array]',
|
|
2940
|
+
int8Tag = '[object Int8Array]',
|
|
2941
|
+
int16Tag = '[object Int16Array]',
|
|
2942
|
+
int32Tag = '[object Int32Array]',
|
|
2943
|
+
uint8Tag = '[object Uint8Array]',
|
|
2944
|
+
uint8ClampedTag = '[object Uint8ClampedArray]',
|
|
2945
|
+
uint16Tag = '[object Uint16Array]',
|
|
2946
|
+
uint32Tag = '[object Uint32Array]';
|
|
2947
|
+
|
|
2948
|
+
/** Used to identify `toStringTag` values of typed arrays. */
|
|
2949
|
+
var typedArrayTags = {};
|
|
2950
|
+
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
|
|
2951
|
+
typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
|
|
2952
|
+
|
|
2953
|
+
/**
|
|
2954
|
+
* The base implementation of `_.isTypedArray` without Node.js optimizations.
|
|
2955
|
+
*
|
|
2956
|
+
* @private
|
|
2957
|
+
* @param {*} value The value to check.
|
|
2958
|
+
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
|
|
2959
|
+
*/
|
|
2960
|
+
function baseIsTypedArray(value) {
|
|
2961
|
+
return isObjectLike_1(value) && isLength_1(value.length) && !!typedArrayTags[_baseGetTag(value)];
|
|
2962
|
+
}
|
|
2963
|
+
var _baseIsTypedArray = baseIsTypedArray;
|
|
2964
|
+
|
|
2965
|
+
/**
|
|
2966
|
+
* The base implementation of `_.unary` without support for storing metadata.
|
|
2967
|
+
*
|
|
2968
|
+
* @private
|
|
2969
|
+
* @param {Function} func The function to cap arguments for.
|
|
2970
|
+
* @returns {Function} Returns the new capped function.
|
|
2971
|
+
*/
|
|
2972
|
+
function baseUnary(func) {
|
|
2973
|
+
return function (value) {
|
|
2974
|
+
return func(value);
|
|
2975
|
+
};
|
|
2976
|
+
}
|
|
2977
|
+
var _baseUnary = baseUnary;
|
|
2978
|
+
|
|
2979
|
+
var _nodeUtil = createCommonjsModule(function (module, exports) {
|
|
2980
|
+
/** Detect free variable `exports`. */
|
|
2981
|
+
var freeExports = exports && !exports.nodeType && exports;
|
|
2982
|
+
|
|
2983
|
+
/** Detect free variable `module`. */
|
|
2984
|
+
var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
|
|
2985
|
+
|
|
2986
|
+
/** Detect the popular CommonJS extension `module.exports`. */
|
|
2987
|
+
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
2988
|
+
|
|
2989
|
+
/** Detect free variable `process` from Node.js. */
|
|
2990
|
+
var freeProcess = moduleExports && _freeGlobal.process;
|
|
2991
|
+
|
|
2992
|
+
/** Used to access faster Node.js helpers. */
|
|
2993
|
+
var nodeUtil = function () {
|
|
2994
|
+
try {
|
|
2995
|
+
// Use `util.types` for Node.js 10+.
|
|
2996
|
+
var types = freeModule && freeModule.require && freeModule.require('util').types;
|
|
2997
|
+
if (types) {
|
|
2998
|
+
return types;
|
|
2999
|
+
}
|
|
3000
|
+
|
|
3001
|
+
// Legacy `process.binding('util')` for Node.js < 10.
|
|
3002
|
+
return freeProcess && freeProcess.binding && freeProcess.binding('util');
|
|
3003
|
+
} catch (e) {}
|
|
3004
|
+
}();
|
|
3005
|
+
module.exports = nodeUtil;
|
|
3006
|
+
});
|
|
3007
|
+
|
|
3008
|
+
/* Node.js helper references. */
|
|
3009
|
+
var nodeIsTypedArray = _nodeUtil && _nodeUtil.isTypedArray;
|
|
3010
|
+
|
|
3011
|
+
/**
|
|
3012
|
+
* Checks if `value` is classified as a typed array.
|
|
3013
|
+
*
|
|
3014
|
+
* @static
|
|
3015
|
+
* @memberOf _
|
|
3016
|
+
* @since 3.0.0
|
|
3017
|
+
* @category Lang
|
|
3018
|
+
* @param {*} value The value to check.
|
|
3019
|
+
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
|
|
3020
|
+
* @example
|
|
3021
|
+
*
|
|
3022
|
+
* _.isTypedArray(new Uint8Array);
|
|
3023
|
+
* // => true
|
|
3024
|
+
*
|
|
3025
|
+
* _.isTypedArray([]);
|
|
3026
|
+
* // => false
|
|
3027
|
+
*/
|
|
3028
|
+
var isTypedArray = nodeIsTypedArray ? _baseUnary(nodeIsTypedArray) : _baseIsTypedArray;
|
|
3029
|
+
var isTypedArray_1 = isTypedArray;
|
|
3030
|
+
|
|
3031
|
+
/**
|
|
3032
|
+
* Gets the value at `key`, unless `key` is "__proto__" or "constructor".
|
|
3033
|
+
*
|
|
3034
|
+
* @private
|
|
3035
|
+
* @param {Object} object The object to query.
|
|
3036
|
+
* @param {string} key The key of the property to get.
|
|
3037
|
+
* @returns {*} Returns the property value.
|
|
3038
|
+
*/
|
|
3039
|
+
function safeGet(object, key) {
|
|
3040
|
+
if (key === 'constructor' && typeof object[key] === 'function') {
|
|
3041
|
+
return;
|
|
3042
|
+
}
|
|
3043
|
+
if (key == '__proto__') {
|
|
3044
|
+
return;
|
|
3045
|
+
}
|
|
3046
|
+
return object[key];
|
|
3047
|
+
}
|
|
3048
|
+
var _safeGet = safeGet;
|
|
3049
|
+
|
|
3050
|
+
/** Used for built-in method references. */
|
|
3051
|
+
var objectProto$2 = Object.prototype;
|
|
3052
|
+
|
|
3053
|
+
/** Used to check objects for own properties. */
|
|
3054
|
+
var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
|
|
3055
|
+
|
|
3056
|
+
/**
|
|
3057
|
+
* Assigns `value` to `key` of `object` if the existing value is not equivalent
|
|
3058
|
+
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
|
3059
|
+
* for equality comparisons.
|
|
3060
|
+
*
|
|
3061
|
+
* @private
|
|
3062
|
+
* @param {Object} object The object to modify.
|
|
3063
|
+
* @param {string} key The key of the property to assign.
|
|
3064
|
+
* @param {*} value The value to assign.
|
|
3065
|
+
*/
|
|
3066
|
+
function assignValue(object, key, value) {
|
|
3067
|
+
var objValue = object[key];
|
|
3068
|
+
if (!(hasOwnProperty$2.call(object, key) && eq_1(objValue, value)) || value === undefined && !(key in object)) {
|
|
3069
|
+
_baseAssignValue(object, key, value);
|
|
3070
|
+
}
|
|
3071
|
+
}
|
|
3072
|
+
var _assignValue = assignValue;
|
|
3073
|
+
|
|
3074
|
+
/**
|
|
3075
|
+
* Copies properties of `source` to `object`.
|
|
3076
|
+
*
|
|
3077
|
+
* @private
|
|
3078
|
+
* @param {Object} source The object to copy properties from.
|
|
3079
|
+
* @param {Array} props The property identifiers to copy.
|
|
3080
|
+
* @param {Object} [object={}] The object to copy properties to.
|
|
3081
|
+
* @param {Function} [customizer] The function to customize copied values.
|
|
3082
|
+
* @returns {Object} Returns `object`.
|
|
3083
|
+
*/
|
|
3084
|
+
function copyObject(source, props, object, customizer) {
|
|
3085
|
+
var isNew = !object;
|
|
3086
|
+
object || (object = {});
|
|
3087
|
+
var index = -1,
|
|
3088
|
+
length = props.length;
|
|
3089
|
+
while (++index < length) {
|
|
3090
|
+
var key = props[index];
|
|
3091
|
+
var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined;
|
|
3092
|
+
if (newValue === undefined) {
|
|
3093
|
+
newValue = source[key];
|
|
3094
|
+
}
|
|
3095
|
+
if (isNew) {
|
|
3096
|
+
_baseAssignValue(object, key, newValue);
|
|
3097
|
+
} else {
|
|
3098
|
+
_assignValue(object, key, newValue);
|
|
3099
|
+
}
|
|
3100
|
+
}
|
|
3101
|
+
return object;
|
|
3102
|
+
}
|
|
3103
|
+
var _copyObject = copyObject;
|
|
3104
|
+
|
|
3105
|
+
/**
|
|
3106
|
+
* The base implementation of `_.times` without support for iteratee shorthands
|
|
3107
|
+
* or max array length checks.
|
|
3108
|
+
*
|
|
3109
|
+
* @private
|
|
3110
|
+
* @param {number} n The number of times to invoke `iteratee`.
|
|
3111
|
+
* @param {Function} iteratee The function invoked per iteration.
|
|
3112
|
+
* @returns {Array} Returns the array of results.
|
|
3113
|
+
*/
|
|
3114
|
+
function baseTimes(n, iteratee) {
|
|
3115
|
+
var index = -1,
|
|
3116
|
+
result = Array(n);
|
|
3117
|
+
while (++index < n) {
|
|
3118
|
+
result[index] = iteratee(index);
|
|
3119
|
+
}
|
|
3120
|
+
return result;
|
|
3121
|
+
}
|
|
3122
|
+
var _baseTimes = baseTimes;
|
|
3123
|
+
|
|
3124
|
+
/** Used as references for various `Number` constants. */
|
|
3125
|
+
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
3126
|
+
|
|
3127
|
+
/** Used to detect unsigned integer values. */
|
|
3128
|
+
var reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
3129
|
+
|
|
3130
|
+
/**
|
|
3131
|
+
* Checks if `value` is a valid array-like index.
|
|
3132
|
+
*
|
|
3133
|
+
* @private
|
|
3134
|
+
* @param {*} value The value to check.
|
|
3135
|
+
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
|
|
3136
|
+
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
|
|
3137
|
+
*/
|
|
3138
|
+
function isIndex(value, length) {
|
|
3139
|
+
var type = typeof value;
|
|
3140
|
+
length = length == null ? MAX_SAFE_INTEGER : length;
|
|
3141
|
+
return !!length && (type == 'number' || type != 'symbol' && reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
|
|
3142
|
+
}
|
|
3143
|
+
var _isIndex = isIndex;
|
|
3144
|
+
|
|
3145
|
+
/** Used for built-in method references. */
|
|
3146
|
+
var objectProto$1 = Object.prototype;
|
|
3147
|
+
|
|
3148
|
+
/** Used to check objects for own properties. */
|
|
3149
|
+
var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
|
|
3150
|
+
|
|
3151
|
+
/**
|
|
3152
|
+
* Creates an array of the enumerable property names of the array-like `value`.
|
|
3153
|
+
*
|
|
3154
|
+
* @private
|
|
3155
|
+
* @param {*} value The value to query.
|
|
3156
|
+
* @param {boolean} inherited Specify returning inherited property names.
|
|
3157
|
+
* @returns {Array} Returns the array of property names.
|
|
3158
|
+
*/
|
|
3159
|
+
function arrayLikeKeys(value, inherited) {
|
|
3160
|
+
var isArr = isArray_1(value),
|
|
3161
|
+
isArg = !isArr && isArguments_1(value),
|
|
3162
|
+
isBuff = !isArr && !isArg && isBuffer_1(value),
|
|
3163
|
+
isType = !isArr && !isArg && !isBuff && isTypedArray_1(value),
|
|
3164
|
+
skipIndexes = isArr || isArg || isBuff || isType,
|
|
3165
|
+
result = skipIndexes ? _baseTimes(value.length, String) : [],
|
|
3166
|
+
length = result.length;
|
|
3167
|
+
for (var key in value) {
|
|
3168
|
+
if ((inherited || hasOwnProperty$1.call(value, key)) && !(skipIndexes && (
|
|
3169
|
+
// Safari 9 has enumerable `arguments.length` in strict mode.
|
|
3170
|
+
key == 'length' ||
|
|
3171
|
+
// Node.js 0.10 has enumerable non-index properties on buffers.
|
|
3172
|
+
isBuff && (key == 'offset' || key == 'parent') ||
|
|
3173
|
+
// PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
3174
|
+
isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset') ||
|
|
3175
|
+
// Skip index properties.
|
|
3176
|
+
_isIndex(key, length)))) {
|
|
3177
|
+
result.push(key);
|
|
3178
|
+
}
|
|
3179
|
+
}
|
|
3180
|
+
return result;
|
|
3181
|
+
}
|
|
3182
|
+
var _arrayLikeKeys = arrayLikeKeys;
|
|
3183
|
+
|
|
3184
|
+
/**
|
|
3185
|
+
* This function is like
|
|
3186
|
+
* [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
|
|
3187
|
+
* except that it includes inherited enumerable properties.
|
|
3188
|
+
*
|
|
3189
|
+
* @private
|
|
3190
|
+
* @param {Object} object The object to query.
|
|
3191
|
+
* @returns {Array} Returns the array of property names.
|
|
3192
|
+
*/
|
|
3193
|
+
function nativeKeysIn(object) {
|
|
3194
|
+
var result = [];
|
|
3195
|
+
if (object != null) {
|
|
3196
|
+
for (var key in Object(object)) {
|
|
3197
|
+
result.push(key);
|
|
3198
|
+
}
|
|
3199
|
+
}
|
|
3200
|
+
return result;
|
|
3201
|
+
}
|
|
3202
|
+
var _nativeKeysIn = nativeKeysIn;
|
|
3203
|
+
|
|
3204
|
+
/** Used for built-in method references. */
|
|
3205
|
+
var objectProto = Object.prototype;
|
|
3206
|
+
|
|
3207
|
+
/** Used to check objects for own properties. */
|
|
3208
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
3209
|
+
|
|
3210
|
+
/**
|
|
3211
|
+
* The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
|
|
3212
|
+
*
|
|
3213
|
+
* @private
|
|
3214
|
+
* @param {Object} object The object to query.
|
|
3215
|
+
* @returns {Array} Returns the array of property names.
|
|
3216
|
+
*/
|
|
3217
|
+
function baseKeysIn(object) {
|
|
3218
|
+
if (!isObject_1(object)) {
|
|
3219
|
+
return _nativeKeysIn(object);
|
|
3220
|
+
}
|
|
3221
|
+
var isProto = _isPrototype(object),
|
|
3222
|
+
result = [];
|
|
3223
|
+
for (var key in object) {
|
|
3224
|
+
if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
|
|
3225
|
+
result.push(key);
|
|
3226
|
+
}
|
|
3227
|
+
}
|
|
3228
|
+
return result;
|
|
3229
|
+
}
|
|
3230
|
+
var _baseKeysIn = baseKeysIn;
|
|
3231
|
+
|
|
3232
|
+
/**
|
|
3233
|
+
* Creates an array of the own and inherited enumerable property names of `object`.
|
|
3234
|
+
*
|
|
3235
|
+
* **Note:** Non-object values are coerced to objects.
|
|
3236
|
+
*
|
|
3237
|
+
* @static
|
|
3238
|
+
* @memberOf _
|
|
3239
|
+
* @since 3.0.0
|
|
3240
|
+
* @category Object
|
|
3241
|
+
* @param {Object} object The object to query.
|
|
3242
|
+
* @returns {Array} Returns the array of property names.
|
|
3243
|
+
* @example
|
|
3244
|
+
*
|
|
3245
|
+
* function Foo() {
|
|
3246
|
+
* this.a = 1;
|
|
3247
|
+
* this.b = 2;
|
|
3248
|
+
* }
|
|
3249
|
+
*
|
|
3250
|
+
* Foo.prototype.c = 3;
|
|
3251
|
+
*
|
|
3252
|
+
* _.keysIn(new Foo);
|
|
3253
|
+
* // => ['a', 'b', 'c'] (iteration order is not guaranteed)
|
|
3254
|
+
*/
|
|
3255
|
+
function keysIn(object) {
|
|
3256
|
+
return isArrayLike_1(object) ? _arrayLikeKeys(object, true) : _baseKeysIn(object);
|
|
3257
|
+
}
|
|
3258
|
+
var keysIn_1 = keysIn;
|
|
3259
|
+
|
|
3260
|
+
/**
|
|
3261
|
+
* Converts `value` to a plain object flattening inherited enumerable string
|
|
3262
|
+
* keyed properties of `value` to own properties of the plain object.
|
|
3263
|
+
*
|
|
3264
|
+
* @static
|
|
3265
|
+
* @memberOf _
|
|
3266
|
+
* @since 3.0.0
|
|
3267
|
+
* @category Lang
|
|
3268
|
+
* @param {*} value The value to convert.
|
|
3269
|
+
* @returns {Object} Returns the converted plain object.
|
|
3270
|
+
* @example
|
|
3271
|
+
*
|
|
3272
|
+
* function Foo() {
|
|
3273
|
+
* this.b = 2;
|
|
3274
|
+
* }
|
|
3275
|
+
*
|
|
3276
|
+
* Foo.prototype.c = 3;
|
|
3277
|
+
*
|
|
3278
|
+
* _.assign({ 'a': 1 }, new Foo);
|
|
3279
|
+
* // => { 'a': 1, 'b': 2 }
|
|
3280
|
+
*
|
|
3281
|
+
* _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
|
|
3282
|
+
* // => { 'a': 1, 'b': 2, 'c': 3 }
|
|
3283
|
+
*/
|
|
3284
|
+
function toPlainObject(value) {
|
|
3285
|
+
return _copyObject(value, keysIn_1(value));
|
|
3286
|
+
}
|
|
3287
|
+
var toPlainObject_1 = toPlainObject;
|
|
3288
|
+
|
|
3289
|
+
/**
|
|
3290
|
+
* A specialized version of `baseMerge` for arrays and objects which performs
|
|
3291
|
+
* deep merges and tracks traversed objects enabling objects with circular
|
|
3292
|
+
* references to be merged.
|
|
3293
|
+
*
|
|
3294
|
+
* @private
|
|
3295
|
+
* @param {Object} object The destination object.
|
|
3296
|
+
* @param {Object} source The source object.
|
|
3297
|
+
* @param {string} key The key of the value to merge.
|
|
3298
|
+
* @param {number} srcIndex The index of `source`.
|
|
3299
|
+
* @param {Function} mergeFunc The function to merge values.
|
|
3300
|
+
* @param {Function} [customizer] The function to customize assigned values.
|
|
3301
|
+
* @param {Object} [stack] Tracks traversed source values and their merged
|
|
3302
|
+
* counterparts.
|
|
3303
|
+
*/
|
|
3304
|
+
function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
|
|
3305
|
+
var objValue = _safeGet(object, key),
|
|
3306
|
+
srcValue = _safeGet(source, key),
|
|
3307
|
+
stacked = stack.get(srcValue);
|
|
3308
|
+
if (stacked) {
|
|
3309
|
+
_assignMergeValue(object, key, stacked);
|
|
3310
|
+
return;
|
|
3311
|
+
}
|
|
3312
|
+
var newValue = customizer ? customizer(objValue, srcValue, key + '', object, source, stack) : undefined;
|
|
3313
|
+
var isCommon = newValue === undefined;
|
|
3314
|
+
if (isCommon) {
|
|
3315
|
+
var isArr = isArray_1(srcValue),
|
|
3316
|
+
isBuff = !isArr && isBuffer_1(srcValue),
|
|
3317
|
+
isTyped = !isArr && !isBuff && isTypedArray_1(srcValue);
|
|
3318
|
+
newValue = srcValue;
|
|
3319
|
+
if (isArr || isBuff || isTyped) {
|
|
3320
|
+
if (isArray_1(objValue)) {
|
|
3321
|
+
newValue = objValue;
|
|
3322
|
+
} else if (isArrayLikeObject_1(objValue)) {
|
|
3323
|
+
newValue = _copyArray(objValue);
|
|
3324
|
+
} else if (isBuff) {
|
|
3325
|
+
isCommon = false;
|
|
3326
|
+
newValue = _cloneBuffer(srcValue, true);
|
|
3327
|
+
} else if (isTyped) {
|
|
3328
|
+
isCommon = false;
|
|
3329
|
+
newValue = _cloneTypedArray(srcValue, true);
|
|
3330
|
+
} else {
|
|
3331
|
+
newValue = [];
|
|
3332
|
+
}
|
|
3333
|
+
} else if (isPlainObject_1(srcValue) || isArguments_1(srcValue)) {
|
|
3334
|
+
newValue = objValue;
|
|
3335
|
+
if (isArguments_1(objValue)) {
|
|
3336
|
+
newValue = toPlainObject_1(objValue);
|
|
3337
|
+
} else if (!isObject_1(objValue) || isFunction_1(objValue)) {
|
|
3338
|
+
newValue = _initCloneObject(srcValue);
|
|
3339
|
+
}
|
|
3340
|
+
} else {
|
|
3341
|
+
isCommon = false;
|
|
3342
|
+
}
|
|
3343
|
+
}
|
|
3344
|
+
if (isCommon) {
|
|
3345
|
+
// Recursively merge objects and arrays (susceptible to call stack limits).
|
|
3346
|
+
stack.set(srcValue, newValue);
|
|
3347
|
+
mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
|
|
3348
|
+
stack['delete'](srcValue);
|
|
3349
|
+
}
|
|
3350
|
+
_assignMergeValue(object, key, newValue);
|
|
3351
|
+
}
|
|
3352
|
+
var _baseMergeDeep = baseMergeDeep;
|
|
3353
|
+
|
|
3354
|
+
/**
|
|
3355
|
+
* The base implementation of `_.merge` without support for multiple sources.
|
|
3356
|
+
*
|
|
3357
|
+
* @private
|
|
3358
|
+
* @param {Object} object The destination object.
|
|
3359
|
+
* @param {Object} source The source object.
|
|
3360
|
+
* @param {number} srcIndex The index of `source`.
|
|
3361
|
+
* @param {Function} [customizer] The function to customize merged values.
|
|
3362
|
+
* @param {Object} [stack] Tracks traversed source values and their merged
|
|
3363
|
+
* counterparts.
|
|
3364
|
+
*/
|
|
3365
|
+
function baseMerge(object, source, srcIndex, customizer, stack) {
|
|
3366
|
+
if (object === source) {
|
|
3367
|
+
return;
|
|
3368
|
+
}
|
|
3369
|
+
_baseFor(source, function (srcValue, key) {
|
|
3370
|
+
stack || (stack = new _Stack());
|
|
3371
|
+
if (isObject_1(srcValue)) {
|
|
3372
|
+
_baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
|
|
3373
|
+
} else {
|
|
3374
|
+
var newValue = customizer ? customizer(_safeGet(object, key), srcValue, key + '', object, source, stack) : undefined;
|
|
3375
|
+
if (newValue === undefined) {
|
|
3376
|
+
newValue = srcValue;
|
|
3377
|
+
}
|
|
3378
|
+
_assignMergeValue(object, key, newValue);
|
|
3379
|
+
}
|
|
3380
|
+
}, keysIn_1);
|
|
3381
|
+
}
|
|
3382
|
+
var _baseMerge = baseMerge;
|
|
3383
|
+
|
|
3384
|
+
/**
|
|
3385
|
+
* This method returns the first argument it receives.
|
|
3386
|
+
*
|
|
3387
|
+
* @static
|
|
3388
|
+
* @since 0.1.0
|
|
3389
|
+
* @memberOf _
|
|
3390
|
+
* @category Util
|
|
3391
|
+
* @param {*} value Any value.
|
|
3392
|
+
* @returns {*} Returns `value`.
|
|
3393
|
+
* @example
|
|
3394
|
+
*
|
|
3395
|
+
* var object = { 'a': 1 };
|
|
3396
|
+
*
|
|
3397
|
+
* console.log(_.identity(object) === object);
|
|
3398
|
+
* // => true
|
|
3399
|
+
*/
|
|
3400
|
+
function identity(value) {
|
|
3401
|
+
return value;
|
|
3402
|
+
}
|
|
3403
|
+
var identity_1 = identity;
|
|
3404
|
+
|
|
3405
|
+
/**
|
|
3406
|
+
* A faster alternative to `Function#apply`, this function invokes `func`
|
|
3407
|
+
* with the `this` binding of `thisArg` and the arguments of `args`.
|
|
3408
|
+
*
|
|
3409
|
+
* @private
|
|
3410
|
+
* @param {Function} func The function to invoke.
|
|
3411
|
+
* @param {*} thisArg The `this` binding of `func`.
|
|
3412
|
+
* @param {Array} args The arguments to invoke `func` with.
|
|
3413
|
+
* @returns {*} Returns the result of `func`.
|
|
3414
|
+
*/
|
|
3415
|
+
function apply(func, thisArg, args) {
|
|
3416
|
+
switch (args.length) {
|
|
3417
|
+
case 0:
|
|
3418
|
+
return func.call(thisArg);
|
|
3419
|
+
case 1:
|
|
3420
|
+
return func.call(thisArg, args[0]);
|
|
3421
|
+
case 2:
|
|
3422
|
+
return func.call(thisArg, args[0], args[1]);
|
|
3423
|
+
case 3:
|
|
3424
|
+
return func.call(thisArg, args[0], args[1], args[2]);
|
|
3425
|
+
}
|
|
3426
|
+
return func.apply(thisArg, args);
|
|
3427
|
+
}
|
|
3428
|
+
var _apply = apply;
|
|
3429
|
+
|
|
3430
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
3431
|
+
var nativeMax = Math.max;
|
|
3432
|
+
|
|
3433
|
+
/**
|
|
3434
|
+
* A specialized version of `baseRest` which transforms the rest array.
|
|
3435
|
+
*
|
|
3436
|
+
* @private
|
|
3437
|
+
* @param {Function} func The function to apply a rest parameter to.
|
|
3438
|
+
* @param {number} [start=func.length-1] The start position of the rest parameter.
|
|
3439
|
+
* @param {Function} transform The rest array transform.
|
|
3440
|
+
* @returns {Function} Returns the new function.
|
|
3441
|
+
*/
|
|
3442
|
+
function overRest(func, start, transform) {
|
|
3443
|
+
start = nativeMax(start === undefined ? func.length - 1 : start, 0);
|
|
3444
|
+
return function () {
|
|
3445
|
+
var args = arguments,
|
|
3446
|
+
index = -1,
|
|
3447
|
+
length = nativeMax(args.length - start, 0),
|
|
3448
|
+
array = Array(length);
|
|
3449
|
+
while (++index < length) {
|
|
3450
|
+
array[index] = args[start + index];
|
|
3451
|
+
}
|
|
3452
|
+
index = -1;
|
|
3453
|
+
var otherArgs = Array(start + 1);
|
|
3454
|
+
while (++index < start) {
|
|
3455
|
+
otherArgs[index] = args[index];
|
|
3456
|
+
}
|
|
3457
|
+
otherArgs[start] = transform(array);
|
|
3458
|
+
return _apply(func, this, otherArgs);
|
|
3459
|
+
};
|
|
3460
|
+
}
|
|
3461
|
+
var _overRest = overRest;
|
|
3462
|
+
|
|
3463
|
+
/**
|
|
3464
|
+
* Creates a function that returns `value`.
|
|
3465
|
+
*
|
|
3466
|
+
* @static
|
|
3467
|
+
* @memberOf _
|
|
3468
|
+
* @since 2.4.0
|
|
3469
|
+
* @category Util
|
|
3470
|
+
* @param {*} value The value to return from the new function.
|
|
3471
|
+
* @returns {Function} Returns the new constant function.
|
|
3472
|
+
* @example
|
|
3473
|
+
*
|
|
3474
|
+
* var objects = _.times(2, _.constant({ 'a': 1 }));
|
|
3475
|
+
*
|
|
3476
|
+
* console.log(objects);
|
|
3477
|
+
* // => [{ 'a': 1 }, { 'a': 1 }]
|
|
3478
|
+
*
|
|
3479
|
+
* console.log(objects[0] === objects[1]);
|
|
3480
|
+
* // => true
|
|
3481
|
+
*/
|
|
3482
|
+
function constant(value) {
|
|
3483
|
+
return function () {
|
|
3484
|
+
return value;
|
|
3485
|
+
};
|
|
3486
|
+
}
|
|
3487
|
+
var constant_1 = constant;
|
|
3488
|
+
|
|
3489
|
+
/**
|
|
3490
|
+
* The base implementation of `setToString` without support for hot loop shorting.
|
|
3491
|
+
*
|
|
3492
|
+
* @private
|
|
3493
|
+
* @param {Function} func The function to modify.
|
|
3494
|
+
* @param {Function} string The `toString` result.
|
|
3495
|
+
* @returns {Function} Returns `func`.
|
|
3496
|
+
*/
|
|
3497
|
+
var baseSetToString = !_defineProperty ? identity_1 : function (func, string) {
|
|
3498
|
+
return _defineProperty(func, 'toString', {
|
|
3499
|
+
'configurable': true,
|
|
3500
|
+
'enumerable': false,
|
|
3501
|
+
'value': constant_1(string),
|
|
3502
|
+
'writable': true
|
|
3503
|
+
});
|
|
3504
|
+
};
|
|
3505
|
+
var _baseSetToString = baseSetToString;
|
|
3506
|
+
|
|
3507
|
+
/** Used to detect hot functions by number of calls within a span of milliseconds. */
|
|
3508
|
+
var HOT_COUNT = 800,
|
|
3509
|
+
HOT_SPAN = 16;
|
|
3510
|
+
|
|
3511
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
3512
|
+
var nativeNow = Date.now;
|
|
3513
|
+
|
|
3514
|
+
/**
|
|
3515
|
+
* Creates a function that'll short out and invoke `identity` instead
|
|
3516
|
+
* of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
|
|
3517
|
+
* milliseconds.
|
|
3518
|
+
*
|
|
3519
|
+
* @private
|
|
3520
|
+
* @param {Function} func The function to restrict.
|
|
3521
|
+
* @returns {Function} Returns the new shortable function.
|
|
3522
|
+
*/
|
|
3523
|
+
function shortOut(func) {
|
|
3524
|
+
var count = 0,
|
|
3525
|
+
lastCalled = 0;
|
|
3526
|
+
return function () {
|
|
3527
|
+
var stamp = nativeNow(),
|
|
3528
|
+
remaining = HOT_SPAN - (stamp - lastCalled);
|
|
3529
|
+
lastCalled = stamp;
|
|
3530
|
+
if (remaining > 0) {
|
|
3531
|
+
if (++count >= HOT_COUNT) {
|
|
3532
|
+
return arguments[0];
|
|
3533
|
+
}
|
|
3534
|
+
} else {
|
|
3535
|
+
count = 0;
|
|
3536
|
+
}
|
|
3537
|
+
return func.apply(undefined, arguments);
|
|
3538
|
+
};
|
|
3539
|
+
}
|
|
3540
|
+
var _shortOut = shortOut;
|
|
3541
|
+
|
|
3542
|
+
/**
|
|
3543
|
+
* Sets the `toString` method of `func` to return `string`.
|
|
3544
|
+
*
|
|
3545
|
+
* @private
|
|
3546
|
+
* @param {Function} func The function to modify.
|
|
3547
|
+
* @param {Function} string The `toString` result.
|
|
3548
|
+
* @returns {Function} Returns `func`.
|
|
3549
|
+
*/
|
|
3550
|
+
var setToString = _shortOut(_baseSetToString);
|
|
3551
|
+
var _setToString = setToString;
|
|
3552
|
+
|
|
3553
|
+
/**
|
|
3554
|
+
* The base implementation of `_.rest` which doesn't validate or coerce arguments.
|
|
3555
|
+
*
|
|
3556
|
+
* @private
|
|
3557
|
+
* @param {Function} func The function to apply a rest parameter to.
|
|
3558
|
+
* @param {number} [start=func.length-1] The start position of the rest parameter.
|
|
3559
|
+
* @returns {Function} Returns the new function.
|
|
3560
|
+
*/
|
|
3561
|
+
function baseRest(func, start) {
|
|
3562
|
+
return _setToString(_overRest(func, start, identity_1), func + '');
|
|
3563
|
+
}
|
|
3564
|
+
var _baseRest = baseRest;
|
|
3565
|
+
|
|
3566
|
+
/**
|
|
3567
|
+
* Checks if the given arguments are from an iteratee call.
|
|
3568
|
+
*
|
|
3569
|
+
* @private
|
|
3570
|
+
* @param {*} value The potential iteratee value argument.
|
|
3571
|
+
* @param {*} index The potential iteratee index or key argument.
|
|
3572
|
+
* @param {*} object The potential iteratee object argument.
|
|
3573
|
+
* @returns {boolean} Returns `true` if the arguments are from an iteratee call,
|
|
3574
|
+
* else `false`.
|
|
3575
|
+
*/
|
|
3576
|
+
function isIterateeCall(value, index, object) {
|
|
3577
|
+
if (!isObject_1(object)) {
|
|
3578
|
+
return false;
|
|
3579
|
+
}
|
|
3580
|
+
var type = typeof index;
|
|
3581
|
+
if (type == 'number' ? isArrayLike_1(object) && _isIndex(index, object.length) : type == 'string' && index in object) {
|
|
3582
|
+
return eq_1(object[index], value);
|
|
3583
|
+
}
|
|
3584
|
+
return false;
|
|
3585
|
+
}
|
|
3586
|
+
var _isIterateeCall = isIterateeCall;
|
|
3587
|
+
|
|
3588
|
+
/**
|
|
3589
|
+
* Creates a function like `_.assign`.
|
|
3590
|
+
*
|
|
3591
|
+
* @private
|
|
3592
|
+
* @param {Function} assigner The function to assign values.
|
|
3593
|
+
* @returns {Function} Returns the new assigner function.
|
|
3594
|
+
*/
|
|
3595
|
+
function createAssigner(assigner) {
|
|
3596
|
+
return _baseRest(function (object, sources) {
|
|
3597
|
+
var index = -1,
|
|
3598
|
+
length = sources.length,
|
|
3599
|
+
customizer = length > 1 ? sources[length - 1] : undefined,
|
|
3600
|
+
guard = length > 2 ? sources[2] : undefined;
|
|
3601
|
+
customizer = assigner.length > 3 && typeof customizer == 'function' ? (length--, customizer) : undefined;
|
|
3602
|
+
if (guard && _isIterateeCall(sources[0], sources[1], guard)) {
|
|
3603
|
+
customizer = length < 3 ? undefined : customizer;
|
|
3604
|
+
length = 1;
|
|
3605
|
+
}
|
|
3606
|
+
object = Object(object);
|
|
3607
|
+
while (++index < length) {
|
|
3608
|
+
var source = sources[index];
|
|
3609
|
+
if (source) {
|
|
3610
|
+
assigner(object, source, index, customizer);
|
|
3611
|
+
}
|
|
3612
|
+
}
|
|
3613
|
+
return object;
|
|
3614
|
+
});
|
|
3615
|
+
}
|
|
3616
|
+
var _createAssigner = createAssigner;
|
|
3617
|
+
|
|
3618
|
+
/**
|
|
3619
|
+
* This method is like `_.merge` except that it accepts `customizer` which
|
|
3620
|
+
* is invoked to produce the merged values of the destination and source
|
|
3621
|
+
* properties. If `customizer` returns `undefined`, merging is handled by the
|
|
3622
|
+
* method instead. The `customizer` is invoked with six arguments:
|
|
3623
|
+
* (objValue, srcValue, key, object, source, stack).
|
|
3624
|
+
*
|
|
3625
|
+
* **Note:** This method mutates `object`.
|
|
3626
|
+
*
|
|
3627
|
+
* @static
|
|
3628
|
+
* @memberOf _
|
|
3629
|
+
* @since 4.0.0
|
|
3630
|
+
* @category Object
|
|
3631
|
+
* @param {Object} object The destination object.
|
|
3632
|
+
* @param {...Object} sources The source objects.
|
|
3633
|
+
* @param {Function} customizer The function to customize assigned values.
|
|
3634
|
+
* @returns {Object} Returns `object`.
|
|
3635
|
+
* @example
|
|
3636
|
+
*
|
|
3637
|
+
* function customizer(objValue, srcValue) {
|
|
3638
|
+
* if (_.isArray(objValue)) {
|
|
3639
|
+
* return objValue.concat(srcValue);
|
|
3640
|
+
* }
|
|
3641
|
+
* }
|
|
3642
|
+
*
|
|
3643
|
+
* var object = { 'a': [1], 'b': [2] };
|
|
3644
|
+
* var other = { 'a': [3], 'b': [4] };
|
|
3645
|
+
*
|
|
3646
|
+
* _.mergeWith(object, other, customizer);
|
|
3647
|
+
* // => { 'a': [1, 3], 'b': [2, 4] }
|
|
3648
|
+
*/
|
|
3649
|
+
var mergeWith = _createAssigner(function (object, source, srcIndex, customizer) {
|
|
3650
|
+
_baseMerge(object, source, srcIndex, customizer);
|
|
3651
|
+
});
|
|
3652
|
+
var mergeWith_1 = mergeWith;
|
|
3653
|
+
var mergeWith$1 = mergeWith_1;
|
|
3654
|
+
|
|
3655
|
+
/**
|
|
3656
|
+
* merge-props.js
|
|
3657
|
+
*
|
|
3658
|
+
* Forked from reactabular-table version 8.14.0
|
|
3659
|
+
* https://github.com/reactabular/reactabular/tree/v8.14.0/packages/reactabular-table/src
|
|
3660
|
+
*/
|
|
3661
|
+
/**
|
|
3662
|
+
* @param {any} props - Props
|
|
3663
|
+
*/
|
|
3664
|
+
function mergeProps() {
|
|
3665
|
+
var props = [].slice.call(arguments);
|
|
3666
|
+
var firstProps = props[0];
|
|
3667
|
+
var restProps = props.slice(1);
|
|
3668
|
+
if (!restProps.length) {
|
|
3669
|
+
return mergeWith$1({}, firstProps);
|
|
3670
|
+
}
|
|
3671
|
+
// Avoid mutating the first prop collection
|
|
3672
|
+
return mergeWith$1.apply(void 0, [mergeWith$1({}, firstProps)].concat(restProps, [function (a, b, key) {
|
|
3673
|
+
if (key === 'children') {
|
|
3674
|
+
if (a && b) {
|
|
3675
|
+
// compose the two
|
|
3676
|
+
return React__namespace.cloneElement(a, {
|
|
3677
|
+
children: b
|
|
3678
|
+
});
|
|
3679
|
+
}
|
|
3680
|
+
// Children have to be merged in reverse order for Reactabular
|
|
3681
|
+
// logic to work.
|
|
3682
|
+
return Object.assign(Object.assign({}, b), a);
|
|
3683
|
+
}
|
|
3684
|
+
if (key === 'className') {
|
|
3685
|
+
// Process class names through classNames to merge properly
|
|
3686
|
+
// as a string.
|
|
3687
|
+
return css(a, b);
|
|
3688
|
+
}
|
|
3689
|
+
return undefined;
|
|
3690
|
+
}]));
|
|
3691
|
+
}
|
|
3692
|
+
|
|
3693
|
+
var c_table__sticky_cell_MinWidth = {
|
|
3694
|
+
"name": "--pf-v5-c-table__sticky-cell--MinWidth",
|
|
3695
|
+
"value": "12.5rem",
|
|
3696
|
+
"var": "var(--pf-v5-c-table__sticky-cell--MinWidth)"
|
|
3697
|
+
};
|
|
3698
|
+
var cssStickyCellMinWidth = c_table__sticky_cell_MinWidth;
|
|
3699
|
+
|
|
3700
|
+
var c_table__sticky_cell_Left = {
|
|
3701
|
+
"name": "--pf-v5-c-table__sticky-cell--Left",
|
|
3702
|
+
"value": "0",
|
|
3703
|
+
"var": "var(--pf-v5-c-table__sticky-cell--Left)"
|
|
3704
|
+
};
|
|
3705
|
+
var cssStickyCellLeft = c_table__sticky_cell_Left;
|
|
3706
|
+
|
|
3707
|
+
var c_table__sticky_cell_Right = {
|
|
3708
|
+
"name": "--pf-v5-c-table__sticky-cell--Right",
|
|
3709
|
+
"value": "0",
|
|
3710
|
+
"var": "var(--pf-v5-c-table__sticky-cell--Right)"
|
|
3711
|
+
};
|
|
3712
|
+
var cssStickyCellRight = c_table__sticky_cell_Right;
|
|
1759
3713
|
|
|
3714
|
+
var ThBase = function ThBase(_a) {
|
|
3715
|
+
var _Object$assign;
|
|
3716
|
+
var children = _a.children,
|
|
3717
|
+
className = _a.className,
|
|
3718
|
+
_a$component = _a.component,
|
|
3719
|
+
component = _a$component === void 0 ? 'th' : _a$component,
|
|
3720
|
+
dataLabel = _a.dataLabel,
|
|
3721
|
+
_a$scope = _a.scope,
|
|
3722
|
+
scope = _a$scope === void 0 ? 'col' : _a$scope,
|
|
3723
|
+
_a$textCenter = _a.textCenter,
|
|
3724
|
+
textCenter = _a$textCenter === void 0 ? false : _a$textCenter,
|
|
3725
|
+
_a$sort = _a.sort,
|
|
3726
|
+
sort = _a$sort === void 0 ? null : _a$sort,
|
|
3727
|
+
modifier = _a.modifier,
|
|
3728
|
+
_a$select = _a.select,
|
|
3729
|
+
select = _a$select === void 0 ? null : _a$select,
|
|
3730
|
+
_a$expand = _a.expand,
|
|
3731
|
+
collapse = _a$expand === void 0 ? null : _a$expand,
|
|
3732
|
+
_a$tooltip = _a.tooltip,
|
|
3733
|
+
tooltip = _a$tooltip === void 0 ? '' : _a$tooltip,
|
|
3734
|
+
tooltipProps = _a.tooltipProps,
|
|
3735
|
+
_a$onMouseEnter = _a.onMouseEnter,
|
|
3736
|
+
onMouseEnterProp = _a$onMouseEnter === void 0 ? function () {} : _a$onMouseEnter,
|
|
3737
|
+
width = _a.width,
|
|
3738
|
+
visibility = _a.visibility,
|
|
3739
|
+
innerRef = _a.innerRef,
|
|
3740
|
+
infoProps = _a.info,
|
|
3741
|
+
_a$isStickyColumn = _a.isStickyColumn,
|
|
3742
|
+
isStickyColumn = _a$isStickyColumn === void 0 ? false : _a$isStickyColumn,
|
|
3743
|
+
_a$hasRightBorder = _a.hasRightBorder,
|
|
3744
|
+
hasRightBorder = _a$hasRightBorder === void 0 ? false : _a$hasRightBorder,
|
|
3745
|
+
_a$hasLeftBorder = _a.hasLeftBorder,
|
|
3746
|
+
hasLeftBorder = _a$hasLeftBorder === void 0 ? false : _a$hasLeftBorder,
|
|
3747
|
+
_a$stickyMinWidth = _a.stickyMinWidth,
|
|
3748
|
+
stickyMinWidth = _a$stickyMinWidth === void 0 ? '120px' : _a$stickyMinWidth,
|
|
3749
|
+
stickyLeftOffset = _a.stickyLeftOffset,
|
|
3750
|
+
stickyRightOffset = _a.stickyRightOffset,
|
|
3751
|
+
_a$isSubheader = _a.isSubheader,
|
|
3752
|
+
isSubheader = _a$isSubheader === void 0 ? false : _a$isSubheader,
|
|
3753
|
+
screenReaderText = _a.screenReaderText,
|
|
3754
|
+
ariaLabel = _a['aria-label'],
|
|
3755
|
+
props = __rest(_a, ["children", "className", "component", "dataLabel", "scope", "textCenter", "sort", "modifier", "select", "expand", "tooltip", "tooltipProps", "onMouseEnter", "width", "visibility", "innerRef", "info", "isStickyColumn", "hasRightBorder", "hasLeftBorder", "stickyMinWidth", "stickyLeftOffset", "stickyRightOffset", "isSubheader", "screenReaderText", 'aria-label']);
|
|
1760
3756
|
if (!children && !screenReaderText && !ariaLabel) {
|
|
1761
3757
|
// eslint-disable-next-line no-console
|
|
1762
3758
|
console.warn('Th: Table headers must have an accessible name. If the Th is intended to be visually empty, pass in screenReaderText. If the Th contains only non-text, interactive content such as a checkbox or expand toggle, pass in an aria-label.');
|
|
1763
3759
|
}
|
|
1764
|
-
|
|
1765
3760
|
var _React$useState = React__namespace.useState(false),
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
3761
|
+
showTooltip = _React$useState[0],
|
|
3762
|
+
setShowTooltip = _React$useState[1];
|
|
1769
3763
|
var _React$useState2 = React__namespace.useState(false),
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
3764
|
+
truncated = _React$useState2[0],
|
|
3765
|
+
setTruncated = _React$useState2[1];
|
|
1773
3766
|
var cellRef = innerRef ? innerRef : React__namespace.createRef();
|
|
1774
|
-
|
|
1775
3767
|
var onMouseEnter = function onMouseEnter(event) {
|
|
1776
3768
|
if (event.target.offsetWidth < event.target.scrollWidth) {
|
|
1777
3769
|
!showTooltip && setShowTooltip(true);
|
|
1778
3770
|
} else {
|
|
1779
3771
|
showTooltip && setShowTooltip(false);
|
|
1780
3772
|
}
|
|
1781
|
-
|
|
1782
3773
|
onMouseEnterProp(event);
|
|
1783
3774
|
};
|
|
1784
|
-
|
|
1785
3775
|
var sortParams = null;
|
|
1786
|
-
|
|
1787
3776
|
if (sort) {
|
|
1788
3777
|
if (sort.isFavorites) {
|
|
1789
3778
|
sortParams = sortableFavorites({
|
|
@@ -1807,7 +3796,6 @@ var ThBase = function ThBase(_a) {
|
|
|
1807
3796
|
});
|
|
1808
3797
|
}
|
|
1809
3798
|
}
|
|
1810
|
-
|
|
1811
3799
|
var selectParams = select ? selectable(children, {
|
|
1812
3800
|
rowData: {
|
|
1813
3801
|
selected: select.isSelected,
|
|
@@ -1838,23 +3826,19 @@ var ThBase = function ThBase(_a) {
|
|
|
1838
3826
|
var visibilityParams = visibility ? classNames.apply(void 0, visibility.map(function (vis) {
|
|
1839
3827
|
return Visibility[vis];
|
|
1840
3828
|
}))() : null;
|
|
1841
|
-
var transformedChildren = (sortParams === null || sortParams === void 0 ? void 0 : sortParams.children) || (selectParams === null || selectParams === void 0 ? void 0 : selectParams.children) || (collapseParams === null || collapseParams === void 0 ? void 0 : collapseParams.children) || children;
|
|
1842
|
-
|
|
3829
|
+
var transformedChildren = (sortParams === null || sortParams === void 0 ? void 0 : sortParams.children) || (selectParams === null || selectParams === void 0 ? void 0 : selectParams.children) || (collapseParams === null || collapseParams === void 0 ? void 0 : collapseParams.children) || children;
|
|
3830
|
+
// info can wrap other transformedChildren
|
|
1843
3831
|
var infoParams = null;
|
|
1844
|
-
|
|
1845
3832
|
if (infoProps) {
|
|
1846
3833
|
infoParams = info(infoProps)(transformedChildren);
|
|
1847
3834
|
transformedChildren = infoParams.children;
|
|
1848
3835
|
}
|
|
1849
|
-
|
|
1850
3836
|
var merged = mergeProps(sortParams, selectParams, collapseParams, widthParams, visibilityParams, infoParams);
|
|
1851
|
-
|
|
1852
3837
|
var _merged$className = merged.className,
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
3838
|
+
mergedClassName = _merged$className === void 0 ? '' : _merged$className,
|
|
3839
|
+
_merged$component = merged.component,
|
|
3840
|
+
MergedComponent = _merged$component === void 0 ? component : _merged$component,
|
|
3841
|
+
mergedProps = __rest(merged, ["children", "isVisible", "className", "component"]);
|
|
1858
3842
|
React__namespace.useEffect(function () {
|
|
1859
3843
|
setTruncated(cellRef.current.offsetWidth < cellRef.current.scrollWidth);
|
|
1860
3844
|
}, [cellRef]);
|
|
@@ -1883,7 +3867,6 @@ var ThBase = function ThBase(_a) {
|
|
|
1883
3867
|
isVisible: true
|
|
1884
3868
|
}, tooltipProps))) : cell;
|
|
1885
3869
|
};
|
|
1886
|
-
|
|
1887
3870
|
var Th = React__namespace.forwardRef(function (props, ref) {
|
|
1888
3871
|
return React__namespace.createElement(ThBase, Object.assign({}, props, {
|
|
1889
3872
|
innerRef: ref
|
|
@@ -1904,71 +3887,64 @@ var draggable = function draggable(value, _ref) {
|
|
|
1904
3887
|
|
|
1905
3888
|
var TdBase = function TdBase(_a) {
|
|
1906
3889
|
var _Object$assign;
|
|
1907
|
-
|
|
1908
3890
|
var children = _a.children,
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
3891
|
+
className = _a.className,
|
|
3892
|
+
_a$isActionCell = _a.isActionCell,
|
|
3893
|
+
isActionCell = _a$isActionCell === void 0 ? false : _a$isActionCell,
|
|
3894
|
+
_a$component = _a.component,
|
|
3895
|
+
component = _a$component === void 0 ? 'td' : _a$component,
|
|
3896
|
+
dataLabel = _a.dataLabel,
|
|
3897
|
+
_a$textCenter = _a.textCenter,
|
|
3898
|
+
textCenter = _a$textCenter === void 0 ? false : _a$textCenter,
|
|
3899
|
+
modifier = _a.modifier,
|
|
3900
|
+
_a$select = _a.select,
|
|
3901
|
+
select = _a$select === void 0 ? null : _a$select,
|
|
3902
|
+
_a$actions = _a.actions,
|
|
3903
|
+
actions = _a$actions === void 0 ? null : _a$actions,
|
|
3904
|
+
_a$expand = _a.expand,
|
|
3905
|
+
expand = _a$expand === void 0 ? null : _a$expand,
|
|
3906
|
+
_a$treeRow = _a.treeRow,
|
|
3907
|
+
treeRowProp = _a$treeRow === void 0 ? null : _a$treeRow,
|
|
3908
|
+
_a$compoundExpand = _a.compoundExpand,
|
|
3909
|
+
compoundExpandProp = _a$compoundExpand === void 0 ? null : _a$compoundExpand,
|
|
3910
|
+
noPadding = _a.noPadding,
|
|
3911
|
+
width = _a.width,
|
|
3912
|
+
visibility = _a.visibility,
|
|
3913
|
+
innerRef = _a.innerRef,
|
|
3914
|
+
_a$favorites = _a.favorites,
|
|
3915
|
+
favorites = _a$favorites === void 0 ? null : _a$favorites,
|
|
3916
|
+
_a$draggableRow = _a.draggableRow,
|
|
3917
|
+
draggableRowProp = _a$draggableRow === void 0 ? null : _a$draggableRow,
|
|
3918
|
+
_a$tooltip = _a.tooltip,
|
|
3919
|
+
tooltip = _a$tooltip === void 0 ? '' : _a$tooltip,
|
|
3920
|
+
_a$onMouseEnter = _a.onMouseEnter,
|
|
3921
|
+
onMouseEnterProp = _a$onMouseEnter === void 0 ? function () {} : _a$onMouseEnter,
|
|
3922
|
+
_a$isStickyColumn = _a.isStickyColumn,
|
|
3923
|
+
isStickyColumn = _a$isStickyColumn === void 0 ? false : _a$isStickyColumn,
|
|
3924
|
+
_a$hasRightBorder = _a.hasRightBorder,
|
|
3925
|
+
hasRightBorder = _a$hasRightBorder === void 0 ? false : _a$hasRightBorder,
|
|
3926
|
+
_a$hasLeftBorder = _a.hasLeftBorder,
|
|
3927
|
+
hasLeftBorder = _a$hasLeftBorder === void 0 ? false : _a$hasLeftBorder,
|
|
3928
|
+
_a$stickyMinWidth = _a.stickyMinWidth,
|
|
3929
|
+
stickyMinWidth = _a$stickyMinWidth === void 0 ? '120px' : _a$stickyMinWidth,
|
|
3930
|
+
stickyLeftOffset = _a.stickyLeftOffset,
|
|
3931
|
+
stickyRightOffset = _a.stickyRightOffset,
|
|
3932
|
+
props = __rest(_a, ["children", "className", "isActionCell", "component", "dataLabel", "textCenter", "modifier", "select", "actions", "expand", "treeRow", "compoundExpand", "noPadding", "width", "visibility", "innerRef", "favorites", "draggableRow", "tooltip", "onMouseEnter", "isStickyColumn", "hasRightBorder", "hasLeftBorder", "stickyMinWidth", "stickyLeftOffset", "stickyRightOffset"]);
|
|
1952
3933
|
var _React$useState = React__namespace.useState(false),
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
3934
|
+
showTooltip = _React$useState[0],
|
|
3935
|
+
setShowTooltip = _React$useState[1];
|
|
1956
3936
|
var _React$useState2 = React__namespace.useState(false),
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
3937
|
+
truncated = _React$useState2[0],
|
|
3938
|
+
setTruncated = _React$useState2[1];
|
|
1960
3939
|
var cellRef = innerRef ? innerRef : React__namespace.createRef();
|
|
1961
|
-
|
|
1962
3940
|
var onMouseEnter = function onMouseEnter(event) {
|
|
1963
3941
|
if (event.target.offsetWidth < event.target.scrollWidth) {
|
|
1964
3942
|
!showTooltip && setShowTooltip(true);
|
|
1965
3943
|
} else {
|
|
1966
3944
|
showTooltip && setShowTooltip(false);
|
|
1967
3945
|
}
|
|
1968
|
-
|
|
1969
3946
|
onMouseEnterProp(event);
|
|
1970
3947
|
};
|
|
1971
|
-
|
|
1972
3948
|
var selectParams = select ? selectable(children, {
|
|
1973
3949
|
rowIndex: select.rowIndex,
|
|
1974
3950
|
rowData: {
|
|
@@ -2056,15 +4032,13 @@ var TdBase = function TdBase(_a) {
|
|
|
2056
4032
|
}
|
|
2057
4033
|
}) : null;
|
|
2058
4034
|
var merged = mergeProps(selectParams, actionParams, expandableParams, compoundParams, widthParams, visibilityParams, favoriteParams, treeRowParams, draggableParams);
|
|
2059
|
-
|
|
2060
4035
|
var _merged$children = merged.children,
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
4036
|
+
mergedChildren = _merged$children === void 0 ? null : _merged$children,
|
|
4037
|
+
_merged$className = merged.className,
|
|
4038
|
+
mergedClassName = _merged$className === void 0 ? '' : _merged$className,
|
|
4039
|
+
_merged$component = merged.component,
|
|
4040
|
+
MergedComponent = _merged$component === void 0 ? component : _merged$component,
|
|
4041
|
+
mergedProps = __rest(merged, ["isVisible", "children", "className", "component"]);
|
|
2068
4042
|
var treeTableTitleCell = className && className.includes(treeViewStyles.tableTreeViewTitleCell) || mergedClassName && mergedClassName.includes(treeViewStyles.tableTreeViewTitleCell);
|
|
2069
4043
|
React__namespace.useEffect(function () {
|
|
2070
4044
|
setTruncated(cellRef.current.offsetWidth < cellRef.current.scrollWidth);
|
|
@@ -2091,7 +4065,6 @@ var TdBase = function TdBase(_a) {
|
|
|
2091
4065
|
isVisible: true
|
|
2092
4066
|
})) : cell;
|
|
2093
4067
|
};
|
|
2094
|
-
|
|
2095
4068
|
var Td = React__namespace.forwardRef(function (props, ref) {
|
|
2096
4069
|
return React__namespace.createElement(TdBase, Object.assign({}, props, {
|
|
2097
4070
|
innerRef: ref
|
|
@@ -2122,53 +4095,49 @@ var SecurityIcon = createIcon(SecurityIconConfig);
|
|
|
2122
4095
|
var DEFAULT_PAGE = 1;
|
|
2123
4096
|
var DEFAULT_PERPAGE = 10;
|
|
2124
4097
|
function FilterableTable(_ref) {
|
|
2125
|
-
|
|
2126
4098
|
var columns = _ref.columns,
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
4099
|
+
items = _ref.items,
|
|
4100
|
+
isLoading = _ref.isLoading,
|
|
4101
|
+
renderRow = _ref.renderRow,
|
|
4102
|
+
filters = _ref.filters,
|
|
4103
|
+
actions = _ref.actions,
|
|
4104
|
+
perPageOptions = _ref.perPageOptions;
|
|
2134
4105
|
var _useState = React.useState(DEFAULT_PAGE),
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
4106
|
+
page = _useState[0],
|
|
4107
|
+
setPage = _useState[1];
|
|
2138
4108
|
var _useState2 = React.useState(DEFAULT_PERPAGE ),
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
4109
|
+
perPage = _useState2[0],
|
|
4110
|
+
setPerPage = _useState2[1];
|
|
2142
4111
|
var _useState3 = React.useState({}),
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
4112
|
+
sortTableBy = _useState3[0],
|
|
4113
|
+
setSortTableBy = _useState3[1];
|
|
2146
4114
|
var _useState4 = React.useState([]),
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
4115
|
+
rows = _useState4[0],
|
|
4116
|
+
setRows = _useState4[1];
|
|
2150
4117
|
var _useState5 = React.useState(items),
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
4118
|
+
filteredItems = _useState5[0],
|
|
4119
|
+
setFilteredItems = _useState5[1];
|
|
2154
4120
|
var _useState6 = React.useState([]),
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
/**
|
|
2158
|
-
* Sorts table by the selected column in ascending or decending order
|
|
2159
|
-
* @param _event click
|
|
2160
|
-
* @param index column index
|
|
2161
|
-
* @param direction asc || desc
|
|
4121
|
+
tableFilters = _useState6[0],
|
|
4122
|
+
setTableFilters = _useState6[1];
|
|
4123
|
+
/**
|
|
4124
|
+
* Sorts table by the selected column in ascending or decending order
|
|
4125
|
+
* @param _event click
|
|
4126
|
+
* @param index column index
|
|
4127
|
+
* @param direction asc || desc
|
|
2162
4128
|
*/
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
4129
|
var onSort = function onSort(_event, index, direction) {
|
|
2166
4130
|
var _columns$index, _columns$index2;
|
|
2167
|
-
|
|
2168
|
-
var
|
|
2169
|
-
var
|
|
2170
|
-
|
|
2171
|
-
|
|
4131
|
+
var sortField = columns == null || (_columns$index = columns[index]) == null ? void 0 : _columns$index.sortField;
|
|
4132
|
+
var sortFn = columns == null || (_columns$index2 = columns[index]) == null ? void 0 : _columns$index2.sortFn;
|
|
4133
|
+
var sortedRows = sortFn ? [].concat(filteredItems).sort(function (a, b) {
|
|
4134
|
+
var aVal = sortFn(a);
|
|
4135
|
+
var bVal = sortFn(b);
|
|
4136
|
+
return aVal < bVal ? -1 : aVal > bVal ? 1 : 0;
|
|
4137
|
+
}) : sortField ? [].concat(filteredItems).sort(function (a, b) {
|
|
4138
|
+
var aVal = a[sortField];
|
|
4139
|
+
var bVal = b[sortField];
|
|
4140
|
+
return aVal < bVal ? -1 : aVal > bVal ? 1 : 0;
|
|
2172
4141
|
}) : filteredItems;
|
|
2173
4142
|
setSortTableBy({
|
|
2174
4143
|
index: index,
|
|
@@ -2176,50 +4145,43 @@ function FilterableTable(_ref) {
|
|
|
2176
4145
|
});
|
|
2177
4146
|
setFilteredItems(direction === SortByDirection.asc ? [].concat(sortedRows) : [].concat(sortedRows == null ? void 0 : sortedRows.reverse()));
|
|
2178
4147
|
};
|
|
2179
|
-
/**
|
|
2180
|
-
* Set table rows to display based on current list of filtered items, page, and perPage settings
|
|
4148
|
+
/**
|
|
4149
|
+
* Set table rows to display based on current list of filtered items, page, and perPage settings
|
|
2181
4150
|
*/
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
4151
|
React.useEffect(function () {
|
|
2185
4152
|
var startIndex = (page - 1) * perPage;
|
|
2186
4153
|
var endIndex = startIndex + perPage;
|
|
2187
4154
|
var itemsInPage = filteredItems.slice(startIndex, endIndex);
|
|
2188
4155
|
setRows(itemsInPage);
|
|
2189
4156
|
}, [filteredItems, page, perPage]);
|
|
2190
|
-
/**
|
|
2191
|
-
* If the list of items change, reset to the first page
|
|
4157
|
+
/**
|
|
4158
|
+
* If the list of items change, reset to the first page
|
|
2192
4159
|
*/
|
|
2193
|
-
|
|
2194
4160
|
function handleItemsPropChange() {
|
|
2195
4161
|
setPage(1);
|
|
2196
4162
|
}
|
|
2197
|
-
|
|
2198
4163
|
var handleItemsPropChangeCallback = React.useCallback(handleItemsPropChange, [setPage, items]);
|
|
2199
4164
|
React.useEffect(handleItemsPropChangeCallback, [handleItemsPropChangeCallback]);
|
|
2200
|
-
/**
|
|
2201
|
-
* Whenever a filter is selected or a user enter a search string, run each item through each filter condition
|
|
2202
|
-
* and check it includes the search string. Only inlcude the item in the table if it passes all filter/search string
|
|
2203
|
-
* conditions.
|
|
4165
|
+
/**
|
|
4166
|
+
* Whenever a filter is selected or a user enter a search string, run each item through each filter condition
|
|
4167
|
+
* and check it includes the search string. Only inlcude the item in the table if it passes all filter/search string
|
|
4168
|
+
* conditions.
|
|
2204
4169
|
*/
|
|
2205
|
-
|
|
2206
4170
|
React.useEffect(function () {
|
|
2207
4171
|
return setFilteredItems(items.filter(function (item) {
|
|
2208
4172
|
return tableFilters.map(function (f, i) {
|
|
2209
|
-
var _filters$i, _filters$i
|
|
2210
|
-
|
|
2211
|
-
return !f ? true : filters == null ? void 0 : (_filters$i = filters[i]) == null ? void 0 : (_filters$i$props = _filters$i.props) == null ? void 0 : _filters$i$props.onChange(f, item);
|
|
4173
|
+
var _filters$i$props$onCh, _filters$i;
|
|
4174
|
+
return !f ? true : (_filters$i$props$onCh = filters == null || (_filters$i = filters[i]) == null || (_filters$i = _filters$i.props) == null || _filters$i.onChange == null ? void 0 : _filters$i.onChange(f, item)) != null ? _filters$i$props$onCh : true;
|
|
2212
4175
|
}).reduce(function (r, v) {
|
|
2213
4176
|
return r && v;
|
|
2214
4177
|
}, true);
|
|
2215
4178
|
}));
|
|
2216
4179
|
}, [filters, items, tableFilters]);
|
|
2217
|
-
/**
|
|
2218
|
-
* Whenever a new filter is selected by the user, update the state of selectedFilters
|
|
2219
|
-
* @param selected filter selections
|
|
2220
|
-
* @param index filter to update with new selections
|
|
4180
|
+
/**
|
|
4181
|
+
* Whenever a new filter is selected by the user, update the state of selectedFilters
|
|
4182
|
+
* @param selected filter selections
|
|
4183
|
+
* @param index filter to update with new selections
|
|
2221
4184
|
*/
|
|
2222
|
-
|
|
2223
4185
|
var onFilterChange = function onFilterChange(selected, index) {
|
|
2224
4186
|
handleItemsPropChangeCallback();
|
|
2225
4187
|
setTableFilters(function (prevState) {
|
|
@@ -2227,15 +4189,13 @@ function FilterableTable(_ref) {
|
|
|
2227
4189
|
return [].concat(prevState);
|
|
2228
4190
|
});
|
|
2229
4191
|
};
|
|
2230
|
-
/**
|
|
2231
|
-
* Pagination component
|
|
2232
|
-
* @param variant top or bottom
|
|
2233
|
-
* @returns Pagination component based on variant
|
|
4192
|
+
/**
|
|
4193
|
+
* Pagination component
|
|
4194
|
+
* @param variant top or bottom
|
|
4195
|
+
* @returns Pagination component based on variant
|
|
2234
4196
|
*/
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
4197
|
var renderPagination = function renderPagination(variant) {
|
|
2238
|
-
return (filteredItems == null ? void 0 : filteredItems.length) > 0 &&
|
|
4198
|
+
return (filteredItems == null ? void 0 : filteredItems.length) > 0 && jsxRuntime.jsx(reactCore.Pagination, {
|
|
2239
4199
|
itemCount: (filteredItems == null ? void 0 : filteredItems.length) || 0,
|
|
2240
4200
|
page: page,
|
|
2241
4201
|
perPage: perPage,
|
|
@@ -2254,80 +4214,99 @@ function FilterableTable(_ref) {
|
|
|
2254
4214
|
}
|
|
2255
4215
|
});
|
|
2256
4216
|
};
|
|
2257
|
-
/**
|
|
2258
|
-
* Toolbar populated with provided filters
|
|
4217
|
+
/**
|
|
4218
|
+
* Toolbar populated with provided filters
|
|
2259
4219
|
*/
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
}
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
4220
|
+
var header = jsxRuntime.jsx(reactCore.Toolbar, {
|
|
4221
|
+
children: jsxRuntime.jsxs(reactCore.ToolbarContent, {
|
|
4222
|
+
children: [filters == null ? void 0 : filters.map(function (el, i) {
|
|
4223
|
+
return jsxRuntime.jsx(reactCore.ToolbarItem, {
|
|
4224
|
+
className: 'filterable-table__toolbar__item--filter',
|
|
4225
|
+
children: React.cloneElement(el, {
|
|
4226
|
+
onChange: function onChange(selectedFilters) {
|
|
4227
|
+
return onFilterChange(selectedFilters, i);
|
|
4228
|
+
}
|
|
4229
|
+
})
|
|
4230
|
+
}, i);
|
|
4231
|
+
}), actions == null ? void 0 : actions.map(function (el, i) {
|
|
4232
|
+
return jsxRuntime.jsx(reactCore.ToolbarItem, {
|
|
4233
|
+
className: 'filterable-table__toolbar__item--action',
|
|
4234
|
+
children: el
|
|
4235
|
+
}, i);
|
|
4236
|
+
}), jsxRuntime.jsx(reactCore.ToolbarItem, {
|
|
4237
|
+
variant: 'pagination',
|
|
4238
|
+
children: renderPagination('top')
|
|
4239
|
+
})]
|
|
4240
|
+
})
|
|
4241
|
+
});
|
|
4242
|
+
return jsxRuntime.jsxs("div", {
|
|
4243
|
+
className: 'filterable-table',
|
|
4244
|
+
children: [isLoading ? jsxRuntime.jsx(reactCore.Bullseye, {
|
|
4245
|
+
style: {
|
|
4246
|
+
minHeight: '15rem'
|
|
4247
|
+
},
|
|
4248
|
+
children: jsxRuntime.jsx("div", {
|
|
4249
|
+
children: jsxRuntime.jsx(reactCore.Title, {
|
|
4250
|
+
headingLevel: 'h3',
|
|
4251
|
+
children: jsxRuntime.jsx(reactCore.Spinner, {
|
|
4252
|
+
size: 'lg'
|
|
4253
|
+
})
|
|
4254
|
+
})
|
|
4255
|
+
})
|
|
4256
|
+
}) : jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
4257
|
+
children: [header, jsxRuntime.jsxs(Table, {
|
|
4258
|
+
"aria-label": 'Packages Table',
|
|
4259
|
+
gridBreakPoint: 'grid-xl',
|
|
4260
|
+
children: [jsxRuntime.jsx(Thead, {
|
|
4261
|
+
children: jsxRuntime.jsx(Tr, {
|
|
4262
|
+
children: columns.map(function (col, colIdx) {
|
|
4263
|
+
return jsxRuntime.jsx(Th, _extends({}, col.sortField ? {
|
|
4264
|
+
sort: {
|
|
4265
|
+
onSort: onSort,
|
|
4266
|
+
sortBy: sortTableBy,
|
|
4267
|
+
columnIndex: colIdx
|
|
4268
|
+
}
|
|
4269
|
+
} : {}, {
|
|
4270
|
+
children: col.title
|
|
4271
|
+
}), "pkg-table-head-" + colIdx);
|
|
4272
|
+
})
|
|
4273
|
+
})
|
|
4274
|
+
}), jsxRuntime.jsx(Tbody, {
|
|
4275
|
+
children: rows.length > 0 ? rows.map(function (row, rowIdx) {
|
|
4276
|
+
return jsxRuntime.jsx(Tr, {
|
|
4277
|
+
children: columns.map(function (_col, colIdx) {
|
|
4278
|
+
var _renderRow;
|
|
4279
|
+
return jsxRuntime.jsx(Td, {
|
|
4280
|
+
children: (_renderRow = renderRow(row)) == null ? void 0 : _renderRow[colIdx]
|
|
4281
|
+
}, "pkg-table-row-" + rowIdx + "-col-" + colIdx);
|
|
4282
|
+
})
|
|
4283
|
+
}, "pkg-table-row-" + rowIdx);
|
|
4284
|
+
}) : jsxRuntime.jsx(Tr, {
|
|
4285
|
+
children: jsxRuntime.jsx(Td, {
|
|
4286
|
+
colSpan: columns.length,
|
|
4287
|
+
children: jsxRuntime.jsx(reactCore.EmptyState, {
|
|
4288
|
+
children: jsxRuntime.jsx(reactCore.EmptyStateHeader, {
|
|
4289
|
+
titleText: 'No results found',
|
|
4290
|
+
icon: jsxRuntime.jsx(reactCore.EmptyStateIcon, {
|
|
4291
|
+
icon: SearchIcon
|
|
4292
|
+
}),
|
|
4293
|
+
headingLevel: 'h5'
|
|
4294
|
+
})
|
|
4295
|
+
})
|
|
4296
|
+
})
|
|
4297
|
+
})
|
|
4298
|
+
})]
|
|
4299
|
+
})]
|
|
4300
|
+
}), renderPagination('bottom')]
|
|
4301
|
+
});
|
|
2321
4302
|
}
|
|
2322
4303
|
|
|
2323
4304
|
var FilterInput = function FilterInput(_ref) {
|
|
2324
4305
|
var onChangeHandler = _ref.onChange,
|
|
2325
|
-
|
|
2326
|
-
|
|
4306
|
+
placeholder = _ref.placeholder;
|
|
2327
4307
|
var _useState = React.useState(''),
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
4308
|
+
searchStr = _useState[0],
|
|
4309
|
+
setSearchStr = _useState[1];
|
|
2331
4310
|
var onChange = function onChange(event, text) {
|
|
2332
4311
|
event.stopPropagation();
|
|
2333
4312
|
event.preventDefault();
|
|
@@ -2336,102 +4315,98 @@ var FilterInput = function FilterInput(_ref) {
|
|
|
2336
4315
|
return text;
|
|
2337
4316
|
});
|
|
2338
4317
|
};
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
}
|
|
2358
|
-
})
|
|
4318
|
+
return jsxRuntime.jsx("div", {
|
|
4319
|
+
className: 'filter-input',
|
|
4320
|
+
children: jsxRuntime.jsx(reactCore.SearchInput, {
|
|
4321
|
+
value: searchStr,
|
|
4322
|
+
placeholder: placeholder,
|
|
4323
|
+
onChange: onChange,
|
|
4324
|
+
"aria-label": 'Text input filter',
|
|
4325
|
+
onFocus: function onFocus(event) {
|
|
4326
|
+
event.stopPropagation();
|
|
4327
|
+
event.preventDefault();
|
|
4328
|
+
},
|
|
4329
|
+
onClick: function onClick(event) {
|
|
4330
|
+
event.stopPropagation();
|
|
4331
|
+
event.preventDefault();
|
|
4332
|
+
},
|
|
4333
|
+
onClear: function onClear(event) {
|
|
4334
|
+
return onChange(event, '');
|
|
4335
|
+
}
|
|
4336
|
+
})
|
|
4337
|
+
});
|
|
2359
4338
|
};
|
|
2360
4339
|
|
|
2361
4340
|
var ExcludedPackagesTable = function ExcludedPackagesTable(_ref) {
|
|
2362
4341
|
var excludedPackages = _ref.excludedPackages,
|
|
2363
|
-
|
|
2364
|
-
|
|
4342
|
+
isLoading = _ref.isLoading;
|
|
2365
4343
|
var renderPackagesRow = function renderPackagesRow(_ref2) {
|
|
2366
4344
|
var gpg = _ref2.gpg,
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
return [gpg ?
|
|
4345
|
+
name = _ref2.name,
|
|
4346
|
+
version = _ref2.version,
|
|
4347
|
+
release = _ref2.release,
|
|
4348
|
+
architecture = _ref2.architecture,
|
|
4349
|
+
nvra = _ref2.nvra,
|
|
4350
|
+
summary = _ref2.summary;
|
|
4351
|
+
return [gpg ? jsxRuntime.jsx("a", {
|
|
2374
4352
|
href: "https://access.redhat.com/downloads/content/" + name + "/" + version + "}-" + release + "/" + architecture + "/" + (gpg == null ? void 0 : gpg.slice(-8)) + "/package",
|
|
2375
4353
|
target: '_blank',
|
|
2376
|
-
rel: 'noopener noreferrer'
|
|
2377
|
-
|
|
4354
|
+
rel: 'noopener noreferrer',
|
|
4355
|
+
children: nvra
|
|
4356
|
+
}) : jsxRuntime.jsx("span", {
|
|
4357
|
+
children: nvra
|
|
4358
|
+
}), summary];
|
|
2378
4359
|
};
|
|
2379
|
-
|
|
2380
4360
|
var onTextInputFilterChange = function onTextInputFilterChange(text, _ref3) {
|
|
2381
4361
|
var nvra = _ref3.nvra,
|
|
2382
|
-
|
|
4362
|
+
summary = _ref3.summary;
|
|
2383
4363
|
return ("" + (nvra + summary)).toLowerCase().includes(text.toLowerCase());
|
|
2384
4364
|
};
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
}));
|
|
4365
|
+
return jsxRuntime.jsx("div", {
|
|
4366
|
+
className: 'excluded-packages-table',
|
|
4367
|
+
children: jsxRuntime.jsx(FilterableTable, {
|
|
4368
|
+
isLoading: isLoading,
|
|
4369
|
+
tableName: 'Excluded packages table',
|
|
4370
|
+
columns: [{
|
|
4371
|
+
title: 'Excluded Package'
|
|
4372
|
+
}, {
|
|
4373
|
+
title: 'Summary'
|
|
4374
|
+
}],
|
|
4375
|
+
items: excludedPackages,
|
|
4376
|
+
renderRow: renderPackagesRow,
|
|
4377
|
+
perPageOptions: [{
|
|
4378
|
+
title: '5',
|
|
4379
|
+
value: 5
|
|
4380
|
+
}, {
|
|
4381
|
+
title: '10',
|
|
4382
|
+
value: 10
|
|
4383
|
+
}, {
|
|
4384
|
+
title: '20',
|
|
4385
|
+
value: 20
|
|
4386
|
+
}],
|
|
4387
|
+
filters: [jsxRuntime.jsx(FilterInput, {
|
|
4388
|
+
onChange: onTextInputFilterChange,
|
|
4389
|
+
placeholder: 'Filter excluded packages'
|
|
4390
|
+
}, 'excluded-packages-table__filter-input')]
|
|
4391
|
+
})
|
|
4392
|
+
});
|
|
2414
4393
|
};
|
|
2415
4394
|
|
|
2416
4395
|
function EcoSelect(_ref) {
|
|
2417
4396
|
var variant = _ref.variant,
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
4397
|
+
placeholderText = _ref.placeholderText,
|
|
4398
|
+
options = _ref.options,
|
|
4399
|
+
onChange = _ref.onChange,
|
|
4400
|
+
ariaLabel = _ref['aria-label'];
|
|
2423
4401
|
var _useState = React.useState(false),
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
4402
|
+
isOpen = _useState[0],
|
|
4403
|
+
setIsOpen = _useState[1];
|
|
2427
4404
|
var _useState2 = React.useState([]),
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
4405
|
+
selected = _useState2[0],
|
|
4406
|
+
setSelected = _useState2[1];
|
|
2431
4407
|
var _onToggle = function onToggle(isOpen) {
|
|
2432
4408
|
return setIsOpen(isOpen);
|
|
2433
4409
|
};
|
|
2434
|
-
|
|
2435
4410
|
var onSelect = function onSelect(event, selection) {
|
|
2436
4411
|
var result = selected.includes(selection) ? selected.filter(function (item) {
|
|
2437
4412
|
return item !== selection;
|
|
@@ -2439,35 +4414,36 @@ function EcoSelect(_ref) {
|
|
|
2439
4414
|
setSelected(result);
|
|
2440
4415
|
onChange && onChange(result, event);
|
|
2441
4416
|
};
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
4417
|
+
var id = React.useMemo(function () {
|
|
4418
|
+
return "select-" + Math.random().toString(36).substring(2, 11);
|
|
4419
|
+
}, []);
|
|
4420
|
+
return jsxRuntime.jsx("div", {
|
|
4421
|
+
className: 'select',
|
|
4422
|
+
children: jsxRuntime.jsx(deprecated.Select, {
|
|
4423
|
+
id: id,
|
|
4424
|
+
variant: variant,
|
|
4425
|
+
"aria-label": ariaLabel,
|
|
4426
|
+
onToggle: function onToggle(_event, isOpen) {
|
|
4427
|
+
return _onToggle(isOpen);
|
|
4428
|
+
},
|
|
4429
|
+
onSelect: onSelect,
|
|
4430
|
+
selections: selected,
|
|
4431
|
+
isOpen: isOpen,
|
|
4432
|
+
placeholderText: placeholderText,
|
|
4433
|
+
className: 'pf-select-wrapper',
|
|
4434
|
+
children: options.map(function (option) {
|
|
4435
|
+
return jsxRuntime.jsx(deprecated.SelectOption, {
|
|
4436
|
+
value: option
|
|
4437
|
+
}, option);
|
|
4438
|
+
})
|
|
4439
|
+
})
|
|
4440
|
+
});
|
|
2464
4441
|
}
|
|
2465
4442
|
|
|
2466
4443
|
var ToggleGroup = function ToggleGroup(props) {
|
|
2467
4444
|
var _useState = React.useState(''),
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
4445
|
+
selected = _useState[0],
|
|
4446
|
+
setSelected = _useState[1];
|
|
2471
4447
|
var onClick = function onClick(_, event) {
|
|
2472
4448
|
var id = event.currentTarget.id;
|
|
2473
4449
|
setSelected(function () {
|
|
@@ -2475,188 +4451,191 @@ var ToggleGroup = function ToggleGroup(props) {
|
|
|
2475
4451
|
return id;
|
|
2476
4452
|
});
|
|
2477
4453
|
};
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
}));
|
|
4454
|
+
return jsxRuntime.jsx(reactCore.ToggleGroup, {
|
|
4455
|
+
"aria-label": props['aria-label'],
|
|
4456
|
+
children: props.options.map(function (option, index) {
|
|
4457
|
+
return jsxRuntime.jsx(reactCore.ToggleGroupItem, {
|
|
4458
|
+
text: option.text,
|
|
4459
|
+
buttonId: option.id,
|
|
4460
|
+
isSelected: selected === option.id,
|
|
4461
|
+
onChange: function onChange(event, _) {
|
|
4462
|
+
return onClick(_, event);
|
|
4463
|
+
}
|
|
4464
|
+
}, index);
|
|
4465
|
+
})
|
|
4466
|
+
});
|
|
2492
4467
|
};
|
|
2493
4468
|
|
|
2494
|
-
/* eslint-disable camelcase */
|
|
2495
4469
|
var VulnerabilitiesTable = function VulnerabilitiesTable(_ref) {
|
|
2496
4470
|
var vulnerabilities = _ref.vulnerabilities,
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
4471
|
+
isLoading = _ref.isLoading,
|
|
4472
|
+
hideToggler = _ref.hideToggler;
|
|
2500
4473
|
var getImpact = function getImpact(_ref2) {
|
|
2501
4474
|
var severity = _ref2.severity;
|
|
2502
|
-
return
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
4475
|
+
return jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
4476
|
+
children: jsxRuntime.jsxs("div", {
|
|
4477
|
+
className: 'vulnerabilities-table__impact-cell',
|
|
4478
|
+
children: [jsxRuntime.jsx(SecurityIcon, {
|
|
4479
|
+
className: "impact-icon color-" + severity.toLowerCase()
|
|
4480
|
+
}), jsxRuntime.jsx("span", {
|
|
4481
|
+
children: severity
|
|
4482
|
+
})]
|
|
4483
|
+
})
|
|
4484
|
+
});
|
|
2507
4485
|
};
|
|
2508
|
-
|
|
2509
4486
|
var getCVE = function getCVE(_ref3) {
|
|
2510
4487
|
var cve_id = _ref3.cve_id;
|
|
2511
|
-
return
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
4488
|
+
return jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
4489
|
+
children: jsxRuntime.jsx("div", {
|
|
4490
|
+
className: 'vulnerabilities-table__cve-cell',
|
|
4491
|
+
children: jsxRuntime.jsx("a", {
|
|
4492
|
+
href: "https://access.redhat.com/security/cve/" + cve_id,
|
|
4493
|
+
target: '_blank',
|
|
4494
|
+
rel: 'noopener noreferrer',
|
|
4495
|
+
children: cve_id
|
|
4496
|
+
})
|
|
4497
|
+
})
|
|
4498
|
+
});
|
|
2518
4499
|
};
|
|
2519
|
-
|
|
2520
4500
|
var getAffectedPackages = function getAffectedPackages(rpms) {
|
|
2521
|
-
return
|
|
2522
|
-
|
|
4501
|
+
return jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
4502
|
+
children: rpms == null ? void 0 : rpms.map(function (_temp, index) {
|
|
4503
|
+
var _ref4 = _temp === void 0 ? {} : _temp,
|
|
2523
4504
|
gpg = _ref4.gpg,
|
|
2524
4505
|
name = _ref4.name,
|
|
2525
4506
|
version = _ref4.version,
|
|
2526
4507
|
release = _ref4.release,
|
|
2527
4508
|
architecture = _ref4.architecture,
|
|
2528
4509
|
nvra = _ref4.nvra;
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
4510
|
+
return gpg ? jsxRuntime.jsx("div", {
|
|
4511
|
+
className: 'vulnerabilities-table__affected-packages-cell',
|
|
4512
|
+
children: jsxRuntime.jsx("a", {
|
|
4513
|
+
href: "https://access.redhat.com/downloads/content/" + name + "/" + version + "-" + release + "/" + architecture + "/" + (gpg == null ? void 0 : gpg.slice(-8)) + "/package",
|
|
4514
|
+
target: '_blank',
|
|
4515
|
+
rel: 'noopener noreferrer',
|
|
4516
|
+
children: nvra
|
|
4517
|
+
})
|
|
4518
|
+
}, "affected-package-" + index) : jsxRuntime.jsx("div", {
|
|
4519
|
+
className: 'vulnerabilities-table__affected-packages-cell',
|
|
4520
|
+
children: jsxRuntime.jsx("span", {
|
|
4521
|
+
children: nvra
|
|
4522
|
+
})
|
|
4523
|
+
}, "affected-package-" + index);
|
|
4524
|
+
})
|
|
4525
|
+
});
|
|
2542
4526
|
};
|
|
2543
|
-
|
|
2544
4527
|
var getRPMAdvisory = function getRPMAdvisory(_ref5) {
|
|
2545
4528
|
var advisory_type = _ref5.advisory_type,
|
|
2546
|
-
|
|
2547
|
-
return
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
4529
|
+
advisory_id = _ref5.advisory_id;
|
|
4530
|
+
return jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
4531
|
+
children: jsxRuntime.jsx("div", {
|
|
4532
|
+
className: 'vulnerabilities-table__rpm-advisory-cell',
|
|
4533
|
+
children: advisory_type && advisory_id ? jsxRuntime.jsxs("a", {
|
|
4534
|
+
href: "https://access.redhat.com/errata/" + advisory_type + "-" + advisory_id,
|
|
4535
|
+
target: '_blank',
|
|
4536
|
+
rel: 'noopener noreferrer',
|
|
4537
|
+
children: [advisory_type, "-", advisory_id]
|
|
4538
|
+
}) : jsxRuntime.jsx("span", {
|
|
4539
|
+
children: "-"
|
|
4540
|
+
})
|
|
4541
|
+
})
|
|
4542
|
+
});
|
|
2554
4543
|
};
|
|
2555
|
-
|
|
2556
4544
|
var renderVulnerabilitiesRow = function renderVulnerabilitiesRow(vulnerability) {
|
|
2557
4545
|
return [getImpact(vulnerability), getCVE(vulnerability), getAffectedPackages(vulnerability.rpm_nvra_with_link_data), getRPMAdvisory(vulnerability), vulnerability != null && vulnerability.creation_date ? dateFns.format(new Date(vulnerability == null ? void 0 : vulnerability.creation_date), 'MMM dd, yyyy hh:mm a') : ''];
|
|
2558
4546
|
};
|
|
2559
|
-
|
|
2560
4547
|
var onTextInputFilterChange = function onTextInputFilterChange(text, _ref6) {
|
|
2561
4548
|
var rpm_nvra_with_link_data = _ref6.rpm_nvra_with_link_data,
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
4549
|
+
severity = _ref6.severity,
|
|
4550
|
+
cve_id = _ref6.cve_id,
|
|
4551
|
+
advisory_id = _ref6.advisory_id;
|
|
2565
4552
|
var nvraList = rpm_nvra_with_link_data.reduce(function (result, _ref7) {
|
|
2566
4553
|
var nvra = _ref7.nvra;
|
|
2567
4554
|
return result += nvra;
|
|
2568
4555
|
}, '');
|
|
2569
4556
|
return ("" + (severity + cve_id + advisory_id + nvraList)).toLowerCase().includes(text.toLowerCase());
|
|
2570
4557
|
};
|
|
2571
|
-
|
|
2572
4558
|
var onStatusFilterChange = function onStatusFilterChange(selected, vulnerability) {
|
|
2573
4559
|
return selected === 'fixed' ? !!(vulnerability != null && vulnerability.advisory_id) : selected === 'unfixed' ? !(vulnerability != null && vulnerability.advisory_id) : true;
|
|
2574
4560
|
};
|
|
2575
|
-
|
|
2576
4561
|
var onImpactFilterChange = function onImpactFilterChange(selected, vulnerability) {
|
|
2577
4562
|
return selected.length > 0 ? selected.includes(vulnerability.severity) : true;
|
|
2578
4563
|
};
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
}
|
|
2590
|
-
}, {
|
|
2591
|
-
title: 'CVE',
|
|
2592
|
-
sortField: 'cve_id'
|
|
2593
|
-
}, {
|
|
2594
|
-
title: 'Affected Package(s)'
|
|
2595
|
-
}, {
|
|
2596
|
-
title: 'RPM Advisory',
|
|
2597
|
-
sortField: 'advisory_id'
|
|
2598
|
-
}, {
|
|
2599
|
-
title: 'Created',
|
|
2600
|
-
sortField: 'creation_date',
|
|
2601
|
-
sortFn: function sortFn(vulnerability) {
|
|
2602
|
-
return new Date(vulnerability == null ? void 0 : vulnerability.creation_date).getTime();
|
|
2603
|
-
}
|
|
2604
|
-
}],
|
|
2605
|
-
items: vulnerabilities,
|
|
2606
|
-
renderRow: renderVulnerabilitiesRow,
|
|
2607
|
-
isLoading: isLoading,
|
|
2608
|
-
perPageOptions: [{
|
|
2609
|
-
title: '5',
|
|
2610
|
-
value: 5
|
|
2611
|
-
}, {
|
|
2612
|
-
title: '10',
|
|
2613
|
-
value: 10
|
|
2614
|
-
}, {
|
|
2615
|
-
title: '20',
|
|
2616
|
-
value: 20
|
|
2617
|
-
}],
|
|
2618
|
-
filters: [React__default["default"].createElement(FilterInput, {
|
|
2619
|
-
key: 'vulnerabilities-table__filter-input',
|
|
2620
|
-
onChange: onTextInputFilterChange,
|
|
2621
|
-
placeholder: 'Filter vulnerabilities'
|
|
2622
|
-
}), !hideToggler ? React__default["default"].createElement(ToggleGroup, {
|
|
2623
|
-
key: 'vulnerabilities-table__toggle-group',
|
|
2624
|
-
onChange: onStatusFilterChange,
|
|
2625
|
-
"aria-label": 'Vulnerability status filter',
|
|
2626
|
-
options: [{
|
|
2627
|
-
id: 'all',
|
|
2628
|
-
text: 'All'
|
|
4564
|
+
return jsxRuntime.jsx("div", {
|
|
4565
|
+
className: 'vulnerabilities-table',
|
|
4566
|
+
children: jsxRuntime.jsx(FilterableTable, {
|
|
4567
|
+
tableName: 'Vulnerabilities impact table',
|
|
4568
|
+
columns: [{
|
|
4569
|
+
title: 'Impact',
|
|
4570
|
+
sortField: 'severity',
|
|
4571
|
+
sortFn: function sortFn(vulnerability) {
|
|
4572
|
+
return severitySortOrder[vulnerability.severity];
|
|
4573
|
+
}
|
|
2629
4574
|
}, {
|
|
2630
|
-
|
|
2631
|
-
|
|
4575
|
+
title: 'CVE',
|
|
4576
|
+
sortField: 'cve_id'
|
|
2632
4577
|
}, {
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
4578
|
+
title: 'Affected Package(s)'
|
|
4579
|
+
}, {
|
|
4580
|
+
title: 'RPM Advisory',
|
|
4581
|
+
sortField: 'advisory_id'
|
|
4582
|
+
}, {
|
|
4583
|
+
title: 'Created',
|
|
4584
|
+
sortField: 'creation_date',
|
|
4585
|
+
sortFn: function sortFn(vulnerability) {
|
|
4586
|
+
return new Date(vulnerability == null ? void 0 : vulnerability.creation_date).getTime();
|
|
4587
|
+
}
|
|
4588
|
+
}],
|
|
4589
|
+
items: vulnerabilities,
|
|
4590
|
+
renderRow: renderVulnerabilitiesRow,
|
|
4591
|
+
isLoading: isLoading,
|
|
4592
|
+
perPageOptions: [{
|
|
4593
|
+
title: '5',
|
|
4594
|
+
value: 5
|
|
4595
|
+
}, {
|
|
4596
|
+
title: '10',
|
|
4597
|
+
value: 10
|
|
4598
|
+
}, {
|
|
4599
|
+
title: '20',
|
|
4600
|
+
value: 20
|
|
4601
|
+
}],
|
|
4602
|
+
filters: [jsxRuntime.jsx(FilterInput, {
|
|
4603
|
+
onChange: onTextInputFilterChange,
|
|
4604
|
+
placeholder: 'Filter vulnerabilities'
|
|
4605
|
+
}, 'vulnerabilities-table__filter-input'), !hideToggler ? jsxRuntime.jsx(ToggleGroup, {
|
|
4606
|
+
onChange: onStatusFilterChange,
|
|
4607
|
+
"aria-label": 'Vulnerability status filter',
|
|
4608
|
+
options: [{
|
|
4609
|
+
id: 'all',
|
|
4610
|
+
text: 'All'
|
|
4611
|
+
}, {
|
|
4612
|
+
id: 'fixed',
|
|
4613
|
+
text: 'Fixed'
|
|
4614
|
+
}, {
|
|
4615
|
+
id: 'unfixed',
|
|
4616
|
+
text: 'Unfixed'
|
|
4617
|
+
}]
|
|
4618
|
+
}, 'vulnerabilities-table__toggle-group') : jsxRuntime.jsx(jsxRuntime.Fragment, {}), jsxRuntime.jsx(EcoSelect, {
|
|
4619
|
+
onChange: onImpactFilterChange,
|
|
4620
|
+
"aria-label": 'Impact filter',
|
|
4621
|
+
placeholderText: 'Impact',
|
|
4622
|
+
variant: 'checkbox',
|
|
4623
|
+
options: Array.from(new Set(vulnerabilities.map(function (vulnerability) {
|
|
4624
|
+
return vulnerability.severity;
|
|
4625
|
+
})))
|
|
4626
|
+
}, 'vulnerabilities-table__select')]
|
|
4627
|
+
})
|
|
4628
|
+
});
|
|
2647
4629
|
};
|
|
2648
4630
|
|
|
2649
|
-
/* eslint-disable camelcase */
|
|
2650
4631
|
var severitySortOrder = {
|
|
2651
4632
|
Critical: 1,
|
|
2652
4633
|
Important: 2,
|
|
2653
4634
|
Moderate: 3,
|
|
2654
4635
|
Low: 4
|
|
2655
4636
|
};
|
|
2656
|
-
|
|
2657
4637
|
var InsertCss = function InsertCss() {
|
|
2658
4638
|
var styleId = 'example-component-styles';
|
|
2659
|
-
|
|
2660
4639
|
if (!document.getElementById(styleId)) {
|
|
2661
4640
|
var styleTag = document.createElement('style');
|
|
2662
4641
|
styleTag.id = styleId;
|
|
@@ -2664,58 +4643,50 @@ var InsertCss = function InsertCss() {
|
|
|
2664
4643
|
document.body.appendChild(styleTag);
|
|
2665
4644
|
}
|
|
2666
4645
|
};
|
|
2667
|
-
|
|
2668
4646
|
var PackagesTable = function PackagesTable(_ref) {
|
|
2669
4647
|
var _ref$vulnerabilities = _ref.vulnerabilities,
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
activeKey = _React$useState3[0],
|
|
2687
|
-
setActiveKey = _React$useState3[1];
|
|
2688
|
-
|
|
2689
|
-
React__namespace.useEffect(function () {
|
|
4648
|
+
vulnerabilities = _ref$vulnerabilities === void 0 ? [] : _ref$vulnerabilities,
|
|
4649
|
+
_ref$rpms = _ref.rpms,
|
|
4650
|
+
rpms = _ref$rpms === void 0 ? [] : _ref$rpms,
|
|
4651
|
+
hideToggler = _ref.hideToggler,
|
|
4652
|
+
_ref$isLoading = _ref.isLoading,
|
|
4653
|
+
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading;
|
|
4654
|
+
var _useState = React.useState([]),
|
|
4655
|
+
excludedPackages = _useState[0],
|
|
4656
|
+
setExcludedPackages = _useState[1];
|
|
4657
|
+
var _useState2 = React.useState([]),
|
|
4658
|
+
uniqueVulnerabilities = _useState2[0],
|
|
4659
|
+
setUniqueVulnerabilities = _useState2[1];
|
|
4660
|
+
var _useState3 = React.useState(0),
|
|
4661
|
+
activeKey = _useState3[0],
|
|
4662
|
+
setActiveKey = _useState3[1];
|
|
4663
|
+
React.useEffect(function () {
|
|
2690
4664
|
var VALID_REDHAT_GPG_KEYS = ['199e2f91fd431d51', '5326810137017186', '45689c882fa658e0', '219180cddb42a60e', '7514f77d8366b0d9', 'fd372689897da07a', '938a80caf21541eb', '08b871e6a5787476'];
|
|
2691
4665
|
var packages = rpms.filter(function (_ref2) {
|
|
2692
4666
|
var gpg = _ref2.gpg;
|
|
2693
4667
|
return !VALID_REDHAT_GPG_KEYS.includes(gpg);
|
|
2694
4668
|
});
|
|
2695
4669
|
setExcludedPackages(packages);
|
|
2696
|
-
var uniqueVulnerabilities = [].concat(vulnerabilities);
|
|
2697
|
-
|
|
4670
|
+
var uniqueVulnerabilities = [].concat(vulnerabilities);
|
|
4671
|
+
// augment vulnerabilities with link data
|
|
2698
4672
|
uniqueVulnerabilities.forEach(function (vulnerability) {
|
|
2699
|
-
vulnerability.rpm_nvra_with_link_data = [];
|
|
2700
|
-
|
|
4673
|
+
vulnerability.rpm_nvra_with_link_data = [];
|
|
4674
|
+
// // CONNCERT-2121
|
|
2701
4675
|
if (vulnerability != null && vulnerability.affected_packages) {
|
|
2702
4676
|
var _vulnerability$affect;
|
|
2703
|
-
|
|
2704
|
-
vulnerability == null ? void 0 : (_vulnerability$affect = vulnerability.affected_packages) == null ? void 0 : _vulnerability$affect.forEach(function (_ref3) {
|
|
4677
|
+
vulnerability == null || (_vulnerability$affect = vulnerability.affected_packages) == null || _vulnerability$affect.forEach(function (_ref3) {
|
|
2705
4678
|
var name = _ref3.name,
|
|
2706
|
-
|
|
4679
|
+
arch = _ref3.arch;
|
|
2707
4680
|
var link_data = rpms == null ? void 0 : rpms.filter(function (rpm) {
|
|
2708
|
-
return rpm.name === name && rpm.architecture === arch;
|
|
4681
|
+
return rpm.name === name && rpm.architecture === arch && !excludedPackages.includes(rpm);
|
|
2709
4682
|
});
|
|
2710
4683
|
vulnerability.rpm_nvra_with_link_data.push(link_data[0]);
|
|
2711
4684
|
});
|
|
2712
4685
|
} else {
|
|
2713
4686
|
var _vulnerability$packag;
|
|
2714
|
-
|
|
2715
|
-
vulnerability == null ? void 0 : (_vulnerability$packag = vulnerability.packages) == null ? void 0 : _vulnerability$packag.forEach(function (p) {
|
|
4687
|
+
vulnerability == null || (_vulnerability$packag = vulnerability.packages) == null || _vulnerability$packag.forEach(function (p) {
|
|
2716
4688
|
var _p$rpm_nvra;
|
|
2717
|
-
|
|
2718
|
-
return p == null ? void 0 : (_p$rpm_nvra = p.rpm_nvra) == null ? void 0 : _p$rpm_nvra.forEach(function (rpm_nvra) {
|
|
4689
|
+
return p == null || (_p$rpm_nvra = p.rpm_nvra) == null ? void 0 : _p$rpm_nvra.forEach(function (rpm_nvra) {
|
|
2719
4690
|
var link_data = rpms == null ? void 0 : rpms.filter(function (pk) {
|
|
2720
4691
|
return pk.nvra === rpm_nvra;
|
|
2721
4692
|
});
|
|
@@ -2723,14 +4694,13 @@ var PackagesTable = function PackagesTable(_ref) {
|
|
|
2723
4694
|
});
|
|
2724
4695
|
});
|
|
2725
4696
|
}
|
|
2726
|
-
|
|
2727
4697
|
return vulnerability;
|
|
2728
|
-
});
|
|
2729
|
-
|
|
4698
|
+
});
|
|
4699
|
+
// sort vulnerabilities by severity
|
|
2730
4700
|
uniqueVulnerabilities.sort(function (vulnerability) {
|
|
2731
4701
|
return severitySortOrder[vulnerability.severity];
|
|
2732
|
-
});
|
|
2733
|
-
|
|
4702
|
+
});
|
|
4703
|
+
// filter out vulnerabilities with duplicate CVE IDs
|
|
2734
4704
|
uniqueVulnerabilities.filter(function (value, index, self) {
|
|
2735
4705
|
return self.findIndex(function (vulnerability) {
|
|
2736
4706
|
return vulnerability.cve_id === value.cve_id;
|
|
@@ -2739,32 +4709,39 @@ var PackagesTable = function PackagesTable(_ref) {
|
|
|
2739
4709
|
setUniqueVulnerabilities(uniqueVulnerabilities);
|
|
2740
4710
|
}, [rpms, vulnerabilities]);
|
|
2741
4711
|
InsertCss();
|
|
2742
|
-
return
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
4712
|
+
return jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
4713
|
+
children: (uniqueVulnerabilities.length > 0 || excludedPackages.length > 0) && jsxRuntime.jsx("div", {
|
|
4714
|
+
className: 'packages-table',
|
|
4715
|
+
children: jsxRuntime.jsxs(reactCore.Tabs, {
|
|
4716
|
+
activeKey: activeKey,
|
|
4717
|
+
onSelect: function onSelect(_evt, tabKey) {
|
|
4718
|
+
return setActiveKey(tabKey);
|
|
4719
|
+
},
|
|
4720
|
+
variant: 'default',
|
|
4721
|
+
isBox: true,
|
|
4722
|
+
"aria-label": 'vulnerability tab',
|
|
4723
|
+
children: [uniqueVulnerabilities.length > 0 && jsxRuntime.jsx(reactCore.Tab, {
|
|
4724
|
+
eventKey: 0,
|
|
4725
|
+
title: "Vulnerabilities (" + uniqueVulnerabilities.length + ")",
|
|
4726
|
+
children: jsxRuntime.jsx(VulnerabilitiesTable, {
|
|
4727
|
+
vulnerabilities: uniqueVulnerabilities,
|
|
4728
|
+
isLoading: isLoading,
|
|
4729
|
+
hideToggler: hideToggler
|
|
4730
|
+
})
|
|
4731
|
+
}), excludedPackages.length > 0 && jsxRuntime.jsxs(reactCore.Tab, {
|
|
4732
|
+
eventKey: 1,
|
|
4733
|
+
title: "Excluded Packages (" + excludedPackages.length + ")",
|
|
4734
|
+
children: [jsxRuntime.jsx("p", {
|
|
4735
|
+
className: 'packages-table__excluded-packages-disclaimer',
|
|
4736
|
+
children: "The following packages were found in this image and cannot be scanned or compared to public vulnerability information. This image may include additional packages or content not found or listed below."
|
|
4737
|
+
}), jsxRuntime.jsx(ExcludedPackagesTable, {
|
|
4738
|
+
excludedPackages: excludedPackages,
|
|
4739
|
+
isLoading: isLoading
|
|
4740
|
+
})]
|
|
4741
|
+
})]
|
|
4742
|
+
})
|
|
4743
|
+
})
|
|
4744
|
+
});
|
|
2768
4745
|
};
|
|
2769
4746
|
|
|
2770
4747
|
exports.PackagesTable = PackagesTable;
|