@rc-component/dialog 1.0.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/LICENSE.md +9 -0
- package/README.md +108 -0
- package/assets/bootstrap.css +177 -0
- package/assets/index.css +174 -0
- package/es/Dialog/Content/MemoChildren.d.ts +7 -0
- package/es/Dialog/Content/MemoChildren.js +8 -0
- package/es/Dialog/Content/Panel.d.ts +15 -0
- package/es/Dialog/Content/Panel.js +149 -0
- package/es/Dialog/Content/index.d.ts +13 -0
- package/es/Dialog/Content/index.js +63 -0
- package/es/Dialog/Mask.d.ts +11 -0
- package/es/Dialog/Mask.js +28 -0
- package/es/Dialog/index.d.ts +4 -0
- package/es/Dialog/index.js +201 -0
- package/es/DialogWrap.d.ts +4 -0
- package/es/DialogWrap.js +59 -0
- package/es/IDialogPropTypes.d.ts +52 -0
- package/es/IDialogPropTypes.js +1 -0
- package/es/context.d.ts +5 -0
- package/es/context.js +2 -0
- package/es/index.d.ts +6 -0
- package/es/index.js +4 -0
- package/es/util.d.ts +5 -0
- package/es/util.js +34 -0
- package/lib/Dialog/Content/MemoChildren.d.ts +7 -0
- package/lib/Dialog/Content/MemoChildren.js +17 -0
- package/lib/Dialog/Content/Panel.d.ts +15 -0
- package/lib/Dialog/Content/Panel.js +159 -0
- package/lib/Dialog/Content/index.d.ts +13 -0
- package/lib/Dialog/Content/index.js +73 -0
- package/lib/Dialog/Mask.d.ts +11 -0
- package/lib/Dialog/Mask.js +38 -0
- package/lib/Dialog/index.d.ts +4 -0
- package/lib/Dialog/index.js +211 -0
- package/lib/DialogWrap.d.ts +4 -0
- package/lib/DialogWrap.js +69 -0
- package/lib/IDialogPropTypes.d.ts +52 -0
- package/lib/IDialogPropTypes.js +5 -0
- package/lib/context.d.ts +5 -0
- package/lib/context.js +11 -0
- package/lib/index.d.ts +6 -0
- package/lib/index.js +16 -0
- package/lib/util.d.ts +5 -0
- package/lib/util.js +41 -0
- package/package.json +98 -0
package/lib/context.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.RefContext = void 0;
|
|
8
|
+
var React = _interopRequireWildcard(require("react"));
|
|
9
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
10
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
11
|
+
var RefContext = exports.RefContext = /*#__PURE__*/React.createContext({});
|
package/lib/index.d.ts
ADDED
package/lib/index.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
Object.defineProperty(exports, "Panel", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function get() {
|
|
10
|
+
return _Panel.default;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
exports.default = void 0;
|
|
14
|
+
var _DialogWrap = _interopRequireDefault(require("./DialogWrap"));
|
|
15
|
+
var _Panel = _interopRequireDefault(require("./Dialog/Content/Panel"));
|
|
16
|
+
var _default = exports.default = _DialogWrap.default;
|
package/lib/util.d.ts
ADDED
package/lib/util.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getMotionName = getMotionName;
|
|
7
|
+
exports.offset = offset;
|
|
8
|
+
// =============================== Motion ===============================
|
|
9
|
+
function getMotionName(prefixCls, transitionName, animationName) {
|
|
10
|
+
var motionName = transitionName;
|
|
11
|
+
if (!motionName && animationName) {
|
|
12
|
+
motionName = "".concat(prefixCls, "-").concat(animationName);
|
|
13
|
+
}
|
|
14
|
+
return motionName;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// =============================== Offset ===============================
|
|
18
|
+
function getScroll(w, top) {
|
|
19
|
+
var ret = w["page".concat(top ? 'Y' : 'X', "Offset")];
|
|
20
|
+
var method = "scroll".concat(top ? 'Top' : 'Left');
|
|
21
|
+
if (typeof ret !== 'number') {
|
|
22
|
+
var d = w.document;
|
|
23
|
+
ret = d.documentElement[method];
|
|
24
|
+
if (typeof ret !== 'number') {
|
|
25
|
+
ret = d.body[method];
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return ret;
|
|
29
|
+
}
|
|
30
|
+
function offset(el) {
|
|
31
|
+
var rect = el.getBoundingClientRect();
|
|
32
|
+
var pos = {
|
|
33
|
+
left: rect.left,
|
|
34
|
+
top: rect.top
|
|
35
|
+
};
|
|
36
|
+
var doc = el.ownerDocument;
|
|
37
|
+
var w = doc.defaultView || doc.parentWindow;
|
|
38
|
+
pos.left += getScroll(w);
|
|
39
|
+
pos.top += getScroll(w, true);
|
|
40
|
+
return pos;
|
|
41
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@rc-component/dialog",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "dialog ui component for react",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"react",
|
|
7
|
+
"react-component",
|
|
8
|
+
"react-dialog",
|
|
9
|
+
"dialog",
|
|
10
|
+
"ui"
|
|
11
|
+
],
|
|
12
|
+
"homepage": "http://github.com/react-component/dialog",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "http://github.com/react-component/dialog/issues"
|
|
15
|
+
},
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git@github.com:react-component/dialog.git"
|
|
19
|
+
},
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"author": "yiminghe@gmail.com",
|
|
22
|
+
"main": "./lib/index",
|
|
23
|
+
"module": "./es/index",
|
|
24
|
+
"files": [
|
|
25
|
+
"lib",
|
|
26
|
+
"es",
|
|
27
|
+
"assets/*.css",
|
|
28
|
+
"dist"
|
|
29
|
+
],
|
|
30
|
+
"scripts": {
|
|
31
|
+
"compile": "father build && lessc assets/index.less assets/index.css && lessc assets/bootstrap.less assets/bootstrap.css",
|
|
32
|
+
"coverage": "rc-test --coverage",
|
|
33
|
+
"deploy": "npm run docs:build && npm run docs:deploy",
|
|
34
|
+
"docs:build": "dumi build",
|
|
35
|
+
"docs:deploy": "gh-pages -d dist",
|
|
36
|
+
"lint": "eslint src/ --ext .ts,.tsx,.jsx,.js,.md",
|
|
37
|
+
"lint:tsc": "tsc -p tsconfig.json --noEmit",
|
|
38
|
+
"now-build": "npm run docs:build",
|
|
39
|
+
"prepare": "husky install",
|
|
40
|
+
"prepublishOnly": "npm run compile && np --yolo --no-publish",
|
|
41
|
+
"prettier": "prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"",
|
|
42
|
+
"start": "dumi dev",
|
|
43
|
+
"test": "rc-test"
|
|
44
|
+
},
|
|
45
|
+
"lint-staged": {
|
|
46
|
+
"**/*.{js,jsx,tsx,ts,md,json}": [
|
|
47
|
+
"prettier --write",
|
|
48
|
+
"git add"
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"@babel/runtime": "^7.10.1",
|
|
53
|
+
"@rc-component/portal": "^1.0.0-8",
|
|
54
|
+
"classnames": "^2.2.6",
|
|
55
|
+
"rc-motion": "^2.3.0",
|
|
56
|
+
"rc-util": "^5.21.0"
|
|
57
|
+
},
|
|
58
|
+
"devDependencies": {
|
|
59
|
+
"@rc-component/father-plugin": "^1.0.1",
|
|
60
|
+
"@testing-library/jest-dom": "^6.1.6",
|
|
61
|
+
"@testing-library/react": "^12.0.0",
|
|
62
|
+
"@types/enzyme": "^3.10.7",
|
|
63
|
+
"@types/jest": "^29.4.0",
|
|
64
|
+
"@types/keyv": "3.1.4",
|
|
65
|
+
"@types/react": "^18.0.24",
|
|
66
|
+
"@types/react-dom": "^18.0.8",
|
|
67
|
+
"@umijs/fabric": "^3.0.0",
|
|
68
|
+
"bootstrap": "^4.3.1",
|
|
69
|
+
"cheerio": "1.0.0-rc.12",
|
|
70
|
+
"cross-env": "^7.0.0",
|
|
71
|
+
"dumi": "^2.1.3",
|
|
72
|
+
"enzyme": "^3.1.1",
|
|
73
|
+
"enzyme-adapter-react-16": "^1.0.1",
|
|
74
|
+
"enzyme-to-json": "^3.1.2",
|
|
75
|
+
"eslint": "^7.1.0",
|
|
76
|
+
"eslint-config-airbnb": "^19.0.4",
|
|
77
|
+
"eslint-plugin-react": "^7.20.6",
|
|
78
|
+
"father": "^4.1.5",
|
|
79
|
+
"gh-pages": "^6.1.1",
|
|
80
|
+
"glob": "^11.0.0",
|
|
81
|
+
"husky": "^8.0.3",
|
|
82
|
+
"less": "^4.1.3",
|
|
83
|
+
"lint-staged": "^15.2.0",
|
|
84
|
+
"np": "^10.0.5",
|
|
85
|
+
"prettier": "^3.2.1",
|
|
86
|
+
"rc-drawer": "^7.0.0",
|
|
87
|
+
"rc-select": "^14.11.0",
|
|
88
|
+
"rc-test": "^7.0.14",
|
|
89
|
+
"react": "^16.9.0",
|
|
90
|
+
"react-dom": "^16.9.0",
|
|
91
|
+
"react-draggable": "^4.4.3",
|
|
92
|
+
"typescript": "^5.4.3"
|
|
93
|
+
},
|
|
94
|
+
"peerDependencies": {
|
|
95
|
+
"react": ">=16.9.0",
|
|
96
|
+
"react-dom": ">=16.9.0"
|
|
97
|
+
}
|
|
98
|
+
}
|