shineout 1.10.16-beta.2 → 1.10.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/css/Datum/Tree.js +13 -7
- package/css/InputTitle/styles/inputTitle.css +2 -2
- package/css/Tabs/Header.js +30 -6
- package/css/Tabs/styles/tabs.css +3 -3
- package/css/TreeSelect/TreeSelect.js +2 -1
- package/css/TreeSelect/filter.js +1 -1
- package/css/index.d.ts +1 -1
- package/css/index.js +1 -1
- package/css/utils/dom/element.js +17 -7
- package/css/utils/func.js +27 -1
- package/dist/shineout.js +144 -74
- package/dist/shineout.js.map +1 -1
- package/dist/shineout.min.js +1 -1
- package/dist/theme.antd.css +1 -1
- package/dist/theme.antd2.css +1 -1
- package/dist/theme.default.css +1 -1
- package/dist/theme.shineout.css +1 -1
- package/es/Datum/Tree.js +13 -7
- package/es/InputTitle/styles/inputTitle.less +2 -2
- package/es/Tabs/Header.js +29 -6
- package/es/Tabs/styles/tabs.less +23 -19
- package/es/TreeSelect/TreeSelect.js +2 -1
- package/es/TreeSelect/filter.js +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/utils/dom/element.js +16 -7
- package/es/utils/func.js +23 -1
- package/lib/Datum/Tree.js +13 -7
- package/lib/InputTitle/styles/inputTitle.less +2 -2
- package/lib/Tabs/Header.js +30 -6
- package/lib/Tabs/styles/tabs.less +23 -19
- package/lib/TreeSelect/TreeSelect.js +2 -1
- package/lib/TreeSelect/filter.js +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/utils/dom/element.js +17 -7
- package/lib/utils/func.js +27 -1
- package/package.json +1 -1
package/css/Datum/Tree.js
CHANGED
|
@@ -86,13 +86,20 @@ function () {
|
|
|
86
86
|
_proto.setUnmatedValue = function setUnmatedValue() {
|
|
87
87
|
var _this = this;
|
|
88
88
|
|
|
89
|
+
this.unmatchedValueMap = new Map();
|
|
89
90
|
if (!this.value || !this.data) return;
|
|
90
91
|
this.value.forEach(function (v) {
|
|
91
92
|
var data = _this.getDataById(v);
|
|
92
93
|
|
|
93
|
-
var unmatched = data
|
|
94
|
+
var unmatched = _this.isUnMatch(data);
|
|
95
|
+
|
|
94
96
|
if (unmatched) _this.unmatchedValueMap.set(v, true);else _this.unmatchedValueMap.delete(v);
|
|
95
97
|
});
|
|
98
|
+
} // eslint-disable-next-line class-methods-use-this
|
|
99
|
+
;
|
|
100
|
+
|
|
101
|
+
_proto.isUnMatch = function isUnMatch(data) {
|
|
102
|
+
return data && data[IS_NOT_MATCHED_VALUE];
|
|
96
103
|
};
|
|
97
104
|
|
|
98
105
|
_proto.setValue = function setValue(value) {
|
|
@@ -161,12 +168,6 @@ function () {
|
|
|
161
168
|
|
|
162
169
|
// self
|
|
163
170
|
if (!this.isDisabled(id)) this.setValueMap(id, checked);
|
|
164
|
-
|
|
165
|
-
if (CheckedMode.Freedom === this.mode) {
|
|
166
|
-
// Free mode will return zero
|
|
167
|
-
return 0;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
171
|
var data = this.getDataById(id);
|
|
171
172
|
|
|
172
173
|
if (data && data[IS_NOT_MATCHED_VALUE]) {
|
|
@@ -174,6 +175,11 @@ function () {
|
|
|
174
175
|
return null;
|
|
175
176
|
}
|
|
176
177
|
|
|
178
|
+
if (CheckedMode.Freedom === this.mode) {
|
|
179
|
+
// Free mode will return zero
|
|
180
|
+
return 0;
|
|
181
|
+
}
|
|
182
|
+
|
|
177
183
|
var _this$pathMap$get = this.pathMap.get(id),
|
|
178
184
|
path = _this$pathMap$get.path,
|
|
179
185
|
children = _this$pathMap$get.children;
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
padding: 2px 8px;
|
|
129
129
|
font-size: var(--font-size-small, 12px);
|
|
130
130
|
}
|
|
131
|
-
.so-input-small
|
|
131
|
+
.so-input-small *.so-input-title-box-item {
|
|
132
132
|
padding: 2px 8px;
|
|
133
133
|
}
|
|
134
134
|
.so-input-large .so-input-title-box {
|
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
padding: 4px 8px;
|
|
139
139
|
font-size: var(--font-size-large, 18px);
|
|
140
140
|
}
|
|
141
|
-
.so-input-large
|
|
141
|
+
.so-input-large *.so-input-title-box-item {
|
|
142
142
|
padding: 4px 8px;
|
|
143
143
|
}
|
|
144
144
|
.so-datepicker-inner-title .so-input-title-box-title {
|
package/css/Tabs/Header.js
CHANGED
|
@@ -19,6 +19,8 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
19
19
|
|
|
20
20
|
var _immer = _interopRequireDefault(require("immer"));
|
|
21
21
|
|
|
22
|
+
var _element = require("shineout/utils/dom/element");
|
|
23
|
+
|
|
22
24
|
var _component = require("../component");
|
|
23
25
|
|
|
24
26
|
var _Button = _interopRequireDefault(require("../Button"));
|
|
@@ -56,6 +58,7 @@ function (_PureComponent) {
|
|
|
56
58
|
_this.handleNextClick = _this.handleMove.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)), false);
|
|
57
59
|
_this.moveToCenter = _this.moveToCenter.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
|
|
58
60
|
_this.handleCollapse = _this.handleCollapse.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
|
|
61
|
+
_this.handleResize = _this.handleResize.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
|
|
59
62
|
return _this;
|
|
60
63
|
}
|
|
61
64
|
|
|
@@ -66,6 +69,10 @@ function (_PureComponent) {
|
|
|
66
69
|
|
|
67
70
|
var isVertical = this.props.isVertical;
|
|
68
71
|
this.setPosition(isVertical);
|
|
72
|
+
this.removeObserver = (0, _element.addResizeObserver)(this.innerElement, this.handleResize, {
|
|
73
|
+
direction: true,
|
|
74
|
+
timer: 100
|
|
75
|
+
});
|
|
69
76
|
};
|
|
70
77
|
|
|
71
78
|
_proto.componentDidUpdate = function componentDidUpdate() {
|
|
@@ -73,6 +80,14 @@ function (_PureComponent) {
|
|
|
73
80
|
this.setPosition(isVertical);
|
|
74
81
|
};
|
|
75
82
|
|
|
83
|
+
_proto.componentWillUnmount = function componentWillUnmount() {
|
|
84
|
+
_PureComponent.prototype.componentWillUnmount.call(this);
|
|
85
|
+
|
|
86
|
+
if (this.removeObserver) {
|
|
87
|
+
this.removeObserver();
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
|
|
76
91
|
_proto.setPosition = function setPosition(isVertical) {
|
|
77
92
|
var attributeString = isVertical ? 'Height' : 'Width';
|
|
78
93
|
if (!this.innerElement) return;
|
|
@@ -85,6 +100,14 @@ function (_PureComponent) {
|
|
|
85
100
|
});
|
|
86
101
|
};
|
|
87
102
|
|
|
103
|
+
_proto.handleResize = function handleResize(entry, _ref) {
|
|
104
|
+
var x = _ref.x,
|
|
105
|
+
y = _ref.y;
|
|
106
|
+
var isVertical = this.props.isVertical;
|
|
107
|
+
var isResize = isVertical ? y : x;
|
|
108
|
+
if (isResize) this.setPosition(isVertical);
|
|
109
|
+
};
|
|
110
|
+
|
|
88
111
|
_proto.bindElement = function bindElement(name, el) {
|
|
89
112
|
this[name] = el;
|
|
90
113
|
};
|
|
@@ -98,6 +121,7 @@ function (_PureComponent) {
|
|
|
98
121
|
var attribute = a + (lt ? -innerAttribute : innerAttribute);
|
|
99
122
|
if (attribute < 0) attribute = 0;
|
|
100
123
|
if (attribute + innerAttribute > scrollAttribute) attribute = scrollAttribute - innerAttribute;
|
|
124
|
+
if (scrollAttribute <= innerAttribute) attribute = 0;
|
|
101
125
|
this.setState({
|
|
102
126
|
attribute: attribute
|
|
103
127
|
});
|
|
@@ -151,10 +175,10 @@ function (_PureComponent) {
|
|
|
151
175
|
onCollapse(!collapsed);
|
|
152
176
|
};
|
|
153
177
|
|
|
154
|
-
_proto.renderTab = function renderTab(
|
|
155
|
-
var tab =
|
|
156
|
-
id =
|
|
157
|
-
other = (0, _objectWithoutPropertiesLoose2.default)(
|
|
178
|
+
_proto.renderTab = function renderTab(_ref2) {
|
|
179
|
+
var tab = _ref2.tab,
|
|
180
|
+
id = _ref2.id,
|
|
181
|
+
other = (0, _objectWithoutPropertiesLoose2.default)(_ref2, ["tab", "id"]);
|
|
158
182
|
return _react.default.createElement(_Tab.default, (0, _extends2.default)({}, other, {
|
|
159
183
|
key: id,
|
|
160
184
|
id: id,
|
|
@@ -187,7 +211,7 @@ function (_PureComponent) {
|
|
|
187
211
|
};
|
|
188
212
|
|
|
189
213
|
_proto.render = function render() {
|
|
190
|
-
var
|
|
214
|
+
var _ref3;
|
|
191
215
|
|
|
192
216
|
var _this$props3 = this.props,
|
|
193
217
|
border = _this$props3.border,
|
|
@@ -221,7 +245,7 @@ function (_PureComponent) {
|
|
|
221
245
|
className: (0, _styles.tabsClass)('inner')
|
|
222
246
|
}, _react.default.createElement("div", {
|
|
223
247
|
ref: this.bindScroll,
|
|
224
|
-
style: (
|
|
248
|
+
style: (_ref3 = {}, _ref3["margin" + position] = -attribute, _ref3),
|
|
225
249
|
className: (0, _styles.tabsClass)('scroll')
|
|
226
250
|
}, shape === 'button' ? this.renderButtons() : this.renderTabs())), overflow && _react.default.createElement("div", {
|
|
227
251
|
onClick: this.handleNextClick,
|
package/css/Tabs/styles/tabs.css
CHANGED
|
@@ -320,17 +320,17 @@
|
|
|
320
320
|
.so-tabs-panel.so-tabs-show {
|
|
321
321
|
display: block;
|
|
322
322
|
}
|
|
323
|
-
.so-tabs-dash .so-tabs-tab {
|
|
323
|
+
.so-tabs-dash > .so-tabs-header .so-tabs-tab {
|
|
324
324
|
border-color: transparent;
|
|
325
325
|
background: transparent;
|
|
326
326
|
color: inherit;
|
|
327
327
|
}
|
|
328
|
-
.so-tabs-dash .so-tabs-active {
|
|
328
|
+
.so-tabs-dash > .so-tabs-header .so-tabs-active {
|
|
329
329
|
color: var(--primary-color, #3399ff);
|
|
330
330
|
border-color: transparent;
|
|
331
331
|
background: transparent;
|
|
332
332
|
}
|
|
333
|
-
.so-tabs-dash .so-tabs-active:after {
|
|
333
|
+
.so-tabs-dash > .so-tabs-header .so-tabs-active:after {
|
|
334
334
|
bottom: 0;
|
|
335
335
|
left: 50%;
|
|
336
336
|
-webkit-transform: translateX(-50%);
|
|
@@ -253,7 +253,8 @@ function (_PureComponent) {
|
|
|
253
253
|
|
|
254
254
|
_proto.handleRemove = function handleRemove(data) {
|
|
255
255
|
var datum = this.props.datum;
|
|
256
|
-
datum.
|
|
256
|
+
var dataKey = data && datum.isUnMatch(data) ? data.value : datum.getKey(data);
|
|
257
|
+
datum.set(dataKey, 0);
|
|
257
258
|
this.handleChange(data, datum.getKey(data));
|
|
258
259
|
};
|
|
259
260
|
|
package/css/TreeSelect/filter.js
CHANGED
|
@@ -73,7 +73,7 @@ var _default = function _default(Origin) {
|
|
|
73
73
|
var _res;
|
|
74
74
|
|
|
75
75
|
res = datum.getDataById(v);
|
|
76
|
-
if (res && !noCache) _this2.resultCache.set(v, res);else if (!res) res = (_res = {}, _res[_Result.IS_NOT_MATCHED_VALUE] = true, _res.value = v, _res);
|
|
76
|
+
if (res && !noCache && !res[_Result.IS_NOT_MATCHED_VALUE]) _this2.resultCache.set(v, res);else if (!res) res = (_res = {}, _res[_Result.IS_NOT_MATCHED_VALUE] = true, _res.value = v, _res);
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
if (res) {
|
package/css/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Created by scripts/src-index.js.
|
|
2
2
|
import * as utils from './utils'
|
|
3
3
|
|
|
4
|
-
export default { utils, version: '1.10.16
|
|
4
|
+
export default { utils, version: '1.10.16' }
|
|
5
5
|
export { utils }
|
|
6
6
|
export { setLocale } from './locale'
|
|
7
7
|
export { color, style } from './utils/expose'
|
package/css/index.js
CHANGED
package/css/utils/dom/element.js
CHANGED
|
@@ -13,6 +13,8 @@ exports.addResizeObserver = exports.parsePxToNumber = exports.preventPasteFile =
|
|
|
13
13
|
|
|
14
14
|
var _react = _interopRequireDefault(require("react"));
|
|
15
15
|
|
|
16
|
+
var _func = require("../func");
|
|
17
|
+
|
|
16
18
|
if (Element && !Element.prototype.matches) {
|
|
17
19
|
var proto = Element.prototype;
|
|
18
20
|
proto.matches = proto.matchesSelector || proto.mozMatchesSelector || proto.msMatchesSelector || proto.oMatchesSelector || proto.webkitMatchesSelector;
|
|
@@ -208,8 +210,14 @@ var addResizeObserver = function addResizeObserver(el, handler, options) {
|
|
|
208
210
|
}
|
|
209
211
|
|
|
210
212
|
var _options = options,
|
|
211
|
-
direction = _options.direction
|
|
212
|
-
|
|
213
|
+
direction = _options.direction,
|
|
214
|
+
timer = _options.timer;
|
|
215
|
+
|
|
216
|
+
var _throttle = (0, _func.throttle)(handler, timer),
|
|
217
|
+
throttleHandler = _throttle[0],
|
|
218
|
+
cleanTimer = _throttle[1];
|
|
219
|
+
|
|
220
|
+
var h = throttleHandler;
|
|
213
221
|
var lastWidth;
|
|
214
222
|
var lastHeight;
|
|
215
223
|
|
|
@@ -225,14 +233,14 @@ var addResizeObserver = function addResizeObserver(el, handler, options) {
|
|
|
225
233
|
|
|
226
234
|
if (width && direction === 'x') {
|
|
227
235
|
if (lastWidth !== width) {
|
|
228
|
-
|
|
236
|
+
throttleHandler(entry);
|
|
229
237
|
}
|
|
230
238
|
} else if (direction === 'y') {
|
|
231
239
|
if (height && lastHeight !== height) {
|
|
232
|
-
|
|
240
|
+
throttleHandler(entry);
|
|
233
241
|
}
|
|
234
242
|
} else if (width && height) {
|
|
235
|
-
|
|
243
|
+
throttleHandler(entry, {
|
|
236
244
|
x: lastWidth !== width,
|
|
237
245
|
y: lastHeight !== height
|
|
238
246
|
});
|
|
@@ -247,13 +255,15 @@ var addResizeObserver = function addResizeObserver(el, handler, options) {
|
|
|
247
255
|
observer.observe(el);
|
|
248
256
|
return function () {
|
|
249
257
|
observer.disconnect();
|
|
258
|
+
cleanTimer();
|
|
250
259
|
observer = null;
|
|
251
260
|
};
|
|
252
261
|
}
|
|
253
262
|
|
|
254
|
-
window.addEventListener('resize',
|
|
263
|
+
window.addEventListener('resize', throttleHandler);
|
|
255
264
|
return function () {
|
|
256
|
-
|
|
265
|
+
window.removeEventListener('resize', handler);
|
|
266
|
+
cleanTimer();
|
|
257
267
|
};
|
|
258
268
|
};
|
|
259
269
|
|
package/css/utils/func.js
CHANGED
|
@@ -6,6 +6,7 @@ exports.curry = curry;
|
|
|
6
6
|
exports.empty = empty;
|
|
7
7
|
exports.memoize = memoize;
|
|
8
8
|
exports.createFunc = createFunc;
|
|
9
|
+
exports.throttle = void 0;
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* from redux.compose https://github.com/reactjs/redux/blob/master/src/compose.js
|
|
@@ -77,4 +78,29 @@ function createFunc(func) {
|
|
|
77
78
|
return function (data) {
|
|
78
79
|
return func ? data[func] : data;
|
|
79
80
|
};
|
|
80
|
-
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
var throttle = function throttle(func, timer) {
|
|
84
|
+
var that = {};
|
|
85
|
+
|
|
86
|
+
var cleanTimer = function cleanTimer() {
|
|
87
|
+
if (that.timer) {
|
|
88
|
+
clearTimeout(that.timer);
|
|
89
|
+
that.timer = '';
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
if (!timer) return [func, cleanTimer];
|
|
94
|
+
return [function () {
|
|
95
|
+
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
96
|
+
args[_key4] = arguments[_key4];
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
cleanTimer();
|
|
100
|
+
that.timer = setTimeout(function () {
|
|
101
|
+
func.apply(void 0, args);
|
|
102
|
+
}, timer);
|
|
103
|
+
}, cleanTimer];
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
exports.throttle = throttle;
|