xph-crud 0.3.8 → 0.4.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.
@@ -1,8 +1,8 @@
1
- declare const useOnPropsSizeChange: ({ initWidth, initHeight, curPropsWidth, curPropsHeight, setParentInitRecord, }: {
2
- initWidth: React.MutableRefObject<string | number>;
3
- initHeight: React.MutableRefObject<string | number>;
1
+ import { Dispatch, SetStateAction } from 'react';
2
+
3
+ declare const useOnPropsSizeChange: ({ curPropsWidth, curPropsHeight, setParentInitRecord, }: {
4
4
  curPropsWidth: number | string;
5
5
  curPropsHeight: number | string;
6
- setParentInitRecord: Function;
6
+ setParentInitRecord: Dispatch<SetStateAction<number>>;
7
7
  }) => void;
8
8
  export default useOnPropsSizeChange;
@@ -1,13 +1,14 @@
1
1
  /// <reference types="react" />
2
- /** 开启了mask后默认挂载到body,因为mask是固定定位,所以后续的所有计算都是基于innerWidth、innerHeight */
2
+ /** 带遮罩窗口以覆盖层的可视区域为定位和最大化范围。 */
3
3
  export interface IContainerSizeTarget {
4
4
  clientWidth: number;
5
5
  clientHeight: number;
6
6
  scrollWidth: number;
7
7
  scrollHeight: number;
8
8
  }
9
- declare const usePopperContainerSize: ({ container }: {
9
+ declare const usePopperContainerSize: ({ container, mask, }: {
10
10
  container: HTMLElement;
11
+ mask?: boolean | undefined;
11
12
  }) => {
12
13
  containerSizeTarget: import('react').MutableRefObject<IContainerSizeTarget>;
13
14
  setContainerSizeTarget: () => void;
@@ -12,7 +12,7 @@ export interface IDialogProps {
12
12
  */
13
13
  height?: number;
14
14
  /**
15
- * 是否显示遮罩
15
+ * 是否显示遮罩;覆盖挂载容器的可视区域,显示期间锁定容器滚动,关闭后恢复
16
16
  * @defaultValue `false`
17
17
  */
18
18
  mask?: boolean;
@@ -74,7 +74,7 @@ export interface IDialogProps {
74
74
  */
75
75
  onClose?: () => void;
76
76
  /**
77
- * 挂载弹窗的容器
77
+ * 挂载弹窗的容器;开启 mask 时遮罩也限制在该容器内
78
78
  * @defaultValue `() => document.body`
79
79
  */
80
80
  getPopperContainer?: () => HTMLElement | null;
package/package.json CHANGED
@@ -1,65 +1,65 @@
1
- {
2
- "name": "xph-crud",
3
- "version": "0.3.8",
4
- "type": "module",
5
- "main": "dist/index.js",
6
- "types": "dist/types/index.d.ts",
7
- "description": "This is a configurable component library based on React",
8
- "keywords": [
9
- "react",
10
- "ant-design",
11
- "configurable-component"
12
- ],
13
- "scripts": {
14
- "examples": "vite",
15
- "build": "tsc && vite build",
16
- "docs": "cd docs && npm run start",
17
- "build:docs": "cd docs && npm run build",
18
- "version-bump": "node version-bump.mjs",
19
- "publish": "npm run version-bump && npm publish",
20
- "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0"
21
- },
22
- "files": [
23
- "dist",
24
- "README.md"
25
- ],
26
- "peerDependencies": {
27
- "@ant-design/icons": "5.3.2",
28
- "antd": "^5.14.2",
29
- "react": "^18.2.0",
30
- "react-dom": "^18.2.0",
31
- "dayjs": "^1.11.13"
32
- },
33
- "dependencies": {
34
- "lodash-es": "^4.17.21"
35
- },
36
- "devDependencies": {
37
- "@types/lodash-es": "^4.17.12",
38
- "@types/node": "^20.14.2",
39
- "@types/react": "^18.2.66",
40
- "@types/react-dom": "^18.2.22",
41
- "@typescript-eslint/eslint-plugin": "^7.2.0",
42
- "@typescript-eslint/parser": "^7.2.0",
43
- "@vitejs/plugin-react": "^4.2.1",
44
- "eslint": "^8.57.0",
45
- "eslint-plugin-react-hooks": "^4.6.0",
46
- "eslint-plugin-react-refresh": "^0.4.6",
47
- "typescript": "^5.2.2",
48
- "vite": "^5.2.0",
49
- "vite-plugin-dts": "^3.9.1"
50
- },
51
- "license": "ISC",
52
- "author": "XiaoPiHong",
53
- "homepage": "https://github.com/XiaoPiHong/xph-crud",
54
- "bugs": {
55
- "url": "https://github.com/XiaoPiHong/xph-crud/issues",
56
- "email": "260094892@qq.com"
57
- },
58
- "repository": {
59
- "type": "git",
60
- "url": "https://github.com/XiaoPiHong/xph-crud.git"
61
- },
62
- "engines": {
63
- "node": ">=16"
64
- }
1
+ {
2
+ "name": "xph-crud",
3
+ "version": "0.4.0",
4
+ "type": "module",
5
+ "main": "dist/index.js",
6
+ "types": "dist/types/index.d.ts",
7
+ "description": "This is a configurable component library based on React",
8
+ "keywords": [
9
+ "react",
10
+ "ant-design",
11
+ "configurable-component"
12
+ ],
13
+ "scripts": {
14
+ "examples": "vite",
15
+ "build": "tsc && vite build",
16
+ "docs": "cd docs && npm run start",
17
+ "build:docs": "cd docs && npm run build",
18
+ "version-bump": "node version-bump.mjs",
19
+ "pub": "npm run version-bump && npm publish",
20
+ "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0"
21
+ },
22
+ "files": [
23
+ "dist",
24
+ "README.md"
25
+ ],
26
+ "peerDependencies": {
27
+ "@ant-design/icons": "5.3.2",
28
+ "antd": "^5.14.2",
29
+ "react": "^18.2.0",
30
+ "react-dom": "^18.2.0",
31
+ "dayjs": "^1.11.13"
32
+ },
33
+ "dependencies": {
34
+ "lodash-es": "^4.17.21"
35
+ },
36
+ "devDependencies": {
37
+ "@types/lodash-es": "^4.17.12",
38
+ "@types/node": "^20.14.2",
39
+ "@types/react": "^18.2.66",
40
+ "@types/react-dom": "^18.2.22",
41
+ "@typescript-eslint/eslint-plugin": "^7.2.0",
42
+ "@typescript-eslint/parser": "^7.2.0",
43
+ "@vitejs/plugin-react": "^4.2.1",
44
+ "eslint": "^8.57.0",
45
+ "eslint-plugin-react-hooks": "^4.6.0",
46
+ "eslint-plugin-react-refresh": "^0.4.6",
47
+ "typescript": "^5.2.2",
48
+ "vite": "^5.2.0",
49
+ "vite-plugin-dts": "^3.9.1"
50
+ },
51
+ "license": "ISC",
52
+ "author": "XiaoPiHong",
53
+ "homepage": "https://github.com/XiaoPiHong/xph-crud",
54
+ "bugs": {
55
+ "url": "https://github.com/XiaoPiHong/xph-crud/issues",
56
+ "email": "260094892@qq.com"
57
+ },
58
+ "repository": {
59
+ "type": "git",
60
+ "url": "https://github.com/XiaoPiHong/xph-crud.git"
61
+ },
62
+ "engines": {
63
+ "node": ">=16"
64
+ }
65
65
  }