fix(plugin-field-sequence): fix read only mode (#6274)

This commit is contained in:
Junyi 2025-02-26 12:19:55 +08:00 committed by GitHub
parent 608c9f2276
commit 929f2c94d5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -121,9 +121,11 @@ const RuleTypes = {
number: t('Number', { ns: NAMESPACE }), number: t('Number', { ns: NAMESPACE }),
lowercase: t('Lowercase letters', { ns: NAMESPACE }), lowercase: t('Lowercase letters', { ns: NAMESPACE }),
uppercase: t('Uppercase letters', { ns: NAMESPACE }), uppercase: t('Uppercase letters', { ns: NAMESPACE }),
symbol: t('Symbols', { ns: NAMESPACE }) symbol: t('Symbols', { ns: NAMESPACE }),
}; };
return <code>{value?.map(charset => charsetLabels[charset]).join(', ') || t('Number', { ns: NAMESPACE })}</code>; return (
<code>{value?.map((charset) => charsetLabels[charset]).join(', ') || t('Number', { ns: NAMESPACE })}</code>
);
}, },
}, },
fieldset: { fieldset: {
@ -154,14 +156,14 @@ const RuleTypes = {
{ value: 'number', label: `{{t("Number", { ns: "${NAMESPACE}" })}}` }, { value: 'number', label: `{{t("Number", { ns: "${NAMESPACE}" })}}` },
{ value: 'lowercase', label: `{{t("Lowercase letters", { ns: "${NAMESPACE}" })}}` }, { value: 'lowercase', label: `{{t("Lowercase letters", { ns: "${NAMESPACE}" })}}` },
{ value: 'uppercase', label: `{{t("Uppercase letters", { ns: "${NAMESPACE}" })}}` }, { value: 'uppercase', label: `{{t("Uppercase letters", { ns: "${NAMESPACE}" })}}` },
{ value: 'symbol', label: `{{t("Symbols", { ns: "${NAMESPACE}" })}}` } { value: 'symbol', label: `{{t("Symbols", { ns: "${NAMESPACE}" })}}` },
], ],
required: true, required: true,
default: ['number'], default: ['number'],
'x-validator': { 'x-validator': {
minItems: 1, minItems: 1,
message: `{{t("At least one character set should be selected", { ns: "${NAMESPACE}" })}}` message: `{{t("At least one character set should be selected", { ns: "${NAMESPACE}" })}}`,
} },
}, },
}, },
defaults: { defaults: {
@ -365,14 +367,6 @@ export class SequenceFieldInterface extends CollectionFieldInterface {
operators: interfacesProperties.operators.string, operators: interfacesProperties.operators.string,
}; };
titleUsable = true; titleUsable = true;
schemaInitialize(schema: ISchema, { block, field }) {
if (block === 'Form') {
Object.assign(schema['x-component-props'], {
disabled: !field.inputable,
});
}
return schema;
}
properties = { properties = {
...interfacesProperties.defaultProps, ...interfacesProperties.defaultProps,
unique: interfacesProperties.unique, unique: interfacesProperties.unique,