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