@douyinfe/semi-ui 2.1.6-alpha.0 → 2.2.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.
Files changed (97) hide show
  1. package/_base/_story/a11y.jsx +1302 -0
  2. package/_base/_story/a11y.scss +49 -0
  3. package/_base/_story/index.stories.js +3 -1
  4. package/_utils/index.ts +9 -4
  5. package/cascader/__test__/cascader.test.js +221 -0
  6. package/cascader/_story/cascader.stories.js +138 -0
  7. package/cascader/index.tsx +37 -21
  8. package/cascader/item.tsx +4 -2
  9. package/datePicker/__test__/datePicker.test.js +100 -2
  10. package/datePicker/_story/datePicker.stories.js +90 -1
  11. package/datePicker/_story/v2/YearButton.jsx +17 -0
  12. package/datePicker/_story/v2/index.js +1 -0
  13. package/datePicker/datePicker.tsx +3 -0
  14. package/datePicker/monthsGrid.tsx +12 -1
  15. package/datePicker/navigation.tsx +55 -29
  16. package/descriptions/__test__/descriptions.test.js +27 -1
  17. package/descriptions/_story/descriptions.stories.js +52 -2
  18. package/descriptions/item.tsx +1 -1
  19. package/dist/css/semi.css +72 -28
  20. package/dist/css/semi.min.css +1 -1
  21. package/dist/umd/semi-ui.js +1086 -468
  22. package/dist/umd/semi-ui.js.map +1 -1
  23. package/dist/umd/semi-ui.min.js +1 -1
  24. package/dist/umd/semi-ui.min.js.map +1 -1
  25. package/empty/index.tsx +2 -2
  26. package/gulpfile.js +2 -1
  27. package/lib/cjs/_utils/index.d.ts +1 -0
  28. package/lib/cjs/_utils/index.js +12 -5
  29. package/lib/cjs/cascader/index.d.ts +7 -0
  30. package/lib/cjs/cascader/index.js +35 -22
  31. package/lib/cjs/cascader/item.d.ts +2 -0
  32. package/lib/cjs/cascader/item.js +4 -2
  33. package/lib/cjs/datePicker/datePicker.js +4 -0
  34. package/lib/cjs/datePicker/monthsGrid.d.ts +1 -0
  35. package/lib/cjs/datePicker/monthsGrid.js +6 -0
  36. package/lib/cjs/datePicker/navigation.js +47 -7
  37. package/lib/cjs/descriptions/item.js +1 -1
  38. package/lib/cjs/empty/index.d.ts +2 -2
  39. package/lib/cjs/empty/index.js +19 -18
  40. package/lib/cjs/form/baseForm.d.ts +6 -1
  41. package/lib/cjs/form/field.d.ts +6 -1
  42. package/lib/cjs/locale/source/es.d.ts +7 -0
  43. package/lib/cjs/locale/source/es.js +168 -0
  44. package/lib/cjs/rating/item.js +1 -1
  45. package/lib/cjs/select/index.d.ts +9 -0
  46. package/lib/cjs/select/index.js +10 -8
  47. package/lib/cjs/tabs/index.js +3 -7
  48. package/lib/cjs/timeline/item.d.ts +3 -0
  49. package/lib/cjs/timeline/item.js +10 -4
  50. package/lib/cjs/typography/title.d.ts +1 -1
  51. package/lib/cjs/upload/fileCard.d.ts +2 -0
  52. package/lib/cjs/upload/fileCard.js +70 -45
  53. package/lib/cjs/upload/index.d.ts +23 -2
  54. package/lib/cjs/upload/index.js +133 -25
  55. package/lib/cjs/upload/interface.d.ts +3 -0
  56. package/lib/es/_utils/index.d.ts +1 -0
  57. package/lib/es/_utils/index.js +12 -5
  58. package/lib/es/cascader/index.d.ts +7 -0
  59. package/lib/es/cascader/index.js +34 -25
  60. package/lib/es/cascader/item.d.ts +2 -0
  61. package/lib/es/cascader/item.js +4 -2
  62. package/lib/es/datePicker/datePicker.js +4 -0
  63. package/lib/es/datePicker/monthsGrid.d.ts +1 -0
  64. package/lib/es/datePicker/monthsGrid.js +6 -0
  65. package/lib/es/datePicker/navigation.js +48 -8
  66. package/lib/es/descriptions/item.js +1 -1
  67. package/lib/es/empty/index.d.ts +2 -2
  68. package/lib/es/empty/index.js +19 -18
  69. package/lib/es/form/baseForm.d.ts +6 -1
  70. package/lib/es/form/field.d.ts +6 -1
  71. package/lib/es/locale/source/es.d.ts +7 -0
  72. package/lib/es/locale/source/es.js +157 -0
  73. package/lib/es/rating/item.js +1 -1
  74. package/lib/es/select/index.d.ts +9 -0
  75. package/lib/es/select/index.js +14 -8
  76. package/lib/es/tabs/index.js +1 -5
  77. package/lib/es/timeline/item.d.ts +3 -0
  78. package/lib/es/timeline/item.js +9 -4
  79. package/lib/es/typography/title.d.ts +1 -1
  80. package/lib/es/upload/fileCard.d.ts +2 -0
  81. package/lib/es/upload/fileCard.js +69 -44
  82. package/lib/es/upload/index.d.ts +23 -2
  83. package/lib/es/upload/index.js +133 -24
  84. package/lib/es/upload/interface.d.ts +3 -0
  85. package/locale/source/es.ts +160 -0
  86. package/package.json +9 -9
  87. package/popover/Arrow.tsx +1 -1
  88. package/rating/item.tsx +1 -1
  89. package/select/_story/select.stories.js +25 -0
  90. package/select/index.tsx +17 -6
  91. package/tabs/index.tsx +1 -1
  92. package/timeline/_story/timeline.stories.js +50 -0
  93. package/timeline/item.tsx +7 -2
  94. package/upload/__test__/upload.test.js +50 -1
  95. package/upload/fileCard.tsx +110 -95
  96. package/upload/index.tsx +147 -53
  97. package/upload/interface.ts +3 -0
@@ -5,7 +5,7 @@ import PropTypes from 'prop-types';
5
5
  import IconButton from '../iconButton';
6
6
  import Button from '../button';
7
7
  import { cssClasses, strings } from '@douyinfe/semi-foundation/lib/es/datePicker/constants';
8
- import { IconChevronLeft, IconChevronRight } from '@douyinfe/semi-icons';
8
+ import { IconChevronLeft, IconChevronRight, IconDoubleChevronLeft, IconDoubleChevronRight } from '@douyinfe/semi-icons';
9
9
  const prefixCls = cssClasses.NAVIGATION;
10
10
  export default class Navigation extends PureComponent {
11
11
  constructor(props) {
@@ -20,6 +20,8 @@ export default class Navigation extends PureComponent {
20
20
  onMonthClick,
21
21
  onNextMonth,
22
22
  onPrevMonth,
23
+ onPrevYear,
24
+ onNextYear,
23
25
  density,
24
26
  shouldBimonthSwitch,
25
27
  panelType
@@ -27,37 +29,75 @@ export default class Navigation extends PureComponent {
27
29
  const btnTheme = 'borderless';
28
30
  const iconBtnSize = density === 'compact' ? 'default' : 'large';
29
31
  const btnNoHorizontalPadding = true;
30
- const buttonSize = density === 'compact' ? 'small' : 'default'; // Enable dual-panel synchronous switching, and the current panel is the left panel
32
+ const buttonSize = density === 'compact' ? 'small' : 'default';
33
+ const isLeftPanel = panelType === strings.PANEL_TYPE_LEFT;
34
+ const isRightPanel = panelType === strings.PANEL_TYPE_RIGHT; // syncSwitchMonth and the current panel is the left
31
35
 
32
- const bimonthSwitchWithLeftPanel = shouldBimonthSwitch && panelType === strings.PANEL_TYPE_LEFT; // Enable dual-panel synchronous switching, and the current panel is the right panel
36
+ const hiddenLeftPanelRightButtons = shouldBimonthSwitch && isLeftPanel; // syncSwitchMonth and the current panel is the right
37
+
38
+ const hiddenRightPanelLeftButtons = shouldBimonthSwitch && isRightPanel; // `visibility: hidden` will keep the icon in position
39
+
40
+ const leftButtonStyle = {};
41
+ const rightButtonStyle = {};
42
+
43
+ if (hiddenRightPanelLeftButtons) {
44
+ leftButtonStyle.visibility = 'hidden';
45
+ }
46
+
47
+ if (hiddenLeftPanelRightButtons) {
48
+ rightButtonStyle.visibility = 'hidden';
49
+ }
33
50
 
34
- const bimonthSwitchWithRightPanel = shouldBimonthSwitch && panelType === strings.PANEL_TYPE_RIGHT;
35
51
  const ref = forwardRef || this.navRef;
36
52
  return /*#__PURE__*/React.createElement("div", {
37
53
  className: prefixCls,
38
54
  ref: ref
39
- }, !bimonthSwitchWithRightPanel && /*#__PURE__*/React.createElement(IconButton, {
55
+ }, /*#__PURE__*/React.createElement(IconButton, {
56
+ key: "double-chevron-left",
57
+ icon: /*#__PURE__*/React.createElement(IconDoubleChevronLeft, {
58
+ size: iconBtnSize
59
+ }),
60
+ size: buttonSize,
61
+ theme: btnTheme,
62
+ noHorizontalPadding: btnNoHorizontalPadding,
63
+ onClick: onPrevYear,
64
+ style: leftButtonStyle
65
+ }), /*#__PURE__*/React.createElement(IconButton, {
66
+ key: "chevron-left",
40
67
  icon: /*#__PURE__*/React.createElement(IconChevronLeft, {
41
68
  size: iconBtnSize
42
69
  }),
43
70
  size: buttonSize,
44
71
  onClick: onPrevMonth,
45
72
  theme: btnTheme,
46
- noHorizontalPadding: btnNoHorizontalPadding
73
+ noHorizontalPadding: btnNoHorizontalPadding,
74
+ style: leftButtonStyle
47
75
  }), /*#__PURE__*/React.createElement("div", {
48
76
  className: "".concat(prefixCls, "-month")
49
77
  }, /*#__PURE__*/React.createElement(Button, {
50
78
  onClick: onMonthClick,
51
79
  theme: btnTheme,
52
80
  size: buttonSize
53
- }, /*#__PURE__*/React.createElement("span", null, monthText))), !bimonthSwitchWithLeftPanel && /*#__PURE__*/React.createElement(IconButton, {
81
+ }, /*#__PURE__*/React.createElement("span", null, monthText))), /*#__PURE__*/React.createElement(IconButton, {
82
+ key: "chevron-right",
54
83
  icon: /*#__PURE__*/React.createElement(IconChevronRight, {
55
84
  size: iconBtnSize
56
85
  }),
57
86
  size: buttonSize,
58
87
  onClick: onNextMonth,
59
88
  theme: btnTheme,
60
- noHorizontalPadding: btnNoHorizontalPadding
89
+ noHorizontalPadding: btnNoHorizontalPadding,
90
+ style: rightButtonStyle
91
+ }), /*#__PURE__*/React.createElement(IconButton, {
92
+ key: "double-chevron-right",
93
+ icon: /*#__PURE__*/React.createElement(IconDoubleChevronRight, {
94
+ size: iconBtnSize
95
+ }),
96
+ size: buttonSize,
97
+ theme: btnTheme,
98
+ noHorizontalPadding: btnNoHorizontalPadding,
99
+ onClick: onNextYear,
100
+ style: rightButtonStyle
61
101
  }));
62
102
  }
63
103
 
@@ -33,7 +33,7 @@ export default class Item extends PureComponent {
33
33
  className: "".concat(prefixCls, "-item")
34
34
  }, /*#__PURE__*/React.createElement("span", {
35
35
  className: keyCls
36
- }, "".concat(itemKey, ":")), /*#__PURE__*/React.createElement("span", {
36
+ }, itemKey, ":"), /*#__PURE__*/React.createElement("span", {
37
37
  className: valCls
38
38
  }, typeof children === 'function' ? children() : children))) : /*#__PURE__*/React.createElement("tr", {
39
39
  className: className,
@@ -31,8 +31,8 @@ export default class Empty extends BaseComponent<EmptyProps, EmptyState> {
31
31
  constructor(props: EmptyProps);
32
32
  componentDidMount(): void;
33
33
  componentWillUnmount(): void;
34
- observe(mutationsList: any): void;
35
- updateMode(): void;
34
+ observe: (mutationsList: any) => void;
35
+ updateMode: () => void;
36
36
  render(): JSX.Element;
37
37
  }
38
38
  export {};
@@ -10,6 +10,25 @@ const prefixCls = cssClasses.PREFIX;
10
10
  export default class Empty extends BaseComponent {
11
11
  constructor(props) {
12
12
  super(props);
13
+
14
+ this.observe = mutationsList => {
15
+ for (const mutation of mutationsList) {
16
+ if (mutation.type === 'attributes' && mutation.attributeName === 'theme-mode') {
17
+ this.updateMode();
18
+ }
19
+ }
20
+ };
21
+
22
+ this.updateMode = () => {
23
+ const val = this.body.getAttribute('theme-mode');
24
+
25
+ if (val !== this.state.mode) {
26
+ this.setState({
27
+ mode: val
28
+ });
29
+ }
30
+ };
31
+
13
32
  this.state = {
14
33
  mode: null
15
34
  };
@@ -33,24 +52,6 @@ export default class Empty extends BaseComponent {
33
52
  this.observer && this.observer.disconnect();
34
53
  }
35
54
 
36
- observe(mutationsList) {
37
- for (const mutation of mutationsList) {
38
- if (mutation.type === 'attributes' && mutation.attributeName === 'theme-mode') {
39
- this.updateMode();
40
- }
41
- }
42
- }
43
-
44
- updateMode() {
45
- const val = this.body.getAttribute('theme-mode');
46
-
47
- if (val !== this.state.mode) {
48
- this.setState({
49
- mode: val
50
- });
51
- }
52
- }
53
-
54
55
  render() {
55
56
  var _context;
56
57
 
@@ -90,6 +90,11 @@ declare class Form extends BaseComponent<BaseFormProps, BaseFormState> {
90
90
  suffix?: React.ReactNode;
91
91
  prefix?: React.ReactNode;
92
92
  insetLabel?: React.ReactNode;
93
+ inputProps?: import("utility-types").Subtract<import("../input").InputProps, {
94
+ value?: React.ReactText;
95
+ onFocus?: (e: React.FocusEvent<HTMLInputElement, Element>) => void;
96
+ onChange?: (value: string, e: React.ChangeEvent<HTMLInputElement>) => void;
97
+ }>;
93
98
  showClear?: boolean;
94
99
  showArrow?: boolean;
95
100
  renderSelectedItem?: import("../select").RenderSelectedItemFn;
@@ -111,7 +116,7 @@ declare class Form extends BaseComponent<BaseFormProps, BaseFormState> {
111
116
  onBlur?: (e: React.FocusEvent<Element, Element>) => void;
112
117
  onListScroll?: (e: React.UIEvent<HTMLDivElement, UIEvent>) => void;
113
118
  children?: React.ReactNode;
114
- } & Pick<import("../tooltip").TooltipProps, "getPopupContainer" | "stopPropagation" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay" | "motion"> & React.RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
119
+ } & Pick<import("../tooltip").TooltipProps, "stopPropagation" | "getPopupContainer" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay" | "motion"> & React.RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
115
120
  static Checkbox: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox").CheckboxProps & import("./interface").RCIncludeType>;
116
121
  static CheckboxGroup: React.ComponentType<import("utility-types").Subtract<import("../checkbox").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
117
122
  static Radio: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../radio").RadioProps & import("./interface").RCIncludeType>;
@@ -40,6 +40,11 @@ declare const FormSelect: import("react").ComponentType<import("utility-types").
40
40
  suffix?: import("react").ReactNode;
41
41
  prefix?: import("react").ReactNode;
42
42
  insetLabel?: import("react").ReactNode;
43
+ inputProps?: import("utility-types").Subtract<import("../input/index").InputProps, {
44
+ value?: import("react").ReactText;
45
+ onFocus?: (e: import("react").FocusEvent<HTMLInputElement, Element>) => void;
46
+ onChange?: (value: string, e: import("react").ChangeEvent<HTMLInputElement>) => void;
47
+ }>;
43
48
  showClear?: boolean;
44
49
  showArrow?: boolean;
45
50
  renderSelectedItem?: import("../select/index").RenderSelectedItemFn;
@@ -61,7 +66,7 @@ declare const FormSelect: import("react").ComponentType<import("utility-types").
61
66
  onBlur?: (e: import("react").FocusEvent<Element, Element>) => void;
62
67
  onListScroll?: (e: import("react").UIEvent<HTMLDivElement, UIEvent>) => void;
63
68
  children?: import("react").ReactNode;
64
- } & Pick<import("../tooltip").TooltipProps, "getPopupContainer" | "stopPropagation" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay" | "motion"> & import("react").RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
69
+ } & Pick<import("../tooltip").TooltipProps, "stopPropagation" | "getPopupContainer" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay" | "motion"> & import("react").RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
65
70
  declare const FormCheckboxGroup: import("react").ComponentType<import("utility-types").Subtract<import("../checkbox/checkboxGroup").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
66
71
  declare const FormCheckbox: import("react").ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox/checkbox").CheckboxProps & import("./interface").RCIncludeType>;
67
72
  declare const FormRadioGroup: import("react").ComponentType<import("utility-types").Subtract<import("../radio/radioGroup").RadioGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
@@ -0,0 +1,7 @@
1
+ import { Locale } from '../interface';
2
+ /**
3
+ * [i18n-Spanish(es)]
4
+ *
5
+ */
6
+ declare const locale: Locale;
7
+ export default locale;
@@ -0,0 +1,157 @@
1
+ import { es } from 'date-fns/locale';
2
+ /**
3
+ * [i18n-Spanish(es)]
4
+ *
5
+ */
6
+
7
+ const locale = {
8
+ code: 'es',
9
+ dateFnsLocale: es,
10
+ Pagination: {
11
+ item: 'objeto',
12
+ pageSize: ' objetos / página',
13
+ page: ' páginas',
14
+ total: '',
15
+ jumpTo: 'Ir a'
16
+ },
17
+ Modal: {
18
+ confirm: 'Aceptar',
19
+ cancel: 'Cancelar'
20
+ },
21
+ TimePicker: {
22
+ placeholder: {
23
+ time: 'Seleccionar hora',
24
+ timeRange: 'Seleccionar rango de tiempo'
25
+ },
26
+ begin: 'Hora inicial',
27
+ end: 'Hora final',
28
+ hour: '',
29
+ minute: '',
30
+ second: '',
31
+ AM: 'AM',
32
+ PM: 'PM'
33
+ },
34
+ DatePicker: {
35
+ placeholder: {
36
+ date: 'Seleccionar fecha',
37
+ dateTime: 'Seleccionar hora y fecha',
38
+ dateRange: ['Fecha inicial', 'Fecha final'],
39
+ dateTimeRange: ['Fecha inicial', 'Fecha final']
40
+ },
41
+ footer: {
42
+ confirm: 'Aceptar',
43
+ cancel: 'Cancelar'
44
+ },
45
+ selectDate: 'Seleccionar fecha',
46
+ selectTime: 'Seleccionar hora',
47
+ year: 'año',
48
+ month: 'mes',
49
+ day: 'día',
50
+ monthText: '${month} ${year}',
51
+ months: {
52
+ 1: 'Ene',
53
+ 2: 'Feb',
54
+ 3: 'Mar',
55
+ 4: 'Abr',
56
+ 5: 'May',
57
+ 6: 'Jun',
58
+ 7: 'Jul',
59
+ 8: 'Ago',
60
+ 9: 'Sep',
61
+ 10: 'Oct',
62
+ 11: 'Nov',
63
+ 12: 'Dic'
64
+ },
65
+ fullMonths: {
66
+ 1: 'Enero',
67
+ 2: 'Febrero',
68
+ 3: 'Marzo',
69
+ 4: 'Abril',
70
+ 5: 'Mayo',
71
+ 6: 'Junio',
72
+ 7: 'Julio',
73
+ 8: 'Agosto',
74
+ 9: 'Septiembre',
75
+ 10: 'Octubre',
76
+ 11: 'Noviembre',
77
+ 12: 'Diciembre'
78
+ },
79
+ weeks: {
80
+ Mon: 'Lun',
81
+ Tue: 'Mar',
82
+ Wed: 'Mie',
83
+ Thu: 'Jue',
84
+ Fri: 'Vie',
85
+ Sat: 'Sab',
86
+ Sun: 'Dom'
87
+ },
88
+ localeFormatToken: {
89
+ FORMAT_SWITCH_DATE: 'yyyy-MM-dd'
90
+ }
91
+ },
92
+ Popconfirm: {
93
+ confirm: 'Aceptar',
94
+ cancel: 'Cancelar'
95
+ },
96
+ Navigation: {
97
+ collapseText: 'Contraer barra lateral',
98
+ expandText: 'Expandir barra lateral'
99
+ },
100
+ Table: {
101
+ emptyText: 'Sin resultados',
102
+ pageText: 'Mostrando del ${currentStart} al ${currentEnd} de ${total}'
103
+ },
104
+ Select: {
105
+ emptyText: 'Sin resultados',
106
+ createText: 'Crear'
107
+ },
108
+ Tree: {
109
+ emptyText: 'Sin resultados',
110
+ searchPlaceholder: 'Búsqueda'
111
+ },
112
+ Cascader: {
113
+ emptyText: 'Sin resultados'
114
+ },
115
+ List: {
116
+ emptyText: 'Sin resultados'
117
+ },
118
+ Calendar: {
119
+ allDay: 'Todo el día',
120
+ AM: '${time} AM',
121
+ PM: '${time} PM',
122
+ datestring: '',
123
+ remaining: '${remained} mas'
124
+ },
125
+ Upload: {
126
+ mainText: 'Clic aquí para cargar archivo o arrastre aquí el archivo',
127
+ illegalTips: 'Este tipo de archivo no es compatible',
128
+ legalTips: 'Suelte y comience a cargar',
129
+ retry: 'Reintentar',
130
+ replace: 'Reemplazar archivo',
131
+ clear: 'Limpiar',
132
+ selectedFiles: 'Archivos seleccionados',
133
+ illegalSize: 'Tamaño de archivo inválido',
134
+ fail: 'Error al cargar'
135
+ },
136
+ TreeSelect: {
137
+ searchPlaceholder: 'Búsqueda'
138
+ },
139
+ Typography: {
140
+ copy: 'Copiar',
141
+ copied: 'Copiado',
142
+ expand: 'Expandir',
143
+ collapse: 'Contraer'
144
+ },
145
+ Transfer: {
146
+ emptyLeft: 'Sin datos',
147
+ emptySearch: 'Sin resultados de búsqueda',
148
+ emptyRight: 'Sin contenido, verifique desde la izquierda',
149
+ placeholder: 'Búsqueda',
150
+ clear: 'Limpiar',
151
+ selectAll: 'Seleccionar todo',
152
+ clearSelectAll: 'Deseleccionar todo',
153
+ total: 'Total ${total} objetos',
154
+ selected: '${total} objetos seleccionados'
155
+ }
156
+ };
157
+ export default locale;
@@ -71,7 +71,7 @@ export default class Item extends PureComponent {
71
71
  height: size,
72
72
  fontSize: size
73
73
  } : {};
74
- const iconSize = size === 'small' ? 'default' : 'extra-large';
74
+ const iconSize = isCustomSize ? 'inherit' : size === 'small' ? 'default' : 'extra-large';
75
75
  const content = character ? character : /*#__PURE__*/React.createElement(IconStar, {
76
76
  size: iconSize
77
77
  });
@@ -2,13 +2,20 @@ import React, { MouseEvent } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import SelectFoundation, { SelectAdapter } from '@douyinfe/semi-foundation/lib/es/select/foundation';
4
4
  import BaseComponent, { ValidateStatus } from '../_base/baseComponent';
5
+ import { InputProps } from '../input/index';
5
6
  import Option, { OptionProps } from './option';
6
7
  import OptionGroup from './optionGroup';
8
+ import { Subtract } from 'utility-types';
7
9
  import '@douyinfe/semi-foundation/lib/es/select/select.css';
8
10
  import { Position, TooltipProps } from '../tooltip';
9
11
  export { OptionProps } from './option';
10
12
  export { OptionGroupProps } from './optionGroup';
11
13
  export { VirtualRowProps } from './virtualRow';
14
+ declare type ExcludeInputType = {
15
+ value?: InputProps['value'];
16
+ onFocus?: InputProps['onFocus'];
17
+ onChange?: InputProps['onChange'];
18
+ };
12
19
  export interface optionRenderProps {
13
20
  key?: any;
14
21
  label?: string | React.ReactNode | number;
@@ -85,6 +92,7 @@ export declare type SelectProps = {
85
92
  suffix?: React.ReactNode;
86
93
  prefix?: React.ReactNode;
87
94
  insetLabel?: React.ReactNode;
95
+ inputProps?: Subtract<InputProps, ExcludeInputType>;
88
96
  showClear?: boolean;
89
97
  showArrow?: boolean;
90
98
  renderSelectedItem?: RenderSelectedItemFn;
@@ -151,6 +159,7 @@ declare class Select extends BaseComponent<SelectProps, SelectState> {
151
159
  dropdownStyle: PropTypes.Requireable<object>;
152
160
  outerTopSlot: PropTypes.Requireable<PropTypes.ReactNodeLike>;
153
161
  innerTopSlot: PropTypes.Requireable<PropTypes.ReactNodeLike>;
162
+ inputProps: PropTypes.Requireable<object>;
154
163
  outerBottomSlot: PropTypes.Requireable<PropTypes.ReactNodeLike>;
155
164
  innerBottomSlot: PropTypes.Requireable<PropTypes.ReactNodeLike>;
156
165
  optionList: PropTypes.Requireable<any[]>;
@@ -342,39 +342,44 @@ class Select extends BaseComponent {
342
342
  const {
343
343
  size,
344
344
  multiple,
345
- disabled
345
+ disabled,
346
+ inputProps
346
347
  } = this.props;
348
+
349
+ const inputPropsCls = _get(inputProps, 'className');
350
+
347
351
  const inputcls = cls("".concat(prefixcls, "-input"), {
348
352
  ["".concat(prefixcls, "-input-single")]: !multiple,
349
353
  ["".concat(prefixcls, "-input-multiple")]: multiple
350
- });
354
+ }, inputPropsCls);
351
355
  const {
352
356
  inputValue
353
357
  } = this.state;
354
- const inputProps = {
358
+
359
+ const selectInputProps = _Object$assign({
355
360
  value: inputValue,
356
361
  disabled,
357
362
  className: inputcls,
358
363
  onChange: this.handleInputChange
359
- };
364
+ }, inputProps);
365
+
360
366
  let style = {}; // Multiple choice mode
361
367
 
362
368
  if (multiple) {
363
369
  style = {
364
370
  width: inputValue ? "".concat(inputValue.length * 16, "px") : '2px'
365
371
  };
366
- inputProps.style = style;
372
+ selectInputProps.style = style;
367
373
  }
368
374
 
369
375
  return /*#__PURE__*/React.createElement(Input, _Object$assign({
370
376
  ref: this.inputRef,
371
- size: size
372
- }, inputProps, {
377
+ size: size,
373
378
  onFocus: e => {
374
379
  // prevent event bubbling which will fire trigger onFocus event
375
380
  e.stopPropagation(); // e.nativeEvent.stopImmediatePropagation();
376
381
  }
377
- }));
382
+ }, selectInputProps));
378
383
  }
379
384
 
380
385
  close() {
@@ -980,6 +985,7 @@ Select.propTypes = {
980
985
  dropdownStyle: PropTypes.object,
981
986
  outerTopSlot: PropTypes.node,
982
987
  innerTopSlot: PropTypes.node,
988
+ inputProps: PropTypes.object,
983
989
  outerBottomSlot: PropTypes.node,
984
990
  innerBottomSlot: PropTypes.node,
985
991
  optionList: PropTypes.array,
@@ -1,9 +1,7 @@
1
- import _omit from "lodash/omit";
2
1
  import _pick from "lodash/pick";
3
2
  import _isEqual from "lodash/isEqual";
4
3
  import _indexOfInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/index-of";
5
4
  import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
6
- import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
7
5
  import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
8
6
  import _Array$isArray from "@babel/runtime-corejs3/core-js-stable/array/is-array";
9
7
  import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
@@ -35,9 +33,7 @@ import '@douyinfe/semi-foundation/lib/es/tabs/tabs.css';
35
33
  import TabBar from './TabBar';
36
34
  import TabPane from './TabPane';
37
35
  import TabsContext from './tabs-context';
38
-
39
- const panePickKeys = _Object$keys(_omit(TabPane.propTypes, ['children']));
40
-
36
+ const panePickKeys = ['className', 'style', 'disabled', 'itemKey', 'tab', 'icon'];
41
37
  export * from './interface';
42
38
 
43
39
  class Tabs extends BaseComponent {
@@ -10,6 +10,7 @@ export interface TimelineItemProps {
10
10
  position?: 'left' | 'right';
11
11
  className?: string;
12
12
  style?: React.CSSProperties;
13
+ onClick?: React.MouseEventHandler<HTMLLIElement>;
13
14
  }
14
15
  export default class Item extends PureComponent<TimelineItemProps> {
15
16
  static propTypes: {
@@ -21,10 +22,12 @@ export default class Item extends PureComponent<TimelineItemProps> {
21
22
  position: PropTypes.Requireable<string>;
22
23
  className: PropTypes.Requireable<string>;
23
24
  style: PropTypes.Requireable<object>;
25
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
24
26
  };
25
27
  static defaultProps: {
26
28
  type: string;
27
29
  time: string;
30
+ onClick: (...args: any[]) => void;
28
31
  };
29
32
  render(): JSX.Element;
30
33
  }
@@ -1,3 +1,4 @@
1
+ import _noop from "lodash/noop";
1
2
  import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
2
3
  import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
3
4
  import React, { PureComponent } from 'react';
@@ -18,7 +19,8 @@ export default class Item extends PureComponent {
18
19
  type,
19
20
  style,
20
21
  time,
21
- extra
22
+ extra,
23
+ onClick
22
24
  } = this.props;
23
25
  const itemCls = cls(prefixCls, className);
24
26
  const dotCls = cls({
@@ -33,7 +35,8 @@ export default class Item extends PureComponent {
33
35
  } : null;
34
36
  return /*#__PURE__*/React.createElement("li", {
35
37
  className: itemCls,
36
- style: style
38
+ style: style,
39
+ onClick: onClick
37
40
  }, /*#__PURE__*/React.createElement("div", {
38
41
  className: "".concat(prefixCls, "-tail")
39
42
  }), /*#__PURE__*/React.createElement("div", _Object$assign({
@@ -56,9 +59,11 @@ Item.propTypes = {
56
59
  extra: PropTypes.node,
57
60
  position: PropTypes.oneOf(strings.ITEM_POS),
58
61
  className: PropTypes.string,
59
- style: PropTypes.object
62
+ style: PropTypes.object,
63
+ onClick: PropTypes.func
60
64
  };
61
65
  Item.defaultProps = {
62
66
  type: 'default',
63
- time: ''
67
+ time: '',
68
+ onClick: _noop
64
69
  };
@@ -37,7 +37,7 @@ export default class Title extends PureComponent<TitleProps> {
37
37
  underline: PropTypes.Requireable<boolean>;
38
38
  strong: PropTypes.Requireable<boolean>;
39
39
  type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
40
- heading: PropTypes.Requireable<4 | 2 | 1 | 3 | 5 | 6>;
40
+ heading: PropTypes.Requireable<1 | 2 | 3 | 4 | 5 | 6>;
41
41
  style: PropTypes.Requireable<object>;
42
42
  className: PropTypes.Requireable<string>;
43
43
  component: PropTypes.Requireable<string>;
@@ -26,6 +26,7 @@ declare class FileCard extends PureComponent<FileCardProps> {
26
26
  style: PropTypes.Requireable<object>;
27
27
  url: PropTypes.Requireable<string>;
28
28
  validateMessage: PropTypes.Requireable<PropTypes.ReactNodeLike>;
29
+ index: PropTypes.Requireable<number>;
29
30
  };
30
31
  static defaultProps: {
31
32
  listType: "list";
@@ -39,6 +40,7 @@ declare class FileCard extends PureComponent<FileCardProps> {
39
40
  renderValidateMessage(): ReactNode;
40
41
  renderPicValidateMsg(): ReactNode;
41
42
  renderPic(locale: Locale['Upload']): ReactNode;
43
+ renderFile(locale: Locale["Upload"]): JSX.Element;
42
44
  onRemove(e: MouseEvent): void;
43
45
  onReplace(e: MouseEvent): void;
44
46
  onRetry(e: MouseEvent): void;