comins-table 0.2.0 → 0.2.2
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 +50 -0
- package/README.md +43 -339
- package/THIRD_PARTY_NOTICES.md +4 -0
- package/dist/{clipboard-CNrbmDue.js → clipboard-B_gA5e12.js} +5 -5
- package/dist/clipboard-B_gA5e12.js.map +1 -0
- package/dist/clipboard.js +2 -2
- package/dist/column-filter.d.ts +6 -1
- package/dist/column-filter.d.ts.map +1 -1
- package/dist/core/editing/export-structure.d.ts +6 -0
- package/dist/core/editing/export-structure.d.ts.map +1 -0
- package/dist/core/editing/export.d.ts +2 -2
- package/dist/core/editing/export.d.ts.map +1 -1
- package/dist/core/editing/import.d.ts +4 -0
- package/dist/core/editing/import.d.ts.map +1 -0
- package/dist/core/editing/xlsx-data.d.ts +12 -0
- package/dist/core/editing/xlsx-data.d.ts.map +1 -0
- package/dist/core/editing/xlsx-model.d.ts +103 -0
- package/dist/core/editing/xlsx-model.d.ts.map +1 -0
- package/dist/core/model.d.ts +2 -0
- package/dist/core/model.d.ts.map +1 -1
- package/dist/core/rows/filter-value.d.ts +12 -0
- package/dist/core/rows/filter-value.d.ts.map +1 -0
- package/dist/core/rows/filtering.d.ts +27 -7
- package/dist/core/rows/filtering.d.ts.map +1 -1
- package/dist/core/rows/values-filter.d.ts +46 -0
- package/dist/core/rows/values-filter.d.ts.map +1 -0
- package/dist/core/state/reconcile.d.ts.map +1 -1
- package/dist/{core-compat-B4I2OHGY.js → core-compat-BO-JJudO.js} +5 -3
- package/dist/core-compat-BO-JJudO.js.map +1 -0
- package/dist/core.d.ts +8 -1
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +3 -3
- package/dist/engine-iWefk5Rv.js +146 -0
- package/dist/engine-iWefk5Rv.js.map +1 -0
- package/dist/export-B_Q9_Whp.js +184 -0
- package/dist/export-B_Q9_Whp.js.map +1 -0
- package/dist/filtering.d.ts +23 -25
- package/dist/filtering.d.ts.map +1 -1
- package/dist/grouping.d.ts +8 -0
- package/dist/grouping.d.ts.map +1 -1
- package/dist/index.d.ts +44 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2620 -2230
- package/dist/index.js.map +1 -1
- package/dist/model.d.ts +30 -0
- package/dist/model.d.ts.map +1 -1
- package/dist/react/cell-tooltip.d.ts +20 -0
- package/dist/react/cell-tooltip.d.ts.map +1 -0
- package/dist/react/state.d.ts +1 -1
- package/dist/react/state.d.ts.map +1 -1
- package/dist/react/table-transfer.d.ts +4 -0
- package/dist/react/table-transfer.d.ts.map +1 -1
- package/dist/react/value-filter-types.d.ts +79 -0
- package/dist/react/value-filter-types.d.ts.map +1 -0
- package/dist/react/value-filter.d.ts +897 -0
- package/dist/react/value-filter.d.ts.map +1 -0
- package/dist/react-types.d.ts +10 -1
- package/dist/react-types.d.ts.map +1 -1
- package/dist/selection.js +1 -1
- package/dist/summary.d.ts +9 -0
- package/dist/summary.d.ts.map +1 -1
- package/dist/values-filter-pFAPWz1Q.js +497 -0
- package/dist/values-filter-pFAPWz1Q.js.map +1 -0
- package/dist/workbook-C7MXhUjt.js +349 -0
- package/dist/workbook-C7MXhUjt.js.map +1 -0
- package/dist/xlsx/engine.d.ts +5 -0
- package/dist/xlsx/engine.d.ts.map +1 -0
- package/dist/xlsx/errors.d.ts +12 -0
- package/dist/xlsx/errors.d.ts.map +1 -0
- package/dist/xlsx/export.d.ts +3 -0
- package/dist/xlsx/export.d.ts.map +1 -0
- package/dist/xlsx/styles.d.ts +37 -0
- package/dist/xlsx/styles.d.ts.map +1 -0
- package/dist/xlsx/text.d.ts +7 -0
- package/dist/xlsx/text.d.ts.map +1 -0
- package/dist/xlsx/workbook.d.ts +32 -0
- package/dist/xlsx/workbook.d.ts.map +1 -0
- package/dist/xlsx/xml.d.ts +14 -0
- package/dist/xlsx/xml.d.ts.map +1 -0
- package/dist/xlsx/zip.d.ts +9 -0
- package/dist/xlsx/zip.d.ts.map +1 -0
- package/dist/xlsx.d.ts +7 -0
- package/dist/xlsx.d.ts.map +1 -0
- package/dist/xlsx.js +39 -0
- package/dist/xlsx.js.map +1 -0
- package/dist/zip-Oz81THHH.js +62 -0
- package/dist/zip-Oz81THHH.js.map +1 -0
- package/package.json +19 -11
- package/styles.css +53 -0
- package/dist/clipboard-CNrbmDue.js.map +0 -1
- package/dist/core-compat-B4I2OHGY.js.map +0 -1
- package/dist/export-Cfk5Jz4a.js +0 -37
- package/dist/export-Cfk5Jz4a.js.map +0 -1
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { CominsColumnFilterValue, CominsTableRuntimeColumn } from "../model";
|
|
2
|
+
import { type CominsColumnFilterModel, type CominsColumnFilteringSourceRow } from "./filtering";
|
|
3
|
+
export type CominsColumnFilterOption = {
|
|
4
|
+
id: string;
|
|
5
|
+
value: CominsColumnFilterValue;
|
|
6
|
+
label: string;
|
|
7
|
+
count: number;
|
|
8
|
+
selected: boolean;
|
|
9
|
+
present: boolean;
|
|
10
|
+
};
|
|
11
|
+
export type CominsColumnFilterOptionsResult = {
|
|
12
|
+
options: readonly CominsColumnFilterOption[];
|
|
13
|
+
visibleOptions: readonly CominsColumnFilterOption[];
|
|
14
|
+
selectionMode: "all" | "include";
|
|
15
|
+
totalOptionCount: number;
|
|
16
|
+
selectedOptionCount: number;
|
|
17
|
+
visibleOptionCount: number;
|
|
18
|
+
selectedVisibleOptionCount: number;
|
|
19
|
+
visibleSelection: boolean | "mixed";
|
|
20
|
+
};
|
|
21
|
+
export type CominsColumnFilterValuesAction = {
|
|
22
|
+
type: "setOption";
|
|
23
|
+
id: string;
|
|
24
|
+
checked: boolean;
|
|
25
|
+
} | {
|
|
26
|
+
type: "setVisible";
|
|
27
|
+
checked: boolean;
|
|
28
|
+
} | {
|
|
29
|
+
type: "clear";
|
|
30
|
+
};
|
|
31
|
+
export type CominsColumnFilterOptionsInput<TData> = {
|
|
32
|
+
columns: readonly CominsTableRuntimeColumn<TData>[];
|
|
33
|
+
columnId: string;
|
|
34
|
+
rows: readonly CominsColumnFilteringSourceRow<TData>[];
|
|
35
|
+
model: CominsColumnFilterModel;
|
|
36
|
+
query?: string;
|
|
37
|
+
};
|
|
38
|
+
/** Internal projection for adapters: search does not re-read rows or recompute facet counts. */
|
|
39
|
+
export declare function searchFilterOptions(base: CominsColumnFilterOptionsResult, query: string): CominsColumnFilterOptionsResult;
|
|
40
|
+
/** Collect all supplied leaf values; count matches of other columns, ignoring this column's rule. */
|
|
41
|
+
export declare function getCominsColumnFilterOptions<TData>(input: CominsColumnFilterOptionsInput<TData>): CominsColumnFilterOptionsResult | null;
|
|
42
|
+
/** Immutable proposal: the application owns and acknowledges the returned model. */
|
|
43
|
+
export declare function setCominsColumnFilterValues<TData>(input: CominsColumnFilterOptionsInput<TData> & {
|
|
44
|
+
action: CominsColumnFilterValuesAction;
|
|
45
|
+
}): CominsColumnFilterModel;
|
|
46
|
+
//# sourceMappingURL=values-filter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"values-filter.d.ts","sourceRoot":"","sources":["../../../src/core/rows/values-filter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAElF,OAAO,EAAiE,KAAK,uBAAuB,EAAE,KAAK,8BAA8B,EAA+B,MAAM,aAAa,CAAC;AAE5L,MAAM,MAAM,wBAAwB,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,uBAAuB,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC;AACzJ,MAAM,MAAM,+BAA+B,GAAG;IAC5C,OAAO,EAAE,SAAS,wBAAwB,EAAE,CAAC;IAAC,cAAc,EAAE,SAAS,wBAAwB,EAAE,CAAC;IAClG,aAAa,EA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G,YAAY,GAAG,YAAY,CAAC,CAAC;AAElF,MAAM,MAAM,yBAAyB,CAAC,KAAK,IAAI;IAC7C,OAAO,EAAE,gBAAgB,CAAC,KAAK,CAAC,CAAC;IACjC,SAAS,EAAE,uBAAuB,CAAC,KAAK,CAAC,CAAC;IAC1C,kBAAkB,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,WAAW,EAAE,OAAO,CAAC;IACrB,eAAe,EAAE,OAAO,CAAC;IACzB,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC,CAAC;AAEF,wFAAwF;AACxF,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,WAAW,EAAE,eAAe,EAAE,eAAe,EAAE,EAAE,yBAAyB,CAAC,KAAK,CAAC,GAAG;IACtK,KAAK,EAAE,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAC/B,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,uBAAuB,EAAE,WAAW,EAAE,CAAC;CACxC,CAkCA;AAGD,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,oBAAoB,EAAE,MAAM,EAAE,SAAS,WAAW,EAAE,EAAE,OAAO,EAAE,SAAS,MAAM,EAAE,EAAE,SAAS,EAAE,SAAS,MAAM,EAAE,GAAG,oBAAoB,CAgB9L"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as e, B as t, C as n, D as r, E as i, F as a, G as o, H as s, I as c, J as l, K as u, L as d, M as f, N as p, O as m, P as ee, R as te, S as ne, T as re, U as h, V as g, W as _, X as v, Y as y, _ as b, a as x, b as S, d as C, f as w, g as T, h as E, i as D, j as O, k, l as A, m as j, n as M, o as N, p as P, q as F, r as I, s as L, t as R, v as z, w as B, x as V, y as H, z as U } from "./clipboard-
|
|
1
|
+
import { A as e, B as t, C as n, D as r, E as i, F as a, G as o, H as s, I as c, J as l, K as u, L as d, M as f, N as p, O as m, P as ee, R as te, S as ne, T as re, U as h, V as g, W as _, X as v, Y as y, _ as b, a as x, b as S, d as C, f as w, g as T, h as E, i as D, j as O, k, l as A, m as j, n as M, o as N, p as P, q as F, r as I, s as L, t as R, v as z, w as B, x as V, y as H, z as U } from "./clipboard-B_gA5e12.js";
|
|
2
2
|
//#region src/react/edit-policy.ts
|
|
3
3
|
function W(e, t, n, r, i = e.rowIds.indexOf(n)) {
|
|
4
4
|
return {
|
|
@@ -77,7 +77,9 @@ function J(e) {
|
|
|
77
77
|
pinned: e.pinned,
|
|
78
78
|
sort: typeof t == "function" ? (n, r, i, a) => t.call(e, n, r, i, a) : t,
|
|
79
79
|
filter: n && {
|
|
80
|
-
|
|
80
|
+
kind: n.kind,
|
|
81
|
+
caseSensitive: n.caseSensitive,
|
|
82
|
+
getOptionLabel: n.getOptionLabel,
|
|
81
83
|
getValue: n.getValue ? (t) => n.getValue({
|
|
82
84
|
...t,
|
|
83
85
|
column: e
|
|
@@ -388,4 +390,4 @@ function Qe(e, { source: t, target: n }, r = e.rowIds) {
|
|
|
388
390
|
//#endregion
|
|
389
391
|
export { Y as $, Je as A, ue as B, xe as C, le as D, ce as E, Ce as F, De as G, se as H, me as I, ke as J, Oe as K, he as L, Ke as M, Ze as N, Ie as O, Se as P, J as Q, fe as R, He as S, ve as T, ae as U, oe as V, ie as W, Ne as X, Ve as Y, Te as Z, Pe as _, je as a, Fe as b, Ge as c, Qe as d, X as et, $ as f, Be as g, Q as h, _e as i, Xe as j, Le as k, Re as l, We as m, de as n, qe as o, Ue as p, Ae as q, ge as r, Ye as s, we as t, Ee as u, be as v, ye as w, ze as x, Me as y, pe as z };
|
|
390
392
|
|
|
391
|
-
//# sourceMappingURL=core-compat-
|
|
393
|
+
//# sourceMappingURL=core-compat-BO-JJudO.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core-compat-BO-JJudO.js","names":["getCominsCellValue","columns.setCominsColumnWidth","columns.setCominsColumnHidden","columns.setCominsColumnGroupHidden","columns.setCominsColumnGroupWidth","columns.moveCominsColumn","columns.moveCominsColumnGroup","columns.serializeCominsColumnLayout","columns.applyCominsColumnLayout","selection.selectRow","selection.selectRows","selection.selectCell","selection.selectCellRange","selection.clearCominsCellRange","selection.clearCominsSelection","selection.isCominsRowSelected","selection.isCominsCellSelected","selection.getCominsSelectedCellRange","selection.isCominsCellInSelectedRange","table.queryCominsRows","table.replaceCominsRows","table.addCominsRows","table.updateCominsRows","table.deleteCominsRows","table.setCominsHeaderVisible","table.setCominsPagination","table.setCominsSortState","table.setCominsSortModel","table.clearCominsSortState","table.getCominsSortedRowIndexes","table.sortCominsRows","table.getCominsPageRows","table.getCominsVirtualRows","table.moveCominsRow","table.moveCominsRowToGroup","table.getCominsCellValue","columns.normalizeColumns","columns.normalizeColumnGroups","table.createCominsTableState","columns.getCominsVisibleColumns","columns.getCominsHeaderRows","clipboard.copyCominsRow","clipboard.pasteCominsRow","cells.copyCominsCell","cells.pasteCominsCell","clipboard.copyCominsCellRange","clipboard.pasteCominsCellRange","clipboard.pasteCominsText","clipboard.fillCominsCellRange","clearCominsSelection$1","getCominsHeaderRows$1","setCominsHeaderVisible$1","sortCominsRows$1","setCominsSortState$1","selectCell$1","normalizeColumns","moveCominsColumn$1","selectCellRange$1","setCominsColumnGroupWidth$1","serializeCominsColumnLayout$1","selectRow$1","isCominsCellInSelectedRange$1","isCominsCellSelected$1","updateCominsRows$1","isCominsRowSelected$1","selectRows$1","replaceCominsRows$1","setCominsSortModel$1","moveCominsColumnGroup$1","getCominsVisibleColumns$1","normalizeColumnGroups","setCominsColumnWidth$1","setCominsColumnHidden$1","getCominsSortedRowIndexes$1","pasteCominsRow$1","moveCominsRowToGroup$1","addCominsRows$1","clearCominsSortState$1","getCominsPageRows$1","getCominsCellValue$1","pasteCominsCellRange$1","getCominsSelectedCellRange$1","pasteCominsCell$1","deleteCominsRows$1","copyCominsRow$1","pasteCominsText$1","createCominsTableState$1","setCominsColumnGroupHidden$1","fillCominsCellRange$1","copyCominsCell$1","copyCominsCellRange$1","getCominsVirtualRows$1","setCominsPagination$1","queryCominsRows$1","moveCominsRow$1","applyCominsColumnLayout$1","createCellComponentParams","state","rowId","column","current","row","rowIndex","resolveGuard","guard","params","resolveCellProps","props","createReactEditPolicy","evaluations","evaluate","cached","payload","definition","result","projectReactColumn","sort","filter","left","right","leftRow","rightRow","projectReactGroup","group","projectReactState","columnSources","groupSources","source","projected","original","restoreReactState","next","bridge","setCominsColumnWidth","columnId","width","setCominsColumnHidden","hidden","setCominsColumnGroupHidden","groupId","setCominsColumnGroupWidth","moveCominsColumn","targetIndex","moveCominsColumnGroup","serializeCominsColumnLayout","applyCominsColumnLayout","layout","selectRow","options","selectRows","rowIds","selectCell","cell","selectCellRange","range","clearCominsCellRange","clearCominsCellRange$1","clearCominsSelection","isCominsRowSelected","isCominsCellSelected","getCominsSelectedCellRange","isCominsCellInSelectedRange","queryCominsRows","predicate","replaceCominsRows","rows","addCominsRows","updateCominsRows","updates","deleteCominsRows","setCominsHeaderVisible","showHeader","setCominsPagination","pagination","setCominsSortState","setCominsSortModel","sortModel","clearCominsSortState","getCominsSortedRowIndexes","index","sourceIndexes","sortCominsRows","getCominsPageRows","getCominsVirtualRows","moveCominsRow","moveCominsRowToGroup","getCominsCellValue","createCominsTableState","runtimeColumns","input","runtimeGroups","getCominsVisibleColumns","getCominsHeaderRows","setCominsTableTheme","theme","formatCominsCellValue","value","isCominsCellDisabled","getCominsCellClassName","className","getCominsCellStyle","style","copyCominsRow","pasteCominsRow","copied","copyCominsCell","pasteCominsCell","copyCominsCellRange","pasteCominsCellRange","target","pasteCominsText","text","fillCominsCellRange"],"sources":["../src/react/edit-policy.ts","../src/react/model.ts","../src/react/core-compat.ts"],"sourcesContent":["import type { CoreCellDataConfig, CominsCellComponentPayload as CorePayload } from \"../core/model\";\nimport type {\n CominsTableState, CominsTableRuntimeColumn, CominsCellComponentPayload, CominsClipboardGuard,\n} from \"../react-types\";\nimport type { CominsRowId } from \"../model\";\nimport { getCominsCellValue } from \"../core/state/table\";\n\nexport function createCellComponentParams<TData>(\n state: CominsTableState<TData>,\n row: TData,\n rowId: CominsRowId,\n column: CominsTableRuntimeColumn<TData>,\n rowIndex = state.rowIds.indexOf(rowId),\n): CominsCellComponentPayload<TData> {\n return {\n column: {\n definition: column,\n field: column.field,\n id: column.id,\n index: state.columns.findIndex((current) => current.id === column.id),\n label: column.label,\n },\n row: {\n data: row,\n dataIndex: rowIndex,\n disabled: false,\n id: rowId,\n index: rowIndex,\n selected: state.selection.rowIds.includes(rowId),\n },\n selection: {\n selectedRowCount: state.selection.rowIds.length,\n },\n value: getCominsCellValue(state, row, column.id),\n };\n}\n\nexport function resolveGuard<TData>(\n guard: CominsClipboardGuard<TData> | undefined,\n params: CominsCellComponentPayload<TData>,\n) {\n if (guard === undefined) {\n return true;\n }\n\n return typeof guard === \"boolean\" ? guard : guard(params);\n}\n\nexport function resolveCellProps<TData>(\n state: CominsTableState<TData>,\n row: TData,\n rowId: CominsRowId,\n column: CominsTableRuntimeColumn<TData>,\n) {\n const params = createCellComponentParams(state, row, rowId, column);\n const props = column.cell?.props;\n\n return typeof props === \"function\" ? props(params) : props;\n}\n\n/** Interpret React props once per guard evaluation, retaining the original payload and receiver. */\nexport function createReactEditPolicy<TData>(\n state: CominsTableState<TData>,\n column: CominsTableRuntimeColumn<TData>,\n): CoreCellDataConfig<TData> {\n const evaluations = new WeakMap<CorePayload<TData>, {\n params: CominsCellComponentPayload<TData>;\n props: ReturnType<typeof resolveCellProps<TData>>;\n }>();\n const evaluate = (payload: CorePayload<TData>) => {\n const cached = evaluations.get(payload);\n if (cached) return cached;\n const params = createCellComponentParams(state, payload.row.data, payload.row.id, column, payload.row.dataIndex);\n const definition = column.cell?.props;\n const result = { params, props: typeof definition === \"function\" ? definition(params) : definition };\n evaluations.set(payload, result);\n return result;\n };\n return {\n disabled: payload => {\n const { params, props } = evaluate(payload);\n return props?.disabled !== undefined && resolveGuard(props.disabled, params) === true;\n },\n copyable: payload => {\n const { params, props } = evaluate(payload);\n return resolveGuard(props?.copyable, params);\n },\n pasteable: payload => {\n const { params, props } = evaluate(payload);\n return resolveGuard(props?.pasteable, params);\n },\n parseClipboard: column.cell?.parseClipboard ? payload => column.cell!.parseClipboard!({\n ...createCellComponentParams(state, payload.row.data, payload.row.id, column, payload.row.dataIndex),\n text: payload.text,\n }) : undefined,\n validateFill: column.cell?.validateFill ? payload => column.cell!.validateFill!({\n ...createCellComponentParams(state, payload.row.data, payload.row.id, column, payload.row.dataIndex),\n value: payload.value,\n }) : undefined,\n };\n}\n","import type * as Core from \"../core/model\";\nimport type * as React from \"../react-types\";\nimport { createReactEditPolicy } from \"./edit-policy\";\n\n/** Only data options cross the boundary; state-dependent cell policies are attached by the bridge. */\nexport function projectReactColumn<TData>(column: React.CominsTableRuntimeColumn<TData>): Core.CominsTableRuntimeColumn<TData> {\n const sort = column.sort;\n const filter = column.filter;\n return {\n id: column.id, field: column.field,\n label: typeof column.label === \"string\" ? column.label : column.id,\n hidden: column.hidden, lockPosition: column.lockPosition,\n minWidth: column.minWidth, maxWidth: column.maxWidth, width: column.width, pinned: column.pinned,\n sort: typeof sort === \"function\" ? (left, right, leftRow, rightRow) => sort.call(column, left, right, leftRow, rightRow) : sort,\n filter: filter && { kind: filter.kind, caseSensitive: filter.caseSensitive, getOptionLabel: filter.getOptionLabel, getValue: filter.getValue\n ? params => filter.getValue!({ ...params, column }) : undefined },\n };\n}\n\nexport function projectReactGroup(group: React.CominsTableRuntimeColumnGroup): Core.CominsTableRuntimeColumnGroup {\n return { id: group.id, children: group.children, hidden: group.hidden, lockPosition: group.lockPosition,\n pinned: group.pinned, label: typeof group.label === \"string\" ? group.label : group.id };\n}\n\nexport type ReactStateBridge<TData> = {\n source: React.CominsTableState<TData>;\n core: Core.CominsTableState<TData>;\n restoreColumn: (column: Core.CominsTableRuntimeColumn<TData>) => React.CominsTableRuntimeColumn<TData>;\n restoreGroup: (group: Core.CominsTableRuntimeColumnGroup) => React.CominsTableRuntimeColumnGroup;\n};\n\nexport function projectReactState<TData>(source: React.CominsTableState<TData>): ReactStateBridge<TData> {\n const columnSources = new Map<Core.CominsTableRuntimeColumn<TData>, React.CominsTableRuntimeColumn<TData>>();\n const groupSources = new Map<Core.CominsTableRuntimeColumnGroup, React.CominsTableRuntimeColumnGroup>();\n const columns = source.columns.map(column => {\n const projected = projectReactColumn(column);\n if (column.cell) projected.cell = createReactEditPolicy(source, column);\n columnSources.set(projected, column);\n return projected;\n });\n const columnGroups = source.columnGroups.map(group => {\n const projected = projectReactGroup(group);\n groupSources.set(projected, group);\n return projected;\n });\n return {\n source,\n core: {\n columns, columnGroups, columnOrder: source.columnOrder,\n columnState: source.columnState, columnGroupState: source.columnGroupState,\n rows: source.rows, rowIds: source.rowIds, getRowId: source.getRowId,\n pagination: source.pagination, selection: source.selection, showHeader: source.showHeader,\n sort: source.sort, sortModel: source.sortModel,\n },\n restoreColumn(column) {\n const original = columnSources.get(column);\n if (!original) throw new Error(\"Cannot restore a column from a different React state bridge.\");\n return original;\n },\n restoreGroup(group) {\n const original = groupSources.get(group);\n if (!original) throw new Error(\"Cannot restore a group from a different React state bridge.\");\n return original;\n },\n };\n}\n\nexport function restoreReactState<TData>(bridge: ReactStateBridge<TData>, next: Core.CominsTableState<TData>): React.CominsTableState<TData> {\n if (next === bridge.core) return bridge.source;\n return {\n ...bridge.source, ...next,\n columns: next.columns === bridge.core.columns ? bridge.source.columns : next.columns.map(bridge.restoreColumn),\n columnGroups: next.columnGroups === bridge.core.columnGroups ? bridge.source.columnGroups : next.columnGroups.map(bridge.restoreGroup),\n };\n}\n","import type { CominsTableTheme, CominsTableRuntimeColumn } from \"../react-types\";\nexport type { CominsColumnPinned } from \"../column-pinning\";\n\nexport type {\n CominsRowId,\n CominsTableDensity,\n CominsSortDirection,\n CominsSortState,\n CominsSortModel,\n CominsComponentPrimitiveValue,\n CominsComponentAlign,\n CominsComponentDirection,\n CominsComponentPlacement,\n CominsComponentRowPayload,\n CominsColumnRuntimeState,\n CominsColumnGroupRuntimeState,\n CominsColumnLayout,\n CominsPaginationState,\n CominsSelectionState,\n CominsRowUpdate,\n CominsVirtualRowsOptions,\n CominsVirtualRows,\n CominsCopiedRow,\n CominsCopiedCell,\n CominsCopiedCellRangeCell,\n CominsCopiedCellRange,\n CominsExportFormat,\n CominsExportValueSource,\n CominsExportColumn,\n CominsExportRowsOptions,\n CominsCellAddress,\n CominsCellRange,\n CominsPasteRowOptions,\n CominsRowSelectionOptions,\n CominsCellSelectionOptions,\n CominsFillCellRangeOptions,\n} from \"../model\";\n\nexport type {\n CominsTableTheme,\n CominsCellFormatParams,\n CominsColumnValueResolver,\n CominsTableComponentOption,\n CominsVirtualListItem,\n CominsTableMenuItem,\n CominsComponentColumnPayload,\n CominsCellComponentPayload,\n CominsHeaderComponentPayload,\n CominsClipboardGuard,\n CominsColumnProps,\n CominsTableComponentProps,\n CominsTableOptions,\n CominsTableMenuItems,\n CominsVirtualListItems,\n CominsButtonComponentConfig,\n CominsInputCommitEvent,\n CominsInputComponentConfig,\n CominsCheckboxComponentConfig,\n CominsRadioComponentConfig,\n CominsSelectComponentConfig,\n CominsToggleComponentConfig,\n CominsProgressComponentConfig,\n CominsMenuComponentConfig,\n CominsVirtualListSearchFilterPayload,\n CominsVirtualListComponentConfig,\n CominsHeaderComponentConfig,\n CominsCellComponentConfig,\n CominsHeaderComponent,\n CominsCellComponent,\n CominsTableCellConfig,\n CominsTableHeaderConfig,\n CominsTableColumn,\n CominsTableColumnGroup,\n CominsTableRuntimeColumn,\n CominsTableRuntimeColumnGroup,\n CominsEventColumn,\n CominsTableState,\n CominsTableStateInput,\n CominsHeaderColumnCell,\n CominsHeaderGroupCell,\n CominsHeaderCell,\n} from \"../react-types\";\nexport { parseCominsClipboardText } from \"../clipboard-text\";\nimport type {\n CominsCopiedRow, CominsCopiedCell, CominsCopiedCellRange, CominsPasteRowOptions, CominsFillCellRangeOptions,\n} from \"../model\";\nimport * as cells from \"../core/editing/cells\";\nimport * as clipboard from \"../core/editing/clipboard\";\nimport { createCellComponentParams, resolveCellProps, resolveGuard } from \"./edit-policy\";\nimport type {\n CominsTableState,\n CominsTableStateInput,\n CominsHeaderCell,\n} from \"../react-types\";\nimport type {\n CominsRowId,\n CominsSortState,\n CominsSortModel,\n CominsColumnLayout,\n CominsPaginationState,\n CominsRowUpdate,\n CominsVirtualRowsOptions,\n CominsVirtualRows,\n CominsCellAddress,\n CominsCellRange,\n CominsRowSelectionOptions,\n CominsCellSelectionOptions,\n} from \"../core/model\";\nimport * as table from \"../core/state/table\";\nimport * as columns from \"../core/layout/columns\";\nimport * as selection from \"../core/selection/state\";\nimport {\n projectReactState,\n restoreReactState,\n projectReactColumn,\n projectReactGroup,\n} from \"./model\";\nexport type { CominsRowGroupMoveOptions } from \"../core/state/table\";\nimport type {\n CominsRowGroupMoveOptions,\n} from \"../core/state/table\";\n\nexport function setCominsColumnWidth<TData>(\n state: CominsTableState<TData>,\n columnId: string,\n width: number,\n) {\n const bridge = projectReactState(state);\n const next = columns.setCominsColumnWidth(bridge.core, columnId, width);\n return restoreReactState(bridge, next);\n}\n\nexport function setCominsColumnHidden<TData>(\n state: CominsTableState<TData>,\n columnId: string,\n hidden: boolean,\n) {\n const bridge = projectReactState(state);\n const next = columns.setCominsColumnHidden(bridge.core, columnId, hidden);\n return restoreReactState(bridge, next);\n}\n\nexport function setCominsColumnGroupHidden<TData>(\n state: CominsTableState<TData>,\n groupId: string,\n hidden: boolean,\n) {\n const bridge = projectReactState(state);\n const next = columns.setCominsColumnGroupHidden(bridge.core, groupId, hidden);\n return restoreReactState(bridge, next);\n}\n\nexport function setCominsColumnGroupWidth<TData>(\n state: CominsTableState<TData>,\n groupId: string,\n width: number,\n) {\n const bridge = projectReactState(state);\n const next = columns.setCominsColumnGroupWidth(bridge.core, groupId, width);\n return restoreReactState(bridge, next);\n}\n\nexport function moveCominsColumn<TData>(\n state: CominsTableState<TData>,\n columnId: string,\n targetIndex: number,\n) {\n const bridge = projectReactState(state);\n const next = columns.moveCominsColumn(bridge.core, columnId, targetIndex);\n return restoreReactState(bridge, next);\n}\n\nexport function moveCominsColumnGroup<TData>(\n state: CominsTableState<TData>,\n groupId: string,\n targetIndex: number,\n) {\n const bridge = projectReactState(state);\n const next = columns.moveCominsColumnGroup(bridge.core, groupId, targetIndex);\n return restoreReactState(bridge, next);\n}\n\nexport function serializeCominsColumnLayout<TData>(state: CominsTableState<TData>): CominsColumnLayout {\n const bridge = projectReactState(state);\n const next = columns.serializeCominsColumnLayout(bridge.core);\n return next;\n}\n\nexport function applyCominsColumnLayout<TData>(state: CominsTableState<TData>, layout: CominsColumnLayout) {\n const bridge = projectReactState(state);\n const next = columns.applyCominsColumnLayout(bridge.core, layout);\n return restoreReactState(bridge, next);\n}\n\nexport function selectRow<TData>(\n state: CominsTableState<TData>,\n rowId: CominsRowId,\n options: CominsRowSelectionOptions = {},\n) {\n const bridge = projectReactState(state);\n const next = selection.selectRow(bridge.core, rowId, options);\n return restoreReactState(bridge, next);\n}\n\nexport function selectRows<TData>(state: CominsTableState<TData>, rowIds: readonly CominsRowId[]) {\n const bridge = projectReactState(state);\n const next = selection.selectRows(bridge.core, rowIds);\n return restoreReactState(bridge, next);\n}\n\nexport function selectCell<TData>(\n state: CominsTableState<TData>,\n cell: CominsCellAddress,\n options: CominsCellSelectionOptions = {},\n) {\n const bridge = projectReactState(state);\n const next = selection.selectCell(bridge.core, cell, options);\n return { ...restoreReactState(bridge, next), selection: next.selection };\n}\n\nexport function selectCellRange<TData>(state: CominsTableState<TData>, range: CominsCellRange) {\n const bridge = projectReactState(state);\n const next = selection.selectCellRange(bridge.core, range);\n return { ...restoreReactState(bridge, next), selection: next.selection };\n}\n\nexport function clearCominsCellRange<TData>(state: CominsTableState<TData>) {\n const bridge = projectReactState(state);\n const next = selection.clearCominsCellRange(bridge.core);\n return { ...restoreReactState(bridge, next), selection: next.selection };\n}\n\nexport function clearCominsSelection<TData>(state: CominsTableState<TData>) {\n const bridge = projectReactState(state);\n const next = selection.clearCominsSelection(bridge.core);\n return restoreReactState(bridge, next);\n}\n\nexport function isCominsRowSelected<TData>(state: CominsTableState<TData>, rowId: CominsRowId) {\n return selection.isCominsRowSelected(state, rowId);\n}\n\nexport function isCominsCellSelected<TData>(state: CominsTableState<TData>, cell: CominsCellAddress) {\n return selection.isCominsCellSelected(state, cell);\n}\n\nexport function getCominsSelectedCellRange<TData>(\n state: CominsTableState<TData>,\n range: CominsCellRange | null = state.selection.range,\n rowIds: readonly CominsRowId[] = state.rowIds,\n) {\n const bridge = projectReactState(state);\n const next = selection.getCominsSelectedCellRange(bridge.core, range, rowIds);\n return next;\n}\n\nexport function isCominsCellInSelectedRange<TData>(\n state: CominsTableState<TData>,\n cell: CominsCellAddress,\n rowIds: readonly CominsRowId[] = state.rowIds,\n) {\n const bridge = projectReactState(state);\n const next = selection.isCominsCellInSelectedRange(bridge.core, cell, rowIds);\n return next;\n}\n\nexport function queryCominsRows<TData>(\n state: CominsTableState<TData>,\n predicate?: (row: TData, index: number) => boolean,\n) {\n return table.queryCominsRows(state, predicate);\n}\n\nexport function replaceCominsRows<TData>(state: CominsTableState<TData>, rows: readonly TData[]) {\n const bridge = projectReactState(state);\n const next = table.replaceCominsRows(bridge.core, rows);\n return restoreReactState(bridge, next);\n}\n\nexport function addCominsRows<TData>(state: CominsTableState<TData>, rows: readonly TData[]) {\n const bridge = projectReactState(state);\n const next = table.addCominsRows(bridge.core, rows);\n return restoreReactState(bridge, next);\n}\n\nexport function updateCominsRows<TData>(\n state: CominsTableState<TData>,\n updates: ReadonlyArray<CominsRowUpdate<TData>>,\n) {\n const bridge = projectReactState(state);\n const next = table.updateCominsRows(bridge.core, updates);\n return restoreReactState(bridge, next);\n}\n\nexport function deleteCominsRows<TData>(state: CominsTableState<TData>, rowIds: readonly CominsRowId[]) {\n const bridge = projectReactState(state);\n const next = table.deleteCominsRows(bridge.core, rowIds);\n return restoreReactState(bridge, next);\n}\n\nexport function setCominsHeaderVisible<TData>(state: CominsTableState<TData>, showHeader: boolean) {\n const bridge = projectReactState(state);\n const next = table.setCominsHeaderVisible(bridge.core, showHeader);\n return restoreReactState(bridge, next);\n}\n\nexport function setCominsPagination<TData>(\n state: CominsTableState<TData>,\n pagination: Partial<CominsPaginationState>,\n) {\n const bridge = projectReactState(state);\n const next = table.setCominsPagination(bridge.core, pagination);\n return restoreReactState(bridge, next);\n}\n\nexport function setCominsSortState<TData>(\n state: CominsTableState<TData>,\n sort: CominsSortState | null,\n) {\n const bridge = projectReactState(state);\n const next = table.setCominsSortState(bridge.core, sort);\n return restoreReactState(bridge, next);\n}\n\nexport function setCominsSortModel<TData>(\n state: CominsTableState<TData>,\n sortModel: CominsSortModel,\n) {\n const bridge = projectReactState(state);\n const next = table.setCominsSortModel(bridge.core, sortModel);\n return restoreReactState(bridge, next);\n}\n\nexport function clearCominsSortState<TData>(state: CominsTableState<TData>) {\n const bridge = projectReactState(state);\n const next = table.clearCominsSortState(bridge.core);\n return restoreReactState(bridge, next);\n}\n\nexport function getCominsSortedRowIndexes<TData>(\n state: CominsTableState<TData>,\n sourceIndexes: readonly number[] = state.rows.map((_row, index) => index),\n) {\n const bridge = projectReactState(state);\n const next = table.getCominsSortedRowIndexes(bridge.core, sourceIndexes);\n return next;\n}\n\nexport function sortCominsRows<TData>(\n state: CominsTableState<TData>,\n sort: CominsSortState | null,\n) {\n const bridge = projectReactState(state);\n const next = table.sortCominsRows(bridge.core, sort);\n return restoreReactState(bridge, next);\n}\n\nexport function getCominsPageRows<TData>(\n state: CominsTableState<TData>,\n pagination: Partial<CominsPaginationState> = {},\n) {\n const bridge = projectReactState(state);\n const next = table.getCominsPageRows(bridge.core, pagination);\n return next;\n}\n\nexport function getCominsVirtualRows<TData>(\n state: CominsTableState<TData>,\n { overscan = 2, rowHeight, scrollTop, viewportHeight }: CominsVirtualRowsOptions,\n): CominsVirtualRows<TData> {\n const bridge = projectReactState(state);\n const next = table.getCominsVirtualRows(bridge.core, { overscan, rowHeight, scrollTop, viewportHeight });\n return next;\n}\n\nexport function moveCominsRow<TData>(\n state: CominsTableState<TData>,\n rowId: CominsRowId,\n targetIndex: number,\n) {\n const bridge = projectReactState(state);\n const next = table.moveCominsRow(bridge.core, rowId, targetIndex);\n return restoreReactState(bridge, next);\n}\n\nexport function moveCominsRowToGroup<TData>(\n state: CominsTableState<TData>,\n options: CominsRowGroupMoveOptions<TData>,\n) {\n const bridge = projectReactState(state);\n const next = table.moveCominsRowToGroup(bridge.core, options);\n return restoreReactState(bridge, next);\n}\n\nexport function getCominsCellValue<TData>(\n state: CominsTableState<TData>,\n row: TData,\n columnId: string,\n) {\n return table.getCominsCellValue(state, row, columnId);\n}\n\nexport function createCominsTableState<TData>(input: CominsTableStateInput<TData>): CominsTableState<TData> {\n const runtimeColumns = columns.normalizeColumns(input.columns);\n const runtimeGroups = columns.normalizeColumnGroups(runtimeColumns, input.columnGroups);\n const state = table.createCominsTableState({ ...input, columns: runtimeColumns.map(projectReactColumn), columnGroups: runtimeGroups.map(projectReactGroup) });\n return { ...state, columns: runtimeColumns, columnGroups: runtimeGroups, theme: input.theme ?? {} };\n}\n\nexport function getCominsVisibleColumns<TData>(state: CominsTableState<TData>) {\n const bridge = projectReactState(state);\n return columns.getCominsVisibleColumns(bridge.core).map(bridge.restoreColumn);\n}\n\nexport function getCominsHeaderRows<TData>(state: CominsTableState<TData>): Array<Array<CominsHeaderCell<TData>>> {\n const bridge = projectReactState(state);\n return columns.getCominsHeaderRows(bridge.core).map(row => row.map(cell => cell.kind === \"column\"\n ? { ...cell, column: bridge.restoreColumn(cell.column) }\n : { ...cell, group: bridge.restoreGroup(cell.group) }));\n}\n\nexport function setCominsTableTheme<TData>(state: CominsTableState<TData>, theme: CominsTableTheme) {\n return {\n ...state,\n theme: { ...state.theme, ...theme },\n };\n}\n\nexport function formatCominsCellValue<TData>(\n state: CominsTableState<TData>,\n row: TData,\n rowId: CominsRowId,\n column: CominsTableRuntimeColumn<TData>,\n) {\n const value = getCominsCellValue(state, row, column.id);\n\n if (column.cell?.format) {\n return column.cell.format(createCellComponentParams(state, row, rowId, column));\n }\n\n return value == null ? \"\" : String(value);\n}\n\nexport function isCominsCellDisabled<TData>(\n state: CominsTableState<TData>,\n row: TData,\n rowId: CominsRowId,\n column: CominsTableRuntimeColumn<TData>,\n) {\n const props = resolveCellProps(state, row, rowId, column);\n\n return props?.disabled !== undefined && resolveGuard(props.disabled, createCellComponentParams(state, row, rowId, column)) === true;\n}\n\nexport function getCominsCellClassName<TData>(\n state: CominsTableState<TData>,\n row: TData,\n rowId: CominsRowId,\n column: CominsTableRuntimeColumn<TData>,\n) {\n const params = createCellComponentParams(state, row, rowId, column);\n const className = resolveCellProps(state, row, rowId, column)?.className;\n\n return typeof className === \"function\" ? className(params) : className;\n}\n\nexport function getCominsCellStyle<TData>(\n state: CominsTableState<TData>,\n row: TData,\n rowId: CominsRowId,\n column: CominsTableRuntimeColumn<TData>,\n) {\n const params = createCellComponentParams(state, row, rowId, column);\n const style = resolveCellProps(state, row, rowId, column)?.style;\n\n return typeof style === \"function\" ? style(params) : style;\n}\n\nexport function copyCominsRow<TData>(state: CominsTableState<TData>, rowId: CominsRowId): CominsCopiedRow<TData> {\n const bridge = projectReactState(state);\n return clipboard.copyCominsRow(bridge.core, rowId);\n}\n\nexport function pasteCominsRow<TData>(\n state: CominsTableState<TData>,\n copied: CominsCopiedRow<TData>,\n options: CominsPasteRowOptions<TData>,\n) {\n const bridge = projectReactState(state);\n const next = clipboard.pasteCominsRow(bridge.core, copied, options);\n return restoreReactState(bridge, next);\n}\n\nexport function copyCominsCell<TData>(\n state: CominsTableState<TData>,\n { columnId, rowId }: CominsCellAddress,\n): CominsCopiedCell | null {\n const bridge = projectReactState(state);\n return cells.copyCominsCell(bridge.core, { columnId, rowId });\n}\n\nexport function pasteCominsCell<TData>(\n state: CominsTableState<TData>,\n { columnId, rowId }: CominsCellAddress,\n copied: CominsCopiedCell | null,\n) {\n const bridge = projectReactState(state);\n const next = cells.pasteCominsCell(bridge.core, { columnId, rowId }, copied);\n return restoreReactState(bridge, next);\n}\n\nexport function copyCominsCellRange<TData>(\n state: CominsTableState<TData>,\n range: CominsCellRange | null = state.selection.range,\n rowIds: readonly CominsRowId[] = state.rowIds,\n): CominsCopiedCellRange | null {\n const bridge = projectReactState(state);\n return clipboard.copyCominsCellRange(bridge.core, range, rowIds);\n}\n\nexport function pasteCominsCellRange<TData>(\n state: CominsTableState<TData>,\n target: CominsCellAddress,\n copied: CominsCopiedCellRange | null,\n rowIds: readonly CominsRowId[] = state.rowIds,\n) {\n const bridge = projectReactState(state);\n const next = clipboard.pasteCominsCellRange(bridge.core, target, copied, rowIds);\n return restoreReactState(bridge, next);\n}\n\nexport function pasteCominsText<TData>(\n state: CominsTableState<TData>,\n target: CominsCellAddress,\n text: string,\n rowIds: readonly CominsRowId[] = state.rowIds,\n) {\n const bridge = projectReactState(state);\n const next = clipboard.pasteCominsText(bridge.core, target, text, rowIds);\n return restoreReactState(bridge, next);\n}\n\nexport function fillCominsCellRange<TData>(\n state: CominsTableState<TData>,\n { source, target }: CominsFillCellRangeOptions,\n rowIds: readonly CominsRowId[] = state.rowIds,\n) {\n const bridge = projectReactState(state);\n const next = clipboard.fillCominsCellRange(bridge.core, { source, target }, rowIds);\n return restoreReactState(bridge, next);\n}\n"],"mappings":";;AAOA,SAAgBgG,EACd,GACA,GACA,GACA,GACA,IAAWC,EAAM,OAAO,QAAQC,CAAK,GACF;CACnC,OAAO;EACL,QAAQ;GACN,YAAYC;GACZ,OAAOA,EAAO;GACd,IAAIA,EAAO;GACX,OAAOF,EAAM,QAAQ,WAAW,MAAYG,EAAQ,OAAOD,EAAO,EAAE;GACpE,OAAOA,EAAO;EAChB;EACA,KAAK;GACH,MAAME;GACN,WAAWC;GACX,UAAU;GACV,IAAIJ;GACJ,OAAOI;GACP,UAAUL,EAAM,UAAU,OAAO,SAASC,CAAK;EACjD;EACA,WAAW,EACT,kBAAkBD,EAAM,UAAU,OA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C9B,IAAMmC,IAASR,EAAkB3B,CAAK;CACtC,OAAOpD,EAA8BuF,EAAO,MAAMsB,GAAOJ,CAAM;AACjE;AAEA,SAAgB0D,GACd,GACA,GACA,GACA,IAAiC/G,EAAM,QACvC;CACA,IAAMmC,IAASR,EAAkB3B,CAAK;CAEtC,OAAOiC,EAAkBE,GADZtF,EAA+BsF,EAAO,MAAM6E,GAAQL,GAAQtD,CACxC,CAAI;AACvC;AAEA,SAAgB4D,GACd,GACA,GACA,GACA,IAAiCjH,EAAM,QACvC;CACA,IAAMmC,IAASR,EAAkB3B,CAAK;CAEtC,OAAOiC,EAAkBE,GADZrF,EAA0BqF,EAAO,MAAM6E,GAAQE,GAAM7D,CACjC,CAAI;AACvC;AAEA,SAAgB8D,GACd,GACA,EAAE,WAAQ,aACV,IAAiCnH,EAAM,QACvC;CACA,IAAMmC,IAASR,EAAkB3B,CAAK;CAEtC,OAAOiC,EAAkBE,GADZpF,EAA8BoF,EAAO,MAAM;EAAE;EAAQ;CAAO,GAAGkB,CAC3C,CAAI;AACvC"}
|
package/dist/core.d.ts
CHANGED
|
@@ -4,7 +4,14 @@ export { clearCominsCellRange, clearCominsSelection, getCominsSelectedCellRange,
|
|
|
4
4
|
export { copyCominsCell, isCominsCellDisabled, pasteCominsCell, } from "./core/editing/cells";
|
|
5
5
|
export { copyCominsCellRange, copyCominsRow, fillCominsCellRange, pasteCominsCellRange, pasteCominsRow, pasteCominsText, } from "./core/editing/clipboard";
|
|
6
6
|
export { exportCominsRowsToCsv, exportCominsRowsToJson, } from "./core/editing/export";
|
|
7
|
+
export { importCominsRowsFromCsv } from "./core/editing/import";
|
|
8
|
+
export { createCominsTreeExportOptions, createCominsGroupedExportOptions } from "./core/editing/export-structure";
|
|
7
9
|
export { parseCominsClipboardText, } from "./clipboard-text";
|
|
8
|
-
export type { CominsCellAddress, CominsCellComponentPayload, CominsCellFormatParams, CominsCellRange, CominsCellSelectionOptions, CominsClipboardGuard, CominsColumnGroupRuntimeState, CominsColumnLayout, CominsColumnPinned, CominsColumnRuntimeState, CominsColumnValueResolver, CominsComponentAlign, CominsComponentColumnPayload, CominsComponentDirection, CominsComponentPlacement, CominsComponentPrimitiveValue, CominsComponentRowPayload, CominsCopiedCell, CominsCopiedCellRange, CominsCopiedCellRangeCell, CominsCopiedRow, CominsEventColumn, CominsExportColumn, CominsExportFormat, CominsExportRowsOptions, CominsExportValueSource, CominsFillCellRangeOptions, CominsHeaderCell, CominsHeaderColumnCell, CominsHeaderComponentPayload, CominsHeaderGroupCell, CominsPaginationState, CominsPasteRowOptions, CominsRowId, CominsRowSelectionOptions, CominsRowUpdate, CominsSelectionState, CominsSortDirection, CominsSortModel, CominsSortState, CominsTableColumn, CominsTableColumnGroup, CominsTableDensity, CominsTableRuntimeColumn, CominsTableRuntimeColumnGroup, CominsTableState, CominsTableStateInput, CominsVirtualRows, CominsVirtualRowsOptions, } from "./core/model";
|
|
10
|
+
export type { CominsCellAddress, CominsCellComponentPayload, CominsCellFormatParams, CominsCellRange, CominsCellSelectionOptions, CominsClipboardGuard, CominsCsvImportOptions, CominsCsvImportRow, CominsColumnGroupRuntimeState, CominsColumnLayout, CominsColumnPinned, CominsColumnRuntimeState, CominsColumnValueResolver, CominsComponentAlign, CominsComponentColumnPayload, CominsComponentDirection, CominsComponentPlacement, CominsComponentPrimitiveValue, CominsComponentRowPayload, CominsCopiedCell, CominsCopiedCellRange, CominsCopiedCellRangeCell, CominsCopiedRow, CominsEventColumn, CominsExportColumn, CominsExportFormat, CominsExportRowsOptions, CominsExportMetadata, CominsExportTreeOptions, CominsExportGroupedOptions, CominsExportValueSource, CominsFillCellRangeOptions, CominsHeaderCell, CominsHeaderColumnCell, CominsHeaderComponentPayload, CominsHeaderGroupCell, CominsPaginationState, CominsPasteRowOptions, CominsRowId, CominsRowSelectionOptions, CominsRowUpdate, CominsSelectionState, CominsSortDirection, CominsSortModel, CominsSortState, CominsTableColumn, CominsTableColumnGroup, CominsTableDensity, CominsTableRuntimeColumn, CominsTableRuntimeColumnGroup, CominsTableState, CominsTableStateInput, CominsVirtualRows, CominsVirtualRowsOptions, } from "./core/model";
|
|
9
11
|
export type { CominsRowGroupMoveOptions } from "./core/state/table";
|
|
12
|
+
export { normalizeCominsColumnFilterModel, getCominsFilteredRowIndexes, getCominsColumnFilterOperators } from "./core/rows/filtering";
|
|
13
|
+
export type { CominsColumnConditionFilterOperator, CominsColumnFilterOperator, CominsColumnConditionFilterRule, CominsColumnValueFilterRule, CominsColumnFilterRule, CominsColumnFilterModel, CominsColumnFilteringConfig, CominsColumnFilteringSourceRow, CominsNormalizedColumnFilterRule } from "./core/rows/filtering";
|
|
14
|
+
export type { CominsColumnFilterValue, CominsColumnFilterKind, CominsColumnFilterConfig } from "./core/model";
|
|
15
|
+
export { getCominsColumnFilterOptions, setCominsColumnFilterValues } from "./core/rows/values-filter";
|
|
16
|
+
export type { CominsColumnFilterOption, CominsColumnFilterOptionsResult, CominsColumnFilterValuesAction, CominsColumnFilterOptionsInput } from "./core/rows/values-filter";
|
|
10
17
|
//# sourceMappingURL=core.d.ts.map
|
package/dist/core.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,sBAAsB,EACtB,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,yBAAyB,EACzB,oBAAoB,EACpB,aAAa,EACb,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,sBAAsB,EACtB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,gBAAgB,GACjB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,uBAAuB,EACvB,gBAAgB,EAChB,qBAAqB,EACrB,2BAA2B,EAC3B,0BAA0B,EAC1B,yBAAyB,EACzB,qBAAqB,EACrB,oBAAoB,G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CAAC;AACtB,YAAY,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,sBAAsB,EACtB,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,yBAAyB,EACzB,oBAAoB,EACpB,aAAa,EACb,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,sBAAsB,EACtB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,gBAAgB,GACjB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,uBAAuB,EACvB,gBAAgB,EAChB,qBAAqB,EACrB,2BAA2B,EAC3B,0BAA0B,EAC1B,yBAAyB,EACzB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,0BAA0B,EAC1B,2BAA2B,EAC3B,oBAAoB,EACpB,mBAAmB,EACnB,UAAU,EACV,eAAe,EACf,SAAS,EACT,UAAU,GACX,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,eAAe,GAChB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,mBAAmB,EACnB,oBAAoB,EACpB,cAAc,EACd,eAAe,GAChB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,6BAA6B,EAAE,gCAAgC,EAAE,MAAM,iCAAiC,CAAC;AAElH,OAAO,EACL,wBAAwB,GACzB,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EACV,iBAAiB,EAC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tG,YAAY,EAAE,wBAAwB,EAAE,+BAA+B,EAAE,8BAA8B,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAC"}
|
package/dist/core.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { A as e, B as t, C as n, D as r, E as i, F as a, H as o, I as s, J as c, K as l, L as u, M as d, N as f, O as p, P as m, R as h, S as g, T as _, U as v, V as y, X as b, Y as x, _ as S, a as C, b as w, c as T, d as E, f as D, g as O, h as k, i as A, it as j, j as M, k as N, l as P, m as F, n as I, o as L, p as R, q as z, r as B, s as V, t as H, v as U, w as W, x as G, y as K, z as q } from "./clipboard-
|
|
2
|
-
import {
|
|
3
|
-
export { E as addCominsRows, q as applyCominsColumnLayout, N as clearCominsCellRange, e as clearCominsSelection, D as clearCominsSortState, V as copyCominsCell, H as copyCominsCellRange, I as copyCominsRow, R as createCominsTableState, F as deleteCominsRows,
|
|
1
|
+
import { A as e, B as t, C as n, D as r, E as i, F as a, H as o, I as s, J as c, K as l, L as u, M as d, N as f, O as p, P as m, R as h, S as g, T as _, U as v, V as y, X as b, Y as x, _ as S, a as C, b as w, c as T, d as E, f as D, g as O, h as k, i as A, it as j, j as M, k as N, l as P, m as F, n as I, o as L, p as R, q as z, r as B, s as V, t as H, v as U, w as W, x as G, y as K, z as q } from "./clipboard-B_gA5e12.js";
|
|
2
|
+
import { a as J, c as Y, d as X, i as Z, l as Q, o as $, r as ee, s as te, t as ne, u as re } from "./values-filter-pFAPWz1Q.js";
|
|
3
|
+
export { E as addCominsRows, q as applyCominsColumnLayout, N as clearCominsCellRange, e as clearCominsSelection, D as clearCominsSortState, V as copyCominsCell, H as copyCominsCellRange, I as copyCominsRow, te as createCominsGroupedExportOptions, R as createCominsTableState, Y as createCominsTreeExportOptions, F as deleteCominsRows, re as exportCominsRowsToCsv, X as exportCominsRowsToJson, B as fillCominsCellRange, k as getCominsCellValue, Z as getCominsColumnFilterOperators, ne as getCominsColumnFilterOptions, J as getCominsFilteredRowIndexes, t as getCominsHeaderRows, O as getCominsPageRows, M as getCominsSelectedCellRange, S as getCominsSortedRowIndexes, U as getCominsVirtualRows, y as getCominsVisibleColumns, Q as importCominsRowsFromCsv, T as isCominsCellDisabled, d as isCominsCellInSelectedRange, f as isCominsCellSelected, m as isCominsRowSelected, o as moveCominsColumn, v as moveCominsColumnGroup, K as moveCominsRow, w as moveCominsRowToGroup, $ as normalizeCominsColumnFilterModel, j as parseCominsClipboardText, P as pasteCominsCell, A as pasteCominsCellRange, C as pasteCominsRow, L as pasteCominsText, G as queryCominsRows, g as replaceCominsRows, a as selectCell, s as selectCellRange, u as selectRow, h as selectRows, l as serializeCominsColumnLayout, ee as setCominsColumnFilterValues, z as setCominsColumnGroupHidden, c as setCominsColumnGroupWidth, x as setCominsColumnHidden, b as setCominsColumnWidth, n as setCominsHeaderVisible, W as setCominsPagination, _ as setCominsSortModel, i as setCominsSortState, r as sortCominsRows, p as updateCominsRows };
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { a as e, c as t, o as n, t as r } from "./workbook-C7MXhUjt.js";
|
|
2
|
+
import { t as i } from "./zip-Oz81THHH.js";
|
|
3
|
+
import * as a from "xlsx";
|
|
4
|
+
//#region src/xlsx/engine.ts
|
|
5
|
+
var o = 864e5;
|
|
6
|
+
function s(t, n, r, i, s, c) {
|
|
7
|
+
let l = {
|
|
8
|
+
formula: t?.formula ?? !1,
|
|
9
|
+
cachePresent: t?.cachePresent ?? !1,
|
|
10
|
+
sheetName: r.name,
|
|
11
|
+
cellAddress: s,
|
|
12
|
+
rowNumber: c
|
|
13
|
+
};
|
|
14
|
+
if (t?.type === "e" || n?.t === "e") return {
|
|
15
|
+
...l,
|
|
16
|
+
kind: "error"
|
|
17
|
+
};
|
|
18
|
+
if (t && !l.formula && !t.cachePresent && !t.inlinePresent || l.formula && !l.cachePresent) return {
|
|
19
|
+
...l,
|
|
20
|
+
kind: "blank"
|
|
21
|
+
};
|
|
22
|
+
if (t?.type === "str" && t.cachePresent && t.value === "") return {
|
|
23
|
+
...l,
|
|
24
|
+
kind: "text",
|
|
25
|
+
value: ""
|
|
26
|
+
};
|
|
27
|
+
if (!n || n.t === "z") {
|
|
28
|
+
if (t?.cachePresent) throw new e("INVALID_WORKBOOK", l);
|
|
29
|
+
return {
|
|
30
|
+
...l,
|
|
31
|
+
kind: "blank"
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
if (n.t === "b") {
|
|
35
|
+
if (t?.value !== void 0 && ![
|
|
36
|
+
"0",
|
|
37
|
+
"1",
|
|
38
|
+
"true",
|
|
39
|
+
"false"
|
|
40
|
+
].includes(t.value.trim())) throw new e("INVALID_WORKBOOK", l);
|
|
41
|
+
return {
|
|
42
|
+
...l,
|
|
43
|
+
kind: "boolean",
|
|
44
|
+
value: t?.value === void 0 ? n.v === !0 : ["1", "true"].includes(t.value.trim())
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
if (n.t === "s") return {
|
|
48
|
+
...l,
|
|
49
|
+
kind: "text",
|
|
50
|
+
value: String(n.v ?? "")
|
|
51
|
+
};
|
|
52
|
+
if (n.t !== "n" || typeof n.v != "number") throw new e("UNSUPPORTED_VALUE", l);
|
|
53
|
+
let u = n.v, d = "General";
|
|
54
|
+
if (t?.type === "d") {
|
|
55
|
+
let n = /^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,3}))?(?:Z|[+-]\d{2}:\d{2})?)?$/.exec(t.value ?? "");
|
|
56
|
+
if (!n) throw new e("INVALID_WORKBOOK", l);
|
|
57
|
+
let i = [
|
|
58
|
+
Number(n[1]),
|
|
59
|
+
Number(n[2]),
|
|
60
|
+
Number(n[3]),
|
|
61
|
+
Number(n[4] ?? 0),
|
|
62
|
+
Number(n[5] ?? 0),
|
|
63
|
+
Number(n[6] ?? 0),
|
|
64
|
+
Number((n[7] ?? "").padEnd(3, "0"))
|
|
65
|
+
], a = Date.UTC(i[0], i[1] - 1, i[2], i[3], i[4], i[5], i[6]), s = new Date(a);
|
|
66
|
+
if (i[0] < 1900 || i[0] > 9999 || s.getUTCFullYear() !== i[0] || s.getUTCMonth() + 1 !== i[1] || s.getUTCDate() !== i[2] || i[3] > 23 || i[4] > 59 || i[5] > 59) throw new e("INVALID_WORKBOOK", l);
|
|
67
|
+
u = (a - (r.date1904 ? Date.UTC(1904, 0, 1) : Date.UTC(1899, 11, 30))) / o, !r.date1904 && a < Date.UTC(1900, 2, 1) && u--, d = n[4] ? `yyyy-mm-dd hh:mm:ss${n[7] ? ".000" : ""}` : "yyyy-mm-dd";
|
|
68
|
+
}
|
|
69
|
+
let f = t?.style !== void 0 && i[t.style] === 14 ? "yyyy-mm-dd" : !n.z || n.z === "General" ? d : n.z;
|
|
70
|
+
try {
|
|
71
|
+
if (a.SSF.is_date(f)) {
|
|
72
|
+
if (!Number.isFinite(u) || u < 0) throw new e("UNSUPPORTED_VALUE", l);
|
|
73
|
+
if (f === "yyyy-mm-dd hh:mm:ss.000") {
|
|
74
|
+
let t = Math.floor(u), n = Math.round((u - t) * o), i = a.SSF.parse_date_code(t + +(n === o), { date1904: r.date1904 });
|
|
75
|
+
if (!i || i.y > 9999) throw new e("UNSUPPORTED_VALUE", l);
|
|
76
|
+
let s = n % o, c = (e, t = 2) => String(e).padStart(t, "0"), d = `${c(i.y, 4)}-${c(i.m)}-${c(i.d)} ${c(Math.floor(s / 36e5))}:${c(Math.floor(s / 6e4) % 60)}:${c(Math.floor(s / 1e3) % 60)}.${c(s % 1e3, 3)}`;
|
|
77
|
+
return {
|
|
78
|
+
...l,
|
|
79
|
+
kind: "date",
|
|
80
|
+
dateText: d
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
let t = u, n = r.date1904;
|
|
84
|
+
if (!n && u > 2958465 && u < 2958466) {
|
|
85
|
+
if (/\[(?:[<>=]|[hms]+\])/i.test(String(f))) throw new e("UNSUPPORTED_VALUE", l);
|
|
86
|
+
t -= 1462, n = !0;
|
|
87
|
+
}
|
|
88
|
+
let i = a.SSF.parse_date_code(t, { date1904: n });
|
|
89
|
+
if (!i || i.y > 9999) throw new e("UNSUPPORTED_VALUE", l);
|
|
90
|
+
let s = a.SSF.format(f, t, { date1904: n });
|
|
91
|
+
if (typeof s != "string" || !s) throw new e("UNSUPPORTED_VALUE", l);
|
|
92
|
+
return {
|
|
93
|
+
...l,
|
|
94
|
+
kind: "date",
|
|
95
|
+
dateText: s
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
} catch {
|
|
99
|
+
throw new e("UNSUPPORTED_VALUE", l);
|
|
100
|
+
}
|
|
101
|
+
return {
|
|
102
|
+
...l,
|
|
103
|
+
kind: "number",
|
|
104
|
+
value: n.v
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
async function c(o, c, l) {
|
|
108
|
+
let u;
|
|
109
|
+
try {
|
|
110
|
+
if (u = a.read(await i(o), {
|
|
111
|
+
type: "array",
|
|
112
|
+
sheets: [c.name],
|
|
113
|
+
cellNF: !0,
|
|
114
|
+
cellDates: !1,
|
|
115
|
+
cellHTML: !1,
|
|
116
|
+
cellFormula: !1,
|
|
117
|
+
sheetStubs: !0
|
|
118
|
+
}).Sheets[c.name], !u) throw Error();
|
|
119
|
+
} catch {
|
|
120
|
+
throw new e("INVALID_WORKBOOK", { sheetName: c.name });
|
|
121
|
+
}
|
|
122
|
+
let d = c.formatIds, f = [];
|
|
123
|
+
try {
|
|
124
|
+
for (let e = 1; e <= c.rows; e++) {
|
|
125
|
+
let n = [];
|
|
126
|
+
for (let i = 1; i <= c.cols; i++) {
|
|
127
|
+
let a = r(e, i);
|
|
128
|
+
n.push(t(s(c.cells.get(a), u[a], c, d, a, e)));
|
|
129
|
+
}
|
|
130
|
+
f.push(n);
|
|
131
|
+
}
|
|
132
|
+
} catch (e) {
|
|
133
|
+
n(e);
|
|
134
|
+
}
|
|
135
|
+
let p = l && f.length ? f.shift().map((e) => e === null ? "" : String(e)) : null;
|
|
136
|
+
return f.map((e, t) => ({
|
|
137
|
+
cells: e,
|
|
138
|
+
headers: p,
|
|
139
|
+
rowIndex: t,
|
|
140
|
+
sheetRowNumber: t + (l ? 2 : 1)
|
|
141
|
+
}));
|
|
142
|
+
}
|
|
143
|
+
//#endregion
|
|
144
|
+
export { c as decodeCominsXlsxRows };
|
|
145
|
+
|
|
146
|
+
//# sourceMappingURL=engine-iWefk5Rv.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"engine-iWefk5Rv.js","names":["CominsXlsxError","normalizeCominsXlsxCell","rethrowXlsxDataError","cellAddress","encodeVerifiedXlsxContainer","XLSX","DAY","descriptor","base","meta","sheet","address","row","cell","number","fallback","match","fields","timestamp","date","format","formats","day","millis","parsed","time","pad","value","width","dateText","dateNumber","date1904","decodeCominsXlsxRows","container","metadata","values","cells","col","error","headers","hasHeader","v","rowIndex"],"sources":["../src/xlsx/engine.ts"],"sourcesContent":["import * as XLSX from \"xlsx\";\nimport type { CominsXlsxCellValue, CominsXlsxImportRow, XlsxCellDescriptor } from \"../core/editing/xlsx-model\";\nimport { normalizeCominsXlsxCell } from \"../core/editing/xlsx-data\";\nimport { CominsXlsxError, rethrowXlsxDataError } from \"./errors\";\nimport { cellAddress, type XlsxCellMetadata, type XlsxSheetMetadata } from \"./workbook\";\nimport { encodeVerifiedXlsxContainer, type VerifiedXlsxContainer } from \"./zip\";\nconst DAY = 86_400_000;\nfunction descriptor(meta: XlsxCellMetadata | undefined, cell: XLSX.CellObject | undefined, sheet: XlsxSheetMetadata, formats: readonly number[], address: string, row: number): XlsxCellDescriptor {\n const base = { formula: meta?.formula ?? false, cachePresent: meta?.cachePresent ?? false, sheetName: sheet.name, cellAddress: address, rowNumber: row };\n if (meta?.type === \"e\" || cell?.t === \"e\") return { ...base, kind: \"error\" };\n if (meta && !base.formula && !meta.cachePresent && !meta.inlinePresent) return { ...base, kind: \"blank\" };\n if (base.formula && !base.cachePresent) return { ...base, kind: \"blank\" };\n if (meta?.type === \"str\" && meta.cachePresent && meta.value === \"\") return { ...base, kind: \"text\", value: \"\" };\n if (!cell || cell.t === \"z\") {\n if (meta?.cachePresent) throw new CominsXlsxError(\"INVALID_WORKBOOK\", base);\n return { ...base, kind: \"blank\" };\n }\n if (cell.t === \"b\") {\n if (meta?.value !== undefined && ![\"0\", \"1\", \"true\", \"false\"].includes(meta.value.trim())) throw new CominsXlsxError(\"INVALID_WORKBOOK\", base);\n return { ...base, kind: \"boolean\", value: meta?.value !== undefined ? [\"1\", \"true\"].includes(meta.value.trim()) : cell.v === true };\n }\n if (cell.t === \"s\") return { ...base, kind: \"text\", value: String(cell.v ?? \"\") };\n if (cell.t !== \"n\" || typeof cell.v !== \"number\") throw new CominsXlsxError(\"UNSUPPORTED_VALUE\", base);\n let number = cell.v;\n let fallback = \"General\";\n if (meta?.type === \"d\") {\n const match = /^(\\d{4})-(\\d{2})-(\\d{2})(?:T(\\d{2}):(\\d{2}):(\\d{2})(?:\\.(\\d{1,3}))?(?:Z|[+-]\\d{2}:\\d{2})?)?$/.exec(meta.value ?? \"\");\n if (!match) throw new CominsXlsxError(\"INVALID_WORKBOOK\", base);\n const fields = [Number(match[1]), Number(match[2]), Number(match[3]), Number(match[4] ?? 0), Number(match[5] ?? 0), Number(match[6] ?? 0), Number((match[7] ?? \"\").padEnd(3,\"0\"))] as const;\n const timestamp = Date.UTC(fields[0], fields[1]-1, fields[2], fields[3], fields[4], fields[5], fields[6]);\n const date = new Date(timestamp);\n if (fields[0] < 1900 || fields[0] > 9999 || date.getUTCFullYear() !== fields[0] || date.getUTCMonth()+1 !== fields[1] || date.getUTCDate() !== fields[2] || fields[3] > 23 || fields[4] > 59 || fields[5] > 59) throw new CominsXlsxError(\"INVALID_WORKBOOK\", base);\n number = (timestamp - (sheet.date1904 ? Date.UTC(1904,0,1) : Date.UTC(1899,11,30))) / DAY;\n if (!sheet.date1904 && timestamp < Date.UTC(1900,2,1)) number--;\n fallback = match[4] ? `yyyy-mm-dd hh:mm:ss${match[7] ? \".000\" : \"\"}` : \"yyyy-mm-dd\";\n }\n const format = meta?.style !== undefined && formats[meta.style] === 14 ? \"yyyy-mm-dd\" : !cell.z || cell.z === \"General\" ? fallback : cell.z;\n try {\n if (XLSX.SSF.is_date(format)) {\n if (!Number.isFinite(number) || number < 0) throw new CominsXlsxError(\"UNSUPPORTED_VALUE\", base);\n if (format === \"yyyy-mm-dd hh:mm:ss.000\") {\n const day = Math.floor(number); const millis = Math.round((number-day) * DAY);\n const parsed = XLSX.SSF.parse_date_code(day + (millis === DAY ? 1 : 0), { date1904: sheet.date1904 });\n if (!parsed || parsed.y > 9999) throw new CominsXlsxError(\"UNSUPPORTED_VALUE\", base);\n const time = millis % DAY; const pad = (value: number, width = 2) => String(value).padStart(width,\"0\");\n // Preserve millisecond Date precision instead of SSF's 15-digit serial truncation.\n const dateText = `${pad(parsed.y,4)}-${pad(parsed.m)}-${pad(parsed.d)} ${pad(Math.floor(time/3600000))}:${pad(Math.floor(time/60000)%60)}:${pad(Math.floor(time/1000)%60)}.${pad(time%1000,3)}`;\n return { ...base, kind: \"date\", dateText };\n }\n let dateNumber = number; let date1904 = sheet.date1904;\n // SSF excludes time fractions on 9999-12-31 in the 1900 system.\n // Equivalent 1904 serials preserve calendar fields; conditions/elapsed values cannot be shifted.\n if (!date1904 && number > 2958465 && number < 2958466) {\n if (/\\[(?:[<>=]|[hms]+\\])/i.test(String(format))) throw new CominsXlsxError(\"UNSUPPORTED_VALUE\", base);\n dateNumber -= 1462; date1904 = true;\n }\n const parsed = XLSX.SSF.parse_date_code(dateNumber, { date1904 });\n if (!parsed || parsed.y > 9999) throw new CominsXlsxError(\"UNSUPPORTED_VALUE\", base);\n const dateText: unknown = XLSX.SSF.format(format, dateNumber, { date1904 });\n if (typeof dateText !== \"string\" || !dateText) throw new CominsXlsxError(\"UNSUPPORTED_VALUE\", base);\n return { ...base, kind: \"date\", dateText };\n }\n } catch { throw new CominsXlsxError(\"UNSUPPORTED_VALUE\", base); }\n return { ...base, kind: \"number\", value: cell.v };\n}\nexport async function decodeCominsXlsxRows(container: VerifiedXlsxContainer, metadata: XlsxSheetMetadata, hasHeader: boolean): Promise<CominsXlsxImportRow[]> {\n let sheet: XLSX.WorkSheet;\n try {\n const book = XLSX.read(await encodeVerifiedXlsxContainer(container), { type: \"array\", sheets: [metadata.name], cellNF: true, cellDates: false, cellHTML: false, cellFormula: false, sheetStubs: true });\n sheet = book.Sheets[metadata.name]!; if (!sheet) throw new Error();\n } catch { throw new CominsXlsxError(\"INVALID_WORKBOOK\", { sheetName: metadata.name }); }\n const formats = metadata.formatIds; const values: CominsXlsxCellValue[][] = [];\n try {\n for (let row = 1; row <= metadata.rows; row++) {\n const cells: CominsXlsxCellValue[] = [];\n for (let col = 1; col <= metadata.cols; col++) {\n const address = cellAddress(row, col);\n cells.push(normalizeCominsXlsxCell(descriptor(metadata.cells.get(address), sheet[address] as XLSX.CellObject | undefined, metadata, formats, address, row)));\n }\n values.push(cells);\n }\n } catch (error) { rethrowXlsxDataError(error); }\n const headers = hasHeader && values.length ? values.shift()!.map(v => v === null ? \"\" : String(v)) : null;\n return values.map((cells, rowIndex) => ({ cells, headers, rowIndex, sheetRowNumber: rowIndex + (hasHeader ? 2 : 1) }));\n}\n"],"mappings":";;;;AAMA,IAAMM,IAAM;AACZ,SAASC,EAAW,GAAoC,GAAmC,GAA0B,GAA4B,GAAiB,GAAiC;CACjM,IAAMC,IAAO;EAAE,SAASC,GAAM,WAAW;EAAO,cAAcA,GAAM,gBAAgB;EAAO,WAAWC,EAAM;EAAM,aAAaC;EAAS,WAAWC;CAAI;CACvJ,IAAIH,GAAM,SAAS,OAAOI,GAAM,MAAM,KAAK,OAAO;EAAE,GAAGL;EAAM,MAAM;CAAQ;CAE3E,IADIC,KAAQ,CAACD,EAAK,WAAW,CAACC,EAAK,gBAAgB,CAACA,EAAK,iBACrDD,EAAK,WAAW,CAACA,EAAK,cAAc,OAAO;EAAE,GAAGA;EAAM,MAAM;CAAQ;CACxE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sBmB,EAAqB,GAAkC,GAA6B,GAAoD;CAC5J,IAAItB;CACJ,IAAI;EAEmC,IAArC,IADaL,EAAK,KAAK,MAAMD,EAA4B6B,CAAS,GAAG;GAAE,MAAM;GAAS,QAAQ,CAACC,EAAS,IAAI;GAAG,QAAQ;GAAM,WAAW;GAAO,UAAU;GAAO,aAAa;GAAO,YAAY;EAAK,CAC7L,CAAA,CAAK,OAAOA,EAAS,OAAY,CAACxB,GAAO,MAAU,MAAM;CACnE,QAAQ;EAAE,MAAM,IAAIV,EAAgB,oBAAoB,EAAE,WAAWkC,EAAS,KAAK,CAAC;CAAG;CACvF,IAAMb,IAAUa,EAAS,WAAiBC,IAAkC,CAAC;CAC7E,IAAI;EACF,KAAK,IAAIvB,IAAM,GAAGA,KAAOsB,EAAS,MAAM,KAAO;GAC7C,IAAME,IAA+B,CAAC;GACtC,KAAK,IAAIC,IAAM,GAAGA,KAAOH,EAAS,MAAM,KAAO;IAC7C,IAAMvB,IAAUR,EAAYS,GAAKyB,CAAG;IACpC,EAAM,KAAKpC,EAAwBM,EAAW2B,EAAS,MAAM,IAAIvB,CAAO,GAAGD,EAAMC,IAAyCuB,GAAUb,GAASV,GAASC,CAAG,CAAC,CAAC;GAC7J;GACA,EAAO,KAAKwB,CAAK;EACnB;CACF,SAASE,GAAO;EAAE,EAAqBA,CAAK;CAAG;CAC/C,IAAMC,IAAUC,KAAaL,EAAO,SAASA,EAAO,MAAM,CAAC,CAAE,KAAI,MAAKM,MAAM,OAAO,KAAK,OAAOA,CAAC,CAAC,IAAI;CACrG,OAAON,EAAO,KAAK,GAAO,OAAc;EAAE;EAAO;EAAS;EAAU,gBAAgBO,KAAYF,IAAY,IAAI;CAAG,EAAE;AACvH"}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { a as e, t } from "./workbook-C7MXhUjt.js";
|
|
2
|
+
import { xmlEscape as n } from "@federicocarboni/saxe";
|
|
3
|
+
import r from "write-excel-file/universal";
|
|
4
|
+
import { findElement as i, getChildElements as a, getOpeningTagMarkup as o } from "write-excel-file/utility";
|
|
5
|
+
//#region src/xlsx/text.ts
|
|
6
|
+
function s(e) {
|
|
7
|
+
let t = e.replace(/_x[\da-f]{4}_/gi, (e) => `_x005F_${e.slice(1)}`).replace(/[\x00-\x08\x0b-\x1f\ufffe\uffff]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/g, (e) => `_x${e.charCodeAt(0).toString(16).padStart(4, "0").toUpperCase()}_`);
|
|
8
|
+
return n(t);
|
|
9
|
+
}
|
|
10
|
+
function c() {
|
|
11
|
+
let t = /* @__PURE__ */ new Map();
|
|
12
|
+
return {
|
|
13
|
+
token: (e, n) => (t.set(n, e), 0),
|
|
14
|
+
feature: { files: { transform: { "xl/worksheets/sheet{id}.xml": { transform(n) {
|
|
15
|
+
let r = i(n, "sheetData");
|
|
16
|
+
if (!r) throw new e("INVALID_WORKBOOK");
|
|
17
|
+
let c = [], l = 0, u = 0;
|
|
18
|
+
for (let i of a(n, r)) for (let r of a(n, i)) {
|
|
19
|
+
let i = String(r.openingTagAttributes.r);
|
|
20
|
+
if (r.tagName !== "c" || !t.has(i)) continue;
|
|
21
|
+
let a = r.selfClosingTag ? r.openingTagEndIndex : r.closingTagEndIndex;
|
|
22
|
+
if (a === void 0) throw new e("INVALID_WORKBOOK");
|
|
23
|
+
c.push(n.slice(l, r.openingTagStartIndex), o("c", {
|
|
24
|
+
...r.openingTagAttributes,
|
|
25
|
+
t: "inlineStr"
|
|
26
|
+
}), `<is><t xml:space="preserve">${s(t.get(i))}</t></is></c>`), l = a + 1, u++;
|
|
27
|
+
}
|
|
28
|
+
if (u !== t.size) throw new e("INVALID_WORKBOOK");
|
|
29
|
+
return c.push(n.slice(l)), c.join("");
|
|
30
|
+
} } } } }
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region src/xlsx/styles.ts
|
|
35
|
+
var l = () => {
|
|
36
|
+
throw new e("INVALID_OPTIONS");
|
|
37
|
+
};
|
|
38
|
+
function u(e) {
|
|
39
|
+
return !e || typeof e != "object" || Array.isArray(e) ? l() : e;
|
|
40
|
+
}
|
|
41
|
+
function d(e, t) {
|
|
42
|
+
Object.keys(e).some((e) => !t.includes(e)) && l();
|
|
43
|
+
}
|
|
44
|
+
function f(e, t) {
|
|
45
|
+
if (e !== void 0) return typeof e != "number" || !Number.isFinite(e) || e <= 0 || e > t ? l() : e;
|
|
46
|
+
}
|
|
47
|
+
var p = {
|
|
48
|
+
fontWeight: ["bold"],
|
|
49
|
+
fontStyle: ["italic"],
|
|
50
|
+
borderStyle: [
|
|
51
|
+
"thin",
|
|
52
|
+
"medium",
|
|
53
|
+
"thick"
|
|
54
|
+
],
|
|
55
|
+
align: [
|
|
56
|
+
"left",
|
|
57
|
+
"center",
|
|
58
|
+
"right"
|
|
59
|
+
],
|
|
60
|
+
alignVertical: [
|
|
61
|
+
"top",
|
|
62
|
+
"center",
|
|
63
|
+
"bottom"
|
|
64
|
+
]
|
|
65
|
+
};
|
|
66
|
+
function m(e) {
|
|
67
|
+
if (e === void 0) return {};
|
|
68
|
+
let t = u(e), n = {};
|
|
69
|
+
d(t, [
|
|
70
|
+
"fontFamily",
|
|
71
|
+
"fontSize",
|
|
72
|
+
"textColor",
|
|
73
|
+
"backgroundColor",
|
|
74
|
+
"borderColor",
|
|
75
|
+
"wrap",
|
|
76
|
+
"format",
|
|
77
|
+
...Object.keys(p)
|
|
78
|
+
]);
|
|
79
|
+
for (let [e, r] of Object.entries(t)) r !== void 0 && (e === "fontSize" ? f(r, 409) : e === "wrap" ? typeof r != "boolean" && l() : p[e] ? (typeof r != "string" || !p[e].includes(r)) && l() : e.endsWith("Color") ? (typeof r != "string" || !/^#[0-9a-f]{6}$/i.test(r)) && l() : (typeof r != "string" || !r || r.length > 255 || /[\x00-\x1f\ufffe\uffff]/u.test(r)) && l(), n[e] = r);
|
|
80
|
+
return n;
|
|
81
|
+
}
|
|
82
|
+
function h(e) {
|
|
83
|
+
let t = e.styles === void 0 ? {} : u(e.styles);
|
|
84
|
+
d(t, [
|
|
85
|
+
"theme",
|
|
86
|
+
"header",
|
|
87
|
+
"body",
|
|
88
|
+
"headerHeight",
|
|
89
|
+
"rowHeight",
|
|
90
|
+
"columns"
|
|
91
|
+
]), t.theme !== void 0 && t.theme !== "comins" && t.theme !== "plain" && l();
|
|
92
|
+
let n = f(t.headerHeight, 409), r = f(t.rowHeight, 409), i = t.theme === "plain" ? {} : {
|
|
93
|
+
fontFamily: "Arial",
|
|
94
|
+
fontSize: 11,
|
|
95
|
+
textColor: "#111827",
|
|
96
|
+
borderColor: "#E5E7EB",
|
|
97
|
+
borderStyle: "thin",
|
|
98
|
+
alignVertical: "center"
|
|
99
|
+
}, a = {
|
|
100
|
+
...i,
|
|
101
|
+
...t.theme === "plain" ? {} : {
|
|
102
|
+
backgroundColor: "#F3F4F6",
|
|
103
|
+
fontWeight: "bold"
|
|
104
|
+
},
|
|
105
|
+
...m(t.header)
|
|
106
|
+
}, o = {
|
|
107
|
+
...i,
|
|
108
|
+
...m(t.body)
|
|
109
|
+
}, s = /* @__PURE__ */ new Map();
|
|
110
|
+
if (t.columns !== void 0) for (let [e, n] of Object.entries(u(t.columns))) {
|
|
111
|
+
let t = u(n);
|
|
112
|
+
d(t, [
|
|
113
|
+
"width",
|
|
114
|
+
"header",
|
|
115
|
+
"body"
|
|
116
|
+
]), s.set(e, {
|
|
117
|
+
width: f(t.width, 255),
|
|
118
|
+
header: m(t.header),
|
|
119
|
+
body: m(t.body)
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
let c = new Map(e.columns.map((e) => [e.id, e]));
|
|
123
|
+
return {
|
|
124
|
+
headerHeight: n,
|
|
125
|
+
rowHeight: r,
|
|
126
|
+
columns: (e.columnOrder?.length ? e.columnOrder.flatMap((e) => {
|
|
127
|
+
let t = c.get(e);
|
|
128
|
+
return t ? [t] : [];
|
|
129
|
+
}) : e.columns).map((e) => {
|
|
130
|
+
let t = e.id === void 0 ? void 0 : s.get(e.id);
|
|
131
|
+
return {
|
|
132
|
+
width: t?.width,
|
|
133
|
+
header: {
|
|
134
|
+
...a,
|
|
135
|
+
...t?.header
|
|
136
|
+
},
|
|
137
|
+
body: {
|
|
138
|
+
...o,
|
|
139
|
+
...t?.body
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
})
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
//#endregion
|
|
146
|
+
//#region src/xlsx/export.ts
|
|
147
|
+
function g(e, t) {
|
|
148
|
+
if (e === null) return { type: Number };
|
|
149
|
+
if (typeof e != "object") return {
|
|
150
|
+
value: typeof e == "string" ? t(e) : e,
|
|
151
|
+
type: typeof e == "boolean" ? Boolean : Number
|
|
152
|
+
};
|
|
153
|
+
let [n, r, i, a, o, s, c] = e.utc, l = Date.UTC(n, r - 1, i, a, o, s, c), u = (l - Date.UTC(1899, 11, 30)) / 864e5;
|
|
154
|
+
return l < Date.UTC(1900, 2, 1) && u--, {
|
|
155
|
+
value: u,
|
|
156
|
+
type: Number,
|
|
157
|
+
format: "yyyy-mm-dd hh:mm:ss.000"
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
async function _(n, i, a) {
|
|
161
|
+
let o = h(a), s = c(), l = [n.headers.map((e, n) => ({
|
|
162
|
+
...g(e, (e) => s.token(e, t(1, n + 1))),
|
|
163
|
+
...o.columns[n].header,
|
|
164
|
+
height: o.headerHeight
|
|
165
|
+
})), ...n.rows.map((e, n) => e.map((e, r) => ({
|
|
166
|
+
...g(e, (e) => s.token(e, t(n + 2, r + 1))),
|
|
167
|
+
...o.columns[r].body,
|
|
168
|
+
...typeof e == "boolean" ? { format: void 0 } : {},
|
|
169
|
+
height: o.rowHeight
|
|
170
|
+
})))];
|
|
171
|
+
try {
|
|
172
|
+
let e = await r(l, {
|
|
173
|
+
sheet: i,
|
|
174
|
+
columns: o.columns.map((e) => ({ width: e.width }))
|
|
175
|
+
}, { features: [s.feature] }).toBlob();
|
|
176
|
+
return new Uint8Array(await e.arrayBuffer());
|
|
177
|
+
} catch {
|
|
178
|
+
throw new e("INVALID_WORKBOOK");
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
//#endregion
|
|
182
|
+
export { _ as encodeCominsXlsxRows };
|
|
183
|
+
|
|
184
|
+
//# sourceMappingURL=export-B_Q9_Whp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export-B_Q9_Whp.js","names":["CominsXlsxError","writeExcelFile","spreadsheetText","escaped","value","text","xmlEscape","createXlsxTextTable","values","address","sheetData","findElement","xml","parts","offset","written","row","getChildElements","cell","end","getOpeningTagMarkup","invalid","object","keys","allowed","key","size","max","enums","cellStyle","source","result","entry","resolveXlsxStyles","input","options","headerHeight","rowHeight","base","header","body","perColumn","id","column","byId","override","exportCell","token","year","month","day","hours","minutes","seconds","ms","timestamp","serial","encodeCominsXlsxRows","styles","data","prepared","cellAddress","index","rowIndex","blob","name"],"sources":["../src/xlsx/text.ts","../src/xlsx/styles.ts","../src/xlsx/export.ts"],"sourcesContent":["import { xmlEscape } from \"@federicocarboni/saxe\";\nimport type { Feature } from \"write-excel-file/universal\";\nimport { findElement, getChildElements, getOpeningTagMarkup } from \"write-excel-file/utility\";\nimport { CominsXlsxError } from \"./errors\";\n/** OOXML escapes preserve code units that XML itself cannot represent. */\nfunction spreadsheetText(value: string): string {\n const escaped = value.replace(/_x[\\da-f]{4}_/gi, text => `_x005F_${text.slice(1)}`)\n .replace(/[\\x00-\\x08\\x0b-\\x1f\\ufffe\\uffff]|[\\ud800-\\udbff](?![\\udc00-\\udfff])|(?<![\\ud800-\\udbff])[\\udc00-\\udfff]/g,\n text => `_x${text.charCodeAt(0).toString(16).padStart(4,\"0\").toUpperCase()}_`);\n return xmlEscape(escaped);\n}\n/** Literal text bypasses the writer's empty-string coercion and object-key lookup. */\nexport function createXlsxTextTable() {\n const values = new Map<string, string>();\n const token = (text: string, address: string) => { values.set(address, text); return 0; };\n const feature: Feature<Blob> = { files: { transform: { \"xl/worksheets/sheet{id}.xml\": {\n transform(xml) {\n const sheetData = findElement(xml, \"sheetData\");\n if (!sheetData) throw new CominsXlsxError(\"INVALID_WORKBOOK\");\n const parts: string[] = []; let offset = 0; let written = 0;\n for (const row of getChildElements(xml, sheetData)) for (const cell of getChildElements(xml, row)) {\n const address = String(cell.openingTagAttributes.r);\n if (cell.tagName !== \"c\" || !values.has(address)) continue;\n const end = cell.selfClosingTag ? cell.openingTagEndIndex : cell.closingTagEndIndex;\n if (end === undefined) throw new CominsXlsxError(\"INVALID_WORKBOOK\");\n parts.push(xml.slice(offset, cell.openingTagStartIndex),\n getOpeningTagMarkup(\"c\", { ...cell.openingTagAttributes, t: \"inlineStr\" }),\n `<is><t xml:space=\"preserve\">${spreadsheetText(values.get(address)!)}</t></is></c>`);\n // The public XML utility reports inclusive end indexes.\n offset = end + 1; written++;\n }\n if (written !== values.size) throw new CominsXlsxError(\"INVALID_WORKBOOK\");\n parts.push(xml.slice(offset)); return parts.join(\"\");\n },\n } } } };\n return { token, feature };\n}\n","import type { CominsXlsxCellStyle, CominsXlsxExportOptions } from \"../core/editing/xlsx-model\";\nimport { CominsXlsxError } from \"./errors\";\nconst invalid = (): never => { throw new CominsXlsxError(\"INVALID_OPTIONS\"); };\nfunction object(value: unknown): Record<string, unknown> {\n if (!value || typeof value !== \"object\" || Array.isArray(value)) return invalid();\n return value as Record<string, unknown>;\n}\nfunction keys(value: Record<string, unknown>, allowed: readonly string[]): void {\n if (Object.keys(value).some(key => !allowed.includes(key))) invalid();\n}\nfunction size(value: unknown, max: number): number | undefined {\n if (value === undefined) return undefined;\n if (typeof value !== \"number\" || !Number.isFinite(value) || value <= 0 || value > max) return invalid();\n return value;\n}\nconst enums: Record<string, readonly string[]> = { fontWeight: [\"bold\"], fontStyle: [\"italic\"], borderStyle: [\"thin\", \"medium\", \"thick\"], align: [\"left\", \"center\", \"right\"], alignVertical: [\"top\", \"center\", \"bottom\"] };\nfunction cellStyle(value: unknown): CominsXlsxCellStyle {\n if (value === undefined) return {};\n const source = object(value); const result: Record<string, unknown> = {};\n keys(source, [\"fontFamily\", \"fontSize\", \"textColor\", \"backgroundColor\", \"borderColor\", \"wrap\", \"format\", ...Object.keys(enums)]);\n for (const [key, entry] of Object.entries(source)) {\n if (entry === undefined) continue;\n if (key === \"fontSize\") size(entry, 409);\n else if (key === \"wrap\") { if (typeof entry !== \"boolean\") invalid(); }\n else if (enums[key]) { if (typeof entry !== \"string\" || !enums[key]!.includes(entry)) invalid(); }\n else if (key.endsWith(\"Color\")) { if (typeof entry !== \"string\" || !/^#[0-9a-f]{6}$/i.test(entry)) invalid(); }\n else if (typeof entry !== \"string\" || !entry || entry.length > 255 || /[\\x00-\\x1f\\ufffe\\uffff]/u.test(entry)) invalid();\n result[key] = entry;\n }\n return result as CominsXlsxCellStyle;\n}\nexport function resolveXlsxStyles<TData>(options: CominsXlsxExportOptions<TData>) {\n const input = options.styles === undefined ? {} : object(options.styles);\n keys(input, [\"theme\", \"header\", \"body\", \"headerHeight\", \"rowHeight\", \"columns\"]);\n if (input.theme !== undefined && input.theme !== \"comins\" && input.theme !== \"plain\") invalid();\n const headerHeight = size(input.headerHeight, 409); const rowHeight = size(input.rowHeight, 409);\n const base: CominsXlsxCellStyle = input.theme === \"plain\" ? {} : { fontFamily: \"Arial\", fontSize: 11, textColor: \"#111827\", borderColor: \"#E5E7EB\", borderStyle: \"thin\", alignVertical: \"center\" };\n const header = { ...base, ...(input.theme === \"plain\" ? {} : { backgroundColor: \"#F3F4F6\", fontWeight: \"bold\" as const }), ...cellStyle(input.header) };\n const body = { ...base, ...cellStyle(input.body) };\n const perColumn = new Map<string, { width?: number; header: CominsXlsxCellStyle; body: CominsXlsxCellStyle }>();\n if (input.columns !== undefined) for (const [id, value] of Object.entries(object(input.columns))) {\n const column = object(value); keys(column, [\"width\", \"header\", \"body\"]);\n perColumn.set(id, { width: size(column.width, 255), header: cellStyle(column.header), body: cellStyle(column.body) });\n }\n const byId = new Map(options.columns.map(column => [column.id, column]));\n const chosen = options.columnOrder?.length ? options.columnOrder.flatMap(id => { const column = byId.get(id); return column ? [column] : []; }) : options.columns;\n return { headerHeight, rowHeight, columns: chosen.map(column => {\n const override = column.id === undefined ? undefined : perColumn.get(column.id);\n return { width: override?.width, header: { ...header, ...override?.header }, body: { ...body, ...override?.body } };\n }) };\n}\n","import writeExcelFile from \"write-excel-file/universal\";\nimport type { Cell, CellObject } from \"write-excel-file/universal\";\nimport type { CominsXlsxExportOptions, PreparedXlsxSheet, PreparedXlsxValue } from \"../core/editing/xlsx-model\";\nimport { CominsXlsxError } from \"./errors\";\nimport { cellAddress } from \"./workbook\";\nimport { createXlsxTextTable } from \"./text\";\nimport { resolveXlsxStyles } from \"./styles\";\nfunction exportCell(value: PreparedXlsxValue, token: (text: string) => number): CellObject {\n if (value === null) return { type: Number };\n if (typeof value !== \"object\") return { value: typeof value === \"string\" ? token(value) : value, type: typeof value === \"boolean\" ? Boolean : Number };\n const [year, month, day, hours, minutes, seconds, ms] = value.utc;\n const timestamp = Date.UTC(year, month-1, day, hours, minutes, seconds, ms);\n let serial = (timestamp - Date.UTC(1899, 11, 30)) / 86_400_000;\n if (timestamp < Date.UTC(1900, 2, 1)) serial--;\n return { value: serial, type: Number, format: \"yyyy-mm-dd hh:mm:ss.000\" };\n}\nexport async function encodeCominsXlsxRows<TData>(prepared: PreparedXlsxSheet, name: string, options: CominsXlsxExportOptions<TData>): Promise<Uint8Array> {\n const styles = resolveXlsxStyles(options);\n const text = createXlsxTextTable();\n const data: Cell[][] = [prepared.headers.map((value, index) => ({ ...exportCell(value, value => text.token(value, cellAddress(1, index+1))), ...styles.columns[index]!.header, height: styles.headerHeight })),\n ...prepared.rows.map((row, rowIndex) => row.map((value, index) => ({ ...exportCell(value, value => text.token(value, cellAddress(rowIndex+2, index+1))), ...styles.columns[index]!.body, ...(typeof value === \"boolean\" ? { format: undefined } : {}), height: styles.rowHeight })))];\n try {\n const blob = await writeExcelFile(data, { sheet: name, columns: styles.columns.map(column => ({ width: column.width })) }, { features: [text.feature] }).toBlob();\n return new Uint8Array(await blob.arrayBuffer());\n } catch { throw new CominsXlsxError(\"INVALID_WORKBOOK\"); }\n}\n"],"mappings":";;;;;AAKA,SAASE,EAAgB,GAAuB;CAC9C,IAAMC,IAAUC,EAAM,QAAQ,oBAAmB,MAAQ,UAAUC,EAAK,MAAM,CAAC,GAAG,CAAC,CAChF,QAAQ,6GACP,MAAQ,KAAKA,EAAK,WAAW,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,SAAS,GAAE,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE;CACjF,OAAOC,EAAUH,CAAO;AAC1B;AAEA,SAAgBI,IAAsB;CACpC,IAAMC,oBAAS,IAAI,IAAoB;CAsBvC,OAAO;EAAE,QArBM,GAAc,OAAsBA,EAAO,IAAIC,GAASJ,CAAI,GAAU;EAqBrE,SAAA,EApBiB,OAAO,EAAE,WAAW,EAAE,+BAA+B,EACpF,UAAU,GAAK;GACb,IAAMK,IAAYC,EAAYC,GAAK,WAAW;GAC9C,IAAI,CAACF,GAAW,MAAM,IAAIV,EAAgB,kBAAkB;GAC5D,IAAMa,IAAkB,CAAC,GAAOC,IAAS,GAAOC,IAAU;GAC1D,KAAK,IAAMC,KAAOC,EAAiBL,GAAKF,CAAS,GAAG,KAAK,IAAMQ,KAAQD,EAAiBL,GAAKI,CAAG,GAAG;IACjG,IAAMP,IAAU,OAAOS,EAAK,qBAAqB,CAAC;IAClD,IAAIA,EAAK,YAAY,OAAO,CAACV,EAAO,IAAIC,CAAO,GAAG;IAClD,IAAMU,IAAMD,EAAK,iBAAiBA,EAAK,qBAAqBA,EAAK;IACjE,IAAIC,MAAQ,KAAA,GAAW,MAAM,IAAInB,EAAgB,kBAAkB;IAKjD,AAJlBa,EAAM,KAAKD,EAAI,MAAME,GAAQI,EAAK,oBAAoB,GACpDE,EAAoB,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