@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,267 @@
|
|
|
1
|
+
import _asyncToGenerator from "@babel/runtime-corejs3/helpers/asyncToGenerator";
|
|
2
|
+
import _regeneratorRuntime from "@babel/runtime-corejs3/regenerator";
|
|
3
|
+
import BasicDemo from '~/components/switch/demos/basic';
|
|
4
|
+
import ValueDemo from '~/components/switch/demos/value';
|
|
5
|
+
import WidthHeightDemo from '~/components/switch/demos/widthHeight';
|
|
6
|
+
import { mount, unmount, dispatchEvent, wait } from '../../test/utils';
|
|
7
|
+
describe('Switch', function () {
|
|
8
|
+
afterEach(function () {
|
|
9
|
+
unmount();
|
|
10
|
+
});
|
|
11
|
+
it('change value by clicking', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
12
|
+
var _mount, instance, element, _element$querySelecto, el, disabledEl, handle;
|
|
13
|
+
|
|
14
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
15
|
+
while (1) {
|
|
16
|
+
switch (_context.prev = _context.next) {
|
|
17
|
+
case 0:
|
|
18
|
+
_mount = mount(BasicDemo), instance = _mount[0], element = _mount[1];
|
|
19
|
+
_element$querySelecto = element.querySelectorAll('.k-switch'), el = _element$querySelecto[0], disabledEl = _element$querySelecto[1];
|
|
20
|
+
el.click();
|
|
21
|
+
_context.next = 5;
|
|
22
|
+
return wait();
|
|
23
|
+
|
|
24
|
+
case 5:
|
|
25
|
+
expect(element.outerHTML).to.matchSnapshot();
|
|
26
|
+
expect(instance.get('value')).to.be.true;
|
|
27
|
+
el.click();
|
|
28
|
+
_context.next = 10;
|
|
29
|
+
return wait();
|
|
30
|
+
|
|
31
|
+
case 10:
|
|
32
|
+
expect(element.outerHTML).to.matchSnapshot();
|
|
33
|
+
expect(instance.get('value')).to.be.false;
|
|
34
|
+
handle = element.querySelector('.k-switch-handle');
|
|
35
|
+
handle.click();
|
|
36
|
+
_context.next = 16;
|
|
37
|
+
return wait();
|
|
38
|
+
|
|
39
|
+
case 16:
|
|
40
|
+
expect(instance.get('value')).to.be.false;
|
|
41
|
+
disabledEl.click();
|
|
42
|
+
_context.next = 20;
|
|
43
|
+
return wait();
|
|
44
|
+
|
|
45
|
+
case 20:
|
|
46
|
+
expect(element.outerHTML).to.matchSnapshot();
|
|
47
|
+
|
|
48
|
+
case 21:
|
|
49
|
+
case "end":
|
|
50
|
+
return _context.stop();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}, _callee);
|
|
54
|
+
})));
|
|
55
|
+
it('change value by draging', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
56
|
+
var _mount2, instance, element, _element$querySelecto2, el, disabledEl;
|
|
57
|
+
|
|
58
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
59
|
+
while (1) {
|
|
60
|
+
switch (_context2.prev = _context2.next) {
|
|
61
|
+
case 0:
|
|
62
|
+
_mount2 = mount(BasicDemo), instance = _mount2[0], element = _mount2[1];
|
|
63
|
+
_element$querySelecto2 = element.querySelectorAll('.k-switch-handle'), el = _element$querySelecto2[0], disabledEl = _element$querySelecto2[1];
|
|
64
|
+
dispatchEvent(el, 'mousedown', {
|
|
65
|
+
which: 1,
|
|
66
|
+
clientX: 0
|
|
67
|
+
});
|
|
68
|
+
dispatchEvent(document, 'mousemove', {
|
|
69
|
+
clientX: 1
|
|
70
|
+
});
|
|
71
|
+
_context2.next = 6;
|
|
72
|
+
return wait();
|
|
73
|
+
|
|
74
|
+
case 6:
|
|
75
|
+
expect(element.outerHTML).to.matchSnapshot(); // cancel this operation if the distance less than half of width
|
|
76
|
+
|
|
77
|
+
dispatchEvent(document, 'mouseup', {
|
|
78
|
+
clientX: 1
|
|
79
|
+
});
|
|
80
|
+
_context2.next = 10;
|
|
81
|
+
return wait();
|
|
82
|
+
|
|
83
|
+
case 10:
|
|
84
|
+
expect(element.outerHTML).to.matchSnapshot();
|
|
85
|
+
expect(instance.get('value')).to.be.false;
|
|
86
|
+
dispatchEvent(el, 'mousedown', {
|
|
87
|
+
which: 1,
|
|
88
|
+
clientX: 0
|
|
89
|
+
});
|
|
90
|
+
dispatchEvent(document, 'mousemove', {
|
|
91
|
+
clientX: 30
|
|
92
|
+
});
|
|
93
|
+
dispatchEvent(document, 'mouseup', {
|
|
94
|
+
clientX: 30
|
|
95
|
+
});
|
|
96
|
+
_context2.next = 17;
|
|
97
|
+
return wait();
|
|
98
|
+
|
|
99
|
+
case 17:
|
|
100
|
+
expect(element.outerHTML).to.matchSnapshot();
|
|
101
|
+
expect(instance.get('value')).to.be.true;
|
|
102
|
+
dispatchEvent(el, 'mousedown', {
|
|
103
|
+
which: 1,
|
|
104
|
+
clientX: 0
|
|
105
|
+
});
|
|
106
|
+
dispatchEvent(document, 'mousemove', {
|
|
107
|
+
clientX: -30
|
|
108
|
+
});
|
|
109
|
+
dispatchEvent(document, 'mouseup', {
|
|
110
|
+
clientX: -30
|
|
111
|
+
});
|
|
112
|
+
_context2.next = 24;
|
|
113
|
+
return wait();
|
|
114
|
+
|
|
115
|
+
case 24:
|
|
116
|
+
expect(instance.get('value')).to.be.false; // treat mousedown -> mouseup as click
|
|
117
|
+
|
|
118
|
+
dispatchEvent(el, 'mousedown', {
|
|
119
|
+
which: 1,
|
|
120
|
+
clientX: 0
|
|
121
|
+
});
|
|
122
|
+
dispatchEvent(document, 'mouseup', {
|
|
123
|
+
clientX: 0
|
|
124
|
+
});
|
|
125
|
+
_context2.next = 29;
|
|
126
|
+
return wait();
|
|
127
|
+
|
|
128
|
+
case 29:
|
|
129
|
+
expect(instance.get('value')).to.be.true; // disabled
|
|
130
|
+
|
|
131
|
+
dispatchEvent(disabledEl, 'mousedown', {
|
|
132
|
+
which: 1,
|
|
133
|
+
clientX: 0
|
|
134
|
+
});
|
|
135
|
+
dispatchEvent(document, 'mousemove', {
|
|
136
|
+
clientX: 30
|
|
137
|
+
});
|
|
138
|
+
dispatchEvent(document, 'mouseup', {
|
|
139
|
+
clientX: 30
|
|
140
|
+
});
|
|
141
|
+
_context2.next = 35;
|
|
142
|
+
return wait();
|
|
143
|
+
|
|
144
|
+
case 35:
|
|
145
|
+
expect(element.outerHTML).to.matchSnapshot();
|
|
146
|
+
|
|
147
|
+
case 36:
|
|
148
|
+
case "end":
|
|
149
|
+
return _context2.stop();
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}, _callee2);
|
|
153
|
+
})));
|
|
154
|
+
it('drag switch which has custom width and height', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
155
|
+
var _mount3, instance, element, _element$querySelecto3, el;
|
|
156
|
+
|
|
157
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
158
|
+
while (1) {
|
|
159
|
+
switch (_context3.prev = _context3.next) {
|
|
160
|
+
case 0:
|
|
161
|
+
_mount3 = mount(WidthHeightDemo), instance = _mount3[0], element = _mount3[1];
|
|
162
|
+
_element$querySelecto3 = element.querySelectorAll('.k-switch-handle'), el = _element$querySelecto3[2];
|
|
163
|
+
dispatchEvent(el, 'mousedown', {
|
|
164
|
+
which: 1,
|
|
165
|
+
clientX: 0
|
|
166
|
+
});
|
|
167
|
+
dispatchEvent(document, 'mousemove', {
|
|
168
|
+
clientX: 50
|
|
169
|
+
});
|
|
170
|
+
dispatchEvent(document, 'mouseup', {
|
|
171
|
+
clientX: 50
|
|
172
|
+
});
|
|
173
|
+
_context3.next = 7;
|
|
174
|
+
return wait();
|
|
175
|
+
|
|
176
|
+
case 7:
|
|
177
|
+
expect(element.outerHTML).to.matchSnapshot();
|
|
178
|
+
dispatchEvent(el, 'mousedown', {
|
|
179
|
+
which: 1,
|
|
180
|
+
clientX: 0
|
|
181
|
+
});
|
|
182
|
+
dispatchEvent(document, 'mousemove', {
|
|
183
|
+
clientX: -50
|
|
184
|
+
});
|
|
185
|
+
dispatchEvent(document, 'mouseup', {
|
|
186
|
+
clientX: -50
|
|
187
|
+
});
|
|
188
|
+
_context3.next = 13;
|
|
189
|
+
return wait();
|
|
190
|
+
|
|
191
|
+
case 13:
|
|
192
|
+
expect(element.outerHTML).to.matchSnapshot();
|
|
193
|
+
|
|
194
|
+
case 14:
|
|
195
|
+
case "end":
|
|
196
|
+
return _context3.stop();
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}, _callee3);
|
|
200
|
+
})));
|
|
201
|
+
it('change value by keypress', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
202
|
+
var _mount4, instance, element, el;
|
|
203
|
+
|
|
204
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
205
|
+
while (1) {
|
|
206
|
+
switch (_context4.prev = _context4.next) {
|
|
207
|
+
case 0:
|
|
208
|
+
_mount4 = mount(BasicDemo), instance = _mount4[0], element = _mount4[1];
|
|
209
|
+
el = element.querySelector('.k-switch');
|
|
210
|
+
dispatchEvent(el, 'keypress', {
|
|
211
|
+
keyCode: 13
|
|
212
|
+
});
|
|
213
|
+
_context4.next = 5;
|
|
214
|
+
return wait();
|
|
215
|
+
|
|
216
|
+
case 5:
|
|
217
|
+
expect(instance.get('value')).to.be.true;
|
|
218
|
+
dispatchEvent(el, 'keypress', {
|
|
219
|
+
keyCode: 13
|
|
220
|
+
});
|
|
221
|
+
_context4.next = 9;
|
|
222
|
+
return wait();
|
|
223
|
+
|
|
224
|
+
case 9:
|
|
225
|
+
expect(instance.get('value')).to.be.false;
|
|
226
|
+
|
|
227
|
+
case 10:
|
|
228
|
+
case "end":
|
|
229
|
+
return _context4.stop();
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}, _callee4);
|
|
233
|
+
})));
|
|
234
|
+
it('custom the value', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
|
|
235
|
+
var _mount5, instance, element, _element$querySelecto4, el1, el2;
|
|
236
|
+
|
|
237
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
238
|
+
while (1) {
|
|
239
|
+
switch (_context5.prev = _context5.next) {
|
|
240
|
+
case 0:
|
|
241
|
+
_mount5 = mount(ValueDemo), instance = _mount5[0], element = _mount5[1];
|
|
242
|
+
_element$querySelecto4 = element.querySelectorAll('.k-switch'), el1 = _element$querySelecto4[0], el2 = _element$querySelecto4[1];
|
|
243
|
+
el1.click();
|
|
244
|
+
el2.click();
|
|
245
|
+
_context5.next = 6;
|
|
246
|
+
return wait();
|
|
247
|
+
|
|
248
|
+
case 6:
|
|
249
|
+
expect(element.outerHTML).to.matchSnapshot();
|
|
250
|
+
el1.click();
|
|
251
|
+
el2.click();
|
|
252
|
+
_context5.next = 11;
|
|
253
|
+
return wait();
|
|
254
|
+
|
|
255
|
+
case 11:
|
|
256
|
+
expect(element.outerHTML).to.matchSnapshot();
|
|
257
|
+
|
|
258
|
+
case 12:
|
|
259
|
+
case "end":
|
|
260
|
+
return _context5.stop();
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}, _callee5);
|
|
264
|
+
})));
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
export {normalize} from 'intact-vue-next';
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
2
|
+
import _Object$assign from "@babel/runtime-corejs3/core-js/object/assign";
|
|
3
|
+
import { createVNode as _$cv, className as _$cn, createElementVNode as _$ce, isChecked as _$isc, linkEvent as _$le, setCheckboxModel as _$scm, noop as _$no } from 'intact-vue-next';
|
|
4
|
+
import { makeStyles } from './styles';
|
|
5
|
+
import { addStyle, getRestProps } from '../utils';
|
|
6
|
+
var _$tmp0 = {
|
|
7
|
+
'src': 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'
|
|
8
|
+
};
|
|
9
|
+
export default function ($props, $blocks, $__proto__) {
|
|
10
|
+
var _classNameObj;
|
|
11
|
+
|
|
12
|
+
$blocks || ($blocks = {});
|
|
13
|
+
$props || ($props = {});
|
|
14
|
+
var $this = this;
|
|
15
|
+
var _$blocks = {};
|
|
16
|
+
var __$blocks = {};
|
|
17
|
+
|
|
18
|
+
var _this$get = this.get(),
|
|
19
|
+
className = _this$get.className,
|
|
20
|
+
style = _this$get.style,
|
|
21
|
+
name = _this$get.name,
|
|
22
|
+
on = _this$get.on,
|
|
23
|
+
off = _this$get.off,
|
|
24
|
+
value = _this$get.value,
|
|
25
|
+
trueValue = _this$get.trueValue,
|
|
26
|
+
falseValue = _this$get.falseValue,
|
|
27
|
+
width = _this$get.width,
|
|
28
|
+
height = _this$get.height,
|
|
29
|
+
size = _this$get.size,
|
|
30
|
+
disabled = _this$get.disabled;
|
|
31
|
+
|
|
32
|
+
var _this$draggable = this.draggable,
|
|
33
|
+
start = _this$draggable.start,
|
|
34
|
+
dragging = _this$draggable.dragging,
|
|
35
|
+
barRef = _this$draggable.barRef,
|
|
36
|
+
barWidth = _this$draggable.barWidth;
|
|
37
|
+
var classNameObj = (_classNameObj = {
|
|
38
|
+
'k-switch': true
|
|
39
|
+
}, _classNameObj[className] = className, _classNameObj['k-checked'] = value === trueValue, _classNameObj["k-" + size] = true, _classNameObj['k-disabled'] = disabled, _classNameObj['k-dragging'] = dragging.value, _classNameObj[makeStyles()] = true, _classNameObj);
|
|
40
|
+
var onStyle;
|
|
41
|
+
var offStyle;
|
|
42
|
+
var barStyle;
|
|
43
|
+
|
|
44
|
+
if (width || height) {
|
|
45
|
+
var _style = {};
|
|
46
|
+
onStyle = {};
|
|
47
|
+
offStyle = {};
|
|
48
|
+
|
|
49
|
+
if (width) {
|
|
50
|
+
_style.width = width + "px";
|
|
51
|
+
onStyle.width = _style.width;
|
|
52
|
+
offStyle.width = _style.width;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (height) {
|
|
56
|
+
_style.height = height + "px";
|
|
57
|
+
|
|
58
|
+
_Object$assign(onStyle, {
|
|
59
|
+
height: _style.height,
|
|
60
|
+
lineHeight: _style.height,
|
|
61
|
+
padding: "0 " + _style.height + " 0 " + height / 3 + "px"
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
_Object$assign(offStyle, {
|
|
65
|
+
height: _style.height,
|
|
66
|
+
lineHeight: _style.height,
|
|
67
|
+
padding: "0 " + height / 3 + "px 0 " + _style.height
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
barStyle = {
|
|
71
|
+
width: value === trueValue ? '100%' : height + "px"
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
style = addStyle(style, _style);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if (barWidth.value) {
|
|
79
|
+
barStyle = addStyle(barStyle, {
|
|
80
|
+
width: barWidth.value + 'px'
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return _$cv('div', _extends({
|
|
85
|
+
'className': _$cn(classNameObj)
|
|
86
|
+
}, getRestProps(this), {
|
|
87
|
+
'style': style,
|
|
88
|
+
'ev-click': this.onClick,
|
|
89
|
+
'tabindex': disabled ? "-1" : "0",
|
|
90
|
+
'ev-keypress': this.onKeypress,
|
|
91
|
+
'ref': this.elementRef
|
|
92
|
+
}), [_$ce(64, 'input', null, 1, null, {
|
|
93
|
+
'type': 'checkbox',
|
|
94
|
+
'name': name,
|
|
95
|
+
'disabled': disabled,
|
|
96
|
+
'trueValue': trueValue,
|
|
97
|
+
'falseValue': falseValue,
|
|
98
|
+
'tabindex': '-1',
|
|
99
|
+
'$model:value': 'value',
|
|
100
|
+
'checked': _$isc($this.get('value'), trueValue),
|
|
101
|
+
'ev-$model:change': _$le($this, _$scm)
|
|
102
|
+
}), off || $blocks.off ? _$ce(2, 'div', (_$blocks['off'] = function ($super) {
|
|
103
|
+
return off;
|
|
104
|
+
}, __$blocks['off'] = function ($super, data) {
|
|
105
|
+
var block = $blocks['off'];
|
|
106
|
+
|
|
107
|
+
var callBlock = function callBlock() {
|
|
108
|
+
return _$blocks['off'].call($this, $super, data);
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
return block ? block.call($this, callBlock, data) : callBlock();
|
|
112
|
+
}, __$blocks['off'](_$no)), 0, 'k-switch-off', {
|
|
113
|
+
'style': offStyle
|
|
114
|
+
}) : undefined, _$ce(2, 'div', [on || $blocks.on ? _$ce(2, 'div', (_$blocks['on'] = function ($super) {
|
|
115
|
+
return on;
|
|
116
|
+
}, __$blocks['on'] = function ($super, data) {
|
|
117
|
+
var block = $blocks['on'];
|
|
118
|
+
|
|
119
|
+
var callBlock = function callBlock() {
|
|
120
|
+
return _$blocks['on'].call($this, $super, data);
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
return block ? block.call($this, callBlock, data) : callBlock();
|
|
124
|
+
}, __$blocks['on'](_$no)), 0, 'k-switch-on', {
|
|
125
|
+
'style': onStyle
|
|
126
|
+
}) : undefined, _$ce(2, 'div', _$ce(2, 'div', _$ce(2, 'img', null, 1, null, _$tmp0), 2, 'k-switch-handle', {
|
|
127
|
+
'ev-click': this.onClickOnHandle,
|
|
128
|
+
'ev-mousedown': start
|
|
129
|
+
}), 2, 'k-switch-wrapper')], 0, 'k-switch-bar', {
|
|
130
|
+
'style': barStyle
|
|
131
|
+
}, null, barRef)]);
|
|
132
|
+
}
|
|
133
|
+
;
|
|
134
|
+
|
|
135
|
+
export {normalize} from 'intact-vue-next';
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js/instance/map";
|
|
2
|
+
import { css } from '@emotion/css';
|
|
3
|
+
import { theme, setDefault } from '../../styles/theme';
|
|
4
|
+
import { deepDefaults, sizes } from '../../styles/utils';
|
|
5
|
+
import '../../styles/global';
|
|
6
|
+
var defaults = {
|
|
7
|
+
bgColor: "#fff",
|
|
8
|
+
fontSize: "12px",
|
|
9
|
+
|
|
10
|
+
get color() {
|
|
11
|
+
return theme.color.text;
|
|
12
|
+
},
|
|
13
|
+
|
|
14
|
+
checkedBgColor: "#fff",
|
|
15
|
+
handleBorderRadius: "100%",
|
|
16
|
+
|
|
17
|
+
get handleBgColor() {
|
|
18
|
+
return theme.color.border;
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
get border() {
|
|
22
|
+
return "1px solid " + theme.color.border;
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
// checked
|
|
26
|
+
checked: {
|
|
27
|
+
get borderColor() {
|
|
28
|
+
return theme.color.primary;
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
get color() {
|
|
32
|
+
return theme.color.primary;
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
get bgColor() {
|
|
36
|
+
return theme.color.primary;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
},
|
|
40
|
+
// default
|
|
41
|
+
default: {
|
|
42
|
+
width: "36px",
|
|
43
|
+
height: "18px",
|
|
44
|
+
padding: "2px"
|
|
45
|
+
},
|
|
46
|
+
// large
|
|
47
|
+
large: {
|
|
48
|
+
width: "52px",
|
|
49
|
+
height: "26px",
|
|
50
|
+
padding: "2px"
|
|
51
|
+
},
|
|
52
|
+
// small
|
|
53
|
+
small: {
|
|
54
|
+
width: "32px",
|
|
55
|
+
height: "16px",
|
|
56
|
+
padding: "2px"
|
|
57
|
+
},
|
|
58
|
+
// mini
|
|
59
|
+
mini: {
|
|
60
|
+
width: "24px",
|
|
61
|
+
height: "12px",
|
|
62
|
+
padding: "1px"
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
// disabled
|
|
66
|
+
get disabledBgColor() {
|
|
67
|
+
return theme.color.disabledBg;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
};
|
|
71
|
+
var kswitch;
|
|
72
|
+
setDefault(function () {
|
|
73
|
+
kswitch = deepDefaults(theme, {
|
|
74
|
+
switch: defaults
|
|
75
|
+
}).switch;
|
|
76
|
+
});
|
|
77
|
+
export function makeStyles() {
|
|
78
|
+
return /*#__PURE__*/css("display:inline-block;vertical-align:middle;background:", kswitch.bgColor, ";position:relative;cursor:pointer;user-select:none;overflow:hidden;border:", kswitch.border, ";box-sizing:content-box;input{opacity:0;position:absolute;}.k-switch-bar,.k-switch-off{box-sizing:border-box;}.k-switch-bar{position:absolute;text-align:right;overflow:hidden;}.k-switch-wrapper{display:inline-block;position:relative;z-index:1;border-radius:", kswitch.handleBorderRadius, ";}.k-switch-bar,.k-switch-wrapper{height:100%;background:", kswitch.bgColor, ";transition:all ", theme.transition, ";}.k-switch-handle{border-radius:", kswitch.handleBorderRadius, ";background:", kswitch.handleBgColor, ";height:100%;cursor:pointer;transition:left ", theme.transition, ";display:inline-block;img{height:100%;visibility:hidden;}}.k-switch-on,.k-switch-off{position:absolute;font-size:", kswitch.fontSize, ";color:", kswitch.color, ";text-align:center;}&.k-dragging{.k-switch-bar,.k-switch-wrapper{background:", kswitch.checkedBgColor, ";transition:background ", theme.transition, ";}}&:focus{outline:none;border-color:", kswitch.checked.borderColor, ";}", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
79
|
+
var _kswitch$size = kswitch[size],
|
|
80
|
+
width = _kswitch$size.width,
|
|
81
|
+
height = _kswitch$size.height,
|
|
82
|
+
padding = _kswitch$size.padding;
|
|
83
|
+
return /*#__PURE__*/css("&.k-", size, ",&.k-", size, " .k-switch-on,&.k-", size, " .k-switch-off{width:", width, ";height:", height, ";}&.k-", size, "{border-radius:", height, ";.k-switch-bar{width:", height, ";border-radius:", height, ";}.k-switch-wrapper{padding:", padding, ";}.k-switch-on,.k-switch-off{line-height:", height, ";left:0;}.k-switch-on{padding:0 ", height, " 0 calc(", height, " / 3);}.k-switch-off{padding:0 calc(", height, " / 3) 0 ", height, ";}}");
|
|
84
|
+
}), "&.k-checked{border-color:", kswitch.checked.borderColor, ";.k-switch-on{color:", kswitch.checked.color, ";}.k-switch-handle{background:", kswitch.checked.bgColor, ";}.k-switch-bar,.k-switch-wrapper{background:", kswitch.checkedBgColor, ";}.k-switch-bar{width:100%;}}&.k-disabled{background:", kswitch.disabledBgColor, ";cursor:not-allowed;.k-switch-bar,.k-switch-wrapper{background:", kswitch.disabledBgColor, ";}}&:not(.k-checked){.k-switch-bar,.k-switch-wrapper{border-top-right-radius:0;border-bottom-right-radius:0;}}");
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export {normalize} from 'intact-vue-next';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RefObject } from 'intact-vue-next';
|
|
2
|
+
export declare function useDraggable(elementRef: RefObject<HTMLElement>): {
|
|
3
|
+
start: (e: MouseEvent) => void;
|
|
4
|
+
dragging: import("../../hooks/useState").State<boolean>;
|
|
5
|
+
barRef: RefObject<HTMLElement>;
|
|
6
|
+
barWidth: import("../../hooks/useState").State<number | null>;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
export {normalize} from 'intact-vue-next';
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { useInstance, createRef } from 'intact-vue-next';
|
|
2
|
+
import { useDraggable as useBaseDraggable } from '../../hooks/useDraggable';
|
|
3
|
+
import { useState } from '../../hooks/useState';
|
|
4
|
+
export function useDraggable(elementRef) {
|
|
5
|
+
var instance = useInstance();
|
|
6
|
+
var barRef = createRef();
|
|
7
|
+
var barWidth = useState(null);
|
|
8
|
+
var x;
|
|
9
|
+
var height;
|
|
10
|
+
var width;
|
|
11
|
+
var maxWidth;
|
|
12
|
+
|
|
13
|
+
function onStart(e) {
|
|
14
|
+
if (instance.get('disabled')) return;
|
|
15
|
+
x = e.clientX;
|
|
16
|
+
height = barRef.value.clientHeight;
|
|
17
|
+
width = barRef.value.clientWidth;
|
|
18
|
+
maxWidth = elementRef.value.clientWidth;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function onMove(e) {
|
|
22
|
+
var left = e.clientX - x;
|
|
23
|
+
var newWidth = Math.min(Math.max(height, width + left), maxWidth);
|
|
24
|
+
barWidth.set(newWidth);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function onEnd(e) {
|
|
28
|
+
// unmounted
|
|
29
|
+
if (!e) return;
|
|
30
|
+
elementRef.value.blur(); // treat mousedown -> mouseup as click
|
|
31
|
+
|
|
32
|
+
if (x === e.clientX) {
|
|
33
|
+
barWidth.set(null);
|
|
34
|
+
instance.toggle(false);
|
|
35
|
+
} else {
|
|
36
|
+
// cancel this operation if the distance less than half of width
|
|
37
|
+
var percent = (barWidth.value - height / 2) / maxWidth;
|
|
38
|
+
|
|
39
|
+
if (!instance.isChecked()) {
|
|
40
|
+
if (percent >= 0.5) {
|
|
41
|
+
instance.check();
|
|
42
|
+
}
|
|
43
|
+
} else if (percent < 0.5) {
|
|
44
|
+
instance.uncheck();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
var _instance$get = instance.get(),
|
|
48
|
+
_width = _instance$get.width,
|
|
49
|
+
_height = _instance$get.height;
|
|
50
|
+
|
|
51
|
+
if (!instance.isChecked() && _width && _height) {
|
|
52
|
+
barWidth.set(+_height);
|
|
53
|
+
} else {
|
|
54
|
+
barWidth.set(null);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
var _useBaseDraggable = useBaseDraggable({
|
|
60
|
+
onStart: onStart,
|
|
61
|
+
onMove: onMove,
|
|
62
|
+
onEnd: onEnd
|
|
63
|
+
}),
|
|
64
|
+
start = _useBaseDraggable.start,
|
|
65
|
+
dragging = _useBaseDraggable.dragging;
|
|
66
|
+
|
|
67
|
+
return {
|
|
68
|
+
start: start,
|
|
69
|
+
dragging: dragging,
|
|
70
|
+
barRef: barRef,
|
|
71
|
+
barWidth: barWidth
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export {normalize} from 'intact-vue-next';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Component, Props, VNodeComponentClass, IntactDom } from 'intact-vue-next';
|
|
2
|
+
import type { TableColumnProps } from './column';
|
|
3
|
+
import type { TableProps } from './table';
|
|
4
|
+
import type { TableGrid } from './useMerge';
|
|
5
|
+
export interface TableCellProps {
|
|
6
|
+
props: Props<TableColumnProps>;
|
|
7
|
+
columnIndex: number;
|
|
8
|
+
rowIndex: number;
|
|
9
|
+
data: any;
|
|
10
|
+
offset: number;
|
|
11
|
+
checkType: TableProps['checkType'];
|
|
12
|
+
indent: number;
|
|
13
|
+
grid: TableGrid;
|
|
14
|
+
colspan: number;
|
|
15
|
+
rowspan: number;
|
|
16
|
+
onClickArrow: (e: MouseEvent) => void;
|
|
17
|
+
hasChildren: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare class TableCell extends Component<TableCellProps> {
|
|
20
|
+
static template: string | import("intact").Template<any>;
|
|
21
|
+
$update(lastVNode: VNodeComponentClass<this>, nextVNode: VNodeComponentClass<this>, parentDom: Element, anchor: IntactDom | null, mountedQueue: Function[], force: boolean): void;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
export {normalize} from 'intact-vue-next';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
|
+
import { Component } from 'intact-vue-next';
|
|
3
|
+
import template from './cell.vdt';
|
|
4
|
+
export var TableCell = /*#__PURE__*/function (_Component) {
|
|
5
|
+
_inheritsLoose(TableCell, _Component);
|
|
6
|
+
|
|
7
|
+
function TableCell() {
|
|
8
|
+
return _Component.apply(this, arguments) || this;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
var _proto = TableCell.prototype;
|
|
12
|
+
|
|
13
|
+
_proto.$update = function $update(lastVNode, nextVNode, parentDom, anchor, mountedQueue, force) {
|
|
14
|
+
var lastProps = lastVNode.props;
|
|
15
|
+
var nextProps = nextVNode.props;
|
|
16
|
+
var isSame = true;
|
|
17
|
+
|
|
18
|
+
for (var key in lastProps) {
|
|
19
|
+
if (lastProps[key] !== nextProps[key]) {
|
|
20
|
+
isSame = false;
|
|
21
|
+
break;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (!isSame) {
|
|
26
|
+
_Component.prototype.$update.call(this, lastVNode, nextVNode, parentDom, anchor, mountedQueue, force);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
return TableCell;
|
|
31
|
+
}(Component);
|
|
32
|
+
TableCell.template = template;
|
|
33
|
+
|
|
34
|
+
export {normalize} from 'intact-vue-next';
|