@douyinfe/semi-ui 2.10.2-alpha.0 → 2.10.2-alpha.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.
- package/dist/umd/semi-ui.js +22 -0
- 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/form/baseForm.d.ts +1 -1
- package/lib/cjs/form/field.d.ts +1 -1
- package/lib/cjs/table/Body/BaseRow.d.ts +1 -0
- package/lib/cjs/table/Body/BaseRow.js +22 -0
- package/lib/cjs/typography/title.d.ts +1 -1
- package/lib/es/form/baseForm.d.ts +1 -1
- package/lib/es/form/field.d.ts +1 -1
- package/lib/es/table/Body/BaseRow.d.ts +1 -0
- package/lib/es/table/Body/BaseRow.js +22 -0
- package/lib/es/typography/title.d.ts +1 -1
- package/package.json +2 -2
- package/table/Body/BaseRow.tsx +15 -0
|
@@ -125,7 +125,7 @@ declare class Form extends BaseComponent<BaseFormProps, BaseFormState> {
|
|
|
125
125
|
onBlur?: (e: React.FocusEvent<Element, Element>) => void;
|
|
126
126
|
onListScroll?: (e: React.UIEvent<HTMLDivElement, UIEvent>) => void;
|
|
127
127
|
children?: React.ReactNode;
|
|
128
|
-
} & Pick<import("../tooltip").TooltipProps, "
|
|
128
|
+
} & Pick<import("../tooltip").TooltipProps, "getPopupContainer" | "stopPropagation" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay" | "motion"> & React.RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
|
|
129
129
|
static Checkbox: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox").CheckboxProps & import("./interface").RCIncludeType>;
|
|
130
130
|
static CheckboxGroup: React.ComponentType<import("utility-types").Subtract<import("../checkbox").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
|
131
131
|
static Radio: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../radio").RadioProps & import("./interface").RCIncludeType>;
|
package/lib/cjs/form/field.d.ts
CHANGED
|
@@ -73,7 +73,7 @@ declare const FormSelect: import("react").ComponentType<import("utility-types").
|
|
|
73
73
|
onBlur?: (e: import("react").FocusEvent<Element, Element>) => void;
|
|
74
74
|
onListScroll?: (e: import("react").UIEvent<HTMLDivElement, UIEvent>) => void;
|
|
75
75
|
children?: import("react").ReactNode;
|
|
76
|
-
} & Pick<import("../tooltip").TooltipProps, "
|
|
76
|
+
} & Pick<import("../tooltip").TooltipProps, "getPopupContainer" | "stopPropagation" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay" | "motion"> & import("react").RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
|
|
77
77
|
declare const FormCheckboxGroup: import("react").ComponentType<import("utility-types").Subtract<import("../checkbox/checkboxGroup").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
|
78
78
|
declare const FormCheckbox: import("react").ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox/checkbox").CheckboxProps & import("./interface").RCIncludeType>;
|
|
79
79
|
declare const FormRadioGroup: import("react").ComponentType<import("utility-types").Subtract<import("../radio/radioGroup").RadioGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
|
@@ -113,6 +113,7 @@ export default class TableRow extends BaseComponent<BaseRowProps, Record<string,
|
|
|
113
113
|
get adapter(): TableRowAdapter<BaseRowProps>;
|
|
114
114
|
ref: React.MutableRefObject<any>;
|
|
115
115
|
constructor(props: BaseRowProps);
|
|
116
|
+
componentDidMount(): void;
|
|
116
117
|
shouldComponentUpdate(nextProps: BaseRowProps): boolean;
|
|
117
118
|
_cacheNode: (node: any) => void;
|
|
118
119
|
renderExpandIcon: (record: Record<string, any>) => React.ReactNode;
|
|
@@ -141,6 +141,28 @@ class TableRow extends _baseComponent.default {
|
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
+
componentDidMount() {
|
|
145
|
+
// fix #745
|
|
146
|
+
// didmount/willUnmount may be called twice when React.StrictMode is true in React 18, we need to ensure that this.cache.customRowProps is correct
|
|
147
|
+
const {
|
|
148
|
+
onRow,
|
|
149
|
+
index,
|
|
150
|
+
record
|
|
151
|
+
} = this.props;
|
|
152
|
+
const customRowProps = this.adapter.getCache('customRowProps');
|
|
153
|
+
|
|
154
|
+
if (typeof customRowProps === 'undefined') {
|
|
155
|
+
const _a = onRow(record, index) || {},
|
|
156
|
+
{
|
|
157
|
+
className: customClassName,
|
|
158
|
+
style: customStyle
|
|
159
|
+
} = _a,
|
|
160
|
+
rowProps = __rest(_a, ["className", "style"]);
|
|
161
|
+
|
|
162
|
+
this.adapter.setCache('customRowProps', (0, _assign.default)({}, rowProps));
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
144
166
|
shouldComponentUpdate(nextProps) {
|
|
145
167
|
/**
|
|
146
168
|
* Shallow comparison of incoming props to simulate PureComponent
|
|
@@ -37,7 +37,7 @@ export default class Title extends PureComponent<TitleProps> {
|
|
|
37
37
|
underline: PropTypes.Requireable<boolean>;
|
|
38
38
|
strong: PropTypes.Requireable<boolean>;
|
|
39
39
|
type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
|
|
40
|
-
heading: PropTypes.Requireable<
|
|
40
|
+
heading: PropTypes.Requireable<4 | 2 | 1 | 3 | 5 | 6>;
|
|
41
41
|
style: PropTypes.Requireable<object>;
|
|
42
42
|
className: PropTypes.Requireable<string>;
|
|
43
43
|
component: PropTypes.Requireable<string>;
|
|
@@ -125,7 +125,7 @@ declare class Form extends BaseComponent<BaseFormProps, BaseFormState> {
|
|
|
125
125
|
onBlur?: (e: React.FocusEvent<Element, Element>) => void;
|
|
126
126
|
onListScroll?: (e: React.UIEvent<HTMLDivElement, UIEvent>) => void;
|
|
127
127
|
children?: React.ReactNode;
|
|
128
|
-
} & Pick<import("../tooltip").TooltipProps, "
|
|
128
|
+
} & Pick<import("../tooltip").TooltipProps, "getPopupContainer" | "stopPropagation" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay" | "motion"> & React.RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
|
|
129
129
|
static Checkbox: React.ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox").CheckboxProps & import("./interface").RCIncludeType>;
|
|
130
130
|
static CheckboxGroup: React.ComponentType<import("utility-types").Subtract<import("../checkbox").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
|
131
131
|
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
|
@@ -73,7 +73,7 @@ declare const FormSelect: import("react").ComponentType<import("utility-types").
|
|
|
73
73
|
onBlur?: (e: import("react").FocusEvent<Element, Element>) => void;
|
|
74
74
|
onListScroll?: (e: import("react").UIEvent<HTMLDivElement, UIEvent>) => void;
|
|
75
75
|
children?: import("react").ReactNode;
|
|
76
|
-
} & Pick<import("../tooltip").TooltipProps, "
|
|
76
|
+
} & Pick<import("../tooltip").TooltipProps, "getPopupContainer" | "stopPropagation" | "spacing" | "mouseEnterDelay" | "autoAdjustOverflow" | "mouseLeaveDelay" | "motion"> & import("react").RefAttributes<any> & import("./interface").CommonFieldProps, import("./interface").CommonexcludeType>> & import("./interface").SelectStatic;
|
|
77
77
|
declare const FormCheckboxGroup: import("react").ComponentType<import("utility-types").Subtract<import("../checkbox/checkboxGroup").CheckboxGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
|
78
78
|
declare const FormCheckbox: import("react").ComponentType<import("utility-types").Subtract<import("./interface").CommonFieldProps, import("./interface").RadioCheckboxExcludeProps> & import("../checkbox/checkbox").CheckboxProps & import("./interface").RCIncludeType>;
|
|
79
79
|
declare const FormRadioGroup: import("react").ComponentType<import("utility-types").Subtract<import("../radio/radioGroup").RadioGroupProps, import("./interface").CommonexcludeType> & import("./interface").CommonFieldProps>;
|
|
@@ -113,6 +113,7 @@ export default class TableRow extends BaseComponent<BaseRowProps, Record<string,
|
|
|
113
113
|
get adapter(): TableRowAdapter<BaseRowProps>;
|
|
114
114
|
ref: React.MutableRefObject<any>;
|
|
115
115
|
constructor(props: BaseRowProps);
|
|
116
|
+
componentDidMount(): void;
|
|
116
117
|
shouldComponentUpdate(nextProps: BaseRowProps): boolean;
|
|
117
118
|
_cacheNode: (node: any) => void;
|
|
118
119
|
renderExpandIcon: (record: Record<string, any>) => React.ReactNode;
|
|
@@ -103,6 +103,28 @@ export default class TableRow extends BaseComponent {
|
|
|
103
103
|
});
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
+
componentDidMount() {
|
|
107
|
+
// fix #745
|
|
108
|
+
// didmount/willUnmount may be called twice when React.StrictMode is true in React 18, we need to ensure that this.cache.customRowProps is correct
|
|
109
|
+
const {
|
|
110
|
+
onRow,
|
|
111
|
+
index,
|
|
112
|
+
record
|
|
113
|
+
} = this.props;
|
|
114
|
+
const customRowProps = this.adapter.getCache('customRowProps');
|
|
115
|
+
|
|
116
|
+
if (typeof customRowProps === 'undefined') {
|
|
117
|
+
const _a = onRow(record, index) || {},
|
|
118
|
+
{
|
|
119
|
+
className: customClassName,
|
|
120
|
+
style: customStyle
|
|
121
|
+
} = _a,
|
|
122
|
+
rowProps = __rest(_a, ["className", "style"]);
|
|
123
|
+
|
|
124
|
+
this.adapter.setCache('customRowProps', _Object$assign({}, rowProps));
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
106
128
|
shouldComponentUpdate(nextProps) {
|
|
107
129
|
/**
|
|
108
130
|
* Shallow comparison of incoming props to simulate PureComponent
|
|
@@ -37,7 +37,7 @@ export default class Title extends PureComponent<TitleProps> {
|
|
|
37
37
|
underline: PropTypes.Requireable<boolean>;
|
|
38
38
|
strong: PropTypes.Requireable<boolean>;
|
|
39
39
|
type: PropTypes.Requireable<"warning" | "success" | "primary" | "tertiary" | "secondary" | "danger" | "quaternary">;
|
|
40
|
-
heading: PropTypes.Requireable<
|
|
40
|
+
heading: PropTypes.Requireable<4 | 2 | 1 | 3 | 5 | 6>;
|
|
41
41
|
style: PropTypes.Requireable<object>;
|
|
42
42
|
className: PropTypes.Requireable<string>;
|
|
43
43
|
component: PropTypes.Requireable<string>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-ui",
|
|
3
|
-
"version": "2.10.2-alpha.
|
|
3
|
+
"version": "2.10.2-alpha.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es/index.js",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
],
|
|
70
70
|
"author": "",
|
|
71
71
|
"license": "MIT",
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "f3c92123d53b7b67e6d89b8c858793c2b5c30256",
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@babel/plugin-proposal-decorators": "^7.15.8",
|
|
75
75
|
"@babel/plugin-transform-runtime": "^7.15.8",
|
package/table/Body/BaseRow.tsx
CHANGED
|
@@ -153,6 +153,21 @@ export default class TableRow extends BaseComponent<BaseRowProps, Record<string,
|
|
|
153
153
|
this.foundation = new TableRowFoundation(this.adapter);
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
+
componentDidMount() {
|
|
157
|
+
// fix #745
|
|
158
|
+
// didmount/willUnmount may be called twice when React.StrictMode is true in React 18, we need to ensure that this.cache.customRowProps is correct
|
|
159
|
+
const {
|
|
160
|
+
onRow,
|
|
161
|
+
index,
|
|
162
|
+
record,
|
|
163
|
+
} = this.props;
|
|
164
|
+
const customRowProps = this.adapter.getCache('customRowProps');
|
|
165
|
+
if (typeof customRowProps === 'undefined') {
|
|
166
|
+
const { className: customClassName, style: customStyle, ...rowProps } = onRow(record, index) || {};
|
|
167
|
+
this.adapter.setCache('customRowProps', { ...rowProps });
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
156
171
|
shouldComponentUpdate(nextProps: BaseRowProps) {
|
|
157
172
|
/**
|
|
158
173
|
* Shallow comparison of incoming props to simulate PureComponent
|