@redsift/dashboard 7.6.0 → 7.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +518 -32
- package/index.js.map +1 -1
- package/package.json +4 -4
package/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { useGridApiRef, gridFilteredSortedRowEntriesSelector, gridVisibleColumnD
|
|
|
7
7
|
import { DataGrid as DataGrid$1 } from '@redsift/table';
|
|
8
8
|
import { config, rowChart, redrawAll, filterAll, pieChart, barChart, filters } from 'dc';
|
|
9
9
|
import { saveAs } from 'file-saver';
|
|
10
|
-
import { Font, StyleSheet, Document, Page, View, Image, Text, pdf } from '@react-pdf/renderer';
|
|
10
|
+
import { Font, StyleSheet, Document, Page, View, Image, Text as Text$1, pdf } from '@react-pdf/renderer';
|
|
11
11
|
import domToImage from 'dom-to-image';
|
|
12
12
|
import 'd3-shape';
|
|
13
13
|
|
|
@@ -20,6 +20,15 @@ const SUM = groupReduceSum;
|
|
|
20
20
|
// Material Design Icons v7.1.96
|
|
21
21
|
var mdiRefresh = "M17.65,6.35C16.2,4.9 14.21,4 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20C15.73,20 18.84,17.45 19.73,14H17.65C16.83,16.33 14.61,18 12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6C13.66,6 15.14,6.69 16.22,7.78L13,11H20V4L17.65,6.35Z";
|
|
22
22
|
|
|
23
|
+
/**
|
|
24
|
+
* Font.
|
|
25
|
+
*/
|
|
26
|
+
const FontFamily = {
|
|
27
|
+
raleway: 'raleway',
|
|
28
|
+
'source-code-pro': 'source-code-pro',
|
|
29
|
+
electrolize: 'electrolize'
|
|
30
|
+
};
|
|
31
|
+
|
|
23
32
|
/**
|
|
24
33
|
* Color palette.
|
|
25
34
|
*/
|
|
@@ -40,6 +49,14 @@ const ProductColorPalette = {
|
|
|
40
49
|
hardenize: 'hardenize',
|
|
41
50
|
tools: 'tools'
|
|
42
51
|
};
|
|
52
|
+
const NeutralColorPalette = {
|
|
53
|
+
black: 'black',
|
|
54
|
+
darkgrey: 'darkgrey',
|
|
55
|
+
midgrey: 'midgrey',
|
|
56
|
+
lightgrey: 'lightgrey',
|
|
57
|
+
xlightgrey: 'xlightgrey',
|
|
58
|
+
white: 'white'
|
|
59
|
+
};
|
|
43
60
|
|
|
44
61
|
/**
|
|
45
62
|
* Do not edit directly
|
|
@@ -225,6 +242,168 @@ function _defineProperty$1(obj, key, value) {
|
|
|
225
242
|
return obj;
|
|
226
243
|
}
|
|
227
244
|
|
|
245
|
+
/*
|
|
246
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
247
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
248
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
249
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
250
|
+
*
|
|
251
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
252
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
253
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
254
|
+
* governing permissions and limitations under the License.
|
|
255
|
+
*/ /*
|
|
256
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
257
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
258
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
259
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
260
|
+
*
|
|
261
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
262
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
263
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
264
|
+
* governing permissions and limitations under the License.
|
|
265
|
+
*/ let $488c6ddbf4ef74c2$var$formatterCache = new Map();
|
|
266
|
+
let $488c6ddbf4ef74c2$var$supportsSignDisplay = false;
|
|
267
|
+
try {
|
|
268
|
+
// @ts-ignore
|
|
269
|
+
$488c6ddbf4ef74c2$var$supportsSignDisplay = new Intl.NumberFormat("de-DE", {
|
|
270
|
+
signDisplay: "exceptZero"
|
|
271
|
+
}).resolvedOptions().signDisplay === "exceptZero";
|
|
272
|
+
// eslint-disable-next-line no-empty
|
|
273
|
+
} catch (e) {}
|
|
274
|
+
let $488c6ddbf4ef74c2$var$supportsUnit = false;
|
|
275
|
+
try {
|
|
276
|
+
// @ts-ignore
|
|
277
|
+
$488c6ddbf4ef74c2$var$supportsUnit = new Intl.NumberFormat("de-DE", {
|
|
278
|
+
style: "unit",
|
|
279
|
+
unit: "degree"
|
|
280
|
+
}).resolvedOptions().style === "unit";
|
|
281
|
+
// eslint-disable-next-line no-empty
|
|
282
|
+
} catch (e1) {}
|
|
283
|
+
// Polyfill for units since Safari doesn't support them yet. See https://bugs.webkit.org/show_bug.cgi?id=215438.
|
|
284
|
+
// Currently only polyfilling the unit degree in narrow format for ColorSlider in our supported locales.
|
|
285
|
+
// Values were determined by switching to each locale manually in Chrome.
|
|
286
|
+
const $488c6ddbf4ef74c2$var$UNITS = {
|
|
287
|
+
degree: {
|
|
288
|
+
narrow: {
|
|
289
|
+
default: "\xb0",
|
|
290
|
+
"ja-JP": " 度",
|
|
291
|
+
"zh-TW": "度",
|
|
292
|
+
"sl-SI": " \xb0"
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
};
|
|
296
|
+
class $488c6ddbf4ef74c2$export$cc77c4ff7e8673c5 {
|
|
297
|
+
/** Formats a number value as a string, according to the locale and options provided to the constructor. */ format(value) {
|
|
298
|
+
let res = "";
|
|
299
|
+
if (!$488c6ddbf4ef74c2$var$supportsSignDisplay && this.options.signDisplay != null) res = $488c6ddbf4ef74c2$export$711b50b3c525e0f2(this.numberFormatter, this.options.signDisplay, value);
|
|
300
|
+
else res = this.numberFormatter.format(value);
|
|
301
|
+
if (this.options.style === "unit" && !$488c6ddbf4ef74c2$var$supportsUnit) {
|
|
302
|
+
var _UNITS_unit;
|
|
303
|
+
let { unit: unit , unitDisplay: unitDisplay = "short" , locale: locale } = this.resolvedOptions();
|
|
304
|
+
let values = (_UNITS_unit = $488c6ddbf4ef74c2$var$UNITS[unit]) === null || _UNITS_unit === void 0 ? void 0 : _UNITS_unit[unitDisplay];
|
|
305
|
+
res += values[locale] || values.default;
|
|
306
|
+
}
|
|
307
|
+
return res;
|
|
308
|
+
}
|
|
309
|
+
/** Formats a number to an array of parts such as separators, digits, punctuation, and more. */ formatToParts(value) {
|
|
310
|
+
// TODO: implement signDisplay for formatToParts
|
|
311
|
+
// @ts-ignore
|
|
312
|
+
return this.numberFormatter.formatToParts(value);
|
|
313
|
+
}
|
|
314
|
+
/** Formats a number range as a string. */ formatRange(start, end) {
|
|
315
|
+
// @ts-ignore
|
|
316
|
+
if (typeof this.numberFormatter.formatRange === "function") // @ts-ignore
|
|
317
|
+
return this.numberFormatter.formatRange(start, end);
|
|
318
|
+
if (end < start) throw new RangeError("End date must be >= start date");
|
|
319
|
+
// Very basic fallback for old browsers.
|
|
320
|
+
return `${this.format(start)} – ${this.format(end)}`;
|
|
321
|
+
}
|
|
322
|
+
/** Formats a number range as an array of parts. */ formatRangeToParts(start, end) {
|
|
323
|
+
// @ts-ignore
|
|
324
|
+
if (typeof this.numberFormatter.formatRangeToParts === "function") // @ts-ignore
|
|
325
|
+
return this.numberFormatter.formatRangeToParts(start, end);
|
|
326
|
+
if (end < start) throw new RangeError("End date must be >= start date");
|
|
327
|
+
let startParts = this.numberFormatter.formatToParts(start);
|
|
328
|
+
let endParts = this.numberFormatter.formatToParts(end);
|
|
329
|
+
return [
|
|
330
|
+
...startParts.map((p)=>({
|
|
331
|
+
...p,
|
|
332
|
+
source: "startRange"
|
|
333
|
+
})),
|
|
334
|
+
{
|
|
335
|
+
type: "literal",
|
|
336
|
+
value: " – ",
|
|
337
|
+
source: "shared"
|
|
338
|
+
},
|
|
339
|
+
...endParts.map((p)=>({
|
|
340
|
+
...p,
|
|
341
|
+
source: "endRange"
|
|
342
|
+
}))
|
|
343
|
+
];
|
|
344
|
+
}
|
|
345
|
+
/** Returns the resolved formatting options based on the values passed to the constructor. */ resolvedOptions() {
|
|
346
|
+
let options = this.numberFormatter.resolvedOptions();
|
|
347
|
+
if (!$488c6ddbf4ef74c2$var$supportsSignDisplay && this.options.signDisplay != null) options = {
|
|
348
|
+
...options,
|
|
349
|
+
signDisplay: this.options.signDisplay
|
|
350
|
+
};
|
|
351
|
+
if (!$488c6ddbf4ef74c2$var$supportsUnit && this.options.style === "unit") options = {
|
|
352
|
+
...options,
|
|
353
|
+
style: "unit",
|
|
354
|
+
unit: this.options.unit,
|
|
355
|
+
unitDisplay: this.options.unitDisplay
|
|
356
|
+
};
|
|
357
|
+
return options;
|
|
358
|
+
}
|
|
359
|
+
constructor(locale, options = {}){
|
|
360
|
+
this.numberFormatter = $488c6ddbf4ef74c2$var$getCachedNumberFormatter(locale, options);
|
|
361
|
+
this.options = options;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
function $488c6ddbf4ef74c2$var$getCachedNumberFormatter(locale, options = {}) {
|
|
365
|
+
let { numberingSystem: numberingSystem } = options;
|
|
366
|
+
if (numberingSystem && locale.indexOf("-u-nu-") === -1) locale = `${locale}-u-nu-${numberingSystem}`;
|
|
367
|
+
if (options.style === "unit" && !$488c6ddbf4ef74c2$var$supportsUnit) {
|
|
368
|
+
var _UNITS_unit;
|
|
369
|
+
let { unit: unit , unitDisplay: unitDisplay = "short" } = options;
|
|
370
|
+
if (!unit) throw new Error('unit option must be provided with style: "unit"');
|
|
371
|
+
if (!((_UNITS_unit = $488c6ddbf4ef74c2$var$UNITS[unit]) === null || _UNITS_unit === void 0 ? void 0 : _UNITS_unit[unitDisplay])) throw new Error(`Unsupported unit ${unit} with unitDisplay = ${unitDisplay}`);
|
|
372
|
+
options = {
|
|
373
|
+
...options,
|
|
374
|
+
style: "decimal"
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
let cacheKey = locale + (options ? Object.entries(options).sort((a, b)=>a[0] < b[0] ? -1 : 1).join() : "");
|
|
378
|
+
if ($488c6ddbf4ef74c2$var$formatterCache.has(cacheKey)) return $488c6ddbf4ef74c2$var$formatterCache.get(cacheKey);
|
|
379
|
+
let numberFormatter = new Intl.NumberFormat(locale, options);
|
|
380
|
+
$488c6ddbf4ef74c2$var$formatterCache.set(cacheKey, numberFormatter);
|
|
381
|
+
return numberFormatter;
|
|
382
|
+
}
|
|
383
|
+
function $488c6ddbf4ef74c2$export$711b50b3c525e0f2(numberFormat, signDisplay, num) {
|
|
384
|
+
if (signDisplay === "auto") return numberFormat.format(num);
|
|
385
|
+
else if (signDisplay === "never") return numberFormat.format(Math.abs(num));
|
|
386
|
+
else {
|
|
387
|
+
let needsPositiveSign = false;
|
|
388
|
+
if (signDisplay === "always") needsPositiveSign = num > 0 || Object.is(num, 0);
|
|
389
|
+
else if (signDisplay === "exceptZero") {
|
|
390
|
+
if (Object.is(num, -0) || Object.is(num, 0)) num = Math.abs(num);
|
|
391
|
+
else needsPositiveSign = num > 0;
|
|
392
|
+
}
|
|
393
|
+
if (needsPositiveSign) {
|
|
394
|
+
let negative = numberFormat.format(-num);
|
|
395
|
+
let noSign = numberFormat.format(num);
|
|
396
|
+
// ignore RTL/LTR marker character
|
|
397
|
+
let minus = negative.replace(noSign, "").replace(/\u200e|\u061C/, "");
|
|
398
|
+
if ([
|
|
399
|
+
...minus
|
|
400
|
+
].length !== 1) console.warn("@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case");
|
|
401
|
+
let positive = negative.replace(noSign, "!!!").replace(minus, "+").replace("!!!", noSign);
|
|
402
|
+
return positive;
|
|
403
|
+
} else return numberFormat.format(num);
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
|
|
228
407
|
/*
|
|
229
408
|
* Copyright 2020 Adobe. All rights reserved.
|
|
230
409
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -402,6 +581,28 @@ function $fca6afa0e843324b$export$f12b703ca79dfbb1(strings) {
|
|
|
402
581
|
]);
|
|
403
582
|
}
|
|
404
583
|
|
|
584
|
+
|
|
585
|
+
/*
|
|
586
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
587
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
588
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
589
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
590
|
+
*
|
|
591
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
592
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
593
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
594
|
+
* governing permissions and limitations under the License.
|
|
595
|
+
*/
|
|
596
|
+
|
|
597
|
+
|
|
598
|
+
function $a916eb452884faea$export$b7a616150fdb9f44(options = {}) {
|
|
599
|
+
let { locale: locale } = ($18f2051aff69b9bf$export$43bb16f9c6d9e3f7)();
|
|
600
|
+
return (useMemo)(()=>new ($488c6ddbf4ef74c2$export$cc77c4ff7e8673c5)(locale, options), [
|
|
601
|
+
locale,
|
|
602
|
+
options
|
|
603
|
+
]);
|
|
604
|
+
}
|
|
605
|
+
|
|
405
606
|
function ownKeys(object, enumerableOnly) {
|
|
406
607
|
var keys = Object.keys(object);
|
|
407
608
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -2440,10 +2641,10 @@ const StyledIcon = styled.span`
|
|
|
2440
2641
|
}}
|
|
2441
2642
|
`;
|
|
2442
2643
|
|
|
2443
|
-
const _excluded$
|
|
2444
|
-
const COMPONENT_NAME$
|
|
2445
|
-
const CLASSNAME$
|
|
2446
|
-
const DEFAULT_PROPS$
|
|
2644
|
+
const _excluded$a = ["aria-hidden", "aria-label", "badge", "className", "color", "icon", "size", "svgProps"];
|
|
2645
|
+
const COMPONENT_NAME$a = 'Icon';
|
|
2646
|
+
const CLASSNAME$a = 'redsift-icon';
|
|
2647
|
+
const DEFAULT_PROPS$9 = {
|
|
2447
2648
|
size: IconSize.medium
|
|
2448
2649
|
};
|
|
2449
2650
|
|
|
@@ -2461,7 +2662,7 @@ const Icon = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
2461
2662
|
size,
|
|
2462
2663
|
svgProps
|
|
2463
2664
|
} = props,
|
|
2464
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
2665
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$a);
|
|
2465
2666
|
return /*#__PURE__*/React.createElement(StyledIcon, _extends({}, forwardedProps, {
|
|
2466
2667
|
$color: color,
|
|
2467
2668
|
$size: size,
|
|
@@ -2483,9 +2684,9 @@ const Icon = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
2483
2684
|
fill: "currentColor"
|
|
2484
2685
|
})), badge ? badge : null);
|
|
2485
2686
|
});
|
|
2486
|
-
Icon.className = CLASSNAME$
|
|
2487
|
-
Icon.defaultProps = DEFAULT_PROPS$
|
|
2488
|
-
Icon.displayName = COMPONENT_NAME$
|
|
2687
|
+
Icon.className = CLASSNAME$a;
|
|
2688
|
+
Icon.defaultProps = DEFAULT_PROPS$9;
|
|
2689
|
+
Icon.displayName = COMPONENT_NAME$a;
|
|
2489
2690
|
|
|
2490
2691
|
/**
|
|
2491
2692
|
* Component variant.
|
|
@@ -2668,7 +2869,7 @@ var spinnerTools = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My
|
|
|
2668
2869
|
|
|
2669
2870
|
var spinnerWebsite = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSIwIDAgNDAwIDQwMCIgc2hhcGUtcmVuZGVyaW5nPSJnZW9tZXRyaWNQcmVjaXNpb24iIHRleHQtcmVuZGVyaW5nPSJnZW9tZXRyaWNQcmVjaXNpb24iPgogIDxzdHlsZT4KICAgIC5zcGlubmluZyB7CiAgICAgIGFuaW1hdGlvbjogc3Bpbm5pbmcta2V5ZnJhbWVzIDMwMDBtcyBsaW5lYXIgaW5maW5pdGUgbm9ybWFsIGZvcndhcmRzOwogICAgICB0cmFuc2Zvcm0tb3JpZ2luOiBjZW50ZXI7CiAgICAgIGFuaW1hdGlvbi10aW1pbmctZnVuY3Rpb246IGN1YmljLWJlemllcigwLjQyLCAwLCAwLjU4LCAxKTsKICAgIH0KICAgIEBrZXlmcmFtZXMgc3Bpbm5pbmcta2V5ZnJhbWVzIHsKICAgICAgMCUgewogICAgICAgIHRyYW5zZm9ybTogIHJvdGF0ZSgwZGVnKTsKICAgICAgfQoKICAgICAgMzMlIHsKICAgICAgICB0cmFuc2Zvcm06ICByb3RhdGUoMTgwZGVnKTsKICAgICAgfQoKICAgICAgNTAlIHsKICAgICAgICB0cmFuc2Zvcm06IHJvdGF0ZSgxODBkZWcpOwogICAgICB9CgogICAgICA4MyUgewogICAgICAgIHRyYW5zZm9ybTogIHJvdGF0ZSgzNjBkZWcpOwogICAgICB9CgogICAgICAxMDAlIHsKICAgICAgICB0cmFuc2Zvcm06ICByb3RhdGUoMzYwZGVnKQogICAgICB9CiAgICB9CiAgPC9zdHlsZT4KICA8cGF0aAogICAgbWFzaz0idXJsKCNzcGlubmVyLXUtbWFza3MpIgogICAgZmlsbD0iIzAwNzllMSIKICAgIGQ9Ik0zMTggMTg2LjlWMTA4LjhMMjAwIDU3IDgyIDEwOC44djc4LjFDODIgMjU5IDEzMi4zIDMyNi40IDIwMCAzNDNjNjcuNy0xNi42IDExOC04NCAxMTgtMTU2LjF6TTQwMCAyMDBjMCAxMTAuNS04OS41IDIwMC0yMDAgMjAwUzAgMzEwLjUgMCAyMDAgODkuNSAwIDIwMCAwczIwMCA4OS41IDIwMCAyMDB6IgogIC8+CiAgPG1hc2sgaWQ9InNwaW5uZXItdS1tYXNrcyI+CiAgICA8cGF0aAogICAgICBjbGFzcz0ic3Bpbm5pbmciCiAgICAgIGQ9Ik0wLDIwMEMwLDg5LjU0MzA1LDg5LjU0MzA1LDAsMjAwLDB2NDAwQzg5LjU0MzA1LDQwMCwwLDMxMC40NTY5NSwwLDIwMFoiCiAgICAgIGZpbGw9IiNmZmYiCiAgICAvPgogIDwvbWFzaz4KICA8cGF0aAogICAgbWFzaz0idXJsKCNzcGlubmVyLXUtbWFza3MyKSIKICAgIGZpbGw9IiMwMDc5ZTEiCiAgICBkPSJNODIsMTg2LjkzOXYtNzguMDg5TDIwMCw1N2wxMTgsNTEuODV2NzguMDg5QzMxOCwyNTkuMDAyLDI2Ny42ODYsMzI2LjQwMiwyMDAsMzQzQzEzMi4zMTQsMzI2LjQwMiw4MiwyNTkuMDAyLDgyLDE4Ni45MzlaIgogIC8+CiAgPG1hc2sgaWQ9InNwaW5uZXItdS1tYXNrczIiPgogICAgPHBhdGgKICAgICAgY2xhc3M9InNwaW5uaW5nIgogICAgICBkPSJNNDAwIDIwMEM0MDAgMzEwLjUgMzEwLjUgNDAwIDIwMCA0MDBWMGMxMTAuNSAwIDIwMCA4OS41IDIwMCAyMDB6IgogICAgICBmaWxsPSIjZmZmIgogICAgLz4KICA8L21hc2s+Cjwvc3ZnPg==';
|
|
2670
2871
|
|
|
2671
|
-
const _excluded$
|
|
2872
|
+
const _excluded$9 = ["aria-hidden", "aria-label", "className", "color", "size"];
|
|
2672
2873
|
const colorToFile = {
|
|
2673
2874
|
default: spinnerDefault,
|
|
2674
2875
|
hardenize: spinnerHardenize,
|
|
@@ -2680,9 +2881,9 @@ const colorToFile = {
|
|
|
2680
2881
|
tools: spinnerTools,
|
|
2681
2882
|
website: spinnerWebsite
|
|
2682
2883
|
};
|
|
2683
|
-
const COMPONENT_NAME$
|
|
2684
|
-
const CLASSNAME$
|
|
2685
|
-
const DEFAULT_PROPS$
|
|
2884
|
+
const COMPONENT_NAME$9 = 'Spinner';
|
|
2885
|
+
const CLASSNAME$9 = 'redsift-shield';
|
|
2886
|
+
const DEFAULT_PROPS$8 = {
|
|
2686
2887
|
color: ColorPalette.default,
|
|
2687
2888
|
size: SpinnerSize.medium
|
|
2688
2889
|
};
|
|
@@ -2723,7 +2924,7 @@ const Spinner = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
2723
2924
|
color: propsColor,
|
|
2724
2925
|
size
|
|
2725
2926
|
} = props,
|
|
2726
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
2927
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$9);
|
|
2727
2928
|
const {
|
|
2728
2929
|
width,
|
|
2729
2930
|
height
|
|
@@ -2745,14 +2946,14 @@ const Spinner = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
2745
2946
|
$size: size
|
|
2746
2947
|
}));
|
|
2747
2948
|
});
|
|
2748
|
-
Spinner.className = CLASSNAME$
|
|
2749
|
-
Spinner.defaultProps = DEFAULT_PROPS$
|
|
2750
|
-
Spinner.displayName = COMPONENT_NAME$
|
|
2949
|
+
Spinner.className = CLASSNAME$9;
|
|
2950
|
+
Spinner.defaultProps = DEFAULT_PROPS$8;
|
|
2951
|
+
Spinner.displayName = COMPONENT_NAME$9;
|
|
2751
2952
|
|
|
2752
|
-
const _excluded$
|
|
2753
|
-
const COMPONENT_NAME$
|
|
2754
|
-
const CLASSNAME$
|
|
2755
|
-
const DEFAULT_PROPS$
|
|
2953
|
+
const _excluded$8 = ["children", "className", "color", "disabled", "fullWidth", "isActive", "isDisabled", "isLoading", "leftIcon", "onPress", "rightIcon", "variant"];
|
|
2954
|
+
const COMPONENT_NAME$8 = 'Button';
|
|
2955
|
+
const CLASSNAME$8 = 'redsift-button';
|
|
2956
|
+
const DEFAULT_PROPS$7 = {
|
|
2756
2957
|
color: ColorPalette.default,
|
|
2757
2958
|
height: 'fit-content',
|
|
2758
2959
|
variant: ButtonVariant.primary
|
|
@@ -2789,7 +2990,7 @@ const Button = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
2789
2990
|
rightIcon,
|
|
2790
2991
|
variant
|
|
2791
2992
|
} = props,
|
|
2792
|
-
forwardedProps = _objectWithoutProperties(props, _excluded$
|
|
2993
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$8);
|
|
2793
2994
|
return /*#__PURE__*/React.createElement(StyledButton, _extends({}, forwardedProps, buttonProps, {
|
|
2794
2995
|
$color: color,
|
|
2795
2996
|
$fullWidth: fullWidth,
|
|
@@ -2813,9 +3014,277 @@ const Button = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
2813
3014
|
className: "right"
|
|
2814
3015
|
}) : null);
|
|
2815
3016
|
});
|
|
2816
|
-
Button.className = CLASSNAME$
|
|
2817
|
-
Button.defaultProps = DEFAULT_PROPS$
|
|
2818
|
-
Button.displayName = COMPONENT_NAME$
|
|
3017
|
+
Button.className = CLASSNAME$8;
|
|
3018
|
+
Button.defaultProps = DEFAULT_PROPS$7;
|
|
3019
|
+
Button.displayName = COMPONENT_NAME$8;
|
|
3020
|
+
|
|
3021
|
+
/**
|
|
3022
|
+
* Component variant.
|
|
3023
|
+
*/
|
|
3024
|
+
const TextVariant = {
|
|
3025
|
+
subtitle: 'subtitle',
|
|
3026
|
+
body: 'body',
|
|
3027
|
+
body2: 'body2',
|
|
3028
|
+
button: 'button',
|
|
3029
|
+
caption: 'caption',
|
|
3030
|
+
inherit: 'inherit'
|
|
3031
|
+
};
|
|
3032
|
+
const TextComponent = {
|
|
3033
|
+
p: 'p',
|
|
3034
|
+
b: 'b',
|
|
3035
|
+
i: 'i',
|
|
3036
|
+
u: 'u',
|
|
3037
|
+
abbr: 'abbr',
|
|
3038
|
+
cite: 'cite',
|
|
3039
|
+
del: 'del',
|
|
3040
|
+
em: 'em',
|
|
3041
|
+
ins: 'ins',
|
|
3042
|
+
kbd: 'kbd',
|
|
3043
|
+
mark: 'mark',
|
|
3044
|
+
s: 's',
|
|
3045
|
+
samp: 'samp',
|
|
3046
|
+
sub: 'sub',
|
|
3047
|
+
sup: 'sup'
|
|
3048
|
+
};
|
|
3049
|
+
|
|
3050
|
+
/**
|
|
3051
|
+
* Component style.
|
|
3052
|
+
*/
|
|
3053
|
+
const StyledText = styled.span`
|
|
3054
|
+
${baseStyling}
|
|
3055
|
+
|
|
3056
|
+
${_ref => {
|
|
3057
|
+
let {
|
|
3058
|
+
$color
|
|
3059
|
+
} = _ref;
|
|
3060
|
+
return $color && [...Object.keys(ColorPalette), ...Object.keys(ProductColorPalette)].indexOf($color) !== -1 ? css`
|
|
3061
|
+
color: var(--redsift-color-${$color}-primary);
|
|
3062
|
+
` : Object.keys(NeutralColorPalette).indexOf($color) !== -1 ? css`
|
|
3063
|
+
color: var(--redsift-color-neutral-${$color});
|
|
3064
|
+
` : css`
|
|
3065
|
+
color: ${$color || css`inherit`};
|
|
3066
|
+
`;
|
|
3067
|
+
}}
|
|
3068
|
+
|
|
3069
|
+
${_ref2 => {
|
|
3070
|
+
let {
|
|
3071
|
+
$as
|
|
3072
|
+
} = _ref2;
|
|
3073
|
+
return css`
|
|
3074
|
+
${$as === TextComponent.i || $as === TextComponent.cite || $as === TextComponent.em ? css`
|
|
3075
|
+
font-style: italic;
|
|
3076
|
+
` : $as === TextComponent.sub ? css`
|
|
3077
|
+
vertical-align: sub;
|
|
3078
|
+
` : $as === TextComponent.sup ? css`
|
|
3079
|
+
vertical-align: super;
|
|
3080
|
+
` : ''}
|
|
3081
|
+
`;
|
|
3082
|
+
}}
|
|
3083
|
+
|
|
3084
|
+
${_ref3 => {
|
|
3085
|
+
let {
|
|
3086
|
+
$as,
|
|
3087
|
+
$fontFamily,
|
|
3088
|
+
$fontSize,
|
|
3089
|
+
$lineHeight,
|
|
3090
|
+
$variant
|
|
3091
|
+
} = _ref3;
|
|
3092
|
+
return !$variant ? css`
|
|
3093
|
+
${$fontFamily ? css`
|
|
3094
|
+
font-family: var(
|
|
3095
|
+
--redsift-typography-font-family-${$fontFamily}
|
|
3096
|
+
);
|
|
3097
|
+
` : ''}
|
|
3098
|
+
${$fontSize ? css`
|
|
3099
|
+
font-size: ${$fontSize};
|
|
3100
|
+
` : ''}
|
|
3101
|
+
${$lineHeight ? css`
|
|
3102
|
+
line-height: ${$lineHeight};
|
|
3103
|
+
` : ''}
|
|
3104
|
+
${$as === TextComponent.b ? css`
|
|
3105
|
+
font-weight: var(--redsift-typography-font-weight-bold);
|
|
3106
|
+
` : $as === TextComponent.sup || $as === TextComponent.sub ? css`
|
|
3107
|
+
font-size: ${$fontSize ? $fontSize : '12px'};
|
|
3108
|
+
` : ''}
|
|
3109
|
+
` : $variant === TextVariant.inherit ? css`
|
|
3110
|
+
font-family: ${$fontFamily ? css`var(--redsift-typography-font-family-${$fontFamily})` : css`inherit`};
|
|
3111
|
+
font-size: ${$fontSize ? $fontSize : $as === TextComponent.sup || $as === TextComponent.sub ? '12px' : css`inherit`};
|
|
3112
|
+
font-weight: ${$as === TextComponent.b ? 'var(--redsift-typography-font-weight-bold)' : 'inherit'};
|
|
3113
|
+
line-height: ${$lineHeight ? $lineHeight : css`inherit`};
|
|
3114
|
+
text-transform: inherit;
|
|
3115
|
+
` : css`
|
|
3116
|
+
font-family: ${$fontFamily ? css`var(--redsift-typography-font-family-${$fontFamily})` : css`var(--redsift-typography-${$variant}-font-family)`};
|
|
3117
|
+
font-size: ${$fontSize ? $fontSize : css`var(--redsift-typography-${$variant}-font-size)`};
|
|
3118
|
+
font-weight: var(--redsift-typography-${$variant}-font-weight);
|
|
3119
|
+
line-height: ${$lineHeight ? $lineHeight : css`var(--redsift-typography-${$variant}-line-height)`};
|
|
3120
|
+
text-transform: var(--redsift-typography-${$variant}-text-transform);
|
|
3121
|
+
`;
|
|
3122
|
+
}}
|
|
3123
|
+
|
|
3124
|
+
${_ref4 => {
|
|
3125
|
+
let {
|
|
3126
|
+
$noWrap
|
|
3127
|
+
} = _ref4;
|
|
3128
|
+
return $noWrap ? css`
|
|
3129
|
+
overflow: hidden;
|
|
3130
|
+
text-overflow: ellipsis;
|
|
3131
|
+
white-space: nowrap;
|
|
3132
|
+
` : css`
|
|
3133
|
+
word-break: break-word;
|
|
3134
|
+
`;
|
|
3135
|
+
}}
|
|
3136
|
+
`;
|
|
3137
|
+
|
|
3138
|
+
const _excluded$7 = ["as", "children", "className", "color", "fontFamily", "fontSize", "lineHeight", "noWrap", "variant"];
|
|
3139
|
+
const COMPONENT_NAME$7 = 'Text';
|
|
3140
|
+
const CLASSNAME$7 = 'redsift-text';
|
|
3141
|
+
const DEFAULT_PROPS$6 = {
|
|
3142
|
+
fontFamily: FontFamily.raleway
|
|
3143
|
+
};
|
|
3144
|
+
|
|
3145
|
+
/**
|
|
3146
|
+
* The Text component.
|
|
3147
|
+
*/
|
|
3148
|
+
const Text = /*#__PURE__*/forwardRef((props, ref) => {
|
|
3149
|
+
const {
|
|
3150
|
+
as,
|
|
3151
|
+
children,
|
|
3152
|
+
className,
|
|
3153
|
+
color,
|
|
3154
|
+
fontFamily,
|
|
3155
|
+
fontSize,
|
|
3156
|
+
lineHeight,
|
|
3157
|
+
noWrap,
|
|
3158
|
+
variant
|
|
3159
|
+
} = props,
|
|
3160
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$7);
|
|
3161
|
+
return /*#__PURE__*/React.createElement(StyledText, _extends({
|
|
3162
|
+
as: as
|
|
3163
|
+
}, forwardedProps, {
|
|
3164
|
+
className: classNames(Text.className, className),
|
|
3165
|
+
ref: ref,
|
|
3166
|
+
$as: as,
|
|
3167
|
+
$color: color,
|
|
3168
|
+
$fontFamily: fontFamily,
|
|
3169
|
+
$fontSize: fontSize,
|
|
3170
|
+
$lineHeight: lineHeight,
|
|
3171
|
+
$noWrap: noWrap,
|
|
3172
|
+
$variant: variant
|
|
3173
|
+
}), children);
|
|
3174
|
+
});
|
|
3175
|
+
Text.className = CLASSNAME$7;
|
|
3176
|
+
Text.defaultProps = DEFAULT_PROPS$6;
|
|
3177
|
+
Text.displayName = COMPONENT_NAME$7;
|
|
3178
|
+
|
|
3179
|
+
/**
|
|
3180
|
+
* Component style.
|
|
3181
|
+
*/
|
|
3182
|
+
const StyledNumber = styled(StyledText)`
|
|
3183
|
+
font-family: var(--redsift-typography-font-family-source-code-pro);
|
|
3184
|
+
`;
|
|
3185
|
+
|
|
3186
|
+
const _excluded$6 = ["as", "className", "color", "compactDisplay", "currency", "currencyDisplay", "currencySign", "fontSize", "lineHeight", "localeMatcher", "maximumFractionDigits", "maximumSignificantDigits", "minimumFractionDigits", "minimumIntegerDigits", "minimumSignificantDigits", "notation", "noWrap", "numberingSystem", "roundingIncrement", "roundingMode", "roundingPriority", "signDisplay", "trailingZeroDisplay", "type", "unit", "unitDisplay", "useGrouping", "value", "variant"];
|
|
3187
|
+
const COMPONENT_NAME$6 = 'Number';
|
|
3188
|
+
const CLASSNAME$6 = 'redsift-number';
|
|
3189
|
+
const DEFAULT_PROPS$5 = {
|
|
3190
|
+
compactDisplay: 'short',
|
|
3191
|
+
currencyDisplay: 'symbol',
|
|
3192
|
+
currencySign: 'standard',
|
|
3193
|
+
localeMatcher: 'best fit',
|
|
3194
|
+
notation: 'standard',
|
|
3195
|
+
signDisplay: 'auto',
|
|
3196
|
+
type: 'decimal',
|
|
3197
|
+
unitDisplay: 'short',
|
|
3198
|
+
roundingMode: 'halfExpand',
|
|
3199
|
+
roundingPriority: 'auto',
|
|
3200
|
+
trailingZeroDisplay: 'auto'
|
|
3201
|
+
};
|
|
3202
|
+
|
|
3203
|
+
/**
|
|
3204
|
+
* The Number component.
|
|
3205
|
+
*/
|
|
3206
|
+
const Number$1 = /*#__PURE__*/forwardRef((props, ref) => {
|
|
3207
|
+
const {
|
|
3208
|
+
as,
|
|
3209
|
+
className,
|
|
3210
|
+
color,
|
|
3211
|
+
compactDisplay,
|
|
3212
|
+
currency,
|
|
3213
|
+
currencyDisplay,
|
|
3214
|
+
currencySign,
|
|
3215
|
+
fontSize,
|
|
3216
|
+
lineHeight,
|
|
3217
|
+
localeMatcher,
|
|
3218
|
+
maximumFractionDigits,
|
|
3219
|
+
maximumSignificantDigits,
|
|
3220
|
+
minimumFractionDigits,
|
|
3221
|
+
minimumIntegerDigits,
|
|
3222
|
+
minimumSignificantDigits,
|
|
3223
|
+
notation,
|
|
3224
|
+
noWrap,
|
|
3225
|
+
numberingSystem,
|
|
3226
|
+
roundingIncrement,
|
|
3227
|
+
roundingMode,
|
|
3228
|
+
roundingPriority,
|
|
3229
|
+
signDisplay,
|
|
3230
|
+
trailingZeroDisplay,
|
|
3231
|
+
type,
|
|
3232
|
+
unit,
|
|
3233
|
+
unitDisplay,
|
|
3234
|
+
useGrouping,
|
|
3235
|
+
value,
|
|
3236
|
+
variant
|
|
3237
|
+
} = props,
|
|
3238
|
+
forwardedProps = _objectWithoutProperties(props, _excluded$6);
|
|
3239
|
+
const formatter = $a916eb452884faea$export$b7a616150fdb9f44(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
|
|
3240
|
+
compactDisplay,
|
|
3241
|
+
currency,
|
|
3242
|
+
currencyDisplay,
|
|
3243
|
+
currencySign,
|
|
3244
|
+
localeMatcher
|
|
3245
|
+
}, maximumFractionDigits !== undefined && {
|
|
3246
|
+
maximumFractionDigits
|
|
3247
|
+
}), maximumSignificantDigits !== undefined && {
|
|
3248
|
+
maximumSignificantDigits
|
|
3249
|
+
}), minimumFractionDigits !== undefined && {
|
|
3250
|
+
minimumFractionDigits
|
|
3251
|
+
}), minimumIntegerDigits !== undefined && {
|
|
3252
|
+
minimumIntegerDigits
|
|
3253
|
+
}), minimumSignificantDigits !== undefined && {
|
|
3254
|
+
minimumSignificantDigits
|
|
3255
|
+
}), {}, {
|
|
3256
|
+
notation,
|
|
3257
|
+
numberingSystem,
|
|
3258
|
+
// @ts-ignore
|
|
3259
|
+
roundingIncrement,
|
|
3260
|
+
// @ts-ignore
|
|
3261
|
+
roundingMode,
|
|
3262
|
+
// @ts-ignore
|
|
3263
|
+
roundingPriority,
|
|
3264
|
+
signDisplay,
|
|
3265
|
+
style: type,
|
|
3266
|
+
// @ts-ignore
|
|
3267
|
+
trailingZeroDisplay,
|
|
3268
|
+
unit,
|
|
3269
|
+
unitDisplay,
|
|
3270
|
+
useGrouping
|
|
3271
|
+
}));
|
|
3272
|
+
return /*#__PURE__*/React.createElement(StyledNumber, _extends({
|
|
3273
|
+
as: as
|
|
3274
|
+
}, forwardedProps, {
|
|
3275
|
+
$as: as,
|
|
3276
|
+
className: classNames(Number$1.className, className),
|
|
3277
|
+
ref: ref,
|
|
3278
|
+
$color: color,
|
|
3279
|
+
$lineHeight: lineHeight,
|
|
3280
|
+
$fontSize: fontSize,
|
|
3281
|
+
$noWrap: noWrap,
|
|
3282
|
+
$variant: variant
|
|
3283
|
+
}), formatter.format(value));
|
|
3284
|
+
});
|
|
3285
|
+
Number$1.className = CLASSNAME$6;
|
|
3286
|
+
Number$1.defaultProps = DEFAULT_PROPS$5;
|
|
3287
|
+
Number$1.displayName = COMPONENT_NAME$6;
|
|
2819
3288
|
|
|
2820
3289
|
/**
|
|
2821
3290
|
* Component style.
|
|
@@ -3782,7 +4251,7 @@ const PdfTableRow = _ref => {
|
|
|
3782
4251
|
marginRight: 7
|
|
3783
4252
|
},
|
|
3784
4253
|
key: `cell-${rowIndex}-${index}`
|
|
3785
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
4254
|
+
}, /*#__PURE__*/React.createElement(Text$1, {
|
|
3786
4255
|
style: styles.tableCellText
|
|
3787
4256
|
}, '-'));
|
|
3788
4257
|
}
|
|
@@ -3793,7 +4262,7 @@ const PdfTableRow = _ref => {
|
|
|
3793
4262
|
marginRight: 7
|
|
3794
4263
|
},
|
|
3795
4264
|
key: `cell-${rowIndex}-${index}`
|
|
3796
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
4265
|
+
}, /*#__PURE__*/React.createElement(Text$1, {
|
|
3797
4266
|
style: styles.tableCellText
|
|
3798
4267
|
}, Array.isArray(rowData[field]) ? rowData[field].join(', ') : rowData[field]));
|
|
3799
4268
|
}));
|
|
@@ -3834,7 +4303,7 @@ const PdfTable = _ref2 => {
|
|
|
3834
4303
|
marginRight: 7
|
|
3835
4304
|
},
|
|
3836
4305
|
key: `heading-${field}`
|
|
3837
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
4306
|
+
}, /*#__PURE__*/React.createElement(Text$1, {
|
|
3838
4307
|
style: styles.tableCellHeaderText
|
|
3839
4308
|
}, headerName));
|
|
3840
4309
|
})), /*#__PURE__*/React.createElement(View, null, data.map((row, index) => {
|
|
@@ -3850,7 +4319,7 @@ const PdfTable = _ref2 => {
|
|
|
3850
4319
|
}
|
|
3851
4320
|
})), data.length >= 1000 ? /*#__PURE__*/React.createElement(View, {
|
|
3852
4321
|
style: styles.constraintsContainer
|
|
3853
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
4322
|
+
}, /*#__PURE__*/React.createElement(Text$1, {
|
|
3854
4323
|
style: styles.constraints
|
|
3855
4324
|
}, (localeText === null || localeText === void 0 ? void 0 : localeText.maxSizeDisclaimer) || 'Due to processing constraints this pdf is limited to the first 1000 rows of data.')) : null);
|
|
3856
4325
|
};
|
|
@@ -3858,7 +4327,7 @@ const Pagination = _ref3 => {
|
|
|
3858
4327
|
let {
|
|
3859
4328
|
styles
|
|
3860
4329
|
} = _ref3;
|
|
3861
|
-
return /*#__PURE__*/React.createElement(Text, {
|
|
4330
|
+
return /*#__PURE__*/React.createElement(Text$1, {
|
|
3862
4331
|
style: styles.pageNumber,
|
|
3863
4332
|
render: _ref4 => {
|
|
3864
4333
|
let {
|
|
@@ -3890,7 +4359,7 @@ const PdfDocument = _ref5 => {
|
|
|
3890
4359
|
style: styles.logo
|
|
3891
4360
|
})) : null, introduction ? /*#__PURE__*/React.createElement(View, {
|
|
3892
4361
|
style: styles.introductionContainer
|
|
3893
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
4362
|
+
}, /*#__PURE__*/React.createElement(Text$1, {
|
|
3894
4363
|
style: styles.introductionText
|
|
3895
4364
|
}, introduction)) : null, dashboardImage ? /*#__PURE__*/React.createElement(View, {
|
|
3896
4365
|
style: styles.dashboardImageContainer
|
|
@@ -7403,7 +7872,24 @@ const PieChart = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
7403
7872
|
return /*#__PURE__*/React.createElement(StyledPieChartLabel, {
|
|
7404
7873
|
key: `pie-external-label _${index}`,
|
|
7405
7874
|
$color: d3colors(key)
|
|
7406
|
-
}, /*#__PURE__*/React.createElement("div", null), labelVariant === PieChartLabelVariant.externalLabelValue ? /*#__PURE__*/React.createElement(
|
|
7875
|
+
}, /*#__PURE__*/React.createElement("div", null), labelVariant === PieChartLabelVariant.externalLabelValue ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Number$1, {
|
|
7876
|
+
as: "b",
|
|
7877
|
+
maximumFractionDigits: 2,
|
|
7878
|
+
value: value,
|
|
7879
|
+
variant: "inherit"
|
|
7880
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
7881
|
+
variant: "caption"
|
|
7882
|
+
}, key)) : labelVariant === PieChartLabelVariant.externalLabelPercent ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Number$1, {
|
|
7883
|
+
as: "b",
|
|
7884
|
+
maximumFractionDigits: 2,
|
|
7885
|
+
type: "percent",
|
|
7886
|
+
value: value / sum(chart.data(), d => d.value),
|
|
7887
|
+
variant: "inherit"
|
|
7888
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
7889
|
+
variant: "caption"
|
|
7890
|
+
}, key)) : /*#__PURE__*/React.createElement(Text, {
|
|
7891
|
+
variant: "caption"
|
|
7892
|
+
}, key));
|
|
7407
7893
|
})) : null)), caption ? /*#__PURE__*/React.createElement(StyledPieChartCaption, {
|
|
7408
7894
|
className: `${PieChart.className}__caption`,
|
|
7409
7895
|
id: `id${id}__caption`
|