@king-design/react 2.1.4 → 2.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/affix/index.d.ts +2 -2
- package/components/affix/index.js +5 -0
- package/components/affix/index.spec.js +108 -84
- package/components/affix/index.vdt.js +8 -5
- package/components/affix/useStyle.js +19 -8
- package/components/badge/index.js +2 -0
- package/components/badge/index.vdt.js +9 -5
- package/components/badge/styles.js +2 -0
- package/components/breadcrumb/index.js +4 -0
- package/components/breadcrumb/index.spec.js +6 -6
- package/components/breadcrumb/index.vdt.js +14 -5
- package/components/breadcrumb/item.js +8 -0
- package/components/breadcrumb/item.vdt.js +6 -3
- package/components/breadcrumb/styles.js +3 -0
- package/components/button/dynamicButton.d.ts +1 -1
- package/components/button/dynamicButton.js +5 -2
- package/components/button/group.js +10 -2
- package/components/button/group.vdt.js +7 -4
- package/components/button/index.js +27 -3
- package/components/button/index.spec.js +96 -74
- package/components/button/index.vdt.js +29 -19
- package/components/button/styles.d.ts +2 -2
- package/components/button/styles.js +48 -4
- package/components/card/column.js +2 -0
- package/components/card/column.vdt.js +10 -5
- package/components/card/index.js +4 -0
- package/components/card/index.vdt.js +16 -4
- package/components/carousel/index.js +19 -1
- package/components/carousel/index.spec.js +163 -127
- package/components/carousel/index.vdt.js +15 -12
- package/components/carousel/item.js +2 -0
- package/components/carousel/item.vdt.js +7 -4
- package/components/carousel/styles.js +1 -0
- package/components/carousel/useAutoplay.js +4 -0
- package/components/carousel/useItems.js +20 -4
- package/components/carousel/useSlide.js +89 -57
- package/components/cascader/index.d.ts +45 -0
- package/components/cascader/index.js +18 -3
- package/components/cascader/index.spec.js +445 -354
- package/components/cascader/index.vdt.js +31 -14
- package/components/cascader/styles.js +6 -0
- package/components/cascader/useFields.js +4 -1
- package/components/cascader/useFilterable.js +19 -2
- package/components/cascader/useLabel.js +9 -1
- package/components/cascader/useLoad.js +35 -22
- package/components/cascader/useValue.d.ts +2 -2
- package/components/cascader/useValue.js +26 -5
- package/components/checkbox/index.js +27 -5
- package/components/checkbox/index.spec.js +171 -129
- package/components/checkbox/index.vdt.js +16 -12
- package/components/checkbox/styles.js +10 -0
- package/components/code/crossDomain.js +9 -2
- package/components/code/index.js +9 -0
- package/components/code/index.spec.js +55 -46
- package/components/code/index.vdt.js +14 -6
- package/components/code/styles.js +1 -0
- package/components/code/useEditor.js +10 -5
- package/components/collapse/index.d.ts +1 -1
- package/components/collapse/index.js +14 -3
- package/components/collapse/index.spec.js +60 -47
- package/components/collapse/index.vdt.js +12 -4
- package/components/collapse/item.js +10 -0
- package/components/collapse/item.vdt.js +14 -7
- package/components/collapse/styles.js +1 -0
- package/components/colorpicker/drag.js +5 -0
- package/components/colorpicker/index.js +4 -0
- package/components/colorpicker/index.spec.js +259 -211
- package/components/colorpicker/index.vdt.js +11 -8
- package/components/colorpicker/panel.js +5 -0
- package/components/colorpicker/panel.vdt.js +26 -21
- package/components/colorpicker/styles.js +13 -2
- package/components/colorpicker/useDrag.js +26 -22
- package/components/colorpicker/useInput.js +16 -0
- package/components/colorpicker/usePointer.js +18 -15
- package/components/colorpicker/useValue.js +7 -2
- package/components/context.d.ts +2 -2
- package/components/context.js +19 -2
- package/components/datepicker/basepicker.d.ts +8 -8
- package/components/datepicker/basepicker.js +90 -20
- package/components/datepicker/calendar.js +11 -0
- package/components/datepicker/calendar.vdt.js +14 -11
- package/components/datepicker/constants.js +1 -0
- package/components/datepicker/dayjs.js +1 -1
- package/components/datepicker/helpers.js +15 -3
- package/components/datepicker/index.d.ts +63 -0
- package/components/datepicker/index.js +32 -6
- package/components/datepicker/index.spec.js +1448 -1141
- package/components/datepicker/index.vdt.js +34 -20
- package/components/datepicker/shortcuts.d.ts +1 -1
- package/components/datepicker/shortcuts.js +4 -0
- package/components/datepicker/styles.js +8 -0
- package/components/datepicker/time.d.ts +1 -1
- package/components/datepicker/time.js +23 -3
- package/components/datepicker/time.vdt.js +5 -4
- package/components/datepicker/useDays.js +9 -2
- package/components/datepicker/useDisabled.js +23 -6
- package/components/datepicker/useFocusDate.js +2 -0
- package/components/datepicker/useFormats.js +15 -6
- package/components/datepicker/useKeyboards.js +36 -20
- package/components/datepicker/useMonths.js +6 -0
- package/components/datepicker/usePanel.js +10 -0
- package/components/datepicker/useShowDate.js +37 -10
- package/components/datepicker/useStatus.js +15 -3
- package/components/datepicker/useValue.js +35 -22
- package/components/datepicker/useYears.js +15 -4
- package/components/diagram/diagram.js +43 -17
- package/components/diagram/diagram.vdt.js +5 -2
- package/components/diagram/graph.js +6 -6
- package/components/diagram/index.d.ts +1 -1
- package/components/diagram/index.js +7 -7
- package/components/diagram/index.spec.js +495 -369
- package/components/diagram/layouts/circle.js +14 -6
- package/components/diagram/layouts/flow.js +15 -7
- package/components/diagram/layouts/layout.js +28 -6
- package/components/diagram/layouts/organic.js +11 -3
- package/components/diagram/layouts/partition.js +12 -4
- package/components/diagram/layouts/radial.js +18 -6
- package/components/diagram/layouts/stack.js +14 -6
- package/components/diagram/layouts/tree.js +21 -11
- package/components/diagram/mxgraph/handler/mxConnectionHandler.js +22 -15
- package/components/diagram/mxgraph/handler/mxConstraintHandler.js +4 -4
- package/components/diagram/mxgraph/handler/mxEdgeHandler.js +15 -11
- package/components/diagram/mxgraph/handler/mxGraphHandler.js +9 -6
- package/components/diagram/mxgraph/handler/mxRubberband.js +4 -4
- package/components/diagram/mxgraph/handler/mxVertexHandler.js +10 -7
- package/components/diagram/mxgraph/index.js +2 -0
- package/components/diagram/mxgraph/mx.js +3 -3
- package/components/diagram/mxgraph/shape/mxCloud.js +2 -2
- package/components/diagram/mxgraph/shape/mxCylinder.js +9 -4
- package/components/diagram/mxgraph/shape/mxEllipse.js +2 -2
- package/components/diagram/mxgraph/shape/mxHexagon.js +2 -2
- package/components/diagram/mxgraph/shape/mxLine.js +2 -2
- package/components/diagram/mxgraph/shape/mxRectangleShape.js +2 -2
- package/components/diagram/mxgraph/shape/mxRhombus.js +12 -6
- package/components/diagram/mxgraph/shape/mxShape.js +1 -0
- package/components/diagram/mxgraph/shape/mxTriangle.js +2 -2
- package/components/diagram/mxgraph/util/mxConstants.js +2 -2
- package/components/diagram/mxgraph/util/mxGuide.js +7 -5
- package/components/diagram/mxgraph/view/mxCellEditor.js +29 -16
- package/components/diagram/mxgraph/view/mxCellRenderer.js +2 -0
- package/components/diagram/mxgraph/view/mxGraph.js +32 -14
- package/components/diagram/shapes/base.d.ts +1 -1
- package/components/diagram/shapes/base.js +39 -9
- package/components/diagram/shapes/callout.js +23 -10
- package/components/diagram/shapes/circle.js +10 -3
- package/components/diagram/shapes/document.js +16 -5
- package/components/diagram/shapes/ellipse.js +5 -0
- package/components/diagram/shapes/generateShapes.d.ts +1 -1
- package/components/diagram/shapes/generateShapes.js +9 -0
- package/components/diagram/shapes/hexagon.js +26 -9
- package/components/diagram/shapes/image.js +9 -1
- package/components/diagram/shapes/line.d.ts +2 -2
- package/components/diagram/shapes/line.js +48 -13
- package/components/diagram/shapes/parallelogram.js +26 -9
- package/components/diagram/shapes/rectangle.js +9 -1
- package/components/diagram/shapes/shape.js +35 -6
- package/components/diagram/shapes/square.js +11 -3
- package/components/diagram/shapes/text.js +5 -0
- package/components/diagram/styles.js +1 -0
- package/components/dialog/alert.vdt.js +19 -9
- package/components/dialog/base.js +29 -1
- package/components/dialog/base.vdt.js +29 -14
- package/components/dialog/index.js +31 -6
- package/components/dialog/index.spec.js +554 -406
- package/components/dialog/staticMethods.d.ts +1 -1
- package/components/dialog/staticMethods.js +13 -2
- package/components/dialog/styles.js +11 -0
- package/components/dialog/useDraggable.js +6 -0
- package/components/dialog/useEscClosable.js +12 -4
- package/components/dialog/useFixBody.d.ts +1 -1
- package/components/dialog/useFixBody.js +11 -0
- package/components/dialog/usePosition.js +5 -0
- package/components/drawer/index.js +5 -0
- package/components/drawer/index.spec.js +168 -126
- package/components/drawer/index.vdt.js +9 -3
- package/components/drawer/styles.d.ts +2 -2
- package/components/drawer/styles.js +4 -0
- package/components/dropdown/dropdown.d.ts +2 -2
- package/components/dropdown/dropdown.js +89 -33
- package/components/dropdown/index.js +6 -2
- package/components/dropdown/index.spec.js +496 -388
- package/components/dropdown/item.js +25 -4
- package/components/dropdown/item.vdt.js +8 -5
- package/components/dropdown/menu.js +29 -12
- package/components/dropdown/menu.vdt.js +13 -5
- package/components/dropdown/styles.js +9 -0
- package/components/dropdown/useKeyboard.d.ts +2 -2
- package/components/dropdown/useKeyboard.js +30 -8
- package/components/dropdown/usePosition.d.ts +1 -1
- package/components/dropdown/usePosition.js +22 -12
- package/components/dropdown/useTransition.js +8 -0
- package/components/editable/index.d.ts +1 -1
- package/components/editable/index.js +28 -4
- package/components/editable/index.spec.js +189 -152
- package/components/editable/index.vdt.js +11 -8
- package/components/editable/styles.js +1 -0
- package/components/form/form.js +18 -0
- package/components/form/form.vdt.js +7 -4
- package/components/form/index.spec.js +1280 -1057
- package/components/form/item.d.ts +1 -1
- package/components/form/item.js +12 -0
- package/components/form/item.vdt.js +31 -17
- package/components/form/methods.d.ts +5 -5
- package/components/form/methods.js +12 -2
- package/components/form/styles.js +8 -0
- package/components/form/useDirty.js +7 -2
- package/components/form/useError.js +10 -2
- package/components/form/useValidate.d.ts +1 -1
- package/components/form/useValidate.js +24 -8
- package/components/grid/col.d.ts +3 -3
- package/components/grid/col.js +7 -0
- package/components/grid/col.vdt.js +13 -8
- package/components/grid/constants.d.ts +6 -6
- package/components/grid/row.js +5 -0
- package/components/grid/row.vdt.js +8 -5
- package/components/grid/styles.js +7 -0
- package/components/grid/useBreakpoints.js +5 -0
- package/components/grid/useGutter.js +25 -5
- package/components/icon/index.js +10 -0
- package/components/icon/index.vdt.js +13 -7
- package/components/icon/styles.js +1 -0
- package/components/input/index.d.ts +3 -3
- package/components/input/index.js +14 -0
- package/components/input/index.spec.js +239 -185
- package/components/input/index.vdt.js +49 -39
- package/components/input/search.js +20 -0
- package/components/input/search.vdt.js +9 -6
- package/components/input/styles.js +26 -0
- package/components/input/useAutoRows.js +18 -6
- package/components/input/useAutoWidth.js +5 -0
- package/components/input/useFrozen.js +6 -0
- package/components/input/useShowPassword.js +5 -2
- package/components/layout/aside.js +17 -5
- package/components/layout/aside.vdt.js +9 -5
- package/components/layout/body.js +17 -5
- package/components/layout/footer.js +7 -1
- package/components/layout/header.js +21 -7
- package/components/layout/layout.js +24 -9
- package/components/layout/styles.js +13 -2
- package/components/layout/template.vdt.js +4 -2
- package/components/layout/useParse.js +7 -0
- package/components/menu/index.spec.js +242 -189
- package/components/menu/item.js +16 -3
- package/components/menu/item.vdt.js +32 -20
- package/components/menu/menu.js +11 -2
- package/components/menu/menu.vdt.js +12 -6
- package/components/menu/styles.js +18 -0
- package/components/menu/useDropdown.js +9 -4
- package/components/menu/useExpanded.js +14 -0
- package/components/menu/useHighlight.js +36 -26
- package/components/message/index.spec.js +73 -58
- package/components/message/message.js +19 -0
- package/components/message/message.vdt.js +8 -5
- package/components/message/messages.js +12 -0
- package/components/message/messages.vdt.js +1 -0
- package/components/message/styles.js +9 -0
- package/components/pagination/index.d.ts +1 -1
- package/components/pagination/index.js +46 -10
- package/components/pagination/index.spec.js +173 -133
- package/components/pagination/index.vdt.js +34 -14
- package/components/pagination/styles.js +4 -0
- package/components/portal.d.ts +1 -1
- package/components/portal.js +29 -2
- package/components/position.d.ts +12 -12
- package/components/position.js +88 -32
- package/components/progress/index.d.ts +6 -6
- package/components/progress/index.js +12 -0
- package/components/progress/index.spec.js +191 -143
- package/components/progress/index.vdt.js +11 -8
- package/components/progress/styles.js +6 -0
- package/components/progress/useColor.js +7 -2
- package/components/progress/useStatus.d.ts +1 -1
- package/components/progress/useStatus.js +5 -2
- package/components/radio/index.js +18 -3
- package/components/radio/index.spec.js +149 -111
- package/components/radio/index.vdt.js +17 -14
- package/components/radio/styles.js +10 -0
- package/components/rate/index.js +7 -0
- package/components/rate/index.spec.js +79 -64
- package/components/rate/index.vdt.js +21 -8
- package/components/rate/styles.js +3 -0
- package/components/rate/useActiveValue.js +7 -2
- package/components/scrollSelect/index.d.ts +2 -2
- package/components/scrollSelect/index.js +7 -0
- package/components/scrollSelect/index.spec.js +131 -100
- package/components/scrollSelect/index.vdt.js +11 -6
- package/components/scrollSelect/styles.js +7 -0
- package/components/scrollSelect/useList.js +17 -3
- package/components/scrollSelect/useMouseEvents.js +49 -31
- package/components/scrollSelect/useTranslate.js +11 -1
- package/components/select/base.js +35 -5
- package/components/select/base.vdt.js +38 -23
- package/components/select/group.js +5 -0
- package/components/select/group.vdt.js +10 -4
- package/components/select/index.spec.js +452 -361
- package/components/select/menu.js +5 -0
- package/components/select/menu.vdt.js +33 -18
- package/components/select/option.js +16 -2
- package/components/select/option.vdt.js +14 -7
- package/components/select/select.d.ts +33 -0
- package/components/select/select.js +20 -3
- package/components/select/select.vdt.js +17 -9
- package/components/select/styles.js +33 -0
- package/components/select/useBaseLabel.d.ts +1 -1
- package/components/select/useBaseLabel.js +17 -4
- package/components/select/useCard.js +4 -0
- package/components/select/useEqualWidth.js +1 -0
- package/components/select/useFilterable.js +27 -5
- package/components/select/useFocusout.js +8 -0
- package/components/select/useInput.js +10 -6
- package/components/select/useLabel.js +13 -3
- package/components/select/useSearchable.js +10 -0
- package/components/skeleton/item.d.ts +1 -1
- package/components/skeleton/item.js +4 -0
- package/components/skeleton/item.vdt.js +6 -1
- package/components/skeleton/skeleton.js +4 -0
- package/components/skeleton/skeleton.vdt.js +12 -6
- package/components/skeleton/style.d.ts +1 -1
- package/components/skeleton/style.js +1 -0
- package/components/slider/index.d.ts +1 -1
- package/components/slider/index.js +7 -0
- package/components/slider/index.spec.js +585 -467
- package/components/slider/index.vdt.js +45 -32
- package/components/slider/styles.js +14 -0
- package/components/slider/useClick.js +11 -2
- package/components/slider/useDraggable.js +34 -23
- package/components/slider/useKeyboard.js +18 -7
- package/components/slider/useMarks.d.ts +5 -5
- package/components/slider/useMarks.js +13 -5
- package/components/slider/usePoints.d.ts +2 -2
- package/components/slider/usePoints.js +21 -7
- package/components/slider/useStyles.d.ts +1 -1
- package/components/slider/useStyles.js +10 -5
- package/components/slider/useTooltip.js +10 -2
- package/components/slider/useValue.d.ts +1 -1
- package/components/slider/useValue.js +22 -7
- package/components/spin/index.js +4 -0
- package/components/spin/index.vdt.js +11 -4
- package/components/spin/styles.js +2 -0
- package/components/spinner/index.d.ts +4 -4
- package/components/spinner/index.js +24 -9
- package/components/spinner/index.spec.js +460 -359
- package/components/spinner/index.vdt.js +13 -10
- package/components/spinner/styles.js +3 -0
- package/components/spinner/useChange.js +16 -4
- package/components/spinner/useFormatter.js +16 -6
- package/components/spinner/useStep.d.ts +3 -3
- package/components/spinner/useStep.js +20 -2
- package/components/spinner/useValue.js +26 -11
- package/components/split/index.js +7 -0
- package/components/split/index.spec.js +267 -223
- package/components/split/index.vdt.js +17 -8
- package/components/split/style.d.ts +1 -1
- package/components/split/style.js +8 -0
- package/components/split/useDraggable.js +35 -11
- package/components/split/useSize.js +5 -2
- package/components/steps/context.d.ts +2 -2
- package/components/steps/index.js +10 -2
- package/components/steps/index.spec.js +27 -21
- package/components/steps/index.vdt.js +10 -8
- package/components/steps/step.js +2 -0
- package/components/steps/step.vdt.js +12 -8
- package/components/steps/styles.js +27 -0
- package/components/switch/index.js +23 -2
- package/components/switch/index.spec.js +224 -188
- package/components/switch/index.vdt.js +32 -16
- package/components/switch/styles.js +14 -3
- package/components/switch/useDraggable.js +18 -10
- package/components/table/cell.js +6 -0
- package/components/table/cell.vdt.js +21 -14
- package/components/table/column.d.ts +1 -1
- package/components/table/column.js +5 -0
- package/components/table/column.vdt.js +30 -19
- package/components/table/exportTable.js +56 -45
- package/components/table/index.spec.js +984 -780
- package/components/table/row.d.ts +1 -1
- package/components/table/row.js +41 -12
- package/components/table/row.vdt.js +39 -27
- package/components/table/styles.js +11 -0
- package/components/table/table.d.ts +5 -5
- package/components/table/table.js +50 -18
- package/components/table/table.vdt.js +85 -61
- package/components/table/useChecked.d.ts +1 -1
- package/components/table/useChecked.js +61 -20
- package/components/table/useColumns.js +16 -3
- package/components/table/useDisableRow.js +12 -2
- package/components/table/useDraggable.js +12 -4
- package/components/table/useExpandable.js +5 -2
- package/components/table/useFixedColumns.d.ts +1 -1
- package/components/table/useFixedColumns.js +23 -4
- package/components/table/useGroup.d.ts +1 -1
- package/components/table/useGroup.js +24 -7
- package/components/table/useMerge.d.ts +4 -4
- package/components/table/useMerge.js +14 -2
- package/components/table/usePagination.js +18 -4
- package/components/table/useResizable.js +10 -2
- package/components/table/useRestRowStatus.js +6 -2
- package/components/table/useScroll.d.ts +1 -1
- package/components/table/useScroll.js +3 -0
- package/components/table/useSelected.js +5 -2
- package/components/table/useSortable.js +8 -2
- package/components/table/useStickyHeader.js +7 -3
- package/components/table/useStickyScrollbar.js +16 -6
- package/components/table/useTree.js +12 -1
- package/components/table/useWidth.js +30 -14
- package/components/tabs/index.js +51 -29
- package/components/tabs/index.spec.js +74 -56
- package/components/tabs/index.vdt.js +16 -13
- package/components/tabs/styles.js +16 -0
- package/components/tabs/tab.js +10 -0
- package/components/tabs/tab.vdt.js +10 -6
- package/components/tabs/useActiveBar.js +11 -2
- package/components/tabs/useScroll.js +20 -4
- package/components/tag/base.js +8 -0
- package/components/tag/index.js +4 -2
- package/components/tag/index.spec.js +25 -19
- package/components/tag/index.vdt.js +15 -8
- package/components/tag/styles.js +9 -0
- package/components/timeline/item.js +4 -0
- package/components/timeline/item.vdt.js +9 -4
- package/components/timeline/styles.d.ts +2 -2
- package/components/timeline/styles.js +4 -0
- package/components/timeline/timeline.js +2 -0
- package/components/timeline/timeline.vdt.js +5 -2
- package/components/timepicker/index.js +7 -2
- package/components/timepicker/index.spec.js +368 -293
- package/components/timepicker/panelPicker.d.ts +54 -0
- package/components/timepicker/panelPicker.js +11 -2
- package/components/timepicker/panelPicker.vdt.js +24 -14
- package/components/timepicker/selectPicker.js +5 -0
- package/components/timepicker/selectPicker.vdt.js +10 -5
- package/components/timepicker/styles.js +1 -0
- package/components/timepicker/useDisabled.js +4 -2
- package/components/timepicker/useFormats.js +13 -4
- package/components/timepicker/useStep.d.ts +1 -1
- package/components/timepicker/useStep.js +17 -8
- package/components/timepicker/useValue.js +21 -16
- package/components/tip/index.js +2 -0
- package/components/tip/index.vdt.js +17 -5
- package/components/tip/styles.js +3 -0
- package/components/tooltip/content.js +28 -0
- package/components/tooltip/content.vdt.js +25 -15
- package/components/tooltip/index.js +7 -3
- package/components/tooltip/index.spec.js +572 -434
- package/components/tooltip/styles.d.ts +1 -1
- package/components/tooltip/styles.js +10 -2
- package/components/tooltip/tooltip.js +15 -2
- package/components/tooltip/useArrow.js +14 -11
- package/components/transfer/index.d.ts +1 -1
- package/components/transfer/index.js +13 -1
- package/components/transfer/index.spec.js +194 -159
- package/components/transfer/index.vdt.js +34 -16
- package/components/transfer/styles.js +10 -0
- package/components/transfer/useCheck.d.ts +1 -1
- package/components/transfer/useCheck.js +15 -1
- package/components/transfer/useFilter.d.ts +1 -1
- package/components/transfer/useFilter.js +30 -9
- package/components/transfer/useTransfer.js +26 -10
- package/components/tree/index.d.ts +3 -3
- package/components/tree/index.js +22 -4
- package/components/tree/index.spec.js +355 -285
- package/components/tree/index.vdt.js +23 -12
- package/components/tree/styles.js +16 -2
- package/components/tree/useChecked.js +26 -3
- package/components/tree/useDraggable.js +42 -12
- package/components/tree/useExpanded.js +43 -26
- package/components/tree/useFilter.js +10 -3
- package/components/tree/useNodes.d.ts +1 -1
- package/components/tree/useNodes.js +4 -0
- package/components/tree/useSelected.js +38 -21
- package/components/tree/useTransitionEvent.js +5 -3
- package/components/treeSelect/index.d.ts +27 -0
- package/components/treeSelect/index.js +36 -9
- package/components/treeSelect/index.spec.js +160 -123
- package/components/treeSelect/index.vdt.js +20 -14
- package/components/treeSelect/styles.js +1 -0
- package/components/treeSelect/useValue.js +11 -0
- package/components/types.d.ts +3 -3
- package/components/upload/ajaxUploader.d.ts +1 -1
- package/components/upload/ajaxUploader.js +17 -0
- package/components/upload/index.d.ts +4 -4
- package/components/upload/index.js +14 -0
- package/components/upload/index.spec.js +249 -142
- package/components/upload/index.vdt.js +27 -12
- package/components/upload/styles.js +30 -0
- package/components/upload/useAccept.js +10 -2
- package/components/upload/useDrag.js +7 -0
- package/components/upload/useFiles.js +145 -103
- package/components/upload/useShowImage.js +3 -0
- package/components/upload/useUpload.js +69 -47
- package/components/utils.d.ts +3 -3
- package/components/utils.js +47 -12
- package/components/virtual.js +37 -9
- package/components/wave/index.js +31 -5
- package/hooks/useDelayClose.js +6 -2
- package/hooks/useDocumentClick.js +16 -8
- package/hooks/useDraggable.d.ts +1 -1
- package/hooks/useDraggable.js +9 -0
- package/hooks/useKeyboard.d.ts +3 -3
- package/hooks/useKeyboard.js +10 -0
- package/hooks/useMouseOutsidable.js +8 -0
- package/hooks/useReceive.d.ts +1 -1
- package/hooks/useReceive.js +4 -0
- package/hooks/useRecordComponent.js +6 -0
- package/hooks/useRouter.js +18 -7
- package/hooks/useShowHideEvents.js +3 -0
- package/hooks/useState.d.ts +2 -2
- package/hooks/useState.js +6 -2
- package/i18n/en-US.js +1 -0
- package/i18n/index.d.ts +1 -1
- package/i18n/index.js +7 -0
- package/index.d.ts +2 -2
- package/index.js +3 -2
- package/package.json +2 -2
- package/styles/global.js +3 -2
- package/styles/keyframes.js +1 -0
- package/styles/theme.d.ts +1 -1
- package/styles/theme.js +7 -4
- package/styles/utils.d.ts +1 -1
- package/styles/utils.js +17 -3
- package/yarn-error.log +218 -199
|
@@ -20,427 +20,518 @@ describe('Select', function () {
|
|
|
20
20
|
});
|
|
21
21
|
it('should select value correctly', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
22
22
|
var _mount, instance, element, trigger, dropdown, item, _dropdown;
|
|
23
|
+
|
|
23
24
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
24
|
-
while (1)
|
|
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
|
-
|
|
25
|
+
while (1) {
|
|
26
|
+
switch (_context.prev = _context.next) {
|
|
27
|
+
case 0:
|
|
28
|
+
_mount = mount(BasicDemo), instance = _mount[0], element = _mount[1];
|
|
29
|
+
trigger = element.querySelector('.k-select');
|
|
30
|
+
trigger.click();
|
|
31
|
+
_context.next = 5;
|
|
32
|
+
return wait();
|
|
33
|
+
|
|
34
|
+
case 5:
|
|
35
|
+
expect(element.outerHTML).to.matchSnapshot();
|
|
36
|
+
dropdown = getElement('.k-select-menu');
|
|
37
|
+
expect(dropdown.innerHTML).to.matchSnapshot();
|
|
38
|
+
item = dropdown.querySelector('.k-dropdown-item');
|
|
39
|
+
item.click();
|
|
40
|
+
_context.next = 12;
|
|
41
|
+
return wait();
|
|
42
|
+
|
|
43
|
+
case 12:
|
|
44
|
+
expect(element.outerHTML).to.matchSnapshot();
|
|
45
|
+
trigger.click();
|
|
46
|
+
_context.next = 16;
|
|
47
|
+
return wait();
|
|
48
|
+
|
|
49
|
+
case 16:
|
|
50
|
+
_dropdown = getElement('.k-select-menu');
|
|
51
|
+
expect(_dropdown.innerHTML).to.matchSnapshot();
|
|
52
|
+
|
|
53
|
+
case 18:
|
|
54
|
+
case "end":
|
|
55
|
+
return _context.stop();
|
|
56
|
+
}
|
|
50
57
|
}
|
|
51
58
|
}, _callee);
|
|
52
59
|
})));
|
|
53
60
|
it('disabled', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
54
61
|
var _mount2, instance, element, _element$querySelecto, trigger, dropdown, close;
|
|
62
|
+
|
|
55
63
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
56
|
-
while (1)
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
64
|
+
while (1) {
|
|
65
|
+
switch (_context2.prev = _context2.next) {
|
|
66
|
+
case 0:
|
|
67
|
+
_mount2 = mount(DisabledDemo), instance = _mount2[0], element = _mount2[1];
|
|
68
|
+
_element$querySelecto = element.querySelectorAll('.k-select'), trigger = _element$querySelecto[1];
|
|
69
|
+
trigger.click();
|
|
70
|
+
_context2.next = 5;
|
|
71
|
+
return wait();
|
|
72
|
+
|
|
73
|
+
case 5:
|
|
74
|
+
dropdown = getElement('.k-select-menu');
|
|
75
|
+
expect(dropdown.innerHTML).to.matchSnapshot();
|
|
76
|
+
close = element.querySelector('.k-select-close');
|
|
77
|
+
close.click();
|
|
78
|
+
_context2.next = 11;
|
|
79
|
+
return wait();
|
|
80
|
+
|
|
81
|
+
case 11:
|
|
82
|
+
expect(instance.get('days').length).to.eql(2);
|
|
83
|
+
|
|
84
|
+
case 12:
|
|
85
|
+
case "end":
|
|
86
|
+
return _context2.stop();
|
|
87
|
+
}
|
|
75
88
|
}
|
|
76
89
|
}, _callee2);
|
|
77
90
|
})));
|
|
78
91
|
it('clearable', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
79
92
|
var _mount3, instance, element, _element$querySelecto2, clear1, clear2, Demo, _mount4, element1, clear;
|
|
93
|
+
|
|
80
94
|
return _regeneratorRuntime.wrap(function _callee3$(_context4) {
|
|
81
|
-
while (1)
|
|
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
|
-
|
|
95
|
+
while (1) {
|
|
96
|
+
switch (_context4.prev = _context4.next) {
|
|
97
|
+
case 0:
|
|
98
|
+
_mount3 = mount(ClearableDemo), instance = _mount3[0], element = _mount3[1];
|
|
99
|
+
instance.set({
|
|
100
|
+
day: 'Monday',
|
|
101
|
+
days: ['Monday', 'TuesdayT']
|
|
102
|
+
});
|
|
103
|
+
_context4.next = 4;
|
|
104
|
+
return wait();
|
|
105
|
+
|
|
106
|
+
case 4:
|
|
107
|
+
expect(element.outerHTML).to.matchSnapshot();
|
|
108
|
+
_element$querySelecto2 = element.querySelectorAll('.k-select-clear'), clear1 = _element$querySelecto2[0], clear2 = _element$querySelecto2[1];
|
|
109
|
+
clear1.click();
|
|
110
|
+
clear2.click();
|
|
111
|
+
_context4.next = 10;
|
|
112
|
+
return wait();
|
|
113
|
+
|
|
114
|
+
case 10:
|
|
115
|
+
expect(instance.get('day')).to.eql(null);
|
|
116
|
+
expect(instance.get('days')).to.eql([]);
|
|
117
|
+
unmount(); // clearable shouldn't support when disabled is true
|
|
118
|
+
|
|
119
|
+
Demo = /*#__PURE__*/function (_Component) {
|
|
120
|
+
_inheritsLoose(Demo, _Component);
|
|
121
|
+
|
|
122
|
+
function Demo() {
|
|
123
|
+
var _context3;
|
|
124
|
+
|
|
125
|
+
var _this;
|
|
126
|
+
|
|
127
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
128
|
+
args[_key] = arguments[_key];
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context3 = [this]).call(_context3, args)) || this;
|
|
132
|
+
_this.Select = Select;
|
|
133
|
+
_this.Option = Option;
|
|
134
|
+
return _this;
|
|
109
135
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
Demo.defaults = function defaults() {
|
|
116
|
-
return {
|
|
117
|
-
days: ['Monday', 'Tuesday']
|
|
136
|
+
|
|
137
|
+
Demo.defaults = function defaults() {
|
|
138
|
+
return {
|
|
139
|
+
days: ['Monday', 'Tuesday']
|
|
140
|
+
};
|
|
118
141
|
};
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
142
|
+
|
|
143
|
+
return Demo;
|
|
144
|
+
}(Component);
|
|
145
|
+
|
|
146
|
+
Demo.template = "\n const {Select, Option} = this;\n <Select v-model=\"days\" multiple disabled clearable>\n <Option value=\"Monday\">\u661F\u671F</Option>\n <Option value=\"Tuesday\">\u661F\u671F\u4E8C</Option>\n <Option value=\"Wednesday\">\u661F\u671F\u4E09</Option>\n <Option value=\"Thursday\">\u661F\u671F\u56DB</Option>\n <Option value=\"Friday\">\u661F\u671F\u4E94</Option>\n <Option value=\"Saturday\">\u661F\u671F\u516D</Option>\n <Option value=\"Sunday\">\u661F\u671F\u5929</Option>\n </Select>\n ";
|
|
147
|
+
_mount4 = mount(Demo), element1 = _mount4[1];
|
|
148
|
+
clear = element1.querySelector('.k-select-clear');
|
|
149
|
+
expect(clear).to.be.null;
|
|
150
|
+
|
|
151
|
+
case 18:
|
|
152
|
+
case "end":
|
|
153
|
+
return _context4.stop();
|
|
154
|
+
}
|
|
129
155
|
}
|
|
130
156
|
}, _callee3);
|
|
131
157
|
})));
|
|
132
158
|
it('multiple', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
133
159
|
var _mount5, instance, element, _element$querySelecto3, trigger, dropdown, _dropdown$querySelect, item1, item2, deleteBtn;
|
|
160
|
+
|
|
134
161
|
return _regeneratorRuntime.wrap(function _callee4$(_context5) {
|
|
135
|
-
while (1)
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
162
|
+
while (1) {
|
|
163
|
+
switch (_context5.prev = _context5.next) {
|
|
164
|
+
case 0:
|
|
165
|
+
_mount5 = mount(ClearableDemo), instance = _mount5[0], element = _mount5[1];
|
|
166
|
+
_element$querySelecto3 = element.querySelectorAll('.k-select'), trigger = _element$querySelecto3[1];
|
|
167
|
+
trigger.click();
|
|
168
|
+
_context5.next = 5;
|
|
169
|
+
return wait();
|
|
170
|
+
|
|
171
|
+
case 5:
|
|
172
|
+
dropdown = getElement('.k-select-menu');
|
|
173
|
+
_dropdown$querySelect = dropdown.querySelectorAll('.k-dropdown-item'), item1 = _dropdown$querySelect[0], item2 = _dropdown$querySelect[1];
|
|
174
|
+
item1.click();
|
|
175
|
+
item2.click();
|
|
176
|
+
_context5.next = 11;
|
|
177
|
+
return wait();
|
|
178
|
+
|
|
179
|
+
case 11:
|
|
180
|
+
expect(dropdown.innerHTML).to.matchSnapshot();
|
|
181
|
+
expect(instance.get('days')).to.eql(['Monday', 'Tuesday']); // delete
|
|
182
|
+
|
|
183
|
+
deleteBtn = element.querySelector('.k-select-close');
|
|
184
|
+
deleteBtn.click();
|
|
185
|
+
_context5.next = 17;
|
|
186
|
+
return wait();
|
|
187
|
+
|
|
188
|
+
case 17:
|
|
189
|
+
expect(instance.get('days')).to.eql(['Tuesday']);
|
|
190
|
+
expect(dropdown.innerHTML).to.matchSnapshot();
|
|
191
|
+
|
|
192
|
+
case 19:
|
|
193
|
+
case "end":
|
|
194
|
+
return _context5.stop();
|
|
195
|
+
}
|
|
163
196
|
}
|
|
164
197
|
}, _callee4);
|
|
165
198
|
})));
|
|
166
199
|
it('filterable', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
|
|
167
200
|
var _mount6, instance, element, _element$querySelecto4, input1, input2, input3, dropdown1, dropdown2;
|
|
201
|
+
|
|
168
202
|
return _regeneratorRuntime.wrap(function _callee5$(_context6) {
|
|
169
|
-
while (1)
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
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
|
-
|
|
244
|
-
|
|
203
|
+
while (1) {
|
|
204
|
+
switch (_context6.prev = _context6.next) {
|
|
205
|
+
case 0:
|
|
206
|
+
_mount6 = mount(FilterDemo), instance = _mount6[0], element = _mount6[1];
|
|
207
|
+
_element$querySelecto4 = element.querySelectorAll('.k-input-inner'), input1 = _element$querySelecto4[0], input2 = _element$querySelecto4[1], input3 = _element$querySelecto4[2];
|
|
208
|
+
input1.click();
|
|
209
|
+
_context6.next = 5;
|
|
210
|
+
return wait();
|
|
211
|
+
|
|
212
|
+
case 5:
|
|
213
|
+
input1.value = 'm';
|
|
214
|
+
dispatchEvent(input1, 'input');
|
|
215
|
+
_context6.next = 9;
|
|
216
|
+
return wait();
|
|
217
|
+
|
|
218
|
+
case 9:
|
|
219
|
+
dropdown1 = getElement('.k-select-menu');
|
|
220
|
+
expect(dropdown1.innerHTML).to.matchSnapshot();
|
|
221
|
+
dispatchEvent(document, 'keydown', {
|
|
222
|
+
keyCode: 13
|
|
223
|
+
});
|
|
224
|
+
_context6.next = 14;
|
|
225
|
+
return wait();
|
|
226
|
+
|
|
227
|
+
case 14:
|
|
228
|
+
expect(instance.get('day')).to.eql('Monday');
|
|
229
|
+
input2.click();
|
|
230
|
+
_context6.next = 18;
|
|
231
|
+
return wait();
|
|
232
|
+
|
|
233
|
+
case 18:
|
|
234
|
+
input2.value = '二';
|
|
235
|
+
dispatchEvent(input2, 'input');
|
|
236
|
+
_context6.next = 22;
|
|
237
|
+
return wait();
|
|
238
|
+
|
|
239
|
+
case 22:
|
|
240
|
+
dropdown2 = getElement('.k-select-menu');
|
|
241
|
+
expect(dropdown2.innerHTML).to.matchSnapshot();
|
|
242
|
+
dispatchEvent(document, 'keydown', {
|
|
243
|
+
keyCode: 13
|
|
244
|
+
});
|
|
245
|
+
_context6.next = 27;
|
|
246
|
+
return wait();
|
|
247
|
+
|
|
248
|
+
case 27:
|
|
249
|
+
input2.value = 'Wed';
|
|
250
|
+
dispatchEvent(input2, 'input');
|
|
251
|
+
_context6.next = 31;
|
|
252
|
+
return wait();
|
|
253
|
+
|
|
254
|
+
case 31:
|
|
255
|
+
dispatchEvent(document, 'keydown', {
|
|
256
|
+
keyCode: 13
|
|
257
|
+
});
|
|
258
|
+
_context6.next = 34;
|
|
259
|
+
return wait();
|
|
260
|
+
|
|
261
|
+
case 34:
|
|
262
|
+
expect(instance.get('days')).to.eql(['Tuesday', 'Wednesday']);
|
|
263
|
+
input3.click();
|
|
264
|
+
_context6.next = 38;
|
|
265
|
+
return wait();
|
|
266
|
+
|
|
267
|
+
case 38:
|
|
268
|
+
input3.value = 'm';
|
|
269
|
+
dispatchEvent(input3, 'input');
|
|
270
|
+
_context6.next = 42;
|
|
271
|
+
return wait();
|
|
272
|
+
|
|
273
|
+
case 42:
|
|
274
|
+
expect(getElement('.k-select-menu').innerText).to.eql('无数据');
|
|
275
|
+
input3.value = '三';
|
|
276
|
+
dispatchEvent(input3, 'input');
|
|
277
|
+
_context6.next = 47;
|
|
278
|
+
return wait();
|
|
279
|
+
|
|
280
|
+
case 47:
|
|
281
|
+
dispatchEvent(document, 'keydown', {
|
|
282
|
+
keyCode: 13
|
|
283
|
+
});
|
|
284
|
+
_context6.next = 50;
|
|
285
|
+
return wait();
|
|
286
|
+
|
|
287
|
+
case 50:
|
|
288
|
+
expect(instance.get('day1')).to.eql('Wednesday');
|
|
289
|
+
|
|
290
|
+
case 51:
|
|
291
|
+
case "end":
|
|
292
|
+
return _context6.stop();
|
|
293
|
+
}
|
|
245
294
|
}
|
|
246
295
|
}, _callee5);
|
|
247
296
|
})));
|
|
248
297
|
it('group', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
|
|
249
298
|
var _mount7, instance, element, _element$querySelecto5, trigger1, trigger2, dropdown1, item, dropdown2;
|
|
299
|
+
|
|
250
300
|
return _regeneratorRuntime.wrap(function _callee6$(_context7) {
|
|
251
|
-
while (1)
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
301
|
+
while (1) {
|
|
302
|
+
switch (_context7.prev = _context7.next) {
|
|
303
|
+
case 0:
|
|
304
|
+
_mount7 = mount(GroupDemo), instance = _mount7[0], element = _mount7[1];
|
|
305
|
+
_element$querySelecto5 = element.querySelectorAll('.k-select'), trigger1 = _element$querySelecto5[0], trigger2 = _element$querySelecto5[1];
|
|
306
|
+
trigger1.click();
|
|
307
|
+
_context7.next = 5;
|
|
308
|
+
return wait();
|
|
309
|
+
|
|
310
|
+
case 5:
|
|
311
|
+
dropdown1 = getElement('.k-select-menu');
|
|
312
|
+
expect(dropdown1.innerHTML).to.matchSnapshot();
|
|
313
|
+
item = dropdown1.querySelector('.k-select-option');
|
|
314
|
+
item.click();
|
|
315
|
+
expect(instance.get('day')).to.eql('Monday');
|
|
316
|
+
trigger2.click();
|
|
317
|
+
_context7.next = 13;
|
|
318
|
+
return wait();
|
|
319
|
+
|
|
320
|
+
case 13:
|
|
321
|
+
dropdown2 = getElement('.k-select-menu');
|
|
322
|
+
expect(dropdown2.innerHTML).to.matchSnapshot();
|
|
323
|
+
|
|
324
|
+
case 15:
|
|
325
|
+
case "end":
|
|
326
|
+
return _context7.stop();
|
|
327
|
+
}
|
|
273
328
|
}
|
|
274
329
|
}, _callee6);
|
|
275
330
|
})));
|
|
276
331
|
it('keyboard operations', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
|
|
277
332
|
var _mount8, instance, element, select, dropdown;
|
|
333
|
+
|
|
278
334
|
return _regeneratorRuntime.wrap(function _callee7$(_context8) {
|
|
279
|
-
while (1)
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
335
|
+
while (1) {
|
|
336
|
+
switch (_context8.prev = _context8.next) {
|
|
337
|
+
case 0:
|
|
338
|
+
_mount8 = mount(BasicDemo), instance = _mount8[0], element = _mount8[1];
|
|
339
|
+
select = element.querySelector('.k-select');
|
|
340
|
+
dispatchEvent(select, 'keydown', {
|
|
341
|
+
keyCode: 13
|
|
342
|
+
});
|
|
343
|
+
_context8.next = 5;
|
|
344
|
+
return wait();
|
|
345
|
+
|
|
346
|
+
case 5:
|
|
347
|
+
dropdown = getElement('.k-select-menu');
|
|
348
|
+
expect(dropdown.innerHTML).to.matchSnapshot();
|
|
349
|
+
dispatchEvent(select, 'keydown', {
|
|
350
|
+
keyCode: 9
|
|
351
|
+
});
|
|
352
|
+
_context8.next = 10;
|
|
353
|
+
return wait(500);
|
|
354
|
+
|
|
355
|
+
case 10:
|
|
356
|
+
expect(dropdown.style.display).to.eql('none');
|
|
357
|
+
|
|
358
|
+
case 11:
|
|
359
|
+
case "end":
|
|
360
|
+
return _context8.stop();
|
|
361
|
+
}
|
|
301
362
|
}
|
|
302
363
|
}, _callee7);
|
|
303
364
|
})));
|
|
304
365
|
it('creatable', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
|
|
305
366
|
var _mount9, instance, element, input, dropdown;
|
|
367
|
+
|
|
306
368
|
return _regeneratorRuntime.wrap(function _callee8$(_context9) {
|
|
307
|
-
while (1)
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
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
|
-
|
|
369
|
+
while (1) {
|
|
370
|
+
switch (_context9.prev = _context9.next) {
|
|
371
|
+
case 0:
|
|
372
|
+
_mount9 = mount(CreatableDemo), instance = _mount9[0], element = _mount9[1];
|
|
373
|
+
input = element.querySelector('.k-input-inner');
|
|
374
|
+
input.click();
|
|
375
|
+
_context9.next = 5;
|
|
376
|
+
return wait();
|
|
377
|
+
|
|
378
|
+
case 5:
|
|
379
|
+
input.value = 'xxx';
|
|
380
|
+
dispatchEvent(input, 'input');
|
|
381
|
+
_context9.next = 9;
|
|
382
|
+
return wait();
|
|
383
|
+
|
|
384
|
+
case 9:
|
|
385
|
+
dropdown = getElement('.k-select-menu');
|
|
386
|
+
expect(dropdown.innerHTML).to.matchSnapshot(); // select
|
|
387
|
+
|
|
388
|
+
dispatchEvent(document, 'keydown', {
|
|
389
|
+
keyCode: 13
|
|
390
|
+
});
|
|
391
|
+
_context9.next = 14;
|
|
392
|
+
return wait();
|
|
393
|
+
|
|
394
|
+
case 14:
|
|
395
|
+
expect(instance.get('day')).to.eql('xxx'); // open again
|
|
396
|
+
|
|
397
|
+
input.click();
|
|
398
|
+
_context9.next = 18;
|
|
399
|
+
return wait();
|
|
400
|
+
|
|
401
|
+
case 18:
|
|
402
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
403
|
+
expect(dropdown.innerHTML).to.matchSnapshot(); // input again
|
|
404
|
+
|
|
405
|
+
input.value = 'yyy';
|
|
406
|
+
dispatchEvent(input, 'input');
|
|
407
|
+
_context9.next = 24;
|
|
408
|
+
return wait();
|
|
409
|
+
|
|
410
|
+
case 24:
|
|
411
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
412
|
+
expect(dropdown.innerHTML).to.matchSnapshot(); // discard
|
|
413
|
+
|
|
414
|
+
dispatchEvent(document, 'click');
|
|
415
|
+
_context9.next = 29;
|
|
416
|
+
return wait();
|
|
417
|
+
|
|
418
|
+
case 29:
|
|
419
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
420
|
+
expect(instance.get('day')).to.eql('xxx');
|
|
421
|
+
|
|
422
|
+
case 31:
|
|
423
|
+
case "end":
|
|
424
|
+
return _context9.stop();
|
|
425
|
+
}
|
|
355
426
|
}
|
|
356
427
|
}, _callee8);
|
|
357
428
|
})));
|
|
358
429
|
it('Tooltip with Select', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9() {
|
|
359
430
|
var Demo, _mount10, instance, element;
|
|
431
|
+
|
|
360
432
|
return _regeneratorRuntime.wrap(function _callee9$(_context11) {
|
|
361
|
-
while (1)
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
433
|
+
while (1) {
|
|
434
|
+
switch (_context11.prev = _context11.next) {
|
|
435
|
+
case 0:
|
|
436
|
+
Demo = /*#__PURE__*/function (_Component2) {
|
|
437
|
+
_inheritsLoose(Demo, _Component2);
|
|
438
|
+
|
|
439
|
+
function Demo() {
|
|
440
|
+
var _context10;
|
|
441
|
+
|
|
442
|
+
var _this2;
|
|
443
|
+
|
|
444
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
445
|
+
args[_key2] = arguments[_key2];
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
_this2 = _Component2.call.apply(_Component2, _concatInstanceProperty(_context10 = [this]).call(_context10, args)) || this;
|
|
449
|
+
_this2.Tooltip = Tooltip;
|
|
450
|
+
_this2.Select = Select;
|
|
451
|
+
_this2.Option = Option;
|
|
452
|
+
return _this2;
|
|
370
453
|
}
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
return _context11.stop();
|
|
454
|
+
|
|
455
|
+
return Demo;
|
|
456
|
+
}(Component);
|
|
457
|
+
|
|
458
|
+
Demo.template = "\n const {Tooltip, Select, Option} = this;\n <Tooltip content=\"hello\">\n <Select><Option value=\"1\">option 1</Option></Select>\n </Tooltip>\n ";
|
|
459
|
+
_mount10 = mount(Demo), instance = _mount10[0], element = _mount10[1];
|
|
460
|
+
element.click();
|
|
461
|
+
_context11.next = 6;
|
|
462
|
+
return wait();
|
|
463
|
+
|
|
464
|
+
case 6:
|
|
465
|
+
expect(getElement('.k-select-menu')).to.be.exist;
|
|
466
|
+
expect(getElement('.k-tooltip-content')).to.be.exist;
|
|
467
|
+
|
|
468
|
+
case 8:
|
|
469
|
+
case "end":
|
|
470
|
+
return _context11.stop();
|
|
471
|
+
}
|
|
390
472
|
}
|
|
391
473
|
}, _callee9);
|
|
392
474
|
})));
|
|
393
475
|
it('Searchable with multiple', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10() {
|
|
394
476
|
var _mount11, instance, element, _element$querySelecto6, select, dropdown, _dropdown$querySelect2, selectAll, toggleSelect, unselectAll, _dropdown$querySelect3, confirm, cancel, input;
|
|
477
|
+
|
|
395
478
|
return _regeneratorRuntime.wrap(function _callee10$(_context12) {
|
|
396
|
-
while (1)
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
479
|
+
while (1) {
|
|
480
|
+
switch (_context12.prev = _context12.next) {
|
|
481
|
+
case 0:
|
|
482
|
+
_mount11 = mount(SearchableDemo), instance = _mount11[0], element = _mount11[1];
|
|
483
|
+
_element$querySelecto6 = element.querySelectorAll('.k-select'), select = _element$querySelecto6[1];
|
|
484
|
+
select.click();
|
|
485
|
+
_context12.next = 5;
|
|
486
|
+
return wait();
|
|
487
|
+
|
|
488
|
+
case 5:
|
|
489
|
+
dropdown = getElement('.k-select-menu');
|
|
490
|
+
_dropdown$querySelect2 = dropdown.querySelectorAll('.k-select-op .k-btn'), selectAll = _dropdown$querySelect2[0], toggleSelect = _dropdown$querySelect2[1], unselectAll = _dropdown$querySelect2[2];
|
|
491
|
+
_dropdown$querySelect3 = dropdown.querySelectorAll('.k-select-footer .k-btn'), confirm = _dropdown$querySelect3[0], cancel = _dropdown$querySelect3[1]; // select all
|
|
492
|
+
|
|
493
|
+
selectAll.click();
|
|
494
|
+
confirm.click();
|
|
495
|
+
expect(instance.get('days')).have.length(7); // unselect all
|
|
496
|
+
|
|
497
|
+
select.click();
|
|
498
|
+
_context12.next = 14;
|
|
499
|
+
return wait();
|
|
500
|
+
|
|
501
|
+
case 14:
|
|
502
|
+
unselectAll.click();
|
|
503
|
+
confirm.click();
|
|
504
|
+
expect(instance.get('days')).have.length(0); // toggle select
|
|
505
|
+
|
|
506
|
+
select.click();
|
|
507
|
+
_context12.next = 20;
|
|
508
|
+
return wait();
|
|
509
|
+
|
|
510
|
+
case 20:
|
|
511
|
+
instance.set('days', ['Monday', 'Tuesday']);
|
|
512
|
+
_context12.next = 23;
|
|
513
|
+
return wait();
|
|
514
|
+
|
|
515
|
+
case 23:
|
|
516
|
+
input = dropdown.querySelector('.k-input-inner');
|
|
517
|
+
input.value = 's';
|
|
518
|
+
dispatchEvent(input, 'input');
|
|
519
|
+
_context12.next = 28;
|
|
520
|
+
return wait();
|
|
521
|
+
|
|
522
|
+
case 28:
|
|
523
|
+
toggleSelect.click();
|
|
524
|
+
confirm.click();
|
|
525
|
+
expect(instance.get('days')).have.length(5);
|
|
526
|
+
expect(instance.get('days')).include('Monday');
|
|
527
|
+
|
|
528
|
+
case 32:
|
|
529
|
+
case "end":
|
|
530
|
+
return _context12.stop();
|
|
531
|
+
}
|
|
440
532
|
}
|
|
441
533
|
}, _callee10);
|
|
442
|
-
})));
|
|
443
|
-
// it('should trigger change event correctly', async () => {
|
|
534
|
+
}))); // it('should trigger change event correctly', async () => {
|
|
444
535
|
// const spy = sinon.spy();
|
|
445
536
|
// class Demo extends Component {
|
|
446
537
|
// static template = `
|