@yimoka/designable-playground 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -2
- package/dist/demo/components/Alert/index.d.ts +4 -0
- package/dist/demo/components/Alert/index.js +41 -0
- package/dist/demo/components/ArrayCards/index.d.ts +17 -0
- package/dist/demo/components/ArrayCards/index.js +62 -0
- package/dist/demo/components/ArrayList/index.d.ts +25 -0
- package/dist/demo/components/ArrayList/index.js +143 -0
- package/dist/demo/components/ArrayTable/index.d.ts +39 -0
- package/dist/demo/components/ArrayTable/index.js +247 -0
- package/dist/demo/components/AutoComplete/index.d.ts +4 -0
- package/dist/demo/components/AutoComplete/index.js +52 -0
- package/dist/demo/components/Avatar/index.d.ts +4 -0
- package/dist/demo/components/Avatar/index.js +34 -0
- package/dist/demo/components/Badge/index.d.ts +4 -0
- package/dist/demo/components/Badge/index.js +35 -0
- package/dist/demo/components/Button/index.d.ts +4 -0
- package/dist/demo/components/Button/index.js +86 -0
- package/dist/demo/components/Card/index.d.ts +4 -0
- package/dist/demo/components/Card/index.js +72 -0
- package/dist/demo/components/Carousel/index.d.ts +4 -0
- package/dist/demo/components/Carousel/index.js +33 -0
- package/dist/demo/components/Cascader/index.d.ts +4 -0
- package/dist/demo/components/Cascader/index.js +60 -0
- package/dist/demo/components/Checkbox/index.d.ts +8 -0
- package/dist/demo/components/Checkbox/index.js +55 -0
- package/dist/demo/components/ColorPicker/index.d.ts +4 -0
- package/dist/demo/components/ColorPicker/index.js +38 -0
- package/dist/demo/components/DatePicker/index.d.ts +4 -0
- package/dist/demo/components/DatePicker/index.js +61 -0
- package/dist/demo/components/DateRangePicker/index.d.ts +4 -0
- package/dist/demo/components/DateRangePicker/index.js +58 -0
- package/dist/demo/components/Divider/index.d.ts +4 -0
- package/dist/demo/components/Divider/index.js +39 -0
- package/dist/demo/components/Empty/index.d.ts +4 -0
- package/dist/demo/components/Empty/index.js +29 -0
- package/dist/demo/components/Flex/index.d.ts +4 -0
- package/dist/demo/components/Flex/index.js +51 -0
- package/dist/demo/components/Form/index.d.ts +21 -0
- package/dist/demo/components/Form/index.js +116 -0
- package/dist/demo/components/FormCollapse/index.d.ts +28 -0
- package/dist/demo/components/FormCollapse/index.js +164 -0
- package/dist/demo/components/FormGrid/index.d.ts +22 -0
- package/dist/demo/components/FormGrid/index.js +134 -0
- package/dist/demo/components/FormItem/index.d.ts +14 -0
- package/dist/demo/components/FormItem/index.js +33 -0
- package/dist/demo/components/FormLayout/index.d.ts +26 -0
- package/dist/demo/components/FormLayout/index.js +260 -0
- package/dist/demo/components/FormTab/index.d.ts +15 -0
- package/dist/demo/components/FormTab/index.js +186 -0
- package/dist/demo/components/GridCol/index.d.ts +4 -0
- package/dist/demo/components/GridCol/index.js +53 -0
- package/dist/demo/components/GridRow/index.d.ts +4 -0
- package/dist/demo/components/GridRow/index.js +70 -0
- package/dist/demo/components/HTMLContent/index.d.ts +4 -0
- package/dist/demo/components/HTMLContent/index.js +34 -0
- package/dist/demo/components/I18nEditor/index.d.ts +8 -0
- package/dist/demo/components/I18nEditor/index.js +64 -0
- package/dist/demo/components/Image/index.d.ts +4 -0
- package/dist/demo/components/Image/index.js +36 -0
- package/dist/demo/components/Input/index.d.ts +4 -0
- package/dist/demo/components/Input/index.js +36 -0
- package/dist/demo/components/InputSearch/index.d.ts +4 -0
- package/dist/demo/components/InputSearch/index.js +40 -0
- package/dist/demo/components/Link/index.d.ts +4 -0
- package/dist/demo/components/Link/index.js +37 -0
- package/dist/demo/components/Mentions/index.d.ts +4 -0
- package/dist/demo/components/Mentions/index.js +41 -0
- package/dist/demo/components/NumberPicker/index.d.ts +6 -0
- package/dist/demo/components/NumberPicker/index.js +63 -0
- package/dist/demo/components/ObjectContainer/index.d.ts +14 -0
- package/dist/demo/components/ObjectContainer/index.js +46 -0
- package/dist/demo/components/Password/index.d.ts +6 -0
- package/dist/demo/components/Password/index.js +44 -0
- package/dist/demo/components/QRCode/index.d.ts +4 -0
- package/dist/demo/components/QRCode/index.js +34 -0
- package/dist/demo/components/Radio/index.d.ts +6 -0
- package/dist/demo/components/Radio/index.js +49 -0
- package/dist/demo/components/Rate/index.d.ts +6 -0
- package/dist/demo/components/Rate/index.js +43 -0
- package/dist/demo/components/Search/index.d.ts +4 -0
- package/dist/demo/components/Search/index.js +42 -0
- package/dist/demo/components/SearchSelect/index.d.ts +4 -0
- package/dist/demo/components/SearchSelect/index.js +53 -0
- package/dist/demo/components/Select/index.d.ts +4 -0
- package/dist/demo/components/Select/index.js +59 -0
- package/dist/demo/components/Slider/index.d.ts +6 -0
- package/dist/demo/components/Slider/index.js +61 -0
- package/dist/demo/components/Space/index.d.ts +9 -0
- package/dist/demo/components/Space/index.js +61 -0
- package/dist/demo/components/Statistic/index.d.ts +4 -0
- package/dist/demo/components/Statistic/index.js +33 -0
- package/dist/demo/components/Switch/index.d.ts +4 -0
- package/dist/demo/components/Switch/index.js +49 -0
- package/dist/demo/components/Tabs/index.d.ts +10 -0
- package/dist/demo/components/Tabs/index.js +181 -0
- package/dist/demo/components/Tag/index.d.ts +4 -0
- package/dist/demo/components/Tag/index.js +33 -0
- package/dist/demo/components/Text/index.d.ts +11 -0
- package/dist/demo/components/Text/index.js +64 -0
- package/dist/demo/components/TextArea/index.d.ts +6 -0
- package/dist/demo/components/TextArea/index.js +43 -0
- package/dist/demo/components/TimePicker/index.d.ts +4 -0
- package/dist/demo/components/TimePicker/index.js +69 -0
- package/dist/demo/components/TimeRangePicker/index.d.ts +4 -0
- package/dist/demo/components/TimeRangePicker/index.js +68 -0
- package/dist/demo/components/Transfer/index.d.ts +6 -0
- package/dist/demo/components/Transfer/index.js +59 -0
- package/dist/demo/components/TreeSelect/index.d.ts +4 -0
- package/dist/demo/components/TreeSelect/index.js +63 -0
- package/dist/demo/components/Upload/index.d.ts +8 -0
- package/dist/demo/components/Upload/index.js +64 -0
- package/dist/demo/components/index.d.ts +55 -0
- package/dist/demo/components/index.js +55 -0
- package/dist/demo/components/shared.d.ts +143 -0
- package/dist/demo/components/shared.js +315 -0
- package/dist/src/Playground.d.ts +3 -0
- package/dist/src/Playground.js +304 -0
- package/dist/src/antd/AntdPlayground.d.ts +16 -0
- package/dist/src/antd/AntdPlayground.js +136 -0
- package/dist/src/antd/index.d.ts +1 -0
- package/dist/src/antd/index.js +1 -0
- package/dist/src/context.d.ts +4 -0
- package/dist/src/context.js +13 -0
- package/dist/src/examples/index.d.ts +267 -0
- package/dist/src/examples/index.js +824 -0
- package/dist/src/hooks/index.d.ts +4 -0
- package/dist/src/hooks/index.js +4 -0
- package/dist/src/hooks/remoteSchemaAdapter.d.ts +53 -0
- package/dist/src/hooks/remoteSchemaAdapter.js +262 -0
- package/dist/src/hooks/usePlayground.d.ts +38 -0
- package/dist/src/hooks/usePlayground.js +642 -0
- package/dist/src/hooks/usePlaygroundRemotePersistence.d.ts +135 -0
- package/dist/src/hooks/usePlaygroundRemotePersistence.js +736 -0
- package/dist/src/hooks/useSchemaEditorDraft.d.ts +4 -0
- package/dist/src/hooks/useSchemaEditorDraft.js +44 -0
- package/dist/src/index.d.ts +14 -0
- package/dist/src/index.js +14 -0
- package/dist/src/layouts/PlaygroundLayout/ErrorBoundaries.d.ts +59 -0
- package/dist/src/layouts/PlaygroundLayout/ErrorBoundaries.js +161 -0
- package/dist/src/layouts/PlaygroundLayout/index.d.ts +7 -0
- package/dist/src/layouts/PlaygroundLayout/index.js +443 -0
- package/dist/src/layouts/index.d.ts +1 -0
- package/dist/src/layouts/index.js +1 -0
- package/dist/src/panels/CompositePanel/index.d.ts +6 -0
- package/dist/src/panels/CompositePanel/index.js +139 -0
- package/dist/src/panels/ToolbarPanel/index.d.ts +3 -0
- package/dist/src/panels/ToolbarPanel/index.js +24 -0
- package/dist/src/panels/index.d.ts +2 -0
- package/dist/src/panels/index.js +2 -0
- package/dist/src/presets/antd.d.ts +19 -0
- package/dist/src/presets/antd.js +112 -0
- package/dist/src/presets/index.d.ts +4 -0
- package/dist/src/presets/index.js +3 -0
- package/dist/src/presets/runtime-array-helpers.d.ts +8 -0
- package/dist/src/presets/runtime-array-helpers.js +147 -0
- package/dist/src/presets/runtime-component-props.d.ts +3 -0
- package/dist/src/presets/runtime-component-props.js +5 -0
- package/dist/src/presets/runtime-components.d.ts +5 -0
- package/dist/src/presets/runtime-components.js +419 -0
- package/dist/src/presets/runtime-form-components.d.ts +9 -0
- package/dist/src/presets/runtime-form-components.js +94 -0
- package/dist/src/presets/scenario-catalog.d.ts +6 -0
- package/dist/src/presets/scenario-catalog.js +128 -0
- package/dist/src/presets/scenarios.d.ts +52 -0
- package/dist/src/presets/scenarios.js +603 -0
- package/dist/src/runtime/actions.d.ts +19 -0
- package/dist/src/runtime/actions.js +307 -0
- package/dist/src/runtime/contracts.d.ts +149 -0
- package/dist/src/runtime/contracts.js +1 -0
- package/dist/src/runtime/document-bindings.d.ts +3 -0
- package/dist/src/runtime/document-bindings.js +101 -0
- package/dist/src/runtime/document-core.d.ts +57 -0
- package/dist/src/runtime/document-core.js +379 -0
- package/dist/src/runtime/document-entity.d.ts +12 -0
- package/dist/src/runtime/document-entity.js +351 -0
- package/dist/src/runtime/document-expressions.d.ts +35 -0
- package/dist/src/runtime/document-expressions.js +346 -0
- package/dist/src/runtime/document-security.d.ts +34 -0
- package/dist/src/runtime/document-security.js +538 -0
- package/dist/src/runtime/document.d.ts +16 -0
- package/dist/src/runtime/document.js +212 -0
- package/dist/src/runtime/environment.d.ts +16 -0
- package/dist/src/runtime/environment.js +76 -0
- package/dist/src/runtime/i18n-schema.d.ts +36 -0
- package/dist/src/runtime/i18n-schema.js +338 -0
- package/dist/src/runtime/i18n.d.ts +25 -0
- package/dist/src/runtime/i18n.js +447 -0
- package/dist/src/runtime/index.d.ts +8 -0
- package/dist/src/runtime/index.js +8 -0
- package/dist/src/runtime/navigation.d.ts +5 -0
- package/dist/src/runtime/navigation.js +43 -0
- package/dist/src/runtime/playground.d.ts +30 -0
- package/dist/src/runtime/playground.js +243 -0
- package/dist/src/runtime/preview-boundaries.d.ts +13 -0
- package/dist/src/runtime/preview-boundaries.js +43 -0
- package/dist/src/runtime/preview.d.ts +44 -0
- package/dist/src/runtime/preview.js +574 -0
- package/dist/src/runtime/settings/RuntimeJsonEditor.d.ts +10 -0
- package/dist/src/runtime/settings/RuntimeJsonEditor.js +21 -0
- package/dist/src/runtime/settings/RuntimeStoreEntitySettings.d.ts +15 -0
- package/dist/src/runtime/settings/RuntimeStoreEntitySettings.js +65 -0
- package/dist/src/runtime/templates.d.ts +1560 -0
- package/dist/src/runtime/templates.js +508 -0
- package/dist/src/runtime/website-contact-template.d.ts +1 -0
- package/dist/src/runtime/website-contact-template.js +66 -0
- package/dist/src/runtime/website-template-shared.d.ts +14 -0
- package/dist/src/runtime/website-template-shared.js +210 -0
- package/dist/src/runtime/website-templates.d.ts +5 -0
- package/dist/src/runtime/website-templates.js +976 -0
- package/dist/src/shared/clipboard.d.ts +4 -0
- package/dist/src/shared/clipboard.js +56 -0
- package/dist/src/shared/componentRegistry.d.ts +133 -0
- package/dist/src/shared/componentRegistry.js +381 -0
- package/dist/src/shared/formilyCompatibility.d.ts +8 -0
- package/dist/src/shared/formilyCompatibility.js +40 -0
- package/dist/src/shared/index.d.ts +6 -0
- package/dist/src/shared/index.js +6 -0
- package/dist/src/shared/productionAcceptance.d.ts +63 -0
- package/dist/src/shared/productionAcceptance.js +201 -0
- package/dist/src/shared/schema-options.d.ts +16 -0
- package/dist/src/shared/schema-options.js +138 -0
- package/dist/src/shared/schema.d.ts +63 -0
- package/dist/src/shared/schema.js +627 -0
- package/dist/src/shared/styleSecurity.d.ts +2 -0
- package/dist/src/shared/styleSecurity.js +35 -0
- package/dist/src/transformers/formily.d.ts +34 -0
- package/dist/src/transformers/formily.js +943 -0
- package/dist/src/transformers/index.d.ts +1 -0
- package/dist/src/transformers/index.js +1 -0
- package/dist/src/types.d.ts +186 -0
- package/dist/src/types.js +1 -0
- package/dist/src/widgets/ActionsWidget/index.d.ts +3 -0
- package/dist/src/widgets/ActionsWidget/index.js +10 -0
- package/dist/src/widgets/ComponentTreeWidget/index.d.ts +3 -0
- package/dist/src/widgets/ComponentTreeWidget/index.js +333 -0
- package/dist/src/widgets/NodeActionsWidget/index.d.ts +2 -0
- package/dist/src/widgets/NodeActionsWidget/index.js +125 -0
- package/dist/src/widgets/OutlineTreeWidget/index.d.ts +3 -0
- package/dist/src/widgets/OutlineTreeWidget/index.js +432 -0
- package/dist/src/widgets/OutlineTreeWidget/shared.d.ts +32 -0
- package/dist/src/widgets/OutlineTreeWidget/shared.js +79 -0
- package/dist/src/widgets/PreviewWidget/index.d.ts +2 -0
- package/dist/src/widgets/PreviewWidget/index.js +1566 -0
- package/dist/src/widgets/ProductionReadinessWidget/index.d.ts +18 -0
- package/dist/src/widgets/ProductionReadinessWidget/index.js +356 -0
- package/dist/src/widgets/RemotePersistenceStatusWidget/index.d.ts +18 -0
- package/dist/src/widgets/RemotePersistenceStatusWidget/index.js +438 -0
- package/dist/src/widgets/RemoteVersionHistoryWidget/index.d.ts +39 -0
- package/dist/src/widgets/RemoteVersionHistoryWidget/index.js +475 -0
- package/dist/src/widgets/ResourceWidget/index.d.ts +3 -0
- package/dist/src/widgets/ResourceWidget/index.js +491 -0
- package/dist/src/widgets/SchemaCodeView/index.d.ts +7 -0
- package/dist/src/widgets/SchemaCodeView/index.js +225 -0
- package/dist/src/widgets/SchemaEditorWidget/index.d.ts +10 -0
- package/dist/src/widgets/SchemaEditorWidget/index.js +484 -0
- package/dist/src/widgets/SettingsPanelWidget/index.d.ts +3 -0
- package/dist/src/widgets/SettingsPanelWidget/index.js +190 -0
- package/dist/src/widgets/StorageActionsWidget/index.d.ts +2 -0
- package/dist/src/widgets/StorageActionsWidget/index.js +284 -0
- package/dist/src/widgets/index.d.ts +13 -0
- package/dist/src/widgets/index.js +13 -0
- package/package.json +100 -4
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Avatar as AntdAvatar } from '@yimoka/antd';
|
|
3
|
+
import { createBehavior, createResource } from '@yimoka/designable-core';
|
|
4
|
+
import { createContainerPropsSchema, createInputProperty, createSelectProperty, sizeProperty, splitDesignableStyleProps, } from "../shared.js";
|
|
5
|
+
export const Avatar = (props) => {
|
|
6
|
+
const { componentProps: avatarProps, designerProps, wrapperStyle, } = splitDesignableStyleProps(props);
|
|
7
|
+
return (_jsx("div", { ...designerProps, style: { display: 'inline-flex', ...wrapperStyle }, children: _jsx(AntdAvatar, { ...avatarProps }) }));
|
|
8
|
+
};
|
|
9
|
+
Avatar.Behavior = createBehavior({
|
|
10
|
+
name: 'Avatar',
|
|
11
|
+
selector: node => node.componentName === 'Avatar',
|
|
12
|
+
designerProps: {
|
|
13
|
+
propsSchema: createContainerPropsSchema({
|
|
14
|
+
value: createInputProperty('图片地址'),
|
|
15
|
+
src: createInputProperty('头像地址'),
|
|
16
|
+
children: createInputProperty('文本'),
|
|
17
|
+
alt: createInputProperty('替代文本'),
|
|
18
|
+
shape: createSelectProperty('形状', ['circle', 'square']),
|
|
19
|
+
size: sizeProperty,
|
|
20
|
+
}),
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
Avatar.Resource = createResource({
|
|
24
|
+
icon: '',
|
|
25
|
+
elements: [
|
|
26
|
+
{
|
|
27
|
+
componentName: 'Avatar',
|
|
28
|
+
props: {
|
|
29
|
+
children: 'U',
|
|
30
|
+
shape: 'circle',
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Badge as AntdBadge } from '@yimoka/antd';
|
|
3
|
+
import { createBehavior, createResource } from '@yimoka/designable-core';
|
|
4
|
+
import { createContainerPropsSchema, createInputProperty, createNumberProperty, createSelectProperty, createSwitchProperty, splitDesignableStyleProps, } from "../shared.js";
|
|
5
|
+
export const Badge = (props) => {
|
|
6
|
+
const { componentProps: badgeProps, designerProps, wrapperStyle, } = splitDesignableStyleProps(props);
|
|
7
|
+
return (_jsx("div", { ...designerProps, style: { display: 'inline-flex', ...wrapperStyle }, children: _jsx(AntdBadge, { ...badgeProps }) }));
|
|
8
|
+
};
|
|
9
|
+
Badge.Behavior = createBehavior({
|
|
10
|
+
name: 'Badge',
|
|
11
|
+
selector: node => node.componentName === 'Badge',
|
|
12
|
+
designerProps: {
|
|
13
|
+
propsSchema: createContainerPropsSchema({
|
|
14
|
+
text: createInputProperty('文本'),
|
|
15
|
+
count: createNumberProperty('数量'),
|
|
16
|
+
color: createInputProperty('颜色'),
|
|
17
|
+
dot: createSwitchProperty('圆点'),
|
|
18
|
+
overflowCount: createNumberProperty('封顶数值'),
|
|
19
|
+
status: createSelectProperty('状态', ['success', 'processing', 'default', 'error', 'warning', null]),
|
|
20
|
+
showZero: createSwitchProperty('显示零值'),
|
|
21
|
+
}),
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
Badge.Resource = createResource({
|
|
25
|
+
icon: '',
|
|
26
|
+
elements: [
|
|
27
|
+
{
|
|
28
|
+
componentName: 'Badge',
|
|
29
|
+
props: {
|
|
30
|
+
count: 5,
|
|
31
|
+
text: '状态',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
});
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Button as AntdButton } from '@yimoka/antd';
|
|
3
|
+
import { createBehavior, createResource } from '@yimoka/designable-core';
|
|
4
|
+
import { createContainerPropsSchema, createExpressionProperty, createInputProperty, createSelectProperty, createSwitchProperty, pickControlVisualStyle, sizeProperty, splitDesignableStyleProps, } from "../shared.js";
|
|
5
|
+
export const Button = (props) => {
|
|
6
|
+
const { componentProps, designerProps, wrapperStyle, } = splitDesignableStyleProps(props);
|
|
7
|
+
const buttonProps = componentProps;
|
|
8
|
+
const { block } = buttonProps;
|
|
9
|
+
const controlStyle = pickControlVisualStyle(wrapperStyle);
|
|
10
|
+
return (_jsx("div", { ...designerProps, style: {
|
|
11
|
+
display: block ? 'block' : 'inline-block',
|
|
12
|
+
width: block ? '100%' : undefined,
|
|
13
|
+
...wrapperStyle,
|
|
14
|
+
}, children: _jsx(AntdButton, { ...buttonProps, style: { ...controlStyle, width: '100%' } }) }));
|
|
15
|
+
};
|
|
16
|
+
Button.Behavior = createBehavior({
|
|
17
|
+
name: 'Button',
|
|
18
|
+
selector: node => node.componentName === 'Button',
|
|
19
|
+
designerProps: {
|
|
20
|
+
propsSchema: createContainerPropsSchema({
|
|
21
|
+
children: {
|
|
22
|
+
type: 'string',
|
|
23
|
+
'x-decorator': 'FormItem',
|
|
24
|
+
'x-component': 'Input',
|
|
25
|
+
title: '按钮文字',
|
|
26
|
+
},
|
|
27
|
+
type: {
|
|
28
|
+
type: 'string',
|
|
29
|
+
enum: ['default', 'primary', 'dashed', 'text', 'link'],
|
|
30
|
+
'x-decorator': 'FormItem',
|
|
31
|
+
'x-component': 'Select',
|
|
32
|
+
title: '按钮类型',
|
|
33
|
+
},
|
|
34
|
+
htmlType: {
|
|
35
|
+
type: 'string',
|
|
36
|
+
enum: ['button', 'submit', 'reset'],
|
|
37
|
+
'x-decorator': 'FormItem',
|
|
38
|
+
'x-component': 'Select',
|
|
39
|
+
title: 'HTML 类型',
|
|
40
|
+
},
|
|
41
|
+
size: sizeProperty,
|
|
42
|
+
shape: createSelectProperty('形状', ['default', 'circle', 'round', null]),
|
|
43
|
+
disabled: {
|
|
44
|
+
type: 'boolean',
|
|
45
|
+
'x-decorator': 'FormItem',
|
|
46
|
+
'x-component': 'Switch',
|
|
47
|
+
title: '禁用',
|
|
48
|
+
},
|
|
49
|
+
danger: {
|
|
50
|
+
type: 'boolean',
|
|
51
|
+
'x-decorator': 'FormItem',
|
|
52
|
+
'x-component': 'Switch',
|
|
53
|
+
title: '危险按钮',
|
|
54
|
+
},
|
|
55
|
+
loading: {
|
|
56
|
+
type: 'boolean',
|
|
57
|
+
'x-decorator': 'FormItem',
|
|
58
|
+
'x-component': 'Switch',
|
|
59
|
+
title: '加载中',
|
|
60
|
+
},
|
|
61
|
+
block: {
|
|
62
|
+
type: 'boolean',
|
|
63
|
+
'x-decorator': 'FormItem',
|
|
64
|
+
'x-component': 'Switch',
|
|
65
|
+
title: '块级按钮',
|
|
66
|
+
},
|
|
67
|
+
ghost: createSwitchProperty('幽灵按钮'),
|
|
68
|
+
href: createInputProperty('跳转地址'),
|
|
69
|
+
target: createSelectProperty('打开方式', ['_blank', '_self', '_parent', '_top', null]),
|
|
70
|
+
icon: createInputProperty('图标名称'),
|
|
71
|
+
iconPosition: createSelectProperty('图标位置', ['start', 'end', null]),
|
|
72
|
+
onClick: createExpressionProperty('点击事件', '{{() => {}}}'),
|
|
73
|
+
}),
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
Button.Resource = createResource({
|
|
77
|
+
icon: 'BoldOutlined',
|
|
78
|
+
elements: [
|
|
79
|
+
{
|
|
80
|
+
componentName: 'Button',
|
|
81
|
+
props: {
|
|
82
|
+
children: '按钮',
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
});
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Card as AntdCard } from '@yimoka/antd';
|
|
3
|
+
import { createBehavior, createResource } from '@yimoka/designable-core';
|
|
4
|
+
import { DroppableWidget } from '@yimoka/designable-react';
|
|
5
|
+
import { createContainerPropsSchema, createInputProperty, createJSONProperty, pickControlVisualStyle, sizeProperty, splitDesignableStyleProps, } from "../shared.js";
|
|
6
|
+
export const Card = (props) => {
|
|
7
|
+
const { componentProps: cardProps, designerProps, wrapperStyle, } = splitDesignableStyleProps(props);
|
|
8
|
+
const { bordered = true, children, title, ...restCardProps } = cardProps;
|
|
9
|
+
const variant = bordered === false ? 'borderless' : 'outlined';
|
|
10
|
+
const isDesignMode = Object.keys(designerProps).length > 0;
|
|
11
|
+
const controlStyle = pickControlVisualStyle(wrapperStyle);
|
|
12
|
+
const titleNode = title === undefined || title === null ? undefined : (_jsx("span", { "data-content-editable": "title", children: title }));
|
|
13
|
+
return (_jsx(DroppableWidget, { ...designerProps, placeholder: false, style: wrapperStyle, children: _jsx(AntdCard, { ...restCardProps, style: controlStyle, title: titleNode, variant: variant, children: children || (isDesignMode ? (_jsx("div", { style: {
|
|
14
|
+
alignItems: 'center',
|
|
15
|
+
border: '1px dashed #d7e1ef',
|
|
16
|
+
borderRadius: 6,
|
|
17
|
+
color: '#8b9bb0',
|
|
18
|
+
display: 'flex',
|
|
19
|
+
fontSize: 12,
|
|
20
|
+
justifyContent: 'center',
|
|
21
|
+
minHeight: 72,
|
|
22
|
+
}, children: "\u4ECE\u5DE6\u4FA7\u62D6\u5165\u7EC4\u4EF6" })) : null) }) }));
|
|
23
|
+
};
|
|
24
|
+
Card.Behavior = createBehavior({
|
|
25
|
+
name: 'Card',
|
|
26
|
+
selector: node => node.componentName === 'Card',
|
|
27
|
+
designerProps: {
|
|
28
|
+
droppable: true,
|
|
29
|
+
propsSchema: createContainerPropsSchema({
|
|
30
|
+
extra: {
|
|
31
|
+
type: 'string',
|
|
32
|
+
'x-decorator': 'FormItem',
|
|
33
|
+
'x-component': 'Input',
|
|
34
|
+
title: '右上内容',
|
|
35
|
+
},
|
|
36
|
+
bordered: {
|
|
37
|
+
type: 'boolean',
|
|
38
|
+
'x-decorator': 'FormItem',
|
|
39
|
+
'x-component': 'Switch',
|
|
40
|
+
title: '显示边框',
|
|
41
|
+
},
|
|
42
|
+
hoverable: {
|
|
43
|
+
type: 'boolean',
|
|
44
|
+
'x-decorator': 'FormItem',
|
|
45
|
+
'x-component': 'Switch',
|
|
46
|
+
title: '可悬浮',
|
|
47
|
+
},
|
|
48
|
+
size: sizeProperty,
|
|
49
|
+
loading: {
|
|
50
|
+
type: 'boolean',
|
|
51
|
+
'x-decorator': 'FormItem',
|
|
52
|
+
'x-component': 'Switch',
|
|
53
|
+
title: '加载中',
|
|
54
|
+
},
|
|
55
|
+
actions: createJSONProperty('操作区', 'array', '["操作一","操作二"]'),
|
|
56
|
+
tabList: createJSONProperty('页签列表', 'array', '[{"key":"tab1","tab":"页签一"}]'),
|
|
57
|
+
activeTabKey: createInputProperty('当前页签'),
|
|
58
|
+
defaultActiveTabKey: createInputProperty('默认页签'),
|
|
59
|
+
}),
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
Card.Resource = createResource({
|
|
63
|
+
icon: 'CreditCardOutlined',
|
|
64
|
+
elements: [
|
|
65
|
+
{
|
|
66
|
+
componentName: 'Card',
|
|
67
|
+
props: {
|
|
68
|
+
title: '卡片标题',
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Carousel as AntdCarousel } from '@yimoka/antd';
|
|
3
|
+
import { createBehavior, createResource } from '@yimoka/designable-core';
|
|
4
|
+
import { DroppableWidget } from '@yimoka/designable-react';
|
|
5
|
+
import { createContainerPropsSchema, createNumberProperty, createSwitchProperty, splitDesignableStyleProps, } from "../shared.js";
|
|
6
|
+
export const Carousel = (props) => {
|
|
7
|
+
const { componentProps, designerProps, wrapperStyle, } = splitDesignableStyleProps(props);
|
|
8
|
+
const isDesignMode = Object.keys(designerProps).length > 0;
|
|
9
|
+
const { autoplay, children, ...carouselProps } = componentProps;
|
|
10
|
+
return (_jsx(DroppableWidget, { ...designerProps, placeholder: false, style: wrapperStyle, children: _jsx(AntdCarousel, { ...carouselProps, autoplay: isDesignMode ? false : autoplay, children: children || (_jsx("div", { children: _jsx("div", { style: { background: '#f5f7fa', padding: 36, textAlign: 'center' }, children: "\u4ECE\u5DE6\u4FA7\u62D6\u5165\u8F6E\u64AD\u5185\u5BB9" }) })) }) }));
|
|
11
|
+
};
|
|
12
|
+
Carousel.Behavior = createBehavior({
|
|
13
|
+
name: 'Carousel',
|
|
14
|
+
selector: node => node.componentName === 'Carousel',
|
|
15
|
+
designerProps: {
|
|
16
|
+
droppable: true,
|
|
17
|
+
propsSchema: createContainerPropsSchema({
|
|
18
|
+
autoplay: createSwitchProperty('自动播放'),
|
|
19
|
+
autoplaySpeed: createNumberProperty('播放间隔'),
|
|
20
|
+
dots: createSwitchProperty('显示指示点'),
|
|
21
|
+
infinite: createSwitchProperty('循环播放'),
|
|
22
|
+
}),
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
Carousel.Resource = createResource({
|
|
26
|
+
icon: 'PlaySquareOutlined',
|
|
27
|
+
elements: [
|
|
28
|
+
{
|
|
29
|
+
componentName: 'Carousel',
|
|
30
|
+
props: { autoplay: false, dots: true },
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
});
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Cascader as AntdCascader } from '@yimoka/antd';
|
|
3
|
+
import { createBehavior, createResource } from '@yimoka/designable-core';
|
|
4
|
+
import { allowClearProperty, autoFocusProperty, createDataBindingProperty, createExpressionProperty, createFieldResourceProps, createFieldPropsSchema, createInputProperty, createJSONProperty, createSelectProperty, createSwitchProperty, multiSelectProperties, pickControlVisualStyle, placeholderProperty, showSearchProperty, sizeProperty, statusProperty, splitDesignableStyleProps, withSchemaOptions, } from "../shared.js";
|
|
5
|
+
export const Cascader = (props) => {
|
|
6
|
+
const { componentProps: cascaderProps, designerProps, wrapperStyle, } = splitDesignableStyleProps(props);
|
|
7
|
+
const controlStyle = pickControlVisualStyle(wrapperStyle);
|
|
8
|
+
return (_jsx("div", { ...designerProps, style: { display: 'inline-block', width: '100%', ...wrapperStyle }, children: _jsx(AntdCascader, { ...withSchemaOptions(cascaderProps), style: { width: '100%', ...controlStyle } }) }));
|
|
9
|
+
};
|
|
10
|
+
Cascader.Behavior = createBehavior({
|
|
11
|
+
name: 'Cascader',
|
|
12
|
+
selector: node => node.componentName === 'Cascader',
|
|
13
|
+
designerProps: {
|
|
14
|
+
propsSchema: createFieldPropsSchema({
|
|
15
|
+
dataBinding: createDataBindingProperty(['options', 'data']),
|
|
16
|
+
placeholder: placeholderProperty,
|
|
17
|
+
allowClear: allowClearProperty,
|
|
18
|
+
autoFocus: autoFocusProperty,
|
|
19
|
+
showSearch: showSearchProperty,
|
|
20
|
+
multiple: createSwitchProperty('多选'),
|
|
21
|
+
valueType: createSelectProperty('值类型', ['array', 'string', null]),
|
|
22
|
+
splitter: {
|
|
23
|
+
type: 'string',
|
|
24
|
+
'x-decorator': 'FormItem',
|
|
25
|
+
'x-component': 'Input',
|
|
26
|
+
title: '分隔符',
|
|
27
|
+
},
|
|
28
|
+
bordered: createSwitchProperty('显示边框'),
|
|
29
|
+
changeOnSelect: createSwitchProperty('选择即变更'),
|
|
30
|
+
expandTrigger: createSelectProperty('展开触发', ['click', 'hover', null]),
|
|
31
|
+
displayRender: createExpressionProperty('展示渲染', '{{(labels) => labels.join(" / ")}}'),
|
|
32
|
+
fieldNames: createJSONProperty('字段映射', 'object', '{"label":"label","value":"value","children":"children"}'),
|
|
33
|
+
notFoundContent: createInputProperty('空状态文案'),
|
|
34
|
+
status: statusProperty,
|
|
35
|
+
...multiSelectProperties,
|
|
36
|
+
size: sizeProperty,
|
|
37
|
+
}),
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
Cascader.Resource = createResource({
|
|
41
|
+
icon: 'ApartmentOutlined',
|
|
42
|
+
elements: [
|
|
43
|
+
{
|
|
44
|
+
componentName: 'Cascader',
|
|
45
|
+
props: createFieldResourceProps('cascader', '级联选择', {
|
|
46
|
+
placeholder: '请选择级联项',
|
|
47
|
+
options: [
|
|
48
|
+
{
|
|
49
|
+
label: '选项一',
|
|
50
|
+
value: 'option-1',
|
|
51
|
+
children: [
|
|
52
|
+
{ label: '子选项一', value: 'child-1' },
|
|
53
|
+
{ label: '子选项二', value: 'child-2' },
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
}),
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Checkbox as AntdCheckbox } from '@yimoka/antd';
|
|
2
|
+
import { DnFC } from '@yimoka/designable-react';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
type CheckboxProps = React.ComponentProps<typeof AntdCheckbox>;
|
|
5
|
+
type CheckboxGroupProps = React.ComponentProps<typeof AntdCheckbox.Group>;
|
|
6
|
+
type CheckboxDesignProps = CheckboxProps & CheckboxGroupProps;
|
|
7
|
+
export declare const Checkbox: DnFC<CheckboxDesignProps>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Checkbox as AntdCheckbox } from '@yimoka/antd';
|
|
3
|
+
import { createBehavior, createResource } from '@yimoka/designable-core';
|
|
4
|
+
import { autoFocusProperty, createDataBindingProperty, createFieldPropsSchema, createFieldResourceProps, createSelectProperty, splitDesignableStyleProps, withSchemaOptions, } from "../shared.js";
|
|
5
|
+
export const Checkbox = (props) => {
|
|
6
|
+
const { componentProps: checkboxProps, designerProps, wrapperStyle, } = splitDesignableStyleProps(props);
|
|
7
|
+
const normalizedCheckboxProps = withSchemaOptions(checkboxProps);
|
|
8
|
+
const { children = '复选框', data, dataKey, options, ...restProps } = normalizedCheckboxProps;
|
|
9
|
+
let groupOptions = Array.isArray(options) ? options : undefined;
|
|
10
|
+
if (!groupOptions && Array.isArray(data))
|
|
11
|
+
groupOptions = data;
|
|
12
|
+
const isGroup = Boolean(Array.isArray(groupOptions)
|
|
13
|
+
|| (typeof dataKey === 'string' && dataKey.trim()));
|
|
14
|
+
return (_jsx("div", { ...designerProps, style: { display: 'inline-block', ...wrapperStyle }, children: isGroup ? (_jsx(AntdCheckbox.Group, { ...restProps, options: groupOptions })) : (_jsx(AntdCheckbox, { ...restProps, children: children })) }));
|
|
15
|
+
};
|
|
16
|
+
Checkbox.Behavior = createBehavior({
|
|
17
|
+
name: 'Checkbox',
|
|
18
|
+
selector: node => node.componentName === 'Checkbox',
|
|
19
|
+
designerProps: {
|
|
20
|
+
propsSchema: createFieldPropsSchema({
|
|
21
|
+
dataBinding: createDataBindingProperty(['options', 'data']),
|
|
22
|
+
autoFocus: autoFocusProperty,
|
|
23
|
+
children: {
|
|
24
|
+
type: 'string',
|
|
25
|
+
'x-decorator': 'FormItem',
|
|
26
|
+
'x-component': 'Input',
|
|
27
|
+
title: '选项文案',
|
|
28
|
+
},
|
|
29
|
+
defaultChecked: {
|
|
30
|
+
type: 'boolean',
|
|
31
|
+
'x-decorator': 'FormItem',
|
|
32
|
+
'x-component': 'Switch',
|
|
33
|
+
title: '默认选中',
|
|
34
|
+
},
|
|
35
|
+
valueType: createSelectProperty('值类型', ['array', 'string', null]),
|
|
36
|
+
splitter: {
|
|
37
|
+
type: 'string',
|
|
38
|
+
'x-decorator': 'FormItem',
|
|
39
|
+
'x-component': 'Input',
|
|
40
|
+
title: '分隔符',
|
|
41
|
+
},
|
|
42
|
+
}),
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
Checkbox.Resource = createResource({
|
|
46
|
+
icon: 'CheckSquareOutlined',
|
|
47
|
+
elements: [
|
|
48
|
+
{
|
|
49
|
+
componentName: 'Checkbox',
|
|
50
|
+
props: createFieldResourceProps('checkbox', '复选框', {
|
|
51
|
+
children: '复选框',
|
|
52
|
+
}),
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ColorPicker as AntdColorPicker } from '@yimoka/antd';
|
|
3
|
+
import { createBehavior, createResource } from '@yimoka/designable-core';
|
|
4
|
+
import { createFieldResourceProps, createFieldPropsSchema, createSelectProperty, createSwitchProperty, sizeProperty, splitDesignableStyleProps, } from "../shared.js";
|
|
5
|
+
export const ColorPicker = (props) => {
|
|
6
|
+
const { componentProps: colorPickerProps, designerProps, wrapperStyle, } = splitDesignableStyleProps(props);
|
|
7
|
+
return (_jsx("div", { ...designerProps, style: { display: 'inline-flex', width: '100%', ...wrapperStyle }, children: _jsx(AntdColorPicker, { ...colorPickerProps }) }));
|
|
8
|
+
};
|
|
9
|
+
ColorPicker.Behavior = createBehavior({
|
|
10
|
+
name: 'ColorPicker',
|
|
11
|
+
selector: node => node.componentName === 'ColorPicker',
|
|
12
|
+
designerProps: {
|
|
13
|
+
propsSchema: createFieldPropsSchema({
|
|
14
|
+
value: {
|
|
15
|
+
type: 'string',
|
|
16
|
+
title: '颜色值',
|
|
17
|
+
'x-decorator': 'FormItem',
|
|
18
|
+
'x-component': 'ColorInput',
|
|
19
|
+
},
|
|
20
|
+
allowClear: createSwitchProperty('可清除'),
|
|
21
|
+
disabledAlpha: createSwitchProperty('禁用透明度'),
|
|
22
|
+
format: createSelectProperty('颜色格式', ['hex', 'rgb', 'hsb', null]),
|
|
23
|
+
showText: createSwitchProperty('显示颜色文本'),
|
|
24
|
+
size: sizeProperty,
|
|
25
|
+
}),
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
ColorPicker.Resource = createResource({
|
|
29
|
+
icon: '',
|
|
30
|
+
elements: [
|
|
31
|
+
{
|
|
32
|
+
componentName: 'ColorPicker',
|
|
33
|
+
props: createFieldResourceProps('color', '颜色', {
|
|
34
|
+
value: '#1677ff',
|
|
35
|
+
}),
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
});
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { DatePicker as AntdDatePicker } from '@yimoka/antd';
|
|
3
|
+
import { createBehavior, createResource } from '@yimoka/designable-core';
|
|
4
|
+
import { allowClearProperty, autoFocusProperty, createExpressionProperty, createFieldResourceProps, createFieldPropsSchema, createSelectProperty, createSwitchProperty, pickControlVisualStyle, placeholderProperty, sizeProperty, splitDesignableStyleProps, statusProperty, } from "../shared.js";
|
|
5
|
+
export const DatePicker = (props) => {
|
|
6
|
+
const { componentProps: datePickerProps, designerProps, wrapperStyle, } = splitDesignableStyleProps(props);
|
|
7
|
+
const controlStyle = pickControlVisualStyle(wrapperStyle);
|
|
8
|
+
return (_jsx("div", { ...designerProps, style: { display: 'inline-block', width: '100%', ...wrapperStyle }, children: _jsx(AntdDatePicker, { ...datePickerProps, style: { width: '100%', ...controlStyle } }) }));
|
|
9
|
+
};
|
|
10
|
+
DatePicker.Behavior = createBehavior({
|
|
11
|
+
name: 'DatePicker',
|
|
12
|
+
selector: node => node.componentName === 'DatePicker',
|
|
13
|
+
designerProps: {
|
|
14
|
+
propsSchema: createFieldPropsSchema({
|
|
15
|
+
placeholder: placeholderProperty,
|
|
16
|
+
allowClear: allowClearProperty,
|
|
17
|
+
autoFocus: autoFocusProperty,
|
|
18
|
+
format: {
|
|
19
|
+
type: 'string',
|
|
20
|
+
'x-decorator': 'FormItem',
|
|
21
|
+
'x-component': 'Input',
|
|
22
|
+
title: '展示格式',
|
|
23
|
+
},
|
|
24
|
+
picker: {
|
|
25
|
+
type: 'string',
|
|
26
|
+
enum: ['date', 'week', 'month', 'quarter', 'year'],
|
|
27
|
+
'x-decorator': 'FormItem',
|
|
28
|
+
'x-component': 'Select',
|
|
29
|
+
title: '选择粒度',
|
|
30
|
+
},
|
|
31
|
+
multiple: createSwitchProperty('多选'),
|
|
32
|
+
inputReadOnly: createSwitchProperty('输入只读'),
|
|
33
|
+
showNow: createSwitchProperty('显示此刻'),
|
|
34
|
+
showTime: createSwitchProperty('显示时间'),
|
|
35
|
+
showToday: createSwitchProperty('显示今天'),
|
|
36
|
+
disabledDate: createExpressionProperty('禁用日期', '{{(current) => current && current < dayjs().startOf("day")}}'),
|
|
37
|
+
disabledTime: createExpressionProperty('禁用时间', '{{() => ({ disabledHours: () => [0, 1, 2] })}}'),
|
|
38
|
+
valueType: createSelectProperty('值类型', ['array', 'string', null]),
|
|
39
|
+
dataValueType: createSelectProperty('日期值类型', ['string', 's', 'ms', 'dayjs', null]),
|
|
40
|
+
status: statusProperty,
|
|
41
|
+
splitter: {
|
|
42
|
+
type: 'string',
|
|
43
|
+
'x-decorator': 'FormItem',
|
|
44
|
+
'x-component': 'Input',
|
|
45
|
+
title: '分隔符',
|
|
46
|
+
},
|
|
47
|
+
size: sizeProperty,
|
|
48
|
+
}),
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
DatePicker.Resource = createResource({
|
|
52
|
+
icon: 'CalendarOutlined',
|
|
53
|
+
elements: [
|
|
54
|
+
{
|
|
55
|
+
componentName: 'DatePicker',
|
|
56
|
+
props: createFieldResourceProps('date', '日期', {
|
|
57
|
+
placeholder: '请选择日期',
|
|
58
|
+
}),
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
});
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { DateRangePicker as AntdDateRangePicker } from '@yimoka/antd';
|
|
3
|
+
import { createBehavior, createResource } from '@yimoka/designable-core';
|
|
4
|
+
import { allowClearProperty, autoFocusProperty, createExpressionProperty, createFieldResourceProps, createFieldPropsSchema, createJSONProperty, createSelectProperty, createSwitchProperty, pickControlVisualStyle, sizeProperty, splitDesignableStyleProps, statusProperty, } from "../shared.js";
|
|
5
|
+
export const DateRangePicker = (props) => {
|
|
6
|
+
const { componentProps: dateRangePickerProps, designerProps, wrapperStyle, } = splitDesignableStyleProps(props);
|
|
7
|
+
const controlStyle = pickControlVisualStyle(wrapperStyle);
|
|
8
|
+
return (_jsx("div", { ...designerProps, style: { display: 'inline-block', width: '100%', ...wrapperStyle }, children: _jsx(AntdDateRangePicker, { ...dateRangePickerProps, style: { width: '100%', ...controlStyle } }) }));
|
|
9
|
+
};
|
|
10
|
+
DateRangePicker.Behavior = createBehavior({
|
|
11
|
+
name: 'DateRangePicker',
|
|
12
|
+
selector: node => node.componentName === 'DateRangePicker',
|
|
13
|
+
designerProps: {
|
|
14
|
+
propsSchema: createFieldPropsSchema({
|
|
15
|
+
placeholder: createJSONProperty('占位符', 'array', '["开始日期","结束日期"]'),
|
|
16
|
+
allowClear: allowClearProperty,
|
|
17
|
+
autoFocus: autoFocusProperty,
|
|
18
|
+
format: {
|
|
19
|
+
type: 'string',
|
|
20
|
+
'x-decorator': 'FormItem',
|
|
21
|
+
'x-component': 'Input',
|
|
22
|
+
title: '展示格式',
|
|
23
|
+
},
|
|
24
|
+
picker: {
|
|
25
|
+
type: 'string',
|
|
26
|
+
enum: ['date', 'week', 'month', 'quarter', 'year'],
|
|
27
|
+
'x-decorator': 'FormItem',
|
|
28
|
+
'x-component': 'Select',
|
|
29
|
+
title: '选择粒度',
|
|
30
|
+
},
|
|
31
|
+
inputReadOnly: createSwitchProperty('输入只读'),
|
|
32
|
+
showTime: createSwitchProperty('显示时间'),
|
|
33
|
+
disabledDate: createExpressionProperty('禁用日期', '{{(current) => current && current < dayjs().startOf("day")}}'),
|
|
34
|
+
disabledTime: createExpressionProperty('禁用时间', '{{() => ({ disabledHours: () => [0, 1, 2] })}}'),
|
|
35
|
+
valueType: createSelectProperty('值类型', ['array', 'string', null]),
|
|
36
|
+
dataValueType: createSelectProperty('日期值类型', ['string', 's', 'ms', 'dayjs', null]),
|
|
37
|
+
status: statusProperty,
|
|
38
|
+
splitter: {
|
|
39
|
+
type: 'string',
|
|
40
|
+
'x-decorator': 'FormItem',
|
|
41
|
+
'x-component': 'Input',
|
|
42
|
+
title: '分隔符',
|
|
43
|
+
},
|
|
44
|
+
size: sizeProperty,
|
|
45
|
+
}),
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
DateRangePicker.Resource = createResource({
|
|
49
|
+
icon: 'CalendarOutlined',
|
|
50
|
+
elements: [
|
|
51
|
+
{
|
|
52
|
+
componentName: 'DateRangePicker',
|
|
53
|
+
props: createFieldResourceProps('dateRange', '日期范围', {
|
|
54
|
+
valueType: 'array',
|
|
55
|
+
}),
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Divider as AntdDivider } from '@yimoka/antd';
|
|
3
|
+
import { createBehavior, createResource } from '@yimoka/designable-core';
|
|
4
|
+
import { createContainerPropsSchema, createInputProperty, createSelectProperty, splitDesignableStyleProps, } from "../shared.js";
|
|
5
|
+
export const Divider = (props) => {
|
|
6
|
+
const { componentProps: dividerProps, designerProps, wrapperStyle, } = splitDesignableStyleProps(props);
|
|
7
|
+
const rawDividerProps = dividerProps;
|
|
8
|
+
const { children, titlePlacement, ...restDividerProps } = dividerProps;
|
|
9
|
+
const { orientation } = rawDividerProps;
|
|
10
|
+
const legacyTitlePlacement = (orientation === 'left'
|
|
11
|
+
|| orientation === 'center'
|
|
12
|
+
|| orientation === 'right')
|
|
13
|
+
? orientation
|
|
14
|
+
: undefined;
|
|
15
|
+
return (_jsx("div", { ...designerProps, style: { width: '100%', ...wrapperStyle }, children: _jsx(AntdDivider, { ...restDividerProps, titlePlacement: titlePlacement ?? legacyTitlePlacement, children: children }) }));
|
|
16
|
+
};
|
|
17
|
+
Divider.Behavior = createBehavior({
|
|
18
|
+
name: 'Divider',
|
|
19
|
+
selector: node => node.componentName === 'Divider',
|
|
20
|
+
designerProps: {
|
|
21
|
+
propsSchema: createContainerPropsSchema({
|
|
22
|
+
children: createInputProperty('分割线文本'),
|
|
23
|
+
titlePlacement: createSelectProperty('文本位置', ['left', 'center', 'right', null]),
|
|
24
|
+
type: createSelectProperty('方向', ['horizontal', 'vertical']),
|
|
25
|
+
}),
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
Divider.Resource = createResource({
|
|
29
|
+
icon: '',
|
|
30
|
+
elements: [
|
|
31
|
+
{
|
|
32
|
+
componentName: 'Divider',
|
|
33
|
+
props: {
|
|
34
|
+
children: '分割线',
|
|
35
|
+
titlePlacement: 'left',
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
});
|