tablevu 0.3.0-beta.2 → 0.3.0-beta.4
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 +25 -65
- package/dist/adapters/array.d.ts +3 -0
- package/dist/adapters/odata.d.ts +4 -0
- package/dist/index.d.ts +4 -5
- package/dist/table.d.ts +164 -163
- package/dist/tablevu.cjs +765 -0
- package/dist/tablevu.esm.js +759 -0
- package/dist/types/adapter.d.ts +15 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/odata.d.ts +27 -0
- package/dist/types/tablevu-column.d.ts +22 -0
- package/dist/types/tablevu-emits.d.ts +4 -0
- package/dist/types/tablevu-footer.d.ts +10 -0
- package/dist/types/tablevu-group.d.ts +6 -0
- package/dist/types/tablevu-page.d.ts +10 -0
- package/dist/types/tablevu-props.d.ts +19 -0
- package/dist/types/tablevu-settings.d.ts +15 -0
- package/dist/types/tablevu-sort.d.ts +5 -0
- package/dist/types/tablevu-spec.d.ts +26 -0
- package/dist/types/tablevu-status.d.ts +6 -0
- package/package.json +10 -29
- package/dist/array.d.ts +0 -14
- package/dist/odata.d.ts +0 -40
- package/dist/tablevu-index.esm.js +0 -1075
- package/dist/tablevu-index.umd.cjs.js +0 -1086
- package/dist/tablevu-odata.esm.js +0 -507
- package/dist/tablevu-odata.umd.cjs.js +0 -518
- package/dist/tablevu-table.esm.js +0 -551
- package/dist/tablevu-table.umd.cjs.js +0 -560
- package/dist/tablevu-webapi.esm.js +0 -19
- package/dist/tablevu-webapi.umd.cjs.js +0 -29
- package/dist/webapi.d.ts +0 -15
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { TablevuSort } from './tablevu-sort';
|
|
2
|
+
import type { TablevuColumn } from './tablevu-column';
|
|
3
|
+
export interface AdapterParams {
|
|
4
|
+
pageSize?: number;
|
|
5
|
+
currPage?: number;
|
|
6
|
+
sort?: TablevuSort[];
|
|
7
|
+
cols?: TablevuColumn[];
|
|
8
|
+
filter?: any;
|
|
9
|
+
search?: string | null;
|
|
10
|
+
}
|
|
11
|
+
export interface AdapterResult<T = any> {
|
|
12
|
+
rows: T[];
|
|
13
|
+
count: number;
|
|
14
|
+
}
|
|
15
|
+
export type AdapterFunction = (params: AdapterParams, data?: any[] | null) => Promise<AdapterResult>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from './tablevu-status';
|
|
2
|
+
export * from './tablevu-column';
|
|
3
|
+
export * from './tablevu-sort';
|
|
4
|
+
export * from './tablevu-group';
|
|
5
|
+
export * from './tablevu-page';
|
|
6
|
+
export * from './tablevu-footer';
|
|
7
|
+
export * from './tablevu-settings';
|
|
8
|
+
export * from './tablevu-props';
|
|
9
|
+
export * from './tablevu-emits';
|
|
10
|
+
export * from './tablevu-spec';
|
|
11
|
+
export * from './adapter';
|
|
12
|
+
export * from './odata';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export type FilterOperator = 'eq' | 'ne' | 'gt' | 'ge' | 'lt' | 'le' | 'contains' | 'startsWith' | 'endsWith' | 'in' | 'between' | 'isNull' | 'isNotNull' | 'and' | 'or' | 'not' | 'any' | 'all' | 'countGt' | 'countGe' | 'countLt' | 'countLe';
|
|
2
|
+
export interface Filter {
|
|
3
|
+
operator: FilterOperator;
|
|
4
|
+
field?: string;
|
|
5
|
+
column?: string;
|
|
6
|
+
value?: unknown;
|
|
7
|
+
filters?: Filter[];
|
|
8
|
+
filter?: Filter;
|
|
9
|
+
variable?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface ODataExpand {
|
|
12
|
+
name: string;
|
|
13
|
+
select?: string[];
|
|
14
|
+
filter?: Filter | string;
|
|
15
|
+
orderby?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface ODataOptions {
|
|
18
|
+
url: string;
|
|
19
|
+
select?: string[];
|
|
20
|
+
expand?: ODataExpand[];
|
|
21
|
+
filter?: Filter | string;
|
|
22
|
+
count?: boolean;
|
|
23
|
+
headers?: HeadersInit;
|
|
24
|
+
credentials?: RequestCredentials;
|
|
25
|
+
fetch?: typeof fetch;
|
|
26
|
+
onfetch?: (request: Request) => Request | Promise<Request>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface TablevuColumn {
|
|
2
|
+
name: string;
|
|
3
|
+
label?: string;
|
|
4
|
+
type?: 'string' | 'number' | 'numeric' | 'integer' | 'date' | 'time' | 'datetime' | 'boolean';
|
|
5
|
+
align?: 'left' | 'center' | 'right';
|
|
6
|
+
width?: string;
|
|
7
|
+
style?: Record<string, string>;
|
|
8
|
+
render?: (row: any) => any;
|
|
9
|
+
colspan?: number;
|
|
10
|
+
depth?: string[];
|
|
11
|
+
header?: {
|
|
12
|
+
colspan?: number;
|
|
13
|
+
style?: Record<string, string>;
|
|
14
|
+
align?: string;
|
|
15
|
+
};
|
|
16
|
+
popup?: boolean;
|
|
17
|
+
filter?: any;
|
|
18
|
+
searchable?: boolean;
|
|
19
|
+
resizable?: boolean;
|
|
20
|
+
draggable?: boolean;
|
|
21
|
+
visible?: boolean;
|
|
22
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { TablevuSettings } from './tablevu-settings';
|
|
2
|
+
import type { AdapterFunction } from './adapter';
|
|
3
|
+
import type { TablevuGroup } from './tablevu-group';
|
|
4
|
+
export interface TablevuProps {
|
|
5
|
+
settings?: TablevuSettings | null;
|
|
6
|
+
data?: any[] | AdapterFunction;
|
|
7
|
+
group?: string | TablevuGroup;
|
|
8
|
+
search?: string;
|
|
9
|
+
filter?: any;
|
|
10
|
+
command?: Array<{
|
|
11
|
+
name: 'refresh' | 'first' | 'prior' | 'next' | 'last' | 'go' | string;
|
|
12
|
+
page?: number;
|
|
13
|
+
}>;
|
|
14
|
+
rowid?: string;
|
|
15
|
+
onRowClick?: (event: MouseEvent, row: any) => void;
|
|
16
|
+
onRowDblClick?: (event: MouseEvent, row: any) => void;
|
|
17
|
+
class?: string;
|
|
18
|
+
style?: string | Record<string, string> | null;
|
|
19
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { TablevuGroup } from './tablevu-group';
|
|
2
|
+
import type { TablevuPageSettings } from './tablevu-page';
|
|
3
|
+
import type { TablevuSort } from './tablevu-sort';
|
|
4
|
+
import type { TablevuColumn } from './tablevu-column';
|
|
5
|
+
import type { TablevuFooterSettings } from './tablevu-footer';
|
|
6
|
+
export interface TablevuSettings {
|
|
7
|
+
group?: TablevuGroup;
|
|
8
|
+
page?: TablevuPageSettings;
|
|
9
|
+
sort?: TablevuSort[];
|
|
10
|
+
columns?: TablevuColumn[];
|
|
11
|
+
searchMinChar?: number;
|
|
12
|
+
footer?: TablevuFooterSettings;
|
|
13
|
+
onData?: (rows: any[]) => any[];
|
|
14
|
+
emptyMessage?: string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { TablevuGroup } from './tablevu-group';
|
|
2
|
+
import type { TablevuPage } from './tablevu-page';
|
|
3
|
+
import type { TablevuSort } from './tablevu-sort';
|
|
4
|
+
import type { TablevuColumn } from './tablevu-column';
|
|
5
|
+
import type { TablevuFooter } from './tablevu-footer';
|
|
6
|
+
import type { TablevuStatus } from './tablevu-status';
|
|
7
|
+
import type { TablevuSettings } from './tablevu-settings';
|
|
8
|
+
export interface TablevuSpec {
|
|
9
|
+
caption: any;
|
|
10
|
+
group: TablevuGroup & {
|
|
11
|
+
value: any;
|
|
12
|
+
content: any;
|
|
13
|
+
expandAll: boolean;
|
|
14
|
+
class: string;
|
|
15
|
+
};
|
|
16
|
+
page: TablevuPage;
|
|
17
|
+
sort: TablevuSort[];
|
|
18
|
+
columns: TablevuColumn[];
|
|
19
|
+
footer: TablevuFooter;
|
|
20
|
+
status: TablevuStatus;
|
|
21
|
+
time: number | null;
|
|
22
|
+
search: string | null;
|
|
23
|
+
filter: any;
|
|
24
|
+
onData?: (rows: any[]) => any[];
|
|
25
|
+
settings?: TablevuSettings;
|
|
26
|
+
}
|
package/package.json
CHANGED
|
@@ -1,53 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tablevu",
|
|
3
|
-
"version": "0.3.0-beta.
|
|
3
|
+
"version": "0.3.0-beta.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Vue 3 data table component",
|
|
6
|
-
"main": "dist/tablevu
|
|
7
|
-
"module": "dist/tablevu
|
|
6
|
+
"main": "dist/tablevu.cjs",
|
|
7
|
+
"module": "dist/tablevu.esm.js",
|
|
8
8
|
"types": "dist/index.d.ts",
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
|
-
"import": "./dist/tablevu
|
|
12
|
-
"require": "./dist/tablevu
|
|
13
|
-
|
|
14
|
-
},
|
|
15
|
-
"./table": {
|
|
16
|
-
"import": "./dist/tablevu-table.esm.js",
|
|
17
|
-
"require": "./dist/tablevu-table.umd.cjs.js",
|
|
18
|
-
"types": "./dist/table.d.ts"
|
|
19
|
-
},
|
|
20
|
-
"./odata": {
|
|
21
|
-
"import": "./dist/tablevu-odata.esm.js",
|
|
22
|
-
"require": "./dist/tablevu-odata.umd.cjs.js",
|
|
23
|
-
"types": "./dist/odata.d.ts"
|
|
24
|
-
},
|
|
25
|
-
"./webapi": {
|
|
26
|
-
"import": "./dist/tablevu-webapi.esm.js",
|
|
27
|
-
"require": "./dist/tablevu-webapi.umd.cjs.js",
|
|
28
|
-
"types": "./dist/webapi.d.ts"
|
|
11
|
+
"import": "./dist/tablevu.esm.js",
|
|
12
|
+
"require": "./dist/tablevu.cjs",
|
|
13
|
+
"types": "./dist/index.d.ts"
|
|
29
14
|
}
|
|
30
15
|
},
|
|
31
16
|
"files": ["dist"],
|
|
32
|
-
"scripts": {
|
|
33
|
-
"build": "rollup -c",
|
|
34
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
35
|
-
},
|
|
17
|
+
"scripts": { "build": "rollup -c" },
|
|
36
18
|
"keywords": ["table", "datatable", "vue3 table", "vue3 datatable", "vue 3 table", "vue 3 datatable"],
|
|
37
19
|
"author": "Ender Boz <ender.boz@gmail.com>",
|
|
38
20
|
"license": "MIT",
|
|
39
21
|
"repository": { "type": "git", "url": "git+https://github.com/endb/tablevu.git" },
|
|
40
22
|
"bugs": { "url": "https://github.com/endb/tablevu/issues" },
|
|
41
23
|
"homepage": "https://github.com/endb/tablevu#readme",
|
|
42
|
-
"
|
|
24
|
+
"peerDependencies": { "vue": ">=3.0.0" },
|
|
43
25
|
"devDependencies": {
|
|
44
26
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
45
27
|
"@types/node": "^20.14.2",
|
|
46
|
-
"
|
|
28
|
+
"vue": "^3.5.0",
|
|
47
29
|
"rollup": "^4.20.0",
|
|
48
|
-
"rollup-plugin-visualizer": "^5.12.0",
|
|
49
30
|
"rollup-plugin-vue": "^6.0.0",
|
|
50
31
|
"tslib": "^2.8.1",
|
|
51
32
|
"typescript": "^5.5.0"
|
|
52
33
|
}
|
|
53
|
-
}
|
|
34
|
+
}
|
package/dist/array.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { TablevuSort, TablevuColumn } from './table';
|
|
2
|
-
export interface ArrayAdapterParams {
|
|
3
|
-
pageSize?: number;
|
|
4
|
-
currPage?: number;
|
|
5
|
-
sort?: TablevuSort[];
|
|
6
|
-
cols?: TablevuColumn[];
|
|
7
|
-
filter?: any;
|
|
8
|
-
search?: string | null;
|
|
9
|
-
}
|
|
10
|
-
export interface AdapterResult<T = any> {
|
|
11
|
-
rows: T[];
|
|
12
|
-
count: number;
|
|
13
|
-
}
|
|
14
|
-
export default function adaptArray<T = any>(props: ArrayAdapterParams, data: T[]): Promise<AdapterResult<T>>;
|
package/dist/odata.d.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
export type FilterOperator = 'eq' | 'ne' | 'gt' | 'ge' | 'lt' | 'le' | 'contains' | 'startsWith' | 'endsWith' | 'in' | 'between' | 'isNull' | 'isNotNull' | 'and' | 'or' | 'not' | 'any' | 'all' | 'countGt' | 'countGe' | 'countLt' | 'countLe';
|
|
2
|
-
export interface Filter {
|
|
3
|
-
column?: string;
|
|
4
|
-
operator: FilterOperator;
|
|
5
|
-
value?: unknown;
|
|
6
|
-
filters?: Filter[];
|
|
7
|
-
func?: string;
|
|
8
|
-
params?: unknown[];
|
|
9
|
-
}
|
|
10
|
-
export interface Column {
|
|
11
|
-
name: string;
|
|
12
|
-
searchable?: boolean;
|
|
13
|
-
}
|
|
14
|
-
export interface Sort {
|
|
15
|
-
index?: number;
|
|
16
|
-
name?: string;
|
|
17
|
-
dir?: 'asc' | 'desc' | string;
|
|
18
|
-
}
|
|
19
|
-
export interface Expand {
|
|
20
|
-
name: string;
|
|
21
|
-
select?: string[];
|
|
22
|
-
}
|
|
23
|
-
export interface DataTableProps {
|
|
24
|
-
pageSize?: number;
|
|
25
|
-
currPage?: number;
|
|
26
|
-
filter?: Filter;
|
|
27
|
-
search?: string;
|
|
28
|
-
sort?: Sort[];
|
|
29
|
-
cols?: Column[];
|
|
30
|
-
}
|
|
31
|
-
export interface ODataOptions {
|
|
32
|
-
url: string;
|
|
33
|
-
headers?: Record<string, string>;
|
|
34
|
-
select?: string[];
|
|
35
|
-
expand?: Expand[];
|
|
36
|
-
filter?: Filter;
|
|
37
|
-
count?: boolean;
|
|
38
|
-
}
|
|
39
|
-
export declare function toODataFilter(filter: Filter): string;
|
|
40
|
-
export default function odata(options: ODataOptions, props?: DataTableProps): Request;
|