mirror of
https://github.com/lowdefy/lowdefy.git
synced 2025-02-23 14:39:32 +08:00
fix(blocks): Do not pass methods down to imported blocks.
This commit is contained in:
parent
6c2b4d0b42
commit
ff3f588410
@ -24,12 +24,7 @@ const AlertBlock = ({ blockId, events, methods, properties }) => {
|
||||
const additionalProps = {};
|
||||
if (properties.icon) {
|
||||
additionalProps.icon = (
|
||||
<Icon
|
||||
blockId={`${blockId}_icon`}
|
||||
events={events}
|
||||
methods={methods}
|
||||
properties={properties.icon}
|
||||
/>
|
||||
<Icon blockId={`${blockId}_icon`} events={events} properties={properties.icon} />
|
||||
);
|
||||
}
|
||||
return (
|
||||
|
@ -65,7 +65,6 @@ const AnchorBlock = ({ blockId, events, loading, methods, properties }) => {
|
||||
<Icon
|
||||
blockId={`${blockId}_icon`}
|
||||
events={events}
|
||||
methods={methods}
|
||||
properties={showLoading ? { name: 'LoadingOutlined', spin: true } : properties.icon}
|
||||
/>
|
||||
)}
|
||||
|
@ -41,7 +41,6 @@ const AutoCompleteInput = ({
|
||||
validation={validation}
|
||||
required={required}
|
||||
loading={loading}
|
||||
methods={methods}
|
||||
content={{
|
||||
content: () => (
|
||||
<AutoComplete
|
||||
|
@ -37,12 +37,7 @@ const AvatarBlock = ({ blockId, events, methods, properties }) => (
|
||||
])}
|
||||
icon={
|
||||
properties.icon && (
|
||||
<Icon
|
||||
blockId={`${blockId}_icon`}
|
||||
events={events}
|
||||
properties={properties.icon}
|
||||
methods={methods}
|
||||
/>
|
||||
<Icon blockId={`${blockId}_icon`} events={events} properties={properties.icon} />
|
||||
)
|
||||
}
|
||||
>
|
||||
|
@ -26,12 +26,7 @@ const BadgeBlock = ({ blockId, events, content, properties, methods }) => (
|
||||
color={properties.color}
|
||||
count={
|
||||
(properties.icon && (
|
||||
<Icon
|
||||
blockId={`${blockId}_icon`}
|
||||
events={events}
|
||||
properties={properties.icon}
|
||||
methods={methods}
|
||||
/>
|
||||
<Icon blockId={`${blockId}_icon`} events={events} properties={properties.icon} />
|
||||
)) ||
|
||||
properties.count
|
||||
}
|
||||
|
@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { type } from '@lowdefy/helpers';
|
||||
import { type, get } from '@lowdefy/helpers';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { Breadcrumb } from 'antd';
|
||||
import { blockDefaultProps } from '@lowdefy/block-tools';
|
||||
@ -39,47 +39,49 @@ const ItemLink = ({ link, children, className }) => {
|
||||
return <span className={className}>{children}</span>;
|
||||
};
|
||||
|
||||
const BreadcrumbBlock = ({ blockId, events, methods, properties }) => (
|
||||
<Breadcrumb
|
||||
id={blockId}
|
||||
separator={properties.separator}
|
||||
className={methods.makeCssClass(properties.style)}
|
||||
>
|
||||
{(properties.list || []).map((link, index) => (
|
||||
<Breadcrumb.Item
|
||||
key={index}
|
||||
onClick={
|
||||
events.onClick &&
|
||||
(() => methods.triggerEvent({ name: 'onClick', event: { link, index } }))
|
||||
}
|
||||
>
|
||||
<ItemLink
|
||||
className={methods.makeCssClass([
|
||||
{
|
||||
cursor: events.onClick && 'pointer',
|
||||
},
|
||||
link.style,
|
||||
])}
|
||||
link={link}
|
||||
const BreadcrumbBlock = ({ blockId, events, methods, properties, rename }) => {
|
||||
const onClickActionName = get(rename, 'events.onClick', { default: 'onClick' });
|
||||
return (
|
||||
<Breadcrumb
|
||||
id={blockId}
|
||||
separator={properties.separator}
|
||||
className={methods.makeCssClass(properties.style)}
|
||||
>
|
||||
{(properties.list || []).map((link, index) => (
|
||||
<Breadcrumb.Item
|
||||
key={index}
|
||||
onClick={
|
||||
events[onClickActionName] &&
|
||||
(() => methods.triggerEvent({ name: onClickActionName, event: { link, index } }))
|
||||
}
|
||||
>
|
||||
{link.icon && (
|
||||
<Icon
|
||||
blockId={`${blockId}_${index}_icon`}
|
||||
events={events}
|
||||
properties={{
|
||||
name: type.isString(link.icon) && link.icon,
|
||||
...(type.isObject(link.icon) ? link.icon : {}),
|
||||
style: { paddingRight: 8, ...(link.icon.style || {}) },
|
||||
}}
|
||||
methods={methods}
|
||||
/>
|
||||
)}
|
||||
{type.isString(link) ? link : link.label || link.pageId || link.url || `Link ${index}`}
|
||||
</ItemLink>
|
||||
</Breadcrumb.Item>
|
||||
))}
|
||||
</Breadcrumb>
|
||||
);
|
||||
<ItemLink
|
||||
className={methods.makeCssClass([
|
||||
{
|
||||
cursor: events[onClickActionName] && 'pointer',
|
||||
},
|
||||
link.style,
|
||||
])}
|
||||
link={link}
|
||||
>
|
||||
{link.icon && (
|
||||
<Icon
|
||||
blockId={`${blockId}_${index}_icon`}
|
||||
events={events}
|
||||
properties={{
|
||||
name: type.isString(link.icon) && link.icon,
|
||||
...(type.isObject(link.icon) ? link.icon : {}),
|
||||
style: { paddingRight: 8, ...(link.icon.style || {}) },
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
{type.isString(link) ? link : link.label || link.pageId || link.url || `Link ${index}`}
|
||||
</ItemLink>
|
||||
</Breadcrumb.Item>
|
||||
))}
|
||||
</Breadcrumb>
|
||||
);
|
||||
};
|
||||
|
||||
BreadcrumbBlock.defaultProps = blockDefaultProps;
|
||||
|
||||
|
@ -52,12 +52,7 @@ const ButtonBlock = ({ blockId, events, loading, methods, onClick, properties, r
|
||||
type={get(properties, 'type', { default: 'primary' })}
|
||||
icon={
|
||||
properties.icon && (
|
||||
<Icon
|
||||
blockId={`${blockId}_icon`}
|
||||
events={events}
|
||||
methods={methods}
|
||||
properties={properties.icon}
|
||||
/>
|
||||
<Icon blockId={`${blockId}_icon`} events={events} properties={properties.icon} />
|
||||
)
|
||||
}
|
||||
onClick={onClick || (() => methods.triggerEvent({ name: onClickActionName }))}
|
||||
|
@ -42,7 +42,6 @@ const ButtonSelector = ({
|
||||
validation={validation}
|
||||
required={required}
|
||||
loading={loading}
|
||||
methods={methods}
|
||||
content={{
|
||||
content: () => (
|
||||
<Radio.Group
|
||||
|
@ -42,7 +42,6 @@ const CheckboxSelector = ({
|
||||
validation={validation}
|
||||
required={required}
|
||||
loading={loading}
|
||||
methods={methods}
|
||||
content={{
|
||||
content: () => (
|
||||
<Checkbox.Group
|
||||
|
@ -49,7 +49,6 @@ const CollapseBlock = ({ blockId, events, content, methods, properties }) => {
|
||||
blockId={`${blockId}_expandIcon`}
|
||||
events={events}
|
||||
properties={{ rotate: isActive ? 90 : 0, ...propertiesIconExpand }}
|
||||
methods={methods}
|
||||
/>
|
||||
))
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ const CommentBlock = ({ blockId, content, properties, methods }) => {
|
||||
author={properties.author || (content.author && content.author())}
|
||||
content={properties.content || (content.content && content.content())}
|
||||
datetime={properties.datetime}
|
||||
avatar={<Avatar methods={methods} properties={avatar} />}
|
||||
avatar={<Avatar properties={avatar} />}
|
||||
>
|
||||
{content.children && content.children()}
|
||||
</Comment>
|
||||
|
@ -25,12 +25,7 @@ const ConfirmModal = ({ blockId, events, content, methods, properties }) => {
|
||||
const additionalProps = {};
|
||||
if (properties.icon) {
|
||||
additionalProps.icon = (
|
||||
<Icon
|
||||
blockId={`${blockId}_icon`}
|
||||
events={events}
|
||||
properties={properties.icon}
|
||||
methods={methods}
|
||||
/>
|
||||
<Icon blockId={`${blockId}_icon`} events={events} properties={properties.icon} />
|
||||
);
|
||||
}
|
||||
methods.triggerEvent({ name: 'onOpen' });
|
||||
|
@ -70,7 +70,6 @@ const ControlledListBlock = ({ blockId, events, properties, list, methods }) =>
|
||||
icon: 'PlusOutlined',
|
||||
...properties.addItemButton,
|
||||
}}
|
||||
methods={methods}
|
||||
onClick={() => methods.unshiftItem()}
|
||||
/>
|
||||
)}
|
||||
@ -92,7 +91,6 @@ const ControlledListBlock = ({ blockId, events, properties, list, methods }) =>
|
||||
icon: 'PlusOutlined',
|
||||
...properties.addItemButton,
|
||||
}}
|
||||
methods={methods}
|
||||
onClick={() => methods.pushItem()}
|
||||
/>
|
||||
</div>
|
||||
@ -124,7 +122,6 @@ const ControlledListBlock = ({ blockId, events, properties, list, methods }) =>
|
||||
: {}),
|
||||
},
|
||||
}}
|
||||
methods={methods}
|
||||
onClick={() => methods.removeItem(i)}
|
||||
/>,
|
||||
]
|
||||
|
@ -50,7 +50,6 @@ const DateRangeSelector = ({
|
||||
validation={validation}
|
||||
required={required}
|
||||
loading={loading}
|
||||
methods={methods}
|
||||
content={{
|
||||
content: () => (
|
||||
<div className={methods.makeCssClass({ width: '100%' })}>
|
||||
@ -76,7 +75,6 @@ const DateRangeSelector = ({
|
||||
blockId={`${blockId}_suffixIcon`}
|
||||
events={events}
|
||||
properties={properties.suffixIcon || 'CalendarOutlined'}
|
||||
methods={methods}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
@ -42,7 +42,6 @@ const DateSelector = ({
|
||||
validation={validation}
|
||||
required={required}
|
||||
loading={loading}
|
||||
methods={methods}
|
||||
content={{
|
||||
content: () => (
|
||||
<div className={methods.makeCssClass({ width: '100%' })}>
|
||||
@ -64,7 +63,6 @@ const DateSelector = ({
|
||||
blockId={`${blockId}_suffixIcon`}
|
||||
events={events}
|
||||
properties={properties.suffixIcon || 'CalendarOutlined'}
|
||||
methods={methods}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
@ -49,7 +49,6 @@ const DateTimeSelector = ({
|
||||
validation={validation}
|
||||
required={required}
|
||||
loading={loading}
|
||||
methods={methods}
|
||||
content={{
|
||||
content: () => (
|
||||
<div className={methods.makeCssClass({ width: '100%' })}>
|
||||
@ -71,7 +70,6 @@ const DateTimeSelector = ({
|
||||
blockId={`${blockId}_suffixIcon`}
|
||||
events={events}
|
||||
properties={properties.suffixIcon || 'CalendarOutlined'}
|
||||
methods={methods}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
@ -32,17 +32,17 @@ const getDefaultMenu = (menus, menuId = 'default', links) => {
|
||||
const getTitle = (id, properties, defaultTitle) =>
|
||||
(properties && properties.title) || defaultTitle || id;
|
||||
|
||||
const MenuTitle = ({ id, methods, pageId, properties, url, linkStyle }) =>
|
||||
const MenuTitle = ({ id, makeCssClass, pageId, properties, url, linkStyle }) =>
|
||||
type.isString(pageId) ? (
|
||||
<Link to={`/${pageId}`} className={methods.makeCssClass([linkStyle])}>
|
||||
<Link to={`/${pageId}`} className={makeCssClass([linkStyle])}>
|
||||
{getTitle(id, properties, pageId)}
|
||||
</Link>
|
||||
) : type.isString(url) ? (
|
||||
<a href={url} className={methods.makeCssClass([linkStyle])}>
|
||||
<a href={url} className={makeCssClass([linkStyle])}>
|
||||
{getTitle(id, properties, url)}
|
||||
</a>
|
||||
) : (
|
||||
<span className={methods.makeCssClass([linkStyle])}>{getTitle(id, properties)}</span>
|
||||
<span className={makeCssClass([linkStyle])}>{getTitle(id, properties)}</span>
|
||||
);
|
||||
|
||||
const getNestedColors = (menuColor, background) => {
|
||||
@ -185,7 +185,7 @@ const MenuComp = ({ blockId, events, methods, menus, pageId, properties, rename
|
||||
<MenuTitle
|
||||
linkStyle={link.style}
|
||||
id={link.id}
|
||||
methods={methods}
|
||||
makeCssClass={methods.makeCssClass}
|
||||
properties={link.properties}
|
||||
/>
|
||||
}
|
||||
@ -195,7 +195,6 @@ const MenuComp = ({ blockId, events, methods, menus, pageId, properties, rename
|
||||
<Icon
|
||||
blockId={`${link.id}_icon`}
|
||||
events={events}
|
||||
methods={methods}
|
||||
properties={link.properties.icon}
|
||||
/>
|
||||
)
|
||||
@ -211,7 +210,7 @@ const MenuComp = ({ blockId, events, methods, menus, pageId, properties, rename
|
||||
<MenuTitle
|
||||
linkStyle={subLink.style}
|
||||
id={subLink.id}
|
||||
methods={methods}
|
||||
makeCssClass={methods.makeCssClass}
|
||||
properties={subLink.properties}
|
||||
/>
|
||||
}
|
||||
@ -226,7 +225,6 @@ const MenuComp = ({ blockId, events, methods, menus, pageId, properties, rename
|
||||
<Icon
|
||||
blockId={`${subLinkGroup.id}_icon`}
|
||||
events={events}
|
||||
methods={methods}
|
||||
properties={subLinkGroup.properties.icon}
|
||||
/>
|
||||
)
|
||||
@ -235,7 +233,7 @@ const MenuComp = ({ blockId, events, methods, menus, pageId, properties, rename
|
||||
<MenuTitle
|
||||
linkStyle={subLinkGroup.style}
|
||||
id={subLinkGroup.id}
|
||||
methods={methods}
|
||||
makeCssClass={methods.makeCssClass}
|
||||
pageId={subLinkGroup.pageId}
|
||||
properties={subLinkGroup.properties}
|
||||
url={subLinkGroup.url}
|
||||
@ -256,7 +254,6 @@ const MenuComp = ({ blockId, events, methods, menus, pageId, properties, rename
|
||||
<Icon
|
||||
blockId={`${subLink.id}_icon`}
|
||||
events={events}
|
||||
methods={methods}
|
||||
properties={subLink.properties.icon}
|
||||
/>
|
||||
)
|
||||
@ -265,7 +262,7 @@ const MenuComp = ({ blockId, events, methods, menus, pageId, properties, rename
|
||||
<MenuTitle
|
||||
linkStyle={subLink.style}
|
||||
id={subLink.id}
|
||||
methods={methods}
|
||||
makeCssClass={methods.makeCssClass}
|
||||
pageId={subLink.pageId}
|
||||
properties={subLink.properties}
|
||||
url={subLink.url}
|
||||
@ -288,7 +285,6 @@ const MenuComp = ({ blockId, events, methods, menus, pageId, properties, rename
|
||||
<Icon
|
||||
blockId={`${link.id}_icon`}
|
||||
events={events}
|
||||
methods={methods}
|
||||
properties={link.properties.icon}
|
||||
/>
|
||||
)
|
||||
@ -297,7 +293,7 @@ const MenuComp = ({ blockId, events, methods, menus, pageId, properties, rename
|
||||
<MenuTitle
|
||||
linkStyle={link.style}
|
||||
id={link.id}
|
||||
methods={methods}
|
||||
makeCssClass={methods.makeCssClass}
|
||||
pageId={link.pageId}
|
||||
properties={link.properties}
|
||||
url={link.url}
|
||||
|
@ -34,7 +34,6 @@ const MessageBlock = ({ blockId, events, properties, methods }) => {
|
||||
blockId={`${blockId}_icon`}
|
||||
events={events}
|
||||
properties={args.icon || properties.icon}
|
||||
methods={methods}
|
||||
/>
|
||||
),
|
||||
className: methods.makeCssClass(properties.messageStyle),
|
||||
|
@ -44,7 +44,6 @@ const MonthSelector = ({
|
||||
validation={validation}
|
||||
required={required}
|
||||
loading={loading}
|
||||
methods={methods}
|
||||
content={{
|
||||
content: () => (
|
||||
<div className={methods.makeCssClass({ width: '100%' })}>
|
||||
@ -65,7 +64,6 @@ const MonthSelector = ({
|
||||
blockId={`${blockId}_suffixIcon`}
|
||||
events={events}
|
||||
properties={properties.suffixIcon || 'CalendarOutlined'}
|
||||
methods={methods}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
@ -40,7 +40,6 @@ const MultipleSelector = ({
|
||||
<Label
|
||||
blockId={blockId}
|
||||
loading={loading}
|
||||
methods={methods}
|
||||
properties={{ title: properties.title, size: properties.size, ...properties.label }}
|
||||
required={required}
|
||||
validation={validation}
|
||||
@ -61,7 +60,6 @@ const MultipleSelector = ({
|
||||
<Icon
|
||||
blockId={`${blockId}_suffixIcon`}
|
||||
events={events}
|
||||
methods={methods}
|
||||
properties={properties.suffixIcon}
|
||||
/>
|
||||
)
|
||||
@ -71,7 +69,6 @@ const MultipleSelector = ({
|
||||
<Icon
|
||||
blockId={`${blockId}_clearIcon`}
|
||||
events={events}
|
||||
methods={methods}
|
||||
properties={properties.clearIcon}
|
||||
/>
|
||||
)
|
||||
@ -81,7 +78,6 @@ const MultipleSelector = ({
|
||||
<Icon
|
||||
blockId={`${blockId}_selectedIcon`}
|
||||
events={events}
|
||||
methods={methods}
|
||||
properties={properties.selectedIcon}
|
||||
/>
|
||||
)
|
||||
|
@ -32,20 +32,18 @@ const NotificationBlock = ({ blockId, events, properties, methods }) => {
|
||||
blockId={`${blockId}_button`}
|
||||
events={events}
|
||||
properties={properties.button}
|
||||
methods={methods}
|
||||
onClick={() => methods.triggerEvent({ name: 'onClose' })}
|
||||
/>
|
||||
),
|
||||
className: methods.makeCssClass(properties.notificationStyle),
|
||||
description: args.description || properties.description,
|
||||
duration: type.isNone(args.duration) ? properties.duration : args.duration,
|
||||
icon: properties.icon && <Icon properties={properties.icon} methods={methods} />,
|
||||
icon: properties.icon && <Icon properties={properties.icon} />,
|
||||
closeIcon: properties.closeIcon && (
|
||||
<Icon
|
||||
blockId={`${blockId}_closeIcon`}
|
||||
events={events}
|
||||
properties={properties.closeIcon}
|
||||
methods={methods}
|
||||
/>
|
||||
),
|
||||
message: args.message || properties.message || blockId,
|
||||
|
@ -37,7 +37,6 @@ const NumberInput = ({
|
||||
validation={validation}
|
||||
required={required}
|
||||
loading={loading}
|
||||
methods={methods}
|
||||
content={{
|
||||
content: () => (
|
||||
<InputNumber
|
||||
|
@ -27,7 +27,6 @@ const PageHCF = ({ blockId, events, content, properties, methods }) => (
|
||||
<Layout
|
||||
blockId={blockId}
|
||||
events={events}
|
||||
methods={methods}
|
||||
properties={{ style: mergeObjects([{ minHeight: '100vh' }, properties.style]) }}
|
||||
content={{
|
||||
content: () => (
|
||||
@ -37,7 +36,6 @@ const PageHCF = ({ blockId, events, content, properties, methods }) => (
|
||||
blockId={`${blockId}_header`}
|
||||
events={events}
|
||||
properties={properties.header}
|
||||
methods={methods}
|
||||
content={{
|
||||
content: () => content.header(),
|
||||
}}
|
||||
@ -48,7 +46,6 @@ const PageHCF = ({ blockId, events, content, properties, methods }) => (
|
||||
blockId={`${blockId}_content`}
|
||||
events={events}
|
||||
properties={properties.content}
|
||||
methods={methods}
|
||||
content={{
|
||||
content: () => content.content(),
|
||||
}}
|
||||
@ -59,7 +56,6 @@ const PageHCF = ({ blockId, events, content, properties, methods }) => (
|
||||
blockId={`${blockId}_footer`}
|
||||
events={events}
|
||||
properties={properties.footer}
|
||||
methods={methods}
|
||||
content={{
|
||||
content: () => content.footer(),
|
||||
}}
|
||||
|
@ -28,7 +28,6 @@ const PageHCSF = ({ blockId, events, content, properties, methods }) => (
|
||||
<Layout
|
||||
blockId={blockId}
|
||||
events={events}
|
||||
methods={methods}
|
||||
properties={{ style: mergeObjects([{ minHeight: '100vh' }, properties.style]) }}
|
||||
content={{
|
||||
content: () => (
|
||||
@ -38,7 +37,6 @@ const PageHCSF = ({ blockId, events, content, properties, methods }) => (
|
||||
blockId={`${blockId}_header`}
|
||||
events={events}
|
||||
properties={properties.header}
|
||||
methods={methods}
|
||||
content={{
|
||||
content: () => content.header(),
|
||||
}}
|
||||
@ -47,7 +45,6 @@ const PageHCSF = ({ blockId, events, content, properties, methods }) => (
|
||||
<Layout
|
||||
blockId={`${blockId}_layout`}
|
||||
events={events}
|
||||
methods={methods}
|
||||
properties={properties.main}
|
||||
content={{
|
||||
content: () => (
|
||||
@ -57,7 +54,6 @@ const PageHCSF = ({ blockId, events, content, properties, methods }) => (
|
||||
blockId={`${blockId}_content`}
|
||||
events={events}
|
||||
properties={properties.content}
|
||||
methods={methods}
|
||||
content={{
|
||||
content: () => content.content(),
|
||||
}}
|
||||
@ -93,7 +89,6 @@ const PageHCSF = ({ blockId, events, content, properties, methods }) => (
|
||||
blockId={`${blockId}_footer`}
|
||||
events={events}
|
||||
properties={properties.footer}
|
||||
methods={methods}
|
||||
content={{
|
||||
content: () => content.footer(),
|
||||
}}
|
||||
|
@ -28,7 +28,6 @@ const PageHSCF = ({ blockId, events, content, properties, methods }) => (
|
||||
<Layout
|
||||
blockId={blockId}
|
||||
events={events}
|
||||
methods={methods}
|
||||
properties={{ style: mergeObjects([{ minHeight: '100vh' }, properties.style]) }}
|
||||
content={{
|
||||
content: () => (
|
||||
@ -38,7 +37,6 @@ const PageHSCF = ({ blockId, events, content, properties, methods }) => (
|
||||
blockId={`${blockId}_header`}
|
||||
events={events}
|
||||
properties={properties.header}
|
||||
methods={methods}
|
||||
content={{
|
||||
content: () => content.header(),
|
||||
}}
|
||||
@ -47,7 +45,6 @@ const PageHSCF = ({ blockId, events, content, properties, methods }) => (
|
||||
<Layout
|
||||
blockId={`${blockId}_layout`}
|
||||
events={events}
|
||||
methods={methods}
|
||||
properties={properties.main}
|
||||
content={{
|
||||
content: () => (
|
||||
@ -78,7 +75,6 @@ const PageHSCF = ({ blockId, events, content, properties, methods }) => (
|
||||
blockId={`${blockId}_content`}
|
||||
events={events}
|
||||
properties={properties.content}
|
||||
methods={methods}
|
||||
content={{
|
||||
content: () => content.content(),
|
||||
}}
|
||||
@ -93,7 +89,6 @@ const PageHSCF = ({ blockId, events, content, properties, methods }) => (
|
||||
blockId={`${blockId}_footer`}
|
||||
events={events}
|
||||
properties={properties.footer}
|
||||
methods={methods}
|
||||
content={{
|
||||
content: () => content.footer(),
|
||||
}}
|
||||
|
@ -100,7 +100,6 @@ const PageHeaderMenu = ({
|
||||
<Layout
|
||||
blockId={blockId}
|
||||
events={events}
|
||||
methods={methods}
|
||||
properties={{ style: mergeObjects([{ minHeight: '100vh' }, properties.style]) }}
|
||||
content={{
|
||||
content: () => (
|
||||
@ -108,7 +107,6 @@ const PageHeaderMenu = ({
|
||||
<Header
|
||||
blockId={`${blockId}_header`}
|
||||
events={events}
|
||||
methods={methods}
|
||||
properties={mergeObjects([
|
||||
{
|
||||
style: styles.header,
|
||||
@ -178,7 +176,6 @@ const PageHeaderMenu = ({
|
||||
<Content
|
||||
blockId={`${blockId}_content`}
|
||||
events={events}
|
||||
methods={methods}
|
||||
properties={mergeObjects([properties.content, { style: styles.body }])}
|
||||
content={{
|
||||
content: () => (
|
||||
@ -192,6 +189,11 @@ const PageHeaderMenu = ({
|
||||
properties.breadcrumb,
|
||||
{ style: { padding: '16px 0' } },
|
||||
])}
|
||||
rename={{
|
||||
events: {
|
||||
onClick: 'onBreadcrumbClick',
|
||||
},
|
||||
}}
|
||||
/>
|
||||
) : (
|
||||
<div className={methods.makeCssClass(styles.noBreadcrumb)} />
|
||||
@ -205,7 +207,6 @@ const PageHeaderMenu = ({
|
||||
<Footer
|
||||
blockId={`${blockId}_footer`}
|
||||
events={events}
|
||||
methods={methods}
|
||||
properties={properties.footer}
|
||||
content={{
|
||||
content: () => content.footer(),
|
||||
|
@ -225,6 +225,10 @@
|
||||
"onToggleMenuGroup": {
|
||||
"type": "array",
|
||||
"description": "Trigger action when mobile menu group is opened."
|
||||
},
|
||||
"onBreadcrumbClick": {
|
||||
"type": "array",
|
||||
"description": "Trigger action when a breadcrumb item is clicked."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -28,7 +28,6 @@ const PageSHCF = ({ blockId, events, content, properties, methods }) => (
|
||||
<Layout
|
||||
blockId={blockId}
|
||||
events={events}
|
||||
methods={methods}
|
||||
properties={{ style: mergeObjects([{ minHeight: '100vh' }, properties.style]) }}
|
||||
content={{
|
||||
content: () => (
|
||||
@ -57,7 +56,6 @@ const PageSHCF = ({ blockId, events, content, properties, methods }) => (
|
||||
<Layout
|
||||
blockId={`${blockId}_layout`}
|
||||
events={events}
|
||||
methods={methods}
|
||||
properties={properties.main}
|
||||
content={{
|
||||
content: () => (
|
||||
@ -67,7 +65,6 @@ const PageSHCF = ({ blockId, events, content, properties, methods }) => (
|
||||
blockId={`${blockId}_header`}
|
||||
events={events}
|
||||
properties={properties.header}
|
||||
methods={methods}
|
||||
content={{
|
||||
content: () => content.header(),
|
||||
}}
|
||||
@ -78,7 +75,6 @@ const PageSHCF = ({ blockId, events, content, properties, methods }) => (
|
||||
blockId={`${blockId}_content`}
|
||||
events={events}
|
||||
properties={properties.content}
|
||||
methods={methods}
|
||||
content={{
|
||||
content: () => content.content(),
|
||||
}}
|
||||
@ -89,7 +85,6 @@ const PageSHCF = ({ blockId, events, content, properties, methods }) => (
|
||||
blockId={`${blockId}_footer`}
|
||||
events={events}
|
||||
properties={properties.footer}
|
||||
methods={methods}
|
||||
content={{
|
||||
content: () => content.footer(),
|
||||
}}
|
||||
|
@ -114,14 +114,12 @@ const PageSiderMenu = ({
|
||||
blockId={blockId}
|
||||
events={events}
|
||||
properties={{ style: mergeObjects([{ minHeight: '100vh' }, properties.style]) }}
|
||||
methods={methods}
|
||||
content={{
|
||||
content: () => (
|
||||
<>
|
||||
<Header
|
||||
blockId={`${blockId}_header`}
|
||||
events={events}
|
||||
methods={methods}
|
||||
properties={mergeObjects([{ style: styles.header }, properties.header])}
|
||||
content={{
|
||||
content: () => (
|
||||
@ -186,7 +184,6 @@ const PageSiderMenu = ({
|
||||
blockId={`${blockId}_layout`}
|
||||
events={events}
|
||||
properties={properties.layout}
|
||||
methods={methods}
|
||||
content={{
|
||||
content: () => (
|
||||
<>
|
||||
@ -298,7 +295,6 @@ const PageSiderMenu = ({
|
||||
<Content
|
||||
blockId={`${blockId}_content`}
|
||||
events={events}
|
||||
methods={methods}
|
||||
properties={mergeObjects([{ style: styles.body }, properties.content])}
|
||||
content={{
|
||||
content: () => (
|
||||
@ -312,6 +308,11 @@ const PageSiderMenu = ({
|
||||
{ style: { padding: '16px 0' } },
|
||||
properties.breadcrumb,
|
||||
])}
|
||||
rename={{
|
||||
events: {
|
||||
onClick: 'onBreadcrumbClick',
|
||||
},
|
||||
}}
|
||||
/>
|
||||
) : (
|
||||
<div className={methods.makeCssClass(styles.noBreadcrumb)} />
|
||||
@ -321,7 +322,6 @@ const PageSiderMenu = ({
|
||||
<Footer
|
||||
blockId={`${blockId}_footer`}
|
||||
events={events}
|
||||
methods={methods}
|
||||
properties={properties.footer}
|
||||
content={{
|
||||
content: () => content.footer(),
|
||||
|
@ -306,6 +306,14 @@
|
||||
"onToggleMenuGroup": {
|
||||
"type": "array",
|
||||
"description": "Trigger action when mobile menu group is opened."
|
||||
},
|
||||
"onBreadcrumbClick": {
|
||||
"type": "array",
|
||||
"description": "Trigger action when a breadcrumb item is clicked."
|
||||
},
|
||||
"onChangeToggleSiderAffix": {
|
||||
"type": "array",
|
||||
"description": "Trigger action when sider collapse button affix triggers a onChange event."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -46,14 +46,12 @@ const ParagraphBlock = ({ blockId, events, properties, methods }) => (
|
||||
key="copy-icon"
|
||||
events={events}
|
||||
blockId={`${blockId}_copyable_before_icon`}
|
||||
methods={methods}
|
||||
properties={properties.copyable.icon[0]}
|
||||
/>,
|
||||
<Icon
|
||||
key="copied-icon"
|
||||
blockId={`${blockId}_copyable_after_icon`}
|
||||
events={events}
|
||||
methods={methods}
|
||||
properties={properties.copyable.icon[1]}
|
||||
/>,
|
||||
]
|
||||
@ -61,7 +59,6 @@ const ParagraphBlock = ({ blockId, events, properties, methods }) => (
|
||||
<Icon
|
||||
blockId={`${blockId}_copyable_icon`}
|
||||
events={events}
|
||||
methods={methods}
|
||||
properties={properties.copyable.icon}
|
||||
/>
|
||||
)),
|
||||
|
@ -61,14 +61,12 @@ const ParagraphInput = ({ blockId, events, properties, methods, value }) => {
|
||||
key="copy-icon"
|
||||
blockId={`${blockId}_copyable_before_icon`}
|
||||
events={events}
|
||||
methods={methods}
|
||||
properties={properties.copyable.icon[0]}
|
||||
/>,
|
||||
<Icon
|
||||
key="copied-icon"
|
||||
blockId={`${blockId}_copyable_after_icon`}
|
||||
events={events}
|
||||
methods={methods}
|
||||
properties={properties.copyable.icon[1]}
|
||||
/>,
|
||||
]
|
||||
@ -76,7 +74,6 @@ const ParagraphInput = ({ blockId, events, properties, methods, value }) => {
|
||||
<Icon
|
||||
blockId={`${blockId}_copyable_icon`}
|
||||
events={events}
|
||||
methods={methods}
|
||||
properties={properties.copyable.icon}
|
||||
/>
|
||||
)),
|
||||
@ -114,7 +111,6 @@ const ParagraphInput = ({ blockId, events, properties, methods, value }) => {
|
||||
<Icon
|
||||
blockId={`${blockId}_editable_icon`}
|
||||
events={events}
|
||||
methods={methods}
|
||||
properties={properties.editable.icon}
|
||||
/>
|
||||
),
|
||||
|
@ -44,7 +44,6 @@ const RadioSelector = ({
|
||||
validation={validation}
|
||||
required={required}
|
||||
loading={loading}
|
||||
methods={methods}
|
||||
content={{
|
||||
content: () => (
|
||||
<RadioGroup
|
||||
|
@ -102,7 +102,6 @@ const RatingSlider = ({
|
||||
blockId={blockId}
|
||||
events={events}
|
||||
loading={loading}
|
||||
methods={methods}
|
||||
properties={{ title: properties.title, size: properties.size, ...properties.label }}
|
||||
required={required}
|
||||
validation={validation}
|
||||
@ -146,7 +145,6 @@ const RatingSlider = ({
|
||||
<Icon
|
||||
blockId={`${blockId}_iconMin`}
|
||||
events={events}
|
||||
methods={methods}
|
||||
properties={mergeObjects([
|
||||
{
|
||||
name: 'FrownOutlined',
|
||||
@ -213,7 +211,6 @@ const RatingSlider = ({
|
||||
<Icon
|
||||
blockId={`${blockId}_iconMax`}
|
||||
events={events}
|
||||
methods={methods}
|
||||
properties={mergeObjects([
|
||||
{
|
||||
name: 'SmileOutlined',
|
||||
|
@ -28,12 +28,7 @@ const ResultBlock = ({ blockId, events, content, methods, properties }) => (
|
||||
status={properties.status}
|
||||
icon={
|
||||
properties.icon && (
|
||||
<Icon
|
||||
blockId={`${blockId}_icon`}
|
||||
events={events}
|
||||
methods={methods}
|
||||
properties={properties.icon}
|
||||
/>
|
||||
<Icon blockId={`${blockId}_icon`} events={events} properties={properties.icon} />
|
||||
)
|
||||
}
|
||||
extra={content.extra && content.extra({ justifyContent: 'center' })}
|
||||
|
@ -44,7 +44,6 @@ const Selector = ({
|
||||
validation={validation}
|
||||
required={required}
|
||||
loading={loading}
|
||||
methods={methods}
|
||||
content={{
|
||||
content: () => (
|
||||
<div className={methods.makeCssClass({ width: '100%' })}>
|
||||
@ -62,7 +61,6 @@ const Selector = ({
|
||||
<Icon
|
||||
blockId={`${blockId}_suffixIcon`}
|
||||
events={events}
|
||||
methods={methods}
|
||||
properties={properties.suffixIcon}
|
||||
/>
|
||||
)
|
||||
@ -72,7 +70,6 @@ const Selector = ({
|
||||
<Icon
|
||||
blockId={`${blockId}_clearIcon`}
|
||||
events={events}
|
||||
methods={methods}
|
||||
properties={properties.clearIcon}
|
||||
/>
|
||||
)
|
||||
|
@ -36,7 +36,6 @@ const StatisticBlock = ({ blockId, events, properties, methods }) => (
|
||||
<Icon
|
||||
blockId={`${blockId}_prefixIcon`}
|
||||
events={events}
|
||||
methods={methods}
|
||||
properties={properties.prefixIcon}
|
||||
/>
|
||||
) : (
|
||||
@ -48,7 +47,6 @@ const StatisticBlock = ({ blockId, events, properties, methods }) => (
|
||||
<Icon
|
||||
blockId={`${blockId}_suffixIcon`}
|
||||
events={events}
|
||||
methods={methods}
|
||||
properties={properties.suffixIcon}
|
||||
/>
|
||||
) : (
|
||||
|
@ -45,7 +45,6 @@ const SwitchBlock = ({
|
||||
blockId={blockId}
|
||||
events={events}
|
||||
loading={loading}
|
||||
methods={methods}
|
||||
properties={{ title: properties.title, size: properties.size, ...properties.label }}
|
||||
required={required}
|
||||
validation={validation}
|
||||
@ -71,7 +70,6 @@ const SwitchBlock = ({
|
||||
<Icon
|
||||
blockId={`${blockId}_checkedIcon`}
|
||||
events={events}
|
||||
methods={methods}
|
||||
properties={{
|
||||
name: 'CheckOutlined',
|
||||
...(propertiesIconChecked || {}),
|
||||
@ -86,7 +84,6 @@ const SwitchBlock = ({
|
||||
<Icon
|
||||
blockId={`${blockId}_uncheckedIcon`}
|
||||
events={events}
|
||||
methods={methods}
|
||||
properties={{
|
||||
name: 'CloseOutlined',
|
||||
...(propertiesIconUnchecked || {}),
|
||||
|
@ -69,12 +69,7 @@ const TabsBlock = ({ blockId, events, content, methods, properties }) => {
|
||||
tab={
|
||||
<span className={methods.makeCssClass(tab.titleStyle)}>
|
||||
{tab.icon && (
|
||||
<Icon
|
||||
blockId={`${blockId}_icon`}
|
||||
events={events}
|
||||
methods={methods}
|
||||
properties={tab.icon}
|
||||
/>
|
||||
<Icon blockId={`${blockId}_icon`} events={events} properties={tab.icon} />
|
||||
)}
|
||||
{tab.title || tab.key}
|
||||
</span>
|
||||
|
@ -41,7 +41,6 @@ const TextAreaBlock = ({
|
||||
validation={validation}
|
||||
required={required}
|
||||
loading={loading}
|
||||
methods={methods}
|
||||
content={{
|
||||
content: () => {
|
||||
const runAfterUpdate = useRunAfterUpdate();
|
||||
|
@ -37,7 +37,6 @@ const TextInput = ({
|
||||
blockId={blockId}
|
||||
events={events}
|
||||
loading={loading}
|
||||
methods={methods}
|
||||
properties={{ title: properties.title, size: properties.size, ...properties.label }}
|
||||
required={required}
|
||||
validation={validation}
|
||||
@ -70,7 +69,6 @@ const TextInput = ({
|
||||
<Icon
|
||||
blockId={`${blockId}_prefixIcon`}
|
||||
events={events}
|
||||
methods={methods}
|
||||
properties={properties.prefixIcon}
|
||||
/>
|
||||
))
|
||||
@ -81,7 +79,6 @@ const TextInput = ({
|
||||
<Icon
|
||||
blockId={`${blockId}_suffixIcon`}
|
||||
events={events}
|
||||
methods={methods}
|
||||
properties={properties.suffixIcon}
|
||||
/>
|
||||
))
|
||||
|
@ -37,7 +37,6 @@ const TimelineList = ({ blockId, events, list, methods, properties, value }) =>
|
||||
<Icon
|
||||
blockId={`${blockId}_pendingDotIcon`}
|
||||
events={events}
|
||||
methods={methods}
|
||||
properties={mergeObjects([{ style: { fontSize: 16 } }, properties.pendingDotIcon])}
|
||||
/>
|
||||
)
|
||||
@ -66,7 +65,6 @@ const TimelineList = ({ blockId, events, list, methods, properties, value }) =>
|
||||
<Icon
|
||||
blockId={`${blockId}_${i}_icon`}
|
||||
events={events}
|
||||
methods={methods}
|
||||
properties={mergeObjects([{ style, color }, icon])}
|
||||
/>
|
||||
)
|
||||
|
@ -50,14 +50,12 @@ const TitleBlock = ({ blockId, events, properties, methods }) => {
|
||||
key="copy-icon"
|
||||
blockId={`${blockId}_copyable_before_icon`}
|
||||
events={events}
|
||||
methods={methods}
|
||||
properties={properties.copyable.icon[0]}
|
||||
/>,
|
||||
<Icon
|
||||
key="copied-icon"
|
||||
blockId={`${blockId}_copyable_after_icon`}
|
||||
events={events}
|
||||
methods={methods}
|
||||
properties={properties.copyable.icon[1]}
|
||||
/>,
|
||||
]
|
||||
@ -65,7 +63,6 @@ const TitleBlock = ({ blockId, events, properties, methods }) => {
|
||||
<Icon
|
||||
blockId={`${blockId}_copyable_icon`}
|
||||
events={events}
|
||||
methods={methods}
|
||||
properties={properties.copyable.icon}
|
||||
/>
|
||||
)),
|
||||
|
@ -64,14 +64,12 @@ const TitleInput = ({ blockId, events, properties, methods, value }) => {
|
||||
key="copy-icon"
|
||||
events={events}
|
||||
blockId={`${blockId}_copyable_before_icon`}
|
||||
methods={methods}
|
||||
properties={properties.copyable.icon[0]}
|
||||
/>,
|
||||
<Icon
|
||||
key="copied-icon"
|
||||
events={events}
|
||||
blockId={`${blockId}_copyable_after_icon`}
|
||||
methods={methods}
|
||||
properties={properties.copyable.icon[1]}
|
||||
/>,
|
||||
]
|
||||
@ -79,7 +77,6 @@ const TitleInput = ({ blockId, events, properties, methods, value }) => {
|
||||
<Icon
|
||||
blockId={`${blockId}_copyable_icon`}
|
||||
events={events}
|
||||
methods={methods}
|
||||
properties={properties.copyable.icon}
|
||||
/>
|
||||
)),
|
||||
@ -111,7 +108,6 @@ const TitleInput = ({ blockId, events, properties, methods, value }) => {
|
||||
<Icon
|
||||
blockId={`${blockId}_editable_icon`}
|
||||
events={events}
|
||||
methods={methods}
|
||||
properties={properties.editable.icon}
|
||||
/>
|
||||
),
|
||||
|
@ -44,7 +44,6 @@ const WeekSelector = ({
|
||||
validation={validation}
|
||||
required={required}
|
||||
loading={loading}
|
||||
methods={methods}
|
||||
content={{
|
||||
content: () => (
|
||||
<div className={methods.makeCssClass({ width: '100%' })}>
|
||||
@ -64,7 +63,6 @@ const WeekSelector = ({
|
||||
<Icon
|
||||
blockId={`${blockId}_suffixIcon`}
|
||||
events={events}
|
||||
methods={methods}
|
||||
properties={properties.suffixIcon || 'CalendarOutlined'}
|
||||
/>
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user