@douyinfe/semi-ui 2.15.0 → 2.16.0-beta.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.
Files changed (42) hide show
  1. package/button/buttonGroup.tsx +3 -2
  2. package/cascader/index.tsx +5 -1
  3. package/dist/css/semi.css +12 -0
  4. package/dist/css/semi.min.css +1 -1
  5. package/dist/umd/semi-ui.js +325 -73
  6. package/dist/umd/semi-ui.js.map +1 -1
  7. package/dist/umd/semi-ui.min.js +1 -1
  8. package/dist/umd/semi-ui.min.js.map +1 -1
  9. package/iconButton/index.tsx +3 -0
  10. package/lib/cjs/button/buttonGroup.d.ts +0 -2
  11. package/lib/cjs/button/buttonGroup.js +4 -3
  12. package/lib/cjs/cascader/index.d.ts +3 -0
  13. package/lib/cjs/cascader/index.js +5 -3
  14. package/lib/cjs/iconButton/index.js +3 -0
  15. package/lib/cjs/slider/index.d.ts +1 -1
  16. package/lib/cjs/slider/index.js +84 -36
  17. package/lib/cjs/tooltip/index.js +1 -1
  18. package/lib/cjs/transfer/index.d.ts +5 -0
  19. package/lib/cjs/transfer/index.js +7 -17
  20. package/lib/cjs/typography/base.js +15 -3
  21. package/lib/cjs/typography/text.js +11 -1
  22. package/lib/es/button/buttonGroup.d.ts +0 -2
  23. package/lib/es/button/buttonGroup.js +4 -3
  24. package/lib/es/cascader/index.d.ts +3 -0
  25. package/lib/es/cascader/index.js +5 -3
  26. package/lib/es/iconButton/index.js +3 -0
  27. package/lib/es/slider/index.d.ts +1 -1
  28. package/lib/es/slider/index.js +84 -36
  29. package/lib/es/tooltip/index.js +1 -1
  30. package/lib/es/transfer/index.d.ts +5 -0
  31. package/lib/es/transfer/index.js +7 -17
  32. package/lib/es/typography/base.js +15 -3
  33. package/lib/es/typography/text.js +10 -1
  34. package/package.json +7 -7
  35. package/slider/_story/slider.stories.js +4 -2
  36. package/slider/index.tsx +63 -33
  37. package/tooltip/index.tsx +1 -1
  38. package/transfer/_story/transfer.stories.js +29 -0
  39. package/transfer/index.tsx +10 -10
  40. package/typography/_story/typography.stories.js +15 -3
  41. package/typography/base.tsx +9 -4
  42. package/typography/text.tsx +9 -1
@@ -26052,11 +26052,11 @@ function getAncestorNodeByRole(curElement, role) {
26052
26052
  }
26053
26053
 
26054
26054
  return curElement.parentElement;
26055
- } // According to the Id, find the corresponding data-popupId element
26055
+ } // According to the Id, find the corresponding data-popupid element
26056
26056
 
26057
26057
  function getMenuButton(focusableEle, Id) {
26058
26058
  for (let i = 0; i < focusableEle.length; i++) {
26059
- const curAriDescribedby = focusableEle[i].attributes['data-popupId'];
26059
+ const curAriDescribedby = focusableEle[i].attributes['data-popupid'];
26060
26060
 
26061
26061
  if (curAriDescribedby && curAriDescribedby.value === Id) {
26062
26062
  return focusableEle[i];
@@ -29936,7 +29936,7 @@ class tooltip_Tooltip extends baseComponent_BaseComponent {
29936
29936
  }
29937
29937
  },
29938
29938
  tabIndex: 0,
29939
- 'data-popupId': id
29939
+ 'data-popupid': id
29940
29940
  })); // If you do not add a layer of div, in order to bind the events and className in the tooltip, you need to cloneElement children, but this time it may overwrite the children's original ref reference
29941
29941
  // So if the user adds ref to the content, you need to use callback ref: https://github.com/facebook/react/issues/8873
29942
29942
 
@@ -33480,12 +33480,18 @@ const wrapperDecorations = (props, content) => {
33480
33480
  underline,
33481
33481
  strong,
33482
33482
  link,
33483
- disabled
33483
+ disabled,
33484
+ icon
33484
33485
  } = props;
33485
33486
  let wrapped = content;
33486
33487
 
33487
33488
  const wrap = (isNeeded, tag) => {
33488
- let wrapProps = {};
33489
+ let wrapProps = icon ? {
33490
+ style: {
33491
+ display: 'inline-flex',
33492
+ alignItems: 'center'
33493
+ }
33494
+ } : {};
33489
33495
 
33490
33496
  if (!isNeeded) {
33491
33497
  return;
@@ -33503,7 +33509,13 @@ const wrapperDecorations = (props, content) => {
33503
33509
  wrap(underline && !link, 'u');
33504
33510
  wrap(strong, 'strong');
33505
33511
  wrap(props.delete, 'del');
33506
- wrap(link, disabled ? 'span' : 'a');
33512
+ 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),
33513
+ // use span to wrap the content, so that the content in the span is vertically aligned
33514
+
33515
+ if (wrapped === content && icon) {
33516
+ wrap(true, 'span');
33517
+ }
33518
+
33507
33519
  return wrapped;
33508
33520
  };
33509
33521
 
@@ -34135,11 +34147,20 @@ base_Base.defaultProps = {
34135
34147
 
34136
34148
 
34137
34149
 
34150
+
34151
+
34152
+ const text_prefixCls = constants_cssClasses.PREFIX;
34138
34153
  class text_Text extends external_root_React_commonjs2_react_commonjs_react_amd_react_["PureComponent"] {
34139
34154
  render() {
34155
+ const className = classnames_default()(this.props.className, {
34156
+ ["".concat(text_prefixCls, "-text")]: true,
34157
+ ["".concat(text_prefixCls, "-text-icon")]: this.props.icon
34158
+ });
34140
34159
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(base_Base, assign_default()({
34141
34160
  component: 'span'
34142
- }, this.props));
34161
+ }, this.props, {
34162
+ className: className
34163
+ }));
34143
34164
  }
34144
34165
 
34145
34166
  }
@@ -38889,6 +38910,9 @@ class iconButton_IconButton extends external_root_React_commonjs2_react_commonjs
38889
38910
  } else if (noHorizontalPadding === true) {
38890
38911
  style.paddingLeft = 0;
38891
38912
  style.paddingRight = 0;
38913
+ } else if (typeof noHorizontalPadding === 'string') {
38914
+ noHorizontalPadding === 'left' && (style.paddingLeft = 0);
38915
+ noHorizontalPadding === 'right' && (style.paddingRight = 0);
38892
38916
  }
38893
38917
 
38894
38918
  let finalChildren = null;
@@ -40088,9 +40112,10 @@ buttonGroup_ButtonGroup.propTypes = {
40088
40112
  'aria-label': prop_types_default.a.string
40089
40113
  };
40090
40114
  buttonGroup_ButtonGroup.defaultProps = {
40091
- size: 'default',
40092
- type: 'primary',
40093
- theme: 'light'
40115
+ // There are default values ​​for type and theme in Button.
40116
+ // In order to allow users to individually customize the type and theme of the Button through the parameters of the Button in the ButtonGroup,
40117
+ // the default value of type and theme is not given in the ButtonGroup。
40118
+ size: 'default'
40094
40119
  };
40095
40120
  // EXTERNAL MODULE: /home/runner/work/semi-design/semi-design/node_modules/@babel/runtime-corejs3/core-js-stable/instance/keys.js
40096
40121
  var instance_keys = __webpack_require__("BoX2");
@@ -52588,7 +52613,8 @@ class cascader_Cascader extends baseComponent_BaseComponent {
52588
52613
  autoAdjustOverflow,
52589
52614
  stopPropagation,
52590
52615
  mouseLeaveDelay,
52591
- mouseEnterDelay
52616
+ mouseEnterDelay,
52617
+ position
52592
52618
  } = this.props;
52593
52619
  const {
52594
52620
  isOpen,
@@ -52599,7 +52625,7 @@ class cascader_Cascader extends baseComponent_BaseComponent {
52599
52625
  } = this.context;
52600
52626
  const content = this.renderContent();
52601
52627
  const selection = this.renderSelection();
52602
- const pos = direction === 'rtl' ? 'bottomRight' : 'bottomLeft';
52628
+ const pos = position !== null && position !== void 0 ? position : direction === 'rtl' ? 'bottomRight' : 'bottomLeft';
52603
52629
  const mergedMotion = this.foundation.getMergedMotion();
52604
52630
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(popover_0, {
52605
52631
  getPopupContainer: getPopupContainer,
@@ -52693,7 +52719,8 @@ cascader_Cascader.propTypes = {
52693
52719
  disableStrictly: prop_types_default.a.bool,
52694
52720
  leafOnly: prop_types_default.a.bool,
52695
52721
  enableLeafClick: prop_types_default.a.bool,
52696
- preventScroll: prop_types_default.a.bool
52722
+ preventScroll: prop_types_default.a.bool,
52723
+ position: prop_types_default.a.string
52697
52724
  };
52698
52725
  cascader_Cascader.defaultProps = {
52699
52726
  leafOnly: false,
@@ -68152,7 +68179,7 @@ class foundation_DropdownFoundation extends foundation {
68152
68179
  getMenuItemNodes(target) {
68153
68180
  var _context;
68154
68181
 
68155
- const id = target.attributes['data-popupId'].value;
68182
+ const id = target.attributes['data-popupid'].value;
68156
68183
  const menuWrapper = document.getElementById(id); // if has dropdown item, the item must wrapped by li
68157
68184
 
68158
68185
  return menuWrapper ? filter_default()(_context = from_default()(menuWrapper.getElementsByTagName('li'))).call(_context, item => item.ariaDisabled === "false") : null;
@@ -68223,7 +68250,7 @@ class menuFoundation_DropdownMenuFoundation extends foundation {
68223
68250
  const trigger = this._adapter.getContext('trigger');
68224
68251
 
68225
68252
  if (trigger === 'custom') {
68226
- const menuButton = menu && getMenuButton(document.querySelectorAll("[data-popupId]"), menu.id);
68253
+ const menuButton = menu && getMenuButton(document.querySelectorAll("[data-popupid]"), menu.id);
68227
68254
  menuButton.focus();
68228
68255
  }
68229
68256
  }
@@ -85101,6 +85128,7 @@ const touchEventPolyfill = (touch, touchEvent) => {
85101
85128
 
85102
85129
 
85103
85130
 
85131
+
85104
85132
  /* eslint-disable no-param-reassign */
85105
85133
 
85106
85134
  /* eslint-disable max-len */
@@ -85108,6 +85136,8 @@ const touchEventPolyfill = (touch, touchEvent) => {
85108
85136
  /* eslint-disable no-nested-ternary */
85109
85137
 
85110
85138
 
85139
+
85140
+
85111
85141
  class foundation_SliderFoundation extends foundation {
85112
85142
  constructor(adapter) {
85113
85143
  var _this;
@@ -85632,8 +85662,7 @@ class foundation_SliderFoundation extends foundation {
85632
85662
  const handleMaxDom = this._adapter.getMaxHandleEl().current;
85633
85663
 
85634
85664
  if (e.target === handleMinDom || e.target === handleMaxDom) {
85635
- e.preventDefault();
85636
- e.stopPropagation();
85665
+ handlePrevent(e);
85637
85666
  const touch = touchPolyfill(e.touches[0], e);
85638
85667
  this.onHandleDown(touch, handler);
85639
85668
  }
@@ -85697,18 +85726,203 @@ class foundation_SliderFoundation extends foundation {
85697
85726
  this._adapter.setDragging([dragging[0], false]);
85698
85727
  }
85699
85728
 
85700
- this._adapter.setStateVal('isDrag', false); // this._adapter.setStateVal('chooseMovePos', '');
85701
-
85729
+ this._adapter.setStateVal('isDrag', false);
85702
85730
 
85703
85731
  this._adapter.onHandleLeave();
85704
85732
 
85705
85733
  this._adapter.onHandleUpAfter();
85706
85734
 
85707
85735
  return true;
85736
+ };
85737
+
85738
+ this._handleValueDecreaseWithKeyBoard = (step, handler) => {
85739
+ const {
85740
+ min,
85741
+ currentValue
85742
+ } = this.getStates();
85743
+ const {
85744
+ range
85745
+ } = this.getProps();
85746
+
85747
+ if (handler === 'min') {
85748
+ if (range) {
85749
+ let newMinValue = currentValue[0] - step;
85750
+ newMinValue = newMinValue < min ? min : newMinValue;
85751
+ return [newMinValue, currentValue[1]];
85752
+ } else {
85753
+ let newMinValue = currentValue - step;
85754
+ newMinValue = newMinValue < min ? min : newMinValue;
85755
+ return newMinValue;
85756
+ }
85757
+ } else {
85758
+ let newMaxValue = currentValue[1] - step;
85759
+ newMaxValue = newMaxValue < currentValue[0] ? currentValue[0] : newMaxValue;
85760
+ return [currentValue[0], newMaxValue];
85761
+ }
85762
+ };
85763
+
85764
+ this._handleValueIncreaseWithKeyBoard = (step, handler) => {
85765
+ const {
85766
+ max,
85767
+ currentValue
85768
+ } = this.getStates();
85769
+ const {
85770
+ range
85771
+ } = this.getProps();
85772
+
85773
+ if (handler === 'min') {
85774
+ if (range) {
85775
+ let newMinValue = currentValue[0] + step;
85776
+ newMinValue = newMinValue > currentValue[1] ? currentValue[1] : newMinValue;
85777
+ return [newMinValue, currentValue[1]];
85778
+ } else {
85779
+ let newMinValue = currentValue + step;
85780
+ newMinValue = newMinValue > max ? max : newMinValue;
85781
+ return newMinValue;
85782
+ }
85783
+ } else {
85784
+ let newMaxValue = currentValue[1] + step;
85785
+ newMaxValue = newMaxValue > max ? max : newMaxValue;
85786
+ return [currentValue[0], newMaxValue];
85787
+ }
85788
+ };
85789
+
85790
+ this._handleHomeKey = handler => {
85791
+ const {
85792
+ min,
85793
+ currentValue
85794
+ } = this.getStates();
85795
+ const {
85796
+ range
85797
+ } = this.getProps();
85798
+
85799
+ if (handler === 'min') {
85800
+ if (range) {
85801
+ return [min, currentValue[1]];
85802
+ } else {
85803
+ return min;
85804
+ }
85805
+ } else {
85806
+ return [currentValue[0], currentValue[0]];
85807
+ }
85808
+ };
85809
+
85810
+ this._handleEndKey = handler => {
85811
+ const {
85812
+ max,
85813
+ currentValue
85814
+ } = this.getStates();
85815
+ const {
85816
+ range
85817
+ } = this.getProps();
85818
+
85819
+ if (handler === 'min') {
85820
+ if (range) {
85821
+ return [currentValue[1], currentValue[1]];
85822
+ } else {
85823
+ return max;
85824
+ }
85825
+ } else {
85826
+ return [currentValue[0], max];
85827
+ }
85828
+ };
85829
+
85830
+ this.handleKeyDown = (event, handler) => {
85831
+ var _context;
85832
+
85833
+ const {
85834
+ min,
85835
+ max,
85836
+ currentValue
85837
+ } = this.getStates();
85838
+ const {
85839
+ step,
85840
+ range
85841
+ } = this.getProps();
85842
+ let outputValue;
85843
+
85844
+ switch (event.key) {
85845
+ case "ArrowLeft":
85846
+ case "ArrowDown":
85847
+ outputValue = this._handleValueDecreaseWithKeyBoard(step, handler);
85848
+ break;
85849
+
85850
+ case "ArrowRight":
85851
+ case "ArrowUp":
85852
+ outputValue = this._handleValueIncreaseWithKeyBoard(step, handler);
85853
+ break;
85854
+
85855
+ case "PageUp":
85856
+ outputValue = this._handleValueIncreaseWithKeyBoard(10 * step, handler);
85857
+ break;
85858
+
85859
+ case "PageDown":
85860
+ outputValue = this._handleValueDecreaseWithKeyBoard(10 * step, handler);
85861
+ break;
85862
+
85863
+ case "Home":
85864
+ outputValue = this._handleHomeKey(handler);
85865
+ break;
85866
+
85867
+ case "End":
85868
+ outputValue = this._handleEndKey(handler);
85869
+ break;
85870
+
85871
+ case 'default':
85872
+ break;
85873
+ }
85874
+
85875
+ if (includes_default()(_context = ["ArrowLeft", "ArrowDown", "ArrowRight", "ArrowUp", "PageUp", "PageDown", "Home", "End"]).call(_context, event.key)) {
85876
+ let update = true;
85877
+
85878
+ if (is_array_default()(currentValue)) {
85879
+ update = !(currentValue[0] === outputValue[0] && currentValue[1] === outputValue[1]);
85880
+ } else {
85881
+ update = currentValue !== outputValue;
85882
+ }
85883
+
85884
+ if (update) {
85885
+ this._adapter.updateCurrentValue(outputValue);
85886
+
85887
+ this._adapter.notifyChange(outputValue);
85888
+ }
85889
+
85890
+ handlePrevent(event);
85891
+ }
85708
85892
  }; // eslint-disable-next-line @typescript-eslint/no-empty-function
85709
85893
 
85710
85894
 
85711
- this.onFocus = (e, handler) => {};
85895
+ this.onFocus = (e, handler) => {
85896
+ handlePrevent(e);
85897
+ const {
85898
+ target
85899
+ } = e;
85900
+
85901
+ try {
85902
+ if (target.matches(':focus-visible')) {
85903
+ if (handler === 'min') {
85904
+ this._adapter.setStateVal('firstDotFocusVisible', true);
85905
+ } else {
85906
+ this._adapter.setStateVal('secondDotFocusVisible', true);
85907
+ }
85908
+ }
85909
+ } catch (error) {
85910
+ Object(warning["a" /* default */])(true, 'Warning: [Semi Slider] The current browser does not support the focus-visible');
85911
+ }
85912
+ };
85913
+
85914
+ this.onBlur = (e, handler) => {
85915
+ const {
85916
+ firstDotFocusVisible,
85917
+ secondDotFocusVisible
85918
+ } = this.getStates();
85919
+
85920
+ if (handler === 'min') {
85921
+ firstDotFocusVisible && this._adapter.setStateVal('firstDotFocusVisible', false);
85922
+ } else {
85923
+ secondDotFocusVisible && this._adapter.setStateVal('secondDotFocusVisible', false);
85924
+ }
85925
+ };
85712
85926
 
85713
85927
  this.handleWrapClick = e => {
85714
85928
  const {
@@ -85901,7 +86115,9 @@ class slider_Slider extends baseComponent_BaseComponent {
85901
86115
  const {
85902
86116
  chooseMovePos,
85903
86117
  isDrag,
85904
- isInRenderTree
86118
+ isInRenderTree,
86119
+ firstDotFocusVisible,
86120
+ secondDotFocusVisible
85905
86121
  } = this.state;
85906
86122
  const stylePos = vertical ? 'top' : 'left';
85907
86123
  const percentInfo = this.foundation.getMinAndMaxPercent(this.state.currentValue);
@@ -85927,7 +86143,7 @@ class slider_Slider extends baseComponent_BaseComponent {
85927
86143
  currentValue
85928
86144
  } = this.state;
85929
86145
  const commonAria = {
85930
- 'aria-label': ariaLabel,
86146
+ 'aria-label': ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : disabled ? 'Disabled Slider' : undefined,
85931
86147
  'aria-labelledby': ariaLabelledby,
85932
86148
  'aria-disabled': disabled
85933
86149
  };
@@ -85939,7 +86155,7 @@ class slider_Slider extends baseComponent_BaseComponent {
85939
86155
  position: "top",
85940
86156
  trigger: "custom",
85941
86157
  rePosKey: minPercent,
85942
- visible: isInRenderTree && tipVisible.min,
86158
+ visible: isInRenderTree && (tipVisible.min || firstDotFocusVisible),
85943
86159
  className: "".concat(slider_constants_cssClasses.HANDLE, "-tooltip")
85944
86160
  }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", assign_default()({
85945
86161
  onMouseOver: this.foundation.checkAndUpdateIsInRenderTreeState,
@@ -85971,20 +86187,28 @@ class slider_Slider extends baseComponent_BaseComponent {
85971
86187
  onTouchEnd: e => {
85972
86188
  this.foundation.onHandleUp(e);
85973
86189
  },
85974
- onFocus: e => this.foundation.onFocus(e, 'min'),
86190
+ onKeyDown: e => {
86191
+ this.foundation.handleKeyDown(e, 'min');
86192
+ },
86193
+ onFocus: e => {
86194
+ this.foundation.onFocus(e, 'min');
86195
+ },
86196
+ onBlur: e => {
86197
+ this.foundation.onBlur(e, 'min');
86198
+ },
85975
86199
  role: "slider",
85976
- tabIndex: 0
86200
+ "aria-valuetext": getAriaValueText ? getAriaValueText(currentValue, 0) : ariaValueText,
86201
+ tabIndex: disabled ? -1 : 0
85977
86202
  }, commonAria, {
85978
86203
  "aria-valuenow": currentValue,
85979
86204
  "aria-valuemax": max,
85980
- "aria-valuemin": min,
85981
- "aria-valuetext": getAriaValueText ? getAriaValueText(currentValue) : ariaValueText
86205
+ "aria-valuemin": min
85982
86206
  }))) : /*#__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, {
85983
86207
  content: tipChildren.min,
85984
86208
  position: "top",
85985
86209
  trigger: "custom",
85986
86210
  rePosKey: minPercent,
85987
- visible: isInRenderTree && tipVisible.min,
86211
+ visible: isInRenderTree && (tipVisible.min || firstDotFocusVisible),
85988
86212
  className: "".concat(slider_constants_cssClasses.HANDLE, "-tooltip")
85989
86213
  }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", assign_default()({
85990
86214
  ref: this.minHanleEl,
@@ -86015,12 +86239,20 @@ class slider_Slider extends baseComponent_BaseComponent {
86015
86239
  onTouchEnd: e => {
86016
86240
  this.foundation.onHandleUp(e);
86017
86241
  },
86018
- onFocus: e => this.foundation.onFocus(e, 'min'),
86242
+ onKeyDown: e => {
86243
+ this.foundation.handleKeyDown(e, 'min');
86244
+ },
86245
+ onFocus: e => {
86246
+ this.foundation.onFocus(e, 'min');
86247
+ },
86248
+ onBlur: e => {
86249
+ this.foundation.onBlur(e, 'min');
86250
+ },
86019
86251
  role: "slider",
86020
- tabIndex: 0
86252
+ tabIndex: disabled ? -1 : 0
86021
86253
  }, commonAria, {
86254
+ "aria-valuetext": getAriaValueText ? getAriaValueText(currentValue[0], 0) : ariaValueText,
86022
86255
  "aria-valuenow": currentValue[0],
86023
- "aria-valuetext": getAriaValueText ? getAriaValueText(currentValue[0]) : ariaValueText,
86024
86256
  "aria-valuemax": currentValue[1],
86025
86257
  "aria-valuemin": min
86026
86258
  }))), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(tooltip_Tooltip, {
@@ -86028,7 +86260,7 @@ class slider_Slider extends baseComponent_BaseComponent {
86028
86260
  position: "top",
86029
86261
  trigger: "custom",
86030
86262
  rePosKey: maxPercent,
86031
- visible: isInRenderTree && tipVisible.max,
86263
+ visible: isInRenderTree && (tipVisible.max || secondDotFocusVisible),
86032
86264
  className: "".concat(slider_constants_cssClasses.HANDLE, "-tooltip")
86033
86265
  }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", assign_default()({
86034
86266
  ref: this.maxHanleEl,
@@ -86059,12 +86291,20 @@ class slider_Slider extends baseComponent_BaseComponent {
86059
86291
  onTouchEnd: e => {
86060
86292
  this.foundation.onHandleUp(e);
86061
86293
  },
86062
- onFocus: e => this.foundation.onFocus(e, 'min'),
86294
+ onKeyDown: e => {
86295
+ this.foundation.handleKeyDown(e, 'max');
86296
+ },
86297
+ onFocus: e => {
86298
+ this.foundation.onFocus(e, 'max');
86299
+ },
86300
+ onBlur: e => {
86301
+ this.foundation.onBlur(e, 'max');
86302
+ },
86063
86303
  role: "slider",
86064
- tabIndex: 0
86304
+ tabIndex: disabled ? -1 : 0
86065
86305
  }, commonAria, {
86306
+ "aria-valuetext": getAriaValueText ? getAriaValueText(currentValue[1], 1) : ariaValueText,
86066
86307
  "aria-valuenow": currentValue[1],
86067
- "aria-valuetext": getAriaValueText ? getAriaValueText(currentValue[1]) : ariaValueText,
86068
86308
  "aria-valuemax": max,
86069
86309
  "aria-valuemin": currentValue[0]
86070
86310
  }))));
@@ -86165,6 +86405,13 @@ class slider_Slider extends baseComponent_BaseComponent {
86165
86405
  return labelContent;
86166
86406
  };
86167
86407
 
86408
+ this._getAriaValueText = (value, index) => {
86409
+ const {
86410
+ getAriaValueText
86411
+ } = this.props;
86412
+ return getAriaValueText ? getAriaValueText(value, index) : value;
86413
+ };
86414
+
86168
86415
  let {
86169
86416
  value
86170
86417
  } = this.props;
@@ -86185,14 +86432,14 @@ class slider_Slider extends baseComponent_BaseComponent {
86185
86432
  isDrag: false,
86186
86433
  clickValue: 0,
86187
86434
  showBoundary: false,
86188
- isInRenderTree: true
86435
+ isInRenderTree: true,
86436
+ firstDotFocusVisible: false,
86437
+ secondDotFocusVisible: false
86189
86438
  };
86190
86439
  this.sliderEl = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createRef();
86191
86440
  this.minHanleEl = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createRef();
86192
86441
  this.maxHanleEl = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createRef();
86193
- this.dragging = [false, false]; // this.chooseMovePos = 'min';
86194
- // this.isDrag = false;
86195
-
86442
+ this.dragging = [false, false];
86196
86443
  this.foundation = new foundation_SliderFoundation(this.adapter);
86197
86444
  this.eventListenerSet = new set_default.a();
86198
86445
  }
@@ -86259,8 +86506,7 @@ class slider_Slider extends baseComponent_BaseComponent {
86259
86506
  return flag;
86260
86507
  },
86261
86508
  getOverallVars: () => ({
86262
- dragging: this.dragging,
86263
- chooseMovePos: this.chooseMovePos
86509
+ dragging: this.dragging
86264
86510
  }),
86265
86511
  updateDisabled: disabled => {
86266
86512
  this.setState({
@@ -86294,9 +86540,6 @@ class slider_Slider extends baseComponent_BaseComponent {
86294
86540
  getMinHandleEl: () => this.minHanleEl,
86295
86541
  getMaxHandleEl: () => this.maxHanleEl,
86296
86542
  onHandleDown: e => {
86297
- e.stopPropagation();
86298
- e.preventDefault();
86299
-
86300
86543
  this._addEventListener(document.body, 'mousemove', this.foundation.onHandleMove, false);
86301
86544
 
86302
86545
  this._addEventListener(document.body, 'mouseup', this.foundation.onHandleUp, false);
@@ -86419,37 +86662,55 @@ class slider_Slider extends baseComponent_BaseComponent {
86419
86662
  }
86420
86663
 
86421
86664
  render() {
86665
+ var _context5;
86666
+
86667
+ const {
86668
+ disabled,
86669
+ currentValue,
86670
+ min,
86671
+ max
86672
+ } = this.state;
86673
+ const {
86674
+ vertical,
86675
+ verticalReverse,
86676
+ style,
86677
+ railStyle,
86678
+ range,
86679
+ className
86680
+ } = this.props;
86422
86681
  const wrapperClass = classnames_default()("".concat(slider_prefixCls, "-wrapper"), {
86423
- ["".concat(slider_prefixCls, "-disabled")]: this.state.disabled,
86424
- ["".concat(slider_constants_cssClasses.VERTICAL, "-wrapper")]: this.props.vertical,
86425
- ["".concat(slider_prefixCls, "-reverse")]: this.props.vertical && this.props.verticalReverse
86426
- }, this.props.className);
86682
+ ["".concat(slider_prefixCls, "-disabled")]: disabled,
86683
+ ["".concat(slider_constants_cssClasses.VERTICAL, "-wrapper")]: vertical,
86684
+ ["".concat(slider_prefixCls, "-reverse")]: vertical && verticalReverse
86685
+ }, className);
86427
86686
  const boundaryClass = classnames_default()("".concat(slider_prefixCls, "-boundary"), {
86428
86687
  ["".concat(slider_prefixCls, "-boundary-show")]: this.props.showBoundary && this.state.showBoundary
86429
86688
  });
86430
86689
  const sliderCls = classnames_default()({
86431
- ["".concat(slider_prefixCls)]: !this.props.vertical,
86432
- [slider_constants_cssClasses.VERTICAL]: this.props.vertical
86690
+ ["".concat(slider_prefixCls)]: !vertical,
86691
+ [slider_constants_cssClasses.VERTICAL]: vertical
86433
86692
  });
86693
+ const ariaLabel = range ? concat_default()(_context5 = "Range: ".concat(this._getAriaValueText(currentValue[0], 0), " to ")).call(_context5, this._getAriaValueText(currentValue[1], 1)) : undefined;
86434
86694
  const slider = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
86435
86695
  className: wrapperClass,
86436
- style: this.props.style,
86696
+ style: style,
86437
86697
  ref: this.sliderEl,
86698
+ "aria-label": ariaLabel,
86438
86699
  onMouseEnter: () => this.foundation.handleWrapperEnter(),
86439
86700
  onMouseLeave: () => this.foundation.handleWrapperLeave()
86440
86701
  }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
86441
86702
  className: "".concat(slider_prefixCls, "-rail"),
86442
86703
  onClick: this.foundation.handleWrapClick,
86443
- style: this.props.railStyle
86704
+ style: railStyle
86444
86705
  }), 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", {
86445
86706
  className: boundaryClass
86446
86707
  }, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", {
86447
86708
  className: "".concat(slider_prefixCls, "-boundary-min")
86448
- }, this.state.min), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", {
86709
+ }, min), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", {
86449
86710
  className: "".concat(slider_prefixCls, "-boundary-max")
86450
- }, this.state.max)));
86711
+ }, max)));
86451
86712
 
86452
- if (!this.props.vertical) {
86713
+ if (!vertical) {
86453
86714
  return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
86454
86715
  className: sliderCls
86455
86716
  }, slider);
@@ -86502,7 +86763,8 @@ slider_Slider.propTypes = {
86502
86763
  className: prop_types_default.a.string,
86503
86764
  showBoundary: prop_types_default.a.bool,
86504
86765
  railStyle: prop_types_default.a.object,
86505
- verticalReverse: prop_types_default.a.bool
86766
+ verticalReverse: prop_types_default.a.bool,
86767
+ getAriaValueText: prop_types_default.a.func
86506
86768
  };
86507
86769
  slider_Slider.defaultProps = {
86508
86770
  // allowClear: false,
@@ -108479,16 +108741,8 @@ class transfer_Transfer extends baseComponent_BaseComponent {
108479
108741
  type,
108480
108742
  showPath
108481
108743
  } = this.props;
108482
- let newItem = item;
108483
-
108484
- if (draggable) {
108485
- newItem = assign_default()(assign_default()({}, item), {
108486
- key: item._optionKey
108487
- });
108488
- delete newItem._optionKey;
108489
- }
108490
108744
 
108491
- const onRemove = () => this.foundation.handleSelectOrRemove(newItem);
108745
+ const onRemove = () => this.foundation.handleSelectOrRemove(item);
108492
108746
 
108493
108747
  const rightItemCls = classnames_default()({
108494
108748
  ["".concat(transfer_prefixcls, "-item")]: true,
@@ -108516,7 +108770,7 @@ class transfer_Transfer extends baseComponent_BaseComponent {
108516
108770
  external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
108517
108771
  role: "listitem",
108518
108772
  className: rightItemCls,
108519
- key: newItem.key
108773
+ key: item.key
108520
108774
  }, 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", {
108521
108775
  className: "".concat(transfer_prefixcls, "-right-item-text")
108522
108776
  }, label), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconClose, {
@@ -108543,7 +108797,7 @@ class transfer_Transfer extends baseComponent_BaseComponent {
108543
108797
 
108544
108798
  renderRightSortableList(selectedData) {
108545
108799
  // when choose some items && draggable is true
108546
- const SortableItem = sortableElement(item => this.renderRightItem(item));
108800
+ const SortableItem = sortableElement(props => this.renderRightItem(props.item));
108547
108801
  const SortableList = sortableContainer(_ref => {
108548
108802
  let {
108549
108803
  items
@@ -108554,14 +108808,12 @@ class transfer_Transfer extends baseComponent_BaseComponent {
108554
108808
  "aria-label": "Selected list"
108555
108809
  }, map_default()(items).call(items, (item, index) =>
108556
108810
  /*#__PURE__*/
108557
- // sortableElement will take over the property 'key', so use another '_optionKey' to pass
108558
108811
  // @ts-ignore skip SortableItem type check
108559
- external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(SortableItem, assign_default()({
108812
+ external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(SortableItem, {
108560
108813
  key: item.label,
108561
- index: index
108562
- }, item, {
108563
- _optionKey: item.key
108564
- })))) // eslint-disable-next-line @typescript-eslint/ban-ts-comment
108814
+ index: index,
108815
+ item: item
108816
+ }))) // eslint-disable-next-line @typescript-eslint/ban-ts-comment
108565
108817
  // @ts-ignore see reasons: https://github.com/clauderic/react-sortable-hoc/issues/206
108566
108818
  ;
108567
108819
  }, {