chore: 弹窗自定义宽度时关闭媒体查询max-width宽度限制 (#8272)

* 修复弹窗自定义宽度时媒体查询max-width限制宽度显示

* 尺寸自定义时去掉媒体查询样式
This commit is contained in:
ascend13 2023-09-28 10:35:16 +08:00 committed by GitHub
parent 5180c3bc35
commit 91c86afdea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 18 additions and 17 deletions

View File

@ -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('/')

View File

@ -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', {

View File

@ -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);

View File

@ -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);
}

View File

@ -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>

View File

@ -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
}
);
}