@douyinfe/semi-ui 2.15.1 → 2.17.0-alpha.0
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/button/buttonGroup.tsx +3 -2
- package/cascader/index.tsx +5 -1
- package/dist/css/semi.css +12 -0
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +596 -459
- package/dist/umd/semi-ui.js.map +1 -1
- package/dist/umd/semi-ui.min.js +1 -1
- package/dist/umd/semi-ui.min.js.map +1 -1
- package/iconButton/index.tsx +3 -0
- package/lib/cjs/button/buttonGroup.d.ts +0 -2
- package/lib/cjs/button/buttonGroup.js +4 -3
- package/lib/cjs/cascader/index.d.ts +3 -0
- package/lib/cjs/cascader/index.js +5 -3
- package/lib/cjs/iconButton/index.js +3 -0
- package/lib/cjs/slider/index.d.ts +1 -1
- package/lib/cjs/slider/index.js +84 -36
- package/lib/cjs/transfer/index.d.ts +5 -0
- package/lib/cjs/transfer/index.js +7 -17
- package/lib/cjs/typography/base.js +15 -3
- package/lib/cjs/typography/text.js +11 -1
- package/lib/es/button/buttonGroup.d.ts +0 -2
- package/lib/es/button/buttonGroup.js +4 -3
- package/lib/es/cascader/index.d.ts +3 -0
- package/lib/es/cascader/index.js +5 -3
- package/lib/es/iconButton/index.js +3 -0
- package/lib/es/slider/index.d.ts +1 -1
- package/lib/es/slider/index.js +84 -36
- package/lib/es/transfer/index.d.ts +5 -0
- package/lib/es/transfer/index.js +7 -17
- package/lib/es/typography/base.js +15 -3
- package/lib/es/typography/text.js +10 -1
- package/package.json +8 -10
- package/slider/_story/slider.stories.js +4 -2
- package/slider/index.tsx +63 -33
- package/transfer/_story/transfer.stories.js +29 -0
- package/transfer/index.tsx +10 -10
- package/typography/_story/typography.stories.js +15 -3
- package/typography/base.tsx +9 -4
- package/typography/text.tsx +9 -1
package/lib/es/slider/index.js
CHANGED
|
@@ -50,7 +50,9 @@ export default class Slider extends BaseComponent {
|
|
|
50
50
|
const {
|
|
51
51
|
chooseMovePos,
|
|
52
52
|
isDrag,
|
|
53
|
-
isInRenderTree
|
|
53
|
+
isInRenderTree,
|
|
54
|
+
firstDotFocusVisible,
|
|
55
|
+
secondDotFocusVisible
|
|
54
56
|
} = this.state;
|
|
55
57
|
const stylePos = vertical ? 'top' : 'left';
|
|
56
58
|
const percentInfo = this.foundation.getMinAndMaxPercent(this.state.currentValue);
|
|
@@ -76,7 +78,7 @@ export default class Slider extends BaseComponent {
|
|
|
76
78
|
currentValue
|
|
77
79
|
} = this.state;
|
|
78
80
|
const commonAria = {
|
|
79
|
-
'aria-label': ariaLabel,
|
|
81
|
+
'aria-label': ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : disabled ? 'Disabled Slider' : undefined,
|
|
80
82
|
'aria-labelledby': ariaLabelledby,
|
|
81
83
|
'aria-disabled': disabled
|
|
82
84
|
};
|
|
@@ -88,7 +90,7 @@ export default class Slider extends BaseComponent {
|
|
|
88
90
|
position: "top",
|
|
89
91
|
trigger: "custom",
|
|
90
92
|
rePosKey: minPercent,
|
|
91
|
-
visible: isInRenderTree && tipVisible.min,
|
|
93
|
+
visible: isInRenderTree && (tipVisible.min || firstDotFocusVisible),
|
|
92
94
|
className: "".concat(cssClasses.HANDLE, "-tooltip")
|
|
93
95
|
}, /*#__PURE__*/React.createElement("span", _Object$assign({
|
|
94
96
|
onMouseOver: this.foundation.checkAndUpdateIsInRenderTreeState,
|
|
@@ -120,20 +122,28 @@ export default class Slider extends BaseComponent {
|
|
|
120
122
|
onTouchEnd: e => {
|
|
121
123
|
this.foundation.onHandleUp(e);
|
|
122
124
|
},
|
|
123
|
-
|
|
125
|
+
onKeyDown: e => {
|
|
126
|
+
this.foundation.handleKeyDown(e, 'min');
|
|
127
|
+
},
|
|
128
|
+
onFocus: e => {
|
|
129
|
+
this.foundation.onFocus(e, 'min');
|
|
130
|
+
},
|
|
131
|
+
onBlur: e => {
|
|
132
|
+
this.foundation.onBlur(e, 'min');
|
|
133
|
+
},
|
|
124
134
|
role: "slider",
|
|
125
|
-
|
|
135
|
+
"aria-valuetext": getAriaValueText ? getAriaValueText(currentValue, 0) : ariaValueText,
|
|
136
|
+
tabIndex: disabled ? -1 : 0
|
|
126
137
|
}, commonAria, {
|
|
127
138
|
"aria-valuenow": currentValue,
|
|
128
139
|
"aria-valuemax": max,
|
|
129
|
-
"aria-valuemin": min
|
|
130
|
-
"aria-valuetext": getAriaValueText ? getAriaValueText(currentValue) : ariaValueText
|
|
140
|
+
"aria-valuemin": min
|
|
131
141
|
}))) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Tooltip, {
|
|
132
142
|
content: tipChildren.min,
|
|
133
143
|
position: "top",
|
|
134
144
|
trigger: "custom",
|
|
135
145
|
rePosKey: minPercent,
|
|
136
|
-
visible: isInRenderTree && tipVisible.min,
|
|
146
|
+
visible: isInRenderTree && (tipVisible.min || firstDotFocusVisible),
|
|
137
147
|
className: "".concat(cssClasses.HANDLE, "-tooltip")
|
|
138
148
|
}, /*#__PURE__*/React.createElement("span", _Object$assign({
|
|
139
149
|
ref: this.minHanleEl,
|
|
@@ -164,12 +174,20 @@ export default class Slider extends BaseComponent {
|
|
|
164
174
|
onTouchEnd: e => {
|
|
165
175
|
this.foundation.onHandleUp(e);
|
|
166
176
|
},
|
|
167
|
-
|
|
177
|
+
onKeyDown: e => {
|
|
178
|
+
this.foundation.handleKeyDown(e, 'min');
|
|
179
|
+
},
|
|
180
|
+
onFocus: e => {
|
|
181
|
+
this.foundation.onFocus(e, 'min');
|
|
182
|
+
},
|
|
183
|
+
onBlur: e => {
|
|
184
|
+
this.foundation.onBlur(e, 'min');
|
|
185
|
+
},
|
|
168
186
|
role: "slider",
|
|
169
|
-
tabIndex: 0
|
|
187
|
+
tabIndex: disabled ? -1 : 0
|
|
170
188
|
}, commonAria, {
|
|
189
|
+
"aria-valuetext": getAriaValueText ? getAriaValueText(currentValue[0], 0) : ariaValueText,
|
|
171
190
|
"aria-valuenow": currentValue[0],
|
|
172
|
-
"aria-valuetext": getAriaValueText ? getAriaValueText(currentValue[0]) : ariaValueText,
|
|
173
191
|
"aria-valuemax": currentValue[1],
|
|
174
192
|
"aria-valuemin": min
|
|
175
193
|
}))), /*#__PURE__*/React.createElement(Tooltip, {
|
|
@@ -177,7 +195,7 @@ export default class Slider extends BaseComponent {
|
|
|
177
195
|
position: "top",
|
|
178
196
|
trigger: "custom",
|
|
179
197
|
rePosKey: maxPercent,
|
|
180
|
-
visible: isInRenderTree && tipVisible.max,
|
|
198
|
+
visible: isInRenderTree && (tipVisible.max || secondDotFocusVisible),
|
|
181
199
|
className: "".concat(cssClasses.HANDLE, "-tooltip")
|
|
182
200
|
}, /*#__PURE__*/React.createElement("span", _Object$assign({
|
|
183
201
|
ref: this.maxHanleEl,
|
|
@@ -208,12 +226,20 @@ export default class Slider extends BaseComponent {
|
|
|
208
226
|
onTouchEnd: e => {
|
|
209
227
|
this.foundation.onHandleUp(e);
|
|
210
228
|
},
|
|
211
|
-
|
|
229
|
+
onKeyDown: e => {
|
|
230
|
+
this.foundation.handleKeyDown(e, 'max');
|
|
231
|
+
},
|
|
232
|
+
onFocus: e => {
|
|
233
|
+
this.foundation.onFocus(e, 'max');
|
|
234
|
+
},
|
|
235
|
+
onBlur: e => {
|
|
236
|
+
this.foundation.onBlur(e, 'max');
|
|
237
|
+
},
|
|
212
238
|
role: "slider",
|
|
213
|
-
tabIndex: 0
|
|
239
|
+
tabIndex: disabled ? -1 : 0
|
|
214
240
|
}, commonAria, {
|
|
241
|
+
"aria-valuetext": getAriaValueText ? getAriaValueText(currentValue[1], 1) : ariaValueText,
|
|
215
242
|
"aria-valuenow": currentValue[1],
|
|
216
|
-
"aria-valuetext": getAriaValueText ? getAriaValueText(currentValue[1]) : ariaValueText,
|
|
217
243
|
"aria-valuemax": max,
|
|
218
244
|
"aria-valuemin": currentValue[0]
|
|
219
245
|
}))));
|
|
@@ -314,6 +340,13 @@ export default class Slider extends BaseComponent {
|
|
|
314
340
|
return labelContent;
|
|
315
341
|
};
|
|
316
342
|
|
|
343
|
+
this._getAriaValueText = (value, index) => {
|
|
344
|
+
const {
|
|
345
|
+
getAriaValueText
|
|
346
|
+
} = this.props;
|
|
347
|
+
return getAriaValueText ? getAriaValueText(value, index) : value;
|
|
348
|
+
};
|
|
349
|
+
|
|
317
350
|
let {
|
|
318
351
|
value
|
|
319
352
|
} = this.props;
|
|
@@ -334,14 +367,14 @@ export default class Slider extends BaseComponent {
|
|
|
334
367
|
isDrag: false,
|
|
335
368
|
clickValue: 0,
|
|
336
369
|
showBoundary: false,
|
|
337
|
-
isInRenderTree: true
|
|
370
|
+
isInRenderTree: true,
|
|
371
|
+
firstDotFocusVisible: false,
|
|
372
|
+
secondDotFocusVisible: false
|
|
338
373
|
};
|
|
339
374
|
this.sliderEl = /*#__PURE__*/React.createRef();
|
|
340
375
|
this.minHanleEl = /*#__PURE__*/React.createRef();
|
|
341
376
|
this.maxHanleEl = /*#__PURE__*/React.createRef();
|
|
342
|
-
this.dragging = [false, false];
|
|
343
|
-
// this.isDrag = false;
|
|
344
|
-
|
|
377
|
+
this.dragging = [false, false];
|
|
345
378
|
this.foundation = new SliderFoundation(this.adapter);
|
|
346
379
|
this.eventListenerSet = new _Set();
|
|
347
380
|
}
|
|
@@ -408,8 +441,7 @@ export default class Slider extends BaseComponent {
|
|
|
408
441
|
return flag;
|
|
409
442
|
},
|
|
410
443
|
getOverallVars: () => ({
|
|
411
|
-
dragging: this.dragging
|
|
412
|
-
chooseMovePos: this.chooseMovePos
|
|
444
|
+
dragging: this.dragging
|
|
413
445
|
}),
|
|
414
446
|
updateDisabled: disabled => {
|
|
415
447
|
this.setState({
|
|
@@ -443,9 +475,6 @@ export default class Slider extends BaseComponent {
|
|
|
443
475
|
getMinHandleEl: () => this.minHanleEl,
|
|
444
476
|
getMaxHandleEl: () => this.maxHanleEl,
|
|
445
477
|
onHandleDown: e => {
|
|
446
|
-
e.stopPropagation();
|
|
447
|
-
e.preventDefault();
|
|
448
|
-
|
|
449
478
|
this._addEventListener(document.body, 'mousemove', this.foundation.onHandleMove, false);
|
|
450
479
|
|
|
451
480
|
this._addEventListener(document.body, 'mouseup', this.foundation.onHandleUp, false);
|
|
@@ -568,37 +597,55 @@ export default class Slider extends BaseComponent {
|
|
|
568
597
|
}
|
|
569
598
|
|
|
570
599
|
render() {
|
|
600
|
+
var _context5;
|
|
601
|
+
|
|
602
|
+
const {
|
|
603
|
+
disabled,
|
|
604
|
+
currentValue,
|
|
605
|
+
min,
|
|
606
|
+
max
|
|
607
|
+
} = this.state;
|
|
608
|
+
const {
|
|
609
|
+
vertical,
|
|
610
|
+
verticalReverse,
|
|
611
|
+
style,
|
|
612
|
+
railStyle,
|
|
613
|
+
range,
|
|
614
|
+
className
|
|
615
|
+
} = this.props;
|
|
571
616
|
const wrapperClass = cls("".concat(prefixCls, "-wrapper"), {
|
|
572
|
-
["".concat(prefixCls, "-disabled")]:
|
|
573
|
-
["".concat(cssClasses.VERTICAL, "-wrapper")]:
|
|
574
|
-
["".concat(prefixCls, "-reverse")]:
|
|
575
|
-
},
|
|
617
|
+
["".concat(prefixCls, "-disabled")]: disabled,
|
|
618
|
+
["".concat(cssClasses.VERTICAL, "-wrapper")]: vertical,
|
|
619
|
+
["".concat(prefixCls, "-reverse")]: vertical && verticalReverse
|
|
620
|
+
}, className);
|
|
576
621
|
const boundaryClass = cls("".concat(prefixCls, "-boundary"), {
|
|
577
622
|
["".concat(prefixCls, "-boundary-show")]: this.props.showBoundary && this.state.showBoundary
|
|
578
623
|
});
|
|
579
624
|
const sliderCls = cls({
|
|
580
|
-
["".concat(prefixCls)]: !
|
|
581
|
-
[cssClasses.VERTICAL]:
|
|
625
|
+
["".concat(prefixCls)]: !vertical,
|
|
626
|
+
[cssClasses.VERTICAL]: vertical
|
|
582
627
|
});
|
|
628
|
+
const ariaLabel = range ? _concatInstanceProperty(_context5 = "Range: ".concat(this._getAriaValueText(currentValue[0], 0), " to ")).call(_context5, this._getAriaValueText(currentValue[1], 1)) : undefined;
|
|
583
629
|
const slider = /*#__PURE__*/React.createElement("div", {
|
|
584
630
|
className: wrapperClass,
|
|
585
|
-
style:
|
|
631
|
+
style: style,
|
|
586
632
|
ref: this.sliderEl,
|
|
633
|
+
"aria-label": ariaLabel,
|
|
587
634
|
onMouseEnter: () => this.foundation.handleWrapperEnter(),
|
|
588
635
|
onMouseLeave: () => this.foundation.handleWrapperLeave()
|
|
589
636
|
}, /*#__PURE__*/React.createElement("div", {
|
|
590
637
|
className: "".concat(prefixCls, "-rail"),
|
|
591
638
|
onClick: this.foundation.handleWrapClick,
|
|
592
|
-
style:
|
|
639
|
+
style: railStyle
|
|
593
640
|
}), this.renderTrack(), this.renderStepDot(), /*#__PURE__*/React.createElement("div", null, this.renderHandle()), this.renderLabel(), /*#__PURE__*/React.createElement("div", {
|
|
594
641
|
className: boundaryClass
|
|
595
642
|
}, /*#__PURE__*/React.createElement("span", {
|
|
596
643
|
className: "".concat(prefixCls, "-boundary-min")
|
|
597
|
-
},
|
|
644
|
+
}, min), /*#__PURE__*/React.createElement("span", {
|
|
598
645
|
className: "".concat(prefixCls, "-boundary-max")
|
|
599
|
-
},
|
|
646
|
+
}, max)));
|
|
600
647
|
|
|
601
|
-
if (!
|
|
648
|
+
if (!vertical) {
|
|
602
649
|
return /*#__PURE__*/React.createElement("div", {
|
|
603
650
|
className: sliderCls
|
|
604
651
|
}, slider);
|
|
@@ -651,7 +698,8 @@ Slider.propTypes = {
|
|
|
651
698
|
className: PropTypes.string,
|
|
652
699
|
showBoundary: PropTypes.bool,
|
|
653
700
|
railStyle: PropTypes.object,
|
|
654
|
-
verticalReverse: PropTypes.bool
|
|
701
|
+
verticalReverse: PropTypes.bool,
|
|
702
|
+
getAriaValueText: PropTypes.func
|
|
655
703
|
};
|
|
656
704
|
Slider.defaultProps = {
|
|
657
705
|
// allowClear: false,
|
|
@@ -63,6 +63,11 @@ export interface ResolvedDataItem extends DataItem {
|
|
|
63
63
|
};
|
|
64
64
|
_optionKey?: string | number;
|
|
65
65
|
}
|
|
66
|
+
export interface DraggableResolvedDataItem {
|
|
67
|
+
key?: string | number;
|
|
68
|
+
index?: number;
|
|
69
|
+
item?: ResolvedDataItem;
|
|
70
|
+
}
|
|
66
71
|
export declare type DataSource = Array<DataItem> | Array<GroupItem> | Array<TreeItem>;
|
|
67
72
|
interface HeaderConfig {
|
|
68
73
|
totalContent: string;
|
package/lib/es/transfer/index.js
CHANGED
|
@@ -419,16 +419,8 @@ class Transfer extends BaseComponent {
|
|
|
419
419
|
type,
|
|
420
420
|
showPath
|
|
421
421
|
} = this.props;
|
|
422
|
-
let newItem = item;
|
|
423
422
|
|
|
424
|
-
|
|
425
|
-
newItem = _Object$assign(_Object$assign({}, item), {
|
|
426
|
-
key: item._optionKey
|
|
427
|
-
});
|
|
428
|
-
delete newItem._optionKey;
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
const onRemove = () => this.foundation.handleSelectOrRemove(newItem);
|
|
423
|
+
const onRemove = () => this.foundation.handleSelectOrRemove(item);
|
|
432
424
|
|
|
433
425
|
const rightItemCls = cls({
|
|
434
426
|
["".concat(prefixcls, "-item")]: true,
|
|
@@ -456,7 +448,7 @@ class Transfer extends BaseComponent {
|
|
|
456
448
|
React.createElement("div", {
|
|
457
449
|
role: "listitem",
|
|
458
450
|
className: rightItemCls,
|
|
459
|
-
key:
|
|
451
|
+
key: item.key
|
|
460
452
|
}, draggable ? /*#__PURE__*/React.createElement(DragHandle, null) : null, /*#__PURE__*/React.createElement("div", {
|
|
461
453
|
className: "".concat(prefixcls, "-right-item-text")
|
|
462
454
|
}, label), /*#__PURE__*/React.createElement(IconClose, {
|
|
@@ -483,7 +475,7 @@ class Transfer extends BaseComponent {
|
|
|
483
475
|
|
|
484
476
|
renderRightSortableList(selectedData) {
|
|
485
477
|
// when choose some items && draggable is true
|
|
486
|
-
const SortableItem = SortableElement(
|
|
478
|
+
const SortableItem = SortableElement(props => this.renderRightItem(props.item));
|
|
487
479
|
const SortableList = SortableContainer(_ref => {
|
|
488
480
|
let {
|
|
489
481
|
items
|
|
@@ -494,14 +486,12 @@ class Transfer extends BaseComponent {
|
|
|
494
486
|
"aria-label": "Selected list"
|
|
495
487
|
}, _mapInstanceProperty(items).call(items, (item, index) =>
|
|
496
488
|
/*#__PURE__*/
|
|
497
|
-
// sortableElement will take over the property 'key', so use another '_optionKey' to pass
|
|
498
489
|
// @ts-ignore skip SortableItem type check
|
|
499
|
-
React.createElement(SortableItem,
|
|
490
|
+
React.createElement(SortableItem, {
|
|
500
491
|
key: item.label,
|
|
501
|
-
index: index
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
})))) // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
492
|
+
index: index,
|
|
493
|
+
item: item
|
|
494
|
+
}))) // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
505
495
|
// @ts-ignore see reasons: https://github.com/clauderic/react-sortable-hoc/issues/206
|
|
506
496
|
;
|
|
507
497
|
}, {
|
|
@@ -45,12 +45,18 @@ const wrapperDecorations = (props, content) => {
|
|
|
45
45
|
underline,
|
|
46
46
|
strong,
|
|
47
47
|
link,
|
|
48
|
-
disabled
|
|
48
|
+
disabled,
|
|
49
|
+
icon
|
|
49
50
|
} = props;
|
|
50
51
|
let wrapped = content;
|
|
51
52
|
|
|
52
53
|
const wrap = (isNeeded, tag) => {
|
|
53
|
-
let wrapProps = {
|
|
54
|
+
let wrapProps = icon ? {
|
|
55
|
+
style: {
|
|
56
|
+
display: 'inline-flex',
|
|
57
|
+
alignItems: 'center'
|
|
58
|
+
}
|
|
59
|
+
} : {};
|
|
54
60
|
|
|
55
61
|
if (!isNeeded) {
|
|
56
62
|
return;
|
|
@@ -68,7 +74,13 @@ const wrapperDecorations = (props, content) => {
|
|
|
68
74
|
wrap(underline && !link, 'u');
|
|
69
75
|
wrap(strong, 'strong');
|
|
70
76
|
wrap(props.delete, 'del');
|
|
71
|
-
wrap(link, disabled ? 'span' : 'a');
|
|
77
|
+
wrap(link, disabled ? 'span' : 'a'); // When the content is not wrapped, and there is more than one element in the content (one of which is an icon),
|
|
78
|
+
// use span to wrap the content, so that the content in the span is vertically aligned
|
|
79
|
+
|
|
80
|
+
if (wrapped === content && icon) {
|
|
81
|
+
wrap(true, 'span');
|
|
82
|
+
}
|
|
83
|
+
|
|
72
84
|
return wrapped;
|
|
73
85
|
};
|
|
74
86
|
|
|
@@ -3,11 +3,20 @@ import React, { PureComponent } from 'react';
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { strings } from '@douyinfe/semi-foundation/lib/es/typography/constants';
|
|
5
5
|
import Base from './base';
|
|
6
|
+
import cls from 'classnames';
|
|
7
|
+
import { cssClasses } from '@douyinfe/semi-foundation/lib/es/typography/constants';
|
|
8
|
+
const prefixCls = cssClasses.PREFIX;
|
|
6
9
|
export default class Text extends PureComponent {
|
|
7
10
|
render() {
|
|
11
|
+
const className = cls(this.props.className, {
|
|
12
|
+
["".concat(prefixCls, "-text")]: true,
|
|
13
|
+
["".concat(prefixCls, "-text-icon")]: this.props.icon
|
|
14
|
+
});
|
|
8
15
|
return /*#__PURE__*/React.createElement(Base, _Object$assign({
|
|
9
16
|
component: 'span'
|
|
10
|
-
}, this.props
|
|
17
|
+
}, this.props, {
|
|
18
|
+
className: className
|
|
19
|
+
}));
|
|
11
20
|
}
|
|
12
21
|
|
|
13
22
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.17.0-alpha.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es/index.js",
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@babel/runtime-corejs3": "^7.15.4",
|
|
17
17
|
"@douyinfe/semi-animation": "2.12.0",
|
|
18
|
-
"@douyinfe/semi-animation-react": "2.
|
|
19
|
-
"@douyinfe/semi-foundation": "2.
|
|
20
|
-
"@douyinfe/semi-icons": "2.
|
|
18
|
+
"@douyinfe/semi-animation-react": "2.17.0-alpha.0",
|
|
19
|
+
"@douyinfe/semi-foundation": "2.17.0-alpha.0",
|
|
20
|
+
"@douyinfe/semi-icons": "2.17.0-alpha.0",
|
|
21
21
|
"@douyinfe/semi-illustrations": "2.15.0",
|
|
22
|
-
"@douyinfe/semi-theme-default": "2.
|
|
22
|
+
"@douyinfe/semi-theme-default": "2.17.0-alpha.0",
|
|
23
23
|
"@types/react-window": "^1.8.2",
|
|
24
24
|
"async-validator": "^3.5.0",
|
|
25
25
|
"classnames": "^2.2.6",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"date-fns": "^2.9.0",
|
|
28
28
|
"date-fns-tz": "^1.0.10",
|
|
29
29
|
"lodash": "^4.17.21",
|
|
30
|
+
"prop-types": "^15.7.2",
|
|
30
31
|
"react-resizable": "^1.8.0",
|
|
31
32
|
"react-sortable-hoc": "^2.0.0",
|
|
32
33
|
"react-window": "^1.8.2",
|
|
@@ -35,9 +36,6 @@
|
|
|
35
36
|
"utility-types": "^3.10.0"
|
|
36
37
|
},
|
|
37
38
|
"peerDependencies": {
|
|
38
|
-
"@types/react": ">=16.0.0",
|
|
39
|
-
"@types/react-dom": ">=16.0.0",
|
|
40
|
-
"prop-types": "15.7.2",
|
|
41
39
|
"react": ">=16.0.0",
|
|
42
40
|
"react-dom": ">=16.0.0"
|
|
43
41
|
},
|
|
@@ -69,13 +67,13 @@
|
|
|
69
67
|
],
|
|
70
68
|
"author": "",
|
|
71
69
|
"license": "MIT",
|
|
72
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "e78045febe3e4645c8afe6d42cfbcb4e97a67923",
|
|
73
71
|
"devDependencies": {
|
|
74
72
|
"@babel/plugin-proposal-decorators": "^7.15.8",
|
|
75
73
|
"@babel/plugin-transform-runtime": "^7.15.8",
|
|
76
74
|
"@babel/preset-env": "^7.15.8",
|
|
77
75
|
"@babel/preset-react": "^7.14.5",
|
|
78
|
-
"@douyinfe/semi-scss-compile": "2.
|
|
76
|
+
"@douyinfe/semi-scss-compile": "2.17.0-alpha.0",
|
|
79
77
|
"@storybook/addon-knobs": "^6.3.1",
|
|
80
78
|
"@types/lodash": "^4.14.176",
|
|
81
79
|
"babel-loader": "^8.2.2",
|
|
@@ -113,7 +113,8 @@ export const HorizontalSlider = () => (
|
|
|
113
113
|
<div style={divStyle}>
|
|
114
114
|
<div>marks</div>
|
|
115
115
|
<Slider
|
|
116
|
-
marks={{ 20: '
|
|
116
|
+
marks={{ 20: '20°C', 40: '40°C' }}
|
|
117
|
+
getAriaValueText={(value) => `${value}°C`}
|
|
117
118
|
defaultValue={[0, 100]}
|
|
118
119
|
range={true}
|
|
119
120
|
onChange={value => {
|
|
@@ -124,7 +125,8 @@ export const HorizontalSlider = () => (
|
|
|
124
125
|
<div style={divStyle}>
|
|
125
126
|
<div>inclued</div>
|
|
126
127
|
<Slider
|
|
127
|
-
marks={{ 20: '
|
|
128
|
+
marks={{ 20: '20°C', 40: '40°C' }}
|
|
129
|
+
getAriaValueText={(value) => `${value}°C`}
|
|
128
130
|
included={false}
|
|
129
131
|
defaultValue={[0, 100]}
|
|
130
132
|
range={true}
|