@splunk/react-ui 4.22.1 → 4.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/JSONTree.js CHANGED
@@ -61,7 +61,7 @@
61
61
  e.r(r);
62
62
  // EXPORTS
63
63
  e.d(r, {
64
- default: () => /* reexport */ ke
64
+ default: () => /* reexport */ Ce
65
65
  });
66
66
  // CONCATENATED MODULE: external "react"
67
67
  const t = require("react");
@@ -76,168 +76,154 @@
76
76
  var u = (0, t.createContext)({});
77
77
  u.displayName = "JSONTree";
78
78
  /* harmony default export */ const c = u;
79
- // CONCATENATED MODULE: external "lodash/fill"
80
- const s = require("lodash/fill");
79
+ // CONCATENATED MODULE: external "styled-components"
80
+ const s = require("styled-components");
81
81
  var f = e.n(s);
82
+ // CONCATENATED MODULE: external "@splunk/themes"
83
+ const d = require("@splunk/themes");
84
+ // CONCATENATED MODULE: ./src/JSONTree/JSONTreeStyles.ts
85
+ var p = (0, s.css)([ "", ";font-family:", ";" ], d.mixins.reset("block"), d.variables.monoFontFamily);
86
+ var v = f().code.withConfig({
87
+ displayName: "JSONTreeStyles__StyledScrollCode",
88
+ componentId: "vrdt21-0"
89
+ })([ "", ";overflow-x:auto;white-space:nowrap;" ], p);
90
+ var y = f().code.withConfig({
91
+ displayName: "JSONTreeStyles__StyledWrapCode",
92
+ componentId: "vrdt21-1"
93
+ })([ "", ";white-space:pre-wrap;" ], p);
94
+ // CONCATENATED MODULE: external "lodash/fill"
95
+ const h = require("lodash/fill");
96
+ var b = e.n(h);
82
97
  // CONCATENATED MODULE: external "lodash/isArray"
83
- const p = require("lodash/isArray");
84
- var d = e.n(p);
98
+ const m = require("lodash/isArray");
99
+ var C = e.n(m);
85
100
  // CONCATENATED MODULE: external "lodash/isEmpty"
86
- const v = require("lodash/isEmpty");
87
- var y = e.n(v);
101
+ const O = require("lodash/isEmpty");
102
+ var S = e.n(O);
88
103
  // CONCATENATED MODULE: external "lodash/isNumber"
89
- const b = require("lodash/isNumber");
90
- var h = e.n(b);
104
+ const k = require("lodash/isNumber");
105
+ var w = e.n(k);
91
106
  // CONCATENATED MODULE: external "lodash/isObject"
92
- const m = require("lodash/isObject");
93
- var k = e.n(m);
107
+ const g = require("lodash/isObject");
108
+ var x = e.n(g);
94
109
  // CONCATENATED MODULE: external "lodash/keys"
95
- const g = require("lodash/keys");
96
- var w = e.n(g);
110
+ const j = require("lodash/keys");
111
+ var T = e.n(j);
97
112
  // 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);
113
+ const E = require("lodash/repeat");
114
+ var _ = e.n(E);
103
115
  // 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");
116
+ const K = require("@splunk/react-ui/Clickable");
117
+ var I = e.n(K);
108
118
  // 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
119
+ var P = {
120
+ string: d.variables.syntaxTeal,
121
+ number: d.variables.syntaxBlue,
122
+ boolean: d.variables.syntaxPurple,
123
+ null: d.variables.syntaxBrown,
124
+ object: d.variables.contentColorDefault
139
125
  };
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({
126
+ var N = (0, s.css)([ "word-break:break-word;word-wrap:break-word;" ]);
127
+ var A = (0, s.css)([ "white-space:nowrap;" ]);
128
+ var q = f().span.withConfig({
143
129
  displayName: "TreeNodeStyles__StyledValue",
144
130
  componentId: "sc-1rdul18-0"
145
131
  })([ "color:", ";", ";" ], (function(e) {
146
132
  var r = e.valueType;
147
- return _[r];
133
+ return P[r];
148
134
  }), (function(e) {
149
135
  var r = e.overflowType;
150
- return r === "wrap" ? I : P;
136
+ return r === "wrap" ? N : A;
151
137
  }));
152
- var A = x()(N.withComponent(T())).withConfig({
138
+ var V = f()(q.withComponent(I())).withConfig({
153
139
  displayName: "TreeNodeStyles__StyledValueInteractiveClickable",
154
140
  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
141
+ })([ "font-family:inherit;&:focus{box-shadow:0 0 1px 3px ", ";outline:0;&:active{box-shadow:none;}}&:hover{background-color:", ";}" ], d.variables.focusColor, (0,
142
+ d.pick)({
143
+ enterprise: d.variables.backgroundColorHover,
144
+ prisma: d.variables.interactiveColorOverlayHover
159
145
  }));
160
- var q = x().span.withConfig({
146
+ var R = f().span.withConfig({
161
147
  displayName: "TreeNodeStyles__StyledProperty",
162
148
  componentId: "sc-1rdul18-2"
163
- })([ "font-weight:bold;color:", ";" ], (0, E.pick)({
149
+ })([ "font-weight:bold;color:", ";" ], (0, d.pick)({
164
150
  enterprise: {
165
151
  dark: "#ec9f98",
166
- light: E.variables.syntaxRed
152
+ light: d.variables.syntaxRed
167
153
  },
168
- prisma: E.variables.syntaxRed
154
+ prisma: d.variables.syntaxRed
169
155
  }));
170
- var K = x()(q.withComponent(T())).withConfig({
156
+ var L = f()(R.withComponent(I())).withConfig({
171
157
  displayName: "TreeNodeStyles__StyledPropertyInteractiveClickable",
172
158
  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
159
+ })([ "font-family:inherit;&:focus{box-shadow:0 0 1px 3px ", ";outline:0;&:active{box-shadow:none;}}&:hover{background-color:", ";}" ], d.variables.focusColor, (0,
160
+ d.pick)({
161
+ enterprise: d.variables.backgroundColorHover,
162
+ prisma: d.variables.interactiveColorOverlayHover
177
163
  }));
178
- var V = x()(T()).withConfig({
164
+ var M = f()(I()).withConfig({
179
165
  displayName: "TreeNodeStyles__StyledExpandLinkClickable",
180
166
  componentId: "sc-1rdul18-4"
181
167
  })([ "cursor:pointer;color:", ";font-family:inherit;&:hover{background-color:", ";text-decoration:none;}&:focus{box-shadow:", ";&:active{box-shadow:none;}}", "" ], (0,
182
- E.pick)({
168
+ d.pick)({
183
169
  enterprise: {
184
- dark: E.variables.accentColorL20,
185
- light: E.variables.accentColorD20
170
+ dark: d.variables.accentColorL20,
171
+ light: d.variables.accentColorD20
186
172
  },
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)
173
+ prisma: d.variables.interactiveColorPrimary
174
+ }), (0, d.pick)({
175
+ enterprise: d.variables.backgroundColorHover,
176
+ prisma: d.variables.interactiveColorOverlayHover
177
+ }), d.variables.focusShadowInset, (0, d.pick)({
178
+ prisma: (0, s.css)([ "border-radius:", ";" ], d.variables.borderRadius)
193
179
  }));
194
180
  // CONCATENATED MODULE: ./src/JSONTree/TreeNode.tsx
195
- function R(e) {
181
+ function H(e) {
196
182
  "@babel/helpers - typeof";
197
183
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
198
- R = function e(r) {
184
+ H = function e(r) {
199
185
  return typeof r;
200
186
  };
201
187
  } else {
202
- R = function e(r) {
188
+ H = function e(r) {
203
189
  return r && typeof Symbol === "function" && r.constructor === Symbol && r !== Symbol.prototype ? "symbol" : typeof r;
204
190
  };
205
191
  }
206
- return R(e);
192
+ return H(e);
207
193
  }
208
- function L(e) {
209
- return J(e) || D(e) || H(e) || M();
194
+ function D(e) {
195
+ return U(e) || F(e) || B(e) || J();
210
196
  }
211
- function M() {
197
+ function J() {
212
198
  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
199
  }
214
- function H(e, r) {
200
+ function B(e, r) {
215
201
  if (!e) return;
216
- if (typeof e === "string") return B(e, r);
202
+ if (typeof e === "string") return $(e, r);
217
203
  var t = Object.prototype.toString.call(e).slice(8, -1);
218
204
  if (t === "Object" && e.constructor) t = e.constructor.name;
219
205
  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);
206
+ if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return $(e, r);
221
207
  }
222
- function D(e) {
208
+ function F(e) {
223
209
  if (typeof Symbol !== "undefined" && Symbol.iterator in Object(e)) return Array.from(e);
224
210
  }
225
- function J(e) {
226
- if (Array.isArray(e)) return B(e);
211
+ function U(e) {
212
+ if (Array.isArray(e)) return $(e);
227
213
  }
228
- function B(e, r) {
214
+ function $(e, r) {
229
215
  if (r == null || r > e.length) r = e.length;
230
216
  for (var t = 0, n = new Array(r); t < r; t++) {
231
217
  n[t] = e[t];
232
218
  }
233
219
  return n;
234
220
  }
235
- function F(e, r) {
221
+ function W(e, r) {
236
222
  if (!(e instanceof r)) {
237
223
  throw new TypeError("Cannot call a class as a function");
238
224
  }
239
225
  }
240
- function U(e, r) {
226
+ function z(e, r) {
241
227
  for (var t = 0; t < r.length; t++) {
242
228
  var n = r[t];
243
229
  n.enumerable = n.enumerable || false;
@@ -246,12 +232,12 @@
246
232
  Object.defineProperty(e, n.key, n);
247
233
  }
248
234
  }
249
- function $(e, r, t) {
250
- if (r) U(e.prototype, r);
251
- if (t) U(e, t);
235
+ function G(e, r, t) {
236
+ if (r) z(e.prototype, r);
237
+ if (t) z(e, t);
252
238
  return e;
253
239
  }
254
- function W(e, r) {
240
+ function Q(e, r) {
255
241
  if (typeof r !== "function" && r !== null) {
256
242
  throw new TypeError("Super expression must either be null or a function");
257
243
  }
@@ -262,41 +248,41 @@
262
248
  configurable: true
263
249
  }
264
250
  });
265
- if (r) z(e, r);
251
+ if (r) X(e, r);
266
252
  }
267
- function z(e, r) {
268
- z = Object.setPrototypeOf || function e(r, t) {
253
+ function X(e, r) {
254
+ X = Object.setPrototypeOf || function e(r, t) {
269
255
  r.__proto__ = t;
270
256
  return r;
271
257
  };
272
- return z(e, r);
258
+ return X(e, r);
273
259
  }
274
- function G(e) {
275
- var r = Y();
260
+ function Y(e) {
261
+ var r = re();
276
262
  return function t() {
277
- var n = Z(e), o;
263
+ var n = te(e), o;
278
264
  if (r) {
279
- var a = Z(this).constructor;
265
+ var a = te(this).constructor;
280
266
  o = Reflect.construct(n, arguments, a);
281
267
  } else {
282
268
  o = n.apply(this, arguments);
283
269
  }
284
- return Q(this, o);
270
+ return Z(this, o);
285
271
  };
286
272
  }
287
- function Q(e, r) {
288
- if (r && (R(r) === "object" || typeof r === "function")) {
273
+ function Z(e, r) {
274
+ if (r && (H(r) === "object" || typeof r === "function")) {
289
275
  return r;
290
276
  }
291
- return X(e);
277
+ return ee(e);
292
278
  }
293
- function X(e) {
279
+ function ee(e) {
294
280
  if (e === void 0) {
295
281
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
296
282
  }
297
283
  return e;
298
284
  }
299
- function Y() {
285
+ function re() {
300
286
  if (typeof Reflect === "undefined" || !Reflect.construct) return false;
301
287
  if (Reflect.construct.sham) return false;
302
288
  if (typeof Proxy === "function") return true;
@@ -307,13 +293,13 @@
307
293
  return false;
308
294
  }
309
295
  }
310
- function Z(e) {
311
- Z = Object.setPrototypeOf ? Object.getPrototypeOf : function e(r) {
296
+ function te(e) {
297
+ te = Object.setPrototypeOf ? Object.getPrototypeOf : function e(r) {
312
298
  return r.__proto__ || Object.getPrototypeOf(r);
313
299
  };
314
- return Z(e);
300
+ return te(e);
315
301
  }
316
- function ee(e, r, t) {
302
+ function ne(e, r, t) {
317
303
  if (r in e) {
318
304
  Object.defineProperty(e, r, {
319
305
  value: t,
@@ -326,7 +312,7 @@
326
312
  }
327
313
  return e;
328
314
  }
329
- var re = {
315
+ var oe = {
330
316
  path: a().arrayOf(a().oneOfType([ a().number, a().string ])),
331
317
  defaultOpen: a().bool,
332
318
  expandChildren: a().oneOfType([ a().bool, a().oneOf([ "withShiftModifier" ]) ]),
@@ -336,30 +322,32 @@
336
322
  onClickKey: a().func,
337
323
  onClickValue: a().func,
338
324
  overflow: a().oneOf([ "wrap", "scroll" ]),
339
- shift: a().bool
325
+ shift: a().bool,
326
+ expandChildrenOnShiftKey: a().bool
340
327
  };
341
- var te = {
328
+ var ae = {
342
329
  path: [],
343
330
  defaultOpen: false,
344
331
  expandChildren: false,
345
332
  indent: 4,
346
333
  indentLevel: 1,
347
- overflow: "scroll"
334
+ overflow: "scroll",
335
+ expandChildrenOnShiftKey: false
348
336
  };
349
337
  /**
350
338
  * 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);
339
+ */ var ie = function(e) {
340
+ Q(t, e);
341
+ var r = Y(t);
354
342
  function t(e) {
355
343
  var n;
356
- F(this, t);
344
+ W(this, t);
357
345
  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") {
346
+ ne(ee(n), "regularIndent", void 0);
347
+ ne(ee(n), "closingIndent", void 0);
348
+ ne(ee(n), "mutableShift", void 0);
349
+ ne(ee(n), "handleExpandClick", (function(e) {
350
+ if (n.props.expandChildren === "withShiftModifier" || n.props.expandChildrenOnShiftKey) {
363
351
  var r = n.context.updateShift;
364
352
  if (r != null) {
365
353
  n.mutableShift = e.shiftKey;
@@ -372,22 +360,22 @@
372
360
  };
373
361
  }));
374
362
  }));
375
- ee(X(n), "handleClickKey", (function(e, r) {
363
+ ne(ee(n), "handleClickKey", (function(e, r) {
376
364
  var t, o;
377
365
  var a = n.props.path;
378
366
  // 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);
367
+ var i = r !== undefined ? [].concat(D(a), [ r ]) : D(a);
380
368
  var l = ".".concat(i.join("."));
381
369
  (t = (o = n.props).onClickKey) === null || t === void 0 ? void 0 : t.call(o, e, {
382
370
  key: l,
383
371
  keyPath: i
384
372
  });
385
373
  }));
386
- ee(X(n), "handleClickValue", (function(e, r) {
374
+ ne(ee(n), "handleClickValue", (function(e, r) {
387
375
  var t, o;
388
376
  var a = n.props.path;
389
377
  // 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);
378
+ var i = r !== undefined ? [].concat(D(a), [ r ]) : D(a);
391
379
  var l = ".".concat(i.join("."));
392
380
  (t = (o = n.props).onClickValue) === null || t === void 0 ? void 0 : t.call(o, e, {
393
381
  key: l,
@@ -397,7 +385,11 @@
397
385
  }));
398
386
  var o = n.props.shift;
399
387
  n.mutableShift = o;
400
- if (n.props.expandChildren === "withShiftModifier" && n.mutableShift != null) {
388
+ if (n.props.expandChildren === true) {
389
+ n.state = {
390
+ open: e.defaultOpen
391
+ };
392
+ } else if ((n.props.expandChildren === "withShiftModifier" || n.props.expandChildrenOnShiftKey) && n.mutableShift != null) {
401
393
  n.state = n.mutableShift ? {
402
394
  open: true
403
395
  } : {
@@ -408,16 +400,16 @@
408
400
  open: e.defaultOpen
409
401
  };
410
402
  }
411
- n.regularIndent = f()(Array(e.indentLevel), S()(" ", e.indent));
412
- n.closingIndent = f()(Array(e.indentLevel - 1), S()(" ", e.indent));
403
+ n.regularIndent = b()(Array(e.indentLevel), _()(" ", e.indent));
404
+ n.closingIndent = b()(Array(e.indentLevel - 1), _()(" ", e.indent));
413
405
  return n;
414
406
  }
415
- $(t, [ {
407
+ G(t, [ {
416
408
  key: "renderExpandLink",
417
409
  value: function e() {
418
410
  var r = this;
419
411
 
420
- return n().createElement(V, {
412
+ return n().createElement(M, {
421
413
  onClick: function e(t) {
422
414
  r.handleExpandClick(t);
423
415
  },
@@ -430,59 +422,60 @@
430
422
  value: function e(r) {
431
423
  var o = this;
432
424
  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;
425
+ var u = this.props, c = u.expandChildren, s = u.indent, f = u.indentLevel, d = u.onClickKey, p = u.onClickValue, v = u.overflow, y = u.path, h = u.shift, b = u.expandChildrenOnShiftKey;
426
+ var m = null;
435
427
  // determine if value should be represented as a simple string
436
428
  // or as a child node
437
- if (!k()(a)) {
429
+ if (!x()(a)) {
438
430
  // isObject is true for arrays
439
431
  if (typeof a === "string") {
440
- w = '"'.concat(a, '"');
432
+ m = '"'.concat(a, '"');
441
433
  } else if (typeof a === "boolean") {
442
- w = a.toString();
434
+ m = a.toString();
443
435
  } else if (a === null) {
444
- w = "null";
436
+ m = "null";
445
437
  } else {
446
- w = a;
438
+ m = a;
447
439
  }
448
- } else if (y()(a)) {
440
+ } else if (S()(a)) {
449
441
  // isObject is true for arrays
450
- w = d()(a) ? "[]" : "{}";
442
+ m = C()(a) ? "[]" : "{}";
451
443
  } else {
452
- w = n().createElement(t, {
444
+ m = n().createElement(t, {
453
445
  obj: a,
454
- path: i !== undefined ? [].concat(L(m), [ i ]) : L(m),
446
+ path: i !== undefined ? [].concat(D(y), [ i ]) : D(y),
455
447
  defaultOpen: c === true,
456
448
  expandChildren: c,
457
- onClickKey: p,
458
- onClickValue: v,
449
+ onClickKey: d,
450
+ onClickValue: p,
459
451
  indent: s,
460
452
  indentLevel: f + 1,
461
- overflow: b,
462
- shift: g
453
+ overflow: v,
454
+ shift: h,
455
+ expandChildrenOnShiftKey: b
463
456
  });
464
457
  }
465
458
  // 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) {
459
+ if (l()(m) || w()(m)) {
460
+ var O = a === null ? "null" : // TS: bigint, function, symbol are prevented by JSONElement type
461
+ H(a);
462
+ if (p) {
470
463
 
471
- return n().createElement(A, {
472
- valueType: C,
473
- overflowType: b,
464
+ return n().createElement(V, {
465
+ valueType: O,
466
+ overflowType: v,
474
467
  onClick: function e(r) {
475
468
  o.handleClickValue(r, i);
476
469
  }
477
- }, w);
470
+ }, m);
478
471
  }
479
472
 
480
- return n().createElement(N, {
481
- valueType: C,
482
- overflowType: b
483
- }, w);
473
+ return n().createElement(q, {
474
+ valueType: O,
475
+ overflowType: v
476
+ }, m);
484
477
  }
485
- return w;
478
+ return m;
486
479
  }
487
480
  }, {
488
481
  key: "renderKey",
@@ -491,31 +484,31 @@
491
484
  var o = this.props.onClickKey;
492
485
  if (o) {
493
486
 
494
- return n().createElement("span", null, n().createElement(K, {
487
+ return n().createElement("span", null, n().createElement(L, {
495
488
  onClick: function e(n) {
496
489
  t.handleClickKey(n, r);
497
490
  }
498
491
  }, r), ":", " ");
499
492
  }
500
493
 
501
- return n().createElement("span", null, n().createElement(q, null, r), ":", " ");
494
+ return n().createElement("span", null, n().createElement(R, null, r), ":", " ");
502
495
  }
503
496
  }, {
504
497
  key: "renderObject",
505
498
  value: function e() {
506
499
  var r = this;
507
500
  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) {
501
+ if (x()(o) || C()(o)) {
502
+ return T()(o).map((function(e, t, i) {
510
503
  var l = o[e];
511
504
  // TS: should be safe based on (recursive) JSONElement type
512
- var u = d()(o) ? parseInt(e, 10) : e;
505
+ var u = C()(o) ? parseInt(e, 10) : e;
513
506
  var c = a.length === 0 ? ".".concat(u) : ".".concat(a.join("."), ".").concat(u);
514
507
  var s = r.renderValue({
515
508
  key: u,
516
509
  value: l
517
510
  });
518
- var f = !d()(o) ? r.renderKey(u) : undefined;
511
+ var f = !C()(o) ? r.renderKey(u) : undefined;
519
512
 
520
513
  return n().createElement("div", {
521
514
  key: c,
@@ -538,30 +531,20 @@
538
531
  value: function e() {
539
532
  var r = this.state.open;
540
533
  var t = this.props.obj;
541
- var o = k()(t) && !y()(t) || d()(t) && t.length > 0;
534
+ var o = x()(t) && !S()(t) || C()(t) && t.length > 0;
542
535
 
543
536
  return n().createElement("span", {
544
537
  "data-test": o ? "node" : null,
545
538
  "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) ? "]" : "}"));
539
+ }, o && (C()(t) ? "[" : "{"), o && this.renderExpandLink(), !o || r ? this.renderObject() : null, !o || r ? this.closingIndent : null, o && (C()(t) ? "]" : "}"));
547
540
  }
548
541
  } ]);
549
542
  return t;
550
543
  }(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);
544
+ ne(ie, "contextType", c);
545
+ ne(ie, "propTypes", oe);
546
+ ne(ie, "defaultProps", ae);
547
+ /* harmony default export */ const le = ie;
565
548
  // CONCATENATED MODULE: ./src/JSONTree/JSONTree.tsx
566
549
  function ue() {
567
550
  ue = Object.assign || function(e) {
@@ -578,27 +561,27 @@
578
561
  return ue.apply(this, arguments);
579
562
  }
580
563
  function ce(e, r) {
581
- return ve(e) || de(e, r) || fe(e, r) || se();
564
+ return ve(e) || pe(e, r) || fe(e, r) || se();
582
565
  }
583
566
  function se() {
584
567
  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
568
  }
586
569
  function fe(e, r) {
587
570
  if (!e) return;
588
- if (typeof e === "string") return pe(e, r);
571
+ if (typeof e === "string") return de(e, r);
589
572
  var t = Object.prototype.toString.call(e).slice(8, -1);
590
573
  if (t === "Object" && e.constructor) t = e.constructor.name;
591
574
  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);
575
+ if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return de(e, r);
593
576
  }
594
- function pe(e, r) {
577
+ function de(e, r) {
595
578
  if (r == null || r > e.length) r = e.length;
596
579
  for (var t = 0, n = new Array(r); t < r; t++) {
597
580
  n[t] = e[t];
598
581
  }
599
582
  return n;
600
583
  }
601
- function de(e, r) {
584
+ function pe(e, r) {
602
585
  if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(e))) return;
603
586
  var t = [];
604
587
  var n = true;
@@ -626,7 +609,7 @@
626
609
  }
627
610
  function ye(e, r) {
628
611
  if (e == null) return {};
629
- var t = be(e, r);
612
+ var t = he(e, r);
630
613
  var n, o;
631
614
  if (Object.getOwnPropertySymbols) {
632
615
  var a = Object.getOwnPropertySymbols(e);
@@ -639,7 +622,7 @@
639
622
  }
640
623
  return t;
641
624
  }
642
- function be(e, r) {
625
+ function he(e, r) {
643
626
  if (e == null) return {};
644
627
  var t = {};
645
628
  var n = Object.keys(e);
@@ -651,52 +634,54 @@
651
634
  }
652
635
  return t;
653
636
  }
654
- var he = {
637
+ var be = {
655
638
  elementRef: a().oneOfType([ a().func, a().object ]),
656
- json: a().oneOfType([ a().string, a().object, a().array, a().number, a().bool ]).isRequired,
639
+ expandChildren: a().oneOfType([ a().bool, a().oneOf([ "withShiftModifier" ]) ]),
657
640
  indent: a().number,
641
+ json: a().oneOfType([ a().string, a().object, a().array, a().number, a().bool ]).isRequired,
658
642
  onClickKey: a().func,
659
643
  onClickValue: a().func,
660
- expandChildren: a().oneOfType([ a().bool, a().oneOf([ "withShiftModifier" ]) ]),
661
- overflow: a().oneOf([ "wrap", "scroll" ])
644
+ overflow: a().oneOf([ "wrap", "scroll" ]),
645
+ expandChildrenOnShiftKey: a().bool
662
646
  };
663
647
  /**
664
648
  * Used to visualize a JSON string.
665
649
  */ 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" ]);
650
+ 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, d = e.onClickValue, p = e.overflow, h = p === void 0 ? "scroll" : p, b = e.expandChildrenOnShiftKey, m = b === void 0 ? false : b, C = ye(e, [ "elementRef", "expandChildren", "indent", "json", "onClickKey", "onClickValue", "overflow", "expandChildrenOnShiftKey" ]);
667
651
  // @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);
652
+ var O = l()(s) ? JSON.parse(s) : s;
653
+ var S = h === "wrap" ? y : v;
654
+ var k = (0, t.useState)(undefined), w = ce(k, 2), g = w[0], x = w[1];
655
+ var j = function e(r) {
656
+ x(r);
673
657
  };
674
658
  // eslint-disable-next-line react-perf/jsx-no-new-object-as-prop
675
- var S = {
659
+ var T = {
676
660
  shift: g,
677
- updateShift: C
661
+ updateShift: j
678
662
  };
679
663
 
680
- return n().createElement(h, ue({
664
+ return n().createElement(S, ue({
681
665
  "data-language": "language-json",
682
666
  "data-test": "json-tree",
683
667
  ref: r,
684
668
  role: "tree"
685
- }, y), n().createElement(c.Provider, {
686
- value: S
687
- }, n().createElement(oe, {
669
+ }, C), n().createElement(c.Provider, {
670
+ value: T
671
+ }, n().createElement(le, {
688
672
  defaultOpen: true,
689
673
  expandChildren: a,
690
674
  indent: u,
691
- obj: b,
675
+ obj: O,
692
676
  onClickKey: f,
693
- onClickValue: p,
694
- overflow: v,
677
+ onClickValue: d,
678
+ overflow: h,
679
+ expandChildrenOnShiftKey: m,
695
680
  shift: g
696
681
  })));
697
682
  }
698
- me.propTypes = he;
699
- /* harmony default export */ const ke = me;
683
+ me.propTypes = be;
684
+ /* harmony default export */ const Ce = me;
700
685
  // CONCATENATED MODULE: ./src/JSONTree/index.ts
701
686
  module.exports = r;
702
687
  /******/})();