mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-07 14:39:25 +08:00
feat: add ellipsis configuration support for more components (#5888)
* feat: add ellipsis configuration support for more components * chore: fix unit tests
This commit is contained in:
parent
486aa24b5f
commit
6d3c7e037f
@ -198,6 +198,10 @@ describe('FieldSettingsFormItem', () => {
|
||||
title: 'Allow multiple',
|
||||
type: 'switch',
|
||||
},
|
||||
{
|
||||
title: 'Ellipsis overflow content',
|
||||
type: 'switch',
|
||||
},
|
||||
{
|
||||
title: 'Title field',
|
||||
type: 'select',
|
||||
@ -304,6 +308,10 @@ describe('FieldSettingsFormItem', () => {
|
||||
title: 'Enable link',
|
||||
type: 'switch',
|
||||
},
|
||||
{
|
||||
title: 'Ellipsis overflow content',
|
||||
type: 'switch',
|
||||
},
|
||||
{
|
||||
title: 'Delete',
|
||||
type: 'delete',
|
||||
|
@ -12,10 +12,11 @@ import { useField, useFieldSchema } from '@formily/react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { SchemaSettings } from '../../../../application/schema-settings/SchemaSettings';
|
||||
import { useFieldComponentName } from '../../../../common/useFieldComponentName';
|
||||
import { useCollectionField } from '../../../../data-source';
|
||||
import { useDesignable, useFieldModeOptions, useIsAddNewForm } from '../../../../schema-component';
|
||||
import { isSubMode } from '../../../../schema-component/antd/association-field/util';
|
||||
import { useTitleFieldOptions } from '../../../../schema-component/antd/form-item/FormItem.Settings';
|
||||
import { useCollectionField } from '../../../../data-source';
|
||||
import { ellipsisSettingsItem } from '../Input/inputComponentSettings';
|
||||
|
||||
const fieldComponent: any = {
|
||||
name: 'fieldComponent',
|
||||
@ -99,5 +100,5 @@ const titleField: any = {
|
||||
|
||||
export const cascadeSelectComponentFieldSettings = new SchemaSettings({
|
||||
name: 'fieldSettings:component:CascadeSelect',
|
||||
items: [fieldComponent, titleField],
|
||||
items: [fieldComponent, titleField, ellipsisSettingsItem],
|
||||
});
|
||||
|
@ -9,8 +9,9 @@
|
||||
|
||||
import { useFieldSchema } from '@formily/react';
|
||||
import { SchemaSettings } from '../../../../application/schema-settings/SchemaSettings';
|
||||
import { SchemaSettingsDateFormat } from '../../../../schema-settings/SchemaSettingsDateFormat';
|
||||
import { useColumnSchema } from '../../../../schema-component/antd/table-v2/Table.Column.Decorator';
|
||||
import { SchemaSettingsDateFormat } from '../../../../schema-settings/SchemaSettingsDateFormat';
|
||||
import { ellipsisSettingsItem } from '../Input/inputComponentSettings';
|
||||
|
||||
export const datePickerComponentFieldSettings = new SchemaSettings({
|
||||
name: 'fieldSettings:component:DatePicker',
|
||||
@ -27,6 +28,7 @@ export const datePickerComponentFieldSettings = new SchemaSettings({
|
||||
};
|
||||
},
|
||||
},
|
||||
ellipsisSettingsItem,
|
||||
],
|
||||
});
|
||||
|
||||
@ -45,5 +47,6 @@ export const rangePickerPickerComponentFieldSettings = new SchemaSettings({
|
||||
};
|
||||
},
|
||||
},
|
||||
ellipsisSettingsItem,
|
||||
],
|
||||
});
|
||||
|
@ -16,7 +16,7 @@ import { SchemaSettings } from '../../../../application/schema-settings/SchemaSe
|
||||
import { useFormBlockContext } from '../../../../block-provider/FormBlockProvider';
|
||||
import { useCollectionManager_deprecated, useCollection_deprecated } from '../../../../collection-manager';
|
||||
import { useFieldComponentName } from '../../../../common/useFieldComponentName';
|
||||
import { useCollectionField } from '../../../../data-source';
|
||||
import { useCollectionField, useDataBlockProps } from '../../../../data-source';
|
||||
import { useRecord } from '../../../../record-provider';
|
||||
import { removeNullCondition, useDesignable, useFieldModeOptions, useIsAddNewForm } from '../../../../schema-component';
|
||||
import { isSubMode } from '../../../../schema-component/antd/association-field/util';
|
||||
@ -34,7 +34,7 @@ import { SchemaSettingsSortingRule } from '../../../../schema-settings/SchemaSet
|
||||
import { useIsShowMultipleSwitch } from '../../../../schema-settings/hooks/useIsShowMultipleSwitch';
|
||||
import { useLocalVariables, useVariables } from '../../../../variables';
|
||||
import { useOpenModeContext } from '../../../popup/OpenModeProvider';
|
||||
import { useDataBlockProps } from '../../../../data-source';
|
||||
import { ellipsisSettingsItem } from '../Input/inputComponentSettings';
|
||||
|
||||
const enableLink = {
|
||||
name: 'enableLink',
|
||||
@ -382,6 +382,7 @@ export const selectComponentFieldSettings = new SchemaSettings({
|
||||
return useIsAssociationField() && readPretty;
|
||||
},
|
||||
},
|
||||
ellipsisSettingsItem,
|
||||
],
|
||||
});
|
||||
|
||||
|
@ -12,12 +12,13 @@ import { useField, useFieldSchema } from '@formily/react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { SchemaSettings } from '../../../../application/schema-settings/SchemaSettings';
|
||||
import { useFieldComponentName } from '../../../../common/useFieldComponentName';
|
||||
import { useCollectionField } from '../../../../data-source';
|
||||
import { useDesignable, useFieldModeOptions, useIsAddNewForm } from '../../../../schema-component';
|
||||
import { isSubMode } from '../../../../schema-component/antd/association-field/util';
|
||||
import { useTitleFieldOptions } from '../../../../schema-component/antd/form-item/FormItem.Settings';
|
||||
import { useColorFields } from '../../../../schema-component/antd/table-v2/Table.Column.Designer';
|
||||
import { useColumnSchema } from '../../../../schema-component/antd/table-v2/Table.Column.Decorator';
|
||||
import { useCollectionField } from '../../../../data-source';
|
||||
import { useColorFields } from '../../../../schema-component/antd/table-v2/Table.Column.Designer';
|
||||
import { ellipsisSettingsItem } from '../Input/inputComponentSettings';
|
||||
|
||||
const enableLink = {
|
||||
name: 'enableLink',
|
||||
@ -177,5 +178,6 @@ export const tagComponentFieldSettings = new SchemaSettings({
|
||||
},
|
||||
titleField,
|
||||
enableLink,
|
||||
ellipsisSettingsItem,
|
||||
],
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user