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