@douyinfe/semi-ui 2.1.4 → 2.2.0-beta.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 (133) 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/button/Button.tsx +1 -0
  6. package/cascader/__test__/cascader.test.js +221 -0
  7. package/cascader/_story/cascader.stories.js +138 -0
  8. package/cascader/index.tsx +37 -21
  9. package/cascader/item.tsx +4 -2
  10. package/checkbox/checkbox.tsx +2 -0
  11. package/checkbox/checkboxGroup.tsx +3 -2
  12. package/datePicker/__test__/datePicker.test.js +85 -2
  13. package/datePicker/_story/datePicker.stories.js +29 -1
  14. package/datePicker/_story/v2/YearButton.jsx +17 -0
  15. package/datePicker/_story/v2/index.js +1 -0
  16. package/datePicker/monthsGrid.tsx +12 -1
  17. package/datePicker/navigation.tsx +55 -29
  18. package/descriptions/__test__/descriptions.test.js +27 -1
  19. package/descriptions/_story/descriptions.stories.js +52 -2
  20. package/descriptions/item.tsx +1 -1
  21. package/dist/css/semi.css +56 -32
  22. package/dist/css/semi.min.css +1 -1
  23. package/dist/umd/semi-ui.js +854 -258
  24. package/dist/umd/semi-ui.js.map +1 -1
  25. package/dist/umd/semi-ui.min.js +1 -1
  26. package/dist/umd/semi-ui.min.js.map +1 -1
  27. package/empty/index.tsx +2 -2
  28. package/form/_story/form.stories.js +0 -67
  29. package/form/hoc/withField.tsx +1 -1
  30. package/gulpfile.js +2 -1
  31. package/lib/cjs/_base/base.css +2 -2
  32. package/lib/cjs/_utils/index.d.ts +1 -0
  33. package/lib/cjs/_utils/index.js +12 -5
  34. package/lib/cjs/button/Button.d.ts +1 -0
  35. package/lib/cjs/cascader/index.d.ts +7 -0
  36. package/lib/cjs/cascader/index.js +35 -22
  37. package/lib/cjs/cascader/item.d.ts +2 -0
  38. package/lib/cjs/cascader/item.js +4 -2
  39. package/lib/cjs/checkbox/checkbox.js +3 -1
  40. package/lib/cjs/checkbox/checkboxGroup.d.ts +1 -0
  41. package/lib/cjs/checkbox/checkboxGroup.js +3 -1
  42. package/lib/cjs/datePicker/monthsGrid.d.ts +1 -0
  43. package/lib/cjs/datePicker/monthsGrid.js +6 -0
  44. package/lib/cjs/datePicker/navigation.js +47 -7
  45. package/lib/cjs/descriptions/item.js +1 -1
  46. package/lib/cjs/empty/index.d.ts +2 -2
  47. package/lib/cjs/empty/index.js +19 -18
  48. package/lib/cjs/form/baseForm.d.ts +6 -0
  49. package/lib/cjs/form/field.d.ts +6 -0
  50. package/lib/cjs/form/hoc/withField.js +3 -1
  51. package/lib/cjs/locale/source/es.d.ts +7 -0
  52. package/lib/cjs/locale/source/es.js +168 -0
  53. package/lib/cjs/modal/Modal.d.ts +2 -2
  54. package/lib/cjs/modal/Modal.js +2 -2
  55. package/lib/cjs/modal/confirm.d.ts +10 -10
  56. package/lib/cjs/navigation/index.d.ts +2 -2
  57. package/lib/cjs/pagination/index.js +9 -4
  58. package/lib/cjs/rating/item.js +1 -1
  59. package/lib/cjs/select/index.d.ts +10 -0
  60. package/lib/cjs/select/index.js +15 -9
  61. package/lib/cjs/timeline/item.d.ts +5 -2
  62. package/lib/cjs/timeline/item.js +13 -7
  63. package/lib/cjs/tree/treeNode.js +0 -2
  64. package/lib/cjs/upload/fileCard.d.ts +2 -0
  65. package/lib/cjs/upload/fileCard.js +70 -45
  66. package/lib/cjs/upload/index.d.ts +23 -2
  67. package/lib/cjs/upload/index.js +133 -25
  68. package/lib/cjs/upload/interface.d.ts +3 -0
  69. package/lib/es/_base/base.css +2 -2
  70. package/lib/es/_utils/index.d.ts +1 -0
  71. package/lib/es/_utils/index.js +12 -5
  72. package/lib/es/button/Button.d.ts +1 -0
  73. package/lib/es/cascader/index.d.ts +7 -0
  74. package/lib/es/cascader/index.js +34 -25
  75. package/lib/es/cascader/item.d.ts +2 -0
  76. package/lib/es/cascader/item.js +4 -2
  77. package/lib/es/checkbox/checkbox.js +3 -1
  78. package/lib/es/checkbox/checkboxGroup.d.ts +1 -0
  79. package/lib/es/checkbox/checkboxGroup.js +3 -1
  80. package/lib/es/datePicker/monthsGrid.d.ts +1 -0
  81. package/lib/es/datePicker/monthsGrid.js +6 -0
  82. package/lib/es/datePicker/navigation.js +48 -8
  83. package/lib/es/descriptions/item.js +1 -1
  84. package/lib/es/empty/index.d.ts +2 -2
  85. package/lib/es/empty/index.js +19 -18
  86. package/lib/es/form/baseForm.d.ts +6 -0
  87. package/lib/es/form/field.d.ts +6 -0
  88. package/lib/es/form/hoc/withField.js +3 -1
  89. package/lib/es/locale/source/es.d.ts +7 -0
  90. package/lib/es/locale/source/es.js +157 -0
  91. package/lib/es/modal/Modal.d.ts +2 -2
  92. package/lib/es/modal/Modal.js +2 -2
  93. package/lib/es/modal/confirm.d.ts +10 -10
  94. package/lib/es/navigation/index.d.ts +2 -2
  95. package/lib/es/pagination/index.js +8 -4
  96. package/lib/es/rating/item.js +1 -1
  97. package/lib/es/select/index.d.ts +10 -0
  98. package/lib/es/select/index.js +19 -9
  99. package/lib/es/timeline/item.d.ts +5 -2
  100. package/lib/es/timeline/item.js +12 -7
  101. package/lib/es/tree/treeNode.js +0 -2
  102. package/lib/es/upload/fileCard.d.ts +2 -0
  103. package/lib/es/upload/fileCard.js +69 -44
  104. package/lib/es/upload/index.d.ts +23 -2
  105. package/lib/es/upload/index.js +133 -24
  106. package/lib/es/upload/interface.d.ts +3 -0
  107. package/locale/source/es.ts +160 -0
  108. package/modal/Modal.tsx +4 -4
  109. package/navigation/__test__/navigation.test.js +4 -4
  110. package/navigation/_story/AutoOpen/index.js +1 -1
  111. package/navigation/_story/WithChildren/index.js +1 -1
  112. package/navigation/_story/navigation.stories.js +1 -1
  113. package/navigation/_story/navigation.stories.tsx +4 -4
  114. package/navigation/index.tsx +2 -2
  115. package/package.json +17 -9
  116. package/pagination/_story/pagination.stories.js +11 -0
  117. package/pagination/index.tsx +9 -4
  118. package/popover/Arrow.tsx +1 -1
  119. package/radio/_story/radio.stories.js +12 -1
  120. package/rating/item.tsx +1 -1
  121. package/select/_story/select.stories.js +39 -14
  122. package/select/index.tsx +21 -7
  123. package/table/_story/DynamicFilters/index.js +13 -16
  124. package/timeline/__test__/timeline.test.js +17 -1
  125. package/timeline/_story/timeline.stories.js +70 -6
  126. package/timeline/item.tsx +11 -6
  127. package/tooltip/_story/tooltip.stories.js +1 -1
  128. package/tree/_story/tree.stories.js +2 -2
  129. package/tree/treeNode.tsx +0 -2
  130. package/upload/__test__/upload.test.js +50 -1
  131. package/upload/fileCard.tsx +110 -95
  132. package/upload/index.tsx +147 -53
  133. package/upload/interface.ts +3 -0
@@ -31,6 +31,25 @@ const prefixCls = _constants.cssClasses.PREFIX;
31
31
  class Empty extends _baseComponent.default {
32
32
  constructor(props) {
33
33
  super(props);
34
+
35
+ this.observe = mutationsList => {
36
+ for (const mutation of mutationsList) {
37
+ if (mutation.type === 'attributes' && mutation.attributeName === 'theme-mode') {
38
+ this.updateMode();
39
+ }
40
+ }
41
+ };
42
+
43
+ this.updateMode = () => {
44
+ const val = this.body.getAttribute('theme-mode');
45
+
46
+ if (val !== this.state.mode) {
47
+ this.setState({
48
+ mode: val
49
+ });
50
+ }
51
+ };
52
+
34
53
  this.state = {
35
54
  mode: null
36
55
  };
@@ -54,24 +73,6 @@ class Empty extends _baseComponent.default {
54
73
  this.observer && this.observer.disconnect();
55
74
  }
56
75
 
57
- observe(mutationsList) {
58
- for (const mutation of mutationsList) {
59
- if (mutation.type === 'attributes' && mutation.attributeName === 'theme-mode') {
60
- this.updateMode();
61
- }
62
- }
63
- }
64
-
65
- updateMode() {
66
- const val = this.body.getAttribute('theme-mode');
67
-
68
- if (val !== this.state.mode) {
69
- this.setState({
70
- mode: val
71
- });
72
- }
73
- }
74
-
75
76
  render() {
76
77
  var _context;
77
78
 
@@ -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;
@@ -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>;
@@ -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
 
@@ -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
  });
@@ -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[]>;
@@ -402,39 +402,40 @@ class Select extends _baseComponent.default {
402
402
  const {
403
403
  size,
404
404
  multiple,
405
- disabled
405
+ disabled,
406
+ inputProps
406
407
  } = this.props;
408
+ const inputPropsCls = (0, _get2.default)(inputProps, 'className');
407
409
  const inputcls = (0, _classnames.default)("".concat(prefixcls, "-input"), {
408
410
  ["".concat(prefixcls, "-input-single")]: !multiple,
409
411
  ["".concat(prefixcls, "-input-multiple")]: multiple
410
- });
412
+ }, inputPropsCls);
411
413
  const {
412
414
  inputValue
413
415
  } = this.state;
414
- const inputProps = {
416
+ const selectInputProps = (0, _assign.default)({
415
417
  value: inputValue,
416
418
  disabled,
417
419
  className: inputcls,
418
420
  onChange: this.handleInputChange
419
- };
421
+ }, inputProps);
420
422
  let style = {}; // Multiple choice mode
421
423
 
422
424
  if (multiple) {
423
425
  style = {
424
426
  width: inputValue ? "".concat(inputValue.length * 16, "px") : '2px'
425
427
  };
426
- inputProps.style = style;
428
+ selectInputProps.style = style;
427
429
  }
428
430
 
429
431
  return /*#__PURE__*/_react.default.createElement(_index3.default, (0, _assign.default)({
430
432
  ref: this.inputRef,
431
- size: size
432
- }, inputProps, {
433
+ size: size,
433
434
  onFocus: e => {
434
435
  // prevent event bubbling which will fire trigger onFocus event
435
436
  e.stopPropagation(); // e.nativeEvent.stopImmediatePropagation();
436
437
  }
437
- }));
438
+ }, selectInputProps));
438
439
  }
439
440
 
440
441
  close() {
@@ -762,7 +763,9 @@ class Select extends _baseComponent.default {
762
763
  key: value
763
764
  }), content);
764
765
  } else {
765
- return content;
766
+ return /*#__PURE__*/_react.default.createElement(_react.Fragment, {
767
+ key: value
768
+ }, content);
766
769
  }
767
770
  });
768
771
  const contentWrapperCls = (0, _classnames.default)({
@@ -873,6 +876,7 @@ class Select extends _baseComponent.default {
873
876
  multiple,
874
877
  filter,
875
878
  style,
879
+ id,
876
880
  size,
877
881
  className,
878
882
  validateStatus,
@@ -946,6 +950,7 @@ class Select extends _baseComponent.default {
946
950
  ref: ref => this.triggerRef.current = ref,
947
951
  onClick: e => this.foundation.handleClick(e),
948
952
  style: style,
953
+ id: id,
949
954
  tabIndex: tabIndex,
950
955
  onMouseEnter: this.onMouseEnter,
951
956
  onMouseLeave: this.onMouseLeave,
@@ -1031,6 +1036,7 @@ Select.propTypes = {
1031
1036
  dropdownStyle: _propTypes.default.object,
1032
1037
  outerTopSlot: _propTypes.default.node,
1033
1038
  innerTopSlot: _propTypes.default.node,
1039
+ inputProps: _propTypes.default.object,
1034
1040
  outerBottomSlot: _propTypes.default.node,
1035
1041
  innerBottomSlot: _propTypes.default.node,
1036
1042
  optionList: _propTypes.default.array,
@@ -3,28 +3,31 @@ import PropTypes from 'prop-types';
3
3
  import '@douyinfe/semi-foundation/lib/cjs/timeline/timeline.css';
4
4
  export interface TimelineItemProps {
5
5
  color?: string;
6
- time?: string;
6
+ time?: React.ReactNode;
7
7
  type?: 'default' | 'ongoing' | 'success' | 'warning' | 'error';
8
8
  dot?: React.ReactNode;
9
9
  extra?: React.ReactNode;
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: {
16
17
  color: PropTypes.Requireable<string>;
17
- time: PropTypes.Requireable<string>;
18
+ time: PropTypes.Requireable<PropTypes.ReactNodeLike>;
18
19
  type: PropTypes.Requireable<string>;
19
20
  dot: PropTypes.Requireable<PropTypes.ReactNodeLike>;
20
21
  extra: PropTypes.Requireable<PropTypes.ReactNodeLike>;
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
  }