@coreui/data-grid 0.1.0-rc.0 → 0.2.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -4
- package/dist/css/data-grid.css +149 -31
- package/dist/css/data-grid.css.map +1 -1
- package/dist/css/data-grid.min.css +2 -2
- package/dist/css/data-grid.min.css.map +1 -1
- package/dist/js/clipboard.cjs +56 -0
- package/dist/js/clipboard.cjs.map +1 -0
- package/dist/js/clipboard.mjs +54 -0
- package/dist/js/clipboard.mjs.map +1 -0
- package/dist/js/csv.cjs +36 -59
- package/dist/js/csv.cjs.map +1 -1
- package/dist/js/csv.mjs +35 -55
- package/dist/js/csv.mjs.map +1 -1
- package/dist/js/data-grid.esm.js +14078 -9332
- package/dist/js/data-grid.esm.js.map +1 -1
- package/dist/js/data-grid.esm.min.js +6 -6
- package/dist/js/data-grid.esm.min.js.map +1 -1
- package/dist/js/data-grid.js +14377 -9634
- package/dist/js/data-grid.js.map +1 -1
- package/dist/js/data-grid.lite.esm.js +10476 -0
- package/dist/js/data-grid.lite.esm.js.map +1 -0
- package/dist/js/data-grid.lite.esm.min.js +8 -0
- package/dist/js/data-grid.lite.esm.min.js.map +1 -0
- package/dist/js/data-grid.lite.js +10489 -0
- package/dist/js/data-grid.lite.js.map +1 -0
- package/dist/js/data-grid.lite.min.js +8 -0
- package/dist/js/data-grid.lite.min.js.map +1 -0
- package/dist/js/data-grid.lite.mjs +10476 -0
- package/dist/js/data-grid.lite.mjs.map +1 -0
- package/dist/js/data-grid.min.js +6 -6
- package/dist/js/data-grid.min.js.map +1 -1
- package/dist/js/data-grid.mjs +14078 -9332
- package/dist/js/data-grid.mjs.map +1 -1
- package/dist/js/drag.cjs +459 -0
- package/dist/js/drag.cjs.map +1 -0
- package/dist/js/drag.mjs +456 -0
- package/dist/js/drag.mjs.map +1 -0
- package/dist/js/export-table-CNAKStzj.mjs +26 -0
- package/dist/js/export-table-CNAKStzj.mjs.map +1 -0
- package/dist/js/export-table-doIwvE5U.cjs +55 -0
- package/dist/js/export-table-doIwvE5U.cjs.map +1 -0
- package/dist/js/filters.cjs +89 -132
- package/dist/js/filters.cjs.map +1 -1
- package/dist/js/filters.mjs +88 -128
- package/dist/js/filters.mjs.map +1 -1
- package/dist/js/labels.cjs +65 -70
- package/dist/js/labels.cjs.map +1 -1
- package/dist/js/labels.mjs +64 -66
- package/dist/js/labels.mjs.map +1 -1
- package/dist/js/print.cjs +66 -0
- package/dist/js/print.cjs.map +1 -0
- package/dist/js/print.mjs +64 -0
- package/dist/js/print.mjs.map +1 -0
- package/dist/js/validate.cjs +43 -0
- package/dist/js/validate.cjs.map +1 -0
- package/dist/js/validate.mjs +42 -0
- package/dist/js/validate.mjs.map +1 -0
- package/dist/js/xlsx.cjs +240 -0
- package/dist/js/xlsx.cjs.map +1 -0
- package/dist/js/xlsx.mjs +238 -0
- package/dist/js/xlsx.mjs.map +1 -0
- package/dist/types/base-component.d.ts +28 -18
- package/dist/types/data-grid.d.ts +26 -13
- package/dist/types/dom/data.d.ts +15 -0
- package/dist/types/dom/event-handler.d.ts +21 -10
- package/dist/types/dom/manipulator.d.ts +15 -8
- package/dist/types/engine/data-source.d.ts +1 -1
- package/dist/types/engine/features-lite.d.ts +25 -0
- package/dist/types/engine/features.d.ts +35 -0
- package/dist/types/engine/table.d.ts +3 -3
- package/dist/types/engine/validate.d.mts +1 -0
- package/dist/types/engine/validate.d.ts +20 -0
- package/dist/types/engine/virtualizer.d.ts +2 -0
- package/dist/types/icons.d.ts +6 -4
- package/dist/types/index-lite.d.mts +1 -0
- package/dist/types/index-lite.d.ts +19 -0
- package/dist/types/index.d.ts +11 -2
- package/dist/types/types.d.ts +53 -31
- package/dist/types/ui/body.d.ts +6 -3
- package/dist/types/ui/header.d.ts +3 -2
- package/dist/types/ui/loading.d.ts +1 -1
- package/dist/types/ui/pinning.d.ts +1 -1
- package/dist/types/ui/toolbar.d.ts +10 -2
- package/dist/types/util/clipboard.d.mts +1 -0
- package/dist/types/util/clipboard.d.ts +29 -0
- package/dist/types/util/config.d.ts +27 -10
- package/dist/types/util/csv.d.ts +5 -5
- package/dist/types/util/drag.d.mts +1 -0
- package/dist/types/util/drag.d.ts +48 -0
- package/dist/types/util/export-table.d.ts +47 -0
- package/dist/types/util/index.d.ts +66 -10
- package/dist/types/util/print.d.mts +1 -0
- package/dist/types/util/print.d.ts +32 -0
- package/dist/types/util/sanitizer.d.ts +15 -11
- package/dist/types/util/xlsx.d.mts +1 -0
- package/dist/types/util/xlsx.d.ts +17 -0
- package/dist/types/util/zip.d.ts +11 -0
- package/package.json +88 -10
- package/scss/data-grid.scss +204 -16
- package/src/{base-component.js → base-component.ts} +21 -17
- package/src/data-grid.ts +507 -200
- package/src/dom/{data.js → data.ts} +13 -10
- package/src/dom/event-handler.ts +380 -0
- package/src/dom/{manipulator.js → manipulator.ts} +11 -11
- package/src/engine/data-source.ts +7 -3
- package/src/engine/features-lite.ts +47 -0
- package/src/engine/features.ts +68 -0
- package/src/engine/table.ts +80 -47
- package/src/engine/validate.ts +64 -0
- package/src/engine/virtualizer.ts +17 -1
- package/src/icons.ts +11 -5
- package/src/index-lite.ts +85 -0
- package/src/index.ts +30 -2
- package/src/labels.ts +6 -4
- package/src/types.ts +87 -32
- package/src/ui/body.ts +73 -17
- package/src/ui/header.ts +51 -26
- package/src/ui/loading.ts +2 -2
- package/src/ui/pinning.ts +16 -16
- package/src/ui/toolbar.ts +27 -3
- package/src/util/clipboard.ts +112 -0
- package/src/util/{config.js → config.ts} +25 -11
- package/src/util/csv.ts +11 -30
- package/src/util/drag.ts +798 -0
- package/src/util/export-table.ts +86 -0
- package/src/util/{index.js → index.ts} +55 -35
- package/src/util/print.ts +125 -0
- package/src/util/{sanitizer.js → sanitizer.ts} +17 -13
- package/src/util/xlsx.ts +183 -0
- package/src/util/zip.ts +170 -0
- package/src/base-component.d.ts +0 -19
- package/src/dom/event-handler.d.ts +0 -11
- package/src/dom/event-handler.js +0 -331
- package/src/dom/manipulator.d.ts +0 -9
- package/src/util/config.d.ts +0 -11
- package/src/util/index.d.ts +0 -10
- package/src/util/sanitizer.d.ts +0 -11
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* License (https://coreui.io/pro/license/)
|
|
5
5
|
* --------------------------------------------------------------------------
|
|
6
6
|
*/
|
|
7
|
-
import type { DataGridColumn,
|
|
7
|
+
import type { DataGridColumn, DataGridLabels, DataGridTable, SortingState } from '../types';
|
|
8
8
|
import { type GridPinning } from './pinning';
|
|
9
9
|
export interface GridHeaderContext {
|
|
10
10
|
cellNavigation: boolean;
|
|
@@ -25,9 +25,10 @@ export interface GridHeaderContext {
|
|
|
25
25
|
isSortable: (column: DataGridColumn) => boolean;
|
|
26
26
|
labels: DataGridLabels;
|
|
27
27
|
resizable: boolean;
|
|
28
|
+
rowOrder: boolean;
|
|
28
29
|
selection: boolean;
|
|
29
30
|
selectAll: boolean;
|
|
30
|
-
table:
|
|
31
|
+
table: DataGridTable;
|
|
31
32
|
}
|
|
32
33
|
export interface GridHeaderState {
|
|
33
34
|
filteredColumns: string[] | null;
|
|
@@ -9,4 +9,4 @@ export interface GridLoading {
|
|
|
9
9
|
element: HTMLDivElement;
|
|
10
10
|
setVisible: (visible: boolean) => void;
|
|
11
11
|
}
|
|
12
|
-
export declare const createLoading: (labels: DataGridLabels) => GridLoading;
|
|
12
|
+
export declare const createLoading: (labels: DataGridLabels, className?: string) => GridLoading;
|
|
@@ -4,17 +4,19 @@
|
|
|
4
4
|
* License (https://coreui.io/pro/license/)
|
|
5
5
|
* --------------------------------------------------------------------------
|
|
6
6
|
*/
|
|
7
|
-
import type { CsvDownloadOptions } from '../util/csv';
|
|
7
|
+
import type { CsvDownloadOptions, CsvTable } from '../util/csv';
|
|
8
8
|
import type { DataGridLabels, DataGridOptions } from '../types';
|
|
9
9
|
export interface GridToolbarContext {
|
|
10
10
|
labels: DataGridLabels;
|
|
11
11
|
columns: boolean;
|
|
12
12
|
export: boolean;
|
|
13
13
|
history: boolean;
|
|
14
|
+
print: boolean;
|
|
14
15
|
search: boolean;
|
|
15
16
|
icons: {
|
|
16
17
|
columns: string;
|
|
17
18
|
export: string;
|
|
19
|
+
print: string;
|
|
18
20
|
redo: string;
|
|
19
21
|
undo: string;
|
|
20
22
|
};
|
|
@@ -22,11 +24,17 @@ export interface GridToolbarContext {
|
|
|
22
24
|
export interface GridToolbar {
|
|
23
25
|
element: HTMLDivElement;
|
|
24
26
|
}
|
|
27
|
+
export type DataGridExporter = (table: CsvTable, options: DataGridExportOptions) => void;
|
|
28
|
+
export interface DataGridExportOptions extends CsvDownloadOptions {
|
|
29
|
+
sheetName?: string;
|
|
30
|
+
exporter?: DataGridExporter;
|
|
31
|
+
}
|
|
25
32
|
export interface ResolvedToolbar {
|
|
26
33
|
columns: boolean;
|
|
27
34
|
export: boolean;
|
|
28
|
-
exportOptions:
|
|
35
|
+
exportOptions: DataGridExportOptions;
|
|
29
36
|
history: boolean;
|
|
37
|
+
print: boolean;
|
|
30
38
|
search: boolean;
|
|
31
39
|
}
|
|
32
40
|
export declare const resolveToolbar: (options: DataGridOptions) => ResolvedToolbar;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './clipboard.js'
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* CoreUI PRO data-grid util/clipboard.ts
|
|
4
|
+
* License (https://coreui.io/pro/license/)
|
|
5
|
+
* --------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
import type { DataGridItem } from '../types';
|
|
8
|
+
export interface ClipboardBounds {
|
|
9
|
+
maxColumnIndex: number;
|
|
10
|
+
maxRowIndex: number;
|
|
11
|
+
minColumnIndex: number;
|
|
12
|
+
minRowIndex: number;
|
|
13
|
+
}
|
|
14
|
+
export interface ClipboardRow {
|
|
15
|
+
getValue: (columnId: string) => unknown;
|
|
16
|
+
original: DataGridItem;
|
|
17
|
+
}
|
|
18
|
+
export interface ClipboardTable {
|
|
19
|
+
getCellSelectionBounds: () => ClipboardBounds[];
|
|
20
|
+
getRowModel: () => {
|
|
21
|
+
rows: ClipboardRow[];
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export interface ClipboardColumn {
|
|
25
|
+
id: string;
|
|
26
|
+
formatter?: (value: unknown, item: DataGridItem) => string;
|
|
27
|
+
}
|
|
28
|
+
export declare const serializeCellSelection: (table: ClipboardTable, columns: ClipboardColumn[]) => string;
|
|
29
|
+
export declare const copyCellSelection: (table: ClipboardTable, columns: ClipboardColumn[]) => Promise<string>;
|
|
@@ -1,11 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* CoreUI util/config.ts
|
|
4
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
5
|
+
*
|
|
6
|
+
* This is a modified version of the Bootstrap's util/config.ts
|
|
7
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
8
|
+
* --------------------------------------------------------------------------
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Types
|
|
12
|
+
*/
|
|
13
|
+
type ComponentConfig = Record<string, any>;
|
|
14
|
+
/**
|
|
15
|
+
* Class definition
|
|
16
|
+
*/
|
|
17
|
+
declare class Config {
|
|
18
|
+
['constructor']: typeof Config;
|
|
19
|
+
static get Default(): ComponentConfig;
|
|
20
|
+
static get DefaultType(): ComponentConfig;
|
|
21
|
+
static get NAME(): string;
|
|
22
|
+
_getConfig(config?: ComponentConfig | null): ComponentConfig;
|
|
23
|
+
_configAfterMerge(config: ComponentConfig): ComponentConfig;
|
|
24
|
+
_mergeConfigObj(config?: ComponentConfig | null, element?: Element): ComponentConfig;
|
|
25
|
+
_typeCheckConfig(config: ComponentConfig, configTypes?: ComponentConfig): void;
|
|
11
26
|
}
|
|
27
|
+
export default Config;
|
|
28
|
+
export type { ComponentConfig };
|
package/dist/types/util/csv.d.ts
CHANGED
|
@@ -4,10 +4,9 @@
|
|
|
4
4
|
* License (https://coreui.io/pro/license/)
|
|
5
5
|
* --------------------------------------------------------------------------
|
|
6
6
|
*/
|
|
7
|
-
import type
|
|
8
|
-
import type { DataGridItem } from '../types';
|
|
7
|
+
import { type ExportScope, type ExportTable } from './export-table';
|
|
9
8
|
export interface CsvOptions {
|
|
10
|
-
scope?:
|
|
9
|
+
scope?: ExportScope;
|
|
11
10
|
delimiter?: string;
|
|
12
11
|
bom?: boolean;
|
|
13
12
|
sanitize?: boolean;
|
|
@@ -15,5 +14,6 @@ export interface CsvOptions {
|
|
|
15
14
|
export interface CsvDownloadOptions extends CsvOptions {
|
|
16
15
|
filename?: string;
|
|
17
16
|
}
|
|
18
|
-
export
|
|
19
|
-
export declare const
|
|
17
|
+
export type CsvTable = ExportTable;
|
|
18
|
+
export declare const exportCsv: (table: CsvTable, options?: CsvOptions) => string;
|
|
19
|
+
export declare const downloadCsv: (table: CsvTable, options?: CsvDownloadOptions) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './drag.js'
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* CoreUI PRO data-grid util/drag.ts
|
|
4
|
+
* License (https://coreui.io/pro/license/)
|
|
5
|
+
* --------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
export type DragAxis = 'x' | 'y';
|
|
8
|
+
export interface DragHit {
|
|
9
|
+
id: string;
|
|
10
|
+
element: HTMLElement;
|
|
11
|
+
}
|
|
12
|
+
export interface DragDrop {
|
|
13
|
+
id: string;
|
|
14
|
+
after: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface DragControllerOptions {
|
|
17
|
+
axis: DragAxis;
|
|
18
|
+
root: HTMLElement;
|
|
19
|
+
handle: string;
|
|
20
|
+
resolveSource: (handle: HTMLElement, target: HTMLElement) => DragHit | null;
|
|
21
|
+
items: DragItems;
|
|
22
|
+
canDrop: (sourceId: string, targetId: string) => boolean;
|
|
23
|
+
getScrollElement: () => HTMLElement | null;
|
|
24
|
+
ghostLabel?: (source: DragHit) => string;
|
|
25
|
+
preview?: boolean;
|
|
26
|
+
onDrop: (sourceId: string, drop: DragDrop) => void;
|
|
27
|
+
}
|
|
28
|
+
export interface DragItems {
|
|
29
|
+
getOrderedIds: () => string[];
|
|
30
|
+
getElements: (id: string) => HTMLElement[];
|
|
31
|
+
}
|
|
32
|
+
export interface DragController {
|
|
33
|
+
dispose: () => void;
|
|
34
|
+
}
|
|
35
|
+
export declare const createDragController: (options: DragControllerOptions) => DragController;
|
|
36
|
+
export interface ColumnDragOptions {
|
|
37
|
+
root: HTMLElement;
|
|
38
|
+
getScrollElement: () => HTMLElement | null;
|
|
39
|
+
canDrop: (sourceKey: string, targetKey: string) => boolean;
|
|
40
|
+
onReorder: (sourceKey: string, targetKey: string, after: boolean) => void;
|
|
41
|
+
}
|
|
42
|
+
export declare const createColumnDragController: (options: ColumnDragOptions) => DragController;
|
|
43
|
+
export interface RowDragOptions {
|
|
44
|
+
root: HTMLElement;
|
|
45
|
+
getScrollElement: () => HTMLElement | null;
|
|
46
|
+
onReorder: (sourceIndex: number, targetIndex: number, after: boolean) => void;
|
|
47
|
+
}
|
|
48
|
+
export declare const createRowDragController: (options: RowDragOptions) => DragController;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* CoreUI PRO data-grid util/export-table.ts
|
|
4
|
+
* License (https://coreui.io/pro/license/)
|
|
5
|
+
* --------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
import type { DataGridItem } from '../types';
|
|
8
|
+
export interface ExportColumnMeta {
|
|
9
|
+
label?: string;
|
|
10
|
+
formatter?: (value: unknown, item: DataGridItem) => string;
|
|
11
|
+
width?: number;
|
|
12
|
+
}
|
|
13
|
+
export interface ExportColumn {
|
|
14
|
+
id: string;
|
|
15
|
+
columnDef: {
|
|
16
|
+
meta?: unknown;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export interface ExportRow {
|
|
20
|
+
original: DataGridItem;
|
|
21
|
+
getValue: (columnId: string) => unknown;
|
|
22
|
+
}
|
|
23
|
+
export interface ExportTable {
|
|
24
|
+
getAllLeafColumns: () => ExportColumn[];
|
|
25
|
+
getCenterVisibleLeafColumns?: () => ExportColumn[];
|
|
26
|
+
getCoreRowModel: () => {
|
|
27
|
+
rows: ExportRow[];
|
|
28
|
+
};
|
|
29
|
+
getEndVisibleLeafColumns?: () => ExportColumn[];
|
|
30
|
+
getFilteredRowModel?: () => {
|
|
31
|
+
rows: ExportRow[];
|
|
32
|
+
};
|
|
33
|
+
getSelectedRowModel?: () => {
|
|
34
|
+
rows: ExportRow[];
|
|
35
|
+
};
|
|
36
|
+
getSortedRowModel?: () => {
|
|
37
|
+
rows: ExportRow[];
|
|
38
|
+
};
|
|
39
|
+
getStartVisibleLeafColumns?: () => ExportColumn[];
|
|
40
|
+
getVisibleLeafColumns?: () => ExportColumn[];
|
|
41
|
+
}
|
|
42
|
+
export type ExportScope = 'filtered' | 'all' | 'selected';
|
|
43
|
+
export declare const rowsFor: (table: ExportTable, scope: ExportScope | undefined) => ExportRow[];
|
|
44
|
+
export declare const columnsFor: (table: ExportTable) => ExportColumn[];
|
|
45
|
+
export declare const headerFor: (column: ExportColumn) => string;
|
|
46
|
+
export declare const formatterFor: (column: ExportColumn) => ExportColumnMeta["formatter"];
|
|
47
|
+
export declare const widthFor: (column: ExportColumn) => number | undefined;
|
|
@@ -1,10 +1,66 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* CoreUI util/index.ts
|
|
4
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
5
|
+
*
|
|
6
|
+
* This is a modified version of the Bootstrap's util/index.ts
|
|
7
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
8
|
+
* --------------------------------------------------------------------------
|
|
9
|
+
*/
|
|
10
|
+
type JQueryStatic = ((selector: unknown) => any) & Record<string, any> & {
|
|
11
|
+
fn: Record<string, any>;
|
|
12
|
+
};
|
|
13
|
+
type JQueryPlugin = {
|
|
14
|
+
NAME: string;
|
|
15
|
+
jQueryInterface: (...args: any[]) => unknown;
|
|
16
|
+
};
|
|
17
|
+
declare global {
|
|
18
|
+
interface Window {
|
|
19
|
+
jQuery?: JQueryStatic;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Properly escape IDs selectors to handle weird IDs
|
|
24
|
+
* @param {string} selector
|
|
25
|
+
* @returns {string}
|
|
26
|
+
*/
|
|
27
|
+
declare const parseSelector: (selector: string) => string;
|
|
28
|
+
declare const toType: (object: unknown) => string;
|
|
29
|
+
/**
|
|
30
|
+
* Public Util API
|
|
31
|
+
*/
|
|
32
|
+
declare const getUID: (prefix: string) => string;
|
|
33
|
+
declare const getTransitionDurationFromElement: (element: Element | null) => number;
|
|
34
|
+
declare const triggerTransitionEnd: (element: Element) => void;
|
|
35
|
+
declare const isElement: (object: unknown) => object is Element;
|
|
36
|
+
declare const getElement: (object: unknown) => HTMLElement | null;
|
|
37
|
+
declare const isVisible: (element: unknown) => boolean;
|
|
38
|
+
declare const isDisabled: (element: Element | null | undefined) => boolean;
|
|
39
|
+
declare const findShadowRoot: (element: Node) => ShadowRoot | null;
|
|
40
|
+
declare const noop: () => void;
|
|
41
|
+
/**
|
|
42
|
+
* Trick to restart an element's animation
|
|
43
|
+
*
|
|
44
|
+
* @param {HTMLElement} element
|
|
45
|
+
* @return void
|
|
46
|
+
*
|
|
47
|
+
* @see https://www.charistheo.io/blog/2021/02/restart-a-css-animation-with-javascript/#restarting-a-css-animation
|
|
48
|
+
*/
|
|
49
|
+
declare const reflow: (element: HTMLElement) => void;
|
|
50
|
+
declare const getjQuery: () => JQueryStatic | null;
|
|
51
|
+
declare const onDOMContentLoaded: (callback: () => void) => void;
|
|
52
|
+
declare const isRTL: () => boolean;
|
|
53
|
+
declare const defineJQueryPlugin: (plugin: JQueryPlugin) => void;
|
|
54
|
+
declare const execute: <T = any>(possibleCallback: T | ((...functionArgs: any[]) => T), args?: any[], defaultValue?: T | ((...functionArgs: any[]) => T)) => T;
|
|
55
|
+
declare const executeAfterTransition: (callback: () => void, transitionElement: Element, waitForTransition?: boolean) => void;
|
|
56
|
+
/**
|
|
57
|
+
* Return the previous/next element of a list.
|
|
58
|
+
*
|
|
59
|
+
* @param {array} list The list of elements
|
|
60
|
+
* @param activeElement The active element
|
|
61
|
+
* @param shouldGetNext Choose to get next or previous element
|
|
62
|
+
* @param isCycleAllowed
|
|
63
|
+
* @return {Element|elem} The proper element
|
|
64
|
+
*/
|
|
65
|
+
declare const getNextActiveElement: <T>(list: T[], activeElement: T, shouldGetNext: boolean, isCycleAllowed?: boolean) => T;
|
|
66
|
+
export { defineJQueryPlugin, execute, executeAfterTransition, findShadowRoot, getElement, getjQuery, getNextActiveElement, getTransitionDurationFromElement, getUID, isDisabled, isElement, isRTL, isVisible, noop, onDOMContentLoaded, parseSelector, reflow, triggerTransitionEnd, toType };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './print.js'
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* CoreUI PRO data-grid util/print.ts
|
|
4
|
+
* License (https://coreui.io/pro/license/)
|
|
5
|
+
* --------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
import type { DataGridItem } from '../types';
|
|
8
|
+
export interface PrintColumn {
|
|
9
|
+
id: string;
|
|
10
|
+
label: string;
|
|
11
|
+
formatter?: (value: unknown, item: DataGridItem) => string;
|
|
12
|
+
}
|
|
13
|
+
export interface PrintRow {
|
|
14
|
+
getValue: (columnId: string) => unknown;
|
|
15
|
+
original: DataGridItem;
|
|
16
|
+
}
|
|
17
|
+
export interface PrintTable {
|
|
18
|
+
getSortedRowModel?: () => {
|
|
19
|
+
rows: PrintRow[];
|
|
20
|
+
};
|
|
21
|
+
getFilteredRowModel?: () => {
|
|
22
|
+
rows: PrintRow[];
|
|
23
|
+
};
|
|
24
|
+
getCoreRowModel: () => {
|
|
25
|
+
rows: PrintRow[];
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export interface PrintOptions {
|
|
29
|
+
title?: string;
|
|
30
|
+
}
|
|
31
|
+
export declare const createPrintTable: (table: PrintTable, columns: PrintColumn[], options?: PrintOptions) => HTMLElement;
|
|
32
|
+
export declare const printGrid: (table: PrintTable, columns: PrintColumn[], options?: PrintOptions) => void;
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* CoreUI util/sanitizer.ts
|
|
4
|
+
* Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE)
|
|
5
|
+
*
|
|
6
|
+
* This is a modified version of the Bootstrap's util/sanitizer.ts
|
|
7
|
+
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
|
8
|
+
* --------------------------------------------------------------------------
|
|
9
|
+
*/
|
|
10
|
+
type SanitizerAllowList = Record<string, Array<string | RegExp>>;
|
|
11
|
+
export declare const DefaultAllowlist: SanitizerAllowList;
|
|
12
|
+
export declare const SVGAllowlist: SanitizerAllowList;
|
|
13
|
+
export declare function escapeHtml(unsafeText: string): string;
|
|
14
|
+
export declare function sanitizeHtml(unsafeHtml: string, allowList: SanitizerAllowList, sanitizeFunction?: ((unsafeHtml: string) => string) | null): string;
|
|
15
|
+
export type { SanitizerAllowList };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './xlsx.js'
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* CoreUI PRO data-grid util/xlsx.ts
|
|
4
|
+
* License (https://coreui.io/pro/license/)
|
|
5
|
+
* --------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
import { type ExportScope, type ExportTable } from './export-table';
|
|
8
|
+
export interface XlsxOptions {
|
|
9
|
+
scope?: ExportScope;
|
|
10
|
+
sheetName?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface XlsxDownloadOptions extends XlsxOptions {
|
|
13
|
+
filename?: string;
|
|
14
|
+
}
|
|
15
|
+
export type XlsxTable = ExportTable;
|
|
16
|
+
export declare const exportXlsx: (table: XlsxTable, options?: XlsxOptions) => Uint8Array;
|
|
17
|
+
export declare const downloadXlsx: (table: XlsxTable, options?: XlsxDownloadOptions) => void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* CoreUI PRO data-grid util/zip.ts
|
|
4
|
+
* License (https://coreui.io/pro/license/)
|
|
5
|
+
* --------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
export interface ZipEntry {
|
|
8
|
+
name: string;
|
|
9
|
+
data: Uint8Array;
|
|
10
|
+
}
|
|
11
|
+
export declare const zip: (entries: ZipEntry[]) => Uint8Array;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coreui/data-grid",
|
|
3
|
-
"description": "High-performance vanilla JavaScript data grid for CoreUI
|
|
4
|
-
"version": "0.
|
|
3
|
+
"description": "High-performance vanilla JavaScript data grid for CoreUI \u2014 100,000 rows with sorting, filtering, selection, pagination, and server-side data",
|
|
4
|
+
"version": "0.2.0-rc.0",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"coreui",
|
|
7
7
|
"data-grid",
|
|
@@ -24,9 +24,11 @@
|
|
|
24
24
|
"css-prefix": "postcss --config build/postcss.config.mjs --replace \"dist/css/*.css\" \"!dist/css/*.min.css\"",
|
|
25
25
|
"css-watch": "sass --watch --style expanded --source-map --embed-sources --no-error-css scss/:dist/css/",
|
|
26
26
|
"js": "npm-run-all js-compile js-types js-minify",
|
|
27
|
-
"js-compile": "
|
|
27
|
+
"js-compile": "rolldown --config build/rolldown.config.mjs --sourcemap",
|
|
28
28
|
"js-minify": "npm-run-all --aggregate-output --parallel js-minify-*",
|
|
29
|
-
"js-types": "tsc --project tsconfig.types.json &&
|
|
29
|
+
"js-types": "tsc --project tsconfig.types.json && node build/types-esm-shims.mjs",
|
|
30
|
+
"js-minify-lite": "terser --compress passes=2 --mangle --comments \"/^!/\" --source-map \"content=dist/js/data-grid.lite.js.map,includeSources,url=data-grid.lite.min.js.map\" --output dist/js/data-grid.lite.min.js dist/js/data-grid.lite.js",
|
|
31
|
+
"js-minify-lite-esm": "terser --compress passes=2 --mangle --comments \"/^!/\" --source-map \"content=dist/js/data-grid.lite.esm.js.map,includeSources,url=data-grid.lite.esm.min.js.map\" --output dist/js/data-grid.lite.esm.min.js dist/js/data-grid.lite.esm.js",
|
|
30
32
|
"js-minify-standalone": "terser --compress passes=2 --mangle --comments \"/^!/\" --source-map \"content=dist/js/data-grid.js.map,includeSources,url=data-grid.min.js.map\" --output dist/js/data-grid.min.js dist/js/data-grid.js",
|
|
31
33
|
"js-minify-standalone-esm": "terser --compress passes=2 --mangle --comments \"/^!/\" --source-map \"content=dist/js/data-grid.esm.js.map,includeSources,url=data-grid.esm.min.js.map\" --output dist/js/data-grid.esm.min.js dist/js/data-grid.esm.js",
|
|
32
34
|
"test": "npm-run-all typecheck test-unit",
|
|
@@ -52,6 +54,16 @@
|
|
|
52
54
|
"default": "./dist/js/data-grid.js"
|
|
53
55
|
}
|
|
54
56
|
},
|
|
57
|
+
"./lite": {
|
|
58
|
+
"import": {
|
|
59
|
+
"types": "./dist/types/index-lite.d.mts",
|
|
60
|
+
"default": "./dist/js/data-grid.lite.mjs"
|
|
61
|
+
},
|
|
62
|
+
"require": {
|
|
63
|
+
"types": "./dist/types/index-lite.d.ts",
|
|
64
|
+
"default": "./dist/js/data-grid.lite.js"
|
|
65
|
+
}
|
|
66
|
+
},
|
|
55
67
|
"./labels": {
|
|
56
68
|
"import": {
|
|
57
69
|
"types": "./dist/types/labels.d.mts",
|
|
@@ -72,6 +84,16 @@
|
|
|
72
84
|
"default": "./dist/js/filters.cjs"
|
|
73
85
|
}
|
|
74
86
|
},
|
|
87
|
+
"./clipboard": {
|
|
88
|
+
"import": {
|
|
89
|
+
"types": "./dist/types/util/clipboard.d.mts",
|
|
90
|
+
"default": "./dist/js/clipboard.mjs"
|
|
91
|
+
},
|
|
92
|
+
"require": {
|
|
93
|
+
"types": "./dist/types/util/clipboard.d.ts",
|
|
94
|
+
"default": "./dist/js/clipboard.cjs"
|
|
95
|
+
}
|
|
96
|
+
},
|
|
75
97
|
"./csv": {
|
|
76
98
|
"import": {
|
|
77
99
|
"types": "./dist/types/util/csv.d.mts",
|
|
@@ -82,6 +104,46 @@
|
|
|
82
104
|
"default": "./dist/js/csv.cjs"
|
|
83
105
|
}
|
|
84
106
|
},
|
|
107
|
+
"./xlsx": {
|
|
108
|
+
"import": {
|
|
109
|
+
"types": "./dist/types/util/xlsx.d.mts",
|
|
110
|
+
"default": "./dist/js/xlsx.mjs"
|
|
111
|
+
},
|
|
112
|
+
"require": {
|
|
113
|
+
"types": "./dist/types/util/xlsx.d.ts",
|
|
114
|
+
"default": "./dist/js/xlsx.cjs"
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
"./print": {
|
|
118
|
+
"import": {
|
|
119
|
+
"types": "./dist/types/util/print.d.mts",
|
|
120
|
+
"default": "./dist/js/print.mjs"
|
|
121
|
+
},
|
|
122
|
+
"require": {
|
|
123
|
+
"types": "./dist/types/util/print.d.ts",
|
|
124
|
+
"default": "./dist/js/print.cjs"
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
"./validate": {
|
|
128
|
+
"import": {
|
|
129
|
+
"types": "./dist/types/engine/validate.d.mts",
|
|
130
|
+
"default": "./dist/js/validate.mjs"
|
|
131
|
+
},
|
|
132
|
+
"require": {
|
|
133
|
+
"types": "./dist/types/engine/validate.d.ts",
|
|
134
|
+
"default": "./dist/js/validate.cjs"
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
"./drag": {
|
|
138
|
+
"import": {
|
|
139
|
+
"types": "./dist/types/util/drag.d.mts",
|
|
140
|
+
"default": "./dist/js/drag.mjs"
|
|
141
|
+
},
|
|
142
|
+
"require": {
|
|
143
|
+
"types": "./dist/types/util/drag.d.ts",
|
|
144
|
+
"default": "./dist/js/drag.cjs"
|
|
145
|
+
}
|
|
146
|
+
},
|
|
85
147
|
"./scss/*": "./scss/*",
|
|
86
148
|
"./dist/*": "./dist/*",
|
|
87
149
|
"./package.json": "./package.json"
|
|
@@ -95,11 +157,29 @@
|
|
|
95
157
|
"labels": [
|
|
96
158
|
"dist/types/labels.d.ts"
|
|
97
159
|
],
|
|
160
|
+
"clipboard": [
|
|
161
|
+
"dist/types/util/clipboard.d.ts"
|
|
162
|
+
],
|
|
98
163
|
"csv": [
|
|
99
164
|
"dist/types/util/csv.d.ts"
|
|
100
165
|
],
|
|
166
|
+
"drag": [
|
|
167
|
+
"dist/types/util/drag.d.ts"
|
|
168
|
+
],
|
|
101
169
|
"filters": [
|
|
102
170
|
"dist/types/filters.d.ts"
|
|
171
|
+
],
|
|
172
|
+
"lite": [
|
|
173
|
+
"dist/types/index-lite.d.ts"
|
|
174
|
+
],
|
|
175
|
+
"print": [
|
|
176
|
+
"dist/types/util/print.d.ts"
|
|
177
|
+
],
|
|
178
|
+
"validate": [
|
|
179
|
+
"dist/types/engine/validate.d.ts"
|
|
180
|
+
],
|
|
181
|
+
"xlsx": [
|
|
182
|
+
"dist/types/util/xlsx.d.ts"
|
|
103
183
|
]
|
|
104
184
|
}
|
|
105
185
|
},
|
|
@@ -115,23 +195,21 @@
|
|
|
115
195
|
},
|
|
116
196
|
"license": "SEE LICENSE IN LICENSE",
|
|
117
197
|
"dependencies": {
|
|
118
|
-
"@tanstack/
|
|
198
|
+
"@tanstack/store": "^0.11.0",
|
|
199
|
+
"@tanstack/table-core": "^9.0.0",
|
|
119
200
|
"@tanstack/virtual-core": "^3.17.3"
|
|
120
201
|
},
|
|
121
202
|
"devDependencies": {
|
|
122
|
-
"@rollup/plugin-commonjs": "^29.0.3",
|
|
123
|
-
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
124
|
-
"@rollup/plugin-replace": "^6.0.3",
|
|
125
|
-
"@rollup/plugin-typescript": "^12.3.0",
|
|
126
203
|
"@vitest/coverage-v8": "^4.1.10",
|
|
127
204
|
"autoprefixer": "^10.5.2",
|
|
205
|
+
"browserslist": "^4.28.7",
|
|
128
206
|
"clean-css-cli": "^5.6.3",
|
|
129
207
|
"jsdom": "^29.1.1",
|
|
130
208
|
"npm-run-all": "^4.1.5",
|
|
131
209
|
"postcss": "^8.5.15",
|
|
132
210
|
"postcss-cli": "^11.0.1",
|
|
133
211
|
"rimraf": "^6.1.3",
|
|
134
|
-
"
|
|
212
|
+
"rolldown": "^1.2.3",
|
|
135
213
|
"sass-embedded": "^1.100.0",
|
|
136
214
|
"terser": "5.48.0",
|
|
137
215
|
"tslib": "^2.8.1",
|