dlt-for-react 1.0.2 → 1.0.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 +3 -1
- package/assets/components/KyInputPicker/index.less +8 -0
- package/assets/components/KyModal/index.less +21 -0
- package/assets/components/KyPreview/index.less +38 -0
- package/assets/components/KyUpload/index.less +41 -0
- package/lib/components/DragM/index.js +127 -0
- package/lib/components/KyInputPicker/edit-page.js +585 -0
- package/lib/components/KyInputPicker/index.js +220 -0
- package/lib/components/KyInputPicker/input-const.js +134 -0
- package/lib/components/KyInputPicker/render.js +2480 -0
- package/lib/components/KyInputPicker/setting-checkbox.js +850 -0
- package/lib/components/KyInputPicker/setting-datepicker.js +430 -0
- package/lib/components/KyInputPicker/setting-datetimepicker.js +443 -0
- package/lib/components/KyInputPicker/setting-input.js +555 -0
- package/lib/components/KyInputPicker/setting-inputNumber.js +612 -0
- package/lib/components/KyInputPicker/setting-monthpicker.js +434 -0
- package/lib/components/KyInputPicker/setting-multiSelect.js +532 -0
- package/lib/components/KyInputPicker/setting-nhcascader.js +584 -0
- package/lib/components/KyInputPicker/setting-old-upload.js +428 -0
- package/lib/components/KyInputPicker/setting-radio.js +468 -0
- package/lib/components/KyInputPicker/setting-rangepicker.js +466 -0
- package/lib/components/KyInputPicker/setting-select.js +534 -0
- package/lib/components/KyInputPicker/setting-stu-selector.js +507 -0
- package/lib/components/KyInputPicker/setting-switch.js +274 -0
- package/lib/components/KyInputPicker/setting-tea-selector.js +507 -0
- package/lib/components/KyInputPicker/setting-textarea.js +619 -0
- package/lib/components/KyInputPicker/setting-timepicker.js +437 -0
- package/lib/components/KyInputPicker/setting-upload.js +766 -0
- package/lib/components/KyModal/buildTitle.js +81 -0
- package/lib/components/KyModal/dragM.js +127 -0
- package/lib/components/KyModal/index.js +321 -0
- package/lib/components/KyPreview/index.js +209 -0
- package/lib/components/KyUpload/index.js +1156 -0
- package/lib/index.js +84 -31
- package/lib/layouts/Login/index.js +522 -458
- package/lib/layouts/Login/lyPassword.js +8 -10
- package/lib/layouts/Top/index.js +308 -254
- package/lib/layouts/TopMenu/index.js +270 -265
- package/lib/layouts/mixTop/index.js +274 -243
- package/package.json +10 -4
package/README.md
CHANGED
|
@@ -6,12 +6,14 @@ npm publish
|
|
|
6
6
|
|
|
7
7
|
## 前端dlt-for-react依赖包版本更新记录
|
|
8
8
|
|
|
9
|
-
##### 当前最新版本:1.0.
|
|
9
|
+
##### 当前最新版本:1.0.3
|
|
10
10
|
|
|
11
11
|
##### 安装依赖
|
|
12
12
|
> cnpm install dlt-for-react --save
|
|
13
13
|
|
|
14
14
|
##### 版本修改记录
|
|
15
|
+
#### V1.0.3—2023年9月28日
|
|
16
|
+
1. 补充KyInputPicker、KyModal、KyUpload及KyPreview组件
|
|
15
17
|
#### V1.0.2—2023年9月27日
|
|
16
18
|
1. 初始化组件
|
|
17
19
|
## 发布
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
:global {
|
|
2
|
+
.vertical-center-modal {
|
|
3
|
+
white-space: nowrap;
|
|
4
|
+
text-align: center;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.vertical-center-modal:before {
|
|
8
|
+
display: inline-block;
|
|
9
|
+
width: 0;
|
|
10
|
+
height: 100%;
|
|
11
|
+
vertical-align: middle;
|
|
12
|
+
content: '';
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.vertical-center-modal .ant-modal {
|
|
16
|
+
top: 0;
|
|
17
|
+
display: inline-block;
|
|
18
|
+
text-align: left;
|
|
19
|
+
vertical-align: middle;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
:global {
|
|
2
|
+
.KyPreview {
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
width: 100%;
|
|
7
|
+
height: 100%;
|
|
8
|
+
.fileContent {
|
|
9
|
+
width: 100%;
|
|
10
|
+
height: calc(100% - 42px);
|
|
11
|
+
.pg-viewer-wrapper button,
|
|
12
|
+
.pg-viewer-wrapper input,
|
|
13
|
+
.pg-viewer-wrapper select,
|
|
14
|
+
.pg-viewer-wrapper textarea {
|
|
15
|
+
margin-top: 5px;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.filePdf {
|
|
20
|
+
display: flex;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
width: 100%;
|
|
23
|
+
height: calc(100% - 84px);
|
|
24
|
+
overflow: scroll;
|
|
25
|
+
overflow-x: hidden;
|
|
26
|
+
}
|
|
27
|
+
.filePdfFooter {
|
|
28
|
+
display: flex;
|
|
29
|
+
align-items: center;
|
|
30
|
+
justify-content: center;
|
|
31
|
+
width: 100%;
|
|
32
|
+
height: 42px;
|
|
33
|
+
}
|
|
34
|
+
.filePdfPage {
|
|
35
|
+
margin: 0 10px;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
:global {
|
|
2
|
+
.button_ctrl {
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
margin-top: 10px;
|
|
7
|
+
background: #e8e8e8;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.button_ctrl img {
|
|
11
|
+
padding-right: 10px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.nhUpload-removeDelete {
|
|
15
|
+
.ant-upload-list-item-card-actions .anticon-delete,
|
|
16
|
+
.ant-upload-list-item-actions .anticon-delete {
|
|
17
|
+
//禁用时样式去掉删除按钮
|
|
18
|
+
display: none;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
.kyUpload-hint {
|
|
22
|
+
margin-top: 4px !important;
|
|
23
|
+
color: red;
|
|
24
|
+
font-size: 12px;
|
|
25
|
+
text-align: start;
|
|
26
|
+
cursor: pointer;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.ky-upload {
|
|
30
|
+
.file-view {
|
|
31
|
+
.ant-upload-list-item-actions a:first-child {
|
|
32
|
+
opacity: 1 !important;
|
|
33
|
+
pointer-events: auto !important;
|
|
34
|
+
}
|
|
35
|
+
.ant-upload-list-item-name {
|
|
36
|
+
color: #397ef0;
|
|
37
|
+
cursor: pointer;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _extends2 = require('babel-runtime/helpers/extends');
|
|
8
|
+
|
|
9
|
+
var _extends3 = _interopRequireDefault(_extends2);
|
|
10
|
+
|
|
11
|
+
var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');
|
|
12
|
+
|
|
13
|
+
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
|
|
14
|
+
|
|
15
|
+
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
|
|
16
|
+
|
|
17
|
+
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
|
18
|
+
|
|
19
|
+
var _createClass2 = require('babel-runtime/helpers/createClass');
|
|
20
|
+
|
|
21
|
+
var _createClass3 = _interopRequireDefault(_createClass2);
|
|
22
|
+
|
|
23
|
+
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
|
|
24
|
+
|
|
25
|
+
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
|
|
26
|
+
|
|
27
|
+
var _inherits2 = require('babel-runtime/helpers/inherits');
|
|
28
|
+
|
|
29
|
+
var _inherits3 = _interopRequireDefault(_inherits2);
|
|
30
|
+
|
|
31
|
+
var _react = require('react');
|
|
32
|
+
|
|
33
|
+
var _react2 = _interopRequireDefault(_react);
|
|
34
|
+
|
|
35
|
+
var _propTypes = require('prop-types');
|
|
36
|
+
|
|
37
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
38
|
+
|
|
39
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
40
|
+
|
|
41
|
+
var DragM = function (_React$Component) {
|
|
42
|
+
(0, _inherits3.default)(DragM, _React$Component);
|
|
43
|
+
|
|
44
|
+
function DragM() {
|
|
45
|
+
var _ref;
|
|
46
|
+
|
|
47
|
+
var _temp, _this, _ret;
|
|
48
|
+
|
|
49
|
+
(0, _classCallCheck3.default)(this, DragM);
|
|
50
|
+
|
|
51
|
+
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
52
|
+
args[_key] = arguments[_key];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return _ret = (_temp = (_this = (0, _possibleConstructorReturn3.default)(this, (_ref = DragM.__proto__ || (0, _getPrototypeOf2.default)(DragM)).call.apply(_ref, [this].concat(args))), _this), _this.position = {
|
|
56
|
+
startX: 0,
|
|
57
|
+
startY: 0,
|
|
58
|
+
dx: 0,
|
|
59
|
+
dy: 0,
|
|
60
|
+
tx: 0,
|
|
61
|
+
ty: 0
|
|
62
|
+
}, _this.start = function (event) {
|
|
63
|
+
if (event.button != 0) {
|
|
64
|
+
//只允许左键,右键问题在于不选择conextmenu就不会触发mouseup事件
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
document.addEventListener('mousemove', _this.docMove);
|
|
68
|
+
_this.position.startX = event.pageX - _this.position.dx;
|
|
69
|
+
_this.position.startY = event.pageY - _this.position.dy;
|
|
70
|
+
}, _this.docMove = function (event) {
|
|
71
|
+
var tx = event.pageX - _this.position.startX;
|
|
72
|
+
var ty = event.pageY - _this.position.startY;
|
|
73
|
+
var transformStr = 'translate(' + tx + 'px,' + ty + 'px)';
|
|
74
|
+
_this.props.updateTransform(transformStr, tx, ty, _this.tdom);
|
|
75
|
+
_this.position.dx = tx;
|
|
76
|
+
_this.position.dy = ty;
|
|
77
|
+
}, _this.docMouseUp = function (event) {
|
|
78
|
+
document.removeEventListener('mousemove', _this.docMove);
|
|
79
|
+
}, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
(0, _createClass3.default)(DragM, [{
|
|
83
|
+
key: 'componentDidMount',
|
|
84
|
+
value: function componentDidMount() {
|
|
85
|
+
this.tdom.addEventListener('mousedown', this.start);
|
|
86
|
+
//用document移除对mousemove事件的监听
|
|
87
|
+
document.addEventListener('mouseup', this.docMouseUp);
|
|
88
|
+
}
|
|
89
|
+
}, {
|
|
90
|
+
key: 'componentWillUnmount',
|
|
91
|
+
value: function componentWillUnmount() {
|
|
92
|
+
this.tdom.removeEventListener('mousedown', this.start);
|
|
93
|
+
document.removeEventListener('mouseup', this.docMouseUp);
|
|
94
|
+
document.removeEventListener('mousemove', this.docMove);
|
|
95
|
+
}
|
|
96
|
+
}, {
|
|
97
|
+
key: 'render',
|
|
98
|
+
value: function render() {
|
|
99
|
+
var _this2 = this;
|
|
100
|
+
|
|
101
|
+
var children = this.props.children;
|
|
102
|
+
|
|
103
|
+
var newStyle = (0, _extends3.default)({}, children.props.style, {
|
|
104
|
+
cursor: 'move',
|
|
105
|
+
userSelect: 'none'
|
|
106
|
+
});
|
|
107
|
+
return _react2.default.cloneElement(_react2.default.Children.only(children), {
|
|
108
|
+
ref: function ref(tdom) {
|
|
109
|
+
return _this2.tdom = tdom;
|
|
110
|
+
},
|
|
111
|
+
style: newStyle
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
}]);
|
|
115
|
+
return DragM;
|
|
116
|
+
}(_react2.default.Component);
|
|
117
|
+
|
|
118
|
+
DragM.propTypes = {
|
|
119
|
+
children: _propTypes2.default.element.isRequired
|
|
120
|
+
};
|
|
121
|
+
DragM.defaultProps = {
|
|
122
|
+
//默认是移动children dom,覆盖该方法,可以把tranform行为同步给外部
|
|
123
|
+
updateTransform: function updateTransform(transformStr, tx, ty, tdom) {
|
|
124
|
+
tdom.style.transform = transformStr;
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
exports.default = DragM;
|