@bigbinary/neeto-team-members-frontend 2.3.0 → 2.3.3
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 +1 -1
- package/dist/index.cjs.js +36 -26
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +36 -26
- package/dist/index.esm.js.map +1 -1
- package/package.json +23 -35
- package/types.d.ts +68 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigbinary/neeto-team-members-frontend",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.3",
|
|
4
4
|
"description": "To manage team members across neeto products.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"homepage": "https://github.com/bigbinary/neeto-team-members-frontend#readme",
|
|
@@ -10,13 +10,15 @@
|
|
|
10
10
|
"repository": "github:bigbinary/neeto-team-members-frontend",
|
|
11
11
|
"author": "BigBinary",
|
|
12
12
|
"files": [
|
|
13
|
-
"dist"
|
|
13
|
+
"dist",
|
|
14
|
+
"types.d.ts"
|
|
14
15
|
],
|
|
15
16
|
"main": "dist/index.cjs.js",
|
|
16
17
|
"module": "dist/index.esm.js",
|
|
18
|
+
"types": "types.d.ts",
|
|
17
19
|
"scripts": {
|
|
18
20
|
"build": "NODE_ENV=production rollup -c --environment production",
|
|
19
|
-
"dev": "(trap 'kill 0' SIGINT;
|
|
21
|
+
"dev": "(trap 'kill 0' SIGINT; rollup -wc & vite & yarn server)",
|
|
20
22
|
"prepare": "husky install",
|
|
21
23
|
"server": "node example/db",
|
|
22
24
|
"start": "NODE_ENV=development webpack-dev-server --open --mode development --config webpack.dev.config.js"
|
|
@@ -37,35 +39,34 @@
|
|
|
37
39
|
},
|
|
38
40
|
"dependencies": {},
|
|
39
41
|
"devDependencies": {
|
|
40
|
-
"@babel/core": "7.
|
|
42
|
+
"@babel/core": "7.19.0",
|
|
41
43
|
"@babel/eslint-parser": "7.18.9",
|
|
42
44
|
"@babel/plugin-proposal-class-properties": "7.18.6",
|
|
45
|
+
"@babel/plugin-proposal-nullish-coalescing-operator": "7.18.6",
|
|
46
|
+
"@babel/plugin-proposal-numeric-separator": "7.18.6",
|
|
47
|
+
"@babel/plugin-proposal-optional-chaining": "^7.18.9",
|
|
43
48
|
"@babel/plugin-transform-runtime": "7.18.10",
|
|
44
|
-
"@babel/preset-env": "7.
|
|
49
|
+
"@babel/preset-env": "7.19.0",
|
|
45
50
|
"@babel/preset-react": "7.18.6",
|
|
46
|
-
"@babel/runtime": "7.
|
|
51
|
+
"@babel/runtime": "7.19.0",
|
|
47
52
|
"@bigbinary/eslint-plugin-neeto": "1.0.12",
|
|
48
|
-
"@bigbinary/neeto-icons": "1.8.
|
|
53
|
+
"@bigbinary/neeto-icons": "1.8.38",
|
|
49
54
|
"@bigbinary/neetoui": "3.5.17",
|
|
50
55
|
"@faker-js/faker": "7.5.0",
|
|
51
|
-
"@pmmmwh/react-refresh-webpack-plugin": "0.5.7",
|
|
52
56
|
"@rollup/plugin-alias": "3.1.9",
|
|
53
57
|
"@rollup/plugin-babel": "5.3.1",
|
|
54
58
|
"@rollup/plugin-commonjs": "22.0.2",
|
|
55
59
|
"@rollup/plugin-json": "4.1.0",
|
|
56
|
-
"@rollup/plugin-node-resolve": "
|
|
60
|
+
"@rollup/plugin-node-resolve": "14.0.1",
|
|
57
61
|
"@rollup/plugin-replace": "4.0.0",
|
|
58
62
|
"@svgr/rollup": "6.3.1",
|
|
59
|
-
"
|
|
63
|
+
"@vitejs/plugin-react": "^2.1.0",
|
|
64
|
+
"antd": "4.23.1",
|
|
60
65
|
"axios": "0.27.2",
|
|
61
|
-
"babel-loader": "8.2.5",
|
|
62
66
|
"babel-plugin-macros": "3.1.0",
|
|
63
67
|
"babel-plugin-transform-react-remove-prop-types": "0.4.24",
|
|
64
68
|
"classnames": "2.3.1",
|
|
65
|
-
"
|
|
66
|
-
"css-loader": "6.7.1",
|
|
67
|
-
"dotenv": "16.0.2",
|
|
68
|
-
"eslint": "8.23.0",
|
|
69
|
+
"eslint": "8.23.1",
|
|
69
70
|
"eslint-config-prettier": "8.5.0",
|
|
70
71
|
"eslint-plugin-cypress": "2.12.1",
|
|
71
72
|
"eslint-plugin-import": "2.26.0",
|
|
@@ -73,54 +74,41 @@
|
|
|
73
74
|
"eslint-plugin-json": "3.1.0",
|
|
74
75
|
"eslint-plugin-prettier": "4.2.1",
|
|
75
76
|
"eslint-plugin-promise": "6.0.1",
|
|
76
|
-
"eslint-plugin-react": "7.31.
|
|
77
|
+
"eslint-plugin-react": "7.31.8",
|
|
77
78
|
"eslint-plugin-react-hooks": "4.6.0",
|
|
78
79
|
"eslint-plugin-unicorn": "43.0.2",
|
|
79
80
|
"eslint-plugin-unused-imports": "2.0.0",
|
|
80
|
-
"file-loader": "6.2.0",
|
|
81
81
|
"formik": "2.2.9",
|
|
82
|
-
"html-loader": "4.1.0",
|
|
83
|
-
"html-webpack-plugin": "5.5.0",
|
|
84
82
|
"husky": "8.0.1",
|
|
85
83
|
"i18next": "21.9.1",
|
|
86
84
|
"i18next-browser-languagedetector": "6.1.5",
|
|
87
85
|
"json-server": "0.17.0",
|
|
88
86
|
"lint-staged": "13.0.3",
|
|
89
|
-
"mini-css-extract-plugin": "2.6.1",
|
|
90
|
-
"mixpanel-browser": "2.45.0",
|
|
91
|
-
"postcss": "8.4.16",
|
|
92
|
-
"postcss-loader": "7.0.1",
|
|
93
|
-
"postcss-preset-env": "7.8.0",
|
|
94
87
|
"prettier": "2.7.1",
|
|
95
88
|
"prop-types": "15.8.1",
|
|
96
89
|
"ramda": "0.28.0",
|
|
97
90
|
"react": "17.0.2",
|
|
98
91
|
"react-dom": "17.0.2",
|
|
99
92
|
"react-dropzone": "14.2.2",
|
|
100
|
-
"react-i18next": "11.18.
|
|
93
|
+
"react-i18next": "11.18.6",
|
|
101
94
|
"react-query": "3.39.2",
|
|
102
|
-
"react-refresh": "0.14.0",
|
|
103
95
|
"react-router-dom": "5.3.3",
|
|
104
96
|
"react-router-nav-prompt": "0.4.1",
|
|
105
97
|
"react-scroll-sync": "0.11.0",
|
|
106
98
|
"react-timer-hook": "3.0.5",
|
|
107
99
|
"react-toastify": "9.0.8",
|
|
108
|
-
"rollup": "2.
|
|
100
|
+
"rollup": "2.79.0",
|
|
109
101
|
"rollup-plugin-analyzer": "4.0.0",
|
|
110
102
|
"rollup-plugin-cleaner": "1.0.0",
|
|
111
103
|
"rollup-plugin-peer-deps-external": "2.2.4",
|
|
112
104
|
"rollup-plugin-styles": "4.0.0",
|
|
113
|
-
"sass": "1.54.
|
|
114
|
-
"
|
|
115
|
-
"
|
|
116
|
-
"uuid": "8.3.2",
|
|
117
|
-
"webpack": "5.74.0",
|
|
118
|
-
"webpack-cli": "4.10.0",
|
|
119
|
-
"webpack-dev-server": "4.10.1",
|
|
105
|
+
"sass": "1.54.9",
|
|
106
|
+
"uuid": "9.0.0",
|
|
107
|
+
"vite": "^3.1.0",
|
|
120
108
|
"yup": "0.32.11"
|
|
121
109
|
},
|
|
122
110
|
"peerDependencies": {
|
|
123
|
-
"@bigbinary/neeto-icons": "1.8.
|
|
111
|
+
"@bigbinary/neeto-icons": "1.8.38",
|
|
124
112
|
"@bigbinary/neetoui": "3.5.17",
|
|
125
113
|
"axios": "0.27.2",
|
|
126
114
|
"classnames": "2.3.1",
|
package/types.d.ts
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { ButtonProps } from "@bigbinary/neetoui";
|
|
2
|
+
|
|
3
|
+
type IsEqual<T, U> =
|
|
4
|
+
(<G>() => G extends T ? 1 : 2) extends
|
|
5
|
+
(<G>() => G extends U ? 1 : 2) ? true : false;
|
|
6
|
+
|
|
7
|
+
type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ?
|
|
8
|
+
never : (KeyType extends ExcludeType ? never : KeyType);
|
|
9
|
+
|
|
10
|
+
type Except<ObjectType, KeysType extends keyof ObjectType> = {
|
|
11
|
+
[KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType];
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
type Only<ObjectType> = Except<ObjectType, null>;
|
|
15
|
+
|
|
16
|
+
type Member = {
|
|
17
|
+
name: string;
|
|
18
|
+
active: boolean;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
type Permission = {
|
|
22
|
+
create: boolean;
|
|
23
|
+
delete: boolean;
|
|
24
|
+
update: boolean;
|
|
25
|
+
view: boolean;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
interface Alert {
|
|
29
|
+
message?: (member: Only<Member>) => string;
|
|
30
|
+
title?: (member: Only<Member>) => string;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
type Breadcrumb = {
|
|
34
|
+
text: string;
|
|
35
|
+
link: string;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
type onSuccess = {
|
|
39
|
+
callback: () => void;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
type CreateMember = {
|
|
43
|
+
onSuccess: Only<onSuccess>;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
type Header = { breadcrumbs: Breadcrumb[]; };
|
|
47
|
+
|
|
48
|
+
type TeamMembersConfig = {
|
|
49
|
+
alert?: Only<Alert>;
|
|
50
|
+
createMember?: Only<CreateMember>;
|
|
51
|
+
permissions: Except<Permission, "delete">;
|
|
52
|
+
rolesButtonProps?: ButtonProps;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
type RolesConfig = {
|
|
56
|
+
header?: Only<Header>;
|
|
57
|
+
permissions: Only<Permission>;
|
|
58
|
+
membersPageUrl?: string;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export function TeamMembers(props: {
|
|
62
|
+
config?: Only<TeamMembersConfig>;
|
|
63
|
+
metaName?: "metaNames.member" | "metaNames.agent";
|
|
64
|
+
}): JSX.Element;
|
|
65
|
+
|
|
66
|
+
export function Roles(props: { config?: RolesConfig; }): JSX.Element;
|
|
67
|
+
|
|
68
|
+
export function hasPermission(permissions: string[] | string): boolean;
|