shineout 1.10.3 → 1.11.0-rc.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.
- package/css/Input/Input.js +1 -1
- package/css/Select/Select.js +2 -2
- package/css/Select/filter.js +7 -3
- package/css/Select/index.d.ts +1 -1
- package/css/Table/Td.js +10 -2
- package/css/Table/index.d.ts +13 -2
- package/css/index.d.ts +1 -1
- package/css/index.js +1 -1
- package/dist/shineout.js +36 -29
- package/dist/shineout.js.map +1 -1
- package/dist/shineout.min.js +1 -1
- package/es/Input/Input.js +1 -1
- package/es/Select/Select.js +2 -2
- package/es/Select/filter.js +7 -3
- package/es/Select/index.d.ts +1 -1
- package/es/Table/Td.js +9 -2
- package/es/Table/index.d.ts +13 -2
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/lib/Input/Input.js +1 -1
- package/lib/Select/Select.js +2 -2
- package/lib/Select/filter.js +7 -3
- package/lib/Select/index.d.ts +1 -1
- package/lib/Table/Td.js +10 -2
- package/lib/Table/index.d.ts +13 -2
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/package.json +1 -1
package/css/Input/Input.js
CHANGED
|
@@ -39,7 +39,7 @@ function regLength(size) {
|
|
|
39
39
|
|
|
40
40
|
function fillNumber(val) {
|
|
41
41
|
return val.replace(/^(-)?(\.\d+)(?!=\.).*/g, '$10$2') // eslint-disable-next-line no-useless-escape
|
|
42
|
-
.replace(/(-|^)0+(?=0\.?|[^0\.])/g, '$
|
|
42
|
+
.replace(/(-|^)0+(?=0\.?|[^0\.])/g, '$1').replace(/\.$/, '');
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
var Input =
|
package/css/Select/Select.js
CHANGED
|
@@ -106,7 +106,7 @@ function (_PureComponent) {
|
|
|
106
106
|
|
|
107
107
|
if (prevState.focus !== this.state.focus && !this.state.focus && onFilter) {
|
|
108
108
|
setTimeout(function () {
|
|
109
|
-
onFilter('');
|
|
109
|
+
onFilter('', 'blur');
|
|
110
110
|
}, 400);
|
|
111
111
|
}
|
|
112
112
|
};
|
|
@@ -271,7 +271,7 @@ function (_PureComponent) {
|
|
|
271
271
|
}, 10);
|
|
272
272
|
}
|
|
273
273
|
|
|
274
|
-
if (emptyAfterSelect && onFilter && filterText) onFilter('');
|
|
274
|
+
if (emptyAfterSelect && onFilter && filterText) onFilter('', 'select');
|
|
275
275
|
};
|
|
276
276
|
|
|
277
277
|
_proto.toInputTriggerCollapse = function toInputTriggerCollapse(text) {
|
package/css/Select/filter.js
CHANGED
|
@@ -133,9 +133,13 @@ var _default = function _default(Origin) {
|
|
|
133
133
|
return result;
|
|
134
134
|
};
|
|
135
135
|
|
|
136
|
-
_proto.handleFilter = function handleFilter(text) {
|
|
136
|
+
_proto.handleFilter = function handleFilter(text, from) {
|
|
137
137
|
var _this3 = this;
|
|
138
138
|
|
|
139
|
+
if (from === void 0) {
|
|
140
|
+
from = 'edit';
|
|
141
|
+
}
|
|
142
|
+
|
|
139
143
|
var _this$props5 = this.props,
|
|
140
144
|
filterDelay = _this$props5.filterDelay,
|
|
141
145
|
onFilter = _this$props5.onFilter,
|
|
@@ -148,7 +152,7 @@ var _default = function _default(Origin) {
|
|
|
148
152
|
innerData: undefined
|
|
149
153
|
});
|
|
150
154
|
if (this.timer) clearTimeout(this.timer);
|
|
151
|
-
if (onFilter) onFilter(text);
|
|
155
|
+
if (onFilter) onFilter(text, from);
|
|
152
156
|
return;
|
|
153
157
|
}
|
|
154
158
|
|
|
@@ -165,7 +169,7 @@ var _default = function _default(Origin) {
|
|
|
165
169
|
});
|
|
166
170
|
if (this.timer) clearTimeout(this.timer);
|
|
167
171
|
this.timer = setTimeout(function () {
|
|
168
|
-
var fn = onFilter(text);
|
|
172
|
+
var fn = onFilter(text, from);
|
|
169
173
|
|
|
170
174
|
if (typeof fn === 'function') {
|
|
171
175
|
_this3.setState({
|
package/css/Select/index.d.ts
CHANGED
|
@@ -195,7 +195,7 @@ Pick<CommonProps, 'absolute' | 'clearable' | 'zIndex'>
|
|
|
195
195
|
*
|
|
196
196
|
* default: -
|
|
197
197
|
*/
|
|
198
|
-
onFilter?: (text: string) => (((data: Item) => boolean) | void);
|
|
198
|
+
onFilter?: (text: string, from: string) => (((data: Item) => boolean) | void);
|
|
199
199
|
|
|
200
200
|
/**
|
|
201
201
|
* Merges selected values, valid only in multiselect mode
|
package/css/Table/Td.js
CHANGED
|
@@ -75,8 +75,10 @@ function (_PureComponent) {
|
|
|
75
75
|
datum = _this$props3.datum,
|
|
76
76
|
treeColumnsName = _this$props3.treeColumnsName,
|
|
77
77
|
treeCheckAll = _this$props3.treeCheckAll,
|
|
78
|
-
disabled = _this$props3.disabled
|
|
79
|
-
|
|
78
|
+
disabled = _this$props3.disabled,
|
|
79
|
+
render = _this$props3.render;
|
|
80
|
+
|
|
81
|
+
var checkbox = _react.default.createElement(_Checkbox.default, {
|
|
80
82
|
force: datum.check(data),
|
|
81
83
|
data: data,
|
|
82
84
|
index: index,
|
|
@@ -84,6 +86,12 @@ function (_PureComponent) {
|
|
|
84
86
|
disabled: disabled,
|
|
85
87
|
treeColumnsName: treeCheckAll && treeColumnsName
|
|
86
88
|
});
|
|
89
|
+
|
|
90
|
+
if (render && typeof render === 'function') {
|
|
91
|
+
return render(data, index, checkbox);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return checkbox;
|
|
87
95
|
};
|
|
88
96
|
|
|
89
97
|
_proto.renderExpand = function renderExpand(index) {
|
package/css/Table/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import * as React from 'react'
|
|
|
3
3
|
import { StickyProps } from '../Sticky'
|
|
4
4
|
import { PaginationProps } from '../Pagination'
|
|
5
5
|
import { ListItemStandardProps, StandardProps, RegularAttributes, keyType } from '../@types/common'
|
|
6
|
+
import { ReactComponentElement } from "react"
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
type ReactNode = React.ReactNode;
|
|
@@ -13,11 +14,11 @@ export type ColumnOrder = 'asc' | 'desc'
|
|
|
13
14
|
|
|
14
15
|
export type ColumnFix = 'left' | 'right'
|
|
15
16
|
|
|
16
|
-
export type ColumnType = 'expand' | 'row-expand'
|
|
17
|
+
export type ColumnType = 'expand' | 'row-expand'
|
|
17
18
|
|
|
18
19
|
export interface renderSorterParam {status?: 'asc' | 'desc', triggerAsc: () => void, triggerDesc: () => void}
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
interface CommonColumn<T> {
|
|
21
22
|
/**
|
|
22
23
|
* cell align \['left', 'center', 'right'\]
|
|
23
24
|
*
|
|
@@ -181,6 +182,16 @@ export interface ColumnItem<T> {
|
|
|
181
182
|
className?: string;
|
|
182
183
|
}
|
|
183
184
|
|
|
185
|
+
type SomeColumn<T> = Omit<CommonColumn<T>, 'render' | 'type'>
|
|
186
|
+
|
|
187
|
+
export interface CheckColumn<T> extends SomeColumn<T>{
|
|
188
|
+
type: 'checkbox',
|
|
189
|
+
render?: (rowData: T, index: number, checkInstance: ReactComponentElement<any>) => any
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export type ColumnItem<T> = CommonColumn<T> | CheckColumn<T>
|
|
193
|
+
|
|
194
|
+
|
|
184
195
|
export interface RowEvents {
|
|
185
196
|
[propName: string]: any
|
|
186
197
|
}
|
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.
|
|
4
|
+
export default { utils, version: '1.11.0-rc.2' }
|
|
5
5
|
export { utils }
|
|
6
6
|
export { setLocale } from './locale'
|
|
7
7
|
export { color, style } from './utils/expose'
|
package/css/index.js
CHANGED
package/dist/shineout.js
CHANGED
|
@@ -25024,7 +25024,7 @@ function regLength(size) {
|
|
|
25024
25024
|
|
|
25025
25025
|
function fillNumber(val) {
|
|
25026
25026
|
return val.replace(/^(-)?(\.\d+)(?!=\.).*/g, '$10$2') // eslint-disable-next-line no-useless-escape
|
|
25027
|
-
.replace(/(-|^)0+(?=0\.?|[^0\.])/g, '$
|
|
25027
|
+
.replace(/(-|^)0+(?=0\.?|[^0\.])/g, '$1').replace(/\.$/, '');
|
|
25028
25028
|
}
|
|
25029
25029
|
|
|
25030
25030
|
var Input =
|
|
@@ -37816,7 +37816,7 @@ function (_PureComponent) {
|
|
|
37816
37816
|
|
|
37817
37817
|
if (prevState.focus !== this.state.focus && !this.state.focus && onFilter) {
|
|
37818
37818
|
setTimeout(function () {
|
|
37819
|
-
onFilter('');
|
|
37819
|
+
onFilter('', 'blur');
|
|
37820
37820
|
}, 400);
|
|
37821
37821
|
}
|
|
37822
37822
|
}
|
|
@@ -37996,7 +37996,7 @@ function (_PureComponent) {
|
|
|
37996
37996
|
}, 10);
|
|
37997
37997
|
}
|
|
37998
37998
|
|
|
37999
|
-
if (emptyAfterSelect && onFilter && filterText) onFilter('');
|
|
37999
|
+
if (emptyAfterSelect && onFilter && filterText) onFilter('', 'select');
|
|
38000
38000
|
}
|
|
38001
38001
|
}, {
|
|
38002
38002
|
key: "toInputTriggerCollapse",
|
|
@@ -38693,6 +38693,7 @@ function _createSuper2(Derived) {
|
|
|
38693
38693
|
value: function handleFilter(text) {
|
|
38694
38694
|
var _this3 = this;
|
|
38695
38695
|
|
|
38696
|
+
var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'edit';
|
|
38696
38697
|
var _this$props5 = this.props,
|
|
38697
38698
|
filterDelay = _this$props5.filterDelay,
|
|
38698
38699
|
onFilter = _this$props5.onFilter,
|
|
@@ -38705,7 +38706,7 @@ function _createSuper2(Derived) {
|
|
|
38705
38706
|
innerData: undefined
|
|
38706
38707
|
});
|
|
38707
38708
|
if (this.timer) clearTimeout(this.timer);
|
|
38708
|
-
if (onFilter) onFilter(text);
|
|
38709
|
+
if (onFilter) onFilter(text, from);
|
|
38709
38710
|
return;
|
|
38710
38711
|
}
|
|
38711
38712
|
|
|
@@ -38722,7 +38723,7 @@ function _createSuper2(Derived) {
|
|
|
38722
38723
|
});
|
|
38723
38724
|
if (this.timer) clearTimeout(this.timer);
|
|
38724
38725
|
this.timer = setTimeout(function () {
|
|
38725
|
-
var fn = onFilter(text);
|
|
38726
|
+
var fn = onFilter(text, from);
|
|
38726
38727
|
|
|
38727
38728
|
if (typeof fn === 'function') {
|
|
38728
38729
|
_this3.setState({
|
|
@@ -44506,24 +44507,30 @@ function (_PureComponent) {
|
|
|
44506
44507
|
datum = _this$props3.datum,
|
|
44507
44508
|
treeColumnsName = _this$props3.treeColumnsName,
|
|
44508
44509
|
treeCheckAll = _this$props3.treeCheckAll,
|
|
44509
|
-
disabled = _this$props3.disabled
|
|
44510
|
-
|
|
44511
|
-
|
|
44512
|
-
|
|
44513
|
-
|
|
44514
|
-
|
|
44515
|
-
|
|
44516
|
-
|
|
44517
|
-
|
|
44518
|
-
|
|
44519
|
-
|
|
44520
|
-
|
|
44521
|
-
|
|
44522
|
-
|
|
44523
|
-
|
|
44524
|
-
|
|
44525
|
-
}
|
|
44526
|
-
);
|
|
44510
|
+
disabled = _this$props3.disabled,
|
|
44511
|
+
render = _this$props3.render;
|
|
44512
|
+
var checkbox =
|
|
44513
|
+
/*#__PURE__*/
|
|
44514
|
+
react__WEBPACK_IMPORTED_MODULE_6___default.a.createElement(_Checkbox__WEBPACK_IMPORTED_MODULE_10__["default"], {
|
|
44515
|
+
force: datum.check(data),
|
|
44516
|
+
data: data,
|
|
44517
|
+
index: index,
|
|
44518
|
+
datum: datum,
|
|
44519
|
+
disabled: disabled,
|
|
44520
|
+
treeColumnsName: treeCheckAll && treeColumnsName,
|
|
44521
|
+
__self: this,
|
|
44522
|
+
__source: {
|
|
44523
|
+
fileName: _jsxFileName,
|
|
44524
|
+
lineNumber: 35,
|
|
44525
|
+
columnNumber: 7
|
|
44526
|
+
}
|
|
44527
|
+
});
|
|
44528
|
+
|
|
44529
|
+
if (render && typeof render === 'function') {
|
|
44530
|
+
return render(data, index, checkbox);
|
|
44531
|
+
}
|
|
44532
|
+
|
|
44533
|
+
return checkbox;
|
|
44527
44534
|
}
|
|
44528
44535
|
}, {
|
|
44529
44536
|
key: "renderExpand",
|
|
@@ -44553,7 +44560,7 @@ function (_PureComponent) {
|
|
|
44553
44560
|
__self: this,
|
|
44554
44561
|
__source: {
|
|
44555
44562
|
fileName: _jsxFileName,
|
|
44556
|
-
lineNumber:
|
|
44563
|
+
lineNumber: 63,
|
|
44557
44564
|
columnNumber: 7
|
|
44558
44565
|
}
|
|
44559
44566
|
})
|
|
@@ -44586,7 +44593,7 @@ function (_PureComponent) {
|
|
|
44586
44593
|
__self: this,
|
|
44587
44594
|
__source: {
|
|
44588
44595
|
fileName: _jsxFileName,
|
|
44589
|
-
lineNumber:
|
|
44596
|
+
lineNumber: 85,
|
|
44590
44597
|
columnNumber: 9
|
|
44591
44598
|
}
|
|
44592
44599
|
}, content)
|
|
@@ -44603,7 +44610,7 @@ function (_PureComponent) {
|
|
|
44603
44610
|
__self: this,
|
|
44604
44611
|
__source: {
|
|
44605
44612
|
fileName: _jsxFileName,
|
|
44606
|
-
lineNumber:
|
|
44613
|
+
lineNumber: 91,
|
|
44607
44614
|
columnNumber: 7
|
|
44608
44615
|
}
|
|
44609
44616
|
},
|
|
@@ -44615,7 +44622,7 @@ function (_PureComponent) {
|
|
|
44615
44622
|
__self: this,
|
|
44616
44623
|
__source: {
|
|
44617
44624
|
fileName: _jsxFileName,
|
|
44618
|
-
lineNumber:
|
|
44625
|
+
lineNumber: 92,
|
|
44619
44626
|
columnNumber: 9
|
|
44620
44627
|
}
|
|
44621
44628
|
}), content)
|
|
@@ -44677,7 +44684,7 @@ function (_PureComponent) {
|
|
|
44677
44684
|
__self: this,
|
|
44678
44685
|
__source: {
|
|
44679
44686
|
fileName: _jsxFileName,
|
|
44680
|
-
lineNumber:
|
|
44687
|
+
lineNumber: 139,
|
|
44681
44688
|
columnNumber: 7
|
|
44682
44689
|
}
|
|
44683
44690
|
}, this.renderContent())
|
|
@@ -61288,7 +61295,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
61288
61295
|
|
|
61289
61296
|
/* harmony default export */ __webpack_exports__["default"] = ({
|
|
61290
61297
|
utils: _utils__WEBPACK_IMPORTED_MODULE_0__,
|
|
61291
|
-
version: '1.
|
|
61298
|
+
version: '1.11.0-rc.2'
|
|
61292
61299
|
});
|
|
61293
61300
|
|
|
61294
61301
|
|