@douyinfe/semi-ui 2.17.0-alpha.1 → 2.17.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 (100) hide show
  1. package/_base/_story/a11y.jsx +2 -2
  2. package/avatar/__test__/avatar.test.js +3 -3
  3. package/avatar/interface.ts +1 -1
  4. package/cascader/_story/cascader.stories.js +91 -1
  5. package/cascader/index.tsx +35 -26
  6. package/checkbox/checkbox.tsx +4 -1
  7. package/collapse/__test__/collapse.test.js +22 -2
  8. package/collapse/_story/accordion.stories.js +2 -2
  9. package/collapse/item.tsx +20 -6
  10. package/collapsible/_story/collapsible.stories.js +6 -6
  11. package/configProvider/_story/RTLDirection/RTLForm.jsx +1 -1
  12. package/datePicker/__test__/datePicker.test.js +5 -5
  13. package/datePicker/_story/datePicker.stories.js +138 -22
  14. package/datePicker/datePicker.tsx +42 -7
  15. package/datePicker/monthsGrid.tsx +22 -10
  16. package/datePicker/quickControl.tsx +62 -16
  17. package/datePicker/yearAndMonth.tsx +31 -5
  18. package/dist/css/semi.css +328 -47
  19. package/dist/css/semi.min.css +1 -1
  20. package/dist/umd/semi-ui.js +36811 -36304
  21. package/dist/umd/semi-ui.js.map +1 -1
  22. package/dist/umd/semi-ui.min.js +1 -1
  23. package/dist/umd/semi-ui.min.js.map +1 -1
  24. package/empty/index.tsx +3 -3
  25. package/lib/cjs/avatar/interface.d.ts +1 -1
  26. package/lib/cjs/cascader/index.js +36 -25
  27. package/lib/cjs/checkbox/checkbox.js +4 -1
  28. package/lib/cjs/collapse/item.d.ts +8 -0
  29. package/lib/cjs/collapse/item.js +19 -8
  30. package/lib/cjs/datePicker/datePicker.d.ts +3 -0
  31. package/lib/cjs/datePicker/datePicker.js +56 -9
  32. package/lib/cjs/datePicker/monthsGrid.d.ts +3 -0
  33. package/lib/cjs/datePicker/monthsGrid.js +14 -3
  34. package/lib/cjs/datePicker/quickControl.d.ts +6 -0
  35. package/lib/cjs/datePicker/quickControl.js +61 -14
  36. package/lib/cjs/datePicker/yearAndMonth.d.ts +3 -0
  37. package/lib/cjs/datePicker/yearAndMonth.js +15 -3
  38. package/lib/cjs/empty/index.js +1 -1
  39. package/lib/cjs/popover/index.d.ts +3 -0
  40. package/lib/cjs/popover/index.js +4 -2
  41. package/lib/cjs/select/index.d.ts +6 -1
  42. package/lib/cjs/select/index.js +130 -72
  43. package/lib/cjs/select/option.js +4 -2
  44. package/lib/cjs/tag/index.js +6 -4
  45. package/lib/cjs/tag/interface.d.ts +1 -0
  46. package/lib/cjs/tagInput/index.d.ts +13 -1
  47. package/lib/cjs/tagInput/index.js +217 -91
  48. package/lib/cjs/timePicker/TimePicker.js +1 -1
  49. package/lib/cjs/tooltip/index.d.ts +4 -0
  50. package/lib/cjs/tooltip/index.js +5 -3
  51. package/lib/cjs/typography/base.js +3 -15
  52. package/lib/cjs/typography/text.js +1 -11
  53. package/lib/es/avatar/interface.d.ts +1 -1
  54. package/lib/es/cascader/index.js +40 -29
  55. package/lib/es/checkbox/checkbox.js +4 -1
  56. package/lib/es/collapse/item.d.ts +8 -0
  57. package/lib/es/collapse/item.js +19 -8
  58. package/lib/es/datePicker/datePicker.d.ts +3 -0
  59. package/lib/es/datePicker/datePicker.js +56 -9
  60. package/lib/es/datePicker/monthsGrid.d.ts +3 -0
  61. package/lib/es/datePicker/monthsGrid.js +14 -3
  62. package/lib/es/datePicker/quickControl.d.ts +6 -0
  63. package/lib/es/datePicker/quickControl.js +61 -15
  64. package/lib/es/datePicker/yearAndMonth.d.ts +3 -0
  65. package/lib/es/datePicker/yearAndMonth.js +14 -3
  66. package/lib/es/empty/index.js +1 -1
  67. package/lib/es/popover/index.d.ts +3 -0
  68. package/lib/es/popover/index.js +4 -2
  69. package/lib/es/select/index.d.ts +6 -1
  70. package/lib/es/select/index.js +129 -71
  71. package/lib/es/select/option.js +4 -2
  72. package/lib/es/tag/index.js +6 -4
  73. package/lib/es/tag/interface.d.ts +1 -0
  74. package/lib/es/tagInput/index.d.ts +13 -1
  75. package/lib/es/tagInput/index.js +217 -93
  76. package/lib/es/timePicker/TimePicker.js +1 -1
  77. package/lib/es/tooltip/index.d.ts +4 -0
  78. package/lib/es/tooltip/index.js +5 -3
  79. package/lib/es/typography/base.js +3 -15
  80. package/lib/es/typography/text.js +1 -10
  81. package/package.json +7 -7
  82. package/popover/index.tsx +4 -1
  83. package/select/__test__/select.test.js +5 -3
  84. package/select/_story/select.stories.js +1 -1
  85. package/select/_story/select.stories.tsx +2 -2
  86. package/select/index.tsx +65 -30
  87. package/select/option.tsx +2 -0
  88. package/table/_story/Perf/Render/complex.jsx +1 -1
  89. package/table/_story/Perf/Render/resizableSelection.jsx +1 -1
  90. package/tag/index.tsx +3 -2
  91. package/tag/interface.ts +1 -0
  92. package/tagInput/_story/tagInput.stories.js +20 -2
  93. package/tagInput/index.tsx +126 -26
  94. package/timePicker/TimePicker.tsx +1 -1
  95. package/tooltip/index.tsx +5 -2
  96. package/typography/_story/typography.stories.js +3 -15
  97. package/typography/base.tsx +4 -9
  98. package/typography/text.tsx +1 -9
  99. package/upload/__test__/upload.test.js +9 -9
  100. package/upload/_story/upload.stories.js +5 -5
package/select/index.tsx CHANGED
@@ -24,7 +24,7 @@ import OptionGroup from './optionGroup';
24
24
  import Spin from '../spin';
25
25
  import Trigger from '../trigger';
26
26
  import { IconChevronDown, IconClear } from '@douyinfe/semi-icons';
27
- import { isSemiIcon } from '../_utils';
27
+ import { isSemiIcon, getFocusableElements, getActiveElement } from '../_utils';
28
28
  import { Subtract } from 'utility-types';
29
29
 
30
30
  import warning from '@douyinfe/semi-foundation/utils/warning';
@@ -177,6 +177,7 @@ export interface SelectState {
177
177
  keyboardEventSet: any; // {}
178
178
  optionGroups: Array<any>;
179
179
  isHovering: boolean;
180
+ isFocusInContainer: boolean;
180
181
  }
181
182
 
182
183
  // Notes: Use the label of the option as the identifier, that is, the option in Select, the value is allowed to be the same, but the label must be unique
@@ -304,13 +305,13 @@ class Select extends BaseComponent<SelectProps, SelectState> {
304
305
  onListScroll: noop,
305
306
  maxHeight: 300,
306
307
  dropdownMatchSelectWidth: true,
307
- defaultActiveFirstOption: false,
308
+ defaultActiveFirstOption: true, // In order to meet the needs of A11y, change to true
308
309
  showArrow: true,
309
310
  showClear: false,
310
311
  remote: false,
311
312
  autoAdjustOverflow: true,
312
313
  autoClearSearchValue: true,
313
- arrowIcon: <IconChevronDown />
314
+ arrowIcon: <IconChevronDown aria-label='' />
314
315
  // Radio selection is different from the default renderSelectedItem for multiple selection, so it is not declared here
315
316
  // renderSelectedItem: (optionNode) => optionNode.label,
316
317
  // The default creator rendering is related to i18, so it is not declared here
@@ -319,9 +320,11 @@ class Select extends BaseComponent<SelectProps, SelectState> {
319
320
 
320
321
  inputRef: React.RefObject<HTMLInputElement>;
321
322
  triggerRef: React.RefObject<HTMLDivElement>;
323
+ optionContainerEl: React.RefObject<HTMLDivElement>;
322
324
  optionsRef: React.RefObject<any>;
323
325
  virtualizeListRef: React.RefObject<any>;
324
326
  selectOptionListID: string;
327
+ selectID: string;
325
328
  clickOutsideHandler: (e: MouseEvent) => void;
326
329
  foundation: SelectFoundation;
327
330
  context: ContextValue;
@@ -341,13 +344,16 @@ class Select extends BaseComponent<SelectProps, SelectState> {
341
344
  keyboardEventSet: {},
342
345
  optionGroups: [],
343
346
  isHovering: false,
347
+ isFocusInContainer: false,
344
348
  };
345
349
  /* Generate random string */
346
350
  this.selectOptionListID = '';
351
+ this.selectID = '';
347
352
  this.virtualizeListRef = React.createRef();
348
353
  this.inputRef = React.createRef();
349
354
  this.triggerRef = React.createRef();
350
355
  this.optionsRef = React.createRef();
356
+ this.optionContainerEl = React.createRef();
351
357
  this.clickOutsideHandler = null;
352
358
  this.onSelect = this.onSelect.bind(this);
353
359
  this.onClear = this.onClear.bind(this);
@@ -355,7 +361,6 @@ class Select extends BaseComponent<SelectProps, SelectState> {
355
361
  this.onMouseLeave = this.onMouseLeave.bind(this);
356
362
  this.renderOption = this.renderOption.bind(this);
357
363
  this.onKeyPress = this.onKeyPress.bind(this);
358
- this.onClearBtnEnterPress = this.onClearBtnEnterPress.bind(this);
359
364
 
360
365
  this.foundation = new SelectFoundation(this.adapter);
361
366
 
@@ -370,6 +375,8 @@ class Select extends BaseComponent<SelectProps, SelectState> {
370
375
  );
371
376
  }
372
377
 
378
+ setOptionContainerEl = (node: HTMLDivElement) => (this.optionContainerEl = { current: node });
379
+
373
380
  get adapter(): SelectAdapter<SelectProps, SelectState> {
374
381
  const keyboardAdapter = {
375
382
  registerKeyDown: (cb: () => void) => {
@@ -536,6 +543,21 @@ class Select extends BaseComponent<SelectProps, SelectState> {
536
543
 
537
544
  }
538
545
  },
546
+ getContainer: () => {
547
+ return this.optionContainerEl && this.optionContainerEl.current;
548
+ },
549
+ getFocusableElements: (node: HTMLDivElement) => {
550
+ return getFocusableElements(node);
551
+ },
552
+ getActiveElement: () => {
553
+ return getActiveElement();
554
+ },
555
+ setIsFocusInContainer: (isFocusInContainer: boolean) => {
556
+ this.setState({ isFocusInContainer });
557
+ },
558
+ getIsFocusInContainer: () => {
559
+ return this.state.isFocusInContainer;
560
+ },
539
561
  updateScrollTop: (index?: number) => {
540
562
  // eslint-disable-next-line max-len
541
563
  let optionClassName = `.${prefixcls}-option-selected`;
@@ -565,6 +587,7 @@ class Select extends BaseComponent<SelectProps, SelectState> {
565
587
  componentDidMount() {
566
588
  this.foundation.init();
567
589
  this.selectOptionListID = getUuidShort();
590
+ this.selectID = this.props.id || getUuidShort();
568
591
  }
569
592
 
570
593
  componentWillUnmount() {
@@ -595,13 +618,13 @@ class Select extends BaseComponent<SelectProps, SelectState> {
595
618
  handleInputChange = (value: string) => this.foundation.handleInputChange(value);
596
619
 
597
620
  renderInput() {
598
- const { size, multiple, disabled, inputProps } = this.props;
621
+ const { size, multiple, disabled, inputProps, filter } = this.props;
599
622
  const inputPropsCls = get(inputProps, 'className');
600
623
  const inputcls = cls(`${prefixcls}-input`, {
601
624
  [`${prefixcls}-input-single`]: !multiple,
602
625
  [`${prefixcls}-input-multiple`]: multiple,
603
626
  }, inputPropsCls);
604
- const { inputValue } = this.state;
627
+ const { inputValue, focusIndex } = this.state;
605
628
 
606
629
  const selectInputProps: Record<string, any> = {
607
630
  value: inputValue,
@@ -623,11 +646,18 @@ class Select extends BaseComponent<SelectProps, SelectState> {
623
646
  <Input
624
647
  ref={this.inputRef as any}
625
648
  size={size}
649
+ aria-activedescendant={focusIndex !== -1 ? `${this.selectID}-option-${focusIndex}`: ''}
626
650
  onFocus={(e: React.FocusEvent<HTMLInputElement>) => {
651
+ // if multiple and filter, when use tab key to let select get focus
652
+ // need to manual update state isFocus to let the focus style take effect
653
+ if (multiple && Boolean(filter)){
654
+ this.setState({ isFocus: true });
655
+ }
627
656
  // prevent event bubbling which will fire trigger onFocus event
628
657
  e.stopPropagation();
629
658
  // e.nativeEvent.stopImmediatePropagation();
630
659
  }}
660
+ onBlur={e => this.foundation.handleInputBlur(e)}
631
661
  {...selectInputProps}
632
662
  />
633
663
  );
@@ -666,10 +696,6 @@ class Select extends BaseComponent<SelectProps, SelectState> {
666
696
  this.foundation.handleClearClick(e as any);
667
697
  }
668
698
 
669
- /* istanbul ignore next */
670
- onClearBtnEnterPress(e: React.KeyboardEvent) {
671
- this.foundation.handleClearBtnEnterPress(e as any);
672
- }
673
699
 
674
700
  renderEmpty() {
675
701
  return <Option empty={true} emptyContent={this.props.emptyContent} />;
@@ -712,6 +738,7 @@ class Select extends BaseComponent<SelectProps, SelectState> {
712
738
  key={option.key || option.label as string + option.value as string + optionIndex}
713
739
  renderOptionItem={renderOptionItem}
714
740
  inputValue={inputValue}
741
+ id={`${this.selectID}-option-${optionIndex}`}
715
742
  >
716
743
  {option.label}
717
744
  </Option>
@@ -837,7 +864,14 @@ class Select extends BaseComponent<SelectProps, SelectState> {
837
864
 
838
865
  const isEmpty = !options.length || !options.some(item => item._show);
839
866
  return (
840
- <div id={`${prefixcls}-${this.selectOptionListID}`} className={dropdownClassName} style={style}>
867
+ // eslint-disable-next-line jsx-a11y/no-static-element-interactions
868
+ <div
869
+ id={`${prefixcls}-${this.selectOptionListID}`}
870
+ className={dropdownClassName}
871
+ style={style}
872
+ ref={this.setOptionContainerEl}
873
+ onKeyDown={e => this.foundation.handleContainerKeyDown(e)}
874
+ >
841
875
  {outerTopSlot}
842
876
  <div
843
877
  style={{ maxHeight: `${maxHeight}px` }}
@@ -930,7 +964,7 @@ class Select extends BaseComponent<SelectProps, SelectState> {
930
964
  };
931
965
  if (isRenderInTag) {
932
966
  return (
933
- <Tag {...basic} color="white" size={size || 'large'} key={value}>
967
+ <Tag {...basic} color="white" size={size || 'large'} key={value} tabIndex={-1}>
934
968
  {content}
935
969
  </Tag>
936
970
  );
@@ -956,7 +990,7 @@ class Select extends BaseComponent<SelectProps, SelectState> {
956
990
 
957
991
  const NotOneLine = !maxTagCount; // Multiple lines (that is, do not set maxTagCount), do not use TagGroup, directly traverse with Tag, otherwise Input cannot follow the correct position
958
992
 
959
- const tagContent = NotOneLine ? tags : <TagGroup<"custom"> tagList={tags} maxTagCount={n} restCount={maxTagCount ? selectedItems.length - maxTagCount : undefined} size="large" mode="custom" />;
993
+ const tagContent = NotOneLine ? tags : <TagGroup<"custom"> tagList={tags} maxTagCount={n} restCount={maxTagCount ? selectedItems.length - maxTagCount : undefined} size="large" mode="custom"/>;
960
994
 
961
995
  return (
962
996
  <>
@@ -1055,7 +1089,7 @@ class Select extends BaseComponent<SelectProps, SelectState> {
1055
1089
  arrowIcon,
1056
1090
  } = this.props;
1057
1091
 
1058
- const { selections, isOpen, keyboardEventSet, inputValue, isHovering, isFocus } = this.state;
1092
+ const { selections, isOpen, keyboardEventSet, inputValue, isHovering, isFocus, showInput, focusIndex } = this.state;
1059
1093
  const useCustomTrigger = typeof triggerRender === 'function';
1060
1094
  const filterable = Boolean(filter); // filter(boolean || function)
1061
1095
  const selectionCls = useCustomTrigger ?
@@ -1109,32 +1143,31 @@ class Select extends BaseComponent<SelectProps, SelectState> {
1109
1143
  </div>
1110
1144
  </Fragment>,
1111
1145
  <Fragment key="clearicon">
1112
- {showClear ? (
1113
- <div
1114
- role="button"
1115
- aria-label="Clear selected value"
1116
- tabIndex={0}
1117
- className={cls(`${prefixcls}-clear`)}
1118
- onClick={this.onClear}
1119
- onKeyPress={this.onClearBtnEnterPress}
1120
- >
1121
- <IconClear />
1122
- </div>
1123
- ) : arrowContent}
1146
+ {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions */}
1147
+ {showClear ? ( <div className={cls(`${prefixcls}-clear`)} onClick={this.onClear}><IconClear /></div>) : arrowContent}
1124
1148
  </Fragment>,
1125
1149
  <Fragment key="suffix">{suffix ? this.renderSuffix() : null}</Fragment>,
1126
1150
  ]
1127
1151
  );
1128
1152
 
1129
- const tabIndex = disabled ? null : 0;
1153
+ /**
1154
+ *
1155
+ * In disabled, searchable single-selection and display input, and searchable multi-selection
1156
+ * make combobox not focusable by tab key
1157
+ *
1158
+ * 在disabled,可搜索单选且显示input框,以及可搜索多选情况下
1159
+ * 让combobox无法通过tab聚焦
1160
+ */
1161
+ const tabIndex = (disabled || (filterable && showInput) || (filterable && multiple)) ? -1 : 0;
1130
1162
  return (
1163
+ /* eslint-disable-next-line jsx-a11y/aria-activedescendant-has-tabindex */
1131
1164
  <div
1132
1165
  role="combobox"
1133
1166
  aria-disabled={disabled}
1134
1167
  aria-expanded={isOpen}
1135
1168
  aria-controls={`${prefixcls}-${this.selectOptionListID}`}
1136
1169
  aria-haspopup="listbox"
1137
- aria-label="select value"
1170
+ aria-label={selections.size ? 'selected' : ''} // if there is a value, expect the narration to speak selected
1138
1171
  aria-invalid={this.props['aria-invalid']}
1139
1172
  aria-errormessage={this.props['aria-errormessage']}
1140
1173
  aria-labelledby={this.props['aria-labelledby']}
@@ -1144,11 +1177,12 @@ class Select extends BaseComponent<SelectProps, SelectState> {
1144
1177
  ref={ref => ((this.triggerRef as any).current = ref)}
1145
1178
  onClick={e => this.foundation.handleClick(e)}
1146
1179
  style={style}
1147
- id={id}
1180
+ id={this.selectID}
1148
1181
  tabIndex={tabIndex}
1182
+ aria-activedescendant={focusIndex !== -1 ? `${this.selectID}-option-${focusIndex}`: ''}
1149
1183
  onMouseEnter={this.onMouseEnter}
1150
1184
  onMouseLeave={this.onMouseLeave}
1151
- // onFocus={e => this.foundation.handleTriggerFocus(e)}
1185
+ onFocus={e => this.foundation.handleTriggerFocus(e)}
1152
1186
  onBlur={e => this.foundation.handleTriggerBlur(e as any)}
1153
1187
  onKeyPress={this.onKeyPress}
1154
1188
  {...keyboardEventSet}
@@ -1193,6 +1227,7 @@ class Select extends BaseComponent<SelectProps, SelectState> {
1193
1227
  position={position}
1194
1228
  spacing={spacing}
1195
1229
  stopPropagation={stopPropagation}
1230
+ disableArrowKeyDown={true}
1196
1231
  onVisibleChange={status => this.handlePopoverVisibleChange(status)}
1197
1232
  >
1198
1233
  {selection}
package/select/option.tsx CHANGED
@@ -88,6 +88,7 @@ class Option extends PureComponent<OptionProps> {
88
88
  prefixCls,
89
89
  renderOptionItem,
90
90
  inputValue,
91
+ id,
91
92
  ...rest
92
93
  } = this.props;
93
94
  const optionClassName = classNames(prefixCls, {
@@ -146,6 +147,7 @@ class Option extends PureComponent<OptionProps> {
146
147
  }}
147
148
  onMouseEnter={e => onMouseEnter && onMouseEnter(e)}
148
149
  role="option"
150
+ id={id}
149
151
  aria-selected={selected ? "true" : "false"}
150
152
  aria-disabled={disabled ? "true" : "false"}
151
153
  style={style}
@@ -3,7 +3,7 @@ import React from 'react';
3
3
  import { Table, Typography, Tag, Popover } from '../../../../index';
4
4
 
5
5
  const { Text } = Typography;
6
- const src = 'https://sf6-cdn-tos.douyinstatic.com/obj/eden-cn/ptlz_zlp/ljhwZthlaukjlkulzlp/root-web-sites/bf8647bffab13c38772c9ff94bf91a9d.jpg';
6
+ const src = 'https://lf3-static.bytednsdoc.com/obj/eden-cn/ptlz_zlp/ljhwZthlaukjlkulzlp/root-web-sites/bag.jpeg';
7
7
 
8
8
  class App extends React.Component {
9
9
  constructor(props) {
@@ -3,7 +3,7 @@ import React from 'react';
3
3
  import { Table, Typography, Tag, Popover } from '../../../../index';
4
4
 
5
5
  const { Text } = Typography;
6
- const src = 'https://sf6-cdn-tos.douyinstatic.com/obj/eden-cn/ptlz_zlp/ljhwZthlaukjlkulzlp/root-web-sites/bf8647bffab13c38772c9ff94bf91a9d.jpg';
6
+ const src = 'https://lf3-static.bytednsdoc.com/obj/eden-cn/ptlz_zlp/ljhwZthlaukjlkulzlp/root-web-sites/bag.jpeg';
7
7
 
8
8
  class App extends React.Component {
9
9
  constructor(props) {
package/tag/index.tsx CHANGED
@@ -119,10 +119,11 @@ export default class Tag extends Component<TagProps, TagState> {
119
119
  }
120
120
 
121
121
  render() {
122
- const { children, size, color, closable, visible, onClose, onClick, className, type, avatarSrc, avatarShape, ...attr } = this.props;
122
+ const { children, size, color, closable, visible, onClose, onClick, className, type, avatarSrc, avatarShape, tabIndex, ...attr } = this.props;
123
123
  const { visible: isVisible } = this.state;
124
124
  const clickable = onClick !== Tag.defaultProps.onClick || closable;
125
- const a11yProps = { role: 'button', tabIndex: 0, onKeyDown: this.handleKeyDown };
125
+ // only when the Tag is clickable or closable, the value of tabIndex is allowed to be passed in.
126
+ const a11yProps = { role: 'button', tabIndex: tabIndex | 0, onKeyDown: this.handleKeyDown };
126
127
  const baseProps = {
127
128
  ...attr,
128
129
  onClick,
package/tag/interface.ts CHANGED
@@ -35,6 +35,7 @@ export interface TagProps {
35
35
  avatarShape?: AvatarShape;
36
36
  onKeyDown?: React.KeyboardEventHandler<HTMLDivElement>;
37
37
  'aria-label'?: React.AriaAttributes['aria-label'];
38
+ tabIndex?: number; // use internal, when tag in taInput, we want to use left arrow and right arrow to control the tag focus, so the tabIndex need to be -1.
38
39
  }
39
40
 
40
41
  export interface TagGroupProps {
@@ -78,6 +78,24 @@ ShowClear.story = {
78
78
  name: 'showClear',
79
79
  };
80
80
 
81
+ export const Draggable = () => (
82
+ <>
83
+ <TagInput draggable defaultValue={['抖音', '火山', '西瓜视频', 'AI Lab', '花亦山', '水之月','轻颜','醒图']} showClear style={style} />
84
+ <br />
85
+ <TagInput
86
+ draggable
87
+ defaultValue={['抖音', '火山', '西瓜视频', 'AI Lab', '花亦山', '水之月','轻颜','醒图']}
88
+ maxTagCount={5}
89
+ showClear
90
+ style={style}
91
+ />
92
+ </>
93
+ );
94
+
95
+ Draggable.story = {
96
+ name: 'draggable',
97
+ };
98
+
81
99
  export const MaxExceed = () => (
82
100
  <>
83
101
  <TagInput
@@ -331,7 +349,7 @@ class CustomRender extends React.Component {
331
349
  name: 'semi',
332
350
  email: 'semi@byte.com',
333
351
  avatar:
334
- 'https://sf6-cdn-tos.douyinstatic.com/obj/eden-cn/ptlz_zlp/ljhwZthlaukjlkulzlp/root-web-sites/bf8647bffab13c38772c9ff94bf91a9d.jpg',
352
+ 'https://lf3-static.bytednsdoc.com/obj/eden-cn/ptlz_zlp/ljhwZthlaukjlkulzlp/root-web-sites/bag.jpeg',
335
353
  },
336
354
  ],
337
355
  };
@@ -367,7 +385,7 @@ class CustomRender extends React.Component {
367
385
  const item = {};
368
386
  item.name = v.name || v;
369
387
  item.email = `${item.name}@byte.com`;
370
- item.avatar = `https://sf6-cdn-tos.douyinstatic.com/obj/eden-cn/ptlz_zlp/ljhwZthlaukjlkulzlp/root-web-sites/bf8647bffab13c38772c9ff94bf91a9d.jpg`;
388
+ item.avatar = `https://lf3-static.bytednsdoc.com/obj/eden-cn/ptlz_zlp/ljhwZthlaukjlkulzlp/root-web-sites/bag.jpeg`;
371
389
  return item;
372
390
  });
373
391
  this.setState({