es-grid-template 0.0.5 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/LICENSE +19 -0
- package/README.md +1 -6
- package/{dist/components/GridTable → es}/CheckboxFilter.d.ts +1 -1
- package/es/CheckboxFilter.js +249 -0
- package/{dist/components/GridTable → es}/ColumnsChoose.d.ts +3 -2
- package/es/ColumnsChoose.js +213 -0
- package/{dist/components/GridTable → es}/ContextMenu.d.ts +1 -1
- package/es/ContextMenu.js +126 -0
- package/{dist/components/GridTable → es}/FilterSearch.d.ts +3 -3
- package/es/FilterSearch.js +33 -0
- package/es/GridTable.d.ts +7 -0
- package/es/GridTable.js +927 -0
- package/es/hooks/constant.js +214 -0
- package/es/hooks/index.js +5 -0
- package/{dist → es}/hooks/useColumns/index.d.ts +1 -1
- package/es/hooks/useColumns/index.js +25 -0
- package/{dist → es}/hooks/useIsOverflow.d.ts +1 -1
- package/es/hooks/useIsOverflow.js +17 -0
- package/es/hooks/useOnClickOutside.js +28 -0
- package/{dist → es}/hooks/utils.d.ts +6 -6
- package/es/hooks/utils.js +192 -0
- package/es/index.d.ts +2 -0
- package/es/index.js +2 -0
- package/es/styles.scss +30 -0
- package/es/type.d.ts +88 -0
- package/es/type.js +1 -0
- package/lib/CheckboxFilter.d.ts +19 -0
- package/lib/CheckboxFilter.js +257 -0
- package/lib/ColumnsChoose.d.ts +10 -0
- package/lib/ColumnsChoose.js +223 -0
- package/lib/ContextMenu.d.ts +20 -0
- package/lib/ContextMenu.js +135 -0
- package/lib/FilterSearch.d.ts +12 -0
- package/lib/FilterSearch.js +42 -0
- package/lib/GridTable.d.ts +7 -0
- package/lib/GridTable.js +936 -0
- package/lib/hooks/constant.d.ts +48 -0
- package/lib/hooks/constant.js +221 -0
- package/lib/hooks/index.d.ts +4 -0
- package/lib/hooks/index.js +49 -0
- package/lib/hooks/useColumns/index.d.ts +2 -0
- package/lib/hooks/useColumns/index.js +31 -0
- package/lib/hooks/useIsOverflow.d.ts +1 -0
- package/lib/hooks/useIsOverflow.js +26 -0
- package/lib/hooks/useOnClickOutside.d.ts +1 -0
- package/lib/hooks/useOnClickOutside.js +36 -0
- package/lib/hooks/utils.d.ts +18 -0
- package/lib/hooks/utils.js +215 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +9 -0
- package/lib/styles.scss +30 -0
- package/lib/type.d.ts +88 -0
- package/lib/type.js +5 -0
- package/package.json +75 -94
- package/dist/components/GridTable/GridTable.d.ts +0 -6
- package/dist/components/GridTable/index.d.ts +0 -1
- package/dist/components/index.d.ts +0 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -53
- package/dist/type.d.ts +0 -44
- /package/{dist → es}/hooks/constant.d.ts +0 -0
- /package/{dist → es}/hooks/index.d.ts +0 -0
- /package/{dist → es}/hooks/useOnClickOutside.d.ts +0 -0
package/lib/styles.scss
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
$prefix : 'ui-rc'!default;
|
|
2
|
+
.popup-context-menu {
|
|
3
|
+
min-width: 200px;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.ui-rc-table-wrapper{
|
|
7
|
+
&.table-none-column-select {
|
|
8
|
+
.#{$prefix}-table-cell {
|
|
9
|
+
&.#{$prefix}-table-selection-column {
|
|
10
|
+
padding: 0!important;
|
|
11
|
+
overflow: hidden !important;
|
|
12
|
+
border-inline-end: 0 !important;
|
|
13
|
+
//flex: 0 0 0 !important;
|
|
14
|
+
//width: 0 !important;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
//
|
|
21
|
+
//.ui-rc-table-wrapper {
|
|
22
|
+
// &.table-none-column-select {
|
|
23
|
+
// .ui-rc-table-cell {
|
|
24
|
+
// &.ui-rc-table-selection-column {
|
|
25
|
+
// padding: 0!important;
|
|
26
|
+
// overflow: hidden !important;
|
|
27
|
+
// }
|
|
28
|
+
// }
|
|
29
|
+
// }
|
|
30
|
+
//}
|
package/lib/type.d.ts
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import type { TableProps, TableColumnType as RcColumnType } from "ui-rc";
|
|
2
|
+
import type { Key, ReactElement, ReactNode } from "react";
|
|
3
|
+
import type React from "react";
|
|
4
|
+
import type { IOperator } from "./hooks";
|
|
5
|
+
import type { FilterOperator, TableRowSelection } from "ui-rc/dist/table/interface";
|
|
6
|
+
import type { ToolbarItem } from "ui-rc/dist/toolbar";
|
|
7
|
+
import type { ItemType } from "ui-rc/dist/menu/interface";
|
|
8
|
+
export type IColumnType = "number" | "time" | "date" | "week" | "month" | "file" | "quarter" | "year" | "datetime" | "string" | "boolean" | "checkbox" | "color" | null | undefined;
|
|
9
|
+
export type AnyObject = Record<PropertyKey, any>;
|
|
10
|
+
export interface ColumnGroupType<RecordType = AnyObject> extends Omit<ColumnType<RecordType>, 'dataIndex'> {
|
|
11
|
+
children: ColumnsType<RecordType>;
|
|
12
|
+
}
|
|
13
|
+
export type ColumnType<RecordType> = RcColumnType<RecordType> & {
|
|
14
|
+
type?: IColumnType;
|
|
15
|
+
isSummary?: boolean;
|
|
16
|
+
summaryTemplate?: (data: number, key: string) => ReactElement | ReactNode;
|
|
17
|
+
maxWidth?: string | number;
|
|
18
|
+
format?: IFormat;
|
|
19
|
+
allowFiltering?: boolean;
|
|
20
|
+
operator?: FilterOperator;
|
|
21
|
+
placeholder?: string;
|
|
22
|
+
showInColumnChoose?: boolean;
|
|
23
|
+
};
|
|
24
|
+
export type ColumnsType<RecordType = AnyObject> = (ColumnGroupType<RecordType> | ColumnType<RecordType>)[];
|
|
25
|
+
export interface GridTableProps<RecordType> extends Omit<TableProps<RecordType>, 'columns' | 'rowSelection'> {
|
|
26
|
+
columns?: ColumnsType<RecordType>;
|
|
27
|
+
format?: IFormat;
|
|
28
|
+
t?: any;
|
|
29
|
+
lang?: string;
|
|
30
|
+
contextMenuItems?: any[];
|
|
31
|
+
contextMenuHidden?: string[] | ((args?: Omit<ContextInfo<RecordType>, 'item' | 'event'>) => string[]);
|
|
32
|
+
contextMenuOpen?: (args: Omit<ContextInfo<RecordType>, 'item'>) => void;
|
|
33
|
+
contextMenuClick?: (args: ContextInfo<RecordType>) => void;
|
|
34
|
+
recordDoubleClick?: (args: RecordDoubleClickEventArgs<RecordType>) => void;
|
|
35
|
+
toolbarItems?: ToolbarItem[];
|
|
36
|
+
showColumnChoose?: boolean;
|
|
37
|
+
onFilter?: (query: {
|
|
38
|
+
field: string;
|
|
39
|
+
key: string;
|
|
40
|
+
operator: IOperator;
|
|
41
|
+
predicate: 'and' | 'or';
|
|
42
|
+
value: any;
|
|
43
|
+
}[]) => void;
|
|
44
|
+
selectionSettings?: SelectionSettings;
|
|
45
|
+
rowKey?: string;
|
|
46
|
+
rowSelection?: RowSelection<RecordType>;
|
|
47
|
+
rowSelected?: (args: {
|
|
48
|
+
type: string;
|
|
49
|
+
rowData: RecordType;
|
|
50
|
+
selected: RecordType | RecordType[];
|
|
51
|
+
}) => void;
|
|
52
|
+
}
|
|
53
|
+
export type RowSelection<RecordType> = Omit<TableRowSelection<RecordType>, 'type' | 'columnWidth' | 'hideSelectAll' | 'defaultSelectedRowKeys'>;
|
|
54
|
+
export type SelectionSettings = {
|
|
55
|
+
mode?: 'checkbox' | 'radio';
|
|
56
|
+
type?: 'single' | 'multiple';
|
|
57
|
+
checkboxOnly?: boolean;
|
|
58
|
+
hideSelectAll?: boolean;
|
|
59
|
+
columnWidth?: number | string;
|
|
60
|
+
defaultSelectedRowKeys?: Key[];
|
|
61
|
+
};
|
|
62
|
+
export type RecordDoubleClickEventArgs<RecordType> = {
|
|
63
|
+
rowData: RecordType;
|
|
64
|
+
rowIndex: number | undefined;
|
|
65
|
+
e: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>;
|
|
66
|
+
};
|
|
67
|
+
export type ContextInfo<RecordType> = {
|
|
68
|
+
rowInfo: {
|
|
69
|
+
rowData: RecordType | null;
|
|
70
|
+
};
|
|
71
|
+
event: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>;
|
|
72
|
+
item: ItemType;
|
|
73
|
+
};
|
|
74
|
+
export type IFormat = {
|
|
75
|
+
thousandSeparator?: string;
|
|
76
|
+
decimalSeparator?: string;
|
|
77
|
+
decimalScale?: number | undefined;
|
|
78
|
+
allowNegative?: boolean;
|
|
79
|
+
prefix?: string | undefined;
|
|
80
|
+
suffix?: string | undefined;
|
|
81
|
+
fixedDecimalScale?: boolean;
|
|
82
|
+
dateFormat?: string;
|
|
83
|
+
datetimeFormat?: string;
|
|
84
|
+
timeFormat?: string;
|
|
85
|
+
weekFormat?: string;
|
|
86
|
+
monthFormat?: string;
|
|
87
|
+
yearFormat?: string;
|
|
88
|
+
};
|
package/lib/type.js
ADDED
package/package.json
CHANGED
|
@@ -1,94 +1,75 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "es-grid-template",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"@
|
|
34
|
-
"@
|
|
35
|
-
"@
|
|
36
|
-
"@
|
|
37
|
-
"@
|
|
38
|
-
"@
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"jest
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
"stylelint-prettier": "^5.0.0",
|
|
77
|
-
"ts-jest": "^29.1.2",
|
|
78
|
-
"tslib": "^2.6.2",
|
|
79
|
-
"typescript": "^5.3.3",
|
|
80
|
-
"ui-rc": "^0.1.4"
|
|
81
|
-
},
|
|
82
|
-
"peerDependencies": {
|
|
83
|
-
"react": ">=16.8.6",
|
|
84
|
-
"react-dom": ">=16.8.6"
|
|
85
|
-
},
|
|
86
|
-
"publishConfig": {
|
|
87
|
-
"access": "public"
|
|
88
|
-
},
|
|
89
|
-
"dependencies": {
|
|
90
|
-
"antd": "^5.24.1",
|
|
91
|
-
"dayjs": "^1.11.13",
|
|
92
|
-
"moment": "^2.30.1"
|
|
93
|
-
}
|
|
94
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "es-grid-template",
|
|
3
|
+
"version": "0.0.7",
|
|
4
|
+
"description": "es-grid-template",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"react",
|
|
7
|
+
"react-component",
|
|
8
|
+
"grid",
|
|
9
|
+
"table"
|
|
10
|
+
],
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"main": "lib/index",
|
|
13
|
+
"module": "es/index",
|
|
14
|
+
"files": [
|
|
15
|
+
"lib",
|
|
16
|
+
"es",
|
|
17
|
+
"assets/*.css",
|
|
18
|
+
"assets/*.less"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"compile": "father build",
|
|
22
|
+
"docs:build": "dumi build",
|
|
23
|
+
"docs:deploy": "gh-pages -d dist",
|
|
24
|
+
"lint": "eslint src/ --ext .tsx,.ts,.jsx,.js",
|
|
25
|
+
"now-build": "npm run docs:build",
|
|
26
|
+
"prepare": "dumi setup",
|
|
27
|
+
"prepublishOnly": "npm run compile && np --no-cleanup --yolo --no-publish",
|
|
28
|
+
"postpublish": "npm run docs:build && npm run docs:deploy",
|
|
29
|
+
"start": "dumi dev",
|
|
30
|
+
"test": "rc-test"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@babel/runtime": "^7.11.2",
|
|
34
|
+
"@rc-component/father-plugin": "^2.0.1",
|
|
35
|
+
"@rc-component/trigger": "^2.0.0",
|
|
36
|
+
"@rc-component/util": "^1.0.1",
|
|
37
|
+
"@types/react-resizable": "^3.0.8",
|
|
38
|
+
"@types/styled-components": "^5.1.34",
|
|
39
|
+
"antd": "^5.24.1",
|
|
40
|
+
"antd-style": "^3.7.1",
|
|
41
|
+
"classnames": "^2.3.1",
|
|
42
|
+
"dayjs": "^1.11.13",
|
|
43
|
+
"moment": "^2.30.1",
|
|
44
|
+
"react-numeric-component": "^1.0.7",
|
|
45
|
+
"react-resizable": "^3.0.5",
|
|
46
|
+
"styled-components": "^6.1.15",
|
|
47
|
+
"ui-rc": "^0.1.5"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@babel/cli": "^7.26.4",
|
|
51
|
+
"@babel/preset-env": "^7.26.9",
|
|
52
|
+
"@rc-component/np": "^1.0.3",
|
|
53
|
+
"@testing-library/react": "^14.0.0",
|
|
54
|
+
"@types/jest": "^29.4.0",
|
|
55
|
+
"@types/react": "^18.0.26",
|
|
56
|
+
"@types/react-dom": "^18.0.10",
|
|
57
|
+
"@types/warning": "^3.0.0",
|
|
58
|
+
"cross-env": "^7.0.0",
|
|
59
|
+
"dumi": "^2.2.13",
|
|
60
|
+
"eslint": "^8.56.0",
|
|
61
|
+
"eslint-plugin-unicorn": "^55.0.0",
|
|
62
|
+
"father": "^4.0.0",
|
|
63
|
+
"gh-pages": "^3.1.0",
|
|
64
|
+
"less": "^4.1.1",
|
|
65
|
+
"np": "^7.1.0",
|
|
66
|
+
"rc-test": "^7.0.9",
|
|
67
|
+
"react": "^18.2.0",
|
|
68
|
+
"react-dom": "^18.2.0",
|
|
69
|
+
"typescript": "^4.0.5"
|
|
70
|
+
},
|
|
71
|
+
"peerDependencies": {
|
|
72
|
+
"react": ">=16.9.0",
|
|
73
|
+
"react-dom": ">=16.9.0"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { GridTableProps } from "../../type";
|
|
3
|
-
import 'dayjs/locale/es';
|
|
4
|
-
import 'dayjs/locale/vi';
|
|
5
|
-
import './styles.scss';
|
|
6
|
-
export declare const GridTable: <RecordType extends object>(props: GridTableProps<RecordType>) => React.JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './GridTable';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './GridTable';
|
package/dist/index.d.ts
DELETED