linkmore-design 1.0.13 → 1.0.16
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/dist/index.umd.js +1857 -744
- package/dist/index.umd.min.js +6 -6
- package/es/Button/index.js +3 -1
- package/es/Button/style/style.css +4 -1
- package/es/CkFilter/baseFilter/filterMenu.js +11 -0
- package/es/CkFilter/complexFilter/drawer.js +42 -2
- package/es/CkFilter/components/CascaderFilter.js +132 -0
- package/es/CkFilter/components/CheckboxTags.js +53 -0
- package/es/CkFilter/components/Controls.js +43 -0
- package/es/CkFilter/components/CustomModal.js +230 -0
- package/es/CkFilter/components/filterTypes.js +154 -1
- package/es/CkFilter/components/modal.js +36 -67
- package/es/CkFilter/components/modalBack.js +261 -0
- package/es/CkFilter/context.js +1 -1
- package/es/CkFilter/customFilter/drawer.js +4 -1
- package/es/CkFilter/filter.js +3 -3
- package/es/CkFilter/style/style.css +68 -26
- package/es/Dropdown/index.d.ts +1 -0
- package/es/Dropdown/index.js +78 -7
- package/es/PopTable/style/style.css +1 -4
- package/es/ProTable/Table.js +24 -12
- package/es/ProTable/autosize.js +170 -0
- package/es/ProTable/detectElementResize.js +225 -0
- package/es/ProTable/style/style.css +7 -0
- package/es/Radio/style/style.css +7 -0
- package/es/TabBar/style/style.css +0 -1
- package/lib/Button/index.js +3 -1
- package/lib/Button/style/style.css +4 -1
- package/lib/CkFilter/baseFilter/filterMenu.js +11 -0
- package/lib/CkFilter/complexFilter/drawer.js +42 -2
- package/lib/CkFilter/components/CascaderFilter.js +132 -0
- package/lib/CkFilter/components/CheckboxTags.js +53 -0
- package/lib/CkFilter/components/Controls.js +43 -0
- package/lib/CkFilter/components/CustomModal.js +230 -0
- package/lib/CkFilter/components/filterTypes.js +154 -1
- package/lib/CkFilter/components/modal.js +36 -67
- package/lib/CkFilter/components/modalBack.js +261 -0
- package/lib/CkFilter/context.js +1 -1
- package/lib/CkFilter/customFilter/drawer.js +4 -1
- package/lib/CkFilter/filter.js +3 -3
- package/lib/CkFilter/style/style.css +68 -26
- package/lib/Dropdown/index.d.ts +1 -0
- package/lib/Dropdown/index.js +81 -7
- package/lib/PopTable/style/style.css +1 -4
- package/lib/ProTable/Table.js +24 -12
- package/lib/ProTable/autosize.js +170 -0
- package/lib/ProTable/detectElementResize.js +225 -0
- package/lib/ProTable/style/style.css +7 -0
- package/lib/Radio/style/style.css +7 -0
- package/lib/TabBar/style/style.css +0 -1
- package/package.json +1 -1
package/lib/ProTable/Table.js
CHANGED
|
@@ -25,7 +25,7 @@ var _lodash = require("lodash");
|
|
|
25
25
|
|
|
26
26
|
var _react = _interopRequireWildcard(require("react"));
|
|
27
27
|
|
|
28
|
-
var
|
|
28
|
+
var _autosize = _interopRequireDefault(require("./autosize"));
|
|
29
29
|
|
|
30
30
|
var _context = _interopRequireDefault(require("./context"));
|
|
31
31
|
|
|
@@ -33,7 +33,7 @@ var _VList = require("./VList");
|
|
|
33
33
|
|
|
34
34
|
var _resetConfig = _interopRequireDefault(require("./resetConfig"));
|
|
35
35
|
|
|
36
|
-
var _excluded = ["dataSource", "autoSize", "columns", "rowClick", "onDoubleClick", "checkConfig", "summary", "pagination", "hiddenPage", "loading"];
|
|
36
|
+
var _excluded = ["dataSource", "autoSize", "columns", "rowClick", "onDoubleClick", "checkConfig", "summary", "pagination", "hiddenPage", "loading", "customCheck"];
|
|
37
37
|
var Summary = _proTable.default.Summary;
|
|
38
38
|
exports.Summary = Summary;
|
|
39
39
|
var ResetTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
@@ -47,6 +47,7 @@ var ResetTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
47
47
|
pagination = props.pagination,
|
|
48
48
|
hiddenPage = props.hiddenPage,
|
|
49
49
|
loading = props.loading,
|
|
50
|
+
customCheck = props.customCheck,
|
|
50
51
|
resetProps = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
51
52
|
var _resetProps$rowKey = resetProps.rowKey,
|
|
52
53
|
rowKey = _resetProps$rowKey === void 0 ? 'id' : _resetProps$rowKey;
|
|
@@ -179,7 +180,7 @@ var ResetTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
179
180
|
selectedRowKeys: useSelectedRows.selectedRows.map(function (v) {
|
|
180
181
|
return v[rowKey];
|
|
181
182
|
}),
|
|
182
|
-
onChange: function onChange(selectedRowKeys, selectedRows) {
|
|
183
|
+
onChange: function onChange(selectedRowKeys, selectedRows, t, s) {
|
|
183
184
|
setSelectedRows({
|
|
184
185
|
selectedRows: selectedRows
|
|
185
186
|
});
|
|
@@ -188,7 +189,7 @@ var ResetTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
188
189
|
},
|
|
189
190
|
onRow: function onRow(record) {
|
|
190
191
|
return {
|
|
191
|
-
onClick: function onClick() {
|
|
192
|
+
onClick: function onClick(e) {
|
|
192
193
|
onRecord(record);
|
|
193
194
|
},
|
|
194
195
|
onDoubleClick: function onDoubleClick() {
|
|
@@ -239,10 +240,10 @@ var ResetTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
239
240
|
}
|
|
240
241
|
});
|
|
241
242
|
setColumnsStateMap(obj);
|
|
242
|
-
}, []);
|
|
243
|
-
(
|
|
244
|
-
|
|
245
|
-
|
|
243
|
+
}, []); // useEffect(() => {
|
|
244
|
+
// rowClick?.()
|
|
245
|
+
// }, [useSelectedRows])
|
|
246
|
+
// 将节点方法给外部使用
|
|
246
247
|
|
|
247
248
|
_react.default.useImperativeHandle(ref, function () {
|
|
248
249
|
return {
|
|
@@ -251,9 +252,16 @@ var ResetTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
251
252
|
},
|
|
252
253
|
// 用于按钮触发事件
|
|
253
254
|
clearSelect: function clearSelect() {
|
|
254
|
-
|
|
255
|
+
setSelectedRows({
|
|
255
256
|
selectedRows: []
|
|
256
257
|
});
|
|
258
|
+
rowClick === null || rowClick === void 0 ? void 0 : rowClick([]);
|
|
259
|
+
},
|
|
260
|
+
customSetCheckboxRecords: function customSetCheckboxRecords(value) {
|
|
261
|
+
setSelectedRows({
|
|
262
|
+
selectedRows: value
|
|
263
|
+
});
|
|
264
|
+
rowClick === null || rowClick === void 0 ? void 0 : rowClick(value);
|
|
257
265
|
}
|
|
258
266
|
};
|
|
259
267
|
}); // loading触发清空选中状态
|
|
@@ -277,7 +285,9 @@ var ResetTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
277
285
|
summary: function summary(pageData) {
|
|
278
286
|
return _summary && _summary(pageData, resultColumns);
|
|
279
287
|
}
|
|
280
|
-
}))
|
|
288
|
+
})), !!customCheck && /*#__PURE__*/_react.default.createElement("div", {
|
|
289
|
+
className: "lm_customCheck"
|
|
290
|
+
}, customCheck));
|
|
281
291
|
}); // 监听大小: 这里的高度是整个表格的高度,表体需要减去列头和分页的高度
|
|
282
292
|
|
|
283
293
|
var ResizeSize = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
@@ -285,6 +295,7 @@ var ResizeSize = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
285
295
|
var throttleSize = (0, _lodash.throttle)(function (_ref) {
|
|
286
296
|
var height = _ref.height,
|
|
287
297
|
width = _ref.width;
|
|
298
|
+
console.log(height, width, 444);
|
|
288
299
|
|
|
289
300
|
var resetHeight = function resetHeight() {
|
|
290
301
|
var h = height - 48;
|
|
@@ -311,11 +322,12 @@ var ResizeSize = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
311
322
|
}
|
|
312
323
|
}));
|
|
313
324
|
}, 100);
|
|
314
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(
|
|
325
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_autosize.default, {
|
|
315
326
|
style: {
|
|
316
327
|
width: '100%',
|
|
317
328
|
height: '100%'
|
|
318
|
-
}
|
|
329
|
+
},
|
|
330
|
+
disableWidth: true
|
|
319
331
|
}, throttleSize));
|
|
320
332
|
});
|
|
321
333
|
var _default = ResizeSize;
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
+
|
|
12
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
|
+
|
|
14
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
15
|
+
|
|
16
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
17
|
+
|
|
18
|
+
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
19
|
+
|
|
20
|
+
var _lodash = require("lodash");
|
|
21
|
+
|
|
22
|
+
var _react = _interopRequireDefault(require("react"));
|
|
23
|
+
|
|
24
|
+
var _detectElementResize = _interopRequireDefault(require("./detectElementResize"));
|
|
25
|
+
|
|
26
|
+
var AutoSizer = /*#__PURE__*/function (_React$Component) {
|
|
27
|
+
(0, _inherits2.default)(AutoSizer, _React$Component);
|
|
28
|
+
|
|
29
|
+
var _super = (0, _createSuper2.default)(AutoSizer);
|
|
30
|
+
|
|
31
|
+
function AutoSizer() {
|
|
32
|
+
var _this;
|
|
33
|
+
|
|
34
|
+
(0, _classCallCheck2.default)(this, AutoSizer);
|
|
35
|
+
|
|
36
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
37
|
+
args[_key] = arguments[_key];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
41
|
+
_this.state = {
|
|
42
|
+
height: _this.props.defaultHeight || 0,
|
|
43
|
+
width: _this.props.defaultWidth || 0
|
|
44
|
+
};
|
|
45
|
+
_this._parentNode = void 0;
|
|
46
|
+
_this._autoSizer = void 0;
|
|
47
|
+
_this._window = void 0;
|
|
48
|
+
_this._detectElementResize = void 0;
|
|
49
|
+
|
|
50
|
+
_this._onResize = function () {
|
|
51
|
+
console.log(11);
|
|
52
|
+
var _this$props = _this.props,
|
|
53
|
+
disableHeight = _this$props.disableHeight,
|
|
54
|
+
disableWidth = _this$props.disableWidth,
|
|
55
|
+
onResize = _this$props.onResize;
|
|
56
|
+
|
|
57
|
+
if (_this._parentNode) {
|
|
58
|
+
// Guard against AutoSizer component being removed from the DOM immediately after being added.
|
|
59
|
+
// This can result in invalid style values which can result in NaN values if we don't handle them.
|
|
60
|
+
// See issue #150 for more context.
|
|
61
|
+
var height = _this._parentNode.offsetHeight || 0;
|
|
62
|
+
var width = _this._parentNode.offsetWidth || 0;
|
|
63
|
+
var win = _this._window || window;
|
|
64
|
+
var style = win.getComputedStyle(_this._parentNode) || {};
|
|
65
|
+
var paddingLeft = parseInt(style.paddingLeft, 10) || 0;
|
|
66
|
+
var paddingRight = parseInt(style.paddingRight, 10) || 0;
|
|
67
|
+
var paddingTop = parseInt(style.paddingTop, 10) || 0;
|
|
68
|
+
var paddingBottom = parseInt(style.paddingBottom, 10) || 0;
|
|
69
|
+
var newHeight = height - paddingTop - paddingBottom;
|
|
70
|
+
var newWidth = width - paddingLeft - paddingRight;
|
|
71
|
+
|
|
72
|
+
if (!disableHeight && _this.state.height !== newHeight || !disableWidth && _this.state.width !== newWidth) {
|
|
73
|
+
_this.setState({
|
|
74
|
+
height: height - paddingTop - paddingBottom,
|
|
75
|
+
width: width - paddingLeft - paddingRight
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
onResize({
|
|
79
|
+
height: height,
|
|
80
|
+
width: width
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
_this.handleResize = (0, _lodash.debounce)(_this._onResize, 800);
|
|
87
|
+
|
|
88
|
+
_this._setRef = function (autoSizer) {
|
|
89
|
+
_this._autoSizer = autoSizer;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
return _this;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
(0, _createClass2.default)(AutoSizer, [{
|
|
96
|
+
key: "componentDidMount",
|
|
97
|
+
value: function componentDidMount() {
|
|
98
|
+
var nonce = this.props.nonce;
|
|
99
|
+
|
|
100
|
+
if (this._autoSizer && this._autoSizer.parentNode && this._autoSizer.parentNode.ownerDocument && this._autoSizer.parentNode.ownerDocument.defaultView && this._autoSizer.parentNode instanceof this._autoSizer.parentNode.ownerDocument.defaultView.HTMLElement) {
|
|
101
|
+
// Delay access of parentNode until mount.
|
|
102
|
+
// This handles edge-cases where the component has already been unmounted before its ref has been set,
|
|
103
|
+
// As well as libraries like react-lite which have a slightly different lifecycle.
|
|
104
|
+
this._parentNode = this._autoSizer.parentNode;
|
|
105
|
+
this._window = this._autoSizer.parentNode.ownerDocument.defaultView; // Defer requiring resize handler in order to support server-side rendering.
|
|
106
|
+
// See issue #41
|
|
107
|
+
|
|
108
|
+
this._detectElementResize = (0, _detectElementResize.default)(nonce, this._window);
|
|
109
|
+
|
|
110
|
+
this._detectElementResize.addResizeListener(this._parentNode, this.handleResize);
|
|
111
|
+
|
|
112
|
+
console.log(3);
|
|
113
|
+
|
|
114
|
+
this._onResize();
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}, {
|
|
118
|
+
key: "componentWillUnmount",
|
|
119
|
+
value: function componentWillUnmount() {
|
|
120
|
+
if (this._detectElementResize && this._parentNode) {
|
|
121
|
+
this._detectElementResize.removeResizeListener(this._parentNode, this._onResize);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}, {
|
|
125
|
+
key: "render",
|
|
126
|
+
value: function render() {
|
|
127
|
+
var _this$props2 = this.props,
|
|
128
|
+
children = _this$props2.children,
|
|
129
|
+
className = _this$props2.className,
|
|
130
|
+
disableHeight = _this$props2.disableHeight,
|
|
131
|
+
disableWidth = _this$props2.disableWidth,
|
|
132
|
+
style = _this$props2.style;
|
|
133
|
+
var _this$state = this.state,
|
|
134
|
+
height = _this$state.height,
|
|
135
|
+
width = _this$state.width; // Outer div should not force width/height since that may prevent containers from shrinking.
|
|
136
|
+
// Inner component should overflow and use calculated width/height.
|
|
137
|
+
// See issue #68 for more information.
|
|
138
|
+
|
|
139
|
+
var outerStyle = {
|
|
140
|
+
overflow: 'visible'
|
|
141
|
+
};
|
|
142
|
+
var childParams = {};
|
|
143
|
+
|
|
144
|
+
if (!disableHeight) {
|
|
145
|
+
outerStyle.height = 0;
|
|
146
|
+
childParams.height = height;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
if (!disableWidth) {
|
|
150
|
+
outerStyle.width = 0;
|
|
151
|
+
childParams.width = width;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
155
|
+
className: className,
|
|
156
|
+
ref: this._setRef,
|
|
157
|
+
style: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, outerStyle), style)
|
|
158
|
+
}, children(childParams));
|
|
159
|
+
}
|
|
160
|
+
}]);
|
|
161
|
+
return AutoSizer;
|
|
162
|
+
}(_react.default.Component);
|
|
163
|
+
|
|
164
|
+
exports.default = AutoSizer;
|
|
165
|
+
AutoSizer.defaultProps = {
|
|
166
|
+
onResize: function onResize() {},
|
|
167
|
+
disableHeight: false,
|
|
168
|
+
disableWidth: false,
|
|
169
|
+
style: {}
|
|
170
|
+
};
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = createDetectElementResize;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Detect Element Resize.
|
|
10
|
+
* https://github.com/sdecima/javascript-detect-element-resize
|
|
11
|
+
* Sebastian Decima
|
|
12
|
+
*
|
|
13
|
+
* Forked from version 0.5.3; includes the following modifications:
|
|
14
|
+
* 1) Guard against unsafe 'window' and 'document' references (to support SSR).
|
|
15
|
+
* 2) Defer initialization code via a top-level function wrapper (to support SSR).
|
|
16
|
+
* 3) Avoid unnecessary reflows by not measuring size for scroll events bubbling from children.
|
|
17
|
+
* 4) Add nonce for style element.
|
|
18
|
+
* 5) Added support for injecting custom window object
|
|
19
|
+
**/
|
|
20
|
+
function createDetectElementResize(nonce, hostWindow) {
|
|
21
|
+
// Check `document` and `window` in case of server-side rendering
|
|
22
|
+
var _window;
|
|
23
|
+
|
|
24
|
+
if (typeof hostWindow !== 'undefined') {
|
|
25
|
+
_window = hostWindow;
|
|
26
|
+
} else if (typeof window !== 'undefined') {
|
|
27
|
+
_window = window;
|
|
28
|
+
} else if (typeof self !== 'undefined') {
|
|
29
|
+
_window = self;
|
|
30
|
+
} else {
|
|
31
|
+
_window = global;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
var attachEvent = typeof _window.document !== 'undefined' && _window.document.attachEvent;
|
|
35
|
+
|
|
36
|
+
if (!attachEvent) {
|
|
37
|
+
var requestFrame = function () {
|
|
38
|
+
var raf = _window.requestAnimationFrame || _window.mozRequestAnimationFrame || _window.webkitRequestAnimationFrame || function (fn) {
|
|
39
|
+
return _window.setTimeout(fn, 20);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
return function (fn) {
|
|
43
|
+
return raf(fn);
|
|
44
|
+
};
|
|
45
|
+
}();
|
|
46
|
+
|
|
47
|
+
var cancelFrame = function () {
|
|
48
|
+
var cancel = _window.cancelAnimationFrame || _window.mozCancelAnimationFrame || _window.webkitCancelAnimationFrame || _window.clearTimeout;
|
|
49
|
+
return function (id) {
|
|
50
|
+
return cancel(id);
|
|
51
|
+
};
|
|
52
|
+
}();
|
|
53
|
+
|
|
54
|
+
var resetTriggers = function resetTriggers(element) {
|
|
55
|
+
var triggers = element.__resizeTriggers__,
|
|
56
|
+
expand = triggers.firstElementChild,
|
|
57
|
+
contract = triggers.lastElementChild,
|
|
58
|
+
expandChild = expand.firstElementChild;
|
|
59
|
+
contract.scrollLeft = contract.scrollWidth;
|
|
60
|
+
contract.scrollTop = contract.scrollHeight;
|
|
61
|
+
expandChild.style.width = expand.offsetWidth + 1 + 'px';
|
|
62
|
+
expandChild.style.height = expand.offsetHeight + 1 + 'px';
|
|
63
|
+
expand.scrollLeft = expand.scrollWidth;
|
|
64
|
+
expand.scrollTop = expand.scrollHeight;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
var checkTriggers = function checkTriggers(element) {
|
|
68
|
+
return element.offsetWidth != element.__resizeLast__.width || element.offsetHeight != element.__resizeLast__.height;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
var scrollListener = function scrollListener(e) {
|
|
72
|
+
// Don't measure (which forces) reflow for scrolls that happen inside of children!
|
|
73
|
+
if (e.target.className && typeof e.target.className.indexOf === 'function' && e.target.className.indexOf('contract-trigger') < 0 && e.target.className.indexOf('expand-trigger') < 0) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
var element = this;
|
|
78
|
+
resetTriggers(this);
|
|
79
|
+
|
|
80
|
+
if (this.__resizeRAF__) {
|
|
81
|
+
cancelFrame(this.__resizeRAF__);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
this.__resizeRAF__ = requestFrame(function () {
|
|
85
|
+
if (checkTriggers(element)) {
|
|
86
|
+
element.__resizeLast__.width = element.offsetWidth;
|
|
87
|
+
element.__resizeLast__.height = element.offsetHeight;
|
|
88
|
+
|
|
89
|
+
element.__resizeListeners__.forEach(function (fn) {
|
|
90
|
+
fn.call(element, e);
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
/* Detect CSS Animations support to detect element display/re-attach */
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
var animation = false,
|
|
99
|
+
keyframeprefix = '',
|
|
100
|
+
animationstartevent = 'animationstart',
|
|
101
|
+
domPrefixes = 'Webkit Moz O ms'.split(' '),
|
|
102
|
+
startEvents = 'webkitAnimationStart animationstart oAnimationStart MSAnimationStart'.split(' '),
|
|
103
|
+
pfx = '';
|
|
104
|
+
{
|
|
105
|
+
var elm = _window.document.createElement('fakeelement');
|
|
106
|
+
|
|
107
|
+
if (elm.style.animationName !== undefined) {
|
|
108
|
+
animation = true;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if (animation === false) {
|
|
112
|
+
for (var i = 0; i < domPrefixes.length; i++) {
|
|
113
|
+
if (elm.style[domPrefixes[i] + 'AnimationName'] !== undefined) {
|
|
114
|
+
pfx = domPrefixes[i];
|
|
115
|
+
keyframeprefix = '-' + pfx.toLowerCase() + '-';
|
|
116
|
+
animationstartevent = startEvents[i];
|
|
117
|
+
animation = true;
|
|
118
|
+
break;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
var animationName = 'resizeanim';
|
|
124
|
+
var animationKeyframes = '@' + keyframeprefix + 'keyframes ' + animationName + ' { from { opacity: 0; } to { opacity: 0; } } ';
|
|
125
|
+
var animationStyle = keyframeprefix + 'animation: 1ms ' + animationName + '; ';
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
var createStyles = function createStyles(doc) {
|
|
129
|
+
if (!doc.getElementById('detectElementResize')) {
|
|
130
|
+
//opacity:0 works around a chrome bug https://code.google.com/p/chromium/issues/detail?id=286360
|
|
131
|
+
var css = (animationKeyframes ? animationKeyframes : '') + '.resize-triggers { ' + (animationStyle ? animationStyle : '') + 'visibility: hidden; opacity: 0; } ' + '.resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',
|
|
132
|
+
head = doc.head || doc.getElementsByTagName('head')[0],
|
|
133
|
+
style = doc.createElement('style');
|
|
134
|
+
style.id = 'detectElementResize';
|
|
135
|
+
style.type = 'text/css';
|
|
136
|
+
|
|
137
|
+
if (nonce != null) {
|
|
138
|
+
style.setAttribute('nonce', nonce);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
if (style.styleSheet) {
|
|
142
|
+
style.styleSheet.cssText = css;
|
|
143
|
+
} else {
|
|
144
|
+
style.appendChild(doc.createTextNode(css));
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
head.appendChild(style);
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
var addResizeListener = function addResizeListener(element, fn) {
|
|
152
|
+
if (attachEvent) {
|
|
153
|
+
element.attachEvent('onresize', fn);
|
|
154
|
+
} else {
|
|
155
|
+
if (!element.__resizeTriggers__) {
|
|
156
|
+
var doc = element.ownerDocument;
|
|
157
|
+
|
|
158
|
+
var elementStyle = _window.getComputedStyle(element);
|
|
159
|
+
|
|
160
|
+
if (elementStyle && elementStyle.position == 'static') {
|
|
161
|
+
element.style.position = 'relative';
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
createStyles(doc);
|
|
165
|
+
element.__resizeLast__ = {};
|
|
166
|
+
element.__resizeListeners__ = [];
|
|
167
|
+
(element.__resizeTriggers__ = doc.createElement('div')).className = 'resize-triggers';
|
|
168
|
+
var expandTrigger = doc.createElement('div');
|
|
169
|
+
expandTrigger.className = 'expand-trigger';
|
|
170
|
+
expandTrigger.appendChild(doc.createElement('div'));
|
|
171
|
+
var contractTrigger = doc.createElement('div');
|
|
172
|
+
contractTrigger.className = 'contract-trigger';
|
|
173
|
+
|
|
174
|
+
element.__resizeTriggers__.appendChild(expandTrigger);
|
|
175
|
+
|
|
176
|
+
element.__resizeTriggers__.appendChild(contractTrigger);
|
|
177
|
+
|
|
178
|
+
element.appendChild(element.__resizeTriggers__);
|
|
179
|
+
resetTriggers(element);
|
|
180
|
+
element.addEventListener('scroll', scrollListener, true);
|
|
181
|
+
/* Listen for a css animation to detect element display/re-attach */
|
|
182
|
+
|
|
183
|
+
if (animationstartevent) {
|
|
184
|
+
element.__resizeTriggers__.__animationListener__ = function animationListener(e) {
|
|
185
|
+
if (e.animationName == animationName) {
|
|
186
|
+
resetTriggers(element);
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
element.__resizeTriggers__.addEventListener(animationstartevent, element.__resizeTriggers__.__animationListener__);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
element.__resizeListeners__.push(fn);
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
var removeResizeListener = function removeResizeListener(element, fn) {
|
|
199
|
+
if (attachEvent) {
|
|
200
|
+
element.detachEvent('onresize', fn);
|
|
201
|
+
} else {
|
|
202
|
+
element.__resizeListeners__.splice(element.__resizeListeners__.indexOf(fn), 1);
|
|
203
|
+
|
|
204
|
+
if (!element.__resizeListeners__.length) {
|
|
205
|
+
element.removeEventListener('scroll', scrollListener, true);
|
|
206
|
+
|
|
207
|
+
if (element.__resizeTriggers__.__animationListener__) {
|
|
208
|
+
element.__resizeTriggers__.removeEventListener(animationstartevent, element.__resizeTriggers__.__animationListener__);
|
|
209
|
+
|
|
210
|
+
element.__resizeTriggers__.__animationListener__ = null;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
try {
|
|
214
|
+
element.__resizeTriggers__ = !element.removeChild(element.__resizeTriggers__);
|
|
215
|
+
} catch (e) {// Preact compat; see developit/preact-compat/issues/228
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
return {
|
|
222
|
+
addResizeListener: addResizeListener,
|
|
223
|
+
removeResizeListener: removeResizeListener
|
|
224
|
+
};
|
|
225
|
+
}
|
|
@@ -34,6 +34,13 @@
|
|
|
34
34
|
color: var(--font-color);
|
|
35
35
|
vertical-align: middle;
|
|
36
36
|
}
|
|
37
|
+
.lm-radio-group .ant-radio-button-wrapper .anticon {
|
|
38
|
+
font-size: 16px;
|
|
39
|
+
vertical-align: middle;
|
|
40
|
+
}
|
|
41
|
+
.lm-radio-group .ant-radio-button-wrapper:hover {
|
|
42
|
+
color: var(--primary-color);
|
|
43
|
+
}
|
|
37
44
|
.lm-radio-group .ant-radio-button-wrapper > span:last-child {
|
|
38
45
|
display: inline-block;
|
|
39
46
|
font-size: 12px;
|