mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-08 23:19:26 +08:00
Merge branch 'main' into next
This commit is contained in:
commit
122d33aaf5
@ -520,6 +520,14 @@
|
|||||||
"Small": "Small",
|
"Small": "Small",
|
||||||
"Middle": "Middle",
|
"Middle": "Middle",
|
||||||
"Large": "Large",
|
"Large": "Large",
|
||||||
|
"Size": "Size",
|
||||||
|
"Oversized": "Oversized",
|
||||||
|
"Auto": "Auto",
|
||||||
|
"Object Fit": "Object Fit",
|
||||||
|
"Cover": "Cover",
|
||||||
|
"Fill": "Fill",
|
||||||
|
"Contain": "Contain",
|
||||||
|
"Scale Down": "Scale Down",
|
||||||
"Menu item title": "Menu item title",
|
"Menu item title": "Menu item title",
|
||||||
"Menu item icon": "Menu item icon",
|
"Menu item icon": "Menu item icon",
|
||||||
"Target": "Target",
|
"Target": "Target",
|
||||||
|
@ -489,6 +489,14 @@
|
|||||||
"Small": "Pequeño",
|
"Small": "Pequeño",
|
||||||
"Middle": "Medio",
|
"Middle": "Medio",
|
||||||
"Large": "Grande",
|
"Large": "Grande",
|
||||||
|
"Size": "Tamaño",
|
||||||
|
"Oversized": "Sobredimensionado",
|
||||||
|
"Auto": "Automático",
|
||||||
|
"Object Fit": "Ajuste de objeto",
|
||||||
|
"Cover": "Cubrir",
|
||||||
|
"Fill": "Llenar",
|
||||||
|
"Contain": "Contener",
|
||||||
|
"Scale Down": "Reducir",
|
||||||
"Menu item title": "Título del elemento del menú",
|
"Menu item title": "Título del elemento del menú",
|
||||||
"Menu item icon": "Icono del elemento del menú",
|
"Menu item icon": "Icono del elemento del menú",
|
||||||
"Target": "Objetivo",
|
"Target": "Objetivo",
|
||||||
|
@ -504,6 +504,14 @@
|
|||||||
"Small": "Petite",
|
"Small": "Petite",
|
||||||
"Middle": "Moyenne",
|
"Middle": "Moyenne",
|
||||||
"Large": "Grande",
|
"Large": "Grande",
|
||||||
|
"Size": "Taille",
|
||||||
|
"Oversized": "Surdimensionné",
|
||||||
|
"Auto": "Auto",
|
||||||
|
"Object Fit": "Ajustement de l'objet",
|
||||||
|
"Cover": "Couvrir",
|
||||||
|
"Fill": "Remplir",
|
||||||
|
"Contain": "Contenir",
|
||||||
|
"Scale Down": "Réduire",
|
||||||
"Menu item title": "Titre de l'élément de menu",
|
"Menu item title": "Titre de l'élément de menu",
|
||||||
"Menu item icon": "Icône de l'élément de menu",
|
"Menu item icon": "Icône de l'élément de menu",
|
||||||
"Target": "Cible",
|
"Target": "Cible",
|
||||||
|
@ -786,6 +786,14 @@
|
|||||||
"Small": "スモール",
|
"Small": "スモール",
|
||||||
"Middle": "ミドル",
|
"Middle": "ミドル",
|
||||||
"Large": "ラージ",
|
"Large": "ラージ",
|
||||||
|
"Size": "サイズ",
|
||||||
|
"Oversized": "特大",
|
||||||
|
"Auto": "自動",
|
||||||
|
"Object Fit": "オブジェクトフィット",
|
||||||
|
"Cover": "カバー",
|
||||||
|
"Fill": "フィル",
|
||||||
|
"Contain": "コンテイン",
|
||||||
|
"Scale Down": "スケールダウン",
|
||||||
"Identifier for program usage. Support letters, numbers and underscores, must start with an letter.": "プログラム使用のための識別子。文字、数字、...",
|
"Identifier for program usage. Support letters, numbers and underscores, must start with an letter.": "プログラム使用のための識別子。文字、数字、...",
|
||||||
"Style": "スタイル",
|
"Style": "スタイル",
|
||||||
"Allows to configure interface": "インターフェースの設定を許可",
|
"Allows to configure interface": "インターフェースの設定を許可",
|
||||||
|
@ -536,6 +536,14 @@
|
|||||||
"Small": "작은",
|
"Small": "작은",
|
||||||
"Middle": "중간",
|
"Middle": "중간",
|
||||||
"Large": "큰",
|
"Large": "큰",
|
||||||
|
"Size": "크기",
|
||||||
|
"Oversized": "초대형",
|
||||||
|
"Auto": "자동",
|
||||||
|
"Object Fit": "객체 맞춤",
|
||||||
|
"Cover": "커버",
|
||||||
|
"Fill": "채우기",
|
||||||
|
"Contain": "포함",
|
||||||
|
"Scale Down": "축소",
|
||||||
"Menu item title": "메뉴 항목 제목",
|
"Menu item title": "메뉴 항목 제목",
|
||||||
"Menu item icon": "메뉴 항목 아이콘",
|
"Menu item icon": "메뉴 항목 아이콘",
|
||||||
"Target": "대상",
|
"Target": "대상",
|
||||||
|
@ -452,6 +452,14 @@
|
|||||||
"Small": "Pequeno",
|
"Small": "Pequeno",
|
||||||
"Middle": "Médio",
|
"Middle": "Médio",
|
||||||
"Large": "Grande",
|
"Large": "Grande",
|
||||||
|
"Size": "Tamanho",
|
||||||
|
"Oversized": "Exagerado",
|
||||||
|
"Auto": "Automático",
|
||||||
|
"Object Fit": "Ajuste do Objeto",
|
||||||
|
"Cover": "Cobrir",
|
||||||
|
"Fill": "Preencher",
|
||||||
|
"Contain": "Contém",
|
||||||
|
"Scale Down": "Reduzir",
|
||||||
"Menu item title": "Título do item de menu",
|
"Menu item title": "Título do item de menu",
|
||||||
"Menu item icon": "Ícone do item de menu",
|
"Menu item icon": "Ícone do item de menu",
|
||||||
"Target": "Destino",
|
"Target": "Destino",
|
||||||
|
@ -506,6 +506,14 @@
|
|||||||
"Small": "Малий",
|
"Small": "Малий",
|
||||||
"Middle": "Середній",
|
"Middle": "Середній",
|
||||||
"Large": "Великий",
|
"Large": "Великий",
|
||||||
|
"Size": "Розмір",
|
||||||
|
"Oversized": "Великий",
|
||||||
|
"Auto": "Авто",
|
||||||
|
"Object Fit": "Пристосування",
|
||||||
|
"Cover": "Накрити",
|
||||||
|
"Fill": "Наповнення",
|
||||||
|
"Contain": "Вмістити",
|
||||||
|
"Scale Down": "Зменшити",
|
||||||
"Menu item title": "Заголовок пункту меню",
|
"Menu item title": "Заголовок пункту меню",
|
||||||
"Menu item icon": "Значок пункту меню",
|
"Menu item icon": "Значок пункту меню",
|
||||||
"Target": "Ціль",
|
"Target": "Ціль",
|
||||||
|
@ -541,6 +541,14 @@
|
|||||||
"Small": "较窄",
|
"Small": "较窄",
|
||||||
"Middle": "中等",
|
"Middle": "中等",
|
||||||
"Large": "较宽",
|
"Large": "较宽",
|
||||||
|
"Size": "大小",
|
||||||
|
"Oversized": "超大",
|
||||||
|
"Auto": "自动",
|
||||||
|
"Object Fit": "适应",
|
||||||
|
"Cover": "覆盖",
|
||||||
|
"Fill": "填充",
|
||||||
|
"Contain": "包含",
|
||||||
|
"Scale Down": "缩放",
|
||||||
"Menu item title": "菜单项名称",
|
"Menu item title": "菜单项名称",
|
||||||
"Menu item icon": "菜单项图标",
|
"Menu item icon": "菜单项图标",
|
||||||
"Target": "目标",
|
"Target": "目标",
|
||||||
|
@ -537,6 +537,14 @@
|
|||||||
"Small": "較窄",
|
"Small": "較窄",
|
||||||
"Middle": "中等",
|
"Middle": "中等",
|
||||||
"Large": "較寬",
|
"Large": "較寬",
|
||||||
|
"Size": "大小",
|
||||||
|
"Oversized": "超大",
|
||||||
|
"Auto": "自動",
|
||||||
|
"Object Fit": "適應",
|
||||||
|
"Cover": "覆蓋",
|
||||||
|
"Fill": "填充",
|
||||||
|
"Contain": "包含",
|
||||||
|
"Scale Down": "縮放",
|
||||||
"Menu item title": "選單項目名稱",
|
"Menu item title": "選單項目名稱",
|
||||||
"Menu item icon": "選單項目圖示",
|
"Menu item icon": "選單項目圖示",
|
||||||
"Target": "目標",
|
"Target": "目標",
|
||||||
|
@ -13,11 +13,14 @@ import { useTranslation } from 'react-i18next';
|
|||||||
import { SchemaSettings } from '../../../../application/schema-settings/SchemaSettings';
|
import { SchemaSettings } from '../../../../application/schema-settings/SchemaSettings';
|
||||||
import { useColumnSchema, useDesignable } from '../../../../schema-component';
|
import { useColumnSchema, useDesignable } from '../../../../schema-component';
|
||||||
import { SchemaSettingsItemType } from '../../../../application/schema-settings';
|
import { SchemaSettingsItemType } from '../../../../application/schema-settings';
|
||||||
// import { createSelectSchemaSettingsItem } from '../../../../application';
|
|
||||||
// import { fieldComponent } from '../Input.URL/settings';
|
|
||||||
|
|
||||||
const size: SchemaSettingsItemType = {
|
const createSettingsItem = (config: {
|
||||||
name: 'size',
|
name: string;
|
||||||
|
title: string;
|
||||||
|
options: typeof getSizeOptions | typeof getObjectFitOptions;
|
||||||
|
defaultValue: string;
|
||||||
|
}): SchemaSettingsItemType => ({
|
||||||
|
name: config.name,
|
||||||
type: 'select',
|
type: 'select',
|
||||||
useComponentProps() {
|
useComponentProps() {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@ -26,49 +29,59 @@ const size: SchemaSettingsItemType = {
|
|||||||
const { fieldSchema: tableColumnSchema } = useColumnSchema();
|
const { fieldSchema: tableColumnSchema } = useColumnSchema();
|
||||||
const fieldSchema = tableColumnSchema || schema;
|
const fieldSchema = tableColumnSchema || schema;
|
||||||
const { dn } = useDesignable();
|
const { dn } = useDesignable();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
title: t('Size'),
|
title: t(config.title),
|
||||||
options: [
|
options: config.options(t),
|
||||||
{ value: 'small', label: 'Small' },
|
value: fieldSchema['x-component-props']?.[config.name] || config.defaultValue,
|
||||||
{ value: 'middle', label: 'Middle' },
|
onChange(value) {
|
||||||
{ value: 'large', label: 'Large' },
|
|
||||||
{ value: 'auto', label: 'Auto' },
|
|
||||||
],
|
|
||||||
value: fieldSchema['x-component-props']?.['size'] || 'small',
|
|
||||||
onChange(size) {
|
|
||||||
const schema = {
|
const schema = {
|
||||||
['x-uid']: fieldSchema['x-uid'],
|
['x-uid']: fieldSchema['x-uid'],
|
||||||
};
|
};
|
||||||
fieldSchema['x-component-props'] = fieldSchema['x-component-props'] || {};
|
fieldSchema['x-component-props'] = fieldSchema['x-component-props'] || {};
|
||||||
fieldSchema['x-component-props']['size'] = size;
|
fieldSchema['x-component-props'][config.name] = value;
|
||||||
schema['x-component-props'] = fieldSchema['x-component-props'];
|
schema['x-component-props'] = fieldSchema['x-component-props'];
|
||||||
field.componentProps = field.componentProps || {};
|
field.componentProps = field.componentProps || {};
|
||||||
field.componentProps.size = size;
|
field.componentProps[config.name] = value;
|
||||||
dn.emit('patch', {
|
dn.emit('patch', {
|
||||||
schema,
|
schema,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
};
|
});
|
||||||
|
|
||||||
// const size2 = createSelectSchemaSettingsItem({
|
const getSizeOptions = (t: (key: string) => any) => [
|
||||||
// name: 'size2',
|
{ value: 'small', label: t('Small') },
|
||||||
// title: 'Size2',
|
{ value: 'middle', label: t('Middle') },
|
||||||
// type: 'field',
|
{ value: 'large', label: t('Large') },
|
||||||
// schemaKey: 'x-component-props.size',
|
{ value: 'oversized', label: t('Oversized') },
|
||||||
// options: [
|
{ value: 'auto', label: t('Auto') },
|
||||||
// { value: 'small', label: 'Small' },
|
];
|
||||||
// { value: 'middle', label: 'Middle' },
|
|
||||||
// { value: 'large', label: 'Large' },
|
const getObjectFitOptions = (t: (key: string) => any) => [
|
||||||
// { value: 'auto', label: 'Auto' },
|
{ value: 'cover', label: t('Cover') },
|
||||||
// ],
|
{ value: 'fill', label: t('Fill') },
|
||||||
// });
|
{ value: 'contain', label: t('Contain') },
|
||||||
|
{ value: 'scale-down', label: t('Scale Down') },
|
||||||
|
{ value: 'none', label: t('None') },
|
||||||
|
];
|
||||||
|
|
||||||
|
const size = createSettingsItem({
|
||||||
|
name: 'size',
|
||||||
|
title: 'Size',
|
||||||
|
options: getSizeOptions,
|
||||||
|
defaultValue: 'small',
|
||||||
|
});
|
||||||
|
|
||||||
|
const objectFit = createSettingsItem({
|
||||||
|
name: 'objectFit',
|
||||||
|
title: 'Object Fit',
|
||||||
|
options: getObjectFitOptions,
|
||||||
|
defaultValue: 'cover',
|
||||||
|
});
|
||||||
|
|
||||||
export const inputPreviewComponentFieldSettings = new SchemaSettings({
|
export const inputPreviewComponentFieldSettings = new SchemaSettings({
|
||||||
name: 'fieldSettings:component:Input.Preview',
|
name: 'fieldSettings:component:Input.Preview',
|
||||||
items: [
|
items: [size, objectFit],
|
||||||
size,
|
|
||||||
// size2
|
|
||||||
],
|
|
||||||
});
|
});
|
||||||
|
@ -555,7 +555,7 @@ const RenderButtonInner = observer(
|
|||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
if (!designable && (field?.data?.hidden || !aclCtx)) {
|
if (!designable && (field?.data?.hidden || !aclCtx)) {
|
||||||
return null;
|
return <div style={{ visibility: 'hidden' }}> </div>;
|
||||||
}
|
}
|
||||||
|
|
||||||
const actionTitle = title || field?.title;
|
const actionTitle = title || field?.title;
|
||||||
|
@ -14,10 +14,10 @@ import { Image } from 'antd';
|
|||||||
import cls from 'classnames';
|
import cls from 'classnames';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import React, { useMemo } from 'react';
|
import React, { useMemo } from 'react';
|
||||||
|
import { withPopupWrapper } from '../../common/withPopupWrapper';
|
||||||
import { useCompile } from '../../hooks';
|
import { useCompile } from '../../hooks';
|
||||||
import { EllipsisWithTooltip } from './EllipsisWithTooltip';
|
import { EllipsisWithTooltip } from './EllipsisWithTooltip';
|
||||||
import { HTMLEncode } from './shared';
|
import { HTMLEncode } from './shared';
|
||||||
import { withPopupWrapper } from '../../common/withPopupWrapper';
|
|
||||||
|
|
||||||
export type InputReadPrettyComposed = {
|
export type InputReadPrettyComposed = {
|
||||||
Input: React.FC<InputReadPrettyProps>;
|
Input: React.FC<InputReadPrettyProps>;
|
||||||
@ -222,22 +222,26 @@ const sizes = {
|
|||||||
small: 24,
|
small: 24,
|
||||||
middle: 48,
|
middle: 48,
|
||||||
large: 72,
|
large: 72,
|
||||||
|
oversized: 120,
|
||||||
};
|
};
|
||||||
|
|
||||||
ReadPretty.Preview = function Preview(props: any) {
|
ReadPretty.Preview = function Preview(props: any) {
|
||||||
const fieldSchema = useFieldSchema();
|
const fieldSchema = useFieldSchema();
|
||||||
const size = fieldSchema['x-component-props']?.['size'] || 'small';
|
const size = fieldSchema['x-component-props']?.['size'] || 'small';
|
||||||
|
const objectFit = fieldSchema['x-component-props']?.['objectFit'] || 'cover';
|
||||||
|
|
||||||
if (!props.value) {
|
if (!props.value) {
|
||||||
return props.value;
|
return props.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Image
|
<Image
|
||||||
style={
|
style={
|
||||||
['small', 'middle', 'large'].includes(size)
|
['small', 'middle', 'large', 'oversized'].includes(size)
|
||||||
? {
|
? {
|
||||||
width: sizes[size],
|
width: sizes[size],
|
||||||
height: sizes[size],
|
height: sizes[size],
|
||||||
objectFit: 'cover',
|
objectFit,
|
||||||
}
|
}
|
||||||
: {}
|
: {}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user