@king-design/vue 2.1.3 → 2.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/affix/index.d.ts +2 -2
- package/components/affix/index.js +0 -5
- package/components/affix/index.spec.js +84 -108
- package/components/affix/index.vdt.js +5 -8
- package/components/affix/useStyle.js +8 -19
- package/components/badge/index.js +0 -2
- package/components/badge/index.vdt.js +5 -9
- package/components/badge/styles.js +0 -2
- package/components/breadcrumb/index.js +0 -4
- package/components/breadcrumb/index.spec.js +6 -6
- package/components/breadcrumb/index.vdt.js +5 -14
- package/components/breadcrumb/item.js +0 -8
- package/components/breadcrumb/item.vdt.js +3 -6
- package/components/breadcrumb/styles.js +0 -3
- package/components/button/dynamicButton.d.ts +1 -1
- package/components/button/dynamicButton.js +2 -5
- package/components/button/group.js +2 -10
- package/components/button/group.vdt.js +4 -7
- package/components/button/index.js +3 -27
- package/components/button/index.spec.js +74 -96
- package/components/button/index.vdt.js +19 -29
- package/components/button/styles.d.ts +2 -2
- package/components/button/styles.js +4 -48
- package/components/card/column.js +0 -2
- package/components/card/column.vdt.js +5 -10
- package/components/card/index.js +0 -4
- package/components/card/index.vdt.js +4 -16
- package/components/carousel/index.js +1 -19
- package/components/carousel/index.spec.js +127 -163
- package/components/carousel/index.vdt.js +12 -15
- package/components/carousel/item.js +0 -2
- package/components/carousel/item.vdt.js +4 -7
- package/components/carousel/styles.js +0 -1
- package/components/carousel/useAutoplay.js +0 -4
- package/components/carousel/useItems.js +4 -20
- package/components/carousel/useSlide.js +57 -89
- package/components/cascader/index.js +3 -18
- package/components/cascader/index.spec.js +365 -379
- package/components/cascader/index.vdt.js +14 -31
- package/components/cascader/styles.js +0 -6
- package/components/cascader/useFields.js +1 -4
- package/components/cascader/useFilterable.js +2 -19
- package/components/cascader/useLabel.js +1 -9
- package/components/cascader/useLoad.js +22 -35
- package/components/cascader/useValue.d.ts +2 -2
- package/components/cascader/useValue.js +6 -27
- package/components/checkbox/index.js +5 -27
- package/components/checkbox/index.spec.js +129 -171
- package/components/checkbox/index.vdt.js +12 -16
- package/components/checkbox/styles.js +0 -10
- package/components/code/crossDomain.js +2 -9
- package/components/code/index.js +0 -9
- package/components/code/index.spec.js +46 -55
- package/components/code/index.vdt.js +6 -14
- package/components/code/styles.js +0 -1
- package/components/code/useEditor.js +5 -10
- package/components/collapse/index.d.ts +1 -1
- package/components/collapse/index.js +3 -14
- package/components/collapse/index.spec.js +47 -60
- package/components/collapse/index.vdt.js +4 -12
- package/components/collapse/item.js +0 -10
- package/components/collapse/item.vdt.js +7 -14
- package/components/collapse/styles.js +0 -1
- package/components/colorpicker/drag.js +0 -5
- package/components/colorpicker/index.js +0 -4
- package/components/colorpicker/index.spec.js +211 -259
- package/components/colorpicker/index.vdt.js +8 -11
- package/components/colorpicker/panel.js +0 -5
- package/components/colorpicker/panel.vdt.js +21 -26
- package/components/colorpicker/styles.js +2 -13
- package/components/colorpicker/useDrag.js +22 -26
- package/components/colorpicker/useInput.js +0 -16
- package/components/colorpicker/usePointer.js +15 -18
- package/components/colorpicker/useValue.js +2 -7
- package/components/context.d.ts +2 -2
- package/components/context.js +2 -19
- package/components/datepicker/basepicker.d.ts +8 -8
- package/components/datepicker/basepicker.js +20 -90
- package/components/datepicker/calendar.js +0 -11
- package/components/datepicker/calendar.vdt.js +11 -14
- package/components/datepicker/constants.js +0 -1
- package/components/datepicker/dayjs.js +1 -1
- package/components/datepicker/helpers.js +3 -15
- package/components/datepicker/index.js +6 -32
- package/components/datepicker/index.spec.js +1141 -1448
- package/components/datepicker/index.vdt.js +20 -34
- package/components/datepicker/shortcuts.d.ts +1 -1
- package/components/datepicker/shortcuts.js +0 -4
- package/components/datepicker/styles.js +0 -8
- package/components/datepicker/time.d.ts +1 -1
- package/components/datepicker/time.js +3 -23
- package/components/datepicker/time.vdt.js +4 -5
- package/components/datepicker/useDays.js +2 -9
- package/components/datepicker/useDisabled.js +6 -23
- package/components/datepicker/useFocusDate.js +0 -2
- package/components/datepicker/useFormats.js +6 -15
- package/components/datepicker/useKeyboards.js +20 -36
- package/components/datepicker/useMonths.js +0 -6
- package/components/datepicker/usePanel.js +0 -10
- package/components/datepicker/useShowDate.js +10 -37
- package/components/datepicker/useStatus.js +3 -15
- package/components/datepicker/useValue.js +22 -35
- package/components/datepicker/useYears.js +4 -15
- package/components/diagram/diagram.js +17 -43
- package/components/diagram/diagram.vdt.js +2 -5
- package/components/diagram/graph.js +6 -6
- package/components/diagram/index.d.ts +1 -1
- package/components/diagram/index.js +7 -7
- package/components/diagram/index.spec.js +369 -495
- package/components/diagram/layouts/circle.js +6 -14
- package/components/diagram/layouts/flow.js +7 -15
- package/components/diagram/layouts/layout.js +6 -28
- package/components/diagram/layouts/organic.js +3 -11
- package/components/diagram/layouts/partition.js +4 -12
- package/components/diagram/layouts/radial.js +6 -18
- package/components/diagram/layouts/stack.js +6 -14
- package/components/diagram/layouts/tree.js +11 -21
- package/components/diagram/mxgraph/handler/mxConnectionHandler.js +15 -22
- package/components/diagram/mxgraph/handler/mxConstraintHandler.js +4 -4
- package/components/diagram/mxgraph/handler/mxEdgeHandler.js +11 -15
- package/components/diagram/mxgraph/handler/mxGraphHandler.js +6 -9
- package/components/diagram/mxgraph/handler/mxRubberband.js +4 -4
- package/components/diagram/mxgraph/handler/mxVertexHandler.js +7 -10
- package/components/diagram/mxgraph/index.js +0 -2
- package/components/diagram/mxgraph/mx.js +3 -3
- package/components/diagram/mxgraph/shape/mxCloud.js +2 -2
- package/components/diagram/mxgraph/shape/mxCylinder.js +4 -9
- package/components/diagram/mxgraph/shape/mxEllipse.js +2 -2
- package/components/diagram/mxgraph/shape/mxHexagon.js +2 -2
- package/components/diagram/mxgraph/shape/mxLine.js +2 -2
- package/components/diagram/mxgraph/shape/mxRectangleShape.js +2 -2
- package/components/diagram/mxgraph/shape/mxRhombus.js +6 -12
- package/components/diagram/mxgraph/shape/mxShape.js +0 -1
- package/components/diagram/mxgraph/shape/mxTriangle.js +2 -2
- package/components/diagram/mxgraph/util/mxConstants.js +2 -2
- package/components/diagram/mxgraph/util/mxGuide.js +5 -7
- package/components/diagram/mxgraph/view/mxCellEditor.js +16 -29
- package/components/diagram/mxgraph/view/mxCellRenderer.js +0 -2
- package/components/diagram/mxgraph/view/mxGraph.js +14 -32
- package/components/diagram/shapes/base.d.ts +1 -1
- package/components/diagram/shapes/base.js +9 -39
- package/components/diagram/shapes/callout.js +10 -23
- package/components/diagram/shapes/circle.js +3 -10
- package/components/diagram/shapes/document.js +5 -16
- package/components/diagram/shapes/ellipse.js +0 -5
- package/components/diagram/shapes/generateShapes.d.ts +1 -1
- package/components/diagram/shapes/generateShapes.js +0 -9
- package/components/diagram/shapes/hexagon.js +9 -26
- package/components/diagram/shapes/image.js +1 -9
- package/components/diagram/shapes/line.d.ts +2 -2
- package/components/diagram/shapes/line.js +13 -48
- package/components/diagram/shapes/parallelogram.js +9 -26
- package/components/diagram/shapes/rectangle.js +1 -9
- package/components/diagram/shapes/shape.js +6 -35
- package/components/diagram/shapes/square.js +3 -11
- package/components/diagram/shapes/text.js +0 -5
- package/components/diagram/styles.js +0 -1
- package/components/dialog/alert.vdt.js +9 -19
- package/components/dialog/base.js +1 -29
- package/components/dialog/base.vdt.js +14 -29
- package/components/dialog/index.js +6 -31
- package/components/dialog/index.spec.js +406 -554
- package/components/dialog/staticMethods.d.ts +1 -1
- package/components/dialog/staticMethods.js +2 -13
- package/components/dialog/styles.js +0 -11
- package/components/dialog/useDraggable.js +0 -6
- package/components/dialog/useEscClosable.js +4 -12
- package/components/dialog/useFixBody.d.ts +1 -1
- package/components/dialog/useFixBody.js +0 -11
- package/components/dialog/usePosition.js +0 -5
- package/components/drawer/index.js +0 -5
- package/components/drawer/index.spec.js +126 -168
- package/components/drawer/index.vdt.js +3 -9
- package/components/drawer/styles.d.ts +2 -2
- package/components/drawer/styles.js +0 -4
- package/components/dropdown/dropdown.d.ts +2 -2
- package/components/dropdown/dropdown.js +33 -89
- package/components/dropdown/index.js +2 -6
- package/components/dropdown/index.spec.js +388 -496
- package/components/dropdown/item.js +4 -25
- package/components/dropdown/item.vdt.js +5 -8
- package/components/dropdown/menu.js +14 -29
- package/components/dropdown/menu.vdt.js +5 -13
- package/components/dropdown/styles.js +0 -9
- package/components/dropdown/useKeyboard.d.ts +2 -2
- package/components/dropdown/useKeyboard.js +8 -30
- package/components/dropdown/usePosition.d.ts +2 -1
- package/components/dropdown/usePosition.js +24 -22
- package/components/dropdown/useTransition.js +0 -8
- package/components/editable/index.d.ts +1 -1
- package/components/editable/index.js +4 -28
- package/components/editable/index.spec.js +152 -189
- package/components/editable/index.vdt.js +8 -11
- package/components/editable/styles.js +0 -1
- package/components/form/form.js +0 -18
- package/components/form/form.vdt.js +4 -7
- package/components/form/index.spec.js +1057 -1280
- package/components/form/item.d.ts +1 -1
- package/components/form/item.js +0 -12
- package/components/form/item.vdt.js +17 -31
- package/components/form/methods.d.ts +5 -5
- package/components/form/methods.js +2 -12
- package/components/form/styles.js +0 -8
- package/components/form/useDirty.js +2 -7
- package/components/form/useError.js +2 -10
- package/components/form/useValidate.d.ts +1 -1
- package/components/form/useValidate.js +8 -24
- package/components/grid/col.d.ts +3 -3
- package/components/grid/col.js +0 -7
- package/components/grid/col.vdt.js +8 -13
- package/components/grid/constants.d.ts +6 -6
- package/components/grid/row.js +0 -5
- package/components/grid/row.vdt.js +5 -8
- package/components/grid/styles.js +0 -7
- package/components/grid/useBreakpoints.js +0 -5
- package/components/grid/useGutter.js +5 -25
- package/components/icon/index.js +0 -10
- package/components/icon/index.vdt.js +7 -13
- package/components/icon/styles.js +0 -1
- package/components/input/index.d.ts +3 -3
- package/components/input/index.js +0 -14
- package/components/input/index.spec.js +185 -239
- package/components/input/index.vdt.js +39 -49
- package/components/input/search.js +0 -20
- package/components/input/search.vdt.js +6 -9
- package/components/input/styles.js +0 -26
- package/components/input/useAutoRows.js +6 -18
- package/components/input/useAutoWidth.js +0 -5
- package/components/input/useFrozen.js +0 -6
- package/components/input/useShowPassword.js +2 -5
- package/components/layout/aside.js +5 -17
- package/components/layout/aside.vdt.js +5 -9
- package/components/layout/body.js +5 -17
- package/components/layout/footer.js +1 -7
- package/components/layout/header.js +7 -21
- package/components/layout/layout.js +9 -24
- package/components/layout/styles.js +2 -13
- package/components/layout/template.vdt.js +2 -4
- package/components/layout/useParse.js +0 -7
- package/components/menu/index.spec.js +189 -242
- package/components/menu/item.js +3 -16
- package/components/menu/item.vdt.js +20 -32
- package/components/menu/menu.js +2 -11
- package/components/menu/menu.vdt.js +6 -12
- package/components/menu/styles.js +0 -18
- package/components/menu/useDropdown.js +4 -9
- package/components/menu/useExpanded.js +0 -14
- package/components/menu/useHighlight.js +26 -36
- package/components/message/index.spec.js +58 -73
- package/components/message/message.js +0 -19
- package/components/message/message.vdt.js +5 -8
- package/components/message/messages.js +0 -12
- package/components/message/messages.vdt.js +0 -1
- package/components/message/styles.js +0 -9
- package/components/pagination/index.d.ts +1 -1
- package/components/pagination/index.js +10 -46
- package/components/pagination/index.spec.js +133 -173
- package/components/pagination/index.vdt.js +14 -34
- package/components/pagination/styles.js +0 -4
- package/components/portal.d.ts +1 -1
- package/components/portal.js +2 -29
- package/components/position.d.ts +12 -12
- package/components/position.js +32 -88
- package/components/progress/index.d.ts +6 -6
- package/components/progress/index.js +0 -12
- package/components/progress/index.spec.js +143 -191
- package/components/progress/index.vdt.js +8 -11
- package/components/progress/styles.js +0 -6
- package/components/progress/useColor.js +2 -7
- package/components/progress/useStatus.d.ts +1 -1
- package/components/progress/useStatus.js +2 -5
- package/components/radio/index.js +3 -18
- package/components/radio/index.spec.js +111 -149
- package/components/radio/index.vdt.js +14 -17
- package/components/radio/styles.js +0 -10
- package/components/rate/index.js +0 -7
- package/components/rate/index.spec.js +64 -79
- package/components/rate/index.vdt.js +8 -21
- package/components/rate/styles.js +0 -3
- package/components/rate/useActiveValue.js +2 -7
- package/components/scrollSelect/index.d.ts +2 -2
- package/components/scrollSelect/index.js +0 -7
- package/components/scrollSelect/index.spec.js +100 -131
- package/components/scrollSelect/index.vdt.js +6 -11
- package/components/scrollSelect/styles.js +0 -7
- package/components/scrollSelect/useList.js +3 -17
- package/components/scrollSelect/useMouseEvents.js +31 -49
- package/components/scrollSelect/useTranslate.js +1 -11
- package/components/select/base.js +5 -35
- package/components/select/base.vdt.js +23 -38
- package/components/select/group.js +0 -5
- package/components/select/group.vdt.js +4 -10
- package/components/select/index.spec.js +361 -452
- package/components/select/menu.js +0 -5
- package/components/select/menu.vdt.js +18 -33
- package/components/select/option.js +2 -16
- package/components/select/option.vdt.js +7 -14
- package/components/select/select.js +3 -20
- package/components/select/select.vdt.js +9 -17
- package/components/select/styles.js +0 -33
- package/components/select/useBaseLabel.d.ts +1 -1
- package/components/select/useBaseLabel.js +4 -17
- package/components/select/useCard.js +0 -4
- package/components/select/useEqualWidth.js +0 -1
- package/components/select/useFilterable.js +5 -27
- package/components/select/useFocusout.d.ts +1 -1
- package/components/select/useFocusout.js +1 -9
- package/components/select/useInput.js +6 -10
- package/components/select/useLabel.js +3 -13
- package/components/select/useSearchable.js +0 -10
- package/components/skeleton/item.d.ts +1 -1
- package/components/skeleton/item.js +0 -4
- package/components/skeleton/item.vdt.js +1 -6
- package/components/skeleton/skeleton.js +0 -4
- package/components/skeleton/skeleton.vdt.js +6 -12
- package/components/skeleton/style.d.ts +1 -1
- package/components/skeleton/style.js +0 -1
- package/components/slider/index.d.ts +1 -1
- package/components/slider/index.js +0 -7
- package/components/slider/index.spec.js +467 -585
- package/components/slider/index.vdt.js +32 -45
- package/components/slider/styles.js +0 -14
- package/components/slider/useClick.js +2 -11
- package/components/slider/useDraggable.js +23 -34
- package/components/slider/useKeyboard.js +7 -18
- package/components/slider/useMarks.d.ts +5 -5
- package/components/slider/useMarks.js +5 -13
- package/components/slider/usePoints.d.ts +2 -2
- package/components/slider/usePoints.js +7 -21
- package/components/slider/useStyles.d.ts +1 -1
- package/components/slider/useStyles.js +5 -10
- package/components/slider/useTooltip.js +2 -10
- package/components/slider/useValue.d.ts +1 -1
- package/components/slider/useValue.js +7 -22
- package/components/spin/index.js +0 -4
- package/components/spin/index.vdt.js +4 -11
- package/components/spin/styles.js +0 -2
- package/components/spinner/index.d.ts +4 -4
- package/components/spinner/index.js +9 -24
- package/components/spinner/index.spec.js +359 -460
- package/components/spinner/index.vdt.js +10 -13
- package/components/spinner/styles.js +0 -3
- package/components/spinner/useChange.js +4 -16
- package/components/spinner/useFormatter.js +6 -16
- package/components/spinner/useStep.d.ts +3 -3
- package/components/spinner/useStep.js +2 -20
- package/components/spinner/useValue.js +11 -26
- package/components/split/index.js +0 -7
- package/components/split/index.spec.js +223 -267
- package/components/split/index.vdt.js +8 -17
- package/components/split/style.d.ts +1 -1
- package/components/split/style.js +0 -8
- package/components/split/useDraggable.js +11 -35
- package/components/split/useSize.js +2 -5
- package/components/steps/context.d.ts +2 -2
- package/components/steps/index.js +2 -10
- package/components/steps/index.spec.js +21 -27
- package/components/steps/index.vdt.js +8 -10
- package/components/steps/step.js +0 -2
- package/components/steps/step.vdt.js +8 -12
- package/components/steps/styles.js +0 -27
- package/components/switch/index.js +2 -23
- package/components/switch/index.spec.js +188 -224
- package/components/switch/index.vdt.js +16 -32
- package/components/switch/styles.js +3 -14
- package/components/switch/useDraggable.js +10 -18
- package/components/table/cell.js +0 -6
- package/components/table/cell.vdt.js +14 -21
- package/components/table/column.d.ts +1 -1
- package/components/table/column.js +0 -5
- package/components/table/column.vdt.js +19 -30
- package/components/table/exportTable.js +45 -56
- package/components/table/index.spec.js +780 -984
- package/components/table/row.d.ts +1 -1
- package/components/table/row.js +12 -41
- package/components/table/row.vdt.js +27 -39
- package/components/table/styles.js +0 -11
- package/components/table/table.d.ts +5 -5
- package/components/table/table.js +18 -50
- package/components/table/table.vdt.js +61 -85
- package/components/table/useChecked.d.ts +1 -1
- package/components/table/useChecked.js +20 -61
- package/components/table/useColumns.js +3 -16
- package/components/table/useDisableRow.js +2 -12
- package/components/table/useDraggable.js +4 -12
- package/components/table/useExpandable.js +2 -5
- package/components/table/useFixedColumns.d.ts +1 -1
- package/components/table/useFixedColumns.js +4 -23
- package/components/table/useGroup.d.ts +1 -1
- package/components/table/useGroup.js +7 -24
- package/components/table/useMerge.d.ts +4 -4
- package/components/table/useMerge.js +2 -14
- package/components/table/usePagination.js +4 -18
- package/components/table/useResizable.js +2 -10
- package/components/table/useRestRowStatus.js +2 -6
- package/components/table/useScroll.d.ts +1 -1
- package/components/table/useScroll.js +0 -3
- package/components/table/useSelected.js +2 -5
- package/components/table/useSortable.js +2 -8
- package/components/table/useStickyHeader.js +3 -7
- package/components/table/useStickyScrollbar.js +6 -16
- package/components/table/useTree.js +1 -12
- package/components/table/useWidth.js +14 -30
- package/components/tabs/index.js +29 -51
- package/components/tabs/index.spec.js +56 -74
- package/components/tabs/index.vdt.js +13 -16
- package/components/tabs/styles.js +0 -16
- package/components/tabs/tab.js +0 -10
- package/components/tabs/tab.vdt.js +6 -10
- package/components/tabs/useActiveBar.js +2 -11
- package/components/tabs/useScroll.js +4 -20
- package/components/tag/base.js +0 -8
- package/components/tag/index.js +2 -4
- package/components/tag/index.spec.js +19 -25
- package/components/tag/index.vdt.js +8 -15
- package/components/tag/styles.js +0 -9
- package/components/timeline/item.js +0 -4
- package/components/timeline/item.vdt.js +4 -9
- package/components/timeline/styles.d.ts +2 -2
- package/components/timeline/styles.js +0 -4
- package/components/timeline/timeline.js +0 -2
- package/components/timeline/timeline.vdt.js +2 -5
- package/components/timepicker/index.js +2 -7
- package/components/timepicker/index.spec.js +293 -368
- package/components/timepicker/panelPicker.js +2 -11
- package/components/timepicker/panelPicker.vdt.js +14 -24
- package/components/timepicker/selectPicker.js +0 -5
- package/components/timepicker/selectPicker.vdt.js +5 -10
- package/components/timepicker/styles.js +0 -1
- package/components/timepicker/useDisabled.js +2 -4
- package/components/timepicker/useFormats.js +4 -13
- package/components/timepicker/useStep.d.ts +1 -1
- package/components/timepicker/useStep.js +8 -17
- package/components/timepicker/useValue.js +16 -21
- package/components/tip/index.js +0 -2
- package/components/tip/index.vdt.js +5 -17
- package/components/tip/styles.js +0 -3
- package/components/tooltip/content.js +0 -28
- package/components/tooltip/content.vdt.js +15 -25
- package/components/tooltip/index.js +3 -7
- package/components/tooltip/index.spec.js +434 -572
- package/components/tooltip/styles.d.ts +1 -1
- package/components/tooltip/styles.js +2 -10
- package/components/tooltip/tooltip.js +2 -15
- package/components/tooltip/useArrow.js +11 -14
- package/components/transfer/index.d.ts +1 -1
- package/components/transfer/index.js +1 -13
- package/components/transfer/index.spec.js +159 -194
- package/components/transfer/index.vdt.js +16 -34
- package/components/transfer/styles.js +0 -10
- package/components/transfer/useCheck.d.ts +1 -1
- package/components/transfer/useCheck.js +1 -15
- package/components/transfer/useFilter.d.ts +1 -1
- package/components/transfer/useFilter.js +9 -30
- package/components/transfer/useTransfer.js +10 -26
- package/components/tree/index.d.ts +3 -3
- package/components/tree/index.js +4 -22
- package/components/tree/index.spec.js +285 -355
- package/components/tree/index.vdt.js +12 -23
- package/components/tree/styles.js +2 -16
- package/components/tree/useChecked.js +3 -26
- package/components/tree/useDraggable.js +12 -42
- package/components/tree/useExpanded.js +26 -43
- package/components/tree/useFilter.js +3 -10
- package/components/tree/useNodes.d.ts +1 -1
- package/components/tree/useNodes.js +0 -4
- package/components/tree/useSelected.js +21 -38
- package/components/tree/useTransitionEvent.js +3 -5
- package/components/treeSelect/index.js +9 -36
- package/components/treeSelect/index.spec.js +123 -160
- package/components/treeSelect/index.vdt.js +14 -20
- package/components/treeSelect/styles.js +0 -1
- package/components/treeSelect/useValue.js +0 -11
- package/components/types.d.ts +3 -3
- package/components/upload/ajaxUploader.d.ts +1 -1
- package/components/upload/ajaxUploader.js +0 -17
- package/components/upload/index.d.ts +4 -4
- package/components/upload/index.js +0 -14
- package/components/upload/index.spec.js +142 -249
- package/components/upload/index.vdt.js +12 -27
- package/components/upload/styles.js +0 -30
- package/components/upload/useAccept.js +2 -10
- package/components/upload/useDrag.js +0 -7
- package/components/upload/useFiles.js +103 -145
- package/components/upload/useShowImage.js +0 -3
- package/components/upload/useUpload.js +47 -69
- package/components/utils.d.ts +3 -3
- package/components/utils.js +12 -47
- package/components/virtual.js +9 -37
- package/components/wave/index.js +5 -31
- package/hooks/useDelayClose.js +2 -6
- package/hooks/useDocumentClick.js +8 -16
- package/hooks/useDraggable.d.ts +1 -1
- package/hooks/useDraggable.js +0 -9
- package/hooks/useKeyboard.d.ts +3 -3
- package/hooks/useKeyboard.js +0 -10
- package/hooks/useMouseOutsidable.js +0 -8
- package/hooks/useReceive.d.ts +1 -1
- package/hooks/useReceive.js +0 -4
- package/hooks/useRecordComponent.js +0 -6
- package/hooks/useRouter.js +7 -18
- package/hooks/useShowHideEvents.js +0 -3
- package/hooks/useState.d.ts +2 -2
- package/hooks/useState.js +2 -6
- package/i18n/en-US.js +0 -1
- package/i18n/index.d.ts +1 -1
- package/i18n/index.js +0 -7
- package/index.d.ts +2 -2
- package/index.js +2 -3
- package/package.json +2 -2
- package/styles/global.js +2 -3
- package/styles/keyframes.js +0 -1
- package/styles/theme.d.ts +1 -1
- package/styles/theme.js +4 -7
- package/styles/utils.d.ts +1 -1
- package/styles/utils.js +3 -17
- package/yarn-error.log +633 -517
- package/components/cascader/index.d.ts +0 -45
- package/components/datepicker/index.d.ts +0 -63
- package/components/select/select.d.ts +0 -33
- package/components/timepicker/panelPicker.d.ts +0 -54
- package/components/treeSelect/index.d.ts +0 -27
|
@@ -13,16 +13,12 @@ import { useStep } from './useStep';
|
|
|
13
13
|
import { typeDefs } from './constants';
|
|
14
14
|
export var PanelPicker = /*#__PURE__*/function (_BasePicker) {
|
|
15
15
|
_inheritsLoose(PanelPicker, _BasePicker);
|
|
16
|
-
|
|
17
16
|
function PanelPicker() {
|
|
18
17
|
var _context;
|
|
19
|
-
|
|
20
18
|
var _this;
|
|
21
|
-
|
|
22
19
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
23
20
|
args[_key] = arguments[_key];
|
|
24
21
|
}
|
|
25
|
-
|
|
26
22
|
_this = _BasePicker.call.apply(_BasePicker, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
27
23
|
_this.formats = useFormats();
|
|
28
24
|
_this.disabled = useDisabled(_this.formats);
|
|
@@ -31,22 +27,17 @@ export var PanelPicker = /*#__PURE__*/function (_BasePicker) {
|
|
|
31
27
|
_this.step = useStep(_this.disabled, _this.formats);
|
|
32
28
|
return _this;
|
|
33
29
|
}
|
|
34
|
-
|
|
35
30
|
var _proto = PanelPicker.prototype;
|
|
36
|
-
|
|
37
31
|
_proto.getPlaceholder = function getPlaceholder() {
|
|
38
32
|
var _this$get = this.get(),
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
33
|
+
placeholder = _this$get.placeholder,
|
|
34
|
+
range = _this$get.range;
|
|
42
35
|
if (!isNullOrUndefined(placeholder)) return placeholder;
|
|
43
36
|
return range ? _$('开始时间 ~ 结束时间') : _$('请选择时间');
|
|
44
37
|
};
|
|
45
|
-
|
|
46
38
|
_proto.getLabel = function getLabel() {
|
|
47
39
|
return this.value.format();
|
|
48
40
|
};
|
|
49
|
-
|
|
50
41
|
return PanelPicker;
|
|
51
42
|
}(BasePicker);
|
|
52
43
|
PanelPicker.template = template;
|
|
@@ -16,22 +16,19 @@ var _$tmp1 = {
|
|
|
16
16
|
};
|
|
17
17
|
export default function ($props, $blocks, $__proto__) {
|
|
18
18
|
var _classNameObj;
|
|
19
|
-
|
|
20
19
|
$blocks || ($blocks = {});
|
|
21
20
|
$props || ($props = {});
|
|
22
21
|
var $this = this;
|
|
23
|
-
|
|
24
22
|
var _this$get = this.get(),
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
className = _this$get.className,
|
|
24
|
+
range = _this$get.range,
|
|
25
|
+
multiple = _this$get.multiple;
|
|
29
26
|
var _this$value = this.value,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
value = _this$value.value.value,
|
|
28
|
+
onConfirm = _this$value.onConfirm,
|
|
29
|
+
onChangeTime = _this$value.onChangeTime,
|
|
30
|
+
onChangeTimeByStep = _this$value.onChangeTimeByStep,
|
|
31
|
+
getTimeValue = _this$value.getTimeValue;
|
|
35
32
|
var lastValue = last(value);
|
|
36
33
|
var classNameObj = (_classNameObj = {
|
|
37
34
|
'k-time-content': true,
|
|
@@ -39,13 +36,12 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
39
36
|
}, _classNameObj[className] = className, _classNameObj[makePanelStyles()] = true, _classNameObj);
|
|
40
37
|
var options = this.step.options.value;
|
|
41
38
|
var _this$disabled = this.disabled,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
isDisabledTime = _this$disabled.isDisabledTime,
|
|
40
|
+
isDisabledTimeByStep = _this$disabled.isDisabledTimeByStep,
|
|
41
|
+
isDisabledConfirm = _this$disabled.isDisabledConfirm;
|
|
45
42
|
var _this$formats = this.formats,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
getValueFormat = _this$formats.getValueFormat,
|
|
44
|
+
getValueString = _this$formats.getValueString;
|
|
49
45
|
var generatePanel = function generatePanel(flag) {
|
|
50
46
|
var timeValue = getTimeValue(flag);
|
|
51
47
|
return _$ce(2, 'div', [range ? _$ce(2, 'div', flag === PanelFlags.Start ? _$('开始时间') : _$('结束时间'), 0, 'k-timepicker-title') : undefined, !options ? _$cc(DatepickerTime, {
|
|
@@ -67,11 +63,9 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
67
63
|
}
|
|
68
64
|
}), 2, 'k-datepicker-time')], 0, 'k-datepicker-calendar-wrapper');
|
|
69
65
|
};
|
|
70
|
-
|
|
71
66
|
return _$su.call($this, _$tmp0, function ($blocks) {
|
|
72
67
|
var _$blocks = {},
|
|
73
|
-
|
|
74
|
-
|
|
68
|
+
__$blocks = _$ex({}, $blocks);
|
|
75
69
|
return (_$blocks['base-menu'] = function ($super) {
|
|
76
70
|
return _$cc(DropdownMenu, {
|
|
77
71
|
'className': _$cn(classNameObj),
|
|
@@ -85,21 +79,17 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
85
79
|
});
|
|
86
80
|
}, __$blocks['base-menu'] = function ($super, data) {
|
|
87
81
|
var block = $blocks['base-menu'];
|
|
88
|
-
|
|
89
82
|
var callBlock = function callBlock() {
|
|
90
83
|
return _$blocks['base-menu'].call($this, $super, data);
|
|
91
84
|
};
|
|
92
|
-
|
|
93
85
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
94
86
|
}), (_$blocks['suffix'] = function ($super) {
|
|
95
87
|
return _$cc(Icon, _$tmp1);
|
|
96
88
|
}, __$blocks['suffix'] = function ($super, data) {
|
|
97
89
|
var block = $blocks['suffix'];
|
|
98
|
-
|
|
99
90
|
var callBlock = function callBlock() {
|
|
100
91
|
return _$blocks['suffix'].call($this, $super, data);
|
|
101
92
|
};
|
|
102
|
-
|
|
103
93
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
104
94
|
}), __$blocks;
|
|
105
95
|
}.call($this, $blocks), $__proto__);
|
|
@@ -8,23 +8,18 @@ import { useDisabled } from '../datepicker/useDisabled';
|
|
|
8
8
|
import { useStep } from './useStep';
|
|
9
9
|
export var SelectPicker = /*#__PURE__*/function (_Component) {
|
|
10
10
|
_inheritsLoose(SelectPicker, _Component);
|
|
11
|
-
|
|
12
11
|
function SelectPicker() {
|
|
13
12
|
var _context;
|
|
14
|
-
|
|
15
13
|
var _this;
|
|
16
|
-
|
|
17
14
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
18
15
|
args[_key] = arguments[_key];
|
|
19
16
|
}
|
|
20
|
-
|
|
21
17
|
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
22
18
|
_this.formats = useFormats();
|
|
23
19
|
_this.disabled = useDisabled(_this.formats);
|
|
24
20
|
_this.step = useStep(_this.disabled, _this.formats);
|
|
25
21
|
return _this;
|
|
26
22
|
}
|
|
27
|
-
|
|
28
23
|
return SelectPicker;
|
|
29
24
|
}(Component);
|
|
30
25
|
SelectPicker.template = template;
|
|
@@ -12,13 +12,11 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
12
12
|
$blocks || ($blocks = {});
|
|
13
13
|
$props || ($props = {});
|
|
14
14
|
var $this = this;
|
|
15
|
-
|
|
16
15
|
var _this$get = this.get(),
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
className = _this$get.className,
|
|
17
|
+
value = _this$get.value,
|
|
18
|
+
placeholder = _this$get.placeholder,
|
|
19
|
+
rest = _objectWithoutPropertiesLoose(_this$get, _excluded);
|
|
22
20
|
var options = this.step.options.value;
|
|
23
21
|
return _$cc(Select, _extends({}, rest, {
|
|
24
22
|
'placeholder': placeholder || _$('请选择时间'),
|
|
@@ -32,17 +30,14 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
32
30
|
}, $this),
|
|
33
31
|
'$blocks': function ($blocks) {
|
|
34
32
|
var _$blocks = {},
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
__$blocks = _$ex({}, $blocks);
|
|
37
34
|
return (_$blocks['suffix'] = function ($super) {
|
|
38
35
|
return _$cc(Icon, _$tmp0);
|
|
39
36
|
}, __$blocks['suffix'] = function ($super, data) {
|
|
40
37
|
var block = $blocks['suffix'];
|
|
41
|
-
|
|
42
38
|
var callBlock = function callBlock() {
|
|
43
39
|
return _$blocks['suffix'].call($this, $super, data);
|
|
44
40
|
};
|
|
45
|
-
|
|
46
41
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
47
42
|
}), __$blocks;
|
|
48
43
|
}.call($this, _$em),
|
|
@@ -4,13 +4,11 @@ var _excluded = ["isDisabledTime"];
|
|
|
4
4
|
import { useDisabled as useDisabledBase } from '../datepicker/useDisabled';
|
|
5
5
|
export function useDisabled(formats) {
|
|
6
6
|
var _useDisabledBase = useDisabledBase(formats),
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
isDisabledTime = _useDisabledBase.isDisabledTime,
|
|
8
|
+
rest = _objectWithoutPropertiesLoose(_useDisabledBase, _excluded);
|
|
10
9
|
function isDisabledTimeByStep(value, flag) {
|
|
11
10
|
return isDisabledTime(formats.createDateByValueFormat(value), flag);
|
|
12
11
|
}
|
|
13
|
-
|
|
14
12
|
return _extends({
|
|
15
13
|
isDisabledTime: isDisabledTime,
|
|
16
14
|
isDisabledTimeByStep: isDisabledTimeByStep
|
|
@@ -3,39 +3,30 @@ import dayjs from '../datepicker/dayjs';
|
|
|
3
3
|
import { YEAR_FORMAT, TIME_FORMAT, PREFIX } from './constants';
|
|
4
4
|
export function useFormats() {
|
|
5
5
|
var instance = useInstance();
|
|
6
|
-
|
|
7
6
|
function getValueFormat() {
|
|
8
7
|
var _instance$get = instance.get(),
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
format = _instance$get.format,
|
|
9
|
+
valueFormat = _instance$get.valueFormat;
|
|
12
10
|
return valueFormat || format || TIME_FORMAT;
|
|
13
11
|
}
|
|
14
|
-
|
|
15
12
|
function getShowFormat() {
|
|
16
13
|
var _instance$get2 = instance.get(),
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
format = _instance$get2.format,
|
|
15
|
+
showFormat = _instance$get2.showFormat;
|
|
20
16
|
return showFormat || format || TIME_FORMAT;
|
|
21
17
|
}
|
|
22
|
-
|
|
23
18
|
function createDateByValueFormat(value) {
|
|
24
19
|
return dayjs(PREFIX + value, YEAR_FORMAT + getValueFormat());
|
|
25
20
|
}
|
|
26
|
-
|
|
27
21
|
function createDateByShowFormat(value) {
|
|
28
22
|
return dayjs(PREFIX + value, YEAR_FORMAT + getShowFormat(), true); // strict parsing
|
|
29
23
|
}
|
|
30
|
-
|
|
31
24
|
function getShowString(value) {
|
|
32
25
|
return value.format(getShowFormat());
|
|
33
26
|
}
|
|
34
|
-
|
|
35
27
|
function getValueString(value) {
|
|
36
28
|
return value.format(getValueFormat());
|
|
37
29
|
}
|
|
38
|
-
|
|
39
30
|
return {
|
|
40
31
|
getValueFormat: getValueFormat,
|
|
41
32
|
getShowFormat: getShowFormat,
|
|
@@ -5,30 +5,26 @@ import { NOW_START, NOW_END } from './constants';
|
|
|
5
5
|
import { useReceive } from '../../hooks/useReceive';
|
|
6
6
|
export function useStep(_ref, _ref2) {
|
|
7
7
|
var maxDate = _ref.maxDate,
|
|
8
|
-
|
|
8
|
+
minDate = _ref.minDate;
|
|
9
9
|
var getValueString = _ref2.getValueString,
|
|
10
|
-
|
|
10
|
+
getShowString = _ref2.getShowString;
|
|
11
11
|
var instance = useInstance();
|
|
12
12
|
var options = useState(null);
|
|
13
13
|
useReceive(['step', 'min', 'max'], generateOptions);
|
|
14
|
-
|
|
15
14
|
function generateOptions() {
|
|
16
15
|
var _instance$get = instance.get(),
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
step = _instance$get.step;
|
|
19
17
|
if (step) {
|
|
20
18
|
var data = [];
|
|
21
19
|
var maxValue = maxDate.value || NOW_END;
|
|
22
20
|
var stepValue = parseTime(step);
|
|
23
21
|
var value = minDate.value || NOW_START;
|
|
24
|
-
|
|
25
22
|
var push = function push(value) {
|
|
26
23
|
data.push({
|
|
27
24
|
value: getValueString(value),
|
|
28
25
|
label: getShowString(value)
|
|
29
26
|
});
|
|
30
27
|
};
|
|
31
|
-
|
|
32
28
|
for (;; value = value.add(stepValue, 'second')) {
|
|
33
29
|
if (value <= maxValue) {
|
|
34
30
|
push(value);
|
|
@@ -42,26 +38,21 @@ export function useStep(_ref, _ref2) {
|
|
|
42
38
|
break;
|
|
43
39
|
}
|
|
44
40
|
}
|
|
45
|
-
|
|
46
41
|
options.set(data);
|
|
47
42
|
} else {
|
|
48
43
|
options.set(null);
|
|
49
44
|
}
|
|
50
45
|
}
|
|
51
|
-
|
|
52
46
|
function parseTime(time) {
|
|
53
47
|
var _context;
|
|
54
|
-
|
|
55
48
|
var _time$split$map = _mapInstanceProperty(_context = time.split(':')).call(_context, function (item) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
49
|
+
return parseInt(item, 10);
|
|
50
|
+
}),
|
|
51
|
+
hours = _time$split$map[0],
|
|
52
|
+
minutes = _time$split$map[1],
|
|
53
|
+
seconds = _time$split$map[2];
|
|
62
54
|
return (hours * 60 + (minutes || 0)) * 60 + (seconds || 0);
|
|
63
55
|
}
|
|
64
|
-
|
|
65
56
|
return {
|
|
66
57
|
options: options
|
|
67
58
|
};
|
|
@@ -8,40 +8,35 @@ import { useValue as useValueBase } from '../datepicker/basepicker';
|
|
|
8
8
|
import { NOW_START, NOW_END } from './constants';
|
|
9
9
|
export function useValue(formats, disabled, panel) {
|
|
10
10
|
var instance = useInstance();
|
|
11
|
-
|
|
12
11
|
var _useValueBase = useValueBase(formats, disabled, panel, function (v) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
12
|
+
return false;
|
|
13
|
+
}, function (v) {
|
|
14
|
+
// pop the last value when input
|
|
15
|
+
// because it is a placeholder date
|
|
16
|
+
value.value.pop();
|
|
17
|
+
setValue(v, true);
|
|
18
|
+
}, function () {
|
|
19
|
+
return 'second';
|
|
20
|
+
}, function (dayjsValue, value) {
|
|
21
|
+
value.set(_sliceInstanceProperty(dayjsValue).call(dayjsValue, 0));
|
|
22
|
+
}),
|
|
23
|
+
value = _useValueBase.value,
|
|
24
|
+
getDayjsValue = _useValueBase.getDayjsValue,
|
|
25
|
+
setValue = _useValueBase.setValue,
|
|
26
|
+
onChangeTime = _useValueBase.onChangeTime,
|
|
27
|
+
rest = _objectWithoutPropertiesLoose(_useValueBase, _excluded);
|
|
30
28
|
setValue(getPlaceholderDates(), false);
|
|
31
29
|
instance.watch('value', function (value) {
|
|
32
30
|
var dayjsValue = getDayjsValue();
|
|
33
31
|
setValue(last(dayjsValue) || getPlaceholderDates(), false);
|
|
34
32
|
});
|
|
35
|
-
|
|
36
33
|
function getPlaceholderDates() {
|
|
37
34
|
return instance.get('range') ? [NOW_START, NOW_END] : NOW_START;
|
|
38
35
|
}
|
|
39
|
-
|
|
40
36
|
function onChangeTimeByStep(v, flag) {
|
|
41
37
|
var date = formats.createDateByValueFormat(v);
|
|
42
38
|
onChangeTime(date, flag);
|
|
43
39
|
}
|
|
44
|
-
|
|
45
40
|
return _extends({
|
|
46
41
|
value: value,
|
|
47
42
|
setValue: setValue,
|
package/components/tip/index.js
CHANGED
|
@@ -3,11 +3,9 @@ import template from './index.vdt';
|
|
|
3
3
|
import { Tag } from '../tag/base';
|
|
4
4
|
export var Tip = /*#__PURE__*/function (_Tag) {
|
|
5
5
|
_inheritsLoose(Tip, _Tag);
|
|
6
|
-
|
|
7
6
|
function Tip() {
|
|
8
7
|
return _Tag.apply(this, arguments) || this;
|
|
9
8
|
}
|
|
10
|
-
|
|
11
9
|
return Tip;
|
|
12
10
|
}(Tag);
|
|
13
11
|
Tip.template = template;
|
|
@@ -4,19 +4,16 @@ import { Icon } from '../icon';
|
|
|
4
4
|
import { makeStyles } from './styles';
|
|
5
5
|
export default function ($props, $blocks, $__proto__) {
|
|
6
6
|
var _classNameObj;
|
|
7
|
-
|
|
8
7
|
$blocks || ($blocks = {});
|
|
9
8
|
$props || ($props = {});
|
|
10
9
|
var $this = this;
|
|
11
10
|
var _$blocks = {};
|
|
12
11
|
var __$blocks = {};
|
|
13
|
-
|
|
14
12
|
var _this$get = this.get(),
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
children = _this$get.children,
|
|
14
|
+
closable = _this$get.closable,
|
|
15
|
+
type = _this$get.type,
|
|
16
|
+
disabled = _this$get.disabled;
|
|
20
17
|
var classNameObj = (_classNameObj = {
|
|
21
18
|
'k-tip': true
|
|
22
19
|
}, _classNameObj[makeStyles()] = true, _classNameObj);
|
|
@@ -25,27 +22,22 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
25
22
|
'name': 'k-fade'
|
|
26
23
|
}, function ($blocks) {
|
|
27
24
|
var _$blocks = {},
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
__$blocks = _$ex({}, $blocks);
|
|
30
26
|
return (_$blocks['body'] = function ($super) {
|
|
31
27
|
return _$ce(2, 'div', [$blocks.title ? _$ce(2, 'div', (_$blocks['title'] = function ($super) {
|
|
32
28
|
return null;
|
|
33
29
|
}, __$blocks['title'] = function ($super, data) {
|
|
34
30
|
var block = $blocks['title'];
|
|
35
|
-
|
|
36
31
|
var callBlock = function callBlock() {
|
|
37
32
|
return _$blocks['title'].call($this, $super, data);
|
|
38
33
|
};
|
|
39
|
-
|
|
40
34
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
41
35
|
}, __$blocks['title'](_$no)), 0, 'k-tip-title') : undefined, children], 0, 'k-tip-wrapper');
|
|
42
36
|
}, __$blocks['body'] = function ($super, data) {
|
|
43
37
|
var block = $blocks['body'];
|
|
44
|
-
|
|
45
38
|
var callBlock = function callBlock() {
|
|
46
39
|
return _$blocks['body'].call($this, $super, data);
|
|
47
40
|
};
|
|
48
|
-
|
|
49
41
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
50
42
|
}), (_$blocks['_close'] = function ($super) {
|
|
51
43
|
return closable ? _$cc(Button, {
|
|
@@ -62,21 +54,17 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
62
54
|
});
|
|
63
55
|
}, __$blocks['close'] = function ($super, data) {
|
|
64
56
|
var block = $blocks['close'];
|
|
65
|
-
|
|
66
57
|
var callBlock = function callBlock() {
|
|
67
58
|
return _$blocks['close'].call($this, $super, data);
|
|
68
59
|
};
|
|
69
|
-
|
|
70
60
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
71
61
|
}, __$blocks['close'](_$no))
|
|
72
62
|
}) : undefined;
|
|
73
63
|
}, __$blocks['_close'] = function ($super, data) {
|
|
74
64
|
var block = $blocks['_close'];
|
|
75
|
-
|
|
76
65
|
var callBlock = function callBlock() {
|
|
77
66
|
return _$blocks['_close'].call($this, $super, data);
|
|
78
67
|
};
|
|
79
|
-
|
|
80
68
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
81
69
|
}), __$blocks;
|
|
82
70
|
}.call($this, $blocks), $__proto__);
|
package/components/tip/styles.js
CHANGED
|
@@ -8,102 +8,74 @@ import { useArrow } from './useArrow';
|
|
|
8
8
|
import { tooltip as tooltipTheme } from './styles';
|
|
9
9
|
export var TooltipContent = /*#__PURE__*/function (_DropdownMenu) {
|
|
10
10
|
_inheritsLoose(TooltipContent, _DropdownMenu);
|
|
11
|
-
|
|
12
11
|
function TooltipContent() {
|
|
13
12
|
var _context;
|
|
14
|
-
|
|
15
13
|
var _this;
|
|
16
|
-
|
|
17
14
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
18
15
|
args[_key] = arguments[_key];
|
|
19
16
|
}
|
|
20
|
-
|
|
21
17
|
_this = _DropdownMenu.call.apply(_DropdownMenu, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
22
18
|
_this.isEmptyChildren = true;
|
|
23
19
|
_this.arrow = useArrow();
|
|
24
20
|
return _this;
|
|
25
21
|
}
|
|
26
|
-
|
|
27
22
|
var _proto = TooltipContent.prototype;
|
|
28
|
-
|
|
29
23
|
_proto.init = function init() {
|
|
30
24
|
var _this2 = this;
|
|
31
|
-
|
|
32
25
|
_DropdownMenu.prototype.init.call(this);
|
|
33
|
-
|
|
34
26
|
this.on('$receive:children', function (vNodes) {
|
|
35
27
|
_this2.isEmptyChildren = isEmptyChildren(vNodes);
|
|
36
28
|
});
|
|
37
29
|
};
|
|
38
|
-
|
|
39
30
|
_proto.onEnter = function onEnter(elem) {
|
|
40
31
|
// fix the width, https://github.com/ksc-fe/kpc/issues/873
|
|
41
32
|
var maxWidth = parseInt(tooltipTheme.maxWidth);
|
|
42
33
|
var width = elem.offsetWidth;
|
|
43
|
-
|
|
44
34
|
if (width === maxWidth) {
|
|
45
35
|
elem.style.width = width + "px";
|
|
46
36
|
}
|
|
47
|
-
|
|
48
37
|
this.dropdown.position();
|
|
49
38
|
};
|
|
50
|
-
|
|
51
39
|
_proto.onAfterLeave = function onAfterLeave(elem) {
|
|
52
40
|
// remove the position after leave, https://github.com/ksc-fe/kpc/issues/873
|
|
53
41
|
var style = elem.style;
|
|
54
42
|
style.left = style.top = style.width = '';
|
|
55
43
|
};
|
|
56
|
-
|
|
57
44
|
_proto.onMouseEnter = function onMouseEnter(e) {
|
|
58
45
|
var dropdown = this.dropdown;
|
|
59
|
-
|
|
60
46
|
if (dropdown.get('hoverable')) {
|
|
61
47
|
dropdown.show();
|
|
62
48
|
}
|
|
63
|
-
|
|
64
49
|
dropdown.trigger('mouseenter', e);
|
|
65
50
|
};
|
|
66
|
-
|
|
67
51
|
_proto.ok = function ok() {
|
|
68
52
|
var dropdown = this.dropdown;
|
|
69
53
|
dropdown.hide(true);
|
|
70
54
|
dropdown.trigger('ok');
|
|
71
55
|
};
|
|
72
|
-
|
|
73
56
|
_proto.cancel = function cancel() {
|
|
74
57
|
var dropdown = this.dropdown;
|
|
75
58
|
dropdown.hide(true);
|
|
76
59
|
dropdown.trigger('cancel');
|
|
77
60
|
};
|
|
78
|
-
|
|
79
61
|
return TooltipContent;
|
|
80
62
|
}(DropdownMenu);
|
|
81
63
|
TooltipContent.template = template;
|
|
82
|
-
|
|
83
64
|
__decorate([bind], TooltipContent.prototype, "onEnter", null);
|
|
84
|
-
|
|
85
65
|
__decorate([bind], TooltipContent.prototype, "onAfterLeave", null);
|
|
86
|
-
|
|
87
66
|
__decorate([bind], TooltipContent.prototype, "onMouseEnter", null);
|
|
88
|
-
|
|
89
67
|
__decorate([bind], TooltipContent.prototype, "ok", null);
|
|
90
|
-
|
|
91
68
|
__decorate([bind], TooltipContent.prototype, "cancel", null);
|
|
92
|
-
|
|
93
69
|
function isEmptyChildren(vNodes) {
|
|
94
70
|
if (!vNodes) return true;
|
|
95
|
-
|
|
96
71
|
if (Array.isArray(vNodes)) {
|
|
97
72
|
return vNodes.every(function (vNode) {
|
|
98
73
|
return isEmptyChildren(vNode);
|
|
99
74
|
});
|
|
100
75
|
}
|
|
101
|
-
|
|
102
76
|
if (vNodes.type === 1) {
|
|
103
77
|
return !vNodes.children;
|
|
104
78
|
}
|
|
105
|
-
|
|
106
79
|
return false;
|
|
107
80
|
}
|
|
108
|
-
|
|
109
81
|
;
|
|
@@ -3,32 +3,28 @@ import { Button } from '../button';
|
|
|
3
3
|
import makeStyles from './styles';
|
|
4
4
|
export default function ($props, $blocks, $__proto__) {
|
|
5
5
|
var _classNameObj;
|
|
6
|
-
|
|
7
6
|
$blocks || ($blocks = {});
|
|
8
7
|
$props || ($props = {});
|
|
9
8
|
var $this = this;
|
|
10
9
|
var _$blocks = {};
|
|
11
10
|
var __$blocks = {};
|
|
12
|
-
|
|
13
11
|
var _this$dropdown$get = this.dropdown.get(),
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
12
|
+
showArrow = _this$dropdown$get.showArrow,
|
|
13
|
+
confirm = _this$dropdown$get.confirm,
|
|
14
|
+
className = _this$dropdown$get.className,
|
|
15
|
+
theme = _this$dropdown$get.theme,
|
|
16
|
+
hoverable = _this$dropdown$get.hoverable,
|
|
17
|
+
trigger = _this$dropdown$get.trigger,
|
|
18
|
+
value = _this$dropdown$get.value,
|
|
19
|
+
cancelText = _this$dropdown$get.cancelText,
|
|
20
|
+
okText = _this$dropdown$get.okText,
|
|
21
|
+
size = _this$dropdown$get.size,
|
|
22
|
+
always = _this$dropdown$get.always;
|
|
26
23
|
var _this$get = this.get(),
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
children = _this$get.children;
|
|
29
25
|
var _this$arrow = this.arrow,
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
arrowRef = _this$arrow.arrowRef,
|
|
27
|
+
arrowType = _this$arrow.arrowType;
|
|
32
28
|
var classNameObj = (_classNameObj = {
|
|
33
29
|
'k-tooltip-content': true,
|
|
34
30
|
'k-hoverable': hoverable || trigger === 'click',
|
|
@@ -45,11 +41,9 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
45
41
|
'className': _$cn(classNameObj)
|
|
46
42
|
}, function ($blocks) {
|
|
47
43
|
var _$blocks = {},
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
__$blocks = _$ex({}, $blocks);
|
|
50
45
|
return (_$blocks['children'] = function ($super) {
|
|
51
46
|
var _$cn2;
|
|
52
|
-
|
|
53
47
|
return [children, showArrow ? _$ce(2, 'i', null, 1, _$cn((_$cn2 = {
|
|
54
48
|
"k-tooltip-arrow": true
|
|
55
49
|
}, _$cn2["k-" + arrowType.value] = arrowType.value, _$cn2)), null, 'tooltip-arrow', arrowRef) : undefined, confirm ? _$ce(2, 'div', (_$blocks['buttons'] = function ($super) {
|
|
@@ -65,20 +59,16 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
65
59
|
})];
|
|
66
60
|
}, __$blocks['buttons'] = function ($super, data) {
|
|
67
61
|
var block = $blocks['buttons'];
|
|
68
|
-
|
|
69
62
|
var callBlock = function callBlock() {
|
|
70
63
|
return _$blocks['buttons'].call($this, $super, data);
|
|
71
64
|
};
|
|
72
|
-
|
|
73
65
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
74
66
|
}, __$blocks['buttons'](_$no)), 0, 'k-tooltip-buttons', null, 'tooltip-buttons') : undefined];
|
|
75
67
|
}, __$blocks['children'] = function ($super, data) {
|
|
76
68
|
var block = $blocks['children'];
|
|
77
|
-
|
|
78
69
|
var callBlock = function callBlock() {
|
|
79
70
|
return _$blocks['children'].call($this, $super, data);
|
|
80
71
|
};
|
|
81
|
-
|
|
82
72
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
83
73
|
}), __$blocks;
|
|
84
74
|
}.call($this, $blocks), $__proto__);
|