@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
package/hooks/useDelayClose.js
CHANGED
|
@@ -2,24 +2,28 @@ import { onMounted, useInstance, onUnmounted } from 'intact-vue-next';
|
|
|
2
2
|
export function useDelayClose(close, duration) {
|
|
3
3
|
var instance = useInstance();
|
|
4
4
|
var timer;
|
|
5
|
+
|
|
5
6
|
function delayClose() {
|
|
6
7
|
if (duration) {
|
|
7
8
|
timer = window.setTimeout(close, duration);
|
|
8
9
|
}
|
|
9
10
|
}
|
|
11
|
+
|
|
10
12
|
function onMouseEnter(e) {
|
|
11
13
|
instance.trigger('mouseenter', e);
|
|
12
14
|
clearTimeout(timer);
|
|
13
15
|
}
|
|
16
|
+
|
|
14
17
|
function onMouseLeave(e) {
|
|
15
|
-
instance.trigger('mouseleave', e);
|
|
16
|
-
// mouse leave event is not a delegated event,
|
|
18
|
+
instance.trigger('mouseleave', e); // mouse leave event is not a delegated event,
|
|
17
19
|
// and it will not unmount when the dom has unmounted,
|
|
18
20
|
// so we must detect the $unmounted status here
|
|
21
|
+
|
|
19
22
|
if (instance.$unmounted) return;
|
|
20
23
|
clearTimeout(timer);
|
|
21
24
|
delayClose();
|
|
22
25
|
}
|
|
26
|
+
|
|
23
27
|
onMounted(delayClose);
|
|
24
28
|
onUnmounted(function () {
|
|
25
29
|
clearTimeout(timer);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { onMounted, onUnmounted } from 'intact-vue-next';
|
|
2
|
-
import { isFunction } from 'intact-shared';
|
|
3
|
-
|
|
4
|
-
var getNow = Date.now;
|
|
5
|
-
// Determine what event timestamp the browser is using. Annoyingly, the
|
|
2
|
+
import { isFunction } from 'intact-shared'; // @reference: Vue3.0
|
|
3
|
+
|
|
4
|
+
var getNow = Date.now; // Determine what event timestamp the browser is using. Annoyingly, the
|
|
6
5
|
// timestamp can either be hi-res (relative to page load) or low-res
|
|
7
6
|
// (relative to UNIX epoch), so in order to compare time we have to use the
|
|
8
7
|
// same timestamp type when saving the flush timestamp.
|
|
8
|
+
|
|
9
9
|
if (getNow() > document.createEvent('Event').timeStamp) {
|
|
10
10
|
// if the low-res timestamp which is bigger than the event timestamp
|
|
11
11
|
// (which is evaluated AFTER) it means the event is using a hi-res timestamp,
|
|
@@ -13,39 +13,47 @@ if (getNow() > document.createEvent('Event').timeStamp) {
|
|
|
13
13
|
getNow = function getNow() {
|
|
14
14
|
return performance.now();
|
|
15
15
|
};
|
|
16
|
-
}
|
|
17
|
-
// #3485: Firefox <= 53 has incorrect Event.timeStamp implementation
|
|
16
|
+
} // #3485: Firefox <= 53 has incorrect Event.timeStamp implementation
|
|
18
17
|
// and does not fire microtasks in between event propagation, so safe to exclude.
|
|
18
|
+
|
|
19
|
+
|
|
19
20
|
var ffMatch = navigator.userAgent.match(/firefox\/(\d+)/i);
|
|
20
21
|
var skipTimestampCheck = !!(ffMatch && Number(ffMatch[1]) <= 53);
|
|
21
22
|
export function useDocumentClick(ref, callback, manual) {
|
|
22
23
|
if (manual === void 0) {
|
|
23
24
|
manual = false;
|
|
24
25
|
}
|
|
26
|
+
|
|
25
27
|
var onDocumentClick = function onDocumentClick(e) {
|
|
26
|
-
if (e._ignore) return;
|
|
27
|
-
|
|
28
|
+
if (e._ignore) return; // https://github.com/ksc-fe/kpc/issues/788
|
|
29
|
+
|
|
28
30
|
var timeStamp = e.timeStamp || getNow();
|
|
31
|
+
|
|
29
32
|
if (!skipTimestampCheck && onDocumentClick.timeStamp > timeStamp + 1) {
|
|
30
33
|
return;
|
|
31
34
|
}
|
|
35
|
+
|
|
32
36
|
var target = e.target;
|
|
33
37
|
var elem = isFunction(ref) ? ref() : ref.value;
|
|
34
38
|
if (containsOrEqual(elem, target)) return;
|
|
35
39
|
callback(e);
|
|
36
40
|
};
|
|
41
|
+
|
|
37
42
|
var add = function add() {
|
|
38
43
|
onDocumentClick.timeStamp = getNow();
|
|
39
44
|
document.addEventListener('click', onDocumentClick);
|
|
40
45
|
document.addEventListener('contextmenu', onDocumentClick);
|
|
41
46
|
};
|
|
47
|
+
|
|
42
48
|
var remove = function remove() {
|
|
43
49
|
document.removeEventListener('click', onDocumentClick);
|
|
44
50
|
document.removeEventListener('contextmenu', onDocumentClick);
|
|
45
51
|
};
|
|
52
|
+
|
|
46
53
|
if (!manual) {
|
|
47
54
|
onMounted(add);
|
|
48
55
|
}
|
|
56
|
+
|
|
49
57
|
onUnmounted(remove);
|
|
50
58
|
return [add, remove];
|
|
51
59
|
}
|
package/hooks/useDraggable.d.ts
CHANGED
package/hooks/useDraggable.js
CHANGED
|
@@ -2,33 +2,42 @@ import { onUnmounted } from 'intact-vue-next';
|
|
|
2
2
|
import { useState } from './useState';
|
|
3
3
|
export function useDraggable(options) {
|
|
4
4
|
var dragging = useState(false);
|
|
5
|
+
|
|
5
6
|
function start(e) {
|
|
6
7
|
// ignore if it isn't left key
|
|
7
8
|
if (e.which !== 1 || options.disable != null && options.disable()) return;
|
|
8
9
|
dragging.set(true);
|
|
10
|
+
|
|
9
11
|
if (options.onStart) {
|
|
10
12
|
options.onStart(e);
|
|
11
13
|
}
|
|
14
|
+
|
|
12
15
|
document.addEventListener('mousemove', move);
|
|
13
16
|
document.addEventListener('mouseup', end);
|
|
14
17
|
}
|
|
18
|
+
|
|
15
19
|
function move(e) {
|
|
16
20
|
if (options.disable != null && options.disable()) return;
|
|
17
21
|
e.preventDefault();
|
|
22
|
+
|
|
18
23
|
if (dragging.value) {
|
|
19
24
|
options.onMove(e);
|
|
20
25
|
}
|
|
21
26
|
}
|
|
27
|
+
|
|
22
28
|
function end(e) {
|
|
23
29
|
if (dragging.value) {
|
|
24
30
|
dragging.set(false);
|
|
31
|
+
|
|
25
32
|
if (options.onEnd) {
|
|
26
33
|
options.onEnd(e);
|
|
27
34
|
}
|
|
35
|
+
|
|
28
36
|
document.removeEventListener('mousemove', move);
|
|
29
37
|
document.removeEventListener('mouseup', end);
|
|
30
38
|
}
|
|
31
39
|
}
|
|
40
|
+
|
|
32
41
|
onUnmounted(function () {
|
|
33
42
|
return end();
|
|
34
43
|
});
|
package/hooks/useKeyboard.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export type Handler = (e: KeyboardEvent) => void;
|
|
2
|
-
export type Listener = (fn: () => void) => () => void;
|
|
3
|
-
export type Options = {
|
|
1
|
+
export declare type Handler = (e: KeyboardEvent) => void;
|
|
2
|
+
export declare type Listener = (fn: () => void) => () => void;
|
|
3
|
+
export declare type Options = {
|
|
4
4
|
down: Handler;
|
|
5
5
|
up: Handler;
|
|
6
6
|
right: Handler;
|
package/hooks/useKeyboard.js
CHANGED
|
@@ -1,40 +1,50 @@
|
|
|
1
1
|
import { onUnmounted } from 'intact-vue-next';
|
|
2
2
|
export function useKeyboard(options) {
|
|
3
3
|
var locked = false;
|
|
4
|
+
|
|
4
5
|
var onKeydown = function onKeydown(e) {
|
|
5
6
|
if (locked) return;
|
|
7
|
+
|
|
6
8
|
switch (e.keyCode) {
|
|
7
9
|
// down
|
|
8
10
|
case 40:
|
|
9
11
|
options.down(e);
|
|
10
12
|
break;
|
|
11
13
|
// up
|
|
14
|
+
|
|
12
15
|
case 38:
|
|
13
16
|
options.up(e);
|
|
14
17
|
break;
|
|
15
18
|
// right
|
|
19
|
+
|
|
16
20
|
case 39:
|
|
17
21
|
options.right(e);
|
|
18
22
|
break;
|
|
19
23
|
// left
|
|
24
|
+
|
|
20
25
|
case 37:
|
|
21
26
|
options.left(e);
|
|
22
27
|
break;
|
|
23
28
|
// enter
|
|
29
|
+
|
|
24
30
|
case 13:
|
|
25
31
|
options.enter(e);
|
|
26
32
|
break;
|
|
33
|
+
|
|
27
34
|
default:
|
|
28
35
|
options.default && options.default(e);
|
|
29
36
|
break;
|
|
30
37
|
}
|
|
31
38
|
};
|
|
39
|
+
|
|
32
40
|
var removeEventListener = function removeEventListener() {
|
|
33
41
|
document.removeEventListener('keydown', onKeydown);
|
|
34
42
|
};
|
|
43
|
+
|
|
35
44
|
var addEventListener = function addEventListener() {
|
|
36
45
|
document.addEventListener('keydown', onKeydown);
|
|
37
46
|
};
|
|
47
|
+
|
|
38
48
|
onUnmounted(removeEventListener);
|
|
39
49
|
return [addEventListener, removeEventListener, function (v) {
|
|
40
50
|
return locked = v;
|
|
@@ -8,32 +8,40 @@ export function useMouseOutsidable(elementRef, autoAdd) {
|
|
|
8
8
|
if (autoAdd === void 0) {
|
|
9
9
|
autoAdd = true;
|
|
10
10
|
}
|
|
11
|
+
|
|
11
12
|
var timer;
|
|
13
|
+
|
|
12
14
|
function onMouseDown() {
|
|
13
15
|
document.addEventListener('click', onDocumentClick, true);
|
|
14
16
|
document.addEventListener('mouseup', onMouseUp);
|
|
15
17
|
}
|
|
18
|
+
|
|
16
19
|
function onMouseUp() {
|
|
17
20
|
timer = window.setTimeout(function () {
|
|
18
21
|
document.removeEventListener('click', onDocumentClick, true);
|
|
19
22
|
});
|
|
20
23
|
document.removeEventListener('mouseup', onMouseUp);
|
|
21
24
|
}
|
|
25
|
+
|
|
22
26
|
function onDocumentClick(e) {
|
|
23
27
|
if (!containsOrEqual(elementRef.value, e.target)) {
|
|
24
28
|
e.stopPropagation();
|
|
25
29
|
}
|
|
26
30
|
}
|
|
31
|
+
|
|
27
32
|
if (autoAdd) {
|
|
28
33
|
onMounted(function () {
|
|
29
34
|
elementRef.value.addEventListener('mousedown', onMouseDown);
|
|
30
35
|
});
|
|
31
36
|
}
|
|
37
|
+
|
|
32
38
|
onBeforeUnmount(function () {
|
|
33
39
|
clearTimeout(timer);
|
|
40
|
+
|
|
34
41
|
if (autoAdd) {
|
|
35
42
|
elementRef.value.removeEventListener('mousedown', onMouseDown);
|
|
36
43
|
}
|
|
44
|
+
|
|
37
45
|
document.removeEventListener('click', onDocumentClick, true);
|
|
38
46
|
document.removeEventListener('mouseup', onMouseUp);
|
|
39
47
|
});
|
package/hooks/useReceive.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Component, Props } from 'intact-vue-next';
|
|
2
|
-
type ExtractProps<T extends Component> = T extends Component<infer P> ? Props<P> : never;
|
|
2
|
+
declare type ExtractProps<T extends Component> = T extends Component<infer P> ? Props<P> : never;
|
|
3
3
|
export declare function useReceive<T extends Component>(props: (keyof ExtractProps<T>)[], callback: () => void, ignoreInit?: boolean): void;
|
|
4
4
|
export {};
|
package/hooks/useReceive.js
CHANGED
|
@@ -3,6 +3,7 @@ export function useReceive(props, callback, ignoreInit) {
|
|
|
3
3
|
if (ignoreInit === void 0) {
|
|
4
4
|
ignoreInit = false;
|
|
5
5
|
}
|
|
6
|
+
|
|
6
7
|
var instance = useInstance();
|
|
7
8
|
var shouldCall = false;
|
|
8
9
|
props.forEach(function (prop) {
|
|
@@ -11,14 +12,17 @@ export function useReceive(props, callback, ignoreInit) {
|
|
|
11
12
|
shouldCall = true;
|
|
12
13
|
});
|
|
13
14
|
});
|
|
15
|
+
|
|
14
16
|
function call() {
|
|
15
17
|
if (shouldCall) {
|
|
16
18
|
callback();
|
|
17
19
|
shouldCall = false;
|
|
18
20
|
}
|
|
19
21
|
}
|
|
22
|
+
|
|
20
23
|
if (!ignoreInit) {
|
|
21
24
|
onBeforeMount(call);
|
|
22
25
|
}
|
|
26
|
+
|
|
23
27
|
onBeforeUpdate(call);
|
|
24
28
|
}
|
|
@@ -6,9 +6,11 @@ export function useRecordParent(key, useMap) {
|
|
|
6
6
|
if (key === void 0) {
|
|
7
7
|
key = RECORD_COMPONENT;
|
|
8
8
|
}
|
|
9
|
+
|
|
9
10
|
if (useMap === void 0) {
|
|
10
11
|
useMap = false;
|
|
11
12
|
}
|
|
13
|
+
|
|
12
14
|
var items = useMap ? new _Map() : [];
|
|
13
15
|
provide(key, items);
|
|
14
16
|
return items;
|
|
@@ -17,10 +19,13 @@ export function useRecordItem(key, item, value) {
|
|
|
17
19
|
if (key === void 0) {
|
|
18
20
|
key = RECORD_COMPONENT;
|
|
19
21
|
}
|
|
22
|
+
|
|
20
23
|
if (item === void 0) {
|
|
21
24
|
item = useInstance();
|
|
22
25
|
}
|
|
26
|
+
|
|
23
27
|
var items = inject(key);
|
|
28
|
+
|
|
24
29
|
if (items) {
|
|
25
30
|
onMounted(function () {
|
|
26
31
|
if (value === undefined) {
|
|
@@ -37,5 +42,6 @@ export function useRecordItem(key, item, value) {
|
|
|
37
42
|
}
|
|
38
43
|
});
|
|
39
44
|
}
|
|
45
|
+
|
|
40
46
|
return items;
|
|
41
47
|
}
|
package/hooks/useRouter.js
CHANGED
|
@@ -2,9 +2,13 @@ import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js/instance/slic
|
|
|
2
2
|
import _Array$from from "@babel/runtime-corejs3/core-js/array/from";
|
|
3
3
|
import _Symbol from "@babel/runtime-corejs3/core-js/symbol";
|
|
4
4
|
import _getIteratorMethod from "@babel/runtime-corejs3/core-js/get-iterator-method";
|
|
5
|
+
|
|
5
6
|
function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
7
|
+
|
|
6
8
|
function _unsupportedIterableToArray(o, minLen) { var _context; if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = _sliceInstanceProperty(_context = Object.prototype.toString.call(o)).call(_context, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
7
|
-
|
|
9
|
+
|
|
10
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
11
|
+
|
|
8
12
|
/**
|
|
9
13
|
* @brief find the router instance
|
|
10
14
|
*
|
|
@@ -33,25 +37,30 @@ export function navigate(router, to) {
|
|
|
33
37
|
}
|
|
34
38
|
}
|
|
35
39
|
}
|
|
40
|
+
|
|
36
41
|
function findRouter(instance) {
|
|
37
42
|
var Component = instance.constructor;
|
|
43
|
+
|
|
38
44
|
if (Component.$cid === 'IntactReact') {
|
|
39
45
|
// in React
|
|
40
46
|
var parent = instance;
|
|
47
|
+
|
|
41
48
|
while (!parent.$isReact) {
|
|
42
49
|
parent = parent.$senior;
|
|
43
50
|
if (!parent) return;
|
|
44
51
|
}
|
|
52
|
+
|
|
45
53
|
for (var _iterator = _createForOfIteratorHelperLoose(parent.$reactProviders), _step; !(_step = _iterator()).done;) {
|
|
46
54
|
var _step$value = _step.value,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
var displayName = key._context.displayName;
|
|
50
|
-
|
|
55
|
+
key = _step$value[0],
|
|
56
|
+
value = _step$value[1];
|
|
57
|
+
var displayName = key._context.displayName; // V6
|
|
58
|
+
|
|
51
59
|
if (displayName === 'Navigation') {
|
|
52
60
|
return value.navigator;
|
|
53
|
-
}
|
|
54
|
-
|
|
61
|
+
} // V5
|
|
62
|
+
|
|
63
|
+
|
|
55
64
|
if (displayName === 'Router') {
|
|
56
65
|
return value.history;
|
|
57
66
|
}
|
|
@@ -59,6 +68,7 @@ function findRouter(instance) {
|
|
|
59
68
|
} else if (Component.$cid === 'IntactVue') {
|
|
60
69
|
do {
|
|
61
70
|
var _parent = instance.$parent;
|
|
71
|
+
|
|
62
72
|
if (_parent) {
|
|
63
73
|
return _parent.$router;
|
|
64
74
|
}
|
|
@@ -67,6 +77,7 @@ function findRouter(instance) {
|
|
|
67
77
|
// for vue-next
|
|
68
78
|
do {
|
|
69
79
|
var vueInstance = instance.vueInstance;
|
|
80
|
+
|
|
70
81
|
if (vueInstance) {
|
|
71
82
|
return vueInstance.proxy.$router;
|
|
72
83
|
}
|
|
@@ -3,12 +3,15 @@ export function useShowHideEvents(prop, show, hide) {
|
|
|
3
3
|
if (prop === void 0) {
|
|
4
4
|
prop = 'value';
|
|
5
5
|
}
|
|
6
|
+
|
|
6
7
|
if (show === void 0) {
|
|
7
8
|
show = 'show';
|
|
8
9
|
}
|
|
10
|
+
|
|
9
11
|
if (hide === void 0) {
|
|
10
12
|
hide = 'hide';
|
|
11
13
|
}
|
|
14
|
+
|
|
12
15
|
var instance = useInstance();
|
|
13
16
|
instance.watch(prop, function (value) {
|
|
14
17
|
if (value) {
|
package/hooks/useState.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type Listener<T> = (newValue: T, oldValue: T) => void;
|
|
2
|
-
export type State<T> = {
|
|
1
|
+
export declare type Listener<T> = (newValue: T, oldValue: T) => void;
|
|
2
|
+
export declare type State<T> = {
|
|
3
3
|
readonly value: T;
|
|
4
4
|
set(value: T): void;
|
|
5
5
|
listeners: Listener<T>[] | null;
|
package/hooks/useState.js
CHANGED
|
@@ -5,6 +5,7 @@ export function useState(value, isEqual) {
|
|
|
5
5
|
value: value,
|
|
6
6
|
set: function set(value) {
|
|
7
7
|
var oldValue = state.value;
|
|
8
|
+
|
|
8
9
|
if (isEqual) {
|
|
9
10
|
if (isEqual(oldValue, value)) {
|
|
10
11
|
// @ts-ignore
|
|
@@ -13,8 +14,9 @@ export function useState(value, isEqual) {
|
|
|
13
14
|
}
|
|
14
15
|
} else {
|
|
15
16
|
if (oldValue === value) return;
|
|
16
|
-
}
|
|
17
|
-
|
|
17
|
+
} // @ts-ignore
|
|
18
|
+
|
|
19
|
+
|
|
18
20
|
state.value = value;
|
|
19
21
|
instance.forceUpdate();
|
|
20
22
|
callListeners(state, value, oldValue);
|
|
@@ -30,8 +32,10 @@ export function watchState(state, callback) {
|
|
|
30
32
|
if (!state.listeners) state.listeners = [];
|
|
31
33
|
state.listeners.push(callback);
|
|
32
34
|
}
|
|
35
|
+
|
|
33
36
|
function callListeners(state, newValue, oldValue) {
|
|
34
37
|
var listeners = state.listeners;
|
|
38
|
+
|
|
35
39
|
if (listeners) {
|
|
36
40
|
for (var i = 0; i < listeners.length; i++) {
|
|
37
41
|
listeners[i](newValue, oldValue);
|
package/i18n/en-US.js
CHANGED
package/i18n/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type Data = Record<string, string | number>;
|
|
1
|
+
declare type Data = Record<string, string | number>;
|
|
2
2
|
export declare function _$(key: null | undefined, data?: any): undefined | null;
|
|
3
3
|
export declare function _$(key: string | number, data?: any): string;
|
|
4
4
|
export declare function localize(data: Data): void;
|
package/i18n/index.js
CHANGED
|
@@ -4,19 +4,24 @@ var i18n = {};
|
|
|
4
4
|
export function _$(key, data) {
|
|
5
5
|
if (isNullOrUndefined(key)) return;
|
|
6
6
|
var value = get(i18n, key);
|
|
7
|
+
|
|
7
8
|
if (isNullOrUndefined(value)) {
|
|
8
9
|
value = key;
|
|
9
10
|
}
|
|
11
|
+
|
|
10
12
|
if (isNumber(value)) value = String(value);
|
|
13
|
+
|
|
11
14
|
if (data) {
|
|
12
15
|
value = value.replace(valueRegexp, function (nouse, variable) {
|
|
13
16
|
var suffix;
|
|
14
17
|
var index = variable.indexOf(':');
|
|
18
|
+
|
|
15
19
|
if (index > 0) {
|
|
16
20
|
suffix = variable.substr(0, index);
|
|
17
21
|
suffix = suffix.split('|');
|
|
18
22
|
variable = variable.substr(index + 1);
|
|
19
23
|
variable = get(data, variable);
|
|
24
|
+
|
|
20
25
|
if (variable > 1) {
|
|
21
26
|
return suffix.length > 1 ? suffix[1] : suffix[0];
|
|
22
27
|
} else {
|
|
@@ -28,11 +33,13 @@ export function _$(key, data) {
|
|
|
28
33
|
}
|
|
29
34
|
});
|
|
30
35
|
}
|
|
36
|
+
|
|
31
37
|
return value;
|
|
32
38
|
}
|
|
33
39
|
export function localize(data) {
|
|
34
40
|
if (!isObject(data)) {
|
|
35
41
|
throw new Error("expect a object but got " + data);
|
|
36
42
|
}
|
|
43
|
+
|
|
37
44
|
i18n = data;
|
|
38
45
|
}
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @king-design v2.1.
|
|
2
|
+
* @king-design v2.1.6
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Kingsoft Cloud
|
|
5
5
|
* Released under the MIT License
|
|
@@ -57,7 +57,7 @@ export * from './components/tree';
|
|
|
57
57
|
export * from './components/treeSelect';
|
|
58
58
|
export * from './components/upload';
|
|
59
59
|
export * from './components/wave';
|
|
60
|
-
export declare const version = "2.1.
|
|
60
|
+
export declare const version = "2.1.6";
|
|
61
61
|
|
|
62
62
|
|
|
63
63
|
export {normalize} from 'intact-vue-next';
|
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @king-design v2.1.
|
|
2
|
+
* @king-design v2.1.6
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Kingsoft Cloud
|
|
5
5
|
* Released under the MIT License
|
|
@@ -11,6 +11,7 @@ export { _$, localize } from './i18n';
|
|
|
11
11
|
export { bind } from './components/utils';
|
|
12
12
|
export { setTheme, theme } from './styles/theme';
|
|
13
13
|
/* generate start */
|
|
14
|
+
|
|
14
15
|
export * from './components/affix';
|
|
15
16
|
export * from './components/badge';
|
|
16
17
|
export * from './components/breadcrumb';
|
|
@@ -58,7 +59,7 @@ export * from './components/tree';
|
|
|
58
59
|
export * from './components/treeSelect';
|
|
59
60
|
export * from './components/upload';
|
|
60
61
|
export * from './components/wave';
|
|
61
|
-
export var version = '2.1.
|
|
62
|
+
export var version = '2.1.6';
|
|
62
63
|
/* generate end */
|
|
63
64
|
|
|
64
65
|
export {normalize} from 'intact-vue-next';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@king-design/vue",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.6",
|
|
4
4
|
"description": "King-Design UI components for Vue3.0.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"component",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"dayjs": "^1.10.7",
|
|
39
39
|
"downloadjs": "^1.4.7",
|
|
40
40
|
"enquire.js": "^2.1.6",
|
|
41
|
-
"intact-vue-next": "3.0.
|
|
41
|
+
"intact-vue-next": "3.0.29",
|
|
42
42
|
"monaco-editor": "^0.26.1",
|
|
43
43
|
"mxgraphx": "^4.0.7",
|
|
44
44
|
"resize-observer-polyfill": "^1.5.1",
|
package/styles/global.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
var _context;
|
|
2
|
+
|
|
2
3
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js/instance/map";
|
|
3
4
|
import _Object$keys from "@babel/runtime-corejs3/core-js/object/keys";
|
|
4
5
|
import { injectGlobal } from '@emotion/css';
|
|
@@ -9,8 +10,8 @@ var slideDirections = {
|
|
|
9
10
|
up: 'center bottom 0',
|
|
10
11
|
left: 'right center 0',
|
|
11
12
|
right: 'left center 0'
|
|
12
|
-
};
|
|
13
|
-
|
|
13
|
+
}; // TODO: update global when theme changed
|
|
14
|
+
|
|
14
15
|
injectGlobal("html{--var-wave-color:", theme.color.primary, ";box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,SF Pro SC,SF Pro Text,Helvetica Neue,Helvetica,PingFang SC,Segoe UI,Roboto,Hiragino Sans GB,arial,microsoft yahei ui,Microsoft YaHei,sans-serif;}body{font-size:", theme.fontSize, ";line-height:", theme.lineHeight, ";margin:0;padding:0;color:", theme.color.text, ";}*,*:before,*:after{box-sizing:inherit;}", _mapInstanceProperty(_context = _Object$keys(slideDirections)).call(_context, function (direction) {
|
|
15
16
|
return "\n .k-slide" + direction + "-enter-from,\n .k-slide" + direction + "-leave-to {\n transform-origin: " + slideDirections[direction] + ";\n opacity: 0;\n transform: " + (direction === 'down' || direction === 'up' ? "scaleY(.8)" : 'scaleX(.8)') + ";\n }\n .k-slide" + direction + "-enter-active,\n .k-slide" + direction + "-leave-active {\n transform-origin: " + slideDirections[direction] + ";\n transition: opacity " + theme.transition.large + ", transform " + theme.transition.large + " !important;\n pointer-events: none;\n }\n ";
|
|
16
17
|
}).join(''), " .k-fade-enter-from,.k-fade-leave-to{opacity:0!important;}.k-fade-enter-active,.k-fade-leave-active{transition:opacity ", theme.transition.large, ";}.k-fade-leave-active:not(tr){position:absolute;}.k-fade-move{transition:transform ", theme.transition.large, ";}.k-scale-enter-from,.k-scale-leave-to{transform:scale(0);}.k-scale-enter-active,.k-scale-leave-active{transition:transform ", theme.transition.large, ";}.k-expand-enter-from,.k-expand-leave-to{opacity:0;overflow:hidden;}.k-expand-enter-active,.k-expand-leave-active{transition:all ", theme.transition.large, "!important;overflow:hidden;}.k-expand-move{transition:transform ", theme.transition.large, ";}.k-dropdown-enter-from,.k-dropdown-leave-to{opacity:0;transform:translateY(-20px);}.k-dropdown-enter-active,.k-dropdown-leave-active,.k-dropdown-move{transition:all ", theme.transition.large, ";}.k-dropdown-leave-active{position:absolute!important;}.k-dropdown-move{transition:transform ", theme.transition.large, ";}.k-fade-in-left-enter-from,.k-fade-in-left-leave-to{opacity:0;transform:translate3d(-15px, 0, 0);}.k-fade-in-left-enter-active,.k-fade-in-left-leave-active{transition:all ", theme.transition.large, ";td{background:", palette(theme.color.primary, -4), "!important;}}.k-fade-in-left-move{transition:transform ", theme.transition.large, ";}.k-fade-expand-enter-from,.k-fade-expand-leave-to{opacity:0;}.k-fade-expand-enter-active,.k-fade-expand-leave-active{transition:all ", theme.transition.large, ";background:", palette(theme.color.primary, -4), "!important;}.c-ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}.c-hidden{display:none;}.c-middle{display:inline-block;vertical-align:middle;}");
|
package/styles/keyframes.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
2
|
+
|
|
2
3
|
import { keyframes } from '@emotion/css';
|
|
3
4
|
export var rotate = /*#__PURE__*/keyframes(process.env.NODE_ENV === "production" ? {
|
|
4
5
|
name: "1b2444z",
|
package/styles/theme.d.ts
CHANGED
package/styles/theme.js
CHANGED
|
@@ -33,15 +33,19 @@ export function defaultTheme() {
|
|
|
33
33
|
title: '#333',
|
|
34
34
|
darkBorder: '#b2b2b2',
|
|
35
35
|
placeholder: '#b2b2b2',
|
|
36
|
+
|
|
36
37
|
get link() {
|
|
37
38
|
return theme.color.primary;
|
|
38
39
|
},
|
|
40
|
+
|
|
39
41
|
get linkHover() {
|
|
40
42
|
return palette(theme.color.primary, -1);
|
|
41
43
|
},
|
|
44
|
+
|
|
42
45
|
get hoverBg() {
|
|
43
46
|
return palette(theme.color.primary, -4);
|
|
44
47
|
},
|
|
48
|
+
|
|
45
49
|
disabled: '#ccc',
|
|
46
50
|
disabledBg: '#f2f2f2',
|
|
47
51
|
disabledBorder: '#ccc',
|
|
@@ -71,8 +75,8 @@ export function push(setTheme) {
|
|
|
71
75
|
}
|
|
72
76
|
export function setTheme(customTheme) {
|
|
73
77
|
resetTheme();
|
|
74
|
-
deepExtends(theme, customTheme);
|
|
75
|
-
|
|
78
|
+
deepExtends(theme, customTheme); // queue
|
|
79
|
+
|
|
76
80
|
queue.forEach(function (fn) {
|
|
77
81
|
return fn();
|
|
78
82
|
});
|
|
@@ -80,8 +84,7 @@ export function setTheme(customTheme) {
|
|
|
80
84
|
export function setDefault(setTheme) {
|
|
81
85
|
setTheme();
|
|
82
86
|
push(setTheme);
|
|
83
|
-
}
|
|
84
|
-
// push(resetTheme);
|
|
87
|
+
} // push(resetTheme);
|
|
85
88
|
// export const theme = defualtTheme();
|
|
86
89
|
// export const theme = {
|
|
87
90
|
// large: {
|
package/styles/utils.d.ts
CHANGED
|
@@ -10,5 +10,5 @@ export declare function palette(color: string, level: number): string;
|
|
|
10
10
|
export declare function getLeft(padding: string): string;
|
|
11
11
|
export declare function getRight(padding: string): string;
|
|
12
12
|
export declare function darken(color: string, number: number): string;
|
|
13
|
-
export type Sizes = 'large' | 'default' | 'small' | 'mini';
|
|
13
|
+
export declare type Sizes = 'large' | 'default' | 'small' | 'mini';
|
|
14
14
|
export declare const sizes: Sizes[];
|