shineout 1.7.1 → 1.7.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.
Files changed (50) hide show
  1. package/css/DatePicker/utils.js +1 -1
  2. package/css/Form/FieldSet.js +0 -1
  3. package/css/Form/Form.js +3 -0
  4. package/css/Form/Item.js +1 -1
  5. package/css/Form/index.d.ts +1 -1
  6. package/css/Form/inputable.js +1 -1
  7. package/css/Menu/Root.js +5 -0
  8. package/css/Pagination/Jumper.js +3 -0
  9. package/css/Popover/Panel.js +4 -1
  10. package/css/Spin/styles/spin.css +1 -0
  11. package/css/Table/SeperateTable.js +1 -0
  12. package/css/TreeSelect/styles/treeSelect.css +1 -0
  13. package/css/index.d.ts +1 -1
  14. package/css/index.js +1 -1
  15. package/dist/shineout.js +55 -41
  16. package/dist/shineout.js.map +1 -1
  17. package/dist/shineout.min.js +1 -1
  18. package/dist/theme.antd.css +1 -1
  19. package/dist/theme.antd2.css +1 -1
  20. package/dist/theme.default.css +1 -1
  21. package/dist/theme.shineout.css +1 -1
  22. package/es/DatePicker/utils.js +2 -2
  23. package/es/Form/FieldSet.js +0 -1
  24. package/es/Form/Form.js +1 -0
  25. package/es/Form/Item.js +1 -1
  26. package/es/Form/index.d.ts +1 -1
  27. package/es/Form/inputable.js +1 -1
  28. package/es/Menu/Root.js +3 -0
  29. package/es/Pagination/Jumper.js +2 -0
  30. package/es/Popover/Panel.js +4 -1
  31. package/es/Spin/styles/spin.less +1 -0
  32. package/es/Table/SeperateTable.js +1 -0
  33. package/es/TreeSelect/styles/treeSelect.less +1 -0
  34. package/es/index.d.ts +1 -1
  35. package/es/index.js +1 -1
  36. package/lib/DatePicker/utils.js +1 -1
  37. package/lib/Form/FieldSet.js +0 -1
  38. package/lib/Form/Form.js +3 -0
  39. package/lib/Form/Item.js +1 -1
  40. package/lib/Form/index.d.ts +1 -1
  41. package/lib/Form/inputable.js +1 -1
  42. package/lib/Menu/Root.js +5 -0
  43. package/lib/Pagination/Jumper.js +3 -0
  44. package/lib/Popover/Panel.js +4 -1
  45. package/lib/Spin/styles/spin.less +1 -0
  46. package/lib/Table/SeperateTable.js +1 -0
  47. package/lib/TreeSelect/styles/treeSelect.less +1 -0
  48. package/lib/index.d.ts +1 -1
  49. package/lib/index.js +1 -1
  50. package/package.json +1 -1
@@ -128,9 +128,9 @@ function parse(date, fmt, options) {
128
128
  const year = date.slice(index, index + 5)
129
129
  const weekIndex = fmt2.indexOf('WW')
130
130
  const week = weekIndex >= 0 ? date.slice(weekIndex, weekIndex + 3) : 1
131
- const result = dayjs(year, 'YYYY')
131
+ const result = dayjs(`${year}-06-15`, 'YYYY-MM-dd')
132
132
  .locale(getDayJsLocate(options))
133
- .isoWeek(week)
133
+ .isoWeek(Number(week))
134
134
  .toDate()
135
135
  return result
136
136
  }
@@ -123,7 +123,6 @@ class FieldSet extends Component {
123
123
  result.push(empty(this.handleInsert.bind(this, 0)))
124
124
  } else {
125
125
  const errorList = (Array.isArray(errors) ? errors : [errors]).filter(Boolean)
126
- console.log(errorList)
127
126
  values.forEach((v, i) => {
128
127
  result.push(
129
128
  <Provider key={i} value={{ path: `${name}[${i}]`, val: this.validate }}>
package/es/Form/Form.js CHANGED
@@ -27,6 +27,7 @@ class Form extends Component {
27
27
  getValue: () => this.props.datum.getValue(),
28
28
  validate: () => this.props.datum.validate(),
29
29
  validateFields: fields => this.props.datum.validateFields(fields).catch(() => {}),
30
+ validateFieldsWithError: fields => this.props.datum.validateFields(fields),
30
31
  clearValidate: () => {
31
32
  this.props.datum.validateClear()
32
33
  },
package/es/Form/Item.js CHANGED
@@ -190,7 +190,7 @@ Item.propTypes = {
190
190
  Item.defaultProps = {
191
191
  ...defaultProps,
192
192
  formItemErrors: [],
193
- keepErrorHeight: true,
193
+ keepErrorHeight: false,
194
194
  }
195
195
 
196
196
  export default Item
@@ -368,7 +368,7 @@ export interface FormFieldSetProps<Value> {
368
368
  *
369
369
  * default:
370
370
  */
371
- defaultValue?: string | number;
371
+ defaultValue?: Value;
372
372
 
373
373
  /**
374
374
  * content with empty
@@ -93,7 +93,7 @@ export default curry(Origin =>
93
93
  const { onChange, readOnly, disabled } = this.props
94
94
  if ('value' in this.props && !onChange && disabled !== true && readOnly !== true) {
95
95
  console.error(
96
- 'You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`'
96
+ 'warning: You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly` or `disabled`'
97
97
  )
98
98
  }
99
99
  const { formDatum, loopContext, name, defaultValue, bindInputToItem, popover } = this.props
package/es/Menu/Root.js CHANGED
@@ -119,6 +119,9 @@ class Root extends React.Component {
119
119
  const { active } = this.props
120
120
  const act = typeof active === 'function' ? active(data) : id === this.state.activeKey
121
121
  if (act) this.state.activeKey = id
122
+ if (!act && this.state.activeKey === id) {
123
+ this.state.activeKey = ''
124
+ }
122
125
  return act
123
126
  }
124
127
 
@@ -5,6 +5,7 @@ import { paginationClass } from './styles'
5
5
  import Input from '../Input'
6
6
 
7
7
  const inputStyle = { width: 60, display: 'inline-block' }
8
+ const nofunc = () => {}
8
9
 
9
10
  class Jumper extends PureComponent {
10
11
  constructor(props) {
@@ -63,6 +64,7 @@ class Jumper extends PureComponent {
63
64
  <Input
64
65
  key={this.renderRequire}
65
66
  value={current}
67
+ onChange={nofunc}
66
68
  autoFocus={this.autoFocus}
67
69
  onKeyDown={this.handleKeyDown}
68
70
  digits={0}
@@ -85,7 +85,10 @@ class Panel extends Component {
85
85
 
86
86
  if (!this.container) return
87
87
  if (this.container === getCommonContainer()) {
88
- this.container.removeChild(this.element)
88
+ // this.container.removeChild(this.element)
89
+ if (this.element && this.element.parentElement) {
90
+ this.element.parentElement.removeChild(this.element)
91
+ }
89
92
  } else {
90
93
  this.container.parentElement.removeChild(this.container)
91
94
  }
@@ -16,6 +16,7 @@
16
16
  &-tip {
17
17
  margin: auto;
18
18
  text-align: center;
19
+ padding-top: 5px;
19
20
  }
20
21
  &-container {
21
22
  position: relative;
@@ -121,6 +121,7 @@ class SeperateTable extends PureComponent {
121
121
  const { offsetLeft, currentIndex } = this.state
122
122
  if (currentIndex === index && !oldHeight) {
123
123
  this.lastScrollTop += height - this.props.rowHeight
124
+ if (this.lastScrollTop < 0) this.lastScrollTop = 0
124
125
  setTranslate(this.tbody, `-${offsetLeft}px`, `-${this.lastScrollTop}px`)
125
126
  }
126
127
 
@@ -86,6 +86,7 @@
86
86
  margin-bottom: @padding-base-vertical;
87
87
  outline: none;
88
88
  white-space: pre-wrap;
89
+ cursor: text;
89
90
 
90
91
  &:after {
91
92
  content: '\feff ';
package/es/index.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  import './styles/normalize.less'
3
3
  import * as utils from './utils'
4
4
 
5
- export default { utils, version: '1.7.1' }
5
+ export default { utils, version: '1.7.5' }
6
6
  export { utils }
7
7
  export { setLocale } from './locale'
8
8
  export { color, style } from './utils/expose'
package/es/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import './styles/normalize.less'
3
3
  import * as utils from './utils'
4
4
 
5
- export default { utils, version: '1.7.1' }
5
+ export default { utils, version: '1.7.5' }
6
6
  export { utils }
7
7
  export { setLocale } from './locale'
8
8
  export { color, style } from './utils/expose'
@@ -135,7 +135,7 @@ function parse(date, fmt, options) {
135
135
  var year = date.slice(index, index + 5);
136
136
  var weekIndex = fmt2.indexOf('WW');
137
137
  var week = weekIndex >= 0 ? date.slice(weekIndex, weekIndex + 3) : 1;
138
- var result = (0, _dayjs.default)(year, 'YYYY').locale(getDayJsLocate(options)).isoWeek(week).toDate();
138
+ var result = (0, _dayjs.default)(year + "-06-15", 'YYYY-MM-dd').locale(getDayJsLocate(options)).isoWeek(Number(week)).toDate();
139
139
  return result;
140
140
  }
141
141
 
@@ -193,7 +193,6 @@ function (_Component) {
193
193
  result.push(empty(this.handleInsert.bind(this, 0)));
194
194
  } else {
195
195
  var errorList = (Array.isArray(errors) ? errors : [errors]).filter(Boolean);
196
- console.log(errorList);
197
196
  values.forEach(function (v, i) {
198
197
  result.push(_react.default.createElement(Provider, {
199
198
  key: i,
package/lib/Form/Form.js CHANGED
@@ -63,6 +63,9 @@ function (_Component) {
63
63
  validateFields: function validateFields(fields) {
64
64
  return _this.props.datum.validateFields(fields).catch(function () {});
65
65
  },
66
+ validateFieldsWithError: function validateFieldsWithError(fields) {
67
+ return _this.props.datum.validateFields(fields);
68
+ },
66
69
  clearValidate: function clearValidate() {
67
70
  _this.props.datum.validateClear();
68
71
  },
package/lib/Form/Item.js CHANGED
@@ -227,7 +227,7 @@ Item.propTypes = (0, _objectSpread2.default)({}, (0, _proptypes.getProps)(_propT
227
227
  });
228
228
  Item.defaultProps = (0, _objectSpread2.default)({}, _proptypes.defaultProps, {
229
229
  formItemErrors: [],
230
- keepErrorHeight: true
230
+ keepErrorHeight: false
231
231
  });
232
232
  var _default = Item; // eslint-disable-next-line
233
233
 
@@ -368,7 +368,7 @@ export interface FormFieldSetProps<Value> {
368
368
  *
369
369
  * default:
370
370
  */
371
- defaultValue?: string | number;
371
+ defaultValue?: Value;
372
372
 
373
373
  /**
374
374
  * content with empty
@@ -105,7 +105,7 @@ var _default = (0, _func.curry)(function (Origin) {
105
105
  disabled = _this$props.disabled;
106
106
 
107
107
  if ('value' in this.props && !onChange && disabled !== true && readOnly !== true) {
108
- console.error('You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`');
108
+ console.error('warning: You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly` or `disabled`');
109
109
  }
110
110
 
111
111
  var _this$props2 = this.props,
package/lib/Menu/Root.js CHANGED
@@ -158,6 +158,11 @@ function (_React$Component) {
158
158
  var active = this.props.active;
159
159
  var act = typeof active === 'function' ? active(data) : id === this.state.activeKey;
160
160
  if (act) this.state.activeKey = id;
161
+
162
+ if (!act && this.state.activeKey === id) {
163
+ this.state.activeKey = '';
164
+ }
165
+
161
166
  return act;
162
167
  };
163
168
 
@@ -26,6 +26,8 @@ var inputStyle = {
26
26
  display: 'inline-block'
27
27
  };
28
28
 
29
+ var nofunc = function nofunc() {};
30
+
29
31
  var Jumper =
30
32
  /*#__PURE__*/
31
33
  function (_PureComponent) {
@@ -91,6 +93,7 @@ function (_PureComponent) {
91
93
  }, txt[0], _react.default.createElement(_Input.default, {
92
94
  key: this.renderRequire,
93
95
  value: current,
96
+ onChange: nofunc,
94
97
  autoFocus: this.autoFocus,
95
98
  onKeyDown: this.handleKeyDown,
96
99
  digits: 0,
@@ -125,7 +125,10 @@ function (_Component) {
125
125
  if (!this.container) return;
126
126
 
127
127
  if (this.container === (0, _popContainer.default)()) {
128
- this.container.removeChild(this.element);
128
+ // this.container.removeChild(this.element)
129
+ if (this.element && this.element.parentElement) {
130
+ this.element.parentElement.removeChild(this.element);
131
+ }
129
132
  } else {
130
133
  this.container.parentElement.removeChild(this.container);
131
134
  }
@@ -16,6 +16,7 @@
16
16
  &-tip {
17
17
  margin: auto;
18
18
  text-align: center;
19
+ padding-top: 5px;
19
20
  }
20
21
  &-container {
21
22
  position: relative;
@@ -187,6 +187,7 @@ function (_PureComponent) {
187
187
 
188
188
  if (currentIndex === index && !oldHeight) {
189
189
  this.lastScrollTop += height - this.props.rowHeight;
190
+ if (this.lastScrollTop < 0) this.lastScrollTop = 0;
190
191
  (0, _translate.setTranslate)(this.tbody, "-" + offsetLeft + "px", "-" + this.lastScrollTop + "px");
191
192
  }
192
193
 
@@ -86,6 +86,7 @@
86
86
  margin-bottom: @padding-base-vertical;
87
87
  outline: none;
88
88
  white-space: pre-wrap;
89
+ cursor: text;
89
90
 
90
91
  &:after {
91
92
  content: '\feff ';
package/lib/index.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  import './styles/normalize.less'
3
3
  import * as utils from './utils'
4
4
 
5
- export default { utils, version: '1.7.1' }
5
+ export default { utils, version: '1.7.5' }
6
6
  export { utils }
7
7
  export { setLocale } from './locale'
8
8
  export { color, style } from './utils/expose'
package/lib/index.js CHANGED
@@ -222,6 +222,6 @@ exports.Upload = _Upload.default;
222
222
  // Created by scripts/src-index.js.
223
223
  var _default = {
224
224
  utils: utils,
225
- version: '1.7.1'
225
+ version: '1.7.5'
226
226
  };
227
227
  exports.default = _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shineout",
3
- "version": "1.7.1",
3
+ "version": "1.7.5",
4
4
  "description": "Shein 前端组件库",
5
5
  "main": "./lib/index.js",
6
6
  "typings": "./lib/index.d.ts",