@douyinfe/semi-ui 2.36.0-alpha.0 → 2.36.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.
- package/dist/css/semi.css +166 -510
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +247 -277
- package/dist/umd/semi-ui.js.map +1 -1
- package/dist/umd/semi-ui.min.js +1 -1
- package/dist/umd/semi-ui.min.js.map +1 -1
- package/lib/cjs/anchor/index.d.ts +3 -2
- package/lib/cjs/anchor/link.js +13 -6
- package/lib/cjs/autoComplete/index.d.ts +1 -1
- package/lib/cjs/button/Button.d.ts +1 -1
- package/lib/cjs/button/buttonGroup.d.ts +1 -1
- package/lib/cjs/button/index.d.ts +1 -1
- package/lib/cjs/calendar/dayCalendar.d.ts +2 -1
- package/lib/cjs/calendar/dayCalendar.js +7 -2
- package/lib/cjs/calendar/index.d.ts +1 -0
- package/lib/cjs/calendar/index.js +1 -0
- package/lib/cjs/calendar/interface.d.ts +2 -0
- package/lib/cjs/calendar/monthCalendar.d.ts +1 -1
- package/lib/cjs/calendar/monthCalendar.js +12 -4
- package/lib/cjs/calendar/rangeCalendar.d.ts +3 -1
- package/lib/cjs/calendar/rangeCalendar.js +23 -9
- package/lib/cjs/calendar/weekCalendar.d.ts +3 -1
- package/lib/cjs/calendar/weekCalendar.js +23 -9
- package/lib/cjs/collapse/item.d.ts +0 -2
- package/lib/cjs/collapse/item.js +2 -3
- package/lib/cjs/datePicker/dateInput.d.ts +1 -1
- package/lib/cjs/datePicker/datePicker.d.ts +2 -2
- package/lib/cjs/datePicker/datePicker.js +12 -4
- package/lib/cjs/datePicker/monthsGrid.d.ts +1 -1
- package/lib/cjs/datePicker/monthsGrid.js +6 -2
- package/lib/cjs/datePicker/yearAndMonth.d.ts +3 -1
- package/lib/cjs/datePicker/yearAndMonth.js +4 -2
- package/lib/cjs/form/baseForm.d.ts +1 -1
- package/lib/cjs/form/field.d.ts +1 -1
- package/lib/cjs/input/index.d.ts +1 -1
- package/lib/cjs/input/inputGroup.d.ts +1 -1
- package/lib/cjs/input/textarea.d.ts +1 -1
- package/lib/cjs/modal/confirm.d.ts +17 -17
- package/lib/cjs/navigation/Footer.d.ts +3 -0
- package/lib/cjs/navigation/Footer.js +19 -9
- package/lib/cjs/navigation/Item.d.ts +0 -4
- package/lib/cjs/navigation/Item.js +10 -29
- package/lib/cjs/navigation/SubNav.d.ts +1 -18
- package/lib/cjs/navigation/SubNav.js +30 -70
- package/lib/cjs/navigation/index.d.ts +4 -1
- package/lib/cjs/navigation/index.js +7 -1
- package/lib/cjs/rating/index.d.ts +1 -1
- package/lib/cjs/rating/item.d.ts +1 -1
- package/lib/cjs/select/index.d.ts +2 -1
- package/lib/cjs/select/index.js +4 -0
- package/lib/cjs/skeleton/index.d.ts +0 -1
- package/lib/cjs/skeleton/index.js +0 -1
- package/lib/cjs/skeleton/item.d.ts +0 -1
- package/lib/cjs/skeleton/item.js +1 -6
- package/lib/cjs/steps/basicStep.d.ts +0 -3
- package/lib/cjs/steps/basicStep.js +2 -8
- package/lib/cjs/steps/basicSteps.js +1 -2
- package/lib/cjs/steps/fillStep.d.ts +0 -2
- package/lib/cjs/steps/fillStep.js +1 -3
- package/lib/cjs/steps/fillSteps.js +8 -5
- package/lib/cjs/steps/index.d.ts +1 -63
- package/lib/cjs/steps/index.js +0 -9
- package/lib/cjs/steps/navStep.d.ts +0 -3
- package/lib/cjs/steps/navStep.js +2 -6
- package/lib/cjs/steps/navSteps.js +1 -2
- package/lib/cjs/steps/step.d.ts +1 -4
- package/lib/cjs/steps/step.js +0 -1
- package/lib/cjs/switch/index.d.ts +1 -1
- package/lib/cjs/table/Body/index.d.ts +1 -1
- package/lib/cjs/table/ResizableTable.d.ts +1 -1
- package/lib/cjs/table/Table.d.ts +2 -2
- package/lib/cjs/table/TableHeaderRow.js +22 -14
- package/lib/cjs/table/index.d.ts +1 -1
- package/lib/cjs/table/interface.d.ts +5 -1
- package/lib/cjs/tagInput/index.d.ts +1 -1
- package/lib/cjs/timePicker/TimePicker.d.ts +1 -1
- package/lib/cjs/timePicker/index.d.ts +1 -1
- package/lib/cjs/timeline/index.d.ts +1 -2
- package/lib/cjs/timeline/index.js +2 -8
- package/lib/cjs/timeline/item.d.ts +0 -10
- package/lib/cjs/timeline/item.js +3 -42
- package/lib/cjs/typography/base.d.ts +1 -0
- package/lib/cjs/typography/base.js +28 -14
- package/lib/cjs/typography/title.d.ts +2 -0
- package/lib/cjs/typography/title.js +2 -1
- package/lib/es/anchor/index.d.ts +3 -2
- package/lib/es/anchor/link.js +12 -6
- package/lib/es/autoComplete/index.d.ts +1 -1
- package/lib/es/button/Button.d.ts +1 -1
- package/lib/es/button/buttonGroup.d.ts +1 -1
- package/lib/es/button/index.d.ts +1 -1
- package/lib/es/calendar/dayCalendar.d.ts +2 -1
- package/lib/es/calendar/dayCalendar.js +7 -2
- package/lib/es/calendar/index.d.ts +1 -0
- package/lib/es/calendar/index.js +1 -0
- package/lib/es/calendar/interface.d.ts +2 -0
- package/lib/es/calendar/monthCalendar.d.ts +1 -1
- package/lib/es/calendar/monthCalendar.js +12 -4
- package/lib/es/calendar/rangeCalendar.d.ts +3 -1
- package/lib/es/calendar/rangeCalendar.js +19 -9
- package/lib/es/calendar/weekCalendar.d.ts +3 -1
- package/lib/es/calendar/weekCalendar.js +19 -9
- package/lib/es/collapse/item.d.ts +0 -2
- package/lib/es/collapse/item.js +2 -3
- package/lib/es/datePicker/dateInput.d.ts +1 -1
- package/lib/es/datePicker/datePicker.d.ts +2 -2
- package/lib/es/datePicker/datePicker.js +12 -4
- package/lib/es/datePicker/monthsGrid.d.ts +1 -1
- package/lib/es/datePicker/monthsGrid.js +6 -2
- package/lib/es/datePicker/yearAndMonth.d.ts +3 -1
- package/lib/es/datePicker/yearAndMonth.js +4 -2
- package/lib/es/form/baseForm.d.ts +1 -1
- package/lib/es/form/field.d.ts +1 -1
- package/lib/es/input/index.d.ts +1 -1
- package/lib/es/input/inputGroup.d.ts +1 -1
- package/lib/es/input/textarea.d.ts +1 -1
- package/lib/es/modal/confirm.d.ts +17 -17
- package/lib/es/navigation/Footer.d.ts +3 -0
- package/lib/es/navigation/Footer.js +16 -7
- package/lib/es/navigation/Item.d.ts +0 -4
- package/lib/es/navigation/Item.js +10 -28
- package/lib/es/navigation/SubNav.d.ts +1 -18
- package/lib/es/navigation/SubNav.js +31 -72
- package/lib/es/navigation/index.d.ts +4 -1
- package/lib/es/navigation/index.js +7 -1
- package/lib/es/rating/index.d.ts +1 -1
- package/lib/es/rating/item.d.ts +1 -1
- package/lib/es/select/index.d.ts +2 -1
- package/lib/es/select/index.js +4 -0
- package/lib/es/skeleton/index.d.ts +0 -1
- package/lib/es/skeleton/index.js +0 -1
- package/lib/es/skeleton/item.d.ts +0 -1
- package/lib/es/skeleton/item.js +1 -6
- package/lib/es/steps/basicStep.d.ts +0 -3
- package/lib/es/steps/basicStep.js +2 -8
- package/lib/es/steps/basicSteps.js +1 -2
- package/lib/es/steps/fillStep.d.ts +0 -2
- package/lib/es/steps/fillStep.js +1 -3
- package/lib/es/steps/fillSteps.js +8 -6
- package/lib/es/steps/index.d.ts +1 -63
- package/lib/es/steps/index.js +0 -6
- package/lib/es/steps/navStep.d.ts +0 -3
- package/lib/es/steps/navStep.js +2 -6
- package/lib/es/steps/navSteps.js +1 -2
- package/lib/es/steps/step.d.ts +1 -4
- package/lib/es/steps/step.js +0 -1
- package/lib/es/switch/index.d.ts +1 -1
- package/lib/es/table/Body/index.d.ts +1 -1
- package/lib/es/table/ResizableTable.d.ts +1 -1
- package/lib/es/table/Table.d.ts +2 -2
- package/lib/es/table/TableHeaderRow.js +22 -14
- package/lib/es/table/index.d.ts +1 -1
- package/lib/es/table/interface.d.ts +5 -1
- package/lib/es/tagInput/index.d.ts +1 -1
- package/lib/es/timePicker/TimePicker.d.ts +1 -1
- package/lib/es/timePicker/index.d.ts +1 -1
- package/lib/es/timeline/index.d.ts +1 -2
- package/lib/es/timeline/index.js +2 -7
- package/lib/es/timeline/item.d.ts +0 -10
- package/lib/es/timeline/item.js +3 -41
- package/lib/es/typography/base.d.ts +1 -0
- package/lib/es/typography/base.js +28 -14
- package/lib/es/typography/title.d.ts +2 -0
- package/lib/es/typography/title.js +2 -1
- package/package.json +8 -9
- package/lib/cjs/timeline/context.d.ts +0 -8
- package/lib/cjs/timeline/context.js +0 -15
- package/lib/es/timeline/context.d.ts +0 -8
- package/lib/es/timeline/context.js +0 -3
package/lib/es/collapse/item.js
CHANGED
|
@@ -95,7 +95,7 @@ export default class CollapsePanel extends PureComponent {
|
|
|
95
95
|
activeSet,
|
|
96
96
|
motion
|
|
97
97
|
} = this.context;
|
|
98
|
-
const active =
|
|
98
|
+
const active = activeSet.has(itemKey);
|
|
99
99
|
const itemCls = cls(className, {
|
|
100
100
|
[`${cssClasses.PREFIX}-item`]: true
|
|
101
101
|
});
|
|
@@ -145,5 +145,4 @@ CollapsePanel.propTypes = {
|
|
|
145
145
|
CollapsePanel.defaultProps = {
|
|
146
146
|
showArrow: true,
|
|
147
147
|
disabled: false
|
|
148
|
-
};
|
|
149
|
-
CollapsePanel.elementType = 'Collapse.Panel';
|
|
148
|
+
};
|
|
@@ -30,7 +30,7 @@ export default class DateInput extends BaseComponent<DateInputProps, {}> {
|
|
|
30
30
|
onFocus: PropTypes.Requireable<(...args: any[]) => any>;
|
|
31
31
|
value: PropTypes.Requireable<any[]>;
|
|
32
32
|
disabled: PropTypes.Requireable<boolean>;
|
|
33
|
-
type: PropTypes.Requireable<"
|
|
33
|
+
type: PropTypes.Requireable<"dateTime" | "date" | "month" | "dateRange" | "year" | "monthRange" | "dateTimeRange">;
|
|
34
34
|
showClear: PropTypes.Requireable<boolean>;
|
|
35
35
|
format: PropTypes.Requireable<string>;
|
|
36
36
|
inputStyle: PropTypes.Requireable<object>;
|
|
@@ -58,8 +58,8 @@ export default class DatePicker extends BaseComponent<DatePickerProps, DatePicke
|
|
|
58
58
|
'aria-labelledby': PropTypes.Requireable<string>;
|
|
59
59
|
'aria-required': PropTypes.Requireable<boolean>;
|
|
60
60
|
borderless: PropTypes.Requireable<boolean>;
|
|
61
|
-
type: PropTypes.Requireable<"
|
|
62
|
-
size: PropTypes.Requireable<"
|
|
61
|
+
type: PropTypes.Requireable<"dateTime" | "date" | "month" | "dateRange" | "year" | "monthRange" | "dateTimeRange">;
|
|
62
|
+
size: PropTypes.Requireable<"default" | "small" | "large">;
|
|
63
63
|
clearIcon: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
64
64
|
density: PropTypes.Requireable<"default" | "compact">;
|
|
65
65
|
defaultValue: PropTypes.Requireable<NonNullable<string | number | object>>;
|
|
@@ -170,7 +170,9 @@ export default class DatePicker extends BaseComponent {
|
|
|
170
170
|
density,
|
|
171
171
|
presetPosition,
|
|
172
172
|
yearAndMonthOpts,
|
|
173
|
-
type
|
|
173
|
+
type,
|
|
174
|
+
startYear,
|
|
175
|
+
endYear
|
|
174
176
|
} = this.props;
|
|
175
177
|
const date = this.state.value[0];
|
|
176
178
|
const year = {
|
|
@@ -210,7 +212,9 @@ export default class DatePicker extends BaseComponent {
|
|
|
210
212
|
renderQuickControls: this.renderQuickControls(),
|
|
211
213
|
renderDateInput: this.renderDateInput(),
|
|
212
214
|
type: type,
|
|
213
|
-
yearAndMonthOpts: yearAndMonthOpts
|
|
215
|
+
yearAndMonthOpts: yearAndMonthOpts,
|
|
216
|
+
startYear: startYear,
|
|
217
|
+
endYear: endYear
|
|
214
218
|
});
|
|
215
219
|
};
|
|
216
220
|
|
|
@@ -608,7 +612,9 @@ export default class DatePicker extends BaseComponent {
|
|
|
608
612
|
triggerRender,
|
|
609
613
|
insetInput,
|
|
610
614
|
presetPosition,
|
|
611
|
-
yearAndMonthOpts
|
|
615
|
+
yearAndMonthOpts,
|
|
616
|
+
startYear,
|
|
617
|
+
endYear
|
|
612
618
|
} = this.props;
|
|
613
619
|
const {
|
|
614
620
|
cachedSelectedValue,
|
|
@@ -652,7 +658,9 @@ export default class DatePicker extends BaseComponent {
|
|
|
652
658
|
presetPosition: presetPosition,
|
|
653
659
|
renderQuickControls: this.renderQuickControls(),
|
|
654
660
|
renderDateInput: this.renderDateInput(),
|
|
655
|
-
yearAndMonthOpts: yearAndMonthOpts
|
|
661
|
+
yearAndMonthOpts: yearAndMonthOpts,
|
|
662
|
+
startYear: startYear,
|
|
663
|
+
endYear: endYear
|
|
656
664
|
});
|
|
657
665
|
}
|
|
658
666
|
|
|
@@ -19,7 +19,7 @@ export interface MonthsGridProps extends MonthsGridFoundationProps, BaseProps {
|
|
|
19
19
|
export declare type MonthsGridState = MonthsGridFoundationState;
|
|
20
20
|
export default class MonthsGrid extends BaseComponent<MonthsGridProps, MonthsGridState> {
|
|
21
21
|
static propTypes: {
|
|
22
|
-
type: PropTypes.Requireable<"
|
|
22
|
+
type: PropTypes.Requireable<"dateTime" | "date" | "month" | "dateRange" | "year" | "monthRange" | "dateTimeRange">;
|
|
23
23
|
defaultValue: PropTypes.Requireable<any[]>;
|
|
24
24
|
defaultPickerValue: PropTypes.Requireable<NonNullable<string | number | object>>;
|
|
25
25
|
multiple: PropTypes.Requireable<boolean>;
|
|
@@ -474,7 +474,9 @@ export default class MonthsGrid extends BaseComponent {
|
|
|
474
474
|
locale,
|
|
475
475
|
localeCode,
|
|
476
476
|
density,
|
|
477
|
-
yearAndMonthOpts
|
|
477
|
+
yearAndMonthOpts,
|
|
478
|
+
startYear,
|
|
479
|
+
endYear
|
|
478
480
|
} = this.props;
|
|
479
481
|
const y = pickerDate.getFullYear();
|
|
480
482
|
const m = pickerDate.getMonth() + 1;
|
|
@@ -502,7 +504,9 @@ export default class MonthsGrid extends BaseComponent {
|
|
|
502
504
|
}
|
|
503
505
|
},
|
|
504
506
|
density: density,
|
|
505
|
-
yearAndMonthOpts: yearAndMonthOpts
|
|
507
|
+
yearAndMonthOpts: yearAndMonthOpts,
|
|
508
|
+
startYear: startYear,
|
|
509
|
+
endYear: endYear
|
|
506
510
|
});
|
|
507
511
|
}
|
|
508
512
|
|
|
@@ -24,7 +24,9 @@ declare class YearAndMonth extends BaseComponent<YearAndMonthProps, YearAndMonth
|
|
|
24
24
|
presetPosition: PropTypes.Requireable<"left" | "top" | "right" | "bottom">;
|
|
25
25
|
renderQuickControls: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
26
26
|
renderDateInput: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
27
|
-
type: PropTypes.Requireable<"
|
|
27
|
+
type: PropTypes.Requireable<"dateTime" | "date" | "month" | "dateRange" | "year" | "monthRange" | "dateTimeRange">;
|
|
28
|
+
startYear: PropTypes.Requireable<number>;
|
|
29
|
+
endYear: PropTypes.Requireable<number>;
|
|
28
30
|
};
|
|
29
31
|
static defaultProps: {
|
|
30
32
|
disabledDate: {
|
|
@@ -61,7 +61,7 @@ class YearAndMonth extends BaseComponent {
|
|
|
61
61
|
right: currentMonth.right || currentLeftMonth + 1
|
|
62
62
|
};
|
|
63
63
|
this.state = {
|
|
64
|
-
years: getYears().map(year => ({
|
|
64
|
+
years: getYears(props.startYear, props.endYear).map(year => ({
|
|
65
65
|
value: year,
|
|
66
66
|
year
|
|
67
67
|
})),
|
|
@@ -308,7 +308,9 @@ YearAndMonth.propTypes = {
|
|
|
308
308
|
presetPosition: PropTypes.oneOf(strings.PRESET_POSITION_SET),
|
|
309
309
|
renderQuickControls: PropTypes.node,
|
|
310
310
|
renderDateInput: PropTypes.node,
|
|
311
|
-
type: PropTypes.oneOf(strings.TYPE_SET)
|
|
311
|
+
type: PropTypes.oneOf(strings.TYPE_SET),
|
|
312
|
+
startYear: PropTypes.number,
|
|
313
|
+
endYear: PropTypes.number
|
|
312
314
|
};
|
|
313
315
|
YearAndMonth.defaultProps = {
|
|
314
316
|
disabledDate: _stubFalse,
|
|
@@ -138,7 +138,7 @@ declare class Form<Values extends Record<string, any> = any> extends BaseCompone
|
|
|
138
138
|
preventScroll?: boolean;
|
|
139
139
|
showRestTagsPopover?: boolean;
|
|
140
140
|
restTagsPopoverProps?: import("../popover").PopoverProps;
|
|
141
|
-
} & Pick<import("../tooltip").TooltipProps, "
|
|
141
|
+
} & Pick<import("../tooltip").TooltipProps, "stopPropagation" | "motion" | "getPopupContainer" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay"> & React.RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
|
|
142
142
|
static Checkbox: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox").CheckboxProps & import("./interface").RCIncludeType>;
|
|
143
143
|
static CheckboxGroup: React.ComponentType<import("utility-types").Subtract<import("../checkbox").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & React.RefAttributes<any>>;
|
|
144
144
|
static Radio: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../radio").RadioProps & import("./interface").RCIncludeType>;
|
package/lib/es/form/field.d.ts
CHANGED
|
@@ -86,7 +86,7 @@ declare const FormSelect: import("react").ComponentType<import("utility-types").
|
|
|
86
86
|
preventScroll?: boolean;
|
|
87
87
|
showRestTagsPopover?: boolean;
|
|
88
88
|
restTagsPopoverProps?: import("../popover").PopoverProps;
|
|
89
|
-
} & Pick<import("../tooltip").TooltipProps, "
|
|
89
|
+
} & Pick<import("../tooltip").TooltipProps, "stopPropagation" | "motion" | "getPopupContainer" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay"> & import("react").RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
|
|
90
90
|
declare const FormCheckboxGroup: import("react").ComponentType<import("utility-types").Subtract<import("../checkbox/checkboxGroup").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & import("react").RefAttributes<any>>;
|
|
91
91
|
declare const FormCheckbox: import("react").ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox/checkbox").CheckboxProps & import("./interface").RCIncludeType>;
|
|
92
92
|
declare const FormRadioGroup: import("react").ComponentType<import("utility-types").Subtract<import("../radio/radioGroup").RadioGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps & import("react").RefAttributes<any>>;
|
package/lib/es/input/index.d.ts
CHANGED
|
@@ -84,7 +84,7 @@ declare class Input extends BaseComponent<InputProps, InputState> {
|
|
|
84
84
|
showClear: PropTypes.Requireable<boolean>;
|
|
85
85
|
hideSuffix: PropTypes.Requireable<boolean>;
|
|
86
86
|
placeholder: PropTypes.Requireable<any>;
|
|
87
|
-
size: PropTypes.Requireable<"
|
|
87
|
+
size: PropTypes.Requireable<"default" | "small" | "large">;
|
|
88
88
|
className: PropTypes.Requireable<string>;
|
|
89
89
|
style: PropTypes.Requireable<object>;
|
|
90
90
|
validateStatus: PropTypes.Requireable<"default" | "error" | "warning" | "success">;
|
|
@@ -21,7 +21,7 @@ export default class inputGroup extends BaseComponent<InputGroupProps, InputGrou
|
|
|
21
21
|
static propTypes: {
|
|
22
22
|
className: PropTypes.Requireable<string>;
|
|
23
23
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
24
|
-
size: PropTypes.Requireable<"
|
|
24
|
+
size: PropTypes.Requireable<"default" | "small" | "large">;
|
|
25
25
|
style: PropTypes.Requireable<object>;
|
|
26
26
|
onBlur: PropTypes.Requireable<(...args: any[]) => any>;
|
|
27
27
|
onFocus: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ValidateStatus } from '../_base/baseComponent';
|
|
3
3
|
import '@douyinfe/semi-foundation/lib/es/input/textarea.css';
|
|
4
|
-
declare type OmitTextareaAttr = 'onChange' | 'onInput' | 'prefix' | 'size' | 'onFocus' | 'onBlur' | 'onKeyDown' | 'onKeyPress' | 'onKeyUp';
|
|
4
|
+
declare type OmitTextareaAttr = 'onChange' | 'onInput' | 'prefix' | 'size' | 'onFocus' | 'onBlur' | 'onKeyDown' | 'onKeyPress' | 'onKeyUp' | 'onResize';
|
|
5
5
|
export interface TextAreaProps extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, OmitTextareaAttr> {
|
|
6
6
|
autosize?: boolean;
|
|
7
7
|
borderless?: boolean;
|
|
@@ -140,12 +140,12 @@ export declare function withWarning(props: ModalReactProps): {
|
|
|
140
140
|
type: "warning";
|
|
141
141
|
};
|
|
142
142
|
export declare function withError(props: ModalReactProps): {
|
|
143
|
-
children?: React.ReactNode;
|
|
144
|
-
motion?: boolean;
|
|
145
143
|
title?: React.ReactNode;
|
|
144
|
+
children?: React.ReactNode;
|
|
146
145
|
size?: import("@douyinfe/semi-foundation/lib/es/modal/modalFoundation").Size;
|
|
147
146
|
style?: React.CSSProperties;
|
|
148
147
|
className?: string;
|
|
148
|
+
motion?: boolean;
|
|
149
149
|
getPopupContainer?: () => HTMLElement;
|
|
150
150
|
footer?: React.ReactNode;
|
|
151
151
|
header?: React.ReactNode;
|
|
@@ -201,24 +201,34 @@ export declare function withError(props: ModalReactProps): {
|
|
|
201
201
|
onMouseEnter?: React.MouseEventHandler<HTMLButtonElement>;
|
|
202
202
|
onMouseLeave?: React.MouseEventHandler<HTMLButtonElement>;
|
|
203
203
|
'aria-label'?: string;
|
|
204
|
-
onAnimationStart?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
205
|
-
onAnimationEnd?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
206
204
|
title?: string;
|
|
207
205
|
name?: string;
|
|
208
206
|
value?: string | number | readonly string[];
|
|
207
|
+
onAnimationStart?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
208
|
+
onAnimationEnd?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
209
209
|
form?: string;
|
|
210
210
|
slot?: string;
|
|
211
211
|
hidden?: boolean;
|
|
212
212
|
color?: string;
|
|
213
|
+
onChange?: React.FormEventHandler<HTMLButtonElement>;
|
|
214
|
+
defaultChecked?: boolean;
|
|
213
215
|
defaultValue?: string | number | readonly string[];
|
|
216
|
+
suppressContentEditableWarning?: boolean;
|
|
217
|
+
suppressHydrationWarning?: boolean;
|
|
214
218
|
accessKey?: string;
|
|
219
|
+
autoFocus?: boolean;
|
|
220
|
+
formAction?: string;
|
|
221
|
+
formEncType?: string;
|
|
222
|
+
formMethod?: string;
|
|
223
|
+
formNoValidate?: boolean;
|
|
224
|
+
formTarget?: string;
|
|
215
225
|
dir?: string;
|
|
216
226
|
draggable?: boolean | "false" | "true";
|
|
217
227
|
lang?: string;
|
|
218
|
-
translate?: "
|
|
228
|
+
translate?: "no" | "yes";
|
|
219
229
|
prefix?: string;
|
|
220
230
|
contentEditable?: "inherit" | (boolean | "false" | "true");
|
|
221
|
-
inputMode?: "
|
|
231
|
+
inputMode?: "search" | "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal";
|
|
222
232
|
tabIndex?: number;
|
|
223
233
|
role?: React.AriaRole;
|
|
224
234
|
onMouseOut?: React.MouseEventHandler<HTMLButtonElement>;
|
|
@@ -230,9 +240,6 @@ export declare function withError(props: ModalReactProps): {
|
|
|
230
240
|
'aria-haspopup'?: boolean | "dialog" | "menu" | "listbox" | "grid" | "false" | "true" | "tree";
|
|
231
241
|
'aria-controls'?: string;
|
|
232
242
|
'aria-describedby'?: string;
|
|
233
|
-
defaultChecked?: boolean;
|
|
234
|
-
suppressContentEditableWarning?: boolean;
|
|
235
|
-
suppressHydrationWarning?: boolean;
|
|
236
243
|
contextMenu?: string;
|
|
237
244
|
placeholder?: string;
|
|
238
245
|
spellCheck?: boolean | "false" | "true";
|
|
@@ -267,7 +274,7 @@ export declare function withError(props: ModalReactProps): {
|
|
|
267
274
|
'aria-current'?: boolean | "time" | "page" | "false" | "true" | "location" | "step" | "date";
|
|
268
275
|
'aria-details'?: string;
|
|
269
276
|
'aria-disabled'?: boolean | "false" | "true";
|
|
270
|
-
'aria-dropeffect'?: "
|
|
277
|
+
'aria-dropeffect'?: "link" | "none" | "copy" | "move" | "execute" | "popup";
|
|
271
278
|
'aria-errormessage'?: string;
|
|
272
279
|
'aria-flowto'?: string;
|
|
273
280
|
'aria-grabbed'?: boolean | "false" | "true";
|
|
@@ -316,7 +323,6 @@ export declare function withError(props: ModalReactProps): {
|
|
|
316
323
|
onCompositionUpdateCapture?: React.CompositionEventHandler<HTMLButtonElement>;
|
|
317
324
|
onFocusCapture?: React.FocusEventHandler<HTMLButtonElement>;
|
|
318
325
|
onBlurCapture?: React.FocusEventHandler<HTMLButtonElement>;
|
|
319
|
-
onChange?: React.FormEventHandler<HTMLButtonElement>;
|
|
320
326
|
onChangeCapture?: React.FormEventHandler<HTMLButtonElement>;
|
|
321
327
|
onBeforeInput?: React.FormEventHandler<HTMLButtonElement>;
|
|
322
328
|
onBeforeInputCapture?: React.FormEventHandler<HTMLButtonElement>;
|
|
@@ -451,12 +457,6 @@ export declare function withError(props: ModalReactProps): {
|
|
|
451
457
|
onAnimationIterationCapture?: React.AnimationEventHandler<HTMLButtonElement>;
|
|
452
458
|
onTransitionEnd?: React.TransitionEventHandler<HTMLButtonElement>;
|
|
453
459
|
onTransitionEndCapture?: React.TransitionEventHandler<HTMLButtonElement>;
|
|
454
|
-
autoFocus?: boolean;
|
|
455
|
-
formAction?: string;
|
|
456
|
-
formEncType?: string;
|
|
457
|
-
formMethod?: string;
|
|
458
|
-
formNoValidate?: boolean;
|
|
459
|
-
formTarget?: string;
|
|
460
460
|
};
|
|
461
461
|
};
|
|
462
462
|
export declare function withConfirm(props: ModalReactProps): {
|
|
@@ -6,6 +6,7 @@ import { BaseProps } from '../_base/baseComponent';
|
|
|
6
6
|
export interface NavFooterProps extends BaseProps {
|
|
7
7
|
collapseButton?: React.ReactNode;
|
|
8
8
|
collapseText?: (collapsed?: boolean) => React.ReactNode;
|
|
9
|
+
onClick?: (event: React.MouseEvent) => void;
|
|
9
10
|
}
|
|
10
11
|
export default class NavFooter extends PureComponent<NavFooterProps> {
|
|
11
12
|
static contextType: React.Context<NavContextType>;
|
|
@@ -15,9 +16,11 @@ export default class NavFooter extends PureComponent<NavFooterProps> {
|
|
|
15
16
|
className: PropTypes.Requireable<string>;
|
|
16
17
|
collapseButton: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
|
|
17
18
|
collapseText: PropTypes.Requireable<(...args: any[]) => any>;
|
|
19
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
18
20
|
};
|
|
19
21
|
static defaultProps: {
|
|
20
22
|
collapseButton: boolean;
|
|
23
|
+
onClick: (...args: any[]) => void;
|
|
21
24
|
};
|
|
22
25
|
context: NavContextType;
|
|
23
26
|
static elementType: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _noop from "lodash/noop";
|
|
1
2
|
import React, { PureComponent } from 'react';
|
|
2
3
|
import PropTypes from 'prop-types';
|
|
3
4
|
import cls from 'classnames';
|
|
@@ -39,7 +40,8 @@ export default class NavFooter extends PureComponent {
|
|
|
39
40
|
const {
|
|
40
41
|
style,
|
|
41
42
|
className,
|
|
42
|
-
collapseButton
|
|
43
|
+
collapseButton,
|
|
44
|
+
onClick
|
|
43
45
|
} = this.props;
|
|
44
46
|
let {
|
|
45
47
|
children
|
|
@@ -56,10 +58,15 @@ export default class NavFooter extends PureComponent {
|
|
|
56
58
|
const wrapCls = cls(className, `${cssClasses.PREFIX}-footer`, {
|
|
57
59
|
[`${cssClasses.PREFIX}-footer-collapsed`]: isCollapsed
|
|
58
60
|
});
|
|
59
|
-
return
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
return (
|
|
62
|
+
/*#__PURE__*/
|
|
63
|
+
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
|
64
|
+
React.createElement("div", {
|
|
65
|
+
className: wrapCls,
|
|
66
|
+
style: style,
|
|
67
|
+
onClick: onClick
|
|
68
|
+
}, children)
|
|
69
|
+
);
|
|
63
70
|
}
|
|
64
71
|
|
|
65
72
|
}
|
|
@@ -69,9 +76,11 @@ NavFooter.propTypes = {
|
|
|
69
76
|
style: PropTypes.object,
|
|
70
77
|
className: PropTypes.string,
|
|
71
78
|
collapseButton: PropTypes.oneOfType([PropTypes.node, PropTypes.bool]),
|
|
72
|
-
collapseText: PropTypes.func
|
|
79
|
+
collapseText: PropTypes.func,
|
|
80
|
+
onClick: PropTypes.func
|
|
73
81
|
};
|
|
74
82
|
NavFooter.defaultProps = {
|
|
75
|
-
collapseButton: false
|
|
83
|
+
collapseButton: false,
|
|
84
|
+
onClick: _noop
|
|
76
85
|
};
|
|
77
86
|
NavFooter.elementType = "NavFooter";
|
|
@@ -19,9 +19,6 @@ export interface NavItemProps extends ItemProps, BaseProps {
|
|
|
19
19
|
onClick?(clickItems: SelectedData): void;
|
|
20
20
|
onMouseEnter?: React.MouseEventHandler<HTMLLIElement>;
|
|
21
21
|
onMouseLeave?: React.MouseEventHandler<HTMLLIElement>;
|
|
22
|
-
selected?: boolean;
|
|
23
|
-
mode?: string;
|
|
24
|
-
isInSubNav?: boolean;
|
|
25
22
|
}
|
|
26
23
|
export interface SelectedData extends SelectedItemProps<NavItemProps> {
|
|
27
24
|
text?: React.ReactNode;
|
|
@@ -31,7 +28,6 @@ export interface NavItemState {
|
|
|
31
28
|
}
|
|
32
29
|
export default class NavItem extends BaseComponent<NavItemProps, NavItemState> {
|
|
33
30
|
static contextType: React.Context<NavContextType>;
|
|
34
|
-
static elementType: string;
|
|
35
31
|
static propTypes: {
|
|
36
32
|
text: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
|
|
37
33
|
itemKey: PropTypes.Requireable<NonNullable<string | number>>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _isUndefined from "lodash/isUndefined";
|
|
2
1
|
import _times from "lodash/times";
|
|
3
2
|
import _noop from "lodash/noop";
|
|
4
3
|
|
|
@@ -100,28 +99,21 @@ export default class NavItem extends BaseComponent {
|
|
|
100
99
|
notifyMouseLeave: function () {
|
|
101
100
|
return _this.props.onMouseLeave(...arguments);
|
|
102
101
|
},
|
|
103
|
-
getIsCollapsed: () => this.props.isCollapsed || Boolean(this.context && this.context.isCollapsed),
|
|
104
|
-
getSelected: () =>
|
|
105
|
-
getIsOpen: () => Boolean(this.context && this.context.openKeys && this.context.openKeys.includes(this.props.itemKey))
|
|
106
|
-
getIsInSubNav: () => this.props.isInSubNav || Boolean(this.context && this.context.isInSubNav),
|
|
107
|
-
getMode: () => {
|
|
108
|
-
var _a, _b;
|
|
109
|
-
|
|
110
|
-
return (_a = this.props.mode) !== null && _a !== void 0 ? _a : (_b = this.context) === null || _b === void 0 ? void 0 : _b.mode;
|
|
111
|
-
}
|
|
102
|
+
getIsCollapsed: () => this.props.isCollapsed || Boolean(this.context && this.context.isCollapsed) || false,
|
|
103
|
+
getSelected: () => Boolean(this.context && this.context.selectedKeys && this.context.selectedKeys.includes(this.props.itemKey)),
|
|
104
|
+
getIsOpen: () => Boolean(this.context && this.context.openKeys && this.context.openKeys.includes(this.props.itemKey))
|
|
112
105
|
});
|
|
113
106
|
}
|
|
114
107
|
|
|
115
108
|
renderIcon(icon, pos) {
|
|
116
109
|
let isToggleIcon = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
117
110
|
let key = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
118
|
-
const mode = this.adapter.getMode();
|
|
119
111
|
|
|
120
112
|
if (this.props.isSubNav) {
|
|
121
113
|
return null;
|
|
122
114
|
}
|
|
123
115
|
|
|
124
|
-
if (!icon && mode === strings.MODE_HORIZONTAL) {
|
|
116
|
+
if (!icon && this.context.mode === strings.MODE_HORIZONTAL) {
|
|
125
117
|
return null;
|
|
126
118
|
}
|
|
127
119
|
|
|
@@ -144,8 +136,6 @@ export default class NavItem extends BaseComponent {
|
|
|
144
136
|
}
|
|
145
137
|
|
|
146
138
|
render() {
|
|
147
|
-
var _a;
|
|
148
|
-
|
|
149
139
|
const {
|
|
150
140
|
text,
|
|
151
141
|
children,
|
|
@@ -161,17 +151,16 @@ export default class NavItem extends BaseComponent {
|
|
|
161
151
|
linkOptions,
|
|
162
152
|
disabled,
|
|
163
153
|
level = 0,
|
|
164
|
-
tabIndex
|
|
165
|
-
mode: modeInProps
|
|
154
|
+
tabIndex
|
|
166
155
|
} = this.props;
|
|
167
156
|
const {
|
|
157
|
+
mode,
|
|
158
|
+
isInSubNav,
|
|
168
159
|
prefixCls,
|
|
169
160
|
limitIndent
|
|
170
161
|
} = this.context;
|
|
171
162
|
const isCollapsed = this.adapter.getIsCollapsed();
|
|
172
163
|
const selected = this.adapter.getSelected();
|
|
173
|
-
const isInSubNav = this.adapter.getIsInSubNav();
|
|
174
|
-
const mode = this.adapter.getMode();
|
|
175
164
|
let itemChildren = null;
|
|
176
165
|
|
|
177
166
|
if (!isNullOrUndefined(children)) {
|
|
@@ -219,20 +208,14 @@ export default class NavItem extends BaseComponent {
|
|
|
219
208
|
onKeyDown: this.handleKeyPress
|
|
220
209
|
}, itemChildren);
|
|
221
210
|
} else {
|
|
222
|
-
//
|
|
223
|
-
// 当 this.props.isInSubNav 存在是,则由 this.props.isInSubNav 决定
|
|
224
|
-
// 否则由 this.context?.mode 决定,因为第一层节点无context
|
|
225
|
-
const isFirstLayer = !_isUndefined(this.props.isInSubNav) ? !this.props.isInSubNav : _isUndefined((_a = this.context) === null || _a === void 0 ? void 0 : _a.mode); // Items are divided into normal and sub-wrap
|
|
226
|
-
|
|
211
|
+
// Items are divided into normal and sub-wrap
|
|
227
212
|
const popoverItemCls = cls(`${className || `${clsPrefix}-normal`}`, {
|
|
228
213
|
[clsPrefix]: true,
|
|
229
214
|
[`${clsPrefix}-sub`]: isSubNav,
|
|
230
215
|
[`${clsPrefix}-selected`]: selected && !isSubNav,
|
|
231
216
|
[`${clsPrefix}-collapsed`]: isCollapsed,
|
|
232
217
|
[`${clsPrefix}-disabled`]: disabled,
|
|
233
|
-
[`${clsPrefix}-has-link`]: typeof link === 'string'
|
|
234
|
-
[`${cssClasses.PREFIX}-first-layer`]: isFirstLayer,
|
|
235
|
-
[`${clsPrefix}-horizontal`]: modeInProps === strings.MODE_HORIZONTAL
|
|
218
|
+
[`${clsPrefix}-has-link`]: typeof link === 'string'
|
|
236
219
|
});
|
|
237
220
|
const ariaProps = {
|
|
238
221
|
'aria-disabled': disabled
|
|
@@ -310,5 +293,4 @@ NavItem.defaultProps = {
|
|
|
310
293
|
onMouseLeave: _noop,
|
|
311
294
|
disabled: false,
|
|
312
295
|
tabIndex: 0
|
|
313
|
-
};
|
|
314
|
-
NavItem.elementType = 'Nav.Item';
|
|
296
|
+
};
|
|
@@ -4,10 +4,6 @@ import PropTypes from 'prop-types';
|
|
|
4
4
|
import '@douyinfe/semi-foundation/lib/es/navigation/navigation.css';
|
|
5
5
|
import SubNavFoundation, { SubNavAdapter } from '@douyinfe/semi-foundation/lib/es/navigation/subNavFoundation';
|
|
6
6
|
import { NavContextType } from './nav-context';
|
|
7
|
-
export interface ToggleIcon {
|
|
8
|
-
open?: string;
|
|
9
|
-
closed?: string;
|
|
10
|
-
}
|
|
11
7
|
export interface SubNavProps extends BaseProps {
|
|
12
8
|
disabled?: boolean;
|
|
13
9
|
dropdownStyle?: React.CSSProperties;
|
|
@@ -21,15 +17,12 @@ export interface SubNavProps extends BaseProps {
|
|
|
21
17
|
onMouseEnter?: React.MouseEventHandler<HTMLLIElement>;
|
|
22
18
|
onMouseLeave?: React.MouseEventHandler<HTMLLIElement>;
|
|
23
19
|
text?: React.ReactNode;
|
|
24
|
-
|
|
25
|
-
active?: boolean;
|
|
26
|
-
mode?: string;
|
|
20
|
+
expandIcon?: React.ReactNode;
|
|
27
21
|
}
|
|
28
22
|
export interface SubNavState {
|
|
29
23
|
isHovered: boolean;
|
|
30
24
|
}
|
|
31
25
|
export default class SubNav extends BaseComponent<SubNavProps, SubNavState> {
|
|
32
|
-
static elementType: string;
|
|
33
26
|
static contextType: React.Context<NavContextType>;
|
|
34
27
|
static propTypes: {
|
|
35
28
|
/**
|
|
@@ -56,10 +49,6 @@ export default class SubNav extends BaseComponent<SubNavProps, SubNavState> {
|
|
|
56
49
|
* Nested child elements
|
|
57
50
|
*/
|
|
58
51
|
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
59
|
-
/**
|
|
60
|
-
* The icon name of the right control switch (on and off status)
|
|
61
|
-
*/
|
|
62
|
-
toggleIcon: PropTypes.Requireable<any>;
|
|
63
52
|
style: PropTypes.Requireable<object>;
|
|
64
53
|
/**
|
|
65
54
|
* Icon name on the left
|
|
@@ -73,7 +62,6 @@ export default class SubNav extends BaseComponent<SubNavProps, SubNavState> {
|
|
|
73
62
|
onMouseLeave: PropTypes.Requireable<(...args: any[]) => any>;
|
|
74
63
|
disabled: PropTypes.Requireable<boolean>;
|
|
75
64
|
level: PropTypes.Requireable<number>;
|
|
76
|
-
active: PropTypes.Requireable<boolean>;
|
|
77
65
|
};
|
|
78
66
|
static defaultProps: {
|
|
79
67
|
level: number;
|
|
@@ -81,12 +69,7 @@ export default class SubNav extends BaseComponent<SubNavProps, SubNavState> {
|
|
|
81
69
|
isCollapsed: boolean;
|
|
82
70
|
isOpen: boolean;
|
|
83
71
|
maxHeight: number;
|
|
84
|
-
toggleIcon: {
|
|
85
|
-
open: JSX.Element;
|
|
86
|
-
closed: JSX.Element;
|
|
87
|
-
};
|
|
88
72
|
disabled: boolean;
|
|
89
|
-
active: boolean;
|
|
90
73
|
};
|
|
91
74
|
titleRef: React.RefObject<HTMLDivElement>;
|
|
92
75
|
itemRef: React.RefObject<HTMLLIElement>;
|