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

Class TooltipWrapperPlugin

packages/amis-editor/src/plugin/TooltipWrapper.tsx:10–309  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8import {generateId} from '../util';
9
10export class TooltipWrapperPlugin extends BasePlugin {
11 static id = 'TooltipWrapperPlugin';
12 static scene = ['layout'];
13 rendererName = 'tooltip-wrapper';
14 $schema = '/schemas/TooltipWrapperSchema.json';
15
16 isBaseComponent = true;
17 name = '文字提示';
18 description =
19 '类似容器,可以将多个渲染器放置在一起,当用户鼠标悬停或者点击容器时,显示文字提示浮层';
20 searchKeywords = '文字提示容器';
21 docLink = '/amis/zh-CN/components/tooltip';
22 tags = ['功能'];
23 icon = 'fa fa-comment-alt';
24 pluginIcon = 'tooltip-wrapper-plugin';
25
26 scaffold = {
27 type: 'tooltip-wrapper',
28 tooltip: '提示文字',
29 body: [
30 {
31 type: 'tpl',
32 wrapperComponent: '',
33 tpl: '内容',
34 id: generateId()
35 }
36 ],
37 enterable: true,
38 showArrow: true,
39 offset: [0, 0]
40 };
41
42 previewSchema = {
43 ...this.scaffold,
44 className: 'p-1 mr-3 border-2 border-solid border-indigo-400'
45 };
46
47 regions: Array<RegionConfig> = [
48 {
49 key: 'body',
50 label: '内容区'
51 }
52 ];
53
54 panelTitle = this.name;
55
56 panelJustify = true;
57
58 panelBodyCreator = (context: BaseEventContext) => {
59 return [
60 getSchemaTpl('tabs', [
61 {
62 title: '属性',
63 className: 'p-none',
64 body: [
65 getSchemaTpl('collapseGroup', [
66 {
67 title: '基本',

Callers

nothing calls this directly

Calls 4

generateIdFunction · 0.90
getSchemaTplFunction · 0.90
tipedLabelFunction · 0.90
defaultValueFunction · 0.90

Tested by

no test coverage detected