mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
chore: 弹窗自定义宽度时关闭媒体查询max-width宽度限制 (#8272)
* 修复弹窗自定义宽度时媒体查询max-width限制宽度显示 * 尺寸自定义时去掉媒体查询样式
This commit is contained in:
parent
5180c3bc35
commit
91c86afdea
@ -16,7 +16,6 @@ import {render as reactRender, unmountComponentAtNode} from 'react-dom';
|
||||
import {
|
||||
autobind,
|
||||
diff,
|
||||
JSONGetByPath,
|
||||
getThemeConfig,
|
||||
JSONGetById,
|
||||
JSONPipeIn,
|
||||
@ -510,6 +509,7 @@ function SchemaFrom({
|
||||
const schemaDiff = diff(schema, newSchema);
|
||||
store.definitionOnchangeValue(newSchema, schemaDiff);
|
||||
}
|
||||
// 添加弹窗事件后自动选中弹窗
|
||||
if (store.activeDialogPath) {
|
||||
let activeId = store.getSchemaByPath(
|
||||
store.activeDialogPath.split('/')
|
||||
|
@ -247,7 +247,7 @@ export class DrawerPlugin extends BasePlugin {
|
||||
'位置为 "左" 或 "右" 时生效。 默认宽度为"尺寸"字段配置的宽度,值单位默认为 px,也支持百分比等单位 ,如:100%'
|
||||
),
|
||||
visibleOn:
|
||||
'this.position === "top" || this.position === "bottom"'
|
||||
'this.position === "left" || this.position === "right" || !this.position'
|
||||
},
|
||||
heightSchema: {
|
||||
label: tipedLabel(
|
||||
@ -255,7 +255,7 @@ export class DrawerPlugin extends BasePlugin {
|
||||
'位置为 "上" 或 "下" 时生效。 默认宽度为"尺寸"字段配置的高度,值单位默认为 px,也支持百分比等单位 ,如:100%'
|
||||
),
|
||||
visibleOn:
|
||||
'this.position === "left" || this.position === "right" || !this.position'
|
||||
'this.position === "top" || this.position === "bottom"'
|
||||
}
|
||||
}),
|
||||
getSchemaTpl('theme:border', {
|
||||
|
@ -451,6 +451,7 @@ setSchemaTpl('dataMap', {
|
||||
deleteBtn: {
|
||||
icon: 'fa fa-trash'
|
||||
},
|
||||
updatePristineAfterStoreDataReInit: true,
|
||||
itemsWrapperClassName: 'ae-Combo-items',
|
||||
pipeIn: (e: any, form: any) => {
|
||||
const data = cloneDeep(form.data?.data);
|
||||
|
@ -185,7 +185,7 @@
|
||||
}
|
||||
|
||||
@include media-breakpoint-up(sm) {
|
||||
.#{$ns}Modal-content {
|
||||
.#{$ns}Modal-content:not(.#{$ns}Modal-content-custom) {
|
||||
max-width: var(--dialog-size-normal-width);
|
||||
border-width: var(--dialog-default-border-width);
|
||||
}
|
||||
|
@ -283,12 +283,10 @@ export class Modal extends React.Component<ModalProps, ModalState> {
|
||||
classnames: cx
|
||||
} = this.props;
|
||||
|
||||
let _width = width;
|
||||
let _height = height;
|
||||
if (size === 'custom') {
|
||||
style?.width && (_width = style.width);
|
||||
style?.height && (_height = style.height);
|
||||
}
|
||||
let _style = {
|
||||
width: style?.width ? style?.width : width,
|
||||
height: style?.height ? style?.height : height
|
||||
};
|
||||
|
||||
return (
|
||||
<Transition
|
||||
@ -326,14 +324,12 @@ export class Modal extends React.Component<ModalProps, ModalState> {
|
||||
<div
|
||||
className={cx(
|
||||
`Modal-content`,
|
||||
size === 'custom' ? 'Modal-content-custom' : '',
|
||||
contentClassName,
|
||||
modalClassName,
|
||||
contentFadeStyles[status]
|
||||
)}
|
||||
style={{
|
||||
width: _width,
|
||||
height: _height
|
||||
}}
|
||||
style={_style}
|
||||
>
|
||||
{status === EXITED ? null : children}
|
||||
</div>
|
||||
|
@ -274,6 +274,7 @@ export interface ComboControlSchema extends FormBaseControlSchema {
|
||||
*/
|
||||
maxLengthValidateFailed?: string;
|
||||
};
|
||||
updatePristineAfterStoreDataReInit?: boolean;
|
||||
}
|
||||
|
||||
export type ComboRendererEvent = 'add' | 'delete' | 'tabsChange';
|
||||
@ -1695,7 +1696,8 @@ export default class ComboControl extends React.Component<ComboProps> {
|
||||
changeImmediately,
|
||||
lazyLoad,
|
||||
translate: __,
|
||||
static: isStatic
|
||||
static: isStatic,
|
||||
updatePristineAfterStoreDataReInit
|
||||
} = this.props;
|
||||
|
||||
// 单个
|
||||
@ -1720,7 +1722,8 @@ export default class ComboControl extends React.Component<ComboProps> {
|
||||
onInit: this.handleSingleFormInit,
|
||||
canAccessSuperData,
|
||||
formStore: undefined,
|
||||
updatePristineAfterStoreDataReInit: false
|
||||
updatePristineAfterStoreDataReInit:
|
||||
updatePristineAfterStoreDataReInit ?? false
|
||||
}
|
||||
);
|
||||
} else if (multiple && index !== undefined && index >= 0) {
|
||||
@ -1752,7 +1755,8 @@ export default class ComboControl extends React.Component<ComboProps> {
|
||||
formItemValue: undefined,
|
||||
formStore: undefined,
|
||||
...(tabsMode ? {} : {lazyLoad}),
|
||||
updatePristineAfterStoreDataReInit: false
|
||||
updatePristineAfterStoreDataReInit:
|
||||
updatePristineAfterStoreDataReInit ?? false
|
||||
}
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user