@douyinfe/semi-ui 2.15.2-alpha.0 → 2.17.0-alpha.1
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 +87 -20
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +358 -223
- 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/radio/radio.js +3 -5
- 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/radio/radio.js +3 -5
- 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 +11 -11
- package/radio/_story/radio.stories.js +5 -5
- package/radio/radio.tsx +5 -3
- 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/dist/umd/semi-ui.js
CHANGED
|
@@ -1604,97 +1604,6 @@ function times(n, iteratee) {
|
|
|
1604
1604
|
module.exports = times;
|
|
1605
1605
|
|
|
1606
1606
|
|
|
1607
|
-
/***/ }),
|
|
1608
|
-
|
|
1609
|
-
/***/ "16Al":
|
|
1610
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
1611
|
-
|
|
1612
|
-
"use strict";
|
|
1613
|
-
/**
|
|
1614
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
|
1615
|
-
*
|
|
1616
|
-
* This source code is licensed under the MIT license found in the
|
|
1617
|
-
* LICENSE file in the root directory of this source tree.
|
|
1618
|
-
*/
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
var ReactPropTypesSecret = __webpack_require__("WbBG");
|
|
1623
|
-
|
|
1624
|
-
function emptyFunction() {}
|
|
1625
|
-
function emptyFunctionWithReset() {}
|
|
1626
|
-
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
1627
|
-
|
|
1628
|
-
module.exports = function() {
|
|
1629
|
-
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
1630
|
-
if (secret === ReactPropTypesSecret) {
|
|
1631
|
-
// It is still safe when called from React.
|
|
1632
|
-
return;
|
|
1633
|
-
}
|
|
1634
|
-
var err = new Error(
|
|
1635
|
-
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
|
1636
|
-
'Use PropTypes.checkPropTypes() to call them. ' +
|
|
1637
|
-
'Read more at http://fb.me/use-check-prop-types'
|
|
1638
|
-
);
|
|
1639
|
-
err.name = 'Invariant Violation';
|
|
1640
|
-
throw err;
|
|
1641
|
-
};
|
|
1642
|
-
shim.isRequired = shim;
|
|
1643
|
-
function getShim() {
|
|
1644
|
-
return shim;
|
|
1645
|
-
};
|
|
1646
|
-
// Important!
|
|
1647
|
-
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
|
|
1648
|
-
var ReactPropTypes = {
|
|
1649
|
-
array: shim,
|
|
1650
|
-
bool: shim,
|
|
1651
|
-
func: shim,
|
|
1652
|
-
number: shim,
|
|
1653
|
-
object: shim,
|
|
1654
|
-
string: shim,
|
|
1655
|
-
symbol: shim,
|
|
1656
|
-
|
|
1657
|
-
any: shim,
|
|
1658
|
-
arrayOf: getShim,
|
|
1659
|
-
element: shim,
|
|
1660
|
-
elementType: shim,
|
|
1661
|
-
instanceOf: getShim,
|
|
1662
|
-
node: shim,
|
|
1663
|
-
objectOf: getShim,
|
|
1664
|
-
oneOf: getShim,
|
|
1665
|
-
oneOfType: getShim,
|
|
1666
|
-
shape: getShim,
|
|
1667
|
-
exact: getShim,
|
|
1668
|
-
|
|
1669
|
-
checkPropTypes: emptyFunctionWithReset,
|
|
1670
|
-
resetWarningCache: emptyFunction
|
|
1671
|
-
};
|
|
1672
|
-
|
|
1673
|
-
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
1674
|
-
|
|
1675
|
-
return ReactPropTypes;
|
|
1676
|
-
};
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
/***/ }),
|
|
1680
|
-
|
|
1681
|
-
/***/ "17x9":
|
|
1682
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
1683
|
-
|
|
1684
|
-
/**
|
|
1685
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
|
1686
|
-
*
|
|
1687
|
-
* This source code is licensed under the MIT license found in the
|
|
1688
|
-
* LICENSE file in the root directory of this source tree.
|
|
1689
|
-
*/
|
|
1690
|
-
|
|
1691
|
-
if (false) { var throwOnDirectAccess, ReactIs; } else {
|
|
1692
|
-
// By explicitly using `prop-types` you are opting into new production behavior.
|
|
1693
|
-
// http://fb.me/prop-types-in-prod
|
|
1694
|
-
module.exports = __webpack_require__("16Al")();
|
|
1695
|
-
}
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
1607
|
/***/ }),
|
|
1699
1608
|
|
|
1700
1609
|
/***/ "1EDM":
|
|
@@ -14880,26 +14789,6 @@ module.exports = function (it) {
|
|
|
14880
14789
|
};
|
|
14881
14790
|
|
|
14882
14791
|
|
|
14883
|
-
/***/ }),
|
|
14884
|
-
|
|
14885
|
-
/***/ "WbBG":
|
|
14886
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
14887
|
-
|
|
14888
|
-
"use strict";
|
|
14889
|
-
/**
|
|
14890
|
-
* Copyright (c) 2013-present, Facebook, Inc.
|
|
14891
|
-
*
|
|
14892
|
-
* This source code is licensed under the MIT license found in the
|
|
14893
|
-
* LICENSE file in the root directory of this source tree.
|
|
14894
|
-
*/
|
|
14895
|
-
|
|
14896
|
-
|
|
14897
|
-
|
|
14898
|
-
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
14899
|
-
|
|
14900
|
-
module.exports = ReactPropTypesSecret;
|
|
14901
|
-
|
|
14902
|
-
|
|
14903
14792
|
/***/ }),
|
|
14904
14793
|
|
|
14905
14794
|
/***/ "WbkG":
|
|
@@ -25128,8 +25017,8 @@ var external_root_React_commonjs2_react_commonjs_react_amd_react_default = /*#__
|
|
|
25128
25017
|
var classnames = __webpack_require__("O94r");
|
|
25129
25018
|
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
|
|
25130
25019
|
|
|
25131
|
-
// EXTERNAL MODULE:
|
|
25132
|
-
var prop_types = __webpack_require__("
|
|
25020
|
+
// EXTERNAL MODULE: /Users/bytedance/code/semi-design/node_modules/prop-types/index.js
|
|
25021
|
+
var prop_types = __webpack_require__("aWzz");
|
|
25133
25022
|
var prop_types_default = /*#__PURE__*/__webpack_require__.n(prop_types);
|
|
25134
25023
|
|
|
25135
25024
|
// CONCATENATED MODULE: ../semi-foundation/base/env.ts
|
|
@@ -33480,12 +33369,18 @@ const wrapperDecorations = (props, content) => {
|
|
|
33480
33369
|
underline,
|
|
33481
33370
|
strong,
|
|
33482
33371
|
link,
|
|
33483
|
-
disabled
|
|
33372
|
+
disabled,
|
|
33373
|
+
icon
|
|
33484
33374
|
} = props;
|
|
33485
33375
|
let wrapped = content;
|
|
33486
33376
|
|
|
33487
33377
|
const wrap = (isNeeded, tag) => {
|
|
33488
|
-
let wrapProps = {
|
|
33378
|
+
let wrapProps = icon ? {
|
|
33379
|
+
style: {
|
|
33380
|
+
display: 'inline-flex',
|
|
33381
|
+
alignItems: 'center'
|
|
33382
|
+
}
|
|
33383
|
+
} : {};
|
|
33489
33384
|
|
|
33490
33385
|
if (!isNeeded) {
|
|
33491
33386
|
return;
|
|
@@ -33503,7 +33398,13 @@ const wrapperDecorations = (props, content) => {
|
|
|
33503
33398
|
wrap(underline && !link, 'u');
|
|
33504
33399
|
wrap(strong, 'strong');
|
|
33505
33400
|
wrap(props.delete, 'del');
|
|
33506
|
-
wrap(link, disabled ? 'span' : 'a');
|
|
33401
|
+
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),
|
|
33402
|
+
// use span to wrap the content, so that the content in the span is vertically aligned
|
|
33403
|
+
|
|
33404
|
+
if (wrapped === content && icon) {
|
|
33405
|
+
wrap(true, 'span');
|
|
33406
|
+
}
|
|
33407
|
+
|
|
33507
33408
|
return wrapped;
|
|
33508
33409
|
};
|
|
33509
33410
|
|
|
@@ -34135,11 +34036,20 @@ base_Base.defaultProps = {
|
|
|
34135
34036
|
|
|
34136
34037
|
|
|
34137
34038
|
|
|
34039
|
+
|
|
34040
|
+
|
|
34041
|
+
const text_prefixCls = constants_cssClasses.PREFIX;
|
|
34138
34042
|
class text_Text extends external_root_React_commonjs2_react_commonjs_react_amd_react_["PureComponent"] {
|
|
34139
34043
|
render() {
|
|
34044
|
+
const className = classnames_default()(this.props.className, {
|
|
34045
|
+
["".concat(text_prefixCls, "-text")]: true,
|
|
34046
|
+
["".concat(text_prefixCls, "-text-icon")]: this.props.icon
|
|
34047
|
+
});
|
|
34140
34048
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(base_Base, assign_default()({
|
|
34141
34049
|
component: 'span'
|
|
34142
|
-
}, this.props
|
|
34050
|
+
}, this.props, {
|
|
34051
|
+
className: className
|
|
34052
|
+
}));
|
|
34143
34053
|
}
|
|
34144
34054
|
|
|
34145
34055
|
}
|
|
@@ -38889,6 +38799,9 @@ class iconButton_IconButton extends external_root_React_commonjs2_react_commonjs
|
|
|
38889
38799
|
} else if (noHorizontalPadding === true) {
|
|
38890
38800
|
style.paddingLeft = 0;
|
|
38891
38801
|
style.paddingRight = 0;
|
|
38802
|
+
} else if (typeof noHorizontalPadding === 'string') {
|
|
38803
|
+
noHorizontalPadding === 'left' && (style.paddingLeft = 0);
|
|
38804
|
+
noHorizontalPadding === 'right' && (style.paddingRight = 0);
|
|
38892
38805
|
}
|
|
38893
38806
|
|
|
38894
38807
|
let finalChildren = null;
|
|
@@ -40088,9 +40001,10 @@ buttonGroup_ButtonGroup.propTypes = {
|
|
|
40088
40001
|
'aria-label': prop_types_default.a.string
|
|
40089
40002
|
};
|
|
40090
40003
|
buttonGroup_ButtonGroup.defaultProps = {
|
|
40091
|
-
|
|
40092
|
-
type
|
|
40093
|
-
theme
|
|
40004
|
+
// There are default values for type and theme in Button.
|
|
40005
|
+
// In order to allow users to individually customize the type and theme of the Button through the parameters of the Button in the ButtonGroup,
|
|
40006
|
+
// the default value of type and theme is not given in the ButtonGroup。
|
|
40007
|
+
size: 'default'
|
|
40094
40008
|
};
|
|
40095
40009
|
// EXTERNAL MODULE: /Users/bytedance/code/semi-design/node_modules/@babel/runtime-corejs3/core-js-stable/instance/keys.js
|
|
40096
40010
|
var instance_keys = __webpack_require__("BoX2");
|
|
@@ -52588,7 +52502,8 @@ class cascader_Cascader extends baseComponent_BaseComponent {
|
|
|
52588
52502
|
autoAdjustOverflow,
|
|
52589
52503
|
stopPropagation,
|
|
52590
52504
|
mouseLeaveDelay,
|
|
52591
|
-
mouseEnterDelay
|
|
52505
|
+
mouseEnterDelay,
|
|
52506
|
+
position
|
|
52592
52507
|
} = this.props;
|
|
52593
52508
|
const {
|
|
52594
52509
|
isOpen,
|
|
@@ -52599,7 +52514,7 @@ class cascader_Cascader extends baseComponent_BaseComponent {
|
|
|
52599
52514
|
} = this.context;
|
|
52600
52515
|
const content = this.renderContent();
|
|
52601
52516
|
const selection = this.renderSelection();
|
|
52602
|
-
const pos = direction === 'rtl' ? 'bottomRight' : 'bottomLeft';
|
|
52517
|
+
const pos = position !== null && position !== void 0 ? position : direction === 'rtl' ? 'bottomRight' : 'bottomLeft';
|
|
52603
52518
|
const mergedMotion = this.foundation.getMergedMotion();
|
|
52604
52519
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(popover_0, {
|
|
52605
52520
|
getPopupContainer: getPopupContainer,
|
|
@@ -52693,7 +52608,8 @@ cascader_Cascader.propTypes = {
|
|
|
52693
52608
|
disableStrictly: prop_types_default.a.bool,
|
|
52694
52609
|
leafOnly: prop_types_default.a.bool,
|
|
52695
52610
|
enableLeafClick: prop_types_default.a.bool,
|
|
52696
|
-
preventScroll: prop_types_default.a.bool
|
|
52611
|
+
preventScroll: prop_types_default.a.bool,
|
|
52612
|
+
position: prop_types_default.a.string
|
|
52697
52613
|
};
|
|
52698
52614
|
cascader_Cascader.defaultProps = {
|
|
52699
52615
|
leafOnly: false,
|
|
@@ -83235,11 +83151,9 @@ class radio_Radio extends baseComponent_BaseComponent {
|
|
|
83235
83151
|
focusInner: focusVisible && !focusOuter,
|
|
83236
83152
|
onInputFocus: this.handleFocusVisible,
|
|
83237
83153
|
onInputBlur: this.handleBlur
|
|
83238
|
-
})), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
83239
|
-
className:
|
|
83240
|
-
|
|
83241
|
-
}])
|
|
83242
|
-
}, renderContent()));
|
|
83154
|
+
})), isCardRadioGroup ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
83155
|
+
className: "".concat(prefix, "-isCardRadioGroup_content")
|
|
83156
|
+
}, renderContent()) : renderContent());
|
|
83243
83157
|
}
|
|
83244
83158
|
|
|
83245
83159
|
}
|
|
@@ -85103,6 +85017,7 @@ const touchEventPolyfill = (touch, touchEvent) => {
|
|
|
85103
85017
|
|
|
85104
85018
|
|
|
85105
85019
|
|
|
85020
|
+
|
|
85106
85021
|
/* eslint-disable no-param-reassign */
|
|
85107
85022
|
|
|
85108
85023
|
/* eslint-disable max-len */
|
|
@@ -85110,6 +85025,8 @@ const touchEventPolyfill = (touch, touchEvent) => {
|
|
|
85110
85025
|
/* eslint-disable no-nested-ternary */
|
|
85111
85026
|
|
|
85112
85027
|
|
|
85028
|
+
|
|
85029
|
+
|
|
85113
85030
|
class foundation_SliderFoundation extends foundation {
|
|
85114
85031
|
constructor(adapter) {
|
|
85115
85032
|
var _this;
|
|
@@ -85634,8 +85551,7 @@ class foundation_SliderFoundation extends foundation {
|
|
|
85634
85551
|
const handleMaxDom = this._adapter.getMaxHandleEl().current;
|
|
85635
85552
|
|
|
85636
85553
|
if (e.target === handleMinDom || e.target === handleMaxDom) {
|
|
85637
|
-
e
|
|
85638
|
-
e.stopPropagation();
|
|
85554
|
+
handlePrevent(e);
|
|
85639
85555
|
const touch = touchPolyfill(e.touches[0], e);
|
|
85640
85556
|
this.onHandleDown(touch, handler);
|
|
85641
85557
|
}
|
|
@@ -85699,18 +85615,203 @@ class foundation_SliderFoundation extends foundation {
|
|
|
85699
85615
|
this._adapter.setDragging([dragging[0], false]);
|
|
85700
85616
|
}
|
|
85701
85617
|
|
|
85702
|
-
this._adapter.setStateVal('isDrag', false);
|
|
85703
|
-
|
|
85618
|
+
this._adapter.setStateVal('isDrag', false);
|
|
85704
85619
|
|
|
85705
85620
|
this._adapter.onHandleLeave();
|
|
85706
85621
|
|
|
85707
85622
|
this._adapter.onHandleUpAfter();
|
|
85708
85623
|
|
|
85709
85624
|
return true;
|
|
85625
|
+
};
|
|
85626
|
+
|
|
85627
|
+
this._handleValueDecreaseWithKeyBoard = (step, handler) => {
|
|
85628
|
+
const {
|
|
85629
|
+
min,
|
|
85630
|
+
currentValue
|
|
85631
|
+
} = this.getStates();
|
|
85632
|
+
const {
|
|
85633
|
+
range
|
|
85634
|
+
} = this.getProps();
|
|
85635
|
+
|
|
85636
|
+
if (handler === 'min') {
|
|
85637
|
+
if (range) {
|
|
85638
|
+
let newMinValue = currentValue[0] - step;
|
|
85639
|
+
newMinValue = newMinValue < min ? min : newMinValue;
|
|
85640
|
+
return [newMinValue, currentValue[1]];
|
|
85641
|
+
} else {
|
|
85642
|
+
let newMinValue = currentValue - step;
|
|
85643
|
+
newMinValue = newMinValue < min ? min : newMinValue;
|
|
85644
|
+
return newMinValue;
|
|
85645
|
+
}
|
|
85646
|
+
} else {
|
|
85647
|
+
let newMaxValue = currentValue[1] - step;
|
|
85648
|
+
newMaxValue = newMaxValue < currentValue[0] ? currentValue[0] : newMaxValue;
|
|
85649
|
+
return [currentValue[0], newMaxValue];
|
|
85650
|
+
}
|
|
85651
|
+
};
|
|
85652
|
+
|
|
85653
|
+
this._handleValueIncreaseWithKeyBoard = (step, handler) => {
|
|
85654
|
+
const {
|
|
85655
|
+
max,
|
|
85656
|
+
currentValue
|
|
85657
|
+
} = this.getStates();
|
|
85658
|
+
const {
|
|
85659
|
+
range
|
|
85660
|
+
} = this.getProps();
|
|
85661
|
+
|
|
85662
|
+
if (handler === 'min') {
|
|
85663
|
+
if (range) {
|
|
85664
|
+
let newMinValue = currentValue[0] + step;
|
|
85665
|
+
newMinValue = newMinValue > currentValue[1] ? currentValue[1] : newMinValue;
|
|
85666
|
+
return [newMinValue, currentValue[1]];
|
|
85667
|
+
} else {
|
|
85668
|
+
let newMinValue = currentValue + step;
|
|
85669
|
+
newMinValue = newMinValue > max ? max : newMinValue;
|
|
85670
|
+
return newMinValue;
|
|
85671
|
+
}
|
|
85672
|
+
} else {
|
|
85673
|
+
let newMaxValue = currentValue[1] + step;
|
|
85674
|
+
newMaxValue = newMaxValue > max ? max : newMaxValue;
|
|
85675
|
+
return [currentValue[0], newMaxValue];
|
|
85676
|
+
}
|
|
85677
|
+
};
|
|
85678
|
+
|
|
85679
|
+
this._handleHomeKey = handler => {
|
|
85680
|
+
const {
|
|
85681
|
+
min,
|
|
85682
|
+
currentValue
|
|
85683
|
+
} = this.getStates();
|
|
85684
|
+
const {
|
|
85685
|
+
range
|
|
85686
|
+
} = this.getProps();
|
|
85687
|
+
|
|
85688
|
+
if (handler === 'min') {
|
|
85689
|
+
if (range) {
|
|
85690
|
+
return [min, currentValue[1]];
|
|
85691
|
+
} else {
|
|
85692
|
+
return min;
|
|
85693
|
+
}
|
|
85694
|
+
} else {
|
|
85695
|
+
return [currentValue[0], currentValue[0]];
|
|
85696
|
+
}
|
|
85697
|
+
};
|
|
85698
|
+
|
|
85699
|
+
this._handleEndKey = handler => {
|
|
85700
|
+
const {
|
|
85701
|
+
max,
|
|
85702
|
+
currentValue
|
|
85703
|
+
} = this.getStates();
|
|
85704
|
+
const {
|
|
85705
|
+
range
|
|
85706
|
+
} = this.getProps();
|
|
85707
|
+
|
|
85708
|
+
if (handler === 'min') {
|
|
85709
|
+
if (range) {
|
|
85710
|
+
return [currentValue[1], currentValue[1]];
|
|
85711
|
+
} else {
|
|
85712
|
+
return max;
|
|
85713
|
+
}
|
|
85714
|
+
} else {
|
|
85715
|
+
return [currentValue[0], max];
|
|
85716
|
+
}
|
|
85717
|
+
};
|
|
85718
|
+
|
|
85719
|
+
this.handleKeyDown = (event, handler) => {
|
|
85720
|
+
var _context;
|
|
85721
|
+
|
|
85722
|
+
const {
|
|
85723
|
+
min,
|
|
85724
|
+
max,
|
|
85725
|
+
currentValue
|
|
85726
|
+
} = this.getStates();
|
|
85727
|
+
const {
|
|
85728
|
+
step,
|
|
85729
|
+
range
|
|
85730
|
+
} = this.getProps();
|
|
85731
|
+
let outputValue;
|
|
85732
|
+
|
|
85733
|
+
switch (event.key) {
|
|
85734
|
+
case "ArrowLeft":
|
|
85735
|
+
case "ArrowDown":
|
|
85736
|
+
outputValue = this._handleValueDecreaseWithKeyBoard(step, handler);
|
|
85737
|
+
break;
|
|
85738
|
+
|
|
85739
|
+
case "ArrowRight":
|
|
85740
|
+
case "ArrowUp":
|
|
85741
|
+
outputValue = this._handleValueIncreaseWithKeyBoard(step, handler);
|
|
85742
|
+
break;
|
|
85743
|
+
|
|
85744
|
+
case "PageUp":
|
|
85745
|
+
outputValue = this._handleValueIncreaseWithKeyBoard(10 * step, handler);
|
|
85746
|
+
break;
|
|
85747
|
+
|
|
85748
|
+
case "PageDown":
|
|
85749
|
+
outputValue = this._handleValueDecreaseWithKeyBoard(10 * step, handler);
|
|
85750
|
+
break;
|
|
85751
|
+
|
|
85752
|
+
case "Home":
|
|
85753
|
+
outputValue = this._handleHomeKey(handler);
|
|
85754
|
+
break;
|
|
85755
|
+
|
|
85756
|
+
case "End":
|
|
85757
|
+
outputValue = this._handleEndKey(handler);
|
|
85758
|
+
break;
|
|
85759
|
+
|
|
85760
|
+
case 'default':
|
|
85761
|
+
break;
|
|
85762
|
+
}
|
|
85763
|
+
|
|
85764
|
+
if (includes_default()(_context = ["ArrowLeft", "ArrowDown", "ArrowRight", "ArrowUp", "PageUp", "PageDown", "Home", "End"]).call(_context, event.key)) {
|
|
85765
|
+
let update = true;
|
|
85766
|
+
|
|
85767
|
+
if (is_array_default()(currentValue)) {
|
|
85768
|
+
update = !(currentValue[0] === outputValue[0] && currentValue[1] === outputValue[1]);
|
|
85769
|
+
} else {
|
|
85770
|
+
update = currentValue !== outputValue;
|
|
85771
|
+
}
|
|
85772
|
+
|
|
85773
|
+
if (update) {
|
|
85774
|
+
this._adapter.updateCurrentValue(outputValue);
|
|
85775
|
+
|
|
85776
|
+
this._adapter.notifyChange(outputValue);
|
|
85777
|
+
}
|
|
85778
|
+
|
|
85779
|
+
handlePrevent(event);
|
|
85780
|
+
}
|
|
85710
85781
|
}; // eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
85711
85782
|
|
|
85712
85783
|
|
|
85713
|
-
this.onFocus = (e, handler) => {
|
|
85784
|
+
this.onFocus = (e, handler) => {
|
|
85785
|
+
handlePrevent(e);
|
|
85786
|
+
const {
|
|
85787
|
+
target
|
|
85788
|
+
} = e;
|
|
85789
|
+
|
|
85790
|
+
try {
|
|
85791
|
+
if (target.matches(':focus-visible')) {
|
|
85792
|
+
if (handler === 'min') {
|
|
85793
|
+
this._adapter.setStateVal('firstDotFocusVisible', true);
|
|
85794
|
+
} else {
|
|
85795
|
+
this._adapter.setStateVal('secondDotFocusVisible', true);
|
|
85796
|
+
}
|
|
85797
|
+
}
|
|
85798
|
+
} catch (error) {
|
|
85799
|
+
Object(warning["a" /* default */])(true, 'Warning: [Semi Slider] The current browser does not support the focus-visible');
|
|
85800
|
+
}
|
|
85801
|
+
};
|
|
85802
|
+
|
|
85803
|
+
this.onBlur = (e, handler) => {
|
|
85804
|
+
const {
|
|
85805
|
+
firstDotFocusVisible,
|
|
85806
|
+
secondDotFocusVisible
|
|
85807
|
+
} = this.getStates();
|
|
85808
|
+
|
|
85809
|
+
if (handler === 'min') {
|
|
85810
|
+
firstDotFocusVisible && this._adapter.setStateVal('firstDotFocusVisible', false);
|
|
85811
|
+
} else {
|
|
85812
|
+
secondDotFocusVisible && this._adapter.setStateVal('secondDotFocusVisible', false);
|
|
85813
|
+
}
|
|
85814
|
+
};
|
|
85714
85815
|
|
|
85715
85816
|
this.handleWrapClick = e => {
|
|
85716
85817
|
const {
|
|
@@ -85903,7 +86004,9 @@ class slider_Slider extends baseComponent_BaseComponent {
|
|
|
85903
86004
|
const {
|
|
85904
86005
|
chooseMovePos,
|
|
85905
86006
|
isDrag,
|
|
85906
|
-
isInRenderTree
|
|
86007
|
+
isInRenderTree,
|
|
86008
|
+
firstDotFocusVisible,
|
|
86009
|
+
secondDotFocusVisible
|
|
85907
86010
|
} = this.state;
|
|
85908
86011
|
const stylePos = vertical ? 'top' : 'left';
|
|
85909
86012
|
const percentInfo = this.foundation.getMinAndMaxPercent(this.state.currentValue);
|
|
@@ -85929,7 +86032,7 @@ class slider_Slider extends baseComponent_BaseComponent {
|
|
|
85929
86032
|
currentValue
|
|
85930
86033
|
} = this.state;
|
|
85931
86034
|
const commonAria = {
|
|
85932
|
-
'aria-label': ariaLabel,
|
|
86035
|
+
'aria-label': ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : disabled ? 'Disabled Slider' : undefined,
|
|
85933
86036
|
'aria-labelledby': ariaLabelledby,
|
|
85934
86037
|
'aria-disabled': disabled
|
|
85935
86038
|
};
|
|
@@ -85941,7 +86044,7 @@ class slider_Slider extends baseComponent_BaseComponent {
|
|
|
85941
86044
|
position: "top",
|
|
85942
86045
|
trigger: "custom",
|
|
85943
86046
|
rePosKey: minPercent,
|
|
85944
|
-
visible: isInRenderTree && tipVisible.min,
|
|
86047
|
+
visible: isInRenderTree && (tipVisible.min || firstDotFocusVisible),
|
|
85945
86048
|
className: "".concat(slider_constants_cssClasses.HANDLE, "-tooltip")
|
|
85946
86049
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", assign_default()({
|
|
85947
86050
|
onMouseOver: this.foundation.checkAndUpdateIsInRenderTreeState,
|
|
@@ -85973,20 +86076,28 @@ class slider_Slider extends baseComponent_BaseComponent {
|
|
|
85973
86076
|
onTouchEnd: e => {
|
|
85974
86077
|
this.foundation.onHandleUp(e);
|
|
85975
86078
|
},
|
|
85976
|
-
|
|
86079
|
+
onKeyDown: e => {
|
|
86080
|
+
this.foundation.handleKeyDown(e, 'min');
|
|
86081
|
+
},
|
|
86082
|
+
onFocus: e => {
|
|
86083
|
+
this.foundation.onFocus(e, 'min');
|
|
86084
|
+
},
|
|
86085
|
+
onBlur: e => {
|
|
86086
|
+
this.foundation.onBlur(e, 'min');
|
|
86087
|
+
},
|
|
85977
86088
|
role: "slider",
|
|
85978
|
-
|
|
86089
|
+
"aria-valuetext": getAriaValueText ? getAriaValueText(currentValue, 0) : ariaValueText,
|
|
86090
|
+
tabIndex: disabled ? -1 : 0
|
|
85979
86091
|
}, commonAria, {
|
|
85980
86092
|
"aria-valuenow": currentValue,
|
|
85981
86093
|
"aria-valuemax": max,
|
|
85982
|
-
"aria-valuemin": min
|
|
85983
|
-
"aria-valuetext": getAriaValueText ? getAriaValueText(currentValue) : ariaValueText
|
|
86094
|
+
"aria-valuemin": min
|
|
85984
86095
|
}))) : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.Fragment, null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(tooltip_Tooltip, {
|
|
85985
86096
|
content: tipChildren.min,
|
|
85986
86097
|
position: "top",
|
|
85987
86098
|
trigger: "custom",
|
|
85988
86099
|
rePosKey: minPercent,
|
|
85989
|
-
visible: isInRenderTree && tipVisible.min,
|
|
86100
|
+
visible: isInRenderTree && (tipVisible.min || firstDotFocusVisible),
|
|
85990
86101
|
className: "".concat(slider_constants_cssClasses.HANDLE, "-tooltip")
|
|
85991
86102
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", assign_default()({
|
|
85992
86103
|
ref: this.minHanleEl,
|
|
@@ -86017,12 +86128,20 @@ class slider_Slider extends baseComponent_BaseComponent {
|
|
|
86017
86128
|
onTouchEnd: e => {
|
|
86018
86129
|
this.foundation.onHandleUp(e);
|
|
86019
86130
|
},
|
|
86020
|
-
|
|
86131
|
+
onKeyDown: e => {
|
|
86132
|
+
this.foundation.handleKeyDown(e, 'min');
|
|
86133
|
+
},
|
|
86134
|
+
onFocus: e => {
|
|
86135
|
+
this.foundation.onFocus(e, 'min');
|
|
86136
|
+
},
|
|
86137
|
+
onBlur: e => {
|
|
86138
|
+
this.foundation.onBlur(e, 'min');
|
|
86139
|
+
},
|
|
86021
86140
|
role: "slider",
|
|
86022
|
-
tabIndex: 0
|
|
86141
|
+
tabIndex: disabled ? -1 : 0
|
|
86023
86142
|
}, commonAria, {
|
|
86143
|
+
"aria-valuetext": getAriaValueText ? getAriaValueText(currentValue[0], 0) : ariaValueText,
|
|
86024
86144
|
"aria-valuenow": currentValue[0],
|
|
86025
|
-
"aria-valuetext": getAriaValueText ? getAriaValueText(currentValue[0]) : ariaValueText,
|
|
86026
86145
|
"aria-valuemax": currentValue[1],
|
|
86027
86146
|
"aria-valuemin": min
|
|
86028
86147
|
}))), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(tooltip_Tooltip, {
|
|
@@ -86030,7 +86149,7 @@ class slider_Slider extends baseComponent_BaseComponent {
|
|
|
86030
86149
|
position: "top",
|
|
86031
86150
|
trigger: "custom",
|
|
86032
86151
|
rePosKey: maxPercent,
|
|
86033
|
-
visible: isInRenderTree && tipVisible.max,
|
|
86152
|
+
visible: isInRenderTree && (tipVisible.max || secondDotFocusVisible),
|
|
86034
86153
|
className: "".concat(slider_constants_cssClasses.HANDLE, "-tooltip")
|
|
86035
86154
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", assign_default()({
|
|
86036
86155
|
ref: this.maxHanleEl,
|
|
@@ -86061,12 +86180,20 @@ class slider_Slider extends baseComponent_BaseComponent {
|
|
|
86061
86180
|
onTouchEnd: e => {
|
|
86062
86181
|
this.foundation.onHandleUp(e);
|
|
86063
86182
|
},
|
|
86064
|
-
|
|
86183
|
+
onKeyDown: e => {
|
|
86184
|
+
this.foundation.handleKeyDown(e, 'max');
|
|
86185
|
+
},
|
|
86186
|
+
onFocus: e => {
|
|
86187
|
+
this.foundation.onFocus(e, 'max');
|
|
86188
|
+
},
|
|
86189
|
+
onBlur: e => {
|
|
86190
|
+
this.foundation.onBlur(e, 'max');
|
|
86191
|
+
},
|
|
86065
86192
|
role: "slider",
|
|
86066
|
-
tabIndex: 0
|
|
86193
|
+
tabIndex: disabled ? -1 : 0
|
|
86067
86194
|
}, commonAria, {
|
|
86195
|
+
"aria-valuetext": getAriaValueText ? getAriaValueText(currentValue[1], 1) : ariaValueText,
|
|
86068
86196
|
"aria-valuenow": currentValue[1],
|
|
86069
|
-
"aria-valuetext": getAriaValueText ? getAriaValueText(currentValue[1]) : ariaValueText,
|
|
86070
86197
|
"aria-valuemax": max,
|
|
86071
86198
|
"aria-valuemin": currentValue[0]
|
|
86072
86199
|
}))));
|
|
@@ -86167,6 +86294,13 @@ class slider_Slider extends baseComponent_BaseComponent {
|
|
|
86167
86294
|
return labelContent;
|
|
86168
86295
|
};
|
|
86169
86296
|
|
|
86297
|
+
this._getAriaValueText = (value, index) => {
|
|
86298
|
+
const {
|
|
86299
|
+
getAriaValueText
|
|
86300
|
+
} = this.props;
|
|
86301
|
+
return getAriaValueText ? getAriaValueText(value, index) : value;
|
|
86302
|
+
};
|
|
86303
|
+
|
|
86170
86304
|
let {
|
|
86171
86305
|
value
|
|
86172
86306
|
} = this.props;
|
|
@@ -86187,14 +86321,14 @@ class slider_Slider extends baseComponent_BaseComponent {
|
|
|
86187
86321
|
isDrag: false,
|
|
86188
86322
|
clickValue: 0,
|
|
86189
86323
|
showBoundary: false,
|
|
86190
|
-
isInRenderTree: true
|
|
86324
|
+
isInRenderTree: true,
|
|
86325
|
+
firstDotFocusVisible: false,
|
|
86326
|
+
secondDotFocusVisible: false
|
|
86191
86327
|
};
|
|
86192
86328
|
this.sliderEl = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createRef();
|
|
86193
86329
|
this.minHanleEl = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createRef();
|
|
86194
86330
|
this.maxHanleEl = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createRef();
|
|
86195
|
-
this.dragging = [false, false];
|
|
86196
|
-
// this.isDrag = false;
|
|
86197
|
-
|
|
86331
|
+
this.dragging = [false, false];
|
|
86198
86332
|
this.foundation = new foundation_SliderFoundation(this.adapter);
|
|
86199
86333
|
this.eventListenerSet = new set_default.a();
|
|
86200
86334
|
}
|
|
@@ -86261,8 +86395,7 @@ class slider_Slider extends baseComponent_BaseComponent {
|
|
|
86261
86395
|
return flag;
|
|
86262
86396
|
},
|
|
86263
86397
|
getOverallVars: () => ({
|
|
86264
|
-
dragging: this.dragging
|
|
86265
|
-
chooseMovePos: this.chooseMovePos
|
|
86398
|
+
dragging: this.dragging
|
|
86266
86399
|
}),
|
|
86267
86400
|
updateDisabled: disabled => {
|
|
86268
86401
|
this.setState({
|
|
@@ -86296,9 +86429,6 @@ class slider_Slider extends baseComponent_BaseComponent {
|
|
|
86296
86429
|
getMinHandleEl: () => this.minHanleEl,
|
|
86297
86430
|
getMaxHandleEl: () => this.maxHanleEl,
|
|
86298
86431
|
onHandleDown: e => {
|
|
86299
|
-
e.stopPropagation();
|
|
86300
|
-
e.preventDefault();
|
|
86301
|
-
|
|
86302
86432
|
this._addEventListener(document.body, 'mousemove', this.foundation.onHandleMove, false);
|
|
86303
86433
|
|
|
86304
86434
|
this._addEventListener(document.body, 'mouseup', this.foundation.onHandleUp, false);
|
|
@@ -86421,37 +86551,55 @@ class slider_Slider extends baseComponent_BaseComponent {
|
|
|
86421
86551
|
}
|
|
86422
86552
|
|
|
86423
86553
|
render() {
|
|
86554
|
+
var _context5;
|
|
86555
|
+
|
|
86556
|
+
const {
|
|
86557
|
+
disabled,
|
|
86558
|
+
currentValue,
|
|
86559
|
+
min,
|
|
86560
|
+
max
|
|
86561
|
+
} = this.state;
|
|
86562
|
+
const {
|
|
86563
|
+
vertical,
|
|
86564
|
+
verticalReverse,
|
|
86565
|
+
style,
|
|
86566
|
+
railStyle,
|
|
86567
|
+
range,
|
|
86568
|
+
className
|
|
86569
|
+
} = this.props;
|
|
86424
86570
|
const wrapperClass = classnames_default()("".concat(slider_prefixCls, "-wrapper"), {
|
|
86425
|
-
["".concat(slider_prefixCls, "-disabled")]:
|
|
86426
|
-
["".concat(slider_constants_cssClasses.VERTICAL, "-wrapper")]:
|
|
86427
|
-
["".concat(slider_prefixCls, "-reverse")]:
|
|
86428
|
-
},
|
|
86571
|
+
["".concat(slider_prefixCls, "-disabled")]: disabled,
|
|
86572
|
+
["".concat(slider_constants_cssClasses.VERTICAL, "-wrapper")]: vertical,
|
|
86573
|
+
["".concat(slider_prefixCls, "-reverse")]: vertical && verticalReverse
|
|
86574
|
+
}, className);
|
|
86429
86575
|
const boundaryClass = classnames_default()("".concat(slider_prefixCls, "-boundary"), {
|
|
86430
86576
|
["".concat(slider_prefixCls, "-boundary-show")]: this.props.showBoundary && this.state.showBoundary
|
|
86431
86577
|
});
|
|
86432
86578
|
const sliderCls = classnames_default()({
|
|
86433
|
-
["".concat(slider_prefixCls)]: !
|
|
86434
|
-
[slider_constants_cssClasses.VERTICAL]:
|
|
86579
|
+
["".concat(slider_prefixCls)]: !vertical,
|
|
86580
|
+
[slider_constants_cssClasses.VERTICAL]: vertical
|
|
86435
86581
|
});
|
|
86582
|
+
const ariaLabel = range ? concat_default()(_context5 = "Range: ".concat(this._getAriaValueText(currentValue[0], 0), " to ")).call(_context5, this._getAriaValueText(currentValue[1], 1)) : undefined;
|
|
86436
86583
|
const slider = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
86437
86584
|
className: wrapperClass,
|
|
86438
|
-
style:
|
|
86585
|
+
style: style,
|
|
86439
86586
|
ref: this.sliderEl,
|
|
86587
|
+
"aria-label": ariaLabel,
|
|
86440
86588
|
onMouseEnter: () => this.foundation.handleWrapperEnter(),
|
|
86441
86589
|
onMouseLeave: () => this.foundation.handleWrapperLeave()
|
|
86442
86590
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
86443
86591
|
className: "".concat(slider_prefixCls, "-rail"),
|
|
86444
86592
|
onClick: this.foundation.handleWrapClick,
|
|
86445
|
-
style:
|
|
86593
|
+
style: railStyle
|
|
86446
86594
|
}), this.renderTrack(), this.renderStepDot(), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", null, this.renderHandle()), this.renderLabel(), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
86447
86595
|
className: boundaryClass
|
|
86448
86596
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", {
|
|
86449
86597
|
className: "".concat(slider_prefixCls, "-boundary-min")
|
|
86450
|
-
},
|
|
86598
|
+
}, min), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", {
|
|
86451
86599
|
className: "".concat(slider_prefixCls, "-boundary-max")
|
|
86452
|
-
},
|
|
86600
|
+
}, max)));
|
|
86453
86601
|
|
|
86454
|
-
if (!
|
|
86602
|
+
if (!vertical) {
|
|
86455
86603
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
86456
86604
|
className: sliderCls
|
|
86457
86605
|
}, slider);
|
|
@@ -86504,7 +86652,8 @@ slider_Slider.propTypes = {
|
|
|
86504
86652
|
className: prop_types_default.a.string,
|
|
86505
86653
|
showBoundary: prop_types_default.a.bool,
|
|
86506
86654
|
railStyle: prop_types_default.a.object,
|
|
86507
|
-
verticalReverse: prop_types_default.a.bool
|
|
86655
|
+
verticalReverse: prop_types_default.a.bool,
|
|
86656
|
+
getAriaValueText: prop_types_default.a.func
|
|
86508
86657
|
};
|
|
86509
86658
|
slider_Slider.defaultProps = {
|
|
86510
86659
|
// allowClear: false,
|
|
@@ -106033,10 +106182,6 @@ function _nonIterableSpread() {
|
|
|
106033
106182
|
function _toConsumableArray(arr) {
|
|
106034
106183
|
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
106035
106184
|
}
|
|
106036
|
-
// EXTERNAL MODULE: /Users/bytedance/code/semi-design/node_modules/prop-types/index.js
|
|
106037
|
-
var semi_design_node_modules_prop_types = __webpack_require__("aWzz");
|
|
106038
|
-
var semi_design_node_modules_prop_types_default = /*#__PURE__*/__webpack_require__.n(semi_design_node_modules_prop_types);
|
|
106039
|
-
|
|
106040
106185
|
// CONCATENATED MODULE: /Users/bytedance/code/semi-design/node_modules/react-sortable-hoc/dist/react-sortable-hoc.esm.js
|
|
106041
106186
|
|
|
106042
106187
|
|
|
@@ -106554,37 +106699,37 @@ function defaultShouldCancelStart(event) {
|
|
|
106554
106699
|
}
|
|
106555
106700
|
|
|
106556
106701
|
var propTypes = {
|
|
106557
|
-
axis:
|
|
106558
|
-
contentWindow:
|
|
106559
|
-
disableAutoscroll:
|
|
106560
|
-
distance:
|
|
106561
|
-
getContainer:
|
|
106562
|
-
getHelperDimensions:
|
|
106563
|
-
helperClass:
|
|
106564
|
-
helperContainer:
|
|
106565
|
-
hideSortableGhost:
|
|
106566
|
-
keyboardSortingTransitionDuration:
|
|
106567
|
-
lockAxis:
|
|
106568
|
-
lockOffset:
|
|
106569
|
-
lockToContainerEdges:
|
|
106570
|
-
onSortEnd:
|
|
106571
|
-
onSortMove:
|
|
106572
|
-
onSortOver:
|
|
106573
|
-
onSortStart:
|
|
106574
|
-
pressDelay:
|
|
106575
|
-
pressThreshold:
|
|
106576
|
-
keyCodes:
|
|
106577
|
-
lift:
|
|
106578
|
-
drop:
|
|
106579
|
-
cancel:
|
|
106580
|
-
up:
|
|
106581
|
-
down:
|
|
106702
|
+
axis: prop_types_default.a.oneOf(['x', 'y', 'xy']),
|
|
106703
|
+
contentWindow: prop_types_default.a.any,
|
|
106704
|
+
disableAutoscroll: prop_types_default.a.bool,
|
|
106705
|
+
distance: prop_types_default.a.number,
|
|
106706
|
+
getContainer: prop_types_default.a.func,
|
|
106707
|
+
getHelperDimensions: prop_types_default.a.func,
|
|
106708
|
+
helperClass: prop_types_default.a.string,
|
|
106709
|
+
helperContainer: prop_types_default.a.oneOfType([prop_types_default.a.func, typeof HTMLElement === 'undefined' ? prop_types_default.a.any : prop_types_default.a.instanceOf(HTMLElement)]),
|
|
106710
|
+
hideSortableGhost: prop_types_default.a.bool,
|
|
106711
|
+
keyboardSortingTransitionDuration: prop_types_default.a.number,
|
|
106712
|
+
lockAxis: prop_types_default.a.string,
|
|
106713
|
+
lockOffset: prop_types_default.a.oneOfType([prop_types_default.a.number, prop_types_default.a.string, prop_types_default.a.arrayOf(prop_types_default.a.oneOfType([prop_types_default.a.number, prop_types_default.a.string]))]),
|
|
106714
|
+
lockToContainerEdges: prop_types_default.a.bool,
|
|
106715
|
+
onSortEnd: prop_types_default.a.func,
|
|
106716
|
+
onSortMove: prop_types_default.a.func,
|
|
106717
|
+
onSortOver: prop_types_default.a.func,
|
|
106718
|
+
onSortStart: prop_types_default.a.func,
|
|
106719
|
+
pressDelay: prop_types_default.a.number,
|
|
106720
|
+
pressThreshold: prop_types_default.a.number,
|
|
106721
|
+
keyCodes: prop_types_default.a.shape({
|
|
106722
|
+
lift: prop_types_default.a.arrayOf(prop_types_default.a.number),
|
|
106723
|
+
drop: prop_types_default.a.arrayOf(prop_types_default.a.number),
|
|
106724
|
+
cancel: prop_types_default.a.arrayOf(prop_types_default.a.number),
|
|
106725
|
+
up: prop_types_default.a.arrayOf(prop_types_default.a.number),
|
|
106726
|
+
down: prop_types_default.a.arrayOf(prop_types_default.a.number)
|
|
106582
106727
|
}),
|
|
106583
|
-
shouldCancelStart:
|
|
106584
|
-
transitionDuration:
|
|
106585
|
-
updateBeforeSortStart:
|
|
106586
|
-
useDragHandle:
|
|
106587
|
-
useWindowAsScrollContainer:
|
|
106728
|
+
shouldCancelStart: prop_types_default.a.func,
|
|
106729
|
+
transitionDuration: prop_types_default.a.number,
|
|
106730
|
+
updateBeforeSortStart: prop_types_default.a.func,
|
|
106731
|
+
useDragHandle: prop_types_default.a.bool,
|
|
106732
|
+
useWindowAsScrollContainer: prop_types_default.a.bool
|
|
106588
106733
|
};
|
|
106589
106734
|
var defaultKeyCodes = {
|
|
106590
106735
|
lift: [KEYCODE.SPACE],
|
|
@@ -107531,9 +107676,9 @@ function sortableContainer(WrappedComponent) {
|
|
|
107531
107676
|
}
|
|
107532
107677
|
|
|
107533
107678
|
var propTypes$1 = {
|
|
107534
|
-
index:
|
|
107535
|
-
collection:
|
|
107536
|
-
disabled:
|
|
107679
|
+
index: prop_types_default.a.number.isRequired,
|
|
107680
|
+
collection: prop_types_default.a.oneOfType([prop_types_default.a.number, prop_types_default.a.string]),
|
|
107681
|
+
disabled: prop_types_default.a.bool
|
|
107537
107682
|
};
|
|
107538
107683
|
var omittedProps$1 = Object.keys(propTypes$1);
|
|
107539
107684
|
function sortableElement(WrappedComponent) {
|
|
@@ -108481,16 +108626,8 @@ class transfer_Transfer extends baseComponent_BaseComponent {
|
|
|
108481
108626
|
type,
|
|
108482
108627
|
showPath
|
|
108483
108628
|
} = this.props;
|
|
108484
|
-
let newItem = item;
|
|
108485
108629
|
|
|
108486
|
-
|
|
108487
|
-
newItem = assign_default()(assign_default()({}, item), {
|
|
108488
|
-
key: item._optionKey
|
|
108489
|
-
});
|
|
108490
|
-
delete newItem._optionKey;
|
|
108491
|
-
}
|
|
108492
|
-
|
|
108493
|
-
const onRemove = () => this.foundation.handleSelectOrRemove(newItem);
|
|
108630
|
+
const onRemove = () => this.foundation.handleSelectOrRemove(item);
|
|
108494
108631
|
|
|
108495
108632
|
const rightItemCls = classnames_default()({
|
|
108496
108633
|
["".concat(transfer_prefixcls, "-item")]: true,
|
|
@@ -108518,7 +108655,7 @@ class transfer_Transfer extends baseComponent_BaseComponent {
|
|
|
108518
108655
|
external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
108519
108656
|
role: "listitem",
|
|
108520
108657
|
className: rightItemCls,
|
|
108521
|
-
key:
|
|
108658
|
+
key: item.key
|
|
108522
108659
|
}, draggable ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(DragHandle, null) : null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
108523
108660
|
className: "".concat(transfer_prefixcls, "-right-item-text")
|
|
108524
108661
|
}, label), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconClose, {
|
|
@@ -108545,7 +108682,7 @@ class transfer_Transfer extends baseComponent_BaseComponent {
|
|
|
108545
108682
|
|
|
108546
108683
|
renderRightSortableList(selectedData) {
|
|
108547
108684
|
// when choose some items && draggable is true
|
|
108548
|
-
const SortableItem = sortableElement(
|
|
108685
|
+
const SortableItem = sortableElement(props => this.renderRightItem(props.item));
|
|
108549
108686
|
const SortableList = sortableContainer(_ref => {
|
|
108550
108687
|
let {
|
|
108551
108688
|
items
|
|
@@ -108556,14 +108693,12 @@ class transfer_Transfer extends baseComponent_BaseComponent {
|
|
|
108556
108693
|
"aria-label": "Selected list"
|
|
108557
108694
|
}, map_default()(items).call(items, (item, index) =>
|
|
108558
108695
|
/*#__PURE__*/
|
|
108559
|
-
// sortableElement will take over the property 'key', so use another '_optionKey' to pass
|
|
108560
108696
|
// @ts-ignore skip SortableItem type check
|
|
108561
|
-
external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(SortableItem,
|
|
108697
|
+
external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(SortableItem, {
|
|
108562
108698
|
key: item.label,
|
|
108563
|
-
index: index
|
|
108564
|
-
|
|
108565
|
-
|
|
108566
|
-
})))) // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
108699
|
+
index: index,
|
|
108700
|
+
item: item
|
|
108701
|
+
}))) // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
108567
108702
|
// @ts-ignore see reasons: https://github.com/clauderic/react-sortable-hoc/issues/206
|
|
108568
108703
|
;
|
|
108569
108704
|
}, {
|