@king-design/intact 2.1.1 → 3.0.0-beta.1
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/README.md +1 -1
- package/components/button/demos/basic.md +1 -0
- package/components/button/demos/group.md +11 -0
- package/components/button/demos/icon.md +1 -0
- package/components/button/index.md +1 -1
- package/components/button/index.ts +2 -2
- package/components/button/styles.ts +10 -2
- package/components/card/styles.ts +3 -2
- package/components/checkbox/styles.ts +31 -6
- package/components/collapse/styles.ts +4 -1
- package/components/copy/demos/basic.md +12 -0
- package/components/copy/demos/children.md +37 -0
- package/components/copy/index.md +21 -0
- package/components/copy/index.spec.ts +21 -0
- package/components/copy/index.ts +37 -0
- package/components/copy/index.vdt +23 -0
- package/components/copy/styles.ts +9 -0
- package/components/copy/useCopy.ts +91 -0
- package/components/datepicker/demos/basic.md +1 -0
- package/components/datepicker/index.md +2 -0
- package/components/datepicker/index.spec.ts +2 -2
- package/components/datepicker/index.vdt +2 -2
- package/components/datepicker/styles.ts +13 -5
- package/components/dialog/alert.vdt +10 -6
- package/components/dialog/base.vdt +4 -5
- package/components/dialog/index.spec.ts +4 -4
- package/components/dialog/styles.ts +18 -13
- package/components/drawer/styles.ts +20 -10
- package/components/dropdown/demos/tooltip.md +1 -1
- package/components/dropdown/index.spec.ts +1 -1
- package/components/dropdown/styles.ts +1 -1
- package/components/form/index.spec.ts +1 -1
- package/components/form/item.vdt +1 -1
- package/components/form/styles.ts +21 -26
- package/components/grid/useGutter.ts +7 -6
- package/components/icon/demos/disabled.md +21 -0
- package/components/icon/demos/icons.md +87 -116
- package/components/icon/index.md +1 -0
- package/components/icon/index.ts +2 -0
- package/components/icon/index.vdt +6 -2
- package/components/icon/styles.ts +8 -1
- package/components/input/demos/flat.md +16 -0
- package/components/input/index.md +1 -0
- package/components/input/index.ts +4 -10
- package/components/input/index.vdt +2 -1
- package/components/input/styles.ts +29 -21
- package/components/message/demos/basic.md +1 -1
- package/components/message/demos/duration.md +3 -3
- package/components/message/index.md +1 -1
- package/components/message/message.ts +2 -2
- package/components/message/message.vdt +6 -6
- package/components/message/styles.ts +10 -19
- package/components/pagination/demos/flat.md +22 -0
- package/components/pagination/index.md +1 -1
- package/components/pagination/index.spec.ts +1 -1
- package/components/pagination/index.ts +2 -2
- package/components/pagination/index.vdt +15 -18
- package/components/pagination/styles.ts +13 -9
- package/components/popover/content.ts +40 -0
- package/components/popover/content.vdt +32 -0
- package/components/popover/demos/basic.md +47 -0
- package/components/popover/demos/button.md +49 -0
- package/components/popover/demos/content.md +36 -0
- package/components/popover/demos/text.md +38 -0
- package/components/popover/demos/type.md +51 -0
- package/components/popover/index.md +54 -0
- package/components/popover/index.spec.ts +91 -0
- package/components/popover/index.ts +52 -0
- package/components/popover/styles.ts +45 -0
- package/components/progress/demos/children.md +1 -1
- package/components/progress/demos/circleSize.md +84 -0
- package/components/progress/demos/customColor.md +1 -3
- package/components/progress/index.ts +1 -1
- package/components/progress/index.vdt +36 -7
- package/components/progress/styles.ts +34 -21
- package/components/radio/styles.ts +28 -9
- package/components/rate/styles.ts +1 -0
- package/components/select/base.ts +8 -2
- package/components/select/base.vdt +40 -39
- package/components/select/demos/basic.md +21 -12
- package/components/select/demos/creatable.md +1 -1
- package/components/select/demos/draggable.md +55 -0
- package/components/select/demos/flat.md +42 -0
- package/components/select/demos/nowrap.md +24 -0
- package/components/select/demos/size.md +41 -1
- package/components/select/index.md +2 -0
- package/components/select/index.spec.ts +2 -2
- package/components/select/menu.vdt +5 -5
- package/components/select/styles.ts +55 -64
- package/components/select/useDraggble.ts +12 -0
- package/components/select/useNowrap.ts +24 -0
- package/components/slider/index.spec.ts +32 -1
- package/components/slider/index.ts +2 -2
- package/components/slider/index.vdt +34 -16
- package/components/slider/styles.ts +21 -13
- package/components/slider/useValue.ts +15 -3
- package/components/spinner/index.md +1 -1
- package/components/spinner/index.ts +0 -9
- package/components/spinner/index.vdt +13 -8
- package/components/spinner/styles.ts +36 -36
- package/components/spinner/useChange.ts +2 -2
- package/components/spinner/useValue.ts +9 -1
- package/components/split/index.vdt +13 -3
- package/components/split/memo.ts +29 -0
- package/components/steps/demos/basic.md +2 -1
- package/components/steps/demos/clickable.md +6 -0
- package/components/steps/demos/error.md +25 -5
- package/components/steps/demos/line.md +7 -6
- package/components/steps/demos/simple.md +0 -6
- package/components/steps/demos/vertical.md +79 -0
- package/components/steps/index.md +2 -1
- package/components/steps/index.spec.ts +1 -1
- package/components/steps/index.ts +7 -5
- package/components/steps/index.vdt +5 -3
- package/components/steps/step.vdt +16 -13
- package/components/steps/styles.ts +422 -255
- package/components/switch/demos/basic.md +1 -2
- package/components/switch/demos/disabled.md +20 -0
- package/components/switch/demos/onOff.md +5 -0
- package/components/switch/index.spec.ts +15 -10
- package/components/switch/styles.ts +29 -37
- package/components/table/styles.ts +11 -6
- package/components/table/useDraggable.ts +4 -3
- package/components/table/useStickyScrollbar.ts +2 -2
- package/components/table/useWidth.ts +2 -2
- package/components/tabs/demos/basic.md +0 -1
- package/components/tabs/demos/beforeChange.md +2 -2
- package/components/tabs/demos/card.md +2 -11
- package/components/tabs/demos/closable.md +7 -6
- package/components/tabs/demos/scroll.md +104 -0
- package/components/tabs/demos/vertical.md +1 -9
- package/components/tabs/index.md +1 -1
- package/components/tabs/index.spec.ts +36 -0
- package/components/tabs/index.ts +11 -12
- package/components/tabs/index.vdt +8 -9
- package/components/tabs/styles.ts +205 -186
- package/components/tabs/useScroll.ts +101 -42
- package/components/tag/base.ts +2 -2
- package/components/tag/demos/border.md +2 -2
- package/components/tag/demos/draggable.md +49 -0
- package/components/tag/demos/tags.md +72 -0
- package/components/tag/index.md +12 -1
- package/components/tag/index.spec.ts +70 -2
- package/components/tag/index.ts +2 -0
- package/components/tag/styles.ts +59 -9
- package/components/tag/tags.ts +54 -0
- package/components/tag/tags.vdt +49 -0
- package/components/tag/useChildren.ts +42 -0
- package/components/tag/useDraggable.ts +97 -0
- package/components/tag/useNowrap.ts +117 -0
- package/components/timepicker/index.md +2 -0
- package/components/timepicker/index.spec.ts +1 -1
- package/components/tip/index.vdt +1 -3
- package/components/tip/styles.ts +8 -2
- package/components/tooltip/content.ts +6 -6
- package/components/tooltip/content.vdt +8 -7
- package/components/tooltip/index.md +3 -6
- package/components/tooltip/index.spec.ts +6 -36
- package/components/tooltip/styles.ts +10 -8
- package/components/transfer/index.vdt +3 -2
- package/components/transfer/styles.ts +1 -0
- package/components/transfer/useCheck.ts +9 -2
- package/components/treeSelect/index.md +2 -0
- package/components/upload/demos/manually.md +12 -13
- package/components/upload/index.spec.ts +4 -4
- package/components/upload/index.vdt +40 -34
- package/components/upload/styles.ts +58 -64
- package/components/utils.ts +25 -4
- package/es/components/button/index.d.ts +1 -1
- package/es/components/button/index.js +1 -1
- package/es/components/button/styles.js +3 -3
- package/es/components/card/styles.js +10 -2
- package/es/components/checkbox/styles.js +21 -10
- package/es/components/collapse/styles.js +6 -1
- package/es/components/copy/index.d.ts +17 -0
- package/es/components/copy/index.js +43 -0
- package/es/components/copy/index.spec.d.ts +1 -0
- package/es/components/copy/index.spec.js +52 -0
- package/es/components/copy/index.vdt.js +45 -0
- package/es/components/copy/styles.d.ts +2 -0
- package/es/components/copy/styles.js +14 -0
- package/es/components/copy/useCopy.d.ts +4 -0
- package/es/components/copy/useCopy.js +90 -0
- package/es/components/datepicker/index.spec.js +1 -1
- package/es/components/datepicker/index.vdt.js +1 -1
- package/es/components/datepicker/styles.d.ts +1 -1
- package/es/components/datepicker/styles.js +5 -2
- package/es/components/diagram/shapes/callout.d.ts +1 -1
- package/es/components/diagram/shapes/circle.d.ts +1 -1
- package/es/components/diagram/shapes/document.d.ts +1 -1
- package/es/components/diagram/shapes/ellipse.d.ts +1 -1
- package/es/components/diagram/shapes/hexagon.d.ts +1 -1
- package/es/components/diagram/shapes/image.d.ts +1 -1
- package/es/components/diagram/shapes/parallelogram.d.ts +1 -1
- package/es/components/diagram/shapes/rectangle.d.ts +1 -1
- package/es/components/diagram/shapes/square.d.ts +1 -1
- package/es/components/diagram/shapes/text.d.ts +1 -1
- package/es/components/dialog/alert.vdt.js +6 -5
- package/es/components/dialog/base.vdt.js +5 -6
- package/es/components/dialog/index.spec.js +4 -4
- package/es/components/dialog/styles.js +16 -14
- package/es/components/drawer/styles.js +20 -5
- package/es/components/dropdown/styles.js +1 -1
- package/es/components/form/index.spec.js +4 -2
- package/es/components/form/item.vdt.js +2 -1
- package/es/components/form/styles.js +5 -5
- package/es/components/grid/useGutter.js +8 -8
- package/es/components/icon/index.d.ts +1 -0
- package/es/components/icon/index.js +2 -1
- package/es/components/icon/index.vdt.js +4 -2
- package/es/components/icon/styles.js +10 -2
- package/es/components/input/index.d.ts +1 -0
- package/es/components/input/index.js +4 -11
- package/es/components/input/index.vdt.js +4 -2
- package/es/components/input/styles.js +13 -11
- package/es/components/message/message.js +1 -1
- package/es/components/message/message.vdt.js +7 -6
- package/es/components/message/styles.js +8 -8
- package/es/components/pagination/index.d.ts +1 -1
- package/es/components/pagination/index.js +1 -1
- package/es/components/pagination/index.spec.js +4 -2
- package/es/components/pagination/index.vdt.js +16 -18
- package/es/components/pagination/styles.js +12 -3
- package/es/components/popover/content.d.ts +19 -0
- package/es/components/popover/content.js +31 -0
- package/es/components/popover/content.vdt.js +68 -0
- package/es/components/popover/index.d.ts +16 -0
- package/es/components/popover/index.js +44 -0
- package/es/components/popover/index.spec.d.ts +1 -0
- package/es/components/popover/index.spec.js +195 -0
- package/es/components/popover/styles.d.ts +1 -0
- package/es/components/popover/styles.js +22 -0
- package/es/components/progress/index.js +1 -1
- package/es/components/progress/index.vdt.js +46 -8
- package/es/components/progress/styles.js +19 -13
- package/es/components/radio/styles.js +16 -6
- package/es/components/rate/styles.js +1 -1
- package/es/components/select/base.d.ts +5 -2
- package/es/components/select/base.js +7 -3
- package/es/components/select/base.vdt.js +46 -38
- package/es/components/select/index.spec.js +2 -2
- package/es/components/select/menu.vdt.js +1 -1
- package/es/components/select/styles.js +14 -28
- package/es/components/select/useDraggble.d.ts +2 -0
- package/es/components/select/useDraggble.js +11 -0
- package/es/components/select/useNowrap.d.ts +3 -0
- package/es/components/select/useNowrap.js +19 -0
- package/es/components/slider/index.spec.js +48 -9
- package/es/components/slider/index.vdt.js +23 -12
- package/es/components/slider/styles.js +23 -14
- package/es/components/slider/useValue.d.ts +3 -1
- package/es/components/slider/useValue.js +12 -0
- package/es/components/spinner/index.d.ts +0 -1
- package/es/components/spinner/index.js +1 -19
- package/es/components/spinner/index.vdt.js +15 -8
- package/es/components/spinner/styles.js +33 -5
- package/es/components/spinner/useChange.d.ts +1 -1
- package/es/components/spinner/useChange.js +2 -2
- package/es/components/spinner/useValue.d.ts +1 -0
- package/es/components/spinner/useValue.js +16 -1
- package/es/components/split/index.vdt.js +32 -20
- package/es/components/split/memo.d.ts +9 -0
- package/es/components/split/memo.js +26 -0
- package/es/components/steps/index.d.ts +3 -2
- package/es/components/steps/index.js +4 -3
- package/es/components/steps/index.spec.js +1 -1
- package/es/components/steps/index.vdt.js +8 -4
- package/es/components/steps/step.vdt.js +17 -9
- package/es/components/steps/styles.d.ts +2 -1
- package/es/components/steps/styles.js +106 -72
- package/es/components/switch/index.spec.js +82 -65
- package/es/components/switch/styles.js +20 -34
- package/es/components/table/styles.js +9 -4
- package/es/components/table/useDraggable.js +3 -10
- package/es/components/table/useStickyScrollbar.js +2 -2
- package/es/components/table/useWidth.js +2 -2
- package/es/components/tabs/index.d.ts +1 -1
- package/es/components/tabs/index.js +1 -1
- package/es/components/tabs/index.spec.js +67 -0
- package/es/components/tabs/index.vdt.js +5 -5
- package/es/components/tabs/styles.js +73 -29
- package/es/components/tabs/useScroll.d.ts +1 -1
- package/es/components/tabs/useScroll.js +75 -48
- package/es/components/tag/base.d.ts +1 -0
- package/es/components/tag/base.js +2 -2
- package/es/components/tag/index.d.ts +1 -0
- package/es/components/tag/index.js +2 -1
- package/es/components/tag/index.spec.js +147 -4
- package/es/components/tag/styles.d.ts +67 -0
- package/es/components/tag/styles.js +42 -12
- package/es/components/tag/tags.d.ts +27 -0
- package/es/components/tag/tags.js +51 -0
- package/es/components/tag/tags.vdt.js +79 -0
- package/es/components/tag/useChildren.d.ts +2 -0
- package/es/components/tag/useChildren.js +39 -0
- package/es/components/tag/useDraggable.d.ts +3 -0
- package/es/components/tag/useDraggable.js +89 -0
- package/es/components/tag/useNowrap.d.ts +7 -0
- package/es/components/tag/useNowrap.js +115 -0
- package/es/components/timepicker/index.spec.js +1 -1
- package/es/components/tip/index.vdt.js +1 -3
- package/es/components/tip/styles.js +4 -3
- package/es/components/tooltip/content.d.ts +2 -2
- package/es/components/tooltip/content.vdt.js +23 -13
- package/es/components/tooltip/index.spec.js +56 -108
- package/es/components/tooltip/styles.d.ts +1 -0
- package/es/components/tooltip/styles.js +13 -8
- package/es/components/transfer/index.vdt.js +3 -1
- package/es/components/transfer/styles.js +1 -1
- package/es/components/transfer/useCheck.d.ts +1 -0
- package/es/components/transfer/useCheck.js +8 -1
- package/es/components/upload/index.spec.js +5 -6
- package/es/components/upload/index.vdt.js +24 -21
- package/es/components/upload/styles.js +22 -30
- package/es/components/utils.d.ts +2 -0
- package/es/components/utils.js +24 -3
- package/es/hooks/useResizeObserver.d.ts +1 -1
- package/es/hooks/useResizeObserver.js +19 -6
- package/es/i18n/en-US.d.ts +6 -2
- package/es/i18n/en-US.js +8 -3
- package/es/index.d.ts +4 -2
- package/es/index.js +4 -2
- package/es/packages/kpc-react/__tests__/components/drawer.spec.js +74 -6
- package/es/site/data/components/button/demos/basic/react.js +3 -1
- package/es/site/data/components/button/demos/group/react.js +26 -0
- package/es/site/data/components/button/demos/icon/react.js +6 -0
- package/es/site/data/components/copy/demos/basic/react.js +23 -0
- package/es/site/data/components/copy/demos/children/react.js +44 -0
- package/es/site/data/components/copy/index.d.ts +57 -0
- package/es/site/data/components/copy/index.js +42 -0
- package/es/site/data/components/datepicker/demos/basic/react.js +8 -0
- package/es/site/data/components/dropdown/demos/tooltip/react.js +2 -1
- package/es/site/data/components/icon/demos/disabled/index.d.ts +6 -0
- package/es/site/data/components/icon/demos/disabled/index.js +18 -0
- package/es/site/data/components/icon/demos/disabled/react.d.ts +5 -0
- package/es/site/data/components/icon/demos/disabled/react.js +33 -0
- package/es/site/data/components/icon/demos/icons/index.js +1 -1
- package/es/site/data/components/icon/demos/icons/react.js +1 -1
- package/es/site/data/components/input/demos/flat/index.d.ts +5 -0
- package/es/site/data/components/input/demos/flat/index.js +17 -0
- package/es/site/data/components/input/demos/flat/react.d.ts +4 -0
- package/es/site/data/components/input/demos/flat/react.js +29 -0
- package/es/site/data/components/message/demos/duration/index.js +2 -2
- package/es/site/data/components/message/demos/duration/react.js +2 -2
- package/es/site/data/components/pagination/demos/flat/index.d.ts +6 -0
- package/es/site/data/components/pagination/demos/flat/index.js +18 -0
- package/es/site/data/components/pagination/demos/flat/react.d.ts +5 -0
- package/es/site/data/components/pagination/demos/{noBoard → flat}/react.js +12 -8
- package/es/site/data/components/popover/demos/basic/react.d.ts +8 -0
- package/es/site/data/components/{tooltip/demos/confirm → popover/demos/basic}/react.js +14 -9
- package/es/site/data/components/popover/demos/button/index.d.ts +8 -0
- package/es/site/data/components/popover/demos/button/index.js +42 -0
- package/es/site/data/components/popover/demos/button/react.d.ts +8 -0
- package/es/site/data/components/popover/demos/button/react.js +73 -0
- package/es/site/data/components/popover/demos/content/index.d.ts +7 -0
- package/es/site/data/components/popover/demos/content/index.js +28 -0
- package/es/site/data/components/{tooltip/demos/confirm → popover/demos/content}/react.d.ts +0 -1
- package/es/site/data/components/popover/demos/content/react.js +43 -0
- package/es/site/data/components/popover/demos/text/index.d.ts +7 -0
- package/es/site/data/components/popover/demos/text/index.js +28 -0
- package/es/site/data/components/popover/demos/text/react.d.ts +6 -0
- package/es/site/data/components/popover/demos/text/react.js +36 -0
- package/es/site/data/components/popover/demos/type/index.d.ts +11 -0
- package/es/site/data/components/popover/demos/type/index.js +34 -0
- package/es/site/data/components/popover/demos/type/react.d.ts +11 -0
- package/es/site/data/components/popover/demos/type/react.js +58 -0
- package/es/site/data/components/popover/index.d.ts +57 -0
- package/es/site/data/components/popover/index.js +42 -0
- package/es/site/data/components/progress/demos/children/react.js +4 -4
- package/es/site/data/components/progress/demos/circleSize/index.d.ts +14 -0
- package/es/site/data/components/progress/demos/circleSize/index.js +43 -0
- package/es/site/data/components/progress/demos/circleSize/react.d.ts +14 -0
- package/es/site/data/components/progress/demos/circleSize/react.js +98 -0
- package/es/site/data/components/progress/demos/customColor/react.js +4 -4
- package/es/site/data/components/select/demos/basic/react.js +19 -7
- package/es/site/data/components/select/demos/creatable/react.js +2 -1
- package/es/site/data/components/select/demos/draggable/index.d.ts +10 -0
- package/es/site/data/components/select/demos/draggable/index.js +24 -0
- package/es/site/data/components/select/demos/draggable/react.d.ts +10 -0
- package/es/site/data/components/select/demos/draggable/react.js +85 -0
- package/es/site/data/components/select/demos/flat/index.d.ts +5 -0
- package/es/site/data/components/select/demos/flat/index.js +17 -0
- package/es/site/data/components/select/demos/flat/react.d.ts +4 -0
- package/es/site/data/components/select/demos/flat/react.js +73 -0
- package/es/site/data/components/select/demos/inline/index.d.ts +5 -0
- package/es/site/data/components/select/demos/inline/index.js +17 -0
- package/es/site/data/components/select/demos/inline/react.d.ts +4 -0
- package/es/site/data/components/select/demos/nowrap/index.d.ts +5 -0
- package/es/site/data/components/select/demos/nowrap/index.js +17 -0
- package/es/site/data/components/select/demos/nowrap/react.d.ts +4 -0
- package/es/site/data/components/select/demos/nowrap/react.js +41 -0
- package/es/site/data/components/select/demos/size/index.d.ts +1 -0
- package/es/site/data/components/select/demos/size/index.js +2 -1
- package/es/site/data/components/select/demos/size/react.d.ts +1 -0
- package/es/site/data/components/select/demos/size/react.js +93 -1
- package/es/site/data/components/steps/demos/basic/react.js +1 -1
- package/es/site/data/components/steps/demos/clickable/react.js +15 -0
- package/es/site/data/components/steps/demos/error/react.js +22 -2
- package/es/site/data/components/steps/demos/line/react.js +15 -11
- package/es/site/data/components/steps/demos/simple/react.js +1 -11
- package/es/site/data/components/steps/demos/vertical/index.d.ts +14 -0
- package/es/site/data/components/steps/demos/vertical/index.js +40 -0
- package/es/site/data/components/steps/demos/vertical/react.d.ts +14 -0
- package/es/site/data/components/steps/demos/vertical/react.js +124 -0
- package/es/site/data/components/switch/demos/basic/react.js +0 -2
- package/es/site/data/components/switch/demos/disabled/index.d.ts +6 -0
- package/es/site/data/components/switch/demos/disabled/index.js +18 -0
- package/es/site/data/components/switch/demos/disabled/react.d.ts +5 -0
- package/es/site/data/components/switch/demos/disabled/react.js +27 -0
- package/es/site/data/components/switch/demos/onOff/react.js +11 -0
- package/es/site/data/components/tabs/demos/card/react.js +1 -15
- package/es/site/data/components/tabs/demos/closable/index.js +1 -1
- package/es/site/data/components/tabs/demos/closable/react.js +9 -3
- package/es/site/data/components/tabs/demos/scroll/index.d.ts +18 -0
- package/es/site/data/components/tabs/demos/scroll/index.js +87 -0
- package/es/site/data/components/tabs/demos/scroll/react.d.ts +18 -0
- package/es/site/data/components/tabs/demos/scroll/react.js +166 -0
- package/es/site/data/components/tabs/demos/vertical/react.js +1 -16
- package/es/site/data/components/tag/demos/border/index.js +1 -1
- package/es/site/data/components/tag/demos/border/react.js +1 -1
- package/es/site/data/components/tag/demos/draggable/index.d.ts +11 -0
- package/es/site/data/components/tag/demos/draggable/index.js +24 -0
- package/es/site/data/components/tag/demos/draggable/react.d.ts +11 -0
- package/es/site/data/components/tag/demos/draggable/react.js +62 -0
- package/es/site/data/components/tag/demos/tags/index.d.ts +12 -0
- package/es/site/data/components/tag/demos/tags/index.js +39 -0
- package/es/site/data/components/tag/demos/tags/react.d.ts +12 -0
- package/es/site/data/components/tag/demos/tags/react.js +83 -0
- package/es/site/data/components/upload/demos/manually/react.js +5 -7
- package/es/site/src/pages/document/styles.js +1 -1
- package/es/styles/fonts/iconfont.eot +0 -0
- package/es/styles/fonts/iconfont.js +2 -2
- package/es/styles/fonts/iconfont.svg +189 -369
- package/es/styles/fonts/iconfont.ttf +0 -0
- package/es/styles/fonts/iconfont.woff +0 -0
- package/es/styles/fonts/ionicons.js +2 -2
- package/es/styles/global.js +1 -1
- package/es/styles/theme.d.ts +10 -2
- package/es/styles/theme.js +23 -21
- package/hooks/useResizeObserver.ts +19 -7
- package/i18n/en-US.ts +8 -2
- package/index.ts +4 -2
- package/package.json +5 -1
- package/styles/fonts/iconfont.css +172 -289
- package/styles/fonts/iconfont.eot +0 -0
- package/styles/fonts/iconfont.svg +189 -369
- package/styles/fonts/iconfont.ts +256 -370
- package/styles/fonts/iconfont.ttf +0 -0
- package/styles/fonts/iconfont.woff +0 -0
- package/styles/fonts/iconfont.woff2 +0 -0
- package/styles/fonts/ionicons.ts +2 -2
- package/styles/global.ts +3 -3
- package/styles/theme.ts +23 -19
- package/components/pagination/demos/noBoard.md +0 -22
- package/components/table/useResizeObserver.ts +0 -22
- package/components/tooltip/demos/confirm.md +0 -41
- package/es/components/table/useResizeObserver.d.ts +0 -2
- package/es/components/table/useResizeObserver.js +0 -20
- /package/components/select/demos/{noBorder.md → inline.md} +0 -0
- /package/es/site/data/components/{select/demos/noBorder → copy/demos/basic}/index.d.ts +0 -0
- /package/es/site/data/components/{select/demos/noBorder → copy/demos/basic}/index.js +0 -0
- /package/es/site/data/components/{select/demos/noBorder → copy/demos/basic}/react.d.ts +0 -0
- /package/es/site/data/components/{pagination/demos/noBoard → copy/demos/children}/index.d.ts +0 -0
- /package/es/site/data/components/{pagination/demos/noBoard → copy/demos/children}/index.js +0 -0
- /package/es/site/data/components/{pagination/demos/noBoard → copy/demos/children}/react.d.ts +0 -0
- /package/es/site/data/components/{tooltip/demos/confirm → popover/demos/basic}/index.d.ts +0 -0
- /package/es/site/data/components/{tooltip/demos/confirm → popover/demos/basic}/index.js +0 -0
- /package/es/site/data/components/select/demos/{noBorder → inline}/react.js +0 -0
|
@@ -10,7 +10,7 @@ var defaults = {
|
|
|
10
10
|
},
|
|
11
11
|
|
|
12
12
|
get boxShadow() {
|
|
13
|
-
return theme.
|
|
13
|
+
return theme.largeBoxShadow;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
};
|
|
@@ -21,9 +21,10 @@ setDefault(function () {
|
|
|
21
21
|
}).drawer;
|
|
22
22
|
});
|
|
23
23
|
export function makeStyles(overlay) {
|
|
24
|
-
return /*#__PURE__*/css("
|
|
24
|
+
return /*#__PURE__*/css("position:fixed!important;background:transparent!important;box-shadow:none!important;&.transition-enter-active,&.transition-leave-active,&.transition-appear-active{transition:opacity ", drawer.transition, "!important;overflow:hidden;.k-drawer-content{transition:transform ", drawer.transition, ";}}.k-drawer-content{height:100%;display:flex;background:#fff;flex-direction:column;transform:translateX(0);box-shadow:", drawer.boxShadow, ";.k-dialog-body{flex-grow:1;overflow:auto;}}", _mapInstanceProperty(placements).call(placements, function (placement) {
|
|
25
25
|
var positionValue = '';
|
|
26
26
|
var transformValue = '';
|
|
27
|
+
var borderRadius = '';
|
|
27
28
|
placements.forEach(function (p) {
|
|
28
29
|
// Set top to `0 !important` when overlay is false and placement is right or left
|
|
29
30
|
// Because dialog without overlay don't have positional parent element
|
|
@@ -32,12 +33,26 @@ export function makeStyles(overlay) {
|
|
|
32
33
|
|
|
33
34
|
if (placement === 'left' || placement === 'right') {
|
|
34
35
|
positionValue += 'height: 100% !important;';
|
|
35
|
-
|
|
36
|
+
|
|
37
|
+
if (placement === 'left') {
|
|
38
|
+
borderRadius = "0 " + theme.largeBorderRadius + " " + theme.largeBorderRadius + " 0";
|
|
39
|
+
transformValue = 'translateX(-100%)';
|
|
40
|
+
} else {
|
|
41
|
+
borderRadius = theme.largeBorderRadius + " 0 0 " + theme.largeBorderRadius;
|
|
42
|
+
transformValue = 'translateX(100%)';
|
|
43
|
+
}
|
|
36
44
|
} else {
|
|
37
45
|
positionValue += 'width: 100% !important;';
|
|
38
|
-
|
|
46
|
+
|
|
47
|
+
if (placement === 'top') {
|
|
48
|
+
borderRadius = "0 0 " + theme.largeBorderRadius + " " + theme.largeBorderRadius;
|
|
49
|
+
transformValue = 'translateY(-100%)';
|
|
50
|
+
} else {
|
|
51
|
+
borderRadius = theme.largeBorderRadius + " " + theme.largeBorderRadius + " 0 0";
|
|
52
|
+
transformValue = 'translateY(100%)';
|
|
53
|
+
}
|
|
39
54
|
}
|
|
40
55
|
|
|
41
|
-
return "\n &.k-" + placement + " {\n " + positionValue + "\n &.transition-enter-from,\n &.transition-leave-to,\n &.transition-appear-from {\n transform: none !important;\n .k-drawer-content {\n transform: " + transformValue + ";\n }\n }\n }\n ";
|
|
56
|
+
return "\n &.k-" + placement + " {\n " + positionValue + "\n &.transition-enter-from,\n &.transition-leave-to,\n &.transition-appear-from {\n transform: none !important;\n .k-drawer-content {\n transform: " + transformValue + ";\n }\n }\n .k-drawer-content {\n border-radius: " + borderRadius + ";\n }\n }\n ";
|
|
42
57
|
}), ";");
|
|
43
58
|
}
|
|
@@ -49,7 +49,7 @@ setDefault(function () {
|
|
|
49
49
|
}).dropdown;
|
|
50
50
|
});
|
|
51
51
|
export function makeMenuStyles() {
|
|
52
|
-
return /*#__PURE__*/css("position:absolute;min-width:", dropdown.menu.minWidth, ";background:", dropdown.menu.bgColor, ";border-radius:", dropdown.menu.borderRadius, ";box-shadow:", theme.
|
|
52
|
+
return /*#__PURE__*/css("position:absolute;min-width:", dropdown.menu.minWidth, ";background:", dropdown.menu.bgColor, ";border-radius:", dropdown.menu.borderRadius, ";box-shadow:", theme.middleBoxShadow, ";font-size:", dropdown.menu.fontSize, ";z-index:", dropdown.menu.zIndex, ";top:0;left:0;.k-dropdown{display:block;}");
|
|
53
53
|
}
|
|
54
54
|
export function makeItemStyles() {
|
|
55
55
|
return /*#__PURE__*/css("padding:", dropdown.item.padding, ";cursor:pointer;white-space:nowrap;height:", dropdown.item.height, ";line-height:", dropdown.item.height, ";&.k-hover{background:", dropdown.item.hoverBgColor, ";}&:first-of-type{border-radius:", dropdown.menu.borderRadius, " ", dropdown.menu.borderRadius, " 0 0;}&:last-of-type{border-radius:0 0 ", dropdown.menu.borderRadius, " ", dropdown.menu.borderRadius, ";}&.k-disabled{background:", dropdown.item.disabledBgColor, ";color:", dropdown.item.disabledColor, ";cursor:not-allowed;}.k-checkbox,.k-radio{display:flex;margin:0 -", getRight(dropdown.item.padding), " 0 -", getLeft(dropdown.item.padding), ";padding:", dropdown.item.padding, ";}.k-checkbox-wrapper,.k-radio-wrapper{vertical-align:text-bottom;}.k-checkbox-text,.k-radio-text{vertical-align:baseline;}");
|
|
@@ -8,7 +8,7 @@ import BasicDemo, { data as basicDemoData } from '~/components/form/demos/basic'
|
|
|
8
8
|
import CustomDemo from '~/components/form/demos/custom';
|
|
9
9
|
import VariableDemo from '~/components/form/demos/variable';
|
|
10
10
|
import RemoteDemo from '~/components/form/demos/remote';
|
|
11
|
-
import { mount, dispatchEvent, wait } from '../../test/utils';
|
|
11
|
+
import { mount, unmount, dispatchEvent, wait } from '../../test/utils';
|
|
12
12
|
import { Component } from 'intact';
|
|
13
13
|
import { Form, FormItem } from './';
|
|
14
14
|
import { Input } from '../input';
|
|
@@ -29,7 +29,9 @@ RemoteDemo.prototype.validateUserName = function (value) {
|
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
describe('Form', function () {
|
|
32
|
-
|
|
32
|
+
afterEach(function () {
|
|
33
|
+
return unmount();
|
|
34
|
+
});
|
|
33
35
|
it('validate', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
34
36
|
var _mount, instance, element, form, item, input;
|
|
35
37
|
|
|
@@ -8,7 +8,8 @@ import { makeItemStyles } from './styles';
|
|
|
8
8
|
import { context as ErrorContext } from './useError';
|
|
9
9
|
var _$tmp0 = {
|
|
10
10
|
'className': 'ion-ios-information-outline k-form-error-more',
|
|
11
|
-
'size': 'small'
|
|
11
|
+
'size': 'small',
|
|
12
|
+
'color': 'inherit'
|
|
12
13
|
};
|
|
13
14
|
export default function ($props, $blocks, $__proto__) {
|
|
14
15
|
var _classNameObj, _$cn2;
|
|
@@ -8,12 +8,12 @@ var defaults = {
|
|
|
8
8
|
gap: "24px",
|
|
9
9
|
labelWidth: "80px",
|
|
10
10
|
|
|
11
|
-
get
|
|
11
|
+
get labelHeight() {
|
|
12
12
|
return theme.default.height;
|
|
13
13
|
},
|
|
14
14
|
|
|
15
15
|
labelTextAlign: 'right',
|
|
16
|
-
labelGap: '
|
|
16
|
+
labelGap: '16px',
|
|
17
17
|
|
|
18
18
|
get starColor() {
|
|
19
19
|
return theme.color.danger;
|
|
@@ -50,12 +50,12 @@ setDefault(function () {
|
|
|
50
50
|
}).form;
|
|
51
51
|
});
|
|
52
52
|
export function makeItemStyles() {
|
|
53
|
-
return /*#__PURE__*/css("display:
|
|
53
|
+
return /*#__PURE__*/css("display:flex;position:relative;&:not(:last-of-type){margin-bottom:", form.item.gap, ";}&.k-fluid>.k-form-content{flex:1;}.k-form-label{display:flex;align-items:center;justify-content:", form.item.labelTextAlign === 'right' ? 'end' : 'start', ";width:", form.item.labelWidth, ";padding-right:", form.item.labelGap, ";max-height:", form.item.labelHeight, ";}.k-form-star{color:", form.item.starColor, ";margin-right:", form.item.starGap, ";}.k-form-content{position:relative;}.k-form-error{position:absolute;color:", form.item.errorColor, ";font-size:", form.item.errorFontSize, ";left:0;right:0;display:flex;align-items:center;&.k-ellipsis{.k-form-error-more{display:inline-block;}}}.k-form-error-more{line-height:", form.item.errorFontSize, ";display:none;}&.k-invalid{.k-input{.k-input-inner{border:", form.item.invalidBorder, ";position:relative;z-index:1;}}.k-select,.k-checkbox-wrapper,.k-radio-wrapper{border:", form.item.invalidBorder, "!important;}.k-select .k-input .k-input-inner{border:none;}}.k-form-append{padding:", form.item.appendPadding, ";vertical-align:middle;}");
|
|
54
54
|
}
|
|
55
55
|
export function makeFormStyles() {
|
|
56
56
|
var _context;
|
|
57
57
|
|
|
58
|
-
return /*#__PURE__*/css("&.k-inline{.k-form-item{display:inline-
|
|
59
|
-
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"], ";}}}");
|
|
58
|
+
return /*#__PURE__*/css("&.k-inline{.k-form-item{display:inline-flex;vertical-align:top;margin-right:", form.item.inlineGap, ";}.k-form-label{width:auto;}}&.k-vertical{.k-form-item{flex-direction:column;}.k-form-label{width:auto;text-align:left;padding:0;justify-content:start;margin-bottom:", form.item.verticalLabelGap, ";}}", _mapInstanceProperty(_context = ['small', 'mini']).call(_context, function (size) {
|
|
59
|
+
return /*#__PURE__*/css("&.k-", size, "{.k-form-item:not(:last-of-type){margin-bottom:", form.item[size + "Gap"], ";}&.k-inline{.k-form-item{margin-right:", form.item[size + "InlineGap"], ";}}}");
|
|
60
60
|
}), ";");
|
|
61
61
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
2
2
|
import { useInstance } from 'intact';
|
|
3
3
|
import { createContext } from '../context';
|
|
4
|
-
import { hasDocumentAvailable, isObject, isNullOrUndefined } from 'intact-shared';
|
|
5
|
-
import { useState } from '../../hooks/useState';
|
|
6
|
-
import { responsiveMap } from './constants';
|
|
7
|
-
var enquire;
|
|
4
|
+
import { hasDocumentAvailable, isObject, isNullOrUndefined } from 'intact-shared'; // import type * as EnquireJs from 'enquire.js';
|
|
8
5
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
6
|
+
import enquire from 'enquire.js';
|
|
7
|
+
import { useState } from '../../hooks/useState';
|
|
8
|
+
import { responsiveMap } from './constants'; // let enquire: typeof EnquireJs;
|
|
9
|
+
// if (hasDocumentAvailable) {
|
|
10
|
+
// enquire = require('enquire.js');
|
|
11
|
+
// }
|
|
12
12
|
|
|
13
13
|
export var context = createContext(0);
|
|
14
14
|
export function useGutter() {
|
|
@@ -22,7 +22,7 @@ export function useGutter() {
|
|
|
22
22
|
xs: false
|
|
23
23
|
});
|
|
24
24
|
|
|
25
|
-
if (
|
|
25
|
+
if (hasDocumentAvailable) {
|
|
26
26
|
var _loop = function _loop(key) {
|
|
27
27
|
enquire.register(responsiveMap[key], {
|
|
28
28
|
match: function match() {
|
|
@@ -10,7 +10,8 @@ var typeDefs = {
|
|
|
10
10
|
size: _concatInstanceProperty(_context = []).call(_context, sizes, ['default', String, Number]),
|
|
11
11
|
color: String,
|
|
12
12
|
rotate: Boolean,
|
|
13
|
-
hoverable: Boolean
|
|
13
|
+
hoverable: Boolean,
|
|
14
|
+
disabled: Boolean
|
|
14
15
|
};
|
|
15
16
|
|
|
16
17
|
var defaults = function defaults() {
|
|
@@ -16,12 +16,14 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
16
16
|
color = _this$get.color,
|
|
17
17
|
rotate = _this$get.rotate,
|
|
18
18
|
hoverable = _this$get.hoverable,
|
|
19
|
-
children = _this$get.children
|
|
19
|
+
children = _this$get.children,
|
|
20
|
+
disabled = _this$get.disabled;
|
|
20
21
|
|
|
21
22
|
var classNameObj = (_classNameObj = {
|
|
22
23
|
'k-icon': true,
|
|
23
24
|
'k-rotate': rotate,
|
|
24
|
-
'k-hoverable': hoverable
|
|
25
|
+
'k-hoverable': !disabled && hoverable,
|
|
26
|
+
'k-disabled': disabled
|
|
25
27
|
}, _classNameObj[className] = className, _classNameObj);
|
|
26
28
|
var _style = {};
|
|
27
29
|
|
|
@@ -11,6 +11,14 @@ var defaults = {
|
|
|
11
11
|
return theme.transition.small;
|
|
12
12
|
},
|
|
13
13
|
|
|
14
|
+
get disabledColor() {
|
|
15
|
+
return theme.color.disabled;
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
get color() {
|
|
19
|
+
return theme.color.lightBlack;
|
|
20
|
+
},
|
|
21
|
+
|
|
14
22
|
fontSize: {
|
|
15
23
|
default: '16px',
|
|
16
24
|
large: '22px',
|
|
@@ -27,11 +35,11 @@ setDefault(function () {
|
|
|
27
35
|
export var colors = ['primary', 'warning', 'danger', 'success'];
|
|
28
36
|
export var sizes = ['large', 'small', 'mini'];
|
|
29
37
|
export default function makeStyles(color) {
|
|
30
|
-
return /*#__PURE__*/css("font-size:", icon.fontSize.default, ";line-height:1;", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
38
|
+
return /*#__PURE__*/css("color:", icon.color, ";font-size:", icon.fontSize.default, ";line-height:1;", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
31
39
|
var fontSize = icon.fontSize[size];
|
|
32
40
|
return /*#__PURE__*/css("&.k-", size, "{font-size:", fontSize, ";}");
|
|
33
41
|
}), " ", _mapInstanceProperty(colors).call(colors, function (color) {
|
|
34
42
|
var _color = theme.color[color];
|
|
35
43
|
return /*#__PURE__*/css("&.k-", color, "{color:", _color, ";&.k-hoverable:hover{color:", palette(_color, -2), ";}}");
|
|
36
|
-
}), " &.k-rotate:before{animation:", rotate, " 1s infinite linear;}&:before{position:relative;font-size:inherit;z-index:1;}&.k-hoverable{cursor:pointer;transition:color ", icon.transition, ";", color && "\n &:hover {\n color: " + palette(color, -2) + " !important;\n }\n ", ";&:hover{color:", theme.color.primary, ";}}");
|
|
44
|
+
}), " &.k-rotate:before{animation:", rotate, " 1s infinite linear;}&:before{position:relative;font-size:inherit;z-index:1;}&.k-hoverable{cursor:pointer;transition:color ", icon.transition, ";", color && "\n &:hover {\n color: " + palette(color, -2) + " !important;\n }\n ", ";&:hover{color:", theme.color.primary, ";}}&.k-disabled{cursor:not-allowed;color:", icon.disabledColor, "!important;}");
|
|
37
45
|
}
|
|
@@ -30,6 +30,7 @@ export interface InputProps<V extends Value = Value> extends InputHTMLAttributes
|
|
|
30
30
|
waveDisabled?: boolean;
|
|
31
31
|
resize?: 'none' | 'vertical' | 'horizontal' | 'both';
|
|
32
32
|
showPassword?: boolean;
|
|
33
|
+
flat?: boolean;
|
|
33
34
|
}
|
|
34
35
|
export declare type AutoRows = {
|
|
35
36
|
min?: number;
|
|
@@ -4,7 +4,7 @@ import { __decorate } from "tslib";
|
|
|
4
4
|
import { Component, createRef } from 'intact';
|
|
5
5
|
import { sizes } from '../../styles/utils';
|
|
6
6
|
import template from './index.vdt';
|
|
7
|
-
import { bind } from '../utils';
|
|
7
|
+
import { bind, selectValue } from '../utils';
|
|
8
8
|
import { useAutoWidth } from './useAutoWidth';
|
|
9
9
|
import { useFrozen } from './useFrozen';
|
|
10
10
|
import { useAutoRows } from './useAutoRows';
|
|
@@ -28,7 +28,8 @@ var typeDefs = {
|
|
|
28
28
|
inline: Boolean,
|
|
29
29
|
waveDisabled: Boolean,
|
|
30
30
|
resize: ['none', 'vertical', 'horizontal', 'both'],
|
|
31
|
-
showPassword: Boolean
|
|
31
|
+
showPassword: Boolean,
|
|
32
|
+
flat: Boolean
|
|
32
33
|
};
|
|
33
34
|
|
|
34
35
|
var defaults = function defaults() {
|
|
@@ -78,15 +79,7 @@ export var Input = /*#__PURE__*/function (_Component) {
|
|
|
78
79
|
};
|
|
79
80
|
|
|
80
81
|
_proto.select = function select() {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
if (input.select) {
|
|
84
|
-
input.select();
|
|
85
|
-
} else if (input.setSelectionRange) {
|
|
86
|
-
// mobile safari
|
|
87
|
-
input.focus();
|
|
88
|
-
input.setSelectionRange(0, input.value.length);
|
|
89
|
-
}
|
|
82
|
+
selectValue(this.inputRef.value);
|
|
90
83
|
};
|
|
91
84
|
|
|
92
85
|
_proto.clear = function clear(e) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime-corejs3/helpers/objectWithoutPropertiesLoose";
|
|
3
|
-
var _excluded = ["className", "style", "type", "value", "defaultValue", "placeholder", "clearable", "disabled", "size", "rows", "autoWidth", "fluid", "width", "stackClearIcon", "frozenOnInput", "readonly", "inline", "waveDisabled", "resize", "ev-click", "ev-mounseenter", "ev-mouseleave"];
|
|
3
|
+
var _excluded = ["className", "style", "type", "value", "defaultValue", "placeholder", "clearable", "disabled", "size", "rows", "autoWidth", "fluid", "width", "stackClearIcon", "frozenOnInput", "readonly", "inline", "waveDisabled", "resize", "flat", "ev-click", "ev-mounseenter", "ev-mouseleave"];
|
|
4
|
+
import _flatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/flat";
|
|
4
5
|
import { createElementVNode as _$ce, className as _$cn, createUnknownComponentVNode as _$cc, noop as _$no, createVNode as _$cv } from 'intact';
|
|
5
6
|
import { Icon } from '../icon';
|
|
6
7
|
import { addStyle, isTextBlock, getRestProps } from '../utils';
|
|
@@ -40,6 +41,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
40
41
|
inline = _this$get.inline,
|
|
41
42
|
waveDisabled = _this$get.waveDisabled,
|
|
42
43
|
resize = _this$get.resize,
|
|
44
|
+
flat = _flatInstanceProperty(_this$get),
|
|
43
45
|
click = _this$get['ev-click'],
|
|
44
46
|
mouseenter = _this$get['ev-mounseenter'],
|
|
45
47
|
mouseleave = _this$get['ev-mouseleave'],
|
|
@@ -54,7 +56,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
54
56
|
var isNotAutoRows = isStringOrNumber(rows) && rows !== 'auto';
|
|
55
57
|
var classNameObj = (_classNameObj = {
|
|
56
58
|
'k-input': true
|
|
57
|
-
}, _classNameObj["k-" + size] = size !== 'default', _classNameObj['k-group'] = $blocks.prepend || $blocks.append, _classNameObj['k-disabled'] = disabled, _classNameObj['k-with-prefix'] = $blocks.prefix, _classNameObj['k-with-suffix'] = $blocks.suffix, _classNameObj['k-clearable'] = clearable, _classNameObj['k-auto-width'] = autoWidth, _classNameObj['k-fluid'] = fluid, _classNameObj['k-stack-clear'] = stackClearIcon, _classNameObj['k-inline'] = inline, _classNameObj["k-resize-" + resize] = type === 'textarea' && isNotAutoRows, _classNameObj["k-resize-none"] = type === 'textarea' && !isNotAutoRows, _classNameObj[className] = className, _classNameObj[makeStyles()] = true, _classNameObj);
|
|
59
|
+
}, _classNameObj["k-" + size] = size !== 'default', _classNameObj['k-group'] = $blocks.prepend || $blocks.append, _classNameObj['k-disabled'] = disabled, _classNameObj['k-with-prefix'] = $blocks.prefix, _classNameObj['k-with-suffix'] = $blocks.suffix, _classNameObj['k-clearable'] = clearable, _classNameObj['k-auto-width'] = autoWidth, _classNameObj['k-fluid'] = fluid, _classNameObj['k-stack-clear'] = stackClearIcon, _classNameObj['k-inline'] = inline, _classNameObj['k-flat'] = flat, _classNameObj["k-resize-" + resize] = type === 'textarea' && isNotAutoRows, _classNameObj["k-resize-none"] = type === 'textarea' && !isNotAutoRows, _classNameObj[className] = className, _classNameObj[makeStyles()] = true, _classNameObj);
|
|
58
60
|
var _this$showPassword = this.showPassword,
|
|
59
61
|
isShowPassword = _this$showPassword.isShow,
|
|
60
62
|
toggleShowPassword = _this$showPassword.toggleShow,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _flatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/flat";
|
|
1
2
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js/instance/map";
|
|
2
3
|
import { css } from '@emotion/css';
|
|
3
4
|
import { theme, setDefault } from '../../styles/theme';
|
|
@@ -85,6 +86,17 @@ var defaults = deepDefaults({
|
|
|
85
86
|
// search input
|
|
86
87
|
search: {
|
|
87
88
|
suffixMarginRight: '15px'
|
|
89
|
+
},
|
|
90
|
+
// flat
|
|
91
|
+
flat: {
|
|
92
|
+
get color() {
|
|
93
|
+
return theme.color.lightBlack;
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
get bgColor() {
|
|
97
|
+
return theme.color.bg;
|
|
98
|
+
}
|
|
99
|
+
|
|
88
100
|
}
|
|
89
101
|
}, sizes.reduce(function (memo, size) {
|
|
90
102
|
var styles = theme[size];
|
|
@@ -102,16 +114,6 @@ var defaults = deepDefaults({
|
|
|
102
114
|
}
|
|
103
115
|
|
|
104
116
|
};
|
|
105
|
-
|
|
106
|
-
if (size === 'large') {
|
|
107
|
-
// use default padding for large size
|
|
108
|
-
Object.defineProperty(memo.large, 'paddingGap', {
|
|
109
|
-
get: function get() {
|
|
110
|
-
return theme.default.padding;
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
|
|
115
117
|
return memo;
|
|
116
118
|
}, {}));
|
|
117
119
|
var input;
|
|
@@ -123,7 +125,7 @@ setDefault(function () {
|
|
|
123
125
|
export function makeStyles() {
|
|
124
126
|
var _context;
|
|
125
127
|
|
|
126
|
-
return /*#__PURE__*/css("display:inline-block;width:", input.width, ";vertical-align:middle;.k-input-wrapper{display:inline-block;width:100%;position:relative;}.k-input-inner{display:inline-block;width:100%;border:", input.border, ";background-color:", input.bgColor, ";transition:border ", input.transition, ",background ", input.transition, ",box-shadow ", input.transition, ";border-radius:", input.borderRadius, ";outline:none;position:relative;color:", input.color, ";&:hover{border:", input.hoverBorder, ";z-index:1;}&:focus{border:", input.focusBorder, ";z-index:1;}&::placeholder{color:", input.placeholderColor, ";}}&.k-fluid{width:100%;}.k-input-prefix,.k-input-suffix{position:absolute;top:50%;transform:translateY(-50%);z-index:2;}.k-input-clear{opacity:0;transition:opacity ", input.transition, ";pointer-events:none;color:", input.clearIconColor, ";+*{margin-left:", input.clearIconGap, ";}}&:hover .k-input-clear.k-input-show{opacity:1;pointer-events:all;}.k-input-show-password{color:", input.clearIconColor, ";}&.k-stack-clear{.k-input-clear{position:absolute;z-index:1;right:0;&.k-input-show+i{transition:opacity ", input.transition, ";}}&:hover{.k-input-clear.k-input-show+i{opacity:0;}}}&.k-group{display:table;.k-input-inner{border-radius:0;}.k-input-wrapper:first-child{.k-input-inner{border-radius:", input.borderRadius, " 0 0 ", input.borderRadius, ";}}.k-input-wrapper:last-child{.k-input-inner{border-radius:0 ", input.borderRadius, " ", input.borderRadius, " 0;}}}.k-input-prepend,.k-input-append{display:table-cell;width:1px;vertical-align:middle;background-color:", input.groupBgColor, ";border:", input.border, ";text-align:center;white-space:nowrap;.k-btn{margin:-1px
|
|
128
|
+
return /*#__PURE__*/css("display:inline-block;width:", input.width, ";vertical-align:middle;.k-input-wrapper{display:inline-block;width:100%;position:relative;}.k-input-inner{display:inline-block;width:100%;border:", input.border, ";background-color:", input.bgColor, ";transition:border ", input.transition, ",background ", input.transition, ",box-shadow ", input.transition, ";border-radius:", input.borderRadius, ";outline:none;position:relative;color:", input.color, ";&:hover{border:", input.hoverBorder, ";z-index:1;}&:focus{border:", input.focusBorder, ";z-index:1;}&::placeholder{color:", input.placeholderColor, ";}}&.k-fluid{width:100%;}.k-input-prefix,.k-input-suffix{position:absolute;top:50%;transform:translateY(-50%);z-index:2;color:", theme.color.lightBlack, ";line-height:1;}.k-input-clear{opacity:0;transition:opacity ", input.transition, ";pointer-events:none;color:", input.clearIconColor, ";+*{margin-left:", input.clearIconGap, ";}}&:hover .k-input-clear.k-input-show{opacity:1;pointer-events:all;}.k-input-show-password{color:", input.clearIconColor, ";}&.k-stack-clear{.k-input-clear{position:absolute;z-index:1;right:0;&.k-input-show+i{transition:opacity ", input.transition, ";}}&:hover{.k-input-clear.k-input-show+i{opacity:0;}}}&.k-group{display:table;.k-input-inner{border-radius:0;}.k-input-wrapper:first-child{.k-input-inner{border-radius:", input.borderRadius, " 0 0 ", input.borderRadius, ";}}.k-input-wrapper:last-child{.k-input-inner{border-radius:0 ", input.borderRadius, " ", input.borderRadius, " 0;}}}.k-input-prepend,.k-input-append{display:table-cell;width:1px;vertical-align:middle;background-color:", input.groupBgColor, ";border:", input.border, ";text-align:center;white-space:nowrap;.k-btn{margin:-1px;border:none;&.k-none:hover{background:transparent;}}.k-select{margin:-1px;text-align:left;}}.k-input-prepend{&,.k-btn,.k-select{z-index:1;border-radius:", input.borderRadius, " 0 0 ", input.borderRadius, ";}}.k-input-append{&,.k-btn,.k-select{z-index:1;border-radius:0 ", input.borderRadius, " ", input.borderRadius, " 0;}}.k-input-padding{padding:0 ", input.groupPaddingGap, ";}.k-input-prepend{border-right:none;}.k-input-append{border-left:none;}&.k-flat{.k-input-inner{border:none;background:", _flatInstanceProperty(input).bgColor, ";color:", _flatInstanceProperty(input).color, ";}}&.k-disabled{color:", input.disabledColor, ";cursor:not-allowed;.k-input-inner{color:", input.disabledColor, ";border-color:", input.disabledBorderColor, ";background:", input.disabledBgColor, ";cursor:not-allowed;}}", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
127
129
|
var styles = input[size];
|
|
128
130
|
var sizeClassName = /*#__PURE__*/css("font-size:", styles.fontSize, ";.k-input-inner{height:", styles.height, ";line-height:", styles.height, ";font-size:", styles.fontSize, ";padding:0 ", styles.paddingGap, ";}.k-input-prefix{left:", styles.paddingGap, ";}.k-input-suffix{right:", styles.paddingGap, ";}&.k-with-prefix{.k-input-inner{padding-left:calc(", styles.paddingGap, " + 1rem + ", input.clearIconGap, ");}}&.k-with-suffix,&.k-clearable{.k-input-inner{padding-right:calc(", styles.paddingGap, " + 1rem + ", input.clearIconGap, ");}}&:not(.k-stack-clear).k-with-suffix.k-clearable{.k-input-inner{padding-right:calc(", styles.paddingGap, " + 2rem + ", input.clearIconGap, " * 2);}}");
|
|
129
131
|
if (size === 'default') return sizeClassName;
|
|
@@ -5,7 +5,8 @@ import { Icon } from '../icon';
|
|
|
5
5
|
import { getRestProps } from '../utils';
|
|
6
6
|
import { makeMessageStyles } from './styles';
|
|
7
7
|
var _$tmp0 = {
|
|
8
|
-
'className': '
|
|
8
|
+
'className': 'k-icon-close',
|
|
9
|
+
'hoverable': true
|
|
9
10
|
};
|
|
10
11
|
export default function ($props, $blocks, $__proto__) {
|
|
11
12
|
var _classNameObj, _$cn2;
|
|
@@ -23,12 +24,12 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
23
24
|
|
|
24
25
|
var classNameObj = (_classNameObj = {
|
|
25
26
|
"k-message": true
|
|
26
|
-
}, _classNameObj["k-" + type] = type
|
|
27
|
+
}, _classNameObj["k-" + type] = type, _classNameObj[makeMessageStyles()] = true, _classNameObj);
|
|
27
28
|
var iconMap = {
|
|
28
|
-
info: 'information',
|
|
29
|
-
warning: '
|
|
30
|
-
success: '
|
|
31
|
-
error: '
|
|
29
|
+
info: 'information-fill',
|
|
30
|
+
warning: 'warning-fill',
|
|
31
|
+
success: 'success-fill',
|
|
32
|
+
error: 'error-fill'
|
|
32
33
|
};
|
|
33
34
|
return _$cv('div', _extends({}, getRestProps(this), {
|
|
34
35
|
'className': _$cn(classNameObj),
|
|
@@ -9,6 +9,7 @@ var defaults = {
|
|
|
9
9
|
},
|
|
10
10
|
|
|
11
11
|
top: "10px",
|
|
12
|
+
left: "0px",
|
|
12
13
|
transform: "translateY(-10px)",
|
|
13
14
|
|
|
14
15
|
get bgColor() {
|
|
@@ -22,11 +23,10 @@ var defaults = {
|
|
|
22
23
|
gap: "10px",
|
|
23
24
|
boxShadow: 'none',
|
|
24
25
|
padding: "7px 33px 8px 8px",
|
|
25
|
-
closeFontSize: "26px",
|
|
26
26
|
fontSize: '12px',
|
|
27
27
|
|
|
28
28
|
get color() {
|
|
29
|
-
return theme.color.
|
|
29
|
+
return theme.color.text;
|
|
30
30
|
},
|
|
31
31
|
|
|
32
32
|
minWidth: '400px',
|
|
@@ -39,10 +39,10 @@ var defaults = {
|
|
|
39
39
|
},
|
|
40
40
|
|
|
41
41
|
icon: {
|
|
42
|
-
color:
|
|
43
|
-
fontSize: "
|
|
42
|
+
// color: `inherit`,
|
|
43
|
+
fontSize: "18px",
|
|
44
44
|
left: "16px",
|
|
45
|
-
top: "
|
|
45
|
+
top: "7px"
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
48
|
var message;
|
|
@@ -52,13 +52,13 @@ setDefault(function () {
|
|
|
52
52
|
}).message;
|
|
53
53
|
});
|
|
54
54
|
export function makeMessagesStyles() {
|
|
55
|
-
return /*#__PURE__*/css("position:fixed;top:", message.top, ";width:100%;pointer-events:none;z-index:", theme.maxZIndex + 1, ";");
|
|
55
|
+
return /*#__PURE__*/css("position:fixed;top:", message.top, ";left:", message.left, ";width:100%;pointer-events:none;z-index:", theme.maxZIndex + 1, ";");
|
|
56
56
|
}
|
|
57
57
|
export function makeMessageStyles() {
|
|
58
58
|
var _context;
|
|
59
59
|
|
|
60
|
-
return /*#__PURE__*/css("text-align:center;width:100%;font-size:", message.fontSize, ";color:", message.color, ";.k-message-container{display:inline-block;box-shadow:", message.boxShadow, ";
|
|
60
|
+
return /*#__PURE__*/css("text-align:center;width:100%;font-size:", message.fontSize, ";color:", message.color, ";.k-message-container{display:inline-block;box-shadow:", message.boxShadow, ";border-radius:", message.borderRadius, ";margin-bottom:", message.gap, ";pointer-events:all;min-width:", message.minWidth, ";max-width:", message.maxWidth, ";position:relative;text-align:", message.textAlign, ";min-height:", message.minHeight, ";}.k-message-wrapper{position:relative;display:inline-block;&.k-with-icon{padding-left:calc(", message.icon.left, " + 14px);}}.k-message-content{display:inline-block;padding:", message.padding, ";vertical-align:middle;word-break:break-word;word-wrap:break-word;}.k-message-close{vertical-align:middle;position:absolute;right:0;top:0;&:hover{background:none;}}.k-message-icon{position:absolute;left:", message.icon.left, ";top:", message.icon.top, ";font-size:", message.icon.fontSize, ";}", _mapInstanceProperty(_context = ['info', 'error', 'success', 'warning']).call(_context, function (type) {
|
|
61
61
|
var color = theme.color[type === 'error' ? 'danger' : type];
|
|
62
|
-
return /*#__PURE__*/css("&.k-", type, "{.k-message-container{
|
|
62
|
+
return /*#__PURE__*/css("&.k-", type, "{.k-message-container{background:", palette(color, -4), ";}.k-message-icon{color:", color, ";}}");
|
|
63
63
|
}), "&.transition-enter-from,&.transition-leave-to{opacity:0;transform:", message.transform, ";}&.transition-enter-active,&.transition-leave-active{transition:transform ", message.transition, ",opacity ", message.transition, ";}&.transition-move{transition:transform ", message.transition, ";}");
|
|
64
64
|
}
|
|
@@ -6,11 +6,13 @@ import BasicDemo from '~/components/pagination/demos/basic';
|
|
|
6
6
|
import GotoDemo from '~/components/pagination/demos/goto';
|
|
7
7
|
import CurrentDemo from '~/components/pagination/demos/current';
|
|
8
8
|
import DisableDemo from '~/components/pagination/demos/disable';
|
|
9
|
-
import { mount, dispatchEvent, wait } from '../../test/utils';
|
|
9
|
+
import { mount, unmount, dispatchEvent, wait } from '../../test/utils';
|
|
10
10
|
import { Component } from 'intact';
|
|
11
11
|
import { Pagination } from '.';
|
|
12
12
|
describe('Pagination', function () {
|
|
13
|
-
|
|
13
|
+
afterEach(function () {
|
|
14
|
+
return unmount();
|
|
15
|
+
});
|
|
14
16
|
it('basic test', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
15
17
|
var _mount, instance, element, pagination, btns, prev, next;
|
|
16
18
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime-corejs3/helpers/extends";
|
|
2
|
+
import _flatInstanceProperty from "@babel/runtime-corejs3/core-js/instance/flat";
|
|
2
3
|
import { createCommentVNode as _$ccv, createUnknownComponentVNode as _$cc, createElementVNode as _$ce, createTextVNode as _$ct, createVNode as _$cv, className as _$cn, map as _$ma } from 'intact';
|
|
3
4
|
import { getRestProps, mapChildren } from '../utils';
|
|
4
5
|
import { ButtonGroup, Button } from '../button';
|
|
@@ -8,10 +9,10 @@ import { Icon } from '../icon';
|
|
|
8
9
|
import { _$ } from '../../i18n';
|
|
9
10
|
import { makeStyles } from './styles';
|
|
10
11
|
var _$tmp0 = {
|
|
11
|
-
'className': '
|
|
12
|
+
'className': 'k-icon-arrow-left'
|
|
12
13
|
};
|
|
13
14
|
var _$tmp1 = {
|
|
14
|
-
'className': '
|
|
15
|
+
'className': 'k-icon-arrow-right'
|
|
15
16
|
};
|
|
16
17
|
export default function ($props, $blocks, $__proto__) {
|
|
17
18
|
var _classNameObj;
|
|
@@ -23,7 +24,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
23
24
|
var _this$get = this.get(),
|
|
24
25
|
total = _this$get.total,
|
|
25
26
|
size = _this$get.size,
|
|
26
|
-
|
|
27
|
+
flat = _flatInstanceProperty(_this$get),
|
|
27
28
|
simple = _this$get.simple,
|
|
28
29
|
className = _this$get.className,
|
|
29
30
|
showTotal = _this$get.showTotal,
|
|
@@ -39,13 +40,8 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
39
40
|
if (!total) return _$ccv(' pagination ');
|
|
40
41
|
var classNameObj = (_classNameObj = {
|
|
41
42
|
'k-pagination': true
|
|
42
|
-
}, _classNameObj[className] = className, _classNameObj["k-" + size] = size !== 'default', _classNameObj['k-
|
|
43
|
-
var type = 'default';
|
|
44
|
-
|
|
45
|
-
if (noBorder || simple) {
|
|
46
|
-
type = 'none';
|
|
47
|
-
}
|
|
48
|
-
|
|
43
|
+
}, _classNameObj[className] = className, _classNameObj["k-" + size] = size !== 'default', _classNameObj['k-flat'] = flat, _classNameObj['k-simple'] = simple, _classNameObj[makeStyles()] = true, _classNameObj);
|
|
44
|
+
var type = flat ? 'flat' : simple ? 'none' : 'default';
|
|
49
45
|
var totalPages = Math.ceil(total / limit) || 0;
|
|
50
46
|
|
|
51
47
|
var paginationButton = function paginationButton(page) {
|
|
@@ -140,19 +136,21 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
140
136
|
|
|
141
137
|
return _$cv('div', _extends({
|
|
142
138
|
'className': _$cn(classNameObj)
|
|
143
|
-
}, getRestProps(this)), [_$
|
|
139
|
+
}, getRestProps(this)), [showTotal && !simple ? _$ce(2, 'div', _$('共 {n} 条', {
|
|
140
|
+
n: total
|
|
141
|
+
}), 0, 'k-pagination-total') : undefined, _$cc(ButtonGroup, {
|
|
144
142
|
'checkType': 'radio',
|
|
145
143
|
'children': [_$cc(Button, {
|
|
146
144
|
'icon': true,
|
|
147
145
|
'size': size,
|
|
148
|
-
'type':
|
|
146
|
+
'type': 'none',
|
|
149
147
|
'disabled': value <= 1 || !!(disablePage && disablePage(value - 1, limit)),
|
|
150
148
|
'ev-click': this.prev,
|
|
151
149
|
'children': _$cc(Icon, _$tmp0)
|
|
152
150
|
}), paginationItems, _$cc(Button, {
|
|
153
151
|
'icon': true,
|
|
154
152
|
'size': size,
|
|
155
|
-
'type':
|
|
153
|
+
'type': 'none',
|
|
156
154
|
'disabled': value >= totalPages || !!(disablePage && disablePage(value + 1, limit)),
|
|
157
155
|
'ev-click': this.next,
|
|
158
156
|
'children': _$cc(Icon, _$tmp1)
|
|
@@ -163,6 +161,7 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
163
161
|
'value': $this.get('value')
|
|
164
162
|
}), !simple ? [showLimits ? _$ce(2, 'div', _$cc(Select, {
|
|
165
163
|
'size': size,
|
|
164
|
+
'flat': flat,
|
|
166
165
|
'children': _$ma(limits, function ($value, $key) {
|
|
167
166
|
return _$cc(Option, {
|
|
168
167
|
'value': $value,
|
|
@@ -175,12 +174,11 @@ export default function ($props, $blocks, $__proto__) {
|
|
|
175
174
|
$this.set('limit', $v);
|
|
176
175
|
},
|
|
177
176
|
'value': $this.get('limit')
|
|
178
|
-
}), 2, 'k-pagination-limits') : undefined, showGoto ? _$ce(2, 'div', [_$ce(2, 'span', _$('
|
|
177
|
+
}), 2, 'k-pagination-limits') : undefined, showGoto ? _$ce(2, 'div', [_$ce(2, 'span', _$('前往'), 0, 'c-middle'), _$cc(Input, {
|
|
179
178
|
'size': size,
|
|
180
179
|
'value': value,
|
|
181
|
-
'ev-change': this.goto
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
}), 0, 'k-pagination-total') : undefined] : undefined]);
|
|
180
|
+
'ev-change': this.goto,
|
|
181
|
+
'flat': flat
|
|
182
|
+
}), _$ce(2, 'span', _$('页'), 0, 'c-middle')], 4, 'k-pagination-goto') : undefined] : undefined]);
|
|
185
183
|
}
|
|
186
184
|
;
|
|
@@ -23,7 +23,16 @@ var defaults = deepDefaults({
|
|
|
23
23
|
gap: '16px',
|
|
24
24
|
btn: {
|
|
25
25
|
gap: '6px',
|
|
26
|
-
padding: '0 3px'
|
|
26
|
+
padding: '0 3px',
|
|
27
|
+
|
|
28
|
+
get borderRadius() {
|
|
29
|
+
return theme.borderRadius;
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
get hoverBgColor() {
|
|
33
|
+
return theme.color.hoverBg;
|
|
34
|
+
}
|
|
35
|
+
|
|
27
36
|
},
|
|
28
37
|
// goto
|
|
29
38
|
goto: {
|
|
@@ -55,9 +64,9 @@ setDefault(function () {
|
|
|
55
64
|
}).pagination;
|
|
56
65
|
});
|
|
57
66
|
export function makeStyles() {
|
|
58
|
-
return /*#__PURE__*/css("font-size:", pagination.fontSize, "
|
|
67
|
+
return /*#__PURE__*/css("font-size:", pagination.fontSize, ";>*{display:inline-block;vertical-align:middle;&:not(:first-child){margin-left:", pagination.gap, ";}}.k-pagination-ellipsis{background-color:transparent;border-color:transparent;}.k-btns{.k-btn{width:auto!important;min-width:", button.height, ";padding:", pagination.btn.padding, ";margin-right:", pagination.btn.gap, ";border-radius:", pagination.btn.borderRadius, "!important;&:last-of-type{margin:0!important;}&:hover{background:", pagination.btn.hoverBgColor, ";}}.k-icon{font-size:18px;}}.k-pagination-goto{.k-input{font-size:inherit;width:", pagination.goto.width, ";margin:", pagination.goto.gap, ";}.k-input-inner{text-align:center;}}.k-select{width:auto;}", _mapInstanceProperty(sizes).call(sizes, function (size) {
|
|
59
68
|
var styles = pagination[size];
|
|
60
69
|
var btnStyles = button[size];
|
|
61
70
|
return /*#__PURE__*/css("&.k-", size, "{font-size:", styles.fontSize, ";.k-btn{margin-right:", styles.btnGap, ";min-width:", btnStyles.height, ";.k-icon{font-size:", styles.iconFontSize, ";}}}");
|
|
62
|
-
}), "&.k-
|
|
71
|
+
}), "&.k-flat{.k-select{&,&:hover,&.k-show{border-color:transparent;}}}&.k-simple{.k-btn{margin:0;}.k-input-inner{text-align:center;}.k-pagination-text{vertical-align:middle;}}");
|
|
63
72
|
}
|