@splunk/react-ui 4.20.0 → 4.21.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/Accordion.js +425 -441
- package/Anchor.js +147 -193
- package/Animation.js +142 -166
- package/AnimationToggle.js +197 -253
- package/Box.js +145 -194
- package/Breadcrumbs.js +288 -298
- package/Button.js +488 -613
- package/ButtonGroup.js +160 -212
- package/ButtonSimple.js +543 -562
- package/CHANGELOG.md +26 -0
- package/Calendar.js +1107 -1195
- package/Card.js +771 -746
- package/CardLayout.js +205 -223
- package/Chip.js +509 -612
- package/Clickable.js +416 -472
- package/CloseButton.js +165 -250
- package/Code.js +1808 -2172
- package/Code.js.LICENSE.txt +8 -0
- package/CollapsiblePanel.js +586 -675
- package/Color.js +1066 -1297
- package/ColumnLayout.js +402 -465
- package/ComboBox.js +892 -969
- package/Concertina.js +998 -963
- package/ControlGroup.js +687 -718
- package/Date.js +567 -697
- package/DefinitionList.js +308 -310
- package/Divider.js +149 -194
- package/Dropdown.js +459 -558
- package/DualListbox.js +1480 -1735
- package/EventListener.js +94 -165
- package/File.js +1051 -1173
- package/FormRows.js +885 -880
- package/Heading.js +216 -263
- package/Image.js +446 -558
- package/JSONTree.js +690 -699
- package/Layer.js +442 -582
- package/Link.js +336 -361
- package/List.js +213 -237
- package/Markdown.js +510 -612
- package/Menu.js +1109 -1331
- package/Message.js +474 -629
- package/MessageBar.js +387 -561
- package/Modal.js +810 -798
- package/ModalLayer.js +326 -343
- package/Monogram.js +308 -368
- package/Multiselect.js +3558 -3998
- package/Number.js +729 -843
- package/Paginator.js +510 -615
- package/Paragraph.js +145 -188
- package/Popover.js +1470 -1693
- package/Progress.js +301 -362
- package/RadioBar.js +610 -651
- package/RadioList.js +483 -544
- package/Resize.js +530 -623
- package/ResultsMenu.js +494 -597
- package/ScreenReaderContent.js +142 -187
- package/Scroll.js +595 -598
- package/ScrollContainerContext.js +197 -278
- package/Search.js +745 -817
- package/Select.js +2441 -2746
- package/SidePanel.js +390 -392
- package/Slider.js +668 -825
- package/SlidingPanels.js +639 -645
- package/SplitButton.js +464 -499
- package/StaticContent.js +161 -217
- package/StepBar.js +386 -466
- package/Switch.js +710 -764
- package/TabBar.js +724 -815
- package/TabLayout.js +406 -438
- package/Table.js +4842 -5121
- package/Text.js +1169 -1351
- package/TextArea.js +1097 -1307
- package/Tooltip.js +624 -721
- package/TransitionOpen.js +489 -546
- package/Typography.js +176 -229
- package/WaitSpinner.js +230 -298
- package/package.json +14 -15
- package/stubs-splunkui.d.ts +4 -1
- package/types/src/ComboBox/Option.d.ts +1 -1
- package/types/src/Concertina/Concertina.d.ts +4 -0
- package/types/src/JSONTree/JSONTreeContext.d.ts +7 -0
- package/types/src/JSONTree/TreeNode.d.ts +5 -0
- package/types/src/Link/Link.d.ts +7 -3
- package/types/src/Link/docs/examples/NewWindow.d.ts +2 -0
- package/types/src/Markdown/Markdown.d.ts +1 -1
- package/types/src/Markdown/renderers/MarkdownHeading.d.ts +1 -1
- package/types/src/Menu/Item.d.ts +1 -1
- package/types/src/Menu/Menu.d.ts +1 -0
- package/types/src/MessageBar/docs/examples/WithActions.d.ts +2 -0
- package/types/src/Multiselect/Option.d.ts +1 -1
- package/types/src/Search/Option.d.ts +1 -1
- package/types/src/Select/Option.d.ts +1 -1
- package/types/src/Select/OptionBase.d.ts +1 -1
- package/types/src/fixtures/FetchOptions.d.ts +2 -8
- package/useForceUpdate.js +112 -146
- package/useKeyPress.js +74 -128
- package/usePrevious.js +65 -129
- package/useRovingFocus.js +122 -218
- package/types/src/Link/docs/examples/NewTab.d.ts +0 -2
- /package/types/src/Table/docs/examples/{DockedHeader.d.ts → DockedHeaderScrollbar.d.ts} +0 -0
- /package/types/src/Table/docs/examples/prisma/{DockedHeader.d.ts → DockedHeaderScrollbar.d.ts} +0 -0
package/JSONTree.js
CHANGED
|
@@ -1,711 +1,702 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/******/
|
|
4
|
-
/******/
|
|
5
|
-
/******/
|
|
6
|
-
/******/
|
|
7
|
-
|
|
8
|
-
/******/
|
|
9
|
-
/******/
|
|
10
|
-
/******/
|
|
11
|
-
/******/
|
|
12
|
-
/******/
|
|
13
|
-
/******/
|
|
14
|
-
/******/
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
/******/
|
|
20
|
-
/******/
|
|
21
|
-
/******/
|
|
22
|
-
/******/
|
|
23
|
-
/******/
|
|
24
|
-
/******/
|
|
25
|
-
/******/
|
|
26
|
-
/******/
|
|
27
|
-
/******/
|
|
28
|
-
/******/
|
|
29
|
-
/******/
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
/******/
|
|
34
|
-
/******/
|
|
35
|
-
/******/
|
|
36
|
-
/******/
|
|
37
|
-
/******/
|
|
38
|
-
/******/
|
|
39
|
-
/******/
|
|
40
|
-
/******/
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
/******/
|
|
44
|
-
/******/
|
|
45
|
-
/******/
|
|
46
|
-
/******/
|
|
47
|
-
/******/
|
|
48
|
-
/******/
|
|
49
|
-
/******/
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
/******/
|
|
53
|
-
/******/
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
/******/
|
|
57
|
-
/******/
|
|
58
|
-
/******/
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
/******/ return ns;
|
|
66
|
-
/******/ };
|
|
67
|
-
/******/
|
|
68
|
-
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
69
|
-
/******/ __webpack_require__.n = function(module) {
|
|
70
|
-
/******/ var getter = module && module.__esModule ?
|
|
71
|
-
/******/ function getDefault() { return module['default']; } :
|
|
72
|
-
/******/ function getModuleExports() { return module; };
|
|
73
|
-
/******/ __webpack_require__.d(getter, 'a', getter);
|
|
74
|
-
/******/ return getter;
|
|
75
|
-
/******/ };
|
|
76
|
-
/******/
|
|
77
|
-
/******/ // Object.prototype.hasOwnProperty.call
|
|
78
|
-
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
|
79
|
-
/******/
|
|
80
|
-
/******/ // __webpack_public_path__
|
|
81
|
-
/******/ __webpack_require__.p = "";
|
|
82
|
-
/******/
|
|
83
|
-
/******/
|
|
84
|
-
/******/ // Load entry module and return exports
|
|
85
|
-
/******/ return __webpack_require__(__webpack_require__.s = 196);
|
|
86
|
-
/******/ })
|
|
87
|
-
/************************************************************************/
|
|
88
|
-
/******/ ({
|
|
89
|
-
|
|
90
|
-
/***/ 0:
|
|
91
|
-
/***/ (function(module, exports) {
|
|
92
|
-
|
|
93
|
-
module.exports = require("@splunk/themes");
|
|
94
|
-
|
|
95
|
-
/***/ }),
|
|
96
|
-
|
|
97
|
-
/***/ 1:
|
|
98
|
-
/***/ (function(module, exports) {
|
|
99
|
-
|
|
100
|
-
module.exports = require("prop-types");
|
|
101
|
-
|
|
102
|
-
/***/ }),
|
|
103
|
-
|
|
104
|
-
/***/ 116:
|
|
105
|
-
/***/ (function(module, exports) {
|
|
106
|
-
|
|
107
|
-
module.exports = require("lodash/isObject");
|
|
108
|
-
|
|
109
|
-
/***/ }),
|
|
110
|
-
|
|
111
|
-
/***/ 12:
|
|
112
|
-
/***/ (function(module, exports) {
|
|
113
|
-
|
|
114
|
-
module.exports = require("@splunk/react-ui/Clickable");
|
|
115
|
-
|
|
116
|
-
/***/ }),
|
|
117
|
-
|
|
118
|
-
/***/ 122:
|
|
119
|
-
/***/ (function(module, exports) {
|
|
120
|
-
|
|
121
|
-
module.exports = require("lodash/fill");
|
|
122
|
-
|
|
123
|
-
/***/ }),
|
|
124
|
-
|
|
125
|
-
/***/ 196:
|
|
126
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
127
|
-
|
|
128
|
-
"use strict";
|
|
129
|
-
// ESM COMPAT FLAG
|
|
130
|
-
__webpack_require__.r(__webpack_exports__);
|
|
131
|
-
|
|
132
|
-
// EXPORTS
|
|
133
|
-
__webpack_require__.d(__webpack_exports__, "default", function() { return /* reexport */ JSONTree_JSONTree; });
|
|
134
|
-
|
|
135
|
-
// EXTERNAL MODULE: external "react"
|
|
136
|
-
var external_react_ = __webpack_require__(2);
|
|
137
|
-
var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
|
|
138
|
-
|
|
139
|
-
// EXTERNAL MODULE: external "prop-types"
|
|
140
|
-
var external_prop_types_ = __webpack_require__(1);
|
|
141
|
-
var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_);
|
|
142
|
-
|
|
143
|
-
// EXTERNAL MODULE: external "lodash/isString"
|
|
144
|
-
var isString_ = __webpack_require__(23);
|
|
145
|
-
var isString_default = /*#__PURE__*/__webpack_require__.n(isString_);
|
|
146
|
-
|
|
147
|
-
// EXTERNAL MODULE: external "lodash/fill"
|
|
148
|
-
var fill_ = __webpack_require__(122);
|
|
149
|
-
var fill_default = /*#__PURE__*/__webpack_require__.n(fill_);
|
|
150
|
-
|
|
151
|
-
// EXTERNAL MODULE: external "lodash/isArray"
|
|
152
|
-
var isArray_ = __webpack_require__(76);
|
|
153
|
-
var isArray_default = /*#__PURE__*/__webpack_require__.n(isArray_);
|
|
154
|
-
|
|
155
|
-
// EXTERNAL MODULE: external "lodash/isEmpty"
|
|
156
|
-
var isEmpty_ = __webpack_require__(90);
|
|
157
|
-
var isEmpty_default = /*#__PURE__*/__webpack_require__.n(isEmpty_);
|
|
158
|
-
|
|
159
|
-
// EXTERNAL MODULE: external "lodash/isNumber"
|
|
160
|
-
var isNumber_ = __webpack_require__(77);
|
|
161
|
-
var isNumber_default = /*#__PURE__*/__webpack_require__.n(isNumber_);
|
|
162
|
-
|
|
163
|
-
// EXTERNAL MODULE: external "lodash/isObject"
|
|
164
|
-
var isObject_ = __webpack_require__(116);
|
|
165
|
-
var isObject_default = /*#__PURE__*/__webpack_require__.n(isObject_);
|
|
166
|
-
|
|
167
|
-
// EXTERNAL MODULE: external "lodash/keys"
|
|
168
|
-
var keys_ = __webpack_require__(9);
|
|
169
|
-
var keys_default = /*#__PURE__*/__webpack_require__.n(keys_);
|
|
170
|
-
|
|
171
|
-
// EXTERNAL MODULE: external "lodash/repeat"
|
|
172
|
-
var repeat_ = __webpack_require__(82);
|
|
173
|
-
var repeat_default = /*#__PURE__*/__webpack_require__.n(repeat_);
|
|
174
|
-
|
|
175
|
-
// EXTERNAL MODULE: external "styled-components"
|
|
176
|
-
var external_styled_components_ = __webpack_require__(3);
|
|
177
|
-
var external_styled_components_default = /*#__PURE__*/__webpack_require__.n(external_styled_components_);
|
|
178
|
-
|
|
179
|
-
// EXTERNAL MODULE: external "@splunk/react-ui/Clickable"
|
|
180
|
-
var Clickable_ = __webpack_require__(12);
|
|
181
|
-
var Clickable_default = /*#__PURE__*/__webpack_require__.n(Clickable_);
|
|
182
|
-
|
|
183
|
-
// EXTERNAL MODULE: external "@splunk/themes"
|
|
184
|
-
var themes_ = __webpack_require__(0);
|
|
185
|
-
|
|
186
|
-
// CONCATENATED MODULE: ./src/JSONTree/TreeNodeStyles.ts
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
var typeColor = {
|
|
191
|
-
string: Object(themes_["pick"])({
|
|
192
|
-
enterprise: {
|
|
193
|
-
dark: '#00b0b3',
|
|
194
|
-
light: '#00787A'
|
|
195
|
-
},
|
|
196
|
-
prisma: themes_["variables"].syntaxTeal
|
|
197
|
-
}),
|
|
198
|
-
number: Object(themes_["pick"])({
|
|
199
|
-
enterprise: {
|
|
200
|
-
dark: '#8bacfd',
|
|
201
|
-
light: '#1f5df9'
|
|
202
|
-
},
|
|
203
|
-
prisma: themes_["variables"].syntaxBlue
|
|
204
|
-
}),
|
|
205
|
-
"boolean": Object(themes_["pick"])({
|
|
206
|
-
enterprise: {
|
|
207
|
-
dark: '#af8aff',
|
|
208
|
-
light: themes_["variables"].syntaxPurple
|
|
209
|
-
},
|
|
210
|
-
prisma: themes_["variables"].syntaxPurple
|
|
211
|
-
}),
|
|
212
|
-
"null": Object(themes_["pick"])({
|
|
213
|
-
enterprise: {
|
|
214
|
-
dark: '#f0b375',
|
|
215
|
-
light: '#ad5700'
|
|
216
|
-
},
|
|
217
|
-
prisma: themes_["variables"].syntaxBrown
|
|
218
|
-
}),
|
|
219
|
-
object: themes_["variables"].contentColorDefault
|
|
220
|
-
};
|
|
221
|
-
var wrap = Object(external_styled_components_["css"])(["word-break:break-word;word-wrap:break-word;"]);
|
|
222
|
-
var TreeNodeStyles_scroll = Object(external_styled_components_["css"])(["white-space:nowrap;"]);
|
|
223
|
-
var StyledValue = external_styled_components_default.a.span.withConfig({
|
|
224
|
-
displayName: "TreeNodeStyles__StyledValue",
|
|
225
|
-
componentId: "sc-1rdul18-0"
|
|
226
|
-
})(["color:", ";", ";"], function (_ref) {
|
|
227
|
-
var valueType = _ref.valueType;
|
|
228
|
-
return typeColor[valueType];
|
|
229
|
-
}, function (_ref2) {
|
|
230
|
-
var overflowType = _ref2.overflowType;
|
|
231
|
-
return overflowType === 'wrap' ? wrap : TreeNodeStyles_scroll;
|
|
232
|
-
});
|
|
233
|
-
var StyledValueInteractiveClickable = external_styled_components_default()(StyledValue.withComponent(Clickable_default.a)).withConfig({
|
|
234
|
-
displayName: "TreeNodeStyles__StyledValueInteractiveClickable",
|
|
235
|
-
componentId: "sc-1rdul18-1"
|
|
236
|
-
})(["font-family:inherit;&:focus{box-shadow:0 0 1px 3px ", ";outline:0;&:active{box-shadow:none;}}&:hover{background-color:", ";}"], themes_["variables"].focusColor, Object(themes_["pick"])({
|
|
237
|
-
enterprise: themes_["variables"].backgroundColorHover,
|
|
238
|
-
prisma: themes_["variables"].interactiveColorOverlayHover
|
|
239
|
-
}));
|
|
240
|
-
var StyledProperty = external_styled_components_default.a.span.withConfig({
|
|
241
|
-
displayName: "TreeNodeStyles__StyledProperty",
|
|
242
|
-
componentId: "sc-1rdul18-2"
|
|
243
|
-
})(["font-weight:bold;color:", ";"], Object(themes_["pick"])({
|
|
244
|
-
enterprise: {
|
|
245
|
-
dark: '#ec9f98',
|
|
246
|
-
light: themes_["variables"].syntaxRed
|
|
247
|
-
},
|
|
248
|
-
prisma: themes_["variables"].syntaxRed
|
|
249
|
-
}));
|
|
250
|
-
var StyledPropertyInteractiveClickable = external_styled_components_default()(StyledProperty.withComponent(Clickable_default.a)).withConfig({
|
|
251
|
-
displayName: "TreeNodeStyles__StyledPropertyInteractiveClickable",
|
|
252
|
-
componentId: "sc-1rdul18-3"
|
|
253
|
-
})(["font-family:inherit;&:focus{box-shadow:0 0 1px 3px ", ";outline:0;&:active{box-shadow:none;}}&:hover{background-color:", ";}"], themes_["variables"].focusColor, Object(themes_["pick"])({
|
|
254
|
-
enterprise: themes_["variables"].backgroundColorHover,
|
|
255
|
-
prisma: themes_["variables"].interactiveColorOverlayHover
|
|
256
|
-
}));
|
|
257
|
-
var StyledExpandLinkClickable = external_styled_components_default()(Clickable_default.a).withConfig({
|
|
258
|
-
displayName: "TreeNodeStyles__StyledExpandLinkClickable",
|
|
259
|
-
componentId: "sc-1rdul18-4"
|
|
260
|
-
})(["cursor:pointer;color:", ";font-family:inherit;&:hover{background-color:", ";text-decoration:none;}&:focus{box-shadow:", ";&:active{box-shadow:none;}}", ""], Object(themes_["pick"])({
|
|
261
|
-
enterprise: {
|
|
262
|
-
dark: themes_["variables"].accentColorL20,
|
|
263
|
-
light: themes_["variables"].accentColorD20
|
|
264
|
-
},
|
|
265
|
-
prisma: themes_["variables"].interactiveColorPrimary
|
|
266
|
-
}), Object(themes_["pick"])({
|
|
267
|
-
enterprise: themes_["variables"].backgroundColorHover,
|
|
268
|
-
prisma: themes_["variables"].interactiveColorOverlayHover
|
|
269
|
-
}), themes_["variables"].focusShadowInset, Object(themes_["pick"])({
|
|
270
|
-
prisma: Object(external_styled_components_["css"])(["border-radius:", ";"], themes_["variables"].borderRadius)
|
|
271
|
-
}));
|
|
272
|
-
|
|
273
|
-
// CONCATENATED MODULE: ./src/JSONTree/TreeNode.tsx
|
|
274
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
275
|
-
|
|
276
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
277
|
-
|
|
278
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
279
|
-
|
|
280
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
281
|
-
|
|
282
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
|
|
283
|
-
|
|
284
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
285
|
-
|
|
286
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
287
|
-
|
|
288
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
289
|
-
|
|
290
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
291
|
-
|
|
292
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
293
|
-
|
|
294
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
295
|
-
|
|
296
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
297
|
-
|
|
298
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
299
|
-
|
|
300
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
301
|
-
|
|
302
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
303
|
-
|
|
304
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
305
|
-
|
|
306
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
307
|
-
|
|
308
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
var propTypes = {
|
|
322
|
-
path: external_prop_types_default.a.arrayOf(external_prop_types_default.a.oneOfType([external_prop_types_default.a.number, external_prop_types_default.a.string])),
|
|
323
|
-
defaultOpen: external_prop_types_default.a.bool,
|
|
324
|
-
expandChildren: external_prop_types_default.a.oneOfType([external_prop_types_default.a.bool, external_prop_types_default.a.oneOf(['withShiftModifier'])]),
|
|
325
|
-
indent: external_prop_types_default.a.number,
|
|
326
|
-
indentLevel: external_prop_types_default.a.number,
|
|
327
|
-
obj: external_prop_types_default.a.oneOfType([external_prop_types_default.a.object, external_prop_types_default.a.array, external_prop_types_default.a.number, external_prop_types_default.a.string, external_prop_types_default.a.bool]).isRequired,
|
|
328
|
-
onClickKey: external_prop_types_default.a.func,
|
|
329
|
-
onClickValue: external_prop_types_default.a.func,
|
|
330
|
-
overflow: external_prop_types_default.a.oneOf(['wrap', 'scroll'])
|
|
331
|
-
};
|
|
332
|
-
var defaultProps = {
|
|
333
|
-
path: [],
|
|
334
|
-
defaultOpen: false,
|
|
335
|
-
expandChildren: false,
|
|
336
|
-
indent: 4,
|
|
337
|
-
indentLevel: 1,
|
|
338
|
-
overflow: 'scroll'
|
|
339
|
-
};
|
|
340
|
-
var shift;
|
|
341
|
-
/**
|
|
342
|
-
* An internal container class for expandable tree nodes (objects and arrays).
|
|
343
|
-
*/
|
|
344
|
-
|
|
345
|
-
var TreeNode_JSONTreeNode = /*#__PURE__*/function (_Component) {
|
|
346
|
-
_inherits(JSONTreeNode, _Component);
|
|
347
|
-
|
|
348
|
-
var _super = _createSuper(JSONTreeNode);
|
|
349
|
-
|
|
350
|
-
function JSONTreeNode(props) {
|
|
351
|
-
var _this;
|
|
352
|
-
|
|
353
|
-
_classCallCheck(this, JSONTreeNode);
|
|
354
|
-
|
|
355
|
-
_this = _super.call(this, props);
|
|
356
|
-
|
|
357
|
-
_defineProperty(_assertThisInitialized(_this), "regularIndent", void 0);
|
|
358
|
-
|
|
359
|
-
_defineProperty(_assertThisInitialized(_this), "closingIndent", void 0);
|
|
360
|
-
|
|
361
|
-
_defineProperty(_assertThisInitialized(_this), "handleExpandClick", function (e) {
|
|
362
|
-
if (_this.props.expandChildren === 'withShiftModifier') {
|
|
363
|
-
shift = e.shiftKey;
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
_this.setState(function (state) {
|
|
367
|
-
return {
|
|
368
|
-
open: !state.open
|
|
369
|
-
};
|
|
370
|
-
});
|
|
371
|
-
});
|
|
372
|
-
|
|
373
|
-
_defineProperty(_assertThisInitialized(_this), "handleClickKey", function (e, key) {
|
|
374
|
-
var _this$props$onClickKe, _this$props;
|
|
375
|
-
|
|
376
|
-
var path = _this.props.path; // When rendering a single value key is not present, here we prevent `[undefined]` in path
|
|
377
|
-
|
|
378
|
-
var keyPath = key !== undefined ? [].concat(_toConsumableArray(path), [key]) : _toConsumableArray(path);
|
|
379
|
-
var keyPathString = ".".concat(keyPath.join('.'));
|
|
380
|
-
(_this$props$onClickKe = (_this$props = _this.props).onClickKey) === null || _this$props$onClickKe === void 0 ? void 0 : _this$props$onClickKe.call(_this$props, e, {
|
|
381
|
-
key: keyPathString,
|
|
382
|
-
keyPath: keyPath
|
|
383
|
-
});
|
|
384
|
-
});
|
|
385
|
-
|
|
386
|
-
_defineProperty(_assertThisInitialized(_this), "handleClickValue", function (e, key) {
|
|
387
|
-
var _this$props$onClickVa, _this$props2;
|
|
388
|
-
|
|
389
|
-
var path = _this.props.path; // When rendering a single value key is not present, here we prevent `[undefined]` in path
|
|
390
|
-
|
|
391
|
-
var keyPath = key !== undefined ? [].concat(_toConsumableArray(path), [key]) : _toConsumableArray(path);
|
|
392
|
-
var keyPathString = ".".concat(keyPath.join('.'));
|
|
393
|
-
(_this$props$onClickVa = (_this$props2 = _this.props).onClickValue) === null || _this$props$onClickVa === void 0 ? void 0 : _this$props$onClickVa.call(_this$props2, e, {
|
|
394
|
-
key: keyPathString,
|
|
395
|
-
keyPath: keyPath,
|
|
396
|
-
value: e.target.textContent // TS: cannot be null in this component, see textContent docs
|
|
397
|
-
|
|
398
|
-
});
|
|
1
|
+
/******/ (() => {
|
|
2
|
+
// webpackBootstrap
|
|
3
|
+
/******/ "use strict";
|
|
4
|
+
/******/ // The require scope
|
|
5
|
+
/******/ var e = {};
|
|
6
|
+
/******/
|
|
7
|
+
/************************************************************************/
|
|
8
|
+
/******/ /* webpack/runtime/compat get default export */
|
|
9
|
+
/******/ (() => {
|
|
10
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
11
|
+
/******/ e.n = r => {
|
|
12
|
+
/******/ var t = r && r.__esModule ?
|
|
13
|
+
/******/ () => r["default"]
|
|
14
|
+
/******/ : () => r
|
|
15
|
+
/******/;
|
|
16
|
+
e.d(t, {
|
|
17
|
+
a: t
|
|
18
|
+
});
|
|
19
|
+
/******/ return t;
|
|
20
|
+
/******/ };
|
|
21
|
+
/******/ })();
|
|
22
|
+
/******/
|
|
23
|
+
/******/ /* webpack/runtime/define property getters */
|
|
24
|
+
/******/ (() => {
|
|
25
|
+
/******/ // define getter functions for harmony exports
|
|
26
|
+
/******/ e.d = (r, t) => {
|
|
27
|
+
/******/ for (var n in t) {
|
|
28
|
+
/******/ if (e.o(t, n) && !e.o(r, n)) {
|
|
29
|
+
/******/ Object.defineProperty(r, n, {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
get: t[n]
|
|
32
|
+
});
|
|
33
|
+
/******/ }
|
|
34
|
+
/******/ }
|
|
35
|
+
/******/ };
|
|
36
|
+
/******/ })();
|
|
37
|
+
/******/
|
|
38
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
39
|
+
/******/ (() => {
|
|
40
|
+
/******/ e.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r)
|
|
41
|
+
/******/;
|
|
42
|
+
})();
|
|
43
|
+
/******/
|
|
44
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
45
|
+
/******/ (() => {
|
|
46
|
+
/******/ // define __esModule on exports
|
|
47
|
+
/******/ e.r = e => {
|
|
48
|
+
/******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
|
|
49
|
+
/******/ Object.defineProperty(e, Symbol.toStringTag, {
|
|
50
|
+
value: "Module"
|
|
51
|
+
});
|
|
52
|
+
/******/ }
|
|
53
|
+
/******/ Object.defineProperty(e, "__esModule", {
|
|
54
|
+
value: true
|
|
55
|
+
});
|
|
56
|
+
/******/ };
|
|
57
|
+
/******/ })();
|
|
58
|
+
/******/
|
|
59
|
+
/************************************************************************/ var r = {};
|
|
60
|
+
// ESM COMPAT FLAG
|
|
61
|
+
e.r(r);
|
|
62
|
+
// EXPORTS
|
|
63
|
+
e.d(r, {
|
|
64
|
+
default: () => /* reexport */ ke
|
|
399
65
|
});
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
66
|
+
// CONCATENATED MODULE: external "react"
|
|
67
|
+
const t = require("react");
|
|
68
|
+
var n = e.n(t);
|
|
69
|
+
// CONCATENATED MODULE: external "prop-types"
|
|
70
|
+
const o = require("prop-types");
|
|
71
|
+
var a = e.n(o);
|
|
72
|
+
// CONCATENATED MODULE: external "lodash/isString"
|
|
73
|
+
const i = require("lodash/isString");
|
|
74
|
+
var l = e.n(i);
|
|
75
|
+
// CONCATENATED MODULE: ./src/JSONTree/JSONTreeContext.ts
|
|
76
|
+
var u = (0, t.createContext)({});
|
|
77
|
+
u.displayName = "JSONTree";
|
|
78
|
+
/* harmony default export */ const c = u;
|
|
79
|
+
// CONCATENATED MODULE: external "lodash/fill"
|
|
80
|
+
const s = require("lodash/fill");
|
|
81
|
+
var f = e.n(s);
|
|
82
|
+
// CONCATENATED MODULE: external "lodash/isArray"
|
|
83
|
+
const p = require("lodash/isArray");
|
|
84
|
+
var d = e.n(p);
|
|
85
|
+
// CONCATENATED MODULE: external "lodash/isEmpty"
|
|
86
|
+
const v = require("lodash/isEmpty");
|
|
87
|
+
var y = e.n(v);
|
|
88
|
+
// CONCATENATED MODULE: external "lodash/isNumber"
|
|
89
|
+
const b = require("lodash/isNumber");
|
|
90
|
+
var h = e.n(b);
|
|
91
|
+
// CONCATENATED MODULE: external "lodash/isObject"
|
|
92
|
+
const m = require("lodash/isObject");
|
|
93
|
+
var k = e.n(m);
|
|
94
|
+
// CONCATENATED MODULE: external "lodash/keys"
|
|
95
|
+
const g = require("lodash/keys");
|
|
96
|
+
var w = e.n(g);
|
|
97
|
+
// CONCATENATED MODULE: external "lodash/repeat"
|
|
98
|
+
const C = require("lodash/repeat");
|
|
99
|
+
var S = e.n(C);
|
|
100
|
+
// CONCATENATED MODULE: external "styled-components"
|
|
101
|
+
const O = require("styled-components");
|
|
102
|
+
var x = e.n(O);
|
|
103
|
+
// CONCATENATED MODULE: external "@splunk/react-ui/Clickable"
|
|
104
|
+
const j = require("@splunk/react-ui/Clickable");
|
|
105
|
+
var T = e.n(j);
|
|
106
|
+
// CONCATENATED MODULE: external "@splunk/themes"
|
|
107
|
+
const E = require("@splunk/themes");
|
|
108
|
+
// CONCATENATED MODULE: ./src/JSONTree/TreeNodeStyles.ts
|
|
109
|
+
var _ = {
|
|
110
|
+
string: (0, E.pick)({
|
|
111
|
+
enterprise: {
|
|
112
|
+
dark: "#00b0b3",
|
|
113
|
+
light: "#00787A"
|
|
114
|
+
},
|
|
115
|
+
prisma: E.variables.syntaxTeal
|
|
116
|
+
}),
|
|
117
|
+
number: (0, E.pick)({
|
|
118
|
+
enterprise: {
|
|
119
|
+
dark: "#8bacfd",
|
|
120
|
+
light: "#1f5df9"
|
|
121
|
+
},
|
|
122
|
+
prisma: E.variables.syntaxBlue
|
|
123
|
+
}),
|
|
124
|
+
boolean: (0, E.pick)({
|
|
125
|
+
enterprise: {
|
|
126
|
+
dark: "#af8aff",
|
|
127
|
+
light: E.variables.syntaxPurple
|
|
128
|
+
},
|
|
129
|
+
prisma: E.variables.syntaxPurple
|
|
130
|
+
}),
|
|
131
|
+
null: (0, E.pick)({
|
|
132
|
+
enterprise: {
|
|
133
|
+
dark: "#f0b375",
|
|
134
|
+
light: "#ad5700"
|
|
135
|
+
},
|
|
136
|
+
prisma: E.variables.syntaxBrown
|
|
137
|
+
}),
|
|
138
|
+
object: E.variables.contentColorDefault
|
|
139
|
+
};
|
|
140
|
+
var I = (0, O.css)([ "word-break:break-word;word-wrap:break-word;" ]);
|
|
141
|
+
var P = (0, O.css)([ "white-space:nowrap;" ]);
|
|
142
|
+
var N = x().span.withConfig({
|
|
143
|
+
displayName: "TreeNodeStyles__StyledValue",
|
|
144
|
+
componentId: "sc-1rdul18-0"
|
|
145
|
+
})([ "color:", ";", ";" ], (function(e) {
|
|
146
|
+
var r = e.valueType;
|
|
147
|
+
return _[r];
|
|
148
|
+
}), (function(e) {
|
|
149
|
+
var r = e.overflowType;
|
|
150
|
+
return r === "wrap" ? I : P;
|
|
151
|
+
}));
|
|
152
|
+
var A = x()(N.withComponent(T())).withConfig({
|
|
153
|
+
displayName: "TreeNodeStyles__StyledValueInteractiveClickable",
|
|
154
|
+
componentId: "sc-1rdul18-1"
|
|
155
|
+
})([ "font-family:inherit;&:focus{box-shadow:0 0 1px 3px ", ";outline:0;&:active{box-shadow:none;}}&:hover{background-color:", ";}" ], E.variables.focusColor, (0,
|
|
156
|
+
E.pick)({
|
|
157
|
+
enterprise: E.variables.backgroundColorHover,
|
|
158
|
+
prisma: E.variables.interactiveColorOverlayHover
|
|
159
|
+
}));
|
|
160
|
+
var q = x().span.withConfig({
|
|
161
|
+
displayName: "TreeNodeStyles__StyledProperty",
|
|
162
|
+
componentId: "sc-1rdul18-2"
|
|
163
|
+
})([ "font-weight:bold;color:", ";" ], (0, E.pick)({
|
|
164
|
+
enterprise: {
|
|
165
|
+
dark: "#ec9f98",
|
|
166
|
+
light: E.variables.syntaxRed
|
|
426
167
|
},
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
168
|
+
prisma: E.variables.syntaxRed
|
|
169
|
+
}));
|
|
170
|
+
var K = x()(q.withComponent(T())).withConfig({
|
|
171
|
+
displayName: "TreeNodeStyles__StyledPropertyInteractiveClickable",
|
|
172
|
+
componentId: "sc-1rdul18-3"
|
|
173
|
+
})([ "font-family:inherit;&:focus{box-shadow:0 0 1px 3px ", ";outline:0;&:active{box-shadow:none;}}&:hover{background-color:", ";}" ], E.variables.focusColor, (0,
|
|
174
|
+
E.pick)({
|
|
175
|
+
enterprise: E.variables.backgroundColorHover,
|
|
176
|
+
prisma: E.variables.interactiveColorOverlayHover
|
|
177
|
+
}));
|
|
178
|
+
var V = x()(T()).withConfig({
|
|
179
|
+
displayName: "TreeNodeStyles__StyledExpandLinkClickable",
|
|
180
|
+
componentId: "sc-1rdul18-4"
|
|
181
|
+
})([ "cursor:pointer;color:", ";font-family:inherit;&:hover{background-color:", ";text-decoration:none;}&:focus{box-shadow:", ";&:active{box-shadow:none;}}", "" ], (0,
|
|
182
|
+
E.pick)({
|
|
183
|
+
enterprise: {
|
|
184
|
+
dark: E.variables.accentColorL20,
|
|
185
|
+
light: E.variables.accentColorD20
|
|
186
|
+
},
|
|
187
|
+
prisma: E.variables.interactiveColorPrimary
|
|
188
|
+
}), (0, E.pick)({
|
|
189
|
+
enterprise: E.variables.backgroundColorHover,
|
|
190
|
+
prisma: E.variables.interactiveColorOverlayHover
|
|
191
|
+
}), E.variables.focusShadowInset, (0, E.pick)({
|
|
192
|
+
prisma: (0, O.css)([ "border-radius:", ";" ], E.variables.borderRadius)
|
|
193
|
+
}));
|
|
194
|
+
// CONCATENATED MODULE: ./src/JSONTree/TreeNode.tsx
|
|
195
|
+
function R(e) {
|
|
196
|
+
"@babel/helpers - typeof";
|
|
197
|
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
198
|
+
R = function e(r) {
|
|
199
|
+
return typeof r;
|
|
200
|
+
};
|
|
457
201
|
} else {
|
|
458
|
-
|
|
202
|
+
R = function e(r) {
|
|
203
|
+
return r && typeof Symbol === "function" && r.constructor === Symbol && r !== Symbol.prototype ? "symbol" : typeof r;
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
return R(e);
|
|
207
|
+
}
|
|
208
|
+
function L(e) {
|
|
209
|
+
return J(e) || D(e) || H(e) || M();
|
|
210
|
+
}
|
|
211
|
+
function M() {
|
|
212
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
213
|
+
}
|
|
214
|
+
function H(e, r) {
|
|
215
|
+
if (!e) return;
|
|
216
|
+
if (typeof e === "string") return B(e, r);
|
|
217
|
+
var t = Object.prototype.toString.call(e).slice(8, -1);
|
|
218
|
+
if (t === "Object" && e.constructor) t = e.constructor.name;
|
|
219
|
+
if (t === "Map" || t === "Set") return Array.from(e);
|
|
220
|
+
if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return B(e, r);
|
|
221
|
+
}
|
|
222
|
+
function D(e) {
|
|
223
|
+
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(e)) return Array.from(e);
|
|
224
|
+
}
|
|
225
|
+
function J(e) {
|
|
226
|
+
if (Array.isArray(e)) return B(e);
|
|
227
|
+
}
|
|
228
|
+
function B(e, r) {
|
|
229
|
+
if (r == null || r > e.length) r = e.length;
|
|
230
|
+
for (var t = 0, n = new Array(r); t < r; t++) {
|
|
231
|
+
n[t] = e[t];
|
|
232
|
+
}
|
|
233
|
+
return n;
|
|
234
|
+
}
|
|
235
|
+
function F(e, r) {
|
|
236
|
+
if (!(e instanceof r)) {
|
|
237
|
+
throw new TypeError("Cannot call a class as a function");
|
|
459
238
|
}
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
239
|
+
}
|
|
240
|
+
function U(e, r) {
|
|
241
|
+
for (var t = 0; t < r.length; t++) {
|
|
242
|
+
var n = r[t];
|
|
243
|
+
n.enumerable = n.enumerable || false;
|
|
244
|
+
n.configurable = true;
|
|
245
|
+
if ("value" in n) n.writable = true;
|
|
246
|
+
Object.defineProperty(e, n.key, n);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
function $(e, r, t) {
|
|
250
|
+
if (r) U(e.prototype, r);
|
|
251
|
+
if (t) U(e, t);
|
|
252
|
+
return e;
|
|
253
|
+
}
|
|
254
|
+
function W(e, r) {
|
|
255
|
+
if (typeof r !== "function" && r !== null) {
|
|
256
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
257
|
+
}
|
|
258
|
+
e.prototype = Object.create(r && r.prototype, {
|
|
259
|
+
constructor: {
|
|
260
|
+
value: e,
|
|
261
|
+
writable: true,
|
|
262
|
+
configurable: true
|
|
263
|
+
}
|
|
475
264
|
});
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
265
|
+
if (r) z(e, r);
|
|
266
|
+
}
|
|
267
|
+
function z(e, r) {
|
|
268
|
+
z = Object.setPrototypeOf || function e(r, t) {
|
|
269
|
+
r.__proto__ = t;
|
|
270
|
+
return r;
|
|
271
|
+
};
|
|
272
|
+
return z(e, r);
|
|
273
|
+
}
|
|
274
|
+
function G(e) {
|
|
275
|
+
var r = Y();
|
|
276
|
+
return function t() {
|
|
277
|
+
var n = Z(e), o;
|
|
278
|
+
if (r) {
|
|
279
|
+
var a = Z(this).constructor;
|
|
280
|
+
o = Reflect.construct(n, arguments, a);
|
|
281
|
+
} else {
|
|
282
|
+
o = n.apply(this, arguments);
|
|
489
283
|
}
|
|
490
|
-
|
|
284
|
+
return Q(this, o);
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
function Q(e, r) {
|
|
288
|
+
if (r && (R(r) === "object" || typeof r === "function")) {
|
|
289
|
+
return r;
|
|
491
290
|
}
|
|
492
|
-
|
|
493
|
-
return /*#__PURE__*/external_react_default.a.createElement(StyledValue, {
|
|
494
|
-
valueType: valueType,
|
|
495
|
-
overflowType: overflow
|
|
496
|
-
}, representation);
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
return representation;
|
|
291
|
+
return X(e);
|
|
500
292
|
}
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
var onClickKey = this.props.onClickKey;
|
|
507
|
-
|
|
508
|
-
if (onClickKey) {
|
|
509
|
-
return /*#__PURE__*/external_react_default.a.createElement("span", null, /*#__PURE__*/external_react_default.a.createElement(StyledPropertyInteractiveClickable, {
|
|
510
|
-
onClick: function onClick(e) {
|
|
511
|
-
_this4.handleClickKey(e, key);
|
|
512
|
-
}
|
|
513
|
-
}, key), ":", ' ');
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
return /*#__PURE__*/external_react_default.a.createElement("span", null, /*#__PURE__*/external_react_default.a.createElement(StyledProperty, null, key), ":", ' ');
|
|
293
|
+
function X(e) {
|
|
294
|
+
if (e === void 0) {
|
|
295
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
296
|
+
}
|
|
297
|
+
return e;
|
|
517
298
|
}
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
return keys_default()(obj).map(function (mapKey, index, properties) {
|
|
529
|
-
var value = obj[mapKey]; // TS: should be safe based on (recursive) JSONElement type
|
|
530
|
-
|
|
531
|
-
var key = isArray_default()(obj) ? parseInt(mapKey, 10) : mapKey;
|
|
532
|
-
var propertyDataPath = path.length === 0 ? ".".concat(key) : ".".concat(path.join('.'), ".").concat(key);
|
|
533
|
-
|
|
534
|
-
var representation = _this5.renderValue({
|
|
535
|
-
key: key,
|
|
536
|
-
value: value
|
|
537
|
-
});
|
|
538
|
-
|
|
539
|
-
var propertyElement = !isArray_default()(obj) ? _this5.renderKey(key) : undefined;
|
|
540
|
-
return /*#__PURE__*/external_react_default.a.createElement("div", {
|
|
541
|
-
key: propertyDataPath,
|
|
542
|
-
role: "treeitem",
|
|
543
|
-
"data-test-path": propertyDataPath
|
|
544
|
-
}, _this5.regularIndent, propertyElement, representation, index + 1 < properties.length ? ',' : null);
|
|
545
|
-
});
|
|
546
|
-
} // edge case: a single number/string/boolean being rendered (still valid JSON)
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
return /*#__PURE__*/external_react_default.a.createElement("div", {
|
|
550
|
-
role: "treeitem",
|
|
551
|
-
"data-test-path": "."
|
|
552
|
-
}, this.renderValue({
|
|
553
|
-
value: obj
|
|
554
|
-
}));
|
|
299
|
+
function Y() {
|
|
300
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
301
|
+
if (Reflect.construct.sham) return false;
|
|
302
|
+
if (typeof Proxy === "function") return true;
|
|
303
|
+
try {
|
|
304
|
+
Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));
|
|
305
|
+
return true;
|
|
306
|
+
} catch (e) {
|
|
307
|
+
return false;
|
|
308
|
+
}
|
|
555
309
|
}
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
var isExpandable = isObject_default()(obj) && !isEmpty_default()(obj) || isArray_default()(obj) && obj.length > 0;
|
|
562
|
-
return /*#__PURE__*/external_react_default.a.createElement("span", {
|
|
563
|
-
"data-test": isExpandable ? 'node' : null,
|
|
564
|
-
"data-test-expanded": isExpandable ? this.state.open : null
|
|
565
|
-
}, isExpandable && (isArray_default()(obj) ? '[' : '{'), isExpandable && this.renderExpandLink(), !isExpandable || open ? this.renderObject() : null, !isExpandable || open ? this.closingIndent : null, isExpandable && (isArray_default()(obj) ? ']' : '}'));
|
|
310
|
+
function Z(e) {
|
|
311
|
+
Z = Object.setPrototypeOf ? Object.getPrototypeOf : function e(r) {
|
|
312
|
+
return r.__proto__ || Object.getPrototypeOf(r);
|
|
313
|
+
};
|
|
314
|
+
return Z(e);
|
|
566
315
|
}
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
var
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
var
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
316
|
+
function ee(e, r, t) {
|
|
317
|
+
if (r in e) {
|
|
318
|
+
Object.defineProperty(e, r, {
|
|
319
|
+
value: t,
|
|
320
|
+
enumerable: true,
|
|
321
|
+
configurable: true,
|
|
322
|
+
writable: true
|
|
323
|
+
});
|
|
324
|
+
} else {
|
|
325
|
+
e[r] = t;
|
|
326
|
+
}
|
|
327
|
+
return e;
|
|
328
|
+
}
|
|
329
|
+
var re = {
|
|
330
|
+
path: a().arrayOf(a().oneOfType([ a().number, a().string ])),
|
|
331
|
+
defaultOpen: a().bool,
|
|
332
|
+
expandChildren: a().oneOfType([ a().bool, a().oneOf([ "withShiftModifier" ]) ]),
|
|
333
|
+
indent: a().number,
|
|
334
|
+
indentLevel: a().number,
|
|
335
|
+
obj: a().oneOfType([ a().object, a().array, a().number, a().string, a().bool ]).isRequired,
|
|
336
|
+
onClickKey: a().func,
|
|
337
|
+
onClickValue: a().func,
|
|
338
|
+
overflow: a().oneOf([ "wrap", "scroll" ]),
|
|
339
|
+
shift: a().bool
|
|
340
|
+
};
|
|
341
|
+
var te = {
|
|
342
|
+
path: [],
|
|
343
|
+
defaultOpen: false,
|
|
344
|
+
expandChildren: false,
|
|
345
|
+
indent: 4,
|
|
346
|
+
indentLevel: 1,
|
|
347
|
+
overflow: "scroll"
|
|
348
|
+
};
|
|
349
|
+
/**
|
|
350
|
+
* An internal container class for expandable tree nodes (objects and arrays).
|
|
351
|
+
*/ var ne = function(e) {
|
|
352
|
+
W(t, e);
|
|
353
|
+
var r = G(t);
|
|
354
|
+
function t(e) {
|
|
355
|
+
var n;
|
|
356
|
+
F(this, t);
|
|
357
|
+
n = r.call(this, e);
|
|
358
|
+
ee(X(n), "regularIndent", void 0);
|
|
359
|
+
ee(X(n), "closingIndent", void 0);
|
|
360
|
+
ee(X(n), "mutableShift", void 0);
|
|
361
|
+
ee(X(n), "handleExpandClick", (function(e) {
|
|
362
|
+
if (n.props.expandChildren === "withShiftModifier") {
|
|
363
|
+
var r = n.context.updateShift;
|
|
364
|
+
if (r != null) {
|
|
365
|
+
n.mutableShift = e.shiftKey;
|
|
366
|
+
r(e.shiftKey);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
n.setState((function(e) {
|
|
370
|
+
return {
|
|
371
|
+
open: !e.open
|
|
372
|
+
};
|
|
373
|
+
}));
|
|
374
|
+
}));
|
|
375
|
+
ee(X(n), "handleClickKey", (function(e, r) {
|
|
376
|
+
var t, o;
|
|
377
|
+
var a = n.props.path;
|
|
378
|
+
// When rendering a single value key is not present, here we prevent `[undefined]` in path
|
|
379
|
+
var i = r !== undefined ? [].concat(L(a), [ r ]) : L(a);
|
|
380
|
+
var l = ".".concat(i.join("."));
|
|
381
|
+
(t = (o = n.props).onClickKey) === null || t === void 0 ? void 0 : t.call(o, e, {
|
|
382
|
+
key: l,
|
|
383
|
+
keyPath: i
|
|
384
|
+
});
|
|
385
|
+
}));
|
|
386
|
+
ee(X(n), "handleClickValue", (function(e, r) {
|
|
387
|
+
var t, o;
|
|
388
|
+
var a = n.props.path;
|
|
389
|
+
// When rendering a single value key is not present, here we prevent `[undefined]` in path
|
|
390
|
+
var i = r !== undefined ? [].concat(L(a), [ r ]) : L(a);
|
|
391
|
+
var l = ".".concat(i.join("."));
|
|
392
|
+
(t = (o = n.props).onClickValue) === null || t === void 0 ? void 0 : t.call(o, e, {
|
|
393
|
+
key: l,
|
|
394
|
+
keyPath: i,
|
|
395
|
+
value: e.target.textContent
|
|
396
|
+
});
|
|
397
|
+
}));
|
|
398
|
+
var o = n.props.shift;
|
|
399
|
+
n.mutableShift = o;
|
|
400
|
+
if (n.props.expandChildren === "withShiftModifier" && n.mutableShift != null) {
|
|
401
|
+
n.state = n.mutableShift ? {
|
|
402
|
+
open: true
|
|
403
|
+
} : {
|
|
404
|
+
open: false
|
|
405
|
+
};
|
|
406
|
+
} else {
|
|
407
|
+
n.state = {
|
|
408
|
+
open: e.defaultOpen
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
n.regularIndent = f()(Array(e.indentLevel), S()(" ", e.indent));
|
|
412
|
+
n.closingIndent = f()(Array(e.indentLevel - 1), S()(" ", e.indent));
|
|
413
|
+
return n;
|
|
414
|
+
}
|
|
415
|
+
$(t, [ {
|
|
416
|
+
key: "renderExpandLink",
|
|
417
|
+
value: function e() {
|
|
418
|
+
var r = this;
|
|
419
|
+
|
|
420
|
+
return n().createElement(V, {
|
|
421
|
+
onClick: function e(t) {
|
|
422
|
+
r.handleExpandClick(t);
|
|
423
|
+
},
|
|
424
|
+
"aria-expanded": this.state.open,
|
|
425
|
+
"data-test": "toggle"
|
|
426
|
+
}, " ", this.state.open ? "[-]" : "[+]", " ");
|
|
427
|
+
}
|
|
428
|
+
}, {
|
|
429
|
+
key: "renderValue",
|
|
430
|
+
value: function e(r) {
|
|
431
|
+
var o = this;
|
|
432
|
+
var a = r.value, i = r.key;
|
|
433
|
+
var u = this.props, c = u.expandChildren, s = u.indent, f = u.indentLevel, p = u.onClickKey, v = u.onClickValue, b = u.overflow, m = u.path, g = u.shift;
|
|
434
|
+
var w = null;
|
|
435
|
+
// determine if value should be represented as a simple string
|
|
436
|
+
// or as a child node
|
|
437
|
+
if (!k()(a)) {
|
|
438
|
+
// isObject is true for arrays
|
|
439
|
+
if (typeof a === "string") {
|
|
440
|
+
w = '"'.concat(a, '"');
|
|
441
|
+
} else if (typeof a === "boolean") {
|
|
442
|
+
w = a.toString();
|
|
443
|
+
} else if (a === null) {
|
|
444
|
+
w = "null";
|
|
445
|
+
} else {
|
|
446
|
+
w = a;
|
|
447
|
+
}
|
|
448
|
+
} else if (y()(a)) {
|
|
449
|
+
// isObject is true for arrays
|
|
450
|
+
w = d()(a) ? "[]" : "{}";
|
|
451
|
+
} else {
|
|
452
|
+
w = n().createElement(t, {
|
|
453
|
+
obj: a,
|
|
454
|
+
path: i !== undefined ? [].concat(L(m), [ i ]) : L(m),
|
|
455
|
+
defaultOpen: c === true,
|
|
456
|
+
expandChildren: c,
|
|
457
|
+
onClickKey: p,
|
|
458
|
+
onClickValue: v,
|
|
459
|
+
indent: s,
|
|
460
|
+
indentLevel: f + 1,
|
|
461
|
+
overflow: b,
|
|
462
|
+
shift: g
|
|
463
|
+
});
|
|
464
|
+
}
|
|
465
|
+
// for string or number representations, apply styles and optional interactivity
|
|
466
|
+
if (l()(w) || h()(w)) {
|
|
467
|
+
var C = a === null ? "null" : // TS: bigint, function, symbol are prevented by JSONElement type
|
|
468
|
+
R(a);
|
|
469
|
+
if (v) {
|
|
470
|
+
|
|
471
|
+
return n().createElement(A, {
|
|
472
|
+
valueType: C,
|
|
473
|
+
overflowType: b,
|
|
474
|
+
onClick: function e(r) {
|
|
475
|
+
o.handleClickValue(r, i);
|
|
476
|
+
}
|
|
477
|
+
}, w);
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
return n().createElement(N, {
|
|
481
|
+
valueType: C,
|
|
482
|
+
overflowType: b
|
|
483
|
+
}, w);
|
|
484
|
+
}
|
|
485
|
+
return w;
|
|
486
|
+
}
|
|
487
|
+
}, {
|
|
488
|
+
key: "renderKey",
|
|
489
|
+
value: function e(r) {
|
|
490
|
+
var t = this;
|
|
491
|
+
var o = this.props.onClickKey;
|
|
492
|
+
if (o) {
|
|
493
|
+
|
|
494
|
+
return n().createElement("span", null, n().createElement(K, {
|
|
495
|
+
onClick: function e(n) {
|
|
496
|
+
t.handleClickKey(n, r);
|
|
497
|
+
}
|
|
498
|
+
}, r), ":", " ");
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
return n().createElement("span", null, n().createElement(q, null, r), ":", " ");
|
|
502
|
+
}
|
|
503
|
+
}, {
|
|
504
|
+
key: "renderObject",
|
|
505
|
+
value: function e() {
|
|
506
|
+
var r = this;
|
|
507
|
+
var t = this.props, o = t.obj, a = t.path;
|
|
508
|
+
if (k()(o) || d()(o)) {
|
|
509
|
+
return w()(o).map((function(e, t, i) {
|
|
510
|
+
var l = o[e];
|
|
511
|
+
// TS: should be safe based on (recursive) JSONElement type
|
|
512
|
+
var u = d()(o) ? parseInt(e, 10) : e;
|
|
513
|
+
var c = a.length === 0 ? ".".concat(u) : ".".concat(a.join("."), ".").concat(u);
|
|
514
|
+
var s = r.renderValue({
|
|
515
|
+
key: u,
|
|
516
|
+
value: l
|
|
517
|
+
});
|
|
518
|
+
var f = !d()(o) ? r.renderKey(u) : undefined;
|
|
519
|
+
|
|
520
|
+
return n().createElement("div", {
|
|
521
|
+
key: c,
|
|
522
|
+
role: "treeitem",
|
|
523
|
+
"data-test-path": c
|
|
524
|
+
}, r.regularIndent, f, s, t + 1 < i.length ? "," : null);
|
|
525
|
+
}));
|
|
526
|
+
}
|
|
527
|
+
// edge case: a single number/string/boolean being rendered (still valid JSON)
|
|
528
|
+
|
|
529
|
+
return n().createElement("div", {
|
|
530
|
+
role: "treeitem",
|
|
531
|
+
"data-test-path": "."
|
|
532
|
+
}, this.renderValue({
|
|
533
|
+
value: o
|
|
534
|
+
}));
|
|
535
|
+
}
|
|
536
|
+
}, {
|
|
537
|
+
key: "render",
|
|
538
|
+
value: function e() {
|
|
539
|
+
var r = this.state.open;
|
|
540
|
+
var t = this.props.obj;
|
|
541
|
+
var o = k()(t) && !y()(t) || d()(t) && t.length > 0;
|
|
542
|
+
|
|
543
|
+
return n().createElement("span", {
|
|
544
|
+
"data-test": o ? "node" : null,
|
|
545
|
+
"data-test-expanded": o ? this.state.open : null
|
|
546
|
+
}, o && (d()(t) ? "[" : "{"), o && this.renderExpandLink(), !o || r ? this.renderObject() : null, !o || r ? this.closingIndent : null, o && (d()(t) ? "]" : "}"));
|
|
547
|
+
}
|
|
548
|
+
} ]);
|
|
549
|
+
return t;
|
|
550
|
+
}(t.Component);
|
|
551
|
+
ee(ne, "contextType", c);
|
|
552
|
+
ee(ne, "propTypes", re);
|
|
553
|
+
ee(ne, "defaultProps", te);
|
|
554
|
+
/* harmony default export */ const oe = ne;
|
|
555
|
+
// CONCATENATED MODULE: ./src/JSONTree/JSONTreeStyles.ts
|
|
556
|
+
var ae = (0, O.css)([ "", ";font-family:", ";" ], E.mixins.reset("block"), E.variables.monoFontFamily);
|
|
557
|
+
var ie = x().code.withConfig({
|
|
558
|
+
displayName: "JSONTreeStyles__StyledScrollCode",
|
|
559
|
+
componentId: "vrdt21-0"
|
|
560
|
+
})([ "", ";overflow-x:auto;white-space:nowrap;" ], ae);
|
|
561
|
+
var le = x().code.withConfig({
|
|
562
|
+
displayName: "JSONTreeStyles__StyledWrapCode",
|
|
563
|
+
componentId: "vrdt21-1"
|
|
564
|
+
})([ "", ";white-space:pre-wrap;" ], ae);
|
|
565
|
+
// CONCATENATED MODULE: ./src/JSONTree/JSONTree.tsx
|
|
566
|
+
function ue() {
|
|
567
|
+
ue = Object.assign || function(e) {
|
|
568
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
569
|
+
var t = arguments[r];
|
|
570
|
+
for (var n in t) {
|
|
571
|
+
if (Object.prototype.hasOwnProperty.call(t, n)) {
|
|
572
|
+
e[n] = t[n];
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
return e;
|
|
577
|
+
};
|
|
578
|
+
return ue.apply(this, arguments);
|
|
579
|
+
}
|
|
580
|
+
function ce(e, r) {
|
|
581
|
+
return ve(e) || de(e, r) || fe(e, r) || se();
|
|
582
|
+
}
|
|
583
|
+
function se() {
|
|
584
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
585
|
+
}
|
|
586
|
+
function fe(e, r) {
|
|
587
|
+
if (!e) return;
|
|
588
|
+
if (typeof e === "string") return pe(e, r);
|
|
589
|
+
var t = Object.prototype.toString.call(e).slice(8, -1);
|
|
590
|
+
if (t === "Object" && e.constructor) t = e.constructor.name;
|
|
591
|
+
if (t === "Map" || t === "Set") return Array.from(e);
|
|
592
|
+
if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return pe(e, r);
|
|
593
|
+
}
|
|
594
|
+
function pe(e, r) {
|
|
595
|
+
if (r == null || r > e.length) r = e.length;
|
|
596
|
+
for (var t = 0, n = new Array(r); t < r; t++) {
|
|
597
|
+
n[t] = e[t];
|
|
598
|
+
}
|
|
599
|
+
return n;
|
|
600
|
+
}
|
|
601
|
+
function de(e, r) {
|
|
602
|
+
if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(e))) return;
|
|
603
|
+
var t = [];
|
|
604
|
+
var n = true;
|
|
605
|
+
var o = false;
|
|
606
|
+
var a = undefined;
|
|
607
|
+
try {
|
|
608
|
+
for (var i = e[Symbol.iterator](), l; !(n = (l = i.next()).done); n = true) {
|
|
609
|
+
t.push(l.value);
|
|
610
|
+
if (r && t.length === r) break;
|
|
611
|
+
}
|
|
612
|
+
} catch (e) {
|
|
613
|
+
o = true;
|
|
614
|
+
a = e;
|
|
615
|
+
} finally {
|
|
616
|
+
try {
|
|
617
|
+
if (!n && i["return"] != null) i["return"]();
|
|
618
|
+
} finally {
|
|
619
|
+
if (o) throw a;
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
return t;
|
|
623
|
+
}
|
|
624
|
+
function ve(e) {
|
|
625
|
+
if (Array.isArray(e)) return e;
|
|
626
|
+
}
|
|
627
|
+
function ye(e, r) {
|
|
628
|
+
if (e == null) return {};
|
|
629
|
+
var t = be(e, r);
|
|
630
|
+
var n, o;
|
|
631
|
+
if (Object.getOwnPropertySymbols) {
|
|
632
|
+
var a = Object.getOwnPropertySymbols(e);
|
|
633
|
+
for (o = 0; o < a.length; o++) {
|
|
634
|
+
n = a[o];
|
|
635
|
+
if (r.indexOf(n) >= 0) continue;
|
|
636
|
+
if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
|
|
637
|
+
t[n] = e[n];
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
return t;
|
|
641
|
+
}
|
|
642
|
+
function be(e, r) {
|
|
643
|
+
if (e == null) return {};
|
|
644
|
+
var t = {};
|
|
645
|
+
var n = Object.keys(e);
|
|
646
|
+
var o, a;
|
|
647
|
+
for (a = 0; a < n.length; a++) {
|
|
648
|
+
o = n[a];
|
|
649
|
+
if (r.indexOf(o) >= 0) continue;
|
|
650
|
+
t[o] = e[o];
|
|
651
|
+
}
|
|
652
|
+
return t;
|
|
653
|
+
}
|
|
654
|
+
var he = {
|
|
655
|
+
elementRef: a().oneOfType([ a().func, a().object ]),
|
|
656
|
+
json: a().oneOfType([ a().string, a().object, a().array, a().number, a().bool ]).isRequired,
|
|
657
|
+
indent: a().number,
|
|
658
|
+
onClickKey: a().func,
|
|
659
|
+
onClickValue: a().func,
|
|
660
|
+
expandChildren: a().oneOfType([ a().bool, a().oneOf([ "withShiftModifier" ]) ]),
|
|
661
|
+
overflow: a().oneOf([ "wrap", "scroll" ])
|
|
662
|
+
};
|
|
663
|
+
/**
|
|
613
664
|
* Used to visualize a JSON string.
|
|
614
|
-
*/
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
}
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
/* harmony default export */
|
|
649
|
-
// CONCATENATED MODULE: ./src/JSONTree/index.ts
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
/***/ }),
|
|
654
|
-
|
|
655
|
-
/***/ 2:
|
|
656
|
-
/***/ (function(module, exports) {
|
|
657
|
-
|
|
658
|
-
module.exports = require("react");
|
|
659
|
-
|
|
660
|
-
/***/ }),
|
|
661
|
-
|
|
662
|
-
/***/ 23:
|
|
663
|
-
/***/ (function(module, exports) {
|
|
664
|
-
|
|
665
|
-
module.exports = require("lodash/isString");
|
|
666
|
-
|
|
667
|
-
/***/ }),
|
|
668
|
-
|
|
669
|
-
/***/ 3:
|
|
670
|
-
/***/ (function(module, exports) {
|
|
671
|
-
|
|
672
|
-
module.exports = require("styled-components");
|
|
673
|
-
|
|
674
|
-
/***/ }),
|
|
675
|
-
|
|
676
|
-
/***/ 76:
|
|
677
|
-
/***/ (function(module, exports) {
|
|
678
|
-
|
|
679
|
-
module.exports = require("lodash/isArray");
|
|
680
|
-
|
|
681
|
-
/***/ }),
|
|
682
|
-
|
|
683
|
-
/***/ 77:
|
|
684
|
-
/***/ (function(module, exports) {
|
|
685
|
-
|
|
686
|
-
module.exports = require("lodash/isNumber");
|
|
687
|
-
|
|
688
|
-
/***/ }),
|
|
689
|
-
|
|
690
|
-
/***/ 82:
|
|
691
|
-
/***/ (function(module, exports) {
|
|
692
|
-
|
|
693
|
-
module.exports = require("lodash/repeat");
|
|
694
|
-
|
|
695
|
-
/***/ }),
|
|
696
|
-
|
|
697
|
-
/***/ 9:
|
|
698
|
-
/***/ (function(module, exports) {
|
|
699
|
-
|
|
700
|
-
module.exports = require("lodash/keys");
|
|
701
|
-
|
|
702
|
-
/***/ }),
|
|
703
|
-
|
|
704
|
-
/***/ 90:
|
|
705
|
-
/***/ (function(module, exports) {
|
|
706
|
-
|
|
707
|
-
module.exports = require("lodash/isEmpty");
|
|
708
|
-
|
|
709
|
-
/***/ })
|
|
710
|
-
|
|
711
|
-
/******/ });
|
|
665
|
+
*/ function me(e) {
|
|
666
|
+
var r = e.elementRef, o = e.expandChildren, a = o === void 0 ? false : o, i = e.indent, u = i === void 0 ? 4 : i, s = e.json, f = e.onClickKey, p = e.onClickValue, d = e.overflow, v = d === void 0 ? "scroll" : d, y = ye(e, [ "elementRef", "expandChildren", "indent", "json", "onClickKey", "onClickValue", "overflow" ]);
|
|
667
|
+
// @docs-props-type JSONTreePropsBase
|
|
668
|
+
var b = l()(s) ? JSON.parse(s) : s;
|
|
669
|
+
var h = v === "wrap" ? le : ie;
|
|
670
|
+
var m = (0, t.useState)(undefined), k = ce(m, 2), g = k[0], w = k[1];
|
|
671
|
+
var C = function e(r) {
|
|
672
|
+
w(r);
|
|
673
|
+
};
|
|
674
|
+
// eslint-disable-next-line react-perf/jsx-no-new-object-as-prop
|
|
675
|
+
var S = {
|
|
676
|
+
shift: g,
|
|
677
|
+
updateShift: C
|
|
678
|
+
};
|
|
679
|
+
|
|
680
|
+
return n().createElement(h, ue({
|
|
681
|
+
"data-language": "language-json",
|
|
682
|
+
"data-test": "json-tree",
|
|
683
|
+
ref: r,
|
|
684
|
+
role: "tree"
|
|
685
|
+
}, y), n().createElement(c.Provider, {
|
|
686
|
+
value: S
|
|
687
|
+
}, n().createElement(oe, {
|
|
688
|
+
defaultOpen: true,
|
|
689
|
+
expandChildren: a,
|
|
690
|
+
indent: u,
|
|
691
|
+
obj: b,
|
|
692
|
+
onClickKey: f,
|
|
693
|
+
onClickValue: p,
|
|
694
|
+
overflow: v,
|
|
695
|
+
shift: g
|
|
696
|
+
})));
|
|
697
|
+
}
|
|
698
|
+
me.propTypes = he;
|
|
699
|
+
/* harmony default export */ const ke = me;
|
|
700
|
+
// CONCATENATED MODULE: ./src/JSONTree/index.ts
|
|
701
|
+
module.exports = r;
|
|
702
|
+
/******/})();
|