@king-design/react 2.0.0-beta.0
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/README.md +22 -0
- package/__tests__/__snapshots__/React Demos.md +1769 -0
- package/__tests__/components/dropdown.spec.tsx +35 -0
- package/__tests__/index.ts +46 -0
- package/__tests__/karma.conf.js +52 -0
- package/__tests__/webpack.config.js +17 -0
- package/components/affix/index.d.ts +32 -0
- package/components/affix/index.js +35 -0
- package/components/affix/index.spec.d.ts +4 -0
- package/components/affix/index.spec.js +132 -0
- package/components/affix/index.vdt.js +35 -0
- package/components/affix/styles.d.ts +5 -0
- package/components/affix/styles.js +18 -0
- package/components/affix/useStyle.d.ts +8 -0
- package/components/affix/useStyle.js +125 -0
- package/components/badge/index.d.ts +13 -0
- package/components/badge/index.js +21 -0
- package/components/badge/index.vdt.js +32 -0
- package/components/badge/styles.d.ts +5 -0
- package/components/badge/styles.js +28 -0
- package/components/breadcrumb/index.d.ts +18 -0
- package/components/breadcrumb/index.js +28 -0
- package/components/breadcrumb/index.spec.d.ts +4 -0
- package/components/breadcrumb/index.spec.js +46 -0
- package/components/breadcrumb/index.vdt.js +62 -0
- package/components/breadcrumb/item.d.ts +13 -0
- package/components/breadcrumb/item.js +52 -0
- package/components/breadcrumb/item.vdt.js +27 -0
- package/components/breadcrumb/styles.d.ts +5 -0
- package/components/breadcrumb/styles.js +30 -0
- package/components/button/constants.d.ts +4 -0
- package/components/button/constants.js +3 -0
- package/components/button/dynamicButton.d.ts +11 -0
- package/components/button/dynamicButton.js +24 -0
- package/components/button/group.d.ts +17 -0
- package/components/button/group.js +51 -0
- package/components/button/group.vdt.js +29 -0
- package/components/button/index.d.ts +51 -0
- package/components/button/index.js +121 -0
- package/components/button/index.spec.d.ts +4 -0
- package/components/button/index.spec.js +129 -0
- package/components/button/index.vdt.js +95 -0
- package/components/button/styles.d.ts +11 -0
- package/components/button/styles.js +257 -0
- package/components/card/column.d.ts +12 -0
- package/components/card/column.js +20 -0
- package/components/card/column.vdt.js +38 -0
- package/components/card/index.d.ts +21 -0
- package/components/card/index.js +29 -0
- package/components/card/index.vdt.js +79 -0
- package/components/card/styles.d.ts +5 -0
- package/components/card/styles.js +23 -0
- package/components/carousel/index.d.ts +26 -0
- package/components/carousel/index.js +106 -0
- package/components/carousel/index.spec.d.ts +4 -0
- package/components/carousel/index.spec.js +200 -0
- package/components/carousel/index.vdt.js +79 -0
- package/components/carousel/item.d.ts +12 -0
- package/components/carousel/item.js +20 -0
- package/components/carousel/item.vdt.js +35 -0
- package/components/carousel/styles.d.ts +6 -0
- package/components/carousel/styles.js +46 -0
- package/components/carousel/useAutoplay.d.ts +7 -0
- package/components/carousel/useAutoplay.js +37 -0
- package/components/carousel/useItems.d.ts +9 -0
- package/components/carousel/useItems.js +93 -0
- package/components/carousel/useSlide.d.ts +12 -0
- package/components/carousel/useSlide.js +191 -0
- package/components/cascader/index.d.ts +37 -0
- package/components/cascader/index.js +93 -0
- package/components/cascader/index.spec.d.ts +4 -0
- package/components/cascader/index.spec.js +283 -0
- package/components/cascader/index.vdt.js +151 -0
- package/components/cascader/styles.d.ts +6 -0
- package/components/cascader/styles.js +52 -0
- package/components/cascader/useFilterable.d.ts +11 -0
- package/components/cascader/useFilterable.js +65 -0
- package/components/cascader/useLabel.d.ts +6 -0
- package/components/cascader/useLabel.js +43 -0
- package/components/cascader/useLoad.d.ts +5 -0
- package/components/cascader/useLoad.js +54 -0
- package/components/cascader/useValue.d.ts +14 -0
- package/components/cascader/useValue.js +125 -0
- package/components/checkbox/index.d.ts +27 -0
- package/components/checkbox/index.js +122 -0
- package/components/checkbox/index.spec.d.ts +4 -0
- package/components/checkbox/index.spec.js +217 -0
- package/components/checkbox/index.vdt.js +67 -0
- package/components/checkbox/styles.d.ts +5 -0
- package/components/checkbox/styles.js +77 -0
- package/components/code/crossDomain.d.ts +4 -0
- package/components/code/crossDomain.js +48 -0
- package/components/code/index.d.ts +26 -0
- package/components/code/index.js +58 -0
- package/components/code/index.spec.d.ts +4 -0
- package/components/code/index.spec.js +73 -0
- package/components/code/index.vdt.js +54 -0
- package/components/code/styles.d.ts +5 -0
- package/components/code/styles.js +16 -0
- package/components/code/useEditor.d.ts +9 -0
- package/components/code/useEditor.js +81 -0
- package/components/collapse/index.d.ts +23 -0
- package/components/collapse/index.js +57 -0
- package/components/collapse/index.spec.d.ts +4 -0
- package/components/collapse/index.spec.js +84 -0
- package/components/collapse/index.vdt.js +47 -0
- package/components/collapse/item.d.ts +24 -0
- package/components/collapse/item.js +52 -0
- package/components/collapse/item.vdt.js +64 -0
- package/components/collapse/styles.d.ts +7 -0
- package/components/collapse/styles.js +33 -0
- package/components/colorpicker/drag.d.ts +18 -0
- package/components/colorpicker/drag.js +27 -0
- package/components/colorpicker/drag.vdt.js +12 -0
- package/components/colorpicker/index.d.ts +18 -0
- package/components/colorpicker/index.js +35 -0
- package/components/colorpicker/index.spec.d.ts +4 -0
- package/components/colorpicker/index.spec.js +312 -0
- package/components/colorpicker/index.vdt.js +54 -0
- package/components/colorpicker/panel.d.ts +14 -0
- package/components/colorpicker/panel.js +31 -0
- package/components/colorpicker/panel.vdt.js +166 -0
- package/components/colorpicker/styles.d.ts +8 -0
- package/components/colorpicker/styles.js +135 -0
- package/components/colorpicker/useDrag.d.ts +6 -0
- package/components/colorpicker/useDrag.js +42 -0
- package/components/colorpicker/useInput.d.ts +19 -0
- package/components/colorpicker/useInput.js +78 -0
- package/components/colorpicker/usePointer.d.ts +9 -0
- package/components/colorpicker/usePointer.js +53 -0
- package/components/colorpicker/useValue.d.ts +14 -0
- package/components/colorpicker/useValue.js +58 -0
- package/components/context.d.ts +14 -0
- package/components/context.js +90 -0
- package/components/datepicker/basepicker.d.ts +62 -0
- package/components/datepicker/basepicker.js +341 -0
- package/components/datepicker/calendar.d.ts +81 -0
- package/components/datepicker/calendar.js +66 -0
- package/components/datepicker/calendar.vdt.js +128 -0
- package/components/datepicker/constants.d.ts +16 -0
- package/components/datepicker/constants.js +20 -0
- package/components/datepicker/dayjs.d.ts +6 -0
- package/components/datepicker/dayjs.js +6 -0
- package/components/datepicker/helpers.d.ts +13 -0
- package/components/datepicker/helpers.js +86 -0
- package/components/datepicker/index.d.ts +66 -0
- package/components/datepicker/index.js +123 -0
- package/components/datepicker/index.spec.d.ts +4 -0
- package/components/datepicker/index.spec.js +1703 -0
- package/components/datepicker/index.vdt.js +142 -0
- package/components/datepicker/shortcuts.d.ts +24 -0
- package/components/datepicker/shortcuts.js +140 -0
- package/components/datepicker/styles.d.ts +9 -0
- package/components/datepicker/styles.js +89 -0
- package/components/datepicker/time.d.ts +33 -0
- package/components/datepicker/time.js +107 -0
- package/components/datepicker/time.vdt.js +48 -0
- package/components/datepicker/useDays.d.ts +19 -0
- package/components/datepicker/useDays.js +47 -0
- package/components/datepicker/useDisabled.d.ts +14 -0
- package/components/datepicker/useDisabled.js +97 -0
- package/components/datepicker/useFocusDate.d.ts +8 -0
- package/components/datepicker/useFocusDate.js +18 -0
- package/components/datepicker/useFormats.d.ts +13 -0
- package/components/datepicker/useFormats.js +57 -0
- package/components/datepicker/useKeyboards.d.ts +8 -0
- package/components/datepicker/useKeyboards.js +98 -0
- package/components/datepicker/useMonths.d.ts +18 -0
- package/components/datepicker/useMonths.js +47 -0
- package/components/datepicker/usePanel.d.ts +21 -0
- package/components/datepicker/usePanel.js +57 -0
- package/components/datepicker/useShowDate.d.ts +19 -0
- package/components/datepicker/useShowDate.js +160 -0
- package/components/datepicker/useStatus.d.ts +11 -0
- package/components/datepicker/useStatus.js +62 -0
- package/components/datepicker/useValue.d.ts +19 -0
- package/components/datepicker/useValue.js +84 -0
- package/components/datepicker/useYears.d.ts +21 -0
- package/components/datepicker/useYears.js +72 -0
- package/components/diagram/constants.d.ts +6 -0
- package/components/diagram/constants.js +5 -0
- package/components/diagram/defaultStyle.d.ts +117 -0
- package/components/diagram/defaultStyle.js +116 -0
- package/components/diagram/diagram.d.ts +43 -0
- package/components/diagram/diagram.js +176 -0
- package/components/diagram/diagram.vdt.js +25 -0
- package/components/diagram/graph.d.ts +5 -0
- package/components/diagram/graph.js +30 -0
- package/components/diagram/index.d.ts +25 -0
- package/components/diagram/index.js +30 -0
- package/components/diagram/index.spec.d.ts +4 -0
- package/components/diagram/index.spec.js +631 -0
- package/components/diagram/layouts/circle.d.ts +19 -0
- package/components/diagram/layouts/circle.js +56 -0
- package/components/diagram/layouts/flow.d.ts +19 -0
- package/components/diagram/layouts/flow.js +69 -0
- package/components/diagram/layouts/layout.d.ts +28 -0
- package/components/diagram/layouts/layout.js +113 -0
- package/components/diagram/layouts/organic.d.ts +18 -0
- package/components/diagram/layouts/organic.js +51 -0
- package/components/diagram/layouts/partition.d.ts +17 -0
- package/components/diagram/layouts/partition.js +55 -0
- package/components/diagram/layouts/radial.d.ts +21 -0
- package/components/diagram/layouts/radial.js +72 -0
- package/components/diagram/layouts/stack.d.ts +19 -0
- package/components/diagram/layouts/stack.js +66 -0
- package/components/diagram/layouts/tree.d.ts +22 -0
- package/components/diagram/layouts/tree.js +77 -0
- package/components/diagram/mxgraph/handler/mxConnectionHandler.d.ts +4 -0
- package/components/diagram/mxgraph/handler/mxConnectionHandler.js +53 -0
- package/components/diagram/mxgraph/handler/mxConstraintHandler.d.ts +5 -0
- package/components/diagram/mxgraph/handler/mxConstraintHandler.js +16 -0
- package/components/diagram/mxgraph/handler/mxEdgeHandler.d.ts +5 -0
- package/components/diagram/mxgraph/handler/mxEdgeHandler.js +45 -0
- package/components/diagram/mxgraph/handler/mxGraphHandler.d.ts +4 -0
- package/components/diagram/mxgraph/handler/mxGraphHandler.js +25 -0
- package/components/diagram/mxgraph/handler/mxRubberband.d.ts +4 -0
- package/components/diagram/mxgraph/handler/mxRubberband.js +10 -0
- package/components/diagram/mxgraph/handler/mxVertexHandler.d.ts +7 -0
- package/components/diagram/mxgraph/handler/mxVertexHandler.js +32 -0
- package/components/diagram/mxgraph/index.d.ts +5 -0
- package/components/diagram/mxgraph/index.js +49 -0
- package/components/diagram/mxgraph/mx.d.ts +6 -0
- package/components/diagram/mxgraph/mx.js +16 -0
- package/components/diagram/mxgraph/shape/mxCloud.d.ts +4 -0
- package/components/diagram/mxgraph/shape/mxCloud.js +9 -0
- package/components/diagram/mxgraph/shape/mxCylinder.d.ts +4 -0
- package/components/diagram/mxgraph/shape/mxCylinder.js +32 -0
- package/components/diagram/mxgraph/shape/mxEllipse.d.ts +4 -0
- package/components/diagram/mxgraph/shape/mxEllipse.js +9 -0
- package/components/diagram/mxgraph/shape/mxHexagon.d.ts +4 -0
- package/components/diagram/mxgraph/shape/mxHexagon.js +9 -0
- package/components/diagram/mxgraph/shape/mxLine.d.ts +4 -0
- package/components/diagram/mxgraph/shape/mxLine.js +9 -0
- package/components/diagram/mxgraph/shape/mxRectangleShape.d.ts +4 -0
- package/components/diagram/mxgraph/shape/mxRectangleShape.js +9 -0
- package/components/diagram/mxgraph/shape/mxRhombus.d.ts +4 -0
- package/components/diagram/mxgraph/shape/mxRhombus.js +41 -0
- package/components/diagram/mxgraph/shape/mxShape.d.ts +4 -0
- package/components/diagram/mxgraph/shape/mxShape.js +10 -0
- package/components/diagram/mxgraph/shape/mxTriangle.d.ts +4 -0
- package/components/diagram/mxgraph/shape/mxTriangle.js +9 -0
- package/components/diagram/mxgraph/util/mxConstants.d.ts +4 -0
- package/components/diagram/mxgraph/util/mxConstants.js +21 -0
- package/components/diagram/mxgraph/util/mxGuide.d.ts +4 -0
- package/components/diagram/mxgraph/util/mxGuide.js +22 -0
- package/components/diagram/mxgraph/view/mxCellEditor.d.ts +4 -0
- package/components/diagram/mxgraph/view/mxCellEditor.js +96 -0
- package/components/diagram/mxgraph/view/mxCellRenderer.d.ts +4 -0
- package/components/diagram/mxgraph/view/mxCellRenderer.js +15 -0
- package/components/diagram/mxgraph/view/mxGraph.d.ts +4 -0
- package/components/diagram/mxgraph/view/mxGraph.js +141 -0
- package/components/diagram/shapes/base.d.ts +45 -0
- package/components/diagram/shapes/base.js +156 -0
- package/components/diagram/shapes/callout.d.ts +24 -0
- package/components/diagram/shapes/callout.js +80 -0
- package/components/diagram/shapes/circle.d.ts +25 -0
- package/components/diagram/shapes/circle.js +38 -0
- package/components/diagram/shapes/document.d.ts +24 -0
- package/components/diagram/shapes/document.js +71 -0
- package/components/diagram/shapes/ellipse.d.ts +24 -0
- package/components/diagram/shapes/ellipse.js +30 -0
- package/components/diagram/shapes/generateShapes.d.ts +32 -0
- package/components/diagram/shapes/generateShapes.js +62 -0
- package/components/diagram/shapes/hexagon.d.ts +24 -0
- package/components/diagram/shapes/hexagon.js +101 -0
- package/components/diagram/shapes/image.d.ts +30 -0
- package/components/diagram/shapes/image.js +38 -0
- package/components/diagram/shapes/line.d.ts +46 -0
- package/components/diagram/shapes/line.js +193 -0
- package/components/diagram/shapes/parallelogram.d.ts +24 -0
- package/components/diagram/shapes/parallelogram.js +103 -0
- package/components/diagram/shapes/rectangle.d.ts +30 -0
- package/components/diagram/shapes/rectangle.js +38 -0
- package/components/diagram/shapes/shape.d.ts +35 -0
- package/components/diagram/shapes/shape.js +153 -0
- package/components/diagram/shapes/square.d.ts +26 -0
- package/components/diagram/shapes/square.js +40 -0
- package/components/diagram/shapes/text.d.ts +24 -0
- package/components/diagram/shapes/text.js +28 -0
- package/components/diagram/styles.d.ts +5 -0
- package/components/diagram/styles.js +16 -0
- package/components/dialog/alert.vdt.js +71 -0
- package/components/dialog/base.d.ts +70 -0
- package/components/dialog/base.js +167 -0
- package/components/dialog/base.vdt.js +146 -0
- package/components/dialog/constants.d.ts +6 -0
- package/components/dialog/constants.js +5 -0
- package/components/dialog/index.d.ts +24 -0
- package/components/dialog/index.js +104 -0
- package/components/dialog/index.spec.d.ts +4 -0
- package/components/dialog/index.spec.js +654 -0
- package/components/dialog/staticMethods.d.ts +13 -0
- package/components/dialog/staticMethods.js +66 -0
- package/components/dialog/styles.d.ts +7 -0
- package/components/dialog/styles.js +100 -0
- package/components/dialog/useDraggable.d.ts +8 -0
- package/components/dialog/useDraggable.js +56 -0
- package/components/dialog/useEscClosable.d.ts +4 -0
- package/components/dialog/useEscClosable.js +46 -0
- package/components/dialog/useFixBody.d.ts +5 -0
- package/components/dialog/useFixBody.js +71 -0
- package/components/dialog/usePosition.d.ts +5 -0
- package/components/dialog/usePosition.js +42 -0
- package/components/drawer/index.d.ts +14 -0
- package/components/drawer/index.js +30 -0
- package/components/drawer/index.spec.d.ts +4 -0
- package/components/drawer/index.spec.js +164 -0
- package/components/drawer/index.vdt.js +38 -0
- package/components/drawer/styles.d.ts +9 -0
- package/components/drawer/styles.js +45 -0
- package/components/dropdown/dropdown.d.ts +60 -0
- package/components/dropdown/dropdown.js +314 -0
- package/components/dropdown/index.d.ts +12 -0
- package/components/dropdown/index.js +39 -0
- package/components/dropdown/index.spec.d.ts +4 -0
- package/components/dropdown/index.spec.js +488 -0
- package/components/dropdown/item.d.ts +29 -0
- package/components/dropdown/item.js +117 -0
- package/components/dropdown/item.vdt.js +32 -0
- package/components/dropdown/menu.d.ts +24 -0
- package/components/dropdown/menu.js +108 -0
- package/components/dropdown/menu.vdt.js +53 -0
- package/components/dropdown/styles.d.ts +6 -0
- package/components/dropdown/styles.js +58 -0
- package/components/dropdown/useKeyboard.d.ts +26 -0
- package/components/dropdown/useKeyboard.js +195 -0
- package/components/dropdown/usePosition.d.ts +11 -0
- package/components/dropdown/usePosition.js +115 -0
- package/components/dropdown/useTransition.d.ts +11 -0
- package/components/dropdown/useTransition.js +80 -0
- package/components/editable/index.d.ts +32 -0
- package/components/editable/index.js +133 -0
- package/components/editable/index.spec.d.ts +4 -0
- package/components/editable/index.spec.js +225 -0
- package/components/editable/index.vdt.js +47 -0
- package/components/editable/styles.d.ts +7 -0
- package/components/editable/styles.js +27 -0
- package/components/form/form.d.ts +41 -0
- package/components/form/form.js +103 -0
- package/components/form/form.vdt.js +29 -0
- package/components/form/index.d.ts +5 -0
- package/components/form/index.js +4 -0
- package/components/form/index.spec.d.ts +4 -0
- package/components/form/index.spec.js +1322 -0
- package/components/form/item.d.ts +40 -0
- package/components/form/item.js +76 -0
- package/components/form/item.vdt.js +130 -0
- package/components/form/methods.d.ts +10 -0
- package/components/form/methods.js +175 -0
- package/components/form/styles.d.ts +6 -0
- package/components/form/styles.js +63 -0
- package/components/form/useDirty.d.ts +9 -0
- package/components/form/useDirty.js +41 -0
- package/components/form/useError.d.ts +11 -0
- package/components/form/useError.js +59 -0
- package/components/form/useValidate.d.ts +14 -0
- package/components/form/useValidate.js +118 -0
- package/components/grid/col.d.ts +20 -0
- package/components/grid/col.js +43 -0
- package/components/grid/col.vdt.js +42 -0
- package/components/grid/constants.d.ts +19 -0
- package/components/grid/constants.js +14 -0
- package/components/grid/index.d.ts +5 -0
- package/components/grid/index.js +4 -0
- package/components/grid/row.d.ts +15 -0
- package/components/grid/row.js +34 -0
- package/components/grid/row.vdt.js +36 -0
- package/components/grid/styles.d.ts +6 -0
- package/components/grid/styles.js +56 -0
- package/components/grid/useBreakpoints.d.ts +6 -0
- package/components/grid/useBreakpoints.js +51 -0
- package/components/grid/useGutter.d.ts +11 -0
- package/components/grid/useGutter.js +104 -0
- package/components/icon/index.d.ts +18 -0
- package/components/icon/index.js +48 -0
- package/components/icon/index.vdt.js +50 -0
- package/components/icon/styles.d.ts +9 -0
- package/components/icon/styles.js +35 -0
- package/components/input/index.d.ts +58 -0
- package/components/input/index.js +99 -0
- package/components/input/index.spec.d.ts +4 -0
- package/components/input/index.spec.js +129 -0
- package/components/input/index.vdt.js +126 -0
- package/components/input/search.d.ts +29 -0
- package/components/input/search.js +102 -0
- package/components/input/search.vdt.js +52 -0
- package/components/input/styles.d.ts +6 -0
- package/components/input/styles.js +132 -0
- package/components/input/useAutoWidth.d.ts +7 -0
- package/components/input/useAutoWidth.js +31 -0
- package/components/input/useFrozen.d.ts +12 -0
- package/components/input/useFrozen.js +49 -0
- package/components/layout/aside.d.ts +18 -0
- package/components/layout/aside.js +68 -0
- package/components/layout/aside.vdt.js +44 -0
- package/components/layout/body.d.ts +10 -0
- package/components/layout/body.js +57 -0
- package/components/layout/footer.d.ts +8 -0
- package/components/layout/footer.js +28 -0
- package/components/layout/header.d.ts +19 -0
- package/components/layout/header.js +76 -0
- package/components/layout/helpers.d.ts +8 -0
- package/components/layout/helpers.js +10 -0
- package/components/layout/index.d.ts +8 -0
- package/components/layout/index.js +7 -0
- package/components/layout/layout.d.ts +18 -0
- package/components/layout/layout.js +75 -0
- package/components/layout/styles.d.ts +9 -0
- package/components/layout/styles.js +81 -0
- package/components/layout/template.vdt.js +20 -0
- package/components/layout/useParse.d.ts +10 -0
- package/components/layout/useParse.js +65 -0
- package/components/menu/index.d.ts +5 -0
- package/components/menu/index.js +4 -0
- package/components/menu/index.spec.d.ts +4 -0
- package/components/menu/index.spec.js +218 -0
- package/components/menu/item.d.ts +29 -0
- package/components/menu/item.js +88 -0
- package/components/menu/item.vdt.js +103 -0
- package/components/menu/menu.d.ts +29 -0
- package/components/menu/menu.js +61 -0
- package/components/menu/menu.vdt.js +57 -0
- package/components/menu/styles.d.ts +9 -0
- package/components/menu/styles.js +138 -0
- package/components/menu/useDropdown.d.ts +19 -0
- package/components/menu/useDropdown.js +83 -0
- package/components/menu/useExpanded.d.ts +13 -0
- package/components/menu/useExpanded.js +80 -0
- package/components/menu/useHighlight.d.ts +13 -0
- package/components/menu/useHighlight.js +60 -0
- package/components/message/index.d.ts +4 -0
- package/components/message/index.js +3 -0
- package/components/message/index.spec.d.ts +4 -0
- package/components/message/index.spec.js +97 -0
- package/components/message/message.d.ts +23 -0
- package/components/message/message.js +112 -0
- package/components/message/message.vdt.js +54 -0
- package/components/message/messages.d.ts +11 -0
- package/components/message/messages.js +51 -0
- package/components/message/messages.vdt.js +20 -0
- package/components/message/styles.d.ts +6 -0
- package/components/message/styles.js +62 -0
- package/components/pagination/index.d.ts +40 -0
- package/components/pagination/index.js +167 -0
- package/components/pagination/index.spec.d.ts +4 -0
- package/components/pagination/index.spec.js +146 -0
- package/components/pagination/index.vdt.js +173 -0
- package/components/pagination/styles.d.ts +5 -0
- package/components/pagination/styles.js +65 -0
- package/components/portal.d.ts +23 -0
- package/components/portal.js +148 -0
- package/components/position.d.ts +77 -0
- package/components/position.js +489 -0
- package/components/progress/index.d.ts +31 -0
- package/components/progress/index.js +72 -0
- package/components/progress/index.spec.d.ts +4 -0
- package/components/progress/index.spec.js +235 -0
- package/components/progress/index.vdt.js +82 -0
- package/components/progress/styles.d.ts +6 -0
- package/components/progress/styles.js +88 -0
- package/components/progress/useColor.d.ts +7 -0
- package/components/progress/useColor.js +36 -0
- package/components/progress/useStatus.d.ts +4 -0
- package/components/progress/useStatus.js +24 -0
- package/components/radio/index.d.ts +24 -0
- package/components/radio/index.js +84 -0
- package/components/radio/index.spec.d.ts +4 -0
- package/components/radio/index.spec.js +192 -0
- package/components/radio/index.vdt.js +66 -0
- package/components/radio/styles.d.ts +5 -0
- package/components/radio/styles.js +49 -0
- package/components/rate/index.d.ts +25 -0
- package/components/rate/index.js +48 -0
- package/components/rate/index.spec.d.ts +4 -0
- package/components/rate/index.spec.js +112 -0
- package/components/rate/index.vdt.js +76 -0
- package/components/rate/styles.d.ts +5 -0
- package/components/rate/styles.js +28 -0
- package/components/rate/useActiveValue.d.ts +9 -0
- package/components/rate/useActiveValue.js +42 -0
- package/components/scrollSelect/index.d.ts +30 -0
- package/components/scrollSelect/index.js +48 -0
- package/components/scrollSelect/index.spec.d.ts +4 -0
- package/components/scrollSelect/index.spec.js +174 -0
- package/components/scrollSelect/index.vdt.js +59 -0
- package/components/scrollSelect/styles.d.ts +7 -0
- package/components/scrollSelect/styles.js +38 -0
- package/components/scrollSelect/useList.d.ts +9 -0
- package/components/scrollSelect/useList.js +82 -0
- package/components/scrollSelect/useMouseEvents.d.ts +12 -0
- package/components/scrollSelect/useMouseEvents.js +112 -0
- package/components/scrollSelect/useTranslate.d.ts +12 -0
- package/components/scrollSelect/useTranslate.js +78 -0
- package/components/select/base.d.ts +63 -0
- package/components/select/base.js +156 -0
- package/components/select/base.vdt.js +194 -0
- package/components/select/constants.d.ts +5 -0
- package/components/select/constants.js +4 -0
- package/components/select/group.d.ts +17 -0
- package/components/select/group.js +31 -0
- package/components/select/group.vdt.js +41 -0
- package/components/select/index.d.ts +6 -0
- package/components/select/index.js +5 -0
- package/components/select/index.spec.d.ts +4 -0
- package/components/select/index.spec.js +680 -0
- package/components/select/menu.d.ts +13 -0
- package/components/select/menu.js +31 -0
- package/components/select/menu.vdt.js +138 -0
- package/components/select/option.d.ts +16 -0
- package/components/select/option.js +74 -0
- package/components/select/option.vdt.js +65 -0
- package/components/select/select.d.ts +36 -0
- package/components/select/select.js +93 -0
- package/components/select/select.vdt.js +62 -0
- package/components/select/styles.d.ts +7 -0
- package/components/select/styles.js +201 -0
- package/components/select/useBaseLabel.d.ts +12 -0
- package/components/select/useBaseLabel.js +80 -0
- package/components/select/useCard.d.ts +11 -0
- package/components/select/useCard.js +41 -0
- package/components/select/useEqualWidth.d.ts +4 -0
- package/components/select/useEqualWidth.js +16 -0
- package/components/select/useFilterable.d.ts +10 -0
- package/components/select/useFilterable.js +120 -0
- package/components/select/useFocusout.d.ts +12 -0
- package/components/select/useFocusout.js +49 -0
- package/components/select/useInput.d.ts +10 -0
- package/components/select/useInput.js +53 -0
- package/components/select/useLabel.d.ts +8 -0
- package/components/select/useLabel.js +59 -0
- package/components/select/useSearchable.d.ts +14 -0
- package/components/select/useSearchable.js +71 -0
- package/components/slider/index.d.ts +50 -0
- package/components/slider/index.js +86 -0
- package/components/slider/index.spec.d.ts +4 -0
- package/components/slider/index.spec.js +737 -0
- package/components/slider/index.vdt.js +154 -0
- package/components/slider/styles.d.ts +5 -0
- package/components/slider/styles.js +79 -0
- package/components/slider/useClick.d.ts +9 -0
- package/components/slider/useClick.js +46 -0
- package/components/slider/useDraggable.d.ts +16 -0
- package/components/slider/useDraggable.js +107 -0
- package/components/slider/useKeyboard.d.ts +10 -0
- package/components/slider/useKeyboard.js +59 -0
- package/components/slider/useMarks.d.ts +18 -0
- package/components/slider/useMarks.js +59 -0
- package/components/slider/usePoints.d.ts +16 -0
- package/components/slider/usePoints.js +85 -0
- package/components/slider/useStyles.d.ts +12 -0
- package/components/slider/useStyles.js +69 -0
- package/components/slider/useTooltip.d.ts +13 -0
- package/components/slider/useTooltip.js +70 -0
- package/components/slider/useValue.d.ts +12 -0
- package/components/slider/useValue.js +100 -0
- package/components/spin/index.d.ts +20 -0
- package/components/spin/index.js +30 -0
- package/components/spin/index.vdt.js +51 -0
- package/components/spin/styles.d.ts +5 -0
- package/components/spin/styles.js +36 -0
- package/components/spinner/index.d.ts +47 -0
- package/components/spinner/index.js +106 -0
- package/components/spinner/index.spec.d.ts +4 -0
- package/components/spinner/index.spec.js +553 -0
- package/components/spinner/index.vdt.js +73 -0
- package/components/spinner/styles.d.ts +5 -0
- package/components/spinner/styles.js +70 -0
- package/components/spinner/useChange.d.ts +11 -0
- package/components/spinner/useChange.js +55 -0
- package/components/spinner/useFormatter.d.ts +7 -0
- package/components/spinner/useFormatter.js +49 -0
- package/components/spinner/useStep.d.ts +16 -0
- package/components/spinner/useStep.js +100 -0
- package/components/spinner/useValue.d.ts +17 -0
- package/components/spinner/useValue.js +91 -0
- package/components/split/index.d.ts +31 -0
- package/components/split/index.js +55 -0
- package/components/split/index.spec.d.ts +4 -0
- package/components/split/index.spec.js +332 -0
- package/components/split/index.vdt.js +69 -0
- package/components/split/style.d.ts +7 -0
- package/components/split/style.js +57 -0
- package/components/split/useDraggable.d.ts +11 -0
- package/components/split/useDraggable.js +151 -0
- package/components/split/useSize.d.ts +7 -0
- package/components/split/useSize.js +35 -0
- package/components/steps/context.d.ts +7 -0
- package/components/steps/context.js +4 -0
- package/components/steps/index.d.ts +17 -0
- package/components/steps/index.js +49 -0
- package/components/steps/index.spec.d.ts +4 -0
- package/components/steps/index.spec.js +44 -0
- package/components/steps/index.vdt.js +52 -0
- package/components/steps/step.d.ts +12 -0
- package/components/steps/step.js +20 -0
- package/components/steps/step.vdt.js +49 -0
- package/components/steps/styles.d.ts +6 -0
- package/components/steps/styles.js +156 -0
- package/components/switch/index.d.ts +41 -0
- package/components/switch/index.js +115 -0
- package/components/switch/index.spec.d.ts +4 -0
- package/components/switch/index.spec.js +267 -0
- package/components/switch/index.vdt.js +135 -0
- package/components/switch/styles.d.ts +5 -0
- package/components/switch/styles.js +87 -0
- package/components/switch/useDraggable.d.ts +10 -0
- package/components/switch/useDraggable.js +75 -0
- package/components/table/cell.d.ts +25 -0
- package/components/table/cell.js +34 -0
- package/components/table/cell.vdt.js +67 -0
- package/components/table/column.d.ts +38 -0
- package/components/table/column.js +50 -0
- package/components/table/column.vdt.js +149 -0
- package/components/table/exportTable.d.ts +6 -0
- package/components/table/exportTable.js +82 -0
- package/components/table/index.d.ts +5 -0
- package/components/table/index.js +4 -0
- package/components/table/index.spec.d.ts +4 -0
- package/components/table/index.spec.js +1044 -0
- package/components/table/row.d.ts +49 -0
- package/components/table/row.js +122 -0
- package/components/table/row.vdt.js +128 -0
- package/components/table/styles.d.ts +6 -0
- package/components/table/styles.js +86 -0
- package/components/table/table.d.ts +97 -0
- package/components/table/table.js +238 -0
- package/components/table/table.vdt.js +332 -0
- package/components/table/useChecked.d.ts +27 -0
- package/components/table/useChecked.js +242 -0
- package/components/table/useColumns.d.ts +19 -0
- package/components/table/useColumns.js +111 -0
- package/components/table/useDisableRow.d.ts +11 -0
- package/components/table/useDisableRow.js +59 -0
- package/components/table/useDraggable.d.ts +11 -0
- package/components/table/useDraggable.js +62 -0
- package/components/table/useExpandable.d.ts +7 -0
- package/components/table/useExpandable.js +26 -0
- package/components/table/useFixedColumns.d.ts +27 -0
- package/components/table/useFixedColumns.js +142 -0
- package/components/table/useGroup.d.ts +17 -0
- package/components/table/useGroup.js +70 -0
- package/components/table/useMerge.d.ts +18 -0
- package/components/table/useMerge.js +79 -0
- package/components/table/useResizable.d.ts +14 -0
- package/components/table/useResizable.js +62 -0
- package/components/table/useRestRowStatus.d.ts +7 -0
- package/components/table/useRestRowStatus.js +47 -0
- package/components/table/useScroll.d.ts +9 -0
- package/components/table/useScroll.js +32 -0
- package/components/table/useSelected.d.ts +7 -0
- package/components/table/useSelected.js +31 -0
- package/components/table/useSortable.d.ts +10 -0
- package/components/table/useSortable.js +36 -0
- package/components/table/useStickyHeader.d.ts +12 -0
- package/components/table/useStickyHeader.js +36 -0
- package/components/table/useStickyScrollbar.d.ts +15 -0
- package/components/table/useStickyScrollbar.js +86 -0
- package/components/table/useTree.d.ts +10 -0
- package/components/table/useTree.js +61 -0
- package/components/table/useWidth.d.ts +13 -0
- package/components/table/useWidth.js +129 -0
- package/components/tabs/constants.d.ts +4 -0
- package/components/tabs/constants.js +3 -0
- package/components/tabs/index.d.ts +30 -0
- package/components/tabs/index.js +119 -0
- package/components/tabs/index.spec.d.ts +4 -0
- package/components/tabs/index.spec.js +98 -0
- package/components/tabs/index.vdt.js +62 -0
- package/components/tabs/styles.d.ts +5 -0
- package/components/tabs/styles.js +95 -0
- package/components/tabs/tab.d.ts +19 -0
- package/components/tabs/tab.js +55 -0
- package/components/tabs/tab.vdt.js +46 -0
- package/components/tabs/useActiveBar.d.ts +4 -0
- package/components/tabs/useActiveBar.js +61 -0
- package/components/tabs/useScroll.d.ts +13 -0
- package/components/tabs/useScroll.js +116 -0
- package/components/tag/base.d.ts +26 -0
- package/components/tag/base.js +54 -0
- package/components/tag/index.d.ts +7 -0
- package/components/tag/index.js +19 -0
- package/components/tag/index.spec.d.ts +4 -0
- package/components/tag/index.spec.js +42 -0
- package/components/tag/index.vdt.js +63 -0
- package/components/tag/styles.d.ts +5 -0
- package/components/tag/styles.js +95 -0
- package/components/timeline/index.d.ts +5 -0
- package/components/timeline/index.js +4 -0
- package/components/timeline/item.d.ts +20 -0
- package/components/timeline/item.js +31 -0
- package/components/timeline/item.vdt.js +39 -0
- package/components/timeline/styles.d.ts +10 -0
- package/components/timeline/styles.js +67 -0
- package/components/timeline/timeline.d.ts +9 -0
- package/components/timeline/timeline.js +15 -0
- package/components/timeline/timeline.vdt.js +25 -0
- package/components/timepicker/constants.d.ts +18 -0
- package/components/timepicker/constants.js +15 -0
- package/components/timepicker/index.d.ts +11 -0
- package/components/timepicker/index.js +40 -0
- package/components/timepicker/index.spec.d.ts +4 -0
- package/components/timepicker/index.spec.js +425 -0
- package/components/timepicker/panelPicker.d.ts +57 -0
- package/components/timepicker/panelPicker.js +55 -0
- package/components/timepicker/panelPicker.vdt.js +109 -0
- package/components/timepicker/selectPicker.d.ts +30 -0
- package/components/timepicker/selectPicker.js +33 -0
- package/components/timepicker/selectPicker.vdt.js +57 -0
- package/components/timepicker/styles.d.ts +5 -0
- package/components/timepicker/styles.js +31 -0
- package/components/timepicker/useDisabled.d.ts +13 -0
- package/components/timepicker/useDisabled.js +20 -0
- package/components/timepicker/useFormats.d.ts +15 -0
- package/components/timepicker/useFormats.js +49 -0
- package/components/timepicker/useStep.d.ts +13 -0
- package/components/timepicker/useStep.js +70 -0
- package/components/timepicker/useValue.d.ts +19 -0
- package/components/timepicker/useValue.js +54 -0
- package/components/tip/index.d.ts +15 -0
- package/components/tip/index.js +15 -0
- package/components/tip/index.vdt.js +86 -0
- package/components/tip/styles.d.ts +5 -0
- package/components/tip/styles.js +30 -0
- package/components/tooltip/content.d.ts +21 -0
- package/components/tooltip/content.js +94 -0
- package/components/tooltip/content.vdt.js +86 -0
- package/components/tooltip/index.d.ts +16 -0
- package/components/tooltip/index.js +30 -0
- package/components/tooltip/index.spec.d.ts +4 -0
- package/components/tooltip/index.spec.js +576 -0
- package/components/tooltip/styles.d.ts +7 -0
- package/components/tooltip/styles.js +82 -0
- package/components/tooltip/tooltip.d.ts +31 -0
- package/components/tooltip/tooltip.js +78 -0
- package/components/tooltip/useArrow.d.ts +7 -0
- package/components/tooltip/useArrow.js +53 -0
- package/components/transfer/index.d.ts +51 -0
- package/components/transfer/index.js +90 -0
- package/components/transfer/index.spec.d.ts +4 -0
- package/components/transfer/index.spec.js +242 -0
- package/components/transfer/index.vdt.js +161 -0
- package/components/transfer/styles.d.ts +5 -0
- package/components/transfer/styles.js +73 -0
- package/components/transfer/useCheck.d.ts +10 -0
- package/components/transfer/useCheck.js +91 -0
- package/components/transfer/useFilter.d.ts +10 -0
- package/components/transfer/useFilter.js +113 -0
- package/components/transfer/useTransfer.d.ts +10 -0
- package/components/transfer/useTransfer.js +86 -0
- package/components/tree/index.d.ts +60 -0
- package/components/tree/index.js +124 -0
- package/components/tree/index.spec.d.ts +4 -0
- package/components/tree/index.spec.js +428 -0
- package/components/tree/index.vdt.js +134 -0
- package/components/tree/styles.d.ts +5 -0
- package/components/tree/styles.js +71 -0
- package/components/tree/useChecked.d.ts +9 -0
- package/components/tree/useChecked.js +144 -0
- package/components/tree/useDraggable.d.ts +19 -0
- package/components/tree/useDraggable.js +174 -0
- package/components/tree/useExpanded.d.ts +9 -0
- package/components/tree/useExpanded.js +96 -0
- package/components/tree/useFilter.d.ts +6 -0
- package/components/tree/useFilter.js +55 -0
- package/components/tree/useNodes.d.ts +25 -0
- package/components/tree/useNodes.js +54 -0
- package/components/tree/useSelected.d.ts +10 -0
- package/components/tree/useSelected.js +92 -0
- package/components/tree/useTransitionEvent.d.ts +11 -0
- package/components/tree/useTransitionEvent.js +23 -0
- package/components/treeSelect/index.d.ts +30 -0
- package/components/treeSelect/index.js +141 -0
- package/components/treeSelect/index.spec.d.ts +4 -0
- package/components/treeSelect/index.spec.js +210 -0
- package/components/treeSelect/index.vdt.js +68 -0
- package/components/treeSelect/styles.d.ts +5 -0
- package/components/treeSelect/styles.js +19 -0
- package/components/treeSelect/useLabel.d.ts +4 -0
- package/components/treeSelect/useLabel.js +3 -0
- package/components/treeSelect/useValue.d.ts +12 -0
- package/components/treeSelect/useValue.js +71 -0
- package/components/types.d.ts +13 -0
- package/components/types.js +3 -0
- package/components/upload/ajaxUploader.d.ts +22 -0
- package/components/upload/ajaxUploader.js +89 -0
- package/components/upload/index.d.ts +66 -0
- package/components/upload/index.js +102 -0
- package/components/upload/index.spec.d.ts +4 -0
- package/components/upload/index.spec.js +544 -0
- package/components/upload/index.vdt.js +182 -0
- package/components/upload/styles.d.ts +6 -0
- package/components/upload/styles.js +156 -0
- package/components/upload/useAccept.d.ts +6 -0
- package/components/upload/useAccept.js +55 -0
- package/components/upload/useDrag.d.ts +10 -0
- package/components/upload/useDrag.js +47 -0
- package/components/upload/useFiles.d.ts +8 -0
- package/components/upload/useFiles.js +210 -0
- package/components/upload/useShowImage.d.ts +10 -0
- package/components/upload/useShowImage.js +25 -0
- package/components/upload/useUpload.d.ts +12 -0
- package/components/upload/useUpload.js +121 -0
- package/components/utils.d.ts +42 -0
- package/components/utils.js +361 -0
- package/hooks/useDelayClose.d.ts +7 -0
- package/hooks/useDelayClose.js +37 -0
- package/hooks/useDocumentClick.d.ts +9 -0
- package/hooks/useDocumentClick.js +37 -0
- package/hooks/useDraggable.d.ts +12 -0
- package/hooks/useDraggable.js +49 -0
- package/hooks/useKeyboard.d.ts +14 -0
- package/hooks/useKeyboard.js +54 -0
- package/hooks/useMouseOutsidable.d.ts +11 -0
- package/hooks/useMouseOutsidable.js +53 -0
- package/hooks/useReceive.d.ts +7 -0
- package/hooks/useReceive.js +30 -0
- package/hooks/useRecordComponent.d.ts +9 -0
- package/hooks/useRecordComponent.js +49 -0
- package/hooks/useResizeObserver.d.ts +5 -0
- package/hooks/useResizeObserver.js +16 -0
- package/hooks/useRouter.d.ts +4 -0
- package/hooks/useRouter.js +78 -0
- package/hooks/useShowHideEvents.d.ts +4 -0
- package/hooks/useShowHideEvents.js +27 -0
- package/hooks/useState.d.ts +11 -0
- package/hooks/useState.js +46 -0
- package/i18n/en-US.d.ts +94 -0
- package/i18n/en-US.js +108 -0
- package/i18n/index.d.ts +8 -0
- package/i18n/index.js +47 -0
- package/index.d.ts +61 -0
- package/index.js +63 -0
- package/package.json +51 -0
- package/styles/fonts/iconfont.d.ts +4 -0
- package/styles/fonts/iconfont.eot +0 -0
- package/styles/fonts/iconfont.js +8 -0
- package/styles/fonts/iconfont.svg +371 -0
- package/styles/fonts/iconfont.ttf +0 -0
- package/styles/fonts/iconfont.woff +0 -0
- package/styles/fonts/ionicons.d.ts +4 -0
- package/styles/fonts/ionicons.eot +0 -0
- package/styles/fonts/ionicons.js +19 -0
- package/styles/fonts/ionicons.svg +2230 -0
- package/styles/fonts/ionicons.ttf +0 -0
- package/styles/fonts/ionicons.woff +0 -0
- package/styles/global.d.ts +4 -0
- package/styles/global.js +18 -0
- package/styles/keyframes.d.ts +4 -0
- package/styles/keyframes.js +13 -0
- package/styles/theme.d.ts +108 -0
- package/styles/theme.js +130 -0
- package/styles/utils.d.ts +17 -0
- package/styles/utils.js +116 -0
- package/tsconfig.json +3 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import mx from '../mx';
|
|
2
|
+
export default function () {
|
|
3
|
+
var mxGuide = mx.mxGuide,
|
|
4
|
+
mxPolyline = mx.mxPolyline,
|
|
5
|
+
mxConstants = mx.mxConstants,
|
|
6
|
+
mxEvent = mx.mxEvent;
|
|
7
|
+
/**
|
|
8
|
+
* No dashed shapes.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
mxGuide.prototype.createGuideShape = function () {
|
|
12
|
+
var guide = new mxPolyline([], mxConstants.GUIDE_COLOR, mxConstants.GUIDE_STROKEWIDTH);
|
|
13
|
+
return guide;
|
|
14
|
+
}; // Alt disables guides
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
mxGuide.prototype.isEnabledForEvent = function (evt) {
|
|
18
|
+
return !mxEvent.isAltDown(evt);
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export {normalize} from 'intact-react';
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import mx from '../mx';
|
|
2
|
+
export default function () {
|
|
3
|
+
var mxCellEditor = mx.mxCellEditor,
|
|
4
|
+
mxUtils = mx.mxUtils,
|
|
5
|
+
mxClient = mx.mxClient;
|
|
6
|
+
mxCellEditor.prototype.blurEnabled = true;
|
|
7
|
+
/**
|
|
8
|
+
* HTML in-place editor
|
|
9
|
+
*/
|
|
10
|
+
// mxCellEditor.prototype.isContentEditing = function() {
|
|
11
|
+
// var state = this.graph.view.getState(this.editingCell);
|
|
12
|
+
// return state != null && state.style['html'] == 1;
|
|
13
|
+
// };
|
|
14
|
+
|
|
15
|
+
var mxCellEditorGetInitialValue = mxCellEditor.prototype.getInitialValue;
|
|
16
|
+
|
|
17
|
+
mxCellEditor.prototype.getInitialValue = function (state, trigger) {
|
|
18
|
+
if (mxUtils.getValue(state.style, 'html', '0') == '0') {
|
|
19
|
+
return mxCellEditorGetInitialValue.apply(this, arguments);
|
|
20
|
+
} else {
|
|
21
|
+
var result = this.graph.getEditingValue(state.cell, trigger);
|
|
22
|
+
|
|
23
|
+
if (mxUtils.getValue(state.style, 'nl2Br', '1') == '1') {
|
|
24
|
+
result = result.replace(/\n/g, '<br/>');
|
|
25
|
+
} // result = this.graph.sanitizeHtml(result, true);
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
return result;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* HTML in-place editor
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
mxCellEditor.prototype.escapeCancelsEditing = false;
|
|
37
|
+
var mxCellEditorStartEditing = mxCellEditor.prototype.startEditing;
|
|
38
|
+
|
|
39
|
+
mxCellEditor.prototype.startEditing = function (cell, trigger) {
|
|
40
|
+
mxCellEditorStartEditing.apply(this, arguments); // Overrides class in case of HTML content to add
|
|
41
|
+
// dashed borders for divs and table cells
|
|
42
|
+
|
|
43
|
+
var state = this.graph.view.getState(cell);
|
|
44
|
+
|
|
45
|
+
if (state != null && state.style['html'] == 1) {
|
|
46
|
+
this.textarea.className = 'mxCellEditor';
|
|
47
|
+
} else {
|
|
48
|
+
this.textarea.className = 'mxCellEditor mxPlainTextEditor';
|
|
49
|
+
} // Toggles markup vs wysiwyg mode
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
this.codeViewMode = false; // Stores current selection range when switching between markup and code
|
|
53
|
+
|
|
54
|
+
this.switchSelectionState = null; // Selects editing cell
|
|
55
|
+
|
|
56
|
+
this.graph.setSelectionCell(cell); // Enables focus outline for edges and edge labels
|
|
57
|
+
|
|
58
|
+
var parent = this.graph.getModel().getParent(cell);
|
|
59
|
+
var geo = this.graph.getCellGeometry(cell);
|
|
60
|
+
|
|
61
|
+
if (this.graph.getModel().isEdge(parent) && geo != null && geo.relative || this.graph.getModel().isEdge(cell)) {
|
|
62
|
+
// Quirks does not support outline at all so use border instead
|
|
63
|
+
if (mxClient.IS_QUIRKS) {
|
|
64
|
+
this.textarea.style.border = 'gray dotted 1px';
|
|
65
|
+
} // IE>8 and FF on Windows uses outline default of none
|
|
66
|
+
else if (mxClient.IS_IE || mxClient.IS_IE11 || mxClient.IS_FF && mxClient.IS_WIN) {
|
|
67
|
+
this.textarea.style.outline = 'gray dotted 1px';
|
|
68
|
+
} else {
|
|
69
|
+
this.textarea.style.outline = '';
|
|
70
|
+
}
|
|
71
|
+
} else if (mxClient.IS_QUIRKS) {
|
|
72
|
+
this.textarea.style.outline = 'none';
|
|
73
|
+
this.textarea.style.border = '';
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
var mxCellEditorGetCurrentValue = mxCellEditor.prototype.getCurrentValue;
|
|
78
|
+
|
|
79
|
+
mxCellEditor.prototype.getCurrentValue = function (state) {
|
|
80
|
+
if (mxUtils.getValue(state.style, 'html', '0') == '0') {
|
|
81
|
+
return mxCellEditorGetCurrentValue.apply(this, arguments);
|
|
82
|
+
} else {
|
|
83
|
+
var result = this.textarea.innerHTML;
|
|
84
|
+
|
|
85
|
+
if (mxUtils.getValue(state.style, 'nl2Br', '1') == '1') {
|
|
86
|
+
result = result.replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>');
|
|
87
|
+
} else {
|
|
88
|
+
result = result.replace(/\r\n/g, '').replace(/\n/g, '');
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return result;
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export {normalize} from 'intact-react';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import mx from '../mx';
|
|
2
|
+
export default function () {
|
|
3
|
+
var mxCellRenderer = mx.mxCellRenderer;
|
|
4
|
+
/**
|
|
5
|
+
* support render DOM as label
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
var getLabelValue = mxCellRenderer.prototype.getLabelValue;
|
|
9
|
+
|
|
10
|
+
mxCellRenderer.prototype.getLabelValue = function (state) {
|
|
11
|
+
return state.cell.value;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export {normalize} from 'intact-react';
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import mx from '../mx'; // import expandedImage from 'mxgraphx/javascript/src/images/expanded.gif';
|
|
2
|
+
// import collapsedImage from 'mxgraphx/javascript/src/images/collapsed.gif';
|
|
3
|
+
|
|
4
|
+
export default function () {
|
|
5
|
+
var mxGraph = mx.mxGraph,
|
|
6
|
+
mxConstants = mx.mxConstants,
|
|
7
|
+
mxUtils = mx.mxUtils,
|
|
8
|
+
mxConnectionConstraint = mx.mxConnectionConstraint,
|
|
9
|
+
mxPoint = mx.mxPoint,
|
|
10
|
+
mxRectangle = mx.mxRectangle,
|
|
11
|
+
mxImage = mx.mxImage;
|
|
12
|
+
var expandedImage = "data:image/gif;base64,R0lGODlhCQAJAPcAAAAAAHuUrXuctYSMlISUnISUpYSUrYScpYScrYSctYyUnIyUpZScnJScpaXG3q21va29xq3G1q3G3rW9xr3GzsbGxsbOzsbO1sbO3sbW1s7W1tbe597e3t7n597v9+fn3ufv9+fv/+f3/+/v7+/v9+/39+////f37/f39/f/////9////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////ywAAAAACQAJAAAIUwAdBChAoMGAAQQiJBBhwkSKhyYKIBCRAgSKFSk8EASRYsUJFCM0KkgBoGTJDQUYkBjB8kOHCwUGbOCgoQKHCjAXYIAwYcKDCRAKRChAlCDRCAEBADs=";
|
|
13
|
+
var collapsedImage = "data:image/gif;base64,R0lGODlhCQAJAPcAAAAAABAICHuUrXuctYSMlISUnISUpYSUrYScrYyUnIyUpYycpZScnJScpaXG3q3G1q3G3rW1vbW9xrW9zsbGzsbO3sbW3s7Oztbe3tbe597e3t7e597n7+fn7+/v7+/3/+////f39/f//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////ywAAAAACQAJAAAIUgAdCDBQoAADAgseCADBUIRDEAYMgPggAkCIDx8QKMA4AsCIEBwKEKgIIAAAABgMMNjgwYNFDRYMEOCAQQOACxQqFFBQQUIEnz8NPIhINOKDgAAAOw=="; // Adds support for HTML labels via style. Note: Currently, only the Java
|
|
14
|
+
// backend supports HTML labels but CSS support is limited to the following:
|
|
15
|
+
// http://docs.oracle.com/javase/6/docs/api/index.html?javax/swing/text/html/CSS.html
|
|
16
|
+
// TODO: Wrap should not affect isHtmlLabel output (should be handled later)
|
|
17
|
+
// const isHtmlLabel = mxGraph.prototype.isHtmlLabel;
|
|
18
|
+
|
|
19
|
+
mxGraph.prototype.isHtmlLabel = function (cell) {
|
|
20
|
+
var state = this.view.getState(cell);
|
|
21
|
+
var style = state != null ? state.style : this.getCellStyle(cell);
|
|
22
|
+
return style != null ? style['html'] == '1' || style[mxConstants.STYLE_WHITE_SPACE] == 'wrap' : false;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Overrides method to provide connection constraints for shapes.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
mxGraph.prototype.getAllConnectionConstraints = function (terminal, source) {
|
|
30
|
+
if (terminal != null) {
|
|
31
|
+
var constraints = mxUtils.getValue(terminal.style, 'points', null);
|
|
32
|
+
|
|
33
|
+
if (constraints != null) {
|
|
34
|
+
// Requires an array of arrays with x, y (0..1), an optional
|
|
35
|
+
// [perimeter (0 or 1), dx, and dy] eg. points=[[0,0,1,-10,10],[0,1,0],[1,1]]
|
|
36
|
+
var result = [];
|
|
37
|
+
|
|
38
|
+
try {
|
|
39
|
+
var c = JSON.parse(constraints);
|
|
40
|
+
|
|
41
|
+
for (var i = 0; i < c.length; i++) {
|
|
42
|
+
var tmp = c[i];
|
|
43
|
+
result.push(new mxConnectionConstraint(new mxPoint(tmp[0], tmp[1]), tmp.length > 2 ? tmp[2] != '0' : true, null, tmp.length > 3 ? tmp[3] : 0, tmp.length > 4 ? tmp[4] : 0));
|
|
44
|
+
}
|
|
45
|
+
} catch (e) {// ignore
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return result;
|
|
49
|
+
} else if (terminal.shape != null && terminal.shape.bounds != null) {
|
|
50
|
+
var dir = terminal.shape.direction;
|
|
51
|
+
var bounds = terminal.shape.bounds;
|
|
52
|
+
var scale = terminal.shape.scale;
|
|
53
|
+
var w = bounds.width / scale;
|
|
54
|
+
var h = bounds.height / scale;
|
|
55
|
+
|
|
56
|
+
if (dir == mxConstants.DIRECTION_NORTH || dir == mxConstants.DIRECTION_SOUTH) {
|
|
57
|
+
var tmp = w;
|
|
58
|
+
w = h;
|
|
59
|
+
h = tmp;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
constraints = terminal.shape.getConstraints(terminal.style, w, h);
|
|
63
|
+
|
|
64
|
+
if (constraints != null) {
|
|
65
|
+
return constraints;
|
|
66
|
+
} else if (terminal.shape.stencil != null && terminal.shape.stencil.constraints != null) {
|
|
67
|
+
return terminal.shape.stencil.constraints;
|
|
68
|
+
} else if (terminal.shape.constraints != null) {
|
|
69
|
+
return terminal.shape.constraints;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return null;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Returns a point that specifies the location for inserting cells.
|
|
78
|
+
*/
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
mxGraph.prototype.getInsertPoint = function () {
|
|
82
|
+
var gs = this.getGridSize();
|
|
83
|
+
var dx = this.container.scrollLeft / this.view.scale - this.view.translate.x;
|
|
84
|
+
var dy = this.container.scrollTop / this.view.scale - this.view.translate.y;
|
|
85
|
+
var layout = this.getPageLayout();
|
|
86
|
+
var page = this.getPageSize();
|
|
87
|
+
dx = Math.max(dx, layout.x * page.width);
|
|
88
|
+
dy = Math.max(dy, layout.y * page.height);
|
|
89
|
+
return new mxPoint(this.snap(dx + gs), this.snap(dy + gs));
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
mxGraph.prototype.getFreeInsertPoint = function () {
|
|
93
|
+
var view = this.view;
|
|
94
|
+
var bds = this.getGraphBounds();
|
|
95
|
+
var pt = this.getInsertPoint(); // Places at same x-coord and 2 grid sizes below existing graph
|
|
96
|
+
|
|
97
|
+
var x = this.snap(Math.round(Math.max(pt.x, bds.x / view.scale - view.translate.x + (bds.width == 0 ? 2 * this.gridSize : 0))));
|
|
98
|
+
var y = this.snap(Math.round(Math.max(pt.y, (bds.y + bds.height) / view.scale - view.translate.y + 2 * this.gridSize)));
|
|
99
|
+
return new mxPoint(x, y);
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Returns a rectangle describing the position and count of the
|
|
103
|
+
* background pages, where x and y are the position of the top,
|
|
104
|
+
* left page and width and height are the vertical and horizontal
|
|
105
|
+
* page count.
|
|
106
|
+
*/
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
mxGraph.prototype.getPageLayout = function () {
|
|
110
|
+
var size = this.getPageSize();
|
|
111
|
+
var bounds = this.getGraphBounds();
|
|
112
|
+
|
|
113
|
+
if (bounds.width == 0 || bounds.height == 0) {
|
|
114
|
+
return new mxRectangle(0, 0, 1, 1);
|
|
115
|
+
} else {
|
|
116
|
+
// Computes untransformed graph bounds
|
|
117
|
+
var x = Math.ceil(bounds.x / this.view.scale - this.view.translate.x);
|
|
118
|
+
var y = Math.ceil(bounds.y / this.view.scale - this.view.translate.y);
|
|
119
|
+
var w = Math.floor(bounds.width / this.view.scale);
|
|
120
|
+
var h = Math.floor(bounds.height / this.view.scale);
|
|
121
|
+
var x0 = Math.floor(x / size.width);
|
|
122
|
+
var y0 = Math.floor(y / size.height);
|
|
123
|
+
var w0 = Math.ceil((x + w) / size.width) - x0;
|
|
124
|
+
var h0 = Math.ceil((y + h) / size.height) - y0;
|
|
125
|
+
return new mxRectangle(x0, y0, w0, h0);
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
/**
|
|
129
|
+
* Returns the size of the page format scaled with the page size.
|
|
130
|
+
*/
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
mxGraph.prototype.getPageSize = function () {
|
|
134
|
+
return new mxRectangle(0, 0, this.pageFormat.width * this.pageScale, this.pageFormat.height * this.pageScale);
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
mxGraph.prototype.expandedImage = new mxImage(expandedImage, 9, 9);
|
|
138
|
+
mxGraph.prototype.collapsedImage = new mxImage(collapsedImage, 9, 9);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export {normalize} from 'intact-react';
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Component, TypeDefs, VNodeComponentClass } from 'intact-react';
|
|
2
|
+
import type { Diagram } from '../diagram';
|
|
3
|
+
export declare type Cell = {
|
|
4
|
+
data?: any;
|
|
5
|
+
instance?: DBase;
|
|
6
|
+
vertex?: boolean;
|
|
7
|
+
edge?: boolean;
|
|
8
|
+
getGeometry: () => any;
|
|
9
|
+
setTerminal: (...args: any[]) => void;
|
|
10
|
+
};
|
|
11
|
+
export interface DBaseProps {
|
|
12
|
+
strokeStyle?: 'solid' | 'dashed' | 'dotted';
|
|
13
|
+
label?: string | number;
|
|
14
|
+
style?: Record<string, string | number>;
|
|
15
|
+
data?: any;
|
|
16
|
+
}
|
|
17
|
+
export declare abstract class DBase<P extends DBaseProps = DBaseProps> extends Component<P> {
|
|
18
|
+
static typeDefs: Required<TypeDefs<DBaseProps>>;
|
|
19
|
+
static defaults: () => Partial<DBaseProps>;
|
|
20
|
+
uniqueId: number;
|
|
21
|
+
cell: Cell | null;
|
|
22
|
+
protected diagram: Diagram;
|
|
23
|
+
private hasDrew;
|
|
24
|
+
private layout;
|
|
25
|
+
mounted(): void;
|
|
26
|
+
beforeUpdate(lastVNode: VNodeComponentClass<DBase>, nextVNode: VNodeComponentClass<DBase>): void;
|
|
27
|
+
beforeUnmount(): void;
|
|
28
|
+
draw(): void;
|
|
29
|
+
protected abstract startDraw(): void;
|
|
30
|
+
protected abstract addToDigram(): void;
|
|
31
|
+
protected abstract deleteFromDiagram(): void;
|
|
32
|
+
protected abstract getStylesheet(): string;
|
|
33
|
+
protected abstract getGeometry(): any;
|
|
34
|
+
protected updateProps(model: any, lastProps: DBaseProps, nextProps: DBaseProps): void;
|
|
35
|
+
protected createCell(): any;
|
|
36
|
+
protected getValue(): string | null | Element;
|
|
37
|
+
protected setStyle(): void;
|
|
38
|
+
protected genStyles(): {
|
|
39
|
+
dashed?: number | null | undefined;
|
|
40
|
+
dashPattern?: string | null | undefined;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
export {normalize} from 'intact-react';
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
2
|
+
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
3
|
+
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
|
|
4
|
+
import { Component, inject } from 'intact-react';
|
|
5
|
+
import mx from '../mxgraph';
|
|
6
|
+
import { isNullOrUndefined, EMPTY_OBJ } from 'intact-shared';
|
|
7
|
+
import { DIAGRAM, LAYOUT } from '../constants';
|
|
8
|
+
var mxCell = mx.mxCell,
|
|
9
|
+
mxGeometry = mx.mxGeometry;
|
|
10
|
+
var typeDefs = {
|
|
11
|
+
strokeStyle: ['solid', 'dashed', 'dotted'],
|
|
12
|
+
label: [String, Number],
|
|
13
|
+
style: Object,
|
|
14
|
+
data: null
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
var defaults = function defaults() {
|
|
18
|
+
return {
|
|
19
|
+
strokeStyle: 'solid'
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
var uniqueId = 0;
|
|
24
|
+
export var DBase = /*#__PURE__*/function (_Component) {
|
|
25
|
+
_inheritsLoose(DBase, _Component);
|
|
26
|
+
|
|
27
|
+
function DBase() {
|
|
28
|
+
var _context;
|
|
29
|
+
|
|
30
|
+
var _this;
|
|
31
|
+
|
|
32
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
33
|
+
args[_key] = arguments[_key];
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
37
|
+
_this.uniqueId = uniqueId++;
|
|
38
|
+
_this.cell = null;
|
|
39
|
+
_this.diagram = inject(DIAGRAM);
|
|
40
|
+
_this.hasDrew = false;
|
|
41
|
+
_this.layout = inject(LAYOUT, null);
|
|
42
|
+
return _this;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
var _proto = DBase.prototype;
|
|
46
|
+
|
|
47
|
+
_proto.mounted = function mounted() {
|
|
48
|
+
var _this$get = this.get(),
|
|
49
|
+
data = _this$get.data;
|
|
50
|
+
|
|
51
|
+
var cell = this.cell = this.createCell(); // add data to the cell, so that we can get it when select the cell
|
|
52
|
+
|
|
53
|
+
cell.data = data;
|
|
54
|
+
cell.instance = this;
|
|
55
|
+
this.addToDigram();
|
|
56
|
+
|
|
57
|
+
if (this.layout) {
|
|
58
|
+
this.layout.addShape(this);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
_proto.beforeUpdate = function beforeUpdate(lastVNode, nextVNode) {
|
|
63
|
+
var lastProps = lastVNode.props || EMPTY_OBJ;
|
|
64
|
+
var nextProps = nextVNode.props || EMPTY_OBJ;
|
|
65
|
+
|
|
66
|
+
if (lastProps !== nextProps) {
|
|
67
|
+
var graph = this.diagram.graph;
|
|
68
|
+
var model = graph.getModel();
|
|
69
|
+
model.beginUpdate();
|
|
70
|
+
this.updateProps(model, lastProps, nextProps);
|
|
71
|
+
model.endUpdate();
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
_proto.beforeUnmount = function beforeUnmount() {
|
|
76
|
+
var graph = this.diagram.graph;
|
|
77
|
+
this.deleteFromDiagram();
|
|
78
|
+
graph.removeCells([this.cell], false);
|
|
79
|
+
|
|
80
|
+
if (this.layout) {
|
|
81
|
+
this.layout.deleteShape(this);
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
_proto.draw = function draw() {
|
|
86
|
+
if (this.hasDrew) return;
|
|
87
|
+
this.startDraw();
|
|
88
|
+
this.hasDrew = true;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
_proto.updateProps = function updateProps(model, lastProps, nextProps) {
|
|
92
|
+
var cell = this.cell;
|
|
93
|
+
|
|
94
|
+
if (lastProps.label !== nextProps.label) {
|
|
95
|
+
// update value
|
|
96
|
+
model.setValue(cell, this.getValue());
|
|
97
|
+
} // update style
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
model.setStyle(cell, this.getStylesheet());
|
|
101
|
+
this.setStyle(); // update data
|
|
102
|
+
|
|
103
|
+
cell.data = nextProps.data;
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
_proto.createCell = function createCell() {
|
|
107
|
+
return new mxCell(this.getValue(), this.getGeometry(), this.getStylesheet());
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
_proto.getValue = function getValue() {
|
|
111
|
+
var _this$get2 = this.get(),
|
|
112
|
+
label = _this$get2.label;
|
|
113
|
+
|
|
114
|
+
return isNullOrUndefined(label) ? null : String(label);
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
_proto.setStyle = function setStyle() {
|
|
118
|
+
var graph = this.diagram.graph;
|
|
119
|
+
var cells = [this.cell];
|
|
120
|
+
|
|
121
|
+
var styles = _extends({}, this.get('style'), this.genStyles());
|
|
122
|
+
|
|
123
|
+
for (var key in styles) {
|
|
124
|
+
graph.setCellStyles(key, styles[key], cells);
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
_proto.genStyles = function genStyles() {
|
|
129
|
+
var styles = {};
|
|
130
|
+
|
|
131
|
+
switch (this.get('strokeStyle')) {
|
|
132
|
+
case 'dashed':
|
|
133
|
+
styles.dashed = 1;
|
|
134
|
+
styles.dashPattern = null;
|
|
135
|
+
break;
|
|
136
|
+
|
|
137
|
+
case 'dotted':
|
|
138
|
+
styles.dashed = 1;
|
|
139
|
+
styles.dashPattern = '1 2';
|
|
140
|
+
break;
|
|
141
|
+
|
|
142
|
+
case 'solid':
|
|
143
|
+
styles.dashed = null;
|
|
144
|
+
styles.dashPattern = null;
|
|
145
|
+
break;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
return styles;
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
return DBase;
|
|
152
|
+
}(Component);
|
|
153
|
+
DBase.typeDefs = typeDefs;
|
|
154
|
+
DBase.defaults = defaults;
|
|
155
|
+
|
|
156
|
+
export {normalize} from 'intact-react';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { DShape } from './shape';
|
|
2
|
+
export declare class DCallout extends DShape {
|
|
3
|
+
static displayName: string;
|
|
4
|
+
static defaults(): {
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
left?: string | number | undefined;
|
|
8
|
+
top?: string | number | undefined;
|
|
9
|
+
movable?: boolean | undefined;
|
|
10
|
+
selectable?: boolean | undefined;
|
|
11
|
+
resizable?: boolean | undefined;
|
|
12
|
+
rotatable?: boolean | undefined;
|
|
13
|
+
editable?: boolean | undefined;
|
|
14
|
+
connectable?: boolean | undefined;
|
|
15
|
+
strokeStyle?: "dashed" | "dotted" | "solid" | undefined;
|
|
16
|
+
label?: string | number | undefined;
|
|
17
|
+
style?: Record<string, string | number> | undefined;
|
|
18
|
+
data?: any;
|
|
19
|
+
};
|
|
20
|
+
getStylesheet(): string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
export {normalize} from 'intact-react';
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
2
|
+
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
3
|
+
import { DShape } from './shape';
|
|
4
|
+
import mx from '../mxgraph';
|
|
5
|
+
import { hasDocumentAvailable } from 'intact-shared';
|
|
6
|
+
var mxActor = mx.mxActor,
|
|
7
|
+
mxUtils = mx.mxUtils,
|
|
8
|
+
mxRectangle = mx.mxRectangle,
|
|
9
|
+
mxCellRenderer = mx.mxCellRenderer,
|
|
10
|
+
mxHexagon = mx.mxHexagon,
|
|
11
|
+
mxConstants = mx.mxConstants,
|
|
12
|
+
mxPoint = mx.mxPoint,
|
|
13
|
+
mxPerimeter = mx.mxPerimeter,
|
|
14
|
+
mxStyleRegistry = mx.mxStyleRegistry;
|
|
15
|
+
export var DCallout = /*#__PURE__*/function (_DShape) {
|
|
16
|
+
_inheritsLoose(DCallout, _DShape);
|
|
17
|
+
|
|
18
|
+
function DCallout() {
|
|
19
|
+
return _DShape.apply(this, arguments) || this;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
DCallout.defaults = function defaults() {
|
|
23
|
+
return _extends({}, DShape.defaults(), {
|
|
24
|
+
width: 120,
|
|
25
|
+
height: 80
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
var _proto = DCallout.prototype;
|
|
30
|
+
|
|
31
|
+
_proto.getStylesheet = function getStylesheet() {
|
|
32
|
+
return 'shape=callout;whiteSpace=wrap;html=1;perimeter=calloutPerimeter;';
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
return DCallout;
|
|
36
|
+
}(DShape);
|
|
37
|
+
DCallout.displayName = 'DCallout';
|
|
38
|
+
|
|
39
|
+
if (hasDocumentAvailable) {
|
|
40
|
+
// Callout shape
|
|
41
|
+
var CalloutShape = function CalloutShape() {
|
|
42
|
+
mxActor.call(this);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
mxUtils.extend(CalloutShape, mxHexagon);
|
|
46
|
+
CalloutShape.prototype.size = 30;
|
|
47
|
+
CalloutShape.prototype.position = 0.5;
|
|
48
|
+
CalloutShape.prototype.position2 = 0.5;
|
|
49
|
+
CalloutShape.prototype.base = 20;
|
|
50
|
+
/* istanbul ignore next */
|
|
51
|
+
|
|
52
|
+
CalloutShape.prototype.getLabelMargins = function () {
|
|
53
|
+
return new mxRectangle(0, 0, 0, parseFloat(mxUtils.getValue(this.style, 'size', this.size)) * this.scale);
|
|
54
|
+
};
|
|
55
|
+
/* istanbul ignore next */
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
CalloutShape.prototype.isRoundable = function () {
|
|
59
|
+
return true;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
CalloutShape.prototype.redrawPath = function (c, x, y, w, h) {
|
|
63
|
+
var arcSize = mxUtils.getValue(this.style, mxConstants.STYLE_ARCSIZE, mxConstants.LINE_ARCSIZE) / 2;
|
|
64
|
+
var s = Math.max(0, Math.min(h, parseFloat(mxUtils.getValue(this.style, 'size', this.size))));
|
|
65
|
+
var dx = w * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.style, 'position', this.position))));
|
|
66
|
+
var dx2 = w * Math.max(0, Math.min(1, parseFloat(mxUtils.getValue(this.style, 'position2', this.position2))));
|
|
67
|
+
var base = Math.max(0, Math.min(w, parseFloat(mxUtils.getValue(this.style, 'base', this.base))));
|
|
68
|
+
this.addPoints(c, [new mxPoint(0, 0), new mxPoint(w, 0), new mxPoint(w, h - s), new mxPoint(Math.min(w, dx + base), h - s), new mxPoint(dx2, h), new mxPoint(Math.max(0, dx), h - s), new mxPoint(0, h - s)], this.isRounded, arcSize, true, [4]);
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
mxCellRenderer.registerShape('callout', CalloutShape); // Callout Perimeter
|
|
72
|
+
|
|
73
|
+
mxPerimeter.CalloutPerimeter = function (bounds, vertex, next, orthogonal) {
|
|
74
|
+
return mxPerimeter.RectanglePerimeter(mxUtils.getDirectedBounds(bounds, new mxRectangle(0, 0, 0, Math.max(0, Math.min(bounds.height, parseFloat(mxUtils.getValue(vertex.style, 'size', CalloutShape.prototype.size)) * vertex.view.scale))), vertex.style), vertex, next, orthogonal);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
mxStyleRegistry.putValue('calloutPerimeter', mxPerimeter.CalloutPerimeter);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export {normalize} from 'intact-react';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { DShape } from './shape';
|
|
2
|
+
export declare class DCircle extends DShape {
|
|
3
|
+
static displayName: string;
|
|
4
|
+
static defaults(): {
|
|
5
|
+
width: number;
|
|
6
|
+
left?: string | number | undefined;
|
|
7
|
+
top?: string | number | undefined;
|
|
8
|
+
height?: string | number | undefined;
|
|
9
|
+
movable?: boolean | undefined;
|
|
10
|
+
selectable?: boolean | undefined;
|
|
11
|
+
resizable?: boolean | undefined;
|
|
12
|
+
rotatable?: boolean | undefined;
|
|
13
|
+
editable?: boolean | undefined;
|
|
14
|
+
connectable?: boolean | undefined;
|
|
15
|
+
strokeStyle?: "dashed" | "dotted" | "solid" | undefined;
|
|
16
|
+
label?: string | number | undefined;
|
|
17
|
+
style?: Record<string, string | number> | undefined;
|
|
18
|
+
data?: any;
|
|
19
|
+
};
|
|
20
|
+
getGeometry(): any;
|
|
21
|
+
getStylesheet(): string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
export {normalize} from 'intact-react';
|