@king-design/vue 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 +1013 -0
- 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
|
@@ -12,19 +12,14 @@ var mxClient = mx.mxClient;
|
|
|
12
12
|
var downName = mxClient.IS_POINTER ? 'pointerdown' : 'mousedown';
|
|
13
13
|
var upName = mxClient.IS_POINTER ? 'pointerup' : 'mouseup';
|
|
14
14
|
var moveName = mxClient.IS_POINTER ? 'pointermove' : 'mousemove';
|
|
15
|
-
|
|
16
15
|
var BaseDemo = /*#__PURE__*/function (_Component) {
|
|
17
16
|
_inheritsLoose(BaseDemo, _Component);
|
|
18
|
-
|
|
19
17
|
function BaseDemo() {
|
|
20
18
|
var _context;
|
|
21
|
-
|
|
22
19
|
var _this;
|
|
23
|
-
|
|
24
20
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
25
21
|
args[_key] = arguments[_key];
|
|
26
22
|
}
|
|
27
|
-
|
|
28
23
|
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
29
24
|
_this.Diagram = Diagram;
|
|
30
25
|
_this.DFlowLayout = DFlowLayout;
|
|
@@ -44,585 +39,464 @@ var BaseDemo = /*#__PURE__*/function (_Component) {
|
|
|
44
39
|
_this.DCallout = DCallout;
|
|
45
40
|
return _this;
|
|
46
41
|
}
|
|
47
|
-
|
|
48
42
|
return BaseDemo;
|
|
49
43
|
}(Component);
|
|
50
|
-
|
|
51
44
|
describe('Diagram', function () {
|
|
52
45
|
afterEach(function () {
|
|
53
46
|
unmount();
|
|
54
47
|
});
|
|
55
48
|
it('should update type of DFlowLayout', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
56
49
|
var Demo, _mount, instance, element;
|
|
57
|
-
|
|
58
50
|
return _regeneratorRuntime.wrap(function _callee$(_context2) {
|
|
59
|
-
while (1) {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
Demo
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
Demo.defaults = function defaults() {
|
|
70
|
-
return {
|
|
71
|
-
type: 'vertical'
|
|
72
|
-
};
|
|
51
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
52
|
+
case 0:
|
|
53
|
+
Demo = /*#__PURE__*/function (_BaseDemo) {
|
|
54
|
+
_inheritsLoose(Demo, _BaseDemo);
|
|
55
|
+
function Demo() {
|
|
56
|
+
return _BaseDemo.apply(this, arguments) || this;
|
|
57
|
+
}
|
|
58
|
+
Demo.defaults = function defaults() {
|
|
59
|
+
return {
|
|
60
|
+
type: 'vertical'
|
|
73
61
|
};
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
case 8:
|
|
89
|
-
case "end":
|
|
90
|
-
return _context2.stop();
|
|
91
|
-
}
|
|
62
|
+
};
|
|
63
|
+
return Demo;
|
|
64
|
+
}(BaseDemo);
|
|
65
|
+
Demo.template = "\n const {Diagram, DFlowLayout, DDiamond, DCircle, DLine} = this;\n <Diagram>\n <DFlowLayout type={this.get('type')}>\n <DDiamond key=\"1\" style={{fillColor: 'red'}} />\n <DCircle key=\"2\" />\n <DLine from=\"1\" to=\"2\" />\n </DFlowLayout>\n </Diagram>\n ";
|
|
66
|
+
_mount = mount(Demo), instance = _mount[0], element = _mount[1];
|
|
67
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
68
|
+
instance.set('type', 'horizontal');
|
|
69
|
+
_context2.next = 7;
|
|
70
|
+
return wait();
|
|
71
|
+
case 7:
|
|
72
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
73
|
+
case 8:
|
|
74
|
+
case "end":
|
|
75
|
+
return _context2.stop();
|
|
92
76
|
}
|
|
93
77
|
}, _callee);
|
|
94
78
|
})));
|
|
95
79
|
it('should update type of DTreeLayout', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
96
80
|
var Demo, _mount2, instance, element;
|
|
97
|
-
|
|
98
81
|
return _regeneratorRuntime.wrap(function _callee2$(_context3) {
|
|
99
|
-
while (1) {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
Demo
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
Demo.defaults = function defaults() {
|
|
110
|
-
return {
|
|
111
|
-
type: 'vertical'
|
|
112
|
-
};
|
|
82
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
83
|
+
case 0:
|
|
84
|
+
Demo = /*#__PURE__*/function (_BaseDemo2) {
|
|
85
|
+
_inheritsLoose(Demo, _BaseDemo2);
|
|
86
|
+
function Demo() {
|
|
87
|
+
return _BaseDemo2.apply(this, arguments) || this;
|
|
88
|
+
}
|
|
89
|
+
Demo.defaults = function defaults() {
|
|
90
|
+
return {
|
|
91
|
+
type: 'vertical'
|
|
113
92
|
};
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
case 8:
|
|
129
|
-
case "end":
|
|
130
|
-
return _context3.stop();
|
|
131
|
-
}
|
|
93
|
+
};
|
|
94
|
+
return Demo;
|
|
95
|
+
}(BaseDemo);
|
|
96
|
+
Demo.template = "\n const {Diagram, DTreeLayout, DRectangle, DCircle, DLine} = this;\n <Diagram>\n <DTreeLayout type={this.get('type')}>\n <DRectangle key=\"1\" />\n <DCircle key=\"2\" />\n <DCircle key=\"3\" />\n <DLine from=\"1\" to=\"2\" />\n <DLine from=\"1\" to=\"3\" />\n </DTreeLayout>\n </Diagram>\n ";
|
|
97
|
+
_mount2 = mount(Demo), instance = _mount2[0], element = _mount2[1];
|
|
98
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
99
|
+
instance.set('type', 'horizontal');
|
|
100
|
+
_context3.next = 7;
|
|
101
|
+
return wait();
|
|
102
|
+
case 7:
|
|
103
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
104
|
+
case 8:
|
|
105
|
+
case "end":
|
|
106
|
+
return _context3.stop();
|
|
132
107
|
}
|
|
133
108
|
}, _callee2);
|
|
134
109
|
})));
|
|
135
110
|
it('should update layout when layout changed', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
136
111
|
var Demo, _mount3, instance, element, tmp;
|
|
137
|
-
|
|
138
112
|
return _regeneratorRuntime.wrap(function _callee3$(_context4) {
|
|
139
|
-
while (1) {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
Demo
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
Demo.defaults = function defaults() {
|
|
150
|
-
return {
|
|
151
|
-
type: 'tree'
|
|
152
|
-
};
|
|
113
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
114
|
+
case 0:
|
|
115
|
+
Demo = /*#__PURE__*/function (_BaseDemo3) {
|
|
116
|
+
_inheritsLoose(Demo, _BaseDemo3);
|
|
117
|
+
function Demo() {
|
|
118
|
+
return _BaseDemo3.apply(this, arguments) || this;
|
|
119
|
+
}
|
|
120
|
+
Demo.defaults = function defaults() {
|
|
121
|
+
return {
|
|
122
|
+
type: 'tree'
|
|
153
123
|
};
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
case 13:
|
|
176
|
-
case "end":
|
|
177
|
-
return _context4.stop();
|
|
178
|
-
}
|
|
124
|
+
};
|
|
125
|
+
return Demo;
|
|
126
|
+
}(BaseDemo);
|
|
127
|
+
Demo.template = "\n const {DRectangle, DCircle, DLine, Diagram, DTreeLayout, DFlowLayout} = this;\n var shapes = [\n <DRectangle key=\"1\" />,\n <DCircle key=\"2\" />,\n <DCircle key=\"3\" />,\n <DCircle />,\n <DLine from=\"1\" to=\"2\" />,\n <DLine from=\"1\" to=\"3\" />,\n ];\n <Diagram>\n <DTreeLayout v-if={this.get('type') === 'tree'}>\n {shapes}\n </DTreeLayout>\n <DFlowLayout v-else>\n {shapes}\n </DFlowLayout>\n </Diagram>\n ";
|
|
128
|
+
_mount3 = mount(Demo), instance = _mount3[0], element = _mount3[1];
|
|
129
|
+
tmp = element.innerHTML;
|
|
130
|
+
expect(tmp).to.matchSnapshot();
|
|
131
|
+
instance.set('type', 'flow');
|
|
132
|
+
_context4.next = 8;
|
|
133
|
+
return wait();
|
|
134
|
+
case 8:
|
|
135
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
136
|
+
instance.set('type', 'tree');
|
|
137
|
+
_context4.next = 12;
|
|
138
|
+
return wait();
|
|
139
|
+
case 12:
|
|
140
|
+
expect(element.innerHTML).to.eql(tmp);
|
|
141
|
+
case 13:
|
|
142
|
+
case "end":
|
|
143
|
+
return _context4.stop();
|
|
179
144
|
}
|
|
180
145
|
}, _callee3);
|
|
181
146
|
})));
|
|
182
147
|
it('should render kpc components in shape', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
183
148
|
var Demo, _mount4, instance, element;
|
|
184
|
-
|
|
185
149
|
return _regeneratorRuntime.wrap(function _callee4$(_context5) {
|
|
186
|
-
while (1) {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
Demo
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
Demo.defaults = function defaults() {
|
|
197
|
-
return {
|
|
198
|
-
counts: 0
|
|
199
|
-
};
|
|
150
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
151
|
+
case 0:
|
|
152
|
+
Demo = /*#__PURE__*/function (_BaseDemo4) {
|
|
153
|
+
_inheritsLoose(Demo, _BaseDemo4);
|
|
154
|
+
function Demo() {
|
|
155
|
+
return _BaseDemo4.apply(this, arguments) || this;
|
|
156
|
+
}
|
|
157
|
+
Demo.defaults = function defaults() {
|
|
158
|
+
return {
|
|
159
|
+
counts: 0
|
|
200
160
|
};
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
expect(element.innerHTML).to.matchSnapshot();
|
|
220
|
-
|
|
221
|
-
case 8:
|
|
222
|
-
case "end":
|
|
223
|
-
return _context5.stop();
|
|
224
|
-
}
|
|
161
|
+
};
|
|
162
|
+
var _proto = Demo.prototype;
|
|
163
|
+
_proto._onClick = function _onClick() {
|
|
164
|
+
this.set('counts', this.get('counts') + 1);
|
|
165
|
+
};
|
|
166
|
+
return Demo;
|
|
167
|
+
}(BaseDemo);
|
|
168
|
+
Demo.template = "\n const {Diagram, DRectangle, Button} = this;\n <Diagram>\n <DRectangle>\n <Button ev-click={this._onClick.bind(this)} ref=\"button\">click</Button>\n <div>click counts: {this.get('counts')}</div>\n </DRectangle>\n </Diagram>\n ";
|
|
169
|
+
_mount4 = mount(Demo), instance = _mount4[0], element = _mount4[1];
|
|
170
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
171
|
+
instance.refs.button.elementRef.value.click();
|
|
172
|
+
_context5.next = 7;
|
|
173
|
+
return wait();
|
|
174
|
+
case 7:
|
|
175
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
176
|
+
case 8:
|
|
177
|
+
case "end":
|
|
178
|
+
return _context5.stop();
|
|
225
179
|
}
|
|
226
180
|
}, _callee4);
|
|
227
181
|
})));
|
|
228
182
|
it('should remove element in shape correctly', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
|
|
229
183
|
var destroy, Demo, _mount5, instance, element;
|
|
230
|
-
|
|
231
184
|
return _regeneratorRuntime.wrap(function _callee5$(_context6) {
|
|
232
|
-
while (1) {
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
Demo.defaults = function defaults() {
|
|
247
|
-
return {
|
|
248
|
-
show: true
|
|
249
|
-
};
|
|
250
|
-
};
|
|
251
|
-
|
|
252
|
-
var _proto2 = Demo.prototype;
|
|
253
|
-
|
|
254
|
-
_proto2._onDestroy = function _onDestroy() {
|
|
255
|
-
destroy();
|
|
185
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
186
|
+
case 0:
|
|
187
|
+
destroy = sinon.spy(function () {
|
|
188
|
+
return console.log('destroy');
|
|
189
|
+
});
|
|
190
|
+
Demo = /*#__PURE__*/function (_BaseDemo5) {
|
|
191
|
+
_inheritsLoose(Demo, _BaseDemo5);
|
|
192
|
+
function Demo() {
|
|
193
|
+
return _BaseDemo5.apply(this, arguments) || this;
|
|
194
|
+
}
|
|
195
|
+
Demo.defaults = function defaults() {
|
|
196
|
+
return {
|
|
197
|
+
show: true
|
|
256
198
|
};
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
199
|
+
};
|
|
200
|
+
var _proto2 = Demo.prototype;
|
|
201
|
+
_proto2._onDestroy = function _onDestroy() {
|
|
202
|
+
destroy();
|
|
203
|
+
};
|
|
204
|
+
return Demo;
|
|
205
|
+
}(BaseDemo);
|
|
206
|
+
Demo.template = "\n const {Diagram, DRectangle, Button} = this;\n <Diagram>\n <DRectangle key=\"1\" v-if={this.get('show')}>\n <Button ev-$beforeUnmount={this._onDestroy}>test</Button>\n </DRectangle>\n </Diagram>\n ";
|
|
207
|
+
_mount5 = mount(Demo), instance = _mount5[0], element = _mount5[1];
|
|
208
|
+
instance.set('show', false);
|
|
209
|
+
_context6.next = 7;
|
|
210
|
+
return wait();
|
|
211
|
+
case 7:
|
|
212
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
213
|
+
expect(destroy.callCount).to.eql(1);
|
|
214
|
+
case 9:
|
|
215
|
+
case "end":
|
|
216
|
+
return _context6.stop();
|
|
275
217
|
}
|
|
276
218
|
}, _callee5);
|
|
277
219
|
})));
|
|
278
220
|
it('should replace shape correctly', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
|
|
279
221
|
var Demo, _mount6, instance, element;
|
|
280
|
-
|
|
281
222
|
return _regeneratorRuntime.wrap(function _callee6$(_context7) {
|
|
282
|
-
while (1) {
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
Demo
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
Demo.defaults = function defaults() {
|
|
293
|
-
return {
|
|
294
|
-
show: true
|
|
295
|
-
};
|
|
223
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
224
|
+
case 0:
|
|
225
|
+
Demo = /*#__PURE__*/function (_BaseDemo6) {
|
|
226
|
+
_inheritsLoose(Demo, _BaseDemo6);
|
|
227
|
+
function Demo() {
|
|
228
|
+
return _BaseDemo6.apply(this, arguments) || this;
|
|
229
|
+
}
|
|
230
|
+
Demo.defaults = function defaults() {
|
|
231
|
+
return {
|
|
232
|
+
show: true
|
|
296
233
|
};
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
case 7:
|
|
311
|
-
case "end":
|
|
312
|
-
return _context7.stop();
|
|
313
|
-
}
|
|
234
|
+
};
|
|
235
|
+
return Demo;
|
|
236
|
+
}(BaseDemo);
|
|
237
|
+
Demo.template = "\n const {Diagram, DRectangle, DCircle} = this;\n <Diagram>\n <DRectangle v-if={this.get('show')}>\n <DCircle />\n </DRectangle>\n <DCircle v-else>\n <DRectangle />\n </DCircle>\n </Diagram>\n ";
|
|
238
|
+
_mount6 = mount(Demo), instance = _mount6[0], element = _mount6[1];
|
|
239
|
+
instance.set('show', false);
|
|
240
|
+
_context7.next = 6;
|
|
241
|
+
return wait();
|
|
242
|
+
case 6:
|
|
243
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
244
|
+
case 7:
|
|
245
|
+
case "end":
|
|
246
|
+
return _context7.stop();
|
|
314
247
|
}
|
|
315
248
|
}, _callee6);
|
|
316
249
|
})));
|
|
317
250
|
it('should update shape when props changed', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
|
|
318
251
|
var Demo, _mount7, instance, element;
|
|
319
|
-
|
|
320
252
|
return _regeneratorRuntime.wrap(function _callee7$(_context8) {
|
|
321
|
-
while (1) {
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
Demo
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
borderStyle: 'solid',
|
|
335
|
-
rounded: 0,
|
|
336
|
-
invert: false
|
|
337
|
-
};
|
|
253
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
254
|
+
case 0:
|
|
255
|
+
Demo = /*#__PURE__*/function (_BaseDemo7) {
|
|
256
|
+
_inheritsLoose(Demo, _BaseDemo7);
|
|
257
|
+
function Demo() {
|
|
258
|
+
return _BaseDemo7.apply(this, arguments) || this;
|
|
259
|
+
}
|
|
260
|
+
Demo.defaults = function defaults() {
|
|
261
|
+
return {
|
|
262
|
+
width: 100,
|
|
263
|
+
borderStyle: 'solid',
|
|
264
|
+
rounded: 0,
|
|
265
|
+
invert: false
|
|
338
266
|
};
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
case 8:
|
|
359
|
-
case "end":
|
|
360
|
-
return _context8.stop();
|
|
361
|
-
}
|
|
267
|
+
};
|
|
268
|
+
return Demo;
|
|
269
|
+
}(BaseDemo);
|
|
270
|
+
Demo.template = "\n const {Diagram, DFlowLayout, DRectangle, DCircle, DLine} = this;\n var width = this.get('width');\n var border = this.get('borderStyle');\n var rounded = this.get('rounded');\n var invert = this.get('invert');\n <Diagram>\n <DFlowLayout left={width}>\n <DRectangle key=\"1\"\n width={width}\n html={width}\n strokeStyle={border}\n rounded={rounded}\n />\n <DCircle key=\"2\" width={width} strokeStyle={border} />\n <DLine from={invert ? \"2\" : \"1\"} to={invert ? \"1\" : \"2\"} strokeStyle={border} />\n </DFlowLayout>\n </Diagram>\n ";
|
|
271
|
+
_mount7 = mount(Demo), instance = _mount7[0], element = _mount7[1];
|
|
272
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
273
|
+
instance.set({
|
|
274
|
+
width: 200,
|
|
275
|
+
borderStyle: 'dashed',
|
|
276
|
+
rounded: 5,
|
|
277
|
+
invert: true
|
|
278
|
+
});
|
|
279
|
+
_context8.next = 7;
|
|
280
|
+
return wait();
|
|
281
|
+
case 7:
|
|
282
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
283
|
+
case 8:
|
|
284
|
+
case "end":
|
|
285
|
+
return _context8.stop();
|
|
362
286
|
}
|
|
363
287
|
}, _callee7);
|
|
364
288
|
})));
|
|
365
289
|
it('should render nested layout correctly', function () {
|
|
366
290
|
var Demo = /*#__PURE__*/function (_BaseDemo8) {
|
|
367
291
|
_inheritsLoose(Demo, _BaseDemo8);
|
|
368
|
-
|
|
369
292
|
function Demo() {
|
|
370
293
|
return _BaseDemo8.apply(this, arguments) || this;
|
|
371
294
|
}
|
|
372
|
-
|
|
373
295
|
return Demo;
|
|
374
296
|
}(BaseDemo);
|
|
375
|
-
|
|
376
297
|
Demo.template = "\n const {\n Diagram, DRectangle, DPartitionLayout,\n DStackLayout, DCircle, DDiamond, DEllipse\n } = this;\n <Diagram>\n <DRectangle width=\"300\" height=\"200\">\n <DPartitionLayout type=\"vertical\">\n <DRectangle>\n <DStackLayout fill>\n <DCircle />\n <DDiamond />\n </DStackLayout>\n </DRectangle>\n <DEllipse />\n </DPartitionLayout>\n </DRectangle>\n </Diagram>\n ";
|
|
377
|
-
|
|
378
298
|
var _mount8 = mount(Demo),
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
299
|
+
instance = _mount8[0],
|
|
300
|
+
element = _mount8[1];
|
|
382
301
|
expect(element.innerHTML).to.matchSnapshot();
|
|
383
302
|
});
|
|
384
303
|
it('should change state of shape correctly', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
|
|
385
304
|
var onChange, onLabelChange, Demo, _mount9, instance, element, _element$querySelecto, rect, square, ellipse, editor;
|
|
386
|
-
|
|
387
305
|
return _regeneratorRuntime.wrap(function _callee8$(_context9) {
|
|
388
|
-
while (1) {
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
expect(element.innerHTML).to.matchSnapshot(); // editable
|
|
493
|
-
|
|
494
|
-
dispatchEvent(ellipse, 'dblclick');
|
|
495
|
-
_context9.next = 46;
|
|
496
|
-
return wait();
|
|
497
|
-
|
|
498
|
-
case 46:
|
|
499
|
-
editor = element.querySelector('.mxCellEditor');
|
|
500
|
-
editor.innerHTML = 'test';
|
|
501
|
-
dispatchEvent(element.querySelector('.k-diagram-canvas'), downName);
|
|
502
|
-
expect(onLabelChange.callCount).to.eql(1);
|
|
503
|
-
dispatchEvent(rect, 'dblclick');
|
|
504
|
-
expect(element.innerHTML).to.matchSnapshot();
|
|
505
|
-
expect(element.querySelector('.mxCellEditor')).to.be.null;
|
|
506
|
-
|
|
507
|
-
case 53:
|
|
508
|
-
case "end":
|
|
509
|
-
return _context9.stop();
|
|
510
|
-
}
|
|
306
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
307
|
+
case 0:
|
|
308
|
+
onChange = sinon.spy(function (cells) {
|
|
309
|
+
return console.log(cells);
|
|
310
|
+
});
|
|
311
|
+
onLabelChange = sinon.spy(function (cell, newValue, oldValue) {
|
|
312
|
+
return console.log(cell, newValue, oldValue);
|
|
313
|
+
});
|
|
314
|
+
Demo = /*#__PURE__*/function (_BaseDemo9) {
|
|
315
|
+
_inheritsLoose(Demo, _BaseDemo9);
|
|
316
|
+
function Demo() {
|
|
317
|
+
return _BaseDemo9.apply(this, arguments) || this;
|
|
318
|
+
}
|
|
319
|
+
var _proto3 = Demo.prototype;
|
|
320
|
+
_proto3._onChange = function _onChange(cells) {
|
|
321
|
+
onChange(cells);
|
|
322
|
+
};
|
|
323
|
+
_proto3._onLabelChange = function _onLabelChange(cell, newValue, oldValue) {
|
|
324
|
+
onLabelChange(cell, newValue, oldValue);
|
|
325
|
+
};
|
|
326
|
+
return Demo;
|
|
327
|
+
}(BaseDemo);
|
|
328
|
+
Demo.template = "\n const {Diagram, DFlowLayout, DRectangle, DCircle, DSquare, DLine} = this;\n <Diagram\n ev-selectionChanged={this._onChange}\n ev-labelChanged={this._onLabelChange}\n >\n <DFlowLayout>\n <DRectangle key=\"1\" data={1} selectable movable connectable />\n <DCircle key=\"2\" data=\"2\" editable />\n <DSquare selectable resizable rotatable connectable />\n <DLine from=\"1\" to=\"2\" />\n </DFlowLayout>\n </Diagram>\n ";
|
|
329
|
+
_mount9 = mount(Demo), instance = _mount9[0], element = _mount9[1]; // selectable
|
|
330
|
+
_element$querySelecto = element.querySelectorAll('rect'), rect = _element$querySelecto[0], square = _element$querySelecto[1];
|
|
331
|
+
dispatchEvent(rect, downName);
|
|
332
|
+
_context9.next = 9;
|
|
333
|
+
return wait();
|
|
334
|
+
case 9:
|
|
335
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
336
|
+
dispatchEvent(rect, upName);
|
|
337
|
+
_context9.next = 13;
|
|
338
|
+
return wait();
|
|
339
|
+
case 13:
|
|
340
|
+
ellipse = element.querySelector('ellipse');
|
|
341
|
+
dispatchEvent(ellipse, downName);
|
|
342
|
+
_context9.next = 17;
|
|
343
|
+
return wait();
|
|
344
|
+
case 17:
|
|
345
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
346
|
+
dispatchEvent(ellipse, upName);
|
|
347
|
+
_context9.next = 21;
|
|
348
|
+
return wait();
|
|
349
|
+
case 21:
|
|
350
|
+
expect(onChange.callCount).to.eql(2);
|
|
351
|
+
expect(onChange.calledWith([])).to.be.true;
|
|
352
|
+
// movable
|
|
353
|
+
dispatchEvent(rect, downName, {
|
|
354
|
+
clientX: 0,
|
|
355
|
+
clientY: 0
|
|
356
|
+
});
|
|
357
|
+
dispatchEvent(rect, moveName, {
|
|
358
|
+
clientX: 10,
|
|
359
|
+
clientY: 10
|
|
360
|
+
});
|
|
361
|
+
dispatchEvent(rect, upName, {
|
|
362
|
+
clientX: 10,
|
|
363
|
+
clientY: 10
|
|
364
|
+
});
|
|
365
|
+
_context9.next = 28;
|
|
366
|
+
return wait();
|
|
367
|
+
case 28:
|
|
368
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
369
|
+
expect(element.querySelector('rect').y.baseVal.value).to.eql(10);
|
|
370
|
+
dispatchEvent(ellipse, downName, {
|
|
371
|
+
clientX: 0,
|
|
372
|
+
clientY: 0
|
|
373
|
+
});
|
|
374
|
+
dispatchEvent(ellipse, moveName, {
|
|
375
|
+
clientX: 10,
|
|
376
|
+
clientY: 10
|
|
377
|
+
});
|
|
378
|
+
dispatchEvent(ellipse, upName, {
|
|
379
|
+
clientX: 10,
|
|
380
|
+
clientY: 10
|
|
381
|
+
});
|
|
382
|
+
_context9.next = 35;
|
|
383
|
+
return wait();
|
|
384
|
+
case 35:
|
|
385
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
386
|
+
expect(element.contains(square)).to.be.true;
|
|
387
|
+
expect(square.y.baseVal.value).to.eql(0);
|
|
388
|
+
// resizable & rotatable
|
|
389
|
+
dispatchEvent(square, downName);
|
|
390
|
+
dispatchEvent(square, upName);
|
|
391
|
+
_context9.next = 42;
|
|
392
|
+
return wait();
|
|
393
|
+
case 42:
|
|
394
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
395
|
+
// editable
|
|
396
|
+
dispatchEvent(ellipse, 'dblclick');
|
|
397
|
+
_context9.next = 46;
|
|
398
|
+
return wait();
|
|
399
|
+
case 46:
|
|
400
|
+
editor = element.querySelector('.mxCellEditor');
|
|
401
|
+
editor.innerHTML = 'test';
|
|
402
|
+
dispatchEvent(element.querySelector('.k-diagram-canvas'), downName);
|
|
403
|
+
expect(onLabelChange.callCount).to.eql(1);
|
|
404
|
+
dispatchEvent(rect, 'dblclick');
|
|
405
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
406
|
+
expect(element.querySelector('.mxCellEditor')).to.be.null;
|
|
407
|
+
case 53:
|
|
408
|
+
case "end":
|
|
409
|
+
return _context9.stop();
|
|
511
410
|
}
|
|
512
411
|
}, _callee8);
|
|
513
412
|
})));
|
|
514
413
|
it('test all layouts', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9() {
|
|
515
414
|
var _mount10, instance, element;
|
|
516
|
-
|
|
517
415
|
return _regeneratorRuntime.wrap(function _callee9$(_context10) {
|
|
518
|
-
while (1) {
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
case 10:
|
|
537
|
-
case "end":
|
|
538
|
-
return _context10.stop();
|
|
539
|
-
}
|
|
416
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
417
|
+
case 0:
|
|
418
|
+
_mount10 = mount(LayoutDemo), instance = _mount10[0], element = _mount10[1];
|
|
419
|
+
instance.set('layout', 'circle');
|
|
420
|
+
_context10.next = 4;
|
|
421
|
+
return wait();
|
|
422
|
+
case 4:
|
|
423
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
424
|
+
instance.set('layout', 'radial');
|
|
425
|
+
_context10.next = 8;
|
|
426
|
+
return wait();
|
|
427
|
+
case 8:
|
|
428
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
429
|
+
instance.set('layout', 'organic'); // the result is random
|
|
430
|
+
case 10:
|
|
431
|
+
case "end":
|
|
432
|
+
return _context10.stop();
|
|
540
433
|
}
|
|
541
434
|
}, _callee9);
|
|
542
435
|
})));
|
|
543
436
|
it('should generate connect points of shapes', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10() {
|
|
544
437
|
var Demo, _mount11, instance, element, _element$querySelecto2, parallelogram, hexagon, callout;
|
|
545
|
-
|
|
546
438
|
return _regeneratorRuntime.wrap(function _callee10$(_context11) {
|
|
547
|
-
while (1) {
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
Demo
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
return wait();
|
|
578
|
-
|
|
579
|
-
case 15:
|
|
580
|
-
expect(element.innerHTML).to.matchSnapshot();
|
|
581
|
-
|
|
582
|
-
case 16:
|
|
583
|
-
case "end":
|
|
584
|
-
return _context11.stop();
|
|
585
|
-
}
|
|
439
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
440
|
+
case 0:
|
|
441
|
+
Demo = /*#__PURE__*/function (_BaseDemo10) {
|
|
442
|
+
_inheritsLoose(Demo, _BaseDemo10);
|
|
443
|
+
function Demo() {
|
|
444
|
+
return _BaseDemo10.apply(this, arguments) || this;
|
|
445
|
+
}
|
|
446
|
+
return Demo;
|
|
447
|
+
}(BaseDemo);
|
|
448
|
+
Demo.template = "\n const {Diagram, DFlowLayout, DParallelogram, DHexagon, DCallout} = this;\n <Diagram>\n <DFlowLayout>\n <DParallelogram connectable />\n <DHexagon connectable />\n <DCallout connectable />\n </DFlowLayout>\n </Diagram>\n ";
|
|
449
|
+
_mount11 = mount(Demo), instance = _mount11[0], element = _mount11[1];
|
|
450
|
+
_element$querySelecto2 = element.querySelectorAll('path'), parallelogram = _element$querySelecto2[0], hexagon = _element$querySelecto2[1], callout = _element$querySelecto2[2];
|
|
451
|
+
dispatchEvent(parallelogram, moveName);
|
|
452
|
+
_context11.next = 7;
|
|
453
|
+
return wait();
|
|
454
|
+
case 7:
|
|
455
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
456
|
+
dispatchEvent(hexagon, moveName);
|
|
457
|
+
_context11.next = 11;
|
|
458
|
+
return wait();
|
|
459
|
+
case 11:
|
|
460
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
461
|
+
dispatchEvent(callout, moveName);
|
|
462
|
+
_context11.next = 15;
|
|
463
|
+
return wait();
|
|
464
|
+
case 15:
|
|
465
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
466
|
+
case 16:
|
|
467
|
+
case "end":
|
|
468
|
+
return _context11.stop();
|
|
586
469
|
}
|
|
587
470
|
}, _callee10);
|
|
588
471
|
})));
|
|
589
472
|
it('should fix points of line', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11() {
|
|
590
473
|
var Demo, _mount12, instance, element;
|
|
591
|
-
|
|
592
474
|
return _regeneratorRuntime.wrap(function _callee11$(_context12) {
|
|
593
|
-
while (1) {
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
Demo
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
Demo.defaults = function defaults() {
|
|
604
|
-
return {
|
|
605
|
-
type: 'curved'
|
|
606
|
-
};
|
|
475
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
476
|
+
case 0:
|
|
477
|
+
Demo = /*#__PURE__*/function (_BaseDemo11) {
|
|
478
|
+
_inheritsLoose(Demo, _BaseDemo11);
|
|
479
|
+
function Demo() {
|
|
480
|
+
return _BaseDemo11.apply(this, arguments) || this;
|
|
481
|
+
}
|
|
482
|
+
Demo.defaults = function defaults() {
|
|
483
|
+
return {
|
|
484
|
+
type: 'curved'
|
|
607
485
|
};
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
case 8:
|
|
623
|
-
case "end":
|
|
624
|
-
return _context12.stop();
|
|
625
|
-
}
|
|
486
|
+
};
|
|
487
|
+
return Demo;
|
|
488
|
+
}(BaseDemo);
|
|
489
|
+
Demo.template = "\n const {Diagram, DFlowLayout, DRectangle, DLine} = this;\n <Diagram>\n <DFlowLayout top=\"20\">\n <DRectangle key=\"1\" />\n <DRectangle key=\"2\" />\n <DLine from=\"1\" to=\"2\" exit={[0.5, 0]} entry={[0.5, 1]}\n type={this.get('type')}\n label={this.get('type')}\n />\n </DFlowLayout>\n </Diagram>\n ";
|
|
490
|
+
_mount12 = mount(Demo), instance = _mount12[0], element = _mount12[1];
|
|
491
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
492
|
+
instance.set('type', 'sharp');
|
|
493
|
+
_context12.next = 7;
|
|
494
|
+
return wait();
|
|
495
|
+
case 7:
|
|
496
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
497
|
+
case 8:
|
|
498
|
+
case "end":
|
|
499
|
+
return _context12.stop();
|
|
626
500
|
}
|
|
627
501
|
}, _callee11);
|
|
628
502
|
})));
|