aldehyde 0.2.474 → 0.2.476
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/controls/action/utils.d.ts +1 -1
- package/lib/controls/entity-select/entity-select.d.ts +2 -2
- package/lib/controls/entity-select/entity-select.d.ts.map +1 -1
- package/lib/controls/entity-select/entity-select.js +16 -7
- package/lib/controls/entity-select/entity-select.js.map +1 -1
- package/lib/controls/entry-control.d.ts.map +1 -1
- package/lib/controls/entry-control.js +1 -0
- package/lib/controls/entry-control.js.map +1 -1
- package/lib/controls/select/index.d.ts.map +1 -1
- package/lib/controls/select/index.js +13 -7
- package/lib/controls/select/index.js.map +1 -1
- package/lib/controls/text/index.less +1 -0
- package/lib/controls/view-control.d.ts.map +1 -1
- package/lib/controls/view-control.js +1 -0
- package/lib/controls/view-control.js.map +1 -1
- package/lib/detail/button/edit-button.d.ts.map +1 -1
- package/lib/detail/button/edit-button.js +23 -11
- package/lib/detail/button/edit-button.js.map +1 -1
- package/lib/detail/button/view-button.d.ts.map +1 -1
- package/lib/detail/button/view-button.js +21 -10
- package/lib/detail/button/view-button.js.map +1 -1
- package/lib/draw-canvas-edit/components/asset-bar/index.d.ts.map +1 -0
- package/lib/{draw-canvas/edit → draw-canvas-edit}/components/asset-bar/index.js +2 -1
- package/lib/draw-canvas-edit/components/asset-bar/index.js.map +1 -0
- package/lib/{draw-canvas/edit → draw-canvas-edit}/components/main-header/index.d.ts +5 -0
- package/lib/draw-canvas-edit/components/main-header/index.d.ts.map +1 -0
- package/lib/{draw-canvas/edit → draw-canvas-edit}/components/main-header/index.js +55 -15
- package/lib/draw-canvas-edit/components/main-header/index.js.map +1 -0
- package/lib/draw-canvas-edit/components/render/draws/bg-draw.d.ts +26 -0
- package/lib/draw-canvas-edit/components/render/draws/bg-draw.d.ts.map +1 -0
- package/lib/draw-canvas-edit/components/render/draws/bg-draw.js +135 -0
- package/lib/draw-canvas-edit/components/render/draws/bg-draw.js.map +1 -0
- package/lib/draw-canvas-edit/components/render/draws/contextmenu-draw.d.ts +26 -0
- package/lib/draw-canvas-edit/components/render/draws/contextmenu-draw.d.ts.map +1 -0
- package/lib/draw-canvas-edit/components/render/draws/contextmenu-draw.js +293 -0
- package/lib/draw-canvas-edit/components/render/draws/contextmenu-draw.js.map +1 -0
- package/lib/draw-canvas-edit/components/render/draws/graph-draw.d.ts +30 -0
- package/lib/draw-canvas-edit/components/render/draws/graph-draw.d.ts.map +1 -0
- package/lib/draw-canvas-edit/components/render/draws/graph-draw.js +182 -0
- package/lib/draw-canvas-edit/components/render/draws/graph-draw.js.map +1 -0
- package/lib/draw-canvas-edit/components/render/draws/index.d.ts +8 -0
- package/lib/draw-canvas-edit/components/render/draws/index.d.ts.map +1 -0
- package/lib/draw-canvas-edit/components/render/draws/index.js +8 -0
- package/lib/draw-canvas-edit/components/render/draws/index.js.map +1 -0
- package/lib/draw-canvas-edit/components/render/draws/link-draw.d.ts +42 -0
- package/lib/draw-canvas-edit/components/render/draws/link-draw.d.ts.map +1 -0
- package/lib/draw-canvas-edit/components/render/draws/link-draw.js +1376 -0
- package/lib/draw-canvas-edit/components/render/draws/link-draw.js.map +1 -0
- package/lib/draw-canvas-edit/components/render/draws/preview-draw.d.ts +15 -0
- package/lib/draw-canvas-edit/components/render/draws/preview-draw.d.ts.map +1 -0
- package/lib/draw-canvas-edit/components/render/draws/preview-draw.js +245 -0
- package/lib/draw-canvas-edit/components/render/draws/preview-draw.js.map +1 -0
- package/lib/draw-canvas-edit/components/render/draws/ref-line-draw.d.ts +18 -0
- package/lib/draw-canvas-edit/components/render/draws/ref-line-draw.d.ts.map +1 -0
- package/lib/draw-canvas-edit/components/render/draws/ref-line-draw.js +59 -0
- package/lib/draw-canvas-edit/components/render/draws/ref-line-draw.js.map +1 -0
- package/lib/draw-canvas-edit/components/render/draws/ruler-draw.d.ts +12 -0
- package/lib/draw-canvas-edit/components/render/draws/ruler-draw.d.ts.map +1 -0
- package/lib/draw-canvas-edit/components/render/draws/ruler-draw.js +151 -0
- package/lib/draw-canvas-edit/components/render/draws/ruler-draw.js.map +1 -0
- package/lib/draw-canvas-edit/components/render/graphs/base-graph.d.ts +112 -0
- package/lib/draw-canvas-edit/components/render/graphs/base-graph.d.ts.map +1 -0
- package/lib/draw-canvas-edit/components/render/graphs/base-graph.js +199 -0
- package/lib/draw-canvas-edit/components/render/graphs/base-graph.js.map +1 -0
- package/lib/draw-canvas-edit/components/render/graphs/bezier.d.ts +80 -0
- package/lib/draw-canvas-edit/components/render/graphs/bezier.d.ts.map +1 -0
- package/lib/draw-canvas-edit/components/render/graphs/bezier.js +485 -0
- package/lib/draw-canvas-edit/components/render/graphs/bezier.js.map +1 -0
- package/lib/draw-canvas-edit/components/render/graphs/circle.d.ts +48 -0
- package/lib/draw-canvas-edit/components/render/graphs/circle.d.ts.map +1 -0
- package/lib/draw-canvas-edit/components/render/graphs/circle.js +735 -0
- package/lib/draw-canvas-edit/components/render/graphs/circle.js.map +1 -0
- package/lib/draw-canvas-edit/components/render/graphs/curve.d.ts +80 -0
- package/lib/draw-canvas-edit/components/render/graphs/curve.d.ts.map +1 -0
- package/lib/draw-canvas-edit/components/render/graphs/curve.js +451 -0
- package/lib/draw-canvas-edit/components/render/graphs/curve.js.map +1 -0
- package/lib/draw-canvas-edit/components/render/graphs/index.d.ts +7 -0
- package/lib/draw-canvas-edit/components/render/graphs/index.d.ts.map +1 -0
- package/lib/draw-canvas-edit/components/render/graphs/index.js +7 -0
- package/lib/draw-canvas-edit/components/render/graphs/index.js.map +1 -0
- package/lib/draw-canvas-edit/components/render/graphs/line.d.ts +80 -0
- package/lib/draw-canvas-edit/components/render/graphs/line.d.ts.map +1 -0
- package/lib/draw-canvas-edit/components/render/graphs/line.js +444 -0
- package/lib/draw-canvas-edit/components/render/graphs/line.js.map +1 -0
- package/lib/draw-canvas-edit/components/render/graphs/rect.d.ts +48 -0
- package/lib/draw-canvas-edit/components/render/graphs/rect.d.ts.map +1 -0
- package/lib/draw-canvas-edit/components/render/graphs/rect.js +716 -0
- package/lib/draw-canvas-edit/components/render/graphs/rect.js.map +1 -0
- package/lib/draw-canvas-edit/components/render/handlers/drag-handlers.d.ts +25 -0
- package/lib/draw-canvas-edit/components/render/handlers/drag-handlers.d.ts.map +1 -0
- package/lib/draw-canvas-edit/components/render/handlers/drag-handlers.js +67 -0
- package/lib/draw-canvas-edit/components/render/handlers/drag-handlers.js.map +1 -0
- package/lib/draw-canvas-edit/components/render/handlers/drag-outside-handlers.d.ts +15 -0
- package/lib/draw-canvas-edit/components/render/handlers/drag-outside-handlers.d.ts.map +1 -0
- package/lib/draw-canvas-edit/components/render/handlers/drag-outside-handlers.js +146 -0
- package/lib/draw-canvas-edit/components/render/handlers/drag-outside-handlers.js.map +1 -0
- package/lib/draw-canvas-edit/components/render/handlers/graph-handlers.d.ts +28 -0
- package/lib/draw-canvas-edit/components/render/handlers/graph-handlers.d.ts.map +1 -0
- package/lib/draw-canvas-edit/components/render/handlers/graph-handlers.js +97 -0
- package/lib/draw-canvas-edit/components/render/handlers/graph-handlers.js.map +1 -0
- package/lib/draw-canvas-edit/components/render/handlers/index.d.ts +10 -0
- package/lib/draw-canvas-edit/components/render/handlers/index.d.ts.map +1 -0
- package/lib/draw-canvas-edit/components/render/handlers/index.js +10 -0
- package/lib/draw-canvas-edit/components/render/handlers/index.js.map +1 -0
- package/lib/draw-canvas-edit/components/render/handlers/key-move-handlers.d.ts +18 -0
- package/lib/draw-canvas-edit/components/render/handlers/key-move-handlers.d.ts.map +1 -0
- package/lib/draw-canvas-edit/components/render/handlers/key-move-handlers.js +51 -0
- package/lib/draw-canvas-edit/components/render/handlers/key-move-handlers.js.map +1 -0
- package/lib/draw-canvas-edit/components/render/handlers/link-handlers.d.ts +14 -0
- package/lib/draw-canvas-edit/components/render/handlers/link-handlers.d.ts.map +1 -0
- package/lib/draw-canvas-edit/components/render/handlers/link-handlers.js +42 -0
- package/lib/draw-canvas-edit/components/render/handlers/link-handlers.js.map +1 -0
- package/lib/draw-canvas-edit/components/render/handlers/selection-handlers.d.ts +62 -0
- package/lib/draw-canvas-edit/components/render/handlers/selection-handlers.d.ts.map +1 -0
- package/lib/draw-canvas-edit/components/render/handlers/selection-handlers.js +396 -0
- package/lib/draw-canvas-edit/components/render/handlers/selection-handlers.js.map +1 -0
- package/lib/draw-canvas-edit/components/render/handlers/shutcut-handlers.d.ts +13 -0
- package/lib/draw-canvas-edit/components/render/handlers/shutcut-handlers.d.ts.map +1 -0
- package/lib/draw-canvas-edit/components/render/handlers/shutcut-handlers.js +50 -0
- package/lib/draw-canvas-edit/components/render/handlers/shutcut-handlers.js.map +1 -0
- package/lib/draw-canvas-edit/components/render/handlers/text-handlers.d.ts +24 -0
- package/lib/draw-canvas-edit/components/render/handlers/text-handlers.d.ts.map +1 -0
- package/lib/draw-canvas-edit/components/render/handlers/text-handlers.js +82 -0
- package/lib/draw-canvas-edit/components/render/handlers/text-handlers.js.map +1 -0
- package/lib/draw-canvas-edit/components/render/handlers/zoom-handlers.d.ts +17 -0
- package/lib/draw-canvas-edit/components/render/handlers/zoom-handlers.d.ts.map +1 -0
- package/lib/draw-canvas-edit/components/render/handlers/zoom-handlers.js +55 -0
- package/lib/draw-canvas-edit/components/render/handlers/zoom-handlers.js.map +1 -0
- package/lib/{draw-canvas/edit → draw-canvas-edit}/components/render/index.d.ts +11 -1
- package/lib/draw-canvas-edit/components/render/index.d.ts.map +1 -0
- package/lib/{draw-canvas/edit → draw-canvas-edit}/components/render/index.js +42 -14
- package/lib/draw-canvas-edit/components/render/index.js.map +1 -0
- package/lib/draw-canvas-edit/components/render/tools/align-tool.d.ts +19 -0
- package/lib/draw-canvas-edit/components/render/tools/align-tool.d.ts.map +1 -0
- package/lib/draw-canvas-edit/components/render/tools/align-tool.js +84 -0
- package/lib/draw-canvas-edit/components/render/tools/align-tool.js.map +1 -0
- package/lib/draw-canvas-edit/components/render/tools/asset-tool.d.ts +12 -0
- package/lib/draw-canvas-edit/components/render/tools/asset-tool.d.ts.map +1 -0
- package/lib/draw-canvas-edit/components/render/tools/asset-tool.js +152 -0
- package/lib/draw-canvas-edit/components/render/tools/asset-tool.js.map +1 -0
- package/lib/draw-canvas-edit/components/render/tools/attract-tool.d.ts +36 -0
- package/lib/draw-canvas-edit/components/render/tools/attract-tool.d.ts.map +1 -0
- package/lib/draw-canvas-edit/components/render/tools/attract-tool.js +419 -0
- package/lib/draw-canvas-edit/components/render/tools/attract-tool.js.map +1 -0
- package/lib/draw-canvas-edit/components/render/tools/copy-tool.d.ts +20 -0
- package/lib/draw-canvas-edit/components/render/tools/copy-tool.d.ts.map +1 -0
- package/lib/draw-canvas-edit/components/render/tools/copy-tool.js +237 -0
- package/lib/draw-canvas-edit/components/render/tools/copy-tool.js.map +1 -0
- package/lib/draw-canvas-edit/components/render/tools/import-export-tool.d.ts +43 -0
- package/lib/draw-canvas-edit/components/render/tools/import-export-tool.d.ts.map +1 -0
- package/lib/draw-canvas-edit/components/render/tools/import-export-tool.js +559 -0
- package/lib/draw-canvas-edit/components/render/tools/import-export-tool.js.map +1 -0
- package/lib/draw-canvas-edit/components/render/tools/index.d.ts +10 -0
- package/lib/draw-canvas-edit/components/render/tools/index.d.ts.map +1 -0
- package/lib/draw-canvas-edit/components/render/tools/index.js +10 -0
- package/lib/draw-canvas-edit/components/render/tools/index.js.map +1 -0
- package/lib/draw-canvas-edit/components/render/tools/link-tool.d.ts +15 -0
- package/lib/draw-canvas-edit/components/render/tools/link-tool.d.ts.map +1 -0
- package/lib/draw-canvas-edit/components/render/tools/link-tool.js +202 -0
- package/lib/draw-canvas-edit/components/render/tools/link-tool.js.map +1 -0
- package/lib/draw-canvas-edit/components/render/tools/position-tool.d.ts +11 -0
- package/lib/draw-canvas-edit/components/render/tools/position-tool.d.ts.map +1 -0
- package/lib/draw-canvas-edit/components/render/tools/position-tool.js +183 -0
- package/lib/draw-canvas-edit/components/render/tools/position-tool.js.map +1 -0
- package/lib/draw-canvas-edit/components/render/tools/selection-tool.d.ts +13 -0
- package/lib/draw-canvas-edit/components/render/tools/selection-tool.d.ts.map +1 -0
- package/lib/draw-canvas-edit/components/render/tools/selection-tool.js +116 -0
- package/lib/draw-canvas-edit/components/render/tools/selection-tool.js.map +1 -0
- package/lib/draw-canvas-edit/components/render/tools/z-index-tool.d.ts +18 -0
- package/lib/draw-canvas-edit/components/render/tools/z-index-tool.d.ts.map +1 -0
- package/lib/draw-canvas-edit/components/render/tools/z-index-tool.js +203 -0
- package/lib/draw-canvas-edit/components/render/tools/z-index-tool.js.map +1 -0
- package/lib/{draw-canvas/edit → draw-canvas-edit}/components/render/types.d.ts +5 -1
- package/lib/draw-canvas-edit/components/render/types.d.ts.map +1 -0
- package/lib/draw-canvas-edit/components/render/types.js.map +1 -0
- package/lib/draw-canvas-edit/components/render/utils/a-star.d.ts +13 -0
- package/lib/draw-canvas-edit/components/render/utils/a-star.d.ts.map +1 -0
- package/lib/draw-canvas-edit/components/render/utils/a-star.js +101 -0
- package/lib/draw-canvas-edit/components/render/utils/a-star.js.map +1 -0
- package/lib/draw-canvas-edit/components/render/utils/bezier-scene-func.d.ts +3 -0
- package/lib/draw-canvas-edit/components/render/utils/bezier-scene-func.d.ts.map +1 -0
- package/lib/draw-canvas-edit/components/render/utils/bezier-scene-func.js +69 -0
- package/lib/draw-canvas-edit/components/render/utils/bezier-scene-func.js.map +1 -0
- package/lib/draw-canvas-edit/components/setting-form/imag-upload.d.ts +26 -0
- package/lib/draw-canvas-edit/components/setting-form/imag-upload.d.ts.map +1 -0
- package/lib/draw-canvas-edit/components/setting-form/imag-upload.js +83 -0
- package/lib/draw-canvas-edit/components/setting-form/imag-upload.js.map +1 -0
- package/lib/{draw-canvas/edit → draw-canvas-edit}/components/setting-form/index.d.ts +1 -3
- package/lib/draw-canvas-edit/components/setting-form/index.d.ts.map +1 -0
- package/lib/{draw-canvas/edit → draw-canvas-edit}/components/setting-form/index.js +94 -16
- package/lib/draw-canvas-edit/components/setting-form/index.js.map +1 -0
- package/lib/draw-canvas-edit/constant.d.ts +7 -0
- package/lib/draw-canvas-edit/constant.d.ts.map +1 -0
- package/lib/draw-canvas-edit/constant.js +7 -0
- package/lib/draw-canvas-edit/constant.js.map +1 -0
- package/lib/draw-canvas-edit/index.d.ts +8 -0
- package/lib/draw-canvas-edit/index.d.ts.map +1 -0
- package/lib/{draw-canvas/edit → draw-canvas-edit}/index.js +63 -10
- package/lib/draw-canvas-edit/index.js.map +1 -0
- package/{src/aldehyde/draw-canvas/edit → lib/draw-canvas-edit}/index.less +17 -2
- package/lib/draw-canvas-view/index.d.ts +8 -0
- package/lib/draw-canvas-view/index.d.ts.map +1 -0
- package/lib/draw-canvas-view/index.js +50 -0
- package/lib/draw-canvas-view/index.js.map +1 -0
- package/lib/draw-canvas-view/index.less +60 -0
- package/lib/draw-canvas-view/view.d.ts +13 -0
- package/lib/draw-canvas-view/view.d.ts.map +1 -0
- package/lib/draw-canvas-view/view.js +208 -0
- package/lib/draw-canvas-view/view.js.map +1 -0
- package/lib/form/form-Item-group.d.ts.map +1 -1
- package/lib/form/form-Item-group.js +4 -4
- package/lib/form/form-Item-group.js.map +1 -1
- package/lib/lowcode-components/index.d.ts +2 -0
- package/lib/lowcode-components/index.d.ts.map +1 -1
- package/lib/lowcode-components/index.js +2 -1
- package/lib/lowcode-components/index.js.map +1 -1
- package/lib/lowcode-components/lowcode-view/component/assets.d.ts.map +1 -1
- package/lib/lowcode-components/lowcode-view/component/assets.js +8 -0
- package/lib/lowcode-components/lowcode-view/component/assets.js.map +1 -1
- package/lib/lowcode-components/radar-chart/index.d.ts +51 -0
- package/lib/lowcode-components/radar-chart/index.d.ts.map +1 -0
- package/lib/lowcode-components/radar-chart/index.js +276 -0
- package/lib/lowcode-components/radar-chart/index.js.map +1 -0
- package/lib/module/dtmpl-edit-card.d.ts.map +1 -1
- package/lib/module/dtmpl-edit-card.js +18 -1
- package/lib/module/dtmpl-edit-card.js.map +1 -1
- package/lib/module/dtmpl-edit-page.d.ts.map +1 -1
- package/lib/module/dtmpl-edit-page.js +19 -2
- package/lib/module/dtmpl-edit-page.js.map +1 -1
- package/lib/routable/ltmpl-route.d.ts +2 -0
- package/lib/routable/ltmpl-route.d.ts.map +1 -1
- package/lib/routable/ltmpl-route.js +20 -4
- package/lib/routable/ltmpl-route.js.map +1 -1
- package/lib/table/act-table.d.ts +2 -0
- package/lib/table/act-table.d.ts.map +1 -1
- package/lib/table/act-table.js +4 -4
- package/lib/table/act-table.js.map +1 -1
- package/lib/table/column/column-builder.d.ts.map +1 -1
- package/lib/table/column/column-builder.js +23 -8
- package/lib/table/column/column-builder.js.map +1 -1
- package/lib/table/relation-table.d.ts +3 -0
- package/lib/table/relation-table.d.ts.map +1 -1
- package/lib/tmpl/control-type-supportor.d.ts.map +1 -1
- package/lib/tmpl/control-type-supportor.js +1 -0
- package/lib/tmpl/control-type-supportor.js.map +1 -1
- package/lib/tmpl/hcservice-v3.d.ts +2 -0
- package/lib/tmpl/hcservice-v3.d.ts.map +1 -1
- package/lib/tmpl/hcservice-v3.js +34 -0
- package/lib/tmpl/hcservice-v3.js.map +1 -1
- package/lib/tmpl/interface.d.ts +13 -1
- package/lib/tmpl/interface.d.ts.map +1 -1
- package/lib/tmpl/interface.js.map +1 -1
- package/lib/tmpl/tmpl-config-analysis.js +1 -1
- package/lib/tmpl/tmpl-config-analysis.js.map +1 -1
- package/lib/units/index.d.ts +2 -1
- package/lib/units/index.d.ts.map +1 -1
- package/lib/units/index.js +17 -3
- package/lib/units/index.js.map +1 -1
- package/package.json +4 -1
- package/src/aldehyde/controls/entity-select/entity-select.tsx +18 -8
- package/src/aldehyde/controls/entry-control.tsx +1 -0
- package/src/aldehyde/controls/select/index.tsx +7 -6
- package/src/aldehyde/controls/text/index.less +1 -0
- package/src/aldehyde/controls/view-control.tsx +1 -0
- package/src/aldehyde/detail/button/edit-button.tsx +21 -22
- package/src/aldehyde/detail/button/view-button.tsx +23 -21
- package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/asset-bar/index.tsx +4 -2
- package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/main-header/index.tsx +60 -14
- package/src/aldehyde/draw-canvas-edit/components/render/draws/bg-draw.ts +163 -0
- package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/draws/preview-draw.ts +33 -15
- package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/handlers/drag-outside-handlers.ts +19 -22
- package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/handlers/selection-handlers.ts +38 -30
- package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/index.ts +41 -9
- package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/tools/position-tool.ts +40 -58
- package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/types.ts +5 -1
- package/src/aldehyde/draw-canvas-edit/components/setting-form/imag-upload.tsx +118 -0
- package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/setting-form/index.tsx +111 -17
- package/src/aldehyde/draw-canvas-edit/constant.ts +6 -0
- package/{lib/draw-canvas/edit → src/aldehyde/draw-canvas-edit}/index.less +17 -2
- package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/index.tsx +84 -25
- package/src/aldehyde/draw-canvas-view/index.less +60 -0
- package/src/aldehyde/draw-canvas-view/index.tsx +48 -0
- package/src/aldehyde/draw-canvas-view/view.tsx +212 -0
- package/src/aldehyde/form/form-Item-group.tsx +4 -5
- package/src/aldehyde/lowcode-components/index.ts +4 -2
- package/src/aldehyde/lowcode-components/lowcode-view/component/assets.ts +8 -0
- package/src/aldehyde/lowcode-components/radar-chart/index.tsx +323 -0
- package/src/aldehyde/module/dtmpl-edit-card.tsx +18 -1
- package/src/aldehyde/module/dtmpl-edit-page.tsx +19 -2
- package/src/aldehyde/routable/ltmpl-route.tsx +39 -3
- package/src/aldehyde/table/act-table.tsx +7 -4
- package/src/aldehyde/table/column/column-builder.tsx +29 -9
- package/src/aldehyde/tmpl/control-type-supportor.tsx +1 -0
- package/src/aldehyde/tmpl/hcservice-v3.tsx +30 -0
- package/src/aldehyde/tmpl/interface.tsx +13 -1
- package/src/aldehyde/tmpl/tmpl-config-analysis.tsx +1 -1
- package/src/aldehyde/units/index.tsx +17 -4
- package/lib/draw-canvas/edit/components/asset-bar/index.d.ts.map +0 -1
- package/lib/draw-canvas/edit/components/asset-bar/index.js.map +0 -1
- package/lib/draw-canvas/edit/components/main-header/index.d.ts.map +0 -1
- package/lib/draw-canvas/edit/components/main-header/index.js.map +0 -1
- package/lib/draw-canvas/edit/components/render/index.d.ts.map +0 -1
- package/lib/draw-canvas/edit/components/render/index.js.map +0 -1
- package/lib/draw-canvas/edit/components/render/types.d.ts.map +0 -1
- package/lib/draw-canvas/edit/components/render/types.js.map +0 -1
- package/lib/draw-canvas/edit/components/setting-form/index.d.ts.map +0 -1
- package/lib/draw-canvas/edit/components/setting-form/index.js.map +0 -1
- package/lib/draw-canvas/edit/index.d.ts +0 -5
- package/lib/draw-canvas/edit/index.d.ts.map +0 -1
- package/lib/draw-canvas/edit/index.js.map +0 -1
- package/src/aldehyde/draw-canvas/edit/components/render/draws/bg-draw.ts +0 -98
- /package/lib/{draw-canvas/edit → draw-canvas-edit}/components/asset-bar/index.d.ts +0 -0
- /package/lib/{draw-canvas/edit → draw-canvas-edit}/components/asset-bar/index.less +0 -0
- /package/lib/{draw-canvas/edit → draw-canvas-edit}/components/main-header/index.less +0 -0
- /package/lib/{draw-canvas/edit → draw-canvas-edit}/components/render/types.js +0 -0
- /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/asset-bar/index.less +0 -0
- /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/main-header/index.less +0 -0
- /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/draws/contextmenu-draw.ts +0 -0
- /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/draws/graph-draw.ts +0 -0
- /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/draws/index.ts +0 -0
- /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/draws/link-draw.ts +0 -0
- /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/draws/ref-line-draw.ts +0 -0
- /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/draws/ruler-draw.ts +0 -0
- /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/graphs/base-graph.ts +0 -0
- /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/graphs/bezier.ts +0 -0
- /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/graphs/circle.ts +0 -0
- /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/graphs/curve.ts +0 -0
- /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/graphs/index.ts +0 -0
- /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/graphs/line.ts +0 -0
- /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/graphs/rect.ts +0 -0
- /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/handlers/drag-handlers.ts +0 -0
- /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/handlers/graph-handlers.ts +0 -0
- /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/handlers/index.ts +0 -0
- /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/handlers/key-move-handlers.ts +0 -0
- /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/handlers/link-handlers.ts +0 -0
- /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/handlers/shutcut-handlers.ts +0 -0
- /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/handlers/text-handlers.ts +0 -0
- /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/handlers/zoom-handlers.ts +0 -0
- /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/tools/align-tool.ts +0 -0
- /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/tools/asset-tool.ts +0 -0
- /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/tools/attract-tool.ts +0 -0
- /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/tools/copy-tool.ts +0 -0
- /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/tools/import-export-tool.ts +0 -0
- /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/tools/index.ts +0 -0
- /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/tools/link-tool.ts +0 -0
- /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/tools/selection-tool.ts +0 -0
- /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/tools/z-index-tool.ts +0 -0
- /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/utils/a-star.ts +0 -0
- /package/src/aldehyde/{draw-canvas/edit → draw-canvas-edit}/components/render/utils/bezier-scene-func.ts +0 -0
|
@@ -0,0 +1,716 @@
|
|
|
1
|
+
import Konva from 'konva';
|
|
2
|
+
import { GraphDraw, LinkDraw, PreviewDraw } from '../draws';
|
|
3
|
+
import { BaseGraph } from './base-graph';
|
|
4
|
+
/**
|
|
5
|
+
* 图形 矩形
|
|
6
|
+
*/
|
|
7
|
+
export class Rect extends BaseGraph {
|
|
8
|
+
// 实现:更新 图形 的 调整点 的 锚点位置
|
|
9
|
+
static updateAnchorShadows(graph, anchorShadows) {
|
|
10
|
+
const { width, height } = graph.size();
|
|
11
|
+
for (const shadow of anchorShadows) {
|
|
12
|
+
switch (shadow.attrs.adjustType) {
|
|
13
|
+
case 'top':
|
|
14
|
+
shadow.position({ x: width / 2, y: 0 });
|
|
15
|
+
break;
|
|
16
|
+
case 'bottom':
|
|
17
|
+
shadow.position({ x: width / 2, y: height });
|
|
18
|
+
break;
|
|
19
|
+
case 'left':
|
|
20
|
+
shadow.position({ x: 0, y: height / 2 });
|
|
21
|
+
break;
|
|
22
|
+
case 'right':
|
|
23
|
+
shadow.position({ x: width, y: height / 2 });
|
|
24
|
+
break;
|
|
25
|
+
case 'top-left':
|
|
26
|
+
shadow.position({ x: 0, y: 0 });
|
|
27
|
+
break;
|
|
28
|
+
case 'top-right':
|
|
29
|
+
shadow.position({ x: width, y: 0 });
|
|
30
|
+
break;
|
|
31
|
+
case 'bottom-left':
|
|
32
|
+
shadow.position({ x: 0, y: height });
|
|
33
|
+
break;
|
|
34
|
+
case 'bottom-right':
|
|
35
|
+
shadow.position({ x: width, y: height });
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
// 实现:更新 图形 的 连接点 的 锚点位置
|
|
41
|
+
static updateLinkAnchorShadows(graph, linkAnchorShadows) {
|
|
42
|
+
const { width, height } = graph.size();
|
|
43
|
+
for (const shadow of linkAnchorShadows) {
|
|
44
|
+
switch (shadow.attrs.alias) {
|
|
45
|
+
case 'top':
|
|
46
|
+
shadow.position({ x: width / 2, y: 0 });
|
|
47
|
+
break;
|
|
48
|
+
case 'bottom':
|
|
49
|
+
shadow.position({ x: width / 2, y: height });
|
|
50
|
+
break;
|
|
51
|
+
case 'left':
|
|
52
|
+
shadow.position({ x: 0, y: height / 2 });
|
|
53
|
+
break;
|
|
54
|
+
case 'right':
|
|
55
|
+
shadow.position({ x: width, y: height / 2 });
|
|
56
|
+
break;
|
|
57
|
+
case 'center':
|
|
58
|
+
shadow.position({ x: width / 2, y: height / 2 });
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
// 实现:生成 调整点
|
|
64
|
+
static createAnchorShapes(render, graph, anchorAndShadows,
|
|
65
|
+
// eslint-disable-next-line
|
|
66
|
+
adjustAnchor) {
|
|
67
|
+
var _a;
|
|
68
|
+
const stageState = render.getStageState();
|
|
69
|
+
for (const anchorAndShadow of anchorAndShadows) {
|
|
70
|
+
const { anchor, anchorShadow } = anchorAndShadow;
|
|
71
|
+
const x = render.toStageValue(anchorShadow.getAbsolutePosition().x - stageState.x), y = render.toStageValue(anchorShadow.getAbsolutePosition().y - stageState.y);
|
|
72
|
+
const offset = render.toStageValue(render.pointSize + 5);
|
|
73
|
+
const anchorShape = new Konva.Line({
|
|
74
|
+
name: 'anchor',
|
|
75
|
+
anchor: anchor,
|
|
76
|
+
stroke: `rgba(0,0,255,0.4)`,
|
|
77
|
+
strokeWidth: render.toStageValue(2),
|
|
78
|
+
hitStrokeWidth: render.toStageValue(3),
|
|
79
|
+
x,
|
|
80
|
+
y,
|
|
81
|
+
points: (_a = {
|
|
82
|
+
'top-left': [[-offset, offset / 2], [-offset, -offset], [offset / 2, -offset]].flat(),
|
|
83
|
+
top: [[-offset, -offset], [offset, -offset]].flat(),
|
|
84
|
+
'top-right': [[-offset / 2, -offset], [offset, -offset], [offset, offset / 2]].flat(),
|
|
85
|
+
right: [[offset, -offset], [offset, offset]].flat(),
|
|
86
|
+
'bottom-right': [[-offset / 2, offset], [offset, offset], [offset, -offset / 2]].flat(),
|
|
87
|
+
bottom: [[-offset, offset], [offset, offset]].flat(),
|
|
88
|
+
'bottom-left': [[-offset, -offset / 2], [-offset, offset], [offset / 2, offset]].flat(),
|
|
89
|
+
left: [[-offset, -offset], [-offset, offset]].flat()
|
|
90
|
+
}[anchor.adjustType]) !== null && _a !== void 0 ? _a : [],
|
|
91
|
+
rotation: graph.getAbsoluteRotation(), // 旋转角度
|
|
92
|
+
visible: graph.attrs.adjusting || graph.attrs.hover === true
|
|
93
|
+
});
|
|
94
|
+
anchorShape.on('mouseenter', () => {
|
|
95
|
+
document.body.style.cursor = 'move';
|
|
96
|
+
graph.setAttr('hover', true);
|
|
97
|
+
graph.setAttr('hoverAnchor', true);
|
|
98
|
+
});
|
|
99
|
+
anchorShape.on('mouseleave', () => {
|
|
100
|
+
document.body.style.cursor = anchorShape.attrs.adjusting ? 'move' : 'default';
|
|
101
|
+
graph.setAttr('hover', false);
|
|
102
|
+
graph.setAttr('hoverAnchor', false);
|
|
103
|
+
render.redraw([GraphDraw.name]);
|
|
104
|
+
});
|
|
105
|
+
anchorAndShadow.shape = anchorShape;
|
|
106
|
+
}
|
|
107
|
+
return { anchorAndShadows };
|
|
108
|
+
}
|
|
109
|
+
// 实现:调整 图形
|
|
110
|
+
static adjust(render, graph, graphSnap, adjustShape, anchorAndShadows, startPoint, endPoint, hoverRect) {
|
|
111
|
+
var _a, _b, _c, _d, _e;
|
|
112
|
+
// 目标 矩形
|
|
113
|
+
const rect = graph.findOne('.graph');
|
|
114
|
+
const rectSnap = graphSnap.findOne('.graph');
|
|
115
|
+
const anchors = ((_a = graph.find('.anchor')) !== null && _a !== void 0 ? _a : []);
|
|
116
|
+
const anchorsSnap = ((_b = graphSnap.find('.anchor')) !== null && _b !== void 0 ? _b : []);
|
|
117
|
+
const linkAnchors = ((_c = graph.find('.link-anchor')) !== null && _c !== void 0 ? _c : []);
|
|
118
|
+
if (rect && rectSnap) {
|
|
119
|
+
const [graphRotation, adjustType, ex, ey] = [
|
|
120
|
+
Math.round(graph.rotation()),
|
|
121
|
+
(_d = adjustShape.attrs.anchor) === null || _d === void 0 ? void 0 : _d.adjustType,
|
|
122
|
+
endPoint.x,
|
|
123
|
+
endPoint.y
|
|
124
|
+
];
|
|
125
|
+
let anchorShadow, anchorShadowAcross;
|
|
126
|
+
switch (adjustType) {
|
|
127
|
+
case 'top':
|
|
128
|
+
anchorShadow = anchorsSnap.find((o) => o.attrs.adjustType === 'top');
|
|
129
|
+
anchorShadowAcross = anchorsSnap.find((o) => o.attrs.adjustType === 'bottom');
|
|
130
|
+
break;
|
|
131
|
+
case 'bottom':
|
|
132
|
+
anchorShadow = anchorsSnap.find((o) => o.attrs.adjustType === 'bottom');
|
|
133
|
+
anchorShadowAcross = anchorsSnap.find((o) => o.attrs.adjustType === 'top');
|
|
134
|
+
break;
|
|
135
|
+
case 'left':
|
|
136
|
+
anchorShadow = anchorsSnap.find((o) => o.attrs.adjustType === 'left');
|
|
137
|
+
anchorShadowAcross = anchorsSnap.find((o) => o.attrs.adjustType === 'right');
|
|
138
|
+
break;
|
|
139
|
+
case 'right':
|
|
140
|
+
anchorShadow = anchorsSnap.find((o) => o.attrs.adjustType === 'right');
|
|
141
|
+
anchorShadowAcross = anchorsSnap.find((o) => o.attrs.adjustType === 'left');
|
|
142
|
+
break;
|
|
143
|
+
case 'top-left':
|
|
144
|
+
anchorShadow = anchorsSnap.find((o) => o.attrs.adjustType === 'top-left');
|
|
145
|
+
anchorShadowAcross = anchorsSnap.find((o) => o.attrs.adjustType === 'bottom-right');
|
|
146
|
+
break;
|
|
147
|
+
case 'top-right':
|
|
148
|
+
anchorShadow = anchorsSnap.find((o) => o.attrs.adjustType === 'top-right');
|
|
149
|
+
anchorShadowAcross = anchorsSnap.find((o) => o.attrs.adjustType === 'bottom-left');
|
|
150
|
+
break;
|
|
151
|
+
case 'bottom-left':
|
|
152
|
+
anchorShadow = anchorsSnap.find((o) => o.attrs.adjustType === 'bottom-left');
|
|
153
|
+
anchorShadowAcross = anchorsSnap.find((o) => o.attrs.adjustType === 'top-right');
|
|
154
|
+
break;
|
|
155
|
+
case 'bottom-right':
|
|
156
|
+
anchorShadow = anchorsSnap.find((o) => o.attrs.adjustType === 'bottom-right');
|
|
157
|
+
anchorShadowAcross = anchorsSnap.find((o) => o.attrs.adjustType === 'top-left');
|
|
158
|
+
break;
|
|
159
|
+
}
|
|
160
|
+
if (anchorShadow && anchorShadowAcross) {
|
|
161
|
+
const { x: sx, y: sy } = anchorShadow.getAbsolutePosition();
|
|
162
|
+
const { x: ax, y: ay } = anchorShadowAcross.getAbsolutePosition();
|
|
163
|
+
{
|
|
164
|
+
const d1 = Math.sqrt(Math.pow(sx - ax, 2) + Math.pow(sy - ay, 2));
|
|
165
|
+
const d2 = Math.sqrt(Math.pow(ex - ax, 2) + Math.pow(ey - ay, 2));
|
|
166
|
+
const r1 = d2 / d1;
|
|
167
|
+
let zeroWidth = 1, zeroHeight = 1;
|
|
168
|
+
switch (adjustType) {
|
|
169
|
+
case 'top':
|
|
170
|
+
if (graphRotation >= 45 && graphRotation < 135) {
|
|
171
|
+
zeroHeight = ex <= ax ? 0 : 1;
|
|
172
|
+
}
|
|
173
|
+
else if (graphRotation >= -135 && graphRotation < -45) {
|
|
174
|
+
zeroHeight = ex >= ax ? 0 : 1;
|
|
175
|
+
}
|
|
176
|
+
else if (graphRotation >= -45 && graphRotation < 45) {
|
|
177
|
+
zeroHeight = ey >= ay ? 0 : 1;
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
zeroHeight = ey <= ay ? 0 : 1;
|
|
181
|
+
}
|
|
182
|
+
break;
|
|
183
|
+
case 'bottom':
|
|
184
|
+
if (graphRotation >= 45 && graphRotation < 135) {
|
|
185
|
+
zeroHeight = ex <= ax ? 1 : 0;
|
|
186
|
+
}
|
|
187
|
+
else if (graphRotation >= -135 && graphRotation < -45) {
|
|
188
|
+
zeroHeight = ex >= ax ? 1 : 0;
|
|
189
|
+
}
|
|
190
|
+
else if (graphRotation >= -45 && graphRotation < 45) {
|
|
191
|
+
zeroHeight = ey >= ay ? 1 : 0;
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
zeroHeight = ey <= ay ? 1 : 0;
|
|
195
|
+
}
|
|
196
|
+
break;
|
|
197
|
+
case 'left':
|
|
198
|
+
if (graphRotation >= 45 && graphRotation < 135) {
|
|
199
|
+
zeroWidth = ey >= ay ? 0 : 1;
|
|
200
|
+
}
|
|
201
|
+
else if (graphRotation >= -135 && graphRotation < -45) {
|
|
202
|
+
zeroWidth = ex <= ax ? 0 : 1;
|
|
203
|
+
}
|
|
204
|
+
else if (graphRotation >= -45 && graphRotation < 45) {
|
|
205
|
+
zeroWidth = ex >= ax ? 0 : 1;
|
|
206
|
+
}
|
|
207
|
+
else {
|
|
208
|
+
zeroWidth = ey <= ay ? 0 : 1;
|
|
209
|
+
}
|
|
210
|
+
break;
|
|
211
|
+
case 'right':
|
|
212
|
+
if (graphRotation >= 45 && graphRotation < 135) {
|
|
213
|
+
zeroWidth = ey >= ay ? 1 : 0;
|
|
214
|
+
}
|
|
215
|
+
else if (graphRotation >= -135 && graphRotation < -45) {
|
|
216
|
+
zeroWidth = ex <= ax ? 1 : 0;
|
|
217
|
+
}
|
|
218
|
+
else if (graphRotation >= -45 && graphRotation < 45) {
|
|
219
|
+
zeroWidth = ex >= ax ? 1 : 0;
|
|
220
|
+
}
|
|
221
|
+
else {
|
|
222
|
+
zeroWidth = ey <= ay ? 1 : 0;
|
|
223
|
+
}
|
|
224
|
+
break;
|
|
225
|
+
case 'top-left':
|
|
226
|
+
if (graphRotation > -45 && graphRotation < 45) {
|
|
227
|
+
if (ex >= ax && ey >= ay) {
|
|
228
|
+
zeroWidth = 0;
|
|
229
|
+
zeroHeight = 0;
|
|
230
|
+
}
|
|
231
|
+
else {
|
|
232
|
+
zeroWidth = 1;
|
|
233
|
+
zeroHeight = 1;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
else if (graphRotation === 45) {
|
|
237
|
+
if (ey >= ay) {
|
|
238
|
+
zeroWidth = 0;
|
|
239
|
+
zeroHeight = 0;
|
|
240
|
+
}
|
|
241
|
+
else {
|
|
242
|
+
zeroWidth = 1;
|
|
243
|
+
zeroHeight = 1;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
else if (graphRotation > 45 && graphRotation < 135) {
|
|
247
|
+
if (ex <= ax && ey >= ay) {
|
|
248
|
+
zeroWidth = 0;
|
|
249
|
+
zeroHeight = 0;
|
|
250
|
+
}
|
|
251
|
+
else {
|
|
252
|
+
zeroWidth = 1;
|
|
253
|
+
zeroHeight = 1;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
else if (graphRotation === 135) {
|
|
257
|
+
if (ex <= ax) {
|
|
258
|
+
zeroWidth = 0;
|
|
259
|
+
zeroHeight = 0;
|
|
260
|
+
}
|
|
261
|
+
else {
|
|
262
|
+
zeroWidth = 1;
|
|
263
|
+
zeroHeight = 1;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
else if ((graphRotation > 135 && graphRotation <= 180) || (graphRotation >= -180 && graphRotation < -135)) {
|
|
267
|
+
if (ex <= ax && ey <= ay) {
|
|
268
|
+
zeroWidth = 0;
|
|
269
|
+
zeroHeight = 0;
|
|
270
|
+
}
|
|
271
|
+
else {
|
|
272
|
+
zeroWidth = 1;
|
|
273
|
+
zeroHeight = 1;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
else if (graphRotation === -135) {
|
|
277
|
+
if (ey <= ay) {
|
|
278
|
+
zeroWidth = 0;
|
|
279
|
+
zeroHeight = 0;
|
|
280
|
+
}
|
|
281
|
+
else {
|
|
282
|
+
zeroWidth = 1;
|
|
283
|
+
zeroHeight = 1;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
else if (graphRotation > -135 && graphRotation < -45) {
|
|
287
|
+
if (ex >= ax && ey <= ay) {
|
|
288
|
+
zeroWidth = 0;
|
|
289
|
+
zeroHeight = 0;
|
|
290
|
+
}
|
|
291
|
+
else {
|
|
292
|
+
zeroWidth = 1;
|
|
293
|
+
zeroHeight = 1;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
else if (graphRotation === -45) {
|
|
297
|
+
if (ex >= ax) {
|
|
298
|
+
zeroWidth = 0;
|
|
299
|
+
zeroHeight = 0;
|
|
300
|
+
}
|
|
301
|
+
else {
|
|
302
|
+
zeroWidth = 1;
|
|
303
|
+
zeroHeight = 1;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
break;
|
|
307
|
+
case 'top-right':
|
|
308
|
+
if (graphRotation > -45 && graphRotation < 45) {
|
|
309
|
+
if (ex <= ax && ey >= ay) {
|
|
310
|
+
zeroWidth = 0;
|
|
311
|
+
zeroHeight = 0;
|
|
312
|
+
}
|
|
313
|
+
else {
|
|
314
|
+
zeroWidth = 1;
|
|
315
|
+
zeroHeight = 1;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
else if (graphRotation === 45) {
|
|
319
|
+
if (ex <= ax) {
|
|
320
|
+
zeroWidth = 0;
|
|
321
|
+
zeroHeight = 0;
|
|
322
|
+
}
|
|
323
|
+
else {
|
|
324
|
+
zeroWidth = 1;
|
|
325
|
+
zeroHeight = 1;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
else if (graphRotation > 45 && graphRotation < 135) {
|
|
329
|
+
if (ex <= ax && ey <= ay) {
|
|
330
|
+
zeroWidth = 0;
|
|
331
|
+
zeroHeight = 0;
|
|
332
|
+
}
|
|
333
|
+
else {
|
|
334
|
+
zeroWidth = 1;
|
|
335
|
+
zeroHeight = 1;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
else if (graphRotation === 135) {
|
|
339
|
+
if (ey <= ay) {
|
|
340
|
+
zeroWidth = 0;
|
|
341
|
+
zeroHeight = 0;
|
|
342
|
+
}
|
|
343
|
+
else {
|
|
344
|
+
zeroWidth = 1;
|
|
345
|
+
zeroHeight = 1;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
else if ((graphRotation > 135 && graphRotation <= 180) || (graphRotation >= -180 && graphRotation < -135)) {
|
|
349
|
+
if (ex >= ax && ey <= ay) {
|
|
350
|
+
zeroWidth = 0;
|
|
351
|
+
zeroHeight = 0;
|
|
352
|
+
}
|
|
353
|
+
else {
|
|
354
|
+
zeroWidth = 1;
|
|
355
|
+
zeroHeight = 1;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
else if (graphRotation === -135) {
|
|
359
|
+
if (ex >= ax) {
|
|
360
|
+
zeroWidth = 0;
|
|
361
|
+
zeroHeight = 0;
|
|
362
|
+
}
|
|
363
|
+
else {
|
|
364
|
+
zeroWidth = 1;
|
|
365
|
+
zeroHeight = 1;
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
else if (graphRotation > -135 && graphRotation < -45) {
|
|
369
|
+
if (ex >= ax && ey >= ay) {
|
|
370
|
+
zeroWidth = 0;
|
|
371
|
+
zeroHeight = 0;
|
|
372
|
+
}
|
|
373
|
+
else {
|
|
374
|
+
zeroWidth = 1;
|
|
375
|
+
zeroHeight = 1;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
else if (graphRotation === -45) {
|
|
379
|
+
if (ey >= ay) {
|
|
380
|
+
zeroWidth = 0;
|
|
381
|
+
zeroHeight = 0;
|
|
382
|
+
}
|
|
383
|
+
else {
|
|
384
|
+
zeroWidth = 1;
|
|
385
|
+
zeroHeight = 1;
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
break;
|
|
389
|
+
case 'bottom-left':
|
|
390
|
+
if (graphRotation > -45 && graphRotation < 45) {
|
|
391
|
+
if (ex >= ax && ey <= ay) {
|
|
392
|
+
zeroWidth = 0;
|
|
393
|
+
zeroHeight = 0;
|
|
394
|
+
}
|
|
395
|
+
else {
|
|
396
|
+
zeroWidth = 1;
|
|
397
|
+
zeroHeight = 1;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
else if (graphRotation === 45) {
|
|
401
|
+
if (ex >= ax) {
|
|
402
|
+
zeroWidth = 0;
|
|
403
|
+
zeroHeight = 0;
|
|
404
|
+
}
|
|
405
|
+
else {
|
|
406
|
+
zeroWidth = 1;
|
|
407
|
+
zeroHeight = 1;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
else if (graphRotation > 45 && graphRotation < 135) {
|
|
411
|
+
if (ex >= ax && ey >= ay) {
|
|
412
|
+
zeroWidth = 0;
|
|
413
|
+
zeroHeight = 0;
|
|
414
|
+
}
|
|
415
|
+
else {
|
|
416
|
+
zeroWidth = 1;
|
|
417
|
+
zeroHeight = 1;
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
else if (graphRotation === 135) {
|
|
421
|
+
if (ey >= ay) {
|
|
422
|
+
zeroWidth = 0;
|
|
423
|
+
zeroHeight = 0;
|
|
424
|
+
}
|
|
425
|
+
else {
|
|
426
|
+
zeroWidth = 1;
|
|
427
|
+
zeroHeight = 1;
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
else if ((graphRotation > 135 && graphRotation <= 180) || (graphRotation >= -180 && graphRotation < -135)) {
|
|
431
|
+
if (ex <= ax && ey >= ay) {
|
|
432
|
+
zeroWidth = 0;
|
|
433
|
+
zeroHeight = 0;
|
|
434
|
+
}
|
|
435
|
+
else {
|
|
436
|
+
zeroWidth = 1;
|
|
437
|
+
zeroHeight = 1;
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
else if (graphRotation === -135) {
|
|
441
|
+
if (ex <= ax) {
|
|
442
|
+
zeroWidth = 0;
|
|
443
|
+
zeroHeight = 0;
|
|
444
|
+
}
|
|
445
|
+
else {
|
|
446
|
+
zeroWidth = 1;
|
|
447
|
+
zeroHeight = 1;
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
else if (graphRotation > -135 && graphRotation < -45) {
|
|
451
|
+
if (ex <= ax && ey <= ay) {
|
|
452
|
+
zeroWidth = 0;
|
|
453
|
+
zeroHeight = 0;
|
|
454
|
+
}
|
|
455
|
+
else {
|
|
456
|
+
zeroWidth = 1;
|
|
457
|
+
zeroHeight = 1;
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
else if (graphRotation === -45) {
|
|
461
|
+
if (ey <= ay) {
|
|
462
|
+
zeroWidth = 0;
|
|
463
|
+
zeroHeight = 0;
|
|
464
|
+
}
|
|
465
|
+
else {
|
|
466
|
+
zeroWidth = 1;
|
|
467
|
+
zeroHeight = 1;
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
break;
|
|
471
|
+
case 'bottom-right':
|
|
472
|
+
if (graphRotation > -45 && graphRotation < 45) {
|
|
473
|
+
if (ex <= ax && ey <= ay) {
|
|
474
|
+
zeroWidth = 0;
|
|
475
|
+
zeroHeight = 0;
|
|
476
|
+
}
|
|
477
|
+
else {
|
|
478
|
+
zeroWidth = 1;
|
|
479
|
+
zeroHeight = 1;
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
else if (graphRotation === 45) {
|
|
483
|
+
if (ey <= ay) {
|
|
484
|
+
zeroWidth = 0;
|
|
485
|
+
zeroHeight = 0;
|
|
486
|
+
}
|
|
487
|
+
else {
|
|
488
|
+
zeroWidth = 1;
|
|
489
|
+
zeroHeight = 1;
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
else if (graphRotation > 45 && graphRotation < 135) {
|
|
493
|
+
if (ex >= ax && ey <= ay) {
|
|
494
|
+
zeroWidth = 0;
|
|
495
|
+
zeroHeight = 0;
|
|
496
|
+
}
|
|
497
|
+
else {
|
|
498
|
+
zeroWidth = 1;
|
|
499
|
+
zeroHeight = 1;
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
else if (graphRotation === 135) {
|
|
503
|
+
if (ex >= ax) {
|
|
504
|
+
zeroWidth = 0;
|
|
505
|
+
zeroHeight = 0;
|
|
506
|
+
}
|
|
507
|
+
else {
|
|
508
|
+
zeroWidth = 1;
|
|
509
|
+
zeroHeight = 1;
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
else if ((graphRotation > 135 && graphRotation <= 180) || (graphRotation >= -180 && graphRotation < -135)) {
|
|
513
|
+
if (ex >= ax && ey >= ay) {
|
|
514
|
+
zeroWidth = 0;
|
|
515
|
+
zeroHeight = 0;
|
|
516
|
+
}
|
|
517
|
+
else {
|
|
518
|
+
zeroWidth = 1;
|
|
519
|
+
zeroHeight = 1;
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
else if (graphRotation === -135) {
|
|
523
|
+
if (ey >= ay) {
|
|
524
|
+
zeroWidth = 0;
|
|
525
|
+
zeroHeight = 0;
|
|
526
|
+
}
|
|
527
|
+
else {
|
|
528
|
+
zeroWidth = 1;
|
|
529
|
+
zeroHeight = 1;
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
else if (graphRotation > -135 && graphRotation < -45) {
|
|
533
|
+
if (ex <= ax && ey >= ay) {
|
|
534
|
+
zeroWidth = 0;
|
|
535
|
+
zeroHeight = 0;
|
|
536
|
+
}
|
|
537
|
+
else {
|
|
538
|
+
zeroWidth = 1;
|
|
539
|
+
zeroHeight = 1;
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
else if (graphRotation === -45) {
|
|
543
|
+
if (ex <= ax) {
|
|
544
|
+
zeroWidth = 0;
|
|
545
|
+
zeroHeight = 0;
|
|
546
|
+
}
|
|
547
|
+
else {
|
|
548
|
+
zeroWidth = 1;
|
|
549
|
+
zeroHeight = 1;
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
break;
|
|
553
|
+
}
|
|
554
|
+
if (/-?(left|right)$/.test(adjustType)) {
|
|
555
|
+
graph.width(Math.max(2, graphSnap.width() * r1 * zeroWidth));
|
|
556
|
+
}
|
|
557
|
+
if (/^(top|bottom)-?/.test(adjustType)) {
|
|
558
|
+
graph.height(Math.max(2, graphSnap.height() * r1 * zeroHeight));
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
{
|
|
562
|
+
const [graphWidth, graphHeight] = [graph.width() * graph.scaleX(), graph.height() * graph.scaleY()];
|
|
563
|
+
const cos = Math.cos((graphRotation * Math.PI) / 180);
|
|
564
|
+
const sin = Math.sin((graphRotation * Math.PI) / 180);
|
|
565
|
+
const tan = Math.tan((graphRotation * Math.PI) / 180);
|
|
566
|
+
switch (adjustType) {
|
|
567
|
+
case 'top':
|
|
568
|
+
graph.x(ax - (graphWidth / 2 - graphHeight * tan) * cos);
|
|
569
|
+
if (graphRotation !== 90 && graphRotation !== -90) {
|
|
570
|
+
graph.y(ay - (graphHeight / cos + (graphWidth / 2 - graphHeight * tan) * sin));
|
|
571
|
+
}
|
|
572
|
+
break;
|
|
573
|
+
case 'bottom': // 无需处理
|
|
574
|
+
break;
|
|
575
|
+
case 'left':
|
|
576
|
+
if ([90, -90].includes(graphRotation)) {
|
|
577
|
+
graph.y(ay - graphWidth);
|
|
578
|
+
}
|
|
579
|
+
else if (Math.abs(graphRotation) === 180) {
|
|
580
|
+
graph.x(ax + graphWidth);
|
|
581
|
+
}
|
|
582
|
+
else {
|
|
583
|
+
const v1 = graphHeight / 2 / cos;
|
|
584
|
+
const v2 = v1 * sin;
|
|
585
|
+
const v3 = graphWidth - v2;
|
|
586
|
+
const v4 = v3 * sin;
|
|
587
|
+
graph.x(ax - v3 * cos);
|
|
588
|
+
graph.y(ay - (v1 + v4));
|
|
589
|
+
}
|
|
590
|
+
break;
|
|
591
|
+
case 'right': // 无需处理
|
|
592
|
+
break;
|
|
593
|
+
case 'top-left':
|
|
594
|
+
graph.x(ax - (graphWidth - graphHeight * tan) * cos);
|
|
595
|
+
graph.y(ay - (graphWidth * sin + graphHeight * cos));
|
|
596
|
+
break;
|
|
597
|
+
case 'top-right':
|
|
598
|
+
graph.x(ax + graphHeight * sin);
|
|
599
|
+
graph.y(ay - graphHeight * cos);
|
|
600
|
+
break;
|
|
601
|
+
case 'bottom-left':
|
|
602
|
+
graph.x(ax - graphWidth * cos);
|
|
603
|
+
graph.y(ay - graphWidth * sin);
|
|
604
|
+
break;
|
|
605
|
+
case 'bottom-right': // 无需处理
|
|
606
|
+
break;
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
const [graphWidth, graphHeight] = [graph.width(), graph.height()];
|
|
611
|
+
// 更新 矩形 大小
|
|
612
|
+
rect.width(graphWidth);
|
|
613
|
+
rect.height(graphHeight);
|
|
614
|
+
// 更新 调整点 的 锚点 位置
|
|
615
|
+
Rect.updateAnchorShadows(graph, anchors);
|
|
616
|
+
// 更新 图形 的 连接点 的 锚点位置
|
|
617
|
+
Rect.updateLinkAnchorShadows(graph, linkAnchors);
|
|
618
|
+
const stageState = render.getStageState();
|
|
619
|
+
// 更新 调整点 位置
|
|
620
|
+
for (const anchor of anchors) {
|
|
621
|
+
for (const { shape } of anchorAndShadows) {
|
|
622
|
+
if (shape) {
|
|
623
|
+
if (((_e = shape.attrs.anchor) === null || _e === void 0 ? void 0 : _e.adjustType) === anchor.attrs.adjustType) {
|
|
624
|
+
const anchorShadow = graph.find(`.anchor`).find((o) => o.attrs.adjustType === anchor.attrs.adjustType);
|
|
625
|
+
if (anchorShadow) {
|
|
626
|
+
shape.position({
|
|
627
|
+
x: render.toStageValue(anchorShadow.getAbsolutePosition().x - stageState.x),
|
|
628
|
+
y: render.toStageValue(anchorShadow.getAbsolutePosition().y - stageState.y)
|
|
629
|
+
});
|
|
630
|
+
shape.rotation(graph.getAbsoluteRotation());
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
render.redraw([GraphDraw.name, LinkDraw.name, PreviewDraw.name]);
|
|
637
|
+
}
|
|
638
|
+
BaseGraph.adjust(render, graph, graphSnap, adjustShape, anchorAndShadows, startPoint, endPoint, hoverRect);
|
|
639
|
+
}
|
|
640
|
+
/**
|
|
641
|
+
* 提供给 GraphDraw draw 使用
|
|
642
|
+
*/
|
|
643
|
+
static draw(graph, render, adjustAnchor) {
|
|
644
|
+
// 调整点 及其 锚点
|
|
645
|
+
const { anchorAndShadows } = super.draw(graph, render, adjustAnchor);
|
|
646
|
+
return Rect.createAnchorShapes(render, graph, anchorAndShadows, adjustAnchor);
|
|
647
|
+
}
|
|
648
|
+
constructor(render, dropPoint) {
|
|
649
|
+
super(render, dropPoint, {
|
|
650
|
+
type: "Rect",
|
|
651
|
+
anchors: [
|
|
652
|
+
{ adjustType: 'top' },
|
|
653
|
+
{ adjustType: 'bottom' },
|
|
654
|
+
{ adjustType: 'left' },
|
|
655
|
+
{ adjustType: 'right' },
|
|
656
|
+
{ adjustType: 'top-left' },
|
|
657
|
+
{ adjustType: 'top-right' },
|
|
658
|
+
{ adjustType: 'bottom-left' },
|
|
659
|
+
{ adjustType: 'bottom-right' }
|
|
660
|
+
].map((o) => ({ adjustType: o.adjustType })),
|
|
661
|
+
linkAnchors: [
|
|
662
|
+
{ x: 0, y: 0, alias: 'top', direction: 'top' },
|
|
663
|
+
{ x: 0, y: 0, alias: 'bottom', direction: 'bottom' },
|
|
664
|
+
{ x: 0, y: 0, alias: 'left', direction: 'left' },
|
|
665
|
+
{ x: 0, y: 0, alias: 'right', direction: 'right' },
|
|
666
|
+
{ x: 0, y: 0, alias: 'center' }
|
|
667
|
+
]
|
|
668
|
+
});
|
|
669
|
+
this.rect = new Konva.Rect({
|
|
670
|
+
name: 'graph',
|
|
671
|
+
x: 0,
|
|
672
|
+
y: 0,
|
|
673
|
+
width: 0,
|
|
674
|
+
height: 0,
|
|
675
|
+
stroke: this.render.getPageSettings().stroke,
|
|
676
|
+
strokeWidth: this.render.getPageSettings().strokeWidth
|
|
677
|
+
});
|
|
678
|
+
this.group.add(this.rect);
|
|
679
|
+
this.group.position(this.dropPoint);
|
|
680
|
+
}
|
|
681
|
+
// 实现:拖动进行时
|
|
682
|
+
drawMove(point) {
|
|
683
|
+
let offsetX = point.x - this.dropPoint.x, offsetY = point.y - this.dropPoint.y;
|
|
684
|
+
if (offsetX < 1)
|
|
685
|
+
offsetX = 1;
|
|
686
|
+
if (offsetY < 1)
|
|
687
|
+
offsetY = 1;
|
|
688
|
+
// 矩形 位置大小
|
|
689
|
+
this.rect.width(offsetX);
|
|
690
|
+
this.rect.height(offsetY);
|
|
691
|
+
this.group.size({ width: offsetX, height: offsetY });
|
|
692
|
+
Rect.updateAnchorShadows(this.group, this.anchorShadows);
|
|
693
|
+
Rect.updateLinkAnchorShadows(this.group, this.linkAnchorShadows);
|
|
694
|
+
this.render.redraw([GraphDraw.name, LinkDraw.name, PreviewDraw.name]);
|
|
695
|
+
}
|
|
696
|
+
// 实现:拖动结束
|
|
697
|
+
drawEnd() {
|
|
698
|
+
if (this.rect.width() <= 1 && this.rect.height() <= 1) {
|
|
699
|
+
const width = Rect.size, height = width;
|
|
700
|
+
this.rect.width(width - this.rect.strokeWidth());
|
|
701
|
+
this.rect.height(height - this.rect.strokeWidth());
|
|
702
|
+
this.group.size({ width, height });
|
|
703
|
+
Rect.updateAnchorShadows(this.group, this.anchorShadows);
|
|
704
|
+
Rect.updateLinkAnchorShadows(this.group, this.linkAnchorShadows);
|
|
705
|
+
this.render.attractTool.alignLinesClear();
|
|
706
|
+
this.render.updateHistory();
|
|
707
|
+
this.render.redraw([GraphDraw.name, LinkDraw.name, PreviewDraw.name]);
|
|
708
|
+
}
|
|
709
|
+
super.drawEnd();
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
/**
|
|
713
|
+
* 默认图形大小
|
|
714
|
+
*/
|
|
715
|
+
Rect.size = 100;
|
|
716
|
+
//# sourceMappingURL=rect.js.map
|