@king-design/react 3.1.4-beta.2 → 3.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/__tests__/__snapshots__/Dialog.md +1 -1
- package/__tests__/__snapshots__/React Demos.md +260 -254
- 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 +7 -10
- package/components/affix/styles.js +1 -1
- package/components/affix/useStyle.js +8 -19
- package/components/badge/index.js +0 -5
- package/components/badge/index.vdt.js +7 -11
- package/components/badge/styles.js +1 -3
- package/components/breadcrumb/index.js +0 -7
- 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 +1 -4
- package/components/button/dynamicButton.d.ts +1 -1
- package/components/button/dynamicButton.js +2 -5
- package/components/button/group.js +2 -13
- package/components/button/group.vdt.js +5 -8
- package/components/button/index.js +3 -27
- package/components/button/index.spec.js +74 -96
- package/components/button/index.vdt.js +21 -31
- package/components/button/styles.d.ts +2 -2
- package/components/button/styles.js +8 -53
- package/components/card/column.js +0 -5
- package/components/card/column.vdt.js +5 -10
- package/components/card/index.js +0 -7
- package/components/card/index.vdt.js +5 -17
- package/components/card/styles.js +3 -6
- package/components/carousel/index.js +1 -19
- package/components/carousel/index.spec.js +127 -163
- package/components/carousel/index.vdt.js +12 -16
- package/components/carousel/item.js +0 -5
- package/components/carousel/item.vdt.js +4 -7
- package/components/carousel/styles.js +2 -3
- 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.d.ts +1 -1
- package/components/cascader/index.js +3 -18
- package/components/cascader/index.spec.js +300 -377
- package/components/cascader/index.vdt.js +15 -33
- package/components/cascader/styles.js +2 -8
- 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 +5 -26
- 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 +1 -13
- 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 -17
- 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 +2 -5
- package/components/colorpicker/drag.js +0 -5
- package/components/colorpicker/index.js +0 -7
- 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 +4 -15
- 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/config/index.js +3 -8
- package/components/config/index.spec.js +37 -50
- package/components/context.d.ts +2 -2
- package/components/context.js +2 -21
- package/components/copy/index.js +0 -7
- package/components/copy/index.spec.js +64 -86
- package/components/copy/index.vdt.js +4 -7
- package/components/copy/styles.js +0 -1
- package/components/copy/useCopy.js +13 -23
- 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 -15
- 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 +1154 -1464
- 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 +3 -12
- 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 +20 -38
- 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.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 -20
- package/components/dialog/base.js +1 -29
- package/components/dialog/base.vdt.js +14 -31
- package/components/dialog/index.js +6 -31
- package/components/dialog/index.spec.js +456 -627
- package/components/dialog/staticMethods.d.ts +1 -1
- package/components/dialog/staticMethods.js +2 -13
- package/components/dialog/styles.js +3 -14
- 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 +128 -170
- package/components/drawer/index.vdt.js +3 -9
- package/components/drawer/styles.d.ts +2 -2
- package/components/drawer/styles.js +1 -4
- package/components/dropdown/dropdown.d.ts +2 -2
- package/components/dropdown/dropdown.js +33 -90
- 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 +12 -29
- package/components/dropdown/menu.vdt.js +5 -13
- package/components/dropdown/styles.js +2 -11
- package/components/dropdown/useKeyboard.d.ts +2 -2
- package/components/dropdown/useKeyboard.js +8 -30
- package/components/dropdown/usePosition.d.ts +1 -1
- package/components/dropdown/usePosition.js +12 -21
- 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 +1 -2
- package/components/form/form.js +0 -18
- package/components/form/form.vdt.js +4 -7
- package/components/form/index.spec.js +1082 -1316
- 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 +2 -10
- package/components/form/useDirty.js +2 -8
- 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 +2 -8
- package/components/grid/useBreakpoints.js +0 -5
- package/components/grid/useGutter.js +9 -27
- package/components/icon/index.js +0 -10
- package/components/icon/index.vdt.js +8 -14
- package/components/icon/styles.js +1 -4
- package/components/input/index.d.ts +3 -3
- package/components/input/index.js +0 -13
- package/components/input/index.spec.js +185 -239
- package/components/input/index.vdt.js +46 -57
- package/components/input/search.js +0 -20
- package/components/input/search.vdt.js +6 -9
- package/components/input/styles.js +2 -29
- package/components/input/useAutoRows.js +6 -18
- package/components/input/useAutoWidth.js +0 -5
- package/components/input/useFocus.js +0 -2
- package/components/input/useFrozen.js +0 -6
- package/components/input/useShowPassword.js +2 -5
- package/components/layout/aside.js +6 -18
- package/components/layout/aside.vdt.js +5 -9
- package/components/layout/body.js +5 -18
- package/components/layout/footer.js +1 -10
- package/components/layout/header.js +9 -23
- package/components/layout/index.spec.js +24 -34
- package/components/layout/layout.js +9 -24
- package/components/layout/styles.js +6 -17
- 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 +22 -38
- package/components/menu/menu.js +2 -11
- package/components/menu/menu.vdt.js +6 -12
- package/components/menu/styles.js +4 -23
- package/components/menu/useDropdown.js +4 -10
- 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 +6 -9
- package/components/message/messages.js +0 -12
- package/components/message/messages.vdt.js +0 -1
- package/components/message/styles.js +2 -11
- 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 -32
- package/components/pagination/styles.js +3 -9
- package/components/popover/content.js +1 -5
- package/components/popover/content.vdt.js +4 -14
- package/components/popover/index.js +5 -10
- package/components/popover/index.spec.js +113 -150
- package/components/popover/styles.js +1 -1
- package/components/portal.d.ts +1 -1
- package/components/portal.js +2 -30
- 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 -17
- package/components/progress/styles.js +1 -7
- 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 +1 -13
- 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 +1 -4
- 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 -12
- package/components/scrollSelect/styles.js +1 -8
- 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.d.ts +2 -2
- package/components/select/base.js +3 -33
- package/components/select/base.vdt.js +27 -46
- package/components/select/group.js +0 -5
- package/components/select/group.vdt.js +4 -10
- package/components/select/index.spec.js +370 -464
- 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 +3 -34
- 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/useDraggble.js +2 -2
- package/components/select/useEqualWidth.js +0 -1
- package/components/select/useFilterable.js +9 -27
- package/components/select/useFocusout.js +0 -8
- 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 -7
- package/components/skeleton/item.vdt.js +1 -6
- package/components/skeleton/skeleton.js +0 -7
- package/components/skeleton/skeleton.vdt.js +6 -12
- package/components/skeleton/styles.d.ts +1 -1
- package/components/skeleton/styles.js +2 -3
- package/components/slider/index.d.ts +1 -1
- package/components/slider/index.js +0 -7
- package/components/slider/index.spec.js +502 -624
- package/components/slider/index.vdt.js +35 -50
- package/components/slider/styles.js +1 -19
- 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 -24
- package/components/spin/index.js +0 -7
- package/components/spin/index.vdt.js +4 -11
- package/components/spin/styles.js +1 -3
- package/components/spinner/index.d.ts +4 -4
- package/components/spinner/index.js +6 -18
- package/components/spinner/index.spec.js +359 -460
- package/components/spinner/index.vdt.js +12 -15
- package/components/spinner/styles.js +1 -11
- 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 +14 -32
- 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/memo.js +0 -6
- package/components/split/styles.d.ts +1 -1
- package/components/split/styles.js +1 -9
- package/components/split/useDraggable.js +11 -35
- package/components/split/useSize.js +2 -5
- package/components/steps/index.js +2 -13
- package/components/steps/index.spec.js +21 -27
- package/components/steps/index.vdt.js +9 -12
- package/components/steps/step.js +0 -5
- package/components/steps/step.vdt.js +8 -12
- package/components/steps/styles.js +1 -38
- package/components/switch/index.js +2 -23
- package/components/switch/index.spec.js +194 -234
- package/components/switch/index.vdt.js +16 -32
- package/components/switch/styles.js +4 -12
- package/components/switch/useDraggable.js +10 -18
- package/components/table/cell.js +0 -9
- 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 +25 -37
- package/components/table/exportTable.js +41 -55
- package/components/table/index.spec.js +817 -1026
- package/components/table/row.d.ts +1 -1
- package/components/table/row.js +12 -44
- package/components/table/row.vdt.js +27 -38
- package/components/table/styles.js +2 -18
- package/components/table/table.d.ts +5 -5
- package/components/table/table.js +18 -50
- package/components/table/table.vdt.js +61 -86
- 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 -8
- package/components/table/useExpandable.js +2 -5
- package/components/table/useFixedColumns.d.ts +1 -1
- package/components/table/useFixedColumns.js +3 -20
- package/components/table/useGroup.d.ts +1 -1
- package/components/table/useGroup.js +7 -25
- 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/useResetRowStatus.js +2 -6
- package/components/table/useResizable.js +4 -21
- 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 +97 -129
- package/components/tabs/index.vdt.js +13 -16
- package/components/tabs/styles.js +1 -23
- 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 +10 -30
- package/components/tag/base.js +0 -11
- package/components/tag/index.js +2 -4
- package/components/tag/index.spec.js +123 -156
- package/components/tag/index.vdt.js +8 -15
- package/components/tag/styles.d.ts +1 -1
- package/components/tag/styles.js +2 -18
- package/components/tag/tags.d.ts +2 -2
- package/components/tag/tags.js +0 -7
- package/components/tag/tags.vdt.js +10 -18
- package/components/tag/useChildren.js +0 -5
- package/components/tag/useDraggable.js +6 -15
- package/components/tag/useNowrap.js +10 -27
- package/components/timeline/item.js +0 -7
- package/components/timeline/item.vdt.js +4 -9
- package/components/timeline/styles.d.ts +2 -2
- package/components/timeline/styles.js +2 -6
- package/components/timeline/timeline.js +0 -5
- 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 +1 -2
- 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 +1 -4
- package/components/tooltip/content.js +0 -28
- package/components/tooltip/content.vdt.js +15 -27
- package/components/tooltip/index.js +3 -7
- package/components/tooltip/index.spec.js +400 -527
- package/components/tooltip/styles.d.ts +1 -1
- package/components/tooltip/styles.js +3 -13
- 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 +17 -36
- package/components/transfer/styles.js +1 -11
- package/components/transfer/useCheck.d.ts +1 -1
- package/components/transfer/useCheck.js +1 -16
- 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 +3 -22
- package/components/tree/index.spec.js +310 -388
- package/components/tree/index.vdt.js +12 -24
- package/components/tree/styles.js +3 -17
- package/components/tree/useChecked.js +3 -27
- package/components/tree/useDraggable.js +14 -44
- package/components/tree/useExpanded.js +28 -46
- package/components/tree/useFilter.js +3 -10
- package/components/tree/useNodes.d.ts +3 -3
- 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 -37
- package/components/treeSelect/index.spec.js +123 -160
- package/components/treeSelect/index.vdt.js +14 -20
- package/components/treeSelect/styles.js +1 -2
- 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 -248
- package/components/upload/index.vdt.js +12 -28
- package/components/upload/styles.js +2 -28
- package/components/upload/useAccept.js +2 -10
- package/components/upload/useDrag.js +0 -7
- package/components/upload/useFiles.js +103 -148
- package/components/upload/useShowImage.js +0 -3
- package/components/upload/useUpload.js +47 -69
- package/components/utils.d.ts +6 -6
- package/components/utils.js +12 -56
- package/components/virtual.js +9 -37
- package/components/wave/index.js +5 -32
- package/components/wave/styles.js +1 -1
- package/hooks/useDelayClose.js +2 -7
- 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/useResizeObserver.js +0 -2
- 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 -5
- package/styles/keyframes.js +0 -1
- package/styles/theme.d.ts +1 -1
- package/styles/theme.js +2 -5
- package/styles/utils.d.ts +1 -1
- package/styles/utils.js +3 -17
- package/yarn-error.log +528 -0
|
@@ -10,45 +10,33 @@ var typeDefs = {
|
|
|
10
10
|
};
|
|
11
11
|
export var Messages = /*#__PURE__*/function (_Component) {
|
|
12
12
|
_inheritsLoose(Messages, _Component);
|
|
13
|
-
|
|
14
13
|
function Messages() {
|
|
15
14
|
var _context;
|
|
16
|
-
|
|
17
15
|
var _this;
|
|
18
|
-
|
|
19
16
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
20
17
|
args[_key] = arguments[_key];
|
|
21
18
|
}
|
|
22
|
-
|
|
23
19
|
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
24
20
|
_this.messages = [];
|
|
25
21
|
_this.config = useConfigContext();
|
|
26
22
|
return _this;
|
|
27
23
|
}
|
|
28
|
-
|
|
29
24
|
var _proto = Messages.prototype;
|
|
30
|
-
|
|
31
25
|
_proto.notice = function notice(message) {
|
|
32
26
|
this.messages.push(message);
|
|
33
27
|
this.forceUpdate();
|
|
34
28
|
};
|
|
35
|
-
|
|
36
29
|
_proto.delete = function _delete(key) {
|
|
37
30
|
var messages = this.messages;
|
|
38
|
-
|
|
39
31
|
var index = _findIndexInstanceProperty(messages).call(messages, function (message) {
|
|
40
32
|
return message.key === key;
|
|
41
33
|
});
|
|
42
|
-
|
|
43
34
|
if (process.env.NODE_ENV !== 'production' && !~index) {
|
|
44
35
|
throw new Error('You are removing a message that does not exist.');
|
|
45
36
|
}
|
|
46
|
-
|
|
47
37
|
_spliceInstanceProperty(messages).call(messages, index, 1);
|
|
48
|
-
|
|
49
38
|
this.forceUpdate();
|
|
50
39
|
};
|
|
51
|
-
|
|
52
40
|
return Messages;
|
|
53
41
|
}(Component);
|
|
54
42
|
Messages.template = template;
|
|
@@ -8,37 +8,29 @@ var defaults = {
|
|
|
8
8
|
get transition() {
|
|
9
9
|
return theme.transition.middle;
|
|
10
10
|
},
|
|
11
|
-
|
|
12
11
|
top: "10px",
|
|
13
12
|
left: "0px",
|
|
14
13
|
transform: "translateY(-10px)",
|
|
15
|
-
|
|
16
14
|
get bgColor() {
|
|
17
15
|
return theme.color.bg;
|
|
18
16
|
},
|
|
19
|
-
|
|
20
17
|
get borderRadius() {
|
|
21
18
|
return theme.borderRadius;
|
|
22
19
|
},
|
|
23
|
-
|
|
24
20
|
gap: "10px",
|
|
25
21
|
boxShadow: 'none',
|
|
26
22
|
padding: "7px 33px 8px 8px",
|
|
27
23
|
fontSize: '12px',
|
|
28
|
-
|
|
29
24
|
get color() {
|
|
30
25
|
return theme.color.text;
|
|
31
26
|
},
|
|
32
|
-
|
|
33
27
|
minWidth: '400px',
|
|
34
28
|
maxWidth: '700px',
|
|
35
29
|
minHeight: '32px',
|
|
36
30
|
textAlign: 'left',
|
|
37
|
-
|
|
38
31
|
get border() {
|
|
39
32
|
return "1px solid " + theme.color.border;
|
|
40
33
|
},
|
|
41
|
-
|
|
42
34
|
icon: {
|
|
43
35
|
// color: `inherit`,
|
|
44
36
|
fontSize: "18px",
|
|
@@ -51,15 +43,14 @@ setDefault(function () {
|
|
|
51
43
|
message = deepDefaults(theme, {
|
|
52
44
|
message: defaults
|
|
53
45
|
}).message;
|
|
54
|
-
makeMessagesStyles == null
|
|
55
|
-
makeMessageStyles == null
|
|
46
|
+
makeMessagesStyles == null || makeMessagesStyles.clearCache();
|
|
47
|
+
makeMessageStyles == null || makeMessageStyles.clearCache();
|
|
56
48
|
});
|
|
57
49
|
export var makeMessagesStyles = cache(function makeMessagesStyles(k) {
|
|
58
50
|
return /*#__PURE__*/css("position:fixed;top:", message.top, ";left:", message.left, ";width:100%;pointer-events:none;z-index:", theme.maxZIndex + 1, ";");
|
|
59
51
|
});
|
|
60
52
|
export var makeMessageStyles = cache(function makeMessageStyles(k) {
|
|
61
53
|
var _context;
|
|
62
|
-
|
|
63
54
|
return /*#__PURE__*/css("text-align:center;width:100%;font-size:", message.fontSize, ";color:", message.color, ";.", k, "-message-container{display:inline-block;box-shadow:", message.boxShadow, ";border-radius:", message.borderRadius, ";margin-bottom:", message.gap, ";pointer-events:all;min-width:", message.minWidth, ";max-width:", message.maxWidth, ";position:relative;text-align:", message.textAlign, ";min-height:", message.minHeight, ";}.", k, "-message-wrapper{position:relative;display:inline-block;&.", k, "-with-icon{padding-left:calc(", message.icon.left, " + 14px);}}.", k, "-message-content{display:inline-block;padding:", message.padding, ";vertical-align:middle;word-break:break-word;word-wrap:break-word;}.", k, "-message-close{vertical-align:middle;position:absolute;right:0;top:0;&:hover{background:none;}}.", k, "-message-icon{position:absolute;left:", message.icon.left, ";top:", message.icon.top, ";font-size:", message.icon.fontSize, ";}", _mapInstanceProperty(_context = ['info', 'error', 'success', 'warning']).call(_context, function (type) {
|
|
64
55
|
var color = theme.color[type === 'error' ? 'danger' : type];
|
|
65
56
|
return /*#__PURE__*/css("&.", k, "-", type, "{.", k, "-message-container{background:", palette(color, -4), ";}.", k, "-message-icon{color:", color, ";}}");
|
|
@@ -21,7 +21,6 @@ var typeDefs = {
|
|
|
21
21
|
disableBtn: Function,
|
|
22
22
|
disablePage: Function
|
|
23
23
|
};
|
|
24
|
-
|
|
25
24
|
var defaults = function defaults() {
|
|
26
25
|
return {
|
|
27
26
|
size: 'default',
|
|
@@ -34,38 +33,29 @@ var defaults = function defaults() {
|
|
|
34
33
|
showLimits: true
|
|
35
34
|
};
|
|
36
35
|
};
|
|
37
|
-
|
|
38
36
|
var events = {
|
|
39
37
|
change: true
|
|
40
38
|
};
|
|
41
39
|
export var Pagination = /*#__PURE__*/function (_Component) {
|
|
42
40
|
_inheritsLoose(Pagination, _Component);
|
|
43
|
-
|
|
44
41
|
function Pagination() {
|
|
45
42
|
var _context;
|
|
46
|
-
|
|
47
43
|
var _this;
|
|
48
|
-
|
|
49
44
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
50
45
|
args[_key] = arguments[_key];
|
|
51
46
|
}
|
|
52
|
-
|
|
53
47
|
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
54
48
|
_this.ignore = false;
|
|
55
49
|
_this.config = useConfigContext();
|
|
56
50
|
return _this;
|
|
57
51
|
}
|
|
58
|
-
|
|
59
52
|
var _proto = Pagination.prototype;
|
|
60
|
-
|
|
61
53
|
_proto.init = function init() {
|
|
62
54
|
var _this2 = this;
|
|
63
|
-
|
|
64
55
|
// avoid setting incorrect value
|
|
65
56
|
this.changePage(this.get('value'));
|
|
66
57
|
this.watch('limit', function (v) {
|
|
67
58
|
var oldvalue = _this2.get('value');
|
|
68
|
-
|
|
69
59
|
if (oldvalue !== 1) {
|
|
70
60
|
// we should not silent it, but let it trigger change event
|
|
71
61
|
// to sync the value to parent
|
|
@@ -73,12 +63,9 @@ export var Pagination = /*#__PURE__*/function (_Component) {
|
|
|
73
63
|
// change event again in bellow $change:value callback
|
|
74
64
|
// #341
|
|
75
65
|
_this2.ignore = true;
|
|
76
|
-
|
|
77
66
|
_this2.set('value', 1);
|
|
78
|
-
|
|
79
67
|
_this2.ignore = false;
|
|
80
68
|
}
|
|
81
|
-
|
|
82
69
|
_this2.trigger('change', {
|
|
83
70
|
limit: v,
|
|
84
71
|
value: 1
|
|
@@ -88,7 +75,6 @@ export var Pagination = /*#__PURE__*/function (_Component) {
|
|
|
88
75
|
});
|
|
89
76
|
this.watch('value', function (v) {
|
|
90
77
|
if (_this2.ignore) return;
|
|
91
|
-
|
|
92
78
|
_this2.trigger('change', {
|
|
93
79
|
limit: _this2.get('limit'),
|
|
94
80
|
value: v
|
|
@@ -97,83 +83,61 @@ export var Pagination = /*#__PURE__*/function (_Component) {
|
|
|
97
83
|
inited: true
|
|
98
84
|
});
|
|
99
85
|
};
|
|
100
|
-
|
|
101
86
|
_proto.changePage = function changePage(page) {
|
|
102
87
|
var _this$get = this.get(),
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
88
|
+
total = _this$get.total,
|
|
89
|
+
limit = _this$get.limit;
|
|
106
90
|
var totalPages = Math.ceil(total / limit);
|
|
107
|
-
|
|
108
91
|
if (page > totalPages) {
|
|
109
92
|
page = totalPages;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
|
|
93
|
+
}
|
|
94
|
+
// perhaps totalPages is 0
|
|
113
95
|
if (page < 1) {
|
|
114
96
|
page = 1;
|
|
115
97
|
}
|
|
116
|
-
|
|
117
98
|
if (this.get('value') !== page) {
|
|
118
99
|
this.set('value', page);
|
|
119
100
|
}
|
|
120
101
|
};
|
|
121
|
-
|
|
122
102
|
_proto.prev = function prev() {
|
|
123
103
|
this.changePage(this.get('value') - 1);
|
|
124
104
|
};
|
|
125
|
-
|
|
126
105
|
_proto.next = function next() {
|
|
127
106
|
this.changePage(this.get('value') + 1);
|
|
128
107
|
};
|
|
129
|
-
|
|
130
108
|
_proto.fastPrev = function fastPrev() {
|
|
131
109
|
var _this$get2 = this.get(),
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
110
|
+
value = _this$get2.value,
|
|
111
|
+
counts = _this$get2.counts;
|
|
135
112
|
var page = value - Math.ceil(Number(counts) / 2);
|
|
136
113
|
this.changePage(page);
|
|
137
114
|
};
|
|
138
|
-
|
|
139
115
|
_proto.fastNext = function fastNext() {
|
|
140
116
|
var _this$get3 = this.get(),
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
117
|
+
value = _this$get3.value,
|
|
118
|
+
counts = _this$get3.counts;
|
|
144
119
|
var page = value + Math.ceil(Number(counts) / 2);
|
|
145
120
|
this.changePage(page);
|
|
146
121
|
};
|
|
147
|
-
|
|
148
122
|
_proto.goto = function goto(e) {
|
|
149
123
|
var _this$get4 = this.get(),
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
124
|
+
disablePage = _this$get4.disablePage,
|
|
125
|
+
limit = _this$get4.limit;
|
|
153
126
|
var value = parseInt(e.target.value) || 1;
|
|
154
|
-
|
|
155
127
|
if (disablePage && disablePage(value, limit)) {
|
|
156
128
|
return;
|
|
157
129
|
}
|
|
158
|
-
|
|
159
130
|
this.changePage(value);
|
|
160
131
|
};
|
|
161
|
-
|
|
162
132
|
return Pagination;
|
|
163
133
|
}(Component);
|
|
164
134
|
Pagination.template = template;
|
|
165
135
|
Pagination.typeDefs = typeDefs;
|
|
166
136
|
Pagination.defaults = defaults;
|
|
167
137
|
Pagination.events = events;
|
|
168
|
-
|
|
169
138
|
__decorate([bind], Pagination.prototype, "changePage", null);
|
|
170
|
-
|
|
171
139
|
__decorate([bind], Pagination.prototype, "prev", null);
|
|
172
|
-
|
|
173
140
|
__decorate([bind], Pagination.prototype, "next", null);
|
|
174
|
-
|
|
175
141
|
__decorate([bind], Pagination.prototype, "fastPrev", null);
|
|
176
|
-
|
|
177
142
|
__decorate([bind], Pagination.prototype, "fastNext", null);
|
|
178
|
-
|
|
179
143
|
__decorate([bind], Pagination.prototype, "goto", null);
|
|
@@ -15,206 +15,166 @@ describe('Pagination', function () {
|
|
|
15
15
|
});
|
|
16
16
|
it('basic test', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
17
17
|
var _mount, instance, element, pagination, btns, prev, next;
|
|
18
|
-
|
|
19
18
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
20
|
-
while (1) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
-
return wait();
|
|
69
|
-
|
|
70
|
-
case 34:
|
|
71
|
-
expect(pagination.innerHTML).to.matchSnapshot();
|
|
72
|
-
expect(instance.get('value1')).to.eql(1);
|
|
73
|
-
|
|
74
|
-
case 36:
|
|
75
|
-
case "end":
|
|
76
|
-
return _context.stop();
|
|
77
|
-
}
|
|
19
|
+
while (1) switch (_context.prev = _context.next) {
|
|
20
|
+
case 0:
|
|
21
|
+
_mount = mount(BasicDemo), instance = _mount[0], element = _mount[1];
|
|
22
|
+
pagination = element.querySelector('.k-pagination');
|
|
23
|
+
btns = pagination.querySelectorAll('.k-btns .k-btn');
|
|
24
|
+
prev = btns[0];
|
|
25
|
+
next = btns[btns.length - 1];
|
|
26
|
+
prev.click();
|
|
27
|
+
_context.next = 8;
|
|
28
|
+
return wait();
|
|
29
|
+
case 8:
|
|
30
|
+
expect(pagination.innerHTML).to.matchSnapshot();
|
|
31
|
+
expect(instance.get('value1')).to.eql(1);
|
|
32
|
+
next.click();
|
|
33
|
+
next.click();
|
|
34
|
+
_context.next = 14;
|
|
35
|
+
return wait();
|
|
36
|
+
case 14:
|
|
37
|
+
expect(pagination.innerHTML).to.matchSnapshot();
|
|
38
|
+
expect(instance.get('value1')).to.eql(3);
|
|
39
|
+
prev.click();
|
|
40
|
+
_context.next = 19;
|
|
41
|
+
return wait();
|
|
42
|
+
case 19:
|
|
43
|
+
expect(pagination.innerHTML).to.matchSnapshot();
|
|
44
|
+
expect(instance.get('value1')).to.eql(2);
|
|
45
|
+
pagination.querySelector('.k-pagination-ellipsis').click();
|
|
46
|
+
_context.next = 24;
|
|
47
|
+
return wait();
|
|
48
|
+
case 24:
|
|
49
|
+
expect(pagination.innerHTML).to.matchSnapshot();
|
|
50
|
+
expect(instance.get('value1')).to.eql(6);
|
|
51
|
+
pagination.querySelector('.k-pagination-ellipsis').click();
|
|
52
|
+
_context.next = 29;
|
|
53
|
+
return wait();
|
|
54
|
+
case 29:
|
|
55
|
+
expect(pagination.innerHTML).to.matchSnapshot();
|
|
56
|
+
expect(instance.get('value1')).to.eql(2);
|
|
57
|
+
// change limit
|
|
58
|
+
instance.refs.__test.set('limit', 20);
|
|
59
|
+
_context.next = 34;
|
|
60
|
+
return wait();
|
|
61
|
+
case 34:
|
|
62
|
+
expect(pagination.innerHTML).to.matchSnapshot();
|
|
63
|
+
expect(instance.get('value1')).to.eql(1);
|
|
64
|
+
case 36:
|
|
65
|
+
case "end":
|
|
66
|
+
return _context.stop();
|
|
78
67
|
}
|
|
79
68
|
}, _callee);
|
|
80
69
|
})));
|
|
81
70
|
it('goto test', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
82
71
|
var _mount2, instance, element, input;
|
|
83
|
-
|
|
84
72
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
85
|
-
while (1) {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
case 14:
|
|
108
|
-
case "end":
|
|
109
|
-
return _context2.stop();
|
|
110
|
-
}
|
|
73
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
74
|
+
case 0:
|
|
75
|
+
_mount2 = mount(GotoDemo), instance = _mount2[0], element = _mount2[1];
|
|
76
|
+
input = element.querySelector('.k-input-inner');
|
|
77
|
+
input.value = '45';
|
|
78
|
+
dispatchEvent(input, 'change');
|
|
79
|
+
_context2.next = 6;
|
|
80
|
+
return wait();
|
|
81
|
+
case 6:
|
|
82
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
83
|
+
expect(instance.get('value')).to.eql(20);
|
|
84
|
+
input.value = '-10';
|
|
85
|
+
dispatchEvent(input, 'change');
|
|
86
|
+
_context2.next = 12;
|
|
87
|
+
return wait();
|
|
88
|
+
case 12:
|
|
89
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
90
|
+
expect(instance.get('value')).to.eql(1);
|
|
91
|
+
case 14:
|
|
92
|
+
case "end":
|
|
93
|
+
return _context2.stop();
|
|
111
94
|
}
|
|
112
95
|
}, _callee2);
|
|
113
96
|
})));
|
|
114
97
|
it('should trigger change event once', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
115
98
|
var fn, _mount3, instance, element;
|
|
116
|
-
|
|
117
99
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
118
|
-
while (1) {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
case 11:
|
|
143
|
-
case "end":
|
|
144
|
-
return _context3.stop();
|
|
145
|
-
}
|
|
100
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
101
|
+
case 0:
|
|
102
|
+
fn = CurrentDemo.prototype._fetch2 = sinon.spy(function () {
|
|
103
|
+
instance.forceUpdate();
|
|
104
|
+
});
|
|
105
|
+
_mount3 = mount(CurrentDemo), instance = _mount3[0], element = _mount3[1];
|
|
106
|
+
instance.set('value2', 2);
|
|
107
|
+
_context3.next = 5;
|
|
108
|
+
return wait();
|
|
109
|
+
case 5:
|
|
110
|
+
expect(fn.callCount).to.eql(1);
|
|
111
|
+
instance.set('limit', 50);
|
|
112
|
+
_context3.next = 9;
|
|
113
|
+
return wait();
|
|
114
|
+
case 9:
|
|
115
|
+
expect(fn.callCount).to.eql(2);
|
|
116
|
+
expect(fn.lastCall.lastArg).to.eql({
|
|
117
|
+
value: 1,
|
|
118
|
+
limit: 50
|
|
119
|
+
});
|
|
120
|
+
case 11:
|
|
121
|
+
case "end":
|
|
122
|
+
return _context3.stop();
|
|
146
123
|
}
|
|
147
124
|
}, _callee3);
|
|
148
125
|
})));
|
|
149
126
|
it('should not goto disabled page', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
150
127
|
var _mount4, instance, element, input;
|
|
151
|
-
|
|
152
128
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
153
|
-
while (1) {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
case 10:
|
|
170
|
-
case "end":
|
|
171
|
-
return _context4.stop();
|
|
172
|
-
}
|
|
129
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
130
|
+
case 0:
|
|
131
|
+
_mount4 = mount(DisableDemo), instance = _mount4[0], element = _mount4[1];
|
|
132
|
+
input = element.querySelector('.k-input-inner');
|
|
133
|
+
dispatchEvent(input, 'focus');
|
|
134
|
+
input.value = '11';
|
|
135
|
+
dispatchEvent(input, 'change');
|
|
136
|
+
dispatchEvent(input, 'blur');
|
|
137
|
+
_context4.next = 8;
|
|
138
|
+
return wait();
|
|
139
|
+
case 8:
|
|
140
|
+
expect(input.value).to.eql('10');
|
|
141
|
+
expect(instance.get('value2')).to.eql(10);
|
|
142
|
+
case 10:
|
|
143
|
+
case "end":
|
|
144
|
+
return _context4.stop();
|
|
173
145
|
}
|
|
174
146
|
}, _callee4);
|
|
175
147
|
})));
|
|
176
148
|
it('should not set value to 0 when total is 0 on intialization', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
|
|
177
149
|
var Demo, _mount5, instance;
|
|
178
|
-
|
|
179
150
|
return _regeneratorRuntime.wrap(function _callee5$(_context6) {
|
|
180
|
-
while (1) {
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
Demo
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
var _this;
|
|
190
|
-
|
|
191
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
192
|
-
args[_key] = arguments[_key];
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context5 = [this]).call(_context5, args)) || this;
|
|
196
|
-
_this.Pagination = Pagination;
|
|
197
|
-
return _this;
|
|
151
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
152
|
+
case 0:
|
|
153
|
+
Demo = /*#__PURE__*/function (_Component) {
|
|
154
|
+
_inheritsLoose(Demo, _Component);
|
|
155
|
+
function Demo() {
|
|
156
|
+
var _context5;
|
|
157
|
+
var _this;
|
|
158
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
159
|
+
args[_key] = arguments[_key];
|
|
198
160
|
}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
161
|
+
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context5 = [this]).call(_context5, args)) || this;
|
|
162
|
+
_this.Pagination = Pagination;
|
|
163
|
+
return _this;
|
|
164
|
+
}
|
|
165
|
+
Demo.defaults = function defaults() {
|
|
166
|
+
return {
|
|
167
|
+
page: 1
|
|
204
168
|
};
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
case 4:
|
|
215
|
-
case "end":
|
|
216
|
-
return _context6.stop();
|
|
217
|
-
}
|
|
169
|
+
};
|
|
170
|
+
return Demo;
|
|
171
|
+
}(Component);
|
|
172
|
+
Demo.template = "\n const { Pagination } = this;\n <Pagination total={0} v-model=\"page\" />\n ";
|
|
173
|
+
_mount5 = mount(Demo), instance = _mount5[0]; // await wait();
|
|
174
|
+
expect(instance.get('page')).to.eql(1);
|
|
175
|
+
case 4:
|
|
176
|
+
case "end":
|
|
177
|
+
return _context6.stop();
|
|
218
178
|
}
|
|
219
179
|
}, _callee5);
|
|
220
180
|
})));
|