@kdcloudjs/kdesign 1.0.2 → 1.1.0
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/LICENSE +104 -105
- package/dist/default-theme.js +17 -12
- package/dist/kdesign-complete.less +3334 -1374
- package/dist/kdesign.css +2565 -1931
- package/dist/kdesign.css.map +1 -1
- package/dist/kdesign.js +783 -112
- package/dist/kdesign.js.map +1 -1
- package/dist/kdesign.min.css +4 -4
- package/dist/kdesign.min.js +6 -6
- package/dist/kdesign.min.js.map +1 -1
- package/es/alert/style/index.css +32 -30
- package/es/alert/style/index.less +36 -37
- package/es/alert/style/token.less +29 -0
- package/es/anchor/style/index.css +48 -34
- package/es/anchor/style/index.less +19 -16
- package/es/anchor/style/mixin.less +1 -0
- package/es/anchor/style/token.less +33 -0
- package/es/avatar/style/index.css +18 -18
- package/es/avatar/style/index.less +4 -25
- package/es/avatar/style/mixin.less +21 -4
- package/es/avatar/style/token.less +20 -0
- package/es/badge/style/index.css +38 -29
- package/es/badge/style/index.less +28 -30
- package/es/badge/style/mixin.less +1 -5
- package/es/badge/style/token.less +23 -0
- package/es/base-data/style/index.css +25 -16
- package/es/base-data/style/index.less +17 -17
- package/es/base-data/style/token.less +27 -0
- package/es/button/button.d.ts +1 -3
- package/es/button/button.js +3 -15
- package/es/button/style/index.css +80 -81
- package/es/button/style/index.less +43 -51
- package/es/button/style/mixin.less +6 -4
- package/es/button/style/token.less +88 -0
- package/es/card/card.d.ts +1 -0
- package/es/card/card.js +4 -1
- package/es/card/style/index.css +48 -23
- package/es/card/style/index.less +43 -23
- package/es/card/style/token.less +28 -0
- package/es/carousel/style/index.css +36 -30
- package/es/carousel/style/index.less +14 -6
- package/es/carousel/style/mixin.less +1 -4
- package/es/carousel/style/token.less +20 -0
- package/es/cascader/cascader.js +1 -1
- package/es/cascader/style/index.css +35 -26
- package/es/cascader/style/index.less +24 -23
- package/es/cascader/style/token.less +28 -0
- package/es/checkbox/style/index.css +86 -80
- package/es/checkbox/style/index.less +26 -27
- package/es/checkbox/style/token.less +48 -0
- package/es/city-picker/style/index.css +24 -14
- package/es/city-picker/style/index.less +16 -16
- package/es/city-picker/style/token.less +25 -0
- package/es/collapse/style/index.css +37 -26
- package/es/collapse/style/index.less +7 -5
- package/es/collapse/style/mixin.less +1 -5
- package/es/collapse/style/token.less +26 -0
- package/es/config-provider/compDefaultProps.d.ts +4 -1
- package/es/config-provider/compDefaultProps.js +5 -2
- package/es/date-picker/style/index.css +81 -72
- package/es/date-picker/style/index.less +36 -36
- package/es/date-picker/style/mixin.less +20 -18
- package/es/date-picker/style/token.less +71 -0
- package/es/drawer/drawer.d.ts +0 -1
- package/es/drawer/drawer.js +6 -26
- package/es/drawer/style/index.css +37 -31
- package/es/drawer/style/index.less +24 -39
- package/es/drawer/style/token.less +23 -0
- package/es/dropdown/dropdown.d.ts +1 -0
- package/es/dropdown/dropdown.js +13 -8
- package/es/dropdown/menu.d.ts +1 -1
- package/es/dropdown/menu.js +3 -3
- package/es/dropdown/style/index.css +57 -48
- package/es/dropdown/style/index.less +27 -24
- package/es/dropdown/style/token.less +26 -0
- package/es/empty/defaultEmptyImg.d.ts +2 -0
- package/es/empty/defaultEmptyImg.js +92 -0
- package/es/empty/empty.d.ts +5 -1
- package/es/empty/empty.js +10 -9
- package/es/empty/illustrationEmptyImg.d.ts +2 -0
- package/es/empty/illustrationEmptyImg.js +439 -0
- package/es/empty/style/index.css +12 -3
- package/es/empty/style/index.less +1 -1
- package/es/empty/style/token.less +12 -0
- package/es/filter/style/index.css +44 -32
- package/es/filter/style/index.less +34 -32
- package/es/filter/style/token.less +28 -0
- package/es/form/style/index.css +19 -10
- package/es/form/style/index.less +9 -6
- package/es/form/style/token.less +27 -0
- package/es/grid/style/index.css +9 -0
- package/es/image/style/index.css +32 -23
- package/es/image/style/index.less +23 -22
- package/es/image/style/token.less +45 -0
- package/es/image-cropper/style/index.css +9 -0
- package/es/image-cropper/style/index.less +1 -1
- package/es/index.d.ts +1 -0
- package/es/index.js +2 -1
- package/es/input/style/index.css +97 -88
- package/es/input/style/index.less +34 -31
- package/es/input/style/mixin.less +54 -47
- package/es/input/style/token.less +46 -0
- package/es/input-number/style/css.js +1 -0
- package/es/input-number/style/index.css +25 -16
- package/es/input-number/style/index.d.ts +1 -0
- package/es/input-number/style/index.js +1 -0
- package/es/input-number/style/index.less +12 -12
- package/es/input-number/style/mixin.less +4 -2
- package/es/input-number/style/token.less +20 -0
- package/es/layout/style/index.css +41 -32
- package/es/layout/style/index.less +9 -8
- package/es/layout/style/token.less +30 -0
- package/es/link/index.d.ts +3 -0
- package/es/link/index.js +3 -0
- package/es/link/link.d.ts +18 -0
- package/es/link/link.js +89 -0
- package/es/link/style/css.js +2 -0
- package/es/link/style/index.css +155 -0
- package/es/link/style/index.d.ts +2 -0
- package/es/link/style/index.js +2 -0
- package/es/link/style/index.less +61 -0
- package/es/link/style/mixin.less +7 -0
- package/es/link/style/token.less +24 -0
- package/es/menu/menuItem.js +1 -2
- package/es/menu/style/index.css +89 -80
- package/es/menu/style/index.less +51 -26
- package/es/menu/style/mixin.less +16 -19
- package/es/menu/style/token.less +32 -0
- package/es/message/style/index.css +23 -13
- package/es/message/style/index.less +15 -13
- package/es/message/style/token.less +21 -0
- package/es/modal/style/index.css +37 -28
- package/es/modal/style/index.less +16 -26
- package/es/modal/style/mixin.less +2 -0
- package/es/modal/style/token.less +46 -0
- package/es/notification/content.js +1 -1
- package/es/notification/style/index.css +34 -25
- package/es/notification/style/index.less +21 -20
- package/es/notification/style/token.less +28 -0
- package/es/pagination/pagination.js +2 -2
- package/es/pagination/style/index.css +159 -159
- package/es/pagination/style/index.less +104 -113
- package/es/pagination/style/token.less +28 -0
- package/es/popconfirm/style/index.css +54 -33
- package/es/popconfirm/style/index.less +41 -20
- package/es/popconfirm/style/token.less +28 -0
- package/es/progress/style/index.css +41 -27
- package/es/progress/style/index.less +24 -8
- package/es/progress/style/mixin.less +2 -1
- package/es/progress/style/token.less +40 -0
- package/es/radio/style/index.css +91 -76
- package/es/radio/style/index.less +76 -64
- package/es/radio/style/token.less +47 -0
- package/es/rate/style/index.css +26 -17
- package/es/rate/style/index.less +4 -3
- package/es/rate/style/token.less +18 -0
- package/es/search/style/index.css +103 -82
- package/es/search/style/index.less +49 -35
- package/es/search/style/mixin.less +4 -2
- package/es/search/style/token.less +60 -0
- package/es/select/select.js +3 -14
- package/es/select/style/index.css +46 -37
- package/es/select/style/index.less +10 -10
- package/es/select/style/mixin.less +4 -7
- package/es/select/style/token.less +43 -0
- package/es/slider/slider.js +5 -13
- package/es/slider/sliderTooltip.js +0 -1
- package/es/slider/style/index.css +21 -12
- package/es/slider/style/index.less +10 -10
- package/es/slider/style/mixin.less +3 -1
- package/es/slider/style/token.less +17 -0
- package/es/space/style/index.css +9 -0
- package/es/spin/style/index.css +23 -14
- package/es/spin/style/index.less +3 -2
- package/es/spin/style/mixin.less +1 -0
- package/es/spin/style/token.less +15 -0
- package/es/split-panel/style/index.css +35 -44
- package/es/split-panel/style/index.less +16 -34
- package/es/split-panel/style/token.less +23 -0
- package/es/stepper/style/index.css +50 -25
- package/es/stepper/style/index.less +45 -11
- package/es/stepper/style/mixin.less +7 -5
- package/es/stepper/style/token.less +28 -0
- package/es/steps/Steps.js +4 -1
- package/es/steps/style/index.css +74 -37
- package/es/steps/style/index.less +281 -189
- package/es/steps/style/token.less +31 -0
- package/es/style/mixins/index.less +10 -9
- package/es/style/mixins/overlay.less +2 -2
- package/es/style/themes/default.less +22 -12
- package/es/style/themes/token.less +128 -0
- package/es/switch/style/index.css +38 -29
- package/es/switch/style/index.less +17 -6
- package/es/switch/style/mixin.less +6 -5
- package/es/switch/style/token.less +45 -0
- package/es/tabs/style/index.css +59 -50
- package/es/tabs/style/index.less +3 -3
- package/es/tabs/style/mixin.less +2 -0
- package/es/tabs/style/token.less +32 -0
- package/es/tabs/tabs.js +3 -1
- package/es/tag/style/index.css +122 -113
- package/es/tag/style/index.less +19 -19
- package/es/tag/style/mixin.less +2 -1
- package/es/tag/style/token.less +42 -0
- package/es/timeline/style/index.css +40 -30
- package/es/timeline/style/index.less +33 -30
- package/es/timeline/style/token.less +45 -0
- package/es/tooltip/style/index.css +26 -17
- package/es/tooltip/style/index.less +6 -5
- package/es/tooltip/style/token.less +20 -0
- package/es/transfer/operation.js +2 -2
- package/es/transfer/style/index.css +37 -24
- package/es/transfer/style/index.less +4 -0
- package/es/transfer/style/mixins.less +2 -0
- package/es/transfer/style/token.less +29 -0
- package/es/tree/style/index.css +37 -37
- package/es/tree/style/index.less +8 -20
- package/es/tree/style/mixin.less +1 -5
- package/es/tree/style/token.less +27 -0
- package/es/typography/style/index.css +46 -53
- package/es/typography/style/index.less +15 -15
- package/es/typography/style/mixin.less +9 -11
- package/es/typography/style/token.less +38 -0
- package/es/upload/style/index.css +41 -31
- package/es/upload/style/index.less +27 -25
- package/es/upload/style/token.less +28 -0
- package/lib/alert/style/index.css +32 -30
- package/lib/alert/style/index.less +36 -37
- package/lib/alert/style/token.less +29 -0
- package/lib/anchor/style/index.css +48 -34
- package/lib/anchor/style/index.less +19 -16
- package/lib/anchor/style/mixin.less +1 -0
- package/lib/anchor/style/token.less +33 -0
- package/lib/avatar/style/index.css +18 -18
- package/lib/avatar/style/index.less +4 -25
- package/lib/avatar/style/mixin.less +21 -4
- package/lib/avatar/style/token.less +20 -0
- package/lib/badge/style/index.css +38 -29
- package/lib/badge/style/index.less +28 -30
- package/lib/badge/style/mixin.less +1 -5
- package/lib/badge/style/token.less +23 -0
- package/lib/base-data/style/index.css +25 -16
- package/lib/base-data/style/index.less +17 -17
- package/lib/base-data/style/token.less +27 -0
- package/lib/button/button.d.ts +1 -3
- package/lib/button/button.js +3 -15
- package/lib/button/style/index.css +80 -81
- package/lib/button/style/index.less +43 -51
- package/lib/button/style/mixin.less +6 -4
- package/lib/button/style/token.less +88 -0
- package/lib/card/card.d.ts +1 -0
- package/lib/card/card.js +4 -1
- package/lib/card/style/index.css +48 -23
- package/lib/card/style/index.less +43 -23
- package/lib/card/style/token.less +28 -0
- package/lib/carousel/style/index.css +36 -30
- package/lib/carousel/style/index.less +14 -6
- package/lib/carousel/style/mixin.less +1 -4
- package/lib/carousel/style/token.less +20 -0
- package/lib/cascader/cascader.js +1 -1
- package/lib/cascader/style/index.css +35 -26
- package/lib/cascader/style/index.less +24 -23
- package/lib/cascader/style/token.less +28 -0
- package/lib/checkbox/style/index.css +86 -80
- package/lib/checkbox/style/index.less +26 -27
- package/lib/checkbox/style/token.less +48 -0
- package/lib/city-picker/style/index.css +24 -14
- package/lib/city-picker/style/index.less +16 -16
- package/lib/city-picker/style/token.less +25 -0
- package/lib/collapse/style/index.css +37 -26
- package/lib/collapse/style/index.less +7 -5
- package/lib/collapse/style/mixin.less +1 -5
- package/lib/collapse/style/token.less +26 -0
- package/lib/config-provider/compDefaultProps.d.ts +4 -1
- package/lib/config-provider/compDefaultProps.js +5 -2
- package/lib/date-picker/style/index.css +81 -72
- package/lib/date-picker/style/index.less +36 -36
- package/lib/date-picker/style/mixin.less +20 -18
- package/lib/date-picker/style/token.less +71 -0
- package/lib/drawer/drawer.d.ts +0 -1
- package/lib/drawer/drawer.js +6 -26
- package/lib/drawer/style/index.css +37 -31
- package/lib/drawer/style/index.less +24 -39
- package/lib/drawer/style/token.less +23 -0
- package/lib/dropdown/dropdown.d.ts +1 -0
- package/lib/dropdown/dropdown.js +13 -8
- package/lib/dropdown/menu.d.ts +1 -1
- package/lib/dropdown/menu.js +3 -3
- package/lib/dropdown/style/index.css +57 -48
- package/lib/dropdown/style/index.less +27 -24
- package/lib/dropdown/style/token.less +26 -0
- package/lib/empty/defaultEmptyImg.d.ts +2 -0
- package/lib/empty/defaultEmptyImg.js +113 -0
- package/lib/empty/empty.d.ts +5 -1
- package/lib/empty/empty.js +13 -9
- package/lib/empty/illustrationEmptyImg.d.ts +2 -0
- package/lib/empty/illustrationEmptyImg.js +460 -0
- package/lib/empty/style/index.css +12 -3
- package/lib/empty/style/index.less +1 -1
- package/lib/empty/style/token.less +12 -0
- package/lib/filter/style/index.css +44 -32
- package/lib/filter/style/index.less +34 -32
- package/lib/filter/style/token.less +28 -0
- package/lib/form/style/index.css +19 -10
- package/lib/form/style/index.less +9 -6
- package/lib/form/style/token.less +27 -0
- package/lib/grid/style/index.css +9 -0
- package/lib/image/style/index.css +32 -23
- package/lib/image/style/index.less +23 -22
- package/lib/image/style/token.less +45 -0
- package/lib/image-cropper/style/index.css +9 -0
- package/lib/image-cropper/style/index.less +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +8 -0
- package/lib/input/style/index.css +97 -88
- package/lib/input/style/index.less +34 -31
- package/lib/input/style/mixin.less +54 -47
- package/lib/input/style/token.less +46 -0
- package/lib/input-number/style/css.js +2 -0
- package/lib/input-number/style/index.css +25 -16
- package/lib/input-number/style/index.d.ts +1 -0
- package/lib/input-number/style/index.js +2 -0
- package/lib/input-number/style/index.less +12 -12
- package/lib/input-number/style/mixin.less +4 -2
- package/lib/input-number/style/token.less +20 -0
- package/lib/layout/style/index.css +41 -32
- package/lib/layout/style/index.less +9 -8
- package/lib/layout/style/token.less +30 -0
- package/lib/link/index.d.ts +3 -0
- package/lib/link/index.js +36 -0
- package/lib/link/link.d.ts +18 -0
- package/lib/link/link.js +120 -0
- package/lib/link/style/css.js +5 -0
- package/lib/link/style/index.css +155 -0
- package/lib/link/style/index.d.ts +2 -0
- package/lib/link/style/index.js +5 -0
- package/lib/link/style/index.less +61 -0
- package/lib/link/style/mixin.less +7 -0
- package/lib/link/style/token.less +24 -0
- package/lib/menu/menuItem.js +1 -2
- package/lib/menu/style/index.css +89 -80
- package/lib/menu/style/index.less +51 -26
- package/lib/menu/style/mixin.less +16 -19
- package/lib/menu/style/token.less +32 -0
- package/lib/message/style/index.css +23 -13
- package/lib/message/style/index.less +15 -13
- package/lib/message/style/token.less +21 -0
- package/lib/modal/style/index.css +37 -28
- package/lib/modal/style/index.less +16 -26
- package/lib/modal/style/mixin.less +2 -0
- package/lib/modal/style/token.less +46 -0
- package/lib/notification/content.js +1 -1
- package/lib/notification/style/index.css +34 -25
- package/lib/notification/style/index.less +21 -20
- package/lib/notification/style/token.less +28 -0
- package/lib/pagination/pagination.js +2 -2
- package/lib/pagination/style/index.css +159 -159
- package/lib/pagination/style/index.less +104 -113
- package/lib/pagination/style/token.less +28 -0
- package/lib/popconfirm/style/index.css +54 -33
- package/lib/popconfirm/style/index.less +41 -20
- package/lib/popconfirm/style/token.less +28 -0
- package/lib/progress/style/index.css +41 -27
- package/lib/progress/style/index.less +24 -8
- package/lib/progress/style/mixin.less +2 -1
- package/lib/progress/style/token.less +40 -0
- package/lib/radio/style/index.css +91 -76
- package/lib/radio/style/index.less +76 -64
- package/lib/radio/style/token.less +47 -0
- package/lib/rate/style/index.css +26 -17
- package/lib/rate/style/index.less +4 -3
- package/lib/rate/style/token.less +18 -0
- package/lib/search/style/index.css +103 -82
- package/lib/search/style/index.less +49 -35
- package/lib/search/style/mixin.less +4 -2
- package/lib/search/style/token.less +60 -0
- package/lib/select/select.js +3 -14
- package/lib/select/style/index.css +46 -37
- package/lib/select/style/index.less +10 -10
- package/lib/select/style/mixin.less +4 -7
- package/lib/select/style/token.less +43 -0
- package/lib/slider/slider.js +5 -13
- package/lib/slider/sliderTooltip.js +0 -1
- package/lib/slider/style/index.css +21 -12
- package/lib/slider/style/index.less +10 -10
- package/lib/slider/style/mixin.less +3 -1
- package/lib/slider/style/token.less +17 -0
- package/lib/space/style/index.css +9 -0
- package/lib/spin/style/index.css +23 -14
- package/lib/spin/style/index.less +3 -2
- package/lib/spin/style/mixin.less +1 -0
- package/lib/spin/style/token.less +15 -0
- package/lib/split-panel/style/index.css +35 -44
- package/lib/split-panel/style/index.less +16 -34
- package/lib/split-panel/style/token.less +23 -0
- package/lib/stepper/style/index.css +50 -25
- package/lib/stepper/style/index.less +45 -11
- package/lib/stepper/style/mixin.less +7 -5
- package/lib/stepper/style/token.less +28 -0
- package/lib/steps/Steps.js +4 -1
- package/lib/steps/style/index.css +74 -37
- package/lib/steps/style/index.less +281 -189
- package/lib/steps/style/token.less +31 -0
- package/lib/style/components.less +1 -0
- package/lib/style/mixins/index.less +10 -9
- package/lib/style/mixins/overlay.less +2 -2
- package/lib/style/themes/default.less +22 -12
- package/lib/style/themes/token.less +128 -0
- package/lib/switch/style/index.css +38 -29
- package/lib/switch/style/index.less +17 -6
- package/lib/switch/style/mixin.less +6 -5
- package/lib/switch/style/token.less +45 -0
- package/lib/tabs/style/index.css +59 -50
- package/lib/tabs/style/index.less +3 -3
- package/lib/tabs/style/mixin.less +2 -0
- package/lib/tabs/style/token.less +32 -0
- package/lib/tabs/tabs.js +3 -1
- package/lib/tag/style/index.css +122 -113
- package/lib/tag/style/index.less +19 -19
- package/lib/tag/style/mixin.less +2 -1
- package/lib/tag/style/token.less +42 -0
- package/lib/timeline/style/index.css +40 -30
- package/lib/timeline/style/index.less +33 -30
- package/lib/timeline/style/token.less +45 -0
- package/lib/tooltip/style/index.css +26 -17
- package/lib/tooltip/style/index.less +6 -5
- package/lib/tooltip/style/token.less +20 -0
- package/lib/transfer/operation.js +2 -2
- package/lib/transfer/style/index.css +37 -24
- package/lib/transfer/style/index.less +4 -0
- package/lib/transfer/style/mixins.less +2 -0
- package/lib/transfer/style/token.less +29 -0
- package/lib/tree/style/index.css +37 -37
- package/lib/tree/style/index.less +8 -20
- package/lib/tree/style/mixin.less +1 -5
- package/lib/tree/style/token.less +27 -0
- package/lib/typography/style/index.css +46 -53
- package/lib/typography/style/index.less +15 -15
- package/lib/typography/style/mixin.less +9 -11
- package/lib/typography/style/token.less +38 -0
- package/lib/upload/style/index.css +41 -31
- package/lib/upload/style/index.less +27 -25
- package/lib/upload/style/token.less +28 -0
- package/package.json +5 -4
- package/es/base-data/style/mixin.less +0 -5
- package/es/empty/style/mixin.less +0 -5
- package/es/form/style/mixin.less +0 -5
- package/es/steps/style/mixin.less +0 -41
- package/lib/base-data/style/mixin.less +0 -5
- package/lib/empty/style/mixin.less +0 -5
- package/lib/form/style/mixin.less +0 -5
- package/lib/steps/style/mixin.less +0 -41
|
@@ -1,22 +1,24 @@
|
|
|
1
|
+
@import './token.less';
|
|
2
|
+
|
|
1
3
|
.input-wrapper() {
|
|
2
4
|
display: inline-flex;
|
|
3
|
-
border: 1px solid @
|
|
4
|
-
border-radius: @radius
|
|
5
|
+
border: 1px solid @date-input-color-border;
|
|
6
|
+
border-radius: @date-input-border-radius;
|
|
5
7
|
box-sizing: border-box;
|
|
6
|
-
background-color: @date-
|
|
8
|
+
background-color: @date-input-color-background;
|
|
7
9
|
&-borderless {
|
|
8
10
|
border: 0;
|
|
9
11
|
}
|
|
10
12
|
&-underline {
|
|
11
13
|
border: none;
|
|
12
|
-
border-bottom: 1px solid @input-color;
|
|
14
|
+
border-bottom: 1px solid @date-input-underline-color;
|
|
13
15
|
border-radius: 0;
|
|
14
16
|
padding-left: 0;
|
|
15
17
|
}
|
|
16
18
|
&-disabled {
|
|
17
|
-
background-color: @
|
|
18
|
-
border-color: @
|
|
19
|
-
color: @
|
|
19
|
+
background-color: @date-input-color-background-disabled !important;
|
|
20
|
+
border-color: @date-input-color-border !important;
|
|
21
|
+
color: @date-input-color-disabled !important;
|
|
20
22
|
cursor: not-allowed !important;
|
|
21
23
|
input {
|
|
22
24
|
cursor: not-allowed !important;
|
|
@@ -24,48 +26,48 @@
|
|
|
24
26
|
}
|
|
25
27
|
&-underline&-disabled,
|
|
26
28
|
&-borderless&-disabled {
|
|
27
|
-
background-color: @date-
|
|
28
|
-
border-color: @
|
|
29
|
+
background-color: @date-input-color-background;
|
|
30
|
+
border-color: @date-input-color-border;
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
&-focused {
|
|
32
34
|
box-shadow: none;
|
|
33
35
|
outline: none;
|
|
34
|
-
border-color: @
|
|
36
|
+
border-color: @date-color-background-checked;
|
|
35
37
|
}
|
|
36
38
|
|
|
37
39
|
&:hover {
|
|
38
|
-
border-color: @
|
|
40
|
+
border-color: @date-color-background-checked;
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
&:not(&-disabled) input:focus {
|
|
42
|
-
color: @date-
|
|
44
|
+
color: @date-input-color-focus;
|
|
43
45
|
}
|
|
44
46
|
}
|
|
45
47
|
|
|
46
48
|
.input() {
|
|
47
49
|
width: 100%;
|
|
48
50
|
min-width: 0;
|
|
49
|
-
color: @date-
|
|
51
|
+
color: @date-input-color;
|
|
50
52
|
&::-webkit-input-placeholder {
|
|
51
|
-
color: @date-
|
|
53
|
+
color: @date-input-color-placeholder;
|
|
52
54
|
}
|
|
53
55
|
&::-moz-input-placeholder {
|
|
54
|
-
color: @date-
|
|
56
|
+
color: @date-input-color-placeholder;
|
|
55
57
|
}
|
|
56
58
|
&::-ms-input-placeholder {
|
|
57
|
-
color: @date-
|
|
59
|
+
color: @date-input-color-placeholder;
|
|
58
60
|
}
|
|
59
61
|
&:focus {
|
|
60
62
|
box-shadow: none;
|
|
61
63
|
outline: none;
|
|
62
|
-
border-color: @
|
|
64
|
+
border-color: @date-color-background-checked;
|
|
63
65
|
}
|
|
64
66
|
}
|
|
65
67
|
|
|
66
68
|
.input-size(@height, @fonSize, @padding-vertical, @padding-horizontal) {
|
|
67
69
|
height: @height;
|
|
68
|
-
line-height: @height - (@padding-vertical * 2) -
|
|
70
|
+
line-height: calc(@height - (@padding-vertical * 2) - 2);
|
|
69
71
|
font-size: @fonSize;
|
|
70
72
|
padding: @padding-vertical @padding-horizontal;
|
|
71
73
|
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
@import '../../style/themes/token.less';
|
|
2
|
+
|
|
3
|
+
@date-picker-custom-prefix: ~'--@{kd-prefix}-c-date-picker';
|
|
4
|
+
|
|
5
|
+
// shadow
|
|
6
|
+
// color
|
|
7
|
+
@date-color-background-checked: var(~'@{date-picker-custom-prefix}-color-background-checked', @color-theme);
|
|
8
|
+
@date-wrapper-color-background: var(~'@{date-picker-custom-prefix}-wrapper-color-background', @color-background);
|
|
9
|
+
@date-input-color: var(~'@{date-picker-custom-prefix}-input-color', @color-text-secondary);
|
|
10
|
+
@date-input-color-placeholder: var(~'@{date-picker-custom-prefix}-input-color-placeholder', @color-text-secondary);
|
|
11
|
+
@date-input-underline-color: var(~'@{date-picker-custom-prefix}-input-underline-color', #999);
|
|
12
|
+
@date-input-color-border: var(~'@{date-picker-custom-prefix}-input-color-border', @color-border-strong);
|
|
13
|
+
@date-input-color-disabled: var(~'@{date-picker-custom-prefix}-input-color-disabled', @color-disabled);
|
|
14
|
+
@date-input-color-background: var(~'@{date-picker-custom-prefix}-input-color-background', @color-white);
|
|
15
|
+
@date-input-color-background-disabled: var(~'@{date-picker-custom-prefix}-input-color-background-disabled', @color-background-contain-disabled);
|
|
16
|
+
@date-input-color-focus: var(~'@{date-picker-custom-prefix}-input-color-focused', @color-text-primary);
|
|
17
|
+
|
|
18
|
+
@date-icon-color: var(~'@{date-picker-custom-prefix}-icon-color', @color-disabled);
|
|
19
|
+
@date-clear-background-color: var(~'@{date-picker-custom-prefix}-clear-color-background', @color-background);
|
|
20
|
+
@date-clear-background-color-hover: var(~'@{date-picker-custom-prefix}-clear-color-background-hover', @color-theme-5);
|
|
21
|
+
@date-clear-background-color-focused: var(~'@{date-picker-custom-prefix}-clear-color-background-focused', @color-theme);
|
|
22
|
+
@date-container-color: var(~'@{date-picker-custom-prefix}-container-color', @color-text-primary);
|
|
23
|
+
@date-container-color-border: var(~'@{date-picker-custom-prefix}-container-color-border', @color-border-weak);
|
|
24
|
+
@date-container-color-background: var(~'@{date-picker-custom-prefix}-container-color-background', @color-background-2);
|
|
25
|
+
|
|
26
|
+
@date-footer-color-background: var(~'@{date-picker-custom-prefix}-footer-color-background', @color-background);
|
|
27
|
+
|
|
28
|
+
// sizing
|
|
29
|
+
@date-width: var(~'@{date-picker-custom-prefix}-sizing-width', 230px);
|
|
30
|
+
@date-large-height: var(~'@{date-picker-custom-prefix}-large-sizing-height', 36px); // 大号 高度
|
|
31
|
+
@date-middle-height: var(~'@{date-picker-custom-prefix}-middle-sizing-height', 30px); // 中号 高度
|
|
32
|
+
@date-small-height: var(~'@{date-picker-custom-prefix}-small-sizing-height', 20px); // 小号 高度
|
|
33
|
+
@date-panel-header-height: var(~'@{date-picker-custom-prefix}-panel-header-sizing-height', 36px);
|
|
34
|
+
|
|
35
|
+
// spacing
|
|
36
|
+
@date-small-padding-vertical: var(~'@{date-picker-custom-prefix}-small-spacing-padding-vertical', 4px); // 小号 内间距 纵向
|
|
37
|
+
@date-small-padding-horizontal: var(~'@{date-picker-custom-prefix}-small-spacing-padding-horizontal', 9px); // 小号 内间距 横向
|
|
38
|
+
@date-middle-padding-vertical: var(~'@{date-picker-custom-prefix}-middle-spacing-padding-vertical', 5px); // 中号 内间距 纵向
|
|
39
|
+
@date-middle-padding-horizontal: var(~'@{date-picker-custom-prefix}-middle-spacing-padding-horizontal', 9px); // 中号 内间距 纵向
|
|
40
|
+
@date-large-padding-vertical: var(~'@{date-picker-custom-prefix}-large-spacing-padding-vertical', 8px); // 大号 内间距 纵向
|
|
41
|
+
@date-large-padding-horizontal: var(~'@{date-picker-custom-prefix}-large-spacing-padding-horizontal', 9px); // 大号 内间距 横向
|
|
42
|
+
@date-suffix-spacing-margin-left: var(~'@{date-picker-custom-prefix}-suffix-spacing-margin-left', 10px);
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
// motion
|
|
46
|
+
// font
|
|
47
|
+
@date-container-font-size: var(~'@{date-picker-custom-prefix}-container-font-size', @font-size-small);
|
|
48
|
+
@date-panel-font-size: var(~'@{date-picker-custom-prefix}-panel-font-size', @font-size-middle);
|
|
49
|
+
@date-small-font-size: var(~'@{date-picker-custom-prefix}-small-font-size', @font-size-small); // 小号 文字大小
|
|
50
|
+
@date-middle-font-size: var(~'@{date-picker-custom-prefix}-middle-font-size', @font-size-middle); // 中号 文字大小
|
|
51
|
+
@date-large-font-size: var(~'@{date-picker-custom-prefix}-large-font-size', @font-size-large); // 大号 文字大小
|
|
52
|
+
|
|
53
|
+
// radius
|
|
54
|
+
@date-input-border-radius: var(~'@{date-picker-custom-prefix}-input-radius-border', @radius-border);
|
|
55
|
+
@date-panel-border-radius: var(~'@{date-picker-custom-prefix}-panel-radius-border', @radius-border);
|
|
56
|
+
|
|
57
|
+
// line-height
|
|
58
|
+
// z-index
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
package/lib/drawer/drawer.d.ts
CHANGED
|
@@ -21,7 +21,6 @@ export interface IDrawerProps {
|
|
|
21
21
|
getContainer?: (() => Element | CSSSelector | false | null) | Element | false;
|
|
22
22
|
headerStyle?: CSSProperties;
|
|
23
23
|
headerClassName?: string;
|
|
24
|
-
height?: string | number;
|
|
25
24
|
keyboard?: boolean;
|
|
26
25
|
mask?: boolean;
|
|
27
26
|
maskClassName?: string;
|
package/lib/drawer/drawer.js
CHANGED
|
@@ -100,7 +100,6 @@ var InternalDrawer = function InternalDrawer(props, ref) {
|
|
|
100
100
|
footerClassName = drawerProps.footerClassName,
|
|
101
101
|
visible = drawerProps.visible,
|
|
102
102
|
width = drawerProps.width,
|
|
103
|
-
height = drawerProps.height,
|
|
104
103
|
headerStyle = drawerProps.headerStyle,
|
|
105
104
|
headerClassName = drawerProps.headerClassName,
|
|
106
105
|
zindex = drawerProps.zIndex,
|
|
@@ -118,12 +117,7 @@ var InternalDrawer = function InternalDrawer(props, ref) {
|
|
|
118
117
|
var _useState3 = (0, _react.useState)(width),
|
|
119
118
|
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
120
119
|
currentWidth = _useState4[0],
|
|
121
|
-
setCurrentWidth = _useState4[1];
|
|
122
|
-
|
|
123
|
-
var _useState5 = (0, _react.useState)(height),
|
|
124
|
-
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
125
|
-
currentHeight = _useState6[0],
|
|
126
|
-
setCurrentHeight = _useState6[1]; // const previousWidthRef = usePrevious(currentWidth)
|
|
120
|
+
setCurrentWidth = _useState4[1]; // const previousWidthRef = usePrevious(currentWidth)
|
|
127
121
|
// const previousHeightRef = usePrevious(currentHeight)
|
|
128
122
|
|
|
129
123
|
|
|
@@ -162,9 +156,8 @@ var InternalDrawer = function InternalDrawer(props, ref) {
|
|
|
162
156
|
}
|
|
163
157
|
}, [drawerContainer, isBody, isAtOriginalPlace, containerRef]);
|
|
164
158
|
var handleContainerResize = (0, _react.useCallback)(function (_ref) {
|
|
165
|
-
var containerWidth = _ref.width
|
|
166
|
-
|
|
167
|
-
if (!visible && width === currentWidth && height === currentHeight) return;
|
|
159
|
+
var containerWidth = _ref.width;
|
|
160
|
+
if (!visible && width === currentWidth) return;
|
|
168
161
|
|
|
169
162
|
if (containerWidth < currentWidth) {
|
|
170
163
|
// 这里改成操作DOM?
|
|
@@ -174,13 +167,7 @@ var InternalDrawer = function InternalDrawer(props, ref) {
|
|
|
174
167
|
} else {
|
|
175
168
|
setCurrentWidth(width);
|
|
176
169
|
}
|
|
177
|
-
|
|
178
|
-
if (containerHeight < currentHeight) {
|
|
179
|
-
setCurrentHeight(containerHeight);
|
|
180
|
-
} else {
|
|
181
|
-
setCurrentHeight(height);
|
|
182
|
-
}
|
|
183
|
-
}, [width, height, visible, currentWidth, currentHeight]);
|
|
170
|
+
}, [width, visible, currentWidth]);
|
|
184
171
|
(0, _hooks.useResizeObserver)(function () {
|
|
185
172
|
var _a;
|
|
186
173
|
|
|
@@ -191,9 +178,6 @@ var InternalDrawer = function InternalDrawer(props, ref) {
|
|
|
191
178
|
(0, _react.useEffect)(function () {
|
|
192
179
|
setCurrentWidth(width);
|
|
193
180
|
}, [width]);
|
|
194
|
-
(0, _react.useEffect)(function () {
|
|
195
|
-
setCurrentHeight(height);
|
|
196
|
-
}, [height]);
|
|
197
181
|
var closeDrawer = (0, _react.useCallback)(function () {
|
|
198
182
|
onClose && onClose();
|
|
199
183
|
destroyOnClose && setShowChildren(false);
|
|
@@ -225,10 +209,7 @@ var InternalDrawer = function InternalDrawer(props, ref) {
|
|
|
225
209
|
var containerStyle = (0, _extends3.default)((0, _defineProperty2.default)({}, placement, 0), (0, _includes.default)(horizontalPlacements).call(horizontalPlacements, placement) ? {
|
|
226
210
|
width: currentWidth,
|
|
227
211
|
transform: "translateX(".concat(visible ? 0 : transformSize(currentWidth, placement), ")")
|
|
228
|
-
} : {
|
|
229
|
-
height: currentHeight,
|
|
230
|
-
transform: "translateY(".concat(visible ? 0 : transformSize(currentHeight, placement), ")")
|
|
231
|
-
});
|
|
212
|
+
} : {});
|
|
232
213
|
|
|
233
214
|
var container = /*#__PURE__*/_react.default.createElement("div", {
|
|
234
215
|
className: (0, _classnames.default)((_classNames2 = {}, (0, _defineProperty2.default)(_classNames2, "".concat(drawerPrefixCls, "-container-box"), true), (0, _defineProperty2.default)(_classNames2, "".concat(drawerPrefixCls, "-has-container-box"), drawerContainer), (0, _defineProperty2.default)(_classNames2, (0, _concat.default)(_context2 = "".concat(drawerPrefixCls, "-container-")).call(_context2, placement), true), _classNames2)),
|
|
@@ -259,8 +240,7 @@ var InternalDrawer = function InternalDrawer(props, ref) {
|
|
|
259
240
|
return p !== placement;
|
|
260
241
|
})[0] : '';
|
|
261
242
|
var noneMaskStyle = !mask ? {
|
|
262
|
-
width: containerStyle.width
|
|
263
|
-
height: containerStyle.height
|
|
243
|
+
width: containerStyle.width
|
|
264
244
|
} : {};
|
|
265
245
|
|
|
266
246
|
var comp = /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -106,11 +106,20 @@
|
|
|
106
106
|
top: 0;
|
|
107
107
|
bottom: 0;
|
|
108
108
|
}
|
|
109
|
+
/* ----------- motion ——————---- start */
|
|
110
|
+
/* ----------- motion ——————---- end */
|
|
111
|
+
/* ----------- transition ——————---- start */
|
|
112
|
+
/* ----------- transition ——————---- end */
|
|
113
|
+
/* ----------- zIndex ——————---- start */
|
|
114
|
+
/*
|
|
115
|
+
普通组件内部自身层级应设置在0-100间
|
|
116
|
+
*/
|
|
117
|
+
/* ----------- zIndex ——————---- end */
|
|
109
118
|
.kd-drawer {
|
|
110
119
|
display: -webkit-box;
|
|
111
120
|
display: -ms-flexbox;
|
|
112
121
|
display: flex;
|
|
113
|
-
z-index: 1050;
|
|
122
|
+
z-index: var(--kd-g-z-index-dialog, 1050);
|
|
114
123
|
position: fixed;
|
|
115
124
|
left: 0;
|
|
116
125
|
right: 0;
|
|
@@ -120,13 +129,13 @@
|
|
|
120
129
|
.kd-drawer-active .kd-drawer-mask {
|
|
121
130
|
opacity: 1;
|
|
122
131
|
visibility: visible;
|
|
123
|
-
-webkit-transition: all calc(0.3s - 0.1s) cubic-bezier(0, 0.4, 0.4, 1);
|
|
124
|
-
transition: all calc(0.3s - 0.1s) cubic-bezier(0, 0.4, 0.4, 1);
|
|
132
|
+
-webkit-transition: all calc(var(--kd-g-duration, 0.3s) - 0.1s) var(--kd-g-ease-out, cubic-bezier(0, 0.4, 0.4, 1));
|
|
133
|
+
transition: all calc(var(--kd-g-duration, 0.3s) - 0.1s) var(--kd-g-ease-out, cubic-bezier(0, 0.4, 0.4, 1));
|
|
125
134
|
}
|
|
126
135
|
.kd-drawer-hide {
|
|
127
136
|
visibility: hidden;
|
|
128
|
-
-webkit-transition: visibility calc(0.3s - 0.1s) cubic-bezier(0, 0.4, 0.4, 1);
|
|
129
|
-
transition: visibility calc(0.3s - 0.1s) cubic-bezier(0, 0.4, 0.4, 1);
|
|
137
|
+
-webkit-transition: visibility calc(var(--kd-g-duration, 0.3s) - 0.1s) var(--kd-g-ease-out, cubic-bezier(0, 0.4, 0.4, 1));
|
|
138
|
+
transition: visibility calc(var(--kd-g-duration, 0.3s) - 0.1s) var(--kd-g-ease-out, cubic-bezier(0, 0.4, 0.4, 1));
|
|
130
139
|
}
|
|
131
140
|
.kd-drawer-mask {
|
|
132
141
|
position: fixed;
|
|
@@ -137,8 +146,8 @@
|
|
|
137
146
|
top: 0;
|
|
138
147
|
bottom: 0;
|
|
139
148
|
opacity: 0;
|
|
140
|
-
-webkit-transition: opacity calc(0.3s - 0.1s) cubic-bezier(0, 0.4, 0.4, 1);
|
|
141
|
-
transition: opacity calc(0.3s - 0.1s) cubic-bezier(0, 0.4, 0.4, 1);
|
|
149
|
+
-webkit-transition: opacity calc(var(--kd-g-duration, 0.3s) - 0.1s) var(--kd-g-ease-out, cubic-bezier(0, 0.4, 0.4, 1));
|
|
150
|
+
transition: opacity calc(var(--kd-g-duration, 0.3s) - 0.1s) var(--kd-g-ease-out, cubic-bezier(0, 0.4, 0.4, 1));
|
|
142
151
|
}
|
|
143
152
|
.kd-drawer-not-at-body {
|
|
144
153
|
position: absolute;
|
|
@@ -146,22 +155,21 @@
|
|
|
146
155
|
.kd-drawer-not-at-body .kd-drawer-mask {
|
|
147
156
|
position: absolute;
|
|
148
157
|
}
|
|
149
|
-
.kd-drawer-container-left
|
|
150
|
-
top: 0;
|
|
151
|
-
bottom: 0;
|
|
152
|
-
}
|
|
158
|
+
.kd-drawer-container-left,
|
|
153
159
|
.kd-drawer-container-right {
|
|
154
160
|
top: 0;
|
|
155
161
|
bottom: 0;
|
|
156
162
|
}
|
|
157
|
-
.kd-drawer-container-top
|
|
158
|
-
left: 0;
|
|
159
|
-
right: 0;
|
|
160
|
-
}
|
|
163
|
+
.kd-drawer-container-top,
|
|
161
164
|
.kd-drawer-container-bottom {
|
|
162
165
|
left: 0;
|
|
163
166
|
right: 0;
|
|
164
167
|
}
|
|
168
|
+
.kd-drawer-container-top .kd-drawer-body,
|
|
169
|
+
.kd-drawer-container-bottom .kd-drawer-body {
|
|
170
|
+
max-height: var(--kd-c-drawer-body-max-height-vertical, 470px);
|
|
171
|
+
overflow-y: auto;
|
|
172
|
+
}
|
|
165
173
|
.kd-drawer-container-box {
|
|
166
174
|
display: -webkit-box;
|
|
167
175
|
display: -ms-flexbox;
|
|
@@ -171,11 +179,11 @@
|
|
|
171
179
|
-webkit-box-direction: normal;
|
|
172
180
|
-ms-flex-direction: column;
|
|
173
181
|
flex-direction: column;
|
|
174
|
-
background: #fff;
|
|
182
|
+
background: var(--kd-c-drawer-color-background, var(--kd-g-color-background, #fff));
|
|
175
183
|
-webkit-box-shadow: -4px 0 10px 0 rgba(0, 0, 0, 0.1);
|
|
176
184
|
box-shadow: -4px 0 10px 0 rgba(0, 0, 0, 0.1);
|
|
177
|
-
-webkit-transition: all calc(0.3s - 0.1s) cubic-bezier(0, 0.4, 0.4, 1);
|
|
178
|
-
transition: all calc(0.3s - 0.1s) cubic-bezier(0, 0.4, 0.4, 1);
|
|
185
|
+
-webkit-transition: all calc(var(--kd-g-duration, 0.3s) - 0.1s) var(--kd-g-ease-out, cubic-bezier(0, 0.4, 0.4, 1));
|
|
186
|
+
transition: all calc(var(--kd-g-duration, 0.3s) - 0.1s) var(--kd-g-ease-out, cubic-bezier(0, 0.4, 0.4, 1));
|
|
179
187
|
}
|
|
180
188
|
.kd-drawer-container-box .kd-drawer-header {
|
|
181
189
|
display: -webkit-box;
|
|
@@ -187,24 +195,21 @@
|
|
|
187
195
|
-webkit-box-align: center;
|
|
188
196
|
-ms-flex-align: center;
|
|
189
197
|
align-items: center;
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
background: #fff;
|
|
193
|
-
font-size: 18px;
|
|
194
|
-
color: #333333;
|
|
198
|
+
padding: var(--kd-c-drawer-header-sizing-padding-vertical, 12px) var(--kd-c-drawer-header-sizing-padding-horizontal, 16px);
|
|
199
|
+
border-bottom: var(--kd-c-drawer-dividing-sizing-width, 1px) solid var(--kd-c-drawer-dividing-color-border, var(--kd-g-color-border-disabled, #ccc));
|
|
195
200
|
}
|
|
196
201
|
.kd-drawer-container-box .kd-drawer-header .kd-drawer-title {
|
|
197
|
-
margin-left: 20px;
|
|
198
|
-
font-size: 18px;
|
|
199
202
|
letter-spacing: 0;
|
|
200
203
|
line-height: 26px;
|
|
204
|
+
font-size: var(--kd-c-drawer-title-font-size, var(--kd-g-font-size-x-large, 18px));
|
|
205
|
+
color: var(--kd-c-drawer-title-color-text, var(--kd-g-color-text-primary, #212121));
|
|
201
206
|
}
|
|
202
207
|
.kd-drawer-container-box .kd-drawer-header .kd-drawer-close-icon {
|
|
203
|
-
margin-right: 10px;
|
|
204
208
|
cursor: pointer;
|
|
205
209
|
}
|
|
206
210
|
.kd-drawer-container-box .kd-drawer-header .kd-drawer-close-icon i {
|
|
207
|
-
|
|
211
|
+
color: var(--kd-c-drawer-close-icon-color-text, var(--kd-g-color-text-secondary, #666));
|
|
212
|
+
font-size: var(--kd-c-drawer-close-icon-font-size, var(--kd-g-font-size-large, 16px));
|
|
208
213
|
}
|
|
209
214
|
.kd-drawer-container-box .kd-drawer-body {
|
|
210
215
|
display: -webkit-box;
|
|
@@ -217,14 +222,15 @@
|
|
|
217
222
|
-webkit-box-direction: normal;
|
|
218
223
|
-ms-flex-direction: column;
|
|
219
224
|
flex-direction: column;
|
|
220
|
-
|
|
221
|
-
|
|
225
|
+
padding: var(--kd-c-drawer-body-sizing-padding, 16px);
|
|
226
|
+
font-size: var(--kd-g-font-size-middle, 14px);
|
|
227
|
+
color: var(--kd-g-color-text-primary, #212121);
|
|
222
228
|
}
|
|
223
229
|
.kd-drawer-container-box .kd-drawer-footer {
|
|
224
230
|
display: -webkit-box;
|
|
225
231
|
display: -ms-flexbox;
|
|
226
232
|
display: flex;
|
|
227
233
|
min-height: 40px;
|
|
228
|
-
font-size: 12px;
|
|
229
|
-
color: #
|
|
234
|
+
font-size: var(--kd-g-font-size-small, 12px);
|
|
235
|
+
color: var(--kd-g-color-text-primary, #212121);
|
|
230
236
|
}
|
|
@@ -1,43 +1,30 @@
|
|
|
1
1
|
@import '../../style/themes/index';
|
|
2
2
|
@import './mixin.less';
|
|
3
3
|
@import '../../style/mixins/overlay';
|
|
4
|
+
@import './token.less';
|
|
4
5
|
|
|
5
6
|
@drawer-prefix-cls: ~'@{kd-prefix}-drawer';
|
|
6
7
|
|
|
7
|
-
@placement-left: left;
|
|
8
|
-
@placement-right: right;
|
|
9
|
-
@placement-top: top;
|
|
10
|
-
@placement-bottom: bottom;
|
|
11
|
-
|
|
12
|
-
@drawer-title-font-size: 18px;
|
|
13
|
-
@drawer-title-font-color: #333333;
|
|
14
|
-
@drawer-dividing-width: 1px;
|
|
15
|
-
@drawer-dividing-color: #cccccc;
|
|
16
|
-
@drawer-body-font-size: 14px;
|
|
17
|
-
@drawer-body-font-color: #333333;
|
|
18
|
-
@drawer-footer-font-size: 12px;
|
|
19
|
-
@drawer-footer-font-color: #333333;
|
|
20
|
-
|
|
21
8
|
.@{drawer-prefix-cls} {
|
|
22
9
|
display: flex;
|
|
23
|
-
z-index: @
|
|
10
|
+
z-index: @z-index-dialog;
|
|
24
11
|
&-active {
|
|
25
12
|
.@{drawer-prefix-cls}-mask {
|
|
26
13
|
opacity: 1;
|
|
27
14
|
visibility: visible;
|
|
28
|
-
transition: all calc(@
|
|
15
|
+
transition: all calc(@duration-promptly - 0.1s) @motion-ease-out;
|
|
29
16
|
}
|
|
30
17
|
}
|
|
31
18
|
&-hide {
|
|
32
19
|
visibility: hidden;
|
|
33
|
-
transition: visibility calc(@
|
|
20
|
+
transition: visibility calc(@duration-promptly - 0.1s) @motion-ease-out;
|
|
34
21
|
}
|
|
35
22
|
position: fixed;
|
|
36
23
|
.overall-postion();
|
|
37
24
|
&-mask {
|
|
38
25
|
.overlay(rgba(55, 55, 55, 0.5), 0);
|
|
39
26
|
opacity: 0;
|
|
40
|
-
transition: opacity calc(@
|
|
27
|
+
transition: opacity calc(@duration-promptly - 0.1s) @motion-ease-out;
|
|
41
28
|
}
|
|
42
29
|
&-not-at-body {
|
|
43
30
|
position: absolute;
|
|
@@ -45,46 +32,43 @@
|
|
|
45
32
|
position: absolute;
|
|
46
33
|
}
|
|
47
34
|
}
|
|
48
|
-
&-container-left
|
|
49
|
-
.drawer-container-placement-horizontal();
|
|
50
|
-
}
|
|
35
|
+
&-container-left,
|
|
51
36
|
&-container-right {
|
|
52
37
|
.drawer-container-placement-horizontal();
|
|
53
38
|
}
|
|
54
|
-
&-container-top
|
|
55
|
-
.drawer-container-placement-vertical();
|
|
56
|
-
}
|
|
39
|
+
&-container-top,
|
|
57
40
|
&-container-bottom {
|
|
58
41
|
.drawer-container-placement-vertical();
|
|
42
|
+
.@{drawer-prefix-cls}-body {
|
|
43
|
+
max-height: @drawer-body-max-height-vertical;
|
|
44
|
+
overflow-y: auto;
|
|
45
|
+
}
|
|
59
46
|
}
|
|
60
47
|
|
|
61
48
|
&-container-box {
|
|
62
49
|
display: flex;
|
|
63
50
|
position: absolute;
|
|
64
51
|
flex-direction: column;
|
|
65
|
-
background: @bg;
|
|
52
|
+
background: @drawer-bg;
|
|
66
53
|
box-shadow: -4px 0 10px 0 rgba(0, 0, 0, 0.1);
|
|
67
|
-
transition: all calc(@
|
|
54
|
+
transition: all calc(@duration-promptly - 0.1s) @motion-ease-out;
|
|
68
55
|
.@{drawer-prefix-cls}-header {
|
|
69
56
|
display: flex;
|
|
70
57
|
justify-content: space-between;
|
|
71
58
|
align-items: center;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
background: @bg;
|
|
75
|
-
font-size: @drawer-title-font-size;
|
|
76
|
-
color: @drawer-title-font-color;
|
|
59
|
+
padding: @drawer-header-padding-vertical @drawer-header-padding-horizontal;
|
|
60
|
+
border-bottom: @drawer-dividing-width solid @drawer-dividing-color;
|
|
77
61
|
.@{drawer-prefix-cls}-title {
|
|
78
|
-
margin-left: 20px;
|
|
79
|
-
font-size: @drawer-title-font-size;
|
|
80
62
|
letter-spacing: 0;
|
|
81
63
|
line-height: 26px;
|
|
64
|
+
font-size: @drawer-title-font-size;
|
|
65
|
+
color: @drawer-title-font-color;
|
|
82
66
|
}
|
|
83
67
|
.@{drawer-prefix-cls}-close-icon {
|
|
84
68
|
i {
|
|
85
|
-
|
|
69
|
+
color: @drawer-close-icon-color;
|
|
70
|
+
font-size: @drawer-close-icon-font-size;
|
|
86
71
|
}
|
|
87
|
-
margin-right: 10px;
|
|
88
72
|
cursor: pointer;
|
|
89
73
|
}
|
|
90
74
|
}
|
|
@@ -92,14 +76,15 @@
|
|
|
92
76
|
display: flex;
|
|
93
77
|
flex-grow: 1;
|
|
94
78
|
flex-direction: column;
|
|
95
|
-
|
|
96
|
-
|
|
79
|
+
padding: @drawer-body-padding;
|
|
80
|
+
font-size: @font-size-middle;
|
|
81
|
+
color: @color-text-primary;
|
|
97
82
|
}
|
|
98
83
|
.@{drawer-prefix-cls}-footer {
|
|
99
84
|
display: flex;
|
|
100
85
|
min-height: 40px;
|
|
101
|
-
font-size: @
|
|
102
|
-
color: @
|
|
86
|
+
font-size: @font-size-small;
|
|
87
|
+
color: @color-text-primary;
|
|
103
88
|
}
|
|
104
89
|
}
|
|
105
90
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
|
|
2
|
+
@import '../../style/themes/token.less';
|
|
3
|
+
|
|
4
|
+
@drawer-custom-prefix: ~'--@{kd-prefix}-c-drawer';
|
|
5
|
+
|
|
6
|
+
// color
|
|
7
|
+
@drawer-bg: var(~'@{drawer-custom-prefix}-color-background', @color-background);
|
|
8
|
+
@drawer-title-font-color: var(~'@{drawer-custom-prefix}-title-color-text', @color-text-primary);
|
|
9
|
+
@drawer-dividing-color: var(~'@{drawer-custom-prefix}-dividing-color-border', @color-border-disabled);
|
|
10
|
+
@drawer-close-icon-color: var(~'@{drawer-custom-prefix}-close-icon-color-text', @color-text-secondary);
|
|
11
|
+
|
|
12
|
+
// font
|
|
13
|
+
@drawer-title-font-size: var(~'@{drawer-custom-prefix}-title-font-size', @font-size-x-large);
|
|
14
|
+
@drawer-close-icon-font-size: var(~'@{drawer-custom-prefix}-close-icon-font-size', @font-size-large);
|
|
15
|
+
|
|
16
|
+
// sizing
|
|
17
|
+
@drawer-body-max-height-vertical: var(~'@{drawer-custom-prefix}-body-max-height-vertical', 470px);
|
|
18
|
+
@drawer-dividing-width: var(~'@{drawer-custom-prefix}-dividing-sizing-width', 1px);
|
|
19
|
+
|
|
20
|
+
// spacing
|
|
21
|
+
@drawer-header-padding-vertical: var(~'@{drawer-custom-prefix}-header-sizing-padding-vertical', 12px);
|
|
22
|
+
@drawer-header-padding-horizontal: var(~'@{drawer-custom-prefix}-header-sizing-padding-horizontal', 16px);
|
|
23
|
+
@drawer-body-padding: var(~'@{drawer-custom-prefix}-body-sizing-padding', 16px);
|
package/lib/dropdown/dropdown.js
CHANGED
|
@@ -72,32 +72,37 @@ var Dropdown = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
72
72
|
});
|
|
73
73
|
var isMenu = menu.type === _menu.Menu;
|
|
74
74
|
|
|
75
|
-
var _React$useState3 = React.useState(((_a = menu.props) === null || _a === void 0 ? void 0 : _a.defaultKey) || props.defaultKey || ''),
|
|
75
|
+
var _React$useState3 = React.useState(props.selectedKey || ((_a = menu.props) === null || _a === void 0 ? void 0 : _a.defaultKey) || props.defaultKey || ''),
|
|
76
76
|
_React$useState4 = (0, _slicedToArray2.default)(_React$useState3, 2),
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
selectedKey = _React$useState4[0],
|
|
78
|
+
setSelectedKey = _React$useState4[1];
|
|
79
79
|
|
|
80
|
+
React.useEffect(function () {
|
|
81
|
+
setSelectedKey(props.selectedKey);
|
|
82
|
+
}, [props.selectedKey]);
|
|
80
83
|
var menuSelectable = ((_b = menu.props) === null || _b === void 0 ? void 0 : _b.selectable) === undefined ? selectable : (_c = menu.props) === null || _c === void 0 ? void 0 : _c.selectable;
|
|
81
84
|
|
|
82
85
|
var handleItemClick = function handleItemClick(e) {
|
|
83
86
|
var _a, _b;
|
|
84
87
|
|
|
85
|
-
var
|
|
88
|
+
var currentTarget = e.target;
|
|
89
|
+
var parentTarget = currentTarget.parentNode;
|
|
90
|
+
var key = ((_a = currentTarget.dataset) === null || _a === void 0 ? void 0 : _a.key) || ((_b = currentTarget.parentNode.dataset) === null || _b === void 0 ? void 0 : _b.key);
|
|
86
91
|
|
|
87
|
-
if (
|
|
92
|
+
if (currentTarget.className.indexOf('disabled') === -1 && parentTarget.className.indexOf('disabled') === -1 && key) {
|
|
88
93
|
if (isMenu && menu.props.onClick) {
|
|
89
94
|
menu.props.onClick(key);
|
|
90
95
|
} else if (onItemClick) {
|
|
91
96
|
onItemClick(key);
|
|
92
97
|
}
|
|
93
98
|
|
|
94
|
-
menuSelectable &&
|
|
99
|
+
menuSelectable && setSelectedKey(key);
|
|
95
100
|
props.visible === undefined && setVisible(false);
|
|
96
101
|
}
|
|
97
102
|
};
|
|
98
103
|
|
|
99
104
|
var menuElement = isMenu ? /*#__PURE__*/React.cloneElement(menu, {
|
|
100
|
-
|
|
105
|
+
selectedKey: selectedKey,
|
|
101
106
|
onClick: handleItemClick,
|
|
102
107
|
selectable: menuSelectable
|
|
103
108
|
}) : /*#__PURE__*/React.createElement("ul", {
|
|
@@ -117,7 +122,7 @@ var Dropdown = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
117
122
|
rel: 'noopener noreferrer'
|
|
118
123
|
};
|
|
119
124
|
var key = itemKey || label;
|
|
120
|
-
var selected = selectable && String(
|
|
125
|
+
var selected = selectable && String(selectedKey) === String(key);
|
|
121
126
|
return /*#__PURE__*/React.createElement("li", {
|
|
122
127
|
title: label,
|
|
123
128
|
key: key,
|
package/lib/dropdown/menu.d.ts
CHANGED
package/lib/dropdown/menu.js
CHANGED
|
@@ -57,16 +57,16 @@ var Menu = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
57
57
|
customPrefixcls = _a.prefixCls,
|
|
58
58
|
children = _a.children,
|
|
59
59
|
selectable = _a.selectable,
|
|
60
|
-
|
|
60
|
+
selectedKey = _a.selectedKey,
|
|
61
61
|
className = _a.className,
|
|
62
|
-
restProps = __rest(_a, ["prefixCls", "children", "selectable", "
|
|
62
|
+
restProps = __rest(_a, ["prefixCls", "children", "selectable", "selectedKey", "className"]); // className前缀
|
|
63
63
|
|
|
64
64
|
|
|
65
65
|
var prefixCls = getPrefixCls(pkgPrefixCls, 'dropdown-menu', customPrefixcls);
|
|
66
66
|
|
|
67
67
|
var cloneItem = function cloneItem(item, index) {
|
|
68
68
|
var key = item.key || index;
|
|
69
|
-
var selected = selectable && String(
|
|
69
|
+
var selected = selectable && String(selectedKey) === String(key);
|
|
70
70
|
return /*#__PURE__*/React.cloneElement(item, {
|
|
71
71
|
key: key,
|
|
72
72
|
selected: selected,
|