@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,425 @@
|
|
|
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 _regeneratorRuntime from "@babel/runtime-corejs3/regenerator";
|
|
5
|
+
import BasicDemo from '~/components/timepicker/demos/basic';
|
|
6
|
+
import RangeDemo from '~/components/timepicker/demos/range';
|
|
7
|
+
import StepDemo from '~/components/timepicker/demos/step';
|
|
8
|
+
import StepRangeDemo from '~/components/timepicker/demos/stepRange';
|
|
9
|
+
import FormatDemo from '~/components/timepicker/demos/format';
|
|
10
|
+
import { mount, unmount, dispatchEvent, getElement, wait } from '../../test/utils';
|
|
11
|
+
import { Timepicker } from 'kpc';
|
|
12
|
+
import { Component } from 'intact-vue-next';
|
|
13
|
+
describe('Timepicker', function () {
|
|
14
|
+
afterEach( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
15
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
16
|
+
while (1) {
|
|
17
|
+
switch (_context.prev = _context.next) {
|
|
18
|
+
case 0:
|
|
19
|
+
unmount();
|
|
20
|
+
_context.next = 3;
|
|
21
|
+
return wait(400);
|
|
22
|
+
|
|
23
|
+
case 3:
|
|
24
|
+
case "end":
|
|
25
|
+
return _context.stop();
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}, _callee);
|
|
29
|
+
})));
|
|
30
|
+
it('select time', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
31
|
+
var _mount, instance, element, _element$querySelecto, picker1, picker2, dropdown, next, ok, ok2, _picker2$querySelecto, close;
|
|
32
|
+
|
|
33
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
34
|
+
while (1) {
|
|
35
|
+
switch (_context2.prev = _context2.next) {
|
|
36
|
+
case 0:
|
|
37
|
+
_mount = mount(BasicDemo), instance = _mount[0], element = _mount[1];
|
|
38
|
+
_element$querySelecto = element.querySelectorAll('.k-select'), picker1 = _element$querySelecto[0], picker2 = _element$querySelecto[1];
|
|
39
|
+
picker1.click();
|
|
40
|
+
_context2.next = 5;
|
|
41
|
+
return wait(300);
|
|
42
|
+
|
|
43
|
+
case 5:
|
|
44
|
+
dropdown = getElement('.k-time-content');
|
|
45
|
+
expect(dropdown.innerHTML).to.matchSnapshot();
|
|
46
|
+
next = dropdown.querySelector('.k-scroll-select-item:nth-child(11)');
|
|
47
|
+
next.click();
|
|
48
|
+
_context2.next = 11;
|
|
49
|
+
return wait();
|
|
50
|
+
|
|
51
|
+
case 11:
|
|
52
|
+
expect(dropdown.innerHTML).to.matchSnapshot();
|
|
53
|
+
expect(instance.get('time')).to.be.null;
|
|
54
|
+
next.click();
|
|
55
|
+
_context2.next = 16;
|
|
56
|
+
return wait();
|
|
57
|
+
|
|
58
|
+
case 16:
|
|
59
|
+
expect(instance.get('time')).to.be.null;
|
|
60
|
+
expect(dropdown.innerHTML).to.matchSnapshot();
|
|
61
|
+
ok = dropdown.querySelector('.k-btn');
|
|
62
|
+
ok.click();
|
|
63
|
+
_context2.next = 22;
|
|
64
|
+
return wait(300);
|
|
65
|
+
|
|
66
|
+
case 22:
|
|
67
|
+
expect(instance.get('time')).to.eql('02:00:00');
|
|
68
|
+
expect(dropdown.style.display).to.eql('none'); // set time
|
|
69
|
+
|
|
70
|
+
instance.set('time', '03:03:03');
|
|
71
|
+
picker1.click();
|
|
72
|
+
_context2.next = 28;
|
|
73
|
+
return wait(300);
|
|
74
|
+
|
|
75
|
+
case 28:
|
|
76
|
+
expect(dropdown.innerHTML).to.matchSnapshot(); // multiple
|
|
77
|
+
|
|
78
|
+
picker2.click();
|
|
79
|
+
_context2.next = 32;
|
|
80
|
+
return wait(300);
|
|
81
|
+
|
|
82
|
+
case 32:
|
|
83
|
+
dropdown = getElement('.k-time-content');
|
|
84
|
+
dropdown.querySelector('.k-scroll-select-item:nth-child(11)').click();
|
|
85
|
+
ok2 = dropdown.querySelector('.k-btn');
|
|
86
|
+
ok2.click();
|
|
87
|
+
dropdown.querySelector('.k-scroll-select-item:nth-child(12)').click();
|
|
88
|
+
ok2.click();
|
|
89
|
+
_context2.next = 40;
|
|
90
|
+
return wait();
|
|
91
|
+
|
|
92
|
+
case 40:
|
|
93
|
+
expect(instance.get('timeArray')).to.eql(['01:00:00', '02:00:00']); // click the same time will do nothing
|
|
94
|
+
|
|
95
|
+
ok2.click();
|
|
96
|
+
_context2.next = 44;
|
|
97
|
+
return wait();
|
|
98
|
+
|
|
99
|
+
case 44:
|
|
100
|
+
expect(instance.get('timeArray')).to.eql(['01:00:00', '02:00:00']); // remove one value
|
|
101
|
+
|
|
102
|
+
_picker2$querySelecto = picker2.querySelectorAll('.k-select-close'), close = _picker2$querySelecto[1];
|
|
103
|
+
close.click();
|
|
104
|
+
_context2.next = 49;
|
|
105
|
+
return wait();
|
|
106
|
+
|
|
107
|
+
case 49:
|
|
108
|
+
expect(instance.get('timeArray')).to.eql(['01:00:00']);
|
|
109
|
+
expect(dropdown.innerHTML).to.matchSnapshot(); // clear
|
|
110
|
+
|
|
111
|
+
picker2.querySelector('.k-select-clear').click();
|
|
112
|
+
_context2.next = 54;
|
|
113
|
+
return wait();
|
|
114
|
+
|
|
115
|
+
case 54:
|
|
116
|
+
expect(instance.get('timeArray')).to.eql([]);
|
|
117
|
+
ok2.click();
|
|
118
|
+
_context2.next = 58;
|
|
119
|
+
return wait();
|
|
120
|
+
|
|
121
|
+
case 58:
|
|
122
|
+
expect(instance.get('timeArray')).to.eql(['00:00:00']); // set value
|
|
123
|
+
|
|
124
|
+
instance.set('timeArray', ['03:03:03', '03:03:04']);
|
|
125
|
+
_context2.next = 62;
|
|
126
|
+
return wait();
|
|
127
|
+
|
|
128
|
+
case 62:
|
|
129
|
+
expect(dropdown.innerHTML).to.matchSnapshot();
|
|
130
|
+
|
|
131
|
+
case 63:
|
|
132
|
+
case "end":
|
|
133
|
+
return _context2.stop();
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}, _callee2);
|
|
137
|
+
})));
|
|
138
|
+
it('range', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
139
|
+
var _mount2, instance, element, picker, dropdown, _dropdown$querySelect, start, end;
|
|
140
|
+
|
|
141
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
142
|
+
while (1) {
|
|
143
|
+
switch (_context3.prev = _context3.next) {
|
|
144
|
+
case 0:
|
|
145
|
+
_mount2 = mount(RangeDemo), instance = _mount2[0], element = _mount2[1];
|
|
146
|
+
picker = element.querySelector('.k-select');
|
|
147
|
+
picker.click();
|
|
148
|
+
_context3.next = 5;
|
|
149
|
+
return wait(300);
|
|
150
|
+
|
|
151
|
+
case 5:
|
|
152
|
+
dropdown = getElement('.k-time-content');
|
|
153
|
+
expect(dropdown.innerHTML).to.matchSnapshot();
|
|
154
|
+
_dropdown$querySelect = dropdown.querySelectorAll('.k-datepicker-calendar-wrapper'), start = _dropdown$querySelect[0], end = _dropdown$querySelect[1];
|
|
155
|
+
start.querySelector('.k-active').nextElementSibling.click();
|
|
156
|
+
_context3.next = 11;
|
|
157
|
+
return wait();
|
|
158
|
+
|
|
159
|
+
case 11:
|
|
160
|
+
expect(dropdown.innerHTML).to.matchSnapshot();
|
|
161
|
+
end.querySelector('.k-active').nextElementSibling.nextElementSibling.click();
|
|
162
|
+
_context3.next = 15;
|
|
163
|
+
return wait();
|
|
164
|
+
|
|
165
|
+
case 15:
|
|
166
|
+
expect(dropdown.innerHTML).to.matchSnapshot();
|
|
167
|
+
dropdown.querySelector('.k-btn').click();
|
|
168
|
+
_context3.next = 19;
|
|
169
|
+
return wait();
|
|
170
|
+
|
|
171
|
+
case 19:
|
|
172
|
+
expect(instance.get('time')).to.eql(['01:00:00', '02:00:00']);
|
|
173
|
+
|
|
174
|
+
case 20:
|
|
175
|
+
case "end":
|
|
176
|
+
return _context3.stop();
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}, _callee3);
|
|
180
|
+
})));
|
|
181
|
+
it('step', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
182
|
+
var _mount3, instance, element, picker, dropdown;
|
|
183
|
+
|
|
184
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
185
|
+
while (1) {
|
|
186
|
+
switch (_context4.prev = _context4.next) {
|
|
187
|
+
case 0:
|
|
188
|
+
_mount3 = mount(StepDemo), instance = _mount3[0], element = _mount3[1];
|
|
189
|
+
picker = element.querySelector('.k-select');
|
|
190
|
+
picker.click();
|
|
191
|
+
_context4.next = 5;
|
|
192
|
+
return wait();
|
|
193
|
+
|
|
194
|
+
case 5:
|
|
195
|
+
dropdown = getElement('.k-select-menu');
|
|
196
|
+
expect(dropdown.innerHTML).to.matchSnapshot();
|
|
197
|
+
dropdown.querySelector('.k-select-option').click();
|
|
198
|
+
expect(instance.get('time')).to.eql('00:00:00');
|
|
199
|
+
|
|
200
|
+
case 9:
|
|
201
|
+
case "end":
|
|
202
|
+
return _context4.stop();
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}, _callee4);
|
|
206
|
+
})));
|
|
207
|
+
it('step range', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
|
|
208
|
+
var _mount4, instance, element, picker, dropdown, _dropdown$querySelect2, start, end;
|
|
209
|
+
|
|
210
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
211
|
+
while (1) {
|
|
212
|
+
switch (_context5.prev = _context5.next) {
|
|
213
|
+
case 0:
|
|
214
|
+
_mount4 = mount(StepRangeDemo), instance = _mount4[0], element = _mount4[1];
|
|
215
|
+
picker = element.querySelector('.k-select');
|
|
216
|
+
picker.click();
|
|
217
|
+
_context5.next = 5;
|
|
218
|
+
return wait();
|
|
219
|
+
|
|
220
|
+
case 5:
|
|
221
|
+
dropdown = getElement('.k-time-content');
|
|
222
|
+
expect(dropdown.innerHTML).to.matchSnapshot();
|
|
223
|
+
_dropdown$querySelect2 = dropdown.querySelectorAll('.k-datepicker-calendar-wrapper'), start = _dropdown$querySelect2[0], end = _dropdown$querySelect2[1];
|
|
224
|
+
start.querySelector('.k-active').nextElementSibling.click();
|
|
225
|
+
_context5.next = 11;
|
|
226
|
+
return wait();
|
|
227
|
+
|
|
228
|
+
case 11:
|
|
229
|
+
expect(dropdown.innerHTML).to.matchSnapshot();
|
|
230
|
+
end.querySelector('.k-active').nextElementSibling.click();
|
|
231
|
+
_context5.next = 15;
|
|
232
|
+
return wait();
|
|
233
|
+
|
|
234
|
+
case 15:
|
|
235
|
+
expect(dropdown.innerHTML).to.matchSnapshot();
|
|
236
|
+
dropdown.querySelector('.k-btn').click();
|
|
237
|
+
expect(instance.get('time')).to.eql(['00:30:00', '00:30:00']);
|
|
238
|
+
|
|
239
|
+
case 18:
|
|
240
|
+
case "end":
|
|
241
|
+
return _context5.stop();
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}, _callee5);
|
|
245
|
+
})));
|
|
246
|
+
it('format', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
|
|
247
|
+
var _mount5, instance, element, _element$querySelecto2, input1, input2, input3, content, _content$querySelecto, scroll1, scroll2;
|
|
248
|
+
|
|
249
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
250
|
+
while (1) {
|
|
251
|
+
switch (_context6.prev = _context6.next) {
|
|
252
|
+
case 0:
|
|
253
|
+
_mount5 = mount(FormatDemo), instance = _mount5[0], element = _mount5[1];
|
|
254
|
+
_element$querySelecto2 = element.querySelectorAll('.k-select'), input1 = _element$querySelecto2[0], input2 = _element$querySelecto2[1], input3 = _element$querySelecto2[2];
|
|
255
|
+
input1.click();
|
|
256
|
+
_context6.next = 5;
|
|
257
|
+
return wait();
|
|
258
|
+
|
|
259
|
+
case 5:
|
|
260
|
+
content = getElement('.k-time-content');
|
|
261
|
+
expect(content.innerHTML).to.matchSnapshot(); // is '02'
|
|
262
|
+
|
|
263
|
+
content.querySelector('.k-scroll-select-item:nth-child(12)').click();
|
|
264
|
+
_context6.next = 10;
|
|
265
|
+
return wait();
|
|
266
|
+
|
|
267
|
+
case 10:
|
|
268
|
+
content.querySelector('.k-btn').click();
|
|
269
|
+
_context6.next = 13;
|
|
270
|
+
return wait();
|
|
271
|
+
|
|
272
|
+
case 13:
|
|
273
|
+
expect(instance.get('time1')).to.eql('02:00 am');
|
|
274
|
+
expect(input1.innerHTML).to.matchSnapshot();
|
|
275
|
+
input2.click();
|
|
276
|
+
_context6.next = 18;
|
|
277
|
+
return wait();
|
|
278
|
+
|
|
279
|
+
case 18:
|
|
280
|
+
content = getElement('.k-select-menu');
|
|
281
|
+
expect(content.innerHTML).to.matchSnapshot();
|
|
282
|
+
content.querySelector('.k-select-option').click();
|
|
283
|
+
_context6.next = 23;
|
|
284
|
+
return wait();
|
|
285
|
+
|
|
286
|
+
case 23:
|
|
287
|
+
expect(instance.get('time2')).to.eql('00:00:00');
|
|
288
|
+
expect(input2.innerHTML).to.matchSnapshot();
|
|
289
|
+
input3.click();
|
|
290
|
+
_context6.next = 28;
|
|
291
|
+
return wait();
|
|
292
|
+
|
|
293
|
+
case 28:
|
|
294
|
+
content = getElement('.k-time-content');
|
|
295
|
+
expect(content.innerHTML).to.matchSnapshot();
|
|
296
|
+
_content$querySelecto = content.querySelectorAll('.k-scroll-select'), scroll1 = _content$querySelecto[0], scroll2 = _content$querySelecto[1];
|
|
297
|
+
scroll1.querySelector('.k-scroll-select-item:nth-child(11)').click();
|
|
298
|
+
scroll2.querySelector('.k-scroll-select-item:nth-child(12)').click();
|
|
299
|
+
_context6.next = 35;
|
|
300
|
+
return wait();
|
|
301
|
+
|
|
302
|
+
case 35:
|
|
303
|
+
expect(content.innerHTML).to.matchSnapshot();
|
|
304
|
+
content.querySelector('.k-btn').click();
|
|
305
|
+
_context6.next = 39;
|
|
306
|
+
return wait();
|
|
307
|
+
|
|
308
|
+
case 39:
|
|
309
|
+
expect(instance.get('time3')).eql(['00:30:00.000', '01:00:00.000']);
|
|
310
|
+
expect(input3.innerHTML).to.matchSnapshot();
|
|
311
|
+
|
|
312
|
+
case 41:
|
|
313
|
+
case "end":
|
|
314
|
+
return _context6.stop();
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}, _callee6);
|
|
318
|
+
})));
|
|
319
|
+
it('can input', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
|
|
320
|
+
var Demo, _mount6, instance, element, _element$querySelecto3, basicInput, multipleInput, rangeInput, formatInput, input;
|
|
321
|
+
|
|
322
|
+
return _regeneratorRuntime.wrap(function _callee8$(_context9) {
|
|
323
|
+
while (1) {
|
|
324
|
+
switch (_context9.prev = _context9.next) {
|
|
325
|
+
case 0:
|
|
326
|
+
Demo = /*#__PURE__*/function (_Component) {
|
|
327
|
+
_inheritsLoose(Demo, _Component);
|
|
328
|
+
|
|
329
|
+
function Demo() {
|
|
330
|
+
var _context7;
|
|
331
|
+
|
|
332
|
+
var _this;
|
|
333
|
+
|
|
334
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
335
|
+
args[_key] = arguments[_key];
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context7 = [this]).call(_context7, args)) || this;
|
|
339
|
+
_this.Timepicker = Timepicker;
|
|
340
|
+
return _this;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
return Demo;
|
|
344
|
+
}(Component);
|
|
345
|
+
|
|
346
|
+
Demo.template = "\n const {Timepicker} = this;\n <div>\n <Timepicker v-model=\"basic\" min=\"01:34:56\" max=\"15:02:59\" />\n <Timepicker v-model=\"multiple\" multiple />\n <Timepicker v-model=\"range\" range min=\"01:34:56\" max=\"15:02:59\" />\n <Timepicker v-model=\"format\" range step=\"00:30:00\" valueFormat=\"HH:mm:ss.SSS\" showFormat=\"HH:mm\"/>\n </div>\n ";
|
|
347
|
+
_mount6 = mount(Demo), instance = _mount6[0], element = _mount6[1];
|
|
348
|
+
_element$querySelecto3 = element.querySelectorAll('.k-input-inner'), basicInput = _element$querySelecto3[0], multipleInput = _element$querySelecto3[1], rangeInput = _element$querySelecto3[2], formatInput = _element$querySelecto3[3];
|
|
349
|
+
|
|
350
|
+
input = /*#__PURE__*/function () {
|
|
351
|
+
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(_input, value) {
|
|
352
|
+
return _regeneratorRuntime.wrap(function _callee7$(_context8) {
|
|
353
|
+
while (1) {
|
|
354
|
+
switch (_context8.prev = _context8.next) {
|
|
355
|
+
case 0:
|
|
356
|
+
_input.value = value;
|
|
357
|
+
dispatchEvent(_input, 'input');
|
|
358
|
+
_context8.next = 4;
|
|
359
|
+
return wait();
|
|
360
|
+
|
|
361
|
+
case 4:
|
|
362
|
+
case "end":
|
|
363
|
+
return _context8.stop();
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}, _callee7);
|
|
367
|
+
}));
|
|
368
|
+
|
|
369
|
+
return function input(_x, _x2) {
|
|
370
|
+
return _ref8.apply(this, arguments);
|
|
371
|
+
};
|
|
372
|
+
}(); // input disabled value
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
_context9.next = 7;
|
|
376
|
+
return input(basicInput, '01:01:01');
|
|
377
|
+
|
|
378
|
+
case 7:
|
|
379
|
+
expect(instance.get('basic')).to.eql(undefined); // input correct value
|
|
380
|
+
|
|
381
|
+
_context9.next = 10;
|
|
382
|
+
return input(basicInput, '03:03:03');
|
|
383
|
+
|
|
384
|
+
case 10:
|
|
385
|
+
expect(instance.get('basic')).to.eql('03:03:03'); // input multple values
|
|
386
|
+
|
|
387
|
+
_context9.next = 13;
|
|
388
|
+
return input(multipleInput, '01:01:01');
|
|
389
|
+
|
|
390
|
+
case 13:
|
|
391
|
+
expect(instance.get('multiple')).to.eql(['01:01:01']);
|
|
392
|
+
_context9.next = 16;
|
|
393
|
+
return input(multipleInput, '02:02:02');
|
|
394
|
+
|
|
395
|
+
case 16:
|
|
396
|
+
expect(instance.get('multiple')).to.eql(['01:01:01', '02:02:02']); // input disabled range value
|
|
397
|
+
|
|
398
|
+
_context9.next = 19;
|
|
399
|
+
return input(rangeInput, '01:01:01~05:05:05');
|
|
400
|
+
|
|
401
|
+
case 19:
|
|
402
|
+
expect(instance.get('range')).to.eql(undefined); // input correct range value
|
|
403
|
+
|
|
404
|
+
_context9.next = 22;
|
|
405
|
+
return input(rangeInput, '03:03:03~05:05:05');
|
|
406
|
+
|
|
407
|
+
case 22:
|
|
408
|
+
expect(instance.get('range')).to.eql(['03:03:03', '05:05:05']); // input correct formated value
|
|
409
|
+
|
|
410
|
+
_context9.next = 25;
|
|
411
|
+
return input(formatInput, '01:00~02:00');
|
|
412
|
+
|
|
413
|
+
case 25:
|
|
414
|
+
expect(instance.get('format')).to.eql(['01:00:00.000', '02:00:00.000']);
|
|
415
|
+
|
|
416
|
+
case 26:
|
|
417
|
+
case "end":
|
|
418
|
+
return _context9.stop();
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
}, _callee8);
|
|
422
|
+
})));
|
|
423
|
+
});
|
|
424
|
+
|
|
425
|
+
export {normalize} from 'intact-vue-next';
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { TypeDefs } from 'intact-vue-next';
|
|
2
|
+
import { BasePicker } from '../datepicker/basepicker';
|
|
3
|
+
import dayjs from '../datepicker/dayjs';
|
|
4
|
+
import { State } from '../../hooks/useState';
|
|
5
|
+
import { PanelTypes } from '../datepicker/usePanel';
|
|
6
|
+
import { TimepickerProps, TimepickerEvents, TimepickerBlocks } from './constants';
|
|
7
|
+
export declare class PanelPicker<Multipe extends boolean = false, Range extends boolean = false> extends BasePicker<TimepickerProps<Multipe, Range>, TimepickerEvents, TimepickerBlocks> {
|
|
8
|
+
static template: string | import("intact").Template<any>;
|
|
9
|
+
static typeDefs: Required<TypeDefs<TimepickerProps<boolean, boolean>>>;
|
|
10
|
+
formats: {
|
|
11
|
+
getValueFormat: () => string;
|
|
12
|
+
getShowFormat: () => string;
|
|
13
|
+
createDateByValueFormat: (value: import("../datepicker/basepicker").Value) => dayjs.Dayjs;
|
|
14
|
+
createDateByShowFormat: (value: import("../datepicker/basepicker").Value) => dayjs.Dayjs;
|
|
15
|
+
getShowString: (value: dayjs.Dayjs) => string;
|
|
16
|
+
getValueString: (value: dayjs.Dayjs) => string;
|
|
17
|
+
};
|
|
18
|
+
disabled: {
|
|
19
|
+
isDisabled: (value: dayjs.Dayjs, type?: dayjs.OpUnitType) => boolean;
|
|
20
|
+
isDisabledConfirm: () => boolean;
|
|
21
|
+
maxDate: State<dayjs.Dayjs | null>;
|
|
22
|
+
minDate: State<dayjs.Dayjs | null>;
|
|
23
|
+
isDisabledTime: (value: dayjs.Dayjs, flag: import("../datepicker/usePanel").PanelFlags) => boolean;
|
|
24
|
+
isDisabledTimeByStep: (value: string, flag: import("../datepicker/usePanel").PanelFlags) => boolean;
|
|
25
|
+
};
|
|
26
|
+
panel: {
|
|
27
|
+
startPanel: State<PanelTypes>;
|
|
28
|
+
endPanel: State<PanelTypes>;
|
|
29
|
+
changePanel: (type: PanelTypes, flag?: import("../datepicker/usePanel").PanelFlags) => void;
|
|
30
|
+
getPanel: (flag: import("../datepicker/usePanel").PanelFlags) => State<PanelTypes>;
|
|
31
|
+
reset: () => void;
|
|
32
|
+
startRef: import("intact").RefObject<import("../datepicker/calendar").DatepickerCalendar>;
|
|
33
|
+
endRef: import("intact").RefObject<import("../datepicker/calendar").DatepickerCalendar>;
|
|
34
|
+
};
|
|
35
|
+
value: {
|
|
36
|
+
format: () => string | string[];
|
|
37
|
+
onConfirm: () => void;
|
|
38
|
+
getTimeValue: (flag: import("../datepicker/usePanel").PanelFlags) => dayjs.Dayjs | null | undefined;
|
|
39
|
+
convertToDayjs: (v: import("../datepicker/basepicker").Value | [import("../datepicker/basepicker").Value, import("../datepicker/basepicker").Value] | import("../datepicker/basepicker").Value[] | [import("../datepicker/basepicker").Value, import("../datepicker/basepicker").Value][] | null | undefined) => import("../datepicker/basepicker").DayjsValue;
|
|
40
|
+
value: State<import("../datepicker/basepicker").StateValue>;
|
|
41
|
+
setValue: (v: import("../datepicker/basepicker").StateValueItem, fromInput: boolean) => void;
|
|
42
|
+
getDayjsValue: () => import("../datepicker/basepicker").DayjsValue;
|
|
43
|
+
onChangeTime: (date: dayjs.Dayjs, flag: import("../datepicker/usePanel").PanelFlags) => void;
|
|
44
|
+
onChangeTimeByStep: (v: string, flag: import("../datepicker/usePanel").PanelFlags) => void;
|
|
45
|
+
};
|
|
46
|
+
step: {
|
|
47
|
+
options: State<{
|
|
48
|
+
value: string;
|
|
49
|
+
label: string;
|
|
50
|
+
}[] | null>;
|
|
51
|
+
};
|
|
52
|
+
protected getPlaceholder(): string | number | boolean | import("misstime/dist/utils/types").VNode<any> | import("intact").Children[];
|
|
53
|
+
protected getLabel(): string | string[];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
export {normalize} from 'intact-vue-next';
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import _inheritsLoose from "@babel/runtime-corejs3/helpers/inheritsLoose";
|
|
2
|
+
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/concat";
|
|
3
|
+
import template from './panelPicker.vdt';
|
|
4
|
+
import { BasePicker } from '../datepicker/basepicker';
|
|
5
|
+
import { isNullOrUndefined } from 'intact-shared';
|
|
6
|
+
import { _$ } from '../../i18n';
|
|
7
|
+
import { useFormats } from './useFormats';
|
|
8
|
+
import { useValue } from './useValue';
|
|
9
|
+
import { useDisabled } from './useDisabled';
|
|
10
|
+
import { usePanel } from '../datepicker/usePanel';
|
|
11
|
+
import { PanelTypes } from '../datepicker/usePanel';
|
|
12
|
+
import { useStep } from './useStep';
|
|
13
|
+
import { typeDefs } from './constants';
|
|
14
|
+
export var PanelPicker = /*#__PURE__*/function (_BasePicker) {
|
|
15
|
+
_inheritsLoose(PanelPicker, _BasePicker);
|
|
16
|
+
|
|
17
|
+
function PanelPicker() {
|
|
18
|
+
var _context;
|
|
19
|
+
|
|
20
|
+
var _this;
|
|
21
|
+
|
|
22
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
23
|
+
args[_key] = arguments[_key];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
_this = _BasePicker.call.apply(_BasePicker, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
27
|
+
_this.formats = useFormats();
|
|
28
|
+
_this.disabled = useDisabled(_this.formats);
|
|
29
|
+
_this.panel = usePanel(PanelTypes.Time);
|
|
30
|
+
_this.value = useValue(_this.formats, _this.disabled, _this.panel);
|
|
31
|
+
_this.step = useStep(_this.disabled, _this.formats);
|
|
32
|
+
return _this;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
var _proto = PanelPicker.prototype;
|
|
36
|
+
|
|
37
|
+
_proto.getPlaceholder = function getPlaceholder() {
|
|
38
|
+
var _this$get = this.get(),
|
|
39
|
+
placeholder = _this$get.placeholder,
|
|
40
|
+
range = _this$get.range;
|
|
41
|
+
|
|
42
|
+
if (!isNullOrUndefined(placeholder)) return placeholder;
|
|
43
|
+
return range ? _$('开始时间 ~ 结束时间') : _$('请选择时间');
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
_proto.getLabel = function getLabel() {
|
|
47
|
+
return this.value.format();
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
return PanelPicker;
|
|
51
|
+
}(BasePicker);
|
|
52
|
+
PanelPicker.template = template;
|
|
53
|
+
PanelPicker.typeDefs = typeDefs;
|
|
54
|
+
|
|
55
|
+
export {normalize} from 'intact-vue-next';
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { createElementVNode as _$ce, createUnknownComponentVNode as _$cc, superCall as _$su, extend as _$ex, EMPTY_OBJ as _$em, className as _$cn, createTextVNode as _$ct } from 'intact-vue-next';
|
|
2
|
+
import { Icon } from '../icon';
|
|
3
|
+
import { DropdownMenu } from '../dropdown';
|
|
4
|
+
import { makePanelStyles } from './styles';
|
|
5
|
+
import { DatepickerTime } from '../datepicker/time';
|
|
6
|
+
import { _$ } from '../../i18n';
|
|
7
|
+
import { Button } from '../button';
|
|
8
|
+
import { PanelFlags } from '../datepicker/usePanel';
|
|
9
|
+
import { last } from '../datepicker/helpers';
|
|
10
|
+
import { ScrollSelect } from '../scrollSelect';
|
|
11
|
+
var _$tmp0 = {
|
|
12
|
+
'className': 'k-timepicker'
|
|
13
|
+
};
|
|
14
|
+
var _$tmp1 = {
|
|
15
|
+
'className': 'k-icon-time'
|
|
16
|
+
};
|
|
17
|
+
export default function ($props, $blocks, $__proto__) {
|
|
18
|
+
var _classNameObj;
|
|
19
|
+
|
|
20
|
+
$blocks || ($blocks = {});
|
|
21
|
+
$props || ($props = {});
|
|
22
|
+
var $this = this;
|
|
23
|
+
|
|
24
|
+
var _this$get = this.get(),
|
|
25
|
+
className = _this$get.className,
|
|
26
|
+
range = _this$get.range,
|
|
27
|
+
multiple = _this$get.multiple;
|
|
28
|
+
|
|
29
|
+
var _this$value = this.value,
|
|
30
|
+
value = _this$value.value.value,
|
|
31
|
+
onConfirm = _this$value.onConfirm,
|
|
32
|
+
onChangeTime = _this$value.onChangeTime,
|
|
33
|
+
onChangeTimeByStep = _this$value.onChangeTimeByStep,
|
|
34
|
+
getTimeValue = _this$value.getTimeValue;
|
|
35
|
+
var lastValue = last(value);
|
|
36
|
+
var classNameObj = (_classNameObj = {
|
|
37
|
+
'k-time-content': true,
|
|
38
|
+
'k-range': range
|
|
39
|
+
}, _classNameObj[className] = className, _classNameObj[makePanelStyles()] = true, _classNameObj);
|
|
40
|
+
var options = this.step.options.value;
|
|
41
|
+
var _this$disabled = this.disabled,
|
|
42
|
+
isDisabledTime = _this$disabled.isDisabledTime,
|
|
43
|
+
isDisabledTimeByStep = _this$disabled.isDisabledTimeByStep,
|
|
44
|
+
isDisabledConfirm = _this$disabled.isDisabledConfirm;
|
|
45
|
+
var _this$formats = this.formats,
|
|
46
|
+
getValueFormat = _this$formats.getValueFormat,
|
|
47
|
+
getValueString = _this$formats.getValueString;
|
|
48
|
+
|
|
49
|
+
var generatePanel = function generatePanel(flag) {
|
|
50
|
+
var timeValue = getTimeValue(flag);
|
|
51
|
+
return _$ce(2, 'div', [range ? _$ce(2, 'div', flag === PanelFlags.Start ? _$('开始时间') : _$('结束时间'), 0, 'k-timepicker-title') : undefined, !options ? _$cc(DatepickerTime, {
|
|
52
|
+
'value': timeValue,
|
|
53
|
+
'ev-$change:value': function ev$changeValue(v) {
|
|
54
|
+
return onChangeTime(v, flag);
|
|
55
|
+
},
|
|
56
|
+
'format': getValueFormat(),
|
|
57
|
+
'flag': flag,
|
|
58
|
+
'isDisabledTime': isDisabledTime
|
|
59
|
+
}) : _$ce(2, 'div', _$cc(ScrollSelect, {
|
|
60
|
+
'value': timeValue ? getValueString(timeValue) : timeValue,
|
|
61
|
+
'ev-$change:value': function ev$changeValue(v) {
|
|
62
|
+
return onChangeTimeByStep(v, flag);
|
|
63
|
+
},
|
|
64
|
+
'data': options,
|
|
65
|
+
'disable': function disable(v) {
|
|
66
|
+
return isDisabledTimeByStep(v, flag);
|
|
67
|
+
}
|
|
68
|
+
}), 2, 'k-datepicker-time')], 0, 'k-datepicker-calendar-wrapper');
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
return _$su.call($this, _$tmp0, function ($blocks) {
|
|
72
|
+
var _$blocks = {},
|
|
73
|
+
__$blocks = _$ex({}, $blocks);
|
|
74
|
+
|
|
75
|
+
return (_$blocks['base-menu'] = function ($super) {
|
|
76
|
+
return _$cc(DropdownMenu, {
|
|
77
|
+
'className': _$cn(classNameObj),
|
|
78
|
+
'children': _$ce(2, 'div', [_$ce(2, 'div', [generatePanel(PanelFlags.Start), _$ct('\n '), range ? generatePanel(PanelFlags.End) : null], 0, 'k-datepicker-calendars'), _$ce(2, 'div', _$cc(Button, {
|
|
79
|
+
'type': 'primary',
|
|
80
|
+
'size': 'small',
|
|
81
|
+
'disabled': isDisabledConfirm(),
|
|
82
|
+
'ev-click': onConfirm,
|
|
83
|
+
'children': _$('确定')
|
|
84
|
+
}), 2, 'k-datepicker-footer')], 4, 'k-datepicker-wrapper')
|
|
85
|
+
});
|
|
86
|
+
}, __$blocks['base-menu'] = function ($super, data) {
|
|
87
|
+
var block = $blocks['base-menu'];
|
|
88
|
+
|
|
89
|
+
var callBlock = function callBlock() {
|
|
90
|
+
return _$blocks['base-menu'].call($this, $super, data);
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
return block ? block.call($this, callBlock, data) : callBlock();
|
|
94
|
+
}), (_$blocks['suffix'] = function ($super) {
|
|
95
|
+
return _$cc(Icon, _$tmp1);
|
|
96
|
+
}, __$blocks['suffix'] = function ($super, data) {
|
|
97
|
+
var block = $blocks['suffix'];
|
|
98
|
+
|
|
99
|
+
var callBlock = function callBlock() {
|
|
100
|
+
return _$blocks['suffix'].call($this, $super, data);
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
return block ? block.call($this, callBlock, data) : callBlock();
|
|
104
|
+
}), __$blocks;
|
|
105
|
+
}.call($this, $blocks), $__proto__);
|
|
106
|
+
}
|
|
107
|
+
;
|
|
108
|
+
|
|
109
|
+
export {normalize} from 'intact-vue-next';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Component, TypeDefs } from 'intact-vue-next';
|
|
2
|
+
import { TimepickerProps, TimepickerEvents, TimepickerBlocks } from './constants';
|
|
3
|
+
export declare class SelectPicker extends Component<TimepickerProps, TimepickerEvents, TimepickerBlocks> {
|
|
4
|
+
static template: string | import("intact").Template<any>;
|
|
5
|
+
static typeDefs: Required<TypeDefs<TimepickerProps<boolean, boolean>>>;
|
|
6
|
+
formats: {
|
|
7
|
+
getValueFormat: () => string;
|
|
8
|
+
getShowFormat: () => string;
|
|
9
|
+
createDateByValueFormat: (value: import("../datepicker/basepicker").Value) => import("dayjs").Dayjs;
|
|
10
|
+
createDateByShowFormat: (value: import("../datepicker/basepicker").Value) => import("dayjs").Dayjs;
|
|
11
|
+
getShowString: (value: import("dayjs").Dayjs) => string;
|
|
12
|
+
getValueString: (value: import("dayjs").Dayjs) => string;
|
|
13
|
+
};
|
|
14
|
+
disabled: {
|
|
15
|
+
isDisabled: (value: import("dayjs").Dayjs, type?: import("dayjs").OpUnitType) => boolean;
|
|
16
|
+
isDisabledTime: (value: import("dayjs").Dayjs, flag: import("../datepicker/usePanel").PanelFlags) => boolean;
|
|
17
|
+
isDisabledConfirm: () => boolean;
|
|
18
|
+
maxDate: import("../../hooks/useState").State<import("dayjs").Dayjs | null>;
|
|
19
|
+
minDate: import("../../hooks/useState").State<import("dayjs").Dayjs | null>;
|
|
20
|
+
};
|
|
21
|
+
step: {
|
|
22
|
+
options: import("../../hooks/useState").State<{
|
|
23
|
+
value: string;
|
|
24
|
+
label: string;
|
|
25
|
+
}[] | null>;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
export {normalize} from 'intact-vue-next';
|