cloud-b2b 1.0.2 → 1.0.5
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/es/Area/Area.js +166 -0
- package/es/Area/package.json +6 -0
- package/es/Control/Control.js +27 -1
- package/es/Header/Header.js +1 -1
- package/es/Header/Header.less +12 -11
- package/es/HomeHeader/Header.less +1 -1
- package/es/LayoutLink/LayoutLink.js +2 -2
- package/es/Sidebar/Sidebar.js +2 -2
- package/es/Sidebar/Sidebar.less +10 -9
- package/es/Sidebar2/Sidebar.js +1 -1
- package/es/SuperForm/SuperForm.js +76 -29
- package/es/SuperTable/DragSortRow.js +125 -0
- package/es/SuperTable/DragSortRow.less +17 -0
- package/es/SuperTable/FilterDropDown.js +188 -0
- package/es/SuperTable/FilterDropDown.less +30 -0
- package/es/SuperTable/SuperTable.js +933 -0
- package/es/SuperTable/SuperTable.less +132 -0
- package/es/SuperTable/fixed.js +42 -0
- package/es/SuperTable/package.json +6 -0
- package/es/SuperTable2/SuperTable2.js +700 -0
- package/es/SuperTable2/SuperTable2.less +100 -0
- package/es/SuperTable2/SuperTableCell.js +215 -0
- package/es/SuperTable2/package.json +6 -0
- package/es/Title/Title.less +35 -35
- package/es/Title/package.json +6 -6
- package/es/Viewer/Viewer.js +1 -1
- package/es/adjust.less +89 -0
- package/es/index.js +4 -1
- package/es/style.less +20 -1
- package/lib/Area/Area.js +194 -0
- package/lib/Area/package.json +6 -0
- package/lib/Control/Control.js +29 -1
- package/lib/Header/Header.js +1 -1
- package/lib/Header/Header.less +12 -11
- package/lib/HomeHeader/Header.less +1 -1
- package/lib/LayoutLink/LayoutLink.js +2 -2
- package/lib/Sidebar/Sidebar.js +2 -2
- package/lib/Sidebar/Sidebar.less +10 -9
- package/lib/Sidebar2/Sidebar.js +1 -1
- package/lib/SuperForm/SuperForm.js +74 -29
- package/lib/SuperTable/DragSortRow.js +142 -0
- package/lib/SuperTable/DragSortRow.less +17 -0
- package/lib/SuperTable/FilterDropDown.js +205 -0
- package/lib/SuperTable/FilterDropDown.less +30 -0
- package/lib/SuperTable/SuperTable.js +937 -0
- package/lib/SuperTable/SuperTable.less +132 -0
- package/lib/SuperTable/fixed.js +55 -0
- package/lib/SuperTable/package.json +6 -0
- package/lib/SuperTable2/SuperTable2.js +725 -0
- package/lib/SuperTable2/SuperTable2.less +100 -0
- package/lib/SuperTable2/SuperTableCell.js +231 -0
- package/lib/SuperTable2/package.json +6 -0
- package/lib/Title/Title.less +35 -35
- package/lib/Title/package.json +6 -6
- package/lib/Viewer/Viewer.js +1 -1
- package/lib/adjust.less +89 -0
- package/lib/index.js +28 -1
- package/lib/index.less +5 -0
- package/lib/style.less +20 -1
- package/package.json +1 -1
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import _Reflect$construct from "@babel/runtime-corejs3/core-js-stable/reflect/construct";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/objectWithoutProperties";
|
|
3
|
+
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
|
4
|
+
import _createClass from "@babel/runtime-corejs3/helpers/createClass";
|
|
5
|
+
import _assertThisInitialized from "@babel/runtime-corejs3/helpers/assertThisInitialized";
|
|
6
|
+
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
7
|
+
import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
|
|
8
|
+
import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
|
|
9
|
+
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
10
|
+
var _excluded = ["onMoveRow", "index", "className"];
|
|
11
|
+
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
|
12
|
+
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
|
|
13
|
+
|
|
14
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
15
|
+
|
|
16
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
17
|
+
|
|
18
|
+
import React from 'react';
|
|
19
|
+
import variables from '../variables';
|
|
20
|
+
var dragIndex = -1;
|
|
21
|
+
|
|
22
|
+
var DragSortRow = /*#__PURE__*/function (_React$Component) {
|
|
23
|
+
_inherits(DragSortRow, _React$Component);
|
|
24
|
+
|
|
25
|
+
var _super = _createSuper(DragSortRow);
|
|
26
|
+
|
|
27
|
+
function DragSortRow() {
|
|
28
|
+
var _context, _context2;
|
|
29
|
+
|
|
30
|
+
var _this;
|
|
31
|
+
|
|
32
|
+
_classCallCheck(this, DragSortRow);
|
|
33
|
+
|
|
34
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
35
|
+
args[_key] = arguments[_key];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
_this = _super.call.apply(_super, _concatInstanceProperty(_context = [this]).call(_context, args));
|
|
39
|
+
|
|
40
|
+
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
41
|
+
dragIndex: -1,
|
|
42
|
+
firefox: _includesInstanceProperty(_context2 = navigator.userAgent).call(_context2, 'Firefox')
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
_defineProperty(_assertThisInitialized(_this), "onDragStart", function (e) {
|
|
46
|
+
dragIndex = _this.props.index;
|
|
47
|
+
|
|
48
|
+
if (_this.state.firefox) {
|
|
49
|
+
// 火狐浏览器必须调用setData
|
|
50
|
+
e.dataTransfer.setData('text/plain', 'DragSortRow');
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
_defineProperty(_assertThisInitialized(_this), "onDragEnd", function () {
|
|
55
|
+
dragIndex = -1;
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
_defineProperty(_assertThisInitialized(_this), "onDragOver", function (e) {
|
|
59
|
+
if (dragIndex > -1 && dragIndex !== _this.props.index) {
|
|
60
|
+
e.preventDefault();
|
|
61
|
+
|
|
62
|
+
if (_this.state.dragIndex !== dragIndex) {
|
|
63
|
+
_this.setState({
|
|
64
|
+
dragIndex: dragIndex
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
_defineProperty(_assertThisInitialized(_this), "onDragLeave", function () {
|
|
71
|
+
_this.setState({
|
|
72
|
+
dragIndex: -1
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
_defineProperty(_assertThisInitialized(_this), "onDrop", function (e) {
|
|
77
|
+
var dragIndex = _this.state.dragIndex;
|
|
78
|
+
|
|
79
|
+
_this.setState({
|
|
80
|
+
dragIndex: -1
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
_this.props.onMoveRow(dragIndex, _this.props.index); // 火狐浏览器默认会打开一个新窗口,此处阻止其打开
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
if (_this.state.firefox) {
|
|
87
|
+
e.preventDefault();
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
return _this;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
_createClass(DragSortRow, [{
|
|
95
|
+
key: "render",
|
|
96
|
+
value: function render() {
|
|
97
|
+
var _context3;
|
|
98
|
+
|
|
99
|
+
var _this$props = this.props,
|
|
100
|
+
onMoveRow = _this$props.onMoveRow,
|
|
101
|
+
index = _this$props.index,
|
|
102
|
+
className = _this$props.className,
|
|
103
|
+
restProps = _objectWithoutProperties(_this$props, _excluded);
|
|
104
|
+
|
|
105
|
+
var dragIndex = this.state.dragIndex;
|
|
106
|
+
restProps.className = _concatInstanceProperty(_context3 = "".concat(className, " ")).call(_context3, variables('DragSortRow'));
|
|
107
|
+
restProps.draggable = true;
|
|
108
|
+
restProps.onDragStart = this.onDragStart;
|
|
109
|
+
restProps.onDragEnd = this.onDragEnd;
|
|
110
|
+
restProps.onDragOver = this.onDragOver;
|
|
111
|
+
restProps.onDragLeave = this.onDragLeave;
|
|
112
|
+
restProps.onDrop = this.onDrop;
|
|
113
|
+
|
|
114
|
+
if (dragIndex > -1) {
|
|
115
|
+
restProps['data-drag-hover'] = dragIndex > index ? 'up' : 'down';
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return /*#__PURE__*/React.createElement("tr", restProps);
|
|
119
|
+
}
|
|
120
|
+
}]);
|
|
121
|
+
|
|
122
|
+
return DragSortRow;
|
|
123
|
+
}(React.Component);
|
|
124
|
+
|
|
125
|
+
export default DragSortRow;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
@import '../../components/variables';
|
|
2
|
+
|
|
3
|
+
.@{cloudlink-prefix}-DragSortRow {
|
|
4
|
+
cursor: move;
|
|
5
|
+
|
|
6
|
+
&[data-drag-hover='up'] {
|
|
7
|
+
td {
|
|
8
|
+
border-top: 2px dashed @primary-color !important;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
&[data-drag-hover='down'] {
|
|
13
|
+
td {
|
|
14
|
+
border-bottom: 2px dashed @primary-color !important;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import _Reflect$construct from "@babel/runtime-corejs3/core-js-stable/reflect/construct";
|
|
2
|
+
import _Input from "antd/es/input";
|
|
3
|
+
import _Button from "antd/es/button";
|
|
4
|
+
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
|
5
|
+
import _createClass from "@babel/runtime-corejs3/helpers/createClass";
|
|
6
|
+
import _assertThisInitialized from "@babel/runtime-corejs3/helpers/assertThisInitialized";
|
|
7
|
+
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
|
8
|
+
import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
|
|
9
|
+
import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
|
|
10
|
+
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
|
11
|
+
import _bindInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/bind";
|
|
12
|
+
|
|
13
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
14
|
+
|
|
15
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
16
|
+
|
|
17
|
+
import React from 'react';
|
|
18
|
+
import PropTypes from 'prop-types';
|
|
19
|
+
import Control from "../Control/Control";
|
|
20
|
+
import variables from '../variables';
|
|
21
|
+
|
|
22
|
+
var FilterDropDown = /*#__PURE__*/function (_React$Component) {
|
|
23
|
+
_inherits(FilterDropDown, _React$Component);
|
|
24
|
+
|
|
25
|
+
var _super = _createSuper(FilterDropDown);
|
|
26
|
+
|
|
27
|
+
function FilterDropDown(_props) {
|
|
28
|
+
var _this;
|
|
29
|
+
|
|
30
|
+
_classCallCheck(this, FilterDropDown);
|
|
31
|
+
|
|
32
|
+
_this = _super.call(this, _props);
|
|
33
|
+
|
|
34
|
+
_defineProperty(_assertThisInitialized(_this), "onChange", function (e) {
|
|
35
|
+
_this.setState({
|
|
36
|
+
value: e.target.value
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
_defineProperty(_assertThisInitialized(_this), "onDateChange", function (key, value) {
|
|
41
|
+
_this.setState(_defineProperty({}, key, value));
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
_defineProperty(_assertThisInitialized(_this), "onSearch", function () {
|
|
45
|
+
var _this$props = _this.props,
|
|
46
|
+
onSearch = _this$props.onSearch,
|
|
47
|
+
isDateFilterByStartAndEnd = _this$props.isDateFilterByStartAndEnd;
|
|
48
|
+
|
|
49
|
+
if (onSearch) {
|
|
50
|
+
var value = !_this.state.start && !_this.state.end ? "" : _this.state;
|
|
51
|
+
var val = isDateFilterByStartAndEnd ? value : _this.state.value;
|
|
52
|
+
onSearch(val);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
_defineProperty(_assertThisInitialized(_this), "DateInputCreator", function () {
|
|
57
|
+
var _context, _context2, _context3;
|
|
58
|
+
|
|
59
|
+
var props = _this.props.props;
|
|
60
|
+
var propsStart = {
|
|
61
|
+
type: "date",
|
|
62
|
+
size: "small",
|
|
63
|
+
showTime: props ? props.showTime : true,
|
|
64
|
+
value: _this.state.start,
|
|
65
|
+
style: {
|
|
66
|
+
marginRight: '5px'
|
|
67
|
+
},
|
|
68
|
+
onChange: _bindInstanceProperty(_context = _this.onDateChange).call(_context, null, 'start')
|
|
69
|
+
};
|
|
70
|
+
var propsEnd = {
|
|
71
|
+
type: "date",
|
|
72
|
+
size: "small",
|
|
73
|
+
showTime: props ? props.showTime : true,
|
|
74
|
+
value: _this.state.end,
|
|
75
|
+
style: {
|
|
76
|
+
marginLeft: '5px'
|
|
77
|
+
},
|
|
78
|
+
onChange: _bindInstanceProperty(_context2 = _this.onDateChange).call(_context2, null, 'end')
|
|
79
|
+
};
|
|
80
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
81
|
+
className: variables('FilterDropDown').date
|
|
82
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Control, propsStart), "To", /*#__PURE__*/React.createElement(Control, propsEnd)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(_Button, {
|
|
83
|
+
size: "small",
|
|
84
|
+
style: {
|
|
85
|
+
marginRight: '5px'
|
|
86
|
+
},
|
|
87
|
+
onClick: _this.props.onClose
|
|
88
|
+
}, "\u5173\u95ED"), /*#__PURE__*/React.createElement(_Button, {
|
|
89
|
+
size: "small",
|
|
90
|
+
type: "primary",
|
|
91
|
+
onClick: _bindInstanceProperty(_context3 = _this.onSearch).call(_context3, null, _this.props.type)
|
|
92
|
+
}, "\u641C\u7D22")));
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
_defineProperty(_assertThisInitialized(_this), "InputCreator", function () {
|
|
96
|
+
var props = {
|
|
97
|
+
size: 'small',
|
|
98
|
+
value: _this.state.value,
|
|
99
|
+
onChange: _this.onChange,
|
|
100
|
+
onPressEnter: _this.onSearch,
|
|
101
|
+
ref: function ref(e) {
|
|
102
|
+
return _this.input = e;
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
106
|
+
className: variables('FilterDropDown')
|
|
107
|
+
}, /*#__PURE__*/React.createElement(_Input, props), /*#__PURE__*/React.createElement(_Button, {
|
|
108
|
+
onClick: _this.onSearch,
|
|
109
|
+
size: "small",
|
|
110
|
+
type: "primary"
|
|
111
|
+
}, "\u641C\u7D22"));
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
_this.state = {
|
|
115
|
+
value: _props.value || ''
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
if (_props.isDateFilterByStartAndEnd) {
|
|
119
|
+
var _ref = _props.value || {},
|
|
120
|
+
_ref$start = _ref.start,
|
|
121
|
+
start = _ref$start === void 0 ? '' : _ref$start,
|
|
122
|
+
_ref$end = _ref.end,
|
|
123
|
+
end = _ref$end === void 0 ? '' : _ref$end;
|
|
124
|
+
|
|
125
|
+
_this.state = {
|
|
126
|
+
start: start,
|
|
127
|
+
end: end
|
|
128
|
+
};
|
|
129
|
+
} else {
|
|
130
|
+
_this.state = {
|
|
131
|
+
value: _props.value || ''
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
return _this;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
_createClass(FilterDropDown, [{
|
|
139
|
+
key: "componentWillReceiveProps",
|
|
140
|
+
value: function componentWillReceiveProps(newProps) {
|
|
141
|
+
if (newProps.isDateFilterByStartAndEnd) {
|
|
142
|
+
var _ref2 = newProps.value || {},
|
|
143
|
+
_ref2$start = _ref2.start,
|
|
144
|
+
start = _ref2$start === void 0 ? '' : _ref2$start,
|
|
145
|
+
_ref2$end = _ref2.end,
|
|
146
|
+
end = _ref2$end === void 0 ? '' : _ref2$end;
|
|
147
|
+
|
|
148
|
+
this.setState({
|
|
149
|
+
start: start,
|
|
150
|
+
end: end
|
|
151
|
+
});
|
|
152
|
+
} else {
|
|
153
|
+
this.setState({
|
|
154
|
+
value: newProps.value || ''
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}, {
|
|
159
|
+
key: "componentDidMount",
|
|
160
|
+
value: function componentDidMount() {
|
|
161
|
+
if (this.input) {
|
|
162
|
+
this.input.focus();
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}, {
|
|
166
|
+
key: "componentDidUpdate",
|
|
167
|
+
value: function componentDidUpdate() {
|
|
168
|
+
if (this.input) {
|
|
169
|
+
this.input.focus();
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}, {
|
|
173
|
+
key: "render",
|
|
174
|
+
value: function render() {
|
|
175
|
+
return this.props.isDateFilterByStartAndEnd ? this.DateInputCreator() : this.InputCreator();
|
|
176
|
+
}
|
|
177
|
+
}]);
|
|
178
|
+
|
|
179
|
+
return FilterDropDown;
|
|
180
|
+
}(React.Component);
|
|
181
|
+
|
|
182
|
+
_defineProperty(FilterDropDown, "propTypes", {
|
|
183
|
+
value: PropTypes.any,
|
|
184
|
+
onSearch: PropTypes.func,
|
|
185
|
+
onClose: PropTypes.func
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
export default FilterDropDown;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
@import '../variables.less';
|
|
2
|
+
|
|
3
|
+
.@{cloudlink-prefix}-FilterDropDown {
|
|
4
|
+
background: white;
|
|
5
|
+
padding: @padding-vertical @padding-horizontal;
|
|
6
|
+
border-radius: @border-radius-base;
|
|
7
|
+
border: 1px solid #d9d9d9;
|
|
8
|
+
|
|
9
|
+
> :first-child {
|
|
10
|
+
width: 135px;
|
|
11
|
+
margin-right: 10px;
|
|
12
|
+
}
|
|
13
|
+
.date{
|
|
14
|
+
background: white;
|
|
15
|
+
padding: @padding-vertical @padding-horizontal;
|
|
16
|
+
border-radius: @border-radius-base;
|
|
17
|
+
border: 1px solid #d9d9d9;
|
|
18
|
+
|
|
19
|
+
> :first-child > div {
|
|
20
|
+
display: inline-block;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
> :last-child {
|
|
24
|
+
text-align: right;
|
|
25
|
+
margin-top: 5px;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
|