@king-design/vue 2.1.4 → 2.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/affix/index.d.ts +2 -2
- package/components/affix/index.js +5 -0
- package/components/affix/index.spec.js +108 -84
- package/components/affix/index.vdt.js +8 -5
- package/components/affix/useStyle.js +19 -8
- package/components/badge/index.js +2 -0
- package/components/badge/index.vdt.js +9 -5
- package/components/badge/styles.js +2 -0
- package/components/breadcrumb/index.js +4 -0
- package/components/breadcrumb/index.spec.js +6 -6
- package/components/breadcrumb/index.vdt.js +14 -5
- package/components/breadcrumb/item.js +8 -0
- package/components/breadcrumb/item.vdt.js +6 -3
- package/components/breadcrumb/styles.js +3 -0
- package/components/button/dynamicButton.d.ts +1 -1
- package/components/button/dynamicButton.js +5 -2
- package/components/button/group.js +10 -2
- package/components/button/group.vdt.js +7 -4
- package/components/button/index.js +27 -3
- package/components/button/index.spec.js +96 -74
- package/components/button/index.vdt.js +29 -19
- package/components/button/styles.d.ts +2 -2
- package/components/button/styles.js +48 -4
- package/components/card/column.js +2 -0
- package/components/card/column.vdt.js +10 -5
- package/components/card/index.js +4 -0
- package/components/card/index.vdt.js +16 -4
- package/components/carousel/index.js +19 -1
- package/components/carousel/index.spec.js +163 -127
- package/components/carousel/index.vdt.js +15 -12
- package/components/carousel/item.js +2 -0
- package/components/carousel/item.vdt.js +7 -4
- package/components/carousel/styles.js +1 -0
- package/components/carousel/useAutoplay.js +4 -0
- package/components/carousel/useItems.js +20 -4
- package/components/carousel/useSlide.js +89 -57
- package/components/cascader/index.d.ts +45 -0
- package/components/cascader/index.js +18 -3
- package/components/cascader/index.spec.js +445 -354
- package/components/cascader/index.vdt.js +31 -14
- package/components/cascader/styles.js +6 -0
- package/components/cascader/useFields.js +4 -1
- package/components/cascader/useFilterable.js +19 -2
- package/components/cascader/useLabel.js +9 -1
- package/components/cascader/useLoad.js +35 -22
- package/components/cascader/useValue.d.ts +2 -2
- package/components/cascader/useValue.js +26 -5
- package/components/checkbox/index.js +27 -5
- package/components/checkbox/index.spec.js +171 -129
- package/components/checkbox/index.vdt.js +16 -12
- package/components/checkbox/styles.js +10 -0
- package/components/code/crossDomain.js +9 -2
- package/components/code/index.js +9 -0
- package/components/code/index.spec.js +55 -46
- package/components/code/index.vdt.js +14 -6
- package/components/code/styles.js +1 -0
- package/components/code/useEditor.js +10 -5
- package/components/collapse/index.d.ts +1 -1
- package/components/collapse/index.js +14 -3
- package/components/collapse/index.spec.js +60 -47
- package/components/collapse/index.vdt.js +12 -4
- package/components/collapse/item.js +10 -0
- package/components/collapse/item.vdt.js +14 -7
- package/components/collapse/styles.js +1 -0
- package/components/colorpicker/drag.js +5 -0
- package/components/colorpicker/index.js +4 -0
- package/components/colorpicker/index.spec.js +259 -211
- package/components/colorpicker/index.vdt.js +11 -8
- package/components/colorpicker/panel.js +5 -0
- package/components/colorpicker/panel.vdt.js +26 -21
- package/components/colorpicker/styles.js +13 -2
- package/components/colorpicker/useDrag.js +26 -22
- package/components/colorpicker/useInput.js +16 -0
- package/components/colorpicker/usePointer.js +18 -15
- package/components/colorpicker/useValue.js +7 -2
- package/components/context.d.ts +2 -2
- package/components/context.js +19 -2
- package/components/datepicker/basepicker.d.ts +8 -8
- package/components/datepicker/basepicker.js +90 -20
- package/components/datepicker/calendar.js +11 -0
- package/components/datepicker/calendar.vdt.js +14 -11
- package/components/datepicker/constants.js +1 -0
- package/components/datepicker/dayjs.js +1 -1
- package/components/datepicker/helpers.js +15 -3
- package/components/datepicker/index.d.ts +63 -0
- package/components/datepicker/index.js +32 -6
- package/components/datepicker/index.spec.js +1448 -1141
- package/components/datepicker/index.vdt.js +34 -20
- package/components/datepicker/shortcuts.d.ts +1 -1
- package/components/datepicker/shortcuts.js +4 -0
- package/components/datepicker/styles.js +8 -0
- package/components/datepicker/time.d.ts +1 -1
- package/components/datepicker/time.js +23 -3
- package/components/datepicker/time.vdt.js +5 -4
- package/components/datepicker/useDays.js +9 -2
- package/components/datepicker/useDisabled.js +23 -6
- package/components/datepicker/useFocusDate.js +2 -0
- package/components/datepicker/useFormats.js +15 -6
- package/components/datepicker/useKeyboards.js +36 -20
- package/components/datepicker/useMonths.js +6 -0
- package/components/datepicker/usePanel.js +10 -0
- package/components/datepicker/useShowDate.js +37 -10
- package/components/datepicker/useStatus.js +15 -3
- package/components/datepicker/useValue.js +35 -22
- package/components/datepicker/useYears.js +15 -4
- package/components/diagram/diagram.js +43 -17
- package/components/diagram/diagram.vdt.js +5 -2
- package/components/diagram/graph.js +6 -6
- package/components/diagram/index.d.ts +1 -1
- package/components/diagram/index.js +7 -7
- package/components/diagram/index.spec.js +495 -369
- package/components/diagram/layouts/circle.js +14 -6
- package/components/diagram/layouts/flow.js +15 -7
- package/components/diagram/layouts/layout.js +28 -6
- package/components/diagram/layouts/organic.js +11 -3
- package/components/diagram/layouts/partition.js +12 -4
- package/components/diagram/layouts/radial.js +18 -6
- package/components/diagram/layouts/stack.js +14 -6
- package/components/diagram/layouts/tree.js +21 -11
- package/components/diagram/mxgraph/handler/mxConnectionHandler.js +22 -15
- package/components/diagram/mxgraph/handler/mxConstraintHandler.js +4 -4
- package/components/diagram/mxgraph/handler/mxEdgeHandler.js +15 -11
- package/components/diagram/mxgraph/handler/mxGraphHandler.js +9 -6
- package/components/diagram/mxgraph/handler/mxRubberband.js +4 -4
- package/components/diagram/mxgraph/handler/mxVertexHandler.js +10 -7
- package/components/diagram/mxgraph/index.js +2 -0
- package/components/diagram/mxgraph/mx.js +3 -3
- package/components/diagram/mxgraph/shape/mxCloud.js +2 -2
- package/components/diagram/mxgraph/shape/mxCylinder.js +9 -4
- package/components/diagram/mxgraph/shape/mxEllipse.js +2 -2
- package/components/diagram/mxgraph/shape/mxHexagon.js +2 -2
- package/components/diagram/mxgraph/shape/mxLine.js +2 -2
- package/components/diagram/mxgraph/shape/mxRectangleShape.js +2 -2
- package/components/diagram/mxgraph/shape/mxRhombus.js +12 -6
- package/components/diagram/mxgraph/shape/mxShape.js +1 -0
- package/components/diagram/mxgraph/shape/mxTriangle.js +2 -2
- package/components/diagram/mxgraph/util/mxConstants.js +2 -2
- package/components/diagram/mxgraph/util/mxGuide.js +7 -5
- package/components/diagram/mxgraph/view/mxCellEditor.js +29 -16
- package/components/diagram/mxgraph/view/mxCellRenderer.js +2 -0
- package/components/diagram/mxgraph/view/mxGraph.js +32 -14
- package/components/diagram/shapes/base.d.ts +1 -1
- package/components/diagram/shapes/base.js +39 -9
- package/components/diagram/shapes/callout.js +23 -10
- package/components/diagram/shapes/circle.js +10 -3
- package/components/diagram/shapes/document.js +16 -5
- package/components/diagram/shapes/ellipse.js +5 -0
- package/components/diagram/shapes/generateShapes.d.ts +1 -1
- package/components/diagram/shapes/generateShapes.js +9 -0
- package/components/diagram/shapes/hexagon.js +26 -9
- package/components/diagram/shapes/image.js +9 -1
- package/components/diagram/shapes/line.d.ts +2 -2
- package/components/diagram/shapes/line.js +48 -13
- package/components/diagram/shapes/parallelogram.js +26 -9
- package/components/diagram/shapes/rectangle.js +9 -1
- package/components/diagram/shapes/shape.js +35 -6
- package/components/diagram/shapes/square.js +11 -3
- package/components/diagram/shapes/text.js +5 -0
- package/components/diagram/styles.js +1 -0
- package/components/dialog/alert.vdt.js +19 -9
- package/components/dialog/base.js +29 -1
- package/components/dialog/base.vdt.js +29 -14
- package/components/dialog/index.js +31 -6
- package/components/dialog/index.spec.js +554 -406
- package/components/dialog/staticMethods.d.ts +1 -1
- package/components/dialog/staticMethods.js +13 -2
- package/components/dialog/styles.js +11 -0
- package/components/dialog/useDraggable.js +6 -0
- package/components/dialog/useEscClosable.js +12 -4
- package/components/dialog/useFixBody.d.ts +1 -1
- package/components/dialog/useFixBody.js +11 -0
- package/components/dialog/usePosition.js +5 -0
- package/components/drawer/index.js +5 -0
- package/components/drawer/index.spec.js +168 -126
- package/components/drawer/index.vdt.js +9 -3
- package/components/drawer/styles.d.ts +2 -2
- package/components/drawer/styles.js +4 -0
- package/components/dropdown/dropdown.d.ts +2 -2
- package/components/dropdown/dropdown.js +89 -33
- package/components/dropdown/index.js +6 -2
- package/components/dropdown/index.spec.js +496 -388
- package/components/dropdown/item.js +25 -4
- package/components/dropdown/item.vdt.js +8 -5
- package/components/dropdown/menu.js +29 -12
- package/components/dropdown/menu.vdt.js +13 -5
- package/components/dropdown/styles.js +9 -0
- package/components/dropdown/useKeyboard.d.ts +2 -2
- package/components/dropdown/useKeyboard.js +30 -8
- package/components/dropdown/usePosition.d.ts +1 -1
- package/components/dropdown/usePosition.js +22 -12
- package/components/dropdown/useTransition.js +8 -0
- package/components/editable/index.d.ts +1 -1
- package/components/editable/index.js +28 -4
- package/components/editable/index.spec.js +189 -152
- package/components/editable/index.vdt.js +11 -8
- package/components/editable/styles.js +1 -0
- package/components/form/form.js +18 -0
- package/components/form/form.vdt.js +7 -4
- package/components/form/index.spec.js +1280 -1057
- package/components/form/item.d.ts +1 -1
- package/components/form/item.js +12 -0
- package/components/form/item.vdt.js +31 -17
- package/components/form/methods.d.ts +5 -5
- package/components/form/methods.js +12 -2
- package/components/form/styles.js +8 -0
- package/components/form/useDirty.js +7 -2
- package/components/form/useError.js +10 -2
- package/components/form/useValidate.d.ts +1 -1
- package/components/form/useValidate.js +24 -8
- package/components/grid/col.d.ts +3 -3
- package/components/grid/col.js +7 -0
- package/components/grid/col.vdt.js +13 -8
- package/components/grid/constants.d.ts +6 -6
- package/components/grid/row.js +5 -0
- package/components/grid/row.vdt.js +8 -5
- package/components/grid/styles.js +7 -0
- package/components/grid/useBreakpoints.js +5 -0
- package/components/grid/useGutter.js +25 -5
- package/components/icon/index.js +10 -0
- package/components/icon/index.vdt.js +13 -7
- package/components/icon/styles.js +1 -0
- package/components/input/index.d.ts +3 -3
- package/components/input/index.js +14 -0
- package/components/input/index.spec.js +239 -185
- package/components/input/index.vdt.js +49 -39
- package/components/input/search.js +20 -0
- package/components/input/search.vdt.js +9 -6
- package/components/input/styles.js +26 -0
- package/components/input/useAutoRows.js +18 -6
- package/components/input/useAutoWidth.js +5 -0
- package/components/input/useFrozen.js +6 -0
- package/components/input/useShowPassword.js +5 -2
- package/components/layout/aside.js +17 -5
- package/components/layout/aside.vdt.js +9 -5
- package/components/layout/body.js +17 -5
- package/components/layout/footer.js +7 -1
- package/components/layout/header.js +21 -7
- package/components/layout/layout.js +24 -9
- package/components/layout/styles.js +13 -2
- package/components/layout/template.vdt.js +4 -2
- package/components/layout/useParse.js +7 -0
- package/components/menu/index.spec.js +242 -189
- package/components/menu/item.js +16 -3
- package/components/menu/item.vdt.js +32 -20
- package/components/menu/menu.js +11 -2
- package/components/menu/menu.vdt.js +12 -6
- package/components/menu/styles.js +18 -0
- package/components/menu/useDropdown.js +9 -4
- package/components/menu/useExpanded.js +14 -0
- package/components/menu/useHighlight.js +36 -26
- package/components/message/index.spec.js +73 -58
- package/components/message/message.js +19 -0
- package/components/message/message.vdt.js +8 -5
- package/components/message/messages.js +12 -0
- package/components/message/messages.vdt.js +1 -0
- package/components/message/styles.js +9 -0
- package/components/pagination/index.d.ts +1 -1
- package/components/pagination/index.js +46 -10
- package/components/pagination/index.spec.js +173 -133
- package/components/pagination/index.vdt.js +34 -14
- package/components/pagination/styles.js +4 -0
- package/components/portal.d.ts +1 -1
- package/components/portal.js +29 -2
- package/components/position.d.ts +12 -12
- package/components/position.js +88 -32
- package/components/progress/index.d.ts +6 -6
- package/components/progress/index.js +12 -0
- package/components/progress/index.spec.js +191 -143
- package/components/progress/index.vdt.js +11 -8
- package/components/progress/styles.js +6 -0
- package/components/progress/useColor.js +7 -2
- package/components/progress/useStatus.d.ts +1 -1
- package/components/progress/useStatus.js +5 -2
- package/components/radio/index.js +18 -3
- package/components/radio/index.spec.js +149 -111
- package/components/radio/index.vdt.js +17 -14
- package/components/radio/styles.js +10 -0
- package/components/rate/index.js +7 -0
- package/components/rate/index.spec.js +79 -64
- package/components/rate/index.vdt.js +21 -8
- package/components/rate/styles.js +3 -0
- package/components/rate/useActiveValue.js +7 -2
- package/components/scrollSelect/index.d.ts +2 -2
- package/components/scrollSelect/index.js +7 -0
- package/components/scrollSelect/index.spec.js +131 -100
- package/components/scrollSelect/index.vdt.js +11 -6
- package/components/scrollSelect/styles.js +7 -0
- package/components/scrollSelect/useList.js +17 -3
- package/components/scrollSelect/useMouseEvents.js +49 -31
- package/components/scrollSelect/useTranslate.js +11 -1
- package/components/select/base.js +35 -5
- package/components/select/base.vdt.js +38 -23
- package/components/select/group.js +5 -0
- package/components/select/group.vdt.js +10 -4
- package/components/select/index.spec.js +452 -361
- package/components/select/menu.js +5 -0
- package/components/select/menu.vdt.js +33 -18
- package/components/select/option.js +16 -2
- package/components/select/option.vdt.js +14 -7
- package/components/select/select.d.ts +33 -0
- package/components/select/select.js +20 -3
- package/components/select/select.vdt.js +17 -9
- package/components/select/styles.js +33 -0
- package/components/select/useBaseLabel.d.ts +1 -1
- package/components/select/useBaseLabel.js +17 -4
- package/components/select/useCard.js +4 -0
- package/components/select/useEqualWidth.js +1 -0
- package/components/select/useFilterable.js +27 -5
- package/components/select/useFocusout.js +8 -0
- package/components/select/useInput.js +10 -6
- package/components/select/useLabel.js +13 -3
- package/components/select/useSearchable.js +10 -0
- package/components/skeleton/item.d.ts +1 -1
- package/components/skeleton/item.js +4 -0
- package/components/skeleton/item.vdt.js +6 -1
- package/components/skeleton/skeleton.js +4 -0
- package/components/skeleton/skeleton.vdt.js +12 -6
- package/components/skeleton/style.d.ts +1 -1
- package/components/skeleton/style.js +1 -0
- package/components/slider/index.d.ts +1 -1
- package/components/slider/index.js +7 -0
- package/components/slider/index.spec.js +585 -467
- package/components/slider/index.vdt.js +45 -32
- package/components/slider/styles.js +14 -0
- package/components/slider/useClick.js +11 -2
- package/components/slider/useDraggable.js +34 -23
- package/components/slider/useKeyboard.js +18 -7
- package/components/slider/useMarks.d.ts +5 -5
- package/components/slider/useMarks.js +13 -5
- package/components/slider/usePoints.d.ts +2 -2
- package/components/slider/usePoints.js +21 -7
- package/components/slider/useStyles.d.ts +1 -1
- package/components/slider/useStyles.js +10 -5
- package/components/slider/useTooltip.js +10 -2
- package/components/slider/useValue.d.ts +1 -1
- package/components/slider/useValue.js +22 -7
- package/components/spin/index.js +4 -0
- package/components/spin/index.vdt.js +11 -4
- package/components/spin/styles.js +2 -0
- package/components/spinner/index.d.ts +4 -4
- package/components/spinner/index.js +24 -9
- package/components/spinner/index.spec.js +460 -359
- package/components/spinner/index.vdt.js +13 -10
- package/components/spinner/styles.js +3 -0
- package/components/spinner/useChange.js +16 -4
- package/components/spinner/useFormatter.js +16 -6
- package/components/spinner/useStep.d.ts +3 -3
- package/components/spinner/useStep.js +20 -2
- package/components/spinner/useValue.js +26 -11
- package/components/split/index.js +7 -0
- package/components/split/index.spec.js +267 -223
- package/components/split/index.vdt.js +17 -8
- package/components/split/style.d.ts +1 -1
- package/components/split/style.js +8 -0
- package/components/split/useDraggable.js +35 -11
- package/components/split/useSize.js +5 -2
- package/components/steps/context.d.ts +2 -2
- package/components/steps/index.js +10 -2
- package/components/steps/index.spec.js +27 -21
- package/components/steps/index.vdt.js +10 -8
- package/components/steps/step.js +2 -0
- package/components/steps/step.vdt.js +12 -8
- package/components/steps/styles.js +27 -0
- package/components/switch/index.js +23 -2
- package/components/switch/index.spec.js +224 -188
- package/components/switch/index.vdt.js +32 -16
- package/components/switch/styles.js +14 -3
- package/components/switch/useDraggable.js +18 -10
- package/components/table/cell.js +6 -0
- package/components/table/cell.vdt.js +21 -14
- package/components/table/column.d.ts +1 -1
- package/components/table/column.js +5 -0
- package/components/table/column.vdt.js +30 -19
- package/components/table/exportTable.js +56 -45
- package/components/table/index.spec.js +984 -780
- package/components/table/row.d.ts +1 -1
- package/components/table/row.js +41 -12
- package/components/table/row.vdt.js +39 -27
- package/components/table/styles.js +11 -0
- package/components/table/table.d.ts +5 -5
- package/components/table/table.js +50 -18
- package/components/table/table.vdt.js +85 -61
- package/components/table/useChecked.d.ts +1 -1
- package/components/table/useChecked.js +61 -20
- package/components/table/useColumns.js +16 -3
- package/components/table/useDisableRow.js +12 -2
- package/components/table/useDraggable.js +12 -4
- package/components/table/useExpandable.js +5 -2
- package/components/table/useFixedColumns.d.ts +1 -1
- package/components/table/useFixedColumns.js +23 -4
- package/components/table/useGroup.d.ts +1 -1
- package/components/table/useGroup.js +24 -7
- package/components/table/useMerge.d.ts +4 -4
- package/components/table/useMerge.js +14 -2
- package/components/table/usePagination.js +18 -4
- package/components/table/useResizable.js +10 -2
- package/components/table/useRestRowStatus.js +6 -2
- package/components/table/useScroll.d.ts +1 -1
- package/components/table/useScroll.js +3 -0
- package/components/table/useSelected.js +5 -2
- package/components/table/useSortable.js +8 -2
- package/components/table/useStickyHeader.js +7 -3
- package/components/table/useStickyScrollbar.js +16 -6
- package/components/table/useTree.js +12 -1
- package/components/table/useWidth.js +30 -14
- package/components/tabs/index.js +51 -29
- package/components/tabs/index.spec.js +74 -56
- package/components/tabs/index.vdt.js +16 -13
- package/components/tabs/styles.js +16 -0
- package/components/tabs/tab.js +10 -0
- package/components/tabs/tab.vdt.js +10 -6
- package/components/tabs/useActiveBar.js +11 -2
- package/components/tabs/useScroll.js +20 -4
- package/components/tag/base.js +8 -0
- package/components/tag/index.js +4 -2
- package/components/tag/index.spec.js +25 -19
- package/components/tag/index.vdt.js +15 -8
- package/components/tag/styles.js +9 -0
- package/components/timeline/item.js +4 -0
- package/components/timeline/item.vdt.js +9 -4
- package/components/timeline/styles.d.ts +2 -2
- package/components/timeline/styles.js +4 -0
- package/components/timeline/timeline.js +2 -0
- package/components/timeline/timeline.vdt.js +5 -2
- package/components/timepicker/index.js +7 -2
- package/components/timepicker/index.spec.js +368 -293
- package/components/timepicker/panelPicker.d.ts +54 -0
- package/components/timepicker/panelPicker.js +11 -2
- package/components/timepicker/panelPicker.vdt.js +24 -14
- package/components/timepicker/selectPicker.js +5 -0
- package/components/timepicker/selectPicker.vdt.js +10 -5
- package/components/timepicker/styles.js +1 -0
- package/components/timepicker/useDisabled.js +4 -2
- package/components/timepicker/useFormats.js +13 -4
- package/components/timepicker/useStep.d.ts +1 -1
- package/components/timepicker/useStep.js +17 -8
- package/components/timepicker/useValue.js +21 -16
- package/components/tip/index.js +2 -0
- package/components/tip/index.vdt.js +17 -5
- package/components/tip/styles.js +3 -0
- package/components/tooltip/content.js +28 -0
- package/components/tooltip/content.vdt.js +25 -15
- package/components/tooltip/index.js +7 -3
- package/components/tooltip/index.spec.js +572 -434
- package/components/tooltip/styles.d.ts +1 -1
- package/components/tooltip/styles.js +10 -2
- package/components/tooltip/tooltip.js +15 -2
- package/components/tooltip/useArrow.js +14 -11
- package/components/transfer/index.d.ts +1 -1
- package/components/transfer/index.js +13 -1
- package/components/transfer/index.spec.js +194 -159
- package/components/transfer/index.vdt.js +34 -16
- package/components/transfer/styles.js +10 -0
- package/components/transfer/useCheck.d.ts +1 -1
- package/components/transfer/useCheck.js +15 -1
- package/components/transfer/useFilter.d.ts +1 -1
- package/components/transfer/useFilter.js +30 -9
- package/components/transfer/useTransfer.js +26 -10
- package/components/tree/index.d.ts +3 -3
- package/components/tree/index.js +22 -4
- package/components/tree/index.spec.js +355 -285
- package/components/tree/index.vdt.js +23 -12
- package/components/tree/styles.js +16 -2
- package/components/tree/useChecked.js +26 -3
- package/components/tree/useDraggable.js +42 -12
- package/components/tree/useExpanded.js +43 -26
- package/components/tree/useFilter.js +10 -3
- package/components/tree/useNodes.d.ts +1 -1
- package/components/tree/useNodes.js +4 -0
- package/components/tree/useSelected.js +38 -21
- package/components/tree/useTransitionEvent.js +5 -3
- package/components/treeSelect/index.d.ts +27 -0
- package/components/treeSelect/index.js +36 -9
- package/components/treeSelect/index.spec.js +160 -123
- package/components/treeSelect/index.vdt.js +20 -14
- package/components/treeSelect/styles.js +1 -0
- package/components/treeSelect/useValue.js +11 -0
- package/components/types.d.ts +3 -3
- package/components/upload/ajaxUploader.d.ts +1 -1
- package/components/upload/ajaxUploader.js +17 -0
- package/components/upload/index.d.ts +4 -4
- package/components/upload/index.js +14 -0
- package/components/upload/index.spec.js +249 -142
- package/components/upload/index.vdt.js +27 -12
- package/components/upload/styles.js +30 -0
- package/components/upload/useAccept.js +10 -2
- package/components/upload/useDrag.js +7 -0
- package/components/upload/useFiles.js +145 -103
- package/components/upload/useShowImage.js +3 -0
- package/components/upload/useUpload.js +69 -47
- package/components/utils.d.ts +3 -3
- package/components/utils.js +47 -12
- package/components/virtual.js +37 -9
- package/components/wave/index.js +31 -5
- package/hooks/useDelayClose.js +6 -2
- package/hooks/useDocumentClick.js +16 -8
- package/hooks/useDraggable.d.ts +1 -1
- package/hooks/useDraggable.js +9 -0
- package/hooks/useKeyboard.d.ts +3 -3
- package/hooks/useKeyboard.js +10 -0
- package/hooks/useMouseOutsidable.js +8 -0
- package/hooks/useReceive.d.ts +1 -1
- package/hooks/useReceive.js +4 -0
- package/hooks/useRecordComponent.js +6 -0
- package/hooks/useRouter.js +18 -7
- package/hooks/useShowHideEvents.js +3 -0
- package/hooks/useState.d.ts +2 -2
- package/hooks/useState.js +6 -2
- package/i18n/en-US.js +1 -0
- package/i18n/index.d.ts +1 -1
- package/i18n/index.js +7 -0
- package/index.d.ts +2 -2
- package/index.js +3 -2
- package/package.json +1 -1
- package/styles/global.js +3 -2
- package/styles/keyframes.js +1 -0
- package/styles/theme.d.ts +1 -1
- package/styles/theme.js +7 -4
- package/styles/utils.d.ts +1 -1
- package/styles/utils.js +17 -3
- package/yarn-error.log +0 -1013
|
@@ -17,524 +17,625 @@ describe('Slider', function () {
|
|
|
17
17
|
});
|
|
18
18
|
it('basic test', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
19
19
|
var _mount, instance, element, _element$querySelecto, slider, handle, wrapper, width, bar;
|
|
20
|
+
|
|
20
21
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
21
|
-
while (1)
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
-
|
|
22
|
+
while (1) {
|
|
23
|
+
switch (_context.prev = _context.next) {
|
|
24
|
+
case 0:
|
|
25
|
+
_mount = mount(BasicDemo), instance = _mount[0], element = _mount[1];
|
|
26
|
+
_element$querySelecto = element.querySelectorAll('.k-slider'), slider = _element$querySelecto[1]; // drag
|
|
27
|
+
|
|
28
|
+
handle = slider.querySelector('.k-slider-thumb');
|
|
29
|
+
dispatchEvent(handle, 'mousedown', {
|
|
30
|
+
which: 1
|
|
31
|
+
});
|
|
32
|
+
dispatchEvent(handle, 'focusin');
|
|
33
|
+
dispatchEvent(document, 'mousemove', {
|
|
34
|
+
clientX: 0
|
|
35
|
+
});
|
|
36
|
+
expect(instance.get('value2')).eql(50); // move to boundary
|
|
37
|
+
|
|
38
|
+
dispatchEvent(document, 'mousemove', {
|
|
39
|
+
clientX: -10
|
|
40
|
+
});
|
|
41
|
+
expect(instance.get('value2')).eql(50);
|
|
42
|
+
dispatchEvent(document, 'mousemove', {
|
|
43
|
+
clientX: 999999
|
|
44
|
+
});
|
|
45
|
+
expect(instance.get('value2')).eql(500);
|
|
46
|
+
dispatchEvent(document, 'mouseup'); // click
|
|
47
|
+
|
|
48
|
+
wrapper = slider.querySelector('.k-slider-track-wrapper');
|
|
49
|
+
width = wrapper.getBoundingClientRect().width;
|
|
50
|
+
dispatchEvent(wrapper, 'click', {
|
|
51
|
+
clientX: width / 2
|
|
52
|
+
});
|
|
53
|
+
expect(instance.get('value2')).eql((500 + 50) / 2); // set value
|
|
54
|
+
|
|
55
|
+
bar = slider.querySelector('.k-slider-bar');
|
|
56
|
+
instance.set('value2', 135 + 50);
|
|
57
|
+
_context.next = 20;
|
|
58
|
+
return wait();
|
|
59
|
+
|
|
60
|
+
case 20:
|
|
61
|
+
expect(bar.style.width).eql('30%');
|
|
62
|
+
instance.set('value2', -10);
|
|
63
|
+
_context.next = 24;
|
|
64
|
+
return wait();
|
|
65
|
+
|
|
66
|
+
case 24:
|
|
67
|
+
expect(bar.style.width).eql('0%');
|
|
68
|
+
instance.set('value2', 1000);
|
|
69
|
+
_context.next = 28;
|
|
70
|
+
return wait();
|
|
71
|
+
|
|
72
|
+
case 28:
|
|
73
|
+
expect(bar.style.width).eql('100%');
|
|
74
|
+
|
|
75
|
+
case 29:
|
|
76
|
+
case "end":
|
|
77
|
+
return _context.stop();
|
|
78
|
+
}
|
|
71
79
|
}
|
|
72
80
|
}, _callee);
|
|
73
81
|
})));
|
|
74
82
|
it('range test', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
75
83
|
var _mount2, instance, element, windowWidth, _element$querySelecto2, first, second, wrapper;
|
|
84
|
+
|
|
76
85
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
77
|
-
while (1)
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
86
|
+
while (1) {
|
|
87
|
+
switch (_context2.prev = _context2.next) {
|
|
88
|
+
case 0:
|
|
89
|
+
_mount2 = mount(RangeDemo), instance = _mount2[0], element = _mount2[1];
|
|
90
|
+
windowWidth = 800; //document.documentElement.clientWidth;
|
|
91
|
+
|
|
92
|
+
_element$querySelecto2 = element.querySelectorAll('.k-slider-thumb'), first = _element$querySelecto2[0], second = _element$querySelecto2[1]; // drag
|
|
93
|
+
|
|
94
|
+
dispatchEvent(first, 'mousedown', {
|
|
95
|
+
which: 1
|
|
96
|
+
});
|
|
97
|
+
dispatchEvent(first, 'focusin');
|
|
98
|
+
dispatchEvent(first, 'mousemove', {
|
|
99
|
+
clientX: windowWidth * 0.8
|
|
100
|
+
});
|
|
101
|
+
_context2.next = 8;
|
|
102
|
+
return wait();
|
|
103
|
+
|
|
104
|
+
case 8:
|
|
105
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
106
|
+
expect(instance.get('values')).eql([76, 80]);
|
|
107
|
+
dispatchEvent(first, 'mouseup');
|
|
108
|
+
dispatchEvent(second, 'mousedown', {
|
|
109
|
+
which: 1
|
|
110
|
+
});
|
|
111
|
+
dispatchEvent(second, 'focusin');
|
|
112
|
+
dispatchEvent(second, 'mousemove', {
|
|
113
|
+
clientX: windowWidth * 0.6
|
|
114
|
+
});
|
|
115
|
+
_context2.next = 16;
|
|
116
|
+
return wait();
|
|
117
|
+
|
|
118
|
+
case 16:
|
|
119
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
120
|
+
expect(instance.get('values')).eql([60, 76]);
|
|
121
|
+
dispatchEvent(first, 'mouseup'); // click
|
|
122
|
+
|
|
123
|
+
wrapper = element.querySelector('.k-slider-track-wrapper');
|
|
124
|
+
dispatchEvent(wrapper, 'click', {
|
|
125
|
+
clientX: windowWidth * 0.5
|
|
126
|
+
});
|
|
127
|
+
_context2.next = 23;
|
|
128
|
+
return wait();
|
|
129
|
+
|
|
130
|
+
case 23:
|
|
131
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
132
|
+
expect(instance.get('values')).eql([50, 76]);
|
|
133
|
+
dispatchEvent(wrapper, 'click', {
|
|
134
|
+
clientX: windowWidth * 0.7
|
|
135
|
+
});
|
|
136
|
+
_context2.next = 28;
|
|
137
|
+
return wait();
|
|
138
|
+
|
|
139
|
+
case 28:
|
|
140
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
141
|
+
expect(instance.get('values')).eql([50, 70]); // set invalid value
|
|
142
|
+
|
|
143
|
+
instance.set('values', 1);
|
|
144
|
+
_context2.next = 33;
|
|
145
|
+
return wait();
|
|
146
|
+
|
|
147
|
+
case 33:
|
|
148
|
+
expect(instance.get('values')).eql([1, 1]);
|
|
149
|
+
|
|
150
|
+
case 34:
|
|
151
|
+
case "end":
|
|
152
|
+
return _context2.stop();
|
|
153
|
+
}
|
|
135
154
|
}
|
|
136
155
|
}, _callee2);
|
|
137
156
|
})));
|
|
138
157
|
it('keyboard operation for basic', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
139
158
|
var _mount3, instance, element, _element$querySelecto3, slider, handle;
|
|
159
|
+
|
|
140
160
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
141
|
-
while (1)
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
161
|
+
while (1) {
|
|
162
|
+
switch (_context3.prev = _context3.next) {
|
|
163
|
+
case 0:
|
|
164
|
+
_mount3 = mount(BasicDemo), instance = _mount3[0], element = _mount3[1];
|
|
165
|
+
_element$querySelecto3 = element.querySelectorAll('.k-slider'), slider = _element$querySelecto3[1];
|
|
166
|
+
handle = slider.querySelector('.k-slider-thumb');
|
|
167
|
+
dispatchEvent(handle, 'focusin');
|
|
168
|
+
dispatchEvent(handle, 'keydown', {
|
|
169
|
+
keyCode: 37
|
|
170
|
+
});
|
|
171
|
+
_context3.next = 7;
|
|
172
|
+
return wait();
|
|
173
|
+
|
|
174
|
+
case 7:
|
|
175
|
+
expect(slider.innerHTML).to.matchSnapshot();
|
|
176
|
+
expect(instance.get('value2')).to.eql(276);
|
|
177
|
+
dispatchEvent(handle, 'keydown', {
|
|
178
|
+
keyCode: 39
|
|
179
|
+
});
|
|
180
|
+
_context3.next = 12;
|
|
181
|
+
return wait();
|
|
182
|
+
|
|
183
|
+
case 12:
|
|
184
|
+
expect(slider.innerHTML).to.matchSnapshot();
|
|
185
|
+
expect(instance.get('value2')).to.eql(277);
|
|
186
|
+
dispatchEvent(handle, 'focusout');
|
|
187
|
+
_context3.next = 17;
|
|
188
|
+
return wait();
|
|
189
|
+
|
|
190
|
+
case 17:
|
|
191
|
+
expect(slider.innerHTML).to.matchSnapshot();
|
|
192
|
+
|
|
193
|
+
case 18:
|
|
194
|
+
case "end":
|
|
195
|
+
return _context3.stop();
|
|
196
|
+
}
|
|
171
197
|
}
|
|
172
198
|
}, _callee3);
|
|
173
199
|
})));
|
|
174
200
|
it('keyboard operation for range', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
175
201
|
var _mount4, instance, element, _element$querySelecto4, first, second;
|
|
202
|
+
|
|
176
203
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
177
|
-
while (1)
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
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
|
-
|
|
204
|
+
while (1) {
|
|
205
|
+
switch (_context4.prev = _context4.next) {
|
|
206
|
+
case 0:
|
|
207
|
+
_mount4 = mount(RangeDemo), instance = _mount4[0], element = _mount4[1];
|
|
208
|
+
_element$querySelecto4 = element.querySelectorAll('.k-slider-thumb'), first = _element$querySelecto4[0], second = _element$querySelecto4[1];
|
|
209
|
+
instance.set('values', [50, 51]);
|
|
210
|
+
_context4.next = 5;
|
|
211
|
+
return wait();
|
|
212
|
+
|
|
213
|
+
case 5:
|
|
214
|
+
dispatchEvent(first, 'focusin');
|
|
215
|
+
dispatchEvent(first, 'keydown', {
|
|
216
|
+
keyCode: 39
|
|
217
|
+
});
|
|
218
|
+
_context4.next = 9;
|
|
219
|
+
return wait();
|
|
220
|
+
|
|
221
|
+
case 9:
|
|
222
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
223
|
+
expect(instance.get('values')).to.eql([51, 51]);
|
|
224
|
+
dispatchEvent(first, 'keydown', {
|
|
225
|
+
keyCode: 39
|
|
226
|
+
});
|
|
227
|
+
_context4.next = 14;
|
|
228
|
+
return wait();
|
|
229
|
+
|
|
230
|
+
case 14:
|
|
231
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
232
|
+
expect(instance.get('values')).to.eql([51, 52]);
|
|
233
|
+
dispatchEvent(second, 'keydown', {
|
|
234
|
+
keyCode: 39
|
|
235
|
+
});
|
|
236
|
+
_context4.next = 19;
|
|
237
|
+
return wait();
|
|
238
|
+
|
|
239
|
+
case 19:
|
|
240
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
241
|
+
expect(instance.get('values')).to.eql([51, 53]);
|
|
242
|
+
dispatchEvent(second, 'focusout');
|
|
243
|
+
instance.set('values', [50, 51]);
|
|
244
|
+
_context4.next = 25;
|
|
245
|
+
return wait();
|
|
246
|
+
|
|
247
|
+
case 25:
|
|
248
|
+
dispatchEvent(second, 'focusin');
|
|
249
|
+
dispatchEvent(second, 'keydown', {
|
|
250
|
+
keyCode: 37
|
|
251
|
+
});
|
|
252
|
+
_context4.next = 29;
|
|
253
|
+
return wait();
|
|
254
|
+
|
|
255
|
+
case 29:
|
|
256
|
+
expect(instance.get('values')).to.eql([50, 50]);
|
|
257
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
258
|
+
dispatchEvent(second, 'keydown', {
|
|
259
|
+
keyCode: 37
|
|
260
|
+
});
|
|
261
|
+
_context4.next = 34;
|
|
262
|
+
return wait();
|
|
263
|
+
|
|
264
|
+
case 34:
|
|
265
|
+
expect(instance.get('values')).to.eql([49, 50]);
|
|
266
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
267
|
+
dispatchEvent(first, 'keydown', {
|
|
268
|
+
keyCode: 37
|
|
269
|
+
});
|
|
270
|
+
_context4.next = 39;
|
|
271
|
+
return wait();
|
|
272
|
+
|
|
273
|
+
case 39:
|
|
274
|
+
expect(instance.get('values')).to.eql([48, 50]);
|
|
275
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
276
|
+
dispatchEvent(first, 'focusout');
|
|
277
|
+
|
|
278
|
+
case 42:
|
|
279
|
+
case "end":
|
|
280
|
+
return _context4.stop();
|
|
281
|
+
}
|
|
244
282
|
}
|
|
245
283
|
}, _callee4);
|
|
246
284
|
})));
|
|
247
285
|
it('disabled', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
|
|
248
286
|
var _mount5, instance, element, slider, sliderDom, handle, wrapper;
|
|
287
|
+
|
|
249
288
|
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
250
|
-
while (1)
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
289
|
+
while (1) {
|
|
290
|
+
switch (_context5.prev = _context5.next) {
|
|
291
|
+
case 0:
|
|
292
|
+
_mount5 = mount(DisabledDemo), instance = _mount5[0], element = _mount5[1];
|
|
293
|
+
slider = instance.refs.__test; // cannot drag
|
|
294
|
+
|
|
295
|
+
sliderDom = element.querySelector('.k-slider');
|
|
296
|
+
handle = sliderDom.querySelector('.k-slider-thumb');
|
|
297
|
+
dispatchEvent(handle, 'mousedown', {
|
|
298
|
+
which: 1
|
|
299
|
+
});
|
|
300
|
+
dispatchEvent(handle, 'focusin');
|
|
301
|
+
dispatchEvent(document, 'mousemove', {
|
|
302
|
+
clientX: 0
|
|
303
|
+
});
|
|
304
|
+
dispatchEvent(handle, 'mouseup', {
|
|
305
|
+
clientX: 0
|
|
306
|
+
});
|
|
307
|
+
_context5.next = 10;
|
|
308
|
+
return wait();
|
|
309
|
+
|
|
310
|
+
case 10:
|
|
311
|
+
expect(sliderDom.innerHTML).to.matchSnapshot();
|
|
312
|
+
expect(slider.get('value')).to.eql(50); // keyboard
|
|
313
|
+
|
|
314
|
+
dispatchEvent(handle, 'keydown', {
|
|
315
|
+
keyCode: 37
|
|
316
|
+
});
|
|
317
|
+
dispatchEvent(handle, 'focusout');
|
|
318
|
+
_context5.next = 16;
|
|
319
|
+
return wait();
|
|
320
|
+
|
|
321
|
+
case 16:
|
|
322
|
+
expect(sliderDom.innerHTML).to.matchSnapshot();
|
|
323
|
+
expect(slider.get('value')).to.eql(50); // click
|
|
324
|
+
|
|
325
|
+
wrapper = sliderDom.querySelector('.k-slider-track-wrapper');
|
|
326
|
+
dispatchEvent(wrapper, 'click', {
|
|
327
|
+
clientX: 0
|
|
328
|
+
});
|
|
329
|
+
_context5.next = 22;
|
|
330
|
+
return wait();
|
|
331
|
+
|
|
332
|
+
case 22:
|
|
333
|
+
expect(sliderDom.innerHTML).to.matchSnapshot();
|
|
334
|
+
expect(slider.get('value')).to.eql(50);
|
|
335
|
+
|
|
336
|
+
case 24:
|
|
337
|
+
case "end":
|
|
338
|
+
return _context5.stop();
|
|
339
|
+
}
|
|
294
340
|
}
|
|
295
341
|
}, _callee5);
|
|
296
342
|
})));
|
|
297
343
|
it('min/max/step is undefined', function () {
|
|
298
344
|
var Demo = /*#__PURE__*/function (_Component) {
|
|
299
345
|
_inheritsLoose(Demo, _Component);
|
|
346
|
+
|
|
300
347
|
function Demo() {
|
|
301
348
|
var _context6;
|
|
349
|
+
|
|
302
350
|
var _this;
|
|
351
|
+
|
|
303
352
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
304
353
|
args[_key] = arguments[_key];
|
|
305
354
|
}
|
|
355
|
+
|
|
306
356
|
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context6 = [this]).call(_context6, args)) || this;
|
|
307
357
|
_this.Slider = Slider;
|
|
308
358
|
return _this;
|
|
309
359
|
}
|
|
360
|
+
|
|
310
361
|
return Demo;
|
|
311
362
|
}(Component);
|
|
363
|
+
|
|
312
364
|
Demo.template = "const {Slider} = this; <Slider min={undefined}\n max={undefined}\n step={undefined}\n value={1}\n />";
|
|
365
|
+
|
|
313
366
|
var _mount6 = mount(Demo),
|
|
314
|
-
|
|
315
|
-
|
|
367
|
+
instance = _mount6[0],
|
|
368
|
+
element = _mount6[1];
|
|
369
|
+
|
|
316
370
|
expect(element.innerHTML).to.matchSnapshot();
|
|
317
371
|
});
|
|
318
372
|
it('should log error when max < min', function () {
|
|
319
373
|
var Demo = /*#__PURE__*/function (_Component2) {
|
|
320
374
|
_inheritsLoose(Demo, _Component2);
|
|
375
|
+
|
|
321
376
|
function Demo() {
|
|
322
377
|
var _context7;
|
|
378
|
+
|
|
323
379
|
var _this2;
|
|
380
|
+
|
|
324
381
|
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
325
382
|
args[_key2] = arguments[_key2];
|
|
326
383
|
}
|
|
384
|
+
|
|
327
385
|
_this2 = _Component2.call.apply(_Component2, _concatInstanceProperty(_context7 = [this]).call(_context7, args)) || this;
|
|
328
386
|
_this2.Slider = Slider;
|
|
329
387
|
return _this2;
|
|
330
388
|
}
|
|
389
|
+
|
|
331
390
|
return Demo;
|
|
332
391
|
}(Component);
|
|
392
|
+
|
|
333
393
|
Demo.template = "const {Slider} = this; <Slider min={20}\n max={0}\n step={undefined}\n value={1}\n />";
|
|
334
394
|
var error = fakeError();
|
|
395
|
+
|
|
335
396
|
var _mount7 = mount(Demo),
|
|
336
|
-
|
|
337
|
-
|
|
397
|
+
instance = _mount7[0],
|
|
398
|
+
element = _mount7[1];
|
|
399
|
+
|
|
338
400
|
expect(element.innerHTML).to.matchSnapshot();
|
|
339
401
|
error('[Slider] min must less than or equal to max, but got min: 20 max: 0');
|
|
340
402
|
});
|
|
341
403
|
it('should input any value even if it has step', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
|
|
342
404
|
var _mount8, instance, element, input, slider;
|
|
405
|
+
|
|
343
406
|
return _regeneratorRuntime.wrap(function _callee6$(_context8) {
|
|
344
|
-
while (1)
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
407
|
+
while (1) {
|
|
408
|
+
switch (_context8.prev = _context8.next) {
|
|
409
|
+
case 0:
|
|
410
|
+
_mount8 = mount(StepDemo), instance = _mount8[0], element = _mount8[1];
|
|
411
|
+
input = element.querySelector('input');
|
|
412
|
+
input.value = '1';
|
|
413
|
+
dispatchEvent(input, 'input');
|
|
414
|
+
_context8.next = 6;
|
|
415
|
+
return wait();
|
|
416
|
+
|
|
417
|
+
case 6:
|
|
418
|
+
expect(input.value).to.eql('1');
|
|
419
|
+
input.value = '11';
|
|
420
|
+
dispatchEvent(input, 'input');
|
|
421
|
+
_context8.next = 11;
|
|
422
|
+
return wait();
|
|
423
|
+
|
|
424
|
+
case 11:
|
|
425
|
+
expect(input.value).to.eql('11');
|
|
426
|
+
expect(instance.get('value1')).to.eql(10);
|
|
427
|
+
dispatchEvent(input, 'change');
|
|
428
|
+
_context8.next = 16;
|
|
429
|
+
return wait();
|
|
430
|
+
|
|
431
|
+
case 16:
|
|
432
|
+
expect(input.value).to.eql('10');
|
|
433
|
+
instance.set('value1', 13);
|
|
434
|
+
_context8.next = 20;
|
|
435
|
+
return wait();
|
|
436
|
+
|
|
437
|
+
case 20:
|
|
438
|
+
expect(instance.get('value1')).to.eql(15); // disable forceStep
|
|
439
|
+
|
|
440
|
+
slider = instance.refs.__test;
|
|
441
|
+
slider.set('forceStep', false);
|
|
442
|
+
instance.set('value1', 13);
|
|
443
|
+
_context8.next = 26;
|
|
444
|
+
return wait();
|
|
445
|
+
|
|
446
|
+
case 26:
|
|
447
|
+
expect(instance.get('value1')).to.eql(13);
|
|
448
|
+
|
|
449
|
+
case 27:
|
|
450
|
+
case "end":
|
|
451
|
+
return _context8.stop();
|
|
452
|
+
}
|
|
382
453
|
}
|
|
383
454
|
}, _callee6);
|
|
384
455
|
})));
|
|
385
456
|
it('should show tooltip', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
|
|
386
457
|
var _mount9, instance, element, content;
|
|
458
|
+
|
|
387
459
|
return _regeneratorRuntime.wrap(function _callee7$(_context9) {
|
|
388
|
-
while (1)
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
460
|
+
while (1) {
|
|
461
|
+
switch (_context9.prev = _context9.next) {
|
|
462
|
+
case 0:
|
|
463
|
+
_mount9 = mount(TooltipDemo), instance = _mount9[0], element = _mount9[1];
|
|
464
|
+
instance.set('value2', 11);
|
|
465
|
+
_context9.next = 4;
|
|
466
|
+
return wait();
|
|
467
|
+
|
|
468
|
+
case 4:
|
|
469
|
+
content = getElements('.k-tooltip-content')[0];
|
|
470
|
+
expect(content.textContent).to.eql('满2年,优惠4个月');
|
|
471
|
+
instance.set('value2', 5);
|
|
472
|
+
_context9.next = 9;
|
|
473
|
+
return wait();
|
|
474
|
+
|
|
475
|
+
case 9:
|
|
476
|
+
expect(content.textContent).to.eql('');
|
|
477
|
+
|
|
478
|
+
case 10:
|
|
479
|
+
case "end":
|
|
480
|
+
return _context9.stop();
|
|
481
|
+
}
|
|
405
482
|
}
|
|
406
483
|
}, _callee7);
|
|
407
484
|
})));
|
|
408
485
|
it('should locate at the end if start value is equal to end value', function () {
|
|
409
486
|
var Demo = /*#__PURE__*/function (_Component3) {
|
|
410
487
|
_inheritsLoose(Demo, _Component3);
|
|
488
|
+
|
|
411
489
|
function Demo() {
|
|
412
490
|
var _context10;
|
|
491
|
+
|
|
413
492
|
var _this3;
|
|
493
|
+
|
|
414
494
|
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
415
495
|
args[_key3] = arguments[_key3];
|
|
416
496
|
}
|
|
497
|
+
|
|
417
498
|
_this3 = _Component3.call.apply(_Component3, _concatInstanceProperty(_context10 = [this]).call(_context10, args)) || this;
|
|
418
499
|
_this3.Slider = Slider;
|
|
419
500
|
return _this3;
|
|
420
501
|
}
|
|
502
|
+
|
|
421
503
|
return Demo;
|
|
422
504
|
}(Component);
|
|
505
|
+
|
|
423
506
|
Demo.template = "const {Slider} = this; <div>\n <Slider min={1} max={1} value={1} />\n <Slider min={1} max={1} range />\n </div>";
|
|
507
|
+
|
|
424
508
|
var _mount10 = mount(Demo),
|
|
425
|
-
|
|
426
|
-
|
|
509
|
+
instance = _mount10[0],
|
|
510
|
+
element = _mount10[1];
|
|
511
|
+
|
|
427
512
|
expect(element.innerHTML).to.matchSnapshot();
|
|
428
513
|
});
|
|
429
514
|
it('should trigger change event correctly', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
|
|
430
515
|
var spy, Demo, _mount11, instance, element, handle, bar, width, start, input, btn;
|
|
516
|
+
|
|
431
517
|
return _regeneratorRuntime.wrap(function _callee8$(_context12) {
|
|
432
|
-
while (1)
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
function
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
518
|
+
while (1) {
|
|
519
|
+
switch (_context12.prev = _context12.next) {
|
|
520
|
+
case 0:
|
|
521
|
+
spy = sinon.spy();
|
|
522
|
+
|
|
523
|
+
Demo = /*#__PURE__*/function (_Component4) {
|
|
524
|
+
_inheritsLoose(Demo, _Component4);
|
|
525
|
+
|
|
526
|
+
function Demo() {
|
|
527
|
+
var _context11;
|
|
528
|
+
|
|
529
|
+
var _this4;
|
|
530
|
+
|
|
531
|
+
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
532
|
+
args[_key4] = arguments[_key4];
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
_this4 = _Component4.call.apply(_Component4, _concatInstanceProperty(_context11 = [this]).call(_context11, args)) || this;
|
|
536
|
+
_this4.Slider = Slider;
|
|
537
|
+
return _this4;
|
|
442
538
|
}
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
539
|
+
|
|
540
|
+
Demo.defaults = function defaults() {
|
|
541
|
+
return {
|
|
542
|
+
value: 0
|
|
543
|
+
};
|
|
544
|
+
};
|
|
545
|
+
|
|
546
|
+
var _proto = Demo.prototype;
|
|
547
|
+
|
|
548
|
+
_proto._onChange = function _onChange(v) {
|
|
549
|
+
console.log('change', v);
|
|
550
|
+
spy(v);
|
|
450
551
|
};
|
|
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
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
552
|
+
|
|
553
|
+
return Demo;
|
|
554
|
+
}(Component);
|
|
555
|
+
|
|
556
|
+
Demo.template = "const Slider = this.Slider; <Slider ev-change={this._onChange} v-model=\"value\" />";
|
|
557
|
+
_mount11 = mount(Demo), instance = _mount11[0], element = _mount11[1];
|
|
558
|
+
handle = element.querySelector('.k-slider-thumb');
|
|
559
|
+
bar = element.querySelector('.k-slider-track-wrapper'); // keyboard
|
|
560
|
+
|
|
561
|
+
dispatchEvent(handle, 'focusin');
|
|
562
|
+
dispatchEvent(handle, 'keydown', {
|
|
563
|
+
keyCode: 39
|
|
564
|
+
});
|
|
565
|
+
expect(spy.callCount).to.eql(0);
|
|
566
|
+
dispatchEvent(handle, 'keydown', {
|
|
567
|
+
keyCode: 39
|
|
568
|
+
});
|
|
569
|
+
expect(spy.callCount).to.eql(0);
|
|
570
|
+
dispatchEvent(handle, 'keyup', {
|
|
571
|
+
keyCode: 13
|
|
572
|
+
});
|
|
573
|
+
expect(spy.callCount).to.eql(0);
|
|
574
|
+
dispatchEvent(handle, 'keyup', {
|
|
575
|
+
keyCode: 39
|
|
576
|
+
});
|
|
577
|
+
expect(spy.callCount).to.eql(1);
|
|
578
|
+
expect(spy.calledWith(2)).to.be.true;
|
|
579
|
+
dispatchEvent(handle, 'keydown', {
|
|
580
|
+
keyCode: 39
|
|
581
|
+
});
|
|
582
|
+
expect(spy.callCount).to.eql(1);
|
|
583
|
+
dispatchEvent(handle, 'keyup', {
|
|
584
|
+
keyCode: 39
|
|
585
|
+
});
|
|
586
|
+
expect(spy.callCount).to.eql(2);
|
|
587
|
+
expect(spy.calledWith(3)).to.be.true; // drag
|
|
588
|
+
|
|
589
|
+
width = bar.getBoundingClientRect().width;
|
|
590
|
+
dispatchEvent(handle, 'mousedown', {
|
|
591
|
+
which: 1
|
|
592
|
+
});
|
|
593
|
+
dispatchEvent(document, 'mousemove', {
|
|
594
|
+
clientX: 0.1 * width
|
|
595
|
+
});
|
|
596
|
+
expect(spy.callCount).to.eql(2);
|
|
597
|
+
dispatchEvent(document, 'mouseup', {
|
|
598
|
+
clientX: 0.1 * width
|
|
599
|
+
});
|
|
600
|
+
expect(spy.callCount).to.eql(3);
|
|
601
|
+
expect(spy.calledWith(10)).to.be.true; // click
|
|
602
|
+
|
|
603
|
+
dispatchEvent(bar, 'click', {
|
|
604
|
+
clientX: 0.2 * width
|
|
605
|
+
});
|
|
606
|
+
expect(spy.callCount).to.eql(4);
|
|
607
|
+
expect(spy.calledWith(20)).to.be.true; // click end
|
|
608
|
+
|
|
609
|
+
start = element.querySelector('.k-slider-ends span');
|
|
610
|
+
start.click();
|
|
611
|
+
expect(spy.callCount).to.eql(5);
|
|
612
|
+
expect(spy.calledWith(0)).to.be.true; // spinner
|
|
613
|
+
|
|
614
|
+
input = element.querySelector('input');
|
|
615
|
+
input.value = '1';
|
|
616
|
+
dispatchEvent(input, 'input');
|
|
617
|
+
_context12.next = 40;
|
|
618
|
+
return wait();
|
|
619
|
+
|
|
620
|
+
case 40:
|
|
621
|
+
expect(spy.callCount).to.eql(6);
|
|
622
|
+
expect(spy.calledWith(1)).to.be.true;
|
|
623
|
+
btn = element.querySelector('.k-btn');
|
|
624
|
+
btn.click();
|
|
625
|
+
_context12.next = 46;
|
|
626
|
+
return wait();
|
|
627
|
+
|
|
628
|
+
case 46:
|
|
629
|
+
expect(spy.callCount).to.eql(7);
|
|
630
|
+
expect(spy.calledWith(0)).to.be.true;
|
|
631
|
+
|
|
632
|
+
case 48:
|
|
633
|
+
case "end":
|
|
634
|
+
return _context12.stop();
|
|
635
|
+
}
|
|
534
636
|
}
|
|
535
637
|
}, _callee8);
|
|
536
|
-
})));
|
|
537
|
-
// it('should set init value to min value', async () => {
|
|
638
|
+
}))); // it('should set init value to min value', async () => {
|
|
538
639
|
// class Demo extends Component<{a: number, b: number}> {
|
|
539
640
|
// static template = `const {Slider} = this; <div>
|
|
540
641
|
// <Slider min={-1} max={1} v-model="a"/>
|
|
@@ -546,71 +647,88 @@ describe('Slider', function () {
|
|
|
546
647
|
// expect(instance.get('a')).to.eql(-1);
|
|
547
648
|
// expect(instance.get('b')).to.eql([-1, -1]);
|
|
548
649
|
// });
|
|
650
|
+
|
|
549
651
|
it('should set value by `min + step * n`', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9() {
|
|
550
652
|
var Demo, _mount12, instance, element;
|
|
653
|
+
|
|
551
654
|
return _regeneratorRuntime.wrap(function _callee9$(_context14) {
|
|
552
|
-
while (1)
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
655
|
+
while (1) {
|
|
656
|
+
switch (_context14.prev = _context14.next) {
|
|
657
|
+
case 0:
|
|
658
|
+
Demo = /*#__PURE__*/function (_Component5) {
|
|
659
|
+
_inheritsLoose(Demo, _Component5);
|
|
660
|
+
|
|
661
|
+
function Demo() {
|
|
662
|
+
var _context13;
|
|
663
|
+
|
|
664
|
+
var _this5;
|
|
665
|
+
|
|
666
|
+
for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
|
667
|
+
args[_key5] = arguments[_key5];
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
_this5 = _Component5.call.apply(_Component5, _concatInstanceProperty(_context13 = [this]).call(_context13, args)) || this;
|
|
671
|
+
_this5.Slider = Slider;
|
|
672
|
+
return _this5;
|
|
561
673
|
}
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
674
|
+
|
|
675
|
+
return Demo;
|
|
676
|
+
}(Component);
|
|
677
|
+
|
|
678
|
+
Demo.template = "const {Slider} = this; <div>\n <Slider min={-6} max={20} v-model=\"value\" step={5} points />\n </div>";
|
|
679
|
+
_mount12 = mount(Demo), instance = _mount12[0], element = _mount12[1];
|
|
680
|
+
instance.set('value', 0);
|
|
681
|
+
_context14.next = 6;
|
|
682
|
+
return wait();
|
|
683
|
+
|
|
684
|
+
case 6:
|
|
685
|
+
expect(instance.get('value')).to.eql(-1);
|
|
686
|
+
|
|
687
|
+
case 7:
|
|
688
|
+
case "end":
|
|
689
|
+
return _context14.stop();
|
|
690
|
+
}
|
|
578
691
|
}
|
|
579
692
|
}, _callee9);
|
|
580
693
|
})));
|
|
581
694
|
it('dynamic step', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10() {
|
|
582
695
|
var _mount13, instance, element, handle, model;
|
|
696
|
+
|
|
583
697
|
return _regeneratorRuntime.wrap(function _callee10$(_context15) {
|
|
584
|
-
while (1)
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
698
|
+
while (1) {
|
|
699
|
+
switch (_context15.prev = _context15.next) {
|
|
700
|
+
case 0:
|
|
701
|
+
_mount13 = mount(DynamicStepDemo), instance = _mount13[0], element = _mount13[1];
|
|
702
|
+
handle = element.querySelector('.k-slider-thumb');
|
|
703
|
+
model = "value1";
|
|
704
|
+
instance.set(model, 100);
|
|
705
|
+
_context15.next = 6;
|
|
706
|
+
return wait();
|
|
707
|
+
|
|
708
|
+
case 6:
|
|
709
|
+
dispatchEvent(handle, 'focusin');
|
|
710
|
+
dispatchEvent(handle, 'keydown', {
|
|
711
|
+
keyCode: 37
|
|
712
|
+
});
|
|
713
|
+
expect(instance.get(model)).to.eql(90);
|
|
714
|
+
dispatchEvent(handle, 'keydown', {
|
|
715
|
+
keyCode: 39
|
|
716
|
+
});
|
|
717
|
+
expect(instance.get(model)).to.eql(100);
|
|
718
|
+
dispatchEvent(handle, 'keydown', {
|
|
719
|
+
keyCode: 39
|
|
720
|
+
});
|
|
721
|
+
expect(instance.get(model)).to.eql(150);
|
|
722
|
+
dispatchEvent(handle, 'keydown', {
|
|
723
|
+
keyCode: 37
|
|
724
|
+
});
|
|
725
|
+
expect(instance.get(model)).to.eql(100);
|
|
726
|
+
dispatchEvent(handle, 'focusout');
|
|
727
|
+
|
|
728
|
+
case 16:
|
|
729
|
+
case "end":
|
|
730
|
+
return _context15.stop();
|
|
731
|
+
}
|
|
614
732
|
}
|
|
615
733
|
}, _callee10);
|
|
616
734
|
})));
|