react-data-matrix 0.4.2 → 1.0.0-rc.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.
Files changed (52) hide show
  1. package/README.md +416 -280
  2. package/dist/components/MatrixHeaders.d.ts +8 -0
  3. package/dist/components/MatrixRows.d.ts +16 -0
  4. package/dist/components/TableData.d.ts +17 -0
  5. package/dist/grid.d.ts +13 -0
  6. package/dist/index.d.ts +6 -0
  7. package/dist/index.js +1414 -0
  8. package/dist/theme/baseCss.d.ts +2 -0
  9. package/dist/theme/colour.d.ts +10 -0
  10. package/dist/theme/presets/arcade.d.ts +2 -0
  11. package/dist/theme/presets/aurora.d.ts +2 -0
  12. package/dist/theme/presets/beacon.d.ts +2 -0
  13. package/dist/theme/presets/blueprint.d.ts +2 -0
  14. package/dist/theme/presets/boardroom.d.ts +2 -0
  15. package/dist/theme/presets/broadsheet.d.ts +2 -0
  16. package/dist/theme/presets/brutal.d.ts +2 -0
  17. package/dist/theme/presets/canopy.d.ts +2 -0
  18. package/dist/theme/presets/clay.d.ts +2 -0
  19. package/dist/theme/presets/contour.d.ts +2 -0
  20. package/dist/theme/presets/fjord.d.ts +2 -0
  21. package/dist/theme/presets/glasshouse.d.ts +2 -0
  22. package/dist/theme/presets/graphite.d.ts +2 -0
  23. package/dist/theme/presets/index.d.ts +57 -0
  24. package/dist/theme/presets/ledger.d.ts +2 -0
  25. package/dist/theme/presets/midnight.d.ts +2 -0
  26. package/dist/theme/presets/neon.d.ts +2 -0
  27. package/dist/theme/presets/noir.d.ts +2 -0
  28. package/dist/theme/presets/original.d.ts +2 -0
  29. package/dist/theme/presets/sherbet.d.ts +2 -0
  30. package/dist/theme/presets/signal.d.ts +2 -0
  31. package/dist/theme/presets/sunset.d.ts +2 -0
  32. package/dist/theme/presets/swiss.d.ts +2 -0
  33. package/dist/theme/presets/terminal.d.ts +2 -0
  34. package/dist/theme/presets/thermal.d.ts +2 -0
  35. package/dist/theme/presets/tidewater.d.ts +2 -0
  36. package/dist/theme/presets/whitespace.d.ts +2 -0
  37. package/dist/theme/severity.d.ts +18 -0
  38. package/dist/theme/tokens.d.ts +11 -0
  39. package/dist/theme/types.d.ts +36 -0
  40. package/dist/types/index.d.ts +71 -0
  41. package/package.json +50 -37
  42. package/dist/lib/components/MatrixHeaders.d.ts +0 -4
  43. package/dist/lib/components/MatrixRows.d.ts +0 -4
  44. package/dist/lib/components/TableData.d.ts +0 -4
  45. package/dist/lib/helpers/getStyles.d.ts +0 -12
  46. package/dist/lib/index.d.ts +0 -4
  47. package/dist/lib/types/index.d.ts +0 -102
  48. package/dist/lib/utils/data.d.ts +0 -2
  49. package/dist/lib/utils/functions.d.ts +0 -4
  50. package/dist/manifest.json +0 -7
  51. package/dist/react-data-matrix.es.js +0 -913
  52. package/dist/react-data-matrix.umd.js +0 -28
@@ -1,913 +0,0 @@
1
- import Yr from "react";
2
- var fr = { exports: {} }, K = {};
3
- /**
4
- * @license React
5
- * react-jsx-runtime.production.min.js
6
- *
7
- * Copyright (c) Facebook, Inc. and its affiliates.
8
- *
9
- * This source code is licensed under the MIT license found in the
10
- * LICENSE file in the root directory of this source tree.
11
- */
12
- var Fr;
13
- function he() {
14
- if (Fr)
15
- return K;
16
- Fr = 1;
17
- var n = Yr, s = Symbol.for("react.element"), b = Symbol.for("react.fragment"), d = Object.prototype.hasOwnProperty, y = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, R = { key: !0, ref: !0, __self: !0, __source: !0 };
18
- function T(f, v, x) {
19
- var h, g = {}, w = null, j = null;
20
- x !== void 0 && (w = "" + x), v.key !== void 0 && (w = "" + v.key), v.ref !== void 0 && (j = v.ref);
21
- for (h in v)
22
- d.call(v, h) && !R.hasOwnProperty(h) && (g[h] = v[h]);
23
- if (f && f.defaultProps)
24
- for (h in v = f.defaultProps, v)
25
- g[h] === void 0 && (g[h] = v[h]);
26
- return { $$typeof: s, type: f, key: w, ref: j, props: g, _owner: y.current };
27
- }
28
- return K.Fragment = b, K.jsx = T, K.jsxs = T, K;
29
- }
30
- var X = {};
31
- /**
32
- * @license React
33
- * react-jsx-runtime.development.js
34
- *
35
- * Copyright (c) Facebook, Inc. and its affiliates.
36
- *
37
- * This source code is licensed under the MIT license found in the
38
- * LICENSE file in the root directory of this source tree.
39
- */
40
- var Dr;
41
- function me() {
42
- return Dr || (Dr = 1, process.env.NODE_ENV !== "production" && function() {
43
- var n = Yr, s = Symbol.for("react.element"), b = Symbol.for("react.portal"), d = Symbol.for("react.fragment"), y = Symbol.for("react.strict_mode"), R = Symbol.for("react.profiler"), T = Symbol.for("react.provider"), f = Symbol.for("react.context"), v = Symbol.for("react.forward_ref"), x = Symbol.for("react.suspense"), h = Symbol.for("react.suspense_list"), g = Symbol.for("react.memo"), w = Symbol.for("react.lazy"), j = Symbol.for("react.offscreen"), A = Symbol.iterator, O = "@@iterator";
44
- function F(r) {
45
- if (r === null || typeof r != "object")
46
- return null;
47
- var e = A && r[A] || r[O];
48
- return typeof e == "function" ? e : null;
49
- }
50
- var C = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
51
- function _(r) {
52
- {
53
- for (var e = arguments.length, t = new Array(e > 1 ? e - 1 : 0), a = 1; a < e; a++)
54
- t[a - 1] = arguments[a];
55
- D("error", r, t);
56
- }
57
- }
58
- function D(r, e, t) {
59
- {
60
- var a = C.ReactDebugCurrentFrame, l = a.getStackAddendum();
61
- l !== "" && (e += "%s", t = t.concat([l]));
62
- var u = t.map(function(o) {
63
- return String(o);
64
- });
65
- u.unshift("Warning: " + e), Function.prototype.apply.call(console[r], console, u);
66
- }
67
- }
68
- var P = !1, M = !1, L = !1, N = !1, U = !1, W;
69
- W = Symbol.for("react.module.reference");
70
- function B(r) {
71
- return !!(typeof r == "string" || typeof r == "function" || r === d || r === R || U || r === y || r === x || r === h || N || r === j || P || M || L || typeof r == "object" && r !== null && (r.$$typeof === w || r.$$typeof === g || r.$$typeof === T || r.$$typeof === f || r.$$typeof === v || // This needs to include all possible module reference object
72
- // types supported by any Flight configuration anywhere since
73
- // we don't know which Flight build this will end up being used
74
- // with.
75
- r.$$typeof === W || r.getModuleId !== void 0));
76
- }
77
- function I(r, e, t) {
78
- var a = r.displayName;
79
- if (a)
80
- return a;
81
- var l = e.displayName || e.name || "";
82
- return l !== "" ? t + "(" + l + ")" : t;
83
- }
84
- function z(r) {
85
- return r.displayName || "Context";
86
- }
87
- function S(r) {
88
- if (r == null)
89
- return null;
90
- if (typeof r.tag == "number" && _("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof r == "function")
91
- return r.displayName || r.name || null;
92
- if (typeof r == "string")
93
- return r;
94
- switch (r) {
95
- case d:
96
- return "Fragment";
97
- case b:
98
- return "Portal";
99
- case R:
100
- return "Profiler";
101
- case y:
102
- return "StrictMode";
103
- case x:
104
- return "Suspense";
105
- case h:
106
- return "SuspenseList";
107
- }
108
- if (typeof r == "object")
109
- switch (r.$$typeof) {
110
- case f:
111
- var e = r;
112
- return z(e) + ".Consumer";
113
- case T:
114
- var t = r;
115
- return z(t._context) + ".Provider";
116
- case v:
117
- return I(r, r.render, "ForwardRef");
118
- case g:
119
- var a = r.displayName || null;
120
- return a !== null ? a : S(r.type) || "Memo";
121
- case w: {
122
- var l = r, u = l._payload, o = l._init;
123
- try {
124
- return S(o(u));
125
- } catch {
126
- return null;
127
- }
128
- }
129
- }
130
- return null;
131
- }
132
- var Y = Object.assign, J = 0, dr, vr, pr, hr, mr, _r, br;
133
- function yr() {
134
- }
135
- yr.__reactDisabledLog = !0;
136
- function zr() {
137
- {
138
- if (J === 0) {
139
- dr = console.log, vr = console.info, pr = console.warn, hr = console.error, mr = console.group, _r = console.groupCollapsed, br = console.groupEnd;
140
- var r = {
141
- configurable: !0,
142
- enumerable: !0,
143
- value: yr,
144
- writable: !0
145
- };
146
- Object.defineProperties(console, {
147
- info: r,
148
- log: r,
149
- warn: r,
150
- error: r,
151
- group: r,
152
- groupCollapsed: r,
153
- groupEnd: r
154
- });
155
- }
156
- J++;
157
- }
158
- }
159
- function Vr() {
160
- {
161
- if (J--, J === 0) {
162
- var r = {
163
- configurable: !0,
164
- enumerable: !0,
165
- writable: !0
166
- };
167
- Object.defineProperties(console, {
168
- log: Y({}, r, {
169
- value: dr
170
- }),
171
- info: Y({}, r, {
172
- value: vr
173
- }),
174
- warn: Y({}, r, {
175
- value: pr
176
- }),
177
- error: Y({}, r, {
178
- value: hr
179
- }),
180
- group: Y({}, r, {
181
- value: mr
182
- }),
183
- groupCollapsed: Y({}, r, {
184
- value: _r
185
- }),
186
- groupEnd: Y({}, r, {
187
- value: br
188
- })
189
- });
190
- }
191
- J < 0 && _("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
192
- }
193
- }
194
- var nr = C.ReactCurrentDispatcher, ar;
195
- function Z(r, e, t) {
196
- {
197
- if (ar === void 0)
198
- try {
199
- throw Error();
200
- } catch (l) {
201
- var a = l.stack.trim().match(/\n( *(at )?)/);
202
- ar = a && a[1] || "";
203
- }
204
- return `
205
- ` + ar + r;
206
- }
207
- }
208
- var ir = !1, Q;
209
- {
210
- var qr = typeof WeakMap == "function" ? WeakMap : Map;
211
- Q = new qr();
212
- }
213
- function gr(r, e) {
214
- if (!r || ir)
215
- return "";
216
- {
217
- var t = Q.get(r);
218
- if (t !== void 0)
219
- return t;
220
- }
221
- var a;
222
- ir = !0;
223
- var l = Error.prepareStackTrace;
224
- Error.prepareStackTrace = void 0;
225
- var u;
226
- u = nr.current, nr.current = null, zr();
227
- try {
228
- if (e) {
229
- var o = function() {
230
- throw Error();
231
- };
232
- if (Object.defineProperty(o.prototype, "props", {
233
- set: function() {
234
- throw Error();
235
- }
236
- }), typeof Reflect == "object" && Reflect.construct) {
237
- try {
238
- Reflect.construct(o, []);
239
- } catch (k) {
240
- a = k;
241
- }
242
- Reflect.construct(r, [], o);
243
- } else {
244
- try {
245
- o.call();
246
- } catch (k) {
247
- a = k;
248
- }
249
- r.call(o.prototype);
250
- }
251
- } else {
252
- try {
253
- throw Error();
254
- } catch (k) {
255
- a = k;
256
- }
257
- r();
258
- }
259
- } catch (k) {
260
- if (k && a && typeof k.stack == "string") {
261
- for (var i = k.stack.split(`
262
- `), E = a.stack.split(`
263
- `), p = i.length - 1, m = E.length - 1; p >= 1 && m >= 0 && i[p] !== E[m]; )
264
- m--;
265
- for (; p >= 1 && m >= 0; p--, m--)
266
- if (i[p] !== E[m]) {
267
- if (p !== 1 || m !== 1)
268
- do
269
- if (p--, m--, m < 0 || i[p] !== E[m]) {
270
- var $ = `
271
- ` + i[p].replace(" at new ", " at ");
272
- return r.displayName && $.includes("<anonymous>") && ($ = $.replace("<anonymous>", r.displayName)), typeof r == "function" && Q.set(r, $), $;
273
- }
274
- while (p >= 1 && m >= 0);
275
- break;
276
- }
277
- }
278
- } finally {
279
- ir = !1, nr.current = u, Vr(), Error.prepareStackTrace = l;
280
- }
281
- var q = r ? r.displayName || r.name : "", Ar = q ? Z(q) : "";
282
- return typeof r == "function" && Q.set(r, Ar), Ar;
283
- }
284
- function Hr(r, e, t) {
285
- return gr(r, !1);
286
- }
287
- function Jr(r) {
288
- var e = r.prototype;
289
- return !!(e && e.isReactComponent);
290
- }
291
- function rr(r, e, t) {
292
- if (r == null)
293
- return "";
294
- if (typeof r == "function")
295
- return gr(r, Jr(r));
296
- if (typeof r == "string")
297
- return Z(r);
298
- switch (r) {
299
- case x:
300
- return Z("Suspense");
301
- case h:
302
- return Z("SuspenseList");
303
- }
304
- if (typeof r == "object")
305
- switch (r.$$typeof) {
306
- case v:
307
- return Hr(r.render);
308
- case g:
309
- return rr(r.type, e, t);
310
- case w: {
311
- var a = r, l = a._payload, u = a._init;
312
- try {
313
- return rr(u(l), e, t);
314
- } catch {
315
- }
316
- }
317
- }
318
- return "";
319
- }
320
- var er = Object.prototype.hasOwnProperty, Er = {}, Rr = C.ReactDebugCurrentFrame;
321
- function tr(r) {
322
- if (r) {
323
- var e = r._owner, t = rr(r.type, r._source, e ? e.type : null);
324
- Rr.setExtraStackFrame(t);
325
- } else
326
- Rr.setExtraStackFrame(null);
327
- }
328
- function Gr(r, e, t, a, l) {
329
- {
330
- var u = Function.call.bind(er);
331
- for (var o in r)
332
- if (u(r, o)) {
333
- var i = void 0;
334
- try {
335
- if (typeof r[o] != "function") {
336
- var E = Error((a || "React class") + ": " + t + " type `" + o + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof r[o] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
337
- throw E.name = "Invariant Violation", E;
338
- }
339
- i = r[o](e, o, a, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
340
- } catch (p) {
341
- i = p;
342
- }
343
- i && !(i instanceof Error) && (tr(l), _("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", a || "React class", t, o, typeof i), tr(null)), i instanceof Error && !(i.message in Er) && (Er[i.message] = !0, tr(l), _("Failed %s type: %s", t, i.message), tr(null));
344
- }
345
- }
346
- }
347
- var Kr = Array.isArray;
348
- function or(r) {
349
- return Kr(r);
350
- }
351
- function Xr(r) {
352
- {
353
- var e = typeof Symbol == "function" && Symbol.toStringTag, t = e && r[Symbol.toStringTag] || r.constructor.name || "Object";
354
- return t;
355
- }
356
- }
357
- function Zr(r) {
358
- try {
359
- return xr(r), !1;
360
- } catch {
361
- return !0;
362
- }
363
- }
364
- function xr(r) {
365
- return "" + r;
366
- }
367
- function Tr(r) {
368
- if (Zr(r))
369
- return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Xr(r)), xr(r);
370
- }
371
- var G = C.ReactCurrentOwner, Qr = {
372
- key: !0,
373
- ref: !0,
374
- __self: !0,
375
- __source: !0
376
- }, wr, $r, sr;
377
- sr = {};
378
- function re(r) {
379
- if (er.call(r, "ref")) {
380
- var e = Object.getOwnPropertyDescriptor(r, "ref").get;
381
- if (e && e.isReactWarning)
382
- return !1;
383
- }
384
- return r.ref !== void 0;
385
- }
386
- function ee(r) {
387
- if (er.call(r, "key")) {
388
- var e = Object.getOwnPropertyDescriptor(r, "key").get;
389
- if (e && e.isReactWarning)
390
- return !1;
391
- }
392
- return r.key !== void 0;
393
- }
394
- function te(r, e) {
395
- if (typeof r.ref == "string" && G.current && e && G.current.stateNode !== e) {
396
- var t = S(G.current.type);
397
- sr[t] || (_('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', S(G.current.type), r.ref), sr[t] = !0);
398
- }
399
- }
400
- function ne(r, e) {
401
- {
402
- var t = function() {
403
- wr || (wr = !0, _("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", e));
404
- };
405
- t.isReactWarning = !0, Object.defineProperty(r, "key", {
406
- get: t,
407
- configurable: !0
408
- });
409
- }
410
- }
411
- function ae(r, e) {
412
- {
413
- var t = function() {
414
- $r || ($r = !0, _("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", e));
415
- };
416
- t.isReactWarning = !0, Object.defineProperty(r, "ref", {
417
- get: t,
418
- configurable: !0
419
- });
420
- }
421
- }
422
- var ie = function(r, e, t, a, l, u, o) {
423
- var i = {
424
- // This tag allows us to uniquely identify this as a React Element
425
- $$typeof: s,
426
- // Built-in properties that belong on the element
427
- type: r,
428
- key: e,
429
- ref: t,
430
- props: o,
431
- // Record the component responsible for creating this element.
432
- _owner: u
433
- };
434
- return i._store = {}, Object.defineProperty(i._store, "validated", {
435
- configurable: !1,
436
- enumerable: !1,
437
- writable: !0,
438
- value: !1
439
- }), Object.defineProperty(i, "_self", {
440
- configurable: !1,
441
- enumerable: !1,
442
- writable: !1,
443
- value: a
444
- }), Object.defineProperty(i, "_source", {
445
- configurable: !1,
446
- enumerable: !1,
447
- writable: !1,
448
- value: l
449
- }), Object.freeze && (Object.freeze(i.props), Object.freeze(i)), i;
450
- };
451
- function oe(r, e, t, a, l) {
452
- {
453
- var u, o = {}, i = null, E = null;
454
- t !== void 0 && (Tr(t), i = "" + t), ee(e) && (Tr(e.key), i = "" + e.key), re(e) && (E = e.ref, te(e, l));
455
- for (u in e)
456
- er.call(e, u) && !Qr.hasOwnProperty(u) && (o[u] = e[u]);
457
- if (r && r.defaultProps) {
458
- var p = r.defaultProps;
459
- for (u in p)
460
- o[u] === void 0 && (o[u] = p[u]);
461
- }
462
- if (i || E) {
463
- var m = typeof r == "function" ? r.displayName || r.name || "Unknown" : r;
464
- i && ne(o, m), E && ae(o, m);
465
- }
466
- return ie(r, i, E, l, a, G.current, o);
467
- }
468
- }
469
- var lr = C.ReactCurrentOwner, jr = C.ReactDebugCurrentFrame;
470
- function V(r) {
471
- if (r) {
472
- var e = r._owner, t = rr(r.type, r._source, e ? e.type : null);
473
- jr.setExtraStackFrame(t);
474
- } else
475
- jr.setExtraStackFrame(null);
476
- }
477
- var ur;
478
- ur = !1;
479
- function cr(r) {
480
- return typeof r == "object" && r !== null && r.$$typeof === s;
481
- }
482
- function Cr() {
483
- {
484
- if (lr.current) {
485
- var r = S(lr.current.type);
486
- if (r)
487
- return `
488
-
489
- Check the render method of \`` + r + "`.";
490
- }
491
- return "";
492
- }
493
- }
494
- function se(r) {
495
- {
496
- if (r !== void 0) {
497
- var e = r.fileName.replace(/^.*[\\\/]/, ""), t = r.lineNumber;
498
- return `
499
-
500
- Check your code at ` + e + ":" + t + ".";
501
- }
502
- return "";
503
- }
504
- }
505
- var Pr = {};
506
- function le(r) {
507
- {
508
- var e = Cr();
509
- if (!e) {
510
- var t = typeof r == "string" ? r : r.displayName || r.name;
511
- t && (e = `
512
-
513
- Check the top-level render call using <` + t + ">.");
514
- }
515
- return e;
516
- }
517
- }
518
- function Or(r, e) {
519
- {
520
- if (!r._store || r._store.validated || r.key != null)
521
- return;
522
- r._store.validated = !0;
523
- var t = le(e);
524
- if (Pr[t])
525
- return;
526
- Pr[t] = !0;
527
- var a = "";
528
- r && r._owner && r._owner !== lr.current && (a = " It was passed a child from " + S(r._owner.type) + "."), V(r), _('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, a), V(null);
529
- }
530
- }
531
- function Sr(r, e) {
532
- {
533
- if (typeof r != "object")
534
- return;
535
- if (or(r))
536
- for (var t = 0; t < r.length; t++) {
537
- var a = r[t];
538
- cr(a) && Or(a, e);
539
- }
540
- else if (cr(r))
541
- r._store && (r._store.validated = !0);
542
- else if (r) {
543
- var l = F(r);
544
- if (typeof l == "function" && l !== r.entries)
545
- for (var u = l.call(r), o; !(o = u.next()).done; )
546
- cr(o.value) && Or(o.value, e);
547
- }
548
- }
549
- }
550
- function ue(r) {
551
- {
552
- var e = r.type;
553
- if (e == null || typeof e == "string")
554
- return;
555
- var t;
556
- if (typeof e == "function")
557
- t = e.propTypes;
558
- else if (typeof e == "object" && (e.$$typeof === v || // Note: Memo only checks outer props here.
559
- // Inner props are checked in the reconciler.
560
- e.$$typeof === g))
561
- t = e.propTypes;
562
- else
563
- return;
564
- if (t) {
565
- var a = S(e);
566
- Gr(t, r.props, "prop", a, r);
567
- } else if (e.PropTypes !== void 0 && !ur) {
568
- ur = !0;
569
- var l = S(e);
570
- _("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", l || "Unknown");
571
- }
572
- typeof e.getDefaultProps == "function" && !e.getDefaultProps.isReactClassApproved && _("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
573
- }
574
- }
575
- function ce(r) {
576
- {
577
- for (var e = Object.keys(r.props), t = 0; t < e.length; t++) {
578
- var a = e[t];
579
- if (a !== "children" && a !== "key") {
580
- V(r), _("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", a), V(null);
581
- break;
582
- }
583
- }
584
- r.ref !== null && (V(r), _("Invalid attribute `ref` supplied to `React.Fragment`."), V(null));
585
- }
586
- }
587
- function kr(r, e, t, a, l, u) {
588
- {
589
- var o = B(r);
590
- if (!o) {
591
- var i = "";
592
- (r === void 0 || typeof r == "object" && r !== null && Object.keys(r).length === 0) && (i += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
593
- var E = se(l);
594
- E ? i += E : i += Cr();
595
- var p;
596
- r === null ? p = "null" : or(r) ? p = "array" : r !== void 0 && r.$$typeof === s ? (p = "<" + (S(r.type) || "Unknown") + " />", i = " Did you accidentally export a JSX literal instead of a component?") : p = typeof r, _("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", p, i);
597
- }
598
- var m = oe(r, e, t, l, u);
599
- if (m == null)
600
- return m;
601
- if (o) {
602
- var $ = e.children;
603
- if ($ !== void 0)
604
- if (a)
605
- if (or($)) {
606
- for (var q = 0; q < $.length; q++)
607
- Sr($[q], r);
608
- Object.freeze && Object.freeze($);
609
- } else
610
- _("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
611
- else
612
- Sr($, r);
613
- }
614
- return r === d ? ce(m) : ue(m), m;
615
- }
616
- }
617
- function fe(r, e, t) {
618
- return kr(r, e, t, !0);
619
- }
620
- function de(r, e, t) {
621
- return kr(r, e, t, !1);
622
- }
623
- var ve = de, pe = fe;
624
- X.Fragment = d, X.jsx = ve, X.jsxs = pe;
625
- }()), X;
626
- }
627
- process.env.NODE_ENV === "production" ? fr.exports = he() : fr.exports = me();
628
- var c = fr.exports;
629
- const H = (n) => n || {}, _e = (n, s) => (
630
- // if custom styles are passed remove default styles by returning a spread empty object
631
- n ? {
632
- top: "50%",
633
- left: "50%",
634
- height: "100%",
635
- textAlign: "center",
636
- position: "absolute",
637
- transform: "translate(-50%, -50%)",
638
- ...s
639
- } : { ...H(n) }
640
- ), be = (n) => n ? { border: "1px solid black" } : {}, ye = (n, s) => n ? { width: "70rem", ...s } : { ...H(n) }, Mr = (n, s) => n ? {
641
- borderWidth: "0",
642
- padding: "1rem 0 1rem 0",
643
- ...s
644
- } : { ...H(n) }, Lr = (n, s) => n ? {
645
- borderColor: "black",
646
- borderStyle: "solid",
647
- padding: "10rem 0 0 0",
648
- borderWidth: "0 0 0 10px",
649
- ...s
650
- } : { ...H(n) }, Nr = (n, s) => n ? {
651
- padding: `0 ${0.5}rem 0 ${0.5}rem`,
652
- backgroundColor: "light-grey",
653
- border: "1px solid black",
654
- ...s
655
- } : { ...H(n) }, Ur = (n, s) => n ? { fontSize: `${0.9}em`, fontWeight: "normal", ...s } : { ...H(n) }, Wr = (n, s) => {
656
- const b = new Map(
657
- Array.from(n, (d) => [d[s], []])
658
- );
659
- return n.forEach((d) => {
660
- const y = d[s];
661
- if (y !== void 0) {
662
- const R = b.get(y);
663
- R && R.push(d);
664
- }
665
- }), Array.from(b.values());
666
- }, Br = (n) => n.toUpperCase(), ge = ({
667
- data: n,
668
- hasInlineStyles: s = !0,
669
- headerPrimaryUpper: b = !0,
670
- thRowStyles: d = {},
671
- thTitleStyles: y = {},
672
- thSubTitleStyles: R = {},
673
- thPrimaryTitleStyles: T = {},
674
- customHeaderRowIdValue: f = "",
675
- customDynamicHeaderTitleIdValue: v = "",
676
- customDynamicSubHeaderTitleIdValue: x = ""
677
- }) => {
678
- const h = Lr(s, d), g = Nr(
679
- s,
680
- y
681
- ), w = Ur(
682
- s,
683
- R
684
- ), j = Mr(
685
- s,
686
- T
687
- ), A = b ? n == null ? void 0 : n.primary_header_title : Br(n == null ? void 0 : n.primary_header_title);
688
- return /* @__PURE__ */ c.jsxs("thead", { children: [
689
- /* @__PURE__ */ c.jsxs("tr", { id: "react-matrix-blank-headers-primary-title-row", children: [
690
- /* @__PURE__ */ c.jsx("th", { headers: "blank", colSpan: 4 }),
691
- /* @__PURE__ */ c.jsx(
692
- "th",
693
- {
694
- style: j,
695
- id: "react-matrix-header-primary-title",
696
- children: A
697
- }
698
- ),
699
- /* @__PURE__ */ c.jsx("th", { headers: "blank", colSpan: 2 })
700
- ] }),
701
- /* @__PURE__ */ c.jsxs(
702
- "tr",
703
- {
704
- style: h,
705
- id: `react-matrix-dynamic-headers-row-${f}`,
706
- children: [
707
- /* @__PURE__ */ c.jsx("th", { headers: "blank", colSpan: 2 }),
708
- n.matrix_details.slice(0, n.matrix_size).map((O, F) => /* @__PURE__ */ c.jsxs(
709
- "th",
710
- {
711
- scope: "col",
712
- style: g,
713
- id: `react-matrix-dynamic-column-header-title${v ? `-${v}` : ""}`,
714
- children: [
715
- O.header_title,
716
- /* @__PURE__ */ c.jsx(
717
- "div",
718
- {
719
- style: w,
720
- id: `react-matrix-dynamic-column-header-sub-title${x ? `-${x}` : ""}`,
721
- children: O.header_sub_title
722
- }
723
- )
724
- ]
725
- },
726
- `${O.id}-${F}`
727
- ))
728
- ]
729
- }
730
- )
731
- ] });
732
- }, Ee = ({
733
- data: n,
734
- tdStyles: s = {},
735
- hasInlineStyles: b = !0,
736
- customTableDataDynamicIdValue: d = ""
737
- }) => {
738
- const y = (f) => {
739
- alert(
740
- `${f == null ? void 0 : f.description}, ${f == null ? void 0 : f.score_value}
741
- ${f == null ? void 0 : f.response}`
742
- );
743
- }, T = b ? {
744
- cursor: "pointer",
745
- textAlign: "center",
746
- borderColor: "black",
747
- borderStyle: "solid",
748
- borderWidth: "1px",
749
- backgroundColor: n == null ? void 0 : n.colour,
750
- ...s
751
- } : { ...s || {} };
752
- return /* @__PURE__ */ c.jsx(c.Fragment, { children: /* @__PURE__ */ c.jsxs(
753
- "td",
754
- {
755
- style: T,
756
- onClick: () => y(n),
757
- id: `react-matrix-dynamic-table-data${d ? `-${d}` : ""}`,
758
- children: [
759
- `${n == null ? void 0 : n.description}`,
760
- /* @__PURE__ */ c.jsx("br", {}),
761
- `(${n == null ? void 0 : n.score_value})`
762
- ]
763
- }
764
- ) });
765
- }, Ir = ({
766
- data: n,
767
- rowPrimaryUpper: s = !0,
768
- hasInlineStyles: b = !0,
769
- reverseMatrixValues: d = !0,
770
- trRowStyles: y = {},
771
- trTitleStyles: R = {},
772
- trSubTitleStyles: T = {},
773
- trPrimaryTitleStyles: f = {},
774
- tdStyles: v = {},
775
- customRowDynamicIdValue: x = "",
776
- customRowHeaderDynamicIdValue: h = "",
777
- customTableDataDynamicIdValue: g = ""
778
- }) => {
779
- const w = d ? Wr(n.matrix_values, "likelihood_descriptor").reverse().slice(0, n.matrix_size) : Wr(n.matrix_values, "likelihood_descriptor").slice(
780
- 0,
781
- n.matrix_size
782
- ), j = Lr(b, y), A = Nr(
783
- b,
784
- R
785
- ), O = Ur(
786
- b,
787
- T
788
- ), F = Mr(
789
- b,
790
- f
791
- ), C = s ? Br(n.primary_row_header_title) : n.primary_row_header_title;
792
- return /* @__PURE__ */ c.jsxs("tbody", { children: [
793
- /* @__PURE__ */ c.jsx("tr", { id: "react-matrix-row-primary-title", children: /* @__PURE__ */ c.jsx("th", { scope: "row", rowSpan: 6, style: F, children: C }) }),
794
- w.map((_, D) => {
795
- var M, L, N, U, W, B;
796
- const P = d ? n.matrix_size - (D + 1) : D;
797
- return /* @__PURE__ */ c.jsxs(
798
- "tr",
799
- {
800
- style: j,
801
- id: `react-matrix-dynamic-rows-${(M = n.matrix_details[P]) == null ? void 0 : M.row_header_title}-${(L = n.matrix_details[P]) == null ? void 0 : L.row_header_sub_title}${x ? `-${x}` : ""}`,
802
- children: [
803
- /* @__PURE__ */ c.jsxs(
804
- "th",
805
- {
806
- scope: "row",
807
- style: A,
808
- id: `react-matrix-dynamic-rows-${(N = n.matrix_details[P]) == null ? void 0 : N.row_header_title}-${(U = n.matrix_details[P]) == null ? void 0 : U.row_header_sub_title}${h ? `-${h}` : ""}`,
809
- children: [
810
- (W = n.matrix_details[P]) == null ? void 0 : W.row_header_title,
811
- /* @__PURE__ */ c.jsx("div", { style: O, children: (B = n.matrix_details[P]) == null ? void 0 : B.row_header_sub_title })
812
- ]
813
- }
814
- ),
815
- _.slice(0, n.matrix_size).map((I, z) => /* @__PURE__ */ c.jsx(
816
- Ee,
817
- {
818
- data: I,
819
- tdStyles: v,
820
- hasInlineStyles: b,
821
- customTableDataDynamicIdValue: g
822
- },
823
- `${I.id}-${z}`
824
- ))
825
- ]
826
- },
827
- `row-${D}`
828
- );
829
- })
830
- ] });
831
- };
832
- Ir.defaultProps = {};
833
- const xe = ({
834
- data: n,
835
- tableStyles: s,
836
- hasTableBorder: b,
837
- hasInlineStyles: d,
838
- hasContainerStyles: y,
839
- tableContainerStyles: R,
840
- tableStyles: T = {},
841
- hasInlineStyles: f = !0,
842
- // MatrixHeaders
843
- headerPrimaryUpper: v = !0,
844
- thRowStyles: x = {},
845
- thTitleStyles: h = {},
846
- thSubTitleStyles: g = {},
847
- thPrimaryTitleStyles: w = {},
848
- customHeaderRowIdValue: j = "",
849
- customDynamicHeaderTitleIdValue: A = "",
850
- customDynamicSubHeaderTitleIdValue: O = "",
851
- // MatrixRows
852
- rowPrimaryUpper: F = !0,
853
- reverseMatrixValues: C = !0,
854
- trRowStyles: _ = {},
855
- trTitleStyles: D = {},
856
- trSubTitleStyles: P = {},
857
- trPrimaryTitleStyles: M = {},
858
- tdStyles: L = {},
859
- customRowDynamicIdValue: N = "",
860
- customRowHeaderDynamicIdValue: U = "",
861
- customTableDataDynamicIdValue: W = ""
862
- }) => {
863
- const B = be(
864
- !!(d && b)
865
- ), I = ye(
866
- !!(d && s),
867
- T
868
- ), z = _e(
869
- !!(d && y),
870
- R ?? {}
871
- );
872
- return /* @__PURE__ */ c.jsxs("div", { style: z, children: [
873
- /* @__PURE__ */ c.jsx("h1", { children: n.matrix_name }),
874
- /* @__PURE__ */ c.jsx("h4", { children: n.matrix_description }),
875
- /* @__PURE__ */ c.jsxs("table", { id: "matrix-table", style: { ...I, ...B }, children: [
876
- /* @__PURE__ */ c.jsx(
877
- ge,
878
- {
879
- data: n,
880
- hasInlineStyles: f,
881
- headerPrimaryUpper: v,
882
- thRowStyles: x,
883
- thTitleStyles: h,
884
- thSubTitleStyles: g,
885
- thPrimaryTitleStyles: w,
886
- customHeaderRowIdValue: j,
887
- customDynamicHeaderTitleIdValue: A,
888
- customDynamicSubHeaderTitleIdValue: O
889
- }
890
- ),
891
- /* @__PURE__ */ c.jsx(
892
- Ir,
893
- {
894
- data: n,
895
- rowPrimaryUpper: F,
896
- hasInlineStyles: f,
897
- reverseMatrixValues: C,
898
- trRowStyles: _,
899
- trTitleStyles: D,
900
- trSubTitleStyles: P,
901
- trPrimaryTitleStyles: M,
902
- tdStyles: L,
903
- customRowDynamicIdValue: N,
904
- customRowHeaderDynamicIdValue: U,
905
- customTableDataDynamicIdValue: W
906
- }
907
- )
908
- ] })
909
- ] });
910
- };
911
- export {
912
- xe as default
913
- };