Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(amis-editor): 补全编辑器遗漏的 theme 参数 #8099

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions packages/amis-editor/src/renderer/OptionControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -712,16 +712,21 @@ export default class OptionControl extends React.Component<
clearable={false}
onChange={(value: string) => this.handleEditLabel(index, value)}
/> */}
{amisRender({
type: i18nEnabled ? 'input-text-i18n' : 'input-text',
className: 'ae-OptionControlItem-input',
value: label,
placeholder: '请输入文本/值',
clearable: false,
onChange: (value: string) => {
this.handleEditLabel(index, value);
{amisRender(
{
type: i18nEnabled ? 'input-text-i18n' : 'input-text',
className: 'ae-OptionControlItem-input',
value: label,
placeholder: '请输入文本/值',
clearable: false,
onChange: (value: string) => {
this.handleEditLabel(index, value);
}
},
{
theme: this.props.theme
}
})}
)}
{render(
'dropdown',
{
Expand Down
66 changes: 41 additions & 25 deletions packages/amis-editor/src/renderer/TimelineItemControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ export default class TimelineItemControl extends React.Component<
}

renderOption(props: TimelineItem & {index: number}) {
const {theme} = this.props;
const {time, title, index} = props;
const delDisabled = !(this.state.items.length > 2);
const i18nEnabled = getI18nEnabled();
Expand All @@ -418,15 +419,18 @@ export default class TimelineItemControl extends React.Component<
this.handleEditLabel(index, value, 'time')
}
/> */}
{amisRender({
type: i18nEnabled ? 'input-text-i18n' : 'input-text',
className: 'ae-TimelineItemControlItem-input',
value: time,
placeholder: '请输入显示时间',
clearable: false,
onChange: (value: string) =>
this.handleEditLabel(index, value, 'time')
})}
{amisRender(
{
type: i18nEnabled ? 'input-text-i18n' : 'input-text',
className: 'ae-TimelineItemControlItem-input',
value: time,
placeholder: '请输入显示时间',
clearable: false,
onChange: (value: string) =>
this.handleEditLabel(index, value, 'time')
},
{theme}
)}
{/* {amisRender(
{
type: "input-date",
Expand Down Expand Up @@ -494,6 +498,7 @@ export default class TimelineItemControl extends React.Component<
]
},
{
theme,
popOverContainer: null // amis 渲染挂载节点会使用 this.target
}
)}
Expand All @@ -508,15 +513,18 @@ export default class TimelineItemControl extends React.Component<
this.handleEditLabel(index, value, 'title')
}
/> */}
{amisRender({
type: i18nEnabled ? 'input-text-i18n' : 'input-text',
className: 'ae-TimelineItemControlItem-input-title',
value: title,
clearable: false,
placeholder: '请输入标题',
onChange: (value: string) =>
this.handleEditLabel(index, value, 'title')
})}
{amisRender(
{
type: i18nEnabled ? 'input-text-i18n' : 'input-text',
className: 'ae-TimelineItemControlItem-input-title',
value: title,
clearable: false,
placeholder: '请输入标题',
onChange: (value: string) =>
this.handleEditLabel(index, value, 'title')
},
{theme}
)}
</div>
</li>
);
Expand Down Expand Up @@ -544,7 +552,7 @@ export default class TimelineItemControl extends React.Component<

render() {
const {source, items} = this.state;
const {render, className} = this.props;
const {render, className, theme} = this.props;
return (
<div className={cx('ae-TimelineItemControl', className)}>
{this.renderHeader()}
Expand All @@ -562,12 +570,20 @@ export default class TimelineItemControl extends React.Component<
)}

<div className="ae-TimelineItemControl-footer">
{amisRender(this.buildAddSchema(), {
onSubmit: this.handleAdd
})}
{amisRender(this.buildBatchAddSchema(), {
onSubmit: this.handleBatchAdd
})}
{amisRender(
this.buildAddSchema(),
{
onSubmit: this.handleAdd
},
{theme}
)}
{amisRender(
this.buildBatchAddSchema(),
{
onSubmit: this.handleBatchAdd
},
{theme}
)}
</div>
</div>
) : null}
Expand Down
5 changes: 3 additions & 2 deletions packages/amis-editor/src/renderer/TransferTableControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -482,10 +482,11 @@ export default class TransferTableOption extends React.Component<
}

render() {
const {theme} = this.props;
return (
<div className="ae-OptionControl-footer">
{amisRender(this.addColumns())}
{amisRender(this.addRows())}
{amisRender(this.addColumns(), {theme})}
{amisRender(this.addRows(), {theme})}
</div>
);
}
Expand Down
3 changes: 2 additions & 1 deletion packages/amis-editor/src/renderer/event-control/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1270,7 +1270,8 @@ export class EventControl extends React.Component<
},
{
data: eventDialogData
}
},
{theme: this.props.theme}
)
: null}
<ActionDialog
Expand Down
Loading