shineout 1.10.4 → 1.10.7

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 (67) hide show
  1. package/css/Card/index.d.ts +69 -23
  2. package/css/CardGroup/index.d.ts +47 -29
  3. package/css/Carousel/index.d.ts +23 -14
  4. package/css/Gap/index.d.ts +14 -4
  5. package/css/Grid/index.d.ts +10 -0
  6. package/css/Image/index.d.ts +52 -43
  7. package/css/Input/index.d.ts +12 -1
  8. package/css/Modal/Panel.js +1 -0
  9. package/css/Modal/index.d.ts +16 -7
  10. package/css/Radio/index.d.ts +12 -1
  11. package/css/Select/Select.js +6 -1
  12. package/css/Spin/index.d.ts +11 -2
  13. package/css/Sticky/index.d.ts +10 -0
  14. package/css/Switch/index.d.ts +2 -1
  15. package/css/Table/Thead.js +6 -1
  16. package/css/Table/index.d.ts +15 -5
  17. package/css/Tabs/index.d.ts +19 -1
  18. package/css/TreeSelect/TreeSelect.js +1 -1
  19. package/css/hoc/inputBorder.js +1 -1
  20. package/css/index.d.ts +1 -1
  21. package/css/index.js +1 -1
  22. package/dist/shineout.js +44 -33
  23. package/dist/shineout.js.map +1 -1
  24. package/dist/shineout.min.js +1 -1
  25. package/es/Card/index.d.ts +69 -23
  26. package/es/CardGroup/index.d.ts +47 -29
  27. package/es/Carousel/index.d.ts +23 -14
  28. package/es/Gap/index.d.ts +14 -4
  29. package/es/Grid/index.d.ts +10 -0
  30. package/es/Image/index.d.ts +52 -43
  31. package/es/Input/index.d.ts +12 -1
  32. package/es/Modal/Panel.js +1 -0
  33. package/es/Modal/index.d.ts +16 -7
  34. package/es/Radio/index.d.ts +12 -1
  35. package/es/Select/Select.js +6 -1
  36. package/es/Spin/index.d.ts +11 -2
  37. package/es/Sticky/index.d.ts +10 -0
  38. package/es/Switch/index.d.ts +2 -1
  39. package/es/Table/Thead.js +6 -1
  40. package/es/Table/index.d.ts +15 -5
  41. package/es/Tabs/index.d.ts +19 -1
  42. package/es/TreeSelect/TreeSelect.js +1 -1
  43. package/es/hoc/inputBorder.js +1 -1
  44. package/es/index.d.ts +1 -1
  45. package/es/index.js +1 -1
  46. package/lib/Card/index.d.ts +69 -23
  47. package/lib/CardGroup/index.d.ts +47 -29
  48. package/lib/Carousel/index.d.ts +23 -14
  49. package/lib/Gap/index.d.ts +14 -4
  50. package/lib/Grid/index.d.ts +10 -0
  51. package/lib/Image/index.d.ts +52 -43
  52. package/lib/Input/index.d.ts +12 -1
  53. package/lib/Modal/Panel.js +1 -0
  54. package/lib/Modal/index.d.ts +16 -7
  55. package/lib/Radio/index.d.ts +12 -1
  56. package/lib/Select/Select.js +6 -1
  57. package/lib/Spin/index.d.ts +11 -2
  58. package/lib/Sticky/index.d.ts +10 -0
  59. package/lib/Switch/index.d.ts +2 -1
  60. package/lib/Table/Thead.js +6 -1
  61. package/lib/Table/index.d.ts +15 -5
  62. package/lib/Tabs/index.d.ts +19 -1
  63. package/lib/TreeSelect/TreeSelect.js +1 -1
  64. package/lib/hoc/inputBorder.js +1 -1
  65. package/lib/index.d.ts +1 -1
  66. package/lib/index.js +1 -1
  67. package/package.json +1 -1
@@ -7,126 +7,126 @@ export interface ImageProps extends StandardProps{
7
7
 
8
8
  /**
9
9
  * the height of the image(When the value is percentage, the ratio is the width of the image)
10
- *
10
+ *
11
11
  * 图片高度(值为百分比时,对比值为图片宽度)
12
- *
12
+ *
13
13
  * default: '100%'
14
14
  */
15
15
  height?: string | number;
16
16
 
17
17
  /**
18
18
  * original picture address
19
- *
19
+ *
20
20
  * 原始图片地址
21
- *
21
+ *
22
22
  * default: none
23
23
  */
24
24
  href?: string;
25
25
 
26
26
  /**
27
27
  * whether to delay loading, number to set lazy offset
28
- *
28
+ *
29
29
  * 是否延迟加载,如果为数字则表示懒加载偏移量
30
- *
30
+ *
31
31
  * default: false
32
32
  */
33
33
  lazy?: boolean | number;
34
34
 
35
35
  /**
36
36
  * the picture address
37
- *
37
+ *
38
38
  * 图片地址
39
- *
39
+ *
40
40
  * default: required
41
41
  */
42
42
  src?: string;
43
43
 
44
44
  /**
45
- * Alternate address, applied when src is invalid
46
- *
47
- * 备用地址,src无效时会应用
48
- *
45
+ * Alternate address, applied when src is invalid
46
+ *
47
+ * 备用地址,src无效时会应用
48
+ *
49
49
  * default: none
50
50
  */
51
51
  alt?: string;
52
52
 
53
53
  /**
54
- * callback of image src or alt request fail
55
- *
56
- * src或alt 地址请求出错回调
57
- *
54
+ * callback of image src or alt request fail
55
+ *
56
+ * src或alt 地址请求出错回调
57
+ *
58
58
  * default: -
59
59
  */
60
60
  onError?: (error: Event) => void;
61
61
 
62
62
  /**
63
63
  * target of image
64
- *
64
+ *
65
65
  * 图片打开方式
66
- *
66
+ *
67
67
  * default: '_modal'
68
68
  */
69
69
  target?: '_modal' | '_blank' | '_self' | '_download';
70
70
 
71
71
  /**
72
72
  * the width of the image
73
- *
73
+ *
74
74
  * 图片宽度
75
- *
75
+ *
76
76
  * default: '100%'
77
77
  */
78
78
  width?: string | number;
79
79
 
80
80
  /**
81
81
  * loading image placeholder content
82
- *
82
+ *
83
83
  * 图片加载中占位内容
84
- *
84
+ *
85
85
  * default: 'loading'
86
86
  */
87
87
  placeholder?: ReactNode;
88
88
 
89
89
  /**
90
90
  * the special element selector witch container the lazy image, such as: '#id', '.class'
91
- *
91
+ *
92
92
  * 对特定元素进行懒加载判断的选择器, 如: '#id', '.class'
93
- *
93
+ *
94
94
  * default: -
95
95
  */
96
96
  container?: string;
97
97
 
98
98
  /**
99
99
  * image error placeholder
100
- *
100
+ *
101
101
  * 图片载入错误的文案
102
- *
102
+ *
103
103
  * default: none
104
104
  */
105
105
  error?: ReactNode;
106
106
 
107
107
  /**
108
108
  * auto transform protocol
109
- *
109
+ *
110
110
  * 是否根据页面自动转换协议
111
- *
111
+ *
112
112
  * default: false
113
113
  */
114
114
  autoSSL?: boolean;
115
115
 
116
116
  /**
117
117
  * fit the container
118
- *
118
+ *
119
119
  * 适应容器的方式
120
- *
120
+ *
121
121
  * default: -
122
122
  */
123
123
  fit?: 'fill' | 'fit' | 'stretch' | 'center';
124
124
 
125
125
  /**
126
126
  * shape of image
127
- *
127
+ *
128
128
  * 图片样式
129
- *
129
+ *
130
130
  * default: 'rounded'
131
131
  */
132
132
  shape?: 'rounded' | 'circle' | 'thumbnail';
@@ -136,49 +136,58 @@ export interface ImageGroupProps {
136
136
 
137
137
  /**
138
138
  * the height of single image(When the value is percentage, the ratio is the width of the image)
139
- *
139
+ *
140
140
  * 单个图片高度(值为百分比时,对比值为图片宽度)
141
- *
141
+ *
142
142
  * default: '100%'
143
143
  */
144
144
  height?: string | number;
145
145
 
146
146
  /**
147
147
  * whether to delay loading
148
- *
148
+ *
149
149
  * 是否延迟加载
150
- *
150
+ *
151
151
  * default: false
152
152
  */
153
153
  lazy?: boolean;
154
154
 
155
155
  /**
156
156
  * whether to stack
157
- *
157
+ *
158
158
  * 是否堆叠
159
- *
159
+ *
160
160
  * default: false
161
161
  */
162
162
  pile?: boolean;
163
163
 
164
164
  /**
165
165
  * target of image
166
- *
166
+ *
167
167
  * 图片打开方式
168
- *
168
+ *
169
169
  * default: '_modal'
170
170
  */
171
171
  target?: '_modal' | '_blank' | '_self' | '_download';
172
172
 
173
173
  /**
174
174
  * the width of single picture
175
- *
175
+ *
176
176
  * 单个图片宽度
177
- *
177
+ *
178
178
  * default: '100%'
179
179
  */
180
180
  width?: string | number;
181
181
 
182
+ /**
183
+ * children
184
+ *
185
+ * 子元素
186
+ *
187
+ * default: -
188
+ */
189
+ children?: ReactNode;
190
+
182
191
  }
183
192
  declare class ImageGroup extends React.Component<ImageGroupProps, {}> {
184
193
  render(): JSX.Element;
@@ -191,4 +200,4 @@ declare class Image extends React.Component<ImageProps, {}> {
191
200
  render(): JSX.Element;
192
201
  }
193
202
 
194
- export default Image
203
+ export default Image
@@ -312,7 +312,18 @@ export interface InputPasswordProps<Value = any> extends InputProps<Value> {
312
312
  point?: 'string';
313
313
  }
314
314
 
315
- declare class InputGroup<Value = any> extends React.Component<InputProps<Value>, {}> {}
315
+ export interface InputGroupProps<Value = any> extends InputProps<Value> {
316
+ /**
317
+ * children
318
+ *
319
+ * 子元素
320
+ *
321
+ * default: -
322
+ */
323
+ children?: ReactNode;
324
+ }
325
+
326
+ declare class InputGroup<Value = any> extends React.Component<InputGroupProps<Value>, {}> {}
316
327
 
317
328
  declare class InputNumber<Value = number> extends React.Component<InputNumberProps<Value>, {}> {}
318
329
 
@@ -168,6 +168,7 @@ function (_PureComponent) {
168
168
  };
169
169
 
170
170
  _proto.handleClose = function handleClose(e) {
171
+ e.stopPropagation();
171
172
  var _this$props5 = this.props,
172
173
  maskCloseAble = _this$props5.maskCloseAble,
173
174
  onClose = _this$props5.onClose;
@@ -248,7 +248,7 @@ export interface ModalFunctionOptions extends ModalProps {
248
248
  *
249
249
  * default: null
250
250
  */
251
- content?: ReactNode | string,
251
+ content?: ReactNode | string;
252
252
 
253
253
  /**
254
254
  * title
@@ -257,7 +257,7 @@ export interface ModalFunctionOptions extends ModalProps {
257
257
  *
258
258
  * default: null
259
259
  */
260
- title?: string,
260
+ title?: string;
261
261
 
262
262
  /**
263
263
  * The event is triggered when the cancel button is clicked.
@@ -266,7 +266,7 @@ export interface ModalFunctionOptions extends ModalProps {
266
266
  *
267
267
  * default: null
268
268
  */
269
- onCancel?: () => void,
269
+ onCancel?: () => void;
270
270
 
271
271
  /**
272
272
  * The event is triggered when the modal is closed.
@@ -275,7 +275,7 @@ export interface ModalFunctionOptions extends ModalProps {
275
275
  *
276
276
  * default: null
277
277
  */
278
- onClose?: () => void,
278
+ onClose?: () => void;
279
279
 
280
280
  /**
281
281
  * The event is triggered when the ok button is clicked.
@@ -284,7 +284,7 @@ export interface ModalFunctionOptions extends ModalProps {
284
284
  *
285
285
  * default: null
286
286
  */
287
- onOk?: () => void | Promise<any>,
287
+ onOk?: () => void | Promise<any>;
288
288
 
289
289
  /**
290
290
  * The text of button
@@ -293,7 +293,7 @@ export interface ModalFunctionOptions extends ModalProps {
293
293
  *
294
294
  * default: { ok: 'Ok', cancel: 'Cancel' }
295
295
  */
296
- text?: { ok?: string, cancel?: string },
296
+ text?: { ok?: string, cancel?: string };
297
297
 
298
298
  /**
299
299
  * auto focus button, one of ['ok', 'cancel']
@@ -302,7 +302,16 @@ export interface ModalFunctionOptions extends ModalProps {
302
302
  *
303
303
  * default: null
304
304
  */
305
- autoFocusButton?: string
305
+ autoFocusButton?: string;
306
+
307
+ /**
308
+ * content
309
+ *
310
+ * 弹窗内容
311
+ *
312
+ * default: -
313
+ */
314
+ children?: ReactNode
306
315
  }
307
316
 
308
317
  type Close = () => void;
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react'
2
2
  import { StandardProps, StructDataStandardProps, ListItemStandardProps, FormItemStandardProps } from '../@types/common'
3
+ import { ReactNode } from "react"
3
4
 
4
5
 
5
6
  export interface RadioProps<Item = any> extends StandardProps {
@@ -41,7 +42,17 @@ export interface RadioGroupProps<Value, Item> extends StandardProps, ListItemSta
41
42
  *
42
43
  * default: false
43
44
  */
44
- block?: boolean
45
+ block?: boolean;
46
+
47
+ /**
48
+ * children
49
+ *
50
+ * 子元素
51
+ *
52
+ * default: -
53
+ */
54
+ children?: ReactNode;
55
+
45
56
  }
46
57
 
47
58
  declare class RadioGroup<Value, Data> extends React.Component<RadioGroupProps<Value, Data>, {}> {
@@ -140,7 +140,12 @@ function (_PureComponent) {
140
140
  // this.closeByResult = true
141
141
  // this.optionsHold = false
142
142
  // }
143
- if (el.getAttribute('data-id') === id) return true;
143
+ if (el.getAttribute('data-id') === id) return true; // in label
144
+
145
+ if (el.tagName === 'LABEL' && el.htmlFor && el.contains(this.element) && el.contains(document.getElementById(el.htmlFor))) {
146
+ return true;
147
+ }
148
+
144
149
  if (!el.parentElement) return false;
145
150
  return this.isDescendent(el.parentElement, id);
146
151
  };
@@ -65,11 +65,20 @@ export interface SpinProps extends StandardProps{
65
65
  *
66
66
  * 提示文案
67
67
  *
68
- * default:
68
+ * default: -
69
69
  *
70
70
  */
71
+ tip?: string | ReactNode;
71
72
 
72
- tip?: string | ReactNode
73
+ /**
74
+ * children
75
+ *
76
+ * 包裹的元素
77
+ *
78
+ * default: -
79
+ *
80
+ */
81
+ children?: ReactNode;
73
82
 
74
83
  }
75
84
 
@@ -2,6 +2,7 @@ import * as React from 'react'
2
2
 
3
3
  // type ReactNode = React.ReactNode
4
4
  import { StandardProps } from '../@types/common'
5
+ import { ReactNode } from "react"
5
6
 
6
7
  export interface StickyProps extends StandardProps {
7
8
  /**
@@ -47,6 +48,15 @@ export interface StickyProps extends StandardProps {
47
48
  * default: null
48
49
  */
49
50
  onChange?: (isSticky: boolean) => void;
51
+
52
+ /**
53
+ * children
54
+ *
55
+ * 子元素
56
+ *
57
+ * default: -
58
+ */
59
+ children?: ReactNode;
50
60
  }
51
61
 
52
62
  declare class Sticky extends React.Component<StickyProps, {}> {
@@ -1,7 +1,8 @@
1
1
  import React from 'react'
2
- import {FormItemStandardProps} from '../@types/common'
2
+ import {FormItemStandardProps, StandardProps} from '../@types/common'
3
3
 
4
4
  export interface SwitchProps extends
5
+ StandardProps,
5
6
  Pick<FormItemStandardProps<boolean>, 'defaultValue' | 'value' | 'onChange' | 'name' >{
6
7
 
7
8
  /**
@@ -126,7 +126,12 @@ function (_PureComponent) {
126
126
  var target = e.target;
127
127
  this.resizingTh = (0, _element.getParent)(target, 'th');
128
128
  this.resizingTable = (0, _element.getParent)(target, 'table');
129
- this.resizingIndex = [].indexOf.call((0, _element.getParent)(target, 'tr').children, this.resizingTh);
129
+ var thList = (0, _element.getParent)(target, 'tr').children;
130
+ var indexInTr = [].indexOf.call(thList, this.resizingTh);
131
+ this.resizingIndex = [].slice.call(thList, 0, indexInTr).reduce(function (total, th) {
132
+ var count = Number(th.getAttribute('colspan')) || 1;
133
+ return total + count;
134
+ }, 0);
130
135
  this.resizingCol = this.resizingTable.querySelectorAll('col')[this.resizingIndex];
131
136
  this.resizingTable.classList.add((0, _styles.tableClass)('resizing'));
132
137
  this.resizingTh.classList.add((0, _styles.tableClass)('resizing-item'));
@@ -525,7 +525,7 @@ export interface TableProps<Value, TRD> extends StandardProps, ListItemStandardP
525
525
  *
526
526
  * default: none
527
527
  */
528
- tableRef?: (table: TableRef) => void
528
+ tableRef?: (table: TableRef) => void;
529
529
  /**
530
530
  * whether to hide thead
531
531
  *
@@ -533,7 +533,7 @@ export interface TableProps<Value, TRD> extends StandardProps, ListItemStandardP
533
533
  *
534
534
  * default: false
535
535
  */
536
- hideHeader?: boolean
536
+ hideHeader?: boolean;
537
537
 
538
538
  /**
539
539
  * make all columns scalable
@@ -542,7 +542,7 @@ export interface TableProps<Value, TRD> extends StandardProps, ListItemStandardP
542
542
  *
543
543
  * default: false
544
544
  */
545
- columnResizable?: boolean
545
+ columnResizable?: boolean;
546
546
 
547
547
  /**
548
548
  * Enable in specific scenarios (tree data expansion is controlled) Used to change the default behavior of scroll reset
@@ -551,7 +551,7 @@ export interface TableProps<Value, TRD> extends StandardProps, ListItemStandardP
551
551
  *
552
552
  * default: false
553
553
  */
554
- changedByExpand?: boolean
554
+ changedByExpand?: boolean;
555
555
 
556
556
  /*
557
557
  * customize sort icons
@@ -560,7 +560,17 @@ export interface TableProps<Value, TRD> extends StandardProps, ListItemStandardP
560
560
  *
561
561
  * default: false
562
562
  */
563
- renderSorter?: (params: renderSorterParam) => ReactNode
563
+ renderSorter?: (params: renderSorterParam) => ReactNode;
564
+
565
+
566
+ /**
567
+ * table content
568
+ *
569
+ * 使用原生的 tr td 来渲染 table
570
+ *
571
+ * default: -
572
+ */
573
+ children?: ReactNode
564
574
 
565
575
  }
566
576
 
@@ -140,7 +140,16 @@ export interface TabsProps extends StandardProps {
140
140
  *
141
141
  * default: false
142
142
  */
143
- hideSplit?: boolean
143
+ hideSplit?: boolean;
144
+
145
+ /**
146
+ * content
147
+ *
148
+ * 内容
149
+ *
150
+ * default: -
151
+ */
152
+ children: ReactNode;
144
153
  }
145
154
 
146
155
  export interface TabsPanelProps extends StandardProps {
@@ -190,6 +199,15 @@ export interface TabsPanelProps extends StandardProps {
190
199
  */
191
200
  tab?: string | ReactNode;
192
201
 
202
+ /**
203
+ * content
204
+ *
205
+ * 内容
206
+ *
207
+ * default: -
208
+ */
209
+ children: ReactNode;
210
+
193
211
  }
194
212
 
195
213
  export interface TabsLinkProps extends AnchorHTMLAttributes<any>, StandardProps {
@@ -252,7 +252,7 @@ function (_PureComponent) {
252
252
  _proto.handleRemove = function handleRemove(data) {
253
253
  var datum = this.props.datum;
254
254
  datum.set(datum.getKey(data), 0);
255
- this.handleChange();
255
+ this.handleChange(data, datum.getKey(data));
256
256
  };
257
257
 
258
258
  _proto.handleChange = function handleChange(data, id) {
@@ -93,7 +93,7 @@ var _default = (0, _func.curry)(function (options, Origin) {
93
93
  popover = _this$props.popover,
94
94
  popoverProps = _this$props.popoverProps;
95
95
  var classList = ['input-tip'];
96
- var position = popover || (0, _config.isRTL)() ? 'bottom-right' : 'bottom-left';
96
+ var position = popover || ((0, _config.isRTL)() ? 'bottom-right' : 'bottom-left');
97
97
  var styles;
98
98
 
99
99
  if (popoverProps.style && popoverProps.style.width) {
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.4' }
4
+ export default { utils, version: '1.10.7' }
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.4'
227
+ version: '1.10.7'
228
228
  };
229
229
  exports.default = _default;