@true-engineering/true-react-common-ui-kit 3.30.0 → 3.32.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/package.json CHANGED
@@ -1,98 +1,98 @@
1
- {
2
- "name": "@true-engineering/true-react-common-ui-kit",
3
- "version": "3.30.0",
4
- "description": "True Engineering React UI Kit with theming support",
5
- "author": "True Engineering (https://trueengineering.ru)",
6
- "keywords": [
7
- "TE",
8
- "True Engineering",
9
- "UI Kit with theming support",
10
- "UI Kit"
11
- ],
12
- "homepage": "",
13
- "license": "Apache-2.0",
14
- "type": "module",
15
- "types": "dist/index.d.ts",
16
- "main": "dist/true-react-common-ui-kit.umd.cjs",
17
- "module": "./dist/true-react-common-ui-kit.js",
18
- "directories": {
19
- "lib": "src"
20
- },
21
- "publishConfig": {
22
- "access": "public"
23
- },
24
- "files": [
25
- "src",
26
- "dist"
27
- ],
28
- "exports": {
29
- ".": {
30
- "require": "./dist/true-react-common-ui-kit.umd.cjs",
31
- "import": "./dist/true-react-common-ui-kit.js"
32
- },
33
- "./dist/style.css": "./dist/style.css",
34
- "./src": "./src/index.ts"
35
- },
36
- "scripts": {
37
- "build": "tsc && vite build",
38
- "lint": "eslint \"**/*.{js,jsx,ts,tsx}\"",
39
- "format": "prettier --write \"**/*.{js,jsx,css,json,ts,tsx}\"",
40
- "format:check": "prettier --check \"**/*.{js,jsx,css,json,ts,tsx}\"",
41
- "full-check": "yarn format:check && yarn lint",
42
- "types-check": "tsc --noEmit"
43
- },
44
- "dependencies": {
45
- "@floating-ui/react": "0.26.12",
46
- "@true-engineering/true-react-platform-helpers": "0.4.4",
47
- "clsx": "1.2.1",
48
- "country-flag-icons": "1.5.5",
49
- "date-fns": "2.29.3",
50
- "filesize": "10.1.1",
51
- "hex-to-rgba": "2.0.1",
52
- "jss": "10.10.0",
53
- "lodash-es": "4.17.21",
54
- "react": "18.2.0",
55
- "react-datepicker": "4.25.0",
56
- "react-dom": "18.2.0",
57
- "react-input-mask": "3.0.0-alpha.2",
58
- "react-jss": "10.10.0",
59
- "react-overlays": "5.2.1",
60
- "react-remove-scroll": "2.5.6",
61
- "react-transition-group": "4.4.5",
62
- "scroll-into-view-if-needed": "3.0.6",
63
- "ts-debounce": "4.0.0"
64
- },
65
- "devDependencies": {
66
- "@babel/core": "7.20.12",
67
- "@storybook/addon-essentials": "7.6.17",
68
- "@storybook/blocks": "7.6.17",
69
- "@storybook/react": "7.6.17",
70
- "@storybook/react-vite": "7.6.17",
71
- "@storybook/test": "7.6.17",
72
- "@swc/core": "^1.3.30",
73
- "@trivago/prettier-plugin-sort-imports": "4.3.0",
74
- "@types/lodash-es": "4.17.11",
75
- "@types/react": "18.2.79",
76
- "@types/react-datepicker": "4.19.4",
77
- "@types/react-dom": "18.2.25",
78
- "@types/react-input-mask": "3.0.2",
79
- "@types/react-transition-group": "4.4.10",
80
- "@typescript-eslint/eslint-plugin": "5.48.2",
81
- "@typescript-eslint/parser": "5.48.2",
82
- "@vitejs/plugin-react": "3.0.0",
83
- "eslint": "8.36.0",
84
- "eslint-config-prettier": "8.7.0",
85
- "eslint-plugin-import": "2.29.0",
86
- "eslint-plugin-react": "7.32.2",
87
- "eslint-plugin-react-hooks": "4.6.0",
88
- "prettier": "2.8.3",
89
- "rollup-plugin-swc3": "0.3.0",
90
- "typescript": "4.9.3",
91
- "unplugin-swc": "1.3.2",
92
- "vite": "4.0.0",
93
- "vite-plugin-dts": "3.7.3"
94
- },
95
- "resolutions": {
96
- "strip-ansi": "6.0.1"
97
- }
98
- }
1
+ {
2
+ "name": "@true-engineering/true-react-common-ui-kit",
3
+ "version": "3.32.0",
4
+ "description": "True Engineering React UI Kit with theming support",
5
+ "author": "True Engineering (https://trueengineering.ru)",
6
+ "keywords": [
7
+ "TE",
8
+ "True Engineering",
9
+ "UI Kit with theming support",
10
+ "UI Kit"
11
+ ],
12
+ "homepage": "",
13
+ "license": "Apache-2.0",
14
+ "type": "module",
15
+ "types": "dist/index.d.ts",
16
+ "main": "dist/true-react-common-ui-kit.umd.cjs",
17
+ "module": "./dist/true-react-common-ui-kit.js",
18
+ "directories": {
19
+ "lib": "src"
20
+ },
21
+ "publishConfig": {
22
+ "access": "public"
23
+ },
24
+ "files": [
25
+ "src",
26
+ "dist"
27
+ ],
28
+ "exports": {
29
+ ".": {
30
+ "require": "./dist/true-react-common-ui-kit.umd.cjs",
31
+ "import": "./dist/true-react-common-ui-kit.js"
32
+ },
33
+ "./dist/style.css": "./dist/style.css",
34
+ "./src": "./src/index.ts"
35
+ },
36
+ "scripts": {
37
+ "build": "tsc && vite build",
38
+ "lint": "eslint \"**/*.{js,jsx,ts,tsx}\"",
39
+ "format": "prettier --write \"**/*.{js,jsx,css,json,ts,tsx}\"",
40
+ "format:check": "prettier --check \"**/*.{js,jsx,css,json,ts,tsx}\"",
41
+ "full-check": "yarn format:check && yarn lint",
42
+ "types-check": "tsc --noEmit"
43
+ },
44
+ "dependencies": {
45
+ "@floating-ui/react": "0.26.12",
46
+ "@true-engineering/true-react-platform-helpers": "0.4.4",
47
+ "clsx": "1.2.1",
48
+ "country-flag-icons": "1.5.5",
49
+ "date-fns": "2.29.3",
50
+ "filesize": "10.1.1",
51
+ "hex-to-rgba": "2.0.1",
52
+ "jss": "10.10.0",
53
+ "lodash-es": "4.17.21",
54
+ "react": "18.2.0",
55
+ "react-datepicker": "4.25.0",
56
+ "react-dom": "18.2.0",
57
+ "react-input-mask": "3.0.0-alpha.2",
58
+ "react-jss": "10.10.0",
59
+ "react-overlays": "5.2.1",
60
+ "react-remove-scroll": "2.5.6",
61
+ "react-transition-group": "4.4.5",
62
+ "scroll-into-view-if-needed": "3.0.6",
63
+ "ts-debounce": "4.0.0"
64
+ },
65
+ "devDependencies": {
66
+ "@babel/core": "7.20.12",
67
+ "@storybook/addon-essentials": "7.6.17",
68
+ "@storybook/blocks": "7.6.17",
69
+ "@storybook/react": "7.6.17",
70
+ "@storybook/react-vite": "7.6.17",
71
+ "@storybook/test": "7.6.17",
72
+ "@swc/core": "^1.3.30",
73
+ "@trivago/prettier-plugin-sort-imports": "4.3.0",
74
+ "@types/lodash-es": "4.17.11",
75
+ "@types/react": "18.2.79",
76
+ "@types/react-datepicker": "4.19.4",
77
+ "@types/react-dom": "18.2.25",
78
+ "@types/react-input-mask": "3.0.2",
79
+ "@types/react-transition-group": "4.4.10",
80
+ "@typescript-eslint/eslint-plugin": "5.48.2",
81
+ "@typescript-eslint/parser": "5.48.2",
82
+ "@vitejs/plugin-react": "3.0.0",
83
+ "eslint": "8.36.0",
84
+ "eslint-config-prettier": "8.7.0",
85
+ "eslint-plugin-import": "2.29.0",
86
+ "eslint-plugin-react": "7.32.2",
87
+ "eslint-plugin-react-hooks": "4.6.0",
88
+ "prettier": "2.8.3",
89
+ "rollup-plugin-swc3": "0.3.0",
90
+ "typescript": "4.9.3",
91
+ "unplugin-swc": "1.3.2",
92
+ "vite": "4.0.0",
93
+ "vite-plugin-dts": "3.7.3"
94
+ },
95
+ "resolutions": {
96
+ "strip-ansi": "6.0.1"
97
+ }
98
+ }
@@ -1,64 +1,70 @@
1
- import { CSSProperties, ReactNode } from 'react';
2
- import { IRenderNode } from '../../types';
3
-
4
- export type IFlexibleTableRenderMode = 'table' | 'divs';
5
-
6
- export type IFlexibleTableRender = Record<
7
- 'Root' | 'Head' | 'Body' | 'Row' | 'Header' | 'Cell',
8
- keyof JSX.IntrinsicElements
9
- >;
10
-
11
- // TODO: Заменить Record<string, any> на Record<string, unknown>
12
- export type ITableRow = Record<string, any>;
13
-
14
- export type IHeaderContent<T extends ITableRow> = Partial<Record<keyof T, unknown>>;
15
-
16
- export interface ITitleComponentProps<Value> {
17
- value?: Value;
18
- }
19
-
20
- export interface IValueComponentProps<Values, Value> {
21
- value: Value;
22
- row: Values;
23
- isFocusedRow?: boolean;
24
- isActiveRow?: boolean;
25
- isNestedComponentExpanded: boolean;
26
- isRowNestedComponentExpanded: boolean;
27
- onSetNestedComponent: (component?: ReactNode) => void;
28
- }
29
-
30
- export type IFlexibleTableConfigType<
31
- Values extends ITableRow,
32
- HeaderContent extends IHeaderContent<Values> = IHeaderContent<Values>,
33
- > = {
34
- [Key in keyof Values]?: {
35
- title?: IRenderNode<ITitleComponentProps<HeaderContent[Key]>>;
36
- component?: IRenderNode<IValueComponentProps<Values, NonNullable<Values[Key]>>>;
37
- dateFormat?: string;
38
- minWidth?: string | number;
39
- width?: string | number;
40
- maxWidth?: string | number;
41
- /** @default 'left' */
42
- titleAlign?: CSSProperties['textAlign'];
43
- cellAlign?: CSSProperties['textAlign'];
44
- cellVerticalAlign?: CSSProperties['verticalAlign'];
45
- position?: CSSProperties['position'];
46
- right?: number;
47
- left?: number;
48
- shouldRenderDataId?: boolean;
49
- };
50
- };
51
-
52
- export interface IInfinityScrollConfig {
53
- activePage: number;
54
- totalPages: number;
55
- isLoading: boolean;
56
- isLastPage: boolean;
57
- onInfinityScroll: (skip: number) => void;
58
- }
59
-
60
- export interface INestedComponent {
61
- isOpen: boolean;
62
- component?: ReactNode;
63
- cellKey?: string;
64
- }
1
+ import { CSSProperties, ReactNode } from 'react';
2
+ import { IRenderNode } from '../../types';
3
+
4
+ export type IFlexibleTableRenderMode = 'table' | 'divs';
5
+
6
+ export type IFlexibleTableRender = Record<
7
+ 'Root' | 'Head' | 'Body' | 'Row' | 'Header' | 'Cell',
8
+ keyof JSX.IntrinsicElements
9
+ >;
10
+
11
+ // TODO: Заменить Record<string, any> на Record<string, unknown>
12
+ export type ITableRow = Record<string, any>;
13
+
14
+ export type IHeaderContent<T extends ITableRow> = Partial<Record<keyof T, unknown>>;
15
+
16
+ export interface ITitleComponentProps<Value> {
17
+ value?: Value;
18
+ }
19
+
20
+ export interface IValueComponentProps<Values, Value> {
21
+ value: Value;
22
+ row: Values;
23
+ isFocusedRow?: boolean;
24
+ isActiveRow?: boolean;
25
+ isNestedComponentExpanded: boolean;
26
+ isRowNestedComponentExpanded: boolean;
27
+ onSetNestedComponent: (component?: ReactNode) => void;
28
+ }
29
+
30
+ export interface IFlexibleTableRowConfig<
31
+ Values extends ITableRow,
32
+ Key extends keyof Values,
33
+ HeaderContent extends IHeaderContent<Values> = IHeaderContent<Values>,
34
+ > {
35
+ title?: IRenderNode<ITitleComponentProps<HeaderContent[Key]>>;
36
+ component?: IRenderNode<IValueComponentProps<Values, NonNullable<Values[Key]>>>;
37
+ dateFormat?: string;
38
+ minWidth?: string | number;
39
+ width?: string | number;
40
+ maxWidth?: string | number;
41
+ /** @default 'left' */
42
+ titleAlign?: CSSProperties['textAlign'];
43
+ cellAlign?: CSSProperties['textAlign'];
44
+ cellVerticalAlign?: CSSProperties['verticalAlign'];
45
+ position?: CSSProperties['position'];
46
+ right?: number;
47
+ left?: number;
48
+ shouldRenderDataId?: boolean;
49
+ }
50
+
51
+ export type IFlexibleTableConfigType<
52
+ Values extends ITableRow,
53
+ HeaderContent extends IHeaderContent<Values> = IHeaderContent<Values>,
54
+ > = {
55
+ [Key in keyof Values]?: IFlexibleTableRowConfig<Values, Key, HeaderContent>;
56
+ };
57
+
58
+ export interface IInfinityScrollConfig {
59
+ activePage: number;
60
+ totalPages: number;
61
+ isLoading: boolean;
62
+ isLastPage: boolean;
63
+ onInfinityScroll: (skip: number) => void;
64
+ }
65
+
66
+ export interface INestedComponent {
67
+ isOpen: boolean;
68
+ component?: ReactNode;
69
+ cellKey?: string;
70
+ }