mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-19 14:04:28 +00:00
fix: setting 面板样式调整
This commit is contained in:
parent
a140f9bc69
commit
922b361504
@ -14,7 +14,7 @@ export interface FieldProps {
|
|||||||
className?: string;
|
className?: string;
|
||||||
meta?: { package: string; componentName: string } | string;
|
meta?: { package: string; componentName: string } | string;
|
||||||
title?: TitleContent | null;
|
title?: TitleContent | null;
|
||||||
defaultDisplay?: 'accordion' | 'inline' | 'block';
|
defaultDisplay?: 'accordion' | 'inline' | 'block' | 'plain' | 'popup' | 'entry';
|
||||||
collapsed?: boolean;
|
collapsed?: boolean;
|
||||||
valueState?: number;
|
valueState?: number;
|
||||||
name?: string;
|
name?: string;
|
||||||
@ -134,6 +134,8 @@ export class Field extends Component<FieldProps> {
|
|||||||
})}
|
})}
|
||||||
id={id}
|
id={id}
|
||||||
>
|
>
|
||||||
|
{
|
||||||
|
display !== 'plain' && (
|
||||||
<div className="lc-field-head" onClick={isAccordion ? this.toggleExpand : undefined}>
|
<div className="lc-field-head" onClick={isAccordion ? this.toggleExpand : undefined}>
|
||||||
<div className="lc-field-title">
|
<div className="lc-field-title">
|
||||||
{createValueState(valueState, this.handleClear)}
|
{createValueState(valueState, this.handleClear)}
|
||||||
@ -142,6 +144,8 @@ export class Field extends Component<FieldProps> {
|
|||||||
</div>
|
</div>
|
||||||
{isAccordion && <Icon className="lc-field-icon" type="arrow-up" size="xs" />}
|
{isAccordion && <Icon className="lc-field-icon" type="arrow-up" size="xs" />}
|
||||||
</div>
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
<div key="body" ref={(shell) => (this.body = shell)} className="lc-field-body">
|
<div key="body" ref={(shell) => (this.body = shell)} className="lc-field-body">
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -68,16 +68,9 @@
|
|||||||
&.lc-inline-field {
|
&.lc-inline-field {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
// for top-level style
|
margin-bottom: 12px;
|
||||||
padding: 16px;
|
|
||||||
&:first-child{
|
|
||||||
padding-top: 16px;
|
|
||||||
}
|
|
||||||
&:last-child{
|
&:last-child{
|
||||||
padding-bottom: 16px;
|
margin-bottom: 0;
|
||||||
}
|
|
||||||
&+.lc-inline-field{
|
|
||||||
padding-top: 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
> .lc-field-head {
|
> .lc-field-head {
|
||||||
@ -96,6 +89,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.lc-plain-field {
|
||||||
|
.lc-inline-field {
|
||||||
|
margin: 12px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
&.lc-block-field, &.lc-accordion-field {
|
&.lc-block-field, &.lc-accordion-field {
|
||||||
display: block;
|
display: block;
|
||||||
&:first-child {
|
&:first-child {
|
||||||
@ -123,12 +122,6 @@
|
|||||||
> .lc-field-body {
|
> .lc-field-body {
|
||||||
// padding: @y-gap @x-gap/2;
|
// padding: @y-gap @x-gap/2;
|
||||||
padding: 12px;
|
padding: 12px;
|
||||||
.lc-inline-field{
|
|
||||||
margin-bottom: 12px;
|
|
||||||
&:last-child{
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
+ .lc-inline-field {
|
+ .lc-inline-field {
|
||||||
@ -180,8 +173,6 @@
|
|||||||
// 2rd level reset
|
// 2rd level reset
|
||||||
.lc-field-body {
|
.lc-field-body {
|
||||||
.lc-inline-field {
|
.lc-inline-field {
|
||||||
// padding: @y-gap @x-gap/2 0 @x-gap/2;
|
|
||||||
padding: 0;
|
|
||||||
&:first-child {
|
&:first-child {
|
||||||
padding-top: 0;
|
padding-top: 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -111,7 +111,7 @@ class SettingGroupView extends Component<{ field: SettingField }> {
|
|||||||
render() {
|
render() {
|
||||||
const { field } = this.props;
|
const { field } = this.props;
|
||||||
const { extraProps } = field;
|
const { extraProps } = field;
|
||||||
const { condition } = extraProps;
|
const { condition, display } = extraProps;
|
||||||
const visible = field.isSingle && typeof condition === 'function' ? condition(field) !== false : true;
|
const visible = field.isSingle && typeof condition === 'function' ? condition(field) !== false : true;
|
||||||
|
|
||||||
if (!visible) {
|
if (!visible) {
|
||||||
@ -119,9 +119,18 @@ class SettingGroupView extends Component<{ field: SettingField }> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// todo: split collapsed state | field.items for optimize
|
// todo: split collapsed state | field.items for optimize
|
||||||
|
// return createField({
|
||||||
|
// meta: field?.componentMeta?.npm || field?.componentMeta?.componentName || '',
|
||||||
|
// title: field.title,
|
||||||
|
// collapsed: !field.expanded,
|
||||||
|
// onExpandChange: (expandState) => field.setExpanded(expandState),
|
||||||
|
// },
|
||||||
|
// field.items.map((item, index) => createSettingFieldView(item, field, index)),
|
||||||
|
// display);
|
||||||
return (
|
return (
|
||||||
<Field
|
<Field
|
||||||
defaultDisplay="accordion"
|
defaultDisplay="accordion"
|
||||||
|
// defaultDisplay={display}
|
||||||
meta={field?.componentMeta?.npm || field?.componentMeta?.componentName || ''}
|
meta={field?.componentMeta?.npm || field?.componentMeta?.componentName || ''}
|
||||||
title={field.title}
|
title={field.title}
|
||||||
collapsed={!field.expanded}
|
collapsed={!field.expanded}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user