@douyinfe/semi-ui 2.1.4-alpha.0 → 2.2.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 (162) hide show
  1. package/_base/_story/a11y.jsx +1302 -0
  2. package/_base/_story/a11y.scss +49 -0
  3. package/_base/_story/index.scss +1 -0
  4. package/_base/_story/index.stories.js +3 -1
  5. package/_utils/index.ts +2 -1
  6. package/button/Button.tsx +1 -0
  7. package/button/__test__/button.test.js +15 -0
  8. package/button/_story/button.stories.js +13 -0
  9. package/button/buttonGroup.tsx +6 -4
  10. package/cascader/__test__/cascader.test.js +221 -0
  11. package/cascader/_story/cascader.stories.js +138 -0
  12. package/cascader/index.tsx +37 -21
  13. package/cascader/item.tsx +7 -2
  14. package/checkbox/__test__/checkboxGroup.test.js +37 -5
  15. package/checkbox/_story/checkbox.stories.js +78 -6
  16. package/checkbox/checkbox.tsx +3 -0
  17. package/checkbox/checkboxGroup.tsx +3 -2
  18. package/datePicker/__test__/datePicker.test.js +67 -2
  19. package/datePicker/_story/datePicker.stories.js +3 -1
  20. package/datePicker/_story/v2/YearButton.jsx +17 -0
  21. package/datePicker/_story/v2/index.js +1 -0
  22. package/datePicker/monthsGrid.tsx +12 -1
  23. package/datePicker/navigation.tsx +55 -29
  24. package/descriptions/__test__/descriptions.test.js +27 -1
  25. package/descriptions/_story/descriptions.stories.js +52 -2
  26. package/descriptions/item.tsx +1 -1
  27. package/dist/css/semi.css +105 -32
  28. package/dist/css/semi.min.css +1 -1
  29. package/dist/umd/semi-ui.js +801 -227
  30. package/dist/umd/semi-ui.js.map +1 -1
  31. package/dist/umd/semi-ui.min.js +1 -1
  32. package/dist/umd/semi-ui.min.js.map +1 -1
  33. package/form/_story/form.stories.js +0 -67
  34. package/form/_story/form.stories.tsx +2 -2
  35. package/form/hoc/withField.tsx +2 -2
  36. package/lib/cjs/_base/base.css +2 -2
  37. package/lib/cjs/_utils/index.d.ts +1 -0
  38. package/lib/cjs/_utils/index.js +3 -2
  39. package/lib/cjs/button/Button.d.ts +1 -0
  40. package/lib/cjs/button/buttonGroup.js +11 -3
  41. package/lib/cjs/cascader/index.d.ts +7 -0
  42. package/lib/cjs/cascader/index.js +35 -22
  43. package/lib/cjs/cascader/item.d.ts +2 -0
  44. package/lib/cjs/cascader/item.js +9 -2
  45. package/lib/cjs/checkbox/checkbox.js +4 -1
  46. package/lib/cjs/checkbox/checkboxGroup.d.ts +1 -0
  47. package/lib/cjs/checkbox/checkboxGroup.js +3 -1
  48. package/lib/cjs/datePicker/dateInput.d.ts +1 -1
  49. package/lib/cjs/datePicker/datePicker.d.ts +1 -1
  50. package/lib/cjs/datePicker/monthsGrid.d.ts +2 -1
  51. package/lib/cjs/datePicker/monthsGrid.js +6 -0
  52. package/lib/cjs/datePicker/navigation.js +47 -7
  53. package/lib/cjs/descriptions/item.js +1 -1
  54. package/lib/cjs/form/baseForm.d.ts +6 -0
  55. package/lib/cjs/form/field.d.ts +6 -0
  56. package/lib/cjs/form/hoc/withField.js +3 -1
  57. package/lib/cjs/locale/source/es.d.ts +7 -0
  58. package/lib/cjs/locale/source/es.js +168 -0
  59. package/lib/cjs/modal/Modal.d.ts +8 -8
  60. package/lib/cjs/modal/Modal.js +4 -4
  61. package/lib/cjs/modal/confirm.d.ts +10 -10
  62. package/lib/cjs/navigation/index.d.ts +2 -2
  63. package/lib/cjs/pagination/index.js +9 -4
  64. package/lib/cjs/radio/radio.d.ts +1 -1
  65. package/lib/cjs/radio/radio.js +1 -0
  66. package/lib/cjs/radio/radioGroup.d.ts +1 -1
  67. package/lib/cjs/rating/item.js +3 -2
  68. package/lib/cjs/select/index.d.ts +10 -0
  69. package/lib/cjs/select/index.js +15 -9
  70. package/lib/cjs/table/Table.d.ts +1 -1
  71. package/lib/cjs/timePicker/TimePicker.d.ts +2 -2
  72. package/lib/cjs/timePicker/TimeShape.d.ts +1 -1
  73. package/lib/cjs/timePicker/index.d.ts +2 -2
  74. package/lib/cjs/timeline/item.d.ts +5 -2
  75. package/lib/cjs/timeline/item.js +13 -7
  76. package/lib/cjs/tree/treeNode.js +0 -2
  77. package/lib/cjs/treeSelect/index.js +1 -0
  78. package/lib/cjs/typography/title.d.ts +1 -1
  79. package/lib/cjs/upload/fileCard.d.ts +2 -0
  80. package/lib/cjs/upload/fileCard.js +70 -45
  81. package/lib/cjs/upload/index.d.ts +34 -4
  82. package/lib/cjs/upload/index.js +141 -25
  83. package/lib/cjs/upload/interface.d.ts +3 -0
  84. package/lib/es/_base/base.css +2 -2
  85. package/lib/es/_utils/index.d.ts +1 -0
  86. package/lib/es/_utils/index.js +3 -2
  87. package/lib/es/button/Button.d.ts +1 -0
  88. package/lib/es/button/buttonGroup.js +3 -3
  89. package/lib/es/cascader/index.d.ts +7 -0
  90. package/lib/es/cascader/index.js +34 -25
  91. package/lib/es/cascader/item.d.ts +2 -0
  92. package/lib/es/cascader/item.js +9 -2
  93. package/lib/es/checkbox/checkbox.js +4 -1
  94. package/lib/es/checkbox/checkboxGroup.d.ts +1 -0
  95. package/lib/es/checkbox/checkboxGroup.js +3 -1
  96. package/lib/es/datePicker/dateInput.d.ts +1 -1
  97. package/lib/es/datePicker/datePicker.d.ts +1 -1
  98. package/lib/es/datePicker/monthsGrid.d.ts +2 -1
  99. package/lib/es/datePicker/monthsGrid.js +6 -0
  100. package/lib/es/datePicker/navigation.js +48 -8
  101. package/lib/es/descriptions/item.js +1 -1
  102. package/lib/es/form/baseForm.d.ts +6 -0
  103. package/lib/es/form/field.d.ts +6 -0
  104. package/lib/es/form/hoc/withField.js +3 -1
  105. package/lib/es/locale/source/es.d.ts +7 -0
  106. package/lib/es/locale/source/es.js +157 -0
  107. package/lib/es/modal/Modal.d.ts +8 -8
  108. package/lib/es/modal/Modal.js +4 -4
  109. package/lib/es/modal/confirm.d.ts +10 -10
  110. package/lib/es/navigation/index.d.ts +2 -2
  111. package/lib/es/pagination/index.js +8 -4
  112. package/lib/es/radio/radio.d.ts +1 -1
  113. package/lib/es/radio/radio.js +1 -0
  114. package/lib/es/radio/radioGroup.d.ts +1 -1
  115. package/lib/es/rating/item.js +3 -2
  116. package/lib/es/select/index.d.ts +10 -0
  117. package/lib/es/select/index.js +19 -9
  118. package/lib/es/table/Table.d.ts +1 -1
  119. package/lib/es/timePicker/TimePicker.d.ts +2 -2
  120. package/lib/es/timePicker/TimeShape.d.ts +1 -1
  121. package/lib/es/timePicker/index.d.ts +2 -2
  122. package/lib/es/timeline/item.d.ts +5 -2
  123. package/lib/es/timeline/item.js +12 -7
  124. package/lib/es/tree/treeNode.js +0 -2
  125. package/lib/es/treeSelect/index.js +1 -0
  126. package/lib/es/typography/title.d.ts +1 -1
  127. package/lib/es/upload/fileCard.d.ts +2 -0
  128. package/lib/es/upload/fileCard.js +69 -44
  129. package/lib/es/upload/index.d.ts +34 -4
  130. package/lib/es/upload/index.js +141 -24
  131. package/lib/es/upload/interface.d.ts +3 -0
  132. package/locale/source/es.ts +160 -0
  133. package/modal/Modal.tsx +6 -6
  134. package/navigation/__test__/navigation.test.js +4 -4
  135. package/navigation/_story/AutoOpen/index.js +1 -1
  136. package/navigation/_story/WithChildren/index.js +1 -1
  137. package/navigation/_story/navigation.stories.js +1 -1
  138. package/navigation/_story/navigation.stories.tsx +4 -4
  139. package/navigation/index.tsx +2 -2
  140. package/package.json +16 -8
  141. package/pagination/_story/pagination.stories.js +11 -0
  142. package/pagination/index.tsx +9 -4
  143. package/popover/Arrow.tsx +1 -1
  144. package/radio/__test__/radioGroup.test.jsx +41 -6
  145. package/radio/_story/radio.stories.js +22 -11
  146. package/radio/radio.tsx +1 -0
  147. package/rating/item.tsx +2 -1
  148. package/select/_story/select.stories.js +39 -14
  149. package/select/index.tsx +21 -7
  150. package/table/_story/DynamicFilters/index.js +13 -16
  151. package/timeline/__test__/timeline.test.js +17 -1
  152. package/timeline/_story/timeline.stories.js +70 -6
  153. package/timeline/item.tsx +11 -6
  154. package/tooltip/_story/tooltip.stories.js +1 -1
  155. package/tree/_story/tree.stories.js +2 -2
  156. package/tree/treeNode.tsx +0 -2
  157. package/treeSelect/index.tsx +3 -2
  158. package/tsconfig.json +2 -1
  159. package/upload/__test__/upload.test.js +50 -1
  160. package/upload/fileCard.tsx +110 -95
  161. package/upload/index.tsx +155 -54
  162. package/upload/interface.ts +3 -0
@@ -48,6 +48,8 @@ class Navigation extends _react.PureComponent {
48
48
  onMonthClick,
49
49
  onNextMonth,
50
50
  onPrevMonth,
51
+ onPrevYear,
52
+ onNextYear,
51
53
  density,
52
54
  shouldBimonthSwitch,
53
55
  panelType
@@ -55,37 +57,75 @@ class Navigation extends _react.PureComponent {
55
57
  const btnTheme = 'borderless';
56
58
  const iconBtnSize = density === 'compact' ? 'default' : 'large';
57
59
  const btnNoHorizontalPadding = true;
58
- const buttonSize = density === 'compact' ? 'small' : 'default'; // Enable dual-panel synchronous switching, and the current panel is the left panel
60
+ const buttonSize = density === 'compact' ? 'small' : 'default';
61
+ const isLeftPanel = panelType === _constants.strings.PANEL_TYPE_LEFT;
62
+ const isRightPanel = panelType === _constants.strings.PANEL_TYPE_RIGHT; // syncSwitchMonth and the current panel is the left
59
63
 
60
- const bimonthSwitchWithLeftPanel = shouldBimonthSwitch && panelType === _constants.strings.PANEL_TYPE_LEFT; // Enable dual-panel synchronous switching, and the current panel is the right panel
64
+ const hiddenLeftPanelRightButtons = shouldBimonthSwitch && isLeftPanel; // syncSwitchMonth and the current panel is the right
65
+
66
+ const hiddenRightPanelLeftButtons = shouldBimonthSwitch && isRightPanel; // `visibility: hidden` will keep the icon in position
67
+
68
+ const leftButtonStyle = {};
69
+ const rightButtonStyle = {};
70
+
71
+ if (hiddenRightPanelLeftButtons) {
72
+ leftButtonStyle.visibility = 'hidden';
73
+ }
74
+
75
+ if (hiddenLeftPanelRightButtons) {
76
+ rightButtonStyle.visibility = 'hidden';
77
+ }
61
78
 
62
- const bimonthSwitchWithRightPanel = shouldBimonthSwitch && panelType === _constants.strings.PANEL_TYPE_RIGHT;
63
79
  const ref = forwardRef || this.navRef;
64
80
  return /*#__PURE__*/_react.default.createElement("div", {
65
81
  className: prefixCls,
66
82
  ref: ref
67
- }, !bimonthSwitchWithRightPanel && /*#__PURE__*/_react.default.createElement(_iconButton.default, {
83
+ }, /*#__PURE__*/_react.default.createElement(_iconButton.default, {
84
+ key: "double-chevron-left",
85
+ icon: /*#__PURE__*/_react.default.createElement(_semiIcons.IconDoubleChevronLeft, {
86
+ size: iconBtnSize
87
+ }),
88
+ size: buttonSize,
89
+ theme: btnTheme,
90
+ noHorizontalPadding: btnNoHorizontalPadding,
91
+ onClick: onPrevYear,
92
+ style: leftButtonStyle
93
+ }), /*#__PURE__*/_react.default.createElement(_iconButton.default, {
94
+ key: "chevron-left",
68
95
  icon: /*#__PURE__*/_react.default.createElement(_semiIcons.IconChevronLeft, {
69
96
  size: iconBtnSize
70
97
  }),
71
98
  size: buttonSize,
72
99
  onClick: onPrevMonth,
73
100
  theme: btnTheme,
74
- noHorizontalPadding: btnNoHorizontalPadding
101
+ noHorizontalPadding: btnNoHorizontalPadding,
102
+ style: leftButtonStyle
75
103
  }), /*#__PURE__*/_react.default.createElement("div", {
76
104
  className: "".concat(prefixCls, "-month")
77
105
  }, /*#__PURE__*/_react.default.createElement(_button.default, {
78
106
  onClick: onMonthClick,
79
107
  theme: btnTheme,
80
108
  size: buttonSize
81
- }, /*#__PURE__*/_react.default.createElement("span", null, monthText))), !bimonthSwitchWithLeftPanel && /*#__PURE__*/_react.default.createElement(_iconButton.default, {
109
+ }, /*#__PURE__*/_react.default.createElement("span", null, monthText))), /*#__PURE__*/_react.default.createElement(_iconButton.default, {
110
+ key: "chevron-right",
82
111
  icon: /*#__PURE__*/_react.default.createElement(_semiIcons.IconChevronRight, {
83
112
  size: iconBtnSize
84
113
  }),
85
114
  size: buttonSize,
86
115
  onClick: onNextMonth,
87
116
  theme: btnTheme,
88
- noHorizontalPadding: btnNoHorizontalPadding
117
+ noHorizontalPadding: btnNoHorizontalPadding,
118
+ style: rightButtonStyle
119
+ }), /*#__PURE__*/_react.default.createElement(_iconButton.default, {
120
+ key: "double-chevron-right",
121
+ icon: /*#__PURE__*/_react.default.createElement(_semiIcons.IconDoubleChevronRight, {
122
+ size: iconBtnSize
123
+ }),
124
+ size: buttonSize,
125
+ theme: btnTheme,
126
+ noHorizontalPadding: btnNoHorizontalPadding,
127
+ onClick: onNextYear,
128
+ style: rightButtonStyle
89
129
  }));
90
130
  }
91
131
 
@@ -60,7 +60,7 @@ class Item extends _react.PureComponent {
60
60
  className: "".concat(prefixCls, "-item")
61
61
  }, /*#__PURE__*/_react.default.createElement("span", {
62
62
  className: keyCls
63
- }, "".concat(itemKey, ":")), /*#__PURE__*/_react.default.createElement("span", {
63
+ }, itemKey, ":"), /*#__PURE__*/_react.default.createElement("span", {
64
64
  className: valCls
65
65
  }, typeof children === 'function' ? children() : children))) : /*#__PURE__*/_react.default.createElement("tr", {
66
66
  className: className,
@@ -53,6 +53,7 @@ declare class Form extends BaseComponent<BaseFormProps, BaseFormState> {
53
53
  static TextArea: React.ComponentType<import("utility-types").Subtract<Omit<import("../input").TextAreaProps, "forwardRef"> & React.RefAttributes<HTMLTextAreaElement>, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
54
54
  static InputNumber: React.ComponentType<import("utility-types").Subtract<import("../inputNumber").InputNumberProps & React.RefAttributes<HTMLInputElement>, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
55
55
  static Select: React.ComponentType<import("utility-types").Subtract<{
56
+ id?: string;
56
57
  autoFocus?: boolean;
57
58
  arrowIcon?: React.ReactNode;
58
59
  defaultValue?: string | number | any[] | Record<string, any>;
@@ -89,6 +90,11 @@ declare class Form extends BaseComponent<BaseFormProps, BaseFormState> {
89
90
  suffix?: React.ReactNode;
90
91
  prefix?: React.ReactNode;
91
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
+ }>;
92
98
  showClear?: boolean;
93
99
  showArrow?: boolean;
94
100
  renderSelectedItem?: import("../select").RenderSelectedItemFn;
@@ -3,6 +3,7 @@ declare const FormInput: import("react").ComponentType<import("utility-types").S
3
3
  declare const FormInputNumber: import("react").ComponentType<import("utility-types").Subtract<import("../inputNumber/index").InputNumberProps & import("react").RefAttributes<HTMLInputElement>, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
4
4
  declare const FormTextArea: import("react").ComponentType<import("utility-types").Subtract<Omit<import("../input/textarea").TextAreaProps, "forwardRef"> & import("react").RefAttributes<HTMLTextAreaElement>, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
5
5
  declare const FormSelect: import("react").ComponentType<import("utility-types").Subtract<{
6
+ id?: string;
6
7
  autoFocus?: boolean;
7
8
  arrowIcon?: import("react").ReactNode;
8
9
  defaultValue?: string | number | any[] | Record<string, any>;
@@ -39,6 +40,11 @@ declare const FormSelect: import("react").ComponentType<import("utility-types").
39
40
  suffix?: import("react").ReactNode;
40
41
  prefix?: import("react").ReactNode;
41
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
+ }>;
42
48
  showClear?: boolean;
43
49
  showArrow?: boolean;
44
50
  renderSelectedItem?: import("../select/index").RenderSelectedItemFn;
@@ -107,7 +107,9 @@ function withField(Component, opts) {
107
107
  // Return without injection, eg: <Checkbox> / <Radio> inside CheckboxGroup/RadioGroup
108
108
 
109
109
  if (!shouldInject) {
110
- return /*#__PURE__*/_react.default.createElement(Component, (0, _assign.default)({}, rest));
110
+ return /*#__PURE__*/_react.default.createElement(Component, (0, _assign.default)({}, rest, {
111
+ ref: ref
112
+ }));
111
113
  } // grab formState from context
112
114
 
113
115
 
@@ -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,168 @@
1
+ "use strict";
2
+
3
+ var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
4
+
5
+ _Object$defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+
9
+ exports.default = void 0;
10
+
11
+ var _locale = require("date-fns/locale");
12
+
13
+ /**
14
+ * [i18n-Spanish(es)]
15
+ *
16
+ */
17
+ const locale = {
18
+ code: 'es',
19
+ dateFnsLocale: _locale.es,
20
+ Pagination: {
21
+ item: 'objeto',
22
+ pageSize: ' objetos / página',
23
+ page: ' páginas',
24
+ total: '',
25
+ jumpTo: 'Ir a'
26
+ },
27
+ Modal: {
28
+ confirm: 'Aceptar',
29
+ cancel: 'Cancelar'
30
+ },
31
+ TimePicker: {
32
+ placeholder: {
33
+ time: 'Seleccionar hora',
34
+ timeRange: 'Seleccionar rango de tiempo'
35
+ },
36
+ begin: 'Hora inicial',
37
+ end: 'Hora final',
38
+ hour: '',
39
+ minute: '',
40
+ second: '',
41
+ AM: 'AM',
42
+ PM: 'PM'
43
+ },
44
+ DatePicker: {
45
+ placeholder: {
46
+ date: 'Seleccionar fecha',
47
+ dateTime: 'Seleccionar hora y fecha',
48
+ dateRange: ['Fecha inicial', 'Fecha final'],
49
+ dateTimeRange: ['Fecha inicial', 'Fecha final']
50
+ },
51
+ footer: {
52
+ confirm: 'Aceptar',
53
+ cancel: 'Cancelar'
54
+ },
55
+ selectDate: 'Seleccionar fecha',
56
+ selectTime: 'Seleccionar hora',
57
+ year: 'año',
58
+ month: 'mes',
59
+ day: 'día',
60
+ monthText: '${month} ${year}',
61
+ months: {
62
+ 1: 'Ene',
63
+ 2: 'Feb',
64
+ 3: 'Mar',
65
+ 4: 'Abr',
66
+ 5: 'May',
67
+ 6: 'Jun',
68
+ 7: 'Jul',
69
+ 8: 'Ago',
70
+ 9: 'Sep',
71
+ 10: 'Oct',
72
+ 11: 'Nov',
73
+ 12: 'Dic'
74
+ },
75
+ fullMonths: {
76
+ 1: 'Enero',
77
+ 2: 'Febrero',
78
+ 3: 'Marzo',
79
+ 4: 'Abril',
80
+ 5: 'Mayo',
81
+ 6: 'Junio',
82
+ 7: 'Julio',
83
+ 8: 'Agosto',
84
+ 9: 'Septiembre',
85
+ 10: 'Octubre',
86
+ 11: 'Noviembre',
87
+ 12: 'Diciembre'
88
+ },
89
+ weeks: {
90
+ Mon: 'Lun',
91
+ Tue: 'Mar',
92
+ Wed: 'Mie',
93
+ Thu: 'Jue',
94
+ Fri: 'Vie',
95
+ Sat: 'Sab',
96
+ Sun: 'Dom'
97
+ },
98
+ localeFormatToken: {
99
+ FORMAT_SWITCH_DATE: 'yyyy-MM-dd'
100
+ }
101
+ },
102
+ Popconfirm: {
103
+ confirm: 'Aceptar',
104
+ cancel: 'Cancelar'
105
+ },
106
+ Navigation: {
107
+ collapseText: 'Contraer barra lateral',
108
+ expandText: 'Expandir barra lateral'
109
+ },
110
+ Table: {
111
+ emptyText: 'Sin resultados',
112
+ pageText: 'Mostrando del ${currentStart} al ${currentEnd} de ${total}'
113
+ },
114
+ Select: {
115
+ emptyText: 'Sin resultados',
116
+ createText: 'Crear'
117
+ },
118
+ Tree: {
119
+ emptyText: 'Sin resultados',
120
+ searchPlaceholder: 'Búsqueda'
121
+ },
122
+ Cascader: {
123
+ emptyText: 'Sin resultados'
124
+ },
125
+ List: {
126
+ emptyText: 'Sin resultados'
127
+ },
128
+ Calendar: {
129
+ allDay: 'Todo el día',
130
+ AM: '${time} AM',
131
+ PM: '${time} PM',
132
+ datestring: '',
133
+ remaining: '${remained} mas'
134
+ },
135
+ Upload: {
136
+ mainText: 'Clic aquí para cargar archivo o arrastre aquí el archivo',
137
+ illegalTips: 'Este tipo de archivo no es compatible',
138
+ legalTips: 'Suelte y comience a cargar',
139
+ retry: 'Reintentar',
140
+ replace: 'Reemplazar archivo',
141
+ clear: 'Limpiar',
142
+ selectedFiles: 'Archivos seleccionados',
143
+ illegalSize: 'Tamaño de archivo inválido',
144
+ fail: 'Error al cargar'
145
+ },
146
+ TreeSelect: {
147
+ searchPlaceholder: 'Búsqueda'
148
+ },
149
+ Typography: {
150
+ copy: 'Copiar',
151
+ copied: 'Copiado',
152
+ expand: 'Expandir',
153
+ collapse: 'Contraer'
154
+ },
155
+ Transfer: {
156
+ emptyLeft: 'Sin datos',
157
+ emptySearch: 'Sin resultados de búsqueda',
158
+ emptyRight: 'Sin contenido, verifique desde la izquierda',
159
+ placeholder: 'Búsqueda',
160
+ clear: 'Limpiar',
161
+ selectAll: 'Seleccionar todo',
162
+ clearSelectAll: 'Deseleccionar todo',
163
+ total: 'Total ${total} objetos',
164
+ selected: '${total} objetos seleccionados'
165
+ }
166
+ };
167
+ var _default = locale;
168
+ exports.default = _default;
@@ -3,7 +3,7 @@ import ModalFoundation, { ModalAdapter, ModalProps, ModalState } from '@douyinfe
3
3
  import PropTypes from 'prop-types';
4
4
  import '@douyinfe/semi-foundation/lib/cjs/modal/modal.css';
5
5
  import BaseComponent from '../_base/baseComponent';
6
- import useModal from '../modal/useModal';
6
+ import useModal from './useModal';
7
7
  import { ButtonProps } from '../button/Button';
8
8
  export declare const destroyFns: any[];
9
9
  export declare type ConfirmType = 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom';
@@ -30,8 +30,8 @@ declare class Modal extends BaseComponent<ModalReactProps, ModalState> {
30
30
  closable: PropTypes.Requireable<boolean>;
31
31
  centered: PropTypes.Requireable<boolean>;
32
32
  visible: PropTypes.Requireable<boolean>;
33
- width: PropTypes.Requireable<number>;
34
- height: PropTypes.Requireable<number>;
33
+ width: PropTypes.Requireable<string | number>;
34
+ height: PropTypes.Requireable<string | number>;
35
35
  confirmLoading: PropTypes.Requireable<boolean>;
36
36
  cancelLoading: PropTypes.Requireable<boolean>;
37
37
  okText: PropTypes.Requireable<string>;
@@ -101,23 +101,23 @@ declare class Modal extends BaseComponent<ModalReactProps, ModalState> {
101
101
  static getScrollbarWidth(): number;
102
102
  static info: (props: ModalReactProps) => {
103
103
  destroy: () => void;
104
- update: (newConfig: import("../modal/confirm").ConfirmProps) => void;
104
+ update: (newConfig: import("./confirm").ConfirmProps) => void;
105
105
  };
106
106
  static success: (props: ModalReactProps) => {
107
107
  destroy: () => void;
108
- update: (newConfig: import("../modal/confirm").ConfirmProps) => void;
108
+ update: (newConfig: import("./confirm").ConfirmProps) => void;
109
109
  };
110
110
  static error: (props: ModalReactProps) => {
111
111
  destroy: () => void;
112
- update: (newConfig: import("../modal/confirm").ConfirmProps) => void;
112
+ update: (newConfig: import("./confirm").ConfirmProps) => void;
113
113
  };
114
114
  static warning: (props: ModalReactProps) => {
115
115
  destroy: () => void;
116
- update: (newConfig: import("../modal/confirm").ConfirmProps) => void;
116
+ update: (newConfig: import("./confirm").ConfirmProps) => void;
117
117
  };
118
118
  static confirm: (props: ModalReactProps) => {
119
119
  destroy: () => void;
120
- update: (newConfig: import("../modal/confirm").ConfirmProps) => void;
120
+ update: (newConfig: import("./confirm").ConfirmProps) => void;
121
121
  };
122
122
  static destroyAll: () => void;
123
123
  componentDidMount(): void;
@@ -48,9 +48,9 @@ require("@douyinfe/semi-foundation/lib/cjs/modal/modal.css");
48
48
 
49
49
  var _baseComponent = _interopRequireDefault(require("../_base/baseComponent"));
50
50
 
51
- var _confirm = _interopRequireWildcard(require("../modal/confirm"));
51
+ var _confirm = _interopRequireWildcard(require("./confirm"));
52
52
 
53
- var _useModal = _interopRequireDefault(require("../modal/useModal"));
53
+ var _useModal = _interopRequireDefault(require("./useModal"));
54
54
 
55
55
  function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
56
56
 
@@ -343,8 +343,8 @@ Modal.propTypes = {
343
343
  closable: _propTypes.default.bool,
344
344
  centered: _propTypes.default.bool,
345
345
  visible: _propTypes.default.bool,
346
- width: _propTypes.default.number,
347
- height: _propTypes.default.number,
346
+ width: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
347
+ height: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
348
348
  confirmLoading: _propTypes.default.bool,
349
349
  cancelLoading: _propTypes.default.bool,
350
350
  okText: _propTypes.default.string,
@@ -30,7 +30,7 @@ export declare function withInfo(props: ModalReactProps): {
30
30
  confirmLoading?: boolean;
31
31
  cancelLoading?: boolean;
32
32
  hasCancel?: boolean;
33
- height?: number;
33
+ height?: string | number;
34
34
  mask?: boolean;
35
35
  maskClosable?: boolean;
36
36
  maskFixed?: boolean;
@@ -38,7 +38,7 @@ export declare function withInfo(props: ModalReactProps): {
38
38
  okText?: string;
39
39
  okType?: import("@douyinfe/semi-foundation/lib/cjs/modal/modalFoundation").OKType;
40
40
  visible?: boolean;
41
- width?: number;
41
+ width?: string | number;
42
42
  zIndex?: number;
43
43
  getPopupContainer?: () => HTMLElement;
44
44
  closeOnEsc?: boolean;
@@ -71,7 +71,7 @@ export declare function withSuccess(props: ModalReactProps): {
71
71
  confirmLoading?: boolean;
72
72
  cancelLoading?: boolean;
73
73
  hasCancel?: boolean;
74
- height?: number;
74
+ height?: string | number;
75
75
  mask?: boolean;
76
76
  maskClosable?: boolean;
77
77
  maskFixed?: boolean;
@@ -79,7 +79,7 @@ export declare function withSuccess(props: ModalReactProps): {
79
79
  okText?: string;
80
80
  okType?: import("@douyinfe/semi-foundation/lib/cjs/modal/modalFoundation").OKType;
81
81
  visible?: boolean;
82
- width?: number;
82
+ width?: string | number;
83
83
  zIndex?: number;
84
84
  getPopupContainer?: () => HTMLElement;
85
85
  closeOnEsc?: boolean;
@@ -112,7 +112,7 @@ export declare function withWarning(props: ModalReactProps): {
112
112
  confirmLoading?: boolean;
113
113
  cancelLoading?: boolean;
114
114
  hasCancel?: boolean;
115
- height?: number;
115
+ height?: string | number;
116
116
  mask?: boolean;
117
117
  maskClosable?: boolean;
118
118
  maskFixed?: boolean;
@@ -120,7 +120,7 @@ export declare function withWarning(props: ModalReactProps): {
120
120
  okText?: string;
121
121
  okType?: import("@douyinfe/semi-foundation/lib/cjs/modal/modalFoundation").OKType;
122
122
  visible?: boolean;
123
- width?: number;
123
+ width?: string | number;
124
124
  zIndex?: number;
125
125
  getPopupContainer?: () => HTMLElement;
126
126
  closeOnEsc?: boolean;
@@ -153,7 +153,7 @@ export declare function withError(props: ModalReactProps): {
153
153
  confirmLoading?: boolean;
154
154
  cancelLoading?: boolean;
155
155
  hasCancel?: boolean;
156
- height?: number;
156
+ height?: string | number;
157
157
  mask?: boolean;
158
158
  maskClosable?: boolean;
159
159
  maskFixed?: boolean;
@@ -161,7 +161,7 @@ export declare function withError(props: ModalReactProps): {
161
161
  okText?: string;
162
162
  okType?: import("@douyinfe/semi-foundation/lib/cjs/modal/modalFoundation").OKType;
163
163
  visible?: boolean;
164
- width?: number;
164
+ width?: string | number;
165
165
  zIndex?: number;
166
166
  getPopupContainer?: () => HTMLElement;
167
167
  closeOnEsc?: boolean;
@@ -194,7 +194,7 @@ export declare function withConfirm(props: ModalReactProps): {
194
194
  confirmLoading?: boolean;
195
195
  cancelLoading?: boolean;
196
196
  hasCancel?: boolean;
197
- height?: number;
197
+ height?: string | number;
198
198
  mask?: boolean;
199
199
  maskClosable?: boolean;
200
200
  maskFixed?: boolean;
@@ -202,7 +202,7 @@ export declare function withConfirm(props: ModalReactProps): {
202
202
  okText?: string;
203
203
  okType?: import("@douyinfe/semi-foundation/lib/cjs/modal/modalFoundation").OKType;
204
204
  visible?: boolean;
205
- width?: number;
205
+ width?: string | number;
206
206
  zIndex?: number;
207
207
  getPopupContainer?: () => HTMLElement;
208
208
  closeOnEsc?: boolean;
@@ -36,8 +36,8 @@ export interface NavProps extends BaseProps {
36
36
  defaultIsCollapsed?: boolean;
37
37
  defaultOpenKeys?: React.ReactText[];
38
38
  defaultSelectedKeys?: React.ReactText[];
39
- footer?: React.ReactNode | NavHeaderProps;
40
- header?: React.ReactNode | NavFooterProps;
39
+ footer?: React.ReactNode | NavFooterProps;
40
+ header?: React.ReactNode | NavHeaderProps;
41
41
  isCollapsed?: boolean;
42
42
  items?: NavItems;
43
43
  limitIndent?: boolean;
@@ -40,6 +40,8 @@ var _constants2 = require("@douyinfe/semi-foundation/lib/cjs/popover/constants")
40
40
 
41
41
  var _semiIcons = require("@douyinfe/semi-icons");
42
42
 
43
+ var _warning = _interopRequireDefault(require("@douyinfe/semi-foundation/lib/cjs/utils/warning"));
44
+
43
45
  var _context7 = _interopRequireDefault(require("../configProvider/context"));
44
46
 
45
47
  var _localeConsumer = _interopRequireDefault(require("../locale/localeConsumer"));
@@ -78,6 +80,7 @@ class Pagination extends _baseComponent.default {
78
80
  this.foundation = new _foundation.default(this.adapter);
79
81
  this.renderDefaultPage = (0, _bind.default)(_context = this.renderDefaultPage).call(_context, this);
80
82
  this.renderSmallPage = (0, _bind.default)(_context2 = this.renderSmallPage).call(_context2, this);
83
+ (0, _warning.default)(Boolean(props.showSizeChanger && props.hideOnSinglePage), '[Semi Pagination] You should not use showSizeChanger and hideOnSinglePage in ths same time. At this time, hideOnSinglePage no longer takes effect, otherwise there may be a problem that the switch entry disappears');
81
84
  }
82
85
 
83
86
  get adapter() {
@@ -370,7 +373,8 @@ class Pagination extends _baseComponent.default {
370
373
  className,
371
374
  style,
372
375
  hideOnSinglePage,
373
- hoverShowPageSelect
376
+ hoverShowPageSelect,
377
+ showSizeChanger
374
378
  } = this.props;
375
379
  const paginationCls = (0, _classnames.default)("".concat(prefixCls, "-small"), prefixCls, className);
376
380
  const {
@@ -380,7 +384,7 @@ class Pagination extends _baseComponent.default {
380
384
  } = this.state;
381
385
  const totalPageNum = Math.ceil(total / pageSize);
382
386
 
383
- if (totalPageNum < 2 && hideOnSinglePage) {
387
+ if (totalPageNum < 2 && hideOnSinglePage && !showSizeChanger) {
384
388
  return null;
385
389
  }
386
390
 
@@ -410,13 +414,14 @@ class Pagination extends _baseComponent.default {
410
414
  showTotal,
411
415
  className,
412
416
  style,
413
- hideOnSinglePage
417
+ hideOnSinglePage,
418
+ showSizeChanger
414
419
  } = this.props;
415
420
  const paginationCls = (0, _classnames.default)(className, "".concat(prefixCls));
416
421
  const showTotalCls = "".concat(prefixCls, "-total");
417
422
  const totalPageNum = Math.ceil(total / pageSize);
418
423
 
419
- if (totalPageNum < 2 && hideOnSinglePage) {
424
+ if (totalPageNum < 2 && hideOnSinglePage && !showSizeChanger) {
420
425
  return null;
421
426
  }
422
427
 
@@ -65,7 +65,7 @@ declare class Radio extends BaseComponent<RadioProps, RadioState> {
65
65
  prefixCls?: string;
66
66
  name?: string;
67
67
  onChange?: (e: RadioChangeEvent) => void;
68
- buttonSize?: "small" | "large" | "middle";
68
+ buttonSize?: "small" | "middle" | "large";
69
69
  isCardRadio?: boolean;
70
70
  isPureCardRadio?: boolean;
71
71
  };
@@ -149,6 +149,7 @@ class Radio extends _baseComponent.default {
149
149
  ["".concat(prefix, "-cardRadioGroup")]: isCardRadioGroup,
150
150
  ["".concat(prefix, "-cardRadioGroup_disabled")]: isDisabled && isCardRadioGroup,
151
151
  ["".concat(prefix, "-cardRadioGroup_checked")]: isCardRadioGroup && realChecked && !isDisabled,
152
+ ["".concat(prefix, "-cardRadioGroup_checked_disabled")]: isCardRadioGroup && realChecked && isDisabled,
152
153
  ["".concat(prefix, "-cardRadioGroup_hover")]: isCardRadioGroup && !realChecked && isHover && !isDisabled,
153
154
  [className]: Boolean(className)
154
155
  });
@@ -40,7 +40,7 @@ declare class RadioGroup extends BaseComponent<RadioGroupProps, RadioGroupState>
40
40
  disabled: PropTypes.Requireable<boolean>;
41
41
  name: PropTypes.Requireable<string>;
42
42
  options: PropTypes.Requireable<any[]>;
43
- buttonSize: PropTypes.Requireable<"small" | "large" | "middle">;
43
+ buttonSize: PropTypes.Requireable<"small" | "middle" | "large">;
44
44
  type: PropTypes.Requireable<"default" | "button" | "card" | "pureCard">;
45
45
  value: PropTypes.Requireable<any>;
46
46
  onChange: PropTypes.Requireable<(...args: any[]) => any>;
@@ -99,7 +99,7 @@ class Item extends _react.PureComponent {
99
99
  height: size,
100
100
  fontSize: size
101
101
  } : {};
102
- const iconSize = size === 'small' ? 'default' : 'extra-large';
102
+ const iconSize = isCustomSize ? 'inherit' : size === 'small' ? 'default' : 'extra-large';
103
103
  const content = character ? character : /*#__PURE__*/_react.default.createElement(_semiIcons.IconStar, {
104
104
  size: iconSize
105
105
  });
@@ -114,7 +114,8 @@ class Item extends _react.PureComponent {
114
114
  "aria-checked": value > index ? 'true' : 'false',
115
115
  "aria-posinset": index + 1,
116
116
  "aria-setsize": count,
117
- tabIndex: 0
117
+ tabIndex: 0,
118
+ className: "".concat(prefixCls, "-wrapper")
118
119
  }, /*#__PURE__*/_react.default.createElement("div", {
119
120
  className: "".concat(prefixCls, "-first"),
120
121
  style: {
@@ -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/cjs/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/cjs/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;
@@ -48,6 +55,7 @@ export declare type RenderMultipleSelectedItemFn = (optionNode: Record<string, a
48
55
  };
49
56
  export declare type RenderSelectedItemFn = RenderSingleSelectedItemFn | RenderMultipleSelectedItemFn;
50
57
  export declare type SelectProps = {
58
+ id?: string;
51
59
  autoFocus?: boolean;
52
60
  arrowIcon?: React.ReactNode;
53
61
  defaultValue?: string | number | any[] | Record<string, any>;
@@ -84,6 +92,7 @@ export declare type SelectProps = {
84
92
  suffix?: React.ReactNode;
85
93
  prefix?: React.ReactNode;
86
94
  insetLabel?: React.ReactNode;
95
+ inputProps?: Subtract<InputProps, ExcludeInputType>;
87
96
  showClear?: boolean;
88
97
  showArrow?: boolean;
89
98
  renderSelectedItem?: RenderSelectedItemFn;
@@ -150,6 +159,7 @@ declare class Select extends BaseComponent<SelectProps, SelectState> {
150
159
  dropdownStyle: PropTypes.Requireable<object>;
151
160
  outerTopSlot: PropTypes.Requireable<PropTypes.ReactNodeLike>;
152
161
  innerTopSlot: PropTypes.Requireable<PropTypes.ReactNodeLike>;
162
+ inputProps: PropTypes.Requireable<object>;
153
163
  outerBottomSlot: PropTypes.Requireable<PropTypes.ReactNodeLike>;
154
164
  innerBottomSlot: PropTypes.Requireable<PropTypes.ReactNodeLike>;
155
165
  optionList: PropTypes.Requireable<any[]>;