@king-design/react 2.1.4 → 2.1.6
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/components/affix/index.d.ts +2 -2
- package/components/affix/index.js +5 -0
- package/components/affix/index.spec.js +108 -84
- package/components/affix/index.vdt.js +8 -5
- package/components/affix/useStyle.js +19 -8
- package/components/badge/index.js +2 -0
- package/components/badge/index.vdt.js +9 -5
- package/components/badge/styles.js +2 -0
- package/components/breadcrumb/index.js +4 -0
- package/components/breadcrumb/index.spec.js +6 -6
- package/components/breadcrumb/index.vdt.js +14 -5
- package/components/breadcrumb/item.js +8 -0
- package/components/breadcrumb/item.vdt.js +6 -3
- package/components/breadcrumb/styles.js +3 -0
- package/components/button/dynamicButton.d.ts +1 -1
- package/components/button/dynamicButton.js +5 -2
- package/components/button/group.js +10 -2
- package/components/button/group.vdt.js +7 -4
- package/components/button/index.js +27 -3
- package/components/button/index.spec.js +96 -74
- package/components/button/index.vdt.js +29 -19
- package/components/button/styles.d.ts +2 -2
- package/components/button/styles.js +48 -4
- package/components/card/column.js +2 -0
- package/components/card/column.vdt.js +10 -5
- package/components/card/index.js +4 -0
- package/components/card/index.vdt.js +16 -4
- package/components/carousel/index.js +19 -1
- package/components/carousel/index.spec.js +163 -127
- package/components/carousel/index.vdt.js +15 -12
- package/components/carousel/item.js +2 -0
- package/components/carousel/item.vdt.js +7 -4
- package/components/carousel/styles.js +1 -0
- package/components/carousel/useAutoplay.js +4 -0
- package/components/carousel/useItems.js +20 -4
- package/components/carousel/useSlide.js +89 -57
- package/components/cascader/index.d.ts +45 -0
- package/components/cascader/index.js +18 -3
- package/components/cascader/index.spec.js +445 -354
- package/components/cascader/index.vdt.js +31 -14
- package/components/cascader/styles.js +6 -0
- package/components/cascader/useFields.js +4 -1
- package/components/cascader/useFilterable.js +19 -2
- package/components/cascader/useLabel.js +9 -1
- package/components/cascader/useLoad.js +35 -22
- package/components/cascader/useValue.d.ts +2 -2
- package/components/cascader/useValue.js +26 -5
- package/components/checkbox/index.js +27 -5
- package/components/checkbox/index.spec.js +171 -129
- package/components/checkbox/index.vdt.js +16 -12
- package/components/checkbox/styles.js +10 -0
- package/components/code/crossDomain.js +9 -2
- package/components/code/index.js +9 -0
- package/components/code/index.spec.js +55 -46
- package/components/code/index.vdt.js +14 -6
- package/components/code/styles.js +1 -0
- package/components/code/useEditor.js +10 -5
- package/components/collapse/index.d.ts +1 -1
- package/components/collapse/index.js +14 -3
- package/components/collapse/index.spec.js +60 -47
- package/components/collapse/index.vdt.js +12 -4
- package/components/collapse/item.js +10 -0
- package/components/collapse/item.vdt.js +14 -7
- package/components/collapse/styles.js +1 -0
- package/components/colorpicker/drag.js +5 -0
- package/components/colorpicker/index.js +4 -0
- package/components/colorpicker/index.spec.js +259 -211
- package/components/colorpicker/index.vdt.js +11 -8
- package/components/colorpicker/panel.js +5 -0
- package/components/colorpicker/panel.vdt.js +26 -21
- package/components/colorpicker/styles.js +13 -2
- package/components/colorpicker/useDrag.js +26 -22
- package/components/colorpicker/useInput.js +16 -0
- package/components/colorpicker/usePointer.js +18 -15
- package/components/colorpicker/useValue.js +7 -2
- package/components/context.d.ts +2 -2
- package/components/context.js +19 -2
- package/components/datepicker/basepicker.d.ts +8 -8
- package/components/datepicker/basepicker.js +90 -20
- package/components/datepicker/calendar.js +11 -0
- package/components/datepicker/calendar.vdt.js +14 -11
- package/components/datepicker/constants.js +1 -0
- package/components/datepicker/dayjs.js +1 -1
- package/components/datepicker/helpers.js +15 -3
- package/components/datepicker/index.d.ts +63 -0
- package/components/datepicker/index.js +32 -6
- package/components/datepicker/index.spec.js +1448 -1141
- package/components/datepicker/index.vdt.js +34 -20
- package/components/datepicker/shortcuts.d.ts +1 -1
- package/components/datepicker/shortcuts.js +4 -0
- package/components/datepicker/styles.js +8 -0
- package/components/datepicker/time.d.ts +1 -1
- package/components/datepicker/time.js +23 -3
- package/components/datepicker/time.vdt.js +5 -4
- package/components/datepicker/useDays.js +9 -2
- package/components/datepicker/useDisabled.js +23 -6
- package/components/datepicker/useFocusDate.js +2 -0
- package/components/datepicker/useFormats.js +15 -6
- package/components/datepicker/useKeyboards.js +36 -20
- package/components/datepicker/useMonths.js +6 -0
- package/components/datepicker/usePanel.js +10 -0
- package/components/datepicker/useShowDate.js +37 -10
- package/components/datepicker/useStatus.js +15 -3
- package/components/datepicker/useValue.js +35 -22
- package/components/datepicker/useYears.js +15 -4
- package/components/diagram/diagram.js +43 -17
- package/components/diagram/diagram.vdt.js +5 -2
- package/components/diagram/graph.js +6 -6
- package/components/diagram/index.d.ts +1 -1
- package/components/diagram/index.js +7 -7
- package/components/diagram/index.spec.js +495 -369
- package/components/diagram/layouts/circle.js +14 -6
- package/components/diagram/layouts/flow.js +15 -7
- package/components/diagram/layouts/layout.js +28 -6
- package/components/diagram/layouts/organic.js +11 -3
- package/components/diagram/layouts/partition.js +12 -4
- package/components/diagram/layouts/radial.js +18 -6
- package/components/diagram/layouts/stack.js +14 -6
- package/components/diagram/layouts/tree.js +21 -11
- package/components/diagram/mxgraph/handler/mxConnectionHandler.js +22 -15
- package/components/diagram/mxgraph/handler/mxConstraintHandler.js +4 -4
- package/components/diagram/mxgraph/handler/mxEdgeHandler.js +15 -11
- package/components/diagram/mxgraph/handler/mxGraphHandler.js +9 -6
- package/components/diagram/mxgraph/handler/mxRubberband.js +4 -4
- package/components/diagram/mxgraph/handler/mxVertexHandler.js +10 -7
- package/components/diagram/mxgraph/index.js +2 -0
- package/components/diagram/mxgraph/mx.js +3 -3
- package/components/diagram/mxgraph/shape/mxCloud.js +2 -2
- package/components/diagram/mxgraph/shape/mxCylinder.js +9 -4
- package/components/diagram/mxgraph/shape/mxEllipse.js +2 -2
- package/components/diagram/mxgraph/shape/mxHexagon.js +2 -2
- package/components/diagram/mxgraph/shape/mxLine.js +2 -2
- package/components/diagram/mxgraph/shape/mxRectangleShape.js +2 -2
- package/components/diagram/mxgraph/shape/mxRhombus.js +12 -6
- package/components/diagram/mxgraph/shape/mxShape.js +1 -0
- package/components/diagram/mxgraph/shape/mxTriangle.js +2 -2
- package/components/diagram/mxgraph/util/mxConstants.js +2 -2
- package/components/diagram/mxgraph/util/mxGuide.js +7 -5
- package/components/diagram/mxgraph/view/mxCellEditor.js +29 -16
- package/components/diagram/mxgraph/view/mxCellRenderer.js +2 -0
- package/components/diagram/mxgraph/view/mxGraph.js +32 -14
- package/components/diagram/shapes/base.d.ts +1 -1
- package/components/diagram/shapes/base.js +39 -9
- package/components/diagram/shapes/callout.js +23 -10
- package/components/diagram/shapes/circle.js +10 -3
- package/components/diagram/shapes/document.js +16 -5
- package/components/diagram/shapes/ellipse.js +5 -0
- package/components/diagram/shapes/generateShapes.d.ts +1 -1
- package/components/diagram/shapes/generateShapes.js +9 -0
- package/components/diagram/shapes/hexagon.js +26 -9
- package/components/diagram/shapes/image.js +9 -1
- package/components/diagram/shapes/line.d.ts +2 -2
- package/components/diagram/shapes/line.js +48 -13
- package/components/diagram/shapes/parallelogram.js +26 -9
- package/components/diagram/shapes/rectangle.js +9 -1
- package/components/diagram/shapes/shape.js +35 -6
- package/components/diagram/shapes/square.js +11 -3
- package/components/diagram/shapes/text.js +5 -0
- package/components/diagram/styles.js +1 -0
- package/components/dialog/alert.vdt.js +19 -9
- package/components/dialog/base.js +29 -1
- package/components/dialog/base.vdt.js +29 -14
- package/components/dialog/index.js +31 -6
- package/components/dialog/index.spec.js +554 -406
- package/components/dialog/staticMethods.d.ts +1 -1
- package/components/dialog/staticMethods.js +13 -2
- package/components/dialog/styles.js +11 -0
- package/components/dialog/useDraggable.js +6 -0
- package/components/dialog/useEscClosable.js +12 -4
- package/components/dialog/useFixBody.d.ts +1 -1
- package/components/dialog/useFixBody.js +11 -0
- package/components/dialog/usePosition.js +5 -0
- package/components/drawer/index.js +5 -0
- package/components/drawer/index.spec.js +168 -126
- package/components/drawer/index.vdt.js +9 -3
- package/components/drawer/styles.d.ts +2 -2
- package/components/drawer/styles.js +4 -0
- package/components/dropdown/dropdown.d.ts +2 -2
- package/components/dropdown/dropdown.js +89 -33
- package/components/dropdown/index.js +6 -2
- package/components/dropdown/index.spec.js +496 -388
- package/components/dropdown/item.js +25 -4
- package/components/dropdown/item.vdt.js +8 -5
- package/components/dropdown/menu.js +29 -12
- package/components/dropdown/menu.vdt.js +13 -5
- package/components/dropdown/styles.js +9 -0
- package/components/dropdown/useKeyboard.d.ts +2 -2
- package/components/dropdown/useKeyboard.js +30 -8
- package/components/dropdown/usePosition.d.ts +1 -1
- package/components/dropdown/usePosition.js +22 -12
- package/components/dropdown/useTransition.js +8 -0
- package/components/editable/index.d.ts +1 -1
- package/components/editable/index.js +28 -4
- package/components/editable/index.spec.js +189 -152
- package/components/editable/index.vdt.js +11 -8
- package/components/editable/styles.js +1 -0
- package/components/form/form.js +18 -0
- package/components/form/form.vdt.js +7 -4
- package/components/form/index.spec.js +1280 -1057
- package/components/form/item.d.ts +1 -1
- package/components/form/item.js +12 -0
- package/components/form/item.vdt.js +31 -17
- package/components/form/methods.d.ts +5 -5
- package/components/form/methods.js +12 -2
- package/components/form/styles.js +8 -0
- package/components/form/useDirty.js +7 -2
- package/components/form/useError.js +10 -2
- package/components/form/useValidate.d.ts +1 -1
- package/components/form/useValidate.js +24 -8
- package/components/grid/col.d.ts +3 -3
- package/components/grid/col.js +7 -0
- package/components/grid/col.vdt.js +13 -8
- package/components/grid/constants.d.ts +6 -6
- package/components/grid/row.js +5 -0
- package/components/grid/row.vdt.js +8 -5
- package/components/grid/styles.js +7 -0
- package/components/grid/useBreakpoints.js +5 -0
- package/components/grid/useGutter.js +25 -5
- package/components/icon/index.js +10 -0
- package/components/icon/index.vdt.js +13 -7
- package/components/icon/styles.js +1 -0
- package/components/input/index.d.ts +3 -3
- package/components/input/index.js +14 -0
- package/components/input/index.spec.js +239 -185
- package/components/input/index.vdt.js +49 -39
- package/components/input/search.js +20 -0
- package/components/input/search.vdt.js +9 -6
- package/components/input/styles.js +26 -0
- package/components/input/useAutoRows.js +18 -6
- package/components/input/useAutoWidth.js +5 -0
- package/components/input/useFrozen.js +6 -0
- package/components/input/useShowPassword.js +5 -2
- package/components/layout/aside.js +17 -5
- package/components/layout/aside.vdt.js +9 -5
- package/components/layout/body.js +17 -5
- package/components/layout/footer.js +7 -1
- package/components/layout/header.js +21 -7
- package/components/layout/layout.js +24 -9
- package/components/layout/styles.js +13 -2
- package/components/layout/template.vdt.js +4 -2
- package/components/layout/useParse.js +7 -0
- package/components/menu/index.spec.js +242 -189
- package/components/menu/item.js +16 -3
- package/components/menu/item.vdt.js +32 -20
- package/components/menu/menu.js +11 -2
- package/components/menu/menu.vdt.js +12 -6
- package/components/menu/styles.js +18 -0
- package/components/menu/useDropdown.js +9 -4
- package/components/menu/useExpanded.js +14 -0
- package/components/menu/useHighlight.js +36 -26
- package/components/message/index.spec.js +73 -58
- package/components/message/message.js +19 -0
- package/components/message/message.vdt.js +8 -5
- package/components/message/messages.js +12 -0
- package/components/message/messages.vdt.js +1 -0
- package/components/message/styles.js +9 -0
- package/components/pagination/index.d.ts +1 -1
- package/components/pagination/index.js +46 -10
- package/components/pagination/index.spec.js +173 -133
- package/components/pagination/index.vdt.js +34 -14
- package/components/pagination/styles.js +4 -0
- package/components/portal.d.ts +1 -1
- package/components/portal.js +29 -2
- package/components/position.d.ts +12 -12
- package/components/position.js +88 -32
- package/components/progress/index.d.ts +6 -6
- package/components/progress/index.js +12 -0
- package/components/progress/index.spec.js +191 -143
- package/components/progress/index.vdt.js +11 -8
- package/components/progress/styles.js +6 -0
- package/components/progress/useColor.js +7 -2
- package/components/progress/useStatus.d.ts +1 -1
- package/components/progress/useStatus.js +5 -2
- package/components/radio/index.js +18 -3
- package/components/radio/index.spec.js +149 -111
- package/components/radio/index.vdt.js +17 -14
- package/components/radio/styles.js +10 -0
- package/components/rate/index.js +7 -0
- package/components/rate/index.spec.js +79 -64
- package/components/rate/index.vdt.js +21 -8
- package/components/rate/styles.js +3 -0
- package/components/rate/useActiveValue.js +7 -2
- package/components/scrollSelect/index.d.ts +2 -2
- package/components/scrollSelect/index.js +7 -0
- package/components/scrollSelect/index.spec.js +131 -100
- package/components/scrollSelect/index.vdt.js +11 -6
- package/components/scrollSelect/styles.js +7 -0
- package/components/scrollSelect/useList.js +17 -3
- package/components/scrollSelect/useMouseEvents.js +49 -31
- package/components/scrollSelect/useTranslate.js +11 -1
- package/components/select/base.js +35 -5
- package/components/select/base.vdt.js +38 -23
- package/components/select/group.js +5 -0
- package/components/select/group.vdt.js +10 -4
- package/components/select/index.spec.js +452 -361
- package/components/select/menu.js +5 -0
- package/components/select/menu.vdt.js +33 -18
- package/components/select/option.js +16 -2
- package/components/select/option.vdt.js +14 -7
- package/components/select/select.d.ts +33 -0
- package/components/select/select.js +20 -3
- package/components/select/select.vdt.js +17 -9
- package/components/select/styles.js +33 -0
- package/components/select/useBaseLabel.d.ts +1 -1
- package/components/select/useBaseLabel.js +17 -4
- package/components/select/useCard.js +4 -0
- package/components/select/useEqualWidth.js +1 -0
- package/components/select/useFilterable.js +27 -5
- package/components/select/useFocusout.js +8 -0
- package/components/select/useInput.js +10 -6
- package/components/select/useLabel.js +13 -3
- package/components/select/useSearchable.js +10 -0
- package/components/skeleton/item.d.ts +1 -1
- package/components/skeleton/item.js +4 -0
- package/components/skeleton/item.vdt.js +6 -1
- package/components/skeleton/skeleton.js +4 -0
- package/components/skeleton/skeleton.vdt.js +12 -6
- package/components/skeleton/style.d.ts +1 -1
- package/components/skeleton/style.js +1 -0
- package/components/slider/index.d.ts +1 -1
- package/components/slider/index.js +7 -0
- package/components/slider/index.spec.js +585 -467
- package/components/slider/index.vdt.js +45 -32
- package/components/slider/styles.js +14 -0
- package/components/slider/useClick.js +11 -2
- package/components/slider/useDraggable.js +34 -23
- package/components/slider/useKeyboard.js +18 -7
- package/components/slider/useMarks.d.ts +5 -5
- package/components/slider/useMarks.js +13 -5
- package/components/slider/usePoints.d.ts +2 -2
- package/components/slider/usePoints.js +21 -7
- package/components/slider/useStyles.d.ts +1 -1
- package/components/slider/useStyles.js +10 -5
- package/components/slider/useTooltip.js +10 -2
- package/components/slider/useValue.d.ts +1 -1
- package/components/slider/useValue.js +22 -7
- package/components/spin/index.js +4 -0
- package/components/spin/index.vdt.js +11 -4
- package/components/spin/styles.js +2 -0
- package/components/spinner/index.d.ts +4 -4
- package/components/spinner/index.js +24 -9
- package/components/spinner/index.spec.js +460 -359
- package/components/spinner/index.vdt.js +13 -10
- package/components/spinner/styles.js +3 -0
- package/components/spinner/useChange.js +16 -4
- package/components/spinner/useFormatter.js +16 -6
- package/components/spinner/useStep.d.ts +3 -3
- package/components/spinner/useStep.js +20 -2
- package/components/spinner/useValue.js +26 -11
- package/components/split/index.js +7 -0
- package/components/split/index.spec.js +267 -223
- package/components/split/index.vdt.js +17 -8
- package/components/split/style.d.ts +1 -1
- package/components/split/style.js +8 -0
- package/components/split/useDraggable.js +35 -11
- package/components/split/useSize.js +5 -2
- package/components/steps/context.d.ts +2 -2
- package/components/steps/index.js +10 -2
- package/components/steps/index.spec.js +27 -21
- package/components/steps/index.vdt.js +10 -8
- package/components/steps/step.js +2 -0
- package/components/steps/step.vdt.js +12 -8
- package/components/steps/styles.js +27 -0
- package/components/switch/index.js +23 -2
- package/components/switch/index.spec.js +224 -188
- package/components/switch/index.vdt.js +32 -16
- package/components/switch/styles.js +14 -3
- package/components/switch/useDraggable.js +18 -10
- package/components/table/cell.js +6 -0
- package/components/table/cell.vdt.js +21 -14
- package/components/table/column.d.ts +1 -1
- package/components/table/column.js +5 -0
- package/components/table/column.vdt.js +30 -19
- package/components/table/exportTable.js +56 -45
- package/components/table/index.spec.js +984 -780
- package/components/table/row.d.ts +1 -1
- package/components/table/row.js +41 -12
- package/components/table/row.vdt.js +39 -27
- package/components/table/styles.js +11 -0
- package/components/table/table.d.ts +5 -5
- package/components/table/table.js +50 -18
- package/components/table/table.vdt.js +85 -61
- package/components/table/useChecked.d.ts +1 -1
- package/components/table/useChecked.js +61 -20
- package/components/table/useColumns.js +16 -3
- package/components/table/useDisableRow.js +12 -2
- package/components/table/useDraggable.js +12 -4
- package/components/table/useExpandable.js +5 -2
- package/components/table/useFixedColumns.d.ts +1 -1
- package/components/table/useFixedColumns.js +23 -4
- package/components/table/useGroup.d.ts +1 -1
- package/components/table/useGroup.js +24 -7
- package/components/table/useMerge.d.ts +4 -4
- package/components/table/useMerge.js +14 -2
- package/components/table/usePagination.js +18 -4
- package/components/table/useResizable.js +10 -2
- package/components/table/useRestRowStatus.js +6 -2
- package/components/table/useScroll.d.ts +1 -1
- package/components/table/useScroll.js +3 -0
- package/components/table/useSelected.js +5 -2
- package/components/table/useSortable.js +8 -2
- package/components/table/useStickyHeader.js +7 -3
- package/components/table/useStickyScrollbar.js +16 -6
- package/components/table/useTree.js +12 -1
- package/components/table/useWidth.js +30 -14
- package/components/tabs/index.js +51 -29
- package/components/tabs/index.spec.js +74 -56
- package/components/tabs/index.vdt.js +16 -13
- package/components/tabs/styles.js +16 -0
- package/components/tabs/tab.js +10 -0
- package/components/tabs/tab.vdt.js +10 -6
- package/components/tabs/useActiveBar.js +11 -2
- package/components/tabs/useScroll.js +20 -4
- package/components/tag/base.js +8 -0
- package/components/tag/index.js +4 -2
- package/components/tag/index.spec.js +25 -19
- package/components/tag/index.vdt.js +15 -8
- package/components/tag/styles.js +9 -0
- package/components/timeline/item.js +4 -0
- package/components/timeline/item.vdt.js +9 -4
- package/components/timeline/styles.d.ts +2 -2
- package/components/timeline/styles.js +4 -0
- package/components/timeline/timeline.js +2 -0
- package/components/timeline/timeline.vdt.js +5 -2
- package/components/timepicker/index.js +7 -2
- package/components/timepicker/index.spec.js +368 -293
- package/components/timepicker/panelPicker.d.ts +54 -0
- package/components/timepicker/panelPicker.js +11 -2
- package/components/timepicker/panelPicker.vdt.js +24 -14
- package/components/timepicker/selectPicker.js +5 -0
- package/components/timepicker/selectPicker.vdt.js +10 -5
- package/components/timepicker/styles.js +1 -0
- package/components/timepicker/useDisabled.js +4 -2
- package/components/timepicker/useFormats.js +13 -4
- package/components/timepicker/useStep.d.ts +1 -1
- package/components/timepicker/useStep.js +17 -8
- package/components/timepicker/useValue.js +21 -16
- package/components/tip/index.js +2 -0
- package/components/tip/index.vdt.js +17 -5
- package/components/tip/styles.js +3 -0
- package/components/tooltip/content.js +28 -0
- package/components/tooltip/content.vdt.js +25 -15
- package/components/tooltip/index.js +7 -3
- package/components/tooltip/index.spec.js +572 -434
- package/components/tooltip/styles.d.ts +1 -1
- package/components/tooltip/styles.js +10 -2
- package/components/tooltip/tooltip.js +15 -2
- package/components/tooltip/useArrow.js +14 -11
- package/components/transfer/index.d.ts +1 -1
- package/components/transfer/index.js +13 -1
- package/components/transfer/index.spec.js +194 -159
- package/components/transfer/index.vdt.js +34 -16
- package/components/transfer/styles.js +10 -0
- package/components/transfer/useCheck.d.ts +1 -1
- package/components/transfer/useCheck.js +15 -1
- package/components/transfer/useFilter.d.ts +1 -1
- package/components/transfer/useFilter.js +30 -9
- package/components/transfer/useTransfer.js +26 -10
- package/components/tree/index.d.ts +3 -3
- package/components/tree/index.js +22 -4
- package/components/tree/index.spec.js +355 -285
- package/components/tree/index.vdt.js +23 -12
- package/components/tree/styles.js +16 -2
- package/components/tree/useChecked.js +26 -3
- package/components/tree/useDraggable.js +42 -12
- package/components/tree/useExpanded.js +43 -26
- package/components/tree/useFilter.js +10 -3
- package/components/tree/useNodes.d.ts +1 -1
- package/components/tree/useNodes.js +4 -0
- package/components/tree/useSelected.js +38 -21
- package/components/tree/useTransitionEvent.js +5 -3
- package/components/treeSelect/index.d.ts +27 -0
- package/components/treeSelect/index.js +36 -9
- package/components/treeSelect/index.spec.js +160 -123
- package/components/treeSelect/index.vdt.js +20 -14
- package/components/treeSelect/styles.js +1 -0
- package/components/treeSelect/useValue.js +11 -0
- package/components/types.d.ts +3 -3
- package/components/upload/ajaxUploader.d.ts +1 -1
- package/components/upload/ajaxUploader.js +17 -0
- package/components/upload/index.d.ts +4 -4
- package/components/upload/index.js +14 -0
- package/components/upload/index.spec.js +249 -142
- package/components/upload/index.vdt.js +27 -12
- package/components/upload/styles.js +30 -0
- package/components/upload/useAccept.js +10 -2
- package/components/upload/useDrag.js +7 -0
- package/components/upload/useFiles.js +145 -103
- package/components/upload/useShowImage.js +3 -0
- package/components/upload/useUpload.js +69 -47
- package/components/utils.d.ts +3 -3
- package/components/utils.js +47 -12
- package/components/virtual.js +37 -9
- package/components/wave/index.js +31 -5
- package/hooks/useDelayClose.js +6 -2
- package/hooks/useDocumentClick.js +16 -8
- package/hooks/useDraggable.d.ts +1 -1
- package/hooks/useDraggable.js +9 -0
- package/hooks/useKeyboard.d.ts +3 -3
- package/hooks/useKeyboard.js +10 -0
- package/hooks/useMouseOutsidable.js +8 -0
- package/hooks/useReceive.d.ts +1 -1
- package/hooks/useReceive.js +4 -0
- package/hooks/useRecordComponent.js +6 -0
- package/hooks/useRouter.js +18 -7
- package/hooks/useShowHideEvents.js +3 -0
- package/hooks/useState.d.ts +2 -2
- package/hooks/useState.js +6 -2
- package/i18n/en-US.js +1 -0
- package/i18n/index.d.ts +1 -1
- package/i18n/index.js +7 -0
- package/index.d.ts +2 -2
- package/index.js +3 -2
- package/package.json +2 -2
- package/styles/global.js +3 -2
- package/styles/keyframes.js +1 -0
- package/styles/theme.d.ts +1 -1
- package/styles/theme.js +7 -4
- package/styles/utils.d.ts +1 -1
- package/styles/utils.js +17 -3
- package/yarn-error.log +218 -199
|
@@ -3,42 +3,50 @@ import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
|
3
3
|
import { DLayout } from './layout';
|
|
4
4
|
import mx from '../mxgraph';
|
|
5
5
|
var mxCircleLayout = mx.mxCircleLayout;
|
|
6
|
+
|
|
6
7
|
var typeDefs = _extends({}, DLayout.typeDefs, {
|
|
7
8
|
x0: [Number, String],
|
|
8
9
|
y0: [Number, String]
|
|
9
10
|
});
|
|
11
|
+
|
|
10
12
|
var defaults = function defaults() {
|
|
11
13
|
return _extends({}, DLayout.defaults(), {
|
|
12
14
|
x0: 0,
|
|
13
15
|
y0: 0
|
|
14
16
|
});
|
|
15
17
|
};
|
|
18
|
+
|
|
16
19
|
export var DCircleLayout = /*#__PURE__*/function (_DLayout) {
|
|
17
20
|
_inheritsLoose(DCircleLayout, _DLayout);
|
|
21
|
+
|
|
18
22
|
function DCircleLayout() {
|
|
19
23
|
return _DLayout.apply(this, arguments) || this;
|
|
20
24
|
}
|
|
25
|
+
|
|
21
26
|
var _proto = DCircleLayout.prototype;
|
|
27
|
+
|
|
22
28
|
_proto.getLayout = function getLayout(graph) {
|
|
23
29
|
var _this$get = this.get(),
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
// layout.radius = radius;
|
|
30
|
+
x0 = _this$get.x0,
|
|
31
|
+
y0 = _this$get.y0;
|
|
32
|
+
|
|
33
|
+
var layout = new mxCircleLayout(graph); // layout.radius = radius;
|
|
34
|
+
|
|
28
35
|
layout.moveCircle = true;
|
|
29
36
|
layout.x0 = x0;
|
|
30
37
|
layout.y0 = y0;
|
|
31
38
|
layout.disableEdgeStyle = false;
|
|
32
39
|
return layout;
|
|
33
40
|
};
|
|
41
|
+
|
|
34
42
|
_proto.execute = function execute(layout, cells, parent, graph) {
|
|
35
43
|
if (!cells.length) return;
|
|
36
44
|
var tmp = parent.cell;
|
|
37
|
-
layout.execute(tmp);
|
|
38
|
-
// if (graph.getModel().isVertex(tmp)) {
|
|
45
|
+
layout.execute(tmp); // if (graph.getModel().isVertex(tmp)) {
|
|
39
46
|
// graph.updateGroupBounds([tmp], graph.gridSize * 2, true);
|
|
40
47
|
// }
|
|
41
48
|
};
|
|
49
|
+
|
|
42
50
|
return DCircleLayout;
|
|
43
51
|
}(DLayout);
|
|
44
52
|
DCircleLayout.displayName = 'DCircleLayout';
|
|
@@ -3,7 +3,8 @@ import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
|
3
3
|
import { DLayout } from './layout';
|
|
4
4
|
import mx from '../mxgraph';
|
|
5
5
|
var mxHierarchicalLayout = mx.mxHierarchicalLayout,
|
|
6
|
-
|
|
6
|
+
mxConstants = mx.mxConstants;
|
|
7
|
+
|
|
7
8
|
var typeDefs = _extends({}, DLayout.typeDefs, {
|
|
8
9
|
type: ['horizontal', 'vertical'],
|
|
9
10
|
intraCellSpacing: [Number, String],
|
|
@@ -12,6 +13,7 @@ var typeDefs = _extends({}, DLayout.typeDefs, {
|
|
|
12
13
|
resizeParent: Boolean,
|
|
13
14
|
parentBorder: [Number, String]
|
|
14
15
|
});
|
|
16
|
+
|
|
15
17
|
var defaults = function defaults() {
|
|
16
18
|
return _extends({}, DLayout.defaults(), {
|
|
17
19
|
// The spacing buffer added between cells on the same layer.
|
|
@@ -26,20 +28,25 @@ var defaults = function defaults() {
|
|
|
26
28
|
parentBorder: 0
|
|
27
29
|
});
|
|
28
30
|
};
|
|
31
|
+
|
|
29
32
|
export var DFlowLayout = /*#__PURE__*/function (_DLayout) {
|
|
30
33
|
_inheritsLoose(DFlowLayout, _DLayout);
|
|
34
|
+
|
|
31
35
|
function DFlowLayout() {
|
|
32
36
|
return _DLayout.apply(this, arguments) || this;
|
|
33
37
|
}
|
|
38
|
+
|
|
34
39
|
var _proto = DFlowLayout.prototype;
|
|
40
|
+
|
|
35
41
|
_proto.getLayout = function getLayout(graph) {
|
|
36
42
|
var _this$get = this.get(),
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
type = _this$get.type,
|
|
44
|
+
interHierarchySpacing = _this$get.interHierarchySpacing,
|
|
45
|
+
interRankCellSpacing = _this$get.interRankCellSpacing,
|
|
46
|
+
intraCellSpacing = _this$get.intraCellSpacing,
|
|
47
|
+
resizeParent = _this$get.resizeParent,
|
|
48
|
+
parentBorder = _this$get.parentBorder;
|
|
49
|
+
|
|
43
50
|
var direction = type === 'horizontal' ? mxConstants.DIRECTION_WEST : mxConstants.DIRECTION_NORTH;
|
|
44
51
|
var layout = new mxHierarchicalLayout(graph, direction);
|
|
45
52
|
layout.intraCellSpacing = +intraCellSpacing;
|
|
@@ -52,6 +59,7 @@ export var DFlowLayout = /*#__PURE__*/function (_DLayout) {
|
|
|
52
59
|
layout.maintainParentLocation = true;
|
|
53
60
|
return layout;
|
|
54
61
|
};
|
|
62
|
+
|
|
55
63
|
return DFlowLayout;
|
|
56
64
|
}(DLayout);
|
|
57
65
|
DFlowLayout.displayName = 'DFlowLayout';
|
|
@@ -12,68 +12,88 @@ var typeDefs = {
|
|
|
12
12
|
left: [String, Number],
|
|
13
13
|
top: [String, Number]
|
|
14
14
|
};
|
|
15
|
+
|
|
15
16
|
var defaults = function defaults() {
|
|
16
17
|
return {
|
|
17
18
|
left: 0,
|
|
18
19
|
top: 0
|
|
19
20
|
};
|
|
20
21
|
};
|
|
22
|
+
|
|
21
23
|
export var DLayout = /*#__PURE__*/function (_Component) {
|
|
22
24
|
_inheritsLoose(DLayout, _Component);
|
|
25
|
+
|
|
23
26
|
function DLayout() {
|
|
24
27
|
var _context;
|
|
28
|
+
|
|
25
29
|
var _this;
|
|
30
|
+
|
|
26
31
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
27
32
|
args[_key] = arguments[_key];
|
|
28
33
|
}
|
|
34
|
+
|
|
29
35
|
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
30
36
|
_this.diagram = inject(DIAGRAM);
|
|
31
37
|
_this.shapes = new _Set();
|
|
32
38
|
_this.shape = inject(SHAPE, null);
|
|
33
39
|
return _this;
|
|
34
40
|
}
|
|
41
|
+
|
|
35
42
|
var _proto = DLayout.prototype;
|
|
43
|
+
|
|
36
44
|
_proto.init = function init() {
|
|
37
45
|
provide(LAYOUT, this);
|
|
38
46
|
};
|
|
47
|
+
|
|
39
48
|
_proto.mounted = function mounted() {
|
|
40
49
|
this.diagram.addLayout(this);
|
|
41
50
|
};
|
|
51
|
+
|
|
42
52
|
_proto.beforeUnmount = function beforeUnmount() {
|
|
43
53
|
this.diagram.deleteLayout(this);
|
|
44
54
|
};
|
|
55
|
+
|
|
45
56
|
_proto.addShape = function addShape(shape) {
|
|
46
57
|
this.shapes.add(shape);
|
|
47
58
|
};
|
|
59
|
+
|
|
48
60
|
_proto.deleteShape = function deleteShape(shape) {
|
|
49
61
|
this.shapes.delete(shape);
|
|
50
62
|
};
|
|
63
|
+
|
|
51
64
|
_proto.draw = function draw() {
|
|
52
65
|
var _context2;
|
|
66
|
+
|
|
53
67
|
var _this$get = this.get(),
|
|
54
|
-
|
|
55
|
-
|
|
68
|
+
left = _this$get.left,
|
|
69
|
+
top = _this$get.top;
|
|
70
|
+
|
|
56
71
|
var diagram = this.diagram;
|
|
57
72
|
var graph = diagram.graph;
|
|
58
|
-
var layout = this.getLayout(graph);
|
|
59
|
-
// Allows the layout to move cells even though cells
|
|
73
|
+
var layout = this.getLayout(graph); // Allows the layout to move cells even though cells
|
|
60
74
|
// aren't movable in the graph
|
|
75
|
+
|
|
61
76
|
layout.isVertexMovable = function () {
|
|
62
77
|
return true;
|
|
63
78
|
};
|
|
79
|
+
|
|
64
80
|
var cells = _mapInstanceProperty(_context2 = _Array$from(this.shapes)).call(_context2, function (shape) {
|
|
65
81
|
return shape.cell;
|
|
66
82
|
});
|
|
83
|
+
|
|
67
84
|
var parent = this.shape ? this.shape : this.diagram;
|
|
68
|
-
this.execute(layout, cells, parent, graph);
|
|
69
|
-
|
|
85
|
+
this.execute(layout, cells, parent, graph); // move cells totally
|
|
86
|
+
|
|
70
87
|
graph.moveCells(cells, +left, +top);
|
|
71
88
|
};
|
|
89
|
+
|
|
72
90
|
_proto.execute = function execute(layout, cells, parent, graph) {
|
|
73
91
|
layout.execute(parent.cell, cells);
|
|
74
92
|
};
|
|
93
|
+
|
|
75
94
|
return DLayout;
|
|
76
95
|
}(Component);
|
|
96
|
+
|
|
77
97
|
DLayout.template = function () {
|
|
78
98
|
if (process.env.NODE_ENV !== 'production') {
|
|
79
99
|
eachChildren(this.get('children'), function (vNode) {
|
|
@@ -82,8 +102,10 @@ DLayout.template = function () {
|
|
|
82
102
|
error("DLayout can only contain DShape or DLine, but " + vNode.tag + " found.");
|
|
83
103
|
});
|
|
84
104
|
}
|
|
105
|
+
|
|
85
106
|
var constructor = this.constructor;
|
|
86
107
|
return h(constructor.displayName, null, this.get('children'));
|
|
87
108
|
};
|
|
109
|
+
|
|
88
110
|
DLayout.typeDefs = typeDefs;
|
|
89
111
|
DLayout.defaults = defaults;
|
|
@@ -3,37 +3,45 @@ import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
|
3
3
|
import { DLayout } from './layout';
|
|
4
4
|
import mx from '../mxgraph';
|
|
5
5
|
var mxFastOrganicLayout = mx.mxFastOrganicLayout;
|
|
6
|
+
|
|
6
7
|
var typeDefs = _extends({}, DLayout.typeDefs, {
|
|
7
8
|
forceConstant: [Number, String]
|
|
8
9
|
});
|
|
10
|
+
|
|
9
11
|
var defaults = function defaults() {
|
|
10
12
|
return _extends({}, DLayout.defaults(), {
|
|
11
13
|
// The force constant by which the attractive forces are divided and the replusive forces are multiple by the square of. The value equates to the average radius there is of free space around each node.
|
|
12
14
|
forceConstant: 50
|
|
13
15
|
});
|
|
14
16
|
};
|
|
17
|
+
|
|
15
18
|
export var DOrganicLayout = /*#__PURE__*/function (_DLayout) {
|
|
16
19
|
_inheritsLoose(DOrganicLayout, _DLayout);
|
|
20
|
+
|
|
17
21
|
function DOrganicLayout() {
|
|
18
22
|
return _DLayout.apply(this, arguments) || this;
|
|
19
23
|
}
|
|
24
|
+
|
|
20
25
|
var _proto = DOrganicLayout.prototype;
|
|
26
|
+
|
|
21
27
|
_proto.getLayout = function getLayout(graph) {
|
|
22
28
|
var _this$get = this.get(),
|
|
23
|
-
|
|
29
|
+
forceConstant = _this$get.forceConstant;
|
|
30
|
+
|
|
24
31
|
var layout = new mxFastOrganicLayout(graph);
|
|
25
32
|
layout.forceConstant = +forceConstant;
|
|
26
33
|
layout.disableEdgeStyle = false;
|
|
27
34
|
return layout;
|
|
28
35
|
};
|
|
36
|
+
|
|
29
37
|
_proto.execute = function execute(layout, cells, parent, graph) {
|
|
30
38
|
if (!cells.length) return;
|
|
31
39
|
var tmp = parent.cell;
|
|
32
|
-
layout.execute(tmp);
|
|
33
|
-
// if (graph.getModel().isVertex(tmp)) {
|
|
40
|
+
layout.execute(tmp); // if (graph.getModel().isVertex(tmp)) {
|
|
34
41
|
// graph.updateGroupBounds([tmp], graph.gridSize * 2, true);
|
|
35
42
|
// }
|
|
36
43
|
};
|
|
44
|
+
|
|
37
45
|
return DOrganicLayout;
|
|
38
46
|
}(DLayout);
|
|
39
47
|
DOrganicLayout.displayName = 'DOrganicLayout';
|
|
@@ -3,12 +3,14 @@ import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
|
3
3
|
import { DLayout } from './layout';
|
|
4
4
|
import mx from '../mxgraph';
|
|
5
5
|
var mxPartitionLayout = mx.mxPartitionLayout;
|
|
6
|
+
|
|
6
7
|
var typeDefs = _extends({}, DLayout.typeDefs, {
|
|
7
8
|
type: ['horizontal', 'vertical'],
|
|
8
9
|
spacing: [Number, String],
|
|
9
10
|
border: [Number, String],
|
|
10
11
|
resizeVertices: Boolean
|
|
11
12
|
});
|
|
13
|
+
|
|
12
14
|
var defaults = function defaults() {
|
|
13
15
|
return _extends({}, DLayout.defaults(), {
|
|
14
16
|
type: 'horizontal',
|
|
@@ -20,24 +22,30 @@ var defaults = function defaults() {
|
|
|
20
22
|
resizeVertices: true
|
|
21
23
|
});
|
|
22
24
|
};
|
|
25
|
+
|
|
23
26
|
export var DPartitionLayout = /*#__PURE__*/function (_DLayout) {
|
|
24
27
|
_inheritsLoose(DPartitionLayout, _DLayout);
|
|
28
|
+
|
|
25
29
|
function DPartitionLayout() {
|
|
26
30
|
return _DLayout.apply(this, arguments) || this;
|
|
27
31
|
}
|
|
32
|
+
|
|
28
33
|
var _proto = DPartitionLayout.prototype;
|
|
34
|
+
|
|
29
35
|
_proto.getLayout = function getLayout(graph) {
|
|
30
36
|
var _this$get = this.get(),
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
37
|
+
type = _this$get.type,
|
|
38
|
+
spacing = _this$get.spacing,
|
|
39
|
+
border = _this$get.border,
|
|
40
|
+
resizeVertices = _this$get.resizeVertices;
|
|
41
|
+
|
|
35
42
|
var layout = new mxPartitionLayout(graph, type === 'horizontal');
|
|
36
43
|
layout.spacing = +spacing;
|
|
37
44
|
layout.border = +border;
|
|
38
45
|
layout.resizeVertices = resizeVertices;
|
|
39
46
|
return layout;
|
|
40
47
|
};
|
|
48
|
+
|
|
41
49
|
return DPartitionLayout;
|
|
42
50
|
}(DLayout);
|
|
43
51
|
DPartitionLayout.displayName = 'DPartitionLayout';
|
|
@@ -3,12 +3,14 @@ import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
|
3
3
|
import { DLayout } from './layout';
|
|
4
4
|
import mx from '../mxgraph';
|
|
5
5
|
var mxRadialTreeLayout = mx.mxRadialTreeLayout;
|
|
6
|
+
|
|
6
7
|
var typeDefs = _extends({}, DLayout.typeDefs, {
|
|
7
8
|
levelDistance: [Number, String],
|
|
8
9
|
nodeDistance: [Number, String],
|
|
9
10
|
rootx: [Number, String],
|
|
10
11
|
rooty: [Number, String]
|
|
11
12
|
});
|
|
13
|
+
|
|
12
14
|
var defaults = function defaults() {
|
|
13
15
|
return _extends({}, DLayout.defaults(), {
|
|
14
16
|
levelDistance: 60,
|
|
@@ -17,40 +19,50 @@ var defaults = function defaults() {
|
|
|
17
19
|
rooty: 0
|
|
18
20
|
});
|
|
19
21
|
};
|
|
22
|
+
|
|
20
23
|
export var DRadialLayout = /*#__PURE__*/function (_DLayout) {
|
|
21
24
|
_inheritsLoose(DRadialLayout, _DLayout);
|
|
25
|
+
|
|
22
26
|
function DRadialLayout() {
|
|
23
27
|
return _DLayout.apply(this, arguments) || this;
|
|
24
28
|
}
|
|
29
|
+
|
|
25
30
|
var _proto = DRadialLayout.prototype;
|
|
31
|
+
|
|
26
32
|
_proto.getLayout = function getLayout(graph) {
|
|
27
33
|
var _this$get = this.get(),
|
|
28
|
-
|
|
29
|
-
|
|
34
|
+
levelDistance = _this$get.levelDistance,
|
|
35
|
+
nodeDistance = _this$get.nodeDistance;
|
|
36
|
+
|
|
30
37
|
var layout = new mxRadialTreeLayout(graph);
|
|
31
38
|
layout.autoRadius = true;
|
|
32
39
|
layout.nodeDistance = +nodeDistance;
|
|
33
|
-
layout.levelDistance = +levelDistance;
|
|
34
|
-
|
|
40
|
+
layout.levelDistance = +levelDistance; // layout.useBoundingBox = false;
|
|
41
|
+
|
|
35
42
|
layout.edgeRouting = false;
|
|
36
43
|
return layout;
|
|
37
44
|
};
|
|
45
|
+
|
|
38
46
|
_proto.execute = function execute(layout, cells, parent, graph) {
|
|
39
47
|
if (!cells.length) return;
|
|
40
48
|
var roots = graph.findTreeRoots(parent.cell);
|
|
41
49
|
var tmp = cells[0];
|
|
50
|
+
|
|
42
51
|
if (roots && roots.length) {
|
|
43
52
|
tmp = roots[0];
|
|
44
53
|
}
|
|
54
|
+
|
|
45
55
|
var _this$get2 = this.get(),
|
|
46
|
-
|
|
47
|
-
|
|
56
|
+
rootx = _this$get2.rootx,
|
|
57
|
+
rooty = _this$get2.rooty;
|
|
58
|
+
|
|
48
59
|
var geo = tmp.getGeometry().clone();
|
|
49
60
|
if (rootx != null) geo.x = +rootx;
|
|
50
61
|
if (rooty != null) geo.y = +rooty;
|
|
51
62
|
graph.model.setGeometry(tmp, geo);
|
|
52
63
|
layout.execute(parent.cell, tmp);
|
|
53
64
|
};
|
|
65
|
+
|
|
54
66
|
return DRadialLayout;
|
|
55
67
|
}(DLayout);
|
|
56
68
|
DRadialLayout.displayName = 'DRadialLayout';
|
|
@@ -4,6 +4,7 @@ import _fillInstanceProperty from "@babel/runtime-corejs3/core-js/instance/fill"
|
|
|
4
4
|
import { DLayout } from './layout';
|
|
5
5
|
import mx from '../mxgraph';
|
|
6
6
|
var mxStackLayout = mx.mxStackLayout;
|
|
7
|
+
|
|
7
8
|
var typeDefs = _extends({}, DLayout.typeDefs, {
|
|
8
9
|
type: ['horizontal', 'vertical'],
|
|
9
10
|
spacing: [Number, String],
|
|
@@ -12,6 +13,7 @@ var typeDefs = _extends({}, DLayout.typeDefs, {
|
|
|
12
13
|
border: [Number, String],
|
|
13
14
|
resizeParent: Boolean
|
|
14
15
|
});
|
|
16
|
+
|
|
15
17
|
var defaults = function defaults() {
|
|
16
18
|
return _extends({}, DLayout.defaults(), {
|
|
17
19
|
type: 'horizontal',
|
|
@@ -27,20 +29,25 @@ var defaults = function defaults() {
|
|
|
27
29
|
resizeParent: false
|
|
28
30
|
});
|
|
29
31
|
};
|
|
32
|
+
|
|
30
33
|
export var DStackLayout = /*#__PURE__*/function (_DLayout) {
|
|
31
34
|
_inheritsLoose(DStackLayout, _DLayout);
|
|
35
|
+
|
|
32
36
|
function DStackLayout() {
|
|
33
37
|
return _DLayout.apply(this, arguments) || this;
|
|
34
38
|
}
|
|
39
|
+
|
|
35
40
|
var _proto = DStackLayout.prototype;
|
|
41
|
+
|
|
36
42
|
_proto.getLayout = function getLayout(graph) {
|
|
37
43
|
var _this$get = this.get(),
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
+
type = _this$get.type,
|
|
45
|
+
spacing = _this$get.spacing,
|
|
46
|
+
wrap = _this$get.wrap,
|
|
47
|
+
fill = _fillInstanceProperty(_this$get),
|
|
48
|
+
border = _this$get.border,
|
|
49
|
+
resizeParent = _this$get.resizeParent;
|
|
50
|
+
|
|
44
51
|
var layout = new mxStackLayout(graph, type === 'horizontal');
|
|
45
52
|
layout.spacing = +spacing;
|
|
46
53
|
layout.wrap = wrap ? +wrap : null;
|
|
@@ -49,6 +56,7 @@ export var DStackLayout = /*#__PURE__*/function (_DLayout) {
|
|
|
49
56
|
layout.resizeParent = resizeParent;
|
|
50
57
|
return layout;
|
|
51
58
|
};
|
|
59
|
+
|
|
52
60
|
return DStackLayout;
|
|
53
61
|
}(DLayout);
|
|
54
62
|
DStackLayout.displayName = 'DStackLayout';
|
|
@@ -3,6 +3,7 @@ import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
|
3
3
|
import { DLayout } from './layout';
|
|
4
4
|
import mx from '../mxgraph';
|
|
5
5
|
var mxCompactTreeLayout = mx.mxCompactTreeLayout;
|
|
6
|
+
|
|
6
7
|
var typeDefs = _extends({}, DLayout.typeDefs, {
|
|
7
8
|
type: ['horizontal', 'vertical'],
|
|
8
9
|
levelDistance: [Number, String],
|
|
@@ -10,6 +11,7 @@ var typeDefs = _extends({}, DLayout.typeDefs, {
|
|
|
10
11
|
resizeParent: Boolean,
|
|
11
12
|
groupPadding: [Number, String]
|
|
12
13
|
});
|
|
14
|
+
|
|
13
15
|
var defaults = function defaults() {
|
|
14
16
|
return _extends({}, DLayout.defaults(), {
|
|
15
17
|
type: 'horizontal',
|
|
@@ -21,43 +23,51 @@ var defaults = function defaults() {
|
|
|
21
23
|
groupPadding: 0
|
|
22
24
|
});
|
|
23
25
|
};
|
|
26
|
+
|
|
24
27
|
export var DTreeLayout = /*#__PURE__*/function (_DLayout) {
|
|
25
28
|
_inheritsLoose(DTreeLayout, _DLayout);
|
|
29
|
+
|
|
26
30
|
function DTreeLayout() {
|
|
27
31
|
return _DLayout.apply(this, arguments) || this;
|
|
28
32
|
}
|
|
33
|
+
|
|
29
34
|
var _proto = DTreeLayout.prototype;
|
|
35
|
+
|
|
30
36
|
_proto.getLayout = function getLayout(graph) {
|
|
31
37
|
var _this$get = this.get(),
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
38
|
+
type = _this$get.type,
|
|
39
|
+
levelDistance = _this$get.levelDistance,
|
|
40
|
+
nodeDistance = _this$get.nodeDistance,
|
|
41
|
+
resizeParent = _this$get.resizeParent,
|
|
42
|
+
groupPadding = _this$get.groupPadding;
|
|
43
|
+
|
|
37
44
|
var layout = new mxCompactTreeLayout(graph, type === 'horizontal');
|
|
38
45
|
layout.nodeDistance = +nodeDistance;
|
|
39
|
-
layout.groupPadding = +groupPadding;
|
|
40
|
-
|
|
46
|
+
layout.groupPadding = +groupPadding; // layout.moveTree = true;
|
|
47
|
+
|
|
41
48
|
layout.maintainParentLocation = true;
|
|
42
49
|
layout.resizeParent = resizeParent;
|
|
43
|
-
layout.levelDistance = +levelDistance;
|
|
44
|
-
|
|
50
|
+
layout.levelDistance = +levelDistance; // layout.useBoundingBox = false;
|
|
51
|
+
|
|
45
52
|
layout.edgeRouting = false;
|
|
46
53
|
return layout;
|
|
47
54
|
};
|
|
55
|
+
|
|
48
56
|
_proto.execute = function execute(layout, cells, parent, graph) {
|
|
49
57
|
if (!cells.length) return;
|
|
50
58
|
var roots = graph.findTreeRoots(parent.cell);
|
|
51
59
|
var tmp = cells[0];
|
|
60
|
+
|
|
52
61
|
if (roots && roots.length) {
|
|
53
62
|
tmp = roots[0];
|
|
54
63
|
}
|
|
55
|
-
|
|
56
|
-
// tmp = graph.getModel().getParent(tmp);
|
|
64
|
+
|
|
65
|
+
layout.execute(parent.cell, tmp); // tmp = graph.getModel().getParent(tmp);
|
|
57
66
|
// if (graph.getModel().isVertex(tmp)) {
|
|
58
67
|
// graph.updateGroupBounds([tmp], graph.gridSize * 2, true);
|
|
59
68
|
// }
|
|
60
69
|
};
|
|
70
|
+
|
|
61
71
|
return DTreeLayout;
|
|
62
72
|
}(DLayout);
|
|
63
73
|
DTreeLayout.displayName = 'DTreeLayout';
|
|
@@ -2,42 +2,49 @@ import _Object$assign from "@babel/runtime-corejs3/core-js/object/assign";
|
|
|
2
2
|
import mx from '../mx';
|
|
3
3
|
export default function () {
|
|
4
4
|
var mxConnectionHandler = mx.mxConnectionHandler,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
// mxConnectionHandler.prototype.outlineConnect = true;
|
|
5
|
+
mxConstants = mx.mxConstants,
|
|
6
|
+
mxCellState = mx.mxCellState; // mxConnectionHandler.prototype.outlineConnect = true;
|
|
8
7
|
// Overrides edge preview to use current edge shape and default style
|
|
8
|
+
|
|
9
9
|
mxConnectionHandler.prototype.livePreview = true;
|
|
10
|
-
mxConnectionHandler.prototype.cursor = 'crosshair';
|
|
11
|
-
|
|
10
|
+
mxConnectionHandler.prototype.cursor = 'crosshair'; // Overrides dashed state with current edge style
|
|
11
|
+
|
|
12
12
|
var connectionHandlerCreateShape = mxConnectionHandler.prototype.createShape;
|
|
13
|
+
|
|
13
14
|
mxConnectionHandler.prototype.createShape = function () {
|
|
14
|
-
var shape = connectionHandlerCreateShape.apply(this, arguments);
|
|
15
|
-
|
|
15
|
+
var shape = connectionHandlerCreateShape.apply(this, arguments); // shape.isDashed = this.graph.currentEdgeStyle[mxConstants.STYLE_DASHED] == '1';
|
|
16
|
+
|
|
16
17
|
shape.isDashed = false;
|
|
17
18
|
return shape;
|
|
18
19
|
};
|
|
20
|
+
|
|
19
21
|
var defaultEdgeStyle = {
|
|
20
22
|
'edgeStyle': 'orthogonalEdgeStyle',
|
|
21
23
|
'rounded': '0',
|
|
22
24
|
'jettySize': 'auto',
|
|
23
25
|
'orthogonalLoop': '1'
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
+
}; // Uses current edge style for connect preview
|
|
27
|
+
|
|
26
28
|
mxConnectionHandler.prototype.createEdgeState = function () {
|
|
27
29
|
var style = 'html=1;';
|
|
30
|
+
|
|
28
31
|
for (var key in defaultEdgeStyle) {
|
|
29
32
|
style += key + "=" + defaultEdgeStyle[key] + ";";
|
|
30
33
|
}
|
|
34
|
+
|
|
31
35
|
var edge = this.graph.createEdge(null, null, null, null, null, style);
|
|
32
36
|
var state = new mxCellState(this.graph.view, edge, this.graph.getCellStyle(edge));
|
|
37
|
+
|
|
33
38
|
_Object$assign(state.style, defaultEdgeStyle);
|
|
39
|
+
|
|
34
40
|
return state;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
+
}; // Overrides live preview to keep current style
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
mxConnectionHandler.prototype.updatePreview = function () {// do not change color of preview
|
|
45
|
+
}; // Disables built-in connection starts
|
|
46
|
+
|
|
47
|
+
|
|
41
48
|
mxConnectionHandler.prototype.isValidSource = function () {
|
|
42
49
|
return false;
|
|
43
50
|
};
|
|
@@ -2,10 +2,10 @@ import mx, { createSvgImage } from '../mx';
|
|
|
2
2
|
import '../util/mxConstants';
|
|
3
3
|
export default function () {
|
|
4
4
|
var mxConstraintHandler = mx.mxConstraintHandler,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
mxConstraintHandler.prototype.pointImage = createSvgImage(5, 5, '<path d="m 0 0 L 5 5 M 0 5 L 5 0" stroke="' + mxConstants.HANDLE_FILLCOLOR + '"/>');
|
|
8
|
-
|
|
5
|
+
mxConstants = mx.mxConstants,
|
|
6
|
+
mxEllipse = mx.mxEllipse;
|
|
7
|
+
mxConstraintHandler.prototype.pointImage = createSvgImage(5, 5, '<path d="m 0 0 L 5 5 M 0 5 L 5 0" stroke="' + mxConstants.HANDLE_FILLCOLOR + '"/>'); // Overrides highlight shape for connection points
|
|
8
|
+
|
|
9
9
|
mxConstraintHandler.prototype.createHighlightShape = function () {
|
|
10
10
|
var hl = new mxEllipse(null, this.highlightColor, this.highlightColor, 0);
|
|
11
11
|
hl.opacity = mxConstants.HIGHLIGHT_OPACITY;
|
|
@@ -3,37 +3,41 @@ import '../util/mxConstants';
|
|
|
3
3
|
import { mainHandle } from './mxVertexHandler';
|
|
4
4
|
export default function () {
|
|
5
5
|
var mxEdgeHandler = mx.mxEdgeHandler,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
mxConstants = mx.mxConstants,
|
|
7
|
+
mxElbowEdgeHandler = mx.mxElbowEdgeHandler,
|
|
8
|
+
mxImageShape = mx.mxImageShape,
|
|
9
|
+
mxRectangleShape = mx.mxRectangleShape,
|
|
10
|
+
mxRectangle = mx.mxRectangle;
|
|
11
11
|
var terminalHandle = createSvgImage(18, 18, '<circle cx="9" cy="9" r="5" stroke="#fff" fill="' + mxConstants.HANDLE_FILLCOLOR + '" stroke-width="1"/><circle cx="9" cy="9" r="2" stroke="#fff" fill="transparent"/>');
|
|
12
12
|
var fixedHandle = createSvgImage(18, 18, '<circle cx="9" cy="9" r="5" stroke="#fff" fill="' + mxConstants.HANDLE_FILLCOLOR + '" stroke-width="1"/><path d="m 7 7 L 11 11 M 7 11 L 11 7" stroke="#fff"/>');
|
|
13
|
-
mxEdgeHandler.prototype.handleImage = mainHandle;
|
|
14
|
-
// mxEdgeHandler.prototype.terminalHandleImage = terminalHandle;
|
|
13
|
+
mxEdgeHandler.prototype.handleImage = mainHandle; // mxEdgeHandler.prototype.terminalHandleImage = terminalHandle;
|
|
15
14
|
// mxEdgeHandler.prototype.fixedHandleImage = fixedHandle;
|
|
16
15
|
// mxEdgeHandler.prototype.labelHandleImage = secondaryHandle;
|
|
17
16
|
// Shows secondary handle for fixed connection points
|
|
17
|
+
|
|
18
18
|
mxEdgeHandler.prototype.createHandleShape = function (index) {
|
|
19
19
|
var source = index != null && index == 0;
|
|
20
20
|
var terminalState = this.state.getVisibleTerminalState(source);
|
|
21
21
|
var c = index != null && (index == 0 || index >= this.state.absolutePoints.length - 1 || this.constructor == mxElbowEdgeHandler && index == 2) ? this.graph.getConnectionConstraint(this.state, terminalState, source) : null;
|
|
22
22
|
var pt = c != null ? this.graph.getConnectionPoint(this.state.getVisibleTerminalState(source), c) : null;
|
|
23
23
|
var img = pt != null ? fixedHandle : c != null && terminalState != null ? terminalHandle : this.handleImage;
|
|
24
|
+
|
|
24
25
|
if (img != null) {
|
|
25
|
-
var shape = new mxImageShape(new mxRectangle(0, 0, img.width, img.height), img.src);
|
|
26
|
-
|
|
26
|
+
var shape = new mxImageShape(new mxRectangle(0, 0, img.width, img.height), img.src); // Allows HTML rendering of the images
|
|
27
|
+
|
|
27
28
|
shape.preserveImageAspect = false;
|
|
28
29
|
return shape;
|
|
29
30
|
} else {
|
|
30
31
|
var s = mxConstants.HANDLE_SIZE;
|
|
32
|
+
|
|
31
33
|
if (this.preferHtml) {
|
|
32
34
|
s -= 1;
|
|
33
35
|
}
|
|
36
|
+
|
|
34
37
|
return new mxRectangleShape(new mxRectangle(0, 0, s, s), mxConstants.HANDLE_FILLCOLOR, mxConstants.HANDLE_STROKECOLOR);
|
|
35
38
|
}
|
|
36
|
-
};
|
|
37
|
-
|
|
39
|
+
}; // Enables snapping waypoints to terminals
|
|
40
|
+
|
|
41
|
+
|
|
38
42
|
mxEdgeHandler.prototype.snapToTerminals = true;
|
|
39
43
|
}
|