@king-design/vue 2.1.2 → 2.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/affix/index.d.ts +2 -2
- package/components/affix/index.js +0 -5
- package/components/affix/index.spec.js +84 -108
- package/components/affix/index.vdt.js +5 -8
- package/components/affix/useStyle.js +8 -19
- package/components/badge/index.js +0 -2
- package/components/badge/index.vdt.js +5 -9
- package/components/badge/styles.js +0 -2
- package/components/breadcrumb/index.js +0 -4
- package/components/breadcrumb/index.spec.js +6 -6
- package/components/breadcrumb/index.vdt.js +5 -14
- package/components/breadcrumb/item.js +0 -8
- package/components/breadcrumb/item.vdt.js +3 -6
- package/components/breadcrumb/styles.js +0 -3
- package/components/button/dynamicButton.d.ts +1 -1
- package/components/button/dynamicButton.js +2 -5
- package/components/button/group.js +2 -10
- package/components/button/group.vdt.js +4 -7
- package/components/button/index.js +3 -27
- package/components/button/index.spec.js +74 -96
- package/components/button/index.vdt.js +19 -29
- package/components/button/styles.d.ts +2 -2
- package/components/button/styles.js +4 -48
- package/components/card/column.js +0 -2
- package/components/card/column.vdt.js +5 -10
- package/components/card/index.js +0 -4
- package/components/card/index.vdt.js +4 -16
- package/components/carousel/index.js +1 -19
- package/components/carousel/index.spec.js +127 -163
- package/components/carousel/index.vdt.js +12 -15
- package/components/carousel/item.js +0 -2
- package/components/carousel/item.vdt.js +4 -7
- package/components/carousel/styles.js +0 -1
- package/components/carousel/useAutoplay.js +0 -4
- package/components/carousel/useItems.js +4 -20
- package/components/carousel/useSlide.js +57 -89
- package/components/cascader/index.js +3 -18
- package/components/cascader/index.spec.js +365 -379
- package/components/cascader/index.vdt.js +14 -31
- package/components/cascader/styles.js +0 -6
- package/components/cascader/useFields.js +1 -4
- package/components/cascader/useFilterable.js +2 -19
- package/components/cascader/useLabel.js +1 -9
- package/components/cascader/useLoad.js +22 -35
- package/components/cascader/useValue.d.ts +2 -2
- package/components/cascader/useValue.js +6 -27
- package/components/checkbox/index.js +5 -27
- package/components/checkbox/index.spec.js +129 -171
- package/components/checkbox/index.vdt.js +12 -16
- package/components/checkbox/styles.js +0 -10
- package/components/code/crossDomain.js +2 -9
- package/components/code/index.js +0 -9
- package/components/code/index.spec.js +46 -55
- package/components/code/index.vdt.js +6 -14
- package/components/code/styles.js +0 -1
- package/components/code/useEditor.js +5 -10
- package/components/collapse/index.d.ts +1 -1
- package/components/collapse/index.js +3 -14
- package/components/collapse/index.spec.js +47 -60
- package/components/collapse/index.vdt.js +4 -12
- package/components/collapse/item.js +0 -10
- package/components/collapse/item.vdt.js +7 -14
- package/components/collapse/styles.js +0 -1
- package/components/colorpicker/drag.js +0 -5
- package/components/colorpicker/index.js +0 -4
- package/components/colorpicker/index.spec.js +211 -259
- package/components/colorpicker/index.vdt.js +8 -11
- package/components/colorpicker/panel.js +0 -5
- package/components/colorpicker/panel.vdt.js +21 -26
- package/components/colorpicker/styles.js +2 -13
- package/components/colorpicker/useDrag.js +22 -26
- package/components/colorpicker/useInput.js +0 -16
- package/components/colorpicker/usePointer.js +15 -18
- package/components/colorpicker/useValue.js +2 -7
- package/components/context.d.ts +2 -2
- package/components/context.js +2 -19
- package/components/datepicker/basepicker.d.ts +8 -8
- package/components/datepicker/basepicker.js +20 -90
- package/components/datepicker/calendar.js +0 -11
- package/components/datepicker/calendar.vdt.js +11 -14
- package/components/datepicker/constants.js +0 -1
- package/components/datepicker/dayjs.js +1 -1
- package/components/datepicker/helpers.js +3 -15
- package/components/datepicker/index.js +6 -32
- package/components/datepicker/index.spec.js +1141 -1448
- package/components/datepicker/index.vdt.js +20 -34
- package/components/datepicker/shortcuts.d.ts +1 -1
- package/components/datepicker/shortcuts.js +0 -4
- package/components/datepicker/styles.js +0 -8
- package/components/datepicker/time.d.ts +1 -1
- package/components/datepicker/time.js +3 -23
- package/components/datepicker/time.vdt.js +4 -5
- package/components/datepicker/useDays.js +2 -9
- package/components/datepicker/useDisabled.js +6 -23
- package/components/datepicker/useFocusDate.js +0 -2
- package/components/datepicker/useFormats.js +6 -15
- package/components/datepicker/useKeyboards.js +20 -36
- package/components/datepicker/useMonths.js +0 -6
- package/components/datepicker/usePanel.js +0 -10
- package/components/datepicker/useShowDate.js +10 -37
- package/components/datepicker/useStatus.js +3 -15
- package/components/datepicker/useValue.js +22 -35
- package/components/datepicker/useYears.js +4 -15
- package/components/diagram/diagram.js +17 -43
- package/components/diagram/diagram.vdt.js +2 -5
- package/components/diagram/graph.js +6 -6
- package/components/diagram/index.d.ts +1 -1
- package/components/diagram/index.js +7 -7
- package/components/diagram/index.spec.js +369 -495
- package/components/diagram/layouts/circle.js +6 -14
- package/components/diagram/layouts/flow.js +7 -15
- package/components/diagram/layouts/layout.js +6 -28
- package/components/diagram/layouts/organic.js +3 -11
- package/components/diagram/layouts/partition.js +4 -12
- package/components/diagram/layouts/radial.js +6 -18
- package/components/diagram/layouts/stack.js +6 -14
- package/components/diagram/layouts/tree.js +11 -21
- package/components/diagram/mxgraph/handler/mxConnectionHandler.js +15 -22
- package/components/diagram/mxgraph/handler/mxConstraintHandler.js +4 -4
- package/components/diagram/mxgraph/handler/mxEdgeHandler.js +11 -15
- package/components/diagram/mxgraph/handler/mxGraphHandler.js +6 -9
- package/components/diagram/mxgraph/handler/mxRubberband.js +4 -4
- package/components/diagram/mxgraph/handler/mxVertexHandler.js +7 -10
- package/components/diagram/mxgraph/index.js +0 -2
- package/components/diagram/mxgraph/mx.js +3 -3
- package/components/diagram/mxgraph/shape/mxCloud.js +2 -2
- package/components/diagram/mxgraph/shape/mxCylinder.js +4 -9
- package/components/diagram/mxgraph/shape/mxEllipse.js +2 -2
- package/components/diagram/mxgraph/shape/mxHexagon.js +2 -2
- package/components/diagram/mxgraph/shape/mxLine.js +2 -2
- package/components/diagram/mxgraph/shape/mxRectangleShape.js +2 -2
- package/components/diagram/mxgraph/shape/mxRhombus.js +6 -12
- package/components/diagram/mxgraph/shape/mxShape.js +0 -1
- package/components/diagram/mxgraph/shape/mxTriangle.js +2 -2
- package/components/diagram/mxgraph/util/mxConstants.js +2 -2
- package/components/diagram/mxgraph/util/mxGuide.js +5 -7
- package/components/diagram/mxgraph/view/mxCellEditor.js +16 -29
- package/components/diagram/mxgraph/view/mxCellRenderer.js +0 -2
- package/components/diagram/mxgraph/view/mxGraph.js +14 -32
- package/components/diagram/shapes/base.d.ts +1 -1
- package/components/diagram/shapes/base.js +9 -39
- package/components/diagram/shapes/callout.js +10 -23
- package/components/diagram/shapes/circle.js +3 -10
- package/components/diagram/shapes/document.js +5 -16
- package/components/diagram/shapes/ellipse.js +0 -5
- package/components/diagram/shapes/generateShapes.d.ts +1 -1
- package/components/diagram/shapes/generateShapes.js +0 -9
- package/components/diagram/shapes/hexagon.js +9 -26
- package/components/diagram/shapes/image.js +1 -9
- package/components/diagram/shapes/line.d.ts +2 -2
- package/components/diagram/shapes/line.js +13 -48
- package/components/diagram/shapes/parallelogram.js +9 -26
- package/components/diagram/shapes/rectangle.js +1 -9
- package/components/diagram/shapes/shape.js +6 -35
- package/components/diagram/shapes/square.js +3 -11
- package/components/diagram/shapes/text.js +0 -5
- package/components/diagram/styles.js +0 -1
- package/components/dialog/alert.vdt.js +9 -19
- package/components/dialog/base.js +1 -29
- package/components/dialog/base.vdt.js +14 -29
- package/components/dialog/index.js +6 -31
- package/components/dialog/index.spec.js +416 -503
- package/components/dialog/staticMethods.d.ts +1 -1
- package/components/dialog/staticMethods.js +2 -13
- package/components/dialog/styles.js +0 -11
- package/components/dialog/useDraggable.js +0 -6
- package/components/dialog/useEscClosable.js +4 -12
- package/components/dialog/useFixBody.d.ts +1 -1
- package/components/dialog/useFixBody.js +0 -11
- package/components/dialog/usePosition.js +7 -5
- package/components/drawer/index.js +0 -5
- package/components/drawer/index.spec.js +126 -168
- package/components/drawer/index.vdt.js +3 -9
- package/components/drawer/styles.d.ts +2 -2
- package/components/drawer/styles.js +0 -4
- package/components/dropdown/dropdown.d.ts +2 -2
- package/components/dropdown/dropdown.js +33 -89
- package/components/dropdown/index.js +2 -6
- package/components/dropdown/index.spec.js +388 -496
- package/components/dropdown/item.js +4 -25
- package/components/dropdown/item.vdt.js +5 -8
- package/components/dropdown/menu.js +14 -29
- package/components/dropdown/menu.vdt.js +5 -13
- package/components/dropdown/styles.js +0 -9
- package/components/dropdown/useKeyboard.d.ts +2 -2
- package/components/dropdown/useKeyboard.js +8 -30
- package/components/dropdown/usePosition.d.ts +2 -1
- package/components/dropdown/usePosition.js +33 -28
- package/components/dropdown/useTransition.js +0 -8
- package/components/editable/index.d.ts +1 -1
- package/components/editable/index.js +4 -28
- package/components/editable/index.spec.js +152 -189
- package/components/editable/index.vdt.js +8 -11
- package/components/editable/styles.js +0 -1
- package/components/form/form.js +0 -18
- package/components/form/form.vdt.js +4 -7
- package/components/form/index.spec.js +1057 -1280
- package/components/form/item.d.ts +1 -1
- package/components/form/item.js +0 -12
- package/components/form/item.vdt.js +17 -31
- package/components/form/methods.d.ts +5 -5
- package/components/form/methods.js +2 -12
- package/components/form/styles.js +0 -8
- package/components/form/useDirty.js +2 -7
- package/components/form/useError.js +2 -10
- package/components/form/useValidate.d.ts +1 -1
- package/components/form/useValidate.js +8 -24
- package/components/grid/col.d.ts +3 -3
- package/components/grid/col.js +0 -7
- package/components/grid/col.vdt.js +8 -13
- package/components/grid/constants.d.ts +6 -6
- package/components/grid/row.js +0 -5
- package/components/grid/row.vdt.js +5 -8
- package/components/grid/styles.js +0 -7
- package/components/grid/useBreakpoints.js +0 -5
- package/components/grid/useGutter.js +5 -25
- package/components/icon/index.js +0 -10
- package/components/icon/index.vdt.js +7 -13
- package/components/icon/styles.js +0 -1
- package/components/input/index.d.ts +3 -3
- package/components/input/index.js +0 -14
- package/components/input/index.spec.js +185 -239
- package/components/input/index.vdt.js +39 -49
- package/components/input/search.js +0 -20
- package/components/input/search.vdt.js +6 -9
- package/components/input/styles.js +0 -26
- package/components/input/useAutoRows.js +6 -18
- package/components/input/useAutoWidth.js +0 -5
- package/components/input/useFrozen.js +0 -6
- package/components/input/useShowPassword.js +2 -5
- package/components/layout/aside.js +5 -17
- package/components/layout/aside.vdt.js +5 -9
- package/components/layout/body.js +5 -17
- package/components/layout/footer.js +1 -7
- package/components/layout/header.js +7 -21
- package/components/layout/layout.js +9 -24
- package/components/layout/styles.js +2 -13
- package/components/layout/template.vdt.js +2 -4
- package/components/layout/useParse.js +0 -7
- package/components/menu/index.spec.js +189 -242
- package/components/menu/item.js +3 -16
- package/components/menu/item.vdt.js +20 -32
- package/components/menu/menu.js +2 -11
- package/components/menu/menu.vdt.js +6 -12
- package/components/menu/styles.js +0 -18
- package/components/menu/useDropdown.js +4 -9
- package/components/menu/useExpanded.js +0 -14
- package/components/menu/useHighlight.js +26 -36
- package/components/message/index.spec.js +58 -73
- package/components/message/message.js +0 -19
- package/components/message/message.vdt.js +5 -8
- package/components/message/messages.js +0 -12
- package/components/message/messages.vdt.js +0 -1
- package/components/message/styles.js +0 -9
- package/components/pagination/index.d.ts +1 -1
- package/components/pagination/index.js +10 -46
- package/components/pagination/index.spec.js +133 -173
- package/components/pagination/index.vdt.js +14 -34
- package/components/pagination/styles.js +0 -4
- package/components/portal.d.ts +1 -1
- package/components/portal.js +13 -28
- package/components/position.d.ts +12 -12
- package/components/position.js +32 -88
- package/components/progress/index.d.ts +6 -6
- package/components/progress/index.js +0 -12
- package/components/progress/index.spec.js +143 -191
- package/components/progress/index.vdt.js +8 -11
- package/components/progress/styles.js +0 -6
- package/components/progress/useColor.js +2 -7
- package/components/progress/useStatus.d.ts +1 -1
- package/components/progress/useStatus.js +2 -5
- package/components/radio/index.js +3 -18
- package/components/radio/index.spec.js +111 -149
- package/components/radio/index.vdt.js +14 -17
- package/components/radio/styles.js +0 -10
- package/components/rate/index.js +0 -7
- package/components/rate/index.spec.js +64 -79
- package/components/rate/index.vdt.js +8 -21
- package/components/rate/styles.js +0 -3
- package/components/rate/useActiveValue.js +2 -7
- package/components/scrollSelect/index.d.ts +2 -2
- package/components/scrollSelect/index.js +0 -7
- package/components/scrollSelect/index.spec.js +100 -131
- package/components/scrollSelect/index.vdt.js +6 -11
- package/components/scrollSelect/styles.js +0 -7
- package/components/scrollSelect/useList.js +3 -17
- package/components/scrollSelect/useMouseEvents.js +31 -49
- package/components/scrollSelect/useTranslate.js +1 -11
- package/components/select/base.js +5 -35
- package/components/select/base.vdt.js +23 -38
- package/components/select/group.js +0 -5
- package/components/select/group.vdt.js +4 -10
- package/components/select/index.spec.js +361 -452
- package/components/select/menu.js +0 -5
- package/components/select/menu.vdt.js +18 -33
- package/components/select/option.js +2 -16
- package/components/select/option.vdt.js +7 -14
- package/components/select/select.js +3 -20
- package/components/select/select.vdt.js +9 -17
- package/components/select/styles.js +0 -33
- package/components/select/useBaseLabel.d.ts +1 -1
- package/components/select/useBaseLabel.js +4 -17
- package/components/select/useCard.js +0 -4
- package/components/select/useEqualWidth.js +0 -1
- package/components/select/useFilterable.js +5 -27
- package/components/select/useFocusout.d.ts +1 -1
- package/components/select/useFocusout.js +1 -9
- package/components/select/useInput.js +6 -10
- package/components/select/useLabel.js +3 -13
- package/components/select/useSearchable.js +0 -10
- package/components/skeleton/item.d.ts +1 -1
- package/components/skeleton/item.js +0 -4
- package/components/skeleton/item.vdt.js +1 -6
- package/components/skeleton/skeleton.js +0 -4
- package/components/skeleton/skeleton.vdt.js +6 -12
- package/components/skeleton/style.d.ts +1 -1
- package/components/skeleton/style.js +0 -1
- package/components/slider/index.d.ts +1 -1
- package/components/slider/index.js +0 -7
- package/components/slider/index.spec.js +467 -585
- package/components/slider/index.vdt.js +32 -45
- package/components/slider/styles.js +0 -14
- package/components/slider/useClick.js +2 -11
- package/components/slider/useDraggable.js +23 -34
- package/components/slider/useKeyboard.js +7 -18
- package/components/slider/useMarks.d.ts +5 -5
- package/components/slider/useMarks.js +5 -13
- package/components/slider/usePoints.d.ts +2 -2
- package/components/slider/usePoints.js +7 -21
- package/components/slider/useStyles.d.ts +1 -1
- package/components/slider/useStyles.js +5 -10
- package/components/slider/useTooltip.js +2 -10
- package/components/slider/useValue.d.ts +1 -1
- package/components/slider/useValue.js +7 -22
- package/components/spin/index.js +0 -4
- package/components/spin/index.vdt.js +4 -11
- package/components/spin/styles.js +0 -2
- package/components/spinner/index.d.ts +4 -4
- package/components/spinner/index.js +9 -24
- package/components/spinner/index.spec.js +359 -460
- package/components/spinner/index.vdt.js +10 -13
- package/components/spinner/styles.js +0 -3
- package/components/spinner/useChange.js +4 -16
- package/components/spinner/useFormatter.js +6 -16
- package/components/spinner/useStep.d.ts +3 -3
- package/components/spinner/useStep.js +2 -20
- package/components/spinner/useValue.js +11 -26
- package/components/split/index.js +0 -7
- package/components/split/index.spec.js +223 -267
- package/components/split/index.vdt.js +8 -17
- package/components/split/style.d.ts +1 -1
- package/components/split/style.js +0 -8
- package/components/split/useDraggable.js +11 -35
- package/components/split/useSize.js +2 -5
- package/components/steps/context.d.ts +2 -2
- package/components/steps/index.js +2 -10
- package/components/steps/index.spec.js +21 -27
- package/components/steps/index.vdt.js +8 -10
- package/components/steps/step.js +0 -2
- package/components/steps/step.vdt.js +8 -12
- package/components/steps/styles.js +0 -27
- package/components/switch/index.js +2 -23
- package/components/switch/index.spec.js +188 -224
- package/components/switch/index.vdt.js +16 -32
- package/components/switch/styles.js +3 -14
- package/components/switch/useDraggable.js +10 -18
- package/components/table/cell.js +0 -6
- package/components/table/cell.vdt.js +14 -21
- package/components/table/column.d.ts +1 -1
- package/components/table/column.js +0 -5
- package/components/table/column.vdt.js +19 -30
- package/components/table/exportTable.js +45 -56
- package/components/table/index.spec.js +780 -984
- package/components/table/row.d.ts +1 -1
- package/components/table/row.js +18 -40
- package/components/table/row.vdt.js +27 -39
- package/components/table/styles.js +0 -11
- package/components/table/table.d.ts +5 -5
- package/components/table/table.js +18 -50
- package/components/table/table.vdt.js +61 -85
- package/components/table/useChecked.d.ts +1 -1
- package/components/table/useChecked.js +20 -61
- package/components/table/useColumns.js +3 -16
- package/components/table/useDisableRow.js +2 -12
- package/components/table/useDraggable.js +4 -12
- package/components/table/useExpandable.js +2 -5
- package/components/table/useFixedColumns.d.ts +1 -1
- package/components/table/useFixedColumns.js +4 -23
- package/components/table/useGroup.d.ts +1 -1
- package/components/table/useGroup.js +7 -24
- package/components/table/useMerge.d.ts +4 -4
- package/components/table/useMerge.js +2 -14
- package/components/table/usePagination.js +4 -18
- package/components/table/useResizable.js +2 -10
- package/components/table/useRestRowStatus.js +2 -6
- package/components/table/useScroll.d.ts +1 -1
- package/components/table/useScroll.js +0 -3
- package/components/table/useSelected.js +2 -5
- package/components/table/useSortable.js +2 -8
- package/components/table/useStickyHeader.js +3 -7
- package/components/table/useStickyScrollbar.js +6 -16
- package/components/table/useTree.js +1 -12
- package/components/table/useWidth.js +14 -30
- package/components/tabs/index.js +29 -51
- package/components/tabs/index.spec.js +56 -74
- package/components/tabs/index.vdt.js +13 -16
- package/components/tabs/styles.js +0 -16
- package/components/tabs/tab.js +0 -10
- package/components/tabs/tab.vdt.js +6 -10
- package/components/tabs/useActiveBar.js +2 -11
- package/components/tabs/useScroll.js +4 -20
- package/components/tag/base.js +0 -8
- package/components/tag/index.js +2 -4
- package/components/tag/index.spec.js +19 -25
- package/components/tag/index.vdt.js +8 -15
- package/components/tag/styles.js +0 -9
- package/components/timeline/item.js +0 -4
- package/components/timeline/item.vdt.js +4 -9
- package/components/timeline/styles.d.ts +2 -2
- package/components/timeline/styles.js +0 -4
- package/components/timeline/timeline.js +0 -2
- package/components/timeline/timeline.vdt.js +2 -5
- package/components/timepicker/index.js +2 -7
- package/components/timepicker/index.spec.js +293 -368
- package/components/timepicker/panelPicker.js +2 -11
- package/components/timepicker/panelPicker.vdt.js +14 -24
- package/components/timepicker/selectPicker.js +0 -5
- package/components/timepicker/selectPicker.vdt.js +5 -10
- package/components/timepicker/styles.js +0 -1
- package/components/timepicker/useDisabled.js +2 -4
- package/components/timepicker/useFormats.js +4 -13
- package/components/timepicker/useStep.d.ts +1 -1
- package/components/timepicker/useStep.js +8 -17
- package/components/timepicker/useValue.js +16 -21
- package/components/tip/index.js +0 -2
- package/components/tip/index.vdt.js +5 -17
- package/components/tip/styles.js +0 -3
- package/components/tooltip/content.js +0 -28
- package/components/tooltip/content.vdt.js +15 -25
- package/components/tooltip/index.js +3 -7
- package/components/tooltip/index.spec.js +434 -572
- package/components/tooltip/styles.d.ts +1 -1
- package/components/tooltip/styles.js +2 -10
- package/components/tooltip/tooltip.js +2 -15
- package/components/tooltip/useArrow.js +11 -14
- package/components/transfer/index.d.ts +1 -1
- package/components/transfer/index.js +1 -13
- package/components/transfer/index.spec.js +159 -194
- package/components/transfer/index.vdt.js +16 -34
- package/components/transfer/styles.js +0 -10
- package/components/transfer/useCheck.d.ts +1 -1
- package/components/transfer/useCheck.js +1 -15
- package/components/transfer/useFilter.d.ts +1 -1
- package/components/transfer/useFilter.js +9 -30
- package/components/transfer/useTransfer.js +10 -26
- package/components/tree/index.d.ts +3 -3
- package/components/tree/index.js +4 -22
- package/components/tree/index.spec.js +285 -355
- package/components/tree/index.vdt.js +12 -23
- package/components/tree/styles.js +2 -16
- package/components/tree/useChecked.js +3 -26
- package/components/tree/useDraggable.js +12 -42
- package/components/tree/useExpanded.js +26 -43
- package/components/tree/useFilter.js +3 -10
- package/components/tree/useNodes.d.ts +1 -1
- package/components/tree/useNodes.js +0 -4
- package/components/tree/useSelected.js +21 -38
- package/components/tree/useTransitionEvent.js +3 -5
- package/components/treeSelect/index.js +9 -36
- package/components/treeSelect/index.spec.js +123 -160
- package/components/treeSelect/index.vdt.js +14 -20
- package/components/treeSelect/styles.js +0 -1
- package/components/treeSelect/useValue.js +0 -11
- package/components/types.d.ts +3 -3
- package/components/upload/ajaxUploader.d.ts +1 -1
- package/components/upload/ajaxUploader.js +0 -17
- package/components/upload/index.d.ts +4 -4
- package/components/upload/index.js +0 -14
- package/components/upload/index.spec.js +142 -249
- package/components/upload/index.vdt.js +12 -27
- package/components/upload/styles.js +0 -30
- package/components/upload/useAccept.js +2 -10
- package/components/upload/useDrag.js +0 -7
- package/components/upload/useFiles.js +103 -145
- package/components/upload/useShowImage.js +0 -3
- package/components/upload/useUpload.js +47 -69
- package/components/utils.d.ts +4 -3
- package/components/utils.js +24 -43
- package/components/virtual.js +14 -39
- package/components/wave/index.js +5 -31
- package/hooks/useDelayClose.js +2 -6
- package/hooks/useDocumentClick.js +8 -16
- package/hooks/useDraggable.d.ts +1 -1
- package/hooks/useDraggable.js +0 -9
- package/hooks/useKeyboard.d.ts +3 -3
- package/hooks/useKeyboard.js +0 -10
- package/hooks/useMouseOutsidable.js +0 -8
- package/hooks/useReceive.d.ts +1 -1
- package/hooks/useReceive.js +0 -4
- package/hooks/useRecordComponent.js +0 -6
- package/hooks/useRouter.js +7 -18
- package/hooks/useShowHideEvents.js +0 -3
- package/hooks/useState.d.ts +2 -2
- package/hooks/useState.js +2 -6
- package/i18n/en-US.js +0 -1
- package/i18n/index.d.ts +1 -1
- package/i18n/index.js +0 -7
- package/index.d.ts +2 -2
- package/index.js +2 -3
- package/package.json +2 -2
- package/styles/global.js +2 -3
- package/styles/keyframes.js +0 -1
- package/styles/theme.d.ts +1 -1
- package/styles/theme.js +4 -7
- package/styles/utils.d.ts +1 -1
- package/styles/utils.js +3 -17
- package/yarn-error.log +1013 -0
- package/components/cascader/index.d.ts +0 -45
- package/components/datepicker/index.d.ts +0 -63
- package/components/select/select.d.ts +0 -33
- package/components/timepicker/panelPicker.d.ts +0 -54
- package/components/treeSelect/index.d.ts +0 -27
|
@@ -31,1147 +31,943 @@ describe('Table', function () {
|
|
|
31
31
|
});
|
|
32
32
|
it('check & uncheck', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
33
33
|
var _mount, instance, element, table, checked, spy, spyCheckRow, spyUncheckRow, spyCheckAll, spyUncheckAll, _element$querySelecto, tr1, tr2, all;
|
|
34
|
-
|
|
35
34
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
36
|
-
while (1) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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
|
-
_context.next = 49;
|
|
110
|
-
return wait();
|
|
111
|
-
|
|
112
|
-
case 49:
|
|
113
|
-
expect(spy.callCount).to.eql(7);
|
|
114
|
-
|
|
115
|
-
case 50:
|
|
116
|
-
case "end":
|
|
117
|
-
return _context.stop();
|
|
118
|
-
}
|
|
35
|
+
while (1) switch (_context.prev = _context.next) {
|
|
36
|
+
case 0:
|
|
37
|
+
_mount = mount(BasicDemo), instance = _mount[0], element = _mount[1];
|
|
38
|
+
table = instance.$lastInput.children;
|
|
39
|
+
checked = table.checked; // bind $change:checked event
|
|
40
|
+
spy = sinon.spy(function (v) {
|
|
41
|
+
return console.log(v);
|
|
42
|
+
});
|
|
43
|
+
table.on('$change:checkedKeys', spy);
|
|
44
|
+
spyCheckRow = sinon.spy(function (data, index, key) {
|
|
45
|
+
return console.log('checkRow', data, index, key);
|
|
46
|
+
});
|
|
47
|
+
table.on('checkRow', spyCheckRow);
|
|
48
|
+
spyUncheckRow = sinon.spy(function (data, index, key) {
|
|
49
|
+
return console.log('uncheckRow', data, index, key);
|
|
50
|
+
});
|
|
51
|
+
table.on('uncheckRow', spyUncheckRow);
|
|
52
|
+
spyCheckAll = sinon.spy(function () {
|
|
53
|
+
return console.log('checkAll');
|
|
54
|
+
});
|
|
55
|
+
table.on('checkAll', spyCheckAll);
|
|
56
|
+
spyUncheckAll = sinon.spy(function () {
|
|
57
|
+
return console.log('uncheckAll');
|
|
58
|
+
});
|
|
59
|
+
table.on('uncheckAll', spyUncheckAll);
|
|
60
|
+
// click row
|
|
61
|
+
_element$querySelecto = element.querySelectorAll('tbody tr'), tr1 = _element$querySelecto[0], tr2 = _element$querySelecto[1];
|
|
62
|
+
tr1.click();
|
|
63
|
+
_context.next = 17;
|
|
64
|
+
return wait();
|
|
65
|
+
case 17:
|
|
66
|
+
expect(table.get('checkedKeys')).to.eql([0]);
|
|
67
|
+
expect(spyCheckRow.callCount).to.eql(1);
|
|
68
|
+
tr2.click();
|
|
69
|
+
_context.next = 22;
|
|
70
|
+
return wait();
|
|
71
|
+
case 22:
|
|
72
|
+
expect(table.get('checkedKeys')).to.eql([0, 1]);
|
|
73
|
+
expect(checked.getAllCheckedStatus()).eql(AllCheckedStatus.All);
|
|
74
|
+
expect(spyCheckRow.callCount).to.eql(2);
|
|
75
|
+
expect(spyCheckAll.callCount).to.eq(0);
|
|
76
|
+
tr1.click();
|
|
77
|
+
_context.next = 29;
|
|
78
|
+
return wait();
|
|
79
|
+
case 29:
|
|
80
|
+
expect(table.get('checkedKeys')).to.eql([1]);
|
|
81
|
+
expect(checked.getAllCheckedStatus()).eql(AllCheckedStatus.Indeterminate);
|
|
82
|
+
expect(spyUncheckRow.callCount).to.eql(1);
|
|
83
|
+
all = element.querySelector('.k-checkbox');
|
|
84
|
+
all.click();
|
|
85
|
+
_context.next = 36;
|
|
86
|
+
return wait();
|
|
87
|
+
case 36:
|
|
88
|
+
expect(checked.getAllCheckedStatus()).eql(AllCheckedStatus.All);
|
|
89
|
+
expect(spyCheckAll.callCount).to.eql(1);
|
|
90
|
+
all.click();
|
|
91
|
+
_context.next = 41;
|
|
92
|
+
return wait();
|
|
93
|
+
case 41:
|
|
94
|
+
expect(checked.getAllCheckedStatus()).eql(AllCheckedStatus.None);
|
|
95
|
+
expect(table.get('checkedKeys')).to.eql([]);
|
|
96
|
+
expect(spyUncheckAll.callCount).to.eql(1);
|
|
97
|
+
expect(spy.callCount).to.eql(5);
|
|
98
|
+
// clear data of table should only trigger $change:checked event once, #407
|
|
99
|
+
all.click();
|
|
100
|
+
instance.set('data', []);
|
|
101
|
+
_context.next = 49;
|
|
102
|
+
return wait();
|
|
103
|
+
case 49:
|
|
104
|
+
expect(spy.callCount).to.eql(7);
|
|
105
|
+
case 50:
|
|
106
|
+
case "end":
|
|
107
|
+
return _context.stop();
|
|
119
108
|
}
|
|
120
109
|
}, _callee);
|
|
121
110
|
})));
|
|
122
111
|
it('click row of radio table', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
123
112
|
var _mount2, instance, element, table, _element$querySelecto2, tr1, tr2;
|
|
124
|
-
|
|
125
113
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
126
|
-
while (1) {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
expect(table.get('checkedKeys')).eql([1]);
|
|
145
|
-
|
|
146
|
-
case 11:
|
|
147
|
-
case "end":
|
|
148
|
-
return _context2.stop();
|
|
149
|
-
}
|
|
114
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
115
|
+
case 0:
|
|
116
|
+
_mount2 = mount(CheckTypeDemo), instance = _mount2[0], element = _mount2[1];
|
|
117
|
+
table = instance.refs.__radio; // click row
|
|
118
|
+
_element$querySelecto2 = element.querySelectorAll('.k-table:nth-child(2) tbody tr'), tr1 = _element$querySelecto2[0], tr2 = _element$querySelecto2[1];
|
|
119
|
+
tr1.click();
|
|
120
|
+
_context2.next = 6;
|
|
121
|
+
return wait();
|
|
122
|
+
case 6:
|
|
123
|
+
expect(table.get('checkedKeys')).eql([0]);
|
|
124
|
+
tr2.click();
|
|
125
|
+
_context2.next = 10;
|
|
126
|
+
return wait();
|
|
127
|
+
case 10:
|
|
128
|
+
expect(table.get('checkedKeys')).eql([1]);
|
|
129
|
+
case 11:
|
|
130
|
+
case "end":
|
|
131
|
+
return _context2.stop();
|
|
150
132
|
}
|
|
151
133
|
}, _callee2);
|
|
152
134
|
})));
|
|
153
135
|
it('getCheckedData', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
154
136
|
var _mount3, instance, element, _instance$refs, checkboxTable, radioTable, _element$querySelecto3, tr1, tr2, _element$querySelecto4, tr11, tr22;
|
|
155
|
-
|
|
156
137
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
157
|
-
while (1) {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
case 19:
|
|
187
|
-
expect(_JSON$stringify(radioTable.getCheckedData())).to.matchSnapshot();
|
|
188
|
-
|
|
189
|
-
case 20:
|
|
190
|
-
case "end":
|
|
191
|
-
return _context3.stop();
|
|
192
|
-
}
|
|
138
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
139
|
+
case 0:
|
|
140
|
+
_mount3 = mount(CheckTypeDemo), instance = _mount3[0], element = _mount3[1];
|
|
141
|
+
_instance$refs = instance.refs, checkboxTable = _instance$refs.__checkbox, radioTable = _instance$refs.__radio;
|
|
142
|
+
_element$querySelecto3 = element.querySelectorAll('.k-table:nth-child(1) tbody tr'), tr1 = _element$querySelecto3[0], tr2 = _element$querySelecto3[1];
|
|
143
|
+
tr1.click();
|
|
144
|
+
_context3.next = 6;
|
|
145
|
+
return wait();
|
|
146
|
+
case 6:
|
|
147
|
+
expect(_JSON$stringify(checkboxTable.getCheckedData())).to.matchSnapshot();
|
|
148
|
+
tr2.click();
|
|
149
|
+
_context3.next = 10;
|
|
150
|
+
return wait();
|
|
151
|
+
case 10:
|
|
152
|
+
expect(_JSON$stringify(checkboxTable.getCheckedData())).to.matchSnapshot();
|
|
153
|
+
_element$querySelecto4 = element.querySelectorAll('.k-table:nth-child(2) tbody tr'), tr11 = _element$querySelecto4[0], tr22 = _element$querySelecto4[1];
|
|
154
|
+
tr11.click();
|
|
155
|
+
_context3.next = 15;
|
|
156
|
+
return wait();
|
|
157
|
+
case 15:
|
|
158
|
+
expect(_JSON$stringify(radioTable.getCheckedData())).to.matchSnapshot();
|
|
159
|
+
tr22.click();
|
|
160
|
+
_context3.next = 19;
|
|
161
|
+
return wait();
|
|
162
|
+
case 19:
|
|
163
|
+
expect(_JSON$stringify(radioTable.getCheckedData())).to.matchSnapshot();
|
|
164
|
+
case 20:
|
|
165
|
+
case "end":
|
|
166
|
+
return _context3.stop();
|
|
193
167
|
}
|
|
194
168
|
}, _callee3);
|
|
195
169
|
})));
|
|
196
170
|
it('expand & shrink', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
197
171
|
var _mount4, instance, element, _instance$refs2, rowExpandableTable, rowUnExpandableTable, _element$querySelecto5, table1, table2, _table1$querySelector, tr, _table2$querySelector, tr1, icon;
|
|
198
|
-
|
|
199
172
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
200
|
-
while (1) {
|
|
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
|
-
case 25:
|
|
238
|
-
expect(table2.outerHTML).to.matchSnapshot();
|
|
239
|
-
|
|
240
|
-
case 26:
|
|
241
|
-
case "end":
|
|
242
|
-
return _context4.stop();
|
|
243
|
-
}
|
|
173
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
174
|
+
case 0:
|
|
175
|
+
_mount4 = mount(ExpandDemo), instance = _mount4[0], element = _mount4[1];
|
|
176
|
+
_instance$refs2 = instance.refs, rowExpandableTable = _instance$refs2.__test1, rowUnExpandableTable = _instance$refs2.__test2;
|
|
177
|
+
_element$querySelecto5 = element.querySelectorAll('.k-table'), table1 = _element$querySelecto5[0], table2 = _element$querySelecto5[1];
|
|
178
|
+
_table1$querySelector = table1.querySelectorAll('tbody tr'), tr = _table1$querySelector[0];
|
|
179
|
+
tr.click();
|
|
180
|
+
_context4.next = 7;
|
|
181
|
+
return wait();
|
|
182
|
+
case 7:
|
|
183
|
+
expect(table1.outerHTML).to.matchSnapshot();
|
|
184
|
+
tr.click();
|
|
185
|
+
_context4.next = 11;
|
|
186
|
+
return wait();
|
|
187
|
+
case 11:
|
|
188
|
+
expect(table1.outerHTML).to.matchSnapshot();
|
|
189
|
+
_table2$querySelector = table2.querySelectorAll('tbody tr'), tr1 = _table2$querySelector[0];
|
|
190
|
+
tr1.click();
|
|
191
|
+
_context4.next = 16;
|
|
192
|
+
return wait();
|
|
193
|
+
case 16:
|
|
194
|
+
expect(table2.outerHTML).to.matchSnapshot();
|
|
195
|
+
icon = tr1.querySelector('.icon');
|
|
196
|
+
icon.click();
|
|
197
|
+
_context4.next = 21;
|
|
198
|
+
return wait();
|
|
199
|
+
case 21:
|
|
200
|
+
expect(table2.outerHTML).to.matchSnapshot();
|
|
201
|
+
icon.click();
|
|
202
|
+
_context4.next = 25;
|
|
203
|
+
return wait();
|
|
204
|
+
case 25:
|
|
205
|
+
expect(table2.outerHTML).to.matchSnapshot();
|
|
206
|
+
case 26:
|
|
207
|
+
case "end":
|
|
208
|
+
return _context4.stop();
|
|
244
209
|
}
|
|
245
210
|
}, _callee4);
|
|
246
211
|
})));
|
|
247
212
|
it('merge cells', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
|
|
248
213
|
var _mount5, instance, element, _instance$refs3, mergeCheckboxTable, mergeRadioTable, _element$querySelecto6, table1, table2, _table1$querySelector2, tr3, tr4, tr5, _table2$querySelector2, _tr1, _tr4;
|
|
249
|
-
|
|
250
214
|
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
251
|
-
while (1) {
|
|
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
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
_tr1.click();
|
|
302
|
-
|
|
303
|
-
_context5.next = 37;
|
|
304
|
-
return wait();
|
|
305
|
-
|
|
306
|
-
case 37:
|
|
307
|
-
expect(mergeRadioTable.get('checkedKeys')).eql([1, 0]);
|
|
308
|
-
expect(table2.outerHTML).to.matchSnapshot();
|
|
309
|
-
|
|
310
|
-
case 39:
|
|
311
|
-
case "end":
|
|
312
|
-
return _context5.stop();
|
|
313
|
-
}
|
|
215
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
216
|
+
case 0:
|
|
217
|
+
_mount5 = mount(MergeCellDemo), instance = _mount5[0], element = _mount5[1];
|
|
218
|
+
_instance$refs3 = instance.refs, mergeCheckboxTable = _instance$refs3.__test1, mergeRadioTable = _instance$refs3.__test2;
|
|
219
|
+
_element$querySelecto6 = element.querySelectorAll('.k-table'), table1 = _element$querySelecto6[0], table2 = _element$querySelecto6[1];
|
|
220
|
+
_table1$querySelector2 = table1.querySelectorAll('tbody tr'), tr3 = _table1$querySelector2[2], tr4 = _table1$querySelector2[3], tr5 = _table1$querySelector2[4];
|
|
221
|
+
expect(mergeCheckboxTable.get('checkedKeys')).eql([3]);
|
|
222
|
+
expect(table1.outerHTML).to.matchSnapshot();
|
|
223
|
+
tr3.click();
|
|
224
|
+
_context5.next = 9;
|
|
225
|
+
return wait();
|
|
226
|
+
case 9:
|
|
227
|
+
expect(mergeCheckboxTable.get('checkedKeys')).eql([3, 2]);
|
|
228
|
+
expect(table1.outerHTML).to.matchSnapshot();
|
|
229
|
+
tr4.click();
|
|
230
|
+
_context5.next = 14;
|
|
231
|
+
return wait();
|
|
232
|
+
case 14:
|
|
233
|
+
expect(mergeCheckboxTable.get('checkedKeys')).eql([2]);
|
|
234
|
+
expect(table1.outerHTML).to.matchSnapshot();
|
|
235
|
+
tr4.click();
|
|
236
|
+
_context5.next = 19;
|
|
237
|
+
return wait();
|
|
238
|
+
case 19:
|
|
239
|
+
expect(mergeCheckboxTable.get('checkedKeys')).eql([2, 3]);
|
|
240
|
+
expect(table1.outerHTML).to.matchSnapshot();
|
|
241
|
+
tr5.click();
|
|
242
|
+
_context5.next = 24;
|
|
243
|
+
return wait();
|
|
244
|
+
case 24:
|
|
245
|
+
expect(mergeCheckboxTable.get('checkedKeys')).eql([2, 3, 4]);
|
|
246
|
+
expect(table1.outerHTML).to.matchSnapshot();
|
|
247
|
+
_table2$querySelector2 = table2.querySelectorAll('tbody tr'), _tr1 = _table2$querySelector2[0], _tr4 = _table2$querySelector2[3];
|
|
248
|
+
expect(mergeRadioTable.get('checkedKeys')).eql([0, 1]);
|
|
249
|
+
expect(table2.outerHTML).to.matchSnapshot();
|
|
250
|
+
_tr4.click();
|
|
251
|
+
_context5.next = 32;
|
|
252
|
+
return wait();
|
|
253
|
+
case 32:
|
|
254
|
+
expect(mergeRadioTable.get('checkedKeys')).eql([1, 2, 3, 4]);
|
|
255
|
+
expect(table2.outerHTML).to.matchSnapshot();
|
|
256
|
+
_tr1.click();
|
|
257
|
+
_context5.next = 37;
|
|
258
|
+
return wait();
|
|
259
|
+
case 37:
|
|
260
|
+
expect(mergeRadioTable.get('checkedKeys')).eql([1, 0]);
|
|
261
|
+
expect(table2.outerHTML).to.matchSnapshot();
|
|
262
|
+
case 39:
|
|
263
|
+
case "end":
|
|
264
|
+
return _context5.stop();
|
|
314
265
|
}
|
|
315
266
|
}, _callee5);
|
|
316
267
|
})));
|
|
317
268
|
it('sort', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
|
|
318
269
|
var _mount6, instance, element, _element$querySelecto7, th1, th2;
|
|
319
|
-
|
|
320
270
|
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
321
|
-
while (1) {
|
|
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
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
case 17:
|
|
358
|
-
expect(instance.get('sort')).to.eql({});
|
|
359
|
-
|
|
360
|
-
case 18:
|
|
361
|
-
case "end":
|
|
362
|
-
return _context6.stop();
|
|
363
|
-
}
|
|
271
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
272
|
+
case 0:
|
|
273
|
+
_mount6 = mount(SortDemo), instance = _mount6[0], element = _mount6[1];
|
|
274
|
+
_element$querySelecto7 = element.querySelectorAll('thead th'), th1 = _element$querySelecto7[1], th2 = _element$querySelecto7[2];
|
|
275
|
+
th1.click();
|
|
276
|
+
_context6.next = 5;
|
|
277
|
+
return wait();
|
|
278
|
+
case 5:
|
|
279
|
+
expect(instance.get('sort')).to.eql({
|
|
280
|
+
key: 'name',
|
|
281
|
+
type: 'desc'
|
|
282
|
+
});
|
|
283
|
+
th2.click();
|
|
284
|
+
_context6.next = 9;
|
|
285
|
+
return wait();
|
|
286
|
+
case 9:
|
|
287
|
+
expect(instance.get('sort')).to.eql({
|
|
288
|
+
key: 'age',
|
|
289
|
+
type: 'desc'
|
|
290
|
+
});
|
|
291
|
+
th2.click();
|
|
292
|
+
_context6.next = 13;
|
|
293
|
+
return wait();
|
|
294
|
+
case 13:
|
|
295
|
+
expect(instance.get('sort')).to.eql({
|
|
296
|
+
key: 'age',
|
|
297
|
+
type: 'asc'
|
|
298
|
+
});
|
|
299
|
+
th2.click();
|
|
300
|
+
_context6.next = 17;
|
|
301
|
+
return wait();
|
|
302
|
+
case 17:
|
|
303
|
+
expect(instance.get('sort')).to.eql({});
|
|
304
|
+
case 18:
|
|
305
|
+
case "end":
|
|
306
|
+
return _context6.stop();
|
|
364
307
|
}
|
|
365
308
|
}, _callee6);
|
|
366
309
|
})));
|
|
367
310
|
it('group', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
|
|
368
311
|
var _mount7, instance, element, _instance$refs4, __test1, __test2, _element$querySelecto8, table1, table2, icon, dropdown, item, icon2, dropdown2, _dropdown2$querySelec, item1, item2, newDropdown;
|
|
369
|
-
|
|
370
312
|
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
371
|
-
while (1) {
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
case 36:
|
|
432
|
-
newDropdown = getElement('.k-table-group-dropdown');
|
|
433
|
-
expect(newDropdown.innerHTML).to.matchSnapshot();
|
|
434
|
-
|
|
435
|
-
case 38:
|
|
436
|
-
case "end":
|
|
437
|
-
return _context7.stop();
|
|
438
|
-
}
|
|
313
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
314
|
+
case 0:
|
|
315
|
+
_mount7 = mount(GroupDemo), instance = _mount7[0], element = _mount7[1];
|
|
316
|
+
_instance$refs4 = instance.refs, __test1 = _instance$refs4.__test1, __test2 = _instance$refs4.__test2;
|
|
317
|
+
_element$querySelecto8 = element.querySelectorAll('.k-table'), table1 = _element$querySelecto8[0], table2 = _element$querySelecto8[1];
|
|
318
|
+
icon = table1.querySelector('.k-table-group');
|
|
319
|
+
dispatchEvent(icon, 'click');
|
|
320
|
+
_context7.next = 7;
|
|
321
|
+
return wait();
|
|
322
|
+
case 7:
|
|
323
|
+
dropdown = getElement('.k-table-group-dropdown');
|
|
324
|
+
expect(dropdown.innerHTML).to.matchSnapshot();
|
|
325
|
+
item = dropdown.querySelector('.k-dropdown-item:nth-child(2)');
|
|
326
|
+
item.click();
|
|
327
|
+
_context7.next = 13;
|
|
328
|
+
return wait();
|
|
329
|
+
case 13:
|
|
330
|
+
expect(instance.get('group')).to.eql({
|
|
331
|
+
status: 'active'
|
|
332
|
+
});
|
|
333
|
+
expect(table1.innerHTML).to.matchSnapshot();
|
|
334
|
+
icon2 = table2.querySelector('.k-table-group');
|
|
335
|
+
dispatchEvent(icon2, 'click');
|
|
336
|
+
_context7.next = 19;
|
|
337
|
+
return wait();
|
|
338
|
+
case 19:
|
|
339
|
+
dropdown2 = getElement('.k-table-group-dropdown');
|
|
340
|
+
expect(dropdown2.innerHTML).to.matchSnapshot();
|
|
341
|
+
_dropdown2$querySelec = dropdown2.querySelectorAll('.k-checkbox'), item1 = _dropdown2$querySelec[0], item2 = _dropdown2$querySelec[1];
|
|
342
|
+
item1.click();
|
|
343
|
+
_context7.next = 25;
|
|
344
|
+
return wait();
|
|
345
|
+
case 25:
|
|
346
|
+
expect(instance.get('multipleGroup')).to.eql({
|
|
347
|
+
status: ['active']
|
|
348
|
+
});
|
|
349
|
+
expect(table2.innerHTML).to.matchSnapshot();
|
|
350
|
+
item2.click();
|
|
351
|
+
_context7.next = 30;
|
|
352
|
+
return wait();
|
|
353
|
+
case 30:
|
|
354
|
+
expect(instance.get('multipleGroup')).to.eql({
|
|
355
|
+
status: ['active', 'stopped']
|
|
356
|
+
});
|
|
357
|
+
expect(table2.innerHTML).to.matchSnapshot();
|
|
358
|
+
// update group
|
|
359
|
+
instance.set('statusGroup', [{
|
|
360
|
+
label: 'label',
|
|
361
|
+
value: 'value'
|
|
362
|
+
}]);
|
|
363
|
+
dispatchEvent(icon, 'click');
|
|
364
|
+
_context7.next = 36;
|
|
365
|
+
return wait(500);
|
|
366
|
+
case 36:
|
|
367
|
+
newDropdown = getElement('.k-table-group-dropdown');
|
|
368
|
+
expect(newDropdown.innerHTML).to.matchSnapshot();
|
|
369
|
+
case 38:
|
|
370
|
+
case "end":
|
|
371
|
+
return _context7.stop();
|
|
439
372
|
}
|
|
440
373
|
}, _callee7);
|
|
441
374
|
})));
|
|
442
375
|
it('fix columns', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
|
|
443
376
|
var _mount8, instance, element, table, tableElement, scrollElement;
|
|
444
|
-
|
|
445
377
|
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
446
|
-
while (1) {
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
case 16:
|
|
474
|
-
expect(tableElement.outerHTML).to.matchSnapshot();
|
|
475
|
-
|
|
476
|
-
case 17:
|
|
477
|
-
case "end":
|
|
478
|
-
return _context8.stop();
|
|
479
|
-
}
|
|
378
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
379
|
+
case 0:
|
|
380
|
+
_mount8 = mount(FixColumnDemo), instance = _mount8[0], element = _mount8[1];
|
|
381
|
+
table = instance.refs.__test;
|
|
382
|
+
element.style.width = "1000px";
|
|
383
|
+
tableElement = element.querySelector('.k-table:nth-child(2)');
|
|
384
|
+
scrollElement = tableElement.querySelector('.k-table-wrapper'); // should add k-scroll-middle classname
|
|
385
|
+
scrollElement.scrollLeft = 100;
|
|
386
|
+
_context8.next = 8;
|
|
387
|
+
return wait(100);
|
|
388
|
+
case 8:
|
|
389
|
+
expect(tableElement.outerHTML).to.matchSnapshot();
|
|
390
|
+
// should add k-scroll-right classname
|
|
391
|
+
scrollElement.scrollLeft = 1000;
|
|
392
|
+
_context8.next = 12;
|
|
393
|
+
return wait(100);
|
|
394
|
+
case 12:
|
|
395
|
+
expect(tableElement.outerHTML).to.matchSnapshot();
|
|
396
|
+
// should change max-height if we set fixHeader to true
|
|
397
|
+
table.set('fixHeader', true);
|
|
398
|
+
_context8.next = 16;
|
|
399
|
+
return wait();
|
|
400
|
+
case 16:
|
|
401
|
+
expect(tableElement.outerHTML).to.matchSnapshot();
|
|
402
|
+
case 17:
|
|
403
|
+
case "end":
|
|
404
|
+
return _context8.stop();
|
|
480
405
|
}
|
|
481
406
|
}, _callee8);
|
|
482
407
|
})));
|
|
483
408
|
it('resize', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9() {
|
|
484
409
|
var _mount9, instance, element, table, resize;
|
|
485
|
-
|
|
486
410
|
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
|
|
487
|
-
while (1) {
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
case 9:
|
|
508
|
-
case "end":
|
|
509
|
-
return _context9.stop();
|
|
510
|
-
}
|
|
411
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
412
|
+
case 0:
|
|
413
|
+
_mount9 = mount(BasicDemo), instance = _mount9[0], element = _mount9[1];
|
|
414
|
+
table = instance.refs.__test;
|
|
415
|
+
resize = element.querySelector('.k-table-resize');
|
|
416
|
+
dispatchEvent(resize, 'mousedown', {
|
|
417
|
+
which: 1,
|
|
418
|
+
clientX: 0
|
|
419
|
+
});
|
|
420
|
+
dispatchEvent(document, 'mousemove', {
|
|
421
|
+
clientX: 1
|
|
422
|
+
});
|
|
423
|
+
dispatchEvent(document, 'mouseup');
|
|
424
|
+
_context9.next = 8;
|
|
425
|
+
return wait();
|
|
426
|
+
case 8:
|
|
427
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
428
|
+
case 9:
|
|
429
|
+
case "end":
|
|
430
|
+
return _context9.stop();
|
|
511
431
|
}
|
|
512
432
|
}, _callee9);
|
|
513
433
|
})));
|
|
514
434
|
it('store width on resizing', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10() {
|
|
515
435
|
var _mount10, instance, element, resize, innerHTML, _mount11, table;
|
|
516
|
-
|
|
517
436
|
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
|
|
518
|
-
while (1) {
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
localStorage.removeItem('resizableTable');
|
|
549
|
-
|
|
550
|
-
case 17:
|
|
551
|
-
case "end":
|
|
552
|
-
return _context10.stop();
|
|
553
|
-
}
|
|
437
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
438
|
+
case 0:
|
|
439
|
+
localStorage.removeItem('resizableTable');
|
|
440
|
+
_mount10 = mount(ResizableDemo), instance = _mount10[0], element = _mount10[1]; // should equal to minWidth
|
|
441
|
+
_context10.next = 4;
|
|
442
|
+
return wait();
|
|
443
|
+
case 4:
|
|
444
|
+
expect(element.querySelector('thead th:nth-child(4)').offsetWidth).to.eql(300);
|
|
445
|
+
resize = element.querySelector('.k-table-resize');
|
|
446
|
+
dispatchEvent(resize, 'mousedown', {
|
|
447
|
+
which: 1,
|
|
448
|
+
clientX: 0
|
|
449
|
+
});
|
|
450
|
+
dispatchEvent(document, 'mousemove', {
|
|
451
|
+
clientX: 1
|
|
452
|
+
});
|
|
453
|
+
dispatchEvent(document, 'mouseup');
|
|
454
|
+
_context10.next = 11;
|
|
455
|
+
return wait();
|
|
456
|
+
case 11:
|
|
457
|
+
// rerender
|
|
458
|
+
innerHTML = element.innerHTML;
|
|
459
|
+
unmount();
|
|
460
|
+
_mount11 = mount(ResizableDemo), table = _mount11[1];
|
|
461
|
+
expect(table.innerHTML).to.matchSnapshot();
|
|
462
|
+
expect(table.innerHTML).to.eql(innerHTML);
|
|
463
|
+
localStorage.removeItem('resizableTable');
|
|
464
|
+
case 17:
|
|
465
|
+
case "end":
|
|
466
|
+
return _context10.stop();
|
|
554
467
|
}
|
|
555
468
|
}, _callee10);
|
|
556
469
|
})));
|
|
557
470
|
it('resize column that its previous column is hidden', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11() {
|
|
558
471
|
var _mount12, instance, element, resize;
|
|
559
|
-
|
|
560
472
|
return _regeneratorRuntime.wrap(function _callee11$(_context11) {
|
|
561
|
-
while (1) {
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
case 10:
|
|
583
|
-
case "end":
|
|
584
|
-
return _context11.stop();
|
|
585
|
-
}
|
|
473
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
474
|
+
case 0:
|
|
475
|
+
localStorage.removeItem('resizableTable');
|
|
476
|
+
_mount12 = mount(ResizableDemo, null, ResizableDemoData), instance = _mount12[0], element = _mount12[1];
|
|
477
|
+
resize = element.querySelector('thead th:nth-child(4) .k-table-resize');
|
|
478
|
+
dispatchEvent(resize, 'mousedown', {
|
|
479
|
+
which: 1,
|
|
480
|
+
clientX: 0
|
|
481
|
+
});
|
|
482
|
+
dispatchEvent(document, 'mousemove', {
|
|
483
|
+
clientX: 1
|
|
484
|
+
});
|
|
485
|
+
dispatchEvent(document, 'mouseup');
|
|
486
|
+
_context11.next = 8;
|
|
487
|
+
return wait();
|
|
488
|
+
case 8:
|
|
489
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
490
|
+
localStorage.removeItem('resizableTable');
|
|
491
|
+
case 10:
|
|
492
|
+
case "end":
|
|
493
|
+
return _context11.stop();
|
|
586
494
|
}
|
|
587
495
|
}, _callee11);
|
|
588
496
|
})));
|
|
589
497
|
it('should set the width of table equal to container after resizing and expanding container', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12() {
|
|
590
498
|
var _mount13, instance, element, resize, container;
|
|
591
|
-
|
|
592
499
|
return _regeneratorRuntime.wrap(function _callee12$(_context12) {
|
|
593
|
-
while (1) {
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
case 12:
|
|
619
|
-
case "end":
|
|
620
|
-
return _context12.stop();
|
|
621
|
-
}
|
|
500
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
501
|
+
case 0:
|
|
502
|
+
_mount13 = mount(BasicDemo), instance = _mount13[0], element = _mount13[1];
|
|
503
|
+
resize = element.querySelector('.k-table-resize');
|
|
504
|
+
dispatchEvent(resize, 'mousedown', {
|
|
505
|
+
which: 1,
|
|
506
|
+
clientX: 0
|
|
507
|
+
});
|
|
508
|
+
dispatchEvent(document, 'mousemove', {
|
|
509
|
+
clientX: 1
|
|
510
|
+
});
|
|
511
|
+
dispatchEvent(document, 'mouseup');
|
|
512
|
+
_context12.next = 7;
|
|
513
|
+
return wait();
|
|
514
|
+
case 7:
|
|
515
|
+
container = element.parentNode;
|
|
516
|
+
container.style.width = '1000px';
|
|
517
|
+
_context12.next = 11;
|
|
518
|
+
return wait(200);
|
|
519
|
+
case 11:
|
|
520
|
+
expect(element.querySelector('table').style.width).to.eql('1000px');
|
|
521
|
+
case 12:
|
|
522
|
+
case "end":
|
|
523
|
+
return _context12.stop();
|
|
622
524
|
}
|
|
623
525
|
}, _callee12);
|
|
624
526
|
})));
|
|
625
527
|
it('loading', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13() {
|
|
626
528
|
var _mount14, instance, element;
|
|
627
|
-
|
|
628
529
|
return _regeneratorRuntime.wrap(function _callee13$(_context13) {
|
|
629
|
-
while (1) {
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
case 9:
|
|
647
|
-
case "end":
|
|
648
|
-
return _context13.stop();
|
|
649
|
-
}
|
|
530
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
531
|
+
case 0:
|
|
532
|
+
_mount14 = mount(LoadingDemo), instance = _mount14[0], element = _mount14[1];
|
|
533
|
+
instance.set('loading', true);
|
|
534
|
+
_context13.next = 4;
|
|
535
|
+
return wait();
|
|
536
|
+
case 4:
|
|
537
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
538
|
+
instance.set('loading', false);
|
|
539
|
+
_context13.next = 8;
|
|
540
|
+
return wait();
|
|
541
|
+
case 8:
|
|
542
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
543
|
+
case 9:
|
|
544
|
+
case "end":
|
|
545
|
+
return _context13.stop();
|
|
650
546
|
}
|
|
651
547
|
}, _callee13);
|
|
652
548
|
})));
|
|
653
549
|
it('export', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14() {
|
|
654
550
|
var _mount15, instance, element, content, content1;
|
|
655
|
-
|
|
656
551
|
return _regeneratorRuntime.wrap(function _callee14$(_context14) {
|
|
657
|
-
while (1) {
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
case 10:
|
|
680
|
-
case "end":
|
|
681
|
-
return _context14.stop();
|
|
682
|
-
}
|
|
552
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
553
|
+
case 0:
|
|
554
|
+
this.timeout(0);
|
|
555
|
+
_mount15 = mount(ExportDemo), instance = _mount15[0], element = _mount15[1];
|
|
556
|
+
_context14.next = 4;
|
|
557
|
+
return instance.refs.table.exportTable();
|
|
558
|
+
case 4:
|
|
559
|
+
content = _context14.sent;
|
|
560
|
+
expect(content.replace(/\r\n|\r/g, '\n')).to.matchSnapshot();
|
|
561
|
+
_context14.next = 8;
|
|
562
|
+
return instance.refs.table.exportTable([{
|
|
563
|
+
a: '1',
|
|
564
|
+
b: 2,
|
|
565
|
+
c: 3
|
|
566
|
+
}]);
|
|
567
|
+
case 8:
|
|
568
|
+
content1 = _context14.sent;
|
|
569
|
+
expect(content1.replace(/\r\n|\r/g, '\n')).to.matchSnapshot();
|
|
570
|
+
case 10:
|
|
571
|
+
case "end":
|
|
572
|
+
return _context14.stop();
|
|
683
573
|
}
|
|
684
574
|
}, _callee14, this);
|
|
685
575
|
})));
|
|
686
576
|
it('selectedKeys', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15() {
|
|
687
577
|
var _mount16, instance, element, _element$querySelecto9, table1, table2, _table1$querySelector3, tr1, tr2, _table2$querySelector3, tr21, tr22;
|
|
688
|
-
|
|
689
578
|
return _regeneratorRuntime.wrap(function _callee15$(_context15) {
|
|
690
|
-
while (1) {
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
case 30:
|
|
735
|
-
expect(table2.innerHTML).to.matchSnapshot();
|
|
736
|
-
expect(instance.refs.__test2.getSelectedData()).to.have.lengthOf(1);
|
|
737
|
-
|
|
738
|
-
case 32:
|
|
739
|
-
case "end":
|
|
740
|
-
return _context15.stop();
|
|
741
|
-
}
|
|
579
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
580
|
+
case 0:
|
|
581
|
+
_mount16 = mount(SelectedKeysDemo), instance = _mount16[0], element = _mount16[1];
|
|
582
|
+
_element$querySelecto9 = element.querySelectorAll('tbody'), table1 = _element$querySelecto9[0], table2 = _element$querySelecto9[1];
|
|
583
|
+
_table1$querySelector3 = table1.querySelectorAll('tr'), tr1 = _table1$querySelector3[0], tr2 = _table1$querySelector3[1];
|
|
584
|
+
tr1.click();
|
|
585
|
+
_context15.next = 6;
|
|
586
|
+
return wait();
|
|
587
|
+
case 6:
|
|
588
|
+
expect(table1.innerHTML).to.matchSnapshot();
|
|
589
|
+
tr2.click();
|
|
590
|
+
_context15.next = 10;
|
|
591
|
+
return wait();
|
|
592
|
+
case 10:
|
|
593
|
+
expect(table1.innerHTML).to.matchSnapshot();
|
|
594
|
+
expect(instance.refs.__test1.getSelectedData()).to.have.lengthOf(1);
|
|
595
|
+
tr2.click();
|
|
596
|
+
_context15.next = 15;
|
|
597
|
+
return wait();
|
|
598
|
+
case 15:
|
|
599
|
+
expect(table1.innerHTML).to.matchSnapshot();
|
|
600
|
+
expect(instance.refs.__test1.getSelectedData()).to.have.lengthOf(0);
|
|
601
|
+
_table2$querySelector3 = table2.querySelectorAll('tr'), tr21 = _table2$querySelector3[0], tr22 = _table2$querySelector3[1];
|
|
602
|
+
tr21.click();
|
|
603
|
+
_context15.next = 21;
|
|
604
|
+
return wait();
|
|
605
|
+
case 21:
|
|
606
|
+
expect(table2.innerHTML).to.matchSnapshot();
|
|
607
|
+
tr22.click();
|
|
608
|
+
_context15.next = 25;
|
|
609
|
+
return wait();
|
|
610
|
+
case 25:
|
|
611
|
+
expect(table2.innerHTML).to.matchSnapshot();
|
|
612
|
+
expect(instance.refs.__test2.getSelectedData()).to.have.lengthOf(2);
|
|
613
|
+
tr22.click();
|
|
614
|
+
_context15.next = 30;
|
|
615
|
+
return wait();
|
|
616
|
+
case 30:
|
|
617
|
+
expect(table2.innerHTML).to.matchSnapshot();
|
|
618
|
+
expect(instance.refs.__test2.getSelectedData()).to.have.lengthOf(1);
|
|
619
|
+
case 32:
|
|
620
|
+
case "end":
|
|
621
|
+
return _context15.stop();
|
|
742
622
|
}
|
|
743
623
|
}, _callee15);
|
|
744
624
|
})));
|
|
745
625
|
it('tooltip', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16() {
|
|
746
626
|
var _mount17, instance, element, tr, content;
|
|
747
|
-
|
|
748
627
|
return _regeneratorRuntime.wrap(function _callee16$(_context16) {
|
|
749
|
-
while (1) {
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
case 7:
|
|
763
|
-
case "end":
|
|
764
|
-
return _context16.stop();
|
|
765
|
-
}
|
|
628
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
629
|
+
case 0:
|
|
630
|
+
_mount17 = mount(TooltipDemo), instance = _mount17[0], element = _mount17[1];
|
|
631
|
+
tr = element.querySelector('tbody tr');
|
|
632
|
+
dispatchEvent(tr, 'mouseenter');
|
|
633
|
+
_context16.next = 5;
|
|
634
|
+
return wait();
|
|
635
|
+
case 5:
|
|
636
|
+
content = getElement('.k-tooltip-content');
|
|
637
|
+
expect(content.textContent).to.matchSnapshot();
|
|
638
|
+
case 7:
|
|
639
|
+
case "end":
|
|
640
|
+
return _context16.stop();
|
|
766
641
|
}
|
|
767
642
|
}, _callee16);
|
|
768
643
|
})));
|
|
769
644
|
it('tree', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17() {
|
|
770
645
|
var _mount18, instance, element, table, checkbox, arrow;
|
|
771
|
-
|
|
772
646
|
return _regeneratorRuntime.wrap(function _callee17$(_context17) {
|
|
773
|
-
while (1) {
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
expect(element.innerHTML).to.matchSnapshot();
|
|
800
|
-
expect(table.getCheckedData()).to.have.lengthOf(8);
|
|
801
|
-
|
|
802
|
-
case 18:
|
|
803
|
-
case "end":
|
|
804
|
-
return _context17.stop();
|
|
805
|
-
}
|
|
647
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
648
|
+
case 0:
|
|
649
|
+
_mount18 = mount(TreeDemo), instance = _mount18[0], element = _mount18[1];
|
|
650
|
+
table = instance.$lastInput.children; // check all
|
|
651
|
+
checkbox = element.querySelector('.k-checkbox');
|
|
652
|
+
checkbox.click();
|
|
653
|
+
_context17.next = 6;
|
|
654
|
+
return wait();
|
|
655
|
+
case 6:
|
|
656
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
657
|
+
expect(table.getCheckedData()).to.have.lengthOf(8);
|
|
658
|
+
arrow = element.querySelector('.k-table-arrow');
|
|
659
|
+
arrow.click();
|
|
660
|
+
_context17.next = 12;
|
|
661
|
+
return wait();
|
|
662
|
+
case 12:
|
|
663
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
664
|
+
arrow.click();
|
|
665
|
+
_context17.next = 16;
|
|
666
|
+
return wait();
|
|
667
|
+
case 16:
|
|
668
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
669
|
+
expect(table.getCheckedData()).to.have.lengthOf(8);
|
|
670
|
+
case 18:
|
|
671
|
+
case "end":
|
|
672
|
+
return _context17.stop();
|
|
806
673
|
}
|
|
807
674
|
}, _callee17);
|
|
808
675
|
})));
|
|
809
676
|
it('should keep checked status of the disabled row', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee18() {
|
|
810
677
|
var _mount19, instance, element, checked, checkbox, _element$querySelecto10, checkbox2, checkbox4;
|
|
811
|
-
|
|
812
678
|
return _regeneratorRuntime.wrap(function _callee18$(_context18) {
|
|
813
|
-
while (1) {
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
case 19:
|
|
843
|
-
expect(checked.getAllCheckedStatus()).eql(AllCheckedStatus.All);
|
|
844
|
-
|
|
845
|
-
case 20:
|
|
846
|
-
case "end":
|
|
847
|
-
return _context18.stop();
|
|
848
|
-
}
|
|
679
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
680
|
+
case 0:
|
|
681
|
+
_mount19 = mount(DisabledDemo), instance = _mount19[0], element = _mount19[1];
|
|
682
|
+
checked = instance.$lastInput.children.checked;
|
|
683
|
+
checkbox = element.querySelector('.k-checkbox');
|
|
684
|
+
checkbox.click();
|
|
685
|
+
_context18.next = 6;
|
|
686
|
+
return wait();
|
|
687
|
+
case 6:
|
|
688
|
+
expect(instance.get('checkedKeys')).to.eql(['3', '2', '4']);
|
|
689
|
+
checkbox.click();
|
|
690
|
+
_context18.next = 10;
|
|
691
|
+
return wait();
|
|
692
|
+
case 10:
|
|
693
|
+
expect(instance.get('checkedKeys')).to.eql(['3']);
|
|
694
|
+
_element$querySelecto10 = element.querySelectorAll('.k-checkbox'), checkbox2 = _element$querySelecto10[2], checkbox4 = _element$querySelecto10[4];
|
|
695
|
+
checkbox2.click();
|
|
696
|
+
_context18.next = 15;
|
|
697
|
+
return wait();
|
|
698
|
+
case 15:
|
|
699
|
+
expect(checked.getAllCheckedStatus()).eql(AllCheckedStatus.Indeterminate);
|
|
700
|
+
checkbox4.click();
|
|
701
|
+
_context18.next = 19;
|
|
702
|
+
return wait();
|
|
703
|
+
case 19:
|
|
704
|
+
expect(checked.getAllCheckedStatus()).eql(AllCheckedStatus.All);
|
|
705
|
+
case 20:
|
|
706
|
+
case "end":
|
|
707
|
+
return _context18.stop();
|
|
849
708
|
}
|
|
850
709
|
}, _callee18);
|
|
851
710
|
})));
|
|
852
711
|
it('scroll to row', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee19() {
|
|
853
712
|
var _mount20, instance, element, table, scroll, tr, height, test;
|
|
854
|
-
|
|
855
713
|
return _regeneratorRuntime.wrap(function _callee19$(_context19) {
|
|
856
|
-
while (1) {
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
return table.scrollToRowByKey('name 2');
|
|
886
|
-
|
|
887
|
-
case 17:
|
|
888
|
-
test(1);
|
|
889
|
-
|
|
890
|
-
case 18:
|
|
891
|
-
case "end":
|
|
892
|
-
return _context19.stop();
|
|
893
|
-
}
|
|
714
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
715
|
+
case 0:
|
|
716
|
+
_mount20 = mount(ScrollToRowDemo), instance = _mount20[0], element = _mount20[1];
|
|
717
|
+
table = instance.refs.table;
|
|
718
|
+
scroll = element.querySelector('.k-table-wrapper');
|
|
719
|
+
tr = element.querySelector('tbody tr');
|
|
720
|
+
height = tr.offsetHeight;
|
|
721
|
+
test = function test(rows) {
|
|
722
|
+
expect(scroll.scrollTop).to.eql(height * rows);
|
|
723
|
+
};
|
|
724
|
+
_context19.next = 8;
|
|
725
|
+
return table.scrollToRowByIndex(2);
|
|
726
|
+
case 8:
|
|
727
|
+
test(2);
|
|
728
|
+
_context19.next = 11;
|
|
729
|
+
return table.scrollToRowByIndex(1);
|
|
730
|
+
case 11:
|
|
731
|
+
test(1);
|
|
732
|
+
_context19.next = 14;
|
|
733
|
+
return table.scrollToRowByKey('name 3');
|
|
734
|
+
case 14:
|
|
735
|
+
test(2);
|
|
736
|
+
_context19.next = 17;
|
|
737
|
+
return table.scrollToRowByKey('name 2');
|
|
738
|
+
case 17:
|
|
739
|
+
test(1);
|
|
740
|
+
case 18:
|
|
741
|
+
case "end":
|
|
742
|
+
return _context19.stop();
|
|
894
743
|
}
|
|
895
744
|
}, _callee19);
|
|
896
745
|
})));
|
|
897
746
|
it('render a hidden table with minWidth', function () {
|
|
898
747
|
var Demo = /*#__PURE__*/function (_Component) {
|
|
899
748
|
_inheritsLoose(Demo, _Component);
|
|
900
|
-
|
|
901
749
|
function Demo() {
|
|
902
750
|
var _context20;
|
|
903
|
-
|
|
904
751
|
var _this;
|
|
905
|
-
|
|
906
752
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
907
753
|
args[_key] = arguments[_key];
|
|
908
754
|
}
|
|
909
|
-
|
|
910
755
|
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context20 = [this]).call(_context20, args)) || this;
|
|
911
756
|
_this.Table = Table;
|
|
912
757
|
_this.TableColumn = TableColumn;
|
|
913
758
|
return _this;
|
|
914
759
|
}
|
|
915
|
-
|
|
916
760
|
return Demo;
|
|
917
761
|
}(Component);
|
|
918
|
-
|
|
919
762
|
Demo.template = "\n const {Table, TableColumn} = this;\n <div style=\"display: none;\">\n <Table>\n <TableColumn key=\"a\" minWidth={30} />\n </Table>\n </div>\n ";
|
|
920
|
-
|
|
921
763
|
var _mount21 = mount(Demo),
|
|
922
|
-
|
|
923
|
-
|
|
764
|
+
element = _mount21[1];
|
|
924
765
|
expect(element.innerHTML).to.matchSnapshot();
|
|
925
766
|
});
|
|
926
767
|
it('draggable', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee20() {
|
|
927
768
|
var _mount22, instance, element, _element$querySelecto11, tr1, tr2, _element$getBoundingC, top;
|
|
928
|
-
|
|
929
769
|
return _regeneratorRuntime.wrap(function _callee20$(_context21) {
|
|
930
|
-
while (1) {
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
case 9:
|
|
948
|
-
case "end":
|
|
949
|
-
return _context21.stop();
|
|
950
|
-
}
|
|
770
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
771
|
+
case 0:
|
|
772
|
+
_mount22 = mount(DraggableTable), instance = _mount22[0], element = _mount22[1];
|
|
773
|
+
_element$querySelecto11 = element.querySelectorAll('tbody tr'), tr1 = _element$querySelecto11[0], tr2 = _element$querySelecto11[1];
|
|
774
|
+
_element$getBoundingC = element.getBoundingClientRect(), top = _element$getBoundingC.top;
|
|
775
|
+
dispatchEvent(tr2, 'dragstart');
|
|
776
|
+
dispatchEvent(tr1, 'dragover', {
|
|
777
|
+
clientY: top + 41 + 20
|
|
778
|
+
});
|
|
779
|
+
dispatchEvent(tr2, 'dragend');
|
|
780
|
+
_context21.next = 8;
|
|
781
|
+
return wait(500);
|
|
782
|
+
case 8:
|
|
783
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
784
|
+
case 9:
|
|
785
|
+
case "end":
|
|
786
|
+
return _context21.stop();
|
|
951
787
|
}
|
|
952
788
|
}, _callee20);
|
|
953
789
|
})));
|
|
954
790
|
it('should not check all even though the keys is equal but the checkedKeys have some keys that not in rowKeys', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee21() {
|
|
955
791
|
var Demo, _mount23, instance, element, table, checked;
|
|
956
|
-
|
|
957
792
|
return _regeneratorRuntime.wrap(function _callee21$(_context23) {
|
|
958
|
-
while (1) {
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
Demo
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
var _this2;
|
|
968
|
-
|
|
969
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
970
|
-
args[_key2] = arguments[_key2];
|
|
971
|
-
}
|
|
972
|
-
|
|
973
|
-
_this2 = _Component2.call.apply(_Component2, _concatInstanceProperty(_context22 = [this]).call(_context22, args)) || this;
|
|
974
|
-
_this2.Table = Table;
|
|
975
|
-
_this2.TableColumn = TableColumn;
|
|
976
|
-
return _this2;
|
|
793
|
+
while (1) switch (_context23.prev = _context23.next) {
|
|
794
|
+
case 0:
|
|
795
|
+
Demo = /*#__PURE__*/function (_Component2) {
|
|
796
|
+
_inheritsLoose(Demo, _Component2);
|
|
797
|
+
function Demo() {
|
|
798
|
+
var _context22;
|
|
799
|
+
var _this2;
|
|
800
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
801
|
+
args[_key2] = arguments[_key2];
|
|
977
802
|
}
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
}
|
|
803
|
+
_this2 = _Component2.call.apply(_Component2, _concatInstanceProperty(_context22 = [this]).call(_context22, args)) || this;
|
|
804
|
+
_this2.Table = Table;
|
|
805
|
+
_this2.TableColumn = TableColumn;
|
|
806
|
+
return _this2;
|
|
807
|
+
}
|
|
808
|
+
Demo.defaults = function defaults() {
|
|
809
|
+
return {
|
|
810
|
+
data: [{
|
|
811
|
+
a: 1
|
|
812
|
+
}, {
|
|
813
|
+
a: 2
|
|
814
|
+
}],
|
|
815
|
+
checkedKeys: [3, 4]
|
|
988
816
|
};
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
case 20:
|
|
1021
|
-
case "end":
|
|
1022
|
-
return _context23.stop();
|
|
1023
|
-
}
|
|
817
|
+
};
|
|
818
|
+
return Demo;
|
|
819
|
+
}(Component);
|
|
820
|
+
Demo.template = "\n const {Table, TableColumn} = this;\n <Table v-model:checkedKeys=\"checkedKeys\"\n data={this.get('data')}\n rowKey={i => i.a}\n ref=\"table\"\n keepStatus={true}\n >\n <TableColumn key=\"a\" />\n </Table>\n ";
|
|
821
|
+
_mount23 = mount(Demo), instance = _mount23[0], element = _mount23[1];
|
|
822
|
+
table = instance.refs.table;
|
|
823
|
+
checked = table.checked;
|
|
824
|
+
expect(checked.getAllCheckedStatus()).to.eql(AllCheckedStatus.None);
|
|
825
|
+
table.checkAll();
|
|
826
|
+
expect(instance.get('checkedKeys')).to.eql([3, 4, 1, 2]);
|
|
827
|
+
table.uncheckAll();
|
|
828
|
+
expect(instance.get('checkedKeys')).to.eql([3, 4]);
|
|
829
|
+
instance.set('checkedKeys', [3, 4, 1]);
|
|
830
|
+
_context23.next = 13;
|
|
831
|
+
return wait();
|
|
832
|
+
case 13:
|
|
833
|
+
expect(checked.getAllCheckedStatus()).to.eql(AllCheckedStatus.Indeterminate);
|
|
834
|
+
table.checkAll();
|
|
835
|
+
expect(instance.get('checkedKeys')).to.eql([3, 4, 1, 2]);
|
|
836
|
+
// destroy one row
|
|
837
|
+
instance.set('data', [{
|
|
838
|
+
a: 1
|
|
839
|
+
}]);
|
|
840
|
+
_context23.next = 19;
|
|
841
|
+
return wait();
|
|
842
|
+
case 19:
|
|
843
|
+
expect(instance.get('checkedKeys')).to.eql([3, 4, 1, 2]);
|
|
844
|
+
case 20:
|
|
845
|
+
case "end":
|
|
846
|
+
return _context23.stop();
|
|
1024
847
|
}
|
|
1025
848
|
}, _callee21);
|
|
1026
849
|
})));
|
|
1027
850
|
it('should update children in TableCell', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee22() {
|
|
1028
851
|
var update, Test, Demo, _mount24, instance, element;
|
|
1029
|
-
|
|
1030
852
|
return _regeneratorRuntime.wrap(function _callee22$(_context25) {
|
|
1031
|
-
while (1) {
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
Demo = /*#__PURE__*/function (_Component4) {
|
|
1055
|
-
_inheritsLoose(Demo, _Component4);
|
|
1056
|
-
|
|
1057
|
-
function Demo() {
|
|
1058
|
-
var _context24;
|
|
1059
|
-
|
|
1060
|
-
var _this3;
|
|
1061
|
-
|
|
1062
|
-
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
1063
|
-
args[_key3] = arguments[_key3];
|
|
1064
|
-
}
|
|
1065
|
-
|
|
1066
|
-
_this3 = _Component4.call.apply(_Component4, _concatInstanceProperty(_context24 = [this]).call(_context24, args)) || this;
|
|
1067
|
-
_this3.Table = Table;
|
|
1068
|
-
_this3.TableColumn = TableColumn;
|
|
1069
|
-
_this3.Test = Test;
|
|
1070
|
-
return _this3;
|
|
853
|
+
while (1) switch (_context25.prev = _context25.next) {
|
|
854
|
+
case 0:
|
|
855
|
+
update = sinon.spy();
|
|
856
|
+
Test = /*#__PURE__*/function (_Component3) {
|
|
857
|
+
_inheritsLoose(Test, _Component3);
|
|
858
|
+
function Test() {
|
|
859
|
+
return _Component3.apply(this, arguments) || this;
|
|
860
|
+
}
|
|
861
|
+
var _proto = Test.prototype;
|
|
862
|
+
_proto.beforeUpdate = function beforeUpdate() {
|
|
863
|
+
update();
|
|
864
|
+
};
|
|
865
|
+
return Test;
|
|
866
|
+
}(Component);
|
|
867
|
+
Test.template = "<div>test</div>";
|
|
868
|
+
Demo = /*#__PURE__*/function (_Component4) {
|
|
869
|
+
_inheritsLoose(Demo, _Component4);
|
|
870
|
+
function Demo() {
|
|
871
|
+
var _context24;
|
|
872
|
+
var _this3;
|
|
873
|
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
874
|
+
args[_key3] = arguments[_key3];
|
|
1071
875
|
}
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
876
|
+
_this3 = _Component4.call.apply(_Component4, _concatInstanceProperty(_context24 = [this]).call(_context24, args)) || this;
|
|
877
|
+
_this3.Table = Table;
|
|
878
|
+
_this3.TableColumn = TableColumn;
|
|
879
|
+
_this3.Test = Test;
|
|
880
|
+
return _this3;
|
|
881
|
+
}
|
|
882
|
+
Demo.defaults = function defaults() {
|
|
883
|
+
return {
|
|
884
|
+
data: [{
|
|
885
|
+
a: 1
|
|
886
|
+
}, {
|
|
887
|
+
a: 2
|
|
888
|
+
}]
|
|
1081
889
|
};
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
case 10:
|
|
1096
|
-
case "end":
|
|
1097
|
-
return _context25.stop();
|
|
1098
|
-
}
|
|
890
|
+
};
|
|
891
|
+
return Demo;
|
|
892
|
+
}(Component);
|
|
893
|
+
Demo.template = "\n const {Table, TableColumn, Test} = this;\n <Table data={this.get('data')} ref=\"table\">\n <TableColumn key=\"a\">\n <b:template>\n <Test />\n </b:template>\n </TableColumn>\n </Table>\n ";
|
|
894
|
+
_mount24 = mount(Demo), instance = _mount24[0], element = _mount24[1];
|
|
895
|
+
element.querySelector('tbody tr').click();
|
|
896
|
+
_context25.next = 9;
|
|
897
|
+
return wait();
|
|
898
|
+
case 9:
|
|
899
|
+
expect(update.callCount).to.eql(1);
|
|
900
|
+
case 10:
|
|
901
|
+
case "end":
|
|
902
|
+
return _context25.stop();
|
|
1099
903
|
}
|
|
1100
904
|
}, _callee22);
|
|
1101
905
|
})));
|
|
1102
906
|
it('pagination', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee23() {
|
|
1103
907
|
var _mount25, instance, element, table, pagination, spy;
|
|
1104
|
-
|
|
1105
908
|
return _regeneratorRuntime.wrap(function _callee23$(_context26) {
|
|
1106
|
-
while (1) {
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
limit: 10
|
|
1169
|
-
});
|
|
1170
|
-
|
|
1171
|
-
case 33:
|
|
1172
|
-
case "end":
|
|
1173
|
-
return _context26.stop();
|
|
1174
|
-
}
|
|
909
|
+
while (1) switch (_context26.prev = _context26.next) {
|
|
910
|
+
case 0:
|
|
911
|
+
_mount25 = mount(PaginationDemo), instance = _mount25[0], element = _mount25[1];
|
|
912
|
+
table = instance.refs.table;
|
|
913
|
+
pagination = table.pagination.paginationRef;
|
|
914
|
+
spy = sinon.spy();
|
|
915
|
+
table.on('changePage', spy);
|
|
916
|
+
// check all
|
|
917
|
+
table.checkAll();
|
|
918
|
+
expect(table.getCheckedData()).to.have.length(10);
|
|
919
|
+
// next page
|
|
920
|
+
table.set('pagination', {
|
|
921
|
+
value: 2
|
|
922
|
+
});
|
|
923
|
+
table.trigger('$receive:pagination');
|
|
924
|
+
_context26.next = 11;
|
|
925
|
+
return wait();
|
|
926
|
+
case 11:
|
|
927
|
+
expect(table.getCheckedData()).to.have.length(0);
|
|
928
|
+
// check all again
|
|
929
|
+
table.checkAll();
|
|
930
|
+
expect(table.getCheckedData()).to.have.length(10);
|
|
931
|
+
// change limit
|
|
932
|
+
table.set('pagination', {
|
|
933
|
+
value: 1,
|
|
934
|
+
limit: 20
|
|
935
|
+
});
|
|
936
|
+
table.trigger('$receive:pagination');
|
|
937
|
+
_context26.next = 18;
|
|
938
|
+
return wait();
|
|
939
|
+
case 18:
|
|
940
|
+
expect(table.getCheckedData()).to.have.length(10);
|
|
941
|
+
// check all again
|
|
942
|
+
table.checkAll();
|
|
943
|
+
expect(table.getCheckedData()).to.have.length(20);
|
|
944
|
+
// change limit from pagination
|
|
945
|
+
pagination.value.set('limit', 10);
|
|
946
|
+
_context26.next = 24;
|
|
947
|
+
return wait();
|
|
948
|
+
case 24:
|
|
949
|
+
expect(table.getCheckedData()).to.have.length(10);
|
|
950
|
+
// FIXME: Pagination component should no trigger change event multiple times
|
|
951
|
+
// when we set value and limit at the same time
|
|
952
|
+
expect(spy.callCount).to.eql(4);
|
|
953
|
+
expect(spy.lastCall.lastArg).to.eql({
|
|
954
|
+
value: 1,
|
|
955
|
+
limit: 10
|
|
956
|
+
});
|
|
957
|
+
// change page from pagination
|
|
958
|
+
_context26.next = 29;
|
|
959
|
+
return wait();
|
|
960
|
+
case 29:
|
|
961
|
+
pagination.value.changePage(2);
|
|
962
|
+
expect(table.getCheckedData()).to.have.length(0);
|
|
963
|
+
expect(spy.callCount).to.eql(5);
|
|
964
|
+
expect(spy.lastCall.lastArg).to.eql({
|
|
965
|
+
value: 2,
|
|
966
|
+
limit: 10
|
|
967
|
+
});
|
|
968
|
+
case 33:
|
|
969
|
+
case "end":
|
|
970
|
+
return _context26.stop();
|
|
1175
971
|
}
|
|
1176
972
|
}, _callee23);
|
|
1177
973
|
})));
|