@king-design/react 2.1.2 → 2.1.4
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 +0 -5
- package/components/affix/index.spec.js +84 -108
- package/components/affix/index.vdt.js +5 -8
- package/components/affix/useStyle.js +8 -19
- package/components/badge/index.js +0 -2
- package/components/badge/index.vdt.js +5 -9
- package/components/badge/styles.js +0 -2
- package/components/breadcrumb/index.js +0 -4
- package/components/breadcrumb/index.spec.js +6 -6
- package/components/breadcrumb/index.vdt.js +5 -14
- package/components/breadcrumb/item.js +0 -8
- package/components/breadcrumb/item.vdt.js +3 -6
- package/components/breadcrumb/styles.js +0 -3
- package/components/button/dynamicButton.d.ts +1 -1
- package/components/button/dynamicButton.js +2 -5
- package/components/button/group.js +2 -10
- package/components/button/group.vdt.js +4 -7
- package/components/button/index.js +3 -27
- package/components/button/index.spec.js +74 -96
- package/components/button/index.vdt.js +19 -29
- package/components/button/styles.d.ts +2 -2
- package/components/button/styles.js +4 -48
- package/components/card/column.js +0 -2
- package/components/card/column.vdt.js +5 -10
- package/components/card/index.js +0 -4
- package/components/card/index.vdt.js +4 -16
- package/components/carousel/index.js +1 -19
- package/components/carousel/index.spec.js +127 -163
- package/components/carousel/index.vdt.js +12 -15
- package/components/carousel/item.js +0 -2
- package/components/carousel/item.vdt.js +4 -7
- package/components/carousel/styles.js +0 -1
- package/components/carousel/useAutoplay.js +0 -4
- package/components/carousel/useItems.js +4 -20
- package/components/carousel/useSlide.js +57 -89
- package/components/cascader/index.js +3 -18
- package/components/cascader/index.spec.js +365 -379
- package/components/cascader/index.vdt.js +14 -31
- package/components/cascader/styles.js +0 -6
- package/components/cascader/useFields.js +1 -4
- package/components/cascader/useFilterable.js +2 -19
- package/components/cascader/useLabel.js +1 -9
- package/components/cascader/useLoad.js +22 -35
- package/components/cascader/useValue.d.ts +2 -2
- package/components/cascader/useValue.js +6 -27
- package/components/checkbox/index.js +5 -27
- package/components/checkbox/index.spec.js +129 -171
- package/components/checkbox/index.vdt.js +12 -16
- package/components/checkbox/styles.js +0 -10
- package/components/code/crossDomain.js +2 -9
- package/components/code/index.js +0 -9
- package/components/code/index.spec.js +46 -55
- package/components/code/index.vdt.js +6 -14
- package/components/code/styles.js +0 -1
- package/components/code/useEditor.js +5 -10
- package/components/collapse/index.d.ts +1 -1
- package/components/collapse/index.js +3 -14
- package/components/collapse/index.spec.js +47 -60
- package/components/collapse/index.vdt.js +4 -12
- package/components/collapse/item.js +0 -10
- package/components/collapse/item.vdt.js +7 -14
- package/components/collapse/styles.js +0 -1
- package/components/colorpicker/drag.js +0 -5
- package/components/colorpicker/index.js +0 -4
- package/components/colorpicker/index.spec.js +211 -259
- package/components/colorpicker/index.vdt.js +8 -11
- package/components/colorpicker/panel.js +0 -5
- package/components/colorpicker/panel.vdt.js +21 -26
- package/components/colorpicker/styles.js +2 -13
- package/components/colorpicker/useDrag.js +22 -26
- package/components/colorpicker/useInput.js +0 -16
- package/components/colorpicker/usePointer.js +15 -18
- package/components/colorpicker/useValue.js +2 -7
- package/components/context.d.ts +2 -2
- package/components/context.js +2 -19
- package/components/datepicker/basepicker.d.ts +8 -8
- package/components/datepicker/basepicker.js +20 -90
- package/components/datepicker/calendar.js +0 -11
- package/components/datepicker/calendar.vdt.js +11 -14
- package/components/datepicker/constants.js +0 -1
- package/components/datepicker/dayjs.js +1 -1
- package/components/datepicker/helpers.js +3 -15
- package/components/datepicker/index.js +6 -32
- package/components/datepicker/index.spec.js +1141 -1448
- package/components/datepicker/index.vdt.js +20 -34
- package/components/datepicker/shortcuts.d.ts +1 -1
- package/components/datepicker/shortcuts.js +0 -4
- package/components/datepicker/styles.js +0 -8
- package/components/datepicker/time.d.ts +1 -1
- package/components/datepicker/time.js +3 -23
- package/components/datepicker/time.vdt.js +4 -5
- package/components/datepicker/useDays.js +2 -9
- package/components/datepicker/useDisabled.js +6 -23
- package/components/datepicker/useFocusDate.js +0 -2
- package/components/datepicker/useFormats.js +6 -15
- package/components/datepicker/useKeyboards.js +20 -36
- package/components/datepicker/useMonths.js +0 -6
- package/components/datepicker/usePanel.js +0 -10
- package/components/datepicker/useShowDate.js +10 -37
- package/components/datepicker/useStatus.js +3 -15
- package/components/datepicker/useValue.js +22 -35
- package/components/datepicker/useYears.js +4 -15
- package/components/diagram/diagram.js +17 -43
- package/components/diagram/diagram.vdt.js +2 -5
- 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 +369 -495
- package/components/diagram/layouts/circle.js +6 -14
- package/components/diagram/layouts/flow.js +7 -15
- package/components/diagram/layouts/layout.js +6 -28
- package/components/diagram/layouts/organic.js +3 -11
- package/components/diagram/layouts/partition.js +4 -12
- package/components/diagram/layouts/radial.js +6 -18
- package/components/diagram/layouts/stack.js +6 -14
- package/components/diagram/layouts/tree.js +11 -21
- package/components/diagram/mxgraph/handler/mxConnectionHandler.js +15 -22
- package/components/diagram/mxgraph/handler/mxConstraintHandler.js +4 -4
- package/components/diagram/mxgraph/handler/mxEdgeHandler.js +11 -15
- package/components/diagram/mxgraph/handler/mxGraphHandler.js +6 -9
- package/components/diagram/mxgraph/handler/mxRubberband.js +4 -4
- package/components/diagram/mxgraph/handler/mxVertexHandler.js +7 -10
- package/components/diagram/mxgraph/index.js +0 -2
- package/components/diagram/mxgraph/mx.js +3 -3
- package/components/diagram/mxgraph/shape/mxCloud.js +2 -2
- package/components/diagram/mxgraph/shape/mxCylinder.js +4 -9
- 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 +6 -12
- package/components/diagram/mxgraph/shape/mxShape.js +0 -1
- 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 +5 -7
- package/components/diagram/mxgraph/view/mxCellEditor.js +16 -29
- package/components/diagram/mxgraph/view/mxCellRenderer.js +0 -2
- package/components/diagram/mxgraph/view/mxGraph.js +14 -32
- package/components/diagram/shapes/base.d.ts +1 -1
- package/components/diagram/shapes/base.js +9 -39
- package/components/diagram/shapes/callout.js +10 -23
- package/components/diagram/shapes/circle.js +3 -10
- package/components/diagram/shapes/document.js +5 -16
- package/components/diagram/shapes/ellipse.js +0 -5
- package/components/diagram/shapes/generateShapes.d.ts +1 -1
- package/components/diagram/shapes/generateShapes.js +0 -9
- package/components/diagram/shapes/hexagon.js +9 -26
- package/components/diagram/shapes/image.js +1 -9
- package/components/diagram/shapes/line.d.ts +2 -2
- package/components/diagram/shapes/line.js +13 -48
- package/components/diagram/shapes/parallelogram.js +9 -26
- package/components/diagram/shapes/rectangle.js +1 -9
- package/components/diagram/shapes/shape.js +6 -35
- package/components/diagram/shapes/square.js +3 -11
- package/components/diagram/shapes/text.js +0 -5
- package/components/diagram/styles.js +0 -1
- package/components/dialog/alert.vdt.js +9 -19
- package/components/dialog/base.js +1 -29
- package/components/dialog/base.vdt.js +14 -29
- package/components/dialog/index.js +6 -31
- package/components/dialog/index.spec.js +416 -503
- package/components/dialog/staticMethods.d.ts +1 -1
- package/components/dialog/staticMethods.js +2 -13
- package/components/dialog/styles.js +0 -11
- package/components/dialog/useDraggable.js +0 -6
- package/components/dialog/useEscClosable.js +4 -12
- package/components/dialog/useFixBody.d.ts +1 -1
- package/components/dialog/useFixBody.js +0 -11
- package/components/dialog/usePosition.js +7 -5
- package/components/drawer/index.js +0 -5
- package/components/drawer/index.spec.js +126 -168
- package/components/drawer/index.vdt.js +3 -9
- package/components/drawer/styles.d.ts +2 -2
- package/components/drawer/styles.js +0 -4
- package/components/dropdown/dropdown.d.ts +2 -2
- package/components/dropdown/dropdown.js +33 -89
- package/components/dropdown/index.js +2 -6
- package/components/dropdown/index.spec.js +388 -496
- package/components/dropdown/item.js +4 -25
- package/components/dropdown/item.vdt.js +5 -8
- package/components/dropdown/menu.js +14 -29
- package/components/dropdown/menu.vdt.js +5 -13
- package/components/dropdown/styles.js +0 -9
- package/components/dropdown/useKeyboard.d.ts +2 -2
- package/components/dropdown/useKeyboard.js +8 -30
- package/components/dropdown/usePosition.d.ts +2 -1
- package/components/dropdown/usePosition.js +33 -28
- package/components/dropdown/useTransition.js +0 -8
- package/components/editable/index.d.ts +1 -1
- package/components/editable/index.js +4 -28
- package/components/editable/index.spec.js +152 -189
- package/components/editable/index.vdt.js +8 -11
- package/components/editable/styles.js +0 -1
- package/components/form/form.js +0 -18
- package/components/form/form.vdt.js +4 -7
- package/components/form/index.spec.js +1057 -1280
- package/components/form/item.d.ts +1 -1
- package/components/form/item.js +0 -12
- package/components/form/item.vdt.js +17 -31
- package/components/form/methods.d.ts +5 -5
- package/components/form/methods.js +2 -12
- package/components/form/styles.js +0 -8
- package/components/form/useDirty.js +2 -7
- package/components/form/useError.js +2 -10
- package/components/form/useValidate.d.ts +1 -1
- package/components/form/useValidate.js +8 -24
- package/components/grid/col.d.ts +3 -3
- package/components/grid/col.js +0 -7
- package/components/grid/col.vdt.js +8 -13
- package/components/grid/constants.d.ts +6 -6
- package/components/grid/row.js +0 -5
- package/components/grid/row.vdt.js +5 -8
- package/components/grid/styles.js +0 -7
- package/components/grid/useBreakpoints.js +0 -5
- package/components/grid/useGutter.js +5 -25
- package/components/icon/index.js +0 -10
- package/components/icon/index.vdt.js +7 -13
- package/components/icon/styles.js +0 -1
- package/components/input/index.d.ts +3 -3
- package/components/input/index.js +0 -14
- package/components/input/index.spec.js +185 -239
- package/components/input/index.vdt.js +39 -49
- package/components/input/search.js +0 -20
- package/components/input/search.vdt.js +6 -9
- package/components/input/styles.js +0 -26
- package/components/input/useAutoRows.js +6 -18
- package/components/input/useAutoWidth.js +0 -5
- package/components/input/useFrozen.js +0 -6
- package/components/input/useShowPassword.js +2 -5
- package/components/layout/aside.js +5 -17
- package/components/layout/aside.vdt.js +5 -9
- package/components/layout/body.js +5 -17
- package/components/layout/footer.js +1 -7
- package/components/layout/header.js +7 -21
- package/components/layout/layout.js +9 -24
- package/components/layout/styles.js +2 -13
- package/components/layout/template.vdt.js +2 -4
- package/components/layout/useParse.js +0 -7
- package/components/menu/index.spec.js +189 -242
- package/components/menu/item.js +3 -16
- package/components/menu/item.vdt.js +20 -32
- package/components/menu/menu.js +2 -11
- package/components/menu/menu.vdt.js +6 -12
- package/components/menu/styles.js +0 -18
- package/components/menu/useDropdown.js +4 -9
- package/components/menu/useExpanded.js +0 -14
- package/components/menu/useHighlight.js +26 -36
- package/components/message/index.spec.js +58 -73
- package/components/message/message.js +0 -19
- package/components/message/message.vdt.js +5 -8
- package/components/message/messages.js +0 -12
- package/components/message/messages.vdt.js +0 -1
- package/components/message/styles.js +0 -9
- package/components/pagination/index.d.ts +1 -1
- package/components/pagination/index.js +10 -46
- package/components/pagination/index.spec.js +133 -173
- package/components/pagination/index.vdt.js +14 -34
- package/components/pagination/styles.js +0 -4
- package/components/portal.d.ts +1 -1
- package/components/portal.js +13 -28
- package/components/position.d.ts +12 -12
- package/components/position.js +32 -88
- package/components/progress/index.d.ts +6 -6
- package/components/progress/index.js +0 -12
- package/components/progress/index.spec.js +143 -191
- package/components/progress/index.vdt.js +8 -11
- package/components/progress/styles.js +0 -6
- package/components/progress/useColor.js +2 -7
- package/components/progress/useStatus.d.ts +1 -1
- package/components/progress/useStatus.js +2 -5
- package/components/radio/index.js +3 -18
- package/components/radio/index.spec.js +111 -149
- package/components/radio/index.vdt.js +14 -17
- package/components/radio/styles.js +0 -10
- package/components/rate/index.js +0 -7
- package/components/rate/index.spec.js +64 -79
- package/components/rate/index.vdt.js +8 -21
- package/components/rate/styles.js +0 -3
- package/components/rate/useActiveValue.js +2 -7
- package/components/scrollSelect/index.d.ts +2 -2
- package/components/scrollSelect/index.js +0 -7
- package/components/scrollSelect/index.spec.js +100 -131
- package/components/scrollSelect/index.vdt.js +6 -11
- package/components/scrollSelect/styles.js +0 -7
- package/components/scrollSelect/useList.js +3 -17
- package/components/scrollSelect/useMouseEvents.js +31 -49
- package/components/scrollSelect/useTranslate.js +1 -11
- package/components/select/base.js +5 -35
- package/components/select/base.vdt.js +23 -38
- package/components/select/group.js +0 -5
- package/components/select/group.vdt.js +4 -10
- package/components/select/index.spec.js +361 -452
- package/components/select/menu.js +0 -5
- package/components/select/menu.vdt.js +18 -33
- package/components/select/option.js +2 -16
- package/components/select/option.vdt.js +7 -14
- package/components/select/select.js +3 -20
- package/components/select/select.vdt.js +9 -17
- package/components/select/styles.js +0 -33
- package/components/select/useBaseLabel.d.ts +1 -1
- package/components/select/useBaseLabel.js +4 -17
- package/components/select/useCard.js +0 -4
- package/components/select/useEqualWidth.js +0 -1
- package/components/select/useFilterable.js +5 -27
- package/components/select/useFocusout.d.ts +1 -1
- package/components/select/useFocusout.js +1 -9
- package/components/select/useInput.js +6 -10
- package/components/select/useLabel.js +3 -13
- package/components/select/useSearchable.js +0 -10
- package/components/skeleton/item.d.ts +1 -1
- package/components/skeleton/item.js +0 -4
- package/components/skeleton/item.vdt.js +1 -6
- package/components/skeleton/skeleton.js +0 -4
- package/components/skeleton/skeleton.vdt.js +6 -12
- package/components/skeleton/style.d.ts +1 -1
- package/components/skeleton/style.js +0 -1
- package/components/slider/index.d.ts +1 -1
- package/components/slider/index.js +0 -7
- package/components/slider/index.spec.js +467 -585
- package/components/slider/index.vdt.js +32 -45
- package/components/slider/styles.js +0 -14
- package/components/slider/useClick.js +2 -11
- package/components/slider/useDraggable.js +23 -34
- package/components/slider/useKeyboard.js +7 -18
- package/components/slider/useMarks.d.ts +5 -5
- package/components/slider/useMarks.js +5 -13
- package/components/slider/usePoints.d.ts +2 -2
- package/components/slider/usePoints.js +7 -21
- package/components/slider/useStyles.d.ts +1 -1
- package/components/slider/useStyles.js +5 -10
- package/components/slider/useTooltip.js +2 -10
- package/components/slider/useValue.d.ts +1 -1
- package/components/slider/useValue.js +7 -22
- package/components/spin/index.js +0 -4
- package/components/spin/index.vdt.js +4 -11
- package/components/spin/styles.js +0 -2
- package/components/spinner/index.d.ts +4 -4
- package/components/spinner/index.js +9 -24
- package/components/spinner/index.spec.js +359 -460
- package/components/spinner/index.vdt.js +10 -13
- package/components/spinner/styles.js +0 -3
- package/components/spinner/useChange.js +4 -16
- package/components/spinner/useFormatter.js +6 -16
- package/components/spinner/useStep.d.ts +3 -3
- package/components/spinner/useStep.js +2 -20
- package/components/spinner/useValue.js +11 -26
- package/components/split/index.js +0 -7
- package/components/split/index.spec.js +223 -267
- package/components/split/index.vdt.js +8 -17
- package/components/split/style.d.ts +1 -1
- package/components/split/style.js +0 -8
- package/components/split/useDraggable.js +11 -35
- package/components/split/useSize.js +2 -5
- package/components/steps/context.d.ts +2 -2
- package/components/steps/index.js +2 -10
- package/components/steps/index.spec.js +21 -27
- package/components/steps/index.vdt.js +8 -10
- package/components/steps/step.js +0 -2
- package/components/steps/step.vdt.js +8 -12
- package/components/steps/styles.js +0 -27
- package/components/switch/index.js +2 -23
- package/components/switch/index.spec.js +188 -224
- package/components/switch/index.vdt.js +16 -32
- package/components/switch/styles.js +3 -14
- package/components/switch/useDraggable.js +10 -18
- package/components/table/cell.js +0 -6
- package/components/table/cell.vdt.js +14 -21
- package/components/table/column.d.ts +1 -1
- package/components/table/column.js +0 -5
- package/components/table/column.vdt.js +19 -30
- package/components/table/exportTable.js +45 -56
- package/components/table/index.spec.js +780 -984
- package/components/table/row.d.ts +1 -1
- package/components/table/row.js +18 -40
- package/components/table/row.vdt.js +27 -39
- package/components/table/styles.js +0 -11
- package/components/table/table.d.ts +5 -5
- package/components/table/table.js +18 -50
- package/components/table/table.vdt.js +61 -85
- package/components/table/useChecked.d.ts +1 -1
- package/components/table/useChecked.js +20 -61
- package/components/table/useColumns.js +3 -16
- package/components/table/useDisableRow.js +2 -12
- package/components/table/useDraggable.js +4 -12
- package/components/table/useExpandable.js +2 -5
- package/components/table/useFixedColumns.d.ts +1 -1
- package/components/table/useFixedColumns.js +4 -23
- package/components/table/useGroup.d.ts +1 -1
- package/components/table/useGroup.js +7 -24
- package/components/table/useMerge.d.ts +4 -4
- package/components/table/useMerge.js +2 -14
- package/components/table/usePagination.js +4 -18
- package/components/table/useResizable.js +2 -10
- package/components/table/useRestRowStatus.js +2 -6
- package/components/table/useScroll.d.ts +1 -1
- package/components/table/useScroll.js +0 -3
- package/components/table/useSelected.js +2 -5
- package/components/table/useSortable.js +2 -8
- package/components/table/useStickyHeader.js +3 -7
- package/components/table/useStickyScrollbar.js +6 -16
- package/components/table/useTree.js +1 -12
- package/components/table/useWidth.js +14 -30
- package/components/tabs/index.js +29 -51
- package/components/tabs/index.spec.js +56 -74
- package/components/tabs/index.vdt.js +13 -16
- package/components/tabs/styles.js +0 -16
- package/components/tabs/tab.js +0 -10
- package/components/tabs/tab.vdt.js +6 -10
- package/components/tabs/useActiveBar.js +2 -11
- package/components/tabs/useScroll.js +4 -20
- package/components/tag/base.js +0 -8
- package/components/tag/index.js +2 -4
- package/components/tag/index.spec.js +19 -25
- package/components/tag/index.vdt.js +8 -15
- package/components/tag/styles.js +0 -9
- package/components/timeline/item.js +0 -4
- package/components/timeline/item.vdt.js +4 -9
- package/components/timeline/styles.d.ts +2 -2
- package/components/timeline/styles.js +0 -4
- package/components/timeline/timeline.js +0 -2
- package/components/timeline/timeline.vdt.js +2 -5
- package/components/timepicker/index.js +2 -7
- package/components/timepicker/index.spec.js +293 -368
- package/components/timepicker/panelPicker.js +2 -11
- package/components/timepicker/panelPicker.vdt.js +14 -24
- package/components/timepicker/selectPicker.js +0 -5
- package/components/timepicker/selectPicker.vdt.js +5 -10
- package/components/timepicker/styles.js +0 -1
- package/components/timepicker/useDisabled.js +2 -4
- package/components/timepicker/useFormats.js +4 -13
- package/components/timepicker/useStep.d.ts +1 -1
- package/components/timepicker/useStep.js +8 -17
- package/components/timepicker/useValue.js +16 -21
- package/components/tip/index.js +0 -2
- package/components/tip/index.vdt.js +5 -17
- package/components/tip/styles.js +0 -3
- package/components/tooltip/content.js +0 -28
- package/components/tooltip/content.vdt.js +15 -25
- package/components/tooltip/index.js +3 -7
- package/components/tooltip/index.spec.js +434 -572
- package/components/tooltip/styles.d.ts +1 -1
- package/components/tooltip/styles.js +2 -10
- package/components/tooltip/tooltip.js +2 -15
- package/components/tooltip/useArrow.js +11 -14
- package/components/transfer/index.d.ts +1 -1
- package/components/transfer/index.js +1 -13
- package/components/transfer/index.spec.js +159 -194
- package/components/transfer/index.vdt.js +16 -34
- package/components/transfer/styles.js +0 -10
- package/components/transfer/useCheck.d.ts +1 -1
- package/components/transfer/useCheck.js +1 -15
- package/components/transfer/useFilter.d.ts +1 -1
- package/components/transfer/useFilter.js +9 -30
- package/components/transfer/useTransfer.js +10 -26
- package/components/tree/index.d.ts +3 -3
- package/components/tree/index.js +4 -22
- package/components/tree/index.spec.js +285 -355
- package/components/tree/index.vdt.js +12 -23
- package/components/tree/styles.js +2 -16
- package/components/tree/useChecked.js +3 -26
- package/components/tree/useDraggable.js +12 -42
- package/components/tree/useExpanded.js +26 -43
- package/components/tree/useFilter.js +3 -10
- package/components/tree/useNodes.d.ts +1 -1
- package/components/tree/useNodes.js +0 -4
- package/components/tree/useSelected.js +21 -38
- package/components/tree/useTransitionEvent.js +3 -5
- package/components/treeSelect/index.js +9 -36
- package/components/treeSelect/index.spec.js +123 -160
- package/components/treeSelect/index.vdt.js +14 -20
- package/components/treeSelect/styles.js +0 -1
- package/components/treeSelect/useValue.js +0 -11
- package/components/types.d.ts +3 -3
- package/components/upload/ajaxUploader.d.ts +1 -1
- package/components/upload/ajaxUploader.js +0 -17
- package/components/upload/index.d.ts +4 -4
- package/components/upload/index.js +0 -14
- package/components/upload/index.spec.js +142 -249
- package/components/upload/index.vdt.js +12 -27
- package/components/upload/styles.js +0 -30
- package/components/upload/useAccept.js +2 -10
- package/components/upload/useDrag.js +0 -7
- package/components/upload/useFiles.js +103 -145
- package/components/upload/useShowImage.js +0 -3
- package/components/upload/useUpload.js +47 -69
- package/components/utils.d.ts +4 -3
- package/components/utils.js +24 -43
- package/components/virtual.js +14 -39
- package/components/wave/index.js +5 -31
- package/hooks/useDelayClose.js +2 -6
- package/hooks/useDocumentClick.js +8 -16
- package/hooks/useDraggable.d.ts +1 -1
- package/hooks/useDraggable.js +0 -9
- package/hooks/useKeyboard.d.ts +3 -3
- package/hooks/useKeyboard.js +0 -10
- package/hooks/useMouseOutsidable.js +0 -8
- package/hooks/useReceive.d.ts +1 -1
- package/hooks/useReceive.js +0 -4
- package/hooks/useRecordComponent.js +0 -6
- package/hooks/useRouter.js +7 -18
- package/hooks/useShowHideEvents.js +0 -3
- package/hooks/useState.d.ts +2 -2
- package/hooks/useState.js +2 -6
- package/i18n/en-US.js +0 -1
- package/i18n/index.d.ts +1 -1
- package/i18n/index.js +0 -7
- package/index.d.ts +2 -2
- package/index.js +2 -3
- package/package.json +2 -2
- package/styles/global.js +2 -3
- package/styles/keyframes.js +0 -1
- package/styles/theme.d.ts +1 -1
- package/styles/theme.js +4 -7
- package/styles/utils.d.ts +1 -1
- package/styles/utils.js +3 -17
- package/yarn-error.log +205 -221
- package/components/cascader/index.d.ts +0 -45
- package/components/datepicker/index.d.ts +0 -63
- package/components/select/select.d.ts +0 -33
- package/components/timepicker/panelPicker.d.ts +0 -54
- package/components/treeSelect/index.d.ts +0 -27
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
import mx from '../mx';
|
|
2
2
|
export default function () {
|
|
3
3
|
var mxGraphHandler = mx.mxGraphHandler;
|
|
4
|
-
mxGraphHandler.prototype.maxLivePreview = 16;
|
|
5
|
-
|
|
6
|
-
mxGraphHandler.prototype.guidesEnabled = true;
|
|
7
|
-
|
|
8
|
-
mxGraphHandler.prototype.removeEmptyParents = true;
|
|
9
|
-
|
|
4
|
+
mxGraphHandler.prototype.maxLivePreview = 16;
|
|
5
|
+
// Enables guides
|
|
6
|
+
mxGraphHandler.prototype.guidesEnabled = true;
|
|
7
|
+
// Removes parents where all child cells are moved out
|
|
8
|
+
mxGraphHandler.prototype.removeEmptyParents = true;
|
|
9
|
+
// Select descendant if we select unselectable children
|
|
10
10
|
var graphHandlerGetInitialCellForEvent = mxGraphHandler.prototype.getInitialCellForEvent;
|
|
11
|
-
|
|
12
11
|
mxGraphHandler.prototype.getInitialCellForEvent = function () {
|
|
13
12
|
var graph = this.graph;
|
|
14
13
|
var model = graph.getModel();
|
|
15
14
|
var cell = graphHandlerGetInitialCellForEvent.apply(this, arguments);
|
|
16
|
-
|
|
17
15
|
while (!graph.isCellSelectable(cell) && model.isVertex(cell)) {
|
|
18
16
|
cell = model.getParent(cell);
|
|
19
17
|
}
|
|
20
|
-
|
|
21
18
|
return cell;
|
|
22
19
|
};
|
|
23
20
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import mx from '../mx';
|
|
2
2
|
export default function () {
|
|
3
|
-
var mxRubberband = mx.mxRubberband;
|
|
4
|
-
|
|
5
|
-
mxRubberband.prototype.fadeOut = true;
|
|
6
|
-
|
|
3
|
+
var mxRubberband = mx.mxRubberband;
|
|
4
|
+
// Enables fading of rubberband
|
|
5
|
+
mxRubberband.prototype.fadeOut = true;
|
|
6
|
+
// Increases default rubberband opacity (default is 20)
|
|
7
7
|
mxRubberband.prototype.defaultOpacity = 30;
|
|
8
8
|
}
|
|
@@ -3,27 +3,24 @@ import '../util/mxConstants';
|
|
|
3
3
|
var mainHandle;
|
|
4
4
|
export default function () {
|
|
5
5
|
var mxVertexHandler = mx.mxVertexHandler,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
mainHandle = createSvgImage(18, 18, "<circle cx=\"9\" cy=\"9\" r=\"5\" stroke=\"#fff\" fill=\"" + mxConstants.HANDLE_FILLCOLOR + "\" stroke-width=\"1\"/>");
|
|
10
|
-
|
|
6
|
+
mxImage = mx.mxImage,
|
|
7
|
+
mxConstants = mx.mxConstants,
|
|
8
|
+
mxEvent = mx.mxEvent;
|
|
9
|
+
mainHandle = createSvgImage(18, 18, "<circle cx=\"9\" cy=\"9\" r=\"5\" stroke=\"#fff\" fill=\"" + mxConstants.HANDLE_FILLCOLOR + "\" stroke-width=\"1\"/>");
|
|
10
|
+
// set sizer shape
|
|
11
11
|
var rotationHandle = new mxImage('data:image/png;base64,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', 19, 21);
|
|
12
12
|
var secondaryHandle = createSvgImage(16, 16, '<path d="m 8 3 L 13 8 L 8 13 L 3 8 z" stroke="#fff" fill="#fca000"/>');
|
|
13
13
|
mxVertexHandler.prototype.rotationEnabled = true;
|
|
14
14
|
mxVertexHandler.prototype.handleImage = mainHandle;
|
|
15
15
|
mxVertexHandler.prototype.secondaryHandle = secondaryHandle;
|
|
16
16
|
var createSizerShape = mxVertexHandler.prototype.createSizerShape;
|
|
17
|
-
|
|
18
17
|
mxVertexHandler.prototype.createSizerShape = function (bounds, index, fillColor) {
|
|
19
18
|
if (index === mxEvent.ROTATION_HANDLE) {
|
|
20
19
|
this.handleImage = rotationHandle;
|
|
21
20
|
}
|
|
22
|
-
|
|
23
21
|
return createSizerShape.apply(this, arguments);
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
};
|
|
23
|
+
// Adds rotation handle and live preview
|
|
27
24
|
mxVertexHandler.prototype.manageSizers = true;
|
|
28
25
|
mxVertexHandler.prototype.livePreview = true;
|
|
29
26
|
}
|
|
@@ -20,7 +20,6 @@ import mxConstraintHandlerSetup from './handler/mxConstraintHandler';
|
|
|
20
20
|
import mxEdgeHandlerSetup from './handler/mxEdgeHandler';
|
|
21
21
|
import mxGraphHandlerSetup from './handler/mxGraphHandler';
|
|
22
22
|
import mxRubberbandSetup from './handler/mxRubberband';
|
|
23
|
-
|
|
24
23
|
if (hasDocumentAvailable) {
|
|
25
24
|
mxConstantsSetup();
|
|
26
25
|
mxGuideSetup();
|
|
@@ -43,5 +42,4 @@ if (hasDocumentAvailable) {
|
|
|
43
42
|
mxGraphHandlerSetup();
|
|
44
43
|
mxRubberbandSetup();
|
|
45
44
|
}
|
|
46
|
-
|
|
47
45
|
export default mx;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import mx from 'mxgraphx';
|
|
2
|
-
import { hasDocumentAvailable } from 'intact-shared';
|
|
3
|
-
|
|
2
|
+
import { hasDocumentAvailable } from 'intact-shared';
|
|
3
|
+
// only support running in browser
|
|
4
4
|
var doll = hasDocumentAvailable ? mx({
|
|
5
5
|
mxLoadResources: false,
|
|
6
6
|
mxLoadStylesheets: false
|
|
7
7
|
}) : {};
|
|
8
8
|
var mxImage = doll.mxImage,
|
|
9
|
-
|
|
9
|
+
mxLog = doll.mxLog;
|
|
10
10
|
export default doll;
|
|
11
11
|
export function createSvgImage(w, h, data) {
|
|
12
12
|
var tmp = unescape(encodeURIComponent('<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">' + '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="' + w + 'px" height="' + h + 'px" ' + 'version="1.1">' + data + '</svg>'));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import mx from '../mx';
|
|
2
2
|
export default function () {
|
|
3
3
|
var mxCloud = mx.mxCloud,
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
mxConnectionConstraint = mx.mxConnectionConstraint,
|
|
5
|
+
mxPoint = mx.mxPoint;
|
|
6
6
|
mxCloud.prototype.constraints = [new mxConnectionConstraint(new mxPoint(0.25, 0.25), false), new mxConnectionConstraint(new mxPoint(0.4, 0.1), false), new mxConnectionConstraint(new mxPoint(0.16, 0.55), false), new mxConnectionConstraint(new mxPoint(0.07, 0.4), false), new mxConnectionConstraint(new mxPoint(0.31, 0.8), false), new mxConnectionConstraint(new mxPoint(0.13, 0.77), false), new mxConnectionConstraint(new mxPoint(0.8, 0.8), false), new mxConnectionConstraint(new mxPoint(0.55, 0.95), false), new mxConnectionConstraint(new mxPoint(0.875, 0.5), false), new mxConnectionConstraint(new mxPoint(0.96, 0.7), false), new mxConnectionConstraint(new mxPoint(0.625, 0.2), false), new mxConnectionConstraint(new mxPoint(0.88, 0.25), false)];
|
|
7
7
|
}
|
|
@@ -1,30 +1,25 @@
|
|
|
1
1
|
import mx from '../mx';
|
|
2
2
|
export default function () {
|
|
3
3
|
var mxCylinder = mx.mxCylinder,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
mxUtils = mx.mxUtils,
|
|
5
|
+
mxRectangle = mx.mxRectangle,
|
|
6
|
+
mxConnectionConstraint = mx.mxConnectionConstraint,
|
|
7
|
+
mxPoint = mx.mxPoint;
|
|
8
8
|
var cylinderGetCylinderSize = mxCylinder.prototype.getCylinderSize;
|
|
9
|
-
|
|
10
9
|
mxCylinder.prototype.getCylinderSize = function (x, y, w, h) {
|
|
11
10
|
var size = mxUtils.getValue(this.style, 'size');
|
|
12
|
-
|
|
13
11
|
if (size != null) {
|
|
14
12
|
return h * Math.max(0, Math.min(1, size));
|
|
15
13
|
} else {
|
|
16
14
|
return cylinderGetCylinderSize.apply(this, arguments);
|
|
17
15
|
}
|
|
18
16
|
};
|
|
19
|
-
|
|
20
17
|
mxCylinder.prototype.getLabelMargins = function (rect) {
|
|
21
18
|
if (mxUtils.getValue(this.style, 'boundedLbl', false)) {
|
|
22
19
|
var size = mxUtils.getValue(this.style, 'size', 0.15) * 2;
|
|
23
20
|
return new mxRectangle(0, Math.min(this.maxHeight * this.scale, rect.height * size), 0, 0);
|
|
24
21
|
}
|
|
25
|
-
|
|
26
22
|
return null;
|
|
27
23
|
};
|
|
28
|
-
|
|
29
24
|
mxCylinder.prototype.constraints = [new mxConnectionConstraint(new mxPoint(0.15, 0.05), false), new mxConnectionConstraint(new mxPoint(0.5, 0), true), new mxConnectionConstraint(new mxPoint(0.85, 0.05), false), new mxConnectionConstraint(new mxPoint(0, 0.3), true), new mxConnectionConstraint(new mxPoint(0, 0.5), true), new mxConnectionConstraint(new mxPoint(0, 0.7), true), new mxConnectionConstraint(new mxPoint(1, 0.3), true), new mxConnectionConstraint(new mxPoint(1, 0.5), true), new mxConnectionConstraint(new mxPoint(1, 0.7), true), new mxConnectionConstraint(new mxPoint(0.15, 0.95), false), new mxConnectionConstraint(new mxPoint(0.5, 1), true), new mxConnectionConstraint(new mxPoint(0.85, 0.95), false)];
|
|
30
25
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import mx from '../mx';
|
|
2
2
|
export default function () {
|
|
3
3
|
var mxEllipse = mx.mxEllipse,
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
mxConnectionConstraint = mx.mxConnectionConstraint,
|
|
5
|
+
mxPoint = mx.mxPoint;
|
|
6
6
|
mxEllipse.prototype.constraints = [new mxConnectionConstraint(new mxPoint(0, 0), true), new mxConnectionConstraint(new mxPoint(1, 0), true), new mxConnectionConstraint(new mxPoint(0, 1), true), new mxConnectionConstraint(new mxPoint(1, 1), true), new mxConnectionConstraint(new mxPoint(0.5, 0), true), new mxConnectionConstraint(new mxPoint(0.5, 1), true), new mxConnectionConstraint(new mxPoint(0, 0.5), true), new mxConnectionConstraint(new mxPoint(1, 0.5))];
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import mx from '../mx';
|
|
2
2
|
export default function () {
|
|
3
3
|
var mxHexagon = mx.mxHexagon,
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
mxConnectionConstraint = mx.mxConnectionConstraint,
|
|
5
|
+
mxPoint = mx.mxPoint;
|
|
6
6
|
mxHexagon.prototype.constraints = [new mxConnectionConstraint(new mxPoint(0.375, 0), true), new mxConnectionConstraint(new mxPoint(0.5, 0), true), new mxConnectionConstraint(new mxPoint(0.625, 0), true), new mxConnectionConstraint(new mxPoint(0, 0.25), true), new mxConnectionConstraint(new mxPoint(0, 0.5), true), new mxConnectionConstraint(new mxPoint(0, 0.75), true), new mxConnectionConstraint(new mxPoint(1, 0.25), true), new mxConnectionConstraint(new mxPoint(1, 0.5), true), new mxConnectionConstraint(new mxPoint(1, 0.75), true), new mxConnectionConstraint(new mxPoint(0.375, 1), true), new mxConnectionConstraint(new mxPoint(0.5, 1), true), new mxConnectionConstraint(new mxPoint(0.625, 1), true)];
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import mx from '../mx';
|
|
2
2
|
export default function () {
|
|
3
3
|
var mxLine = mx.mxLine,
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
mxConnectionConstraint = mx.mxConnectionConstraint,
|
|
5
|
+
mxPoint = mx.mxPoint;
|
|
6
6
|
mxLine.prototype.constraints = [new mxConnectionConstraint(new mxPoint(0, 0.5), false), new mxConnectionConstraint(new mxPoint(0.25, 0.5), false), new mxConnectionConstraint(new mxPoint(0.75, 0.5), false), new mxConnectionConstraint(new mxPoint(1, 0.5), false)];
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import mx from '../mx';
|
|
2
2
|
export default function () {
|
|
3
3
|
var mxRectangleShape = mx.mxRectangleShape,
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
mxConnectionConstraint = mx.mxConnectionConstraint,
|
|
5
|
+
mxPoint = mx.mxPoint;
|
|
6
6
|
mxRectangleShape.prototype.constraints = [new mxConnectionConstraint(new mxPoint(0.25, 0), true), new mxConnectionConstraint(new mxPoint(0.5, 0), true), new mxConnectionConstraint(new mxPoint(0.75, 0), true), new mxConnectionConstraint(new mxPoint(0, 0.25), true), new mxConnectionConstraint(new mxPoint(0, 0.5), true), new mxConnectionConstraint(new mxPoint(0, 0.75), true), new mxConnectionConstraint(new mxPoint(1, 0.25), true), new mxConnectionConstraint(new mxPoint(1, 0.5), true), new mxConnectionConstraint(new mxPoint(1, 0.75), true), new mxConnectionConstraint(new mxPoint(0.25, 1), true), new mxConnectionConstraint(new mxPoint(0.5, 1), true), new mxConnectionConstraint(new mxPoint(0.75, 1), true)];
|
|
7
7
|
}
|
|
@@ -1,39 +1,33 @@
|
|
|
1
1
|
import mx from '../mx';
|
|
2
2
|
export default function () {
|
|
3
3
|
var mxRhombus = mx.mxRhombus,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
mxConstants = mx.mxConstants,
|
|
5
|
+
mxRectangle = mx.mxRectangle,
|
|
6
|
+
mxEllipse = mx.mxEllipse;
|
|
7
|
+
// Overrides painting of rhombus shape to allow for double style
|
|
8
8
|
var mxRhombusPaintVertexShape = mxRhombus.prototype.paintVertexShape;
|
|
9
|
-
|
|
10
9
|
mxRhombus.prototype.getLabelBounds = function (rect) {
|
|
11
10
|
if (this.style['double'] == 1) {
|
|
12
11
|
var margin = (Math.max(2, this.strokewidth + 1) * 2 + parseFloat(this.style[mxConstants.STYLE_MARGIN] || 0)) * this.scale;
|
|
13
12
|
return new mxRectangle(rect.x + margin, rect.y + margin, rect.width - 2 * margin, rect.height - 2 * margin);
|
|
14
13
|
}
|
|
15
|
-
|
|
16
14
|
return rect;
|
|
17
15
|
};
|
|
18
|
-
|
|
19
16
|
mxRhombus.prototype.paintVertexShape = function (c, x, y, w, h) {
|
|
20
17
|
mxRhombusPaintVertexShape.apply(this, arguments);
|
|
21
|
-
|
|
22
18
|
if (!this.outline && this.style['double'] == 1) {
|
|
23
19
|
var margin = Math.max(2, this.strokewidth + 1) * 2 + parseFloat(this.style[mxConstants.STYLE_MARGIN] || 0);
|
|
24
20
|
x += margin;
|
|
25
21
|
y += margin;
|
|
26
22
|
w -= 2 * margin;
|
|
27
23
|
h -= 2 * margin;
|
|
28
|
-
|
|
29
24
|
if (w > 0 && h > 0) {
|
|
30
|
-
c.setShadow(false);
|
|
25
|
+
c.setShadow(false);
|
|
26
|
+
// Workaround for closure compiler bug where the lines with x and y above
|
|
31
27
|
// are removed if arguments is used as second argument in call below.
|
|
32
|
-
|
|
33
28
|
mxRhombusPaintVertexShape.apply(this, [c, x, y, w, h]);
|
|
34
29
|
}
|
|
35
30
|
}
|
|
36
31
|
};
|
|
37
|
-
|
|
38
32
|
mxRhombus.prototype.constraints = mxEllipse.prototype.constraints;
|
|
39
33
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import mx from '../mx';
|
|
2
2
|
export default function () {
|
|
3
3
|
var mxTriangle = mx.mxTriangle,
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
mxConnectionConstraint = mx.mxConnectionConstraint,
|
|
5
|
+
mxPoint = mx.mxPoint;
|
|
6
6
|
mxTriangle.prototype.constraints = [new mxConnectionConstraint(new mxPoint(0, 0.25), true), new mxConnectionConstraint(new mxPoint(0, 0.5), true), new mxConnectionConstraint(new mxPoint(0, 0.75), true), new mxConnectionConstraint(new mxPoint(0.5, 0), true), new mxConnectionConstraint(new mxPoint(0.5, 1), true), new mxConnectionConstraint(new mxPoint(1, 0.5), true)];
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import mx from '../mx';
|
|
2
2
|
export default function () {
|
|
3
|
-
var mxConstants = mx.mxConstants;
|
|
4
|
-
|
|
3
|
+
var mxConstants = mx.mxConstants;
|
|
4
|
+
// Sets colors for handles
|
|
5
5
|
mxConstants.HANDLE_FILLCOLOR = '#29b6f2';
|
|
6
6
|
mxConstants.HANDLE_STROKECOLOR = '#0088cf';
|
|
7
7
|
mxConstants.VERTEX_SELECTION_COLOR = '#00a8ff';
|
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
import mx from '../mx';
|
|
2
2
|
export default function () {
|
|
3
3
|
var mxGuide = mx.mxGuide,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
mxPolyline = mx.mxPolyline,
|
|
5
|
+
mxConstants = mx.mxConstants,
|
|
6
|
+
mxEvent = mx.mxEvent;
|
|
7
7
|
/**
|
|
8
8
|
* No dashed shapes.
|
|
9
9
|
*/
|
|
10
|
-
|
|
11
10
|
mxGuide.prototype.createGuideShape = function () {
|
|
12
11
|
var guide = new mxPolyline([], mxConstants.GUIDE_COLOR, mxConstants.GUIDE_STROKEWIDTH);
|
|
13
12
|
return guide;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
};
|
|
14
|
+
// Alt disables guides
|
|
17
15
|
mxGuide.prototype.isEnabledForEvent = function (evt) {
|
|
18
16
|
return !mxEvent.isAltDown(evt);
|
|
19
17
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import mx from '../mx';
|
|
2
2
|
export default function () {
|
|
3
3
|
var mxCellEditor = mx.mxCellEditor,
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
mxUtils = mx.mxUtils,
|
|
5
|
+
mxClient = mx.mxClient;
|
|
6
6
|
mxCellEditor.prototype.blurEnabled = true;
|
|
7
7
|
/**
|
|
8
8
|
* HTML in-place editor
|
|
@@ -11,58 +11,49 @@ export default function () {
|
|
|
11
11
|
// var state = this.graph.view.getState(this.editingCell);
|
|
12
12
|
// return state != null && state.style['html'] == 1;
|
|
13
13
|
// };
|
|
14
|
-
|
|
15
14
|
var mxCellEditorGetInitialValue = mxCellEditor.prototype.getInitialValue;
|
|
16
|
-
|
|
17
15
|
mxCellEditor.prototype.getInitialValue = function (state, trigger) {
|
|
18
16
|
if (mxUtils.getValue(state.style, 'html', '0') == '0') {
|
|
19
17
|
return mxCellEditorGetInitialValue.apply(this, arguments);
|
|
20
18
|
} else {
|
|
21
19
|
var result = this.graph.getEditingValue(state.cell, trigger);
|
|
22
|
-
|
|
23
20
|
if (mxUtils.getValue(state.style, 'nl2Br', '1') == '1') {
|
|
24
21
|
result = result.replace(/\n/g, '<br/>');
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
}
|
|
23
|
+
// result = this.graph.sanitizeHtml(result, true);
|
|
28
24
|
return result;
|
|
29
25
|
}
|
|
30
26
|
};
|
|
31
27
|
/**
|
|
32
28
|
* HTML in-place editor
|
|
33
29
|
*/
|
|
34
|
-
|
|
35
|
-
|
|
36
30
|
mxCellEditor.prototype.escapeCancelsEditing = false;
|
|
37
31
|
var mxCellEditorStartEditing = mxCellEditor.prototype.startEditing;
|
|
38
|
-
|
|
39
32
|
mxCellEditor.prototype.startEditing = function (cell, trigger) {
|
|
40
|
-
mxCellEditorStartEditing.apply(this, arguments);
|
|
33
|
+
mxCellEditorStartEditing.apply(this, arguments);
|
|
34
|
+
// Overrides class in case of HTML content to add
|
|
41
35
|
// dashed borders for divs and table cells
|
|
42
|
-
|
|
43
36
|
var state = this.graph.view.getState(cell);
|
|
44
|
-
|
|
45
37
|
if (state != null && state.style['html'] == 1) {
|
|
46
38
|
this.textarea.className = 'mxCellEditor';
|
|
47
39
|
} else {
|
|
48
40
|
this.textarea.className = 'mxCellEditor mxPlainTextEditor';
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
41
|
+
}
|
|
42
|
+
// Toggles markup vs wysiwyg mode
|
|
43
|
+
this.codeViewMode = false;
|
|
44
|
+
// Stores current selection range when switching between markup and code
|
|
45
|
+
this.switchSelectionState = null;
|
|
46
|
+
// Selects editing cell
|
|
47
|
+
this.graph.setSelectionCell(cell);
|
|
48
|
+
// Enables focus outline for edges and edge labels
|
|
58
49
|
var parent = this.graph.getModel().getParent(cell);
|
|
59
50
|
var geo = this.graph.getCellGeometry(cell);
|
|
60
|
-
|
|
61
51
|
if (this.graph.getModel().isEdge(parent) && geo != null && geo.relative || this.graph.getModel().isEdge(cell)) {
|
|
62
52
|
// Quirks does not support outline at all so use border instead
|
|
63
53
|
if (mxClient.IS_QUIRKS) {
|
|
64
54
|
this.textarea.style.border = 'gray dotted 1px';
|
|
65
|
-
}
|
|
55
|
+
}
|
|
56
|
+
// IE>8 and FF on Windows uses outline default of none
|
|
66
57
|
else if (mxClient.IS_IE || mxClient.IS_IE11 || mxClient.IS_FF && mxClient.IS_WIN) {
|
|
67
58
|
this.textarea.style.outline = 'gray dotted 1px';
|
|
68
59
|
} else {
|
|
@@ -73,21 +64,17 @@ export default function () {
|
|
|
73
64
|
this.textarea.style.border = '';
|
|
74
65
|
}
|
|
75
66
|
};
|
|
76
|
-
|
|
77
67
|
var mxCellEditorGetCurrentValue = mxCellEditor.prototype.getCurrentValue;
|
|
78
|
-
|
|
79
68
|
mxCellEditor.prototype.getCurrentValue = function (state) {
|
|
80
69
|
if (mxUtils.getValue(state.style, 'html', '0') == '0') {
|
|
81
70
|
return mxCellEditorGetCurrentValue.apply(this, arguments);
|
|
82
71
|
} else {
|
|
83
72
|
var result = this.textarea.innerHTML;
|
|
84
|
-
|
|
85
73
|
if (mxUtils.getValue(state.style, 'nl2Br', '1') == '1') {
|
|
86
74
|
result = result.replace(/\r\n/g, '<br/>').replace(/\n/g, '<br/>');
|
|
87
75
|
} else {
|
|
88
76
|
result = result.replace(/\r\n/g, '').replace(/\n/g, '');
|
|
89
77
|
}
|
|
90
|
-
|
|
91
78
|
return result;
|
|
92
79
|
}
|
|
93
80
|
};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import mx from '../mx';
|
|
1
|
+
import mx from '../mx';
|
|
2
|
+
// import expandedImage from 'mxgraphx/javascript/src/images/expanded.gif';
|
|
2
3
|
// import collapsedImage from 'mxgraphx/javascript/src/images/collapsed.gif';
|
|
3
|
-
|
|
4
4
|
export default function () {
|
|
5
5
|
var mxGraph = mx.mxGraph,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
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==";
|
|
13
|
+
var collapsedImage = "data:image/gif;base64,R0lGODlhCQAJAPcAAAAAABAICHuUrXuctYSMlISUnISUpYSUrYScrYyUnIyUpYycpZScnJScpaXG3q3G1q3G3rW1vbW9xrW9zsbGzsbO3sbW3s7Oztbe3tbe597e3t7e597n7+fn7+/v7+/3/+////f39/f//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////ywAAAAACQAJAAAIUgAdCDBQoAADAgseCADBUIRDEAYMgPggAkCIDx8QKMA4AsCIEBwKEKgIIAAAABgMMNjgwYNFDRYMEOCAQQOACxQqFFBQQUIEnz8NPIhINOKDgAAAOw==";
|
|
14
|
+
// Adds support for HTML labels via style. Note: Currently, only the Java
|
|
14
15
|
// backend supports HTML labels but CSS support is limited to the following:
|
|
15
16
|
// http://docs.oracle.com/javase/6/docs/api/index.html?javax/swing/text/html/CSS.html
|
|
16
17
|
// TODO: Wrap should not affect isHtmlLabel output (should be handled later)
|
|
17
18
|
// const isHtmlLabel = mxGraph.prototype.isHtmlLabel;
|
|
18
|
-
|
|
19
19
|
mxGraph.prototype.isHtmlLabel = function (cell) {
|
|
20
20
|
var state = this.view.getState(cell);
|
|
21
21
|
var style = state != null ? state.style : this.getCellStyle(cell);
|
|
@@ -24,27 +24,22 @@ export default function () {
|
|
|
24
24
|
/**
|
|
25
25
|
* Overrides method to provide connection constraints for shapes.
|
|
26
26
|
*/
|
|
27
|
-
|
|
28
|
-
|
|
29
27
|
mxGraph.prototype.getAllConnectionConstraints = function (terminal, source) {
|
|
30
28
|
if (terminal != null) {
|
|
31
29
|
var constraints = mxUtils.getValue(terminal.style, 'points', null);
|
|
32
|
-
|
|
33
30
|
if (constraints != null) {
|
|
34
31
|
// Requires an array of arrays with x, y (0..1), an optional
|
|
35
32
|
// [perimeter (0 or 1), dx, and dy] eg. points=[[0,0,1,-10,10],[0,1,0],[1,1]]
|
|
36
33
|
var result = [];
|
|
37
|
-
|
|
38
34
|
try {
|
|
39
35
|
var c = JSON.parse(constraints);
|
|
40
|
-
|
|
41
36
|
for (var i = 0; i < c.length; i++) {
|
|
42
37
|
var tmp = c[i];
|
|
43
38
|
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
39
|
}
|
|
45
|
-
} catch (e) {
|
|
40
|
+
} catch (e) {
|
|
41
|
+
// ignore
|
|
46
42
|
}
|
|
47
|
-
|
|
48
43
|
return result;
|
|
49
44
|
} else if (terminal.shape != null && terminal.shape.bounds != null) {
|
|
50
45
|
var dir = terminal.shape.direction;
|
|
@@ -52,15 +47,12 @@ export default function () {
|
|
|
52
47
|
var scale = terminal.shape.scale;
|
|
53
48
|
var w = bounds.width / scale;
|
|
54
49
|
var h = bounds.height / scale;
|
|
55
|
-
|
|
56
50
|
if (dir == mxConstants.DIRECTION_NORTH || dir == mxConstants.DIRECTION_SOUTH) {
|
|
57
51
|
var tmp = w;
|
|
58
52
|
w = h;
|
|
59
53
|
h = tmp;
|
|
60
54
|
}
|
|
61
|
-
|
|
62
55
|
constraints = terminal.shape.getConstraints(terminal.style, w, h);
|
|
63
|
-
|
|
64
56
|
if (constraints != null) {
|
|
65
57
|
return constraints;
|
|
66
58
|
} else if (terminal.shape.stencil != null && terminal.shape.stencil.constraints != null) {
|
|
@@ -70,14 +62,11 @@ export default function () {
|
|
|
70
62
|
}
|
|
71
63
|
}
|
|
72
64
|
}
|
|
73
|
-
|
|
74
65
|
return null;
|
|
75
66
|
};
|
|
76
67
|
/**
|
|
77
68
|
* Returns a point that specifies the location for inserting cells.
|
|
78
69
|
*/
|
|
79
|
-
|
|
80
|
-
|
|
81
70
|
mxGraph.prototype.getInsertPoint = function () {
|
|
82
71
|
var gs = this.getGridSize();
|
|
83
72
|
var dx = this.container.scrollLeft / this.view.scale - this.view.translate.x;
|
|
@@ -88,12 +77,11 @@ export default function () {
|
|
|
88
77
|
dy = Math.max(dy, layout.y * page.height);
|
|
89
78
|
return new mxPoint(this.snap(dx + gs), this.snap(dy + gs));
|
|
90
79
|
};
|
|
91
|
-
|
|
92
80
|
mxGraph.prototype.getFreeInsertPoint = function () {
|
|
93
81
|
var view = this.view;
|
|
94
82
|
var bds = this.getGraphBounds();
|
|
95
|
-
var pt = this.getInsertPoint();
|
|
96
|
-
|
|
83
|
+
var pt = this.getInsertPoint();
|
|
84
|
+
// Places at same x-coord and 2 grid sizes below existing graph
|
|
97
85
|
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
86
|
var y = this.snap(Math.round(Math.max(pt.y, (bds.y + bds.height) / view.scale - view.translate.y + 2 * this.gridSize)));
|
|
99
87
|
return new mxPoint(x, y);
|
|
@@ -104,12 +92,9 @@ export default function () {
|
|
|
104
92
|
* left page and width and height are the vertical and horizontal
|
|
105
93
|
* page count.
|
|
106
94
|
*/
|
|
107
|
-
|
|
108
|
-
|
|
109
95
|
mxGraph.prototype.getPageLayout = function () {
|
|
110
96
|
var size = this.getPageSize();
|
|
111
97
|
var bounds = this.getGraphBounds();
|
|
112
|
-
|
|
113
98
|
if (bounds.width == 0 || bounds.height == 0) {
|
|
114
99
|
return new mxRectangle(0, 0, 1, 1);
|
|
115
100
|
} else {
|
|
@@ -128,12 +113,9 @@ export default function () {
|
|
|
128
113
|
/**
|
|
129
114
|
* Returns the size of the page format scaled with the page size.
|
|
130
115
|
*/
|
|
131
|
-
|
|
132
|
-
|
|
133
116
|
mxGraph.prototype.getPageSize = function () {
|
|
134
117
|
return new mxRectangle(0, 0, this.pageFormat.width * this.pageScale, this.pageFormat.height * this.pageScale);
|
|
135
118
|
};
|
|
136
|
-
|
|
137
119
|
mxGraph.prototype.expandedImage = new mxImage(expandedImage, 9, 9);
|
|
138
120
|
mxGraph.prototype.collapsedImage = new mxImage(collapsedImage, 9, 9);
|
|
139
121
|
}
|