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