@king-design/vue 2.1.3 → 2.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/affix/index.d.ts +2 -2
- package/components/affix/index.js +0 -5
- package/components/affix/index.spec.js +84 -108
- package/components/affix/index.vdt.js +5 -8
- package/components/affix/useStyle.js +8 -19
- package/components/badge/index.js +0 -2
- package/components/badge/index.vdt.js +5 -9
- package/components/badge/styles.js +0 -2
- package/components/breadcrumb/index.js +0 -4
- package/components/breadcrumb/index.spec.js +6 -6
- package/components/breadcrumb/index.vdt.js +5 -14
- package/components/breadcrumb/item.js +0 -8
- package/components/breadcrumb/item.vdt.js +3 -6
- package/components/breadcrumb/styles.js +0 -3
- package/components/button/dynamicButton.d.ts +1 -1
- package/components/button/dynamicButton.js +2 -5
- package/components/button/group.js +2 -10
- package/components/button/group.vdt.js +4 -7
- package/components/button/index.js +3 -27
- package/components/button/index.spec.js +74 -96
- package/components/button/index.vdt.js +19 -29
- package/components/button/styles.d.ts +2 -2
- package/components/button/styles.js +4 -48
- package/components/card/column.js +0 -2
- package/components/card/column.vdt.js +5 -10
- package/components/card/index.js +0 -4
- package/components/card/index.vdt.js +4 -16
- package/components/carousel/index.js +1 -19
- package/components/carousel/index.spec.js +127 -163
- package/components/carousel/index.vdt.js +12 -15
- package/components/carousel/item.js +0 -2
- package/components/carousel/item.vdt.js +4 -7
- package/components/carousel/styles.js +0 -1
- package/components/carousel/useAutoplay.js +0 -4
- package/components/carousel/useItems.js +4 -20
- package/components/carousel/useSlide.js +57 -89
- package/components/cascader/index.js +3 -18
- package/components/cascader/index.spec.js +365 -379
- package/components/cascader/index.vdt.js +14 -31
- package/components/cascader/styles.js +0 -6
- package/components/cascader/useFields.js +1 -4
- package/components/cascader/useFilterable.js +2 -19
- package/components/cascader/useLabel.js +1 -9
- package/components/cascader/useLoad.js +22 -35
- package/components/cascader/useValue.d.ts +2 -2
- package/components/cascader/useValue.js +6 -27
- package/components/checkbox/index.js +5 -27
- package/components/checkbox/index.spec.js +129 -171
- package/components/checkbox/index.vdt.js +12 -16
- package/components/checkbox/styles.js +0 -10
- package/components/code/crossDomain.js +2 -9
- package/components/code/index.js +0 -9
- package/components/code/index.spec.js +46 -55
- package/components/code/index.vdt.js +6 -14
- package/components/code/styles.js +0 -1
- package/components/code/useEditor.js +5 -10
- package/components/collapse/index.d.ts +1 -1
- package/components/collapse/index.js +3 -14
- package/components/collapse/index.spec.js +47 -60
- package/components/collapse/index.vdt.js +4 -12
- package/components/collapse/item.js +0 -10
- package/components/collapse/item.vdt.js +7 -14
- package/components/collapse/styles.js +0 -1
- package/components/colorpicker/drag.js +0 -5
- package/components/colorpicker/index.js +0 -4
- package/components/colorpicker/index.spec.js +211 -259
- package/components/colorpicker/index.vdt.js +8 -11
- package/components/colorpicker/panel.js +0 -5
- package/components/colorpicker/panel.vdt.js +21 -26
- package/components/colorpicker/styles.js +2 -13
- package/components/colorpicker/useDrag.js +22 -26
- package/components/colorpicker/useInput.js +0 -16
- package/components/colorpicker/usePointer.js +15 -18
- package/components/colorpicker/useValue.js +2 -7
- package/components/context.d.ts +2 -2
- package/components/context.js +2 -19
- package/components/datepicker/basepicker.d.ts +8 -8
- package/components/datepicker/basepicker.js +20 -90
- package/components/datepicker/calendar.js +0 -11
- package/components/datepicker/calendar.vdt.js +11 -14
- package/components/datepicker/constants.js +0 -1
- package/components/datepicker/dayjs.js +1 -1
- package/components/datepicker/helpers.js +3 -15
- package/components/datepicker/index.js +6 -32
- package/components/datepicker/index.spec.js +1141 -1448
- package/components/datepicker/index.vdt.js +20 -34
- package/components/datepicker/shortcuts.d.ts +1 -1
- package/components/datepicker/shortcuts.js +0 -4
- package/components/datepicker/styles.js +0 -8
- package/components/datepicker/time.d.ts +1 -1
- package/components/datepicker/time.js +3 -23
- package/components/datepicker/time.vdt.js +4 -5
- package/components/datepicker/useDays.js +2 -9
- package/components/datepicker/useDisabled.js +6 -23
- package/components/datepicker/useFocusDate.js +0 -2
- package/components/datepicker/useFormats.js +6 -15
- package/components/datepicker/useKeyboards.js +20 -36
- package/components/datepicker/useMonths.js +0 -6
- package/components/datepicker/usePanel.js +0 -10
- package/components/datepicker/useShowDate.js +10 -37
- package/components/datepicker/useStatus.js +3 -15
- package/components/datepicker/useValue.js +22 -35
- package/components/datepicker/useYears.js +4 -15
- package/components/diagram/diagram.js +17 -43
- package/components/diagram/diagram.vdt.js +2 -5
- package/components/diagram/graph.js +6 -6
- package/components/diagram/index.d.ts +1 -1
- package/components/diagram/index.js +7 -7
- package/components/diagram/index.spec.js +369 -495
- package/components/diagram/layouts/circle.js +6 -14
- package/components/diagram/layouts/flow.js +7 -15
- package/components/diagram/layouts/layout.js +6 -28
- package/components/diagram/layouts/organic.js +3 -11
- package/components/diagram/layouts/partition.js +4 -12
- package/components/diagram/layouts/radial.js +6 -18
- package/components/diagram/layouts/stack.js +6 -14
- package/components/diagram/layouts/tree.js +11 -21
- package/components/diagram/mxgraph/handler/mxConnectionHandler.js +15 -22
- package/components/diagram/mxgraph/handler/mxConstraintHandler.js +4 -4
- package/components/diagram/mxgraph/handler/mxEdgeHandler.js +11 -15
- package/components/diagram/mxgraph/handler/mxGraphHandler.js +6 -9
- package/components/diagram/mxgraph/handler/mxRubberband.js +4 -4
- package/components/diagram/mxgraph/handler/mxVertexHandler.js +7 -10
- package/components/diagram/mxgraph/index.js +0 -2
- package/components/diagram/mxgraph/mx.js +3 -3
- package/components/diagram/mxgraph/shape/mxCloud.js +2 -2
- package/components/diagram/mxgraph/shape/mxCylinder.js +4 -9
- package/components/diagram/mxgraph/shape/mxEllipse.js +2 -2
- package/components/diagram/mxgraph/shape/mxHexagon.js +2 -2
- package/components/diagram/mxgraph/shape/mxLine.js +2 -2
- package/components/diagram/mxgraph/shape/mxRectangleShape.js +2 -2
- package/components/diagram/mxgraph/shape/mxRhombus.js +6 -12
- package/components/diagram/mxgraph/shape/mxShape.js +0 -1
- package/components/diagram/mxgraph/shape/mxTriangle.js +2 -2
- package/components/diagram/mxgraph/util/mxConstants.js +2 -2
- package/components/diagram/mxgraph/util/mxGuide.js +5 -7
- package/components/diagram/mxgraph/view/mxCellEditor.js +16 -29
- package/components/diagram/mxgraph/view/mxCellRenderer.js +0 -2
- package/components/diagram/mxgraph/view/mxGraph.js +14 -32
- package/components/diagram/shapes/base.d.ts +1 -1
- package/components/diagram/shapes/base.js +9 -39
- package/components/diagram/shapes/callout.js +10 -23
- package/components/diagram/shapes/circle.js +3 -10
- package/components/diagram/shapes/document.js +5 -16
- package/components/diagram/shapes/ellipse.js +0 -5
- package/components/diagram/shapes/generateShapes.d.ts +1 -1
- package/components/diagram/shapes/generateShapes.js +0 -9
- package/components/diagram/shapes/hexagon.js +9 -26
- package/components/diagram/shapes/image.js +1 -9
- package/components/diagram/shapes/line.d.ts +2 -2
- package/components/diagram/shapes/line.js +13 -48
- package/components/diagram/shapes/parallelogram.js +9 -26
- package/components/diagram/shapes/rectangle.js +1 -9
- package/components/diagram/shapes/shape.js +6 -35
- package/components/diagram/shapes/square.js +3 -11
- package/components/diagram/shapes/text.js +0 -5
- package/components/diagram/styles.js +0 -1
- package/components/dialog/alert.vdt.js +9 -19
- package/components/dialog/base.js +1 -29
- package/components/dialog/base.vdt.js +14 -29
- package/components/dialog/index.js +6 -31
- package/components/dialog/index.spec.js +406 -554
- package/components/dialog/staticMethods.d.ts +1 -1
- package/components/dialog/staticMethods.js +2 -13
- package/components/dialog/styles.js +0 -11
- package/components/dialog/useDraggable.js +0 -6
- package/components/dialog/useEscClosable.js +4 -12
- package/components/dialog/useFixBody.d.ts +1 -1
- package/components/dialog/useFixBody.js +0 -11
- package/components/dialog/usePosition.js +0 -5
- package/components/drawer/index.js +0 -5
- package/components/drawer/index.spec.js +126 -168
- package/components/drawer/index.vdt.js +3 -9
- package/components/drawer/styles.d.ts +2 -2
- package/components/drawer/styles.js +0 -4
- package/components/dropdown/dropdown.d.ts +2 -2
- package/components/dropdown/dropdown.js +33 -89
- package/components/dropdown/index.js +2 -6
- package/components/dropdown/index.spec.js +388 -496
- package/components/dropdown/item.js +4 -25
- package/components/dropdown/item.vdt.js +5 -8
- package/components/dropdown/menu.js +14 -29
- package/components/dropdown/menu.vdt.js +5 -13
- package/components/dropdown/styles.js +0 -9
- package/components/dropdown/useKeyboard.d.ts +2 -2
- package/components/dropdown/useKeyboard.js +8 -30
- package/components/dropdown/usePosition.d.ts +2 -1
- package/components/dropdown/usePosition.js +24 -22
- package/components/dropdown/useTransition.js +0 -8
- package/components/editable/index.d.ts +1 -1
- package/components/editable/index.js +4 -28
- package/components/editable/index.spec.js +152 -189
- package/components/editable/index.vdt.js +8 -11
- package/components/editable/styles.js +0 -1
- package/components/form/form.js +0 -18
- package/components/form/form.vdt.js +4 -7
- package/components/form/index.spec.js +1057 -1280
- package/components/form/item.d.ts +1 -1
- package/components/form/item.js +0 -12
- package/components/form/item.vdt.js +17 -31
- package/components/form/methods.d.ts +5 -5
- package/components/form/methods.js +2 -12
- package/components/form/styles.js +0 -8
- package/components/form/useDirty.js +2 -7
- package/components/form/useError.js +2 -10
- package/components/form/useValidate.d.ts +1 -1
- package/components/form/useValidate.js +8 -24
- package/components/grid/col.d.ts +3 -3
- package/components/grid/col.js +0 -7
- package/components/grid/col.vdt.js +8 -13
- package/components/grid/constants.d.ts +6 -6
- package/components/grid/row.js +0 -5
- package/components/grid/row.vdt.js +5 -8
- package/components/grid/styles.js +0 -7
- package/components/grid/useBreakpoints.js +0 -5
- package/components/grid/useGutter.js +5 -25
- package/components/icon/index.js +0 -10
- package/components/icon/index.vdt.js +7 -13
- package/components/icon/styles.js +0 -1
- package/components/input/index.d.ts +3 -3
- package/components/input/index.js +0 -14
- package/components/input/index.spec.js +185 -239
- package/components/input/index.vdt.js +39 -49
- package/components/input/search.js +0 -20
- package/components/input/search.vdt.js +6 -9
- package/components/input/styles.js +0 -26
- package/components/input/useAutoRows.js +6 -18
- package/components/input/useAutoWidth.js +0 -5
- package/components/input/useFrozen.js +0 -6
- package/components/input/useShowPassword.js +2 -5
- package/components/layout/aside.js +5 -17
- package/components/layout/aside.vdt.js +5 -9
- package/components/layout/body.js +5 -17
- package/components/layout/footer.js +1 -7
- package/components/layout/header.js +7 -21
- package/components/layout/layout.js +9 -24
- package/components/layout/styles.js +2 -13
- package/components/layout/template.vdt.js +2 -4
- package/components/layout/useParse.js +0 -7
- package/components/menu/index.spec.js +189 -242
- package/components/menu/item.js +3 -16
- package/components/menu/item.vdt.js +20 -32
- package/components/menu/menu.js +2 -11
- package/components/menu/menu.vdt.js +6 -12
- package/components/menu/styles.js +0 -18
- package/components/menu/useDropdown.js +4 -9
- package/components/menu/useExpanded.js +0 -14
- package/components/menu/useHighlight.js +26 -36
- package/components/message/index.spec.js +58 -73
- package/components/message/message.js +0 -19
- package/components/message/message.vdt.js +5 -8
- package/components/message/messages.js +0 -12
- package/components/message/messages.vdt.js +0 -1
- package/components/message/styles.js +0 -9
- package/components/pagination/index.d.ts +1 -1
- package/components/pagination/index.js +10 -46
- package/components/pagination/index.spec.js +133 -173
- package/components/pagination/index.vdt.js +14 -34
- package/components/pagination/styles.js +0 -4
- package/components/portal.d.ts +1 -1
- package/components/portal.js +2 -29
- package/components/position.d.ts +12 -12
- package/components/position.js +32 -88
- package/components/progress/index.d.ts +6 -6
- package/components/progress/index.js +0 -12
- package/components/progress/index.spec.js +143 -191
- package/components/progress/index.vdt.js +8 -11
- package/components/progress/styles.js +0 -6
- package/components/progress/useColor.js +2 -7
- package/components/progress/useStatus.d.ts +1 -1
- package/components/progress/useStatus.js +2 -5
- package/components/radio/index.js +3 -18
- package/components/radio/index.spec.js +111 -149
- package/components/radio/index.vdt.js +14 -17
- package/components/radio/styles.js +0 -10
- package/components/rate/index.js +0 -7
- package/components/rate/index.spec.js +64 -79
- package/components/rate/index.vdt.js +8 -21
- package/components/rate/styles.js +0 -3
- package/components/rate/useActiveValue.js +2 -7
- package/components/scrollSelect/index.d.ts +2 -2
- package/components/scrollSelect/index.js +0 -7
- package/components/scrollSelect/index.spec.js +100 -131
- package/components/scrollSelect/index.vdt.js +6 -11
- package/components/scrollSelect/styles.js +0 -7
- package/components/scrollSelect/useList.js +3 -17
- package/components/scrollSelect/useMouseEvents.js +31 -49
- package/components/scrollSelect/useTranslate.js +1 -11
- package/components/select/base.js +5 -35
- package/components/select/base.vdt.js +23 -38
- package/components/select/group.js +0 -5
- package/components/select/group.vdt.js +4 -10
- package/components/select/index.spec.js +361 -452
- package/components/select/menu.js +0 -5
- package/components/select/menu.vdt.js +18 -33
- package/components/select/option.js +2 -16
- package/components/select/option.vdt.js +7 -14
- package/components/select/select.js +3 -20
- package/components/select/select.vdt.js +9 -17
- package/components/select/styles.js +0 -33
- package/components/select/useBaseLabel.d.ts +1 -1
- package/components/select/useBaseLabel.js +4 -17
- package/components/select/useCard.js +0 -4
- package/components/select/useEqualWidth.js +0 -1
- package/components/select/useFilterable.js +5 -27
- package/components/select/useFocusout.d.ts +1 -1
- package/components/select/useFocusout.js +1 -9
- package/components/select/useInput.js +6 -10
- package/components/select/useLabel.js +3 -13
- package/components/select/useSearchable.js +0 -10
- package/components/skeleton/item.d.ts +1 -1
- package/components/skeleton/item.js +0 -4
- package/components/skeleton/item.vdt.js +1 -6
- package/components/skeleton/skeleton.js +0 -4
- package/components/skeleton/skeleton.vdt.js +6 -12
- package/components/skeleton/style.d.ts +1 -1
- package/components/skeleton/style.js +0 -1
- package/components/slider/index.d.ts +1 -1
- package/components/slider/index.js +0 -7
- package/components/slider/index.spec.js +467 -585
- package/components/slider/index.vdt.js +32 -45
- package/components/slider/styles.js +0 -14
- package/components/slider/useClick.js +2 -11
- package/components/slider/useDraggable.js +23 -34
- package/components/slider/useKeyboard.js +7 -18
- package/components/slider/useMarks.d.ts +5 -5
- package/components/slider/useMarks.js +5 -13
- package/components/slider/usePoints.d.ts +2 -2
- package/components/slider/usePoints.js +7 -21
- package/components/slider/useStyles.d.ts +1 -1
- package/components/slider/useStyles.js +5 -10
- package/components/slider/useTooltip.js +2 -10
- package/components/slider/useValue.d.ts +1 -1
- package/components/slider/useValue.js +7 -22
- package/components/spin/index.js +0 -4
- package/components/spin/index.vdt.js +4 -11
- package/components/spin/styles.js +0 -2
- package/components/spinner/index.d.ts +4 -4
- package/components/spinner/index.js +9 -24
- package/components/spinner/index.spec.js +359 -460
- package/components/spinner/index.vdt.js +10 -13
- package/components/spinner/styles.js +0 -3
- package/components/spinner/useChange.js +4 -16
- package/components/spinner/useFormatter.js +6 -16
- package/components/spinner/useStep.d.ts +3 -3
- package/components/spinner/useStep.js +2 -20
- package/components/spinner/useValue.js +11 -26
- package/components/split/index.js +0 -7
- package/components/split/index.spec.js +223 -267
- package/components/split/index.vdt.js +8 -17
- package/components/split/style.d.ts +1 -1
- package/components/split/style.js +0 -8
- package/components/split/useDraggable.js +11 -35
- package/components/split/useSize.js +2 -5
- package/components/steps/context.d.ts +2 -2
- package/components/steps/index.js +2 -10
- package/components/steps/index.spec.js +21 -27
- package/components/steps/index.vdt.js +8 -10
- package/components/steps/step.js +0 -2
- package/components/steps/step.vdt.js +8 -12
- package/components/steps/styles.js +0 -27
- package/components/switch/index.js +2 -23
- package/components/switch/index.spec.js +188 -224
- package/components/switch/index.vdt.js +16 -32
- package/components/switch/styles.js +3 -14
- package/components/switch/useDraggable.js +10 -18
- package/components/table/cell.js +0 -6
- package/components/table/cell.vdt.js +14 -21
- package/components/table/column.d.ts +1 -1
- package/components/table/column.js +0 -5
- package/components/table/column.vdt.js +19 -30
- package/components/table/exportTable.js +45 -56
- package/components/table/index.spec.js +780 -984
- package/components/table/row.d.ts +1 -1
- package/components/table/row.js +12 -41
- package/components/table/row.vdt.js +27 -39
- package/components/table/styles.js +0 -11
- package/components/table/table.d.ts +5 -5
- package/components/table/table.js +18 -50
- package/components/table/table.vdt.js +61 -85
- package/components/table/useChecked.d.ts +1 -1
- package/components/table/useChecked.js +20 -61
- package/components/table/useColumns.js +3 -16
- package/components/table/useDisableRow.js +2 -12
- package/components/table/useDraggable.js +4 -12
- package/components/table/useExpandable.js +2 -5
- package/components/table/useFixedColumns.d.ts +1 -1
- package/components/table/useFixedColumns.js +4 -23
- package/components/table/useGroup.d.ts +1 -1
- package/components/table/useGroup.js +7 -24
- package/components/table/useMerge.d.ts +4 -4
- package/components/table/useMerge.js +2 -14
- package/components/table/usePagination.js +4 -18
- package/components/table/useResizable.js +2 -10
- package/components/table/useRestRowStatus.js +2 -6
- package/components/table/useScroll.d.ts +1 -1
- package/components/table/useScroll.js +0 -3
- package/components/table/useSelected.js +2 -5
- package/components/table/useSortable.js +2 -8
- package/components/table/useStickyHeader.js +3 -7
- package/components/table/useStickyScrollbar.js +6 -16
- package/components/table/useTree.js +1 -12
- package/components/table/useWidth.js +14 -30
- package/components/tabs/index.js +29 -51
- package/components/tabs/index.spec.js +56 -74
- package/components/tabs/index.vdt.js +13 -16
- package/components/tabs/styles.js +0 -16
- package/components/tabs/tab.js +0 -10
- package/components/tabs/tab.vdt.js +6 -10
- package/components/tabs/useActiveBar.js +2 -11
- package/components/tabs/useScroll.js +4 -20
- package/components/tag/base.js +0 -8
- package/components/tag/index.js +2 -4
- package/components/tag/index.spec.js +19 -25
- package/components/tag/index.vdt.js +8 -15
- package/components/tag/styles.js +0 -9
- package/components/timeline/item.js +0 -4
- package/components/timeline/item.vdt.js +4 -9
- package/components/timeline/styles.d.ts +2 -2
- package/components/timeline/styles.js +0 -4
- package/components/timeline/timeline.js +0 -2
- package/components/timeline/timeline.vdt.js +2 -5
- package/components/timepicker/index.js +2 -7
- package/components/timepicker/index.spec.js +293 -368
- package/components/timepicker/panelPicker.js +2 -11
- package/components/timepicker/panelPicker.vdt.js +14 -24
- package/components/timepicker/selectPicker.js +0 -5
- package/components/timepicker/selectPicker.vdt.js +5 -10
- package/components/timepicker/styles.js +0 -1
- package/components/timepicker/useDisabled.js +2 -4
- package/components/timepicker/useFormats.js +4 -13
- package/components/timepicker/useStep.d.ts +1 -1
- package/components/timepicker/useStep.js +8 -17
- package/components/timepicker/useValue.js +16 -21
- package/components/tip/index.js +0 -2
- package/components/tip/index.vdt.js +5 -17
- package/components/tip/styles.js +0 -3
- package/components/tooltip/content.js +0 -28
- package/components/tooltip/content.vdt.js +15 -25
- package/components/tooltip/index.js +3 -7
- package/components/tooltip/index.spec.js +434 -572
- package/components/tooltip/styles.d.ts +1 -1
- package/components/tooltip/styles.js +2 -10
- package/components/tooltip/tooltip.js +2 -15
- package/components/tooltip/useArrow.js +11 -14
- package/components/transfer/index.d.ts +1 -1
- package/components/transfer/index.js +1 -13
- package/components/transfer/index.spec.js +159 -194
- package/components/transfer/index.vdt.js +16 -34
- package/components/transfer/styles.js +0 -10
- package/components/transfer/useCheck.d.ts +1 -1
- package/components/transfer/useCheck.js +1 -15
- package/components/transfer/useFilter.d.ts +1 -1
- package/components/transfer/useFilter.js +9 -30
- package/components/transfer/useTransfer.js +10 -26
- package/components/tree/index.d.ts +3 -3
- package/components/tree/index.js +4 -22
- package/components/tree/index.spec.js +285 -355
- package/components/tree/index.vdt.js +12 -23
- package/components/tree/styles.js +2 -16
- package/components/tree/useChecked.js +3 -26
- package/components/tree/useDraggable.js +12 -42
- package/components/tree/useExpanded.js +26 -43
- package/components/tree/useFilter.js +3 -10
- package/components/tree/useNodes.d.ts +1 -1
- package/components/tree/useNodes.js +0 -4
- package/components/tree/useSelected.js +21 -38
- package/components/tree/useTransitionEvent.js +3 -5
- package/components/treeSelect/index.js +9 -36
- package/components/treeSelect/index.spec.js +123 -160
- package/components/treeSelect/index.vdt.js +14 -20
- package/components/treeSelect/styles.js +0 -1
- package/components/treeSelect/useValue.js +0 -11
- package/components/types.d.ts +3 -3
- package/components/upload/ajaxUploader.d.ts +1 -1
- package/components/upload/ajaxUploader.js +0 -17
- package/components/upload/index.d.ts +4 -4
- package/components/upload/index.js +0 -14
- package/components/upload/index.spec.js +142 -249
- package/components/upload/index.vdt.js +12 -27
- package/components/upload/styles.js +0 -30
- package/components/upload/useAccept.js +2 -10
- package/components/upload/useDrag.js +0 -7
- package/components/upload/useFiles.js +103 -145
- package/components/upload/useShowImage.js +0 -3
- package/components/upload/useUpload.js +47 -69
- package/components/utils.d.ts +3 -3
- package/components/utils.js +12 -47
- package/components/virtual.js +9 -37
- package/components/wave/index.js +5 -31
- package/hooks/useDelayClose.js +2 -6
- package/hooks/useDocumentClick.js +8 -16
- package/hooks/useDraggable.d.ts +1 -1
- package/hooks/useDraggable.js +0 -9
- package/hooks/useKeyboard.d.ts +3 -3
- package/hooks/useKeyboard.js +0 -10
- package/hooks/useMouseOutsidable.js +0 -8
- package/hooks/useReceive.d.ts +1 -1
- package/hooks/useReceive.js +0 -4
- package/hooks/useRecordComponent.js +0 -6
- package/hooks/useRouter.js +7 -18
- package/hooks/useShowHideEvents.js +0 -3
- package/hooks/useState.d.ts +2 -2
- package/hooks/useState.js +2 -6
- package/i18n/en-US.js +0 -1
- package/i18n/index.d.ts +1 -1
- package/i18n/index.js +0 -7
- package/index.d.ts +2 -2
- package/index.js +2 -3
- package/package.json +2 -2
- package/styles/global.js +2 -3
- package/styles/keyframes.js +0 -1
- package/styles/theme.d.ts +1 -1
- package/styles/theme.js +4 -7
- package/styles/utils.d.ts +1 -1
- package/styles/utils.js +3 -17
- package/yarn-error.log +633 -517
- package/components/cascader/index.d.ts +0 -45
- package/components/datepicker/index.d.ts +0 -63
- package/components/select/select.d.ts +0 -33
- package/components/timepicker/panelPicker.d.ts +0 -54
- package/components/treeSelect/index.d.ts +0 -27
|
@@ -20,7 +20,7 @@ export interface FormItemBlocks {
|
|
|
20
20
|
content: null;
|
|
21
21
|
append: null;
|
|
22
22
|
}
|
|
23
|
-
export
|
|
23
|
+
export type Rules = Record<string, any>;
|
|
24
24
|
export declare class FormItem extends Component<FormItemProps, FormItemEvents, FormItemBlocks> {
|
|
25
25
|
static template: string | import("intact").Template<any>;
|
|
26
26
|
static typeDefs: Required<TypeDefs<FormItemProps>>;
|
package/components/form/item.js
CHANGED
|
@@ -8,12 +8,10 @@ import { useError } from './useError';
|
|
|
8
8
|
import { useValidate } from './useValidate';
|
|
9
9
|
import { useDirty } from './useDirty';
|
|
10
10
|
var MessageOrClassname;
|
|
11
|
-
|
|
12
11
|
(function (MessageOrClassname) {
|
|
13
12
|
MessageOrClassname[MessageOrClassname["Message"] = 0] = "Message";
|
|
14
13
|
MessageOrClassname[MessageOrClassname["ClassName"] = 1] = "ClassName";
|
|
15
14
|
})(MessageOrClassname || (MessageOrClassname = {}));
|
|
16
|
-
|
|
17
15
|
var typeDefs = {
|
|
18
16
|
value: null,
|
|
19
17
|
rules: Object,
|
|
@@ -27,16 +25,12 @@ var typeDefs = {
|
|
|
27
25
|
};
|
|
28
26
|
export var FormItem = /*#__PURE__*/function (_Component) {
|
|
29
27
|
_inheritsLoose(FormItem, _Component);
|
|
30
|
-
|
|
31
28
|
function FormItem() {
|
|
32
29
|
var _context;
|
|
33
|
-
|
|
34
30
|
var _this;
|
|
35
|
-
|
|
36
31
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
37
32
|
args[_key] = arguments[_key];
|
|
38
33
|
}
|
|
39
|
-
|
|
40
34
|
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
41
35
|
_this.form = inject(FORM, null);
|
|
42
36
|
_this.error = useError();
|
|
@@ -46,28 +40,22 @@ export var FormItem = /*#__PURE__*/function (_Component) {
|
|
|
46
40
|
_this.validateHook = useValidate(_this.error.getErrorMessage, _this.error.getErrorClassName, _this.error.message, _this.dirty.isDirty);
|
|
47
41
|
return _this;
|
|
48
42
|
}
|
|
49
|
-
|
|
50
43
|
var _proto = FormItem.prototype;
|
|
51
|
-
|
|
52
44
|
_proto.init = function init() {
|
|
53
45
|
useRecordItem(RECORD_KEY);
|
|
54
46
|
};
|
|
55
|
-
|
|
56
47
|
_proto.validate = function validate() {
|
|
57
48
|
if (!this.form) return true;
|
|
58
49
|
return this.validateHook.validate();
|
|
59
50
|
};
|
|
60
|
-
|
|
61
51
|
_proto.isValid = function isValid() {
|
|
62
52
|
return this.validateHook.isValid.value;
|
|
63
53
|
};
|
|
64
|
-
|
|
65
54
|
_proto.reset = function reset() {
|
|
66
55
|
this.error.reset();
|
|
67
56
|
this.validateHook.reset();
|
|
68
57
|
this.dirty.reset();
|
|
69
58
|
};
|
|
70
|
-
|
|
71
59
|
return FormItem;
|
|
72
60
|
}(Component);
|
|
73
61
|
FormItem.template = template;
|
|
@@ -12,30 +12,27 @@ var _$tmp0 = {
|
|
|
12
12
|
};
|
|
13
13
|
export default function ($props, $blocks, $__proto__) {
|
|
14
14
|
var _classNameObj, _$cn2;
|
|
15
|
-
|
|
16
15
|
$blocks || ($blocks = {});
|
|
17
16
|
$props || ($props = {});
|
|
18
17
|
var $this = this;
|
|
19
18
|
var _$blocks = {};
|
|
20
19
|
var __$blocks = {};
|
|
21
|
-
|
|
22
20
|
var _this$get = this.get(),
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
21
|
+
className = _this$get.className,
|
|
22
|
+
children = _this$get.children,
|
|
23
|
+
label = _this$get.label,
|
|
24
|
+
hideLabel = _this$get.hideLabel,
|
|
25
|
+
htmlFor = _this$get.htmlFor,
|
|
26
|
+
errorClassName = _this$get.errorClassName,
|
|
27
|
+
rules = _this$get.rules,
|
|
28
|
+
fluid = _this$get.fluid;
|
|
32
29
|
var _this$dirty = this.dirty,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
isDirty = _this$dirty.isDirty.value,
|
|
31
|
+
onChange = _this$dirty.onChange,
|
|
32
|
+
onFocusout = _this$dirty.onFocusout;
|
|
36
33
|
var _this$validateHook = this.validateHook,
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
isValid = _this$validateHook.isValid.value,
|
|
35
|
+
customErrorClassName = _this$validateHook.errorClassName.value;
|
|
39
36
|
var classNameObj = (_classNameObj = {
|
|
40
37
|
'k-form-item': true,
|
|
41
38
|
'k-invalid': isDirty && !isValid,
|
|
@@ -44,7 +41,6 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
44
41
|
var starOnRequired = this.form && this.form.get('starOnRequired');
|
|
45
42
|
var labelWidth = this.form && this.form.get('labelWidth');
|
|
46
43
|
var labelStyle;
|
|
47
|
-
|
|
48
44
|
if (labelWidth != null) {
|
|
49
45
|
if (/^\d+$/.test(labelWidth)) {
|
|
50
46
|
labelStyle = {
|
|
@@ -56,11 +52,10 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
56
52
|
};
|
|
57
53
|
}
|
|
58
54
|
}
|
|
59
|
-
|
|
60
55
|
var _this$error = this.error,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
56
|
+
ellipsis = _this$error.ellipsis,
|
|
57
|
+
message = _this$error.message,
|
|
58
|
+
errorRef = _this$error.errorRef;
|
|
64
59
|
return _$cv('div', _extends({}, getRestProps(this), {
|
|
65
60
|
'className': _$cn(classNameObj),
|
|
66
61
|
'ev-change': onChange,
|
|
@@ -69,11 +64,9 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
69
64
|
return label;
|
|
70
65
|
}, __$blocks['label'] = function ($super, data) {
|
|
71
66
|
var block = $blocks['label'];
|
|
72
|
-
|
|
73
67
|
var callBlock = function callBlock() {
|
|
74
68
|
return _$blocks['label'].call($this, $super, data);
|
|
75
69
|
};
|
|
76
|
-
|
|
77
70
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
78
71
|
}, __$blocks['label'](_$no))], 0, 'k-form-label', {
|
|
79
72
|
'htmlFor': htmlFor,
|
|
@@ -84,11 +77,9 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
84
77
|
return children;
|
|
85
78
|
}, __$blocks['content'] = function ($super, data) {
|
|
86
79
|
var block = $blocks['content'];
|
|
87
|
-
|
|
88
80
|
var callBlock = function callBlock() {
|
|
89
81
|
return _$blocks['content'].call($this, $super, data);
|
|
90
82
|
};
|
|
91
|
-
|
|
92
83
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
93
84
|
}, __$blocks['content'](_$no))
|
|
94
85
|
}), _$cc(Transition, {
|
|
@@ -100,17 +91,14 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
100
91
|
'children': _$cc(Icon, _$tmp0),
|
|
101
92
|
'$blocks': function ($blocks) {
|
|
102
93
|
var _$blocks = {},
|
|
103
|
-
|
|
104
|
-
|
|
94
|
+
__$blocks = _$ex({}, $blocks);
|
|
105
95
|
return (_$blocks['content'] = function ($super) {
|
|
106
96
|
return message.value;
|
|
107
97
|
}, __$blocks['content'] = function ($super, data) {
|
|
108
98
|
var block = $blocks['content'];
|
|
109
|
-
|
|
110
99
|
var callBlock = function callBlock() {
|
|
111
100
|
return _$blocks['content'].call($this, $super, data);
|
|
112
101
|
};
|
|
113
|
-
|
|
114
102
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
115
103
|
}), __$blocks;
|
|
116
104
|
}.call($this, _$em)
|
|
@@ -121,11 +109,9 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
121
109
|
return null;
|
|
122
110
|
}, __$blocks['append'] = function ($super, data) {
|
|
123
111
|
var block = $blocks['append'];
|
|
124
|
-
|
|
125
112
|
var callBlock = function callBlock() {
|
|
126
113
|
return _$blocks['append'].call($this, $super, data);
|
|
127
114
|
};
|
|
128
|
-
|
|
129
115
|
return block ? block.call($this, callBlock, data) : callBlock();
|
|
130
116
|
}, __$blocks['append'](_$no)), 0, 'k-form-append') : undefined]);
|
|
131
117
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
1
|
+
export type MethodReturn = boolean | string;
|
|
2
|
+
export type Method = (value: any, param: any) => MethodReturn | Promise<MethodReturn>;
|
|
3
|
+
export type Message = string | ((value: any, param: any) => string);
|
|
4
|
+
export type ClassName = string | ((value: any, param: any) => string);
|
|
5
5
|
export declare const methods: Record<string, Method>;
|
|
6
6
|
export declare const messages: Record<string, Message>;
|
|
7
7
|
export declare const classNames: Record<string, ClassName>;
|
|
8
|
-
export declare const addMethod: (name: string, method: Method, message?: Message
|
|
8
|
+
export declare const addMethod: (name: string, method: Method, message?: Message, className?: ClassName) => void;
|
|
@@ -1,31 +1,24 @@
|
|
|
1
1
|
import _trimInstanceProperty from "@babel/runtime-corejs3/core-js/instance/trim";
|
|
2
2
|
import { _$ } from '../../i18n';
|
|
3
3
|
import { isNumber, isNullOrUndefined, isString } from 'intact-shared';
|
|
4
|
-
|
|
5
4
|
function decimalPlaces(num) {
|
|
6
5
|
var match = ("" + num).match(/(?:\.(\d+))?$/);
|
|
7
6
|
/* istanbul ignore if */
|
|
8
|
-
|
|
9
7
|
if (!match) {
|
|
10
8
|
return 0;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
}
|
|
10
|
+
// Number of digits right of decimal point.
|
|
14
11
|
return match[1] ? match[1].length : 0;
|
|
15
12
|
}
|
|
16
|
-
|
|
17
13
|
export var methods = {
|
|
18
14
|
required: function required(value) {
|
|
19
15
|
if (isNullOrUndefined(value)) return false;
|
|
20
|
-
|
|
21
16
|
if (isString(value)) {
|
|
22
17
|
return _trimInstanceProperty(value).call(value).length > 0;
|
|
23
18
|
}
|
|
24
|
-
|
|
25
19
|
if (Array.isArray(value)) {
|
|
26
20
|
return value.length > 0;
|
|
27
21
|
}
|
|
28
|
-
|
|
29
22
|
return true;
|
|
30
23
|
},
|
|
31
24
|
digits: function digits(value) {
|
|
@@ -70,11 +63,9 @@ export var methods = {
|
|
|
70
63
|
},
|
|
71
64
|
step: function step(value, param) {
|
|
72
65
|
var decimals = decimalPlaces(param);
|
|
73
|
-
|
|
74
66
|
var toInt = function toInt(num) {
|
|
75
67
|
return Math.round(num * Math.pow(10, decimals));
|
|
76
68
|
};
|
|
77
|
-
|
|
78
69
|
return decimalPlaces(value) <= decimals && toInt(value) % toInt(param) === 0;
|
|
79
70
|
},
|
|
80
71
|
equal: function equal(value, param) {
|
|
@@ -166,7 +157,6 @@ export var classNames = {};
|
|
|
166
157
|
export var addMethod = function addMethod(name, method, message, className) {
|
|
167
158
|
methods[name] = method;
|
|
168
159
|
messages[name] = message !== undefined ? message : messages[name];
|
|
169
|
-
|
|
170
160
|
if (className) {
|
|
171
161
|
classNames[name] = className;
|
|
172
162
|
}
|
|
@@ -7,30 +7,23 @@ var defaults = {
|
|
|
7
7
|
item: {
|
|
8
8
|
gap: "24px",
|
|
9
9
|
labelWidth: "80px",
|
|
10
|
-
|
|
11
10
|
get labelLineHeight() {
|
|
12
11
|
return theme.default.height;
|
|
13
12
|
},
|
|
14
|
-
|
|
15
13
|
labelTextAlign: 'right',
|
|
16
14
|
labelGap: '10px',
|
|
17
|
-
|
|
18
15
|
get starColor() {
|
|
19
16
|
return theme.color.danger;
|
|
20
17
|
},
|
|
21
|
-
|
|
22
18
|
starGap: '3px',
|
|
23
19
|
// invalid
|
|
24
20
|
errorFontSize: '12px',
|
|
25
|
-
|
|
26
21
|
get errorColor() {
|
|
27
22
|
return theme.color.danger;
|
|
28
23
|
},
|
|
29
|
-
|
|
30
24
|
get invalidBorder() {
|
|
31
25
|
return "1px solid " + theme.color.danger;
|
|
32
26
|
},
|
|
33
|
-
|
|
34
27
|
// append
|
|
35
28
|
appendPadding: "0 10px",
|
|
36
29
|
// layout
|
|
@@ -54,7 +47,6 @@ export function makeItemStyles() {
|
|
|
54
47
|
}
|
|
55
48
|
export function makeFormStyles() {
|
|
56
49
|
var _context;
|
|
57
|
-
|
|
58
50
|
return /*#__PURE__*/css("&.k-inline{.k-form-item{display:inline-block;vertical-align:top;margin-right:", form.item.inlineGap, ";}.k-form-label{width:auto;}}&.k-vertical{.k-form-item,.k-form-label,.k-form-content{display:block;}.k-form-label{width:auto;text-align:left;line-height:inherit;margin-bottom:", form.item.verticalLabelGap, ";}}", _mapInstanceProperty(_context = ['small', 'mini']).call(_context, function (size) {
|
|
59
51
|
return /*#__PURE__*/css("&.k-", size, "{.k-form-item:not(:last-of-type){margin:", form.item[size + "Gap"], ";}&.k-inline{.k-form-item{margin-right:", form.item[size + "InlineGap"], ";}}}");
|
|
60
52
|
}), ";");
|
|
@@ -3,33 +3,28 @@ import { useState } from '../../hooks/useState';
|
|
|
3
3
|
export function useDirty(getValidate) {
|
|
4
4
|
var instance = useInstance();
|
|
5
5
|
var isDirty = useState(false);
|
|
6
|
-
|
|
7
6
|
function onChange(e) {
|
|
8
7
|
dirty();
|
|
9
8
|
instance.trigger('change', e);
|
|
10
9
|
}
|
|
11
|
-
|
|
12
10
|
function onFocusout(e) {
|
|
13
11
|
dirty();
|
|
14
12
|
instance.trigger('focusout', e);
|
|
15
13
|
}
|
|
16
|
-
|
|
17
14
|
function dirty() {
|
|
18
15
|
if (isDirty.value) return;
|
|
19
|
-
isDirty.set(true);
|
|
16
|
+
isDirty.set(true);
|
|
17
|
+
// for select, the focusout event triggers before select
|
|
20
18
|
// so we put off validating it
|
|
21
|
-
|
|
22
19
|
setTimeout(function () {
|
|
23
20
|
// maybe it has been unmounted or reset
|
|
24
21
|
if (instance.$unmounted || !isDirty.value) return;
|
|
25
22
|
getValidate()();
|
|
26
23
|
}, 100);
|
|
27
24
|
}
|
|
28
|
-
|
|
29
25
|
function reset() {
|
|
30
26
|
isDirty.set(false);
|
|
31
27
|
}
|
|
32
|
-
|
|
33
28
|
return {
|
|
34
29
|
onChange: onChange,
|
|
35
30
|
onFocusout: onFocusout,
|
|
@@ -2,11 +2,11 @@ import { useInstance, nextTick, createRef } from 'intact-vue-next';
|
|
|
2
2
|
import { useState, watchState } from '../../hooks/useState';
|
|
3
3
|
import { messages as globalMessages, classNames as globalClassNames } from './methods';
|
|
4
4
|
import { isFunction } from 'intact-shared';
|
|
5
|
-
import { createContext } from '../context';
|
|
5
|
+
import { createContext } from '../context';
|
|
6
|
+
// enum MessageOrClassname {
|
|
6
7
|
// Message,
|
|
7
8
|
// ClassName,
|
|
8
9
|
// }
|
|
9
|
-
|
|
10
10
|
export var context = createContext();
|
|
11
11
|
export function useError() {
|
|
12
12
|
var instance = useInstance();
|
|
@@ -16,38 +16,30 @@ export function useError() {
|
|
|
16
16
|
watchState(message, function () {
|
|
17
17
|
nextTick(checkEllipsis);
|
|
18
18
|
});
|
|
19
|
-
|
|
20
19
|
function checkEllipsis() {
|
|
21
20
|
var error = errorRef.value;
|
|
22
21
|
if (!error) return;
|
|
23
22
|
ellipsis.set(error.offsetWidth < error.scrollWidth);
|
|
24
23
|
}
|
|
25
|
-
|
|
26
24
|
function getErrorMessageOrClassName(type, key) {
|
|
27
25
|
var custom = instance.get(type);
|
|
28
26
|
var value = custom && custom[key] || (type === 'messages' ? globalMessages[key] : globalClassNames[key]);
|
|
29
|
-
|
|
30
27
|
if (isFunction(value)) {
|
|
31
28
|
var rules = instance.get('rules');
|
|
32
29
|
return value(instance.get('value'), rules[key]);
|
|
33
30
|
}
|
|
34
|
-
|
|
35
31
|
return value;
|
|
36
32
|
}
|
|
37
|
-
|
|
38
33
|
function getErrorMessage(key) {
|
|
39
34
|
return getErrorMessageOrClassName('messages', key);
|
|
40
35
|
}
|
|
41
|
-
|
|
42
36
|
function getErrorClassName(key) {
|
|
43
37
|
return getErrorMessageOrClassName('classNames', key);
|
|
44
38
|
}
|
|
45
|
-
|
|
46
39
|
function reset() {
|
|
47
40
|
ellipsis.set(false);
|
|
48
41
|
message.set(undefined);
|
|
49
42
|
}
|
|
50
|
-
|
|
51
43
|
return {
|
|
52
44
|
ellipsis: ellipsis,
|
|
53
45
|
message: message,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { State } from '../../hooks/useState';
|
|
2
|
-
|
|
2
|
+
type PromiseWithCancelled = Promise<boolean> & {
|
|
3
3
|
cancelled: boolean;
|
|
4
4
|
};
|
|
5
5
|
export declare function useValidate(getErrorMessage: (ruleName: string) => string, getErrorClassName: (ruleName: string) => string, message: State<string | undefined>, isDirty: State<boolean>): {
|
|
@@ -10,81 +10,68 @@ export function useValidate(getErrorMessage, getErrorClassName, message, isDirty
|
|
|
10
10
|
var errorClassName = useState(undefined);
|
|
11
11
|
var promise = null;
|
|
12
12
|
useReceive(['value', 'rules'], validateIfDirty);
|
|
13
|
-
|
|
14
13
|
function validateIfDirty() {
|
|
15
14
|
if (isDirty.value) {
|
|
16
15
|
validate();
|
|
17
16
|
}
|
|
18
17
|
}
|
|
19
|
-
|
|
20
18
|
function validate() {
|
|
21
19
|
var _instance$get = instance.get(),
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
rules = _instance$get.rules,
|
|
21
|
+
value = _instance$get.value;
|
|
25
22
|
if (!rules) return true;
|
|
26
23
|
cancel();
|
|
27
24
|
var promises = [];
|
|
28
|
-
var ruleNames = [];
|
|
29
|
-
|
|
25
|
+
var ruleNames = [];
|
|
26
|
+
// check required rule firstly, detect whether it is empty or not
|
|
30
27
|
var required = globalMethods.required(value, true);
|
|
31
|
-
|
|
32
28
|
if (rules.required) {
|
|
33
29
|
promises.push(required);
|
|
34
30
|
ruleNames.push('required');
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
}
|
|
32
|
+
// if required rule passed, then check other rules
|
|
38
33
|
if (required) {
|
|
39
34
|
for (var key in rules) {
|
|
40
35
|
var rule = rules[key];
|
|
41
36
|
if (key === 'required' || rule === false) continue;
|
|
42
37
|
var fn = void 0;
|
|
43
|
-
|
|
44
38
|
if (isFunction(rule)) {
|
|
45
39
|
fn = rule;
|
|
46
40
|
} else {
|
|
47
41
|
fn = globalMethods[key];
|
|
48
42
|
/* istanbul ignore if */
|
|
49
|
-
|
|
50
43
|
if (!fn) {
|
|
51
44
|
console.warn("Can not find validate method: " + key);
|
|
52
45
|
continue;
|
|
53
46
|
}
|
|
54
47
|
}
|
|
55
|
-
|
|
56
48
|
promises.push(fn(value, rules[key]));
|
|
57
49
|
ruleNames.push(key);
|
|
58
50
|
}
|
|
59
51
|
}
|
|
60
|
-
|
|
61
52
|
return promise = _Promise.all(promises).then(function (results) {
|
|
62
53
|
for (var index = 0; index < results.length; index++) {
|
|
63
54
|
var result = results[index];
|
|
64
|
-
|
|
65
55
|
if (result !== true) {
|
|
66
56
|
var ruleName = ruleNames[index];
|
|
67
57
|
return [false, result || getErrorMessage(ruleName), getErrorClassName(ruleName)];
|
|
68
58
|
}
|
|
69
59
|
}
|
|
70
|
-
|
|
71
60
|
return [true, message.value, undefined];
|
|
72
61
|
}, function (err) {
|
|
73
62
|
var message;
|
|
74
63
|
var className;
|
|
75
|
-
|
|
76
64
|
if (isString(err)) {
|
|
77
65
|
message = err;
|
|
78
66
|
} else if (err) {
|
|
79
67
|
message = err.message || getErrorMessage(err.name);
|
|
80
68
|
className = err.className || getErrorClassName(err.name);
|
|
81
69
|
}
|
|
82
|
-
|
|
83
70
|
return [false, message, className];
|
|
84
71
|
}).then(function (_ref) {
|
|
85
72
|
var _isValid = _ref[0],
|
|
86
|
-
|
|
87
|
-
|
|
73
|
+
_message = _ref[1],
|
|
74
|
+
_className = _ref[2];
|
|
88
75
|
// if cancelled, should return the last result
|
|
89
76
|
if (promise.cancelled) return isValid.value;
|
|
90
77
|
isDirty.set(true);
|
|
@@ -94,19 +81,16 @@ export function useValidate(getErrorMessage, getErrorClassName, message, isDirty
|
|
|
94
81
|
return _isValid;
|
|
95
82
|
});
|
|
96
83
|
}
|
|
97
|
-
|
|
98
84
|
function cancel() {
|
|
99
85
|
if (promise) {
|
|
100
86
|
promise.cancelled = true;
|
|
101
87
|
}
|
|
102
88
|
}
|
|
103
|
-
|
|
104
89
|
function reset() {
|
|
105
90
|
isValid.set(true);
|
|
106
91
|
errorClassName.set(undefined);
|
|
107
92
|
cancel();
|
|
108
93
|
}
|
|
109
|
-
|
|
110
94
|
return {
|
|
111
95
|
isValid: isValid,
|
|
112
96
|
errorClassName: errorClassName,
|
package/components/grid/col.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Component, TypeDefs } from 'intact-vue-next';
|
|
2
2
|
import { PrimitiveValue, BreakpointValues } from './constants';
|
|
3
|
-
export
|
|
3
|
+
export type BaseColProps = {
|
|
4
4
|
span?: PrimitiveValue;
|
|
5
5
|
offset?: PrimitiveValue;
|
|
6
6
|
order?: PrimitiveValue;
|
|
7
7
|
pull?: PrimitiveValue;
|
|
8
8
|
push?: PrimitiveValue;
|
|
9
9
|
};
|
|
10
|
-
export
|
|
11
|
-
export
|
|
10
|
+
export type BreakpointProps = BreakpointValues<keyof BaseColProps>;
|
|
11
|
+
export type ColProps = BaseColProps & BreakpointProps;
|
|
12
12
|
export declare const baseTypeDefs: Required<TypeDefs<BaseColProps>>;
|
|
13
13
|
export declare class Col extends Component<ColProps> {
|
|
14
14
|
static template: string | import("intact").Template<any>;
|
package/components/grid/col.js
CHANGED
|
@@ -12,29 +12,22 @@ export var baseTypeDefs = {
|
|
|
12
12
|
pull: PrimitiveValue,
|
|
13
13
|
push: PrimitiveValue
|
|
14
14
|
};
|
|
15
|
-
|
|
16
15
|
var typeDefs = _extends({}, baseTypeDefs, breakpoints.reduce(function (memo, key) {
|
|
17
16
|
memo[key] = Value;
|
|
18
17
|
return memo;
|
|
19
18
|
}, {}));
|
|
20
|
-
|
|
21
19
|
export var Col = /*#__PURE__*/function (_Component) {
|
|
22
20
|
_inheritsLoose(Col, _Component);
|
|
23
|
-
|
|
24
21
|
function Col() {
|
|
25
22
|
var _context;
|
|
26
|
-
|
|
27
23
|
var _this;
|
|
28
|
-
|
|
29
24
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
30
25
|
args[_key] = arguments[_key];
|
|
31
26
|
}
|
|
32
|
-
|
|
33
27
|
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
34
28
|
_this.breakpoints = useBreakpoints();
|
|
35
29
|
return _this;
|
|
36
30
|
}
|
|
37
|
-
|
|
38
31
|
return Col;
|
|
39
32
|
}(Component);
|
|
40
33
|
Col.template = template;
|
|
@@ -5,29 +5,24 @@ import { makeColStyles } from './styles';
|
|
|
5
5
|
import { context as GutterContext, gutterStyle } from './useGutter';
|
|
6
6
|
export default function ($props, $blocks, $__proto__) {
|
|
7
7
|
var _this = this;
|
|
8
|
-
|
|
9
8
|
$blocks || ($blocks = {});
|
|
10
9
|
$props || ($props = {});
|
|
11
10
|
var $this = this;
|
|
12
|
-
|
|
13
11
|
var _this$get = this.get(),
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
12
|
+
className = _this$get.className,
|
|
13
|
+
_children = _this$get.children,
|
|
14
|
+
span = _this$get.span,
|
|
15
|
+
style = _this$get.style,
|
|
16
|
+
offset = _this$get.offset,
|
|
17
|
+
push = _this$get.push,
|
|
18
|
+
pull = _this$get.pull,
|
|
19
|
+
order = _this$get.order;
|
|
23
20
|
return _$cc(GutterContext.Consumer, {
|
|
24
21
|
'children': function children(gutter) {
|
|
25
22
|
var _extends2, _$cn2;
|
|
26
|
-
|
|
27
23
|
var classNameObj = _extends((_extends2 = {
|
|
28
24
|
'k-col': true
|
|
29
25
|
}, _extends2["k-" + span] = span, _extends2["k-offset-" + offset] = offset, _extends2["k-pull-" + pull] = pull, _extends2["k-push-" + push] = push, _extends2["k-order-" + order] = order, _extends2[className] = className && !gutter, _extends2[makeColStyles()] = true, _extends2), _this.breakpoints.getBreakpointsClassName());
|
|
30
|
-
|
|
31
26
|
var newStyle = gutter ? gutterStyle(gutter, style, 'padding') : style;
|
|
32
27
|
return _$cv('div', _extends({
|
|
33
28
|
'className': _$cn(classNameObj)
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
1
|
+
export type Breakpoint = 'xxl' | 'xl' | 'lg' | 'md' | 'sm' | 'xs';
|
|
2
|
+
export type PrimitiveValue = string | number;
|
|
3
|
+
export type BreakpointValue = {
|
|
4
4
|
[key in Breakpoint]?: PrimitiveValue;
|
|
5
5
|
};
|
|
6
|
-
export
|
|
7
|
-
export
|
|
6
|
+
export type Value = PrimitiveValue | BreakpointValue;
|
|
7
|
+
export type BreakpointPropsValues<T extends string> = {
|
|
8
8
|
[key in T]?: PrimitiveValue;
|
|
9
9
|
};
|
|
10
|
-
export
|
|
10
|
+
export type BreakpointValues<T extends string> = {
|
|
11
11
|
[key in Breakpoint]?: PrimitiveValue | null | undefined | BreakpointPropsValues<T>;
|
|
12
12
|
};
|
|
13
13
|
export declare const Value: (ObjectConstructor | StringConstructor | NumberConstructor)[];
|
package/components/grid/row.js
CHANGED
|
@@ -11,21 +11,16 @@ var typeDefs = {
|
|
|
11
11
|
};
|
|
12
12
|
export var Row = /*#__PURE__*/function (_Component) {
|
|
13
13
|
_inheritsLoose(Row, _Component);
|
|
14
|
-
|
|
15
14
|
function Row() {
|
|
16
15
|
var _context;
|
|
17
|
-
|
|
18
16
|
var _this;
|
|
19
|
-
|
|
20
17
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
21
18
|
args[_key] = arguments[_key];
|
|
22
19
|
}
|
|
23
|
-
|
|
24
20
|
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context = [this]).call(_context, args)) || this;
|
|
25
21
|
_this.gutter = useGutter();
|
|
26
22
|
return _this;
|
|
27
23
|
}
|
|
28
|
-
|
|
29
24
|
return Row;
|
|
30
25
|
}(Component);
|
|
31
26
|
Row.template = template;
|
|
@@ -5,18 +5,15 @@ import { makeRowStyles } from './styles';
|
|
|
5
5
|
import { context as GutterContext, gutterStyle } from './useGutter';
|
|
6
6
|
export default function ($props, $blocks, $__proto__) {
|
|
7
7
|
var _classNameObj;
|
|
8
|
-
|
|
9
8
|
$blocks || ($blocks = {});
|
|
10
9
|
$props || ($props = {});
|
|
11
10
|
var $this = this;
|
|
12
|
-
|
|
13
11
|
var _this$get = this.get(),
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
className = _this$get.className,
|
|
13
|
+
children = _this$get.children,
|
|
14
|
+
style = _this$get.style,
|
|
15
|
+
justify = _this$get.justify,
|
|
16
|
+
align = _this$get.align;
|
|
20
17
|
var classNameObj = (_classNameObj = {
|
|
21
18
|
'k-row': true
|
|
22
19
|
}, _classNameObj["k-justify-" + justify] = justify, _classNameObj["k-align-" + align] = align, _classNameObj[className] = className, _classNameObj[makeRowStyles()] = true, _classNameObj);
|