mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 03:58:07 +08:00
Merge remote-tracking branch 'baidu/master'
This commit is contained in:
commit
ddde285005
@ -26,6 +26,7 @@
|
|||||||
|
|
||||||
> div {
|
> div {
|
||||||
flex-grow: 0 !important;
|
flex-grow: 0 !important;
|
||||||
|
min-width: auto !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -142,8 +142,8 @@ export default class BadgeControl extends React.Component<
|
|||||||
}
|
}
|
||||||
|
|
||||||
transformBadgeValue(): BadgeForm {
|
transformBadgeValue(): BadgeForm {
|
||||||
const {data: ctx, node} = this.props;
|
const {data: ctx, node, name} = this.props;
|
||||||
let badge = ctx?.badge ?? {};
|
let badge = ctx?.[name || 'badge'] ?? {};
|
||||||
// 避免获取到上层的size
|
// 避免获取到上层的size
|
||||||
let size = ctx?.badge?.size;
|
let size = ctx?.badge?.size;
|
||||||
if (node.type === 'button-group-select') {
|
if (node.type === 'button-group-select') {
|
||||||
@ -185,10 +185,10 @@ export default class BadgeControl extends React.Component<
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleSubmit(form: BadgeForm, action: any): void {
|
handleSubmit(form: BadgeForm, action: any): void {
|
||||||
const {onBulkChange} = this.props;
|
const {onBulkChange, name} = this.props;
|
||||||
|
|
||||||
if (action?.type === 'submit') {
|
if (action?.type === 'submit') {
|
||||||
onBulkChange?.({badge: this.normalizeBadgeValue(form)});
|
onBulkChange?.({[name || 'badge']: this.normalizeBadgeValue(form)});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,6 +16,11 @@ import {Spinner, SpinnerExtraProps} from 'amis-ui';
|
|||||||
export const ColProps = ['lg', 'md', 'sm', 'xs'];
|
export const ColProps = ['lg', 'md', 'sm', 'xs'];
|
||||||
|
|
||||||
export type GridColumnObject = {
|
export type GridColumnObject = {
|
||||||
|
/**
|
||||||
|
* 组件唯一 id
|
||||||
|
*/
|
||||||
|
id?: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 极小屏(<768px)时宽度占比
|
* 极小屏(<768px)时宽度占比
|
||||||
*/
|
*/
|
||||||
@ -62,6 +67,10 @@ export type GridColumnObject = {
|
|||||||
* 样式
|
* 样式
|
||||||
*/
|
*/
|
||||||
style?: any;
|
style?: any;
|
||||||
|
|
||||||
|
wrapperCustomStyle?: any;
|
||||||
|
|
||||||
|
themeCss?: any;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type GridColumn = GridColumnObject;
|
export type GridColumn = GridColumnObject;
|
||||||
@ -165,9 +174,12 @@ export default class Grid<T> extends React.Component<GridProps & T, object> {
|
|||||||
formHorizontal,
|
formHorizontal,
|
||||||
translate: __,
|
translate: __,
|
||||||
disabled,
|
disabled,
|
||||||
data
|
data,
|
||||||
|
env
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const styleVar = buildStyle(column.style, data);
|
const styleVar = buildStyle(column.style, data);
|
||||||
|
|
||||||
|
const {id, themeCss, wrapperCustomStyle} = column;
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
key={key}
|
key={key}
|
||||||
@ -176,7 +188,19 @@ export default class Grid<T> extends React.Component<GridProps & T, object> {
|
|||||||
fromBsClass((column as any).columnClassName!),
|
fromBsClass((column as any).columnClassName!),
|
||||||
{
|
{
|
||||||
[`Grid-col--v${ucFirst(column.valign)}`]: column.valign
|
[`Grid-col--v${ucFirst(column.valign)}`]: column.valign
|
||||||
}
|
},
|
||||||
|
setThemeClassName({
|
||||||
|
...column,
|
||||||
|
name: 'baseControlClassName',
|
||||||
|
id,
|
||||||
|
themeCss
|
||||||
|
}),
|
||||||
|
setThemeClassName({
|
||||||
|
...column,
|
||||||
|
name: 'wrapperCustomStyle',
|
||||||
|
id,
|
||||||
|
themeCss
|
||||||
|
})
|
||||||
)}
|
)}
|
||||||
style={styleVar}
|
style={styleVar}
|
||||||
>
|
>
|
||||||
@ -186,6 +210,21 @@ export default class Grid<T> extends React.Component<GridProps & T, object> {
|
|||||||
formHorizontal:
|
formHorizontal:
|
||||||
column.horizontal || subFormHorizontal || formHorizontal
|
column.horizontal || subFormHorizontal || formHorizontal
|
||||||
})}
|
})}
|
||||||
|
|
||||||
|
<CustomStyle
|
||||||
|
{...column}
|
||||||
|
config={{
|
||||||
|
wrapperCustomStyle,
|
||||||
|
id,
|
||||||
|
themeCss,
|
||||||
|
classNames: [
|
||||||
|
{
|
||||||
|
key: 'baseControlClassName'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}}
|
||||||
|
env={env}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user