shineout 2.0.0-rc.6 → 2.0.0-rc.8
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/Checkbox/CheckItem.js +13 -5
- package/css/Checkbox/Props.d.ts +11 -2
- package/css/Checkbox/styles/checkinput.css +14 -0
- package/css/index.d.ts +149 -57
- package/css/index.js +1 -1
- package/css/utils/clone.js +14 -0
- package/dist/shineout.js +867 -641
- package/dist/shineout.js.map +1 -1
- package/dist/shineout.min.js +1 -1
- package/dist/theme.antd.css +1 -1
- package/dist/theme.antd2.css +1 -1
- package/dist/theme.default.css +1 -1
- package/dist/theme.shineout.css +1 -1
- package/esm/Checkbox/CheckItem.js +12 -5
- package/esm/Checkbox/Props.d.ts +11 -2
- package/esm/Checkbox/styles/checkinput.less +17 -0
- package/esm/index.d.ts +149 -57
- package/esm/index.js +1 -1
- package/esm/utils/clone.js +14 -0
- package/lib/Checkbox/CheckItem.js +13 -5
- package/lib/Checkbox/Props.d.ts +11 -2
- package/lib/Checkbox/styles/checkinput.less +17 -0
- package/lib/index.d.ts +149 -57
- package/lib/index.js +1 -1
- package/lib/utils/clone.js +14 -0
- package/package.json +1 -1
|
@@ -31,6 +31,8 @@ var _is = require("../utils/is");
|
|
|
31
31
|
|
|
32
32
|
var _Input = _interopRequireDefault(require("../Input"));
|
|
33
33
|
|
|
34
|
+
var _Spin = _interopRequireDefault(require("../Spin"));
|
|
35
|
+
|
|
34
36
|
var _styles = require("./styles");
|
|
35
37
|
|
|
36
38
|
var _config = require("../config");
|
|
@@ -154,11 +156,13 @@ function checkItem(type) {
|
|
|
154
156
|
size = _this$props5.size,
|
|
155
157
|
children = _this$props5.children,
|
|
156
158
|
inputable = _this$props5.inputable,
|
|
157
|
-
onClick = _this$props5.onClick
|
|
159
|
+
onClick = _this$props5.onClick,
|
|
160
|
+
loading = _this$props5.loading;
|
|
158
161
|
var rtl = (0, _config.isRTL)();
|
|
159
162
|
var checked = this.getChecked();
|
|
160
163
|
var isSwitch = type === 'switch';
|
|
161
|
-
var
|
|
164
|
+
var ban = disabled || isSwitch && loading;
|
|
165
|
+
var className = (0, _classnames.default)((0, _styles.checkinputClass)('_', ban && 'disabled', checked === true && 'checked', checked === 'indeterminate' && 'indeterminate', isSwitch && 'switch', loading && 'loading', type + "-container", rtl && 'rtl', {
|
|
162
166
|
large: size === 'large',
|
|
163
167
|
small: size === 'small'
|
|
164
168
|
}), this.props.className);
|
|
@@ -180,10 +184,10 @@ function checkItem(type) {
|
|
|
180
184
|
ref: this.bindRef
|
|
181
185
|
/* @ts-ignore */
|
|
182
186
|
,
|
|
183
|
-
disabled:
|
|
187
|
+
disabled: ban
|
|
184
188
|
}, (0, _getDataset.default)(this.props)), switchChildren, _react.default.createElement("input", {
|
|
185
189
|
id: this.id,
|
|
186
|
-
disabled:
|
|
190
|
+
disabled: ban,
|
|
187
191
|
tabIndex: -1,
|
|
188
192
|
type: isSwitch ? 'checkbox' : type,
|
|
189
193
|
onClick: onClick,
|
|
@@ -199,7 +203,11 @@ function checkItem(type) {
|
|
|
199
203
|
value: value
|
|
200
204
|
}), isSwitch && _react.default.createElement("span", {
|
|
201
205
|
className: (0, _styles.checkinputClass)((0, _classname.getDirectionClass)('switch-indicator'))
|
|
202
|
-
}
|
|
206
|
+
}, loading ? _react.default.createElement(_Spin.default, {
|
|
207
|
+
size: "auto",
|
|
208
|
+
color: "none",
|
|
209
|
+
name: "ring"
|
|
210
|
+
}) : null));
|
|
203
211
|
};
|
|
204
212
|
|
|
205
213
|
return CheckItem;
|
package/css/Checkbox/Props.d.ts
CHANGED
|
@@ -15,6 +15,15 @@ export interface CheckItemProps extends StandardProps {
|
|
|
15
15
|
* default: false
|
|
16
16
|
*/
|
|
17
17
|
disabled?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* loading
|
|
21
|
+
*
|
|
22
|
+
* 加载中
|
|
23
|
+
*
|
|
24
|
+
* default: false
|
|
25
|
+
*/
|
|
26
|
+
loading?: boolean;
|
|
18
27
|
/**
|
|
19
28
|
* if not set, use (value === htmlValue).
|
|
20
29
|
*
|
|
@@ -61,10 +70,10 @@ export interface CheckItemProps extends StandardProps {
|
|
|
61
70
|
size?: 'small' | 'default' | 'large';
|
|
62
71
|
content?: [ReactNode, ReactNode] | [];
|
|
63
72
|
}
|
|
64
|
-
export declare type SimpleCheckProps = Omit<CheckItemProps, 'content' | 'onChange'> & {
|
|
73
|
+
export declare type SimpleCheckProps = Omit<CheckItemProps, 'content' | 'onChange' | 'loading'> & {
|
|
65
74
|
onChange?: ((value: any, checked: CheckValueType, index?: number) => void);
|
|
66
75
|
};
|
|
67
|
-
export declare type SimpleRadioProps = Omit<CheckItemProps, 'content' | 'onChange' | 'onRawChange' | 'inputable' | 'value'> & {
|
|
76
|
+
export declare type SimpleRadioProps = Omit<CheckItemProps, 'content' | 'onChange' | 'onRawChange' | 'inputable' | 'value' | 'loading'> & {
|
|
68
77
|
checked?: boolean | ((htmlValue: any) => boolean);
|
|
69
78
|
onChange?: ((value: any, checked: CheckValueType, index?: number) => void);
|
|
70
79
|
};
|
|
@@ -393,11 +393,22 @@ fieldset[disabled] .so-checkinput-button .so-checkinput.so-checkinput-checked:ac
|
|
|
393
393
|
border-radius: 50%;
|
|
394
394
|
-webkit-box-shadow: 0 1px 4px var(--gray-500, #adb5bd);
|
|
395
395
|
box-shadow: 0 1px 4px var(--gray-500, #adb5bd);
|
|
396
|
+
font-size: var(--switch-indicator-size, 24px);
|
|
397
|
+
color: var(--switch-unchecked-bg, #ced4da);
|
|
396
398
|
}
|
|
397
399
|
.so-checkinput-rtl .so-checkinput-switch-indicator {
|
|
398
400
|
left: auto;
|
|
399
401
|
right: var(--switch-indicator-padding-horizontal, 0px);
|
|
400
402
|
}
|
|
403
|
+
.so-checkinput-loading .so-checkinput-switch-indicator .so-spin-ring {
|
|
404
|
+
position: absolute;
|
|
405
|
+
top: 12%;
|
|
406
|
+
left: 12%;
|
|
407
|
+
right: 12%;
|
|
408
|
+
bottom: 12%;
|
|
409
|
+
border-width: 0.12em;
|
|
410
|
+
border-top-color: currentColor;
|
|
411
|
+
}
|
|
401
412
|
.so-checkinput-switch-children {
|
|
402
413
|
font-size: 12px;
|
|
403
414
|
color: #fff;
|
|
@@ -416,6 +427,7 @@ fieldset[disabled] .so-checkinput-button .so-checkinput.so-checkinput-checked:ac
|
|
|
416
427
|
-webkit-box-shadow: var(--switch-checked-box-shadow, 0 1px 4px var(--primary-color-fade-50, rgba(51, 153, 255, 0.5)));
|
|
417
428
|
box-shadow: var(--switch-checked-box-shadow, 0 1px 4px var(--primary-color-fade-50, rgba(51, 153, 255, 0.5)));
|
|
418
429
|
background: var(--switch-indicator-checked-bg, var(--primary-color, #3399ff));
|
|
430
|
+
color: var(--switch-checked-bg, var(--primary-color-fade-50, rgba(51, 153, 255, 0.5)));
|
|
419
431
|
}
|
|
420
432
|
.so-checkinput-checked.so-checkinput-switch .so-checkinput-switch-indicator-ltr {
|
|
421
433
|
left: 100%;
|
|
@@ -465,6 +477,7 @@ fieldset[disabled] .so-checkinput-button .so-checkinput.so-checkinput-checked:ac
|
|
|
465
477
|
top: var(--switch-small-indicator-top, -3px);
|
|
466
478
|
padding-left: 8px;
|
|
467
479
|
padding-right: 8px;
|
|
480
|
+
font-size: var(--switch-small-indicator-size, 16px);
|
|
468
481
|
}
|
|
469
482
|
.so-checkinput-large.so-checkinput-switch {
|
|
470
483
|
min-width: 60px;
|
|
@@ -482,6 +495,7 @@ fieldset[disabled] .so-checkinput-button .so-checkinput.so-checkinput-checked:ac
|
|
|
482
495
|
width: var(--switch-large-indicator-size, 32px);
|
|
483
496
|
height: var(--switch-large-indicator-size, 32px);
|
|
484
497
|
top: var(--switch-large-indicator-top, -5px);
|
|
498
|
+
font-size: var(--switch-large-indicator-size, 32px);
|
|
485
499
|
}
|
|
486
500
|
.so-checkinput-disabled.so-checkinput-switch {
|
|
487
501
|
opacity: 0.4;
|
package/css/index.d.ts
CHANGED
|
@@ -1,58 +1,150 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
// Created by scripts/src-index.js.
|
|
2
|
+
import * as AlertType from './Alert/interface'
|
|
3
|
+
import * as BreadcrumbType from './Breadcrumb/interface'
|
|
4
|
+
import * as ButtonType from './Button/interface'
|
|
5
|
+
import * as CardType from './Card/interface'
|
|
6
|
+
import * as CardGroupType from './CardGroup/interface'
|
|
7
|
+
import * as CarouselType from './Carousel/interface'
|
|
8
|
+
import * as CascaderType from './Cascader/interface'
|
|
9
|
+
import * as CheckboxType from './Checkbox/interface'
|
|
10
|
+
import * as DatePickerType from './DatePicker/interface'
|
|
11
|
+
import * as DividerType from './Divider/interface'
|
|
12
|
+
import * as DrawerType from './Drawer/interface'
|
|
13
|
+
import * as DropdownType from './Dropdown/interface'
|
|
14
|
+
import * as EditableAreaType from './EditableArea/interface'
|
|
15
|
+
import * as FormType from './Form/interface'
|
|
16
|
+
import * as GapType from './Gap/interface'
|
|
17
|
+
import * as GridType from './Grid/interface'
|
|
18
|
+
import * as IconType from './Icon/interface'
|
|
19
|
+
import * as ImageType from './Image/interface'
|
|
20
|
+
import * as InputType from './Input/interface'
|
|
21
|
+
import * as ListType from './List/interface'
|
|
22
|
+
import * as MenuType from './Menu/interface'
|
|
23
|
+
import * as MessageType from './Message/interface'
|
|
24
|
+
import * as ModalType from './Modal/interface'
|
|
25
|
+
import * as PaginationType from './Pagination/interface'
|
|
26
|
+
import * as PopoverType from './Popover/interface'
|
|
27
|
+
import * as ProgressType from './Progress/interface'
|
|
28
|
+
import * as RadioType from './Radio/interface'
|
|
29
|
+
import * as RateType from './Rate/interface'
|
|
30
|
+
import * as RuleType from './Rule/interface'
|
|
31
|
+
import * as SelectType from './Select/interface'
|
|
32
|
+
import * as SliderType from './Slider/interface'
|
|
33
|
+
import * as SpinType from './Spin/interface'
|
|
34
|
+
import * as StickyType from './Sticky/interface'
|
|
35
|
+
import * as SwitchType from './Switch/interface'
|
|
36
|
+
import * as TableType from './Table/interface'
|
|
37
|
+
import * as TabsType from './Tabs/interface'
|
|
38
|
+
import * as TagType from './Tag/interface'
|
|
39
|
+
import * as TextareaType from './Textarea/interface'
|
|
40
|
+
import * as TooltipType from './Tooltip/interface'
|
|
41
|
+
import * as TransferType from './Transfer/interface'
|
|
42
|
+
import * as TreeType from './Tree/interface'
|
|
43
|
+
import * as TreeSelectType from './TreeSelect/interface'
|
|
44
|
+
import * as UploadType from './Upload/interface'
|
|
45
|
+
export declare namespace TYPE {
|
|
46
|
+
export import Alert = AlertType
|
|
47
|
+
export import Breadcrumb = BreadcrumbType
|
|
48
|
+
export import Button = ButtonType
|
|
49
|
+
export import Card = CardType
|
|
50
|
+
export import CardGroup = CardGroupType
|
|
51
|
+
export import Carousel = CarouselType
|
|
52
|
+
export import Cascader = CascaderType
|
|
53
|
+
export import Checkbox = CheckboxType
|
|
54
|
+
export import DatePicker = DatePickerType
|
|
55
|
+
export import Divider = DividerType
|
|
56
|
+
export import Drawer = DrawerType
|
|
57
|
+
export import Dropdown = DropdownType
|
|
58
|
+
export import EditableArea = EditableAreaType
|
|
59
|
+
export import Form = FormType
|
|
60
|
+
export import Gap = GapType
|
|
61
|
+
export import Grid = GridType
|
|
62
|
+
export import Icon = IconType
|
|
63
|
+
export import Image = ImageType
|
|
64
|
+
export import Input = InputType
|
|
65
|
+
export import List = ListType
|
|
66
|
+
export import Menu = MenuType
|
|
67
|
+
export import Message = MessageType
|
|
68
|
+
export import Modal = ModalType
|
|
69
|
+
export import Pagination = PaginationType
|
|
70
|
+
export import Popover = PopoverType
|
|
71
|
+
export import Progress = ProgressType
|
|
72
|
+
export import Radio = RadioType
|
|
73
|
+
export import Rate = RateType
|
|
74
|
+
export import Rule = RuleType
|
|
75
|
+
export import Select = SelectType
|
|
76
|
+
export import Slider = SliderType
|
|
77
|
+
export import Spin = SpinType
|
|
78
|
+
export import Sticky = StickyType
|
|
79
|
+
export import Switch = SwitchType
|
|
80
|
+
export import Table = TableType
|
|
81
|
+
export import Tabs = TabsType
|
|
82
|
+
export import Tag = TagType
|
|
83
|
+
export import Textarea = TextareaType
|
|
84
|
+
export import Tooltip = TooltipType
|
|
85
|
+
export import Transfer = TransferType
|
|
86
|
+
export import Tree = TreeType
|
|
87
|
+
export import TreeSelect = TreeSelectType
|
|
88
|
+
export import Upload = UploadType
|
|
4
89
|
}
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
16
|
-
export { default as
|
|
17
|
-
|
|
18
|
-
export { default as
|
|
19
|
-
export { default as
|
|
20
|
-
export { default as
|
|
21
|
-
export { default as
|
|
22
|
-
export { default as
|
|
23
|
-
export { default as
|
|
24
|
-
export { default as
|
|
25
|
-
export { default as
|
|
26
|
-
export { default as
|
|
27
|
-
export { default as
|
|
28
|
-
export { default as
|
|
29
|
-
export { default as
|
|
30
|
-
export { default as
|
|
31
|
-
export { default as
|
|
32
|
-
export { default as
|
|
33
|
-
export { default as
|
|
34
|
-
export { default as
|
|
35
|
-
export { default as
|
|
36
|
-
export { default as
|
|
37
|
-
export { default as
|
|
38
|
-
export { default as
|
|
39
|
-
export { default as
|
|
40
|
-
export { default as
|
|
41
|
-
export { default as
|
|
42
|
-
export { default as
|
|
43
|
-
export { default as
|
|
44
|
-
export { default as
|
|
45
|
-
export { default as
|
|
46
|
-
export { default as
|
|
47
|
-
export { default as
|
|
48
|
-
export { default as
|
|
49
|
-
export { default as
|
|
50
|
-
export { default as
|
|
51
|
-
export { default as
|
|
52
|
-
export { default as
|
|
53
|
-
export { default as
|
|
54
|
-
export { default as
|
|
55
|
-
export { default as
|
|
56
|
-
|
|
57
|
-
export {
|
|
58
|
-
export { default as
|
|
90
|
+
import * as utils from './utils'
|
|
91
|
+
|
|
92
|
+
declare const __default: {
|
|
93
|
+
utils: typeof utils,
|
|
94
|
+
version: '1.12.0-rc.6'
|
|
95
|
+
}
|
|
96
|
+
export default __default
|
|
97
|
+
|
|
98
|
+
export { utils }
|
|
99
|
+
export { setLocale } from './locale'
|
|
100
|
+
export { color, style } from './utils/expose'
|
|
101
|
+
export { default as config, setConfig, isRTL } from './config'
|
|
102
|
+
|
|
103
|
+
export { default as LazyList } from './AnimationList/LazyList'
|
|
104
|
+
export { default as Alert } from './Alert'
|
|
105
|
+
export { default as AnimationList } from './AnimationList'
|
|
106
|
+
export { default as Breadcrumb } from './Breadcrumb'
|
|
107
|
+
export { default as Button } from './Button'
|
|
108
|
+
export { default as Card } from './Card'
|
|
109
|
+
export { default as CardGroup } from './CardGroup'
|
|
110
|
+
export { default as Carousel } from './Carousel'
|
|
111
|
+
export { default as Cascader } from './Cascader'
|
|
112
|
+
export { default as Checkbox } from './Checkbox'
|
|
113
|
+
export { default as DatePicker } from './DatePicker'
|
|
114
|
+
export { default as Datum } from './Datum'
|
|
115
|
+
export { default as Divider } from './Divider'
|
|
116
|
+
export { default as Drawer } from './Drawer'
|
|
117
|
+
export { default as Dropdown } from './Dropdown'
|
|
118
|
+
export { default as EditableArea } from './EditableArea'
|
|
119
|
+
export { default as Form } from './Form'
|
|
120
|
+
export { default as Gap } from './Gap'
|
|
121
|
+
export { default as Grid } from './Grid'
|
|
122
|
+
export { default as Icon } from './Icon'
|
|
123
|
+
export { default as Image } from './Image'
|
|
124
|
+
export { default as Input } from './Input'
|
|
125
|
+
export { default as Lazyload } from './Lazyload'
|
|
126
|
+
export { default as List } from './List'
|
|
127
|
+
export { default as Menu } from './Menu'
|
|
128
|
+
export { default as Message } from './Message'
|
|
129
|
+
export { default as Modal } from './Modal'
|
|
130
|
+
export { default as Pagination } from './Pagination'
|
|
131
|
+
export { default as Popover } from './Popover'
|
|
132
|
+
export { default as Progress } from './Progress'
|
|
133
|
+
export { default as Radio } from './Radio'
|
|
134
|
+
export { default as Rate } from './Rate'
|
|
135
|
+
export { default as Rule } from './Rule'
|
|
136
|
+
export { default as Scroll } from './Scroll'
|
|
137
|
+
export { default as Select } from './Select'
|
|
138
|
+
export { default as Slider } from './Slider'
|
|
139
|
+
export { default as Spin } from './Spin'
|
|
140
|
+
export { default as Sticky } from './Sticky'
|
|
141
|
+
export { default as Switch } from './Switch'
|
|
142
|
+
export { default as Table } from './Table'
|
|
143
|
+
export { default as Tabs } from './Tabs'
|
|
144
|
+
export { default as Tag } from './Tag'
|
|
145
|
+
export { default as Textarea } from './Textarea'
|
|
146
|
+
export { default as Tooltip } from './Tooltip'
|
|
147
|
+
export { default as Transfer } from './Transfer'
|
|
148
|
+
export { default as Tree } from './Tree'
|
|
149
|
+
export { default as TreeSelect } from './TreeSelect'
|
|
150
|
+
export { default as Upload } from './Upload'
|
package/css/index.js
CHANGED
package/css/utils/clone.js
CHANGED
|
@@ -18,6 +18,20 @@ var cloneObject = function cloneObject(source, specialKeys) {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
var target = Object.create(Object.getPrototypeOf(source));
|
|
21
|
+
/* File or Response (non-serializable data) will throw error */
|
|
22
|
+
|
|
23
|
+
try {
|
|
24
|
+
// eslint-disable-next-line guard-for-in
|
|
25
|
+
for (var key in target) {
|
|
26
|
+
target[key] = target[key];
|
|
27
|
+
}
|
|
28
|
+
} catch (e) {
|
|
29
|
+
console.error('should not pass non-serializable data', source);
|
|
30
|
+
console.error(e);
|
|
31
|
+
target = {};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
;
|
|
21
35
|
[].concat(specialKeys, Object.keys(source)).forEach(function (k) {
|
|
22
36
|
// eslint-disable-next-line
|
|
23
37
|
target[k] = deepClone(source[k]);
|