@king-design/vue 2.1.2 → 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 +416 -503
- 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 +7 -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 +33 -28
- 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 +13 -28
- 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 +18 -40
- 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 +4 -3
- package/components/utils.js +24 -43
- package/components/virtual.js +14 -39
- 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 +1013 -0
- 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
|
@@ -8,7 +8,6 @@ export function useDraggable(data) {
|
|
|
8
8
|
var originIndex;
|
|
9
9
|
var originData;
|
|
10
10
|
var draggingIndex;
|
|
11
|
-
|
|
12
11
|
function onRowDragStart(e, tableRow) {
|
|
13
12
|
draggingIndex = originIndex = tableRow.get('index');
|
|
14
13
|
var key = tableRow.get('key');
|
|
@@ -19,28 +18,22 @@ export function useDraggable(data) {
|
|
|
19
18
|
from: draggingIndex
|
|
20
19
|
});
|
|
21
20
|
}
|
|
22
|
-
|
|
23
21
|
function onRowDragOver(e, tableRow) {
|
|
24
22
|
var _context;
|
|
25
|
-
|
|
26
23
|
e.preventDefault();
|
|
27
24
|
e.stopPropagation();
|
|
28
25
|
var newIndex = tableRow.get('index');
|
|
29
|
-
if (newIndex === draggingIndex) return;
|
|
30
|
-
|
|
26
|
+
if (newIndex === draggingIndex) return;
|
|
27
|
+
// swap data
|
|
31
28
|
var newData = _sliceInstanceProperty(_context = data.value).call(_context);
|
|
32
|
-
|
|
33
29
|
var item = _spliceInstanceProperty(newData).call(newData, draggingIndex, 1)[0];
|
|
34
|
-
|
|
35
30
|
_spliceInstanceProperty(newData).call(newData, newIndex, 0, item);
|
|
36
|
-
|
|
37
31
|
draggingIndex = newIndex;
|
|
38
32
|
data.set(newData);
|
|
39
33
|
}
|
|
40
|
-
|
|
41
34
|
function onRowDragEnd(e, tableRow) {
|
|
42
|
-
e.preventDefault();
|
|
43
|
-
|
|
35
|
+
e.preventDefault();
|
|
36
|
+
// revert to origin data, then set to new data to trigger animation
|
|
44
37
|
var newData = data.value;
|
|
45
38
|
data.set(originData);
|
|
46
39
|
nextTick(function () {
|
|
@@ -53,7 +46,6 @@ export function useDraggable(data) {
|
|
|
53
46
|
});
|
|
54
47
|
});
|
|
55
48
|
}
|
|
56
|
-
|
|
57
49
|
return {
|
|
58
50
|
onRowDragStart: onRowDragStart,
|
|
59
51
|
onRowDragOver: onRowDragOver,
|
|
@@ -3,17 +3,14 @@ import { inArray } from './useChecked';
|
|
|
3
3
|
import { toggleArray } from '../utils';
|
|
4
4
|
export function useExpandable() {
|
|
5
5
|
var instance = useInstance();
|
|
6
|
-
|
|
7
6
|
function isExpanded(key) {
|
|
8
7
|
return inArray(instance.get('expandedKeys'), key);
|
|
9
8
|
}
|
|
10
|
-
|
|
11
9
|
instance.on('clickRow', function (data, index, key) {
|
|
12
10
|
if (instance.get('rowExpandable')) {
|
|
13
11
|
var _instance$get = instance.get(),
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
expandedKeys = _instance$get.expandedKeys,
|
|
13
|
+
$blocks = _instance$get.$blocks;
|
|
17
14
|
if (!$blocks || !$blocks.expand) return;
|
|
18
15
|
instance.set('expandedKeys', toggleArray(expandedKeys, key));
|
|
19
16
|
}
|
|
@@ -3,7 +3,7 @@ import { TableColumn, TableColumnProps } from './column';
|
|
|
3
3
|
import type { TableProps, TableRowKey } from './table';
|
|
4
4
|
import { State } from '../../hooks/useState';
|
|
5
5
|
import type { useScroll } from './useScroll';
|
|
6
|
-
|
|
6
|
+
type ScrollPosition = 'left' | 'middle' | 'right';
|
|
7
7
|
export declare const context: {
|
|
8
8
|
Provider: import("intact").ComponentConstructor<import("intact").Component<import("../context").ProviderProps<any>, {}, {}, {}>>;
|
|
9
9
|
Consumer: import("intact").ComponentConstructor<import("intact").Component<import("../context").ConsumerProps<any>, {}, {}, {}>>;
|
|
@@ -8,7 +8,7 @@ import { createContext } from '../context';
|
|
|
8
8
|
export var context = createContext();
|
|
9
9
|
export function useFixedColumns(getColumns, _ref, widthMap) {
|
|
10
10
|
var scrollRef = _ref.scrollRef,
|
|
11
|
-
|
|
11
|
+
callbacks = _ref.callbacks;
|
|
12
12
|
var instance = useInstance();
|
|
13
13
|
var scrollPosition = useState(null);
|
|
14
14
|
var hasFixed = useState(false);
|
|
@@ -32,7 +32,6 @@ export function useFixedColumns(getColumns, _ref, widthMap) {
|
|
|
32
32
|
onUnmounted(function () {
|
|
33
33
|
window.removeEventListener('resize', throttleUpdate);
|
|
34
34
|
});
|
|
35
|
-
|
|
36
35
|
function handleFixedColumns() {
|
|
37
36
|
var columns = getColumns();
|
|
38
37
|
hasFixedLeft = false;
|
|
@@ -45,45 +44,34 @@ export function useFixedColumns(getColumns, _ref, widthMap) {
|
|
|
45
44
|
var key = props.key;
|
|
46
45
|
offsetMap[key] = 0;
|
|
47
46
|
var fixed = props.fixed;
|
|
48
|
-
|
|
49
47
|
if (fixed === 'left') {
|
|
50
48
|
var value = 0;
|
|
51
49
|
var prevVNode = props.prevVNode;
|
|
52
|
-
|
|
53
50
|
while (prevVNode) {
|
|
54
51
|
var _props = prevVNode.props;
|
|
55
|
-
|
|
56
52
|
if (_props.fixed === 'left') {
|
|
57
53
|
if (process.env.NODE_ENV !== 'production') {
|
|
58
54
|
validateWidth(_props);
|
|
59
55
|
}
|
|
60
|
-
|
|
61
56
|
value += widthMap.value[_props.key] || parseInt(_props.width, 10) || 0;
|
|
62
57
|
}
|
|
63
|
-
|
|
64
58
|
prevVNode = _props.prevVNode;
|
|
65
59
|
}
|
|
66
|
-
|
|
67
60
|
offsetMap[key] = value;
|
|
68
61
|
hasFixedLeft = true;
|
|
69
62
|
} else if (fixed === 'right') {
|
|
70
63
|
var _value = 0;
|
|
71
64
|
var lastVNode = columns[columns.length - 1];
|
|
72
|
-
|
|
73
65
|
while (vNode !== lastVNode) {
|
|
74
66
|
var _props2 = lastVNode.props;
|
|
75
|
-
|
|
76
67
|
if (_props2.fixed === 'right') {
|
|
77
68
|
if (process.env.NODE_ENV !== 'production') {
|
|
78
69
|
validateWidth(_props2);
|
|
79
70
|
}
|
|
80
|
-
|
|
81
71
|
_value += widthMap.value[_props2.key] || parseInt(_props2.width, 10) || 0;
|
|
82
72
|
}
|
|
83
|
-
|
|
84
73
|
lastVNode = _props2.prevVNode;
|
|
85
74
|
}
|
|
86
|
-
|
|
87
75
|
offsetMap[key] = _value;
|
|
88
76
|
hasFixedRight = true;
|
|
89
77
|
}
|
|
@@ -91,24 +79,20 @@ export function useFixedColumns(getColumns, _ref, widthMap) {
|
|
|
91
79
|
});
|
|
92
80
|
hasFixed.set(hasFixedLeft || hasFixedRight);
|
|
93
81
|
}
|
|
94
|
-
|
|
95
82
|
function setScrollPosition(scrollLeft) {
|
|
96
83
|
if (!hasFixed.value) return;
|
|
97
84
|
var scrollDom = scrollRef.value;
|
|
98
85
|
var maxScroll = scrollDom.scrollWidth - scrollDom.offsetWidth;
|
|
99
86
|
scrollPosition.set(scrollLeft === 0 ? 'left' : scrollLeft >= maxScroll ? 'right' : 'middle');
|
|
100
87
|
}
|
|
101
|
-
|
|
102
88
|
function updateScrollPositionOnResize() {
|
|
103
89
|
var scrollDom = scrollRef.value;
|
|
104
|
-
|
|
105
90
|
if (scrollDom.scrollWidth - scrollDom.offsetWidth <= 0) {
|
|
106
91
|
scrollPosition.set(null);
|
|
107
92
|
} else {
|
|
108
93
|
setScrollPosition(scrollRef.value.scrollLeft);
|
|
109
94
|
}
|
|
110
95
|
}
|
|
111
|
-
|
|
112
96
|
return {
|
|
113
97
|
scrollPosition: scrollPosition,
|
|
114
98
|
setScrollPosition: setScrollPosition,
|
|
@@ -123,21 +107,18 @@ export function useFixedColumns(getColumns, _ref, widthMap) {
|
|
|
123
107
|
}
|
|
124
108
|
export function getClassAndStyleForFixed(_ref2, offset, checkType) {
|
|
125
109
|
var _cx, _ref3;
|
|
126
|
-
|
|
127
110
|
var className = _ref2.className,
|
|
128
|
-
|
|
129
|
-
|
|
111
|
+
fixed = _ref2.fixed,
|
|
112
|
+
align = _ref2.align;
|
|
130
113
|
var extraOffset = checkType && checkType !== 'none' && fixed === 'left' ? 40 : 0;
|
|
131
114
|
return {
|
|
132
115
|
className: cx((_cx = {}, _cx[className] = !!className, _cx["k-fixed-" + fixed] = !!fixed, _cx["k-align-" + align] = !!align, _cx)),
|
|
133
116
|
style: fixed ? (_ref3 = {}, _ref3[fixed] = offset + extraOffset + "px", _ref3) : null
|
|
134
117
|
};
|
|
135
118
|
}
|
|
136
|
-
|
|
137
119
|
function validateWidth(_ref4) {
|
|
138
120
|
var width = _ref4.width,
|
|
139
|
-
|
|
140
|
-
|
|
121
|
+
key = _ref4.key;
|
|
141
122
|
if (isNullOrUndefined(width) || isString(width) && !/\d+(px)?/.test(width)) {
|
|
142
123
|
error("The width must be specified with 'px' when the column has fixed. <TableColumn key=\"" + key + "\" />");
|
|
143
124
|
}
|
|
@@ -15,71 +15,54 @@ export function useGroup() {
|
|
|
15
15
|
instance.on('$receive:group', function (group) {
|
|
16
16
|
return filteredGroup.set(group);
|
|
17
17
|
});
|
|
18
|
-
|
|
19
18
|
function onSelect(value, groupValue, onChange) {
|
|
20
19
|
var _instance$get = instance.get(),
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
multiple = _instance$get.multiple,
|
|
21
|
+
key = _instance$get.key;
|
|
24
22
|
if (multiple) {
|
|
25
23
|
value = toggleArray(groupValue, value);
|
|
26
24
|
}
|
|
27
|
-
|
|
28
25
|
onChange(key, value);
|
|
29
26
|
}
|
|
30
|
-
|
|
31
27
|
function isChecked(value, groupValue) {
|
|
32
28
|
var _instance$get2 = instance.get(),
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
multiple = _instance$get2.multiple;
|
|
35
30
|
if (multiple) {
|
|
36
31
|
return groupValue && _includesInstanceProperty(groupValue).call(groupValue, value);
|
|
37
32
|
}
|
|
38
|
-
|
|
39
33
|
return groupValue === value;
|
|
40
34
|
}
|
|
41
|
-
|
|
42
35
|
function getGroupText(groupValue) {
|
|
43
36
|
var _instance$get3 = instance.get(),
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
37
|
+
multiple = _instance$get3.multiple,
|
|
38
|
+
group = _instance$get3.group;
|
|
47
39
|
if (isNullOrUndefined(groupValue)) return null;
|
|
48
|
-
|
|
49
40
|
if (!multiple) {
|
|
50
41
|
groupValue = [groupValue];
|
|
51
42
|
}
|
|
52
|
-
|
|
53
43
|
if (group) {
|
|
54
44
|
var _context;
|
|
55
|
-
|
|
56
45
|
var ret = _mapInstanceProperty(_context = _filterInstanceProperty(group).call(group, function (item) {
|
|
57
46
|
return _includesInstanceProperty(groupValue).call(groupValue, item.value);
|
|
58
47
|
})).call(_context, function (item) {
|
|
59
48
|
return item.label;
|
|
60
49
|
}).join(', ');
|
|
61
|
-
|
|
62
50
|
if (ret) {
|
|
63
51
|
return "(" + ret + ")";
|
|
64
52
|
}
|
|
65
53
|
}
|
|
66
|
-
|
|
67
54
|
return null;
|
|
68
55
|
}
|
|
69
|
-
|
|
70
56
|
watchState(keywords, function (v) {
|
|
71
57
|
var _instance$get4 = instance.get(),
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
58
|
+
_instance$get4$group = _instance$get4.group,
|
|
59
|
+
group = _instance$get4$group === void 0 ? [] : _instance$get4$group;
|
|
75
60
|
v = _trimInstanceProperty(v).call(v);
|
|
76
|
-
|
|
77
61
|
if (!v) {
|
|
78
62
|
filteredGroup.set(group);
|
|
79
63
|
} else {
|
|
80
64
|
filteredGroup.set(_filterInstanceProperty(group).call(group, function (item) {
|
|
81
65
|
var _context2, _context3;
|
|
82
|
-
|
|
83
66
|
return _includesInstanceProperty(_context2 = String(item.label)).call(_context2, v) || _includesInstanceProperty(_context3 = String(item.value)).call(_context3, v);
|
|
84
67
|
}));
|
|
85
68
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { Props } from 'intact-vue-next';
|
|
2
2
|
import type { TableColumnProps } from './column';
|
|
3
3
|
import { State } from '../../hooks/useState';
|
|
4
|
-
export
|
|
5
|
-
export
|
|
4
|
+
export type TableMerge<T = any, CheckType = 'checkbox'> = (row: T, column: CheckType extends 'none' ? Props<TableColumnProps> : Props<TableColumnProps> | null, rowIndex: number, columnIndex: number) => TableMergeConfig | undefined;
|
|
5
|
+
export type TableMergeConfig = {
|
|
6
6
|
colspan?: number;
|
|
7
7
|
rowspan?: number;
|
|
8
8
|
};
|
|
9
|
-
export
|
|
9
|
+
export type TableGridItem = {
|
|
10
10
|
render: boolean;
|
|
11
11
|
spans: TableMergeConfig | undefined;
|
|
12
12
|
};
|
|
13
|
-
export
|
|
13
|
+
export type TableGrid = TableGridItem[][];
|
|
14
14
|
export declare function useMerge(getCols: () => Props<TableColumnProps>[], data: State<unknown[] | undefined>): {
|
|
15
15
|
getGrid: () => TableGrid;
|
|
16
16
|
};
|
|
@@ -3,36 +3,29 @@ import { watchState } from '../../hooks/useState';
|
|
|
3
3
|
export function useMerge(getCols, data) {
|
|
4
4
|
var instance = useInstance();
|
|
5
5
|
var grid = [];
|
|
6
|
-
|
|
7
6
|
function handleSpans() {
|
|
8
7
|
grid = [];
|
|
9
|
-
|
|
10
8
|
var _instance$get = instance.get(),
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
merge = _instance$get.merge,
|
|
10
|
+
checkType = _instance$get.checkType;
|
|
14
11
|
if (!data.value || !data.value.length || !merge) return;
|
|
15
12
|
var cols = getCols();
|
|
16
13
|
data.value.forEach(function (data, rowIndex) {
|
|
17
14
|
var currentRow = [];
|
|
18
15
|
grid.push(currentRow);
|
|
19
16
|
var columnIndexOffset = 0;
|
|
20
|
-
|
|
21
17
|
if (checkType !== 'none') {
|
|
22
18
|
handleGridItem(currentRow, merge, data, null, rowIndex, 0);
|
|
23
19
|
columnIndexOffset = 1;
|
|
24
20
|
}
|
|
25
|
-
|
|
26
21
|
cols.forEach(function (props, columnIndex) {
|
|
27
22
|
handleGridItem(currentRow, merge, data, props, rowIndex, columnIndex + columnIndexOffset);
|
|
28
23
|
});
|
|
29
24
|
});
|
|
30
25
|
}
|
|
31
|
-
|
|
32
26
|
function handleGridItem(currentRow, merge, data, column, rowIndex, columnIndex) {
|
|
33
27
|
var prevCell = currentRow[columnIndex - 1];
|
|
34
28
|
var tmp;
|
|
35
|
-
|
|
36
29
|
if (prevCell && (tmp = prevCell.spans) && tmp.colspan > 1) {
|
|
37
30
|
currentRow.push({
|
|
38
31
|
render: false,
|
|
@@ -43,11 +36,9 @@ export function useMerge(getCols, data) {
|
|
|
43
36
|
});
|
|
44
37
|
return;
|
|
45
38
|
}
|
|
46
|
-
|
|
47
39
|
if (rowIndex > 0) {
|
|
48
40
|
var prevRow = grid[rowIndex - 1];
|
|
49
41
|
var aboveCell = prevRow[columnIndex];
|
|
50
|
-
|
|
51
42
|
if (aboveCell && (tmp = aboveCell.spans) && tmp.rowspan > 1) {
|
|
52
43
|
currentRow.push({
|
|
53
44
|
render: false,
|
|
@@ -59,17 +50,14 @@ export function useMerge(getCols, data) {
|
|
|
59
50
|
return;
|
|
60
51
|
}
|
|
61
52
|
}
|
|
62
|
-
|
|
63
53
|
currentRow.push({
|
|
64
54
|
render: true,
|
|
65
55
|
spans: merge(data, column, rowIndex, columnIndex)
|
|
66
56
|
});
|
|
67
57
|
}
|
|
68
|
-
|
|
69
58
|
function getGrid() {
|
|
70
59
|
return grid;
|
|
71
60
|
}
|
|
72
|
-
|
|
73
61
|
instance.on('$receive:children', handleSpans);
|
|
74
62
|
watchState(data, handleSpans);
|
|
75
63
|
return {
|
|
@@ -12,65 +12,51 @@ export function usePagination() {
|
|
|
12
12
|
var value = useState(defaultPagination.value);
|
|
13
13
|
var limit = useState(defaultPagination.limit);
|
|
14
14
|
var paginationRef = createRef(); // for unit test
|
|
15
|
-
|
|
16
15
|
useReceive(['data', 'pagination'], function () {
|
|
17
16
|
handleData();
|
|
18
17
|
});
|
|
19
|
-
|
|
20
18
|
function handleData() {
|
|
21
19
|
var _instance$get = instance.get(),
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
_data = _instance$get.data,
|
|
21
|
+
pagination = _instance$get.pagination;
|
|
25
22
|
if (!_data) {
|
|
26
23
|
data.set(undefined);
|
|
27
24
|
return;
|
|
28
25
|
}
|
|
29
|
-
|
|
30
26
|
if (!pagination) {
|
|
31
27
|
data.set(_data);
|
|
32
28
|
return;
|
|
33
29
|
}
|
|
34
|
-
|
|
35
30
|
if (isObject(pagination)) {
|
|
36
31
|
if (pagination.value) {
|
|
37
32
|
value.set(pagination.value);
|
|
38
33
|
}
|
|
39
|
-
|
|
40
34
|
if (pagination.limit) {
|
|
41
35
|
limit.set(pagination.limit);
|
|
42
36
|
}
|
|
43
37
|
}
|
|
44
|
-
|
|
45
38
|
updateDataByPage();
|
|
46
39
|
}
|
|
47
|
-
|
|
48
40
|
function updateDataByPage() {
|
|
49
41
|
var _instance$get2 = instance.get(),
|
|
50
|
-
|
|
51
|
-
|
|
42
|
+
_data = _instance$get2.data;
|
|
52
43
|
var index = (value.value - 1) * limit.value;
|
|
53
44
|
data.set(_sliceInstanceProperty(_data).call(_data, index, index + limit.value));
|
|
54
45
|
}
|
|
55
|
-
|
|
56
46
|
function onChange(data) {
|
|
57
47
|
var _instance$get3 = instance.get(),
|
|
58
|
-
|
|
59
|
-
|
|
48
|
+
pagination = _instance$get3.pagination;
|
|
60
49
|
value.set(data.value);
|
|
61
50
|
limit.set(data.limit);
|
|
62
51
|
updateDataByPage();
|
|
63
|
-
|
|
64
52
|
if (isObject(pagination)) {
|
|
65
53
|
instance.set('pagination', _extends({}, pagination, {
|
|
66
54
|
value: value.value,
|
|
67
55
|
limit: limit.value
|
|
68
56
|
}));
|
|
69
57
|
}
|
|
70
|
-
|
|
71
58
|
instance.trigger('changePage', data);
|
|
72
59
|
}
|
|
73
|
-
|
|
74
60
|
return {
|
|
75
61
|
data: data,
|
|
76
62
|
value: value,
|
|
@@ -12,26 +12,21 @@ export function useResizable(scrollRef, tableRef, tableWidth, widthMap, storeWid
|
|
|
12
12
|
var currentVNode;
|
|
13
13
|
var currentTh;
|
|
14
14
|
var minWidth;
|
|
15
|
-
|
|
16
15
|
function onStart(e) {
|
|
17
16
|
containerWidth = scrollRef.value.clientWidth;
|
|
18
|
-
x = e.clientX;
|
|
19
|
-
|
|
17
|
+
x = e.clientX;
|
|
18
|
+
// find the previous column but exclude the hidden columns, #467
|
|
20
19
|
prevVNode = currentVNode = e._vNode;
|
|
21
20
|
prevTh;
|
|
22
|
-
|
|
23
21
|
do {
|
|
24
22
|
prevVNode = prevVNode.props.prevVNode;
|
|
25
23
|
prevTh = findDomFromVNode(prevVNode, true);
|
|
26
24
|
} while (window.getComputedStyle(prevTh).display === 'none');
|
|
27
|
-
|
|
28
25
|
currentTh = findDomFromVNode(currentVNode, true);
|
|
29
26
|
minWidth = prevVNode.props.minWidth || instance.get('minColWidth');
|
|
30
27
|
}
|
|
31
|
-
|
|
32
28
|
function onMove(e) {
|
|
33
29
|
var _map;
|
|
34
|
-
|
|
35
30
|
var delX = e.clientX - x;
|
|
36
31
|
if (delX === 0) return;
|
|
37
32
|
var newPrevWidth = prevTh.offsetWidth + delX;
|
|
@@ -42,16 +37,13 @@ export function useResizable(scrollRef, tableRef, tableWidth, widthMap, storeWid
|
|
|
42
37
|
var prevKey = prevVNode.props.key;
|
|
43
38
|
x = e.clientX;
|
|
44
39
|
var map = (_map = {}, _map[prevKey] = newPrevWidth, _map);
|
|
45
|
-
|
|
46
40
|
if (containerWidth > newTableWidth) {
|
|
47
41
|
map[currentKey] = newCurrentWidth;
|
|
48
42
|
} else {
|
|
49
43
|
tableWidth.set(newTableWidth);
|
|
50
44
|
}
|
|
51
|
-
|
|
52
45
|
widthMap.set(_extends({}, widthMap.value, map));
|
|
53
46
|
}
|
|
54
|
-
|
|
55
47
|
return useDraggable({
|
|
56
48
|
onStart: onStart,
|
|
57
49
|
onMove: onMove,
|
|
@@ -6,15 +6,13 @@ export function useRestRowStatus(getAllKeys) {
|
|
|
6
6
|
var instance = useInstance();
|
|
7
7
|
var allUnmountedRows = [];
|
|
8
8
|
var willUnmounted = false;
|
|
9
|
-
|
|
10
9
|
function onRowBeforeUnmount(key) {
|
|
11
|
-
if (willUnmounted || instance.get('keepStatus')) return;
|
|
12
|
-
|
|
10
|
+
if (willUnmounted || instance.get('keepStatus')) return;
|
|
11
|
+
// maybe the row is only removed by shrinking, i.e. tree table
|
|
13
12
|
var allKeys = getAllKeys();
|
|
14
13
|
if (_includesInstanceProperty(allKeys).call(allKeys, key)) return;
|
|
15
14
|
allUnmountedRows.push(key);
|
|
16
15
|
}
|
|
17
|
-
|
|
18
16
|
function reset() {
|
|
19
17
|
if (allUnmountedRows.length) {
|
|
20
18
|
omit('checkedKeys', allUnmountedRows);
|
|
@@ -24,7 +22,6 @@ export function useRestRowStatus(getAllKeys) {
|
|
|
24
22
|
allUnmountedRows = [];
|
|
25
23
|
}
|
|
26
24
|
}
|
|
27
|
-
|
|
28
25
|
function omit(type, keys) {
|
|
29
26
|
var originKeys = instance.get(type);
|
|
30
27
|
if (!originKeys) return;
|
|
@@ -34,7 +31,6 @@ export function useRestRowStatus(getAllKeys) {
|
|
|
34
31
|
});
|
|
35
32
|
instance.set(type, originKeys);
|
|
36
33
|
}
|
|
37
|
-
|
|
38
34
|
onBeforeUnmount(function () {
|
|
39
35
|
return willUnmounted = true;
|
|
40
36
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RefObject } from 'intact-vue-next';
|
|
2
|
-
export
|
|
2
|
+
export type ScrollCallback = (scrollLeft: number) => void;
|
|
3
3
|
export declare function useScroll(): {
|
|
4
4
|
callbacks: ScrollCallback[];
|
|
5
5
|
scrollRef: RefObject<HTMLElement>;
|
|
@@ -3,10 +3,8 @@ export function useScroll() {
|
|
|
3
3
|
var callbacks = [];
|
|
4
4
|
var scrollRef = createRef();
|
|
5
5
|
var scrollLeft = 0;
|
|
6
|
-
|
|
7
6
|
function onScroll() {
|
|
8
7
|
var newScrollLeft = scrollRef.value.scrollLeft;
|
|
9
|
-
|
|
10
8
|
if (scrollLeft !== newScrollLeft) {
|
|
11
9
|
scrollLeft = newScrollLeft;
|
|
12
10
|
callbacks.forEach(function (fn) {
|
|
@@ -14,7 +12,6 @@ export function useScroll() {
|
|
|
14
12
|
});
|
|
15
13
|
}
|
|
16
14
|
}
|
|
17
|
-
|
|
18
15
|
onMounted(function () {
|
|
19
16
|
scrollRef.value.addEventListener('scroll', onScroll, {
|
|
20
17
|
passive: true
|
|
@@ -3,16 +3,13 @@ import { inArray } from './useChecked';
|
|
|
3
3
|
import { toggleArray } from '../utils';
|
|
4
4
|
export function useSelected() {
|
|
5
5
|
var instance = useInstance();
|
|
6
|
-
|
|
7
6
|
function isSelected(key) {
|
|
8
7
|
return inArray(instance.get('selectedKeys'), key);
|
|
9
8
|
}
|
|
10
|
-
|
|
11
9
|
instance.on('clickRow', function (data, index, key) {
|
|
12
10
|
var _instance$get = instance.get(),
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
rowSelectable = _instance$get.rowSelectable,
|
|
12
|
+
selectedKeys = _instance$get.selectedKeys;
|
|
16
13
|
if (rowSelectable === 'multiple') {
|
|
17
14
|
instance.set('selectedKeys', toggleArray(selectedKeys, key));
|
|
18
15
|
} else if (rowSelectable) {
|
|
@@ -3,20 +3,16 @@ import { useInstance } from 'intact-vue-next';
|
|
|
3
3
|
import { createContext } from '../context';
|
|
4
4
|
export var context = createContext();
|
|
5
5
|
export function useSortable() {
|
|
6
|
-
var instance = useInstance();
|
|
6
|
+
var instance = useInstance();
|
|
7
|
+
// if the same column has been clicked three times consecutively,
|
|
7
8
|
// then let the third click to reset the sort
|
|
8
|
-
|
|
9
9
|
var count = 0;
|
|
10
|
-
|
|
11
10
|
function onChange(key, event) {
|
|
12
11
|
// ignore when click group dropdown menu
|
|
13
12
|
if (event._ignoreSortable) return;
|
|
14
|
-
|
|
15
13
|
var sort = _extends({}, instance.get('sort'));
|
|
16
|
-
|
|
17
14
|
if (sort.key === key) {
|
|
18
15
|
count++;
|
|
19
|
-
|
|
20
16
|
if (count === 3) {
|
|
21
17
|
sort = {};
|
|
22
18
|
} else {
|
|
@@ -27,10 +23,8 @@ export function useSortable() {
|
|
|
27
23
|
sort.key = key;
|
|
28
24
|
if (!sort.type) sort.type = 'desc';
|
|
29
25
|
}
|
|
30
|
-
|
|
31
26
|
instance.set('sort', sort);
|
|
32
27
|
}
|
|
33
|
-
|
|
34
28
|
return {
|
|
35
29
|
onChange: onChange
|
|
36
30
|
};
|
|
@@ -6,20 +6,16 @@ export function useStickyHeader(callbacks) {
|
|
|
6
6
|
var elementRef = createRef();
|
|
7
7
|
var headRef = createRef();
|
|
8
8
|
var stickHeader = useState(null);
|
|
9
|
-
|
|
10
9
|
function excludeStickHeader(_ref) {
|
|
11
10
|
var offsetTop = _ref.offsetTop;
|
|
12
|
-
|
|
13
11
|
var _elementRef$value$get = elementRef.value.getBoundingClientRect(),
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
bottom = _elementRef$value$get.bottom;
|
|
16
13
|
return bottom <= offsetTop;
|
|
17
14
|
}
|
|
18
|
-
|
|
19
15
|
instance.on('$receive:stickHeader', function (v) {
|
|
20
16
|
stickHeader.set(v === true ? 0 : isStringOrNumber(v) ? +v : null);
|
|
21
|
-
});
|
|
22
|
-
|
|
17
|
+
});
|
|
18
|
+
// when the scroll element scroll horizontally, scroll the sticky header too
|
|
23
19
|
callbacks.push(function (scrollLeft) {
|
|
24
20
|
if (isNull(stickHeader.value)) return;
|
|
25
21
|
var affixHeadWrapper = headRef.value.parentElement;
|