feat: checkboxs允许配置全选/不选文案 (#7408)

* perf: checkboxs允许配置全选/不选文案

* perf: checkboxs允许配置全选/不选文案

---------

Co-authored-by: yanglu19 <yanglu19@baidu.com>
This commit is contained in:
Dora 2023-07-10 10:36:09 +08:00 committed by GitHub
parent c625db7b44
commit 5638927871
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 2 deletions

View File

@ -141,6 +141,7 @@ export class CheckboxesControlPlugin extends BasePlugin {
if (!value) {
// 可全选关闭时,默认全选也需联动关闭
form.setValueByName('defaultCheckAll', false);
form.setValueByName('checkAllText', undefined);
}
}
}),
@ -153,7 +154,12 @@ export class CheckboxesControlPlugin extends BasePlugin {
label: '默认全选',
name: 'defaultCheckAll',
value: false
})
}),
{
type: 'input-text',
label: '全选文本',
name: 'checkAllText'
}
]
}
],

View File

@ -30,6 +30,10 @@ export interface CheckboxesControlSchema extends FormOptionsSchema {
*/
defaultCheckAll?: boolean;
/**
* /
*/
checkAllText?: string;
/**
*
*/
@ -337,6 +341,7 @@ export default class CheckboxesControl extends React.Component<
onToggle,
onToggleAll,
checkAll,
checkAllText,
classnames: cx,
itemClassName,
labelClassName,
@ -369,7 +374,7 @@ export default class CheckboxesControl extends React.Component<
inline={inline}
labelClassName={labelClassName}
>
{__('Checkboxes.selectAll')}
{checkAllText ?? __('Checkboxes.selectAll')}
</Checkbox>
);
}