@dcs-tech/ui 0.9.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +488 -0
- package/README.md +43 -7
- package/THIRD_PARTY_NOTICES.md +23 -0
- package/dist/ChartImageMenu-sB2QNQzd.js +9673 -0
- package/dist/ChartView-BstZkP1g.js +1942 -0
- package/dist/{SummaryChart-CxRjK_HU.js → SummaryChart-B5ibDNOZ.js} +11 -10
- package/dist/{SummaryImage-Crf1R-3a.js → SummaryImage-CRP7X2Nl.js} +2 -2
- package/dist/SummarySeeAll-CtYRGV4G.js +101 -0
- package/dist/assets/fileTask.worker-D97s2vRV.js +1 -0
- package/dist/columnValue-BOn9NC8X.js +644 -0
- package/dist/exportContext-CMzuzRjc.js +274 -0
- package/dist/{exportEngine-BFZD6djX.js → exportEngine-CYDN8Ty-.js} +167 -137
- package/dist/file-worker.js +1 -1
- package/dist/{fileActions-CFNO14Aj.js → fileActions-DkPEWE-t.js} +1 -1
- package/dist/{geometry-yZmKN662.js → geometry-CFS5If1N.js} +848 -439
- package/dist/index.js +24208 -12603
- package/dist/{labels-CnqqTrne.js → labels-mukFhYkc.js} +126 -1
- package/dist/{runFileTask-BIZTFnZP.js → runFileTask-DI_39TjR.js} +17 -0
- package/dist/scrollArea-B52kugL1.js +291 -0
- package/dist/style.css +1 -1
- package/dist/{summaryChartData-CARqGRUl.js → summaryChartData-D15kw64n.js} +10 -3
- package/dist/types/components/Alert/Alert.d.ts +16 -0
- package/dist/types/components/Alert/index.d.ts +2 -0
- package/dist/types/components/Card/Card.d.ts +4 -3
- package/dist/types/components/Card/index.d.ts +1 -1
- package/dist/types/components/Charts/BarList.d.ts +4 -3
- package/dist/types/components/Charts/CalendarHeatmap.d.ts +4 -2
- package/dist/types/components/Charts/Chart.d.ts +3 -2
- package/dist/types/components/Charts/ChartView.d.ts +3 -2
- package/dist/types/components/Charts/ColumnChart.d.ts +4 -3
- package/dist/types/components/Charts/Donut.d.ts +3 -2
- package/dist/types/components/Charts/Funnel.d.ts +4 -2
- package/dist/types/components/Charts/Gauge.d.ts +3 -2
- package/dist/types/components/Charts/LineChart.d.ts +4 -3
- package/dist/types/components/Charts/NumberTrend.d.ts +4 -3
- package/dist/types/components/Charts/Progress.d.ts +3 -2
- package/dist/types/components/Charts/StackedBar.d.ts +3 -2
- package/dist/types/components/Charts/Treemap.d.ts +3 -2
- package/dist/types/components/Charts/chartData.d.ts +6 -0
- package/dist/types/components/Charts/chartImage.d.ts +3 -0
- package/dist/types/components/Charts/geometry.d.ts +3 -0
- package/dist/types/components/Charts/index.d.ts +2 -0
- package/dist/types/components/Charts/palette.d.ts +1 -0
- package/dist/types/components/Charts/parts.d.ts +14 -0
- package/dist/types/components/Charts/useChartMotion.d.ts +8 -0
- package/dist/types/components/ChipInput/ChipTags.d.ts +3 -0
- package/dist/types/components/CommandPalette/CommandPaletteTrigger.d.ts +9 -0
- package/dist/types/components/CommandPalette/index.d.ts +2 -0
- package/dist/types/components/DataTable/DataTable.d.ts +3 -1
- package/dist/types/components/DataTable/DisplayPopover.d.ts +1 -0
- package/dist/types/components/DataTable/HeaderMenu.d.ts +1 -0
- package/dist/types/components/DataTable/TableColumnModal.d.ts +4 -1
- package/dist/types/components/DataTable/TablePagination.d.ts +1 -1
- package/dist/types/components/DataTable/TableToolbar.d.ts +21 -1
- package/dist/types/components/DataTable/TableView.d.ts +19 -2
- package/dist/types/components/DataTable/cards/CardView.d.ts +25 -5
- package/dist/types/components/DataTable/cards/cardFields.d.ts +1 -0
- package/dist/types/components/DataTable/cards/rowParts.d.ts +1 -0
- package/dist/types/components/DataTable/cellSelection/CellRangeBar.d.ts +16 -0
- package/dist/types/components/DataTable/cellSelection/cellRangeStore.d.ts +18 -0
- package/dist/types/components/DataTable/cellSelection/paintRanges.d.ts +2 -0
- package/dist/types/components/DataTable/cellSelection/useCellSelection.d.ts +63 -0
- package/dist/types/components/DataTable/data/listDelta.d.ts +27 -0
- package/dist/types/components/DataTable/data/rowLineage.d.ts +3 -0
- package/dist/types/components/DataTable/data/rowModels.d.ts +9 -0
- package/dist/types/components/DataTable/data/rowTransaction.d.ts +9 -0
- package/dist/types/components/DataTable/data/useServerData.d.ts +3 -1
- package/dist/types/components/DataTable/defaults.d.ts +4 -0
- package/dist/types/components/DataTable/export/exportCells.d.ts +5 -2
- package/dist/types/components/DataTable/export/exportEngine.d.ts +7 -2
- package/dist/types/components/DataTable/export/useTableExport.d.ts +17 -1
- package/dist/types/components/DataTable/filters/filterRowModel.d.ts +1 -0
- package/dist/types/components/DataTable/grouping/groupModel.d.ts +11 -0
- package/dist/types/components/DataTable/index.d.ts +1 -1
- package/dist/types/components/DataTable/keyboard/ShortcutsDialog.d.ts +4 -1
- package/dist/types/components/DataTable/keyboard/useGridKeyboard.d.ts +8 -0
- package/dist/types/components/DataTable/labels.d.ts +130 -0
- package/dist/types/components/DataTable/layout/LayoutSwitcher.d.ts +10 -2
- package/dist/types/components/DataTable/layout/useFitWidths.d.ts +7 -0
- package/dist/types/components/DataTable/menu/RowMenu.d.ts +1 -0
- package/dist/types/components/DataTable/menu/buildRowMenu.d.ts +6 -3
- package/dist/types/components/DataTable/motion/RowChangeNotice.d.ts +19 -0
- package/dist/types/components/DataTable/motion/rowChanges.d.ts +25 -0
- package/dist/types/components/DataTable/motion/useNoticeInsets.d.ts +2 -0
- package/dist/types/components/DataTable/motion/useRowChangeNotices.d.ts +35 -0
- package/dist/types/components/DataTable/motion/useRowMotion.d.ts +29 -3
- package/dist/types/components/DataTable/persistence/reconcile.d.ts +4 -0
- package/dist/types/components/DataTable/persistence/useColumnPersistence.d.ts +5 -1
- package/dist/types/components/DataTable/pivot/PivotPanel.d.ts +11 -0
- package/dist/types/components/DataTable/pivot/PivotView.d.ts +22 -0
- package/dist/types/components/DataTable/pivot/pivotModel.d.ts +54 -0
- package/dist/types/components/DataTable/pivot/usePivot.d.ts +44 -0
- package/dist/types/components/DataTable/rows/PressRow.d.ts +1 -0
- package/dist/types/components/DataTable/rows/RowLead.d.ts +23 -0
- package/dist/types/components/DataTable/rows/rowPress.d.ts +2 -0
- package/dist/types/components/DataTable/rows/usePinnedRows.d.ts +34 -0
- package/dist/types/components/DataTable/rows/useRowDrag.d.ts +44 -0
- package/dist/types/components/DataTable/split/SplitView.d.ts +4 -2
- package/dist/types/components/DataTable/summary/SummaryChart.d.ts +2 -1
- package/dist/types/components/DataTable/summary/TableSummary.d.ts +2 -1
- package/dist/types/components/DataTable/summary/summaryModel.d.ts +28 -6
- package/dist/types/components/DataTable/summary/useTableSummary.d.ts +3 -0
- package/dist/types/components/DataTable/toolbar/ToolbarMore.d.ts +14 -0
- package/dist/types/components/DataTable/toolbar/useToolbarFit.d.ts +10 -0
- package/dist/types/components/DataTable/tree/TreeChips.d.ts +5 -0
- package/dist/types/components/DataTable/tree/treeExport.d.ts +54 -0
- package/dist/types/components/DataTable/tree/treeMove.d.ts +1 -0
- package/dist/types/components/DataTable/tree/useTreeChildren.d.ts +15 -0
- package/dist/types/components/DataTable/tree/useTreeData.d.ts +60 -0
- package/dist/types/components/DataTable/types.d.ts +290 -6
- package/dist/types/components/DataTable/ui-local/TableReorderList.d.ts +13 -0
- package/dist/types/components/DataTable/ui.d.ts +2 -1
- package/dist/types/components/DataTable/useDataChangeTracker.d.ts +11 -4
- package/dist/types/components/DataTable/useTable.d.ts +14 -1
- package/dist/types/components/DataTable/virtual/useVirtualLines.d.ts +1 -0
- package/dist/types/components/DatePicker/PeriodGrid.d.ts +13 -0
- package/dist/types/components/DatePicker/PeriodPicker.d.ts +19 -0
- package/dist/types/components/DatePicker/index.d.ts +1 -1
- package/dist/types/components/Dialog/dialogSlots.d.ts +9 -0
- package/dist/types/components/DropdownMenu/DropdownMenu.d.ts +8 -0
- package/dist/types/components/EventCalendar/EventCalendar.d.ts +46 -0
- package/dist/types/components/EventCalendar/eventParts.d.ts +10 -0
- package/dist/types/components/EventCalendar/index.d.ts +3 -0
- package/dist/types/components/EventCalendar/useCalendarEdit.d.ts +40 -0
- package/dist/types/components/FieldWrapper/index.d.ts +1 -1
- package/dist/types/components/Fields/index.d.ts +1 -1
- package/dist/types/components/Icon/Icon.d.ts +36 -0
- package/dist/types/components/Icon/Icon.storyData.d.ts +6 -0
- package/dist/types/components/Icon/IconContext.d.ts +7 -0
- package/dist/types/components/Icon/icons.d.ts +223 -0
- package/dist/types/components/Icon/index.d.ts +7 -0
- package/dist/types/components/Icon/useIconDone.d.ts +5 -0
- package/dist/types/components/Image/ImageEditor.d.ts +21 -0
- package/dist/types/components/Image/ImagePicker.d.ts +10 -1
- package/dist/types/components/Image/imageRender.d.ts +33 -0
- package/dist/types/components/Image/index.d.ts +3 -1
- package/dist/types/components/Image/prepareImage.d.ts +4 -3
- package/dist/types/components/Link/Link.d.ts +22 -0
- package/dist/types/components/Link/index.d.ts +2 -0
- package/dist/types/components/NavList/NavList.d.ts +13 -0
- package/dist/types/components/NavList/index.d.ts +2 -0
- package/dist/types/components/PageProgress/PageProgress.d.ts +10 -0
- package/dist/types/components/PageProgress/index.d.ts +2 -0
- package/dist/types/components/Pagination/Pagination.d.ts +19 -0
- package/dist/types/components/Pagination/index.d.ts +2 -0
- package/dist/types/components/Popover/Popover.d.ts +2 -1
- package/dist/types/components/Popover/floatingPosition.d.ts +26 -2
- package/dist/types/components/ReorderList/ReorderGroup.d.ts +16 -0
- package/dist/types/components/ReorderList/ReorderList.d.ts +56 -0
- package/dist/types/components/ReorderList/crossListDrag.d.ts +61 -0
- package/dist/types/components/ReorderList/index.d.ts +5 -0
- package/dist/types/components/ReorderList/useReorderDrag.d.ts +28 -0
- package/dist/types/components/Scroll/ui.d.ts +1 -0
- package/dist/types/components/SlidingHighlight/index.d.ts +2 -0
- package/dist/types/components/SlidingHighlight/useSlidingHighlight.d.ts +20 -0
- package/dist/types/components/Suggest/SuggestionList.d.ts +1 -0
- package/dist/types/components/Tooltip/useTooltip.d.ts +4 -0
- package/dist/types/components/UIProvider/UILabelsContext.d.ts +120 -0
- package/dist/types/components/UIProvider/UIProvider.d.ts +2 -0
- package/dist/types/core/hooks/index.d.ts +2 -1
- package/dist/types/core/hooks/useMeasuredState.d.ts +1 -0
- package/dist/types/core/hooks/usePresence.d.ts +1 -0
- package/dist/types/core/icons/actions.icons.d.ts +37 -0
- package/dist/types/core/icons/commerce.icons.d.ts +16 -0
- package/dist/types/core/icons/communication.icons.d.ts +10 -0
- package/dist/types/core/icons/delivery.icons.d.ts +13 -0
- package/dist/types/core/icons/devices.icons.d.ts +16 -0
- package/dist/types/core/icons/files.icons.d.ts +13 -0
- package/dist/types/core/icons/general.icons.d.ts +24 -0
- package/dist/types/core/icons/index.d.ts +14 -0
- package/dist/types/core/icons/media.icons.d.ts +11 -0
- package/dist/types/core/icons/navigation.icons.d.ts +25 -0
- package/dist/types/core/icons/people.icons.d.ts +13 -0
- package/dist/types/core/icons/registry.d.ts +2 -0
- package/dist/types/core/icons/state.icons.d.ts +14 -0
- package/dist/types/core/icons/status.icons.d.ts +10 -0
- package/dist/types/core/icons/table.icons.d.ts +22 -0
- package/dist/types/core/icons/text.icons.d.ts +13 -0
- package/dist/types/core/logic/alert.logic.d.ts +3 -0
- package/dist/types/core/logic/cellRange.logic.d.ts +66 -0
- package/dist/types/core/logic/cellTouch.logic.d.ts +16 -0
- package/dist/types/core/logic/columnGroups.logic.d.ts +31 -0
- package/dist/types/core/logic/commandPalette.logic.d.ts +2 -0
- package/dist/types/core/logic/datePicker.logic.d.ts +12 -0
- package/dist/types/core/logic/dropdownSide.logic.d.ts +19 -0
- package/dist/types/core/logic/eventCalendar.logic.d.ts +225 -0
- package/dist/types/core/logic/fieldWrapper.logic.d.ts +6 -1
- package/dist/types/core/logic/fitColumns.logic.d.ts +7 -0
- package/dist/types/core/logic/icon.logic.d.ts +24 -0
- package/dist/types/core/logic/imageEditor.logic.d.ts +132 -0
- package/dist/types/core/logic/imageTransform.logic.d.ts +57 -0
- package/dist/types/core/logic/index.d.ts +25 -0
- package/dist/types/core/logic/inertProps.d.ts +3 -0
- package/dist/types/core/logic/pageProgress.logic.d.ts +3 -0
- package/dist/types/core/logic/pagination.logic.d.ts +7 -0
- package/dist/types/core/logic/periodPicker.logic.d.ts +86 -0
- package/dist/types/core/logic/pivot.logic.d.ts +100 -0
- package/dist/types/core/logic/reorder.logic.d.ts +49 -0
- package/dist/types/core/logic/rowActions.logic.d.ts +7 -0
- package/dist/types/core/logic/rowDrag.logic.d.ts +36 -0
- package/dist/types/core/logic/rowPinning.logic.d.ts +12 -0
- package/dist/types/core/logic/slidingHighlight.logic.d.ts +20 -0
- package/dist/types/core/logic/toolbarOverflow.logic.d.ts +21 -0
- package/dist/types/core/logic/treeData.logic.d.ts +44 -0
- package/dist/types/core/logic/treeDrag.logic.d.ts +63 -0
- package/dist/types/core/logic/tween.logic.d.ts +33 -0
- package/dist/types/core/logic/visualViewport.logic.d.ts +13 -0
- package/dist/types/core/types/chipinput.types.d.ts +3 -1
- package/dist/types/core/types/collapsible.types.d.ts +3 -0
- package/dist/types/core/types/datePicker.types.d.ts +7 -0
- package/dist/types/core/types/eventCalendar.types.d.ts +18 -0
- package/dist/types/core/types/field.types.d.ts +6 -3
- package/dist/types/core/types/fieldWrapper.types.d.ts +2 -0
- package/dist/types/core/types/fields.types.d.ts +6 -1
- package/dist/types/core/types/fileEngine.types.d.ts +6 -0
- package/dist/types/core/types/form.types.d.ts +1 -0
- package/dist/types/core/types/format.types.d.ts +2 -0
- package/dist/types/core/types/icon.types.d.ts +109 -0
- package/dist/types/core/types/index.d.ts +2 -0
- package/dist/types/core/types/input.types.d.ts +2 -0
- package/dist/types/core/types/navigation.types.d.ts +1 -0
- package/dist/types/core/types/select.types.d.ts +2 -6
- package/dist/types/core/types/suggest.types.d.ts +2 -0
- package/dist/types/index.d.ts +31 -6
- package/package.json +4 -4
- package/dist/ChartImageMenu-DDVNJNc6.js +0 -1499
- package/dist/ChartView-CW3m4Z_1.js +0 -1703
- package/dist/SummarySeeAll-BRHOMQRA.js +0 -101
- package/dist/assets/fileTask.worker--Q3rI3Bn.js +0 -1
- package/dist/columnValue-DwUqueZ6.js +0 -610
- package/dist/exportContext-BKFnNQ0q.js +0 -166
- package/dist/scrollArea-DbYFqbIH.js +0 -269
- package/dist/types/components/DataTable/ui-local/DragAndDropList/DragAndDropList.d.ts +0 -4
- package/dist/types/components/DataTable/ui-local/DragAndDropList/index.d.ts +0 -3
- package/dist/types/components/DataTable/ui-local/DragAndDropList/types.d.ts +0 -70
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as e } from "./runFileTask-
|
|
3
|
-
import { a as t, c as n, f as r, i, l as a, n as o, o as s, s as c } from "./fileActions-
|
|
4
|
-
import { a as l, c as u, i as d, n as f, o as p, r as m, s as h } from "./exportContext-
|
|
2
|
+
import { t as e } from "./runFileTask-DI_39TjR.js";
|
|
3
|
+
import { a as t, c as n, f as r, i, l as a, n as o, o as s, s as c } from "./fileActions-DkPEWE-t.js";
|
|
4
|
+
import { a as l, c as u, i as d, n as f, o as p, r as m, s as h } from "./exportContext-CMzuzRjc.js";
|
|
5
5
|
// src/components/DataTable/export/exportEngine.ts
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
function g(e, t) {
|
|
7
|
+
let n = Array(t).fill("");
|
|
8
|
+
for (let r of e) r.start >= 0 && r.start < t && (n[r.start] = r.label);
|
|
9
|
+
return n;
|
|
10
|
+
}
|
|
11
|
+
var _ = (e) => JSON.stringify(e).replace(/</g, "\\u003c");
|
|
12
|
+
function v(e = "", t = {}, n) {
|
|
8
13
|
let r = e && n ? n(String(e)) : void 0;
|
|
9
14
|
return r ? {
|
|
10
15
|
text: e,
|
|
@@ -15,7 +20,7 @@ function _(e = "", t = {}, n) {
|
|
|
15
20
|
...t
|
|
16
21
|
};
|
|
17
22
|
}
|
|
18
|
-
function
|
|
23
|
+
function y(e, t) {
|
|
19
24
|
return t.map((t) => {
|
|
20
25
|
let n = e.find((e) => (e.exportHeader || e.header) === t);
|
|
21
26
|
if (!n) return { header: t };
|
|
@@ -23,7 +28,7 @@ function v(e, t) {
|
|
|
23
28
|
return n.type && (r.type = n.type), n.align ? r.align = n.align : r.type === "number" && (r.align = "right"), n.width && (r.width = n.width), r.type === "number" ? r.format = "number" : r.type === "date" && (r.format = "date"), n.cellStyle && (r.cellStyle = n.cellStyle), r;
|
|
24
29
|
});
|
|
25
30
|
}
|
|
26
|
-
function
|
|
31
|
+
function b(e, t, n, r, i) {
|
|
27
32
|
if (!n && !r) return null;
|
|
28
33
|
let a = /* @__PURE__ */ new Set();
|
|
29
34
|
if (n && r) for (let e of n) {
|
|
@@ -42,28 +47,29 @@ function y(e, t, n, r, i) {
|
|
|
42
47
|
}
|
|
43
48
|
return o;
|
|
44
49
|
}
|
|
45
|
-
function
|
|
46
|
-
let
|
|
50
|
+
function x(e, t, n, r, i, a, o) {
|
|
51
|
+
let s = (e) => {
|
|
47
52
|
if (e == null) return "";
|
|
48
53
|
let t = String(e);
|
|
49
54
|
return t.includes(",") || t.includes("\"") || t.includes("\n") ? `"${t.replace(/"/g, "\"\"")}"` : t;
|
|
50
|
-
},
|
|
55
|
+
}, c = [];
|
|
51
56
|
if (i) {
|
|
52
57
|
let e = m(i);
|
|
53
|
-
for (let [t, n] of e)
|
|
54
|
-
a &&
|
|
55
|
-
} else a && (
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
58
|
+
for (let [t, n] of e) c.push(`${s(t)},${s(n)}`);
|
|
59
|
+
a && c.push(s(a)), c.push("");
|
|
60
|
+
} else a && (c.push(s(a)), c.push(""));
|
|
61
|
+
for (let t of o ?? []) c.push(g(t, e.length).map(s).join(","));
|
|
62
|
+
if (c.push(e.map(s).join(","), ...t.map((t) => e.map((e) => s(t[e])).join(","))), n && c.push(e.map((e) => s(n[e])).join(",")), r && Object.keys(r.items).length > 0) {
|
|
63
|
+
c.push(""), c.push(s(d(i).exportSummaryLabel));
|
|
64
|
+
for (let [e, t] of Object.entries(r.items)) c.push(`${s(e)},${s(t)}`);
|
|
59
65
|
}
|
|
60
66
|
for (let e of r?.tables ?? []) {
|
|
61
|
-
|
|
62
|
-
for (let t of e.rows)
|
|
67
|
+
c.push(""), c.push(s(e.title)), c.push(e.header.map(s).join(","));
|
|
68
|
+
for (let t of e.rows) c.push(`${s(t.label)},${s(t.count)}`);
|
|
63
69
|
}
|
|
64
|
-
return new Blob(["" +
|
|
70
|
+
return new Blob(["" + c.join("\n")], { type: "text/csv;charset=utf-8;" });
|
|
65
71
|
}
|
|
66
|
-
function
|
|
72
|
+
function S(e) {
|
|
67
73
|
if (e) {
|
|
68
74
|
if (e.numFmt) return e.numFmt;
|
|
69
75
|
switch (e.format) {
|
|
@@ -75,50 +81,50 @@ function x(e) {
|
|
|
75
81
|
}
|
|
76
82
|
}
|
|
77
83
|
}
|
|
78
|
-
var
|
|
84
|
+
var C = (e) => e ? {
|
|
79
85
|
...e.align ? { align: e.align } : {},
|
|
80
86
|
...e.fontWeight === "bold" ? { bold: !0 } : {},
|
|
81
87
|
...e.color ? { color: e.color } : {},
|
|
82
88
|
...e.fontSize ? { size: e.fontSize } : {},
|
|
83
89
|
...e.backgroundColor ? { fill: e.backgroundColor } : {}
|
|
84
90
|
} : void 0;
|
|
85
|
-
function
|
|
86
|
-
let { totals: r, summary: i, style: a, sheetName: o, columnMeta: s, cellStyles: c, metadata: u, subtitle: p } = n || {},
|
|
91
|
+
function w(e, t, n) {
|
|
92
|
+
let { totals: r, summary: i, style: a, sheetName: o, columnMeta: s, cellStyles: c, metadata: u, subtitle: p, headerGroups: m } = n || {}, h = [], g = (e, t) => h.push({
|
|
87
93
|
values: [e],
|
|
88
94
|
style: t,
|
|
89
95
|
merge: !0
|
|
90
96
|
});
|
|
91
97
|
if (u) {
|
|
92
|
-
u.businessName &&
|
|
98
|
+
u.businessName && g(u.businessName, {
|
|
93
99
|
bold: !0,
|
|
94
100
|
size: 14
|
|
95
101
|
});
|
|
96
102
|
let e = [u.businessAddress, u.businessPhone].filter(Boolean);
|
|
97
|
-
e.length > 0 &&
|
|
103
|
+
e.length > 0 && g(e.join(" | "), {
|
|
98
104
|
size: 10,
|
|
99
105
|
color: "#666666"
|
|
100
|
-
}), u.taxNumber &&
|
|
106
|
+
}), u.taxNumber && g(`${l(u)}: ${u.taxNumber}`, { size: 10 }), p && g(p, {
|
|
101
107
|
size: 10,
|
|
102
108
|
italic: !0,
|
|
103
109
|
color: "#555555"
|
|
104
110
|
});
|
|
105
111
|
let t = f(u);
|
|
106
|
-
t &&
|
|
112
|
+
t && g(t, {
|
|
107
113
|
size: 9,
|
|
108
114
|
italic: !0
|
|
109
|
-
}),
|
|
110
|
-
} else p && (
|
|
115
|
+
}), h.push({ values: [] });
|
|
116
|
+
} else p && (g(p, {
|
|
111
117
|
size: 10,
|
|
112
118
|
italic: !0,
|
|
113
119
|
color: "#555555"
|
|
114
|
-
}),
|
|
115
|
-
let
|
|
120
|
+
}), h.push({ values: [] }));
|
|
121
|
+
let _ = h.length + (m?.length ?? 0) + 1, v = e.map((e, n) => {
|
|
116
122
|
let r = s?.[n], i = a?.columnStyles?.[e], o = i?.width || r?.width;
|
|
117
123
|
if (!o) {
|
|
118
124
|
let n = Math.max(e.length, ...t.slice(0, 50).map((t) => String(t[e] ?? "").length));
|
|
119
125
|
o = Math.min(Math.max(n + 2, 10), 40);
|
|
120
126
|
}
|
|
121
|
-
let c = i?.numFmt ||
|
|
127
|
+
let c = i?.numFmt || S(r), l = i?.align || r?.align;
|
|
122
128
|
return {
|
|
123
129
|
header: e,
|
|
124
130
|
width: o,
|
|
@@ -126,17 +132,17 @@ function C(e, t, n) {
|
|
|
126
132
|
...l ? { align: l } : {},
|
|
127
133
|
...i?.bold ? { style: { bold: !0 } } : {}
|
|
128
134
|
};
|
|
129
|
-
}),
|
|
135
|
+
}), y = [];
|
|
130
136
|
if (r) {
|
|
131
137
|
let t = {};
|
|
132
138
|
e.forEach((e, n) => {
|
|
133
|
-
let i =
|
|
139
|
+
let i = C(s?.[n]?.cellStyle?.(r[e], {})), a = v[n].numFmt, o = v[n].align;
|
|
134
140
|
t[n] = {
|
|
135
141
|
...o ? { align: o } : {},
|
|
136
142
|
...a ? { numFmt: a } : {},
|
|
137
143
|
...i
|
|
138
144
|
};
|
|
139
|
-
}),
|
|
145
|
+
}), y.push({
|
|
140
146
|
values: e.map((e) => r[e] ?? ""),
|
|
141
147
|
style: {
|
|
142
148
|
bold: a?.totalsStyle?.bold !== !1,
|
|
@@ -150,14 +156,14 @@ function C(e, t, n) {
|
|
|
150
156
|
});
|
|
151
157
|
}
|
|
152
158
|
if (i && Object.keys(i.items).length > 0) {
|
|
153
|
-
|
|
159
|
+
y.push({ values: [] }), y.push({
|
|
154
160
|
values: [d(u).exportSummaryLabel],
|
|
155
161
|
style: {
|
|
156
162
|
bold: !0,
|
|
157
163
|
size: 12
|
|
158
164
|
}
|
|
159
165
|
});
|
|
160
|
-
for (let [e, t] of Object.entries(i.items))
|
|
166
|
+
for (let [e, t] of Object.entries(i.items)) y.push({
|
|
161
167
|
values: [e, t],
|
|
162
168
|
cells: {
|
|
163
169
|
0: { bold: !0 },
|
|
@@ -166,30 +172,31 @@ function C(e, t, n) {
|
|
|
166
172
|
});
|
|
167
173
|
}
|
|
168
174
|
for (let e of i?.tables ?? []) {
|
|
169
|
-
|
|
175
|
+
y.push({ values: [] }), y.push({
|
|
170
176
|
values: [e.title],
|
|
171
177
|
style: {
|
|
172
178
|
bold: !0,
|
|
173
179
|
size: 12
|
|
174
180
|
}
|
|
175
|
-
}),
|
|
181
|
+
}), y.push({
|
|
176
182
|
values: e.header,
|
|
177
183
|
style: {
|
|
178
184
|
bold: !0,
|
|
179
185
|
borderBottom: { style: "thin" }
|
|
180
186
|
}
|
|
181
187
|
});
|
|
182
|
-
for (let t of e.rows)
|
|
188
|
+
for (let t of e.rows) y.push({
|
|
183
189
|
values: [t.label, t.count],
|
|
184
190
|
cells: { 1: { numFmt: "#,##0" } }
|
|
185
191
|
});
|
|
186
192
|
}
|
|
187
193
|
return { sheets: [{
|
|
188
194
|
name: o || "Sheet1",
|
|
189
|
-
columns:
|
|
195
|
+
columns: v,
|
|
190
196
|
rows: t.map((t) => e.map((e) => t[e] ?? "")),
|
|
191
|
-
before:
|
|
192
|
-
|
|
197
|
+
before: h,
|
|
198
|
+
...m?.length ? { headerGroups: m } : {},
|
|
199
|
+
after: y,
|
|
193
200
|
headerStyle: {
|
|
194
201
|
bold: a?.headerStyle?.bold !== !1,
|
|
195
202
|
color: a?.headerStyle?.fontColor || "#FFFFFF",
|
|
@@ -204,25 +211,25 @@ function C(e, t, n) {
|
|
|
204
211
|
cellStyles: c?.map((t) => {
|
|
205
212
|
let n = {};
|
|
206
213
|
return e.forEach((e, r) => {
|
|
207
|
-
let i =
|
|
214
|
+
let i = C(t?.[e]);
|
|
208
215
|
i && (n[r] = i);
|
|
209
216
|
}), n;
|
|
210
217
|
}),
|
|
211
218
|
autoFilter: a?.autoFilter !== !1,
|
|
212
219
|
freeze: {
|
|
213
|
-
rows: a?.freezeRows ??
|
|
220
|
+
rows: a?.freezeRows ?? _,
|
|
214
221
|
cols: a?.freezeCols || 0
|
|
215
222
|
}
|
|
216
223
|
}] };
|
|
217
224
|
}
|
|
218
|
-
async function
|
|
225
|
+
async function T(t, n, r) {
|
|
219
226
|
let i = await e({
|
|
220
227
|
kind: "xlsx",
|
|
221
|
-
workbook:
|
|
228
|
+
workbook: w(t, n, r)
|
|
222
229
|
}, { progress: () => {} });
|
|
223
230
|
return new Blob([i], { type: o.xlsx });
|
|
224
231
|
}
|
|
225
|
-
function
|
|
232
|
+
function E(e, t, n, r) {
|
|
226
233
|
let i = t ? {
|
|
227
234
|
...t.items,
|
|
228
235
|
...t.tables?.length ? { tables: t.tables.map((e) => ({
|
|
@@ -233,7 +240,7 @@ function T(e, t, n, r) {
|
|
|
233
240
|
} : void 0;
|
|
234
241
|
if (n) {
|
|
235
242
|
let t = { exportedAt: (/* @__PURE__ */ new Date()).toISOString() };
|
|
236
|
-
r && (t.subtitle = r), n.businessName && (t.businessName = n.businessName), n.businessAddress && (t.businessAddress = n.businessAddress), n.businessPhone && (t.businessPhone = n.businessPhone), n.taxNumber && (t[l(n)] = n.taxNumber), n.searchTerm && (t.search = n.searchTerm), n.filters && n.filters.length > 0 && (t.filters = n.filters), t.rows = {
|
|
243
|
+
r && (t.subtitle = r), n.businessName && (t.businessName = n.businessName), n.businessAddress && (t.businessAddress = n.businessAddress), n.businessPhone && (t.businessPhone = n.businessPhone), n.taxNumber && (t[l(n)] = n.taxNumber), n.searchTerm && (t.search = n.searchTerm), n.filters && n.filters.length > 0 && (t.filters = n.filters), n.notes?.length && (t.notes = n.notes), t.rows = {
|
|
237
244
|
total: n.totalRows,
|
|
238
245
|
filtered: n.filteredRows,
|
|
239
246
|
exported: n.resultRows,
|
|
@@ -254,9 +261,9 @@ function T(e, t, n, r) {
|
|
|
254
261
|
} : e;
|
|
255
262
|
return i && r && (a.summary = i), new Blob([JSON.stringify(a, null, 2)], { type: "application/json" });
|
|
256
263
|
}
|
|
257
|
-
function
|
|
258
|
-
let { title: r, subtitle: i, totals: a, summary: o, customStyles: s, columnMeta: c, cellStyles: u, metadata: p, branding: m } = n || {}, h = d(p),
|
|
259
|
-
${
|
|
264
|
+
function D(e, t, n) {
|
|
265
|
+
let { title: r, subtitle: i, totals: a, summary: o, customStyles: s, columnMeta: c, cellStyles: u, metadata: p, branding: m } = n || {}, h = d(p), g = m ? `<footer class="export-footer">
|
|
266
|
+
${M(h.exportGeneratedFrom)} <strong>${M(m.name)}</strong>${m.url ? ` — <a href="${M(m.url)}" target="_blank" rel="noopener">${M(m.url.replace(/^https?:\/\//, ""))}</a>` : ""}
|
|
260
267
|
</footer>` : "", v = (e) => e == null ? "" : String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">"), y = (e) => {
|
|
261
268
|
let t = c?.[e];
|
|
262
269
|
return t?.align ? ` style="text-align:${t.align}"` : "";
|
|
@@ -378,7 +385,7 @@ ${S ? `<tfoot>${S}</tfoot>` : ""}
|
|
|
378
385
|
</table>
|
|
379
386
|
</div>
|
|
380
387
|
${T}
|
|
381
|
-
${
|
|
388
|
+
${g}
|
|
382
389
|
<script>
|
|
383
390
|
(function(){
|
|
384
391
|
var table=document.getElementById('dataTable');
|
|
@@ -398,7 +405,7 @@ var show=!q||text.indexOf(q)>=0;
|
|
|
398
405
|
r.classList.toggle('hidden-row',!show);
|
|
399
406
|
if(show)visible++;
|
|
400
407
|
});
|
|
401
|
-
countEl.textContent=q?${
|
|
408
|
+
countEl.textContent=q?${_(h.rowsInfoFiltered("{v}", "{t}"))}.replace('{v}',visible).replace('{t}',total):${_(h.rowsInfo("{t}"))}.replace('{t}',total);
|
|
402
409
|
});
|
|
403
410
|
|
|
404
411
|
// Sort
|
|
@@ -459,7 +466,7 @@ this.classList.add('active');
|
|
|
459
466
|
</html>`;
|
|
460
467
|
return new Blob([D], { type: "text/html;charset=utf-8;" });
|
|
461
468
|
}
|
|
462
|
-
var
|
|
469
|
+
var O = {
|
|
463
470
|
A4: {
|
|
464
471
|
w: 595.28,
|
|
465
472
|
h: 841.89
|
|
@@ -485,7 +492,7 @@ var D = {
|
|
|
485
492
|
h: 1224
|
|
486
493
|
}
|
|
487
494
|
};
|
|
488
|
-
function
|
|
495
|
+
function k(e, t, n, r) {
|
|
489
496
|
e.length;
|
|
490
497
|
let i = e.map((e, i) => {
|
|
491
498
|
let a = r?.columnStyles?.[e]?.width;
|
|
@@ -530,7 +537,7 @@ function O(e, t, n, r) {
|
|
|
530
537
|
minFont: 6
|
|
531
538
|
}
|
|
532
539
|
]) {
|
|
533
|
-
let t =
|
|
540
|
+
let t = O[e.size], n = ((e.orient === "landscape" ? t.h : t.w) - e.margin * 2) / i;
|
|
534
541
|
if (n >= .85) {
|
|
535
542
|
let t = Math.max(e.minFont, Math.min(9, Math.round(9 * Math.min(n, 1))));
|
|
536
543
|
return {
|
|
@@ -558,19 +565,19 @@ function O(e, t, n, r) {
|
|
|
558
565
|
]
|
|
559
566
|
};
|
|
560
567
|
}
|
|
561
|
-
var
|
|
562
|
-
function
|
|
563
|
-
let { pdfConfig: r, totals: i, summary: a, subtitle: o, columnMeta: s, cellStyles: c, metadata: u, fontFor: p, fonts: m } = n || {},
|
|
568
|
+
var A = "dcsTable";
|
|
569
|
+
function j(e, t, n) {
|
|
570
|
+
let { pdfConfig: r, totals: i, summary: a, subtitle: o, columnMeta: s, cellStyles: c, metadata: u, fontFor: p, fonts: m, headerGroups: h } = n || {}, g = d(u), _ = (/* @__PURE__ */ new Date()).toLocaleDateString(u?.locale), y = r?.title || g.export, b = r?.autoFit !== !1, x = r?.pageSize || "A4", S = r?.orientation || "portrait", C = r?.fontSize || 9, w = [
|
|
564
571
|
30,
|
|
565
572
|
30,
|
|
566
573
|
30,
|
|
567
574
|
40
|
|
568
575
|
];
|
|
569
|
-
if (
|
|
570
|
-
let n =
|
|
571
|
-
|
|
576
|
+
if (b && !r?.orientation && !r?.pageSize) {
|
|
577
|
+
let n = k(e, t, s, r);
|
|
578
|
+
x = n.pageSize, S = n.orientation, r?.fontSize || (C = n.fontSize), w = n.margins;
|
|
572
579
|
}
|
|
573
|
-
r?.margin && (
|
|
580
|
+
r?.margin && (w = typeof r.margin == "number" ? [
|
|
574
581
|
r.margin,
|
|
575
582
|
r.margin,
|
|
576
583
|
r.margin,
|
|
@@ -581,40 +588,62 @@ function A(e, t, n) {
|
|
|
581
588
|
r.margin.right,
|
|
582
589
|
r.margin.bottom
|
|
583
590
|
]);
|
|
584
|
-
let
|
|
591
|
+
let T = (t) => {
|
|
585
592
|
let n = r?.columnStyles?.[e[t]];
|
|
586
593
|
return n?.align ? n.align : s?.[t]?.align || "left";
|
|
587
|
-
},
|
|
588
|
-
...
|
|
589
|
-
fontSize:
|
|
594
|
+
}, E = e.map((e, t) => ({
|
|
595
|
+
...v(e, { bold: !0 }, p),
|
|
596
|
+
fontSize: C - 1,
|
|
590
597
|
color: "white",
|
|
591
598
|
fillColor: "#1a73e8",
|
|
592
|
-
alignment:
|
|
593
|
-
})),
|
|
599
|
+
alignment: T(t)
|
|
600
|
+
})), D = t.map((t, n) => e.map((e, r) => {
|
|
594
601
|
let i = c?.[n]?.[e];
|
|
595
602
|
return {
|
|
596
|
-
...
|
|
597
|
-
fontSize: i?.fontSize ||
|
|
603
|
+
...v(t[e] == null ? "" : String(t[e]), {}, p),
|
|
604
|
+
fontSize: i?.fontSize || C,
|
|
598
605
|
fillColor: i?.backgroundColor || (n % 2 == 0 ? null : "#f8f9fa"),
|
|
599
|
-
alignment: i?.align ||
|
|
606
|
+
alignment: i?.align || T(r),
|
|
600
607
|
color: i?.color || void 0,
|
|
601
608
|
bold: i?.fontWeight === "bold" || void 0
|
|
602
609
|
};
|
|
603
|
-
})),
|
|
610
|
+
})), O = i ? e.map((e, t) => {
|
|
604
611
|
let n = s?.[t]?.cellStyle?.(i[e], {});
|
|
605
612
|
return {
|
|
606
|
-
...
|
|
607
|
-
fontSize:
|
|
613
|
+
...v(i[e] == null ? "" : String(i[e]), { bold: !0 }, p),
|
|
614
|
+
fontSize: C,
|
|
608
615
|
fillColor: n?.backgroundColor || "#e8e8e8",
|
|
609
|
-
alignment: n?.align ||
|
|
616
|
+
alignment: n?.align || T(t),
|
|
610
617
|
color: n?.color || void 0
|
|
611
618
|
};
|
|
612
|
-
}) : null,
|
|
613
|
-
|
|
614
|
-
|
|
619
|
+
}) : null, j = (h ?? []).map((t) => {
|
|
620
|
+
let n = e.map(() => ({
|
|
621
|
+
text: "",
|
|
622
|
+
fillColor: "#1a73e8"
|
|
623
|
+
}));
|
|
624
|
+
for (let r of t) {
|
|
625
|
+
if (r.start < 0 || r.start >= e.length) continue;
|
|
626
|
+
let t = Math.min(r.span, e.length - r.start);
|
|
627
|
+
n[r.start] = {
|
|
628
|
+
...v(r.label, { bold: !0 }, p),
|
|
629
|
+
fontSize: C - 1,
|
|
630
|
+
color: "white",
|
|
631
|
+
fillColor: "#1a73e8",
|
|
632
|
+
alignment: "center",
|
|
633
|
+
...t > 1 ? { colSpan: t } : {}
|
|
634
|
+
};
|
|
635
|
+
}
|
|
636
|
+
return n;
|
|
637
|
+
}), M = [
|
|
638
|
+
...j,
|
|
639
|
+
E,
|
|
640
|
+
...D
|
|
641
|
+
];
|
|
642
|
+
O && M.push(O);
|
|
643
|
+
let N = e.map(() => "*"), P = e.length > 8 ? 4 : 6, F = e.length > 8 ? 3 : 4, I = [];
|
|
615
644
|
if (u) {
|
|
616
|
-
u.businessName &&
|
|
617
|
-
...
|
|
645
|
+
u.businessName && I.push({
|
|
646
|
+
...v(u.businessName, { bold: !0 }, p),
|
|
618
647
|
fontSize: 16,
|
|
619
648
|
margin: [
|
|
620
649
|
0,
|
|
@@ -624,8 +653,8 @@ function A(e, t, n) {
|
|
|
624
653
|
]
|
|
625
654
|
});
|
|
626
655
|
let e = [];
|
|
627
|
-
u.businessAddress && e.push(u.businessAddress), u.businessPhone && e.push(u.businessPhone), u.taxNumber && e.push(`${l(u)}: ${u.taxNumber}`), e.length > 0 &&
|
|
628
|
-
...
|
|
656
|
+
u.businessAddress && e.push(u.businessAddress), u.businessPhone && e.push(u.businessPhone), u.taxNumber && e.push(`${l(u)}: ${u.taxNumber}`), e.length > 0 && I.push({
|
|
657
|
+
...v(e.join(" | "), {}, p),
|
|
629
658
|
fontSize: 9,
|
|
630
659
|
color: "#666666",
|
|
631
660
|
margin: [
|
|
@@ -634,8 +663,8 @@ function A(e, t, n) {
|
|
|
634
663
|
0,
|
|
635
664
|
4
|
|
636
665
|
]
|
|
637
|
-
}),
|
|
638
|
-
...
|
|
666
|
+
}), I.push({
|
|
667
|
+
...v(y, { bold: !0 }, p),
|
|
639
668
|
fontSize: 12,
|
|
640
669
|
color: "#333333",
|
|
641
670
|
margin: [
|
|
@@ -644,8 +673,8 @@ function A(e, t, n) {
|
|
|
644
673
|
0,
|
|
645
674
|
o ? 2 : 4
|
|
646
675
|
]
|
|
647
|
-
}), o &&
|
|
648
|
-
...
|
|
676
|
+
}), o && I.push({
|
|
677
|
+
...v(o, { italics: !0 }, p),
|
|
649
678
|
fontSize: 9,
|
|
650
679
|
color: "#555555",
|
|
651
680
|
margin: [
|
|
@@ -655,9 +684,9 @@ function A(e, t, n) {
|
|
|
655
684
|
4
|
|
656
685
|
]
|
|
657
686
|
});
|
|
658
|
-
let t = [f(u),
|
|
659
|
-
|
|
660
|
-
...
|
|
687
|
+
let t = [f(u), g.exportGenerated(_)].filter(Boolean).join(" | ");
|
|
688
|
+
I.push({
|
|
689
|
+
...v(t, {}, p),
|
|
661
690
|
fontSize: 8,
|
|
662
691
|
color: "#888888",
|
|
663
692
|
margin: [
|
|
@@ -667,8 +696,8 @@ function A(e, t, n) {
|
|
|
667
696
|
12
|
|
668
697
|
]
|
|
669
698
|
});
|
|
670
|
-
} else
|
|
671
|
-
...
|
|
699
|
+
} else I.push({
|
|
700
|
+
...v(y, { bold: !0 }, p),
|
|
672
701
|
fontSize: 16,
|
|
673
702
|
margin: [
|
|
674
703
|
0,
|
|
@@ -676,8 +705,8 @@ function A(e, t, n) {
|
|
|
676
705
|
0,
|
|
677
706
|
o ? 2 : 4
|
|
678
707
|
]
|
|
679
|
-
}), o &&
|
|
680
|
-
...
|
|
708
|
+
}), o && I.push({
|
|
709
|
+
...v(o, { italics: !0 }, p),
|
|
681
710
|
fontSize: 10,
|
|
682
711
|
color: "#555555",
|
|
683
712
|
margin: [
|
|
@@ -686,8 +715,8 @@ function A(e, t, n) {
|
|
|
686
715
|
0,
|
|
687
716
|
4
|
|
688
717
|
]
|
|
689
|
-
}),
|
|
690
|
-
text: `${
|
|
718
|
+
}), I.push({
|
|
719
|
+
text: `${g.rowsInfo(String(t.length))} | ${g.exportGenerated(_)}`,
|
|
691
720
|
fontSize: 9,
|
|
692
721
|
color: "#888",
|
|
693
722
|
margin: [
|
|
@@ -697,15 +726,15 @@ function A(e, t, n) {
|
|
|
697
726
|
12
|
|
698
727
|
]
|
|
699
728
|
});
|
|
700
|
-
if (
|
|
729
|
+
if (I.push({
|
|
701
730
|
table: {
|
|
702
|
-
headerRows: 1,
|
|
703
|
-
widths:
|
|
704
|
-
body:
|
|
731
|
+
headerRows: 1 + j.length,
|
|
732
|
+
widths: N,
|
|
733
|
+
body: M
|
|
705
734
|
},
|
|
706
|
-
layout:
|
|
735
|
+
layout: A
|
|
707
736
|
}), a && Object.keys(a.items).length > 0) {
|
|
708
|
-
|
|
737
|
+
I.push({
|
|
709
738
|
text: "",
|
|
710
739
|
margin: [
|
|
711
740
|
0,
|
|
@@ -713,8 +742,8 @@ function A(e, t, n) {
|
|
|
713
742
|
0,
|
|
714
743
|
0
|
|
715
744
|
]
|
|
716
|
-
}),
|
|
717
|
-
...
|
|
745
|
+
}), I.push({
|
|
746
|
+
...v(g.exportSummaryLabel, { bold: !0 }, p),
|
|
718
747
|
fontSize: 12,
|
|
719
748
|
margin: [
|
|
720
749
|
0,
|
|
@@ -724,13 +753,13 @@ function A(e, t, n) {
|
|
|
724
753
|
]
|
|
725
754
|
});
|
|
726
755
|
let e = Object.entries(a.items).map(([e, t]) => [{
|
|
727
|
-
...
|
|
756
|
+
...v(e, { bold: !0 }, p),
|
|
728
757
|
fontSize: 9
|
|
729
758
|
}, {
|
|
730
|
-
...
|
|
759
|
+
...v(String(t), {}, p),
|
|
731
760
|
fontSize: 9
|
|
732
761
|
}]);
|
|
733
|
-
|
|
762
|
+
I.push({
|
|
734
763
|
table: {
|
|
735
764
|
widths: ["auto", "*"],
|
|
736
765
|
body: e
|
|
@@ -739,7 +768,7 @@ function A(e, t, n) {
|
|
|
739
768
|
});
|
|
740
769
|
}
|
|
741
770
|
for (let e of a?.tables ?? []) {
|
|
742
|
-
|
|
771
|
+
I.push({
|
|
743
772
|
text: "",
|
|
744
773
|
margin: [
|
|
745
774
|
0,
|
|
@@ -747,8 +776,8 @@ function A(e, t, n) {
|
|
|
747
776
|
0,
|
|
748
777
|
0
|
|
749
778
|
]
|
|
750
|
-
}),
|
|
751
|
-
...
|
|
779
|
+
}), I.push({
|
|
780
|
+
...v(e.title, { bold: !0 }, p),
|
|
752
781
|
fontSize: 10,
|
|
753
782
|
margin: [
|
|
754
783
|
0,
|
|
@@ -758,18 +787,18 @@ function A(e, t, n) {
|
|
|
758
787
|
]
|
|
759
788
|
});
|
|
760
789
|
let t = [e.header.map((e, t) => ({
|
|
761
|
-
...
|
|
790
|
+
...v(e, { bold: !0 }, p),
|
|
762
791
|
fontSize: 9,
|
|
763
792
|
...t === 1 ? { alignment: "right" } : {}
|
|
764
793
|
})), ...e.rows.map((e) => [{
|
|
765
|
-
...
|
|
794
|
+
...v(e.label, {}, p),
|
|
766
795
|
fontSize: 9
|
|
767
796
|
}, {
|
|
768
797
|
text: String(e.count),
|
|
769
798
|
fontSize: 9,
|
|
770
799
|
alignment: "right"
|
|
771
800
|
}])];
|
|
772
|
-
|
|
801
|
+
I.push({
|
|
773
802
|
table: {
|
|
774
803
|
headerRows: 1,
|
|
775
804
|
widths: ["auto", "auto"],
|
|
@@ -778,27 +807,27 @@ function A(e, t, n) {
|
|
|
778
807
|
layout: "lightHorizontalLines"
|
|
779
808
|
});
|
|
780
809
|
}
|
|
781
|
-
let
|
|
810
|
+
let L = p?.(g.exportPage("1", "1"));
|
|
782
811
|
return {
|
|
783
812
|
kind: "pdf",
|
|
784
813
|
document: {
|
|
785
|
-
content:
|
|
786
|
-
pageOrientation:
|
|
787
|
-
pageSize:
|
|
788
|
-
pageMargins:
|
|
814
|
+
content: I,
|
|
815
|
+
pageOrientation: S,
|
|
816
|
+
pageSize: x,
|
|
817
|
+
pageMargins: w
|
|
789
818
|
},
|
|
790
|
-
tableLayouts: { [
|
|
819
|
+
tableLayouts: { [A]: {
|
|
791
820
|
hLineWidth: .5,
|
|
792
821
|
edgeLineWidth: 1.5,
|
|
793
822
|
vLineWidth: .5,
|
|
794
823
|
hLineColor: "#cccccc",
|
|
795
824
|
vLineColor: "#cccccc",
|
|
796
|
-
paddingX:
|
|
797
|
-
paddingY:
|
|
825
|
+
paddingX: P,
|
|
826
|
+
paddingY: F
|
|
798
827
|
} },
|
|
799
828
|
footer: {
|
|
800
|
-
text:
|
|
801
|
-
...
|
|
829
|
+
text: g.exportPage("{page}", "{pages}"),
|
|
830
|
+
...L ? { font: L } : {},
|
|
802
831
|
alignment: "center",
|
|
803
832
|
fontSize: 8,
|
|
804
833
|
color: "#888",
|
|
@@ -815,9 +844,9 @@ function A(e, t, n) {
|
|
|
815
844
|
} } : {}
|
|
816
845
|
};
|
|
817
846
|
}
|
|
818
|
-
var
|
|
819
|
-
function
|
|
820
|
-
let { title: r, subtitle: i, totals: a, summary: o, metadata: s } = n || {}, c =
|
|
847
|
+
var M = (e) => String(e ?? "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
848
|
+
function N(e, t, n) {
|
|
849
|
+
let { title: r, subtitle: i, totals: a, summary: o, metadata: s } = n || {}, c = M, l = (t) => e.map((e) => ` <field name="${c(e)}">${c(t[e])}</field>`).join("\n"), u = ["<?xml version=\"1.0\" encoding=\"UTF-8\"?>", `<export${r ? ` title="${c(r)}"` : ""} generated="${(/* @__PURE__ */ new Date()).toISOString()}">`];
|
|
821
850
|
if (i && u.push(` <subtitle>${c(i)}</subtitle>`), s) {
|
|
822
851
|
u.push(" <metadata>");
|
|
823
852
|
for (let [e, t] of m(s)) u.push(` <item name="${c(e)}">${c(t)}</item>`);
|
|
@@ -837,11 +866,12 @@ function M(e, t, n) {
|
|
|
837
866
|
}
|
|
838
867
|
return u.push("</export>"), new Blob([u.join("\n")], { type: "application/xml;charset=utf-8;" });
|
|
839
868
|
}
|
|
840
|
-
async function
|
|
841
|
-
let i = r?.totals ??
|
|
869
|
+
async function P(e, t, n, r) {
|
|
870
|
+
let i = r?.totals ?? b(n, t, r?.totalKeys, r?.columns, d(r?.metadata)), a = r?.summary, o = r?.metadata, s = r?.subtitle || r?.pdf?.subtitle, c = r?.columnMeta ?? (r?.columns ? y(r.columns, t) : void 0);
|
|
842
871
|
switch (e) {
|
|
843
|
-
case "csv": return
|
|
844
|
-
case "xlsx": return await
|
|
872
|
+
case "csv": return x(t, n, i, a, o, s, r?.headerGroups);
|
|
873
|
+
case "xlsx": return await T(t, n, {
|
|
874
|
+
headerGroups: r?.headerGroups,
|
|
845
875
|
totals: i,
|
|
846
876
|
summary: a,
|
|
847
877
|
style: r?.xlsx,
|
|
@@ -851,8 +881,8 @@ async function N(e, t, n, r) {
|
|
|
851
881
|
metadata: o,
|
|
852
882
|
subtitle: s
|
|
853
883
|
});
|
|
854
|
-
case "json": return
|
|
855
|
-
case "html": return
|
|
884
|
+
case "json": return E(n, a, o, s);
|
|
885
|
+
case "html": return D(t, n, {
|
|
856
886
|
title: r?.html?.title || r?.title || r?.pdf?.title,
|
|
857
887
|
subtitle: s,
|
|
858
888
|
totals: i,
|
|
@@ -863,14 +893,14 @@ async function N(e, t, n, r) {
|
|
|
863
893
|
metadata: o,
|
|
864
894
|
branding: r?.branding
|
|
865
895
|
});
|
|
866
|
-
case "xml": return
|
|
896
|
+
case "xml": return N(t, n, {
|
|
867
897
|
title: r?.title,
|
|
868
898
|
subtitle: s,
|
|
869
899
|
totals: i,
|
|
870
900
|
summary: a,
|
|
871
901
|
metadata: o
|
|
872
902
|
});
|
|
873
|
-
case "pdf": return
|
|
903
|
+
case "pdf": return D(t, n, {
|
|
874
904
|
title: r?.pdf?.title || r?.title || d(r?.metadata).export,
|
|
875
905
|
subtitle: s,
|
|
876
906
|
totals: i,
|
|
@@ -883,7 +913,7 @@ async function N(e, t, n, r) {
|
|
|
883
913
|
cellStyles: r?.cellStyles,
|
|
884
914
|
metadata: o
|
|
885
915
|
});
|
|
886
|
-
default: return
|
|
916
|
+
default: return x(t, n, i, a, o, s);
|
|
887
917
|
}
|
|
888
918
|
}
|
|
889
|
-
export { p as autoFormatValue, h as buildBusinessMeta,
|
|
919
|
+
export { p as autoFormatValue, h as buildBusinessMeta, y as buildColumnMeta, P as buildExportBlob, w as buildTableXlsxSpec, i as downloadBlob, t as executeFileAction, f as formatContextLine, m as formatMetadataLines, x as generateCSV, D as generateHTML, E as generateJSON, j as generateTablePDFTask, T as generateXLSX, N as generateXML, s as getExtension, c as getFormatLabel, g as headerGroupCells, n as openPreview, u as prepareExportRows, a as rawDataToBlob, r as shareFile };
|