@inandu-solutions/grid-react 0.1.1 → 0.1.3
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/README.md +58 -36
- package/package.json +5 -2
- package/dist/components/InanduGrid.d.ts +0 -97
- package/dist/core/aggregate.d.ts +0 -5
- package/dist/core/columns.d.ts +0 -11
- package/dist/core/constants.d.ts +0 -14
- package/dist/core/export/csv.d.ts +0 -2
- package/dist/core/export/download.d.ts +0 -2
- package/dist/core/export/markup.d.ts +0 -2
- package/dist/core/export/pdf.d.ts +0 -3
- package/dist/core/filter.d.ts +0 -26
- package/dist/core/format.d.ts +0 -24
- package/dist/core/i18n/en.d.ts +0 -46
- package/dist/core/i18n/es.d.ts +0 -46
- package/dist/core/i18n/fr.d.ts +0 -46
- package/dist/core/i18n/index.d.ts +0 -8
- package/dist/core/i18n/it.d.ts +0 -46
- package/dist/core/i18n/zh.d.ts +0 -46
- package/dist/core/index.d.ts +0 -16
- package/dist/core/parse.d.ts +0 -14
- package/dist/core/sort.d.ts +0 -1
- package/dist/core/tree.d.ts +0 -28
- package/dist/core/types.d.ts +0 -46
- package/dist/hooks/useInanduGrid.d.ts +0 -195
- package/dist/html2canvas-BE2ZQbtv.js +0 -4021
- package/dist/html2canvas-o9-HsXBE.cjs +0 -5
- package/dist/inandu-grid-react.cjs +0 -2
- package/dist/inandu-grid-react.js +0 -1676
- package/dist/index.d.ts +0 -11
- package/dist/index.es-BqzICVsf.cjs +0 -5
- package/dist/index.es-CPZG9pTc.js +0 -5752
- package/dist/jspdf.es.min-D_8zJvYC.cjs +0 -78
- package/dist/jspdf.es.min-DiTFVZBc.js +0 -18250
- package/dist/purify.es-3_UFdOhH.js +0 -805
- package/dist/purify.es-DXMFKXT6.cjs +0 -3
- package/dist/utils/exporters.d.ts +0 -29
- package/dist/utils/measureColumn.d.ts +0 -15
- package/dist/utils/translate.d.ts +0 -10
package/README.md
CHANGED
|
@@ -9,23 +9,56 @@ CSV/Excel/PDF export and i18n, with a deliberately small dependency footprint.
|
|
|
9
9
|
[](https://bundlephobia.com/package/@inandu-solutions/grid-react)
|
|
10
10
|
[](LICENSE)
|
|
11
11
|

|
|
12
|
+
[](https://inandusolutions.github.io/inandu-grid-react/)
|
|
12
13
|
[](https://stackblitz.com/github/inandusolutions/inandu-grid-react/tree/main/examples/stackblitz)
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
[](https://inandusolutions.github.io/inandu-grid-react/)
|
|
16
|
+
|
|
17
|
+
<sub>Live free-text search on the demo grid. [Try every feature →](https://inandusolutions.github.io/inandu-grid-react/)</sub>
|
|
18
|
+
|
|
19
|
+
## Quick links
|
|
20
|
+
|
|
21
|
+
- **▶️ Live demo:** <https://inandusolutions.github.io/inandu-grid-react/> — try every feature in the browser.
|
|
22
|
+
- **⚡ StackBlitz:** [a minimal editable example](https://stackblitz.com/github/inandusolutions/inandu-grid-react/tree/main/examples/stackblitz) —
|
|
23
|
+
installs `@inandu-solutions/grid-react` from npm; edit `src/App.tsx` and it updates live ([source](examples/stackblitz)).
|
|
24
|
+
- **Package:** [`@inandu-solutions/grid-react`](https://www.npmjs.com/package/@inandu-solutions/grid-react)
|
|
25
|
+
(MIT) — `0.x` while the API settles; expect breaking changes between minors until `1.0.0`.
|
|
26
|
+
- **Angular version:** [`inandu-grid`](https://github.com/inandusolutions/inandu-grid) — the
|
|
27
|
+
original, feature-complete, MIT-licensed grid this repo is ported from.
|
|
28
|
+
- **Commercial add-ons:** `@inandu-solutions/grid-pro-react` *(private, paid, not released yet)* —
|
|
29
|
+
the React port of `@inandu-solutions/grid-pro`, depends on this package the same way grid-pro
|
|
30
|
+
depends on grid-angular.
|
|
31
|
+
|
|
32
|
+
## See it
|
|
33
|
+
|
|
34
|
+
Grouping and live free-text search — running in the [demo](https://inandusolutions.github.io/inandu-grid-react/),
|
|
35
|
+
which also has tabs for inline editing and tree data.
|
|
36
|
+
|
|
37
|
+
[](https://inandusolutions.github.io/inandu-grid-react/)
|
|
38
|
+
|
|
39
|
+
## Features
|
|
40
|
+
|
|
41
|
+
**Feature-complete with grid-angular.** The framework-agnostic core (sorting, filtering,
|
|
42
|
+
aggregation, export, i18n) is ported from grid-angular's
|
|
17
43
|
[`core/`](https://github.com/inandusolutions/inandu-grid/tree/main/projects/inandu-grid/src/lib/core)
|
|
18
|
-
folder and kept in sync by hand across the two repos. The React-specific layer — the
|
|
19
|
-
component and the `useInanduGrid()` headless hook —
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
44
|
+
folder and kept in sync by hand across the two repos. The React-specific layer — the
|
|
45
|
+
[`<InanduGrid>`](#api-shape) component and the [`useInanduGrid()`](#api-shape) headless hook —
|
|
46
|
+
covers:
|
|
47
|
+
|
|
48
|
+
- Sorting — single-column, or multi-column via shift-click
|
|
49
|
+
- Free-text search and per-column filtering, plus an `extraRowFilter` escape hatch for your own predicates
|
|
50
|
+
- Pagination, single-column grouping with aggregates, row selection
|
|
51
|
+
- CSV / Excel (`.xls`) / PDF export, and print
|
|
52
|
+
- i18n — 5 built-in languages via a `lang` prop
|
|
53
|
+
- Inline row editing, creation and deletion, with validation (required / min / max / pattern / custom / async)
|
|
54
|
+
- Excel-style Ctrl+C / Ctrl+V clipboard copy/paste
|
|
55
|
+
- Runtime column show/hide, sticky (pinned left/right) columns, drag-reorder
|
|
56
|
+
- Column resize (drag a header's handle) and autosize (double-click it to fit content)
|
|
57
|
+
- Row drag-reorder
|
|
58
|
+
- Tree data (`treeChildrenKey`) — display and expand only, no inline editing/drag/clipboard on tree
|
|
59
|
+
rows, same restriction as grid-angular
|
|
60
|
+
- Master-detail (`renderDetail`)
|
|
61
|
+
- Row virtualization (`virtualScroll`) for large datasets
|
|
29
62
|
|
|
30
63
|
Two things work slightly differently from grid-angular because they need a real browser layout
|
|
31
64
|
engine that a unit-test environment can't provide: virtual scroll's row height isn't
|
|
@@ -34,40 +67,29 @@ trusted (ported verbatim, same DOM APIs) rather than end-to-end tested; see
|
|
|
34
67
|
[`measureColumn.ts`](src/utils/measureColumn.ts)'s doc comment for exactly what its test suite does
|
|
35
68
|
and doesn't cover.
|
|
36
69
|
|
|
37
|
-
- **Angular version:** [`inandu-grid`](https://github.com/inandusolutions/inandu-grid) — the
|
|
38
|
-
original, feature-complete, MIT-licensed grid. Start there if you need something production-ready
|
|
39
|
-
today.
|
|
40
|
-
- **Commercial add-ons for React:** `@inandu-solutions/grid-pro-react` *(private, paid, not released
|
|
41
|
-
yet)* — the React port of `@inandu-solutions/grid-pro`, depends on this package the same way
|
|
42
|
-
grid-pro depends on grid-angular.
|
|
43
|
-
- **Package:** [`@inandu-solutions/grid-react`](https://www.npmjs.com/package/@inandu-solutions/grid-react)
|
|
44
|
-
(MIT) — `0.x` while the API settles; expect breaking changes between minors until `1.0.0`.
|
|
45
|
-
- **⚡ StackBlitz:** [a minimal editable example](https://stackblitz.com/github/inandusolutions/inandu-grid-react/tree/main/examples/stackblitz) —
|
|
46
|
-
the grid in a bare React app installing `@inandu-solutions/grid-react` from npm; edit `src/App.tsx`
|
|
47
|
-
and it updates live ([source](examples/stackblitz)).
|
|
48
|
-
|
|
49
|
-
## Development
|
|
50
|
-
|
|
51
|
-
```bash
|
|
52
|
-
npm install
|
|
53
|
-
npm run dev # Vite dev server
|
|
54
|
-
npm test # Vitest + React Testing Library
|
|
55
|
-
npm run build # library build (dist/)
|
|
56
|
-
```
|
|
57
|
-
|
|
58
70
|
## API shape
|
|
59
71
|
|
|
60
72
|
```tsx
|
|
61
73
|
import { InanduGrid, useInanduGrid } from '@inandu-solutions/grid-react';
|
|
74
|
+
import '@inandu-solutions/grid-react/style.css'; // optional default styling — skip it and bring your own
|
|
62
75
|
|
|
63
76
|
// Component: batteries-included table.
|
|
64
77
|
<InanduGrid rows={rows} columns={columns} />;
|
|
65
78
|
|
|
66
79
|
// Hook: headless — bring your own markup.
|
|
67
|
-
const { visibleRows, filteredRowCount,
|
|
80
|
+
const { visibleRows, filteredRowCount, sortCriteria, setSort, filterValues, setFilterValue, page, setPage, pageCount } =
|
|
68
81
|
useInanduGrid({ rows, columns, pageSize: 25 });
|
|
69
82
|
```
|
|
70
83
|
|
|
84
|
+
## Development
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
npm install
|
|
88
|
+
npm run dev # Vite dev server
|
|
89
|
+
npm test # Vitest + React Testing Library
|
|
90
|
+
npm run build # library build (dist/)
|
|
91
|
+
```
|
|
92
|
+
|
|
71
93
|
## License
|
|
72
94
|
|
|
73
95
|
MIT © [Inandu SAS](https://inandu.com)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inandu-solutions/grid-react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Standalone React data grid: sorting, free-text and per-column filtering, grouping, pagination, CSV/Excel/PDF export and print, i18n (5 languages) and theming, with a deliberately small dependency footprint. The React port of @inandu-solutions/grid-angular.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -45,6 +45,9 @@
|
|
|
45
45
|
"types": "./dist/index.d.ts",
|
|
46
46
|
"import": "./dist/inandu-grid-react.js",
|
|
47
47
|
"require": "./dist/inandu-grid-react.cjs"
|
|
48
|
+
},
|
|
49
|
+
"./style.css": {
|
|
50
|
+
"default": "./dist/style.css"
|
|
48
51
|
}
|
|
49
52
|
},
|
|
50
53
|
"files": [
|
|
@@ -60,7 +63,7 @@
|
|
|
60
63
|
},
|
|
61
64
|
"scripts": {
|
|
62
65
|
"dev": "vite",
|
|
63
|
-
"build": "vite build",
|
|
66
|
+
"build": "vite build && node -e \"require('fs').copyFileSync('src/styles/inandu-grid.css','dist/style.css')\"",
|
|
64
67
|
"typecheck": "tsc --noEmit",
|
|
65
68
|
"test": "vitest run",
|
|
66
69
|
"test:watch": "vitest"
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { InanduGridRow } from '../core';
|
|
3
|
-
import { InanduGridCellPaste, InanduGridColumn, InanduGridRowSave } from '../hooks/useInanduGrid';
|
|
4
|
-
export interface InanduGridProps {
|
|
5
|
-
rows: InanduGridRow[];
|
|
6
|
-
columns: InanduGridColumn[];
|
|
7
|
-
/** Drives number/date formatting (`Intl`-based). Default: 'en'. */
|
|
8
|
-
locale?: string;
|
|
9
|
-
/** Drives built-in UI string translation (one of `INANDU_GRID_TRANSLATIONS`'s keys). Default: `locale`'s primary subtag. */
|
|
10
|
-
lang?: string;
|
|
11
|
-
/** 0 (default) disables pagination — every filtered/sorted row renders. Ignored while grouped. */
|
|
12
|
-
pageSize?: number;
|
|
13
|
-
/** Adds a checkbox column with row + select-all selection. Default: false. */
|
|
14
|
-
selectable?: boolean;
|
|
15
|
-
/** Called after every selection change with the current full selection, as an array. */
|
|
16
|
-
onSelectionChange?: (selectedRows: InanduGridRow[]) => void;
|
|
17
|
-
/** Adds a CSV/Excel/PDF export toolbar above the table. Default: false. */
|
|
18
|
-
exportable?: boolean;
|
|
19
|
-
/** Base filename (without extension) for exports. Default: 'inandu-grid'. */
|
|
20
|
-
exportFilenameBase?: string;
|
|
21
|
-
/** Adds a per-row "Delete" button. Default: false. */
|
|
22
|
-
deletable?: boolean;
|
|
23
|
-
/** `window.confirm()`-gates a single row's delete. Unset: deletes immediately. */
|
|
24
|
-
deleteConfirmMessage?: string;
|
|
25
|
-
/** `window.confirm()`-gates the "Delete selected" bulk action (shown when `selectable && deletable` with at least one row selected). Unset: deletes immediately. */
|
|
26
|
-
bulkDeleteConfirmMessage?: string;
|
|
27
|
-
/** Adds an "Add row" trigger with a blank draft row. Default: false. Has no effect unless at least one column is `editable`. */
|
|
28
|
-
creatable?: boolean;
|
|
29
|
-
/** Called once a row edit passes validation. The grid never mutates `rows` itself — applying `values` onto `row` is the caller's job. */
|
|
30
|
-
onRowSave?: (event: InanduGridRowSave) => void;
|
|
31
|
-
/** Called once a new row's draft passes validation. No row reference — it doesn't exist in `rows` yet. */
|
|
32
|
-
onRowCreate?: (values: Record<string, unknown>) => void;
|
|
33
|
-
/** Called after a single-row delete is confirmed (or clicked, if no `deleteConfirmMessage`). */
|
|
34
|
-
onRowDelete?: (row: InanduGridRow) => void;
|
|
35
|
-
/** Called after the bulk "Delete selected" action is confirmed (or clicked, if no `bulkDeleteConfirmMessage`). */
|
|
36
|
-
onRowsDelete?: (rows: InanduGridRow[]) => void;
|
|
37
|
-
/** Opts into `Ctrl+C`/`Ctrl+V` cell copy/paste (Excel-style TSV). Default: false. */
|
|
38
|
-
clipboard?: boolean;
|
|
39
|
-
/** Called with every parsed cell update from a `Ctrl+V`. The grid never mutates `rows` itself. */
|
|
40
|
-
onCellsPaste?: (updates: InanduGridCellPaste[]) => void;
|
|
41
|
-
/** Adds a "Columns" toolbar button + popup letting the user show/hide individual columns at runtime. Default: false. */
|
|
42
|
-
columnToggle?: boolean;
|
|
43
|
-
/** Adds a per-row drag handle to reorder rows. Default: false. Auto-disabled while grouped, same as grid-angular. */
|
|
44
|
-
rowReorder?: boolean;
|
|
45
|
-
/** Called with the fully reordered row array after a row drag-and-drop. The grid never mutates `rows` itself. */
|
|
46
|
-
onRowOrderChange?: (rows: InanduGridRow[]) => void;
|
|
47
|
-
/**
|
|
48
|
-
* Turns on tree mode: the field on each row holding its child rows (a nested array of the same
|
|
49
|
-
* shape). `rows` is then the root rows. Auto-disabled while grouped. Tree rows are display +
|
|
50
|
-
* expand only — inline editing, drag-reorder and clipboard don't apply to them, same as
|
|
51
|
-
* grid-angular.
|
|
52
|
-
*/
|
|
53
|
-
treeChildrenKey?: string;
|
|
54
|
-
/** Initial expand state for tree mode. Default: `'none'`. */
|
|
55
|
-
treeDefaultExpanded?: 'none' | 'all' | number;
|
|
56
|
-
/**
|
|
57
|
-
* Enables master-detail: renders a leading expand/collapse toggle per row, and (while expanded)
|
|
58
|
-
* a full-width detail row right below it, with whatever this returns. Auto-disabled while
|
|
59
|
-
* grouped, same as grid-angular's `detailTemplate`/`hasMasterDetail`. Unset (default): off.
|
|
60
|
-
*/
|
|
61
|
-
renderDetail?: (row: InanduGridRow) => ReactNode;
|
|
62
|
-
/** Collapses any other expanded row first, accordion-style, when a new one expands. Off (any number of rows can be expanded at once) by default. */
|
|
63
|
-
singleDetailExpand?: boolean;
|
|
64
|
-
/**
|
|
65
|
-
* Opt-in row virtualization for large datasets — only rows scrolled into view (plus a small
|
|
66
|
-
* overscan runway) are actually mounted. Bypasses pagination entirely, same as grouping.
|
|
67
|
-
* Auto-disabled while grouped (this port doesn't interleave group headers into the virtualized
|
|
68
|
-
* window the way grid-angular does); also disables master-detail, row drag-reorder, tree data,
|
|
69
|
-
* and the totals `<tfoot>`, same restrictions grid-angular's `virtualScroll` has. Default: false.
|
|
70
|
-
*/
|
|
71
|
-
virtualScroll?: boolean;
|
|
72
|
-
/**
|
|
73
|
-
* Fixed row height (px) the virtualization math uses to compute scroll position and how many
|
|
74
|
-
* rows to render. Unlike grid-angular, this port doesn't auto-measure a rendered row's real
|
|
75
|
-
* height (that needs a real layout engine to verify, which unit tests can't provide) — pass the
|
|
76
|
-
* actual rendered row height for correct scrolling. Default: 40.
|
|
77
|
-
*/
|
|
78
|
-
virtualRowHeight?: number;
|
|
79
|
-
/** The scrollable viewport's own height (px) — only used while `virtualScroll`. Default: 400. */
|
|
80
|
-
height?: number;
|
|
81
|
-
/** Extra rows rendered above/below the visible window, so a fast scroll doesn't flash empty space before the next render catches up. Default: 4. */
|
|
82
|
-
overscan?: number;
|
|
83
|
-
/**
|
|
84
|
-
* Double-click a column's resize handle to fit its width to its widest currently-rendered value
|
|
85
|
-
* (header included). Measures real rendered text width via the DOM (`measureColumnContentWidth`)
|
|
86
|
-
* — like grid-angular's own autosize, this only measures what's actually mounted (one page, or
|
|
87
|
-
* the virtual window), not the full dataset. Default: false.
|
|
88
|
-
*/
|
|
89
|
-
autosize?: boolean;
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Batteries-included table over `useInanduGrid`: sorting, free-text search, a per-column filter
|
|
93
|
-
* row, pagination, single-column grouping with per-group + grand-total aggregates, row selection,
|
|
94
|
-
* CSV/Excel/PDF export, i18n, inline row editing/creation/deletion with validation, and row
|
|
95
|
-
* virtualization for large datasets.
|
|
96
|
-
*/
|
|
97
|
-
export declare function InanduGrid({ rows, columns, locale, lang, pageSize, selectable, onSelectionChange, exportable, exportFilenameBase, deletable, deleteConfirmMessage, bulkDeleteConfirmMessage, creatable, onRowSave, onRowCreate, onRowDelete, onRowsDelete, clipboard, onCellsPaste, columnToggle, rowReorder, onRowOrderChange, treeChildrenKey, treeDefaultExpanded, renderDetail, singleDetailExpand, virtualScroll, virtualRowHeight, height, overscan, autosize, }: InanduGridProps): import('react').JSX.Element;
|
package/dist/core/aggregate.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { ColumnConfig, InanduColumnAggregate, InanduGridRow } from './types';
|
|
2
|
-
/** Short, language-agnostic symbol shown for each `InanduColumnAggregate` kind — deliberately not translated (the same way units like "CSV"/"PDF" aren't). */
|
|
3
|
-
export declare const AGGREGATE_SYMBOLS: Record<Exclude<InanduColumnAggregate, ''>, string>;
|
|
4
|
-
/** One numeric aggregate per `aggregateColumns` entry, computed over `rows` — `'count'` just counts rows (works for any column type); the rest ignore rows whose raw value isn't a finite number. */
|
|
5
|
-
export declare function computeGroupAggregates(rows: InanduGridRow[], aggregateColumns: readonly ColumnConfig[]): Record<string, number>;
|
package/dist/core/columns.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Columns with an explicit `order` land at that 0-based slot; columns without one
|
|
3
|
-
* fill the remaining slots in declaration order. Equal/out-of-range `order` values
|
|
4
|
-
* degrade gracefully by falling back to declaration order among themselves.
|
|
5
|
-
*
|
|
6
|
-
* Generic over the column type: works for `InanduColumnComponent` instances or any object with
|
|
7
|
-
* an `order()` accessor.
|
|
8
|
-
*/
|
|
9
|
-
export declare function placeColumnsByOrder<C extends {
|
|
10
|
-
order(): number | undefined;
|
|
11
|
-
}>(columns: readonly C[]): C[];
|
package/dist/core/constants.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/** Floor enforced while dragging a resize handle, so a column can never be shrunk to zero/negative width. */
|
|
2
|
-
export declare const MIN_COLUMN_WIDTH = 30;
|
|
3
|
-
/** Ceiling `autosize` (double-click a resize handle to fit content) will grow a column to, so one
|
|
4
|
-
* very long value can't blow the column out to the width of the page. The drag handle itself is
|
|
5
|
-
* not capped by this. */
|
|
6
|
-
export declare const MAX_COLUMN_WIDTH = 600;
|
|
7
|
-
/** Must match `.inandu-select-column`'s CSS width — used by `stickyOffset()` to account for the (always-sticky) checkbox column. */
|
|
8
|
-
export declare const SELECT_COLUMN_WIDTH = 36;
|
|
9
|
-
/** Must match `.inandu-row-drag-column`'s CSS width — used by `stickyOffset()` to account for the (always-leading, when enabled) drag-handle column. */
|
|
10
|
-
export declare const ROW_DRAG_COLUMN_WIDTH = 32;
|
|
11
|
-
/** Must match `.inandu-detail-toggle-column`'s CSS width — used by `stickyOffset()` to account for the (always-leading-most, when enabled) master-detail expand/collapse column. */
|
|
12
|
-
export declare const DETAIL_TOGGLE_COLUMN_WIDTH = 32;
|
|
13
|
-
/** `localStorage` key prefix for `stateKey`-based persistence, so this library's own saved blobs don't collide with anything else a host app stores. */
|
|
14
|
-
export declare const STATE_STORAGE_PREFIX = "inandu-grid-state:";
|
package/dist/core/filter.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { ColumnConfig, InanduGridColumnFilterValue, InanduGridRow } from './types';
|
|
2
|
-
import { NumberFormatter } from './format';
|
|
3
|
-
/**
|
|
4
|
-
* Whether `value` has at least one non-empty key — an entry can exist (e.g. after typing then
|
|
5
|
-
* clearing) without actually narrowing anything. `values` is the one exception: unlike every other
|
|
6
|
-
* key, an *empty* array is still meaningful (see `matchesColumnFilter`) — the presence of the key
|
|
7
|
-
* at all is what counts, not its length. Only an entirely absent/`undefined` `values` reads as "no
|
|
8
|
-
* set-filter constraint".
|
|
9
|
-
*/
|
|
10
|
-
export declare function hasMeaningfulFilterValue(value: InanduGridColumnFilterValue | undefined): boolean;
|
|
11
|
-
/**
|
|
12
|
-
* Whether `row` satisfies `column`'s own filter control. An empty/absent `filterValue` (no
|
|
13
|
-
* constraint entered for this column yet) always matches. Range checks (`'number'`/`'date'`) are
|
|
14
|
-
* inclusive on both ends; a cell that can't be parsed as that column's type never matches once at
|
|
15
|
-
* least one bound is set.
|
|
16
|
-
*
|
|
17
|
-
* `filterValue.values` (the set filter) is the one key that's *present-vs-absent*, not
|
|
18
|
-
* *non-empty-vs-empty*: an `undefined` `values` falls through to the type-specific checks below,
|
|
19
|
-
* same as omitting it; a *defined* `values` — even `[]` — takes over matching for the column
|
|
20
|
-
* entirely, checked against the formatted display value. This is deliberate: `[]` is how "every
|
|
21
|
-
* checkbox is unchecked" (match nothing) is told apart from "the set filter was never touched"
|
|
22
|
-
* (match everything, i.e. don't constrain) — collapsing them to the same "no constraint" meaning,
|
|
23
|
-
* like every other filter key's blank state does, would make unchecking every box a no-op instead
|
|
24
|
-
* of the empty result a consumer building a set-filter checklist actually needs.
|
|
25
|
-
*/
|
|
26
|
-
export declare function matchesColumnFilter(column: ColumnConfig, row: InanduGridRow, filterValue: InanduGridColumnFilterValue, locale: string, numberFormatter?: NumberFormatter): boolean;
|
package/dist/core/format.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { InanduColumnType } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* Turns a raw numeric value into its display string. `digitsInfo` is a `DecimalPipe`-style
|
|
4
|
-
* `'{minInt}.{minFrac}-{maxFrac}'` string (e.g. `"1.2-2"`), or empty for the default.
|
|
5
|
-
*
|
|
6
|
-
* Injected into `formatCellValue()` so the framework layer can choose the implementation: the
|
|
7
|
-
* Angular component passes one backed by `@angular/common`'s `formatNumber` (honouring whatever
|
|
8
|
-
* locale data the host app registered), keeping its output byte-identical to before this folder
|
|
9
|
-
* existed. `defaultNumberFormatter` below is the standalone fallback for a non-Angular consumer.
|
|
10
|
-
*/
|
|
11
|
-
export type NumberFormatter = (value: number, locale: string, digitsInfo?: string) => string;
|
|
12
|
-
/** `Intl.NumberFormat`-based `NumberFormatter`. Parses the `digitsInfo` mini-syntax; falls back to Angular's own default of up to 3 fraction digits (`'1.0-3'`) when it's absent. */
|
|
13
|
-
export declare function defaultNumberFormatter(value: number, locale: string, digitsInfo?: string): string;
|
|
14
|
-
/**
|
|
15
|
-
* Coerces a raw cell value to a `Date` for `type="date"` columns — accepts a `Date`, a timestamp,
|
|
16
|
-
* or a string. Safari's `Date` string parser is stricter than Chrome's; notably it returns an
|
|
17
|
-
* Invalid Date for a space-separated `"yyyy-mm-dd hh:mm[:ss]"` that Chrome happily parses. That one
|
|
18
|
-
* common case is normalised to the ISO `T` form before parsing, so a `type="date"` column renders
|
|
19
|
-
* and filters identically in both. Anything still unparseable comes back as an Invalid Date — every
|
|
20
|
-
* caller already guards with `Number.isNaN(date.getTime())`.
|
|
21
|
-
*/
|
|
22
|
-
export declare function coerceToDate(value: unknown): Date;
|
|
23
|
-
export declare function formatDateValue(date: Date, format: string): string;
|
|
24
|
-
export declare function formatCellValue(value: unknown, type: InanduColumnType, format: string, locale: string, numberFormatter?: NumberFormatter): string;
|
package/dist/core/i18n/en.d.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
export declare const en: {
|
|
2
|
-
MsgNoData: string;
|
|
3
|
-
MsgFirstPage: string;
|
|
4
|
-
MsgPreviousPage: string;
|
|
5
|
-
MsgNextPage: string;
|
|
6
|
-
MsgLastPage: string;
|
|
7
|
-
MsgSortBy: string;
|
|
8
|
-
MsgPageOf: string;
|
|
9
|
-
MsgFilterPlaceholder: string;
|
|
10
|
-
MsgFilterColumn: string;
|
|
11
|
-
MsgFilterMin: string;
|
|
12
|
-
MsgFilterMax: string;
|
|
13
|
-
MsgFilterFrom: string;
|
|
14
|
-
MsgFilterTo: string;
|
|
15
|
-
MsgAll: string;
|
|
16
|
-
MsgCancelFilter: string;
|
|
17
|
-
MsgCancelAllFilters: string;
|
|
18
|
-
MsgGroupByHint: string;
|
|
19
|
-
MsgGroupedBy: string;
|
|
20
|
-
MsgGroupHeader: string;
|
|
21
|
-
MsgCancelGrouping: string;
|
|
22
|
-
MsgSelectAll: string;
|
|
23
|
-
MsgSelectRow: string;
|
|
24
|
-
MsgExportCsv: string;
|
|
25
|
-
MsgExportExcel: string;
|
|
26
|
-
MsgExportPdf: string;
|
|
27
|
-
MsgPrint: string;
|
|
28
|
-
MsgToggleColumns: string;
|
|
29
|
-
MsgToggleColumn: string;
|
|
30
|
-
MsgEditCell: string;
|
|
31
|
-
MsgEditRow: string;
|
|
32
|
-
MsgSaveRow: string;
|
|
33
|
-
MsgCancelRowEdit: string;
|
|
34
|
-
MsgDeleteRow: string;
|
|
35
|
-
MsgAddRow: string;
|
|
36
|
-
MsgLoading: string;
|
|
37
|
-
MsgDragRow: string;
|
|
38
|
-
MsgAutosizeColumn: string;
|
|
39
|
-
MsgExpandDetail: string;
|
|
40
|
-
MsgCollapseDetail: string;
|
|
41
|
-
MsgDeleteSelected: string;
|
|
42
|
-
MsgValidationRequired: string;
|
|
43
|
-
MsgValidationMin: string;
|
|
44
|
-
MsgValidationMax: string;
|
|
45
|
-
MsgValidationPattern: string;
|
|
46
|
-
};
|
package/dist/core/i18n/es.d.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
export declare const es: {
|
|
2
|
-
MsgNoData: string;
|
|
3
|
-
MsgFirstPage: string;
|
|
4
|
-
MsgPreviousPage: string;
|
|
5
|
-
MsgNextPage: string;
|
|
6
|
-
MsgLastPage: string;
|
|
7
|
-
MsgSortBy: string;
|
|
8
|
-
MsgPageOf: string;
|
|
9
|
-
MsgFilterPlaceholder: string;
|
|
10
|
-
MsgFilterColumn: string;
|
|
11
|
-
MsgFilterMin: string;
|
|
12
|
-
MsgFilterMax: string;
|
|
13
|
-
MsgFilterFrom: string;
|
|
14
|
-
MsgFilterTo: string;
|
|
15
|
-
MsgAll: string;
|
|
16
|
-
MsgCancelFilter: string;
|
|
17
|
-
MsgCancelAllFilters: string;
|
|
18
|
-
MsgGroupByHint: string;
|
|
19
|
-
MsgGroupedBy: string;
|
|
20
|
-
MsgGroupHeader: string;
|
|
21
|
-
MsgCancelGrouping: string;
|
|
22
|
-
MsgSelectAll: string;
|
|
23
|
-
MsgSelectRow: string;
|
|
24
|
-
MsgExportCsv: string;
|
|
25
|
-
MsgExportExcel: string;
|
|
26
|
-
MsgExportPdf: string;
|
|
27
|
-
MsgPrint: string;
|
|
28
|
-
MsgToggleColumns: string;
|
|
29
|
-
MsgToggleColumn: string;
|
|
30
|
-
MsgEditCell: string;
|
|
31
|
-
MsgEditRow: string;
|
|
32
|
-
MsgSaveRow: string;
|
|
33
|
-
MsgCancelRowEdit: string;
|
|
34
|
-
MsgDeleteRow: string;
|
|
35
|
-
MsgAddRow: string;
|
|
36
|
-
MsgLoading: string;
|
|
37
|
-
MsgDragRow: string;
|
|
38
|
-
MsgAutosizeColumn: string;
|
|
39
|
-
MsgExpandDetail: string;
|
|
40
|
-
MsgCollapseDetail: string;
|
|
41
|
-
MsgDeleteSelected: string;
|
|
42
|
-
MsgValidationRequired: string;
|
|
43
|
-
MsgValidationMin: string;
|
|
44
|
-
MsgValidationMax: string;
|
|
45
|
-
MsgValidationPattern: string;
|
|
46
|
-
};
|
package/dist/core/i18n/fr.d.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
export declare const fr: {
|
|
2
|
-
MsgNoData: string;
|
|
3
|
-
MsgFirstPage: string;
|
|
4
|
-
MsgPreviousPage: string;
|
|
5
|
-
MsgNextPage: string;
|
|
6
|
-
MsgLastPage: string;
|
|
7
|
-
MsgSortBy: string;
|
|
8
|
-
MsgPageOf: string;
|
|
9
|
-
MsgFilterPlaceholder: string;
|
|
10
|
-
MsgFilterColumn: string;
|
|
11
|
-
MsgFilterMin: string;
|
|
12
|
-
MsgFilterMax: string;
|
|
13
|
-
MsgFilterFrom: string;
|
|
14
|
-
MsgFilterTo: string;
|
|
15
|
-
MsgAll: string;
|
|
16
|
-
MsgCancelFilter: string;
|
|
17
|
-
MsgCancelAllFilters: string;
|
|
18
|
-
MsgGroupByHint: string;
|
|
19
|
-
MsgGroupedBy: string;
|
|
20
|
-
MsgGroupHeader: string;
|
|
21
|
-
MsgCancelGrouping: string;
|
|
22
|
-
MsgSelectAll: string;
|
|
23
|
-
MsgSelectRow: string;
|
|
24
|
-
MsgExportCsv: string;
|
|
25
|
-
MsgExportExcel: string;
|
|
26
|
-
MsgExportPdf: string;
|
|
27
|
-
MsgPrint: string;
|
|
28
|
-
MsgToggleColumns: string;
|
|
29
|
-
MsgToggleColumn: string;
|
|
30
|
-
MsgEditCell: string;
|
|
31
|
-
MsgEditRow: string;
|
|
32
|
-
MsgSaveRow: string;
|
|
33
|
-
MsgCancelRowEdit: string;
|
|
34
|
-
MsgDeleteRow: string;
|
|
35
|
-
MsgAddRow: string;
|
|
36
|
-
MsgLoading: string;
|
|
37
|
-
MsgDragRow: string;
|
|
38
|
-
MsgAutosizeColumn: string;
|
|
39
|
-
MsgExpandDetail: string;
|
|
40
|
-
MsgCollapseDetail: string;
|
|
41
|
-
MsgDeleteSelected: string;
|
|
42
|
-
MsgValidationRequired: string;
|
|
43
|
-
MsgValidationMin: string;
|
|
44
|
-
MsgValidationMax: string;
|
|
45
|
-
MsgValidationPattern: string;
|
|
46
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { en } from './en';
|
|
2
|
-
import { es } from './es';
|
|
3
|
-
import { fr } from './fr';
|
|
4
|
-
import { it } from './it';
|
|
5
|
-
import { zh } from './zh';
|
|
6
|
-
export { en, es, fr, it, zh };
|
|
7
|
-
/** Every built-in dictionary, keyed by primary language subtag. */
|
|
8
|
-
export declare const INANDU_GRID_TRANSLATIONS: Record<string, Record<string, string>>;
|
package/dist/core/i18n/it.d.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
export declare const it: {
|
|
2
|
-
MsgNoData: string;
|
|
3
|
-
MsgFirstPage: string;
|
|
4
|
-
MsgPreviousPage: string;
|
|
5
|
-
MsgNextPage: string;
|
|
6
|
-
MsgLastPage: string;
|
|
7
|
-
MsgSortBy: string;
|
|
8
|
-
MsgPageOf: string;
|
|
9
|
-
MsgFilterPlaceholder: string;
|
|
10
|
-
MsgFilterColumn: string;
|
|
11
|
-
MsgFilterMin: string;
|
|
12
|
-
MsgFilterMax: string;
|
|
13
|
-
MsgFilterFrom: string;
|
|
14
|
-
MsgFilterTo: string;
|
|
15
|
-
MsgAll: string;
|
|
16
|
-
MsgCancelFilter: string;
|
|
17
|
-
MsgCancelAllFilters: string;
|
|
18
|
-
MsgGroupByHint: string;
|
|
19
|
-
MsgGroupedBy: string;
|
|
20
|
-
MsgGroupHeader: string;
|
|
21
|
-
MsgCancelGrouping: string;
|
|
22
|
-
MsgSelectAll: string;
|
|
23
|
-
MsgSelectRow: string;
|
|
24
|
-
MsgExportCsv: string;
|
|
25
|
-
MsgExportExcel: string;
|
|
26
|
-
MsgExportPdf: string;
|
|
27
|
-
MsgPrint: string;
|
|
28
|
-
MsgToggleColumns: string;
|
|
29
|
-
MsgToggleColumn: string;
|
|
30
|
-
MsgEditCell: string;
|
|
31
|
-
MsgEditRow: string;
|
|
32
|
-
MsgSaveRow: string;
|
|
33
|
-
MsgCancelRowEdit: string;
|
|
34
|
-
MsgDeleteRow: string;
|
|
35
|
-
MsgAddRow: string;
|
|
36
|
-
MsgLoading: string;
|
|
37
|
-
MsgDragRow: string;
|
|
38
|
-
MsgAutosizeColumn: string;
|
|
39
|
-
MsgExpandDetail: string;
|
|
40
|
-
MsgCollapseDetail: string;
|
|
41
|
-
MsgDeleteSelected: string;
|
|
42
|
-
MsgValidationRequired: string;
|
|
43
|
-
MsgValidationMin: string;
|
|
44
|
-
MsgValidationMax: string;
|
|
45
|
-
MsgValidationPattern: string;
|
|
46
|
-
};
|
package/dist/core/i18n/zh.d.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
export declare const zh: {
|
|
2
|
-
MsgNoData: string;
|
|
3
|
-
MsgFirstPage: string;
|
|
4
|
-
MsgPreviousPage: string;
|
|
5
|
-
MsgNextPage: string;
|
|
6
|
-
MsgLastPage: string;
|
|
7
|
-
MsgSortBy: string;
|
|
8
|
-
MsgPageOf: string;
|
|
9
|
-
MsgFilterPlaceholder: string;
|
|
10
|
-
MsgFilterColumn: string;
|
|
11
|
-
MsgFilterMin: string;
|
|
12
|
-
MsgFilterMax: string;
|
|
13
|
-
MsgFilterFrom: string;
|
|
14
|
-
MsgFilterTo: string;
|
|
15
|
-
MsgAll: string;
|
|
16
|
-
MsgCancelFilter: string;
|
|
17
|
-
MsgCancelAllFilters: string;
|
|
18
|
-
MsgGroupByHint: string;
|
|
19
|
-
MsgGroupedBy: string;
|
|
20
|
-
MsgGroupHeader: string;
|
|
21
|
-
MsgCancelGrouping: string;
|
|
22
|
-
MsgSelectAll: string;
|
|
23
|
-
MsgSelectRow: string;
|
|
24
|
-
MsgExportCsv: string;
|
|
25
|
-
MsgExportExcel: string;
|
|
26
|
-
MsgExportPdf: string;
|
|
27
|
-
MsgPrint: string;
|
|
28
|
-
MsgToggleColumns: string;
|
|
29
|
-
MsgToggleColumn: string;
|
|
30
|
-
MsgEditCell: string;
|
|
31
|
-
MsgEditRow: string;
|
|
32
|
-
MsgSaveRow: string;
|
|
33
|
-
MsgCancelRowEdit: string;
|
|
34
|
-
MsgDeleteRow: string;
|
|
35
|
-
MsgAddRow: string;
|
|
36
|
-
MsgLoading: string;
|
|
37
|
-
MsgDragRow: string;
|
|
38
|
-
MsgAutosizeColumn: string;
|
|
39
|
-
MsgExpandDetail: string;
|
|
40
|
-
MsgCollapseDetail: string;
|
|
41
|
-
MsgDeleteSelected: string;
|
|
42
|
-
MsgValidationRequired: string;
|
|
43
|
-
MsgValidationMin: string;
|
|
44
|
-
MsgValidationMax: string;
|
|
45
|
-
MsgValidationPattern: string;
|
|
46
|
-
};
|
package/dist/core/index.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export type { InanduColumnType, InanduColumnStickySide, InanduColumnAggregate, InanduGridRow, InanduGridColumnFilterValue, ColumnConfig, } from './types';
|
|
2
|
-
export { MIN_COLUMN_WIDTH, MAX_COLUMN_WIDTH, SELECT_COLUMN_WIDTH, ROW_DRAG_COLUMN_WIDTH, DETAIL_TOGGLE_COLUMN_WIDTH, STATE_STORAGE_PREFIX, } from './constants';
|
|
3
|
-
export { coerceToDate, formatDateValue, formatCellValue, defaultNumberFormatter, } from './format';
|
|
4
|
-
export type { NumberFormatter } from './format';
|
|
5
|
-
export { compareCellValues } from './sort';
|
|
6
|
-
export { flattenTree, collectTreeRows } from './tree';
|
|
7
|
-
export type { TreeVisibleRow, FlattenTreeOptions } from './tree';
|
|
8
|
-
export { hasMeaningfulFilterValue, matchesColumnFilter } from './filter';
|
|
9
|
-
export { AGGREGATE_SYMBOLS, computeGroupAggregates } from './aggregate';
|
|
10
|
-
export { placeColumnsByOrder } from './columns';
|
|
11
|
-
export { parseDraftValue, parsePastedCellValue } from './parse';
|
|
12
|
-
export { escapeCsvValue } from './export/csv';
|
|
13
|
-
export { escapeMarkup } from './export/markup';
|
|
14
|
-
export { truncatePdfText } from './export/pdf';
|
|
15
|
-
export { downloadBlob } from './export/download';
|
|
16
|
-
export { en, es, fr, it, zh, INANDU_GRID_TRANSLATIONS } from './i18n';
|
package/dist/core/parse.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { InanduColumnType } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* Parses a row-edit draft's raw control value (a string for text/number/date, a boolean for the
|
|
4
|
-
* checkbox — see `InanduGridComponent.onRowFieldChange`) per the column's `type`. Returns `undefined` for
|
|
5
|
-
* an unparseable `'number'`/`'date'`, the signal `saveRow()` uses to omit that field from `values`
|
|
6
|
-
* rather than committing garbage.
|
|
7
|
-
*/
|
|
8
|
-
export declare function parseDraftValue(raw: unknown, type: InanduColumnType): unknown;
|
|
9
|
-
/**
|
|
10
|
-
* Parses one pasted TSV cell's raw text per `type` — like `parseDraftValue()`, except `'boolean'`:
|
|
11
|
-
* a pasted cell is always plain text (`"true"`/`"false"`, whatever the clipboard actually held),
|
|
12
|
-
* never an already-boolean checkbox `.checked` the way a manual row edit's draft value is.
|
|
13
|
-
*/
|
|
14
|
-
export declare function parsePastedCellValue(raw: string, type: InanduColumnType): unknown;
|
package/dist/core/sort.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function compareCellValues(a: unknown, b: unknown, locale?: string): number;
|