@king-design/vue 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 -1013
|
@@ -10,252 +10,300 @@ describe('Colorpicker', function () {
|
|
|
10
10
|
beforeEach( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
11
11
|
var data, trigger;
|
|
12
12
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
13
|
-
while (1)
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
13
|
+
while (1) {
|
|
14
|
+
switch (_context.prev = _context.next) {
|
|
15
|
+
case 0:
|
|
16
|
+
data = mount(BasicDemo);
|
|
17
|
+
instance = data[0];
|
|
18
|
+
element = data[1];
|
|
19
|
+
trigger = element.querySelector('.k-colorpicker-color');
|
|
20
|
+
trigger.click();
|
|
21
|
+
_context.next = 7;
|
|
22
|
+
return wait();
|
|
23
|
+
|
|
24
|
+
case 7:
|
|
25
|
+
picker = getElement('.k-colorpicker-content');
|
|
26
|
+
|
|
27
|
+
case 8:
|
|
28
|
+
case "end":
|
|
29
|
+
return _context.stop();
|
|
30
|
+
}
|
|
27
31
|
}
|
|
28
32
|
}, _callee);
|
|
29
33
|
})));
|
|
30
34
|
afterEach( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
31
35
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
32
|
-
while (1)
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
while (1) {
|
|
37
|
+
switch (_context2.prev = _context2.next) {
|
|
38
|
+
case 0:
|
|
39
|
+
unmount();
|
|
40
|
+
_context2.next = 3;
|
|
41
|
+
return wait(500);
|
|
42
|
+
|
|
43
|
+
case 3:
|
|
44
|
+
case "end":
|
|
45
|
+
return _context2.stop();
|
|
46
|
+
}
|
|
40
47
|
}
|
|
41
48
|
}, _callee2);
|
|
42
49
|
})));
|
|
43
50
|
it('should select color by saturation', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
44
51
|
var saturation, _saturation$getBoundi, left, top;
|
|
52
|
+
|
|
45
53
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
46
|
-
while (1)
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
54
|
+
while (1) {
|
|
55
|
+
switch (_context3.prev = _context3.next) {
|
|
56
|
+
case 0:
|
|
57
|
+
expect(picker.innerHTML).to.matchSnapshot();
|
|
58
|
+
saturation = picker.querySelector('.k-colorpicker-saturation');
|
|
59
|
+
_saturation$getBoundi = saturation.getBoundingClientRect(), left = _saturation$getBoundi.left, top = _saturation$getBoundi.top;
|
|
60
|
+
dispatchEvent(saturation, 'mousedown', {
|
|
61
|
+
pageX: left + window.pageXOffset,
|
|
62
|
+
pageY: top + window.pageYOffset,
|
|
63
|
+
which: 1
|
|
64
|
+
});
|
|
65
|
+
_context3.next = 6;
|
|
66
|
+
return wait();
|
|
67
|
+
|
|
68
|
+
case 6:
|
|
69
|
+
expect(picker.innerHTML).to.matchSnapshot();
|
|
70
|
+
expect(instance.get('color')).to.eql('#ffffff');
|
|
71
|
+
dispatchEvent(saturation, 'mousemove', {
|
|
72
|
+
pageX: left + window.pageXOffset + 1,
|
|
73
|
+
pageY: top + window.pageYOffset + 1
|
|
74
|
+
});
|
|
75
|
+
_context3.next = 11;
|
|
76
|
+
return wait();
|
|
77
|
+
|
|
78
|
+
case 11:
|
|
79
|
+
expect(instance.get('color')).to.eql('#fdfcfc');
|
|
80
|
+
dispatchEvent(saturation, 'mouseup');
|
|
81
|
+
_context3.next = 15;
|
|
82
|
+
return wait();
|
|
83
|
+
|
|
84
|
+
case 15:
|
|
85
|
+
case "end":
|
|
86
|
+
return _context3.stop();
|
|
87
|
+
}
|
|
75
88
|
}
|
|
76
89
|
}, _callee3);
|
|
77
90
|
})));
|
|
78
91
|
it('should change color by hue', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
79
92
|
var hue, _hue$getBoundingClien, width, left;
|
|
93
|
+
|
|
80
94
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
81
|
-
while (1)
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
95
|
+
while (1) {
|
|
96
|
+
switch (_context4.prev = _context4.next) {
|
|
97
|
+
case 0:
|
|
98
|
+
hue = picker.querySelector('.k-colorpicker-hue .k-slider-track-wrapper');
|
|
99
|
+
_hue$getBoundingClien = hue.getBoundingClientRect(), width = _hue$getBoundingClien.width, left = _hue$getBoundingClien.left;
|
|
100
|
+
dispatchEvent(hue, 'click', {
|
|
101
|
+
clientX: 100 / 360 * width + left
|
|
102
|
+
}); // changing hue is throttled 50ms
|
|
103
|
+
|
|
104
|
+
_context4.next = 5;
|
|
105
|
+
return wait(100);
|
|
106
|
+
|
|
107
|
+
case 5:
|
|
108
|
+
expect(instance.get('color')).to.eql('#68d923');
|
|
109
|
+
|
|
110
|
+
case 6:
|
|
111
|
+
case "end":
|
|
112
|
+
return _context4.stop();
|
|
113
|
+
}
|
|
96
114
|
}
|
|
97
115
|
}, _callee4);
|
|
98
116
|
})));
|
|
99
117
|
it('should change color by alpha', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
|
|
100
118
|
var alpha, _alpha$getBoundingCli, width, left;
|
|
119
|
+
|
|
101
120
|
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
102
|
-
while (1)
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
121
|
+
while (1) {
|
|
122
|
+
switch (_context5.prev = _context5.next) {
|
|
123
|
+
case 0:
|
|
124
|
+
alpha = picker.querySelector('.k-colorpicker-alpha .k-slider-track-wrapper');
|
|
125
|
+
_alpha$getBoundingCli = alpha.getBoundingClientRect(), width = _alpha$getBoundingCli.width, left = _alpha$getBoundingCli.left;
|
|
126
|
+
dispatchEvent(alpha, 'click', {
|
|
127
|
+
clientX: 0.5 * width + left
|
|
128
|
+
}); // changing alpha is throttled 50ms
|
|
129
|
+
|
|
130
|
+
_context5.next = 5;
|
|
131
|
+
return wait(100);
|
|
132
|
+
|
|
133
|
+
case 5:
|
|
134
|
+
expect(instance.get('color')).to.eql('rgba(217, 145, 35, 0.5)');
|
|
135
|
+
|
|
136
|
+
case 6:
|
|
137
|
+
case "end":
|
|
138
|
+
return _context5.stop();
|
|
139
|
+
}
|
|
117
140
|
}
|
|
118
141
|
}, _callee5);
|
|
119
142
|
})));
|
|
120
143
|
it('should change color by input', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
|
|
121
144
|
var _picker$querySelector, hex, r, g, b, alpha, alphaText;
|
|
145
|
+
|
|
122
146
|
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
123
|
-
while (1)
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
147
|
+
while (1) {
|
|
148
|
+
switch (_context6.prev = _context6.next) {
|
|
149
|
+
case 0:
|
|
150
|
+
_picker$querySelector = picker.querySelectorAll('input'), hex = _picker$querySelector[0], r = _picker$querySelector[1], g = _picker$querySelector[2], b = _picker$querySelector[3], alpha = _picker$querySelector[4]; // should ignore invalid value
|
|
151
|
+
|
|
152
|
+
hex.value = 'test';
|
|
153
|
+
dispatchEvent(hex, 'input');
|
|
154
|
+
_context6.next = 5;
|
|
155
|
+
return wait();
|
|
156
|
+
|
|
157
|
+
case 5:
|
|
158
|
+
expect(instance.get('color')).to.eql('#d99123');
|
|
159
|
+
hex.value = '333';
|
|
160
|
+
dispatchEvent(hex, 'input');
|
|
161
|
+
_context6.next = 10;
|
|
162
|
+
return wait();
|
|
163
|
+
|
|
164
|
+
case 10:
|
|
165
|
+
expect(instance.get('color')).to.eql('#333333'); // drag to change alpha
|
|
166
|
+
|
|
167
|
+
alphaText = picker.querySelectorAll('.k-colorpicker-drag')[3];
|
|
168
|
+
dispatchEvent(alphaText, 'mousedown', {
|
|
169
|
+
clientX: 0,
|
|
170
|
+
which: 1
|
|
171
|
+
});
|
|
172
|
+
dispatchEvent(alphaText, 'mousemove', {
|
|
173
|
+
clientX: -1
|
|
174
|
+
});
|
|
175
|
+
_context6.next = 16;
|
|
176
|
+
return wait();
|
|
177
|
+
|
|
178
|
+
case 16:
|
|
179
|
+
expect(instance.get('color')).to.eql('rgba(51, 51, 51, 0.99)');
|
|
180
|
+
dispatchEvent(alphaText, 'mousemove', {
|
|
181
|
+
clientX: 1
|
|
182
|
+
});
|
|
183
|
+
_context6.next = 20;
|
|
184
|
+
return wait();
|
|
185
|
+
|
|
186
|
+
case 20:
|
|
187
|
+
expect(instance.get('color')).to.eql('#333333');
|
|
188
|
+
expect(picker.innerHTML).to.matchSnapshot();
|
|
189
|
+
dispatchEvent(alphaText, 'mouseup');
|
|
190
|
+
_context6.next = 25;
|
|
191
|
+
return wait();
|
|
192
|
+
|
|
193
|
+
case 25:
|
|
194
|
+
r.value = '1000';
|
|
195
|
+
dispatchEvent(r, 'input');
|
|
196
|
+
_context6.next = 29;
|
|
197
|
+
return wait();
|
|
198
|
+
|
|
199
|
+
case 29:
|
|
200
|
+
expect(instance.get('color')).to.eql('#ff3333');
|
|
201
|
+
alpha.value = '-1';
|
|
202
|
+
dispatchEvent(alpha, 'input');
|
|
203
|
+
_context6.next = 34;
|
|
204
|
+
return wait();
|
|
205
|
+
|
|
206
|
+
case 34:
|
|
207
|
+
expect(instance.get('color')).to.eql('rgba(255, 51, 51, 0)');
|
|
208
|
+
|
|
209
|
+
case 35:
|
|
210
|
+
case "end":
|
|
211
|
+
return _context6.stop();
|
|
212
|
+
}
|
|
178
213
|
}
|
|
179
214
|
}, _callee6);
|
|
180
215
|
})));
|
|
181
216
|
it('should change to hsv mode', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
|
|
182
217
|
var _picker$querySelector2, first, second, color, hsl, _picker$querySelector3, hex, h, s;
|
|
218
|
+
|
|
183
219
|
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
184
|
-
while (1)
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
220
|
+
while (1) {
|
|
221
|
+
switch (_context7.prev = _context7.next) {
|
|
222
|
+
case 0:
|
|
223
|
+
_picker$querySelector2 = picker.querySelectorAll('.k-colorpicker-drag'), first = _picker$querySelector2[0], second = _picker$querySelector2[1];
|
|
224
|
+
color = tinycolor(instance.get('color'));
|
|
225
|
+
hsl = color.toHsl();
|
|
226
|
+
console.log(hsl);
|
|
227
|
+
dispatchEvent(first, 'mousedown', {
|
|
228
|
+
which: 1
|
|
229
|
+
});
|
|
230
|
+
dispatchEvent(first, 'mouseup');
|
|
231
|
+
_context7.next = 8;
|
|
232
|
+
return wait();
|
|
233
|
+
|
|
234
|
+
case 8:
|
|
235
|
+
expect(picker.innerHTML).to.matchSnapshot();
|
|
236
|
+
dispatchEvent(first, 'mousedown', {
|
|
237
|
+
clientX: 0,
|
|
238
|
+
which: 1
|
|
239
|
+
});
|
|
240
|
+
dispatchEvent(first, 'mousemove', {
|
|
241
|
+
clientX: -1
|
|
242
|
+
});
|
|
243
|
+
_context7.next = 13;
|
|
244
|
+
return wait();
|
|
245
|
+
|
|
246
|
+
case 13:
|
|
247
|
+
expect(tinycolor(instance.get('color')).toString('hsl')).to.eql('hsl(35, 72%, 49%)');
|
|
248
|
+
dispatchEvent(first, 'mousemove', {
|
|
249
|
+
clientX: 1
|
|
250
|
+
});
|
|
251
|
+
_context7.next = 17;
|
|
252
|
+
return wait();
|
|
253
|
+
|
|
254
|
+
case 17:
|
|
255
|
+
expect(tinycolor(instance.get('color')).toString('hsl')).to.eql('hsl(37, 72%, 49%)');
|
|
256
|
+
dispatchEvent(first, 'mouseup');
|
|
257
|
+
_context7.next = 21;
|
|
258
|
+
return wait();
|
|
259
|
+
|
|
260
|
+
case 21:
|
|
261
|
+
dispatchEvent(second, 'mousedown', {
|
|
262
|
+
clientX: 0,
|
|
263
|
+
which: 1
|
|
264
|
+
});
|
|
265
|
+
dispatchEvent(second, 'mousemove', {
|
|
266
|
+
clientX: -1
|
|
267
|
+
});
|
|
268
|
+
_context7.next = 25;
|
|
269
|
+
return wait();
|
|
270
|
+
|
|
271
|
+
case 25:
|
|
272
|
+
expect(tinycolor(instance.get('color')).toString('hsl')).to.eql('hsl(37, 71%, 49%)');
|
|
273
|
+
dispatchEvent(second, 'mousemove', {
|
|
274
|
+
clientX: 1
|
|
275
|
+
});
|
|
276
|
+
_context7.next = 29;
|
|
277
|
+
return wait();
|
|
278
|
+
|
|
279
|
+
case 29:
|
|
280
|
+
expect(tinycolor(instance.get('color')).toString('hsl')).to.eql('hsl(37, 73%, 49%)');
|
|
281
|
+
dispatchEvent(first, 'mouseup');
|
|
282
|
+
_context7.next = 33;
|
|
283
|
+
return wait();
|
|
284
|
+
|
|
285
|
+
case 33:
|
|
286
|
+
// input
|
|
287
|
+
_picker$querySelector3 = picker.querySelectorAll('input'), hex = _picker$querySelector3[0], h = _picker$querySelector3[1], s = _picker$querySelector3[2];
|
|
288
|
+
h.value = '1000';
|
|
289
|
+
dispatchEvent(h, 'input');
|
|
290
|
+
_context7.next = 38;
|
|
291
|
+
return wait();
|
|
292
|
+
|
|
293
|
+
case 38:
|
|
294
|
+
expect(tinycolor(instance.get('color')).toString('hsl')).to.eql('hsl(359, 73%, 49%)');
|
|
295
|
+
s.value = '10';
|
|
296
|
+
dispatchEvent(s, 'input');
|
|
297
|
+
_context7.next = 43;
|
|
298
|
+
return wait();
|
|
299
|
+
|
|
300
|
+
case 43:
|
|
301
|
+
expect(tinycolor(instance.get('color')).toString('hsl')).to.eql('hsl(358, 10%, 49%)');
|
|
302
|
+
|
|
303
|
+
case 44:
|
|
304
|
+
case "end":
|
|
305
|
+
return _context7.stop();
|
|
306
|
+
}
|
|
259
307
|
}
|
|
260
308
|
}, _callee7);
|
|
261
309
|
})));
|
|
@@ -7,18 +7,21 @@ import { ColorpickerPanel } from './panel';
|
|
|
7
7
|
import { Dropdown, DropdownMenu } from '../dropdown';
|
|
8
8
|
export default function ($props, $blocks, $__proto__) {
|
|
9
9
|
var _classNameObj;
|
|
10
|
+
|
|
10
11
|
$blocks || ($blocks = {});
|
|
11
12
|
$props || ($props = {});
|
|
12
13
|
var $this = this;
|
|
14
|
+
|
|
13
15
|
var _this$get = this.get(),
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
className = _this$get.className,
|
|
17
|
+
transition = _this$get.transition,
|
|
18
|
+
presets = _this$get.presets,
|
|
19
|
+
value = _this$get.value,
|
|
20
|
+
size = _this$get.size,
|
|
21
|
+
disabled = _this$get.disabled,
|
|
22
|
+
container = _this$get.container,
|
|
23
|
+
position = _this$get.position;
|
|
24
|
+
|
|
22
25
|
var classNameObj = (_classNameObj = {
|
|
23
26
|
'k-colorpicker': true
|
|
24
27
|
}, _classNameObj[className] = className, _classNameObj["k-" + size] = size !== 'default', _classNameObj['k-disabled'] = disabled, _classNameObj[makeStyles()] = true, _classNameObj);
|
|
@@ -7,18 +7,23 @@ import { usePointer } from './usePointer';
|
|
|
7
7
|
import { useInput } from './useInput';
|
|
8
8
|
export var ColorpickerPanel = /*#__PURE__*/function (_Component) {
|
|
9
9
|
_inheritsLoose(ColorpickerPanel, _Component);
|
|
10
|
+
|
|
10
11
|
function ColorpickerPanel() {
|
|
11
12
|
var _context;
|
|
13
|
+
|
|
12
14
|
var _this;
|
|
15
|
+
|
|
13
16
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
14
17
|
args[_key] = arguments[_key];
|
|
15
18
|
}
|
|
19
|
+
|
|
16
20
|
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
17
21
|
_this.value = useValue();
|
|
18
22
|
_this.pointer = usePointer(_this.value.hsv, _this.value.format);
|
|
19
23
|
_this.input = useInput(_this.value.hsv, _this.value.rgb, _this.value.hsl);
|
|
20
24
|
return _this;
|
|
21
25
|
}
|
|
26
|
+
|
|
22
27
|
return ColorpickerPanel;
|
|
23
28
|
}(Component);
|
|
24
29
|
ColorpickerPanel.template = template;
|
|
@@ -9,37 +9,40 @@ import { Mode } from './useInput';
|
|
|
9
9
|
import { ColorpickerDrag as Drag } from './drag';
|
|
10
10
|
export default function ($props, $blocks, $__proto__) {
|
|
11
11
|
var _classNameObj,
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
_$cn2,
|
|
13
|
+
_this = this;
|
|
14
|
+
|
|
14
15
|
$blocks || ($blocks = {});
|
|
15
16
|
$props || ($props = {});
|
|
16
17
|
var $this = this;
|
|
18
|
+
|
|
17
19
|
var _this$get = this.get(),
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
value = _this$get.value,
|
|
21
|
+
presets = _this$get.presets;
|
|
22
|
+
|
|
20
23
|
var classNameObj = (_classNameObj = {
|
|
21
24
|
'k-colorpicker-panel': true
|
|
22
25
|
}, _classNameObj[makePanelStyles()] = true, _classNameObj);
|
|
23
26
|
var _this$value = this.value,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
hex = _this$value.hex.value,
|
|
28
|
+
hsv = _this$value.hsv.value,
|
|
29
|
+
rgb = _this$value.rgb.value,
|
|
30
|
+
hsl = _this$value.hsl.value,
|
|
31
|
+
changeHue = _this$value.changeHue,
|
|
32
|
+
changeAlpha = _this$value.changeAlpha,
|
|
33
|
+
setValue = _this$value.setValue;
|
|
31
34
|
var _this$pointer = this.pointer,
|
|
32
|
-
|
|
33
|
-
|
|
35
|
+
start = _this$pointer.start,
|
|
36
|
+
areaRef = _this$pointer.areaRef;
|
|
34
37
|
var _this$input = this.input,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
onInputHex = _this$input.onInputHex,
|
|
39
|
+
mode = _this$input.mode,
|
|
40
|
+
changeMode = _this$input.changeMode,
|
|
41
|
+
changeColor = _this$input.changeColor,
|
|
42
|
+
onStart = _this$input.onStart,
|
|
43
|
+
onEnd = _this$input.onEnd,
|
|
44
|
+
dragging = _this$input.dragging,
|
|
45
|
+
setInputValue = _this$input.setInputValue;
|
|
43
46
|
var alpha = Math.round(rgb.a * 100);
|
|
44
47
|
return _$ce(2, 'div', [_$ce(2, 'div', [_$ce(2, 'div', null, 1, 'k-colorpicker-white'), _$ce(2, 'div', null, 1, 'k-colorpicker-black'), _$ce(2, 'div', _$ce(2, 'div', null, 1, 'k-colorpicker-circle'), 2, 'k-colorpicker-pointer', {
|
|
45
48
|
'style': {
|
|
@@ -92,6 +95,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
92
95
|
var color;
|
|
93
96
|
var method;
|
|
94
97
|
var max;
|
|
98
|
+
|
|
95
99
|
if (mode.value === Mode.RGB) {
|
|
96
100
|
params = ['r', 'g', 'b'];
|
|
97
101
|
color = rgb;
|
|
@@ -107,6 +111,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
107
111
|
method = _this._changeHsv;
|
|
108
112
|
max = 100;
|
|
109
113
|
}
|
|
114
|
+
|
|
110
115
|
return _mapInstanceProperty(params).call(params, function (value) {
|
|
111
116
|
var v = Math.round(color[value]);
|
|
112
117
|
var realMax = value === 'h' ? 359 : max;
|