@king-design/react 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/README.md +22 -0
- package/__tests__/__snapshots__/React Demos.md +1769 -0
- package/__tests__/components/dropdown.spec.tsx +35 -0
- package/__tests__/index.ts +46 -0
- package/__tests__/karma.conf.js +52 -0
- package/__tests__/webpack.config.js +17 -0
- 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/package.json +51 -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
- package/tsconfig.json +3 -0
|
@@ -0,0 +1,553 @@
|
|
|
1
|
+
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
|
+
import _asyncToGenerator from "@babel/runtime-corejs3/helpers/asyncToGenerator";
|
|
3
|
+
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
|
|
4
|
+
import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js/instance/slice";
|
|
5
|
+
import _Array$from from "@babel/runtime-corejs3/core-js/array/from";
|
|
6
|
+
import _regeneratorRuntime from "@babel/runtime-corejs3/regenerator";
|
|
7
|
+
import StepDemo from '~/components/spinner/demos/step';
|
|
8
|
+
import PrecisionDemo from '~/components/spinner/demos/precision';
|
|
9
|
+
import { mount, unmount, dispatchEvent, wait, fakeError } from '../../test/utils';
|
|
10
|
+
import { Spinner } from '../spinner';
|
|
11
|
+
import { Component } from 'intact-react';
|
|
12
|
+
import FormatterDemo from '~/components/spinner/demos/formatter';
|
|
13
|
+
import ForceStepDemo from '~/components/spinner/demos/forceStep';
|
|
14
|
+
import DynamicStepDemo from '~/components/spinner/demos/dynamicStep';
|
|
15
|
+
describe('Spinner', function () {
|
|
16
|
+
afterEach(function () {
|
|
17
|
+
return unmount();
|
|
18
|
+
});
|
|
19
|
+
it('step/max/min test', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
20
|
+
var _mount, instance, element, _element$querySelecto, prev, next, input;
|
|
21
|
+
|
|
22
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
23
|
+
while (1) {
|
|
24
|
+
switch (_context.prev = _context.next) {
|
|
25
|
+
case 0:
|
|
26
|
+
_mount = mount(StepDemo), instance = _mount[0], element = _mount[1];
|
|
27
|
+
_element$querySelecto = element.querySelectorAll('.k-btn'), prev = _element$querySelecto[0], next = _element$querySelecto[1];
|
|
28
|
+
input = element.querySelector('.k-input-inner');
|
|
29
|
+
next.click();
|
|
30
|
+
_context.next = 6;
|
|
31
|
+
return wait();
|
|
32
|
+
|
|
33
|
+
case 6:
|
|
34
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
35
|
+
expect(input.value).to.eql('1.2');
|
|
36
|
+
prev.click();
|
|
37
|
+
_context.next = 11;
|
|
38
|
+
return wait();
|
|
39
|
+
|
|
40
|
+
case 11:
|
|
41
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
42
|
+
expect(input.value).to.eql('0');
|
|
43
|
+
input.value = '9.9';
|
|
44
|
+
dispatchEvent(input, 'change');
|
|
45
|
+
_context.next = 17;
|
|
46
|
+
return wait();
|
|
47
|
+
|
|
48
|
+
case 17:
|
|
49
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
50
|
+
expect(input.value).eql('9.9');
|
|
51
|
+
prev.click();
|
|
52
|
+
_context.next = 22;
|
|
53
|
+
return wait();
|
|
54
|
+
|
|
55
|
+
case 22:
|
|
56
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
57
|
+
expect(input.value).eql('8.7');
|
|
58
|
+
input.value = '19.9';
|
|
59
|
+
dispatchEvent(input, 'change');
|
|
60
|
+
_context.next = 28;
|
|
61
|
+
return wait();
|
|
62
|
+
|
|
63
|
+
case 28:
|
|
64
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
65
|
+
expect(input.value).eql('10');
|
|
66
|
+
input.value = 'x19.9'; // to make the _input eql 'x19.9', then lead change
|
|
67
|
+
|
|
68
|
+
dispatchEvent(input, 'input');
|
|
69
|
+
dispatchEvent(input, 'change');
|
|
70
|
+
_context.next = 35;
|
|
71
|
+
return wait();
|
|
72
|
+
|
|
73
|
+
case 35:
|
|
74
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
75
|
+
expect(input.value).to.eql('10');
|
|
76
|
+
input.value = '-10';
|
|
77
|
+
dispatchEvent(input, 'change');
|
|
78
|
+
_context.next = 41;
|
|
79
|
+
return wait();
|
|
80
|
+
|
|
81
|
+
case 41:
|
|
82
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
83
|
+
expect(input.value).to.eql('0'); // should not disable btns, when value is between min and max
|
|
84
|
+
|
|
85
|
+
input.value = '9.9';
|
|
86
|
+
dispatchEvent(input, 'change');
|
|
87
|
+
next.click();
|
|
88
|
+
_context.next = 48;
|
|
89
|
+
return wait();
|
|
90
|
+
|
|
91
|
+
case 48:
|
|
92
|
+
expect(input.value).to.eql('10');
|
|
93
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
94
|
+
input.value = '0.1';
|
|
95
|
+
dispatchEvent(input, 'change');
|
|
96
|
+
prev.click();
|
|
97
|
+
_context.next = 55;
|
|
98
|
+
return wait();
|
|
99
|
+
|
|
100
|
+
case 55:
|
|
101
|
+
expect(input.value).to.eql('0');
|
|
102
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
103
|
+
|
|
104
|
+
case 57:
|
|
105
|
+
case "end":
|
|
106
|
+
return _context.stop();
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}, _callee);
|
|
110
|
+
})));
|
|
111
|
+
it('precision', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
112
|
+
var _mount2, instance, element, _element$querySelecto2, spinner1, spinner2, input1, input2;
|
|
113
|
+
|
|
114
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
115
|
+
while (1) {
|
|
116
|
+
switch (_context2.prev = _context2.next) {
|
|
117
|
+
case 0:
|
|
118
|
+
_mount2 = mount(PrecisionDemo), instance = _mount2[0], element = _mount2[1];
|
|
119
|
+
_element$querySelecto2 = element.querySelectorAll('.k-spinner'), spinner1 = _element$querySelecto2[0], spinner2 = _element$querySelecto2[1];
|
|
120
|
+
input1 = spinner1.querySelector('.k-input-inner');
|
|
121
|
+
input1.value = '0.6';
|
|
122
|
+
dispatchEvent(input1, 'input');
|
|
123
|
+
dispatchEvent(input1, 'change');
|
|
124
|
+
_context2.next = 8;
|
|
125
|
+
return wait();
|
|
126
|
+
|
|
127
|
+
case 8:
|
|
128
|
+
expect(spinner1.innerHTML).to.matchSnapshot();
|
|
129
|
+
expect(input1.value).to.eql('1');
|
|
130
|
+
expect(instance.get('value1')).to.eql(1);
|
|
131
|
+
input2 = spinner2.querySelector('.k-input-inner'); // expect(input2.value).to.eql('0.0');
|
|
132
|
+
|
|
133
|
+
input2.value = '0.61';
|
|
134
|
+
dispatchEvent(input2, 'input');
|
|
135
|
+
dispatchEvent(input2, 'change');
|
|
136
|
+
_context2.next = 17;
|
|
137
|
+
return wait();
|
|
138
|
+
|
|
139
|
+
case 17:
|
|
140
|
+
expect(input2.value).to.eql('0.6');
|
|
141
|
+
|
|
142
|
+
case 18:
|
|
143
|
+
case "end":
|
|
144
|
+
return _context2.stop();
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}, _callee2);
|
|
148
|
+
})));
|
|
149
|
+
it('should change value as long as the input is valid', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
150
|
+
var _mount3, instance, element, input;
|
|
151
|
+
|
|
152
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
153
|
+
while (1) {
|
|
154
|
+
switch (_context3.prev = _context3.next) {
|
|
155
|
+
case 0:
|
|
156
|
+
_mount3 = mount(PrecisionDemo), instance = _mount3[0], element = _mount3[1];
|
|
157
|
+
input = element.querySelector('input');
|
|
158
|
+
input.value = '01';
|
|
159
|
+
dispatchEvent(input, 'input');
|
|
160
|
+
_context3.next = 6;
|
|
161
|
+
return wait();
|
|
162
|
+
|
|
163
|
+
case 6:
|
|
164
|
+
expect(instance.get('value1')).to.eql(1);
|
|
165
|
+
input.value = 'xx';
|
|
166
|
+
dispatchEvent(input, 'input');
|
|
167
|
+
_context3.next = 11;
|
|
168
|
+
return wait();
|
|
169
|
+
|
|
170
|
+
case 11:
|
|
171
|
+
expect(instance.get('value1')).to.eql(1);
|
|
172
|
+
input.value = '100';
|
|
173
|
+
dispatchEvent(input, 'input');
|
|
174
|
+
_context3.next = 16;
|
|
175
|
+
return wait();
|
|
176
|
+
|
|
177
|
+
case 16:
|
|
178
|
+
expect(instance.get('value1')).to.eql(10);
|
|
179
|
+
|
|
180
|
+
case 17:
|
|
181
|
+
case "end":
|
|
182
|
+
return _context3.stop();
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}, _callee3);
|
|
186
|
+
})));
|
|
187
|
+
it('should log error when max < min', function () {
|
|
188
|
+
var Demo = /*#__PURE__*/function (_Component) {
|
|
189
|
+
_inheritsLoose(Demo, _Component);
|
|
190
|
+
|
|
191
|
+
function Demo() {
|
|
192
|
+
var _context4;
|
|
193
|
+
|
|
194
|
+
var _this;
|
|
195
|
+
|
|
196
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
197
|
+
args[_key] = arguments[_key];
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context4 = [this]).call(_context4, args)) || this;
|
|
201
|
+
_this.Spinner = Spinner;
|
|
202
|
+
return _this;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
return Demo;
|
|
206
|
+
}(Component);
|
|
207
|
+
|
|
208
|
+
Demo.template = "\n const {Spinner} = this;\n <Spinner min={20}\n max={0}\n step={undefined}\n value={1}\n />\n ";
|
|
209
|
+
var test = fakeError();
|
|
210
|
+
|
|
211
|
+
var _mount4 = mount(Demo),
|
|
212
|
+
instance = _mount4[0],
|
|
213
|
+
element = _mount4[1];
|
|
214
|
+
|
|
215
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
216
|
+
test('[Spinner] min must less than or equal to max, but got min: 20 max: 0');
|
|
217
|
+
});
|
|
218
|
+
it('should format value', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
219
|
+
var _mount5, instance, element, _element$querySelecto3, input1, input2, increase, decrease;
|
|
220
|
+
|
|
221
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context5) {
|
|
222
|
+
while (1) {
|
|
223
|
+
switch (_context5.prev = _context5.next) {
|
|
224
|
+
case 0:
|
|
225
|
+
_mount5 = mount(FormatterDemo), instance = _mount5[0], element = _mount5[1];
|
|
226
|
+
_element$querySelecto3 = element.querySelectorAll('input'), input1 = _element$querySelecto3[0], input2 = _element$querySelecto3[1];
|
|
227
|
+
expect(input1.value).to.eql('¥1,000');
|
|
228
|
+
expect(input2.value).to.eql('增长率 78%'); // increase / decrease
|
|
229
|
+
|
|
230
|
+
increase = element.querySelector('.k-left');
|
|
231
|
+
increase.click();
|
|
232
|
+
_context5.next = 8;
|
|
233
|
+
return wait();
|
|
234
|
+
|
|
235
|
+
case 8:
|
|
236
|
+
expect(input1.value).to.eql('¥999');
|
|
237
|
+
decrease = element.querySelectorAll('.k-right')[1];
|
|
238
|
+
decrease.click();
|
|
239
|
+
_context5.next = 13;
|
|
240
|
+
return wait();
|
|
241
|
+
|
|
242
|
+
case 13:
|
|
243
|
+
expect(input2.value).to.eql('增长率 79%'); // input
|
|
244
|
+
|
|
245
|
+
input1.value = '9999';
|
|
246
|
+
dispatchEvent(input1, 'input');
|
|
247
|
+
dispatchEvent(input1, 'change');
|
|
248
|
+
_context5.next = 19;
|
|
249
|
+
return wait();
|
|
250
|
+
|
|
251
|
+
case 19:
|
|
252
|
+
expect(input1.value).to.eql('¥9,999');
|
|
253
|
+
expect(instance.get('money')).to.eql(9999);
|
|
254
|
+
input2.value = '99';
|
|
255
|
+
dispatchEvent(input2, 'input');
|
|
256
|
+
dispatchEvent(input1, 'change');
|
|
257
|
+
_context5.next = 26;
|
|
258
|
+
return wait();
|
|
259
|
+
|
|
260
|
+
case 26:
|
|
261
|
+
expect(input2.value).to.eql('99');
|
|
262
|
+
expect(instance.get('percent')).to.eql(99);
|
|
263
|
+
dispatchEvent(input2, 'change');
|
|
264
|
+
_context5.next = 31;
|
|
265
|
+
return wait();
|
|
266
|
+
|
|
267
|
+
case 31:
|
|
268
|
+
expect(input2.value).to.eql('增长率 99%');
|
|
269
|
+
|
|
270
|
+
case 32:
|
|
271
|
+
case "end":
|
|
272
|
+
return _context5.stop();
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}, _callee4);
|
|
276
|
+
})));
|
|
277
|
+
it('should trigger change event correctly', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
|
|
278
|
+
var onChange, Demo, _mount6, instance, element, increase, decrease, input;
|
|
279
|
+
|
|
280
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context7) {
|
|
281
|
+
while (1) {
|
|
282
|
+
switch (_context7.prev = _context7.next) {
|
|
283
|
+
case 0:
|
|
284
|
+
onChange = sinon.spy(function (v) {
|
|
285
|
+
return console.log(v);
|
|
286
|
+
});
|
|
287
|
+
|
|
288
|
+
Demo = /*#__PURE__*/function (_Component2) {
|
|
289
|
+
_inheritsLoose(Demo, _Component2);
|
|
290
|
+
|
|
291
|
+
function Demo() {
|
|
292
|
+
var _context6;
|
|
293
|
+
|
|
294
|
+
var _this2;
|
|
295
|
+
|
|
296
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
297
|
+
args[_key2] = arguments[_key2];
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
_this2 = _Component2.call.apply(_Component2, _concatInstanceProperty(_context6 = [this]).call(_context6, args)) || this;
|
|
301
|
+
_this2.Spinner = Spinner;
|
|
302
|
+
return _this2;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
var _proto = Demo.prototype;
|
|
306
|
+
|
|
307
|
+
_proto._onChange = function _onChange(v) {
|
|
308
|
+
onChange(v);
|
|
309
|
+
};
|
|
310
|
+
|
|
311
|
+
return Demo;
|
|
312
|
+
}(Component);
|
|
313
|
+
|
|
314
|
+
Demo.template = "\n const {Spinner} = this;\n <Spinner ev-change={this._onChange} />\n ";
|
|
315
|
+
_mount6 = mount(Demo), instance = _mount6[0], element = _mount6[1]; // increase / decrease
|
|
316
|
+
|
|
317
|
+
increase = element.querySelector('.k-left');
|
|
318
|
+
increase.click();
|
|
319
|
+
expect(onChange.callCount).to.eql(1);
|
|
320
|
+
expect(onChange.calledWith(-1)).to.be.true;
|
|
321
|
+
decrease = element.querySelector('.k-right');
|
|
322
|
+
decrease.click();
|
|
323
|
+
expect(onChange.callCount).to.eql(2);
|
|
324
|
+
expect(onChange.calledWith(0)).to.be.true;
|
|
325
|
+
input = element.querySelector('input');
|
|
326
|
+
dispatchEvent(input, 'focus');
|
|
327
|
+
input.value = '1';
|
|
328
|
+
dispatchEvent(input, 'input');
|
|
329
|
+
input.value = '12';
|
|
330
|
+
dispatchEvent(input, 'input');
|
|
331
|
+
dispatchEvent(input, 'change');
|
|
332
|
+
_context7.next = 21;
|
|
333
|
+
return wait();
|
|
334
|
+
|
|
335
|
+
case 21:
|
|
336
|
+
expect(onChange.callCount).to.eql(3);
|
|
337
|
+
expect(onChange.calledWith(12)).to.be.true;
|
|
338
|
+
|
|
339
|
+
case 23:
|
|
340
|
+
case "end":
|
|
341
|
+
return _context7.stop();
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
}, _callee5);
|
|
345
|
+
})));
|
|
346
|
+
it('should be min + step * n', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
|
|
347
|
+
var _mount7, instance, element, _element$querySelecto4, prev, next, input;
|
|
348
|
+
|
|
349
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context8) {
|
|
350
|
+
while (1) {
|
|
351
|
+
switch (_context8.prev = _context8.next) {
|
|
352
|
+
case 0:
|
|
353
|
+
_mount7 = mount(ForceStepDemo), instance = _mount7[0], element = _mount7[1];
|
|
354
|
+
_element$querySelecto4 = element.querySelectorAll('.k-btn'), prev = _element$querySelecto4[0], next = _element$querySelecto4[1];
|
|
355
|
+
input = element.querySelector('.k-input-inner');
|
|
356
|
+
input.value = '1';
|
|
357
|
+
dispatchEvent(input, 'change');
|
|
358
|
+
_context8.next = 7;
|
|
359
|
+
return wait();
|
|
360
|
+
|
|
361
|
+
case 7:
|
|
362
|
+
expect(instance.get('value1')).to.eql(1.2);
|
|
363
|
+
input.value = '9.9';
|
|
364
|
+
dispatchEvent(input, 'change');
|
|
365
|
+
_context8.next = 12;
|
|
366
|
+
return wait();
|
|
367
|
+
|
|
368
|
+
case 12:
|
|
369
|
+
expect(instance.get('value1')).to.eql(9.6);
|
|
370
|
+
input.value = '10';
|
|
371
|
+
dispatchEvent(input, 'change');
|
|
372
|
+
_context8.next = 17;
|
|
373
|
+
return wait();
|
|
374
|
+
|
|
375
|
+
case 17:
|
|
376
|
+
expect(instance.get('value1')).to.eql(10);
|
|
377
|
+
prev.click();
|
|
378
|
+
_context8.next = 21;
|
|
379
|
+
return wait();
|
|
380
|
+
|
|
381
|
+
case 21:
|
|
382
|
+
expect(instance.get('value1')).to.eql(8.4);
|
|
383
|
+
|
|
384
|
+
case 22:
|
|
385
|
+
case "end":
|
|
386
|
+
return _context8.stop();
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
}, _callee6);
|
|
390
|
+
})));
|
|
391
|
+
it('dynamic step', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
|
|
392
|
+
var _mount8, instance, element, btns, test, _test;
|
|
393
|
+
|
|
394
|
+
return _regeneratorRuntime.wrap(function _callee8$(_context11) {
|
|
395
|
+
while (1) {
|
|
396
|
+
switch (_context11.prev = _context11.next) {
|
|
397
|
+
case 0:
|
|
398
|
+
_test = function _test3() {
|
|
399
|
+
_test = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(index) {
|
|
400
|
+
var _context9;
|
|
401
|
+
|
|
402
|
+
var _ref8, prev, next, model;
|
|
403
|
+
|
|
404
|
+
return _regeneratorRuntime.wrap(function _callee7$(_context10) {
|
|
405
|
+
while (1) {
|
|
406
|
+
switch (_context10.prev = _context10.next) {
|
|
407
|
+
case 0:
|
|
408
|
+
_ref8 = index === 1 ? btns : _sliceInstanceProperty(_context9 = _Array$from(btns)).call(_context9, 2), prev = _ref8[0], next = _ref8[1];
|
|
409
|
+
model = "value" + index;
|
|
410
|
+
prev.click();
|
|
411
|
+
_context10.next = 5;
|
|
412
|
+
return wait();
|
|
413
|
+
|
|
414
|
+
case 5:
|
|
415
|
+
expect(instance.get(model)).to.eql(-1);
|
|
416
|
+
instance.set(model, -5);
|
|
417
|
+
_context10.next = 9;
|
|
418
|
+
return wait();
|
|
419
|
+
|
|
420
|
+
case 9:
|
|
421
|
+
prev.click();
|
|
422
|
+
_context10.next = 12;
|
|
423
|
+
return wait();
|
|
424
|
+
|
|
425
|
+
case 12:
|
|
426
|
+
expect(instance.get(model)).to.eql(-10);
|
|
427
|
+
next.click();
|
|
428
|
+
_context10.next = 16;
|
|
429
|
+
return wait();
|
|
430
|
+
|
|
431
|
+
case 16:
|
|
432
|
+
expect(instance.get(model)).to.eql(-5);
|
|
433
|
+
next.click();
|
|
434
|
+
_context10.next = 20;
|
|
435
|
+
return wait();
|
|
436
|
+
|
|
437
|
+
case 20:
|
|
438
|
+
expect(instance.get(model)).to.eql(-4);
|
|
439
|
+
instance.set(model, 5);
|
|
440
|
+
_context10.next = 24;
|
|
441
|
+
return wait();
|
|
442
|
+
|
|
443
|
+
case 24:
|
|
444
|
+
next.click();
|
|
445
|
+
_context10.next = 27;
|
|
446
|
+
return wait();
|
|
447
|
+
|
|
448
|
+
case 27:
|
|
449
|
+
expect(instance.get(model)).to.eql(10);
|
|
450
|
+
prev.click();
|
|
451
|
+
_context10.next = 31;
|
|
452
|
+
return wait();
|
|
453
|
+
|
|
454
|
+
case 31:
|
|
455
|
+
expect(instance.get(model)).to.eql(5);
|
|
456
|
+
prev.click();
|
|
457
|
+
_context10.next = 35;
|
|
458
|
+
return wait();
|
|
459
|
+
|
|
460
|
+
case 35:
|
|
461
|
+
expect(instance.get(model)).to.eql(4);
|
|
462
|
+
|
|
463
|
+
case 36:
|
|
464
|
+
case "end":
|
|
465
|
+
return _context10.stop();
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
}, _callee7);
|
|
469
|
+
}));
|
|
470
|
+
return _test.apply(this, arguments);
|
|
471
|
+
};
|
|
472
|
+
|
|
473
|
+
test = function _test2(_x) {
|
|
474
|
+
return _test.apply(this, arguments);
|
|
475
|
+
};
|
|
476
|
+
|
|
477
|
+
_mount8 = mount(DynamicStepDemo), instance = _mount8[0], element = _mount8[1];
|
|
478
|
+
btns = element.querySelectorAll('.k-btn');
|
|
479
|
+
_context11.next = 6;
|
|
480
|
+
return test(1);
|
|
481
|
+
|
|
482
|
+
case 6:
|
|
483
|
+
case "end":
|
|
484
|
+
return _context11.stop();
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
}, _callee8);
|
|
488
|
+
})));
|
|
489
|
+
it('should set correct value with dynamic step when min is not equal 0', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9() {
|
|
490
|
+
var Demo, _mount9, instance, element, _element$querySelecto5, prev, next;
|
|
491
|
+
|
|
492
|
+
return _regeneratorRuntime.wrap(function _callee9$(_context13) {
|
|
493
|
+
while (1) {
|
|
494
|
+
switch (_context13.prev = _context13.next) {
|
|
495
|
+
case 0:
|
|
496
|
+
Demo = /*#__PURE__*/function (_Component3) {
|
|
497
|
+
_inheritsLoose(Demo, _Component3);
|
|
498
|
+
|
|
499
|
+
function Demo() {
|
|
500
|
+
var _context12;
|
|
501
|
+
|
|
502
|
+
var _this3;
|
|
503
|
+
|
|
504
|
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
505
|
+
args[_key3] = arguments[_key3];
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
_this3 = _Component3.call.apply(_Component3, _concatInstanceProperty(_context12 = [this]).call(_context12, args)) || this;
|
|
509
|
+
_this3.Spinner = Spinner;
|
|
510
|
+
return _this3;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
Demo.defaults = function defaults() {
|
|
514
|
+
return {
|
|
515
|
+
value: 100
|
|
516
|
+
};
|
|
517
|
+
};
|
|
518
|
+
|
|
519
|
+
return Demo;
|
|
520
|
+
}(Component);
|
|
521
|
+
|
|
522
|
+
Demo.template = "const {Spinner} = this; <Spinner min={30}\n max={500}\n step={{100: 10, 500: 50}}\n v-model=\"value\"\n forceStep\n />";
|
|
523
|
+
_mount9 = mount(Demo), instance = _mount9[0], element = _mount9[1];
|
|
524
|
+
_element$querySelecto5 = element.querySelectorAll('.k-btn'), prev = _element$querySelecto5[0], next = _element$querySelecto5[1];
|
|
525
|
+
next.click();
|
|
526
|
+
_context13.next = 7;
|
|
527
|
+
return wait();
|
|
528
|
+
|
|
529
|
+
case 7:
|
|
530
|
+
expect(instance.get('value')).to.eql(150);
|
|
531
|
+
prev.click();
|
|
532
|
+
_context13.next = 11;
|
|
533
|
+
return wait();
|
|
534
|
+
|
|
535
|
+
case 11:
|
|
536
|
+
expect(instance.get('value')).to.eql(100);
|
|
537
|
+
prev.click();
|
|
538
|
+
_context13.next = 15;
|
|
539
|
+
return wait();
|
|
540
|
+
|
|
541
|
+
case 15:
|
|
542
|
+
expect(instance.get('value')).to.eql(90);
|
|
543
|
+
|
|
544
|
+
case 16:
|
|
545
|
+
case "end":
|
|
546
|
+
return _context13.stop();
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
}, _callee9);
|
|
550
|
+
})));
|
|
551
|
+
});
|
|
552
|
+
|
|
553
|
+
export {normalize} from 'intact-react';
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
2
|
+
import { createVNode as _$cv, className as _$cn, createUnknownComponentVNode as _$cc } from 'intact-react';
|
|
3
|
+
import { Button } from '../button';
|
|
4
|
+
import { Icon } from '../icon';
|
|
5
|
+
import { Input } from '../input';
|
|
6
|
+
import { getRestProps } from '../utils';
|
|
7
|
+
import { makeStyles } from './styles';
|
|
8
|
+
var _$tmp0 = {
|
|
9
|
+
'className': 'k-spinner-icon ion-ios-minus-empty'
|
|
10
|
+
};
|
|
11
|
+
var _$tmp1 = {
|
|
12
|
+
'className': 'k-spinner-icon ion-ios-arrow-down'
|
|
13
|
+
};
|
|
14
|
+
var _$tmp2 = {
|
|
15
|
+
'className': 'k-spinner-icon ion-ios-plus-empty'
|
|
16
|
+
};
|
|
17
|
+
var _$tmp3 = {
|
|
18
|
+
'className': 'k-spinner-icon ion-ios-arrow-up'
|
|
19
|
+
};
|
|
20
|
+
export default function ($props, $blocks, $__proto__) {
|
|
21
|
+
var _classNameObj;
|
|
22
|
+
|
|
23
|
+
$blocks || ($blocks = {});
|
|
24
|
+
$props || ($props = {});
|
|
25
|
+
var $this = this;
|
|
26
|
+
|
|
27
|
+
var _this$get = this.get(),
|
|
28
|
+
className = _this$get.className,
|
|
29
|
+
disabled = _this$get.disabled,
|
|
30
|
+
size = _this$get.size,
|
|
31
|
+
vertical = _this$get.vertical,
|
|
32
|
+
value = _this$get.value,
|
|
33
|
+
width = _this$get.width;
|
|
34
|
+
|
|
35
|
+
var classNameObj = (_classNameObj = {
|
|
36
|
+
'k-spinner': true,
|
|
37
|
+
'k-disabled': disabled
|
|
38
|
+
}, _classNameObj["k-" + size] = size !== 'default', _classNameObj[className] = className, _classNameObj['k-vertical'] = vertical, _classNameObj[makeStyles()] = true, _classNameObj);
|
|
39
|
+
var _this$change = this.change,
|
|
40
|
+
decrease = _this$change.decrease,
|
|
41
|
+
increase = _this$change.increase,
|
|
42
|
+
changeValue = _this$change.changeValue,
|
|
43
|
+
onFocusin = _this$change.onFocusin;
|
|
44
|
+
return _$cv('div', _extends({
|
|
45
|
+
'className': _$cn(classNameObj)
|
|
46
|
+
}, getRestProps(this)), [_$cc(Button, {
|
|
47
|
+
'icon': true,
|
|
48
|
+
'ev-click': decrease,
|
|
49
|
+
'disabled': this.isDisabledDecrease(),
|
|
50
|
+
'className': 'k-spinner-btn k-left',
|
|
51
|
+
'size': size,
|
|
52
|
+
'children': !vertical ? _$cc(Icon, _$tmp0) : _$cc(Icon, _$tmp1)
|
|
53
|
+
}), _$cc(Input, {
|
|
54
|
+
'className': 'k-spinner-input',
|
|
55
|
+
'disabled': disabled,
|
|
56
|
+
'ev-change': changeValue,
|
|
57
|
+
'ev-focusin': onFocusin,
|
|
58
|
+
'value': this.value.showValue.value,
|
|
59
|
+
'ev-input': this.onInput,
|
|
60
|
+
'size': size,
|
|
61
|
+
'width': width
|
|
62
|
+
}), _$cc(Button, {
|
|
63
|
+
'icon': true,
|
|
64
|
+
'ev-click': increase,
|
|
65
|
+
'disabled': this.isDisabledIncrease(),
|
|
66
|
+
'className': 'k-spinner-btn k-right',
|
|
67
|
+
'size': size,
|
|
68
|
+
'children': !vertical ? _$cc(Icon, _$tmp2) : _$cc(Icon, _$tmp3)
|
|
69
|
+
})]);
|
|
70
|
+
}
|
|
71
|
+
;
|
|
72
|
+
|
|
73
|
+
export {normalize} from 'intact-react';
|