@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
|
@@ -13,438 +13,424 @@ import { Component } from 'intact-vue-next';
|
|
|
13
13
|
describe('Cascader', function () {
|
|
14
14
|
afterEach( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
15
15
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
16
|
-
while (1) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
case "end":
|
|
25
|
-
return _context.stop();
|
|
26
|
-
}
|
|
16
|
+
while (1) switch (_context.prev = _context.next) {
|
|
17
|
+
case 0:
|
|
18
|
+
unmount();
|
|
19
|
+
_context.next = 3;
|
|
20
|
+
return wait(500);
|
|
21
|
+
case 3:
|
|
22
|
+
case "end":
|
|
23
|
+
return _context.stop();
|
|
27
24
|
}
|
|
28
25
|
}, _callee);
|
|
29
26
|
})));
|
|
30
27
|
it('basic test', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
31
28
|
var _mount, instance, element, select, dropdown1, _dropdown1$querySelec, item1, item2, dropdown2, _dropdown2$querySelec, item11, item12, dropdown3, _dropdown3$querySelec, item21, item22, _getElements, _dropdown1, _dropdown2, _dropdown3;
|
|
32
|
-
|
|
33
29
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
34
|
-
while (1) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
expect(_dropdown1.innerHTML).to.matchSnapshot();
|
|
75
|
-
expect(_dropdown2.innerHTML).to.matchSnapshot();
|
|
76
|
-
expect(_dropdown3.innerHTML).to.matchSnapshot();
|
|
77
|
-
|
|
78
|
-
case 30:
|
|
79
|
-
case "end":
|
|
80
|
-
return _context2.stop();
|
|
81
|
-
}
|
|
30
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
31
|
+
case 0:
|
|
32
|
+
_mount = mount(BasicDemo), instance = _mount[0], element = _mount[1];
|
|
33
|
+
select = element.querySelector('.k-cascader');
|
|
34
|
+
select.click();
|
|
35
|
+
_context2.next = 5;
|
|
36
|
+
return wait();
|
|
37
|
+
case 5:
|
|
38
|
+
dropdown1 = getElement('.k-cascader-menu');
|
|
39
|
+
_dropdown1$querySelec = dropdown1.querySelectorAll(':scope > .k-dropdown-item'), item1 = _dropdown1$querySelec[0], item2 = _dropdown1$querySelec[1];
|
|
40
|
+
item2.click();
|
|
41
|
+
_context2.next = 10;
|
|
42
|
+
return wait();
|
|
43
|
+
case 10:
|
|
44
|
+
expect(dropdown1.innerHTML).to.matchSnapshot();
|
|
45
|
+
dropdown2 = getElement('.k-cascader-menu');
|
|
46
|
+
_dropdown2$querySelec = dropdown2.querySelectorAll(':scope > .k-dropdown-item'), item11 = _dropdown2$querySelec[0], item12 = _dropdown2$querySelec[1];
|
|
47
|
+
item12.click();
|
|
48
|
+
_context2.next = 16;
|
|
49
|
+
return wait();
|
|
50
|
+
case 16:
|
|
51
|
+
dropdown3 = getElement('.k-cascader-menu');
|
|
52
|
+
_dropdown3$querySelec = dropdown3.querySelectorAll(':scope > .k-dropdown-item'), item21 = _dropdown3$querySelec[0], item22 = _dropdown3$querySelec[1];
|
|
53
|
+
item22.click();
|
|
54
|
+
_context2.next = 21;
|
|
55
|
+
return wait();
|
|
56
|
+
case 21:
|
|
57
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
58
|
+
expect(instance.get('value')).to.eql(['hunan', 'yueyang', 'yueyangxian']);
|
|
59
|
+
select.click();
|
|
60
|
+
_context2.next = 26;
|
|
61
|
+
return wait();
|
|
62
|
+
case 26:
|
|
63
|
+
_getElements = getElements('.k-cascader-menu'), _dropdown1 = _getElements[0], _dropdown2 = _getElements[1], _dropdown3 = _getElements[2];
|
|
64
|
+
expect(_dropdown1.innerHTML).to.matchSnapshot();
|
|
65
|
+
expect(_dropdown2.innerHTML).to.matchSnapshot();
|
|
66
|
+
expect(_dropdown3.innerHTML).to.matchSnapshot();
|
|
67
|
+
case 30:
|
|
68
|
+
case "end":
|
|
69
|
+
return _context2.stop();
|
|
82
70
|
}
|
|
83
71
|
}, _callee2);
|
|
84
72
|
})));
|
|
85
73
|
it('custom label', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
86
74
|
var _mount2, instance, element;
|
|
87
|
-
|
|
88
75
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
89
|
-
while (1) {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
case 9:
|
|
107
|
-
case "end":
|
|
108
|
-
return _context3.stop();
|
|
109
|
-
}
|
|
76
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
77
|
+
case 0:
|
|
78
|
+
_mount2 = mount(CustomDemo), instance = _mount2[0], element = _mount2[1];
|
|
79
|
+
instance.set('value', ['beijing', 'haidian']);
|
|
80
|
+
_context3.next = 4;
|
|
81
|
+
return wait();
|
|
82
|
+
case 4:
|
|
83
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
84
|
+
instance.set('value', ['hunan', 'yueyang', 'yueyangxian']);
|
|
85
|
+
_context3.next = 8;
|
|
86
|
+
return wait();
|
|
87
|
+
case 8:
|
|
88
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
89
|
+
case 9:
|
|
90
|
+
case "end":
|
|
91
|
+
return _context3.stop();
|
|
110
92
|
}
|
|
111
93
|
}, _callee3);
|
|
112
94
|
})));
|
|
113
95
|
it('change on select', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
114
96
|
var _mount3, instance, element, select, dropdown1, _dropdown1$querySelec2, item1, item2;
|
|
115
|
-
|
|
116
97
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
117
|
-
while (1) {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
expect(instance.get('value')).to.eql(['beijing']);
|
|
141
|
-
|
|
142
|
-
case 15:
|
|
143
|
-
case "end":
|
|
144
|
-
return _context4.stop();
|
|
145
|
-
}
|
|
98
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
99
|
+
case 0:
|
|
100
|
+
_mount3 = mount(ChangeOnSelectDemo), instance = _mount3[0], element = _mount3[1];
|
|
101
|
+
select = element.querySelector('.k-cascader');
|
|
102
|
+
select.click();
|
|
103
|
+
_context4.next = 5;
|
|
104
|
+
return wait();
|
|
105
|
+
case 5:
|
|
106
|
+
dropdown1 = getElement('.k-cascader-menu');
|
|
107
|
+
_dropdown1$querySelec2 = dropdown1.querySelectorAll(':scope > .k-dropdown-item'), item1 = _dropdown1$querySelec2[0], item2 = _dropdown1$querySelec2[1];
|
|
108
|
+
item2.click();
|
|
109
|
+
_context4.next = 10;
|
|
110
|
+
return wait();
|
|
111
|
+
case 10:
|
|
112
|
+
expect(instance.get('value')).to.eql(['hunan']);
|
|
113
|
+
item1.click();
|
|
114
|
+
_context4.next = 14;
|
|
115
|
+
return wait();
|
|
116
|
+
case 14:
|
|
117
|
+
expect(instance.get('value')).to.eql(['beijing']);
|
|
118
|
+
case 15:
|
|
119
|
+
case "end":
|
|
120
|
+
return _context4.stop();
|
|
146
121
|
}
|
|
147
122
|
}, _callee4);
|
|
148
123
|
})));
|
|
149
124
|
it('load data asychronously', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
|
|
150
125
|
var _mount4, instance, element, dropdown1, _dropdown1$querySelec3, item1, item2, dropdown2, _dropdown2$querySelec2, item21, item22, dropdown3;
|
|
151
|
-
|
|
152
126
|
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
153
|
-
while (1) {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
expect(dropdown3.innerHTML).to.matchSnapshot();
|
|
186
|
-
expect(dropdown3.innerText).to.eql('无数据');
|
|
187
|
-
|
|
188
|
-
case 23:
|
|
189
|
-
case "end":
|
|
190
|
-
return _context5.stop();
|
|
191
|
-
}
|
|
127
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
128
|
+
case 0:
|
|
129
|
+
_mount4 = mount(LoadDataDemo), instance = _mount4[0], element = _mount4[1];
|
|
130
|
+
element.click();
|
|
131
|
+
_context5.next = 4;
|
|
132
|
+
return wait();
|
|
133
|
+
case 4:
|
|
134
|
+
dropdown1 = getElement('.k-cascader-menu');
|
|
135
|
+
_dropdown1$querySelec3 = dropdown1.querySelectorAll(':scope > .k-dropdown-item'), item1 = _dropdown1$querySelec3[0], item2 = _dropdown1$querySelec3[1];
|
|
136
|
+
item2.click();
|
|
137
|
+
_context5.next = 9;
|
|
138
|
+
return wait();
|
|
139
|
+
case 9:
|
|
140
|
+
dropdown2 = getElement('.k-cascader-menu');
|
|
141
|
+
expect(dropdown2.innerHTML).to.matchSnapshot();
|
|
142
|
+
expect(dropdown2.innerText).to.eql('');
|
|
143
|
+
_context5.next = 14;
|
|
144
|
+
return wait(1500);
|
|
145
|
+
case 14:
|
|
146
|
+
expect(dropdown2.innerHTML).to.matchSnapshot();
|
|
147
|
+
expect(dropdown2.innerText).to.not.eql('');
|
|
148
|
+
_dropdown2$querySelec2 = dropdown2.querySelectorAll(':scope > .k-dropdown-item'), item21 = _dropdown2$querySelec2[0], item22 = _dropdown2$querySelec2[1];
|
|
149
|
+
item22.click();
|
|
150
|
+
_context5.next = 20;
|
|
151
|
+
return wait();
|
|
152
|
+
case 20:
|
|
153
|
+
dropdown3 = getElement('.k-cascader-menu');
|
|
154
|
+
expect(dropdown3.innerHTML).to.matchSnapshot();
|
|
155
|
+
expect(dropdown3.innerText).to.eql('无数据');
|
|
156
|
+
case 23:
|
|
157
|
+
case "end":
|
|
158
|
+
return _context5.stop();
|
|
192
159
|
}
|
|
193
160
|
}, _callee5);
|
|
194
161
|
})));
|
|
195
162
|
it('filter', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
|
|
196
|
-
var _mount5, instance, element, input, dropdown, dropdown1;
|
|
197
|
-
|
|
163
|
+
var _mount5, instance, element, input, dropdown, dropdown1, _getElements2, _dropdown1, _dropdown2, _dropdown3;
|
|
198
164
|
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
199
|
-
while (1) {
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
}
|
|
165
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
166
|
+
case 0:
|
|
167
|
+
_mount5 = mount(FilterDemo), instance = _mount5[0], element = _mount5[1];
|
|
168
|
+
input = element.querySelector('.k-input-inner'); // show menu
|
|
169
|
+
input.click();
|
|
170
|
+
_context6.next = 5;
|
|
171
|
+
return wait();
|
|
172
|
+
case 5:
|
|
173
|
+
// should show layer when input empty string
|
|
174
|
+
input.value = ' ';
|
|
175
|
+
dispatchEvent(input, 'input');
|
|
176
|
+
_context6.next = 9;
|
|
177
|
+
return wait();
|
|
178
|
+
case 9:
|
|
179
|
+
dropdown = getElement('.k-cascader-menu');
|
|
180
|
+
expect(dropdown.innerHTML).to.matchSnapshot();
|
|
181
|
+
expect(dropdown.innerText).to.eql('北京\n湖南');
|
|
182
|
+
input.value = '长沙';
|
|
183
|
+
dispatchEvent(input, 'input');
|
|
184
|
+
_context6.next = 16;
|
|
185
|
+
return wait();
|
|
186
|
+
case 16:
|
|
187
|
+
dropdown1 = getElement('.k-cascader-filter');
|
|
188
|
+
expect(dropdown1.innerHTML).to.matchSnapshot();
|
|
189
|
+
expect(dropdown1.innerText).to.eql('湖南 / 长沙市 / 岳麓区');
|
|
190
|
+
// should show no-data layer
|
|
191
|
+
input.value = 'xxx';
|
|
192
|
+
dispatchEvent(input, 'input');
|
|
193
|
+
_context6.next = 23;
|
|
194
|
+
return wait();
|
|
195
|
+
case 23:
|
|
196
|
+
expect(dropdown1.innerHTML).to.matchSnapshot();
|
|
197
|
+
expect(dropdown1.innerText).to.eql('无匹配数据');
|
|
198
|
+
input.value = '岳阳';
|
|
199
|
+
dispatchEvent(input, 'input');
|
|
200
|
+
_context6.next = 29;
|
|
201
|
+
return wait();
|
|
202
|
+
case 29:
|
|
203
|
+
expect(dropdown1.innerHTML).to.matchSnapshot();
|
|
204
|
+
expect(dropdown1.childElementCount).to.eql(2);
|
|
205
|
+
dropdown1.querySelector('.k-dropdown-item').click();
|
|
206
|
+
_context6.next = 34;
|
|
207
|
+
return wait();
|
|
208
|
+
case 34:
|
|
209
|
+
expect(instance.get('value')).to.eql(['hunan', 'yueyang', 'yueyanglou']);
|
|
210
|
+
// show again to test the position
|
|
211
|
+
input.click();
|
|
212
|
+
_context6.next = 38;
|
|
213
|
+
return wait();
|
|
214
|
+
case 38:
|
|
215
|
+
_getElements2 = getElements('.k-cascader-menu'), _dropdown1 = _getElements2[0], _dropdown2 = _getElements2[1], _dropdown3 = _getElements2[2];
|
|
216
|
+
expect(_dropdown1.style.top).not.eql('0px');
|
|
217
|
+
expect(_dropdown2.style.top).not.eql('0px');
|
|
218
|
+
expect(_dropdown3.style.top).not.eql('0px');
|
|
219
|
+
case 42:
|
|
220
|
+
case "end":
|
|
221
|
+
return _context6.stop();
|
|
257
222
|
}
|
|
258
223
|
}, _callee6);
|
|
259
224
|
})));
|
|
260
225
|
it('no data for init data', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
|
|
261
226
|
var _mount6, instance, element, _element$querySelecto, select, dropdown;
|
|
262
|
-
|
|
263
227
|
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
264
|
-
while (1) {
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
case 8:
|
|
279
|
-
case "end":
|
|
280
|
-
return _context7.stop();
|
|
281
|
-
}
|
|
228
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
229
|
+
case 0:
|
|
230
|
+
_mount6 = mount(BasicDemo), instance = _mount6[0], element = _mount6[1];
|
|
231
|
+
_element$querySelecto = element.querySelectorAll('.k-cascader'), select = _element$querySelecto[1];
|
|
232
|
+
dispatchEvent(select, 'click');
|
|
233
|
+
_context7.next = 5;
|
|
234
|
+
return wait();
|
|
235
|
+
case 5:
|
|
236
|
+
dropdown = getElement('.k-cascader-menu');
|
|
237
|
+
expect(dropdown.innerHTML).to.matchSnapshot();
|
|
238
|
+
expect(dropdown.innerText).to.eql('无数据');
|
|
239
|
+
case 8:
|
|
240
|
+
case "end":
|
|
241
|
+
return _context7.stop();
|
|
282
242
|
}
|
|
283
243
|
}, _callee7);
|
|
284
244
|
})));
|
|
285
245
|
it('duplicated sub data', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
|
|
286
|
-
var Demo, _mount7, instance, element,
|
|
287
|
-
|
|
246
|
+
var Demo, _mount7, instance, element, _getElements3, dropdown1, dropdown2, _dropdown1$querySelec4, item1, item2, _dropdown2$querySelec3, item21, dropdown3, _dropdown3$querySelec2, item31;
|
|
288
247
|
return _regeneratorRuntime.wrap(function _callee8$(_context9) {
|
|
289
|
-
while (1) {
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
Demo
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
var _this;
|
|
299
|
-
|
|
300
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
301
|
-
args[_key] = arguments[_key];
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context8 = [this]).call(_context8, args)) || this;
|
|
305
|
-
_this.Cascader = Cascader;
|
|
306
|
-
return _this;
|
|
248
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
249
|
+
case 0:
|
|
250
|
+
Demo = /*#__PURE__*/function (_Component) {
|
|
251
|
+
_inheritsLoose(Demo, _Component);
|
|
252
|
+
function Demo() {
|
|
253
|
+
var _context8;
|
|
254
|
+
var _this;
|
|
255
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
256
|
+
args[_key] = arguments[_key];
|
|
307
257
|
}
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
label: '湖南',
|
|
322
|
-
children: [{
|
|
323
|
-
value: 'haidian',
|
|
324
|
-
label: '海淀区'
|
|
325
|
-
}]
|
|
258
|
+
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context8 = [this]).call(_context8, args)) || this;
|
|
259
|
+
_this.Cascader = Cascader;
|
|
260
|
+
return _this;
|
|
261
|
+
}
|
|
262
|
+
Demo.defaults = function defaults() {
|
|
263
|
+
return {
|
|
264
|
+
value: ['beijing', 'haidian'],
|
|
265
|
+
data: [{
|
|
266
|
+
value: 'beijing',
|
|
267
|
+
label: '北京',
|
|
268
|
+
children: [{
|
|
269
|
+
value: 'haidian',
|
|
270
|
+
label: '海淀区'
|
|
326
271
|
}]
|
|
327
|
-
}
|
|
272
|
+
}, {
|
|
273
|
+
value: 'hunan',
|
|
274
|
+
label: '湖南',
|
|
275
|
+
children: [{
|
|
276
|
+
value: 'haidian',
|
|
277
|
+
label: '海淀区'
|
|
278
|
+
}]
|
|
279
|
+
}]
|
|
328
280
|
};
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
expect(element.textContent).to.eql('湖南 / 海淀区');
|
|
361
|
-
|
|
362
|
-
case 23:
|
|
363
|
-
case "end":
|
|
364
|
-
return _context9.stop();
|
|
365
|
-
}
|
|
281
|
+
};
|
|
282
|
+
return Demo;
|
|
283
|
+
}(Component);
|
|
284
|
+
Demo.template = "const {Cascader} = this; <Cascader data={this.get('data')} v-model=\"value\" />";
|
|
285
|
+
_mount7 = mount(Demo), instance = _mount7[0], element = _mount7[1];
|
|
286
|
+
dispatchEvent(element, 'click');
|
|
287
|
+
_context9.next = 6;
|
|
288
|
+
return wait();
|
|
289
|
+
case 6:
|
|
290
|
+
_getElements3 = getElements('.k-cascader-menu'), dropdown1 = _getElements3[0], dropdown2 = _getElements3[1];
|
|
291
|
+
_dropdown1$querySelec4 = dropdown1.querySelectorAll(':scope > .k-dropdown-item'), item1 = _dropdown1$querySelec4[0], item2 = _dropdown1$querySelec4[1];
|
|
292
|
+
expect(item1.classList.contains('k-selected')).to.be.true;
|
|
293
|
+
expect(item2.classList.contains('k-selected')).to.be.false;
|
|
294
|
+
_dropdown2$querySelec3 = dropdown2.querySelectorAll(':scope > .k-dropdown-item'), item21 = _dropdown2$querySelec3[0];
|
|
295
|
+
expect(item21.classList.contains('k-selected')).to.be.true;
|
|
296
|
+
dispatchEvent(item2, 'click');
|
|
297
|
+
_context9.next = 15;
|
|
298
|
+
return wait();
|
|
299
|
+
case 15:
|
|
300
|
+
dropdown3 = getElement('.k-cascader-menu');
|
|
301
|
+
_dropdown3$querySelec2 = dropdown3.querySelectorAll(':scope > .k-dropdown-item'), item31 = _dropdown3$querySelec2[0];
|
|
302
|
+
expect(item31.classList.contains('k-selected')).to.be.false;
|
|
303
|
+
dispatchEvent(item31, 'click');
|
|
304
|
+
_context9.next = 21;
|
|
305
|
+
return wait();
|
|
306
|
+
case 21:
|
|
307
|
+
expect(instance.get('value')).to.eql(['hunan', 'haidian']);
|
|
308
|
+
expect(element.textContent).to.eql('湖南 / 海淀区');
|
|
309
|
+
case 23:
|
|
310
|
+
case "end":
|
|
311
|
+
return _context9.stop();
|
|
366
312
|
}
|
|
367
313
|
}, _callee8);
|
|
368
314
|
})));
|
|
369
315
|
it('specify fields', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9() {
|
|
370
316
|
var Demo, _mount8, instance, element, select, dropdown1, _dropdown1$querySelec5, item1, dropdown2, _dropdown2$querySelec4, item11;
|
|
371
|
-
|
|
372
317
|
return _regeneratorRuntime.wrap(function _callee9$(_context11) {
|
|
373
|
-
while (1) {
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
Demo
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
var _this2;
|
|
383
|
-
|
|
384
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
385
|
-
args[_key2] = arguments[_key2];
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
_this2 = _Component2.call.apply(_Component2, _concatInstanceProperty(_context10 = [this]).call(_context10, args)) || this;
|
|
389
|
-
_this2.Cascader = Cascader;
|
|
390
|
-
return _this2;
|
|
318
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
319
|
+
case 0:
|
|
320
|
+
Demo = /*#__PURE__*/function (_Component2) {
|
|
321
|
+
_inheritsLoose(Demo, _Component2);
|
|
322
|
+
function Demo() {
|
|
323
|
+
var _context10;
|
|
324
|
+
var _this2;
|
|
325
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
326
|
+
args[_key2] = arguments[_key2];
|
|
391
327
|
}
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
328
|
+
_this2 = _Component2.call.apply(_Component2, _concatInstanceProperty(_context10 = [this]).call(_context10, args)) || this;
|
|
329
|
+
_this2.Cascader = Cascader;
|
|
330
|
+
return _this2;
|
|
331
|
+
}
|
|
332
|
+
Demo.defaults = function defaults() {
|
|
333
|
+
return {
|
|
334
|
+
value: [],
|
|
335
|
+
data: [{
|
|
336
|
+
v: 'beijing',
|
|
337
|
+
l: '北京',
|
|
338
|
+
c: [{
|
|
339
|
+
v: 'haidian',
|
|
340
|
+
l: '海淀区'
|
|
341
|
+
}]
|
|
342
|
+
}, {
|
|
343
|
+
v: 'hunan',
|
|
344
|
+
l: '湖南',
|
|
345
|
+
c: [{
|
|
346
|
+
v: 'haidian',
|
|
347
|
+
l: '海淀区'
|
|
410
348
|
}]
|
|
411
|
-
}
|
|
349
|
+
}]
|
|
412
350
|
};
|
|
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
|
-
expect(instance.get('value')).to.eql(['beijing', 'haidian']);
|
|
442
|
-
|
|
443
|
-
case 20:
|
|
444
|
-
case "end":
|
|
445
|
-
return _context11.stop();
|
|
446
|
-
}
|
|
351
|
+
};
|
|
352
|
+
return Demo;
|
|
353
|
+
}(Component);
|
|
354
|
+
Demo.template = "\n const {Cascader} = this;\n <Cascader data={this.get('data')}\n v-model=\"value\"\n fields={{value: 'v', label: 'l', children: 'c'}}\n />\n ";
|
|
355
|
+
_mount8 = mount(Demo), instance = _mount8[0], element = _mount8[1];
|
|
356
|
+
select = element;
|
|
357
|
+
select.click();
|
|
358
|
+
_context11.next = 7;
|
|
359
|
+
return wait();
|
|
360
|
+
case 7:
|
|
361
|
+
dropdown1 = getElement('.k-cascader-menu');
|
|
362
|
+
_dropdown1$querySelec5 = dropdown1.querySelectorAll(':scope > .k-dropdown-item'), item1 = _dropdown1$querySelec5[0];
|
|
363
|
+
item1.click();
|
|
364
|
+
_context11.next = 12;
|
|
365
|
+
return wait();
|
|
366
|
+
case 12:
|
|
367
|
+
expect(dropdown1.innerHTML).to.matchSnapshot();
|
|
368
|
+
dropdown2 = getElement('.k-cascader-menu');
|
|
369
|
+
_dropdown2$querySelec4 = dropdown2.querySelectorAll(':scope > .k-dropdown-item'), item11 = _dropdown2$querySelec4[0];
|
|
370
|
+
item11.click();
|
|
371
|
+
_context11.next = 18;
|
|
372
|
+
return wait();
|
|
373
|
+
case 18:
|
|
374
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
375
|
+
expect(instance.get('value')).to.eql(['beijing', 'haidian']);
|
|
376
|
+
case 20:
|
|
377
|
+
case "end":
|
|
378
|
+
return _context11.stop();
|
|
447
379
|
}
|
|
448
380
|
}, _callee9);
|
|
449
381
|
})));
|
|
382
|
+
it('should select correct value', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10() {
|
|
383
|
+
var Demo, _mount9, instance, element, _getElements4, dropdown1, dropdown2, _dropdown1$querySelec6, item1, item2;
|
|
384
|
+
return _regeneratorRuntime.wrap(function _callee10$(_context13) {
|
|
385
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
386
|
+
case 0:
|
|
387
|
+
Demo = /*#__PURE__*/function (_Component3) {
|
|
388
|
+
_inheritsLoose(Demo, _Component3);
|
|
389
|
+
function Demo() {
|
|
390
|
+
var _context12;
|
|
391
|
+
var _this3;
|
|
392
|
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
393
|
+
args[_key3] = arguments[_key3];
|
|
394
|
+
}
|
|
395
|
+
_this3 = _Component3.call.apply(_Component3, _concatInstanceProperty(_context12 = [this]).call(_context12, args)) || this;
|
|
396
|
+
_this3.Cascader = Cascader;
|
|
397
|
+
return _this3;
|
|
398
|
+
}
|
|
399
|
+
Demo.defaults = function defaults() {
|
|
400
|
+
return {
|
|
401
|
+
value: ['beijing', 'haidian'],
|
|
402
|
+
data: [{
|
|
403
|
+
value: 'beijing',
|
|
404
|
+
label: '北京',
|
|
405
|
+
children: [{
|
|
406
|
+
value: 'haidian',
|
|
407
|
+
label: '海淀区'
|
|
408
|
+
}]
|
|
409
|
+
}, {
|
|
410
|
+
value: 'hunan',
|
|
411
|
+
label: '湖南'
|
|
412
|
+
}]
|
|
413
|
+
};
|
|
414
|
+
};
|
|
415
|
+
return Demo;
|
|
416
|
+
}(Component);
|
|
417
|
+
Demo.template = "\n const {Cascader} = this;\n <Cascader data={this.get('data')} v-model=\"value\" />\n ";
|
|
418
|
+
_mount9 = mount(Demo), instance = _mount9[0], element = _mount9[1];
|
|
419
|
+
dispatchEvent(element, 'click');
|
|
420
|
+
_context13.next = 6;
|
|
421
|
+
return wait();
|
|
422
|
+
case 6:
|
|
423
|
+
_getElements4 = getElements('.k-cascader-menu'), dropdown1 = _getElements4[0], dropdown2 = _getElements4[1];
|
|
424
|
+
_dropdown1$querySelec6 = dropdown1.querySelectorAll(':scope > .k-dropdown-item'), item1 = _dropdown1$querySelec6[0], item2 = _dropdown1$querySelec6[1];
|
|
425
|
+
dispatchEvent(item2, 'click');
|
|
426
|
+
_context13.next = 11;
|
|
427
|
+
return wait();
|
|
428
|
+
case 11:
|
|
429
|
+
expect(instance.get('value')).to.eql(['hunan']);
|
|
430
|
+
case 12:
|
|
431
|
+
case "end":
|
|
432
|
+
return _context13.stop();
|
|
433
|
+
}
|
|
434
|
+
}, _callee10);
|
|
435
|
+
})));
|
|
450
436
|
});
|