@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
@@ -84,7 +84,8 @@ class Checkbox extends BaseComponent {
84
84
  onMouseEnter,
85
85
  onMouseLeave,
86
86
  extra,
87
- value
87
+ value,
88
+ id
88
89
  } = this.props;
89
90
  const {
90
91
  checked
@@ -125,6 +126,7 @@ class Checkbox extends BaseComponent {
125
126
  ["".concat(prefix, "-cardType_disabled")]: props.disabled && props.isCardType,
126
127
  ["".concat(prefix, "-cardType_unDisabled")]: !(props.disabled && props.isCardType),
127
128
  ["".concat(prefix, "-cardType_checked")]: props.isCardType && props.checked && !props.disabled,
129
+ ["".concat(prefix, "-cardType_checked_disabled")]: props.isCardType && props.checked && props.disabled,
128
130
  [className]: Boolean(className)
129
131
  });
130
132
  const extraCls = classnames("".concat(prefix, "-extra"), {
@@ -141,6 +143,7 @@ class Checkbox extends BaseComponent {
141
143
  return /*#__PURE__*/React.createElement("span", {
142
144
  style: style,
143
145
  className: wrapper,
146
+ id: id,
144
147
  onMouseEnter: onMouseEnter,
145
148
  onMouseLeave: onMouseLeave,
146
149
  onClick: this.handleChange
@@ -18,6 +18,7 @@ export declare type CheckboxGroupProps = {
18
18
  style?: React.CSSProperties;
19
19
  className?: string;
20
20
  type?: CheckboxType;
21
+ id?: string;
21
22
  };
22
23
  export declare type CheckboxGroupState = {
23
24
  value?: any[];
@@ -67,6 +67,7 @@ class CheckboxGroup extends BaseComponent {
67
67
  prefixCls,
68
68
  direction,
69
69
  className,
70
+ id,
70
71
  style,
71
72
  type
72
73
  } = this.props;
@@ -118,7 +119,8 @@ class CheckboxGroup extends BaseComponent {
118
119
 
119
120
  return /*#__PURE__*/React.createElement("div", {
120
121
  className: prefixClsDisplay,
121
- style: style
122
+ style: style,
123
+ id: id
122
124
  }, /*#__PURE__*/React.createElement(Context.Provider, {
123
125
  value: {
124
126
  checkboxGroup: {
@@ -24,7 +24,7 @@ export default class DateInput extends BaseComponent<DateInputProps, {}> {
24
24
  onFocus: PropTypes.Requireable<(...args: any[]) => any>;
25
25
  value: PropTypes.Requireable<any[]>;
26
26
  disabled: PropTypes.Requireable<boolean>;
27
- type: PropTypes.Requireable<"date" | "month" | "dateTime" | "dateRange" | "year" | "dateTimeRange">;
27
+ type: PropTypes.Requireable<"dateTime" | "date" | "month" | "dateRange" | "year" | "dateTimeRange">;
28
28
  multiple: PropTypes.Requireable<boolean>;
29
29
  showClear: PropTypes.Requireable<boolean>;
30
30
  format: PropTypes.Requireable<string>;
@@ -29,7 +29,7 @@ export declare type DatePickerState = DatePickerFoundationState;
29
29
  export default class DatePicker extends BaseComponent<DatePickerProps, DatePickerState> {
30
30
  static contextType: React.Context<import("../configProvider/context").ContextValue>;
31
31
  static propTypes: {
32
- type: PropTypes.Requireable<"date" | "month" | "dateTime" | "dateRange" | "year" | "dateTimeRange">;
32
+ type: PropTypes.Requireable<"dateTime" | "date" | "month" | "dateRange" | "year" | "dateTimeRange">;
33
33
  size: PropTypes.Requireable<"default" | "small" | "large">;
34
34
  density: PropTypes.Requireable<"default" | "compact">;
35
35
  defaultValue: PropTypes.Requireable<string | number | object>;
@@ -17,7 +17,7 @@ export interface MonthsGridProps extends MonthsGridFoundationProps, BaseProps {
17
17
  export declare type MonthsGridState = MonthsGridFoundationState;
18
18
  export default class MonthsGrid extends BaseComponent<MonthsGridProps, MonthsGridState> {
19
19
  static propTypes: {
20
- type: PropTypes.Requireable<"date" | "month" | "dateTime" | "dateRange" | "year" | "dateTimeRange">;
20
+ type: PropTypes.Requireable<"dateTime" | "date" | "month" | "dateRange" | "year" | "dateTimeRange">;
21
21
  defaultValue: PropTypes.Requireable<string | number | object>;
22
22
  defaultPickerValue: PropTypes.Requireable<string | number | object>;
23
23
  multiple: PropTypes.Requireable<boolean>;
@@ -81,6 +81,7 @@ export default class MonthsGrid extends BaseComponent<MonthsGridProps, MonthsGri
81
81
  renderMonth(month: Date, panelType: PanelType): JSX.Element;
82
82
  handleWeeksRowNumChange: (weeksRowNum: number, panelType: PanelType) => void;
83
83
  reselect: () => void;
84
+ getYAMOpenType: () => "left" | "right" | "none" | "both";
84
85
  renderTimePicker(panelType: PanelType, panelDetail: MonthInfo): JSX.Element;
85
86
  renderYearAndMonth(panelType: PanelType, panelDetail: MonthInfo): JSX.Element;
86
87
  renderSwitch(panelType: PanelType): JSX.Element;
@@ -124,6 +124,10 @@ export default class MonthsGrid extends BaseComponent {
124
124
  });
125
125
  };
126
126
 
127
+ this.getYAMOpenType = () => {
128
+ return this.foundation.getYAMOpenType();
129
+ };
130
+
127
131
  let nowDate = _Array$isArray(props.defaultPickerValue) ? props.defaultPickerValue[0] : props.defaultPickerValue;
128
132
  const validFormat = props.format || getDefaultFormatTokenByType(props.type);
129
133
 
@@ -615,9 +619,11 @@ export default class MonthsGrid extends BaseComponent {
615
619
  content = 'year month';
616
620
  }
617
621
 
622
+ const yearOpenType = this.getYAMOpenType();
618
623
  return /*#__PURE__*/React.createElement("div", {
619
624
  className: monthGridCls,
620
625
  "x-type": type,
626
+ "x-panel-yearandmonth-open-type": yearOpenType,
621
627
  ref: current => this.cacheRefCurrent('monthGrid', current)
622
628
  }, content);
623
629
  }
@@ -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,
@@ -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;
@@ -70,7 +70,9 @@ function withField(Component, opts) {
70
70
  // Return without injection, eg: <Checkbox> / <Radio> inside CheckboxGroup/RadioGroup
71
71
 
72
72
  if (!shouldInject) {
73
- return /*#__PURE__*/React.createElement(Component, _Object$assign({}, rest));
73
+ return /*#__PURE__*/React.createElement(Component, _Object$assign({}, rest, {
74
+ ref: ref
75
+ }));
74
76
  } // grab formState from context
75
77
 
76
78
 
@@ -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;
@@ -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/es/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;
@@ -29,8 +29,8 @@ import cls from 'classnames';
29
29
  import PropTypes from 'prop-types';
30
30
  import '@douyinfe/semi-foundation/lib/es/modal/modal.css';
31
31
  import BaseComponent from '../_base/baseComponent';
32
- import confirm, { withConfirm, withError, withInfo, withSuccess, withWarning } from '../modal/confirm';
33
- import useModal from '../modal/useModal';
32
+ import confirm, { withConfirm, withError, withInfo, withSuccess, withWarning } from './confirm';
33
+ import useModal from './useModal';
34
34
  export const destroyFns = [];
35
35
 
36
36
  class Modal extends BaseComponent {
@@ -304,8 +304,8 @@ Modal.propTypes = {
304
304
  closable: PropTypes.bool,
305
305
  centered: PropTypes.bool,
306
306
  visible: PropTypes.bool,
307
- width: PropTypes.number,
308
- height: PropTypes.number,
307
+ width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
308
+ height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
309
309
  confirmLoading: PropTypes.bool,
310
310
  cancelLoading: PropTypes.bool,
311
311
  okText: PropTypes.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/es/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/es/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/es/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/es/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/es/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;