@quillsql/react 2.10.4 → 2.10.6
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/dist/cjs/Chart.d.ts +2 -2
- package/dist/cjs/Chart.d.ts.map +1 -1
- package/dist/cjs/Chart.js +22 -30
- package/dist/cjs/ChartBuilder.d.ts.map +1 -1
- package/dist/cjs/ChartBuilder.js +18 -9
- package/dist/cjs/ChartEditor.js +1 -1
- package/dist/cjs/Context.d.ts +22 -39
- package/dist/cjs/Context.d.ts.map +1 -1
- package/dist/cjs/Context.js +11 -9
- package/dist/cjs/Dashboard.d.ts +116 -26
- package/dist/cjs/Dashboard.d.ts.map +1 -1
- package/dist/cjs/Dashboard.js +92 -402
- package/dist/cjs/DateRangePicker/dateRangePickerUtils.d.ts +18 -1
- package/dist/cjs/DateRangePicker/dateRangePickerUtils.d.ts.map +1 -1
- package/dist/cjs/DateRangePicker/dateRangePickerUtils.js +9 -9
- package/dist/cjs/SQLEditor.d.ts.map +1 -1
- package/dist/cjs/SQLEditor.js +2 -4
- package/dist/cjs/Table.d.ts.map +1 -1
- package/dist/cjs/Table.js +12 -2
- package/dist/cjs/components/Chart/BarChart.d.ts +2 -2
- package/dist/cjs/components/Chart/BarChart.js +2 -2
- package/dist/cjs/components/Chart/ChartError.d.ts +3 -0
- package/dist/cjs/components/Chart/ChartError.d.ts.map +1 -0
- package/dist/cjs/components/Chart/ChartError.js +29 -0
- package/dist/cjs/components/Chart/ChartSkeleton.d.ts +3 -0
- package/dist/cjs/components/Chart/ChartSkeleton.d.ts.map +1 -0
- package/dist/cjs/components/Chart/ChartSkeleton.js +20 -0
- package/dist/cjs/components/Chart/ChartTooltipFrame.d.ts.map +1 -1
- package/dist/cjs/components/Chart/ChartTooltipFrame.js +1 -0
- package/dist/cjs/components/Chart/LineChart.d.ts +2 -2
- package/dist/cjs/components/Chart/LineChart.js +2 -2
- package/dist/cjs/components/Dashboard/DashboardGroup.d.ts +3 -0
- package/dist/cjs/components/Dashboard/DashboardGroup.d.ts.map +1 -0
- package/dist/cjs/components/Dashboard/DashboardGroup.js +16 -0
- package/dist/cjs/components/Dashboard/DashboardItem.d.ts +3 -0
- package/dist/cjs/components/Dashboard/DashboardItem.d.ts.map +1 -0
- package/dist/cjs/components/Dashboard/DashboardItem.js +64 -0
- package/dist/cjs/components/Dashboard/DashboardSection.d.ts +3 -0
- package/dist/cjs/components/Dashboard/DashboardSection.d.ts.map +1 -0
- package/dist/cjs/components/Dashboard/DashboardSection.js +7 -0
- package/dist/cjs/hooks/useQuill.d.ts.map +1 -1
- package/dist/cjs/hooks/useQuill.js +15 -9
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/internals/ReportBuilder/PivotModal.d.ts +1 -1
- package/dist/cjs/internals/ReportBuilder/PivotModal.js +1 -1
- package/dist/cjs/utils/axisFormatter.d.ts.map +1 -1
- package/dist/cjs/utils/axisFormatter.js +7 -18
- package/dist/cjs/utils/dashboard.d.ts +12 -0
- package/dist/cjs/utils/dashboard.d.ts.map +1 -0
- package/dist/cjs/utils/dashboard.js +150 -0
- package/dist/cjs/utils/styles.d.ts +17 -0
- package/dist/cjs/utils/styles.d.ts.map +1 -0
- package/dist/cjs/utils/styles.js +20 -0
- package/dist/cjs/utils/valueFormatter.d.ts +1 -1
- package/dist/cjs/utils/valueFormatter.d.ts.map +1 -1
- package/dist/cjs/utils/valueFormatter.js +7 -18
- package/dist/cjs/utils/valueFormatterCSV.d.ts.map +1 -1
- package/dist/cjs/utils/valueFormatterCSV.js +7 -15
- package/dist/esm/Chart.d.ts +2 -2
- package/dist/esm/Chart.d.ts.map +1 -1
- package/dist/esm/Chart.js +23 -31
- package/dist/esm/ChartBuilder.d.ts.map +1 -1
- package/dist/esm/ChartBuilder.js +18 -9
- package/dist/esm/ChartEditor.js +1 -1
- package/dist/esm/Context.d.ts +22 -39
- package/dist/esm/Context.d.ts.map +1 -1
- package/dist/esm/Context.js +11 -9
- package/dist/esm/Dashboard.d.ts +116 -26
- package/dist/esm/Dashboard.d.ts.map +1 -1
- package/dist/esm/Dashboard.js +89 -376
- package/dist/esm/DateRangePicker/dateRangePickerUtils.d.ts +18 -1
- package/dist/esm/DateRangePicker/dateRangePickerUtils.d.ts.map +1 -1
- package/dist/esm/DateRangePicker/dateRangePickerUtils.js +9 -9
- package/dist/esm/SQLEditor.d.ts.map +1 -1
- package/dist/esm/SQLEditor.js +2 -4
- package/dist/esm/Table.d.ts.map +1 -1
- package/dist/esm/Table.js +12 -2
- package/dist/esm/components/Chart/BarChart.d.ts +2 -2
- package/dist/esm/components/Chart/BarChart.js +2 -2
- package/dist/esm/components/Chart/ChartError.d.ts +3 -0
- package/dist/esm/components/Chart/ChartError.d.ts.map +1 -0
- package/dist/esm/components/Chart/ChartError.js +26 -0
- package/dist/esm/components/Chart/ChartSkeleton.d.ts +3 -0
- package/dist/esm/components/Chart/ChartSkeleton.d.ts.map +1 -0
- package/dist/esm/components/Chart/ChartSkeleton.js +17 -0
- package/dist/esm/components/Chart/ChartTooltipFrame.d.ts.map +1 -1
- package/dist/esm/components/Chart/ChartTooltipFrame.js +1 -0
- package/dist/esm/components/Chart/LineChart.d.ts +2 -2
- package/dist/esm/components/Chart/LineChart.js +2 -2
- package/dist/esm/components/Dashboard/DashboardGroup.d.ts +3 -0
- package/dist/esm/components/Dashboard/DashboardGroup.d.ts.map +1 -0
- package/dist/esm/components/Dashboard/DashboardGroup.js +13 -0
- package/dist/esm/components/Dashboard/DashboardItem.d.ts +3 -0
- package/dist/esm/components/Dashboard/DashboardItem.d.ts.map +1 -0
- package/dist/esm/components/Dashboard/DashboardItem.js +61 -0
- package/dist/esm/components/Dashboard/DashboardSection.d.ts +3 -0
- package/dist/esm/components/Dashboard/DashboardSection.d.ts.map +1 -0
- package/dist/esm/components/Dashboard/DashboardSection.js +4 -0
- package/dist/esm/hooks/useQuill.d.ts.map +1 -1
- package/dist/esm/hooks/useQuill.js +16 -10
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/internals/ReportBuilder/PivotModal.d.ts +1 -1
- package/dist/esm/internals/ReportBuilder/PivotModal.js +1 -1
- package/dist/esm/utils/axisFormatter.d.ts.map +1 -1
- package/dist/esm/utils/axisFormatter.js +7 -18
- package/dist/esm/utils/dashboard.d.ts +12 -0
- package/dist/esm/utils/dashboard.d.ts.map +1 -0
- package/dist/esm/utils/dashboard.js +146 -0
- package/dist/esm/utils/styles.d.ts +17 -0
- package/dist/esm/utils/styles.d.ts.map +1 -0
- package/dist/esm/utils/styles.js +16 -0
- package/dist/esm/utils/valueFormatter.d.ts +1 -1
- package/dist/esm/utils/valueFormatter.d.ts.map +1 -1
- package/dist/esm/utils/valueFormatter.js +7 -18
- package/dist/esm/utils/valueFormatterCSV.d.ts.map +1 -1
- package/dist/esm/utils/valueFormatterCSV.js +7 -15
- package/package.json +2 -5
|
@@ -31,8 +31,25 @@ export declare const PRIMARY_CODES: {
|
|
|
31
31
|
* comparison range) and returns a QuillDateRange based on that key and date.
|
|
32
32
|
*/
|
|
33
33
|
export declare const COMPARISON_RANGE: {
|
|
34
|
-
|
|
34
|
+
readonly PREV_PERIOD: ({ start, end }: QuillDateRange) => {
|
|
35
|
+
start: Date;
|
|
36
|
+
end: Date;
|
|
37
|
+
};
|
|
38
|
+
readonly PREV_7_DAYS: ({ start }: QuillDateRange) => {
|
|
39
|
+
start: Date;
|
|
40
|
+
end: Date;
|
|
41
|
+
};
|
|
42
|
+
readonly PREV_30_DAYS: ({ start }: QuillDateRange) => {
|
|
43
|
+
start: Date;
|
|
44
|
+
end: Date;
|
|
45
|
+
};
|
|
46
|
+
readonly PREV_90_DAYS: ({ start }: QuillDateRange) => {
|
|
47
|
+
start: Date;
|
|
48
|
+
end: Date;
|
|
49
|
+
};
|
|
50
|
+
readonly NO_COMPARISON: (_: any) => null;
|
|
35
51
|
};
|
|
52
|
+
export type ComparisonRangeKey = keyof typeof COMPARISON_RANGE;
|
|
36
53
|
export declare const defaultOptions: DateRangePickerOption[];
|
|
37
54
|
export declare const reportBuilderOptions: DateRangePickerOption[];
|
|
38
55
|
export declare const getRangeFromPreset: (preset: string) => (string | Date | null)[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dateRangePickerUtils.d.ts","sourceRoot":"","sources":["../../../src/DateRangePicker/dateRangePickerUtils.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAG1D,eAAO,MAAM,WAAW,WAAY,MAAM,aAKzC,CAAC;AAEF,eAAO,MAAM,UAAU,MAAO,MAAM,UAAU,MAAM,WAEnD,CAAC;AAEF,eAAO,MAAM,2BAA2B,kBACvB,MAAM,GAAG,IAAI,GAAG,SAAS,oBACtB,qBAAqB,EAAE,gBAU1C,CAAC;AAEF,eAAO,MAAM,yBAAyB,kBACrB,MAAM,GAAG,IAAI,GAAG,SAAS,oBACtB,qBAAqB,EAAE,SAU1C,CAAC;AAEF,eAAO,MAAM,cAAc,cACd,IAAI,GAAG,IAAI,GAAG,SAAS,WACzB,IAAI,GAAG,IAAI,GAAG,SAAS,yBACT,MAAM,GAAG,IAAI,GAAG,SAAS,mBAC/B,qBAAqB,EAAE,gBAWzC,CAAC;AAEF,eAAO,MAAM,YAAY,YACd,IAAI,GAAG,IAAI,GAAG,SAAS,WACvB,IAAI,GAAG,IAAI,GAAG,SAAS,yBACT,MAAM,GAAG,IAAI,GAAG,SAAS,mBAC/B,qBAAqB,EAAE,gBASzC,CAAC;AAEF;;GAEG;AACH,KAAK,cAAc,GAAG;IACpB,KAAK,EAAE,IAAI,CAAC;IACZ,GAAG,EAAE,IAAI,CAAC;CACX,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAAA;CASjE,CAAC;AAEF;;G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AAG,EAAE,MAAM,OAAO,aAAa,GAAG,MAAM,CAAA;CAStE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB;2CACG,cAAc;;;;sCAInB,cAAc;;;;uCAIb,cAAc;;;;uCAId,cAAc;;;;gCAIrB,GAAG;CACd,CAAC;AACX,MAAM,MAAM,kBAAkB,GAAG,MAAM,OAAO,gBAAgB,CAAC;AAE/D,eAAO,MAAM,cAAc,EAAE,qBAAqB,EAyCjD,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,qBAAqB,EA+BvD,CAAC;AAEF,eAAO,MAAM,kBAAkB,WAAY,MAAM,6BAGhD,CAAC;AAEF,eAAO,MAAM,aAAa,UACjB,GAAG,QACJ,IAAI,kBACM,IAAI,GAAG,IAAI,gBACb,IAAI,GAAG,IAAI,eACZ,IAAI,GAAG,SAAS,kBACb,OAAO,QAgCxB,CAAC;AAkGF,eAAO,MAAM,eAAe,qBACR,IAAI,GAAG,IAAI,kBACb,IAAI,GAAG,IAAI,uBA0C5B,CAAC;AAyHF,eAAO,MAAM,mBAAmB,cACnB,IAAI,GAAG,IAAI,WACb,IAAI,GAAG,IAAI,WACX,MAAM,WAyChB,CAAC;;AAEF,yEAAyE"}
|
|
@@ -67,14 +67,14 @@ exports.PRIMARY_RANGE = {
|
|
|
67
67
|
* Maps between the keys of primary range and the short code.
|
|
68
68
|
*/
|
|
69
69
|
exports.PRIMARY_CODES = {
|
|
70
|
-
THIS_WEEK:
|
|
71
|
-
THIS_MONTH:
|
|
72
|
-
THIS_YEAR:
|
|
73
|
-
LAST_7_DAYS:
|
|
74
|
-
LAST_30_DAYS:
|
|
75
|
-
LAST_90_DAYS:
|
|
76
|
-
LAST_6_MONTHS:
|
|
77
|
-
ALL_TIME:
|
|
70
|
+
THIS_WEEK: 'wk',
|
|
71
|
+
THIS_MONTH: 'm',
|
|
72
|
+
THIS_YEAR: 'y',
|
|
73
|
+
LAST_7_DAYS: 'w',
|
|
74
|
+
LAST_30_DAYS: 't',
|
|
75
|
+
LAST_90_DAYS: '90d',
|
|
76
|
+
LAST_6_MONTHS: '6m',
|
|
77
|
+
ALL_TIME: 'at',
|
|
78
78
|
};
|
|
79
79
|
/**
|
|
80
80
|
* A helpful map between comparison range keys and a function that takes the
|
|
@@ -176,7 +176,7 @@ exports.reportBuilderOptions = [
|
|
|
176
176
|
];
|
|
177
177
|
const getRangeFromPreset = (preset) => {
|
|
178
178
|
const foundPreset = exports.defaultOptions.find((elem) => elem.value === preset);
|
|
179
|
-
return [foundPreset?.startDate || null,
|
|
179
|
+
return [foundPreset?.startDate || null, (0, date_fns_1.endOfToday)(), foundPreset?.value || ''];
|
|
180
180
|
};
|
|
181
181
|
exports.getRangeFromPreset = getRangeFromPreset;
|
|
182
182
|
const getDateStyles = (theme, date, finalStartDate, finalEndDate, hoveredDate, isDateDisabled) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SQLEditor.d.ts","sourceRoot":"","sources":["../../src/SQLEditor.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAUxE,wBAAgB,qBAAqB,CAAC,MAAM,KAAA;;;;;
|
|
1
|
+
{"version":3,"file":"SQLEditor.d.ts","sourceRoot":"","sources":["../../src/SQLEditor.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAUxE,wBAAgB,qBAAqB,CAAC,MAAM,KAAA;;;;;EAwE3C;AA2BD,UAAU,oBAAoB;IAC5B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,UAAU,cAAc;IACtB,cAAc,EAAE,KAAK,CAAC,aAAa,CAAC;IAEpC,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,GAAG,CAAC,OAAO,CAAC;IAC/D,wBAAwB,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,GAAG,CAAC,OAAO,CAAC;IAExE,k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EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AA+ED,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,cAAoC,EACpC,eAAe,EACf,wBAAwB,EACxB,kBAAkB,EAClB,cAAc,EACd,eAAuB,EACvB,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,eAAe,EACf,cAAc,EACd,UAAkB,EAClB,mBAA2B,EAC3B,sBAA8B,EAC9B,oBAA4B,EAC5B,wBAAgC,EAChC,oBAAoB,EACpB,iBAAiB,EACjB,uBAAuB,EACvB,wBAAwB,EACxB,yBAA8C,EAC9C,aAAyB,GAC1B,EAAE,cAAc,2CA2YhB"}
|
package/dist/cjs/SQLEditor.js
CHANGED
|
@@ -31,12 +31,10 @@ function convertPostgresColumn(column) {
|
|
|
31
31
|
case 1082: // date
|
|
32
32
|
case 1083: // time
|
|
33
33
|
case 1184: // timestamptz
|
|
34
|
-
case 1186: // interval
|
|
35
|
-
format = 'interval';
|
|
36
|
-
break;
|
|
37
34
|
case 1114: // timestamp
|
|
38
35
|
format = 'MMM_dd_yyyy';
|
|
39
36
|
break;
|
|
37
|
+
case 1186: // interval
|
|
40
38
|
case 1043: // varchar
|
|
41
39
|
default:
|
|
42
40
|
format = 'string';
|
|
@@ -476,7 +474,7 @@ function SchemaItem({ elem, theme, index }) {
|
|
|
476
474
|
paddingBottom: 12,
|
|
477
475
|
paddingLeft: 0,
|
|
478
476
|
cursor: 'pointer',
|
|
479
|
-
userSelect: 'none'
|
|
477
|
+
userSelect: 'none',
|
|
480
478
|
}, children: isOpen ? ((0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: "12", height: "12", fill: theme.secondaryTextColor, children: (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", d: "M12.53 16.28a.75.75 0 01-1.06 0l-7.5-7.5a.75.75 0 011.06-1.06L12 14.69l6.97-6.97a.75.75 0 111.06 1.06l-7.5 7.5z", clipRule: "evenodd" }) })) : ((0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: "12", height: "12", fill: theme.secondaryTextColor, children: (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", d: "M16.28 11.47a.75.75 0 010 1.06l-7.5 7.5a.75.75 0 01-1.06-1.06L14.69 12 7.72 5.03a.75.75 0 011.06-1.06l7.5 7.5z", clipRule: "evenodd" }) })) })] }), isOpen ? ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
481
479
|
paddingBottom: theme.padding,
|
|
482
480
|
display: 'flex',
|
package/dist/cjs/Table.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../src/Table.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAcxE,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,UAAU,iBAAiB;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,UAAU,cAAc;IACtB,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,gBAAgB,CAAC,EAAE,MAAM,GAAG,CAAC,OAAO,CAAC;CACtC;AAED,QAAA,MAAM,KAAK,sGAQR,iBAAiB,GAAG,cAAc,4CAqEpC,CAAC;AAEF,UAAU,yBAAyB;IACjC,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;
|
|
1
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CAAC,EAAE,OAAO,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0BAA0B,CAAC,EAAE,CAC3B,KAAK,EAAE,yBAAyB,KAC7B,GAAG,CAAC,OAAO,CAAC;IACjB,6BAA6B,CAAC,EAAE,CAC9B,KAAK,EAAE,yBAAyB,KAC7B,GAAG,CAAC,OAAO,CAAC;IACjB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,kDAomBA;AA2UD,eAAe,KAAK,CAAC"}
|
package/dist/cjs/Table.js
CHANGED
|
@@ -50,6 +50,16 @@ const Table = ({ chartId, columns, rows, containerStyle, csvFilename, showDownlo
|
|
|
50
50
|
const compareValues = (a, b, column) => {
|
|
51
51
|
const valueA = a[column];
|
|
52
52
|
const valueB = b[column];
|
|
53
|
+
// Null checks
|
|
54
|
+
if (valueA === null && valueB === null) {
|
|
55
|
+
return 0; // Both values are null, consider them equal
|
|
56
|
+
}
|
|
57
|
+
else if (valueA === null) {
|
|
58
|
+
return -1; // ValueA is null, consider it smaller
|
|
59
|
+
}
|
|
60
|
+
else if (valueB === null) {
|
|
61
|
+
return 1; // ValueB is null, consider it smaller
|
|
62
|
+
}
|
|
53
63
|
// For numbers
|
|
54
64
|
if (!isNaN(valueA) && !isNaN(valueB)) {
|
|
55
65
|
return valueA - valueB;
|
|
@@ -448,8 +458,7 @@ const ChartUpdater = ({ chartId, containerStyle, dashboard, dispatch, client, da
|
|
|
448
458
|
filters: [...Object.values(dashboardFilters)],
|
|
449
459
|
};
|
|
450
460
|
const resp = await (0, dataFetcher_1.getData)(client, 'itempost', 'omit', hostedBody, cloudBody);
|
|
451
|
-
if (resp) {
|
|
452
|
-
setLoading(false);
|
|
461
|
+
if (resp && resp.name !== 'error') {
|
|
453
462
|
if (resp.compareRows) {
|
|
454
463
|
(0, merge_1.mergeComparisonRange)(resp);
|
|
455
464
|
}
|
|
@@ -462,6 +471,7 @@ const ChartUpdater = ({ chartId, containerStyle, dashboard, dispatch, client, da
|
|
|
462
471
|
},
|
|
463
472
|
});
|
|
464
473
|
}
|
|
474
|
+
setLoading(false);
|
|
465
475
|
}
|
|
466
476
|
catch (e) {
|
|
467
477
|
console.log('Error fetching chart: ', e);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export default function BarChart({ colors, yAxisFields, data, containerStyle, xAxisField, xAxisFormat, theme, comparison, isStacked, isAnimationActive, hideXAxis, hideYAxis,
|
|
2
|
+
export default function BarChart({ colors, yAxisFields, data, containerStyle, xAxisField, xAxisFormat, theme, comparison, isStacked, isAnimationActive, hideXAxis, hideYAxis, hideCartesianGrid, }: {
|
|
3
3
|
colors: string[];
|
|
4
4
|
yAxisFields: any[];
|
|
5
5
|
data: any[];
|
|
@@ -13,6 +13,6 @@ export default function BarChart({ colors, yAxisFields, data, containerStyle, xA
|
|
|
13
13
|
isAnimationActive: boolean;
|
|
14
14
|
hideXAxis: boolean;
|
|
15
15
|
hideYAxis: boolean;
|
|
16
|
-
|
|
16
|
+
hideCartesianGrid: boolean;
|
|
17
17
|
}): import("react/jsx-runtime").JSX.Element;
|
|
18
18
|
//# sourceMappingURL=BarChart.d.ts.map
|
|
@@ -11,7 +11,7 @@ const axisFormatter_1 = require("../../utils/axisFormatter");
|
|
|
11
11
|
const color_1 = require("../../utils/color");
|
|
12
12
|
const ChartTooltip_1 = __importDefault(require("../../components/Chart/ChartTooltip"));
|
|
13
13
|
const getDomain_1 = __importDefault(require("../../utils/getDomain"));
|
|
14
|
-
function BarChart({ colors, yAxisFields, data, containerStyle, xAxisField, xAxisFormat, theme, comparison, isStacked, isAnimationActive = true, hideXAxis = false, hideYAxis = false,
|
|
14
|
+
function BarChart({ colors, yAxisFields, data, containerStyle, xAxisField, xAxisFormat, theme, comparison, isStacked, isAnimationActive = true, hideXAxis = false, hideYAxis = false, hideCartesianGrid = false, }) {
|
|
15
15
|
if (!data || data.length === 0) {
|
|
16
16
|
return ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
17
17
|
display: 'flex',
|
|
@@ -27,7 +27,7 @@ function BarChart({ colors, yAxisFields, data, containerStyle, xAxisField, xAxis
|
|
|
27
27
|
return ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
28
28
|
...containerStyle,
|
|
29
29
|
boxSizing: 'content-box',
|
|
30
|
-
}, children: (0, jsx_runtime_1.jsx)(recharts_1.ResponsiveContainer, { width: "100%", height: '100%', children: (0, jsx_runtime_1.jsxs)(recharts_1.BarChart, { data: data, layout: 'horizontal', children: [!
|
|
30
|
+
}, children: (0, jsx_runtime_1.jsx)(recharts_1.ResponsiveContainer, { width: "100%", height: '100%', children: (0, jsx_runtime_1.jsxs)(recharts_1.BarChart, { data: data, layout: 'horizontal', children: [!hideCartesianGrid && ((0, jsx_runtime_1.jsx)(recharts_1.CartesianGrid, { horizontal: true, vertical: false, stroke: "#e5e7eb" })), (0, jsx_runtime_1.jsx)(recharts_1.YAxis, { width: 44, hide: hideYAxis, axisLine: false, tickLine: false, type: "number", domain: (0, getDomain_1.default)(data, yAxisFields), tick: { transform: 'translate(-3, 0)' }, style: {
|
|
31
31
|
fontSize: '12px',
|
|
32
32
|
fontFamily: theme.chartLabelFontFamily,
|
|
33
33
|
}, tickFormatter: (tick) => (0, axisFormatter_1.axisFormatter)({
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChartError.d.ts","sourceRoot":"","sources":["../../../../src/components/Chart/ChartError.tsx"],"names":[],"mappings":";AAGA,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EAAE,cAAc,EAAE,EAAE,GAAG,GAAG,GAAG,CAAC,OAAO,CAoCvE"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const Context_1 = require("../../Context");
|
|
6
|
+
function ChartError({ containerStyle }) {
|
|
7
|
+
const [theme] = (0, react_1.useContext)(Context_1.ThemeContext);
|
|
8
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
9
|
+
...containerStyle,
|
|
10
|
+
boxSizing: 'content-box',
|
|
11
|
+
height: '100%',
|
|
12
|
+
}, children: (0, jsx_runtime_1.jsx)("div", { style: {
|
|
13
|
+
height: containerStyle?.height,
|
|
14
|
+
width: '100%',
|
|
15
|
+
boxSizing: 'content-box',
|
|
16
|
+
borderRadius: 8,
|
|
17
|
+
overflow: 'hidden',
|
|
18
|
+
}, children: (0, jsx_runtime_1.jsx)("div", { style: {
|
|
19
|
+
paddingTop: '60px',
|
|
20
|
+
display: 'flex',
|
|
21
|
+
flex: '1 0 auto',
|
|
22
|
+
margin: 'auto',
|
|
23
|
+
justifyContent: 'center',
|
|
24
|
+
alignItems: 'center',
|
|
25
|
+
fontSize: 13,
|
|
26
|
+
color: theme?.secondaryTextColor || 'rgb(55, 65, 81)',
|
|
27
|
+
}, children: "Failed to fetch data." }) }) }));
|
|
28
|
+
}
|
|
29
|
+
exports.default = ChartError;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChartSkeleton.d.ts","sourceRoot":"","sources":["../../../../src/components/Chart/ChartSkeleton.tsx"],"names":[],"mappings":";AAGA,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EAAE,cAAc,EAAE,EAAE,GAAG,GAAG,GAAG,CAAC,OAAO,CAyE1E"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const Context_1 = require("../../Context");
|
|
6
|
+
function ChartSkeleton({ containerStyle }) {
|
|
7
|
+
const [theme] = (0, react_1.useContext)(Context_1.ThemeContext);
|
|
8
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
9
|
+
...containerStyle,
|
|
10
|
+
boxSizing: 'content-box',
|
|
11
|
+
height: '100%',
|
|
12
|
+
}, children: (0, jsx_runtime_1.jsx)("div", { style: {
|
|
13
|
+
height: containerStyle?.height,
|
|
14
|
+
width: '100%',
|
|
15
|
+
boxSizing: 'content-box',
|
|
16
|
+
borderRadius: 8,
|
|
17
|
+
overflow: 'hidden',
|
|
18
|
+
}, children: (0, jsx_runtime_1.jsxs)("svg", { width: "100%", height: "100%", xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", children: [(0, jsx_runtime_1.jsx)("rect", { width: "100%", height: "100%", fill: theme?.loadingStateBackgroundColor || '#F9F9FA' }), (0, jsx_runtime_1.jsx)("defs", { fill: theme?.loadingStateBackgroundColor || '#F9F9FA', children: (0, jsx_runtime_1.jsxs)("linearGradient", { id: "skeletonGradient", x1: "0%", y1: "0%", x2: "10%", y2: "0%", gradientUnits: "userSpaceOnUse", children: [(0, jsx_runtime_1.jsx)("stop", { offset: "0%", stopColor: "rgba(255,255,255,0)" }), (0, jsx_runtime_1.jsx)("stop", { offset: "50%", stopColor: "#FEFEFE" }), (0, jsx_runtime_1.jsx)("stop", { offset: "100%", stopColor: "rgba(255,255,255,0)" }), (0, jsx_runtime_1.jsx)("animate", { attributeName: "x1", from: "-100%", to: "100%", dur: "2s", repeatCount: "indefinite" }), (0, jsx_runtime_1.jsx)("animate", { attributeName: "x2", from: "-50%", to: "150%", dur: "2s", repeatCount: "indefinite" })] }) }), (0, jsx_runtime_1.jsx)("rect", { width: "50%", height: "100%", fill: "url(#skeletonGradient)", children: (0, jsx_runtime_1.jsx)("animate", { attributeName: "x", from: "-100%", to: "100%", dur: "2s", repeatCount: "indefinite" }) })] }) }) }));
|
|
19
|
+
}
|
|
20
|
+
exports.default = ChartSkeleton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartTooltipFrame.d.ts","sourceRoot":"","sources":["../../../../src/components/Chart/ChartTooltipFrame.tsx"],"names":[],"mappings":";AAAA,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,EACxC,QAAQ,EACR,KAAK,GACN,EAAE;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,EAAE,GAAG,CAAC;CACZ,
|
|
1
|
+
{"version":3,"file":"ChartTooltipFrame.d.ts","sourceRoot":"","sources":["../../../../src/components/Chart/ChartTooltipFrame.tsx"],"names":[],"mappings":";AAAA,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,EACxC,QAAQ,EACR,KAAK,GACN,EAAE;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,EAAE,GAAG,CAAC;CACZ,2CAkBA"}
|
|
@@ -9,6 +9,7 @@ function ChartTooltipFrame({ children, theme, }) {
|
|
|
9
9
|
borderWidth: 1,
|
|
10
10
|
background: theme?.backgroundColor || '#ffffff',
|
|
11
11
|
borderRadius: '6px',
|
|
12
|
+
zIndex: 40,
|
|
12
13
|
boxShadow: '0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)',
|
|
13
14
|
}, children: children }));
|
|
14
15
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export default function LineChart({ colors, yAxisFields, data, containerStyle, xAxisField, xAxisFormat, theme, comparison, isAnimationActive, hideXAxis, hideYAxis,
|
|
2
|
+
export default function LineChart({ colors, yAxisFields, data, containerStyle, xAxisField, xAxisFormat, theme, comparison, isAnimationActive, hideXAxis, hideYAxis, hideCartesianGrid, }: {
|
|
3
3
|
colors: string[];
|
|
4
4
|
yAxisFields: any[];
|
|
5
5
|
data: any[];
|
|
@@ -11,6 +11,6 @@ export default function LineChart({ colors, yAxisFields, data, containerStyle, x
|
|
|
11
11
|
isAnimationActive: boolean;
|
|
12
12
|
hideXAxis: boolean;
|
|
13
13
|
hideYAxis: boolean;
|
|
14
|
-
|
|
14
|
+
hideCartesianGrid: boolean;
|
|
15
15
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
16
16
|
//# sourceMappingURL=LineChart.d.ts.map
|
|
@@ -11,7 +11,7 @@ const axisFormatter_1 = require("../../utils/axisFormatter");
|
|
|
11
11
|
const color_1 = require("../../utils/color");
|
|
12
12
|
const ChartTooltip_1 = __importDefault(require("../../components/Chart/ChartTooltip"));
|
|
13
13
|
const getDomain_1 = __importDefault(require("../../utils/getDomain"));
|
|
14
|
-
function LineChart({ colors, yAxisFields, data, containerStyle, xAxisField, xAxisFormat, theme, comparison, isAnimationActive = true, hideXAxis = false, hideYAxis = false,
|
|
14
|
+
function LineChart({ colors, yAxisFields, data, containerStyle, xAxisField, xAxisFormat, theme, comparison, isAnimationActive = true, hideXAxis = false, hideYAxis = false, hideCartesianGrid = false, }) {
|
|
15
15
|
if (!yAxisFields || !yAxisFields.length) {
|
|
16
16
|
return null;
|
|
17
17
|
}
|
|
@@ -27,7 +27,7 @@ function LineChart({ colors, yAxisFields, data, containerStyle, xAxisField, xAxi
|
|
|
27
27
|
color: theme.secondaryTextColor,
|
|
28
28
|
}, children: "No results found for specified time period." }));
|
|
29
29
|
}
|
|
30
|
-
return ((0, jsx_runtime_1.jsx)("div", { style: { ...containerStyle
|
|
30
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: { ...containerStyle }, children: (0, jsx_runtime_1.jsx)(recharts_1.ResponsiveContainer, { width: "100%", height: '100%', children: (0, jsx_runtime_1.jsxs)(recharts_1.ComposedChart, { data: data, children: [!hideCartesianGrid && ((0, jsx_runtime_1.jsx)(recharts_1.CartesianGrid, { horizontal: true, vertical: false, stroke: "#e5e7eb" })), (0, jsx_runtime_1.jsx)(recharts_1.XAxis, { dataKey: xAxisField, hide: hideXAxis, tick: { transform: 'translate(0, 6)' }, style: {
|
|
31
31
|
fontSize: '12px',
|
|
32
32
|
fontFamily: theme?.chartLabelFontFamily ||
|
|
33
33
|
theme?.fontFamily ||
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DashboardGroup.d.ts","sourceRoot":"","sources":["../../../../src/components/Dashboard/DashboardGroup.tsx"],"names":[],"mappings":";AAAA,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EAAE,QAAQ,EAAE,EAAE,GAAG,GAAG,GAAG,CAAC,OAAO,CAiBrE"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
function DashboardGroup({ children }) {
|
|
5
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
6
|
+
boxSizing: 'content-box',
|
|
7
|
+
width: `100%`,
|
|
8
|
+
listStyleType: 'none',
|
|
9
|
+
marginBottom: 50,
|
|
10
|
+
display: 'grid',
|
|
11
|
+
gridGap: 25,
|
|
12
|
+
gridTemplateColumns: `repeat(auto-fill,minmax(400px, 1fr))`,
|
|
13
|
+
gridTemplateRows: `repeat(${170}px)`,
|
|
14
|
+
}, children: children }));
|
|
15
|
+
}
|
|
16
|
+
exports.default = DashboardGroup;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DashboardItem.d.ts","sourceRoot":"","sources":["../../../../src/components/Dashboard/DashboardItem.tsx"],"names":[],"mappings":";AAGA,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EACpC,aAAa,EACb,oBAA+B,EAC/B,QAAQ,GACT,EAAE,GAAG,GAAG,GAAG,CAAC,OAAO,CAkGnB"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const Context_1 = require("../../Context");
|
|
6
|
+
function DashboardItem({ dashboardItem, onClickDashboardItem = () => { }, children, }) {
|
|
7
|
+
const [theme] = (0, react_1.useContext)(Context_1.ThemeContext);
|
|
8
|
+
return ((0, jsx_runtime_1.jsx)("div", { onClick: () => onClickDashboardItem(dashboardItem), style: {
|
|
9
|
+
height: '100%',
|
|
10
|
+
cursor: 'pointer',
|
|
11
|
+
boxSizing: 'content-box',
|
|
12
|
+
paddingRight: 25,
|
|
13
|
+
minHeight: 400,
|
|
14
|
+
borderRadius: 8,
|
|
15
|
+
paddingTop: 20,
|
|
16
|
+
}, children: (0, jsx_runtime_1.jsx)("div", { style: {
|
|
17
|
+
width: '100%',
|
|
18
|
+
height: '100%',
|
|
19
|
+
boxSizing: 'content-box',
|
|
20
|
+
}, children: (0, jsx_runtime_1.jsx)("div", { style: {
|
|
21
|
+
width: '100%',
|
|
22
|
+
height: '100%',
|
|
23
|
+
boxSizing: 'content-box',
|
|
24
|
+
}, children: (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
25
|
+
display: 'flex',
|
|
26
|
+
flexDirection: 'column',
|
|
27
|
+
justifyContent: 'space-between',
|
|
28
|
+
height: '100%',
|
|
29
|
+
boxSizing: 'content-box',
|
|
30
|
+
}, children: [(0, jsx_runtime_1.jsxs)("div", { style: {
|
|
31
|
+
display: 'flex',
|
|
32
|
+
flexDirection: 'row',
|
|
33
|
+
justifyContent: 'space-between',
|
|
34
|
+
boxSizing: 'content-box',
|
|
35
|
+
}, children: [(0, jsx_runtime_1.jsx)("div", { style: {
|
|
36
|
+
fontFamily: theme.fontFamily,
|
|
37
|
+
color: theme.primaryTextColor,
|
|
38
|
+
boxSizing: 'content-box',
|
|
39
|
+
fontSize: 18,
|
|
40
|
+
fontWeight: '500',
|
|
41
|
+
textOverflow: 'ellipsis',
|
|
42
|
+
// marginLeft: 25,
|
|
43
|
+
padding: 0,
|
|
44
|
+
whiteSpace: 'nowrap',
|
|
45
|
+
display: 'block',
|
|
46
|
+
maxWidth: '100%',
|
|
47
|
+
overflow: 'hidden',
|
|
48
|
+
}, children: dashboardItem?.name }), onClickDashboardItem ? ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
49
|
+
fontFamily: theme.fontFamily,
|
|
50
|
+
color: theme.primaryTextColor,
|
|
51
|
+
boxSizing: 'content-box',
|
|
52
|
+
fontWeight: '500',
|
|
53
|
+
fontSize: 14,
|
|
54
|
+
minWidth: 14 * 7,
|
|
55
|
+
display: 'flex',
|
|
56
|
+
alignItems: 'center',
|
|
57
|
+
justifyContent: 'flex-end',
|
|
58
|
+
}, children: 'view report →' })) : null] }), (0, jsx_runtime_1.jsx)("div", { style: {
|
|
59
|
+
padding: 0,
|
|
60
|
+
height: '100%',
|
|
61
|
+
boxSizing: 'content-box',
|
|
62
|
+
}, children: children })] }) }) }) }, dashboardItem?.name));
|
|
63
|
+
}
|
|
64
|
+
exports.default = DashboardItem;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DashboardSection.d.ts","sourceRoot":"","sources":["../../../../src/components/Dashboard/DashboardSection.tsx"],"names":[],"mappings":";AAAA,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EAAE,QAAQ,EAAE,EAAE,GAAG,GAAG,GAAG,CAAC,OAAO,CAMvE"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
function DashboardSection({ children }) {
|
|
5
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: { width: '100%' }, children: children }));
|
|
6
|
+
}
|
|
7
|
+
exports.default = DashboardSection;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useQuill.d.ts","sourceRoot":"","sources":["../../../src/hooks/useQuill.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useQuill.d.ts","sourceRoot":"","sources":["../../../src/hooks/useQuill.ts"],"names":[],"mappings":"AAUA,UAAU,MAAM;IACd,GAAG,EAAE,MAAM,CAAC;I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
43
43
|
const resp = await (0, dataFetcher_1.getData)(client, 'itempost', 'same-origin', hostedBody, cloudBody);
|
|
44
44
|
if (resp) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
if (resp.name === 'error') {
|
|
46
|
+
setError(JSON.stringify(resp));
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
if (resp.compareRows) {
|
|
50
|
+
(0, merge_1.mergeComparisonRange)(resp);
|
|
51
|
+
}
|
|
52
|
+
setData(resp);
|
|
53
|
+
dispatch({
|
|
54
|
+
type: 'UPDATE_DASHBOARD_ITEM',
|
|
55
|
+
id: chartId,
|
|
56
|
+
data: { ...resp, filtersApplied: dashboardFilters },
|
|
57
|
+
});
|
|
48
58
|
}
|
|
49
|
-
setData(resp);
|
|
50
|
-
dispatch({
|
|
51
|
-
type: 'UPDATE_DASHBOARD_ITEM',
|
|
52
|
-
id: chartId,
|
|
53
|
-
data: { ...resp, filtersApplied: dashboardFilters },
|
|
54
|
-
});
|
|
55
59
|
}
|
|
60
|
+
setLoading(false);
|
|
56
61
|
}
|
|
57
62
|
catch (e) {
|
|
58
63
|
if (typeof e === 'string' || (typeof e === 'object' && e !== null)) {
|
|
@@ -61,6 +66,7 @@ const useQuill = (chartId) => {
|
|
|
61
66
|
else {
|
|
62
67
|
setError('error');
|
|
63
68
|
}
|
|
69
|
+
setLoading(false);
|
|
64
70
|
}
|
|
65
71
|
}
|
|
66
72
|
}
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { default as Dashboard } from './Dashboard';
|
|
1
|
+
export { default as Dashboard, type DashboardProps, type DashboardItemProps, type DashboardItemData, type AxisFormat, } from './Dashboard';
|
|
2
2
|
export { default as QuillProvider } from './QuillProvider';
|
|
3
3
|
export { default as Chart } from './Chart';
|
|
4
4
|
export { default as Table } from './Table';
|
package/dist/cjs/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,OAAO,IAAI,SAAS,EACpB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,UAAU,GAChB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -479,7 +479,7 @@ function generatePivotTitle(pivot) {
|
|
|
479
479
|
}
|
|
480
480
|
function getDateRange(dateRange, column, data) {
|
|
481
481
|
if (!dateRange || !dateRange[0]) {
|
|
482
|
-
if (data.length == 0) {
|
|
482
|
+
if (data.length == 0 || !data[0][column]) {
|
|
483
483
|
return { start: new Date(), end: new Date() };
|
|
484
484
|
}
|
|
485
485
|
const firstDate = data[0][column] === null ? null : new Date(data[0][column]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"axisFormatter.d.ts","sourceRoot":"","sources":["../../../src/utils/axisFormatter.ts"],"names":[],"mappings":"AAGA,KAAK,KAAK,GAAG;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,SAAS,CAAC;CACnB,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,IAAI,CAAC;IACpD,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IACjC,MAAM,EAAE,KAAK,EAAE,CAAC;CACjB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,aAAa,8BAIvB,KAAK,KAAG,MAAM,GAAG,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"axisFormatter.d.ts","sourceRoot":"","sources":["../../../src/utils/axisFormatter.ts"],"names":[],"mappings":"AAGA,KAAK,KAAK,GAAG;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,SAAS,CAAC;CACnB,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,IAAI,CAAC;IACpD,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IACjC,MAAM,EAAE,KAAK,EAAE,CAAC;CACjB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,aAAa,8BAIvB,KAAK,KAAG,MAAM,GAAG,MAAM,GAAG,OA+B5B,CAAC"}
|
|
@@ -25,7 +25,6 @@ const axisFormatter = ({ value, field, fields, }) => {
|
|
|
25
25
|
one_decimal_place: formatOneDecimalPlace,
|
|
26
26
|
two_decimal_places: formatTwoDecimalPlaces,
|
|
27
27
|
string: formatString,
|
|
28
|
-
interval: formatInterval,
|
|
29
28
|
yyyy: format_YYYY,
|
|
30
29
|
MMM_yyyy: format_MMM_yyyy,
|
|
31
30
|
MMM_dd_yyyy: format_MMM_dd_yyyy,
|
|
@@ -39,7 +38,7 @@ const axisFormatter = ({ value, field, fields, }) => {
|
|
|
39
38
|
if (Object.keys(HANDLERS).includes(formatType)) {
|
|
40
39
|
return HANDLERS[formatType](value);
|
|
41
40
|
}
|
|
42
|
-
return value
|
|
41
|
+
return formatString(value); // by default make this value a string
|
|
43
42
|
};
|
|
44
43
|
exports.axisFormatter = axisFormatter;
|
|
45
44
|
/**
|
|
@@ -48,22 +47,12 @@ exports.axisFormatter = axisFormatter;
|
|
|
48
47
|
/**
|
|
49
48
|
* Formats the value as a string using the built-in converstion.
|
|
50
49
|
*/
|
|
51
|
-
const formatString = (value) =>
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
'months',
|
|
58
|
-
'days',
|
|
59
|
-
'hours',
|
|
60
|
-
'minutes',
|
|
61
|
-
'seconds',
|
|
62
|
-
];
|
|
63
|
-
const formatInterval = (interval) => INTERVALS.map((component) => interval[component])
|
|
64
|
-
.filter((value) => value !== undefined && value !== null)
|
|
65
|
-
.map((value, index) => `${value} ${INTERVALS[index]}`)
|
|
66
|
-
.join(', ');
|
|
50
|
+
const formatString = (value) => {
|
|
51
|
+
if (typeof value === 'object') {
|
|
52
|
+
return JSON.stringify(value);
|
|
53
|
+
}
|
|
54
|
+
return value.toString();
|
|
55
|
+
};
|
|
67
56
|
/**
|
|
68
57
|
* Formats the value as a (rounded) currency amount in dollars.
|
|
69
58
|
*
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DashboardItemData } from '../Dashboard';
|
|
2
|
+
/**
|
|
3
|
+
* Returns a cleaned version of the dashboard item we store in state. We clean
|
|
4
|
+
* the dashboard item so that we aren't exposing unnecessary details to the
|
|
5
|
+
* client and also so that we can give the developer using our items a stable
|
|
6
|
+
* interface to build amazing dashboards on top of.
|
|
7
|
+
* @param item
|
|
8
|
+
*/
|
|
9
|
+
export declare function cleanDashboardItem(item: {
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
} | undefined): DashboardItemData | undefined;
|
|
12
|
+
//# sourceMappingURL=dashboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../../../src/utils/dashboard.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAQjD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,GAAG,SAAS,GACvC,iBAAiB,GAAG,SAAS,CA4B/B"}
|