shineout 1.10.8-beta.2 → 1.10.9

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.
Files changed (44) hide show
  1. package/css/Button/Button.js +2 -2
  2. package/css/Datum/Tree.js +6 -0
  3. package/css/Form/styles/form.css +1 -0
  4. package/css/Select/Result.js +1 -1
  5. package/css/Select/Select.js +11 -4
  6. package/css/Table/SimpleTable.js +5 -1
  7. package/css/Tabs/Tab.js +1 -1
  8. package/css/Tree/Content.js +23 -1
  9. package/css/TreeSelect/Result.js +1 -1
  10. package/css/TreeSelect/datum.js +2 -1
  11. package/css/index.d.ts +1 -1
  12. package/css/index.js +1 -1
  13. package/dist/shineout.js +133 -86
  14. package/dist/shineout.js.map +1 -1
  15. package/dist/shineout.min.js +1 -1
  16. package/dist/theme.antd.css +1 -1
  17. package/dist/theme.antd2.css +1 -1
  18. package/dist/theme.default.css +1 -1
  19. package/dist/theme.shineout.css +1 -1
  20. package/es/Button/Button.js +1 -1
  21. package/es/Datum/Tree.js +6 -0
  22. package/es/Form/styles/form.less +1 -0
  23. package/es/Select/Result.js +1 -1
  24. package/es/Select/Select.js +11 -4
  25. package/es/Table/SimpleTable.js +5 -1
  26. package/es/Tabs/Tab.js +1 -1
  27. package/es/Tree/Content.js +22 -1
  28. package/es/TreeSelect/Result.js +1 -1
  29. package/es/TreeSelect/datum.js +2 -1
  30. package/es/index.d.ts +1 -1
  31. package/es/index.js +1 -1
  32. package/lib/Button/Button.js +2 -2
  33. package/lib/Datum/Tree.js +6 -0
  34. package/lib/Form/styles/form.less +1 -0
  35. package/lib/Select/Result.js +1 -1
  36. package/lib/Select/Select.js +11 -4
  37. package/lib/Table/SimpleTable.js +5 -1
  38. package/lib/Tabs/Tab.js +1 -1
  39. package/lib/Tree/Content.js +23 -1
  40. package/lib/TreeSelect/Result.js +1 -1
  41. package/lib/TreeSelect/datum.js +2 -1
  42. package/lib/index.d.ts +1 -1
  43. package/lib/index.js +1 -1
  44. package/package.json +1 -1
@@ -31,7 +31,7 @@ var _styles = require("./styles");
31
31
 
32
32
  var _config = require("../config");
33
33
 
34
- var _classname = _interopRequireDefault(require("../utils/classname"));
34
+ var _classname = require("../utils/classname");
35
35
 
36
36
  var Button =
37
37
  /*#__PURE__*/
@@ -104,7 +104,7 @@ function (_PureComponent) {
104
104
  type: htmlType,
105
105
  className: className
106
106
  }), loading && _react.default.createElement("span", {
107
- className: (0, _styles.buttonClass)((0, _classname.default)('spin'))
107
+ className: (0, _styles.buttonClass)((0, _classname.getDirectionClass)('spin'))
108
108
  }, _react.default.createElement(_Spin.default, {
109
109
  size: 12,
110
110
  name: "ring",
package/css/Datum/Tree.js CHANGED
@@ -69,6 +69,12 @@ function () {
69
69
 
70
70
  var _proto = _default.prototype;
71
71
 
72
+ _proto.updateDisabled = function updateDisabled(dis) {
73
+ this.disabled = dis || function () {
74
+ return false;
75
+ };
76
+ };
77
+
72
78
  _proto.bind = function bind(id, update) {
73
79
  this.events[id] = update;
74
80
  };
@@ -58,6 +58,7 @@
58
58
  -ms-flex: 1;
59
59
  flex: 1;
60
60
  padding: 0 6px;
61
+ min-width: 0;
61
62
  }
62
63
  .so-form-item .so-form-control:first-child {
63
64
  padding-left: 0;
@@ -211,7 +211,7 @@ function (_PureComponent) {
211
211
  var res = result.reduce(function (acc, cur) {
212
212
  var r = getResultContent(cur, renderResult, renderUnmatched);
213
213
 
214
- if (r !== undefined && r !== '') {
214
+ if (!(0, _is.isEmpty)(r)) {
215
215
  acc.push(cur);
216
216
  }
217
217
 
@@ -123,6 +123,14 @@ function (_PureComponent) {
123
123
  return this.props.text[key] || (0, _locale.getLocale)(key);
124
124
  };
125
125
 
126
+ _proto.getDisabledStatus = function getDisabledStatus() {
127
+ if (typeof this.props.disabled == 'function') {
128
+ return this.props.disabled;
129
+ } else {
130
+ return !!this.props.disabled;
131
+ }
132
+ };
133
+
126
134
  _proto.getFocusSelected = function getFocusSelected() {
127
135
  var _this$props = this.props,
128
136
  reFocus = _this$props.reFocus,
@@ -204,7 +212,7 @@ function (_PureComponent) {
204
212
  };
205
213
 
206
214
  _proto.handleState = function handleState(focus, e) {
207
- if (this.props.disabled === true) return;
215
+ if (this.getDisabledStatus() === true) return;
208
216
  if (focus === this.state.focus) return; // click close icon
209
217
 
210
218
  if (focus && e && e.target.classList.contains((0, _styles.selectClass)('close'))) return;
@@ -239,13 +247,12 @@ function (_PureComponent) {
239
247
  var _this$props4 = this.props,
240
248
  datum = _this$props4.datum,
241
249
  multiple = _this$props4.multiple,
242
- disabled = _this$props4.disabled,
243
250
  emptyAfterSelect = _this$props4.emptyAfterSelect,
244
251
  onFilter = _this$props4.onFilter,
245
252
  filterText = _this$props4.filterText,
246
253
  onCreate = _this$props4.onCreate,
247
254
  reFocus = _this$props4.reFocus;
248
- if (disabled === true) return; // if click option, ignore blur event
255
+ if (this.getDisabledStatus() === true) return; // if click option, ignore blur event
249
256
 
250
257
  if (this.inputBlurTimer) {
251
258
  this.lastChangeIsOptionClick = true;
@@ -591,7 +598,6 @@ function (_PureComponent) {
591
598
  placeholder = _this$props12.placeholder,
592
599
  multiple = _this$props12.multiple,
593
600
  clearable = _this$props12.clearable,
594
- disabled = _this$props12.disabled,
595
601
  size = _this$props12.size,
596
602
  onFilter = _this$props12.onFilter,
597
603
  datum = _this$props12.datum,
@@ -608,6 +614,7 @@ function (_PureComponent) {
608
614
  innerTitle = _this$props12.innerTitle,
609
615
  keygen = _this$props12.keygen,
610
616
  data = _this$props12.data;
617
+ var disabled = this.getDisabledStatus();
611
618
  var className = (0, _styles.selectClass)('inner', size, this.state.focus && 'focus', this.state.position, multiple && 'multiple', disabled === true && (0, _classname.getDirectionClass)('disabled'), !trim && 'pre');
612
619
  return _react.default.createElement("div", {
613
620
  // eslint-disable-next-line
@@ -70,7 +70,11 @@ function (_PureComponent) {
70
70
 
71
71
  _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
72
72
  this.scrollCheck();
73
- var resize = prevProps.data.length === 0 && this.props.data.length;
73
+ var resize = prevProps.data.length === 0 && this.props.data.length; // when resize
74
+
75
+ if (resize && this.body) this.handleScroll({
76
+ currentTarget: this.body
77
+ });
74
78
  var shouldResetColgroup = this.props.dataChangeResize && this.props.data !== prevProps.data;
75
79
 
76
80
  if (resize || shouldResetColgroup || !(0, _shallowEqual.compareColumns)(prevProps.columns, this.props.columns)) {
package/css/Tabs/Tab.js CHANGED
@@ -27,7 +27,7 @@ var _uid = require("../utils/uid");
27
27
 
28
28
  var _getDataset = _interopRequireDefault(require("../utils/dom/getDataset"));
29
29
 
30
- var _classname = require("shineout/utils/classname");
30
+ var _classname = require("../utils/classname");
31
31
 
32
32
  var Tab =
33
33
  /*#__PURE__*/
@@ -27,6 +27,8 @@ var _Spin = _interopRequireDefault(require("../Spin"));
27
27
 
28
28
  var _Checkbox = _interopRequireDefault(require("./Checkbox"));
29
29
 
30
+ var _types = require("../Datum/types");
31
+
30
32
  var loading = _react.default.createElement("span", {
31
33
  className: (0, _styles.treeClass)('icon-loading')
32
34
  }, _react.default.createElement(_Spin.default, {
@@ -46,11 +48,26 @@ function (_PureComponent) {
46
48
  _this.handleNodeClick = _this.handleNodeClick.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
47
49
  _this.handleNodeExpand = _this.handleNodeExpand.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
48
50
  _this.handleIndicatorClick = _this.handleIndicatorClick.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
51
+ _this.handleUpdate = _this.handleUpdate.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
49
52
  return _this;
50
53
  }
51
54
 
52
55
  var _proto = Content.prototype;
53
56
 
57
+ _proto.componentDidMount = function componentDidMount() {
58
+ _PureComponent.prototype.componentDidMount.call(this);
59
+
60
+ var datum = this.props.datum;
61
+ datum.subscribe(_types.CHANGE_TOPIC, this.handleUpdate);
62
+ };
63
+
64
+ _proto.componentWillUnmount = function componentWillUnmount() {
65
+ _PureComponent.prototype.componentWillUnmount.call(this);
66
+
67
+ var datum = this.props.datum;
68
+ datum.unsubscribe(_types.CHANGE_TOPIC, this.handleUpdate);
69
+ };
70
+
54
71
  _proto.handleNodeClick = function handleNodeClick() {
55
72
  var _this$props = this.props,
56
73
  data = _this$props.data,
@@ -67,6 +84,10 @@ function (_PureComponent) {
67
84
  }
68
85
  };
69
86
 
87
+ _proto.handleUpdate = function handleUpdate() {
88
+ this.forceUpdate();
89
+ };
90
+
70
91
  _proto.handleNodeExpand = function handleNodeExpand() {
71
92
  var _this$props2 = this.props,
72
93
  data = _this$props2.data,
@@ -176,7 +197,8 @@ Content.propTypes = {
176
197
  setFetching: _propTypes.default.func,
177
198
  fetching: _propTypes.default.bool,
178
199
  doubleClickExpand: _propTypes.default.bool,
179
- iconClass: _propTypes.default.string
200
+ iconClass: _propTypes.default.string,
201
+ datum: _propTypes.default.object
180
202
  };
181
203
  var _default = Content;
182
204
  exports.default = _default;
@@ -252,7 +252,7 @@ function (_PureComponent) {
252
252
  key: "more",
253
253
  className: (0, _styles.treeSelectClass)((0, _classname.getDirectionClass)('item'), 'item-compressed'),
254
254
  popoverClassName: (0, _styles.treeSelectClass)('popover'),
255
- contentClassName: (0, _classname.getDirectionClass)('result'),
255
+ contentClassName: (0, _styles.treeSelectClass)((0, _classname.getDirectionClass)('result')),
256
256
  compressed: compressed,
257
257
  data: items,
258
258
  cls: _styles.treeSelectClass,
@@ -55,7 +55,8 @@ function datum(Origin) {
55
55
 
56
56
  _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
57
57
  if (!(0, _shallowEqual.default)(prevProps.data, this.props.data)) {
58
- this.datum.setData(this.props.data);
58
+ this.datum.updateDisabled(this.props.disabled);
59
+ this.datum.setData(this.props.data, true);
59
60
  this.forceUpdate();
60
61
  }
61
62
  };
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.8-beta.2' }
4
+ export default { utils, version: '1.10.9' }
5
5
  export { utils }
6
6
  export { setLocale } from './locale'
7
7
  export { color, style } from './utils/expose'
package/css/index.js CHANGED
@@ -224,6 +224,6 @@ exports.Upload = _Upload.default;
224
224
  // Created by scripts/src-index.js.
225
225
  var _default = {
226
226
  utils: utils,
227
- version: '1.10.8-beta.2'
227
+ version: '1.10.9'
228
228
  };
229
229
  exports.default = _default;