@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
|
@@ -13,6 +13,7 @@ import { Component } from 'intact-vue-next';
|
|
|
13
13
|
import { Form, FormItem } from './';
|
|
14
14
|
import { Input } from '../input';
|
|
15
15
|
import { Select } from '../select';
|
|
16
|
+
|
|
16
17
|
RemoteDemo.prototype.validateUserName = function (value) {
|
|
17
18
|
// mock api
|
|
18
19
|
return new _Promise(function (resolve, reject) {
|
|
@@ -27,1115 +28,1337 @@ RemoteDemo.prototype.validateUserName = function (value) {
|
|
|
27
28
|
});
|
|
28
29
|
});
|
|
29
30
|
};
|
|
31
|
+
|
|
30
32
|
describe('Form', function () {
|
|
31
33
|
afterEach(function () {
|
|
32
34
|
return unmount();
|
|
33
35
|
});
|
|
34
36
|
it('validate', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
35
37
|
var _mount, instance, element, form, item, input;
|
|
38
|
+
|
|
36
39
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
37
|
-
while (1)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
40
|
+
while (1) {
|
|
41
|
+
switch (_context.prev = _context.next) {
|
|
42
|
+
case 0:
|
|
43
|
+
_mount = mount(BasicDemo, null, basicDemoData), instance = _mount[0], element = _mount[1];
|
|
44
|
+
form = instance.refs.form;
|
|
45
|
+
_context.next = 4;
|
|
46
|
+
return instance.handleSubmit();
|
|
47
|
+
|
|
48
|
+
case 4:
|
|
49
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
50
|
+
item = form.getFirstInvalidFormItem();
|
|
51
|
+
expect(item.get('label')).to.eql('Input');
|
|
52
|
+
instance.reset();
|
|
53
|
+
_context.next = 10;
|
|
54
|
+
return wait();
|
|
55
|
+
|
|
56
|
+
case 10:
|
|
57
|
+
expect(instance.get('model')).to.matchSnapshot(); // validate on focusout
|
|
58
|
+
|
|
59
|
+
input = element.querySelector('input');
|
|
60
|
+
dispatchEvent(input, 'focus');
|
|
61
|
+
_context.next = 15;
|
|
62
|
+
return wait();
|
|
63
|
+
|
|
64
|
+
case 15:
|
|
65
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
66
|
+
dispatchEvent(input, 'focusout');
|
|
67
|
+
_context.next = 19;
|
|
68
|
+
return wait();
|
|
69
|
+
|
|
70
|
+
case 19:
|
|
71
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
72
|
+
|
|
73
|
+
case 20:
|
|
74
|
+
case "end":
|
|
75
|
+
return _context.stop();
|
|
76
|
+
}
|
|
67
77
|
}
|
|
68
78
|
}, _callee);
|
|
69
79
|
})));
|
|
70
80
|
it('custom rules', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
71
81
|
var _mount2, instance, element, _Array$from, input, input1;
|
|
82
|
+
|
|
72
83
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
73
|
-
while (1)
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
84
|
+
while (1) {
|
|
85
|
+
switch (_context2.prev = _context2.next) {
|
|
86
|
+
case 0:
|
|
87
|
+
_mount2 = mount(CustomDemo), instance = _mount2[0], element = _mount2[1];
|
|
88
|
+
_Array$from = _Array$from2(element.querySelectorAll('input')), input = _Array$from[0], input1 = _Array$from[1];
|
|
89
|
+
instance.set('descriptions.0', '1');
|
|
90
|
+
dispatchEvent(input, 'focusout');
|
|
91
|
+
_context2.next = 6;
|
|
92
|
+
return wait(500);
|
|
93
|
+
|
|
94
|
+
case 6:
|
|
95
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
96
|
+
instance.set('descriptions.0', 'a');
|
|
97
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
98
|
+
instance.set('descriptions.1', 'a');
|
|
99
|
+
dispatchEvent(input1, 'focusout');
|
|
100
|
+
_context2.next = 13;
|
|
101
|
+
return wait(500);
|
|
102
|
+
|
|
103
|
+
case 13:
|
|
104
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
105
|
+
instance.set('descriptions.1', 'b');
|
|
106
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
107
|
+
|
|
108
|
+
case 16:
|
|
109
|
+
case "end":
|
|
110
|
+
return _context2.stop();
|
|
111
|
+
}
|
|
96
112
|
}
|
|
97
113
|
}, _callee2);
|
|
98
114
|
})));
|
|
99
115
|
it('validate when rules have changed', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
100
116
|
var _mount3, instance, element, form, res;
|
|
117
|
+
|
|
101
118
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
102
|
-
while (1)
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
119
|
+
while (1) {
|
|
120
|
+
switch (_context3.prev = _context3.next) {
|
|
121
|
+
case 0:
|
|
122
|
+
_mount3 = mount(VariableDemo), instance = _mount3[0], element = _mount3[1];
|
|
123
|
+
form = instance.refs.form;
|
|
124
|
+
_context3.next = 4;
|
|
125
|
+
return form.validate();
|
|
126
|
+
|
|
127
|
+
case 4:
|
|
128
|
+
res = _context3.sent;
|
|
129
|
+
expect(res).to.be.true;
|
|
130
|
+
instance.set('firstName', 'a');
|
|
131
|
+
_context3.next = 9;
|
|
132
|
+
return wait(500);
|
|
133
|
+
|
|
134
|
+
case 9:
|
|
135
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
136
|
+
instance.set('lastName', 'b');
|
|
137
|
+
_context3.next = 13;
|
|
138
|
+
return wait(500);
|
|
139
|
+
|
|
140
|
+
case 13:
|
|
141
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
142
|
+
|
|
143
|
+
case 14:
|
|
144
|
+
case "end":
|
|
145
|
+
return _context3.stop();
|
|
146
|
+
}
|
|
124
147
|
}
|
|
125
148
|
}, _callee3);
|
|
126
149
|
})));
|
|
127
150
|
it('validate asynchronously', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
128
151
|
var _mount4, i, element, form, res;
|
|
152
|
+
|
|
129
153
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
130
|
-
while (1)
|
|
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
|
-
|
|
154
|
+
while (1) {
|
|
155
|
+
switch (_context4.prev = _context4.next) {
|
|
156
|
+
case 0:
|
|
157
|
+
this.timeout(0);
|
|
158
|
+
_mount4 = mount(RemoteDemo), i = _mount4[0], element = _mount4[1];
|
|
159
|
+
form = i.refs.form;
|
|
160
|
+
i.set('userName', 'a');
|
|
161
|
+
_context4.next = 6;
|
|
162
|
+
return wait();
|
|
163
|
+
|
|
164
|
+
case 6:
|
|
165
|
+
_context4.next = 8;
|
|
166
|
+
return form.validate();
|
|
167
|
+
|
|
168
|
+
case 8:
|
|
169
|
+
res = _context4.sent;
|
|
170
|
+
expect(res).to.be.false;
|
|
171
|
+
_context4.next = 12;
|
|
172
|
+
return wait(500);
|
|
173
|
+
|
|
174
|
+
case 12:
|
|
175
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
176
|
+
i.set('userName', 'b');
|
|
177
|
+
_context4.next = 16;
|
|
178
|
+
return wait();
|
|
179
|
+
|
|
180
|
+
case 16:
|
|
181
|
+
_context4.next = 18;
|
|
182
|
+
return form.validate();
|
|
183
|
+
|
|
184
|
+
case 18:
|
|
185
|
+
res = _context4.sent;
|
|
186
|
+
expect(res).to.be.true;
|
|
187
|
+
_context4.next = 22;
|
|
188
|
+
return wait(500);
|
|
189
|
+
|
|
190
|
+
case 22:
|
|
191
|
+
expect(element.innerHTML).to.matchSnapshot();
|
|
192
|
+
|
|
193
|
+
case 23:
|
|
194
|
+
case "end":
|
|
195
|
+
return _context4.stop();
|
|
196
|
+
}
|
|
164
197
|
}
|
|
165
198
|
}, _callee4, this);
|
|
166
199
|
})));
|
|
167
200
|
it('should trigger submit event if form is valid', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
|
|
168
201
|
var _mount5, i, element, form, cb;
|
|
202
|
+
|
|
169
203
|
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
170
|
-
while (1)
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
204
|
+
while (1) {
|
|
205
|
+
switch (_context5.prev = _context5.next) {
|
|
206
|
+
case 0:
|
|
207
|
+
_mount5 = mount(RemoteDemo), i = _mount5[0], element = _mount5[1];
|
|
208
|
+
form = i.refs.form;
|
|
209
|
+
cb = sinon.spy();
|
|
210
|
+
form.on('submit', cb);
|
|
211
|
+
i.set('userName', 'a');
|
|
212
|
+
dispatchEvent(element, 'submit');
|
|
213
|
+
_context5.next = 8;
|
|
214
|
+
return wait(0);
|
|
215
|
+
|
|
216
|
+
case 8:
|
|
217
|
+
expect(cb.callCount).to.eql(0);
|
|
218
|
+
i.set('userName', 'b');
|
|
219
|
+
_context5.next = 12;
|
|
220
|
+
return wait();
|
|
221
|
+
|
|
222
|
+
case 12:
|
|
223
|
+
dispatchEvent(element, 'submit');
|
|
224
|
+
_context5.next = 15;
|
|
225
|
+
return wait(0);
|
|
226
|
+
|
|
227
|
+
case 15:
|
|
228
|
+
expect(cb.callCount).to.eql(1);
|
|
229
|
+
|
|
230
|
+
case 16:
|
|
231
|
+
case "end":
|
|
232
|
+
return _context5.stop();
|
|
233
|
+
}
|
|
194
234
|
}
|
|
195
235
|
}, _callee5);
|
|
196
236
|
})));
|
|
197
237
|
it('methods', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
|
|
198
238
|
var Demo, _mount6, i, el, form;
|
|
239
|
+
|
|
199
240
|
return _regeneratorRuntime.wrap(function _callee6$(_context7) {
|
|
200
|
-
while (1)
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
function
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
241
|
+
while (1) {
|
|
242
|
+
switch (_context7.prev = _context7.next) {
|
|
243
|
+
case 0:
|
|
244
|
+
this.timeout(0);
|
|
245
|
+
|
|
246
|
+
Demo = /*#__PURE__*/function (_Component) {
|
|
247
|
+
_inheritsLoose(Demo, _Component);
|
|
248
|
+
|
|
249
|
+
function Demo() {
|
|
250
|
+
var _context6;
|
|
251
|
+
|
|
252
|
+
var _this;
|
|
253
|
+
|
|
254
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
255
|
+
args[_key] = arguments[_key];
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
_this = _Component.call.apply(_Component, _concatInstanceProperty(_context6 = [this]).call(_context6, args)) || this;
|
|
259
|
+
_this.Form = Form;
|
|
260
|
+
_this.FormItem = FormItem;
|
|
261
|
+
return _this;
|
|
210
262
|
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
}
|
|
229
|
-
value
|
|
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
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
263
|
+
|
|
264
|
+
return Demo;
|
|
265
|
+
}(Component);
|
|
266
|
+
|
|
267
|
+
Demo.template = "\n const Form = this.Form;\n const FormItem = this.FormItem;\n <Form ref=\"form\">\n <FormItem value={this.get('value')} rules={this.get('rules')} />\n <FormItem value={this.get('value1')} rules={this.get('rules1')} />\n </Form>\n ";
|
|
268
|
+
_mount6 = mount(Demo), i = _mount6[0], el = _mount6[1];
|
|
269
|
+
form = i.refs.form;
|
|
270
|
+
_context7.next = 7;
|
|
271
|
+
return form.validate();
|
|
272
|
+
|
|
273
|
+
case 7:
|
|
274
|
+
// required
|
|
275
|
+
i.set({
|
|
276
|
+
rules: {
|
|
277
|
+
required: true
|
|
278
|
+
},
|
|
279
|
+
value: ''
|
|
280
|
+
});
|
|
281
|
+
i.set('value', ' ');
|
|
282
|
+
_context7.next = 11;
|
|
283
|
+
return wait();
|
|
284
|
+
|
|
285
|
+
case 11:
|
|
286
|
+
_context7.t0 = expect;
|
|
287
|
+
_context7.next = 14;
|
|
288
|
+
return form.validate();
|
|
289
|
+
|
|
290
|
+
case 14:
|
|
291
|
+
_context7.t1 = _context7.sent;
|
|
292
|
+
(0, _context7.t0)(_context7.t1).to.be.false;
|
|
293
|
+
i.set('value', ' 1 ');
|
|
294
|
+
_context7.next = 19;
|
|
295
|
+
return wait();
|
|
296
|
+
|
|
297
|
+
case 19:
|
|
298
|
+
_context7.t2 = expect;
|
|
299
|
+
_context7.next = 22;
|
|
300
|
+
return form.validate();
|
|
301
|
+
|
|
302
|
+
case 22:
|
|
303
|
+
_context7.t3 = _context7.sent;
|
|
304
|
+
(0, _context7.t2)(_context7.t3).to.be.true;
|
|
305
|
+
i.set('value', []);
|
|
306
|
+
_context7.next = 27;
|
|
307
|
+
return wait();
|
|
308
|
+
|
|
309
|
+
case 27:
|
|
310
|
+
_context7.t4 = expect;
|
|
311
|
+
_context7.next = 30;
|
|
312
|
+
return form.validate();
|
|
313
|
+
|
|
314
|
+
case 30:
|
|
315
|
+
_context7.t5 = _context7.sent;
|
|
316
|
+
(0, _context7.t4)(_context7.t5).to.be.false;
|
|
317
|
+
i.set('value', ['']);
|
|
318
|
+
_context7.next = 35;
|
|
319
|
+
return wait();
|
|
320
|
+
|
|
321
|
+
case 35:
|
|
322
|
+
_context7.t6 = expect;
|
|
323
|
+
_context7.next = 38;
|
|
324
|
+
return form.validate();
|
|
325
|
+
|
|
326
|
+
case 38:
|
|
327
|
+
_context7.t7 = _context7.sent;
|
|
328
|
+
(0, _context7.t6)(_context7.t7).to.be.true;
|
|
329
|
+
// digits
|
|
330
|
+
i.set({
|
|
331
|
+
rules: {
|
|
332
|
+
digits: true
|
|
333
|
+
},
|
|
334
|
+
value: ''
|
|
335
|
+
});
|
|
336
|
+
i.set('value', 'a');
|
|
337
|
+
_context7.next = 44;
|
|
338
|
+
return wait();
|
|
339
|
+
|
|
340
|
+
case 44:
|
|
341
|
+
_context7.t8 = expect;
|
|
342
|
+
_context7.next = 47;
|
|
343
|
+
return form.validate();
|
|
344
|
+
|
|
345
|
+
case 47:
|
|
346
|
+
_context7.t9 = _context7.sent;
|
|
347
|
+
(0, _context7.t8)(_context7.t9).to.be.false;
|
|
348
|
+
i.set('value', '1');
|
|
349
|
+
_context7.next = 52;
|
|
350
|
+
return wait();
|
|
351
|
+
|
|
352
|
+
case 52:
|
|
353
|
+
_context7.t10 = expect;
|
|
354
|
+
_context7.next = 55;
|
|
355
|
+
return form.validate();
|
|
356
|
+
|
|
357
|
+
case 55:
|
|
358
|
+
_context7.t11 = _context7.sent;
|
|
359
|
+
(0, _context7.t10)(_context7.t11).to.be.true;
|
|
360
|
+
i.set('value', '1.1');
|
|
361
|
+
_context7.next = 60;
|
|
362
|
+
return wait();
|
|
363
|
+
|
|
364
|
+
case 60:
|
|
365
|
+
_context7.t12 = expect;
|
|
366
|
+
_context7.next = 63;
|
|
367
|
+
return form.validate();
|
|
368
|
+
|
|
369
|
+
case 63:
|
|
370
|
+
_context7.t13 = _context7.sent;
|
|
371
|
+
(0, _context7.t12)(_context7.t13).to.be.false;
|
|
372
|
+
// email
|
|
373
|
+
i.set({
|
|
374
|
+
rules: {
|
|
375
|
+
email: true
|
|
376
|
+
},
|
|
377
|
+
value: ''
|
|
378
|
+
});
|
|
379
|
+
i.set('value', 'a@b');
|
|
380
|
+
_context7.next = 69;
|
|
381
|
+
return wait();
|
|
382
|
+
|
|
383
|
+
case 69:
|
|
384
|
+
_context7.t14 = expect;
|
|
385
|
+
_context7.next = 72;
|
|
386
|
+
return form.validate();
|
|
387
|
+
|
|
388
|
+
case 72:
|
|
389
|
+
_context7.t15 = _context7.sent;
|
|
390
|
+
(0, _context7.t14)(_context7.t15).to.be.true;
|
|
391
|
+
i.set('value', 'a@b.c');
|
|
392
|
+
_context7.next = 77;
|
|
393
|
+
return wait();
|
|
394
|
+
|
|
395
|
+
case 77:
|
|
396
|
+
_context7.t16 = expect;
|
|
397
|
+
_context7.next = 80;
|
|
398
|
+
return form.validate();
|
|
399
|
+
|
|
400
|
+
case 80:
|
|
401
|
+
_context7.t17 = _context7.sent;
|
|
402
|
+
(0, _context7.t16)(_context7.t17).to.be.true;
|
|
403
|
+
i.set('value', 'a@');
|
|
404
|
+
_context7.next = 85;
|
|
405
|
+
return wait();
|
|
406
|
+
|
|
407
|
+
case 85:
|
|
408
|
+
_context7.t18 = expect;
|
|
409
|
+
_context7.next = 88;
|
|
410
|
+
return form.validate();
|
|
411
|
+
|
|
412
|
+
case 88:
|
|
413
|
+
_context7.t19 = _context7.sent;
|
|
414
|
+
(0, _context7.t18)(_context7.t19).to.be.false;
|
|
415
|
+
// url
|
|
416
|
+
i.set({
|
|
417
|
+
rules: {
|
|
418
|
+
url: true
|
|
419
|
+
},
|
|
420
|
+
value: ''
|
|
421
|
+
});
|
|
422
|
+
i.set('value', 'http://www.a.com');
|
|
423
|
+
_context7.next = 94;
|
|
424
|
+
return wait();
|
|
425
|
+
|
|
426
|
+
case 94:
|
|
427
|
+
_context7.t20 = expect;
|
|
428
|
+
_context7.next = 97;
|
|
429
|
+
return form.validate();
|
|
430
|
+
|
|
431
|
+
case 97:
|
|
432
|
+
_context7.t21 = _context7.sent;
|
|
433
|
+
(0, _context7.t20)(_context7.t21).to.be.true;
|
|
434
|
+
i.set('value', 'https://a.com');
|
|
435
|
+
_context7.next = 102;
|
|
436
|
+
return wait();
|
|
437
|
+
|
|
438
|
+
case 102:
|
|
439
|
+
_context7.t22 = expect;
|
|
440
|
+
_context7.next = 105;
|
|
441
|
+
return form.validate();
|
|
442
|
+
|
|
443
|
+
case 105:
|
|
444
|
+
_context7.t23 = _context7.sent;
|
|
445
|
+
(0, _context7.t22)(_context7.t23).to.be.true;
|
|
446
|
+
i.set('value', 'ftp://a.com');
|
|
447
|
+
_context7.next = 110;
|
|
448
|
+
return wait();
|
|
449
|
+
|
|
450
|
+
case 110:
|
|
451
|
+
_context7.t24 = expect;
|
|
452
|
+
_context7.next = 113;
|
|
453
|
+
return form.validate();
|
|
454
|
+
|
|
455
|
+
case 113:
|
|
456
|
+
_context7.t25 = _context7.sent;
|
|
457
|
+
(0, _context7.t24)(_context7.t25).to.be.true;
|
|
458
|
+
i.set('value', 'http://www.a.com/a?b=c');
|
|
459
|
+
_context7.next = 118;
|
|
460
|
+
return wait();
|
|
461
|
+
|
|
462
|
+
case 118:
|
|
463
|
+
_context7.t26 = expect;
|
|
464
|
+
_context7.next = 121;
|
|
465
|
+
return form.validate();
|
|
466
|
+
|
|
467
|
+
case 121:
|
|
468
|
+
_context7.t27 = _context7.sent;
|
|
469
|
+
(0, _context7.t26)(_context7.t27).to.be.true;
|
|
470
|
+
i.set('value', 'a.com');
|
|
471
|
+
_context7.next = 126;
|
|
472
|
+
return wait();
|
|
473
|
+
|
|
474
|
+
case 126:
|
|
475
|
+
_context7.t28 = expect;
|
|
476
|
+
_context7.next = 129;
|
|
477
|
+
return form.validate();
|
|
478
|
+
|
|
479
|
+
case 129:
|
|
480
|
+
_context7.t29 = _context7.sent;
|
|
481
|
+
(0, _context7.t28)(_context7.t29).to.be.false;
|
|
482
|
+
i.set('value', 'a');
|
|
483
|
+
_context7.next = 134;
|
|
484
|
+
return wait();
|
|
485
|
+
|
|
486
|
+
case 134:
|
|
487
|
+
_context7.t30 = expect;
|
|
488
|
+
_context7.next = 137;
|
|
489
|
+
return form.validate();
|
|
490
|
+
|
|
491
|
+
case 137:
|
|
492
|
+
_context7.t31 = _context7.sent;
|
|
493
|
+
(0, _context7.t30)(_context7.t31).to.be.false;
|
|
494
|
+
// date
|
|
495
|
+
i.set({
|
|
496
|
+
rules: {
|
|
497
|
+
date: true
|
|
498
|
+
},
|
|
499
|
+
value: ''
|
|
500
|
+
});
|
|
501
|
+
i.set('value', '2018-01-01');
|
|
502
|
+
_context7.next = 143;
|
|
503
|
+
return wait();
|
|
504
|
+
|
|
505
|
+
case 143:
|
|
506
|
+
_context7.t32 = expect;
|
|
507
|
+
_context7.next = 146;
|
|
508
|
+
return form.validate();
|
|
509
|
+
|
|
510
|
+
case 146:
|
|
511
|
+
_context7.t33 = _context7.sent;
|
|
512
|
+
(0, _context7.t32)(_context7.t33).to.be.true;
|
|
513
|
+
i.set('value', '2018/01/01');
|
|
514
|
+
_context7.next = 151;
|
|
515
|
+
return wait();
|
|
516
|
+
|
|
517
|
+
case 151:
|
|
518
|
+
_context7.t34 = expect;
|
|
519
|
+
_context7.next = 154;
|
|
520
|
+
return form.validate();
|
|
521
|
+
|
|
522
|
+
case 154:
|
|
523
|
+
_context7.t35 = _context7.sent;
|
|
524
|
+
(0, _context7.t34)(_context7.t35).to.be.true;
|
|
525
|
+
i.set('value', '2018/01/01 01:01:01');
|
|
526
|
+
_context7.next = 159;
|
|
527
|
+
return wait();
|
|
528
|
+
|
|
529
|
+
case 159:
|
|
530
|
+
_context7.t36 = expect;
|
|
531
|
+
_context7.next = 162;
|
|
532
|
+
return form.validate();
|
|
533
|
+
|
|
534
|
+
case 162:
|
|
535
|
+
_context7.t37 = _context7.sent;
|
|
536
|
+
(0, _context7.t36)(_context7.t37).to.be.true;
|
|
537
|
+
i.set('value', '20180101');
|
|
538
|
+
_context7.next = 167;
|
|
539
|
+
return wait();
|
|
540
|
+
|
|
541
|
+
case 167:
|
|
542
|
+
_context7.t38 = expect;
|
|
543
|
+
_context7.next = 170;
|
|
544
|
+
return form.validate();
|
|
545
|
+
|
|
546
|
+
case 170:
|
|
547
|
+
_context7.t39 = _context7.sent;
|
|
548
|
+
(0, _context7.t38)(_context7.t39).to.be.false;
|
|
549
|
+
// dateISO
|
|
550
|
+
i.set({
|
|
551
|
+
rules: {
|
|
552
|
+
dateISO: true
|
|
553
|
+
},
|
|
554
|
+
value: ''
|
|
555
|
+
});
|
|
556
|
+
i.set('value', '20180101');
|
|
557
|
+
_context7.next = 176;
|
|
558
|
+
return wait();
|
|
559
|
+
|
|
560
|
+
case 176:
|
|
561
|
+
_context7.t40 = expect;
|
|
562
|
+
_context7.next = 179;
|
|
563
|
+
return form.validate();
|
|
564
|
+
|
|
565
|
+
case 179:
|
|
566
|
+
_context7.t41 = _context7.sent;
|
|
567
|
+
(0, _context7.t40)(_context7.t41).to.be.false;
|
|
568
|
+
i.set('value', '2018/01/01');
|
|
569
|
+
_context7.next = 184;
|
|
570
|
+
return wait();
|
|
571
|
+
|
|
572
|
+
case 184:
|
|
573
|
+
_context7.t42 = expect;
|
|
574
|
+
_context7.next = 187;
|
|
575
|
+
return form.validate();
|
|
576
|
+
|
|
577
|
+
case 187:
|
|
578
|
+
_context7.t43 = _context7.sent;
|
|
579
|
+
(0, _context7.t42)(_context7.t43).to.be.true;
|
|
580
|
+
i.set('value', '2018-01-01');
|
|
581
|
+
_context7.next = 192;
|
|
582
|
+
return wait();
|
|
583
|
+
|
|
584
|
+
case 192:
|
|
585
|
+
_context7.t44 = expect;
|
|
586
|
+
_context7.next = 195;
|
|
587
|
+
return form.validate();
|
|
588
|
+
|
|
589
|
+
case 195:
|
|
590
|
+
_context7.t45 = _context7.sent;
|
|
591
|
+
(0, _context7.t44)(_context7.t45).to.be.true;
|
|
592
|
+
// number
|
|
593
|
+
i.set({
|
|
594
|
+
rules: {
|
|
595
|
+
number: true
|
|
596
|
+
},
|
|
597
|
+
value: ''
|
|
598
|
+
});
|
|
599
|
+
i.set('value', '1');
|
|
600
|
+
_context7.next = 201;
|
|
601
|
+
return wait();
|
|
602
|
+
|
|
603
|
+
case 201:
|
|
604
|
+
_context7.t46 = expect;
|
|
605
|
+
_context7.next = 204;
|
|
606
|
+
return form.validate();
|
|
607
|
+
|
|
608
|
+
case 204:
|
|
609
|
+
_context7.t47 = _context7.sent;
|
|
610
|
+
(0, _context7.t46)(_context7.t47).to.be.true;
|
|
611
|
+
i.set('value', '1.1');
|
|
612
|
+
_context7.next = 209;
|
|
613
|
+
return wait();
|
|
614
|
+
|
|
615
|
+
case 209:
|
|
616
|
+
_context7.t48 = expect;
|
|
617
|
+
_context7.next = 212;
|
|
618
|
+
return form.validate();
|
|
619
|
+
|
|
620
|
+
case 212:
|
|
621
|
+
_context7.t49 = _context7.sent;
|
|
622
|
+
(0, _context7.t48)(_context7.t49).to.be.true;
|
|
623
|
+
i.set('value', '-1.1');
|
|
624
|
+
_context7.next = 217;
|
|
625
|
+
return wait();
|
|
626
|
+
|
|
627
|
+
case 217:
|
|
628
|
+
_context7.t50 = expect;
|
|
629
|
+
_context7.next = 220;
|
|
630
|
+
return form.validate();
|
|
631
|
+
|
|
632
|
+
case 220:
|
|
633
|
+
_context7.t51 = _context7.sent;
|
|
634
|
+
(0, _context7.t50)(_context7.t51).to.be.true;
|
|
635
|
+
i.set('value', '-1');
|
|
636
|
+
_context7.next = 225;
|
|
637
|
+
return wait();
|
|
638
|
+
|
|
639
|
+
case 225:
|
|
640
|
+
_context7.t52 = expect;
|
|
641
|
+
_context7.next = 228;
|
|
642
|
+
return form.validate();
|
|
643
|
+
|
|
644
|
+
case 228:
|
|
645
|
+
_context7.t53 = _context7.sent;
|
|
646
|
+
(0, _context7.t52)(_context7.t53).to.be.true;
|
|
647
|
+
i.set('value', '1a');
|
|
648
|
+
_context7.next = 233;
|
|
649
|
+
return wait();
|
|
650
|
+
|
|
651
|
+
case 233:
|
|
652
|
+
_context7.t54 = expect;
|
|
653
|
+
_context7.next = 236;
|
|
654
|
+
return form.validate();
|
|
655
|
+
|
|
656
|
+
case 236:
|
|
657
|
+
_context7.t55 = _context7.sent;
|
|
658
|
+
(0, _context7.t54)(_context7.t55).to.be.false;
|
|
659
|
+
// minLength
|
|
660
|
+
i.set({
|
|
661
|
+
rules: {
|
|
662
|
+
minLength: 2
|
|
663
|
+
},
|
|
664
|
+
value: ''
|
|
665
|
+
});
|
|
666
|
+
i.set('value', 'a');
|
|
667
|
+
_context7.next = 242;
|
|
668
|
+
return wait();
|
|
669
|
+
|
|
670
|
+
case 242:
|
|
671
|
+
_context7.t56 = expect;
|
|
672
|
+
_context7.next = 245;
|
|
673
|
+
return form.validate();
|
|
674
|
+
|
|
675
|
+
case 245:
|
|
676
|
+
_context7.t57 = _context7.sent;
|
|
677
|
+
(0, _context7.t56)(_context7.t57).to.be.false;
|
|
678
|
+
i.set('value', 'aa');
|
|
679
|
+
_context7.next = 250;
|
|
680
|
+
return wait();
|
|
681
|
+
|
|
682
|
+
case 250:
|
|
683
|
+
_context7.t58 = expect;
|
|
684
|
+
_context7.next = 253;
|
|
685
|
+
return form.validate();
|
|
686
|
+
|
|
687
|
+
case 253:
|
|
688
|
+
_context7.t59 = _context7.sent;
|
|
689
|
+
(0, _context7.t58)(_context7.t59).to.be.true;
|
|
690
|
+
i.set('value', 'aaa');
|
|
691
|
+
_context7.next = 258;
|
|
692
|
+
return wait();
|
|
693
|
+
|
|
694
|
+
case 258:
|
|
695
|
+
_context7.t60 = expect;
|
|
696
|
+
_context7.next = 261;
|
|
697
|
+
return form.validate();
|
|
698
|
+
|
|
699
|
+
case 261:
|
|
700
|
+
_context7.t61 = _context7.sent;
|
|
701
|
+
(0, _context7.t60)(_context7.t61).to.be.true;
|
|
702
|
+
i.set('value', ['a']);
|
|
703
|
+
_context7.next = 266;
|
|
704
|
+
return wait();
|
|
705
|
+
|
|
706
|
+
case 266:
|
|
707
|
+
_context7.t62 = expect;
|
|
708
|
+
_context7.next = 269;
|
|
709
|
+
return form.validate();
|
|
710
|
+
|
|
711
|
+
case 269:
|
|
712
|
+
_context7.t63 = _context7.sent;
|
|
713
|
+
(0, _context7.t62)(_context7.t63).to.be.false;
|
|
714
|
+
i.set('value', ['a', 'a']);
|
|
715
|
+
_context7.next = 274;
|
|
716
|
+
return wait();
|
|
717
|
+
|
|
718
|
+
case 274:
|
|
719
|
+
_context7.t64 = expect;
|
|
720
|
+
_context7.next = 277;
|
|
721
|
+
return form.validate();
|
|
722
|
+
|
|
723
|
+
case 277:
|
|
724
|
+
_context7.t65 = _context7.sent;
|
|
725
|
+
(0, _context7.t64)(_context7.t65).to.be.true;
|
|
726
|
+
i.set('value', ['a', 'a', 'a']);
|
|
727
|
+
_context7.next = 282;
|
|
728
|
+
return wait();
|
|
729
|
+
|
|
730
|
+
case 282:
|
|
731
|
+
_context7.t66 = expect;
|
|
732
|
+
_context7.next = 285;
|
|
733
|
+
return form.validate();
|
|
734
|
+
|
|
735
|
+
case 285:
|
|
736
|
+
_context7.t67 = _context7.sent;
|
|
737
|
+
(0, _context7.t66)(_context7.t67).to.be.true;
|
|
738
|
+
i.set('value', 1);
|
|
739
|
+
_context7.next = 290;
|
|
740
|
+
return wait();
|
|
741
|
+
|
|
742
|
+
case 290:
|
|
743
|
+
_context7.t68 = expect;
|
|
744
|
+
_context7.next = 293;
|
|
745
|
+
return form.validate();
|
|
746
|
+
|
|
747
|
+
case 293:
|
|
748
|
+
_context7.t69 = _context7.sent;
|
|
749
|
+
(0, _context7.t68)(_context7.t69).to.be.false;
|
|
750
|
+
i.set('value', 11);
|
|
751
|
+
_context7.next = 298;
|
|
752
|
+
return wait();
|
|
753
|
+
|
|
754
|
+
case 298:
|
|
755
|
+
_context7.t70 = expect;
|
|
756
|
+
_context7.next = 301;
|
|
757
|
+
return form.validate();
|
|
758
|
+
|
|
759
|
+
case 301:
|
|
760
|
+
_context7.t71 = _context7.sent;
|
|
761
|
+
(0, _context7.t70)(_context7.t71).to.be.true;
|
|
762
|
+
// maxLength
|
|
763
|
+
i.set({
|
|
764
|
+
rules: {
|
|
765
|
+
maxLength: 2
|
|
766
|
+
},
|
|
767
|
+
value: ''
|
|
768
|
+
});
|
|
769
|
+
i.set('value', 'a');
|
|
770
|
+
_context7.next = 307;
|
|
771
|
+
return wait();
|
|
772
|
+
|
|
773
|
+
case 307:
|
|
774
|
+
_context7.t72 = expect;
|
|
775
|
+
_context7.next = 310;
|
|
776
|
+
return form.validate();
|
|
777
|
+
|
|
778
|
+
case 310:
|
|
779
|
+
_context7.t73 = _context7.sent;
|
|
780
|
+
(0, _context7.t72)(_context7.t73).to.be.true;
|
|
781
|
+
i.set('value', 'aa');
|
|
782
|
+
_context7.next = 315;
|
|
783
|
+
return wait();
|
|
784
|
+
|
|
785
|
+
case 315:
|
|
786
|
+
_context7.t74 = expect;
|
|
787
|
+
_context7.next = 318;
|
|
788
|
+
return form.validate();
|
|
789
|
+
|
|
790
|
+
case 318:
|
|
791
|
+
_context7.t75 = _context7.sent;
|
|
792
|
+
(0, _context7.t74)(_context7.t75).to.be.true;
|
|
793
|
+
i.set('value', 'aaa');
|
|
794
|
+
_context7.next = 323;
|
|
795
|
+
return wait();
|
|
796
|
+
|
|
797
|
+
case 323:
|
|
798
|
+
_context7.t76 = expect;
|
|
799
|
+
_context7.next = 326;
|
|
800
|
+
return form.validate();
|
|
801
|
+
|
|
802
|
+
case 326:
|
|
803
|
+
_context7.t77 = _context7.sent;
|
|
804
|
+
(0, _context7.t76)(_context7.t77).to.be.false;
|
|
805
|
+
i.set('value', ['a']);
|
|
806
|
+
_context7.next = 331;
|
|
807
|
+
return wait();
|
|
808
|
+
|
|
809
|
+
case 331:
|
|
810
|
+
_context7.t78 = expect;
|
|
811
|
+
_context7.next = 334;
|
|
812
|
+
return form.validate();
|
|
813
|
+
|
|
814
|
+
case 334:
|
|
815
|
+
_context7.t79 = _context7.sent;
|
|
816
|
+
(0, _context7.t78)(_context7.t79).to.be.true;
|
|
817
|
+
i.set('value', ['a', 'a']);
|
|
818
|
+
_context7.next = 339;
|
|
819
|
+
return wait();
|
|
820
|
+
|
|
821
|
+
case 339:
|
|
822
|
+
_context7.t80 = expect;
|
|
823
|
+
_context7.next = 342;
|
|
824
|
+
return form.validate();
|
|
825
|
+
|
|
826
|
+
case 342:
|
|
827
|
+
_context7.t81 = _context7.sent;
|
|
828
|
+
(0, _context7.t80)(_context7.t81).to.be.true;
|
|
829
|
+
i.set('value', ['a', 'a', 'a']);
|
|
830
|
+
_context7.next = 347;
|
|
831
|
+
return wait();
|
|
832
|
+
|
|
833
|
+
case 347:
|
|
834
|
+
_context7.t82 = expect;
|
|
835
|
+
_context7.next = 350;
|
|
836
|
+
return form.validate();
|
|
837
|
+
|
|
838
|
+
case 350:
|
|
839
|
+
_context7.t83 = _context7.sent;
|
|
840
|
+
(0, _context7.t82)(_context7.t83).to.be.false;
|
|
841
|
+
i.set('value', 1);
|
|
842
|
+
_context7.next = 355;
|
|
843
|
+
return wait();
|
|
844
|
+
|
|
845
|
+
case 355:
|
|
846
|
+
_context7.t84 = expect;
|
|
847
|
+
_context7.next = 358;
|
|
848
|
+
return form.validate();
|
|
849
|
+
|
|
850
|
+
case 358:
|
|
851
|
+
_context7.t85 = _context7.sent;
|
|
852
|
+
(0, _context7.t84)(_context7.t85).to.be.true;
|
|
853
|
+
i.set('value', 111);
|
|
854
|
+
_context7.next = 363;
|
|
855
|
+
return wait();
|
|
856
|
+
|
|
857
|
+
case 363:
|
|
858
|
+
_context7.t86 = expect;
|
|
859
|
+
_context7.next = 366;
|
|
860
|
+
return form.validate();
|
|
861
|
+
|
|
862
|
+
case 366:
|
|
863
|
+
_context7.t87 = _context7.sent;
|
|
864
|
+
(0, _context7.t86)(_context7.t87).to.be.false;
|
|
865
|
+
// rangeLength
|
|
866
|
+
i.set({
|
|
867
|
+
rules: {
|
|
868
|
+
rangeLength: [1, '2']
|
|
869
|
+
},
|
|
870
|
+
value: ''
|
|
871
|
+
});
|
|
872
|
+
i.set('value', 'a');
|
|
873
|
+
_context7.next = 372;
|
|
874
|
+
return wait();
|
|
875
|
+
|
|
876
|
+
case 372:
|
|
877
|
+
_context7.t88 = expect;
|
|
878
|
+
_context7.next = 375;
|
|
879
|
+
return form.validate();
|
|
880
|
+
|
|
881
|
+
case 375:
|
|
882
|
+
_context7.t89 = _context7.sent;
|
|
883
|
+
(0, _context7.t88)(_context7.t89).to.be.true;
|
|
884
|
+
i.set('value', 'aa');
|
|
885
|
+
_context7.next = 380;
|
|
886
|
+
return wait();
|
|
887
|
+
|
|
888
|
+
case 380:
|
|
889
|
+
_context7.t90 = expect;
|
|
890
|
+
_context7.next = 383;
|
|
891
|
+
return form.validate();
|
|
892
|
+
|
|
893
|
+
case 383:
|
|
894
|
+
_context7.t91 = _context7.sent;
|
|
895
|
+
(0, _context7.t90)(_context7.t91).to.be.true;
|
|
896
|
+
i.set('value', 'aaa');
|
|
897
|
+
_context7.next = 388;
|
|
898
|
+
return wait();
|
|
899
|
+
|
|
900
|
+
case 388:
|
|
901
|
+
_context7.t92 = expect;
|
|
902
|
+
_context7.next = 391;
|
|
903
|
+
return form.validate();
|
|
904
|
+
|
|
905
|
+
case 391:
|
|
906
|
+
_context7.t93 = _context7.sent;
|
|
907
|
+
(0, _context7.t92)(_context7.t93).to.be.false;
|
|
908
|
+
i.set('value', ['a']);
|
|
909
|
+
_context7.next = 396;
|
|
910
|
+
return wait();
|
|
911
|
+
|
|
912
|
+
case 396:
|
|
913
|
+
_context7.t94 = expect;
|
|
914
|
+
_context7.next = 399;
|
|
915
|
+
return form.validate();
|
|
916
|
+
|
|
917
|
+
case 399:
|
|
918
|
+
_context7.t95 = _context7.sent;
|
|
919
|
+
(0, _context7.t94)(_context7.t95).to.be.true;
|
|
920
|
+
i.set('value', ['a', 'a']);
|
|
921
|
+
_context7.next = 404;
|
|
922
|
+
return wait();
|
|
923
|
+
|
|
924
|
+
case 404:
|
|
925
|
+
_context7.t96 = expect;
|
|
926
|
+
_context7.next = 407;
|
|
927
|
+
return form.validate();
|
|
928
|
+
|
|
929
|
+
case 407:
|
|
930
|
+
_context7.t97 = _context7.sent;
|
|
931
|
+
(0, _context7.t96)(_context7.t97).to.be.true;
|
|
932
|
+
i.set('value', ['a', 'a', 'a']);
|
|
933
|
+
_context7.next = 412;
|
|
934
|
+
return wait();
|
|
935
|
+
|
|
936
|
+
case 412:
|
|
937
|
+
_context7.t98 = expect;
|
|
938
|
+
_context7.next = 415;
|
|
939
|
+
return form.validate();
|
|
940
|
+
|
|
941
|
+
case 415:
|
|
942
|
+
_context7.t99 = _context7.sent;
|
|
943
|
+
(0, _context7.t98)(_context7.t99).to.be.false;
|
|
944
|
+
i.set('value', 1);
|
|
945
|
+
_context7.next = 420;
|
|
946
|
+
return wait();
|
|
947
|
+
|
|
948
|
+
case 420:
|
|
949
|
+
_context7.t100 = expect;
|
|
950
|
+
_context7.next = 423;
|
|
951
|
+
return form.validate();
|
|
952
|
+
|
|
953
|
+
case 423:
|
|
954
|
+
_context7.t101 = _context7.sent;
|
|
955
|
+
(0, _context7.t100)(_context7.t101).to.be.true;
|
|
956
|
+
i.set('value', 11);
|
|
957
|
+
_context7.next = 428;
|
|
958
|
+
return wait();
|
|
959
|
+
|
|
960
|
+
case 428:
|
|
961
|
+
_context7.t102 = expect;
|
|
962
|
+
_context7.next = 431;
|
|
963
|
+
return form.validate();
|
|
964
|
+
|
|
965
|
+
case 431:
|
|
966
|
+
_context7.t103 = _context7.sent;
|
|
967
|
+
(0, _context7.t102)(_context7.t103).to.be.true;
|
|
968
|
+
i.set('value', 111);
|
|
969
|
+
_context7.next = 436;
|
|
970
|
+
return wait();
|
|
971
|
+
|
|
972
|
+
case 436:
|
|
973
|
+
_context7.t104 = expect;
|
|
974
|
+
_context7.next = 439;
|
|
975
|
+
return form.validate();
|
|
976
|
+
|
|
977
|
+
case 439:
|
|
978
|
+
_context7.t105 = _context7.sent;
|
|
979
|
+
(0, _context7.t104)(_context7.t105).to.be.false;
|
|
980
|
+
// min
|
|
981
|
+
i.set({
|
|
982
|
+
rules: {
|
|
983
|
+
min: 0
|
|
984
|
+
},
|
|
985
|
+
value: ''
|
|
986
|
+
});
|
|
987
|
+
i.set('value', -1);
|
|
988
|
+
_context7.next = 445;
|
|
989
|
+
return wait();
|
|
990
|
+
|
|
991
|
+
case 445:
|
|
992
|
+
_context7.t106 = expect;
|
|
993
|
+
_context7.next = 448;
|
|
994
|
+
return form.validate();
|
|
995
|
+
|
|
996
|
+
case 448:
|
|
997
|
+
_context7.t107 = _context7.sent;
|
|
998
|
+
(0, _context7.t106)(_context7.t107).to.be.false;
|
|
999
|
+
i.set('value', 0);
|
|
1000
|
+
_context7.next = 453;
|
|
1001
|
+
return wait();
|
|
1002
|
+
|
|
1003
|
+
case 453:
|
|
1004
|
+
_context7.t108 = expect;
|
|
1005
|
+
_context7.next = 456;
|
|
1006
|
+
return form.validate();
|
|
1007
|
+
|
|
1008
|
+
case 456:
|
|
1009
|
+
_context7.t109 = _context7.sent;
|
|
1010
|
+
(0, _context7.t108)(_context7.t109).to.be.true;
|
|
1011
|
+
i.set('value', 1);
|
|
1012
|
+
_context7.next = 461;
|
|
1013
|
+
return wait();
|
|
1014
|
+
|
|
1015
|
+
case 461:
|
|
1016
|
+
_context7.t110 = expect;
|
|
1017
|
+
_context7.next = 464;
|
|
1018
|
+
return form.validate();
|
|
1019
|
+
|
|
1020
|
+
case 464:
|
|
1021
|
+
_context7.t111 = _context7.sent;
|
|
1022
|
+
(0, _context7.t110)(_context7.t111).to.be.true;
|
|
1023
|
+
// max
|
|
1024
|
+
i.set({
|
|
1025
|
+
rules: {
|
|
1026
|
+
max: 0
|
|
1027
|
+
},
|
|
1028
|
+
value: ''
|
|
1029
|
+
});
|
|
1030
|
+
i.set('value', -1);
|
|
1031
|
+
_context7.next = 470;
|
|
1032
|
+
return wait();
|
|
1033
|
+
|
|
1034
|
+
case 470:
|
|
1035
|
+
_context7.t112 = expect;
|
|
1036
|
+
_context7.next = 473;
|
|
1037
|
+
return form.validate();
|
|
1038
|
+
|
|
1039
|
+
case 473:
|
|
1040
|
+
_context7.t113 = _context7.sent;
|
|
1041
|
+
(0, _context7.t112)(_context7.t113).to.be.true;
|
|
1042
|
+
i.set('value', 0);
|
|
1043
|
+
_context7.next = 478;
|
|
1044
|
+
return wait();
|
|
1045
|
+
|
|
1046
|
+
case 478:
|
|
1047
|
+
_context7.t114 = expect;
|
|
1048
|
+
_context7.next = 481;
|
|
1049
|
+
return form.validate();
|
|
1050
|
+
|
|
1051
|
+
case 481:
|
|
1052
|
+
_context7.t115 = _context7.sent;
|
|
1053
|
+
(0, _context7.t114)(_context7.t115).to.be.true;
|
|
1054
|
+
i.set('value', 1);
|
|
1055
|
+
_context7.next = 486;
|
|
1056
|
+
return wait();
|
|
1057
|
+
|
|
1058
|
+
case 486:
|
|
1059
|
+
_context7.t116 = expect;
|
|
1060
|
+
_context7.next = 489;
|
|
1061
|
+
return form.validate();
|
|
1062
|
+
|
|
1063
|
+
case 489:
|
|
1064
|
+
_context7.t117 = _context7.sent;
|
|
1065
|
+
(0, _context7.t116)(_context7.t117).to.be.false;
|
|
1066
|
+
// range
|
|
1067
|
+
i.set({
|
|
1068
|
+
rules: {
|
|
1069
|
+
range: [-1, 0]
|
|
1070
|
+
},
|
|
1071
|
+
value: ''
|
|
1072
|
+
});
|
|
1073
|
+
i.set('value', -2);
|
|
1074
|
+
_context7.next = 495;
|
|
1075
|
+
return wait();
|
|
1076
|
+
|
|
1077
|
+
case 495:
|
|
1078
|
+
_context7.t118 = expect;
|
|
1079
|
+
_context7.next = 498;
|
|
1080
|
+
return form.validate();
|
|
1081
|
+
|
|
1082
|
+
case 498:
|
|
1083
|
+
_context7.t119 = _context7.sent;
|
|
1084
|
+
(0, _context7.t118)(_context7.t119).to.be.false;
|
|
1085
|
+
i.set('value', -1);
|
|
1086
|
+
_context7.next = 503;
|
|
1087
|
+
return wait();
|
|
1088
|
+
|
|
1089
|
+
case 503:
|
|
1090
|
+
_context7.t120 = expect;
|
|
1091
|
+
_context7.next = 506;
|
|
1092
|
+
return form.validate();
|
|
1093
|
+
|
|
1094
|
+
case 506:
|
|
1095
|
+
_context7.t121 = _context7.sent;
|
|
1096
|
+
(0, _context7.t120)(_context7.t121).to.be.true;
|
|
1097
|
+
i.set('value', 0);
|
|
1098
|
+
_context7.next = 511;
|
|
1099
|
+
return wait();
|
|
1100
|
+
|
|
1101
|
+
case 511:
|
|
1102
|
+
_context7.t122 = expect;
|
|
1103
|
+
_context7.next = 514;
|
|
1104
|
+
return form.validate();
|
|
1105
|
+
|
|
1106
|
+
case 514:
|
|
1107
|
+
_context7.t123 = _context7.sent;
|
|
1108
|
+
(0, _context7.t122)(_context7.t123).to.be.true;
|
|
1109
|
+
i.set('value', 1);
|
|
1110
|
+
_context7.next = 519;
|
|
1111
|
+
return wait();
|
|
1112
|
+
|
|
1113
|
+
case 519:
|
|
1114
|
+
_context7.t124 = expect;
|
|
1115
|
+
_context7.next = 522;
|
|
1116
|
+
return form.validate();
|
|
1117
|
+
|
|
1118
|
+
case 522:
|
|
1119
|
+
_context7.t125 = _context7.sent;
|
|
1120
|
+
(0, _context7.t124)(_context7.t125).to.be.false;
|
|
1121
|
+
// step
|
|
1122
|
+
i.set({
|
|
1123
|
+
rules: {
|
|
1124
|
+
step: 0.3
|
|
1125
|
+
},
|
|
1126
|
+
value: ''
|
|
1127
|
+
});
|
|
1128
|
+
i.set('value', 'a.a');
|
|
1129
|
+
_context7.next = 528;
|
|
1130
|
+
return wait();
|
|
1131
|
+
|
|
1132
|
+
case 528:
|
|
1133
|
+
_context7.t126 = expect;
|
|
1134
|
+
_context7.next = 531;
|
|
1135
|
+
return form.validate();
|
|
1136
|
+
|
|
1137
|
+
case 531:
|
|
1138
|
+
_context7.t127 = _context7.sent;
|
|
1139
|
+
(0, _context7.t126)(_context7.t127).to.be.false;
|
|
1140
|
+
i.set('value', 0);
|
|
1141
|
+
_context7.next = 536;
|
|
1142
|
+
return wait();
|
|
1143
|
+
|
|
1144
|
+
case 536:
|
|
1145
|
+
_context7.t128 = expect;
|
|
1146
|
+
_context7.next = 539;
|
|
1147
|
+
return form.validate();
|
|
1148
|
+
|
|
1149
|
+
case 539:
|
|
1150
|
+
_context7.t129 = _context7.sent;
|
|
1151
|
+
(0, _context7.t128)(_context7.t129).to.be.true;
|
|
1152
|
+
i.set('value', 0.1);
|
|
1153
|
+
_context7.next = 544;
|
|
1154
|
+
return wait();
|
|
1155
|
+
|
|
1156
|
+
case 544:
|
|
1157
|
+
_context7.t130 = expect;
|
|
1158
|
+
_context7.next = 547;
|
|
1159
|
+
return form.validate();
|
|
1160
|
+
|
|
1161
|
+
case 547:
|
|
1162
|
+
_context7.t131 = _context7.sent;
|
|
1163
|
+
(0, _context7.t130)(_context7.t131).to.be.false;
|
|
1164
|
+
i.set('value', 0.3);
|
|
1165
|
+
_context7.next = 552;
|
|
1166
|
+
return wait();
|
|
1167
|
+
|
|
1168
|
+
case 552:
|
|
1169
|
+
_context7.t132 = expect;
|
|
1170
|
+
_context7.next = 555;
|
|
1171
|
+
return form.validate();
|
|
1172
|
+
|
|
1173
|
+
case 555:
|
|
1174
|
+
_context7.t133 = _context7.sent;
|
|
1175
|
+
(0, _context7.t132)(_context7.t133).to.be.true;
|
|
1176
|
+
i.set('value', 0.6);
|
|
1177
|
+
_context7.next = 560;
|
|
1178
|
+
return wait();
|
|
1179
|
+
|
|
1180
|
+
case 560:
|
|
1181
|
+
_context7.t134 = expect;
|
|
1182
|
+
_context7.next = 563;
|
|
1183
|
+
return form.validate();
|
|
1184
|
+
|
|
1185
|
+
case 563:
|
|
1186
|
+
_context7.t135 = _context7.sent;
|
|
1187
|
+
(0, _context7.t134)(_context7.t135).to.be.true;
|
|
1188
|
+
i.set('value', -0.6);
|
|
1189
|
+
_context7.next = 568;
|
|
1190
|
+
return wait();
|
|
1191
|
+
|
|
1192
|
+
case 568:
|
|
1193
|
+
_context7.t136 = expect;
|
|
1194
|
+
_context7.next = 571;
|
|
1195
|
+
return form.validate();
|
|
1196
|
+
|
|
1197
|
+
case 571:
|
|
1198
|
+
_context7.t137 = _context7.sent;
|
|
1199
|
+
(0, _context7.t136)(_context7.t137).to.be.true;
|
|
1200
|
+
// equal
|
|
1201
|
+
i.set({
|
|
1202
|
+
rules: {
|
|
1203
|
+
equal: 1
|
|
1204
|
+
},
|
|
1205
|
+
rules1: {
|
|
1206
|
+
equal: 1
|
|
1207
|
+
},
|
|
1208
|
+
value: '1',
|
|
1209
|
+
value1: '1'
|
|
1210
|
+
});
|
|
1211
|
+
i.set('value', 1);
|
|
1212
|
+
_context7.next = 577;
|
|
1213
|
+
return wait();
|
|
1214
|
+
|
|
1215
|
+
case 577:
|
|
1216
|
+
_context7.t138 = expect;
|
|
1217
|
+
_context7.next = 580;
|
|
1218
|
+
return form.validate();
|
|
1219
|
+
|
|
1220
|
+
case 580:
|
|
1221
|
+
_context7.t139 = _context7.sent;
|
|
1222
|
+
(0, _context7.t138)(_context7.t139).to.be.false;
|
|
1223
|
+
i.set('value1', 1);
|
|
1224
|
+
_context7.next = 585;
|
|
1225
|
+
return wait();
|
|
1226
|
+
|
|
1227
|
+
case 585:
|
|
1228
|
+
_context7.t140 = expect;
|
|
1229
|
+
_context7.next = 588;
|
|
1230
|
+
return form.validate();
|
|
1231
|
+
|
|
1232
|
+
case 588:
|
|
1233
|
+
_context7.t141 = _context7.sent;
|
|
1234
|
+
(0, _context7.t140)(_context7.t141).to.be.true;
|
|
1235
|
+
|
|
1236
|
+
case 590:
|
|
1237
|
+
case "end":
|
|
1238
|
+
return _context7.stop();
|
|
1239
|
+
}
|
|
1046
1240
|
}
|
|
1047
1241
|
}, _callee6, this);
|
|
1048
1242
|
})));
|
|
1049
1243
|
it('should show icon when text shows ellipsis', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7() {
|
|
1050
1244
|
var Demo, _mount7, instance, _instance$refs, form, formItem, classList;
|
|
1245
|
+
|
|
1051
1246
|
return _regeneratorRuntime.wrap(function _callee7$(_context9) {
|
|
1052
|
-
while (1)
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1247
|
+
while (1) {
|
|
1248
|
+
switch (_context9.prev = _context9.next) {
|
|
1249
|
+
case 0:
|
|
1250
|
+
Demo = /*#__PURE__*/function (_Component2) {
|
|
1251
|
+
_inheritsLoose(Demo, _Component2);
|
|
1252
|
+
|
|
1253
|
+
function Demo() {
|
|
1254
|
+
var _context8;
|
|
1255
|
+
|
|
1256
|
+
var _this2;
|
|
1257
|
+
|
|
1258
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
1259
|
+
args[_key2] = arguments[_key2];
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
_this2 = _Component2.call.apply(_Component2, _concatInstanceProperty(_context8 = [this]).call(_context8, args)) || this;
|
|
1263
|
+
_this2.Form = Form;
|
|
1264
|
+
_this2.FormItem = FormItem;
|
|
1265
|
+
_this2.Input = Input;
|
|
1266
|
+
return _this2;
|
|
1061
1267
|
}
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1268
|
+
|
|
1269
|
+
return Demo;
|
|
1270
|
+
}(Component);
|
|
1271
|
+
|
|
1272
|
+
Demo.template = "\n const {Form, FormItem, Input} = this;\n <Form ref=\"form\">\n <FormItem value={this.get('value')}\n rules={{\n required: true,\n digits: true,\n }}\n messages={{\n required: 'It is a very very very very very very very very very very very very very very very very very very long text.',\n }}\n ref=\"formItem\"\n >\n <Input v-model=\"value\" />\n </FormItem>\n </Form>\n ";
|
|
1273
|
+
_mount7 = mount(Demo), instance = _mount7[0];
|
|
1274
|
+
_instance$refs = instance.refs, form = _instance$refs.form, formItem = _instance$refs.formItem;
|
|
1275
|
+
_context9.next = 6;
|
|
1276
|
+
return form.validate();
|
|
1277
|
+
|
|
1278
|
+
case 6:
|
|
1279
|
+
_context9.next = 8;
|
|
1280
|
+
return wait();
|
|
1281
|
+
|
|
1282
|
+
case 8:
|
|
1283
|
+
classList = formItem.error.errorRef.value.parentElement.classList;
|
|
1284
|
+
expect(classList.contains('k-ellipsis')).to.be.true;
|
|
1285
|
+
instance.set('value', 'a');
|
|
1286
|
+
_context9.next = 13;
|
|
1287
|
+
return wait();
|
|
1288
|
+
|
|
1289
|
+
case 13:
|
|
1290
|
+
_context9.next = 15;
|
|
1291
|
+
return form.validate();
|
|
1292
|
+
|
|
1293
|
+
case 15:
|
|
1294
|
+
_context9.next = 17;
|
|
1295
|
+
return wait();
|
|
1296
|
+
|
|
1297
|
+
case 17:
|
|
1298
|
+
expect(classList.contains('k-ellipsis')).to.be.false;
|
|
1299
|
+
instance.set('value', '');
|
|
1300
|
+
_context9.next = 21;
|
|
1301
|
+
return wait();
|
|
1302
|
+
|
|
1303
|
+
case 21:
|
|
1304
|
+
_context9.next = 23;
|
|
1305
|
+
return form.validate();
|
|
1306
|
+
|
|
1307
|
+
case 23:
|
|
1308
|
+
_context9.next = 25;
|
|
1309
|
+
return wait();
|
|
1310
|
+
|
|
1311
|
+
case 25:
|
|
1312
|
+
expect(classList.contains('k-ellipsis')).to.be.true;
|
|
1313
|
+
|
|
1314
|
+
case 26:
|
|
1315
|
+
case "end":
|
|
1316
|
+
return _context9.stop();
|
|
1317
|
+
}
|
|
1106
1318
|
}
|
|
1107
1319
|
}, _callee7);
|
|
1108
1320
|
})));
|
|
1109
1321
|
it('should not validate when select is disabled on init', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
|
|
1110
1322
|
var Demo, _mount8, instance, element;
|
|
1323
|
+
|
|
1111
1324
|
return _regeneratorRuntime.wrap(function _callee8$(_context11) {
|
|
1112
|
-
while (1)
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1325
|
+
while (1) {
|
|
1326
|
+
switch (_context11.prev = _context11.next) {
|
|
1327
|
+
case 0:
|
|
1328
|
+
Demo = /*#__PURE__*/function (_Component3) {
|
|
1329
|
+
_inheritsLoose(Demo, _Component3);
|
|
1330
|
+
|
|
1331
|
+
function Demo() {
|
|
1332
|
+
var _context10;
|
|
1333
|
+
|
|
1334
|
+
var _this3;
|
|
1335
|
+
|
|
1336
|
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
1337
|
+
args[_key3] = arguments[_key3];
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1340
|
+
_this3 = _Component3.call.apply(_Component3, _concatInstanceProperty(_context10 = [this]).call(_context10, args)) || this;
|
|
1341
|
+
_this3.Form = Form;
|
|
1342
|
+
_this3.FormItem = FormItem;
|
|
1343
|
+
_this3.Select = Select;
|
|
1344
|
+
return _this3;
|
|
1121
1345
|
}
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
return _context11.stop();
|
|
1346
|
+
|
|
1347
|
+
return Demo;
|
|
1348
|
+
}(Component);
|
|
1349
|
+
|
|
1350
|
+
Demo.template = "\n const {Form, FormItem, Select} = this;\n <Form ref=\"form\">\n <FormItem rules={{required: true}}>\n <Select disabled />\n </FormItem>\n </Form>\n ";
|
|
1351
|
+
_mount8 = mount(Demo), instance = _mount8[0], element = _mount8[1];
|
|
1352
|
+
_context11.next = 5;
|
|
1353
|
+
return wait(500);
|
|
1354
|
+
|
|
1355
|
+
case 5:
|
|
1356
|
+
expect(element.querySelector('.k-form-error')).to.be.null;
|
|
1357
|
+
|
|
1358
|
+
case 6:
|
|
1359
|
+
case "end":
|
|
1360
|
+
return _context11.stop();
|
|
1361
|
+
}
|
|
1139
1362
|
}
|
|
1140
1363
|
}, _callee8);
|
|
1141
1364
|
})));
|