es-grid-template 0.0.4 → 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.
Files changed (64) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/LICENSE +19 -0
  3. package/README.md +1 -6
  4. package/{dist/components/GridTable → es}/CheckboxFilter.d.ts +1 -1
  5. package/es/CheckboxFilter.js +249 -0
  6. package/{dist/components/GridTable → es}/ColumnsChoose.d.ts +3 -2
  7. package/es/ColumnsChoose.js +213 -0
  8. package/{dist/components/GridTable → es}/ContextMenu.d.ts +1 -1
  9. package/es/ContextMenu.js +126 -0
  10. package/{dist/components/GridTable → es}/FilterSearch.d.ts +3 -3
  11. package/es/FilterSearch.js +33 -0
  12. package/es/GridTable.d.ts +7 -0
  13. package/es/GridTable.js +927 -0
  14. package/es/hooks/constant.js +214 -0
  15. package/es/hooks/index.js +5 -0
  16. package/{dist → es}/hooks/useColumns/index.d.ts +1 -1
  17. package/es/hooks/useColumns/index.js +25 -0
  18. package/{dist → es}/hooks/useIsOverflow.d.ts +1 -1
  19. package/es/hooks/useIsOverflow.js +17 -0
  20. package/es/hooks/useOnClickOutside.js +28 -0
  21. package/{dist → es}/hooks/utils.d.ts +7 -3
  22. package/es/hooks/utils.js +192 -0
  23. package/es/index.d.ts +2 -0
  24. package/es/index.js +2 -0
  25. package/es/styles.scss +30 -0
  26. package/es/type.d.ts +88 -0
  27. package/es/type.js +1 -0
  28. package/lib/CheckboxFilter.d.ts +19 -0
  29. package/lib/CheckboxFilter.js +257 -0
  30. package/lib/ColumnsChoose.d.ts +10 -0
  31. package/lib/ColumnsChoose.js +223 -0
  32. package/lib/ContextMenu.d.ts +20 -0
  33. package/lib/ContextMenu.js +135 -0
  34. package/lib/FilterSearch.d.ts +12 -0
  35. package/lib/FilterSearch.js +42 -0
  36. package/lib/GridTable.d.ts +7 -0
  37. package/lib/GridTable.js +936 -0
  38. package/lib/hooks/constant.d.ts +48 -0
  39. package/lib/hooks/constant.js +221 -0
  40. package/lib/hooks/index.d.ts +4 -0
  41. package/lib/hooks/index.js +49 -0
  42. package/lib/hooks/useColumns/index.d.ts +2 -0
  43. package/lib/hooks/useColumns/index.js +31 -0
  44. package/lib/hooks/useIsOverflow.d.ts +1 -0
  45. package/lib/hooks/useIsOverflow.js +26 -0
  46. package/lib/hooks/useOnClickOutside.d.ts +1 -0
  47. package/lib/hooks/useOnClickOutside.js +36 -0
  48. package/lib/hooks/utils.d.ts +18 -0
  49. package/lib/hooks/utils.js +215 -0
  50. package/lib/index.d.ts +2 -0
  51. package/lib/index.js +9 -0
  52. package/lib/styles.scss +30 -0
  53. package/lib/type.d.ts +88 -0
  54. package/lib/type.js +5 -0
  55. package/package.json +75 -94
  56. package/dist/components/GridTable/GridTable.d.ts +0 -6
  57. package/dist/components/GridTable/index.d.ts +0 -1
  58. package/dist/components/index.d.ts +0 -1
  59. package/dist/index.d.ts +0 -2
  60. package/dist/index.js +0 -53
  61. package/dist/type.d.ts +0 -45
  62. /package/{dist → es}/hooks/constant.d.ts +0 -0
  63. /package/{dist → es}/hooks/index.d.ts +0 -0
  64. /package/{dist → es}/hooks/useOnClickOutside.d.ts +0 -0
@@ -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
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
package/package.json CHANGED
@@ -1,94 +1,75 @@
1
- {
2
- "name": "es-grid-template",
3
- "version": "0.0.4",
4
- "description": "React",
5
- "main": "dist/index.js",
6
- "files": [
7
- "dist/**/*",
8
- "LICENSE",
9
- "README.md",
10
- "CHANGELOG.md"
11
- ],
12
- "types": "dist/index.d.ts",
13
- "scripts": {
14
- "test": "jest",
15
- "build:clean": "rimraf dist",
16
- "build:rollup": "rollup -c",
17
- "build": "npm-run-all build:clean build:rollup",
18
- "lint:ts": "eslint ./src --ext .ts,.tsx --config .eslintrc --fix",
19
- "lint:styles": "stylelint \"**/*.css\" --fix",
20
- "lint": "npm-run-all lint:ts lint:styles",
21
- "format": "prettier --write .",
22
- "semantic-release": "semantic-release"
23
- },
24
- "keywords": [
25
- "react"
26
- ],
27
- "author": "Taonv",
28
- "license": "MIT",
29
- "devDependencies": {
30
- "@rollup/plugin-commonjs": "^20.0.0",
31
- "@rollup/plugin-node-resolve": "^13.0.4",
32
- "@rollup/plugin-typescript": "^8.2.5",
33
- "@semantic-release/commit-analyzer": "^9.0.2",
34
- "@semantic-release/git": "^10.0.1",
35
- "@semantic-release/github": "^8.0.6",
36
- "@semantic-release/npm": "^9.0.1",
37
- "@semantic-release/release-notes-generator": "^10.0.3",
38
- "@testing-library/react": "^14.2.1",
39
- "@types/jest": "^29.5.12",
40
- "@types/react": "^18.2.58",
41
- "@types/react-resizable": "^3.0.7",
42
- "@typescript-eslint/eslint-plugin": "^5.39.0",
43
- "@typescript-eslint/parser": "^5.39.0",
44
- "antd-style": "^3.7.1",
45
- "classnames": "^2.5.1",
46
- "eslint": "^8.25.0",
47
- "eslint-config-prettier": "^8.5.0",
48
- "eslint-plugin-prettier": "^4.2.1",
49
- "eslint-plugin-react": "^7.31.8",
50
- "eslint-plugin-react-hooks": "^4.6.0",
51
- "eslint-plugin-simple-import-sort": "^8.0.0",
52
- "jest": "^29.7.0",
53
- "jest-css-modules": "^2.1.0",
54
- "jest-environment-jsdom": "^29.7.0",
55
- "npm-run-all": "^4.1.5",
56
- "postcss": "^8.4.35",
57
- "prettier": "^3.2.5",
58
- "react": "^18.2.0",
59
- "react-dom": "^18.2.0",
60
- "react-numeric-component": "^1.0.7",
61
- "react-resizable": "^3.0.5",
62
- "reactstrap": "^9.2.2",
63
- "rimraf": "^3.0.2",
64
- "rollup": "^2.56.2",
65
- "rollup-plugin-peer-deps-external": "^2.2.4",
66
- "rollup-plugin-postcss": "^4.0.1",
67
- "rollup-plugin-terser": "^7.0.2",
68
- "sass": "^1.71.1",
69
- "sass-loader": "^14.1.1",
70
- "styled-components": "^6.1.8",
71
- "stylelint": "^16.2.1",
72
- "stylelint-config-idiomatic-order": "^10.0.0",
73
- "stylelint-config-prettier": "^9.0.5",
74
- "stylelint-config-standard": "^36.0.0",
75
- "stylelint-order": "^6.0.4",
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.2"
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
@@ -1,2 +0,0 @@
1
- export * from './components';
2
- export * from './type';