amis-editor 4.0.1-beta.8 → 4.0.2-beta.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (176) hide show
  1. package/dist/cebfe0bc5a1dbde02da1.svg +10 -0
  2. package/dist/component/ContextMenuPanel.d.ts +8 -0
  3. package/dist/component/Control/APIControl.d.ts +504 -0
  4. package/dist/component/Control/OptionControl.d.ts +163 -0
  5. package/dist/component/Control/PopoverEdit.d.ts +57 -0
  6. package/dist/component/Control/ValidationControl.d.ts +30 -0
  7. package/dist/component/Editor.d.ts +1 -0
  8. package/dist/component/Panel/AMisCodeEditor.d.ts +37 -0
  9. package/dist/component/Panel/AvailableRenderersPanel.d.ts +10 -0
  10. package/dist/component/Panel/CodeEditorPanel.d.ts +6 -0
  11. package/dist/component/Panel/ContextMenuPanel.d.ts +8 -0
  12. package/dist/component/Panel/DrawerPanel.d.ts +15 -0
  13. package/dist/component/Panel/DrawerRendererPanel.d.ts +15 -0
  14. package/dist/component/Panel/InsertSubRendererPanel.d.ts +11 -0
  15. package/dist/component/Panel/LeftPanels.d.ts +20 -0
  16. package/dist/component/Panel/Outline.d.ts +18 -0
  17. package/dist/component/Panel/RenderersPanel.d.ts +32 -0
  18. package/dist/component/Panel/RightPanels.d.ts +21 -0
  19. package/dist/component/Panel/TargetNamePanel.d.ts +7 -0
  20. package/dist/component/Preview.d.ts +1 -0
  21. package/dist/component/ScaffoldModal.d.ts +1 -1
  22. package/dist/component/base/BackTop.d.ts +26 -0
  23. package/dist/component/base/ErrorRenderer.d.ts +4 -0
  24. package/dist/component/base/InputComponentName.d.ts +8 -0
  25. package/dist/component/base/SearchRendererPanel.d.ts +59 -0
  26. package/dist/component/base/WidthDraggableBtn.d.ts +16 -0
  27. package/dist/component/base/WidthDraggableContainer.d.ts +2 -0
  28. package/dist/component/remarkTpl.d.ts +150 -0
  29. package/dist/exports.d.ts +8 -0
  30. package/dist/exports.min.js +1 -0
  31. package/dist/index.d.ts +19 -14
  32. package/dist/index.min.js +1 -1
  33. package/dist/manager.d.ts +7 -5
  34. package/dist/plugin/Alert.d.ts +2 -1
  35. package/dist/plugin/AnchorNav.d.ts +1 -0
  36. package/dist/plugin/Audio.d.ts +1 -0
  37. package/dist/plugin/Avatar.d.ts +1 -0
  38. package/dist/plugin/Breadcrumb.d.ts +2 -0
  39. package/dist/plugin/Button.d.ts +1 -0
  40. package/dist/plugin/ButtonGroup.d.ts +1 -0
  41. package/dist/plugin/ButtonToolbar.d.ts +1 -0
  42. package/dist/plugin/CRUD.d.ts +1 -0
  43. package/dist/plugin/Card.d.ts +1 -1
  44. package/dist/plugin/Cards.d.ts +1 -0
  45. package/dist/plugin/Carousel.d.ts +1 -0
  46. package/dist/plugin/Chart.d.ts +1 -0
  47. package/dist/plugin/CodeView.d.ts +1 -0
  48. package/dist/plugin/Collapse.d.ts +16 -6
  49. package/dist/plugin/CollapseGroup.d.ts +41 -0
  50. package/dist/plugin/Container.d.ts +1 -0
  51. package/dist/plugin/Custom.d.ts +1 -0
  52. package/dist/plugin/Date.d.ts +1 -0
  53. package/dist/plugin/Datetime.d.ts +1 -0
  54. package/dist/plugin/Dialog.d.ts +1 -0
  55. package/dist/plugin/Divider.d.ts +1 -0
  56. package/dist/plugin/Drawer.d.ts +1 -0
  57. package/dist/plugin/DropDownButton.d.ts +1 -0
  58. package/dist/plugin/Each.d.ts +1 -0
  59. package/dist/plugin/ErrorRenderer.d.ts +1 -0
  60. package/dist/plugin/Flex.d.ts +2 -1
  61. package/dist/plugin/Form/ButtonGroupSelect.d.ts +1 -0
  62. package/dist/plugin/Form/ButtonToolbar.d.ts +1 -0
  63. package/dist/plugin/Form/ChainedSelect.d.ts +1 -0
  64. package/dist/plugin/Form/Checkbox.d.ts +1 -0
  65. package/dist/plugin/Form/Checkboxes.d.ts +1 -0
  66. package/dist/plugin/Form/CodeEditor.d.ts +40 -0
  67. package/dist/plugin/Form/Combo.d.ts +1 -0
  68. package/dist/plugin/Form/ConditionBuilder.d.ts +1 -0
  69. package/dist/plugin/Form/Control.d.ts +1 -0
  70. package/dist/plugin/Form/DiffEditor.d.ts +1 -0
  71. package/dist/plugin/Form/FieldSet.d.ts +1 -0
  72. package/dist/plugin/Form/Form.d.ts +1 -0
  73. package/dist/plugin/Form/Formula.d.ts +1 -0
  74. package/dist/plugin/Form/Group.d.ts +1 -0
  75. package/dist/plugin/Form/Hidden.d.ts +1 -0
  76. package/dist/plugin/Form/InputArray.d.ts +2 -0
  77. package/dist/plugin/Form/InputCity.d.ts +1 -0
  78. package/dist/plugin/Form/InputColor.d.ts +1 -0
  79. package/dist/plugin/Form/InputDate.d.ts +1 -0
  80. package/dist/plugin/Form/InputDateRange.d.ts +1 -0
  81. package/dist/plugin/Form/InputDateTime.d.ts +1 -0
  82. package/dist/plugin/Form/InputDateTimeRange.d.ts +1 -0
  83. package/dist/plugin/Form/InputEmail.d.ts +1 -0
  84. package/dist/plugin/Form/InputExcel.d.ts +1 -0
  85. package/dist/plugin/Form/InputFile.d.ts +1 -0
  86. package/dist/plugin/Form/InputGroup.d.ts +1 -2
  87. package/dist/plugin/Form/InputImage.d.ts +1 -0
  88. package/dist/plugin/Form/InputKV.d.ts +1 -0
  89. package/dist/plugin/Form/InputMonth.d.ts +1 -0
  90. package/dist/plugin/Form/InputMonthRange.d.ts +1 -0
  91. package/dist/plugin/Form/InputNumber.d.ts +1 -0
  92. package/dist/plugin/Form/InputPassword.d.ts +1 -0
  93. package/dist/plugin/Form/InputQuarter.d.ts +1 -0
  94. package/dist/plugin/Form/InputQuarterRange.d.ts +1 -0
  95. package/dist/plugin/Form/InputRange.d.ts +1 -0
  96. package/dist/plugin/Form/InputRating.d.ts +2 -1
  97. package/dist/plugin/Form/InputRepeat.d.ts +1 -0
  98. package/dist/plugin/Form/InputRichText.d.ts +1 -0
  99. package/dist/plugin/Form/InputSubForm.d.ts +1 -0
  100. package/dist/plugin/Form/InputTable.d.ts +1 -1
  101. package/dist/plugin/Form/InputTag.d.ts +1 -0
  102. package/dist/plugin/Form/InputText.d.ts +1 -0
  103. package/dist/plugin/Form/InputTime.d.ts +1 -0
  104. package/dist/plugin/Form/InputTree.d.ts +1 -0
  105. package/dist/plugin/Form/InputURL.d.ts +1 -0
  106. package/dist/plugin/Form/InputYear.d.ts +1 -0
  107. package/dist/plugin/Form/ListSelect.d.ts +1 -0
  108. package/dist/plugin/Form/LocationPicker.d.ts +1 -0
  109. package/dist/plugin/Form/MatrixCheckboxes.d.ts +1 -0
  110. package/dist/plugin/Form/NestedSelect.d.ts +1 -0
  111. package/dist/plugin/Form/Picker.d.ts +1 -0
  112. package/dist/plugin/Form/Radios.d.ts +1 -0
  113. package/dist/plugin/Form/Select.d.ts +1 -0
  114. package/dist/plugin/Form/Static.d.ts +1 -1
  115. package/dist/plugin/Form/Switch.d.ts +1 -0
  116. package/dist/plugin/Form/TabsTransfer.d.ts +1 -0
  117. package/dist/plugin/Form/Textarea.d.ts +1 -0
  118. package/dist/plugin/Form/Transfer.d.ts +1 -0
  119. package/dist/plugin/Form/TreeSelect.d.ts +1 -0
  120. package/dist/plugin/Form/UUID.d.ts +1 -0
  121. package/dist/plugin/Grid.d.ts +1 -0
  122. package/dist/plugin/HBox.d.ts +1 -1
  123. package/dist/plugin/IFrame.d.ts +1 -0
  124. package/dist/plugin/Image.d.ts +1 -0
  125. package/dist/plugin/Images.d.ts +1 -0
  126. package/dist/plugin/Json.d.ts +1 -0
  127. package/dist/plugin/Link.d.ts +1 -0
  128. package/dist/plugin/List.d.ts +1 -0
  129. package/dist/plugin/ListItem.d.ts +1 -1
  130. package/dist/plugin/Log.d.ts +1 -0
  131. package/dist/plugin/Mapping.d.ts +1 -0
  132. package/dist/plugin/Markdown.d.ts +1 -0
  133. package/dist/plugin/Nav.d.ts +1 -0
  134. package/dist/plugin/Operation.d.ts +1 -0
  135. package/dist/plugin/Others/Action.d.ts +8 -0
  136. package/dist/plugin/Others/BasicToolbar.d.ts +11 -0
  137. package/dist/plugin/Others/DataDebug.d.ts +19 -0
  138. package/dist/plugin/Others/TableCell.d.ts +8 -0
  139. package/dist/plugin/Others/Unknown.d.ts +5 -0
  140. package/dist/plugin/Page.d.ts +1 -0
  141. package/dist/plugin/Panel/AvailableRenderers.d.ts +8 -0
  142. package/dist/plugin/Panel/Code.d.ts +9 -0
  143. package/dist/plugin/Panel/Name.d.ts +8 -0
  144. package/dist/plugin/Panel.d.ts +16 -3
  145. package/dist/plugin/Plain.d.ts +1 -0
  146. package/dist/plugin/Progress.d.ts +1 -0
  147. package/dist/plugin/Property.d.ts +1 -0
  148. package/dist/plugin/QRCode.d.ts +1 -0
  149. package/dist/plugin/Reset.d.ts +1 -0
  150. package/dist/plugin/Service.d.ts +1 -0
  151. package/dist/plugin/Sparkline.d.ts +1 -0
  152. package/dist/plugin/Status.d.ts +1 -0
  153. package/dist/plugin/Steps.d.ts +1 -0
  154. package/dist/plugin/Submit.d.ts +1 -0
  155. package/dist/plugin/Table.d.ts +1 -0
  156. package/dist/plugin/TableCell.d.ts +0 -1
  157. package/dist/plugin/TableView.d.ts +1 -0
  158. package/dist/plugin/Tabs.d.ts +1 -0
  159. package/dist/plugin/Tasks.d.ts +1 -0
  160. package/dist/plugin/Time.d.ts +1 -0
  161. package/dist/plugin/Tpl.d.ts +1 -0
  162. package/dist/plugin/Video.d.ts +1 -0
  163. package/dist/plugin/WebComponent.d.ts +3 -26
  164. package/dist/plugin/Wizard.d.ts +1 -0
  165. package/dist/plugin/Wrapper.d.ts +1 -0
  166. package/dist/plugin.d.ts +18 -5
  167. package/dist/store/editor.d.ts +54 -4
  168. package/dist/style.css +1 -1
  169. package/dist/util.d.ts +7 -2
  170. package/package.json +23 -15
  171. package/static/side_hide_left.svg +10 -0
  172. package/.editorconfig +0 -12
  173. package/.fecsrc +0 -8
  174. package/.prettierrc +0 -20
  175. package/publish-local.sh +0 -37
  176. package/rollup.config.js +0 -24
@@ -0,0 +1,163 @@
1
+ /**
2
+ * @file 组件选项组件的可视化编辑控件
3
+ */
4
+ import React from 'react';
5
+ import Sortable from 'sortablejs';
6
+ import type { Option } from 'amis';
7
+ import type { FormControlProps } from 'amis/lib/renderers/Form/Item';
8
+ import type { OptionValue } from 'amis/lib/components/Select';
9
+ export declare type valueType = 'text' | 'boolean' | 'number';
10
+ export interface PopoverForm {
11
+ optionLabel: string;
12
+ optionValue: any;
13
+ optionValueType: valueType;
14
+ }
15
+ export declare type OptionControlItem = Option & {
16
+ checked: boolean;
17
+ };
18
+ export interface OptionControlProps extends FormControlProps {
19
+ className?: string;
20
+ }
21
+ export interface OptionControlState {
22
+ options: Array<OptionControlItem>;
23
+ popOverData: any;
24
+ popOverCtx?: {
25
+ mode: 'add' | 'edit';
26
+ index?: number;
27
+ };
28
+ source: 'custom' | 'api' | 'form';
29
+ sourceOptions: Array<Option>;
30
+ }
31
+ export declare class OptionControl extends React.Component<OptionControlProps, OptionControlState> {
32
+ sortable?: Sortable;
33
+ drag?: HTMLElement | null;
34
+ target: HTMLElement | null;
35
+ internalProps: string[];
36
+ constructor(props: OptionControlProps);
37
+ componentDidUpdate(prevProps: OptionControlProps): void;
38
+ /**
39
+ * 获取当前选项值的类型
40
+ */
41
+ getOptionValueType(value: any): valueType;
42
+ /**
43
+ * 将当前选项值转换为选择的类型
44
+ */
45
+ normalizeOptionValue(value: any, valueType: valueType): string | number | boolean;
46
+ /**
47
+ * 处理填入输入框的值
48
+ */
49
+ transformOptionValue(value: any): string;
50
+ transformOptions(props: OptionControlProps): {
51
+ checked: boolean;
52
+ label?: string | undefined;
53
+ scopeLabel?: string | undefined;
54
+ value?: any;
55
+ disabled?: boolean | undefined;
56
+ children?: import("amis").Options | undefined;
57
+ visible?: boolean | undefined;
58
+ hidden?: boolean | undefined;
59
+ description?: string | undefined;
60
+ defer?: boolean | undefined;
61
+ deferApi?: import("amis").SchemaApi | undefined;
62
+ loading?: boolean | undefined;
63
+ loaded?: boolean | undefined;
64
+ }[];
65
+ /**
66
+ * 处理当前组件的默认值
67
+ */
68
+ normalizeValue(): OptionValue | OptionValue[];
69
+ /**
70
+ * 更新options字段的统一出口
71
+ */
72
+ onChangeOptions(): void;
73
+ targetRef(ref: any): void;
74
+ dragRef(ref: any): void;
75
+ initDragging(): void;
76
+ destroyDragging(): void;
77
+ scroll2Bottom(): void;
78
+ /**
79
+ * 切换选项类型
80
+ */
81
+ handleSourceChange(option: {
82
+ label: string;
83
+ value: 'custom' | 'api' | 'form';
84
+ }): void;
85
+ /**
86
+ * 删除选项
87
+ */
88
+ handleDelete(index: number, e: React.UIEvent<any>): void;
89
+ /**
90
+ * 设置默认选项
91
+ */
92
+ handleToggleDefaultValue(index: number, checked: any, shift?: boolean): void;
93
+ /**
94
+ * 编辑选项
95
+ */
96
+ handleEdit(index: number, e: React.UIEvent<any>): void;
97
+ handleEditLabel(index: number, e: React.FocusEvent<HTMLInputElement>): void;
98
+ handleAdd(): void;
99
+ handlePopoverSubmit(values: PopoverForm, action: any): void;
100
+ closePopoverEdit(): boolean;
101
+ handleBatchAdd(values: {
102
+ batchOption: string;
103
+ }, action: any): void;
104
+ renderHeader(): JSX.Element;
105
+ renderOption(props: any): JSX.Element;
106
+ renderPopover(): JSX.Element;
107
+ buildBatchAddSchema(): {
108
+ type: string;
109
+ actionType: string;
110
+ level: string;
111
+ size: string;
112
+ label: string;
113
+ dialog: {
114
+ title: string;
115
+ headerClassName: string;
116
+ closeOnEsc: boolean;
117
+ closeOnOutside: boolean;
118
+ showCloseButton: boolean;
119
+ body: ({
120
+ type: string;
121
+ level: string;
122
+ body: string;
123
+ showIcon: boolean;
124
+ className: string;
125
+ wrapWithPanel?: undefined;
126
+ mode?: undefined;
127
+ wrapperComponent?: undefined;
128
+ resetAfterSubmit?: undefined;
129
+ autoFocus?: undefined;
130
+ preventEnterSubmit?: undefined;
131
+ horizontal?: undefined;
132
+ } | {
133
+ type: string;
134
+ wrapWithPanel: boolean;
135
+ mode: string;
136
+ wrapperComponent: string;
137
+ resetAfterSubmit: boolean;
138
+ autoFocus: boolean;
139
+ preventEnterSubmit: boolean;
140
+ horizontal: {
141
+ left: number;
142
+ right: number;
143
+ };
144
+ body: {
145
+ name: string;
146
+ type: string;
147
+ label: string;
148
+ placeholder: string;
149
+ trimContents: boolean;
150
+ minRows: number;
151
+ maxRows: number;
152
+ required: boolean;
153
+ }[];
154
+ level?: undefined;
155
+ showIcon?: undefined;
156
+ className?: undefined;
157
+ })[];
158
+ };
159
+ };
160
+ render(): JSX.Element;
161
+ }
162
+ export declare class OptionControlRenderer extends OptionControl {
163
+ }
@@ -0,0 +1,57 @@
1
+ /**
2
+ * @file 浮窗编辑
3
+ */
4
+ import React from 'react';
5
+ import type { Action } from 'amis/lib/types';
6
+ import type { IScopedContext } from 'amis/lib/Scoped';
7
+ import type { FormSchema } from 'amis/lib/renderers/Form';
8
+ import type { FormControlProps } from 'amis/lib/renderers/Form/Item';
9
+ import type { Offset } from 'amis/lib/components/PopOver';
10
+ export interface PopoverEditProps extends FormControlProps {
11
+ className?: string;
12
+ popOverclassName?: string;
13
+ btnLabel?: string;
14
+ btnIcon?: string;
15
+ iconPosition?: 'right' | 'left';
16
+ mode: 'popover' | 'dialog';
17
+ form: Omit<FormSchema, 'type'>;
18
+ rootClose?: boolean;
19
+ placement?: string;
20
+ offset?: ((clip: object, offset: object) => Offset) | Offset;
21
+ style?: object;
22
+ overlay?: boolean;
23
+ container?: React.ReactNode | Function;
24
+ target?: React.ReactNode | Function;
25
+ trueValue?: any;
26
+ falseValue?: any;
27
+ enableEdit?: boolean;
28
+ removable?: boolean;
29
+ onClose: (e: React.UIEvent<any> | void) => void;
30
+ }
31
+ interface PopoverEditState {
32
+ /**
33
+ * 是否展示编辑窗口
34
+ */
35
+ show: boolean;
36
+ /**
37
+ * 是否开启编辑
38
+ */
39
+ checked: boolean;
40
+ }
41
+ export declare class PopoverEdit extends React.Component<PopoverEditProps, PopoverEditState> {
42
+ static defaultProps: Pick<PopoverEditProps, 'btnIcon' | 'iconPosition' | 'container' | 'placement' | 'overlay' | 'rootClose' | 'mode' | 'trueValue' | 'falseValue' | 'enableEdit'>;
43
+ overlay: HTMLElement | null;
44
+ constructor(props: PopoverEditProps);
45
+ overlayRef(ref: any): void;
46
+ openPopover(): void;
47
+ closePopover(): void;
48
+ handleDelete(e: React.UIEvent<any> | void): void;
49
+ handleSwitchChange(checked: boolean): void;
50
+ handleSubmit(values: any, action: any): void;
51
+ handleAction(e: React.UIEvent<any> | void, action: Action, data: object, throwErrors?: boolean, delegate?: IScopedContext): void;
52
+ renderPopover(): JSX.Element;
53
+ render(): JSX.Element;
54
+ }
55
+ export declare class PopoverEditRenderer extends PopoverEdit {
56
+ }
57
+ export {};
@@ -0,0 +1,30 @@
1
+ /**
2
+ * @file 表单项校验配置
3
+ */
4
+ /// <reference types="lodash" />
5
+ import React from 'react';
6
+ import type { FormControlProps } from 'amis/lib/renderers/Form/Item';
7
+ export interface ValidationControlProps extends FormControlProps {
8
+ }
9
+ interface Rule {
10
+ label: string;
11
+ key: string;
12
+ value: boolean | string | number;
13
+ checked: boolean;
14
+ message?: string;
15
+ }
16
+ interface ValidationControlState {
17
+ rules: Array<Rule>;
18
+ }
19
+ export declare class ValidationControl extends React.Component<ValidationControlProps, ValidationControlState> {
20
+ validationRules: Record<string, string>;
21
+ constructor(props: ValidationControlProps);
22
+ transformRules(): Rule[];
23
+ normalizeRules(): import("lodash").Dictionary<boolean | Record<string, any>>;
24
+ handleAddRule(): void;
25
+ handleSubmit(values: any, action: any): void;
26
+ render(): JSX.Element;
27
+ }
28
+ export declare class ValidationControlRenderer extends ValidationControl {
29
+ }
30
+ export {};
@@ -14,6 +14,7 @@ export interface EditorProps extends PluginEventListener {
14
14
  className?: string;
15
15
  $schemaUrl?: string;
16
16
  theme?: string;
17
+ showCustomRenderersPanel?: boolean;
17
18
  amisDocHost?: string;
18
19
  /**
19
20
  * Preview 预览前可以修改配置。
@@ -0,0 +1,37 @@
1
+ /// <reference types="lodash" />
2
+ import React from 'react';
3
+ export interface AMisCodeEditorProps {
4
+ value: any;
5
+ onChange: (value: any, diff: any) => void;
6
+ onPaste?: () => void;
7
+ disabled?: boolean;
8
+ $schemaUrl?: string;
9
+ $schema?: string;
10
+ className?: string;
11
+ theme?: string;
12
+ }
13
+ export default class AMisCodeEditor extends React.Component<AMisCodeEditorProps> {
14
+ state: {
15
+ wrongSchema: string;
16
+ value: any;
17
+ contents: any;
18
+ };
19
+ lastResult: any;
20
+ toDispose: Array<() => void>;
21
+ editor: any;
22
+ monaco: any;
23
+ model: any;
24
+ decorations: any;
25
+ uri: string;
26
+ componentDidUpdate(prevProps: AMisCodeEditorProps): void;
27
+ obj2str(value: any, props: AMisCodeEditorProps): any;
28
+ str2obj(str: string): any;
29
+ emitChange: import("lodash").DebouncedFunc<() => void>;
30
+ changeJsonOptions(props?: AMisCodeEditorProps): void;
31
+ editorFactory: (containerElement: HTMLElement, monaco: any, options: any) => any;
32
+ editorDidMount: (editor: any, monaco: any) => void;
33
+ editorWillUnmount: (editor: any, monaco: any) => void;
34
+ handleChange: (value: string) => void;
35
+ handleBlur: () => Promise<void>;
36
+ render(): JSX.Element;
37
+ }
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { PanelProps } from '../../plugin';
3
+ declare type PanelStates = {
4
+ toggleCollapseFolderStatus: boolean;
5
+ };
6
+ export declare class AvailableRenderersPanel extends React.Component<PanelProps, PanelStates> {
7
+ handleSelect(key: string): void;
8
+ render(): JSX.Element;
9
+ }
10
+ export {};
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { PanelProps } from '../../plugin';
3
+ export default class CodeEditorPanel extends React.Component<PanelProps> {
4
+ handleCodePaste(): void;
5
+ render(): JSX.Element;
6
+ }
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { EditorStoreType } from '../../store/editor';
3
+ export interface ContextMenuPanelProps {
4
+ store: EditorStoreType;
5
+ }
6
+ export declare class ContextMenuPanel extends React.Component<ContextMenuPanelProps> {
7
+ render(): JSX.Element | null;
8
+ }
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import { EditorManager } from '../../manager';
3
+ import { EditorStoreType } from '../../store/editor';
4
+ import { EditorNodeType } from '../../store/node';
5
+ export interface PanelsProps {
6
+ store: EditorStoreType;
7
+ manager: EditorManager;
8
+ node: EditorNodeType | undefined;
9
+ panelItem: any;
10
+ theme?: string;
11
+ }
12
+ export declare class DrawerPanel extends React.Component<PanelsProps> {
13
+ getPopOverContainer(): HTMLElement;
14
+ render(): JSX.Element;
15
+ }
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import { EditorManager } from '../../manager';
3
+ import { EditorStoreType } from '../../store/editor';
4
+ import { EditorNodeType } from '../../store/node';
5
+ export interface PanelsProps {
6
+ store: EditorStoreType;
7
+ manager: EditorManager;
8
+ node: EditorNodeType | undefined;
9
+ panelItem: any;
10
+ theme?: string;
11
+ }
12
+ export declare class DrawerRendererPanel extends React.Component<PanelsProps> {
13
+ getPopOverContainer(): HTMLElement;
14
+ render(): JSX.Element;
15
+ }
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { PanelProps } from '../../plugin';
3
+ export declare class InsertSubRendererPanel extends React.Component<PanelProps> {
4
+ handleLeftClick(e: React.MouseEvent): void;
5
+ handleClick(e: React.MouseEvent): void;
6
+ hadnlDBClick(e: React.MouseEvent): void;
7
+ handleInsert(): void;
8
+ handleReplace(): void;
9
+ handleCancel(): void;
10
+ render(): JSX.Element;
11
+ }
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import { EditorManager } from '../../manager';
3
+ import { EditorStoreType } from '../../store/editor';
4
+ interface LeftPanelsProps {
5
+ store: EditorStoreType;
6
+ manager: EditorManager;
7
+ theme?: string;
8
+ }
9
+ interface LeftPanelsStates {
10
+ isFixedStatus: boolean;
11
+ }
12
+ export declare class LeftPanels extends React.Component<LeftPanelsProps, LeftPanelsStates> {
13
+ constructor(props: any);
14
+ handleHidden(): void;
15
+ handleFixed(): void;
16
+ handleSelect(key: string): void;
17
+ getPopOverContainer(): HTMLElement;
18
+ render(): JSX.Element;
19
+ }
20
+ export {};
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import { PanelProps } from '../../plugin';
3
+ import { EditorNodeType } from '../../store/node';
4
+ export declare class OutlinePanel extends React.Component<PanelProps> {
5
+ state: {
6
+ curSearchElemKey: string;
7
+ };
8
+ handleClick(e: React.MouseEvent<HTMLAnchorElement>): void;
9
+ handleEnter(e: React.MouseEvent): void;
10
+ handleDragStart(e: React.DragEvent): void;
11
+ handleDragOver(e: React.DragEvent): void;
12
+ handleDrop(e: React.DragEvent): void;
13
+ handleSearchElemKeyChange(searchVal: string): void;
14
+ clearSearchElemKey(): void;
15
+ renderTitleByKeyword(rendererTitle: string, curSearchTitle: string): string | JSX.Element;
16
+ renderItem(option: EditorNodeType, index: number): JSX.Element | null;
17
+ render(): JSX.Element;
18
+ }
@@ -0,0 +1,32 @@
1
+ import React from 'react';
2
+ import { EditorStoreType } from '../../store/editor';
3
+ import { EditorManager } from '../../manager';
4
+ import { SubRendererInfo } from '../../plugin';
5
+ declare type PanelProps = {
6
+ store: EditorStoreType;
7
+ manager: EditorManager;
8
+ groupedRenderers: {
9
+ [propName: string]: Array<SubRendererInfo>;
10
+ };
11
+ renderersPanelUUID: string;
12
+ isShowSearchRenderer?: boolean;
13
+ className?: string;
14
+ };
15
+ declare type PanelStates = {
16
+ toggleCollapseFolderStatus: boolean;
17
+ };
18
+ export default class RenderersPanel extends React.Component<PanelProps, PanelStates> {
19
+ state: {
20
+ toggleCollapseFolderStatus: boolean;
21
+ };
22
+ curCollapseFolded: {
23
+ [propName: string]: boolean;
24
+ };
25
+ handleRegionFilterClick(e: React.MouseEvent): void;
26
+ handleDragStart(e: React.DragEvent): void;
27
+ handleClick(e: React.MouseEvent): void;
28
+ changeCollapseFoldStatus(tagKey: string, event: any): void;
29
+ renderThumb(schema: any): JSX.Element;
30
+ render(): JSX.Element;
31
+ }
32
+ export {};
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import { EditorManager } from '../../manager';
3
+ import { EditorStoreType } from '../../store/editor';
4
+ interface RightPanelsProps {
5
+ store: EditorStoreType;
6
+ manager: EditorManager;
7
+ theme?: string;
8
+ }
9
+ interface RightPanelsStates {
10
+ isOpenStatus: boolean;
11
+ isFixedStatus: boolean;
12
+ }
13
+ export declare class RightPanels extends React.Component<RightPanelsProps, RightPanelsStates> {
14
+ constructor(props: any);
15
+ handleFixed(): void;
16
+ handleSelect(key: string): void;
17
+ handleHidden(): void;
18
+ getPopOverContainer(): HTMLElement;
19
+ render(): JSX.Element | null;
20
+ }
21
+ export {};
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { PanelProps } from '../../plugin';
3
+ export declare class TargetNamePanel extends React.Component<PanelProps> {
4
+ handleClick(e: React.MouseEvent<HTMLElement>): void;
5
+ handleEnter(e: React.MouseEvent<HTMLElement>): void;
6
+ render(): JSX.Element;
7
+ }
@@ -33,6 +33,7 @@ export default class Preview extends Component<PreviewProps> {
33
33
  getHighlightNodes(): string[];
34
34
  calculateHighlightBox(ids: Array<string>): void;
35
35
  handeMouseDown(e: MouseEvent): void;
36
+ /** 拖拽多选 */
36
37
  doSelection(rect: {
37
38
  x: number;
38
39
  y: number;
@@ -14,7 +14,7 @@ export declare class ScaffoldModal extends React.Component<SubEditorProps> {
14
14
  wrapWithPanel: boolean;
15
15
  initApi: any;
16
16
  api: any;
17
- mode: "normal" | "inline" | "horizontal";
17
+ mode: "normal" | "horizontal" | "inline";
18
18
  wrapperComponent: string;
19
19
  };
20
20
  amisScope: any;
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ export interface BackTopProps {
3
+ visibilityHeight?: number;
4
+ onClick?: React.MouseEventHandler<HTMLElement>;
5
+ target: () => HTMLElement | Window | Document;
6
+ children?: React.ReactNode;
7
+ className?: string;
8
+ visible?: boolean;
9
+ }
10
+ export interface BackTopStates {
11
+ visible: boolean;
12
+ }
13
+ export default class BackTop extends React.Component<BackTopProps, BackTopStates> {
14
+ ref: React.RefObject<HTMLDivElement>;
15
+ scrollElem: any;
16
+ constructor(props: any);
17
+ componentDidMount(): void;
18
+ componentWillUnmount(): void;
19
+ getDefaultTarget(): Document | (Window & typeof globalThis);
20
+ handleScroll(e: React.UIEvent<HTMLElement> | {
21
+ target: any;
22
+ }): void;
23
+ bindScrollEvent(): void;
24
+ scrollToTop(e: React.MouseEvent<HTMLDivElement>): void;
25
+ render(): JSX.Element;
26
+ }
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ export declare class ErrorRenderer extends React.Component<any> {
3
+ render(): JSX.Element;
4
+ }
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import { RendererProps } from 'amis/lib/factory';
3
+ interface InputComponentNameProps extends RendererProps {
4
+ value: any;
5
+ onChange: (value: any) => void;
6
+ }
7
+ export declare function InputComponentName(props: InputComponentNameProps): JSX.Element;
8
+ export {};
@@ -0,0 +1,59 @@
1
+ import React from 'react';
2
+ import { EditorStoreType } from '../../store/editor';
3
+ import { SubRendererInfo } from '../../plugin';
4
+ interface SearchRendererProps {
5
+ store: EditorStoreType;
6
+ }
7
+ interface SearchRendererStates {
8
+ subRenderersByOrder: Array<SubRendererInfo>;
9
+ groupedSubRenderers: {
10
+ [propName: string]: Array<SubRendererInfo>;
11
+ };
12
+ searchSubRenderers: {
13
+ [propName: string]: Array<SubRendererInfo>;
14
+ };
15
+ visible: boolean;
16
+ curKeyword: string;
17
+ curKeywordSearchHistory: string[];
18
+ toggleTagFolderStatus: boolean;
19
+ }
20
+ export default class SearchRendererPanel extends React.Component<SearchRendererProps, SearchRendererStates> {
21
+ ref: React.RefObject<HTMLDivElement>;
22
+ curInputBox: any;
23
+ localStorageKey: string;
24
+ curTagFolded: {
25
+ [propName: string]: boolean;
26
+ };
27
+ lastSubRenderersTag: string;
28
+ constructor(props: any);
29
+ componentDidMount(): void;
30
+ componentWillReceiveProps(nextProps: any): void;
31
+ componentWillUnmount(): void;
32
+ bindFocusEvent(): void;
33
+ bindBlurEvent(): void;
34
+ updateCurKeyword(keywords: string): void;
35
+ searchSubRenderersByKeyword(): void;
36
+ changeTagFoldStatus(tagKey: string, event: any): void;
37
+ bindEnterEvent(event: any): void;
38
+ /** 删除搜索关键字 */
39
+ bindClearActionEvent(): void;
40
+ /** 组件分类tag点击事件 */
41
+ bindTagClickEvent(tag: string): void;
42
+ getSearchHistory(): any[];
43
+ /** 添加搜索历史 */
44
+ addSearchHistory(newKeywords: string): void;
45
+ /** 搜索历史/点击 */
46
+ clickKeywordEvent(keywords: string): void;
47
+ deleteSearchHistory(event: any, newKeywords: string): void;
48
+ clearSearchHistory(event: any): void;
49
+ /** 将搜索记录保存到localStorage */
50
+ updateSearchHistory(): void;
51
+ /** 显示搜索关键字 */
52
+ renderNameByKeyword(rendererName: string, curKeyword: string): string | JSX.Element;
53
+ /** 判断搜索展示内容是否有滚动(交互优化) */
54
+ resultIsHasScroll(searchSubRenderers: {
55
+ [propName: string]: Array<SubRendererInfo>;
56
+ }, maxShowLine: number): boolean;
57
+ render(): JSX.Element;
58
+ }
59
+ export {};
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ interface WidthDraggableProps {
3
+ isLeftDragIcon?: boolean;
4
+ className?: any;
5
+ }
6
+ export declare class WidthDraggableBtn extends React.Component<WidthDraggableProps> {
7
+ startX: number;
8
+ startWidth: number;
9
+ dragWrap: HTMLElement;
10
+ constructor(props: any);
11
+ handleResizeMouseDown(e: React.MouseEvent): void;
12
+ handleResizeMouseMove(e: MouseEvent): void;
13
+ handleResizeMouseUp(): void;
14
+ render(): JSX.Element;
15
+ }
16
+ export {};
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export default function (NeedWidthDraggableComp: React.ComponentType, isLeftDragIcon?: boolean): React.ComponentType;