@coreui/data-grid 0.1.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/LICENSE +3 -0
- package/README.md +37 -0
- package/dist/css/data-grid.css +444 -0
- package/dist/css/data-grid.css.map +1 -0
- package/dist/css/data-grid.min.css +5 -0
- package/dist/css/data-grid.min.css.map +1 -0
- package/dist/js/csv.cjs +68 -0
- package/dist/js/csv.cjs.map +1 -0
- package/dist/js/csv.mjs +63 -0
- package/dist/js/csv.mjs.map +1 -0
- package/dist/js/data-grid.esm.js +9618 -0
- package/dist/js/data-grid.esm.js.map +1 -0
- package/dist/js/data-grid.esm.min.js +8 -0
- package/dist/js/data-grid.esm.min.js.map +1 -0
- package/dist/js/data-grid.js +9635 -0
- package/dist/js/data-grid.js.map +1 -0
- package/dist/js/data-grid.min.js +8 -0
- package/dist/js/data-grid.min.js.map +1 -0
- package/dist/js/data-grid.mjs +9618 -0
- package/dist/js/data-grid.mjs.map +1 -0
- package/dist/js/filters.cjs +143 -0
- package/dist/js/filters.cjs.map +1 -0
- package/dist/js/filters.mjs +137 -0
- package/dist/js/filters.mjs.map +1 -0
- package/dist/js/labels.cjs +76 -0
- package/dist/js/labels.cjs.map +1 -0
- package/dist/js/labels.mjs +71 -0
- package/dist/js/labels.mjs.map +1 -0
- package/dist/types/base-component.d.ts +19 -0
- package/dist/types/data-grid.d.ts +128 -0
- package/dist/types/dom/event-handler.d.ts +11 -0
- package/dist/types/dom/manipulator.d.ts +9 -0
- package/dist/types/engine/active-cell.d.ts +32 -0
- package/dist/types/engine/data-source.d.ts +19 -0
- package/dist/types/engine/scheduler.d.ts +11 -0
- package/dist/types/engine/table.d.ts +9 -0
- package/dist/types/engine/virtualizer.d.ts +21 -0
- package/dist/types/filters.d.mts +1 -0
- package/dist/types/filters.d.ts +13 -0
- package/dist/types/icons.d.ts +21 -0
- package/dist/types/index.d.mts +1 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/labels.d.mts +1 -0
- package/dist/types/labels.d.ts +9 -0
- package/dist/types/types.d.ts +262 -0
- package/dist/types/ui/body.d.ts +34 -0
- package/dist/types/ui/column-chooser.d.ts +27 -0
- package/dist/types/ui/editor.d.ts +8 -0
- package/dist/types/ui/filter-menu.d.ts +21 -0
- package/dist/types/ui/header.d.ts +50 -0
- package/dist/types/ui/loading.d.ts +12 -0
- package/dist/types/ui/menu.d.ts +17 -0
- package/dist/types/ui/pagination.d.ts +17 -0
- package/dist/types/ui/pinning.d.ts +17 -0
- package/dist/types/ui/toolbar.d.ts +34 -0
- package/dist/types/ui/tooltip.d.ts +10 -0
- package/dist/types/util/config.d.ts +11 -0
- package/dist/types/util/csv.d.mts +1 -0
- package/dist/types/util/csv.d.ts +19 -0
- package/dist/types/util/debounce.d.ts +7 -0
- package/dist/types/util/index.d.ts +10 -0
- package/dist/types/util/sanitizer.d.ts +11 -0
- package/package.json +147 -0
- package/scss/data-grid.scss +559 -0
- package/src/base-component.d.ts +19 -0
- package/src/base-component.js +90 -0
- package/src/data-grid.ts +2208 -0
- package/src/dom/data.js +59 -0
- package/src/dom/event-handler.d.ts +11 -0
- package/src/dom/event-handler.js +331 -0
- package/src/dom/manipulator.d.ts +9 -0
- package/src/dom/manipulator.js +75 -0
- package/src/engine/active-cell.ts +195 -0
- package/src/engine/data-source.ts +63 -0
- package/src/engine/scheduler.ts +42 -0
- package/src/engine/table.ts +122 -0
- package/src/engine/virtualizer.ts +57 -0
- package/src/filters.ts +176 -0
- package/src/icons.ts +60 -0
- package/src/index.ts +56 -0
- package/src/labels.ts +70 -0
- package/src/types.ts +334 -0
- package/src/ui/body.ts +348 -0
- package/src/ui/column-chooser.ts +183 -0
- package/src/ui/editor.ts +98 -0
- package/src/ui/filter-menu.ts +398 -0
- package/src/ui/header.ts +441 -0
- package/src/ui/loading.ts +39 -0
- package/src/ui/menu.ts +218 -0
- package/src/ui/pagination.ts +150 -0
- package/src/ui/pinning.ts +53 -0
- package/src/ui/toolbar.ts +144 -0
- package/src/ui/tooltip.ts +113 -0
- package/src/util/config.d.ts +11 -0
- package/src/util/config.js +69 -0
- package/src/util/csv.ts +85 -0
- package/src/util/debounce.ts +18 -0
- package/src/util/index.d.ts +10 -0
- package/src/util/index.js +310 -0
- package/src/util/sanitizer.d.ts +11 -0
- package/src/util/sanitizer.js +162 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* CoreUI PRO data-grid ui/tooltip.ts
|
|
4
|
+
* License (https://coreui.io/pro/license/)
|
|
5
|
+
* --------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
export interface GridTooltip {
|
|
8
|
+
dispose: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const createTooltip: (root: HTMLElement) => GridTooltip;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Hand-written types for the vendored config.js (see the provenance header there)
|
|
2
|
+
export default class Config {
|
|
3
|
+
static get Default(): unknown
|
|
4
|
+
static get DefaultType(): unknown
|
|
5
|
+
static get NAME(): string
|
|
6
|
+
|
|
7
|
+
_getConfig(config?: unknown): any
|
|
8
|
+
_configAfterMerge(config: any): any
|
|
9
|
+
_mergeConfigObj(config?: unknown, element?: Element): any
|
|
10
|
+
_typeCheckConfig(config: Record<string, unknown>, configTypes?: Record<string, string>): void
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './csv.js'
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* CoreUI PRO data-grid util/csv.ts
|
|
4
|
+
* License (https://coreui.io/pro/license/)
|
|
5
|
+
* --------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
import type { Table } from '@tanstack/table-core';
|
|
8
|
+
import type { DataGridItem } from '../types';
|
|
9
|
+
export interface CsvOptions {
|
|
10
|
+
scope?: 'filtered' | 'all' | 'selected';
|
|
11
|
+
delimiter?: string;
|
|
12
|
+
bom?: boolean;
|
|
13
|
+
sanitize?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface CsvDownloadOptions extends CsvOptions {
|
|
16
|
+
filename?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare const exportCsv: (table: Table<DataGridItem>, options?: CsvOptions) => string;
|
|
19
|
+
export declare const downloadCsv: (table: Table<DataGridItem>, options?: CsvDownloadOptions) => void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* --------------------------------------------------------------------------
|
|
3
|
+
* CoreUI PRO data-grid util/debounce.ts
|
|
4
|
+
* License (https://coreui.io/pro/license/)
|
|
5
|
+
* --------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
export declare const debounce: <Args extends unknown[]>(callback: (...args: Args) => void, delay: number) => ((...args: Args) => void);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Hand-written types for the vendored util/index.js (see the provenance header there)
|
|
2
|
+
export function defineJQueryPlugin(plugin: { NAME: string; jQueryInterface: (this: any, ...args: any[]) => unknown }): void
|
|
3
|
+
export function executeAfterTransition(callback: () => void, transitionElement: Element, waitForTransition?: boolean): void
|
|
4
|
+
export function getElement(object: unknown): HTMLElement | null
|
|
5
|
+
export function getjQuery(): unknown
|
|
6
|
+
export function getUID(prefix: string): string
|
|
7
|
+
export function isElement(object: unknown): boolean
|
|
8
|
+
export function isRTL(): boolean
|
|
9
|
+
export function isVisible(element: Element): boolean
|
|
10
|
+
export function toType(object: unknown): string
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Hand-written types for the vendored sanitizer.js (see the provenance header there)
|
|
2
|
+
export type Allowlist = Record<string, Array<string | RegExp>>
|
|
3
|
+
|
|
4
|
+
export declare const DefaultAllowlist: Allowlist
|
|
5
|
+
export declare const SVGAllowlist: Allowlist
|
|
6
|
+
export declare function escapeHtml(unsafeText: string): string
|
|
7
|
+
export declare function sanitizeHtml(
|
|
8
|
+
unsafeHtml: string,
|
|
9
|
+
allowList: Allowlist,
|
|
10
|
+
sanitizeFunction?: ((html: string) => string) | null
|
|
11
|
+
): string
|
package/package.json
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@coreui/data-grid",
|
|
3
|
+
"description": "High-performance vanilla JavaScript data grid for CoreUI — 100,000 rows with sorting, filtering, selection, pagination, and server-side data",
|
|
4
|
+
"version": "0.1.0-rc.0",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"coreui",
|
|
7
|
+
"data-grid",
|
|
8
|
+
"datagrid",
|
|
9
|
+
"grid",
|
|
10
|
+
"table",
|
|
11
|
+
"virtualization"
|
|
12
|
+
],
|
|
13
|
+
"homepage": "https://coreui.io",
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/coreui/coreui-data-grid/issues"
|
|
16
|
+
},
|
|
17
|
+
"author": "The CoreUI Team (https://github.com/orgs/coreui/people)",
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "npm-run-all clean --parallel css js",
|
|
20
|
+
"clean": "rimraf dist",
|
|
21
|
+
"css": "npm-run-all css-compile css-prefix css-minify",
|
|
22
|
+
"css-compile": "sass --style expanded --source-map --embed-sources --no-error-css scss/:dist/css/",
|
|
23
|
+
"css-minify": "cleancss -O1 --format breakWith=lf --with-rebase --source-map --source-map-inline-sources --output dist/css/ --batch --batch-suffix \".min\" \"dist/css/*.css\" \"!dist/css/*.min.css\"",
|
|
24
|
+
"css-prefix": "postcss --config build/postcss.config.mjs --replace \"dist/css/*.css\" \"!dist/css/*.min.css\"",
|
|
25
|
+
"css-watch": "sass --watch --style expanded --source-map --embed-sources --no-error-css scss/:dist/css/",
|
|
26
|
+
"js": "npm-run-all js-compile js-types js-minify",
|
|
27
|
+
"js-compile": "rollup --config build/rollup.config.mjs --sourcemap",
|
|
28
|
+
"js-minify": "npm-run-all --aggregate-output --parallel js-minify-*",
|
|
29
|
+
"js-types": "tsc --project tsconfig.types.json && mkdir -p dist/types/dom dist/types/util && cp src/*.d.ts dist/types/ && cp src/dom/*.d.ts dist/types/dom/ && cp src/util/*.d.ts dist/types/util/ && node build/types-esm-shims.mjs",
|
|
30
|
+
"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
|
+
"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
|
+
"test": "npm-run-all typecheck test-unit",
|
|
33
|
+
"test-unit": "vitest run",
|
|
34
|
+
"test:coverage": "vitest run --coverage",
|
|
35
|
+
"typecheck": "tsc --project src/__tests__/tsconfig.json"
|
|
36
|
+
},
|
|
37
|
+
"style": "dist/css/data-grid.css",
|
|
38
|
+
"sass": "scss/data-grid.scss",
|
|
39
|
+
"main": "dist/js/data-grid.js",
|
|
40
|
+
"module": "dist/js/data-grid.esm.js",
|
|
41
|
+
"types": "dist/types/index.d.ts",
|
|
42
|
+
"exports": {
|
|
43
|
+
".": {
|
|
44
|
+
"sass": "./scss/data-grid.scss",
|
|
45
|
+
"style": "./dist/css/data-grid.css",
|
|
46
|
+
"import": {
|
|
47
|
+
"types": "./dist/types/index.d.mts",
|
|
48
|
+
"default": "./dist/js/data-grid.mjs"
|
|
49
|
+
},
|
|
50
|
+
"require": {
|
|
51
|
+
"types": "./dist/types/index.d.ts",
|
|
52
|
+
"default": "./dist/js/data-grid.js"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"./labels": {
|
|
56
|
+
"import": {
|
|
57
|
+
"types": "./dist/types/labels.d.mts",
|
|
58
|
+
"default": "./dist/js/labels.mjs"
|
|
59
|
+
},
|
|
60
|
+
"require": {
|
|
61
|
+
"types": "./dist/types/labels.d.ts",
|
|
62
|
+
"default": "./dist/js/labels.cjs"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"./filters": {
|
|
66
|
+
"import": {
|
|
67
|
+
"types": "./dist/types/filters.d.mts",
|
|
68
|
+
"default": "./dist/js/filters.mjs"
|
|
69
|
+
},
|
|
70
|
+
"require": {
|
|
71
|
+
"types": "./dist/types/filters.d.ts",
|
|
72
|
+
"default": "./dist/js/filters.cjs"
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"./csv": {
|
|
76
|
+
"import": {
|
|
77
|
+
"types": "./dist/types/util/csv.d.mts",
|
|
78
|
+
"default": "./dist/js/csv.mjs"
|
|
79
|
+
},
|
|
80
|
+
"require": {
|
|
81
|
+
"types": "./dist/types/util/csv.d.ts",
|
|
82
|
+
"default": "./dist/js/csv.cjs"
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"./scss/*": "./scss/*",
|
|
86
|
+
"./dist/*": "./dist/*",
|
|
87
|
+
"./package.json": "./package.json"
|
|
88
|
+
},
|
|
89
|
+
"sideEffects": [
|
|
90
|
+
"*.css",
|
|
91
|
+
"*.scss"
|
|
92
|
+
],
|
|
93
|
+
"typesVersions": {
|
|
94
|
+
"*": {
|
|
95
|
+
"labels": [
|
|
96
|
+
"dist/types/labels.d.ts"
|
|
97
|
+
],
|
|
98
|
+
"csv": [
|
|
99
|
+
"dist/types/util/csv.d.ts"
|
|
100
|
+
],
|
|
101
|
+
"filters": [
|
|
102
|
+
"dist/types/filters.d.ts"
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"publishConfig": {
|
|
107
|
+
"access": "public"
|
|
108
|
+
},
|
|
109
|
+
"engines": {
|
|
110
|
+
"node": ">=20"
|
|
111
|
+
},
|
|
112
|
+
"repository": {
|
|
113
|
+
"type": "git",
|
|
114
|
+
"url": "git+https://github.com/coreui/coreui-data-grid.git"
|
|
115
|
+
},
|
|
116
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
117
|
+
"dependencies": {
|
|
118
|
+
"@tanstack/table-core": "^8.21.3",
|
|
119
|
+
"@tanstack/virtual-core": "^3.17.3"
|
|
120
|
+
},
|
|
121
|
+
"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
|
+
"@vitest/coverage-v8": "^4.1.10",
|
|
127
|
+
"autoprefixer": "^10.5.2",
|
|
128
|
+
"clean-css-cli": "^5.6.3",
|
|
129
|
+
"jsdom": "^29.1.1",
|
|
130
|
+
"npm-run-all": "^4.1.5",
|
|
131
|
+
"postcss": "^8.5.15",
|
|
132
|
+
"postcss-cli": "^11.0.1",
|
|
133
|
+
"rimraf": "^6.1.3",
|
|
134
|
+
"rollup": "^4.62.2",
|
|
135
|
+
"sass-embedded": "^1.100.0",
|
|
136
|
+
"terser": "5.48.0",
|
|
137
|
+
"tslib": "^2.8.1",
|
|
138
|
+
"typescript": "^5.9.3",
|
|
139
|
+
"vitest": "^4.1.10"
|
|
140
|
+
},
|
|
141
|
+
"files": [
|
|
142
|
+
"dist/{css,js,types}/**",
|
|
143
|
+
"scss/**/*.scss",
|
|
144
|
+
"src/**/*.{js,ts}",
|
|
145
|
+
"!src/**/__tests__/**"
|
|
146
|
+
]
|
|
147
|
+
}
|