shineout 1.9.1 → 1.9.2

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.
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react'
2
+ import { RuleParamsType } from '../Rule'
2
3
 
3
4
  export interface StandardProps {
4
5
  /**
@@ -79,6 +80,24 @@ export interface FormItemStandardProps<Value = any> {
79
80
  * default: false
80
81
  */
81
82
  filterSameChange?: boolean;
83
+
84
+ /**
85
+ * Validation rules
86
+ *
87
+ * 校验规则
88
+ *
89
+ * default: -
90
+ */
91
+ rules?: RuleParamsType<Value>;
92
+
93
+ /**
94
+ * Binding validation field name. When the value changes, the bound field validation is triggered.
95
+ *
96
+ * 绑定校验字段名。当值变化后,触发绑定的字段校验。
97
+ *
98
+ * default: -
99
+ */
100
+ bind?: string[];
82
101
  }
83
102
  export interface ListItemStandardProps<Item = any, Value = any> {
84
103
  /**
@@ -3,7 +3,7 @@ import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized
3
3
  import React, { Component } from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import { cascaderClass } from './styles';
6
- import { focusElement, getCursorOffset } from '../utils/dom/element';
6
+ import { focusElement, getCursorOffset, preventPasteFile } from '../utils/dom/element';
7
7
 
8
8
  var handleFocus = function handleFocus(e) {
9
9
  e.stopPropagation();
@@ -83,24 +83,15 @@ function (_Component) {
83
83
  this.lastCursorOffset = getCursorOffset(text.length);
84
84
  var t = this.getProcessedValue(text);
85
85
  this.props.onFilter(t);
86
- };
86
+ } // eslint-disable-next-line class-methods-use-this
87
+ ;
87
88
 
88
89
  _proto.handlePaste = function handlePaste(e) {
89
- var text = (e.clipboardData || window.clipboardData).getData('text/plain');
90
- if (!text) return;
91
- e.preventDefault();
92
- document.execCommand('insertText', false, text);
93
- this.handleInput({
94
- target: {
95
- innerText: text
96
- }
97
- });
90
+ preventPasteFile(e);
98
91
  };
99
92
 
100
93
  _proto.render = function render() {
101
- var _this$props = this.props,
102
- focus = _this$props.focus,
103
- filterText = _this$props.filterText;
94
+ var focus = this.props.focus;
104
95
  var props = {
105
96
  className: cascaderClass('input', !focus && 'ellipsis'),
106
97
  ref: this.bindElement,
@@ -1,5 +1,4 @@
1
1
  import * as React from 'react'
2
- import { RuleParamsType } from '../Rule'
3
2
  import { StandardProps, FormItemStandardProps, ListItemStandardProps } from '../@types/common'
4
3
 
5
4
  type ReactNode = React.ReactNode;
@@ -33,16 +32,6 @@ export interface CheckboxProps<T> extends StandardProps, FormItemStandardProps<T
33
32
  */
34
33
  htmlValue?: any;
35
34
 
36
-
37
- /**
38
- * Validation rules
39
- *
40
- * 校验规则
41
- *
42
- * default: -
43
- */
44
- rules?: RuleParamsType<T, CheckboxProps<T>>
45
-
46
35
  }
47
36
 
48
37
  // attention: checkbox group value is array
@@ -1,6 +1,5 @@
1
1
  import * as React from 'react'
2
2
  import { PopoverProps } from '../Popover'
3
- import { RuleParamsType } from '../Rule'
4
3
  import { StandardProps, RegularAttributes, FormItemStandardProps, CommonProps } from '../@types/common'
5
4
 
6
5
  type ReactNode = React.ReactNode;
@@ -144,15 +143,6 @@ FormItemStandardProps<Value> {
144
143
  */
145
144
  maxLength?: number;
146
145
 
147
- /**
148
- * Validation rules
149
- *
150
- * 校验规则
151
- *
152
- * default: -
153
- */
154
- rules?: RuleParamsType<Value, InputProps<Value>>;
155
-
156
146
  /**
157
147
  * get input element
158
148
  *
@@ -51,6 +51,10 @@
51
51
  flex-grow: 1;
52
52
  width: 0;
53
53
  }
54
+ .@{input-title-prefix}-title {
55
+ padding-top: 0;
56
+ padding-bottom: 0;
57
+ }
54
58
  }
55
59
  &:not(&-open) &-hideable {opacity: 0;}
56
60
  &:hover + .@{input-prefix}-clear-wrapper {display: block;}
@@ -1,8 +1,6 @@
1
1
  import * as React from 'react'
2
- import { RuleParamsType } from '../Rule'
3
2
  import { StandardProps, StructDataStandardProps, ListItemStandardProps, FormItemStandardProps } from '../@types/common'
4
3
 
5
- type ReactNode = React.ReactNode;
6
4
 
7
5
  export interface RadioProps<Item = any> extends StandardProps {
8
6
 
package/es/Rate/Rate.js CHANGED
@@ -6,7 +6,6 @@ import PropTypes from 'prop-types';
6
6
  import classnames from 'classnames';
7
7
  import { PureComponent } from '../component';
8
8
  import { range } from '../utils/numbers';
9
- import { getParent } from '../utils/dom/element';
10
9
  import { getProps, defaultProps } from '../utils/proptypes';
11
10
  import { rateClass } from './styles';
12
11
  import getDataset from '../utils/dom/getDataset';
@@ -91,7 +90,7 @@ function (_PureComponent) {
91
90
  clearable = _this$props2.clearable,
92
91
  allowHalf = _this$props2.allowHalf;
93
92
 
94
- if (allowHalf && getParent(e.target, "." + rateClass('allow-half'))) {
93
+ if (allowHalf && e.target.parentElement.querySelector("." + rateClass('allow-half'))) {
95
94
  value -= 0.5;
96
95
  }
97
96
 
@@ -335,8 +335,8 @@
335
335
  }
336
336
 
337
337
  &.@{select-prefix}-selected {
338
- background-color: @primary-color-fade-60;
339
- color: white;
338
+ background-color: @primary-color-fade-10;
339
+ color: @colors-primary;
340
340
  }
341
341
  &.@{select-prefix}-disabled {
342
342
  padding-right: @select-result-space;
@@ -1,5 +1,4 @@
1
1
  import * as React from 'react'
2
- import { RuleParamsType } from '../Rule'
3
2
  import { CommonProps, StandardProps } from '../@types/common'
4
3
 
5
4
  type ReactNode = React.ReactNode;
@@ -280,15 +279,6 @@ export interface TreeSelectProps<Value, Data> extends StandardProps,
280
279
  */
281
280
  onCollapse?: (collapse: boolean) => void;
282
281
 
283
- /**
284
- * Validation rules
285
- *
286
- * 校验规则
287
- *
288
- * default: -
289
- */
290
- rules?: RuleParamsType<Value, TreeSelectProps<Value, Data>>;
291
-
292
282
  /**
293
283
  * render unmatch value
294
284
  *
package/es/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.9.1' }
4
+ export default { utils, version: '1.9.2' }
5
5
  export { utils }
6
6
  export { setLocale } from './locale'
7
7
  export { color, style } from './utils/expose'
package/es/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import * as utils from './utils';
3
3
  export default {
4
4
  utils: utils,
5
- version: '1.9.1'
5
+ version: '1.9.2'
6
6
  };
7
7
  export { utils };
8
8
  export { setLocale } from './locale';
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react'
2
+ import { RuleParamsType } from '../Rule'
2
3
 
3
4
  export interface StandardProps {
4
5
  /**
@@ -79,6 +80,24 @@ export interface FormItemStandardProps<Value = any> {
79
80
  * default: false
80
81
  */
81
82
  filterSameChange?: boolean;
83
+
84
+ /**
85
+ * Validation rules
86
+ *
87
+ * 校验规则
88
+ *
89
+ * default: -
90
+ */
91
+ rules?: RuleParamsType<Value>;
92
+
93
+ /**
94
+ * Binding validation field name. When the value changes, the bound field validation is triggered.
95
+ *
96
+ * 绑定校验字段名。当值变化后,触发绑定的字段校验。
97
+ *
98
+ * default: -
99
+ */
100
+ bind?: string[];
82
101
  }
83
102
  export interface ListItemStandardProps<Item = any, Value = any> {
84
103
  /**
@@ -97,24 +97,15 @@ function (_Component) {
97
97
  this.lastCursorOffset = (0, _element.getCursorOffset)(text.length);
98
98
  var t = this.getProcessedValue(text);
99
99
  this.props.onFilter(t);
100
- };
100
+ } // eslint-disable-next-line class-methods-use-this
101
+ ;
101
102
 
102
103
  _proto.handlePaste = function handlePaste(e) {
103
- var text = (e.clipboardData || window.clipboardData).getData('text/plain');
104
- if (!text) return;
105
- e.preventDefault();
106
- document.execCommand('insertText', false, text);
107
- this.handleInput({
108
- target: {
109
- innerText: text
110
- }
111
- });
104
+ (0, _element.preventPasteFile)(e);
112
105
  };
113
106
 
114
107
  _proto.render = function render() {
115
- var _this$props = this.props,
116
- focus = _this$props.focus,
117
- filterText = _this$props.filterText;
108
+ var focus = this.props.focus;
118
109
  var props = {
119
110
  className: (0, _styles.cascaderClass)('input', !focus && 'ellipsis'),
120
111
  ref: this.bindElement,
@@ -1,5 +1,4 @@
1
1
  import * as React from 'react'
2
- import { RuleParamsType } from '../Rule'
3
2
  import { StandardProps, FormItemStandardProps, ListItemStandardProps } from '../@types/common'
4
3
 
5
4
  type ReactNode = React.ReactNode;
@@ -33,16 +32,6 @@ export interface CheckboxProps<T> extends StandardProps, FormItemStandardProps<T
33
32
  */
34
33
  htmlValue?: any;
35
34
 
36
-
37
- /**
38
- * Validation rules
39
- *
40
- * 校验规则
41
- *
42
- * default: -
43
- */
44
- rules?: RuleParamsType<T, CheckboxProps<T>>
45
-
46
35
  }
47
36
 
48
37
  // attention: checkbox group value is array
@@ -1,6 +1,5 @@
1
1
  import * as React from 'react'
2
2
  import { PopoverProps } from '../Popover'
3
- import { RuleParamsType } from '../Rule'
4
3
  import { StandardProps, RegularAttributes, FormItemStandardProps, CommonProps } from '../@types/common'
5
4
 
6
5
  type ReactNode = React.ReactNode;
@@ -144,15 +143,6 @@ FormItemStandardProps<Value> {
144
143
  */
145
144
  maxLength?: number;
146
145
 
147
- /**
148
- * Validation rules
149
- *
150
- * 校验规则
151
- *
152
- * default: -
153
- */
154
- rules?: RuleParamsType<Value, InputProps<Value>>;
155
-
156
146
  /**
157
147
  * get input element
158
148
  *
@@ -51,6 +51,10 @@
51
51
  flex-grow: 1;
52
52
  width: 0;
53
53
  }
54
+ .@{input-title-prefix}-title {
55
+ padding-top: 0;
56
+ padding-bottom: 0;
57
+ }
54
58
  }
55
59
  &:not(&-open) &-hideable {opacity: 0;}
56
60
  &:hover + .@{input-prefix}-clear-wrapper {display: block;}
@@ -1,8 +1,6 @@
1
1
  import * as React from 'react'
2
- import { RuleParamsType } from '../Rule'
3
2
  import { StandardProps, StructDataStandardProps, ListItemStandardProps, FormItemStandardProps } from '../@types/common'
4
3
 
5
- type ReactNode = React.ReactNode;
6
4
 
7
5
  export interface RadioProps<Item = any> extends StandardProps {
8
6
 
package/lib/Rate/Rate.js CHANGED
@@ -21,8 +21,6 @@ var _component = require("../component");
21
21
 
22
22
  var _numbers = require("../utils/numbers");
23
23
 
24
- var _element = require("../utils/dom/element");
25
-
26
24
  var _proptypes = require("../utils/proptypes");
27
25
 
28
26
  var _styles = require("./styles");
@@ -110,7 +108,7 @@ function (_PureComponent) {
110
108
  clearable = _this$props2.clearable,
111
109
  allowHalf = _this$props2.allowHalf;
112
110
 
113
- if (allowHalf && (0, _element.getParent)(e.target, "." + (0, _styles.rateClass)('allow-half'))) {
111
+ if (allowHalf && e.target.parentElement.querySelector("." + (0, _styles.rateClass)('allow-half'))) {
114
112
  value -= 0.5;
115
113
  }
116
114
 
@@ -335,8 +335,8 @@
335
335
  }
336
336
 
337
337
  &.@{select-prefix}-selected {
338
- background-color: @primary-color-fade-60;
339
- color: white;
338
+ background-color: @primary-color-fade-10;
339
+ color: @colors-primary;
340
340
  }
341
341
  &.@{select-prefix}-disabled {
342
342
  padding-right: @select-result-space;
@@ -1,5 +1,4 @@
1
1
  import * as React from 'react'
2
- import { RuleParamsType } from '../Rule'
3
2
  import { CommonProps, StandardProps } from '../@types/common'
4
3
 
5
4
  type ReactNode = React.ReactNode;
@@ -280,15 +279,6 @@ export interface TreeSelectProps<Value, Data> extends StandardProps,
280
279
  */
281
280
  onCollapse?: (collapse: boolean) => void;
282
281
 
283
- /**
284
- * Validation rules
285
- *
286
- * 校验规则
287
- *
288
- * default: -
289
- */
290
- rules?: RuleParamsType<Value, TreeSelectProps<Value, Data>>;
291
-
292
282
  /**
293
283
  * render unmatch value
294
284
  *
package/lib/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.9.1' }
4
+ export default { utils, version: '1.9.2' }
5
5
  export { utils }
6
6
  export { setLocale } from './locale'
7
7
  export { color, style } from './utils/expose'
package/lib/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.9.1'
227
+ version: '1.9.2'
228
228
  };
229
229
  exports.default = _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shineout",
3
- "version": "1.9.1",
3
+ "version": "1.9.2",
4
4
  "description": "Shein 前端组件库",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./es/index.js",