amis-editor 4.0.1-beta.9 → 4.0.2-beta.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (179) hide show
  1. package/dist/cebfe0bc5a1dbde02da1.svg +10 -0
  2. package/dist/component/Control/APIControl.d.ts +504 -0
  3. package/dist/component/Control/OptionControl.d.ts +163 -0
  4. package/dist/component/Control/PopoverEdit.d.ts +57 -0
  5. package/dist/component/Control/ValidationControl.d.ts +30 -0
  6. package/dist/component/Editor.d.ts +1 -0
  7. package/dist/component/{CodeEditor.d.ts → Panel/AMisCodeEditor.d.ts} +1 -1
  8. package/dist/component/Panel/AvailableRenderersPanel.d.ts +10 -0
  9. package/dist/component/Panel/CodeEditorPanel.d.ts +6 -0
  10. package/dist/component/Panel/ContextMenuPanel.d.ts +8 -0
  11. package/dist/component/Panel/DrawerPanel.d.ts +15 -0
  12. package/dist/component/Panel/DrawerRendererPanel.d.ts +15 -0
  13. package/dist/component/{InsertSubRendererPanel.d.ts → Panel/InsertSubRendererPanel.d.ts} +1 -1
  14. package/dist/component/Panel/LeftPanels.d.ts +20 -0
  15. package/dist/component/{Outline.d.ts → Panel/Outline.d.ts} +2 -2
  16. package/dist/component/{AvailableRenderersPanel.d.ts → Panel/RenderersPanel.d.ts} +14 -2
  17. package/dist/component/Panel/RightPanels.d.ts +21 -0
  18. package/dist/component/{TargetNamePanel.d.ts → Panel/TargetNamePanel.d.ts} +1 -1
  19. package/dist/component/Preview.d.ts +1 -0
  20. package/dist/component/ScaffoldModal.d.ts +1 -1
  21. package/dist/component/{BackTop.d.ts → base/BackTop.d.ts} +1 -1
  22. package/dist/component/{ErrorRenderer.d.ts → base/ErrorRenderer.d.ts} +0 -0
  23. package/dist/component/base/InputComponentName.d.ts +8 -0
  24. package/dist/component/base/SearchRendererPanel.d.ts +59 -0
  25. package/dist/component/base/WidthDraggableBtn.d.ts +16 -0
  26. package/dist/component/base/WidthDraggableContainer.d.ts +2 -0
  27. package/dist/component/remarkTpl.d.ts +150 -0
  28. package/dist/exports.d.ts +8 -0
  29. package/dist/exports.min.js +1 -0
  30. package/dist/index.d.ts +20 -14
  31. package/dist/index.min.js +1 -1
  32. package/dist/manager.d.ts +7 -5
  33. package/dist/plugin/Alert.d.ts +2 -1
  34. package/dist/plugin/AnchorNav.d.ts +1 -0
  35. package/dist/plugin/Audio.d.ts +1 -0
  36. package/dist/plugin/Avatar.d.ts +1 -0
  37. package/dist/plugin/Breadcrumb.d.ts +2 -0
  38. package/dist/plugin/Button.d.ts +1 -0
  39. package/dist/plugin/ButtonGroup.d.ts +1 -0
  40. package/dist/plugin/ButtonToolbar.d.ts +1 -0
  41. package/dist/plugin/CRUD.d.ts +1 -0
  42. package/dist/plugin/Card.d.ts +1 -1
  43. package/dist/plugin/Cards.d.ts +1 -0
  44. package/dist/plugin/Carousel.d.ts +1 -0
  45. package/dist/plugin/Chart.d.ts +1 -0
  46. package/dist/plugin/CodeView.d.ts +1 -0
  47. package/dist/plugin/Collapse.d.ts +16 -6
  48. package/dist/plugin/CollapseGroup.d.ts +41 -0
  49. package/dist/plugin/Container.d.ts +1 -0
  50. package/dist/plugin/Custom.d.ts +1 -0
  51. package/dist/plugin/Date.d.ts +1 -0
  52. package/dist/plugin/Datetime.d.ts +1 -0
  53. package/dist/plugin/Dialog.d.ts +1 -0
  54. package/dist/plugin/Divider.d.ts +1 -0
  55. package/dist/plugin/Drawer.d.ts +1 -0
  56. package/dist/plugin/DropDownButton.d.ts +2 -0
  57. package/dist/plugin/Each.d.ts +1 -0
  58. package/dist/plugin/ErrorRenderer.d.ts +1 -0
  59. package/dist/plugin/Flex.d.ts +2 -1
  60. package/dist/plugin/Form/ButtonGroupSelect.d.ts +1 -0
  61. package/dist/plugin/Form/ButtonToolbar.d.ts +1 -0
  62. package/dist/plugin/Form/ChainedSelect.d.ts +1 -0
  63. package/dist/plugin/Form/Checkbox.d.ts +1 -0
  64. package/dist/plugin/Form/Checkboxes.d.ts +1 -0
  65. package/dist/plugin/Form/{Editor.d.ts → CodeEditor.d.ts} +2 -1
  66. package/dist/plugin/Form/Combo.d.ts +2 -1
  67. package/dist/plugin/Form/ConditionBuilder.d.ts +1 -0
  68. package/dist/plugin/Form/Control.d.ts +1 -0
  69. package/dist/plugin/Form/DiffEditor.d.ts +1 -0
  70. package/dist/plugin/Form/FieldSet.d.ts +1 -0
  71. package/dist/plugin/Form/Form.d.ts +1 -0
  72. package/dist/plugin/Form/Formula.d.ts +1 -0
  73. package/dist/plugin/Form/Group.d.ts +1 -0
  74. package/dist/plugin/Form/Hidden.d.ts +1 -0
  75. package/dist/plugin/Form/InputArray.d.ts +2 -0
  76. package/dist/plugin/Form/InputCity.d.ts +1 -0
  77. package/dist/plugin/Form/InputColor.d.ts +1 -0
  78. package/dist/plugin/Form/InputDate.d.ts +1 -0
  79. package/dist/plugin/Form/InputDateRange.d.ts +1 -0
  80. package/dist/plugin/Form/InputDateTime.d.ts +1 -0
  81. package/dist/plugin/Form/InputDateTimeRange.d.ts +1 -0
  82. package/dist/plugin/Form/InputEmail.d.ts +1 -0
  83. package/dist/plugin/Form/InputExcel.d.ts +1 -0
  84. package/dist/plugin/Form/InputFile.d.ts +1 -0
  85. package/dist/plugin/Form/InputGroup.d.ts +1 -2
  86. package/dist/plugin/Form/InputImage.d.ts +1 -0
  87. package/dist/plugin/Form/InputKV.d.ts +1 -0
  88. package/dist/plugin/Form/InputMonth.d.ts +1 -0
  89. package/dist/plugin/Form/InputMonthRange.d.ts +1 -0
  90. package/dist/plugin/Form/InputNumber.d.ts +1 -0
  91. package/dist/plugin/Form/InputPassword.d.ts +1 -0
  92. package/dist/plugin/Form/InputQuarter.d.ts +1 -0
  93. package/dist/plugin/Form/InputQuarterRange.d.ts +1 -0
  94. package/dist/plugin/Form/InputRange.d.ts +1 -0
  95. package/dist/plugin/Form/InputRating.d.ts +2 -1
  96. package/dist/plugin/Form/InputRepeat.d.ts +1 -0
  97. package/dist/plugin/Form/InputRichText.d.ts +1 -0
  98. package/dist/plugin/Form/InputSubForm.d.ts +1 -0
  99. package/dist/plugin/Form/InputTable.d.ts +1 -1
  100. package/dist/plugin/Form/InputTag.d.ts +1 -0
  101. package/dist/plugin/Form/InputText.d.ts +1 -0
  102. package/dist/plugin/Form/InputTime.d.ts +1 -0
  103. package/dist/plugin/Form/InputTree.d.ts +1 -0
  104. package/dist/plugin/Form/InputURL.d.ts +1 -0
  105. package/dist/plugin/Form/InputYear.d.ts +1 -0
  106. package/dist/plugin/Form/ListSelect.d.ts +1 -0
  107. package/dist/plugin/Form/LocationPicker.d.ts +1 -0
  108. package/dist/plugin/Form/MatrixCheckboxes.d.ts +1 -0
  109. package/dist/plugin/Form/NestedSelect.d.ts +1 -0
  110. package/dist/plugin/Form/Picker.d.ts +1 -0
  111. package/dist/plugin/Form/Radios.d.ts +1 -0
  112. package/dist/plugin/Form/Select.d.ts +1 -0
  113. package/dist/plugin/Form/Static.d.ts +1 -1
  114. package/dist/plugin/Form/Switch.d.ts +1 -0
  115. package/dist/plugin/Form/TabsTransfer.d.ts +1 -0
  116. package/dist/plugin/Form/Textarea.d.ts +1 -0
  117. package/dist/plugin/Form/Transfer.d.ts +1 -0
  118. package/dist/plugin/Form/TreeSelect.d.ts +1 -0
  119. package/dist/plugin/Form/UUID.d.ts +1 -0
  120. package/dist/plugin/Grid.d.ts +1 -0
  121. package/dist/plugin/HBox.d.ts +1 -1
  122. package/dist/plugin/IFrame.d.ts +1 -0
  123. package/dist/plugin/Image.d.ts +1 -0
  124. package/dist/plugin/Images.d.ts +1 -0
  125. package/dist/plugin/Json.d.ts +1 -0
  126. package/dist/plugin/Link.d.ts +1 -0
  127. package/dist/plugin/List.d.ts +1 -0
  128. package/dist/plugin/ListItem.d.ts +1 -1
  129. package/dist/plugin/Log.d.ts +1 -0
  130. package/dist/plugin/Mapping.d.ts +1 -0
  131. package/dist/plugin/Markdown.d.ts +1 -0
  132. package/dist/plugin/Nav.d.ts +1 -0
  133. package/dist/plugin/Operation.d.ts +1 -0
  134. package/dist/plugin/Others/Action.d.ts +8 -0
  135. package/dist/plugin/{BasicToolbar.d.ts → Others/BasicToolbar.d.ts} +1 -1
  136. package/dist/plugin/{DataDebug.d.ts → Others/DataDebug.d.ts} +1 -1
  137. package/dist/plugin/{TableCell.d.ts → Others/TableCell.d.ts} +1 -2
  138. package/dist/plugin/{Unknown.d.ts → Others/Unknown.d.ts} +1 -1
  139. package/dist/plugin/Page.d.ts +1 -0
  140. package/dist/plugin/{AvailableRenderers.d.ts → Panel/AvailableRenderers.d.ts} +1 -1
  141. package/dist/plugin/{Code.d.ts → Panel/Code.d.ts} +1 -1
  142. package/dist/plugin/{Name.d.ts → Panel/Name.d.ts} +1 -1
  143. package/dist/plugin/Panel.d.ts +16 -3
  144. package/dist/plugin/Plain.d.ts +1 -0
  145. package/dist/plugin/Progress.d.ts +1 -0
  146. package/dist/plugin/Property.d.ts +1 -0
  147. package/dist/plugin/QRCode.d.ts +1 -0
  148. package/dist/plugin/Reset.d.ts +1 -0
  149. package/dist/plugin/Service.d.ts +1 -0
  150. package/dist/plugin/Sparkline.d.ts +1 -0
  151. package/dist/plugin/Status.d.ts +1 -0
  152. package/dist/plugin/Steps.d.ts +1 -0
  153. package/dist/plugin/Submit.d.ts +1 -0
  154. package/dist/plugin/Table.d.ts +1 -0
  155. package/dist/plugin/TableView.d.ts +1 -0
  156. package/dist/plugin/Tabs.d.ts +1 -0
  157. package/dist/plugin/Tasks.d.ts +1 -0
  158. package/dist/plugin/Time.d.ts +1 -0
  159. package/dist/plugin/TooltipWrapper.d.ts +29 -0
  160. package/dist/plugin/Tpl.d.ts +1 -0
  161. package/dist/plugin/Video.d.ts +1 -0
  162. package/dist/plugin/WebComponent.d.ts +3 -26
  163. package/dist/plugin/Wizard.d.ts +1 -0
  164. package/dist/plugin/Wrapper.d.ts +1 -0
  165. package/dist/plugin.d.ts +20 -5
  166. package/dist/store/editor.d.ts +58 -4
  167. package/dist/style.css +1 -1
  168. package/dist/util.d.ts +7 -2
  169. package/package.json +24 -16
  170. package/static/side_hide_left.svg +10 -0
  171. package/.editorconfig +0 -12
  172. package/.fecsrc +0 -8
  173. package/.prettierrc +0 -20
  174. package/dist/component/CodeEditorPanel.d.ts +0 -12
  175. package/dist/component/InputComponentName.d.ts +0 -8
  176. package/dist/component/Panels.d.ts +0 -17
  177. package/dist/plugin/Action.d.ts +0 -6
  178. package/publish-local.sh +0 -37
  179. package/rollup.config.js +0 -24
@@ -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 预览前可以修改配置。
@@ -10,7 +10,7 @@ export interface AMisCodeEditorProps {
10
10
  className?: string;
11
11
  theme?: string;
12
12
  }
13
- export default class AMisCodeEditor extends React.Component<AMisCodeEditorProps, any> {
13
+ export default class AMisCodeEditor extends React.Component<AMisCodeEditorProps> {
14
14
  state: {
15
15
  wrongSchema: string;
16
16
  value: any;
@@ -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
+ }
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { PanelProps } from '../plugin';
2
+ import { PanelProps } from '../../plugin';
3
3
  export declare class InsertSubRendererPanel extends React.Component<PanelProps> {
4
4
  handleLeftClick(e: React.MouseEvent): void;
5
5
  handleClick(e: React.MouseEvent): void;
@@ -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 {};
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { PanelProps } from '../plugin';
3
- import { EditorNodeType } from '../store/node';
2
+ import { PanelProps } from '../../plugin';
3
+ import { EditorNodeType } from '../../store/node';
4
4
  export declare class OutlinePanel extends React.Component<PanelProps> {
5
5
  state: {
6
6
  curSearchElemKey: string;
@@ -1,9 +1,21 @@
1
1
  import React from 'react';
2
- import { PanelProps } from '../plugin';
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
+ };
3
15
  declare type PanelStates = {
4
16
  toggleCollapseFolderStatus: boolean;
5
17
  };
6
- export declare class AvailableRenderersPanel extends React.Component<PanelProps, PanelStates> {
18
+ export default class RenderersPanel extends React.Component<PanelProps, PanelStates> {
7
19
  state: {
8
20
  toggleCollapseFolderStatus: boolean;
9
21
  };
@@ -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 {};
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { PanelProps } from '../plugin';
2
+ import { PanelProps } from '../../plugin';
3
3
  export declare class TargetNamePanel extends React.Component<PanelProps> {
4
4
  handleClick(e: React.MouseEvent<HTMLElement>): void;
5
5
  handleEnter(e: React.MouseEvent<HTMLElement>): void;
@@ -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;
@@ -16,7 +16,7 @@ export default class BackTop extends React.Component<BackTopProps, BackTopStates
16
16
  constructor(props: any);
17
17
  componentDidMount(): void;
18
18
  componentWillUnmount(): void;
19
- getDefaultTarget(): (Window & typeof globalThis) | Document;
19
+ getDefaultTarget(): Document | (Window & typeof globalThis);
20
20
  handleScroll(e: React.UIEvent<HTMLElement> | {
21
21
  target: any;
22
22
  }): void;
@@ -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;
@@ -0,0 +1,150 @@
1
+ /**
2
+ * @description 信息提示组件模版
3
+ * @file src/component/remarkTpl.tsx
4
+ * @author hanxiao11@baidu.com
5
+ */
6
+ export default function remarkTpl(config: {
7
+ name: 'remark' | 'labelRemark';
8
+ label: string;
9
+ }): {
10
+ type: string;
11
+ label: string;
12
+ mode: string;
13
+ className: string;
14
+ labelRemark: {
15
+ icon: string;
16
+ trigger: string[];
17
+ setting: boolean;
18
+ title: string;
19
+ content: string;
20
+ placement: string;
21
+ };
22
+ body: {
23
+ type: string;
24
+ className: string;
25
+ body: ({
26
+ type: string;
27
+ name: "remark" | "labelRemark";
28
+ label: string;
29
+ btnLabel: string;
30
+ visibleOn: string;
31
+ className: string;
32
+ itemClassName: string;
33
+ icon: string;
34
+ form: {
35
+ title: string;
36
+ mode: string;
37
+ size: string;
38
+ body: {
39
+ type: string;
40
+ columns: ({
41
+ md: string;
42
+ body: ({
43
+ name: string;
44
+ type: string;
45
+ label: string;
46
+ placeholder: string;
47
+ } | {
48
+ name: string;
49
+ type: string;
50
+ label: string;
51
+ placeholder?: undefined;
52
+ })[];
53
+ } | {
54
+ md: string;
55
+ body: ({
56
+ name: string;
57
+ type: string;
58
+ size: string;
59
+ label: string;
60
+ options: {
61
+ label: string;
62
+ value: string;
63
+ }[];
64
+ labelRemark?: undefined;
65
+ multiple?: undefined;
66
+ pipeIn?: undefined;
67
+ pipeOut?: undefined;
68
+ visibleOn?: undefined;
69
+ } | {
70
+ name: string;
71
+ label: string;
72
+ type: string;
73
+ size?: undefined;
74
+ options?: undefined;
75
+ labelRemark?: undefined;
76
+ multiple?: undefined;
77
+ pipeIn?: undefined;
78
+ pipeOut?: undefined;
79
+ visibleOn?: undefined;
80
+ } | {
81
+ name: string;
82
+ label: string;
83
+ type: string;
84
+ labelRemark: {
85
+ trigger: string;
86
+ className: string;
87
+ rootClose: boolean;
88
+ content: string;
89
+ placement: string;
90
+ };
91
+ size?: undefined;
92
+ options?: undefined;
93
+ multiple?: undefined;
94
+ pipeIn?: undefined;
95
+ pipeOut?: undefined;
96
+ visibleOn?: undefined;
97
+ } | {
98
+ name: string;
99
+ type: string;
100
+ label: string;
101
+ multiple: boolean;
102
+ pipeIn: (value: any) => string | never[];
103
+ pipeOut: (value: any) => any;
104
+ options: {
105
+ label: string;
106
+ value: string;
107
+ }[];
108
+ size?: undefined;
109
+ labelRemark?: undefined;
110
+ visibleOn?: undefined;
111
+ } | {
112
+ name: string;
113
+ visibleOn: string;
114
+ label: string;
115
+ type: string;
116
+ size?: undefined;
117
+ options?: undefined;
118
+ labelRemark?: undefined;
119
+ multiple?: undefined;
120
+ pipeIn?: undefined;
121
+ pipeOut?: undefined;
122
+ })[];
123
+ })[];
124
+ };
125
+ };
126
+ mode?: undefined;
127
+ pipeIn?: undefined;
128
+ pipeOut?: undefined;
129
+ } | {
130
+ type: string;
131
+ name: "remark" | "labelRemark";
132
+ mode: string;
133
+ pipeIn: (value: any) => boolean;
134
+ pipeOut: (value: any) => {
135
+ icon: string;
136
+ trigger: string[];
137
+ className: string;
138
+ setting: boolean;
139
+ placement: string;
140
+ } | null;
141
+ label?: undefined;
142
+ btnLabel?: undefined;
143
+ visibleOn?: undefined;
144
+ className?: undefined;
145
+ itemClassName?: undefined;
146
+ icon?: undefined;
147
+ form?: undefined;
148
+ })[];
149
+ }[];
150
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * 用于导出纯工具类方法
3
+ * 比如:BasePlugin、registerEditorPlugin
4
+ */
5
+ import { BasePlugin } from './plugin';
6
+ import { registerEditorPlugin, unRegisterEditorPlugin, getEditorPlugins } from './manager';
7
+ import { getSchemaTpl, defaultValue, setSchemaTpl } from './component/schemaTpl';
8
+ export { BasePlugin, getSchemaTpl, setSchemaTpl, defaultValue, registerEditorPlugin, unRegisterEditorPlugin, getEditorPlugins };