Github https://github.com/alibaba/designable
在线表单设计器 https://designable-antd.formilyjs.org
designable 在线案例 https://designable.netlify.app

  • @designable/core
  • @designable/react
  • @designable/react-settings-form
  • @designable/shared
  • @designable/formily-antd
  • @designable/formily-setters
  • @designable/formily-transformer

https://juejin.cn/post/7080512202314088478

designable 和 formily的区别

  • designable 可视化搭建配置,只专注于设计器引擎
    • designable 不负责包装产品,定位更像一个 library,尽可能的优化设计器的各种设计能力
    • 上层产品如何封装,是用户自己发挥的
  • formily 表单引擎
    • jsx
    • json schema
    • jsx & schema,schema 与 field 并存
  • designable 将 formily的 JSONSchema可视化,可以解析 designable拖拽生成的 JSON
  • lowcode-engine 是打包型的产品,designable 是设计器引擎,聚焦点不一样

designable 的核心理念是将设计器搭建变成模块化组合,一切可替换,

  • designable 本身是不会提供任何插槽 Plugin 相关的 API
  • 如果用户对组件不满意,可以直接替换组件,从而实现最大化灵活定制
  • designable二次开发表单设计器好用的原型;但没有任何说明文档,基于源码,而不是规范,你要去案例,和源码里面找相关的方法和属性
  • 设计器内部不会对任何业务模块的依赖,开发自定义组件是表单设计器的核心工作

antd5

designable目前只支持 antd4.x,不支持 5x

只是 formily/antd 版本不一样

  1. # antd4x 依赖 moment
  2. yarn add antd moment
  3. yarn add @formily/core @formily/react @formily/antd
  4. # antd5x 依赖 dayjs
  5. yarn add antd dayjs
  6. yarn add @formily/core @formily/react @formily/antd-v5

@designable/core

63个方法

  1. [
  2. "AddWorkspaceEvent",
  3. "AppendNodeEvent",
  4. "CloneNodeEvent",
  5. "ClosestPosition",
  6. "createBehavior",
  7. "createDesigner",
  8. "createLocales",
  9. "createResource",
  10. "Cursor",
  11. "CursorStatus",
  12. "CursorType",
  13. "DragMoveEvent",
  14. "DragNodeEvent",
  15. "Dragon",
  16. "DragStartEvent",
  17. "DragStopEvent",
  18. "DropNodeEvent",
  19. "Engine",
  20. "FromNodeEvent",
  21. "GlobalRegistry",
  22. "History",
  23. "HistoryGotoEvent",
  24. "HistoryPushEvent",
  25. "HistoryRedoEvent",
  26. "HistoryUndoEvent",
  27. "HoverNodeEvent",
  28. "InsertAfterEvent",
  29. "InsertBeforeEvent",
  30. "InsertChildrenEvent",
  31. "isBehavior",
  32. "isBehaviorHost",
  33. "isBehaviorList",
  34. "isResource",
  35. "isResourceHost",
  36. "isResourceList",
  37. "Keyboard",
  38. "KeyCode",
  39. "KeyDownEvent",
  40. "KeyUpEvent",
  41. "MouseClickEvent",
  42. "MouseDoubleClickEvent",
  43. "MouseMoveEvent",
  44. "Operation",
  45. "PrependNodeEvent",
  46. "RemoveNodeEvent",
  47. "RemoveWorkspaceEvent",
  48. "Screen",
  49. "ScreenStatus",
  50. "ScreenType",
  51. "Selection",
  52. "SelectNodeEvent",
  53. "Shortcut",
  54. "SwitchWorkspaceEvent",
  55. "TreeNode",
  56. "UnSelectNodeEvent",
  57. "UpdateChildrenEvent",
  58. "UpdateNodePropsEvent",
  59. "Viewport",
  60. "ViewportResizeEvent",
  61. "ViewportScrollEvent",
  62. "Workbench",
  63. "Workspace",
  64. "WrapNodeEvent"
  65. ]

@designable/react

63个方法

  1. [
  2. "AuxToolWidget",
  3. "ComponentTreeWidget",
  4. "CompositePanel",
  5. "Designer",
  6. "DesignerComponentsContext",
  7. "DesignerEngineContext",
  8. "DesignerLayoutContext",
  9. "DesignerToolsWidget",
  10. "DroppableWidget",
  11. "EmptyWidget",
  12. "GhostWidget",
  13. "HistoryWidget",
  14. "IconWidget",
  15. "Layout",
  16. "MobileSimulator",
  17. "NodeActionsWidget",
  18. "NodePathWidget",
  19. "NodeTitleWidget",
  20. "OutlineTreeWidget",
  21. "PCSimulator",
  22. "ResourceWidget",
  23. "ResponsiveSimulator",
  24. "SettingsPanel",
  25. "Simulator",
  26. "StudioPanel",
  27. "TextWidget",
  28. "ToolbarPanel",
  29. "TreeNodeContext",
  30. "TreeNodeWidget",
  31. "useComponents",
  32. "useCurrentNode",
  33. "useCurrentNodeSelected",
  34. "useCursor",
  35. "useDesigner",
  36. "useDragon",
  37. "useHistory",
  38. "useHover",
  39. "useLayout",
  40. "useNodeIdProps",
  41. "useOperation",
  42. "useOutline",
  43. "useOutlineDragon",
  44. "usePosition",
  45. "usePrefix",
  46. "useRegistry",
  47. "useScreen",
  48. "useSelected",
  49. "useSelection",
  50. "useTheme",
  51. "useTree",
  52. "useTreeNode",
  53. "useValidNodeOffsetRect",
  54. "useViewport",
  55. "useWorkbench",
  56. "useWorkspace",
  57. "ViewPanel",
  58. "Viewport",
  59. "ViewportPanel",
  60. "ViewToolsWidget",
  61. "Workbench",
  62. "Workspace",
  63. "WorkspaceContext",
  64. "WorkspacePanel"
  65. ]

@designable/shared

  1. [
  2. "calcAutoScrollBasicInfo",
  3. "calcBoundingRect",
  4. "calcDistanceOfPointToRect",
  5. "calcDistancePointToEdge",
  6. "calcElementLayout",
  7. "calcElementOuterWidth",
  8. "calcQuadrantOfPointToRect",
  9. "calcRectByStartEndPoint",
  10. "calcRelativeOfPointToRect",
  11. "calcSpeedFactor",
  12. "cancelIdle",
  13. "clone",
  14. "compose",
  15. "createUniformSpeedAnimation",
  16. "each",
  17. "Event",
  18. "EventDriver",
  19. "every",
  20. "find",
  21. "findIndex",
  22. "flat",
  23. "getKeyCodeFromEvent",
  24. "getRectPoints",
  25. "getType",
  26. "globalThisPolyfill",
  27. "includes",
  28. "includesWith",
  29. "instOf",
  30. "isArr",
  31. "isBool",
  32. "isCrossRectInRect",
  33. "isFn",
  34. "isHTMLElement",
  35. "isNearAfter",
  36. "isNum",
  37. "isObj",
  38. "isPlainObj",
  39. "isPointInRect",
  40. "isRectInRect",
  41. "isRegExp",
  42. "isStr",
  43. "isValid",
  44. "isWindow",
  45. "KeyCode",
  46. "LRUMap",
  47. "map",
  48. "Point",
  49. "RectQuadrant",
  50. "reduce",
  51. "requestIdle",
  52. "scrollAnimate",
  53. "shallowClone",
  54. "some",
  55. "Subscribable",
  56. "toArr",
  57. "uid",
  58. "updateScrollValue"
  59. ]

@designable/react-settings-form

26个方法

  1. [
  2. "BackgroundImageInput",
  3. "BackgroundSizeInput",
  4. "BackgroundStyleSetter",
  5. "BorderRadiusStyleSetter",
  6. "BorderStyleSetter",
  7. "BoxShadowStyleSetter",
  8. "BoxStyleSetter",
  9. "CollapseItem",
  10. "ColorInput",
  11. "CornerInput",
  12. "createPolyInput",
  13. "DisplayStyleSetter",
  14. "DrawerSetter",
  15. "FlexStyleSetter",
  16. "FoldItem",
  17. "FontStyleSetter",
  18. "getNpmCDNRegistry",
  19. "ImageInput",
  20. "InputItems",
  21. "MonacoInput",
  22. "PositionInput",
  23. "SchemaField",
  24. "setNpmCDNRegistry",
  25. "SettingsForm",
  26. "SizeInput",
  27. "ValueInput"
  28. ]

@designable/formily-antd

32个方法

  1. [
  2. "AllLocales",
  3. "AllSchemas",
  4. "ArrayCards",
  5. "ArrayTable",
  6. "Card",
  7. "Cascader",
  8. "Checkbox",
  9. "createComponentSchema",
  10. "createFieldSchema",
  11. "createVoidFieldSchema",
  12. "DatePicker",
  13. "Field",
  14. "Form",
  15. "FormCollapse",
  16. "FormGrid",
  17. "FormLayout",
  18. "FormTab",
  19. "Input",
  20. "NumberPicker",
  21. "ObjectContainer",
  22. "Password",
  23. "Radio",
  24. "Rate",
  25. "Select",
  26. "Slider",
  27. "Space",
  28. "Switch",
  29. "Text",
  30. "TimePicker",
  31. "Transfer",
  32. "TreeSelect",
  33. "Upload"
  34. ]

@designable/formily-transformer

  1. [
  2. "transformToSchema",
  3. "transformToTreeNode"
  4. ]

@designable/formily-setters

  1. [
  2. "DataSourceSetter",
  3. "ReactionsSetter",
  4. "ValidatorSetter"
  5. ]