MCPcopy
hub / github.com/baidu/amis / DrawerPlugin

Class DrawerPlugin

packages/amis-editor/src/plugin/Drawer.tsx:24–442  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22import {InlineModal} from './Dialog';
23
24export class DrawerPlugin extends BasePlugin {
25 static id = 'DrawerPlugin';
26 // 关联渲染器名字
27 rendererName = 'drawer';
28 $schema = '/schemas/DrawerSchema.json';
29
30 // 组件名称
31 name = '抽屉式弹框';
32 isBaseComponent = true;
33 wrapperProps = {
34 wrapperComponent: InlineModal,
35 onClose: noop,
36 resizable: false,
37 show: true
38 };
39
40 regions: Array<RegionConfig> = [
41 {
42 key: 'body',
43 label: '内容区',
44 renderMethod: 'renderBody',
45 renderMethodOverride: (regions, insertRegion) =>
46 function (this: any, ...args: any[]) {
47 const info: RendererInfo = this.props.$$editor;
48 const dom = this.super(...args);
49
50 if (info && args[1] === 'body') {
51 return insertRegion(this, dom, regions, info, info.plugin.manager);
52 }
53
54 return dom;
55 }
56 },
57 {
58 key: 'actions',
59 label: '按钮组',
60 renderMethod: 'renderFooter',
61 wrapperResolve: dom => dom
62 }
63 ];
64
65 // 现在没用,后面弹窗优化后有用
66 events = [
67 {
68 eventName: 'confirm',
69 eventLabel: '确认',
70 description: '点击抽屉确认按钮时触发',
71 dataSchema: [
72 {
73 type: 'object',
74 properties: {
75 data: {
76 type: 'object',
77 title: '数据',
78 description: '当前数据域,可以通过.字段名读取对应的值'
79 }
80 }
81 }

Callers

nothing calls this directly

Calls 7

getActionCommonPropsFunction · 0.90
getI18nEnabledFunction · 0.90
getSchemaTplFunction · 0.90
defaultValueFunction · 0.90
tipedLabelFunction · 0.90
getEventControlConfigFunction · 0.90
insertRegionFunction · 0.85

Tested by

no test coverage detected