@king-design/react 2.1.4 → 2.1.5
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 +1 -1
- 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 -528
|
@@ -7,36 +7,45 @@ var defaults = {
|
|
|
7
7
|
get height() {
|
|
8
8
|
return theme.default.height;
|
|
9
9
|
},
|
|
10
|
+
|
|
10
11
|
width: '100px',
|
|
12
|
+
|
|
11
13
|
get border() {
|
|
12
14
|
return "1px solid " + theme.color.border;
|
|
13
15
|
},
|
|
16
|
+
|
|
14
17
|
get borderRadius() {
|
|
15
18
|
return theme.borderRadius;
|
|
16
19
|
},
|
|
20
|
+
|
|
17
21
|
cursor: 'pointer',
|
|
18
22
|
bgColor: '#fff',
|
|
19
23
|
padding: '4px',
|
|
24
|
+
|
|
20
25
|
get innerBorderRadius() {
|
|
21
26
|
return theme.borderRadius;
|
|
22
27
|
},
|
|
28
|
+
|
|
23
29
|
// size
|
|
24
30
|
large: {
|
|
25
31
|
get height() {
|
|
26
32
|
return theme.large.height;
|
|
27
33
|
},
|
|
34
|
+
|
|
28
35
|
width: '120px'
|
|
29
36
|
},
|
|
30
37
|
small: {
|
|
31
38
|
get height() {
|
|
32
39
|
return theme.small.height;
|
|
33
40
|
},
|
|
41
|
+
|
|
34
42
|
width: '70px'
|
|
35
43
|
},
|
|
36
44
|
mini: {
|
|
37
45
|
get height() {
|
|
38
46
|
return theme.mini.height;
|
|
39
47
|
},
|
|
48
|
+
|
|
40
49
|
width: '50px',
|
|
41
50
|
padding: '2px'
|
|
42
51
|
},
|
|
@@ -92,9 +101,11 @@ var defaults = {
|
|
|
92
101
|
get bgColor() {
|
|
93
102
|
return theme.color.disabledBg;
|
|
94
103
|
},
|
|
104
|
+
|
|
95
105
|
get borderColor() {
|
|
96
106
|
return theme.color.disabledBorder;
|
|
97
107
|
},
|
|
108
|
+
|
|
98
109
|
cursor: 'not-allowed'
|
|
99
110
|
}
|
|
100
111
|
};
|
|
@@ -116,7 +127,7 @@ export function makePanelStyles() {
|
|
|
116
127
|
}
|
|
117
128
|
export function makeAlphaBgColor(_ref) {
|
|
118
129
|
var r = _ref.r,
|
|
119
|
-
|
|
120
|
-
|
|
130
|
+
g = _ref.g,
|
|
131
|
+
b = _ref.b;
|
|
121
132
|
return /*#__PURE__*/css(".k-slider-track-wrapper{background:linear-gradient(to right, rgba(", r, ", ", g, ", ", b, ", 0) 0%, rgb(", r, ", ", g, ", ", b, ") 100%);}");
|
|
122
133
|
}
|
|
@@ -5,31 +5,35 @@ export function useDrag() {
|
|
|
5
5
|
var mousedown = false;
|
|
6
6
|
var mousemove = false;
|
|
7
7
|
var x;
|
|
8
|
+
|
|
8
9
|
var _useDraggable = useDraggable({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
onStart: function onStart(e) {
|
|
11
|
+
mousedown = true;
|
|
12
|
+
x = e.clientX;
|
|
13
|
+
instance.get('onStart')();
|
|
14
|
+
},
|
|
15
|
+
onMove: function onMove(e) {
|
|
16
|
+
mousemove = true;
|
|
17
|
+
|
|
18
|
+
var _instance$get = instance.get(),
|
|
17
19
|
value = _instance$get.value,
|
|
18
20
|
max = _instance$get.max;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
|
|
21
|
+
|
|
22
|
+
var deltaX = e.clientX - x;
|
|
23
|
+
var newValue = value + deltaX;
|
|
24
|
+
x = e.clientX;
|
|
25
|
+
instance.set('value', Math.min(max, Math.max(0, newValue)));
|
|
26
|
+
},
|
|
27
|
+
onEnd: function onEnd(e) {
|
|
28
|
+
if (instance.$unmounted) return;
|
|
29
|
+
if (mousedown && !mousemove) instance.trigger('click');
|
|
30
|
+
mousedown = false;
|
|
31
|
+
mousemove = false;
|
|
32
|
+
instance.get('onEnd')();
|
|
33
|
+
}
|
|
34
|
+
}),
|
|
35
|
+
start = _useDraggable.start;
|
|
36
|
+
|
|
33
37
|
return {
|
|
34
38
|
start: start
|
|
35
39
|
};
|
|
@@ -5,48 +5,64 @@ import { useInstance } from 'intact-react';
|
|
|
5
5
|
import tinycolor from 'tinycolor2';
|
|
6
6
|
import { useState } from '../../hooks/useState';
|
|
7
7
|
export var Mode;
|
|
8
|
+
|
|
8
9
|
(function (Mode) {
|
|
9
10
|
Mode[Mode["RGB"] = 0] = "RGB";
|
|
10
11
|
Mode[Mode["HSL"] = 1] = "HSL";
|
|
11
12
|
})(Mode || (Mode = {}));
|
|
13
|
+
|
|
12
14
|
export function useInput(hsv, rgb, hsl) {
|
|
13
15
|
var instance = useInstance();
|
|
14
16
|
var mode = useState(Mode.RGB);
|
|
15
17
|
var dragging = useState(false);
|
|
18
|
+
|
|
16
19
|
function onInputHex(e) {
|
|
17
20
|
var _context;
|
|
21
|
+
|
|
18
22
|
var hex = _trimInstanceProperty(_context = e.target.value).call(_context);
|
|
23
|
+
|
|
19
24
|
var color = tinycolor(hex);
|
|
25
|
+
|
|
20
26
|
if (color.isValid()) {
|
|
21
27
|
hsv.set(color.toHsv());
|
|
22
28
|
}
|
|
23
29
|
}
|
|
30
|
+
|
|
24
31
|
function changeMode() {
|
|
25
32
|
mode.set(mode.value === Mode.RGB ? Mode.HSL : Mode.RGB);
|
|
26
33
|
}
|
|
34
|
+
|
|
27
35
|
function changeColor(type, v) {
|
|
28
36
|
var _extends2;
|
|
37
|
+
|
|
29
38
|
var isRgb = mode.value === Mode.RGB;
|
|
30
39
|
var color = isRgb ? rgb.value : hsl.value;
|
|
40
|
+
|
|
31
41
|
if (!isRgb && type !== 'h' || type === 'a') {
|
|
32
42
|
v = v / 100;
|
|
33
43
|
}
|
|
44
|
+
|
|
34
45
|
if (color[type] === v) return;
|
|
35
46
|
hsv.set(tinycolor(_extends({}, color, (_extends2 = {}, _extends2[type] = v, _extends2))).toHsv());
|
|
36
47
|
}
|
|
48
|
+
|
|
37
49
|
function setInputValue(type, maxValue, e) {
|
|
38
50
|
var _context2;
|
|
51
|
+
|
|
39
52
|
var value = parseInt(_trimInstanceProperty(_context2 = e.target.value).call(_context2), 10);
|
|
40
53
|
if (_Number$isNaN(value)) return;
|
|
41
54
|
value = Math.min(Math.max(0, value), maxValue);
|
|
42
55
|
changeColor(type, value);
|
|
43
56
|
}
|
|
57
|
+
|
|
44
58
|
function onStart() {
|
|
45
59
|
dragging.set(true);
|
|
46
60
|
}
|
|
61
|
+
|
|
47
62
|
function onEnd() {
|
|
48
63
|
dragging.set(false);
|
|
49
64
|
}
|
|
65
|
+
|
|
50
66
|
return {
|
|
51
67
|
onInputHex: onInputHex,
|
|
52
68
|
mode: mode,
|
|
@@ -7,22 +7,25 @@ window.tinycolor = tinycolor;
|
|
|
7
7
|
export function usePointer(hsv, format) {
|
|
8
8
|
var instance = useInstance();
|
|
9
9
|
var areaRef = createRef();
|
|
10
|
+
|
|
10
11
|
var _useDraggable = useDraggable({
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
onStart: function onStart(e) {
|
|
13
|
+
handleChange(e);
|
|
14
|
+
},
|
|
15
|
+
onMove: function onMove(e) {
|
|
16
|
+
handleChange(e);
|
|
17
|
+
}
|
|
18
|
+
}),
|
|
19
|
+
start = _useDraggable.start; // @reference: https://github.com/casesandberg/react-color/blob/master/src/helpers/saturation.js
|
|
20
|
+
|
|
21
|
+
|
|
20
22
|
function handleChange(e) {
|
|
21
23
|
var _areaRef$value$getBou = areaRef.value.getBoundingClientRect(),
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
width = _areaRef$value$getBou.width,
|
|
25
|
+
height = _areaRef$value$getBou.height,
|
|
26
|
+
_left = _areaRef$value$getBou.left,
|
|
27
|
+
_top = _areaRef$value$getBou.top;
|
|
28
|
+
|
|
26
29
|
var x = isNumber(e.pageX) ? e.pageX : e.touches[0].pageX;
|
|
27
30
|
var y = isNumber(e.pageY) ? e.pageY : e.touches[0].pageY;
|
|
28
31
|
var left = x - _left - window.pageXOffset;
|
|
@@ -34,13 +37,13 @@ export function usePointer(hsv, format) {
|
|
|
34
37
|
hsv.set(_extends({}, hsv.value, {
|
|
35
38
|
s: saturation,
|
|
36
39
|
v: bright
|
|
37
|
-
}));
|
|
38
|
-
// const value = tinycolor(hsv.value!).toString(format.value as 'rgb');
|
|
40
|
+
})); // const value = tinycolor(hsv.value!).toString(format.value as 'rgb');
|
|
39
41
|
// // console.log()
|
|
40
42
|
// // const tinyValue = tinycolor(value);
|
|
41
43
|
// // console.log(hsv, value, tinycolor(hsv).toHsv(), getFormat(), tinyValue.toHsv());
|
|
42
44
|
// instance.set({value});
|
|
43
45
|
}
|
|
46
|
+
|
|
44
47
|
return {
|
|
45
48
|
start: start,
|
|
46
49
|
areaRef: areaRef
|
|
@@ -19,25 +19,30 @@ export function useValue() {
|
|
|
19
19
|
var color = tinycolor(hsv);
|
|
20
20
|
rgb.set(color.toRgb());
|
|
21
21
|
hex.set(color.toHex());
|
|
22
|
-
hsl.set(color.toHsl());
|
|
23
|
-
|
|
22
|
+
hsl.set(color.toHsl()); // if alpha less than 1, use rgba format
|
|
23
|
+
|
|
24
24
|
var _format = hsv.a < 1 ? 'rgb' : format.value;
|
|
25
|
+
|
|
25
26
|
instance.set('value', color.toString(_format));
|
|
26
27
|
});
|
|
28
|
+
|
|
27
29
|
function changeHue(v) {
|
|
28
30
|
hsv.set(_extends({}, hsv.value, {
|
|
29
31
|
h: v
|
|
30
32
|
}));
|
|
31
33
|
}
|
|
34
|
+
|
|
32
35
|
function changeAlpha(v) {
|
|
33
36
|
format.set('rgb');
|
|
34
37
|
hsv.set(_extends({}, hsv.value, {
|
|
35
38
|
a: v
|
|
36
39
|
}));
|
|
37
40
|
}
|
|
41
|
+
|
|
38
42
|
function setValue(v) {
|
|
39
43
|
hsv.set(tinycolor(v).toHsv());
|
|
40
44
|
}
|
|
45
|
+
|
|
41
46
|
return {
|
|
42
47
|
format: format,
|
|
43
48
|
hex: hex,
|
package/components/context.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ export interface ProviderProps<T> {
|
|
|
5
5
|
export interface ConsumerProps<T> {
|
|
6
6
|
defaultValue?: T;
|
|
7
7
|
}
|
|
8
|
-
type ProviderConstructor<T> = ComponentConstructor<Component<ProviderProps<T>>>;
|
|
9
|
-
type ConsumerConstructor<T> = ComponentConstructor<Component<ConsumerProps<T>>>;
|
|
8
|
+
declare type ProviderConstructor<T> = ComponentConstructor<Component<ProviderProps<T>>>;
|
|
9
|
+
declare type ConsumerConstructor<T> = ComponentConstructor<Component<ConsumerProps<T>>>;
|
|
10
10
|
export declare function createContext<T = any>(defaultValue?: T): {
|
|
11
11
|
Provider: ProviderConstructor<T>;
|
|
12
12
|
Consumer: ConsumerConstructor<T>;
|
package/components/context.js
CHANGED
|
@@ -5,19 +5,26 @@ import { isNullOrUndefined } from 'intact-shared';
|
|
|
5
5
|
var id = 0;
|
|
6
6
|
export function createContext(defaultValue) {
|
|
7
7
|
var injectionKey = "$Context-" + id++;
|
|
8
|
+
|
|
8
9
|
var Provider = /*#__PURE__*/function (_Component) {
|
|
9
10
|
_inheritsLoose(Provider, _Component);
|
|
11
|
+
|
|
10
12
|
function Provider() {
|
|
11
13
|
var _context;
|
|
14
|
+
|
|
12
15
|
var _this;
|
|
16
|
+
|
|
13
17
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
14
18
|
args[_key] = arguments[_key];
|
|
15
19
|
}
|
|
20
|
+
|
|
16
21
|
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
17
22
|
_this.ref = createRef();
|
|
18
23
|
return _this;
|
|
19
24
|
}
|
|
25
|
+
|
|
20
26
|
var _proto = Provider.prototype;
|
|
27
|
+
|
|
21
28
|
_proto.init = function init(props) {
|
|
22
29
|
var value = props && props.value;
|
|
23
30
|
var ref = this.ref;
|
|
@@ -27,39 +34,49 @@ export function createContext(defaultValue) {
|
|
|
27
34
|
return ref.value = v;
|
|
28
35
|
});
|
|
29
36
|
};
|
|
37
|
+
|
|
30
38
|
return Provider;
|
|
31
39
|
}(Component);
|
|
40
|
+
|
|
32
41
|
Provider.template = providerTemplate;
|
|
42
|
+
|
|
33
43
|
var Consumer = /*#__PURE__*/function (_Component2) {
|
|
34
44
|
_inheritsLoose(Consumer, _Component2);
|
|
45
|
+
|
|
35
46
|
function Consumer() {
|
|
36
47
|
var _context2;
|
|
48
|
+
|
|
37
49
|
var _this2;
|
|
50
|
+
|
|
38
51
|
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
39
52
|
args[_key2] = arguments[_key2];
|
|
40
53
|
}
|
|
54
|
+
|
|
41
55
|
_this2 = _Component2.call.apply(_Component2, _concatInstanceProperty(_context2 = [this]).call(_context2, args)) || this;
|
|
42
56
|
_this2.ref = inject(injectionKey, null);
|
|
43
57
|
return _this2;
|
|
44
58
|
}
|
|
59
|
+
|
|
45
60
|
return Consumer;
|
|
46
61
|
}(Component);
|
|
62
|
+
|
|
47
63
|
Consumer.template = consumerTemplate;
|
|
48
64
|
return {
|
|
49
65
|
Provider: Provider,
|
|
50
66
|
Consumer: Consumer
|
|
51
67
|
};
|
|
52
68
|
}
|
|
69
|
+
|
|
53
70
|
function providerTemplate() {
|
|
54
71
|
return this.$props.children;
|
|
55
72
|
}
|
|
73
|
+
|
|
56
74
|
function consumerTemplate() {
|
|
57
75
|
var ref = this.ref;
|
|
58
76
|
var props = this.$props;
|
|
59
77
|
var value = ref && ref.value || props && props.value;
|
|
60
78
|
return this.$props.children(value);
|
|
61
|
-
}
|
|
62
|
-
// Maybe like legency context api of React
|
|
79
|
+
} // Maybe like legency context api of React
|
|
63
80
|
// Error: Can not use it in multiple instances.
|
|
64
81
|
// export function Context<T = any>(defaultValue?: T) {
|
|
65
82
|
// let data: T | undefined;
|
|
@@ -9,13 +9,13 @@ import type { useDisabled } from './useDisabled';
|
|
|
9
9
|
import { PanelFlags, usePanel } from './usePanel';
|
|
10
10
|
import { BaseSelect, BaseSelectProps, BaseSelectEvents, BaseSelectBlocks } from '../select/base';
|
|
11
11
|
import type { Events } from '../types';
|
|
12
|
-
export type StateValueRange = [Dayjs, Dayjs?];
|
|
13
|
-
export type StateValueItem = Dayjs | StateValueRange;
|
|
14
|
-
export type StateValue = StateValueItem[];
|
|
15
|
-
export type StringValue = string | string[] | [string, string] | [string, string][];
|
|
16
|
-
export type DayjsValueRange = [Dayjs, Dayjs];
|
|
17
|
-
export type DayjsValueItem = Dayjs | DayjsValueRange;
|
|
18
|
-
export type DayjsValue = DayjsValueItem[];
|
|
12
|
+
export declare type StateValueRange = [Dayjs, Dayjs?];
|
|
13
|
+
export declare type StateValueItem = Dayjs | StateValueRange;
|
|
14
|
+
export declare type StateValue = StateValueItem[];
|
|
15
|
+
export declare type StringValue = string | string[] | [string, string] | [string, string][];
|
|
16
|
+
export declare type DayjsValueRange = [Dayjs, Dayjs];
|
|
17
|
+
export declare type DayjsValueItem = Dayjs | DayjsValueRange;
|
|
18
|
+
export declare type DayjsValue = DayjsValueItem[];
|
|
19
19
|
export interface BasePickerProps<V extends Value = Value, Multipe extends boolean = boolean, Range extends boolean = boolean> extends BaseSelectProps<V | [V, V], Multipe> {
|
|
20
20
|
value?: Multipe extends true ? Range extends true ? [
|
|
21
21
|
V,
|
|
@@ -37,7 +37,7 @@ export interface BasePickerEvents extends BaseSelectEvents {
|
|
|
37
37
|
}
|
|
38
38
|
export interface BasePickerBlocks<V extends Value = Value, R extends boolean = boolean> extends BaseSelectBlocks<R extends true ? [Value, Value] : Value> {
|
|
39
39
|
}
|
|
40
|
-
export type Value = string | Date | number | Dayjs;
|
|
40
|
+
export declare type Value = string | Date | number | Dayjs;
|
|
41
41
|
export declare abstract class BasePicker<T extends BasePickerProps = BasePickerProps, E extends BasePickerEvents = BasePickerEvents, B extends BasePickerBlocks<any> = BasePickerBlocks<any>> extends BaseSelect<T, E, B> {
|
|
42
42
|
static typeDefs: Required<TypeDefs<BasePickerProps<Value, boolean, boolean>>>;
|
|
43
43
|
static defaults: () => Partial<BasePickerProps<any, boolean, boolean>>;
|