@king-design/vue 2.1.3 → 2.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/affix/index.d.ts +2 -2
- package/components/affix/index.js +0 -5
- package/components/affix/index.spec.js +84 -108
- package/components/affix/index.vdt.js +5 -8
- package/components/affix/useStyle.js +8 -19
- package/components/badge/index.js +0 -2
- package/components/badge/index.vdt.js +5 -9
- package/components/badge/styles.js +0 -2
- package/components/breadcrumb/index.js +0 -4
- package/components/breadcrumb/index.spec.js +6 -6
- package/components/breadcrumb/index.vdt.js +5 -14
- package/components/breadcrumb/item.js +0 -8
- package/components/breadcrumb/item.vdt.js +3 -6
- package/components/breadcrumb/styles.js +0 -3
- package/components/button/dynamicButton.d.ts +1 -1
- package/components/button/dynamicButton.js +2 -5
- package/components/button/group.js +2 -10
- package/components/button/group.vdt.js +4 -7
- package/components/button/index.js +3 -27
- package/components/button/index.spec.js +74 -96
- package/components/button/index.vdt.js +19 -29
- package/components/button/styles.d.ts +2 -2
- package/components/button/styles.js +4 -48
- package/components/card/column.js +0 -2
- package/components/card/column.vdt.js +5 -10
- package/components/card/index.js +0 -4
- package/components/card/index.vdt.js +4 -16
- package/components/carousel/index.js +1 -19
- package/components/carousel/index.spec.js +127 -163
- package/components/carousel/index.vdt.js +12 -15
- package/components/carousel/item.js +0 -2
- package/components/carousel/item.vdt.js +4 -7
- package/components/carousel/styles.js +0 -1
- package/components/carousel/useAutoplay.js +0 -4
- package/components/carousel/useItems.js +4 -20
- package/components/carousel/useSlide.js +57 -89
- package/components/cascader/index.js +3 -18
- package/components/cascader/index.spec.js +365 -379
- package/components/cascader/index.vdt.js +14 -31
- package/components/cascader/styles.js +0 -6
- package/components/cascader/useFields.js +1 -4
- package/components/cascader/useFilterable.js +2 -19
- package/components/cascader/useLabel.js +1 -9
- package/components/cascader/useLoad.js +22 -35
- package/components/cascader/useValue.d.ts +2 -2
- package/components/cascader/useValue.js +6 -27
- package/components/checkbox/index.js +5 -27
- package/components/checkbox/index.spec.js +129 -171
- package/components/checkbox/index.vdt.js +12 -16
- package/components/checkbox/styles.js +0 -10
- package/components/code/crossDomain.js +2 -9
- package/components/code/index.js +0 -9
- package/components/code/index.spec.js +46 -55
- package/components/code/index.vdt.js +6 -14
- package/components/code/styles.js +0 -1
- package/components/code/useEditor.js +5 -10
- package/components/collapse/index.d.ts +1 -1
- package/components/collapse/index.js +3 -14
- package/components/collapse/index.spec.js +47 -60
- package/components/collapse/index.vdt.js +4 -12
- package/components/collapse/item.js +0 -10
- package/components/collapse/item.vdt.js +7 -14
- package/components/collapse/styles.js +0 -1
- package/components/colorpicker/drag.js +0 -5
- package/components/colorpicker/index.js +0 -4
- package/components/colorpicker/index.spec.js +211 -259
- package/components/colorpicker/index.vdt.js +8 -11
- package/components/colorpicker/panel.js +0 -5
- package/components/colorpicker/panel.vdt.js +21 -26
- package/components/colorpicker/styles.js +2 -13
- package/components/colorpicker/useDrag.js +22 -26
- package/components/colorpicker/useInput.js +0 -16
- package/components/colorpicker/usePointer.js +15 -18
- package/components/colorpicker/useValue.js +2 -7
- package/components/context.d.ts +2 -2
- package/components/context.js +2 -19
- package/components/datepicker/basepicker.d.ts +8 -8
- package/components/datepicker/basepicker.js +20 -90
- package/components/datepicker/calendar.js +0 -11
- package/components/datepicker/calendar.vdt.js +11 -14
- package/components/datepicker/constants.js +0 -1
- package/components/datepicker/dayjs.js +1 -1
- package/components/datepicker/helpers.js +3 -15
- package/components/datepicker/index.js +6 -32
- package/components/datepicker/index.spec.js +1141 -1448
- package/components/datepicker/index.vdt.js +20 -34
- package/components/datepicker/shortcuts.d.ts +1 -1
- package/components/datepicker/shortcuts.js +0 -4
- package/components/datepicker/styles.js +0 -8
- package/components/datepicker/time.d.ts +1 -1
- package/components/datepicker/time.js +3 -23
- package/components/datepicker/time.vdt.js +4 -5
- package/components/datepicker/useDays.js +2 -9
- package/components/datepicker/useDisabled.js +6 -23
- package/components/datepicker/useFocusDate.js +0 -2
- package/components/datepicker/useFormats.js +6 -15
- package/components/datepicker/useKeyboards.js +20 -36
- package/components/datepicker/useMonths.js +0 -6
- package/components/datepicker/usePanel.js +0 -10
- package/components/datepicker/useShowDate.js +10 -37
- package/components/datepicker/useStatus.js +3 -15
- package/components/datepicker/useValue.js +22 -35
- package/components/datepicker/useYears.js +4 -15
- package/components/diagram/diagram.js +17 -43
- package/components/diagram/diagram.vdt.js +2 -5
- package/components/diagram/graph.js +6 -6
- package/components/diagram/index.d.ts +1 -1
- package/components/diagram/index.js +7 -7
- package/components/diagram/index.spec.js +369 -495
- package/components/diagram/layouts/circle.js +6 -14
- package/components/diagram/layouts/flow.js +7 -15
- package/components/diagram/layouts/layout.js +6 -28
- package/components/diagram/layouts/organic.js +3 -11
- package/components/diagram/layouts/partition.js +4 -12
- package/components/diagram/layouts/radial.js +6 -18
- package/components/diagram/layouts/stack.js +6 -14
- package/components/diagram/layouts/tree.js +11 -21
- package/components/diagram/mxgraph/handler/mxConnectionHandler.js +15 -22
- package/components/diagram/mxgraph/handler/mxConstraintHandler.js +4 -4
- package/components/diagram/mxgraph/handler/mxEdgeHandler.js +11 -15
- package/components/diagram/mxgraph/handler/mxGraphHandler.js +6 -9
- package/components/diagram/mxgraph/handler/mxRubberband.js +4 -4
- package/components/diagram/mxgraph/handler/mxVertexHandler.js +7 -10
- package/components/diagram/mxgraph/index.js +0 -2
- package/components/diagram/mxgraph/mx.js +3 -3
- package/components/diagram/mxgraph/shape/mxCloud.js +2 -2
- package/components/diagram/mxgraph/shape/mxCylinder.js +4 -9
- package/components/diagram/mxgraph/shape/mxEllipse.js +2 -2
- package/components/diagram/mxgraph/shape/mxHexagon.js +2 -2
- package/components/diagram/mxgraph/shape/mxLine.js +2 -2
- package/components/diagram/mxgraph/shape/mxRectangleShape.js +2 -2
- package/components/diagram/mxgraph/shape/mxRhombus.js +6 -12
- package/components/diagram/mxgraph/shape/mxShape.js +0 -1
- package/components/diagram/mxgraph/shape/mxTriangle.js +2 -2
- package/components/diagram/mxgraph/util/mxConstants.js +2 -2
- package/components/diagram/mxgraph/util/mxGuide.js +5 -7
- package/components/diagram/mxgraph/view/mxCellEditor.js +16 -29
- package/components/diagram/mxgraph/view/mxCellRenderer.js +0 -2
- package/components/diagram/mxgraph/view/mxGraph.js +14 -32
- package/components/diagram/shapes/base.d.ts +1 -1
- package/components/diagram/shapes/base.js +9 -39
- package/components/diagram/shapes/callout.js +10 -23
- package/components/diagram/shapes/circle.js +3 -10
- package/components/diagram/shapes/document.js +5 -16
- package/components/diagram/shapes/ellipse.js +0 -5
- package/components/diagram/shapes/generateShapes.d.ts +1 -1
- package/components/diagram/shapes/generateShapes.js +0 -9
- package/components/diagram/shapes/hexagon.js +9 -26
- package/components/diagram/shapes/image.js +1 -9
- package/components/diagram/shapes/line.d.ts +2 -2
- package/components/diagram/shapes/line.js +13 -48
- package/components/diagram/shapes/parallelogram.js +9 -26
- package/components/diagram/shapes/rectangle.js +1 -9
- package/components/diagram/shapes/shape.js +6 -35
- package/components/diagram/shapes/square.js +3 -11
- package/components/diagram/shapes/text.js +0 -5
- package/components/diagram/styles.js +0 -1
- package/components/dialog/alert.vdt.js +9 -19
- package/components/dialog/base.js +1 -29
- package/components/dialog/base.vdt.js +14 -29
- package/components/dialog/index.js +6 -31
- package/components/dialog/index.spec.js +406 -554
- package/components/dialog/staticMethods.d.ts +1 -1
- package/components/dialog/staticMethods.js +2 -13
- package/components/dialog/styles.js +0 -11
- package/components/dialog/useDraggable.js +0 -6
- package/components/dialog/useEscClosable.js +4 -12
- package/components/dialog/useFixBody.d.ts +1 -1
- package/components/dialog/useFixBody.js +0 -11
- package/components/dialog/usePosition.js +0 -5
- package/components/drawer/index.js +0 -5
- package/components/drawer/index.spec.js +126 -168
- package/components/drawer/index.vdt.js +3 -9
- package/components/drawer/styles.d.ts +2 -2
- package/components/drawer/styles.js +0 -4
- package/components/dropdown/dropdown.d.ts +2 -2
- package/components/dropdown/dropdown.js +33 -89
- package/components/dropdown/index.js +2 -6
- package/components/dropdown/index.spec.js +388 -496
- package/components/dropdown/item.js +4 -25
- package/components/dropdown/item.vdt.js +5 -8
- package/components/dropdown/menu.js +14 -29
- package/components/dropdown/menu.vdt.js +5 -13
- package/components/dropdown/styles.js +0 -9
- package/components/dropdown/useKeyboard.d.ts +2 -2
- package/components/dropdown/useKeyboard.js +8 -30
- package/components/dropdown/usePosition.d.ts +2 -1
- package/components/dropdown/usePosition.js +24 -22
- package/components/dropdown/useTransition.js +0 -8
- package/components/editable/index.d.ts +1 -1
- package/components/editable/index.js +4 -28
- package/components/editable/index.spec.js +152 -189
- package/components/editable/index.vdt.js +8 -11
- package/components/editable/styles.js +0 -1
- package/components/form/form.js +0 -18
- package/components/form/form.vdt.js +4 -7
- package/components/form/index.spec.js +1057 -1280
- package/components/form/item.d.ts +1 -1
- package/components/form/item.js +0 -12
- package/components/form/item.vdt.js +17 -31
- package/components/form/methods.d.ts +5 -5
- package/components/form/methods.js +2 -12
- package/components/form/styles.js +0 -8
- package/components/form/useDirty.js +2 -7
- package/components/form/useError.js +2 -10
- package/components/form/useValidate.d.ts +1 -1
- package/components/form/useValidate.js +8 -24
- package/components/grid/col.d.ts +3 -3
- package/components/grid/col.js +0 -7
- package/components/grid/col.vdt.js +8 -13
- package/components/grid/constants.d.ts +6 -6
- package/components/grid/row.js +0 -5
- package/components/grid/row.vdt.js +5 -8
- package/components/grid/styles.js +0 -7
- package/components/grid/useBreakpoints.js +0 -5
- package/components/grid/useGutter.js +5 -25
- package/components/icon/index.js +0 -10
- package/components/icon/index.vdt.js +7 -13
- package/components/icon/styles.js +0 -1
- package/components/input/index.d.ts +3 -3
- package/components/input/index.js +0 -14
- package/components/input/index.spec.js +185 -239
- package/components/input/index.vdt.js +39 -49
- package/components/input/search.js +0 -20
- package/components/input/search.vdt.js +6 -9
- package/components/input/styles.js +0 -26
- package/components/input/useAutoRows.js +6 -18
- package/components/input/useAutoWidth.js +0 -5
- package/components/input/useFrozen.js +0 -6
- package/components/input/useShowPassword.js +2 -5
- package/components/layout/aside.js +5 -17
- package/components/layout/aside.vdt.js +5 -9
- package/components/layout/body.js +5 -17
- package/components/layout/footer.js +1 -7
- package/components/layout/header.js +7 -21
- package/components/layout/layout.js +9 -24
- package/components/layout/styles.js +2 -13
- package/components/layout/template.vdt.js +2 -4
- package/components/layout/useParse.js +0 -7
- package/components/menu/index.spec.js +189 -242
- package/components/menu/item.js +3 -16
- package/components/menu/item.vdt.js +20 -32
- package/components/menu/menu.js +2 -11
- package/components/menu/menu.vdt.js +6 -12
- package/components/menu/styles.js +0 -18
- package/components/menu/useDropdown.js +4 -9
- package/components/menu/useExpanded.js +0 -14
- package/components/menu/useHighlight.js +26 -36
- package/components/message/index.spec.js +58 -73
- package/components/message/message.js +0 -19
- package/components/message/message.vdt.js +5 -8
- package/components/message/messages.js +0 -12
- package/components/message/messages.vdt.js +0 -1
- package/components/message/styles.js +0 -9
- package/components/pagination/index.d.ts +1 -1
- package/components/pagination/index.js +10 -46
- package/components/pagination/index.spec.js +133 -173
- package/components/pagination/index.vdt.js +14 -34
- package/components/pagination/styles.js +0 -4
- package/components/portal.d.ts +1 -1
- package/components/portal.js +2 -29
- package/components/position.d.ts +12 -12
- package/components/position.js +32 -88
- package/components/progress/index.d.ts +6 -6
- package/components/progress/index.js +0 -12
- package/components/progress/index.spec.js +143 -191
- package/components/progress/index.vdt.js +8 -11
- package/components/progress/styles.js +0 -6
- package/components/progress/useColor.js +2 -7
- package/components/progress/useStatus.d.ts +1 -1
- package/components/progress/useStatus.js +2 -5
- package/components/radio/index.js +3 -18
- package/components/radio/index.spec.js +111 -149
- package/components/radio/index.vdt.js +14 -17
- package/components/radio/styles.js +0 -10
- package/components/rate/index.js +0 -7
- package/components/rate/index.spec.js +64 -79
- package/components/rate/index.vdt.js +8 -21
- package/components/rate/styles.js +0 -3
- package/components/rate/useActiveValue.js +2 -7
- package/components/scrollSelect/index.d.ts +2 -2
- package/components/scrollSelect/index.js +0 -7
- package/components/scrollSelect/index.spec.js +100 -131
- package/components/scrollSelect/index.vdt.js +6 -11
- package/components/scrollSelect/styles.js +0 -7
- package/components/scrollSelect/useList.js +3 -17
- package/components/scrollSelect/useMouseEvents.js +31 -49
- package/components/scrollSelect/useTranslate.js +1 -11
- package/components/select/base.js +5 -35
- package/components/select/base.vdt.js +23 -38
- package/components/select/group.js +0 -5
- package/components/select/group.vdt.js +4 -10
- package/components/select/index.spec.js +361 -452
- package/components/select/menu.js +0 -5
- package/components/select/menu.vdt.js +18 -33
- package/components/select/option.js +2 -16
- package/components/select/option.vdt.js +7 -14
- package/components/select/select.js +3 -20
- package/components/select/select.vdt.js +9 -17
- package/components/select/styles.js +0 -33
- package/components/select/useBaseLabel.d.ts +1 -1
- package/components/select/useBaseLabel.js +4 -17
- package/components/select/useCard.js +0 -4
- package/components/select/useEqualWidth.js +0 -1
- package/components/select/useFilterable.js +5 -27
- package/components/select/useFocusout.d.ts +1 -1
- package/components/select/useFocusout.js +1 -9
- package/components/select/useInput.js +6 -10
- package/components/select/useLabel.js +3 -13
- package/components/select/useSearchable.js +0 -10
- package/components/skeleton/item.d.ts +1 -1
- package/components/skeleton/item.js +0 -4
- package/components/skeleton/item.vdt.js +1 -6
- package/components/skeleton/skeleton.js +0 -4
- package/components/skeleton/skeleton.vdt.js +6 -12
- package/components/skeleton/style.d.ts +1 -1
- package/components/skeleton/style.js +0 -1
- package/components/slider/index.d.ts +1 -1
- package/components/slider/index.js +0 -7
- package/components/slider/index.spec.js +467 -585
- package/components/slider/index.vdt.js +32 -45
- package/components/slider/styles.js +0 -14
- package/components/slider/useClick.js +2 -11
- package/components/slider/useDraggable.js +23 -34
- package/components/slider/useKeyboard.js +7 -18
- package/components/slider/useMarks.d.ts +5 -5
- package/components/slider/useMarks.js +5 -13
- package/components/slider/usePoints.d.ts +2 -2
- package/components/slider/usePoints.js +7 -21
- package/components/slider/useStyles.d.ts +1 -1
- package/components/slider/useStyles.js +5 -10
- package/components/slider/useTooltip.js +2 -10
- package/components/slider/useValue.d.ts +1 -1
- package/components/slider/useValue.js +7 -22
- package/components/spin/index.js +0 -4
- package/components/spin/index.vdt.js +4 -11
- package/components/spin/styles.js +0 -2
- package/components/spinner/index.d.ts +4 -4
- package/components/spinner/index.js +9 -24
- package/components/spinner/index.spec.js +359 -460
- package/components/spinner/index.vdt.js +10 -13
- package/components/spinner/styles.js +0 -3
- package/components/spinner/useChange.js +4 -16
- package/components/spinner/useFormatter.js +6 -16
- package/components/spinner/useStep.d.ts +3 -3
- package/components/spinner/useStep.js +2 -20
- package/components/spinner/useValue.js +11 -26
- package/components/split/index.js +0 -7
- package/components/split/index.spec.js +223 -267
- package/components/split/index.vdt.js +8 -17
- package/components/split/style.d.ts +1 -1
- package/components/split/style.js +0 -8
- package/components/split/useDraggable.js +11 -35
- package/components/split/useSize.js +2 -5
- package/components/steps/context.d.ts +2 -2
- package/components/steps/index.js +2 -10
- package/components/steps/index.spec.js +21 -27
- package/components/steps/index.vdt.js +8 -10
- package/components/steps/step.js +0 -2
- package/components/steps/step.vdt.js +8 -12
- package/components/steps/styles.js +0 -27
- package/components/switch/index.js +2 -23
- package/components/switch/index.spec.js +188 -224
- package/components/switch/index.vdt.js +16 -32
- package/components/switch/styles.js +3 -14
- package/components/switch/useDraggable.js +10 -18
- package/components/table/cell.js +0 -6
- package/components/table/cell.vdt.js +14 -21
- package/components/table/column.d.ts +1 -1
- package/components/table/column.js +0 -5
- package/components/table/column.vdt.js +19 -30
- package/components/table/exportTable.js +45 -56
- package/components/table/index.spec.js +780 -984
- package/components/table/row.d.ts +1 -1
- package/components/table/row.js +12 -41
- package/components/table/row.vdt.js +27 -39
- package/components/table/styles.js +0 -11
- package/components/table/table.d.ts +5 -5
- package/components/table/table.js +18 -50
- package/components/table/table.vdt.js +61 -85
- package/components/table/useChecked.d.ts +1 -1
- package/components/table/useChecked.js +20 -61
- package/components/table/useColumns.js +3 -16
- package/components/table/useDisableRow.js +2 -12
- package/components/table/useDraggable.js +4 -12
- package/components/table/useExpandable.js +2 -5
- package/components/table/useFixedColumns.d.ts +1 -1
- package/components/table/useFixedColumns.js +4 -23
- package/components/table/useGroup.d.ts +1 -1
- package/components/table/useGroup.js +7 -24
- package/components/table/useMerge.d.ts +4 -4
- package/components/table/useMerge.js +2 -14
- package/components/table/usePagination.js +4 -18
- package/components/table/useResizable.js +2 -10
- package/components/table/useRestRowStatus.js +2 -6
- package/components/table/useScroll.d.ts +1 -1
- package/components/table/useScroll.js +0 -3
- package/components/table/useSelected.js +2 -5
- package/components/table/useSortable.js +2 -8
- package/components/table/useStickyHeader.js +3 -7
- package/components/table/useStickyScrollbar.js +6 -16
- package/components/table/useTree.js +1 -12
- package/components/table/useWidth.js +14 -30
- package/components/tabs/index.js +29 -51
- package/components/tabs/index.spec.js +56 -74
- package/components/tabs/index.vdt.js +13 -16
- package/components/tabs/styles.js +0 -16
- package/components/tabs/tab.js +0 -10
- package/components/tabs/tab.vdt.js +6 -10
- package/components/tabs/useActiveBar.js +2 -11
- package/components/tabs/useScroll.js +4 -20
- package/components/tag/base.js +0 -8
- package/components/tag/index.js +2 -4
- package/components/tag/index.spec.js +19 -25
- package/components/tag/index.vdt.js +8 -15
- package/components/tag/styles.js +0 -9
- package/components/timeline/item.js +0 -4
- package/components/timeline/item.vdt.js +4 -9
- package/components/timeline/styles.d.ts +2 -2
- package/components/timeline/styles.js +0 -4
- package/components/timeline/timeline.js +0 -2
- package/components/timeline/timeline.vdt.js +2 -5
- package/components/timepicker/index.js +2 -7
- package/components/timepicker/index.spec.js +293 -368
- package/components/timepicker/panelPicker.js +2 -11
- package/components/timepicker/panelPicker.vdt.js +14 -24
- package/components/timepicker/selectPicker.js +0 -5
- package/components/timepicker/selectPicker.vdt.js +5 -10
- package/components/timepicker/styles.js +0 -1
- package/components/timepicker/useDisabled.js +2 -4
- package/components/timepicker/useFormats.js +4 -13
- package/components/timepicker/useStep.d.ts +1 -1
- package/components/timepicker/useStep.js +8 -17
- package/components/timepicker/useValue.js +16 -21
- package/components/tip/index.js +0 -2
- package/components/tip/index.vdt.js +5 -17
- package/components/tip/styles.js +0 -3
- package/components/tooltip/content.js +0 -28
- package/components/tooltip/content.vdt.js +15 -25
- package/components/tooltip/index.js +3 -7
- package/components/tooltip/index.spec.js +434 -572
- package/components/tooltip/styles.d.ts +1 -1
- package/components/tooltip/styles.js +2 -10
- package/components/tooltip/tooltip.js +2 -15
- package/components/tooltip/useArrow.js +11 -14
- package/components/transfer/index.d.ts +1 -1
- package/components/transfer/index.js +1 -13
- package/components/transfer/index.spec.js +159 -194
- package/components/transfer/index.vdt.js +16 -34
- package/components/transfer/styles.js +0 -10
- package/components/transfer/useCheck.d.ts +1 -1
- package/components/transfer/useCheck.js +1 -15
- package/components/transfer/useFilter.d.ts +1 -1
- package/components/transfer/useFilter.js +9 -30
- package/components/transfer/useTransfer.js +10 -26
- package/components/tree/index.d.ts +3 -3
- package/components/tree/index.js +4 -22
- package/components/tree/index.spec.js +285 -355
- package/components/tree/index.vdt.js +12 -23
- package/components/tree/styles.js +2 -16
- package/components/tree/useChecked.js +3 -26
- package/components/tree/useDraggable.js +12 -42
- package/components/tree/useExpanded.js +26 -43
- package/components/tree/useFilter.js +3 -10
- package/components/tree/useNodes.d.ts +1 -1
- package/components/tree/useNodes.js +0 -4
- package/components/tree/useSelected.js +21 -38
- package/components/tree/useTransitionEvent.js +3 -5
- package/components/treeSelect/index.js +9 -36
- package/components/treeSelect/index.spec.js +123 -160
- package/components/treeSelect/index.vdt.js +14 -20
- package/components/treeSelect/styles.js +0 -1
- package/components/treeSelect/useValue.js +0 -11
- package/components/types.d.ts +3 -3
- package/components/upload/ajaxUploader.d.ts +1 -1
- package/components/upload/ajaxUploader.js +0 -17
- package/components/upload/index.d.ts +4 -4
- package/components/upload/index.js +0 -14
- package/components/upload/index.spec.js +142 -249
- package/components/upload/index.vdt.js +12 -27
- package/components/upload/styles.js +0 -30
- package/components/upload/useAccept.js +2 -10
- package/components/upload/useDrag.js +0 -7
- package/components/upload/useFiles.js +103 -145
- package/components/upload/useShowImage.js +0 -3
- package/components/upload/useUpload.js +47 -69
- package/components/utils.d.ts +3 -3
- package/components/utils.js +12 -47
- package/components/virtual.js +9 -37
- package/components/wave/index.js +5 -31
- package/hooks/useDelayClose.js +2 -6
- package/hooks/useDocumentClick.js +8 -16
- package/hooks/useDraggable.d.ts +1 -1
- package/hooks/useDraggable.js +0 -9
- package/hooks/useKeyboard.d.ts +3 -3
- package/hooks/useKeyboard.js +0 -10
- package/hooks/useMouseOutsidable.js +0 -8
- package/hooks/useReceive.d.ts +1 -1
- package/hooks/useReceive.js +0 -4
- package/hooks/useRecordComponent.js +0 -6
- package/hooks/useRouter.js +7 -18
- package/hooks/useShowHideEvents.js +0 -3
- package/hooks/useState.d.ts +2 -2
- package/hooks/useState.js +2 -6
- package/i18n/en-US.js +0 -1
- package/i18n/index.d.ts +1 -1
- package/i18n/index.js +0 -7
- package/index.d.ts +2 -2
- package/index.js +2 -3
- package/package.json +2 -2
- package/styles/global.js +2 -3
- package/styles/keyframes.js +0 -1
- package/styles/theme.d.ts +1 -1
- package/styles/theme.js +4 -7
- package/styles/utils.d.ts +1 -1
- package/styles/utils.js +3 -17
- package/yarn-error.log +633 -517
- package/components/cascader/index.d.ts +0 -45
- package/components/datepicker/index.d.ts +0 -63
- package/components/select/select.d.ts +0 -33
- package/components/timepicker/panelPicker.d.ts +0 -54
- package/components/treeSelect/index.d.ts +0 -27
|
@@ -17,278 +17,224 @@ describe('Input', function () {
|
|
|
17
17
|
});
|
|
18
18
|
it('basic test', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
19
19
|
var _mount, instance, element, input;
|
|
20
|
-
|
|
21
20
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
22
|
-
while (1) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
instance.refs.__test.select();
|
|
39
|
-
|
|
40
|
-
case 9:
|
|
41
|
-
case "end":
|
|
42
|
-
return _context.stop();
|
|
43
|
-
}
|
|
21
|
+
while (1) switch (_context.prev = _context.next) {
|
|
22
|
+
case 0:
|
|
23
|
+
_mount = mount(BasicDemo), instance = _mount[0], element = _mount[1];
|
|
24
|
+
input = element.querySelector('input');
|
|
25
|
+
instance.refs.__test.focus();
|
|
26
|
+
input.value = 'test';
|
|
27
|
+
dispatchEvent(input, 'input');
|
|
28
|
+
_context.next = 7;
|
|
29
|
+
return wait();
|
|
30
|
+
case 7:
|
|
31
|
+
expect(instance.get('value')).eql('test');
|
|
32
|
+
instance.refs.__test.select();
|
|
33
|
+
case 9:
|
|
34
|
+
case "end":
|
|
35
|
+
return _context.stop();
|
|
44
36
|
}
|
|
45
37
|
}, _callee);
|
|
46
38
|
})));
|
|
47
39
|
it('search input', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
48
40
|
var onSearch, _mount2, instance, element, btn, input, form;
|
|
49
|
-
|
|
50
41
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
51
|
-
while (1) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
case 29:
|
|
93
|
-
expect(element.innerHTML).to.matchSnapshot();
|
|
94
|
-
|
|
95
|
-
case 30:
|
|
96
|
-
case "end":
|
|
97
|
-
return _context2.stop();
|
|
98
|
-
}
|
|
42
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
43
|
+
case 0:
|
|
44
|
+
onSearch = sinon.spy();
|
|
45
|
+
SearchDemo.prototype.search = onSearch;
|
|
46
|
+
_mount2 = mount(SearchDemo), instance = _mount2[0], element = _mount2[1];
|
|
47
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
48
|
+
btn = element.querySelector('.k-btn');
|
|
49
|
+
btn.click();
|
|
50
|
+
_context2.next = 8;
|
|
51
|
+
return wait();
|
|
52
|
+
case 8:
|
|
53
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
54
|
+
input = element.querySelector('input');
|
|
55
|
+
input.value = 'test';
|
|
56
|
+
dispatchEvent(input, 'input');
|
|
57
|
+
_context2.next = 14;
|
|
58
|
+
return wait();
|
|
59
|
+
case 14:
|
|
60
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
61
|
+
form = element.querySelector('form');
|
|
62
|
+
dispatchEvent(form, 'submit');
|
|
63
|
+
_context2.next = 19;
|
|
64
|
+
return wait();
|
|
65
|
+
case 19:
|
|
66
|
+
expect(onSearch.calledWith('test')).to.be.true;
|
|
67
|
+
btn.click();
|
|
68
|
+
_context2.next = 23;
|
|
69
|
+
return wait();
|
|
70
|
+
case 23:
|
|
71
|
+
expect(onSearch.callCount).to.eql(2);
|
|
72
|
+
expect(onSearch.calledWith('test')).to.be.true;
|
|
73
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
74
|
+
document.body.click();
|
|
75
|
+
_context2.next = 29;
|
|
76
|
+
return wait();
|
|
77
|
+
case 29:
|
|
78
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
79
|
+
case 30:
|
|
80
|
+
case "end":
|
|
81
|
+
return _context2.stop();
|
|
99
82
|
}
|
|
100
83
|
}, _callee2);
|
|
101
84
|
})));
|
|
102
85
|
it('should frozen value on input', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
103
86
|
var _mount3, instance, element, _element$querySelecto, input1, input2;
|
|
104
|
-
|
|
105
87
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
106
|
-
while (1) {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
case 13:
|
|
128
|
-
case "end":
|
|
129
|
-
return _context3.stop();
|
|
130
|
-
}
|
|
88
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
89
|
+
case 0:
|
|
90
|
+
_mount3 = mount(FrozenDemo), instance = _mount3[0], element = _mount3[1];
|
|
91
|
+
_element$querySelecto = element.querySelectorAll('input'), input1 = _element$querySelecto[0], input2 = _element$querySelecto[1];
|
|
92
|
+
dispatchEvent(input2, 'focus');
|
|
93
|
+
input2.value = '#123';
|
|
94
|
+
dispatchEvent(input2, 'input');
|
|
95
|
+
_context3.next = 7;
|
|
96
|
+
return wait();
|
|
97
|
+
case 7:
|
|
98
|
+
expect(input1.value).to.eql('#112233');
|
|
99
|
+
expect(input2.value).to.eql('#123');
|
|
100
|
+
dispatchEvent(input2, 'blur');
|
|
101
|
+
_context3.next = 12;
|
|
102
|
+
return wait();
|
|
103
|
+
case 12:
|
|
104
|
+
expect(input2.value).to.eql('#112233');
|
|
105
|
+
case 13:
|
|
106
|
+
case "end":
|
|
107
|
+
return _context3.stop();
|
|
131
108
|
}
|
|
132
109
|
}, _callee3);
|
|
133
110
|
})));
|
|
134
111
|
it('should auto expand or shrink textarea', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
135
112
|
var _mount4, instance, element, _element$querySelecto2, textarea1, textarea2;
|
|
136
|
-
|
|
137
113
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
138
|
-
while (1) {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
_context4.next = 25;
|
|
176
|
-
return wait();
|
|
177
|
-
|
|
178
|
-
case 25:
|
|
179
|
-
expect(textarea2.style.height).to.eql('104px');
|
|
180
|
-
|
|
181
|
-
case 26:
|
|
182
|
-
case "end":
|
|
183
|
-
return _context4.stop();
|
|
184
|
-
}
|
|
114
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
115
|
+
case 0:
|
|
116
|
+
_mount4 = mount(AutoRowsDemo), instance = _mount4[0], element = _mount4[1];
|
|
117
|
+
_element$querySelecto2 = element.querySelectorAll('textarea'), textarea1 = _element$querySelecto2[0], textarea2 = _element$querySelecto2[1]; // const lineHeight = parseInt(getComputedStyle(textarea1).lineHeight);
|
|
118
|
+
instance.set('value1', 'a\nb');
|
|
119
|
+
_context4.next = 5;
|
|
120
|
+
return wait();
|
|
121
|
+
case 5:
|
|
122
|
+
expect(textarea1.style.height).to.eql('50px');
|
|
123
|
+
instance.set('value1', 'a');
|
|
124
|
+
_context4.next = 9;
|
|
125
|
+
return wait();
|
|
126
|
+
case 9:
|
|
127
|
+
expect(textarea1.style.height).to.eql('32px');
|
|
128
|
+
instance.set('value2', 'a');
|
|
129
|
+
_context4.next = 13;
|
|
130
|
+
return wait();
|
|
131
|
+
case 13:
|
|
132
|
+
expect(textarea2.style.height).to.eql('68px');
|
|
133
|
+
instance.set('value2', 'a\nb\nc');
|
|
134
|
+
_context4.next = 17;
|
|
135
|
+
return wait();
|
|
136
|
+
case 17:
|
|
137
|
+
expect(textarea2.style.height).to.eql('68px');
|
|
138
|
+
instance.set('value2', 'a\nb\nc\nd');
|
|
139
|
+
_context4.next = 21;
|
|
140
|
+
return wait();
|
|
141
|
+
case 21:
|
|
142
|
+
expect(textarea2.style.height).to.eql('86px');
|
|
143
|
+
instance.set('value2', 'a\nb\nc\nd\ne\nf\ng\nh');
|
|
144
|
+
_context4.next = 25;
|
|
145
|
+
return wait();
|
|
146
|
+
case 25:
|
|
147
|
+
expect(textarea2.style.height).to.eql('104px');
|
|
148
|
+
case 26:
|
|
149
|
+
case "end":
|
|
150
|
+
return _context4.stop();
|
|
185
151
|
}
|
|
186
152
|
}, _callee4);
|
|
187
153
|
})));
|
|
188
154
|
it('should show or hide password', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
|
|
189
155
|
var _mount5, instance, element, input, icon, inputInstance;
|
|
190
|
-
|
|
191
156
|
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
192
|
-
while (1) {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
expect(element.querySelector('.k-icon')).to.eql(null);
|
|
234
|
-
expect(element.innerHTML).to.matchSnapshot();
|
|
235
|
-
|
|
236
|
-
case 30:
|
|
237
|
-
case "end":
|
|
238
|
-
return _context5.stop();
|
|
239
|
-
}
|
|
157
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
158
|
+
case 0:
|
|
159
|
+
_mount5 = mount(PasswordDemo), instance = _mount5[0], element = _mount5[1];
|
|
160
|
+
input = element.querySelector('input');
|
|
161
|
+
icon = element.querySelector('.k-icon');
|
|
162
|
+
inputInstance = instance.refs.__demo;
|
|
163
|
+
icon.click();
|
|
164
|
+
_context5.next = 7;
|
|
165
|
+
return wait();
|
|
166
|
+
case 7:
|
|
167
|
+
expect(input.type).to.eql('text');
|
|
168
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
169
|
+
icon.click();
|
|
170
|
+
_context5.next = 12;
|
|
171
|
+
return wait();
|
|
172
|
+
case 12:
|
|
173
|
+
expect(input.type).to.eql('password');
|
|
174
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
175
|
+
// simulate receive type
|
|
176
|
+
inputInstance.$props.type = 'number';
|
|
177
|
+
inputInstance.trigger('$receive:type', 'number');
|
|
178
|
+
_context5.next = 18;
|
|
179
|
+
return wait();
|
|
180
|
+
case 18:
|
|
181
|
+
expect(input.type).to.eql('number');
|
|
182
|
+
expect(icon.parentElement.parentElement).to.eql(null);
|
|
183
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
184
|
+
// simulate receive showPassword
|
|
185
|
+
inputInstance.$props.type = 'password';
|
|
186
|
+
inputInstance.$props.showPassword = false;
|
|
187
|
+
inputInstance.trigger('$receive:type', 'password');
|
|
188
|
+
inputInstance.trigger('$receive:showPassword', false);
|
|
189
|
+
_context5.next = 27;
|
|
190
|
+
return wait();
|
|
191
|
+
case 27:
|
|
192
|
+
expect(input.type).to.eql('password');
|
|
193
|
+
expect(element.querySelector('.k-icon')).to.eql(null);
|
|
194
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
195
|
+
case 30:
|
|
196
|
+
case "end":
|
|
197
|
+
return _context5.stop();
|
|
240
198
|
}
|
|
241
199
|
}, _callee5);
|
|
242
200
|
})));
|
|
243
201
|
it('should set width when dialog show and input mounted', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
|
|
244
202
|
var Demo, _mount6, instance, dialog, width;
|
|
245
|
-
|
|
246
203
|
return _regeneratorRuntime.wrap(function _callee6$(_context7) {
|
|
247
|
-
while (1) {
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
Demo
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
var _this;
|
|
257
|
-
|
|
258
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
259
|
-
args[_key] = arguments[_key];
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context6 = [this]).call(_context6, args)) || this;
|
|
263
|
-
_this.Dialog = Dialog;
|
|
264
|
-
_this.Input = Input;
|
|
265
|
-
return _this;
|
|
204
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
205
|
+
case 0:
|
|
206
|
+
Demo = /*#__PURE__*/function (_Component) {
|
|
207
|
+
_inheritsLoose(Demo, _Component);
|
|
208
|
+
function Demo() {
|
|
209
|
+
var _context6;
|
|
210
|
+
var _this;
|
|
211
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
212
|
+
args[_key] = arguments[_key];
|
|
266
213
|
}
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
214
|
+
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context6 = [this]).call(_context6, args)) || this;
|
|
215
|
+
_this.Dialog = Dialog;
|
|
216
|
+
_this.Input = Input;
|
|
217
|
+
return _this;
|
|
218
|
+
}
|
|
219
|
+
Demo.defaults = function defaults() {
|
|
220
|
+
return {
|
|
221
|
+
show: false
|
|
272
222
|
};
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
case 9:
|
|
289
|
-
case "end":
|
|
290
|
-
return _context7.stop();
|
|
291
|
-
}
|
|
223
|
+
};
|
|
224
|
+
return Demo;
|
|
225
|
+
}(Component);
|
|
226
|
+
Demo.template = "\n var Dialog = this.Dialog;\n var Input = this.Input;\n <Dialog value={this.get('show')}>\n <Input autoWidth placeholder=\"test\" v-if={this.get('show')} />\n </Dialog>\n ";
|
|
227
|
+
_mount6 = mount(Demo), instance = _mount6[0];
|
|
228
|
+
instance.set('show', true);
|
|
229
|
+
_context7.next = 6;
|
|
230
|
+
return wait(50);
|
|
231
|
+
case 6:
|
|
232
|
+
dialog = getElement('.k-dialog');
|
|
233
|
+
width = parseInt(dialog.querySelector('.k-input-inner').style.width);
|
|
234
|
+
expect(width).to.gt(1);
|
|
235
|
+
case 9:
|
|
236
|
+
case "end":
|
|
237
|
+
return _context7.stop();
|
|
292
238
|
}
|
|
293
239
|
}, _callee6);
|
|
294
240
|
})));
|
|
@@ -10,64 +10,60 @@ import { Wave } from '../wave';
|
|
|
10
10
|
import { context as ErrorContext } from '../form/useError';
|
|
11
11
|
export default function ($props, $blocks, $__proto__) {
|
|
12
12
|
var _classNameObj,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
children,
|
|
14
|
+
_this = this,
|
|
15
|
+
_children;
|
|
17
16
|
$blocks || ($blocks = {});
|
|
18
17
|
$props || ($props = {});
|
|
19
18
|
var $this = this;
|
|
20
19
|
var _$blocks = {};
|
|
21
20
|
var __$blocks = {};
|
|
22
|
-
|
|
23
21
|
var _this$get = this.get(),
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
22
|
+
className = _this$get.className,
|
|
23
|
+
style = _this$get.style,
|
|
24
|
+
type = _this$get.type,
|
|
25
|
+
value = _this$get.value,
|
|
26
|
+
defaultValue = _this$get.defaultValue,
|
|
27
|
+
placeholder = _this$get.placeholder,
|
|
28
|
+
clearable = _this$get.clearable,
|
|
29
|
+
disabled = _this$get.disabled,
|
|
30
|
+
size = _this$get.size,
|
|
31
|
+
rows = _this$get.rows,
|
|
32
|
+
autoWidth = _this$get.autoWidth,
|
|
33
|
+
fluid = _this$get.fluid,
|
|
34
|
+
width = _this$get.width,
|
|
35
|
+
stackClearIcon = _this$get.stackClearIcon,
|
|
36
|
+
frozenOnInput = _this$get.frozenOnInput,
|
|
37
|
+
readonly = _this$get.readonly,
|
|
38
|
+
inline = _this$get.inline,
|
|
39
|
+
waveDisabled = _this$get.waveDisabled,
|
|
40
|
+
resize = _this$get.resize,
|
|
41
|
+
click = _this$get['ev-click'],
|
|
42
|
+
mouseenter = _this$get['ev-mounseenter'],
|
|
43
|
+
mouseleave = _this$get['ev-mouseleave'],
|
|
44
|
+
rest = _objectWithoutPropertiesLoose(_this$get, _excluded);
|
|
48
45
|
var _this$frozen = this.frozen,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
46
|
+
inputing = _this$frozen.inputing.value,
|
|
47
|
+
originalValue = _this$frozen.originalValue.value,
|
|
48
|
+
startInput = _this$frozen.startInput,
|
|
49
|
+
onInput = _this$frozen.onInput,
|
|
50
|
+
endInput = _this$frozen.endInput;
|
|
54
51
|
var isNotAutoRows = isStringOrNumber(rows) && rows !== 'auto';
|
|
55
52
|
var classNameObj = (_classNameObj = {
|
|
56
53
|
'k-input': true
|
|
57
54
|
}, _classNameObj["k-" + size] = size !== 'default', _classNameObj['k-group'] = $blocks.prepend || $blocks.append, _classNameObj['k-disabled'] = disabled, _classNameObj['k-with-prefix'] = $blocks.prefix, _classNameObj['k-with-suffix'] = $blocks.suffix, _classNameObj['k-clearable'] = clearable, _classNameObj['k-auto-width'] = autoWidth, _classNameObj['k-fluid'] = fluid, _classNameObj['k-stack-clear'] = stackClearIcon, _classNameObj['k-inline'] = inline, _classNameObj["k-resize-" + resize] = type === 'textarea' && isNotAutoRows, _classNameObj["k-resize-none"] = type === 'textarea' && !isNotAutoRows, _classNameObj[className] = className, _classNameObj[makeStyles()] = true, _classNameObj);
|
|
58
55
|
var _this$showPassword = this.showPassword,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
56
|
+
isShowPassword = _this$showPassword.isShow,
|
|
57
|
+
toggleShowPassword = _this$showPassword.toggleShow,
|
|
58
|
+
showPasswordType = _this$showPassword.type,
|
|
59
|
+
showPasswordIcon = _this$showPassword.showIcon;
|
|
63
60
|
var _this$autoWidth = this.autoWidth,
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
fakeRef = _this$autoWidth.fakeRef,
|
|
62
|
+
fakeWidth = _this$autoWidth.width.value;
|
|
66
63
|
var height = this.autoRows;
|
|
67
64
|
var inputValue = frozenOnInput && inputing ? originalValue : value;
|
|
68
65
|
var hasInputValue = !isNullOrUndefined(inputValue);
|
|
69
66
|
var hasValue = hasInputValue && inputValue !== '';
|
|
70
|
-
|
|
71
67
|
var inputProps = _extends({}, getRestProps(this, rest), {
|
|
72
68
|
'ev-focus': startInput,
|
|
73
69
|
'ev-blur': endInput,
|
|
@@ -80,14 +76,12 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
80
76
|
style: autoWidth && fakeWidth ? {
|
|
81
77
|
width: fakeWidth + 'px'
|
|
82
78
|
} : undefined
|
|
83
|
-
});
|
|
79
|
+
});
|
|
80
|
+
// if we pass value to input element, the input is controlled and the
|
|
84
81
|
// defaultValue does not work
|
|
85
|
-
|
|
86
|
-
|
|
87
82
|
if (hasInputValue) {
|
|
88
83
|
inputProps.value = inputValue;
|
|
89
84
|
}
|
|
90
|
-
|
|
91
85
|
return _$ce(2, 'div', [$blocks.prepend ? (children = $blocks.prepend(noop), _$ce(2, 'div', children, 0, _$cn({
|
|
92
86
|
"k-input-prepend": true,
|
|
93
87
|
"k-input-padding": isTextBlock(children)
|
|
@@ -100,11 +94,9 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
100
94
|
return null;
|
|
101
95
|
}, __$blocks['prefix'] = function ($super, data) {
|
|
102
96
|
var block = $blocks['prefix'];
|
|
103
|
-
|
|
104
97
|
var callBlock = function callBlock() {
|
|
105
98
|
return _$blocks['prefix'].call($this, $super, data);
|
|
106
99
|
};
|
|
107
|
-
|
|
108
100
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
109
101
|
}, __$blocks['prefix'](_$no)), 0, 'k-input-prefix') : undefined, type !== 'textarea' ? _$cv('input', _extends({}, inputProps, {
|
|
110
102
|
'className': 'k-input-inner',
|
|
@@ -134,11 +126,9 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
134
126
|
return null;
|
|
135
127
|
}, __$blocks['suffix'] = function ($super, data) {
|
|
136
128
|
var block = $blocks['suffix'];
|
|
137
|
-
|
|
138
129
|
var callBlock = function callBlock() {
|
|
139
130
|
return _$blocks['suffix'].call($this, $super, data);
|
|
140
131
|
};
|
|
141
|
-
|
|
142
132
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
143
133
|
}, __$blocks['suffix'](_$no))], 0, 'k-input-suffix') : undefined, autoWidth ? _$ce(2, 'div', !hasValue ? placeholder : inputValue, 0, 'k-input-fake', null, null, fakeRef) : undefined], 0, 'k-input-wrapper')
|
|
144
134
|
});
|