@splunk/react-ui 4.44.1 → 4.45.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/Concertina.js CHANGED
@@ -61,8 +61,8 @@
61
61
  e.r(t);
62
62
  // EXPORTS
63
63
  e.d(t, {
64
- Panel: () => /* reexport */ xe,
65
- default: () => /* reexport */ Xe
64
+ Panel: () => /* reexport */ ze,
65
+ default: () => /* reexport */ it
66
66
  });
67
67
  // CONCATENATED MODULE: external "react"
68
68
  const n = require("react");
@@ -75,59 +75,59 @@
75
75
  var l = e.n(a);
76
76
  // CONCATENATED MODULE: external "lodash/take"
77
77
  const c = require("lodash/take");
78
- var s = e.n(c);
78
+ var u = e.n(c);
79
79
  // CONCATENATED MODULE: external "lodash/takeRight"
80
- const u = require("lodash/takeRight");
81
- var p = e.n(u);
80
+ const s = require("lodash/takeRight");
81
+ var f = e.n(s);
82
82
  // CONCATENATED MODULE: external "@splunk/react-ui/EventListener"
83
- const f = require("@splunk/react-ui/EventListener");
84
- var d = e.n(f);
83
+ const p = require("@splunk/react-ui/EventListener");
84
+ var d = e.n(p);
85
85
  // CONCATENATED MODULE: external "lodash/keys"
86
- const b = require("lodash/keys");
87
- var h = e.n(b);
86
+ const h = require("lodash/keys");
87
+ var b = e.n(h);
88
88
  // CONCATENATED MODULE: external "lodash/omit"
89
89
  const y = require("lodash/omit");
90
90
  var v = e.n(y);
91
91
  // CONCATENATED MODULE: external "styled-components"
92
- const g = require("styled-components");
93
- var m = e.n(g);
92
+ const m = require("styled-components");
93
+ var g = e.n(m);
94
94
  // CONCATENATED MODULE: external "@splunk/react-ui/Clickable"
95
95
  const w = require("@splunk/react-ui/Clickable");
96
- var O = e.n(w);
96
+ var S = e.n(w);
97
97
  // CONCATENATED MODULE: external "@splunk/themes"
98
- const S = require("@splunk/themes");
98
+ const O = require("@splunk/themes");
99
99
  // CONCATENATED MODULE: ./src/Concertina/HeadingStyles.ts
100
- var k = m()(O()).withConfig({
100
+ var k = g()(S()).withConfig({
101
101
  displayName: "HeadingStyles__StyledClickable",
102
102
  componentId: "sc-1h92oaj-0"
103
- })([ "display:block;width:100%;cursor:pointer;position:relative;padding:6px ", ";line-height:", ";border-radius:0;color:", ";", " &:focus:not([disabled]){box-shadow:", ";}", "" ], S.variables.spacingLarge, S.variables.lineHeight, S.variables.textColor, (0,
104
- S.pickVariant)("$inner", {
105
- true: (0, g.css)([ "*:not(:first-child) > &&{border-top:2px solid ", ";}*:not(:last-child) > &&{border-bottom:2px solid ", ";}" ], S.variables.backgroundColor, S.variables.backgroundColor),
106
- false: (0, g.css)([ "& + &&{border-top:2px solid ", ";}" ], S.variables.backgroundColor)
107
- }), S.variables.focusShadowInset, (0, S.pickVariant)("$status", {
108
- normal: (0, g.css)([ "background-color:", ";&:hover:not([disabled]){background-color:", ";}" ], (0,
109
- S.pick)({
110
- dark: S.variables.gray45,
111
- light: S.variables.gray96
112
- }), (0, S.pick)({
113
- dark: S.variables.gray30,
114
- light: S.variables.gray92
103
+ })([ "display:block;width:100%;cursor:pointer;position:relative;padding:6px ", ";line-height:", ";border-radius:0;color:", ";", " &:focus:not([disabled]){box-shadow:", ";}", "" ], O.variables.spacingLarge, O.variables.lineHeight, O.variables.textColor, (0,
104
+ O.pickVariant)("$inner", {
105
+ true: (0, m.css)([ "*:not(:first-child) > &&{border-top:2px solid ", ";}*:not(:last-child) > &&{border-bottom:2px solid ", ";}" ], O.variables.backgroundColor, O.variables.backgroundColor),
106
+ false: (0, m.css)([ "& + &&{border-top:2px solid ", ";}" ], O.variables.backgroundColor)
107
+ }), O.variables.focusShadowInset, (0, O.pickVariant)("$status", {
108
+ normal: (0, m.css)([ "background-color:", ";&:hover:not([disabled]){background-color:", ";}" ], (0,
109
+ O.pick)({
110
+ dark: O.variables.gray45,
111
+ light: O.variables.gray96
112
+ }), (0, O.pick)({
113
+ dark: O.variables.gray30,
114
+ light: O.variables.gray92
115
115
  })),
116
- disabled: (0, g.css)([ "background-color:", ";" ], (0, S.pick)({
117
- dark: S.variables.gray80,
118
- light: S.variables.gray96
116
+ disabled: (0, m.css)([ "background-color:", ";" ], (0, O.pick)({
117
+ dark: O.variables.gray80,
118
+ light: O.variables.gray96
119
119
  })),
120
- error: (0, g.css)([ "background-color:", ";color:", ";&:hover:not([disabled]){background-color:", ";}" ], S.variables.errorColor, S.variables.white, S.variables.errorColorD10),
121
- warning: (0, g.css)([ "background-color:", ";color:", ";&:hover:not([disabled]){background-color:", ";box-shadow:none;}" ], S.variables.warningColor, S.variables.white, S.variables.warningColorD10)
120
+ error: (0, m.css)([ "background-color:", ";color:", ";&:hover:not([disabled]){background-color:", ";}" ], O.variables.errorColor, O.variables.white, O.variables.errorColorD10),
121
+ warning: (0, m.css)([ "background-color:", ";color:", ";&:hover:not([disabled]){background-color:", ";box-shadow:none;}" ], O.variables.warningColor, O.variables.white, O.variables.warningColorD10)
122
122
  }));
123
- var C = m().span.withConfig({
123
+ var C = g().span.withConfig({
124
124
  displayName: "HeadingStyles__StyledHeadingContent",
125
125
  componentId: "sc-1h92oaj-1"
126
126
  })([ "display:flex;justify-content:space-between;" ]);
127
- var j = m().span.withConfig({
127
+ var E = g().span.withConfig({
128
128
  displayName: "HeadingStyles__StyledDescription",
129
129
  componentId: "sc-1h92oaj-2"
130
- })([ "font-size:", ";" ], S.variables.fontSizeSmall);
130
+ })([ "font-size:", ";" ], O.variables.fontSizeSmall);
131
131
  // CONCATENATED MODULE: ./src/Concertina/Heading.tsx
132
132
  function P(e) {
133
133
  "@babel/helpers - typeof";
@@ -137,8 +137,8 @@
137
137
  return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
138
138
  }, P(e);
139
139
  }
140
- function E() {
141
- return E = Object.assign ? Object.assign.bind() : function(e) {
140
+ function j() {
141
+ return j = Object.assign ? Object.assign.bind() : function(e) {
142
142
  for (var t = 1; t < arguments.length; t++) {
143
143
  var n = arguments[t];
144
144
  for (var r in n) {
@@ -146,20 +146,20 @@
146
146
  }
147
147
  }
148
148
  return e;
149
- }, E.apply(null, arguments);
149
+ }, j.apply(null, arguments);
150
150
  }
151
- function _(e, t) {
151
+ function T(e, t) {
152
152
  if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
153
153
  }
154
- function T(e, t) {
154
+ function _(e, t) {
155
155
  for (var n = 0; n < t.length; n++) {
156
156
  var r = t[n];
157
157
  r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0),
158
- Object.defineProperty(e, A(r.key), r);
158
+ Object.defineProperty(e, M(r.key), r);
159
159
  }
160
160
  }
161
161
  function x(e, t, n) {
162
- return t && T(e.prototype, t), n && T(e, n), Object.defineProperty(e, "prototype", {
162
+ return t && _(e.prototype, t), n && _(e, n), Object.defineProperty(e, "prototype", {
163
163
  writable: !1
164
164
  }), e;
165
165
  }
@@ -181,11 +181,11 @@
181
181
  }, I(e, t);
182
182
  }
183
183
  function R(e) {
184
- var t = z();
184
+ var t = N();
185
185
  return function() {
186
- var n, r = M(e);
186
+ var n, r = A(e);
187
187
  if (t) {
188
- var o = M(this).constructor;
188
+ var o = A(this).constructor;
189
189
  n = Reflect.construct(r, arguments, o);
190
190
  } else n = r.apply(this, arguments);
191
191
  return q(this, n);
@@ -200,28 +200,28 @@
200
200
  if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
201
201
  return e;
202
202
  }
203
- function z() {
203
+ function N() {
204
204
  try {
205
205
  var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
206
206
  } catch (e) {}
207
- return (z = function t() {
207
+ return (N = function t() {
208
208
  return !!e;
209
209
  })();
210
210
  }
211
- function M(e) {
212
- return M = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
211
+ function A(e) {
212
+ return A = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
213
213
  return e.__proto__ || Object.getPrototypeOf(e);
214
- }, M(e);
214
+ }, A(e);
215
215
  }
216
- function N(e, t, n) {
217
- return (t = A(t)) in e ? Object.defineProperty(e, t, {
216
+ function z(e, t, n) {
217
+ return (t = M(t)) in e ? Object.defineProperty(e, t, {
218
218
  value: n,
219
219
  enumerable: !0,
220
220
  configurable: !0,
221
221
  writable: !0
222
222
  }) : e[t] = n, e;
223
223
  }
224
- function A(e) {
224
+ function M(e) {
225
225
  var t = W(e, "string");
226
226
  return "symbol" == P(t) ? t : t + "";
227
227
  }
@@ -248,21 +248,21 @@
248
248
  position: i().oneOf([ "top", "inner", "bottom" ]),
249
249
  status: i().oneOf([ "normal", "warning", "error", "disabled" ])
250
250
  };
251
- var $ = {
251
+ var L = {
252
252
  position: "inner"
253
253
  };
254
- var U = function(e) {
254
+ var $ = function(e) {
255
255
  H(n, e);
256
256
  var t = R(n);
257
257
  function n() {
258
258
  var e;
259
- _(this, n);
259
+ T(this, n);
260
260
  for (var r = arguments.length, o = new Array(r), i = 0; i < r; i++) {
261
261
  o[i] = arguments[i];
262
262
  }
263
263
  e = t.call.apply(t, [ this ].concat(o));
264
- N(B(e), "container", null);
265
- N(B(e), "handleClick", (function(t) {
264
+ z(B(e), "container", null);
265
+ z(B(e), "handleClick", (function(t) {
266
266
  var n, r;
267
267
  (n = (r = e.props).onClick) === null || n === void 0 ? void 0 : n.call(r, t, {
268
268
  index: e.props.index,
@@ -270,7 +270,7 @@
270
270
  position: e.props.position
271
271
  });
272
272
  }));
273
- N(B(e), "handleMount", (function(t) {
273
+ z(B(e), "handleMount", (function(t) {
274
274
  e.container = t;
275
275
  }));
276
276
  return e;
@@ -287,7 +287,7 @@
287
287
  value: function e() {
288
288
  var t = this.props, o = t.children, i = t.description, a = t.panelId, l = t.position, c = t.status;
289
289
 
290
- return r().createElement(k, E({
290
+ return r().createElement(k, j({
291
291
  disabled: c === "disabled",
292
292
  $inner: l === "inner",
293
293
  $status: c,
@@ -295,18 +295,18 @@
295
295
  ref: this.handleMount,
296
296
  "data-test": "heading",
297
297
  "data-test-panel-id": a
298
- }, v()(this.props, h()(n.propTypes))), r().createElement(C, null, r().createElement("span", {
298
+ }, v()(this.props, b()(n.propTypes))), r().createElement(C, null, r().createElement("span", {
299
299
  "data-concertina-role": "title"
300
- }, o), i && r().createElement(j, {
300
+ }, o), i && r().createElement(E, {
301
301
  "data-concertina-role": "description"
302
302
  }, i)));
303
303
  }
304
304
  } ]);
305
305
  return n;
306
306
  }(n.Component);
307
- N(U, "propTypes", D);
308
- N(U, "defaultProps", $);
309
- /* harmony default export */ const L = U;
307
+ z($, "propTypes", D);
308
+ z($, "defaultProps", L);
309
+ /* harmony default export */ const U = $;
310
310
  // CONCATENATED MODULE: external "lodash/throttle"
311
311
  const V = require("lodash/throttle");
312
312
  var F = e.n(V);
@@ -317,37 +317,162 @@
317
317
  const K = require("@splunk/react-ui/Scroll");
318
318
  var Q = e.n(K);
319
319
  // CONCATENATED MODULE: ./src/Concertina/ConcertinaStyles.ts
320
- var X = (0, g.css)([ "position:absolute;left:0;top:0;right:0;bottom:0;" ]);
321
- var Y = m()(Q()).withConfig({
320
+ var X = (0, m.css)([ "position:absolute;left:0;top:0;right:0;bottom:0;" ]);
321
+ var Y = g()(Q()).withConfig({
322
322
  displayName: "ConcertinaStyles__StyledScroll",
323
323
  componentId: "sc-1fzuh39-0"
324
324
  })([ "", "" ], X);
325
- var Z = m()(J()).withConfig({
325
+ var Z = g()(J()).withConfig({
326
326
  displayName: "ConcertinaStyles__StyledBox",
327
327
  componentId: "sc-1fzuh39-1"
328
328
  })([ "", " overflow:hidden;" ], X);
329
- var ee = m().div.withConfig({
329
+ var ee = g().div.withConfig({
330
330
  displayName: "ConcertinaStyles__StyledTop",
331
331
  componentId: "sc-1fzuh39-2"
332
- })([ "position:absolute;left:0;top:0;right:0;z-index:1;background-color:", ";&::after{content:'';position:absolute;bottom:-10px;height:10px;left:0;right:0;background-image:linear-gradient(180deg,rgba(0,0,0,0.15),rgba(0,0,0,0));}" ], S.variables.backgroundColor);
333
- var te = m().div.withConfig({
332
+ })([ "position:absolute;left:0;top:0;right:0;z-index:1;background-color:", ";&::after{content:'';position:absolute;bottom:-10px;height:10px;left:0;right:0;background-image:linear-gradient(180deg,rgba(0,0,0,0.15),rgba(0,0,0,0));}" ], O.variables.backgroundColor);
333
+ var te = g().div.withConfig({
334
334
  displayName: "ConcertinaStyles__StyledBottom",
335
335
  componentId: "sc-1fzuh39-3"
336
- })([ "position:absolute;left:0;bottom:0;right:0;background-color:", ";&::before{content:'';position:absolute;top:-5px;height:5px;left:0;right:0;background-image:linear-gradient(0deg,rgba(0,0,0,0.15),rgba(0,0,0,0));}" ], S.variables.backgroundColor);
337
- var ne = m().div.withConfig({
336
+ })([ "position:absolute;left:0;bottom:0;right:0;background-color:", ";&::before{content:'';position:absolute;top:-5px;height:5px;left:0;right:0;background-image:linear-gradient(0deg,rgba(0,0,0,0.15),rgba(0,0,0,0));}" ], O.variables.backgroundColor);
337
+ var ne = g().div.withConfig({
338
338
  displayName: "ConcertinaStyles__StyledPanelBody",
339
339
  componentId: "sc-1fzuh39-4"
340
- })([ "", "" ], (0, S.pickVariant)("$status", {
340
+ })([ "", "" ], (0, O.pickVariant)("$status", {
341
341
  error: {
342
- dark: (0, g.css)([ "background-color:", ";" ], S.mixins.colorWithAlpha(S.variables.errorColor, .5)),
343
- light: (0, g.css)([ "background-color:", ";" ], S.variables.errorColorL50)
342
+ dark: (0, m.css)([ "background-color:", ";" ], O.mixins.colorWithAlpha(O.variables.errorColor, .5)),
343
+ light: (0, m.css)([ "background-color:", ";" ], O.variables.errorColorL50)
344
344
  },
345
345
  warning: {
346
- dark: (0, g.css)([ "background-color:", ";" ], S.mixins.colorWithAlpha(S.variables.warningColor, .5)),
347
- light: (0, g.css)([ "background-color:", ";" ], S.variables.warningColorL50)
346
+ dark: (0, m.css)([ "background-color:", ";" ], O.mixins.colorWithAlpha(O.variables.warningColor, .5)),
347
+ light: (0, m.css)([ "background-color:", ";" ], O.variables.warningColorL50)
348
348
  },
349
- disabled: (0, g.css)([ "display:none;" ])
349
+ disabled: (0, m.css)([ "display:none;" ])
350
350
  }));
351
+ // CONCATENATED MODULE: ./src/utils/ssrDocument.ts
352
+ /* eslint-disable @typescript-eslint/no-empty-function */
353
+ var re = {
354
+ body: {
355
+ appendChild: function e() {
356
+ return [];
357
+ }
358
+ },
359
+ addEventListener: function e() {},
360
+ removeEventListener: function e() {},
361
+ activeElement: {
362
+ blur: function e() {},
363
+ nodeName: ""
364
+ },
365
+ querySelector: function e() {
366
+ return null;
367
+ },
368
+ querySelectorAll: function e() {
369
+ return [];
370
+ },
371
+ getElementById: function e() {
372
+ return null;
373
+ },
374
+ createEvent: function e() {
375
+ return {
376
+ initEvent: function e() {}
377
+ };
378
+ },
379
+ createElement: function e() {
380
+ return {
381
+ children: [],
382
+ childNodes: [],
383
+ style: {},
384
+ setAttribute: function e() {},
385
+ getElementsByTagName: function e() {
386
+ return [];
387
+ }
388
+ };
389
+ },
390
+ createElementNS: function e() {
391
+ return {};
392
+ },
393
+ importNode: function e() {
394
+ return null;
395
+ },
396
+ location: {
397
+ hash: "",
398
+ host: "",
399
+ hostname: "",
400
+ href: "",
401
+ origin: "",
402
+ pathname: "",
403
+ protocol: "",
404
+ search: ""
405
+ }
406
+ };
407
+ function oe() {
408
+ var e = typeof document !== "undefined" ? document : re;
409
+ return e;
410
+ }
411
+ var ie = oe();
412
+ /* harmony default export */ const ae = /* unused pure expression or super */ null && ie;
413
+ // CONCATENATED MODULE: ./src/utils/ssrWindow.ts
414
+ /* eslint-disable @typescript-eslint/no-empty-function */
415
+ var le = {
416
+ document: re,
417
+ navigator: {
418
+ userAgent: ""
419
+ },
420
+ location: {
421
+ hash: "",
422
+ host: "",
423
+ hostname: "",
424
+ href: "",
425
+ origin: "",
426
+ pathname: "",
427
+ protocol: "",
428
+ search: ""
429
+ },
430
+ history: {
431
+ replaceState: function e() {},
432
+ pushState: function e() {},
433
+ go: function e() {},
434
+ back: function e() {}
435
+ },
436
+ CustomEvent: function e() {
437
+ return this;
438
+ },
439
+ addEventListener: function e() {},
440
+ removeEventListener: function e() {},
441
+ getComputedStyle: function e() {
442
+ return {
443
+ getPropertyValue: function e() {
444
+ return "";
445
+ }
446
+ };
447
+ },
448
+ Image: function e() {},
449
+ Date: function e() {},
450
+ screen: {},
451
+ setTimeout: function e() {},
452
+ clearTimeout: function e() {},
453
+ matchMedia: function e() {
454
+ return {};
455
+ },
456
+ requestAnimationFrame: function e(t) {
457
+ if (typeof setTimeout === "undefined") {
458
+ t();
459
+ return null;
460
+ }
461
+ return setTimeout(t, 0);
462
+ },
463
+ cancelAnimationFrame: function e(t) {
464
+ if (typeof setTimeout === "undefined") {
465
+ return;
466
+ }
467
+ clearTimeout(t);
468
+ }
469
+ };
470
+ function ce() {
471
+ var e = typeof window !== "undefined" ? window : le;
472
+ return e;
473
+ }
474
+ var ue = ce();
475
+ /* harmony default export */ const se = ue;
351
476
  // CONCATENATED MODULE: ./src/utils/updateReactRef.ts
352
477
  /**
353
478
  * Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
@@ -355,7 +480,7 @@
355
480
  * @param ref - The React callback or object ref. Can be `null` or `undefined`.
356
481
  * @param current - The new value of the ref.
357
482
  */
358
- function re(e, t) {
483
+ function fe(e, t) {
359
484
  if (e) {
360
485
  if (typeof e === "function") {
361
486
  e(t);
@@ -368,20 +493,20 @@
368
493
  }
369
494
  }
370
495
  // CONCATENATED MODULE: ./src/Concertina/ConcertinaContext.tsx
371
- var oe = (0, n.createContext)({});
372
- oe.displayName = "Concertina";
373
- /* harmony default export */ const ie = oe;
496
+ var pe = (0, n.createContext)({});
497
+ pe.displayName = "Concertina";
498
+ /* harmony default export */ const de = pe;
374
499
  // CONCATENATED MODULE: ./src/Concertina/Panel.tsx
375
- function ae(e) {
500
+ function he(e) {
376
501
  "@babel/helpers - typeof";
377
- return ae = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
502
+ return he = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
378
503
  return typeof e;
379
504
  } : function(e) {
380
505
  return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
381
- }, ae(e);
506
+ }, he(e);
382
507
  }
383
- function le() {
384
- return le = Object.assign ? Object.assign.bind() : function(e) {
508
+ function be() {
509
+ return be = Object.assign ? Object.assign.bind() : function(e) {
385
510
  for (var t = 1; t < arguments.length; t++) {
386
511
  var n = arguments[t];
387
512
  for (var r in n) {
@@ -389,50 +514,50 @@
389
514
  }
390
515
  }
391
516
  return e;
392
- }, le.apply(null, arguments);
517
+ }, be.apply(null, arguments);
393
518
  }
394
- function ce(e) {
395
- return fe(e) || pe(e) || ue(e) || se();
519
+ function ye(e) {
520
+ return we(e) || ge(e) || me(e) || ve();
396
521
  }
397
- function se() {
522
+ function ve() {
398
523
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
399
524
  }
400
- function ue(e, t) {
525
+ function me(e, t) {
401
526
  if (e) {
402
- if ("string" == typeof e) return de(e, t);
527
+ if ("string" == typeof e) return Se(e, t);
403
528
  var n = {}.toString.call(e).slice(8, -1);
404
- return "Object" === n && e.constructor && (n = e.constructor.name), "Map" === n || "Set" === n ? Array.from(e) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? de(e, t) : void 0;
529
+ return "Object" === n && e.constructor && (n = e.constructor.name), "Map" === n || "Set" === n ? Array.from(e) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? Se(e, t) : void 0;
405
530
  }
406
531
  }
407
- function pe(e) {
532
+ function ge(e) {
408
533
  if ("undefined" != typeof Symbol && null != e[Symbol.iterator] || null != e["@@iterator"]) return Array.from(e);
409
534
  }
410
- function fe(e) {
411
- if (Array.isArray(e)) return de(e);
535
+ function we(e) {
536
+ if (Array.isArray(e)) return Se(e);
412
537
  }
413
- function de(e, t) {
538
+ function Se(e, t) {
414
539
  (null == t || t > e.length) && (t = e.length);
415
540
  for (var n = 0, r = Array(t); n < t; n++) {
416
541
  r[n] = e[n];
417
542
  }
418
543
  return r;
419
544
  }
420
- function be(e, t) {
545
+ function Oe(e, t) {
421
546
  if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
422
547
  }
423
- function he(e, t) {
548
+ function ke(e, t) {
424
549
  for (var n = 0; n < t.length; n++) {
425
550
  var r = t[n];
426
551
  r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0),
427
- Object.defineProperty(e, je(r.key), r);
552
+ Object.defineProperty(e, Re(r.key), r);
428
553
  }
429
554
  }
430
- function ye(e, t, n) {
431
- return t && he(e.prototype, t), n && he(e, n), Object.defineProperty(e, "prototype", {
555
+ function Ce(e, t, n) {
556
+ return t && ke(e.prototype, t), n && ke(e, n), Object.defineProperty(e, "prototype", {
432
557
  writable: !1
433
558
  }), e;
434
559
  }
435
- function ve(e, t) {
560
+ function Ee(e, t) {
436
561
  if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
437
562
  e.prototype = Object.create(t && t.prototype, {
438
563
  constructor: {
@@ -442,69 +567,69 @@
442
567
  }
443
568
  }), Object.defineProperty(e, "prototype", {
444
569
  writable: !1
445
- }), t && ge(e, t);
570
+ }), t && Pe(e, t);
446
571
  }
447
- function ge(e, t) {
448
- return ge = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
572
+ function Pe(e, t) {
573
+ return Pe = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
449
574
  return e.__proto__ = t, e;
450
- }, ge(e, t);
575
+ }, Pe(e, t);
451
576
  }
452
- function me(e) {
453
- var t = Se();
577
+ function je(e) {
578
+ var t = xe();
454
579
  return function() {
455
- var n, r = ke(e);
580
+ var n, r = He(e);
456
581
  if (t) {
457
- var o = ke(this).constructor;
582
+ var o = He(this).constructor;
458
583
  n = Reflect.construct(r, arguments, o);
459
584
  } else n = r.apply(this, arguments);
460
- return we(this, n);
585
+ return Te(this, n);
461
586
  };
462
587
  }
463
- function we(e, t) {
464
- if (t && ("object" == ae(t) || "function" == typeof t)) return t;
588
+ function Te(e, t) {
589
+ if (t && ("object" == he(t) || "function" == typeof t)) return t;
465
590
  if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
466
- return Oe(e);
591
+ return _e(e);
467
592
  }
468
- function Oe(e) {
593
+ function _e(e) {
469
594
  if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
470
595
  return e;
471
596
  }
472
- function Se() {
597
+ function xe() {
473
598
  try {
474
599
  var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
475
600
  } catch (e) {}
476
- return (Se = function t() {
601
+ return (xe = function t() {
477
602
  return !!e;
478
603
  })();
479
604
  }
480
- function ke(e) {
481
- return ke = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
605
+ function He(e) {
606
+ return He = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
482
607
  return e.__proto__ || Object.getPrototypeOf(e);
483
- }, ke(e);
608
+ }, He(e);
484
609
  }
485
- function Ce(e, t, n) {
486
- return (t = je(t)) in e ? Object.defineProperty(e, t, {
610
+ function Ie(e, t, n) {
611
+ return (t = Re(t)) in e ? Object.defineProperty(e, t, {
487
612
  value: n,
488
613
  enumerable: !0,
489
614
  configurable: !0,
490
615
  writable: !0
491
616
  }) : e[t] = n, e;
492
617
  }
493
- function je(e) {
494
- var t = Pe(e, "string");
495
- return "symbol" == ae(t) ? t : t + "";
618
+ function Re(e) {
619
+ var t = qe(e, "string");
620
+ return "symbol" == he(t) ? t : t + "";
496
621
  }
497
- function Pe(e, t) {
498
- if ("object" != ae(e) || !e) return e;
622
+ function qe(e, t) {
623
+ if ("object" != he(e) || !e) return e;
499
624
  var n = e[Symbol.toPrimitive];
500
625
  if (void 0 !== n) {
501
626
  var r = n.call(e, t || "default");
502
- if ("object" != ae(r)) return r;
627
+ if ("object" != he(r)) return r;
503
628
  throw new TypeError("@@toPrimitive must return a primitive value.");
504
629
  }
505
630
  return ("string" === t ? String : Number)(e);
506
631
  }
507
- var Ee = {
632
+ var Be = {
508
633
  children: i().node,
509
634
  description: i().node,
510
635
  elementRef: i().oneOfType([ i().func, i().object ]),
@@ -514,19 +639,19 @@
514
639
  status: i().oneOf([ "normal", "warning", "error", "disabled" ]),
515
640
  title: i().node.isRequired
516
641
  };
517
- var _e = {
642
+ var Ne = {
518
643
  status: "normal"
519
644
  };
520
- var Te = function(e) {
521
- ve(n, e);
522
- var t = me(n);
645
+ var Ae = function(e) {
646
+ Ee(n, e);
647
+ var t = je(n);
523
648
  // @docs-props-type PanelPropsBase
524
649
  function n(e) {
525
650
  var r;
526
- be(this, n);
651
+ Oe(this, n);
527
652
  r = t.call(this, e);
528
- Ce(Oe(r), "lastHeight", void 0);
529
- Ce(Oe(r), "measureHeight", (function(e) {
653
+ Ie(_e(r), "lastHeight", void 0);
654
+ Ie(_e(r), "measureHeight", (function(e) {
530
655
  var t, n, o;
531
656
  if (!r.state.containerEl || !r.state.bodyEl) {
532
657
  return;
@@ -544,19 +669,19 @@
544
669
  r.lastHeight = i;
545
670
  (n = (o = r.context).onChange) === null || n === void 0 ? void 0 : n.call(o, e, a);
546
671
  }));
547
- Ce(Oe(r), "handleResize", F()(r.measureHeight, 300));
548
- Ce(Oe(r), "handleMount", (function(e) {
672
+ Ie(_e(r), "handleResize", F()(r.measureHeight, 300));
673
+ Ie(_e(r), "handleMount", (function(e) {
549
674
  r.setState({
550
675
  containerEl: e
551
676
  });
552
- re(r.props.elementRef, e);
677
+ fe(r.props.elementRef, e);
553
678
  }));
554
- Ce(Oe(r), "handleHeadingMount", (function(e) {
679
+ Ie(_e(r), "handleHeadingMount", (function(e) {
555
680
  r.setState({
556
681
  heading: e
557
682
  });
558
683
  }));
559
- Ce(Oe(r), "handleBodyMount", (function(e) {
684
+ Ie(_e(r), "handleBodyMount", (function(e) {
560
685
  r.setState({
561
686
  bodyEl: e
562
687
  });
@@ -568,7 +693,7 @@
568
693
  };
569
694
  return r;
570
695
  }
571
- ye(n, [ {
696
+ Ce(n, [ {
572
697
  key: "componentDidUpdate",
573
698
  value: function e(t, n) {
574
699
  if (this.props.children !== t.children || !n.containerEl) {
@@ -590,50 +715,50 @@
590
715
  }, {
591
716
  key: "render",
592
717
  value: function e() {
593
- var t = this.props, o = t.children, i = t.description, a = t.index, l = t.panelId, c = t.status, s = t.style, u = t.title;
594
- var p = this.context.onHeadingClick;
718
+ var t = this.props, o = t.children, i = t.description, a = t.index, l = t.panelId, c = t.status, u = t.style, s = t.title;
719
+ var f = this.context.onHeadingClick;
595
720
 
596
- return r().createElement("div", le({
721
+ return r().createElement("div", be({
597
722
  ref: this.handleMount,
598
723
  "data-test": "panel",
599
724
  "data-test-panel-id": l || "".concat(a)
600
- }, v()(this.props, [].concat(ce(h()(n.propTypes)), [ "style" ]))), r().createElement(L, {
601
- onClick: p,
725
+ }, v()(this.props, [].concat(ye(b()(n.propTypes)), [ "style" ]))), r().createElement(U, {
726
+ onClick: f,
602
727
  ref: this.handleHeadingMount,
603
728
  description: i,
604
729
  index: a !== null && a !== void 0 ? a : 0,
605
730
  panelId: l || "".concat(a),
606
731
  position: "inner",
607
732
  status: c
608
- }, u), r().createElement(d(), {
609
- target: window,
733
+ }, s), r().createElement(d(), {
734
+ target: se,
610
735
  eventType: "resize",
611
736
  listener: this.handleResize
612
737
  }), r().createElement(ne, {
613
738
  $status: c,
614
739
  "data-test": "body",
615
- style: s,
740
+ style: u,
616
741
  ref: this.handleBodyMount
617
742
  }, o));
618
743
  }
619
744
  } ]);
620
745
  return n;
621
746
  }(n.Component);
622
- Ce(Te, "propTypes", Ee);
623
- Ce(Te, "defaultProps", _e);
624
- Ce(Te, "contextType", ie);
625
- /* harmony default export */ const xe = Te;
747
+ Ie(Ae, "propTypes", Be);
748
+ Ie(Ae, "defaultProps", Ne);
749
+ Ie(Ae, "contextType", de);
750
+ /* harmony default export */ const ze = Ae;
626
751
  // CONCATENATED MODULE: ./src/Concertina/Concertina.tsx
627
- function He(e) {
752
+ function Me(e) {
628
753
  "@babel/helpers - typeof";
629
- return He = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
754
+ return Me = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
630
755
  return typeof e;
631
756
  } : function(e) {
632
757
  return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
633
- }, He(e);
758
+ }, Me(e);
634
759
  }
635
- function Ie() {
636
- return Ie = Object.assign ? Object.assign.bind() : function(e) {
760
+ function We() {
761
+ return We = Object.assign ? Object.assign.bind() : function(e) {
637
762
  for (var t = 1; t < arguments.length; t++) {
638
763
  var n = arguments[t];
639
764
  for (var r in n) {
@@ -641,11 +766,11 @@
641
766
  }
642
767
  }
643
768
  return e;
644
- }, Ie.apply(null, arguments);
769
+ }, We.apply(null, arguments);
645
770
  }
646
- function Re(e, t) {
771
+ function De(e, t) {
647
772
  if (null == e) return {};
648
- var n, r, o = qe(e, t);
773
+ var n, r, o = Le(e, t);
649
774
  if (Object.getOwnPropertySymbols) {
650
775
  var i = Object.getOwnPropertySymbols(e);
651
776
  for (r = 0; r < i.length; r++) {
@@ -654,7 +779,7 @@
654
779
  }
655
780
  return o;
656
781
  }
657
- function qe(e, t) {
782
+ function Le(e, t) {
658
783
  if (null == e) return {};
659
784
  var n = {};
660
785
  for (var r in e) {
@@ -665,22 +790,22 @@
665
790
  }
666
791
  return n;
667
792
  }
668
- function Be(e, t) {
793
+ function $e(e, t) {
669
794
  if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
670
795
  }
671
- function ze(e, t) {
796
+ function Ue(e, t) {
672
797
  for (var n = 0; n < t.length; n++) {
673
798
  var r = t[n];
674
799
  r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0),
675
- Object.defineProperty(e, Fe(r.key), r);
800
+ Object.defineProperty(e, et(r.key), r);
676
801
  }
677
802
  }
678
- function Me(e, t, n) {
679
- return t && ze(e.prototype, t), n && ze(e, n), Object.defineProperty(e, "prototype", {
803
+ function Ve(e, t, n) {
804
+ return t && Ue(e.prototype, t), n && Ue(e, n), Object.defineProperty(e, "prototype", {
680
805
  writable: !1
681
806
  }), e;
682
807
  }
683
- function Ne(e, t) {
808
+ function Fe(e, t) {
684
809
  if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
685
810
  e.prototype = Object.create(t && t.prototype, {
686
811
  constructor: {
@@ -690,86 +815,86 @@
690
815
  }
691
816
  }), Object.defineProperty(e, "prototype", {
692
817
  writable: !1
693
- }), t && Ae(e, t);
818
+ }), t && Ge(e, t);
694
819
  }
695
- function Ae(e, t) {
696
- return Ae = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
820
+ function Ge(e, t) {
821
+ return Ge = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
697
822
  return e.__proto__ = t, e;
698
- }, Ae(e, t);
823
+ }, Ge(e, t);
699
824
  }
700
- function We(e) {
701
- var t = Ue();
825
+ function Je(e) {
826
+ var t = Xe();
702
827
  return function() {
703
- var n, r = Le(e);
828
+ var n, r = Ye(e);
704
829
  if (t) {
705
- var o = Le(this).constructor;
830
+ var o = Ye(this).constructor;
706
831
  n = Reflect.construct(r, arguments, o);
707
832
  } else n = r.apply(this, arguments);
708
- return De(this, n);
833
+ return Ke(this, n);
709
834
  };
710
835
  }
711
- function De(e, t) {
712
- if (t && ("object" == He(t) || "function" == typeof t)) return t;
836
+ function Ke(e, t) {
837
+ if (t && ("object" == Me(t) || "function" == typeof t)) return t;
713
838
  if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
714
- return $e(e);
839
+ return Qe(e);
715
840
  }
716
- function $e(e) {
841
+ function Qe(e) {
717
842
  if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
718
843
  return e;
719
844
  }
720
- function Ue() {
845
+ function Xe() {
721
846
  try {
722
847
  var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
723
848
  } catch (e) {}
724
- return (Ue = function t() {
849
+ return (Xe = function t() {
725
850
  return !!e;
726
851
  })();
727
852
  }
728
- function Le(e) {
729
- return Le = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
853
+ function Ye(e) {
854
+ return Ye = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
730
855
  return e.__proto__ || Object.getPrototypeOf(e);
731
- }, Le(e);
856
+ }, Ye(e);
732
857
  }
733
- function Ve(e, t, n) {
734
- return (t = Fe(t)) in e ? Object.defineProperty(e, t, {
858
+ function Ze(e, t, n) {
859
+ return (t = et(t)) in e ? Object.defineProperty(e, t, {
735
860
  value: n,
736
861
  enumerable: !0,
737
862
  configurable: !0,
738
863
  writable: !0
739
864
  }) : e[t] = n, e;
740
865
  }
741
- function Fe(e) {
742
- var t = Ge(e, "string");
743
- return "symbol" == He(t) ? t : t + "";
866
+ function et(e) {
867
+ var t = tt(e, "string");
868
+ return "symbol" == Me(t) ? t : t + "";
744
869
  }
745
- function Ge(e, t) {
746
- if ("object" != He(e) || !e) return e;
870
+ function tt(e, t) {
871
+ if ("object" != Me(e) || !e) return e;
747
872
  var n = e[Symbol.toPrimitive];
748
873
  if (void 0 !== n) {
749
874
  var r = n.call(e, t || "default");
750
- if ("object" != He(r)) return r;
875
+ if ("object" != Me(r)) return r;
751
876
  throw new TypeError("@@toPrimitive must return a primitive value.");
752
877
  }
753
878
  return ("string" === t ? String : Number)(e);
754
879
  }
755
- var Je = {
880
+ var nt = {
756
881
  children: i().node,
757
882
  elementRef: i().oneOfType([ i().func, i().object ])
758
883
  };
759
- var Ke = {};
884
+ var rt = {};
760
885
  /**
761
886
  * @deprecated
762
887
  * Concertina has been deprecated and will be removed in a future major version.
763
- */ var Qe = function(e) {
764
- Ne(o, e);
765
- var t = We(o);
888
+ */ var ot = function(e) {
889
+ Fe(o, e);
890
+ var t = Je(o);
766
891
  // @docs-props-type ConcertinaPropsBase
767
892
  function o(e) {
768
893
  var n;
769
- Be(this, o);
894
+ $e(this, o);
770
895
  n = t.call(this, e);
771
- Ve($e(n), "panelPositions", void 0);
772
- Ve($e(n), "handleUpdate", (function(e, t) {
896
+ Ze(Qe(n), "panelPositions", void 0);
897
+ Ze(Qe(n), "handleUpdate", (function(e, t) {
773
898
  n.panelPositions[t.index] = t;
774
899
  var r = 0;
775
900
  n.panelPositions.forEach((function(e) {
@@ -779,7 +904,7 @@
779
904
  }));
780
905
  n.updateHeadings();
781
906
  }));
782
- Ve($e(n), "handleElementMount", (function(e) {
907
+ Ze(Qe(n), "handleElementMount", (function(e) {
783
908
  n.setState({
784
909
  scrollEl: e
785
910
  });
@@ -791,7 +916,7 @@
791
916
  });
792
917
  }
793
918
  }));
794
- Ve($e(n), "handleResize", (function() {
919
+ Ze(Qe(n), "handleResize", (function() {
795
920
  n.setState((function(e) {
796
921
  var t;
797
922
  return {
@@ -799,43 +924,43 @@
799
924
  };
800
925
  }));
801
926
  }));
802
- Ve($e(n), "handleScroll", (function() {
927
+ Ze(Qe(n), "handleScroll", (function() {
803
928
  n.updateHeadings();
804
929
  }));
805
- Ve($e(n), "handleScrollComplete", (function() {
930
+ Ze(Qe(n), "handleScrollComplete", (function() {
806
931
  n.setState({
807
932
  targetTop: undefined
808
933
  });
809
934
  }));
810
- Ve($e(n), "handleClick", (function(e, t) {
935
+ Ze(Qe(n), "handleClick", (function(e, t) {
811
936
  var r;
812
937
  var o = t.index, i = t.position;
813
938
  var a = n.state.scrollEl;
814
939
  if (!a) {
815
940
  return;
816
941
  }
817
- var l = s()(n.panelPositions, o).map((function(e) {
942
+ var l = u()(n.panelPositions, o).map((function(e) {
818
943
  return e.headingHeight;
819
944
  })).reduce((function(e, t) {
820
945
  return e + t;
821
946
  }), 0);
822
947
  // sum the heights
823
- var c = p()(n.panelPositions, n.panelPositions.length - o - 1).map((function(e) {
948
+ var c = f()(n.panelPositions, n.panelPositions.length - o - 1).map((function(e) {
824
949
  return e.headingHeight;
825
950
  })).reduce((function(e, t) {
826
951
  return e + t;
827
952
  }), 0);
828
953
  // sum the heights
829
- var u = a.clientHeight - l - c;
830
- var f = n.panelPositions[o].height;
954
+ var s = a.clientHeight - l - c;
955
+ var p = n.panelPositions[o].height;
831
956
  var d = ((r = n.panelPositions[o].offsetTop) !== null && r !== void 0 ? r : 0) - l;
832
- var b = d - (u - f);
833
- var h = u > f && (i === "bottom" || i === "inner");
957
+ var h = d - (s - p);
958
+ var b = s > p && (i === "bottom" || i === "inner");
834
959
  // if the entire panel is in view, do nothing
835
- if (h && b < a.scrollTop) {
960
+ if (b && h < a.scrollTop) {
836
961
  return;
837
962
  }
838
- var y = h ? b : d;
963
+ var y = b ? h : d;
839
964
  // handleRest will shift focus;
840
965
  if (i !== "inner") {
841
966
  e.currentTarget.blur();
@@ -844,7 +969,7 @@
844
969
  targetTop: y
845
970
  });
846
971
  }));
847
- Ve($e(n), "updateHeadingsImpl", (function() {
972
+ Ze(Qe(n), "updateHeadingsImpl", (function() {
848
973
  var e = n.state.scrollEl;
849
974
  if (!e) {
850
975
  return;
@@ -870,7 +995,7 @@
870
995
  panelsBottomCount: n.panelPositions.reduceRight(i, 0)
871
996
  });
872
997
  }));
873
- Ve($e(n), "updateHeadings", l()(n.updateHeadingsImpl, 0));
998
+ Ze(Qe(n), "updateHeadings", l()(n.updateHeadingsImpl, 0));
874
999
  n.state = {
875
1000
  innerWidth: "100%",
876
1001
  panelsBottomCount: 0,
@@ -880,7 +1005,7 @@
880
1005
  n.panelPositions = [];
881
1006
  return n;
882
1007
  }
883
- Me(o, [ {
1008
+ Ve(o, [ {
884
1009
  key: "componentWillUnmount",
885
1010
  value: function e() {
886
1011
  this.updateHeadings.cancel();
@@ -892,7 +1017,7 @@
892
1017
  var i = t.map((function(e) {
893
1018
  var t;
894
1019
 
895
- return r().createElement(L, {
1020
+ return r().createElement(U, {
896
1021
  onClick: o.handleClick,
897
1022
  description: e.props.description,
898
1023
  panelId: e.props.panelId,
@@ -909,20 +1034,20 @@
909
1034
  key: "render",
910
1035
  value: function e() {
911
1036
  if (false) {}
912
- var t = this.props, o = t.children, i = Re(t, [ "children" ]);
1037
+ var t = this.props, o = t.children, i = De(t, [ "children" ]);
913
1038
  var a = n.Children.toArray(o).filter(n.isValidElement).map((function(e, t) {
914
1039
 
915
1040
  return (0, n.cloneElement)(e, {
916
1041
  index: t
917
1042
  });
918
1043
  }));
919
- var l = s()(a, this.state.panelsTopCount);
920
- var c = p()(a, this.state.panelsBottomCount);
1044
+ var l = u()(a, this.state.panelsTopCount);
1045
+ var c = f()(a, this.state.panelsBottomCount);
921
1046
 
922
- return r().createElement(Z, Ie({
1047
+ return r().createElement(Z, We({
923
1048
  "data-test": "concertina"
924
1049
  }, i), r().createElement(d(), {
925
- target: window,
1050
+ target: se,
926
1051
  eventType: "resize",
927
1052
  listener: this.handleResize
928
1053
  }), this.state.panelsTopCount > 0 && r().createElement(ee, {
@@ -938,7 +1063,7 @@
938
1063
  "data-test": "scroll",
939
1064
  top: this.state.targetTop,
940
1065
  onScrollComplete: this.handleScrollComplete
941
- }, r().createElement(ie.Provider, {
1066
+ }, r().createElement(de.Provider, {
942
1067
  // eslint-disable-next-line react/jsx-no-constructed-context-values
943
1068
  value: {
944
1069
  onHeadingClick: this.handleClick,
@@ -954,10 +1079,10 @@
954
1079
  } ]);
955
1080
  return o;
956
1081
  }(n.Component);
957
- Ve(Qe, "propTypes", Je);
958
- Ve(Qe, "defaultProps", Ke);
959
- Ve(Qe, "Panel", xe);
960
- /* harmony default export */ const Xe = Qe;
1082
+ Ze(ot, "propTypes", nt);
1083
+ Ze(ot, "defaultProps", rt);
1084
+ Ze(ot, "Panel", ze);
1085
+ /* harmony default export */ const it = ot;
961
1086
  // CONCATENATED MODULE: ./src/Concertina/index.ts
962
1087
  module.exports = t;
963
1088
  /******/})();