tiny-ui 1.0.0 → 1.0.2
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/dist/styles/index.css +6 -62
- package/dist/styles/index.css.map +1 -1
- package/dist/styles/index.min.css +1 -1
- package/dist/styles/index.min.css.map +1 -1
- package/dist/tiny.min.js +1 -1
- package/dist/tiny.min.js.map +1 -1
- package/es/_utils/use-theme.js +1 -1
- package/es/_utils/use-theme.js.map +1 -1
- package/es/alert/alert.d.ts +4 -0
- package/es/alert/alert.js +56 -0
- package/es/alert/alert.js.map +1 -0
- package/es/alert/index.d.ts +1 -3
- package/es/alert/index.js +1 -54
- package/es/alert/index.js.map +1 -1
- package/es/anchor/anchor.js +9 -0
- package/es/anchor/anchor.js.map +1 -1
- package/es/aspect-ratio/aspect-ratio.d.ts +4 -0
- package/es/aspect-ratio/aspect-ratio.js +15 -0
- package/es/aspect-ratio/aspect-ratio.js.map +1 -0
- package/es/aspect-ratio/index.d.ts +1 -3
- package/es/aspect-ratio/index.js +1 -13
- package/es/aspect-ratio/index.js.map +1 -1
- package/es/back-top/back-top.d.ts +3 -0
- package/es/back-top/back-top.js +80 -0
- package/es/back-top/back-top.js.map +1 -0
- package/es/back-top/index.d.ts +1 -2
- package/es/back-top/index.js +1 -78
- package/es/back-top/index.js.map +1 -1
- package/es/badge/badge.d.ts +4 -0
- package/es/badge/badge.js +29 -0
- package/es/badge/badge.js.map +1 -0
- package/es/badge/index.d.ts +1 -3
- package/es/badge/index.js +1 -27
- package/es/badge/index.js.map +1 -1
- package/es/calendar/calendar.d.ts +4 -0
- package/es/calendar/calendar.js +117 -0
- package/es/calendar/calendar.js.map +1 -0
- package/es/calendar/index.d.ts +1 -3
- package/es/calendar/index.js +1 -115
- package/es/calendar/index.js.map +1 -1
- package/es/collapse-transition/collapse-transition.d.ts +10 -0
- package/es/collapse-transition/collapse-transition.js +89 -0
- package/es/collapse-transition/collapse-transition.js.map +1 -0
- package/es/collapse-transition/index.d.ts +1 -9
- package/es/collapse-transition/index.js +1 -87
- package/es/collapse-transition/index.js.map +1 -1
- package/es/config-provider/config-provider.d.ts +6 -0
- package/es/config-provider/config-provider.js +23 -0
- package/es/config-provider/config-provider.js.map +1 -0
- package/es/config-provider/index.d.ts +1 -5
- package/es/config-provider/index.js +1 -21
- package/es/config-provider/index.js.map +1 -1
- package/es/copy-to-clipboard/copy-to-clipboard.d.ts +7 -0
- package/es/copy-to-clipboard/copy-to-clipboard.js +47 -0
- package/es/copy-to-clipboard/copy-to-clipboard.js.map +1 -0
- package/es/copy-to-clipboard/index.d.ts +1 -6
- package/es/copy-to-clipboard/index.js +1 -45
- package/es/copy-to-clipboard/index.js.map +1 -1
- package/es/countdown/countdown.d.ts +4 -0
- package/es/countdown/countdown.js +42 -0
- package/es/countdown/countdown.js.map +1 -0
- package/es/countdown/index.d.ts +1 -3
- package/es/countdown/index.js +1 -40
- package/es/countdown/index.js.map +1 -1
- package/es/date-picker/date-picker.d.ts +6 -0
- package/es/date-picker/date-picker.js +142 -0
- package/es/date-picker/date-picker.js.map +1 -0
- package/es/date-picker/index.d.ts +1 -5
- package/es/date-picker/index.js +1 -140
- package/es/date-picker/index.js.map +1 -1
- package/es/divider/divider.d.ts +4 -0
- package/es/divider/divider.js +18 -0
- package/es/divider/divider.js.map +1 -0
- package/es/divider/index.d.ts +1 -3
- package/es/divider/index.js +1 -16
- package/es/divider/index.js.map +1 -1
- package/es/drawer/drawer.d.ts +4 -0
- package/es/drawer/drawer.js +67 -0
- package/es/drawer/drawer.js.map +1 -0
- package/es/drawer/index.d.ts +1 -3
- package/es/drawer/index.js +1 -65
- package/es/drawer/index.js.map +1 -1
- package/es/dropdown/dropdown.d.ts +6 -0
- package/es/dropdown/dropdown.js +101 -0
- package/es/dropdown/dropdown.js.map +1 -0
- package/es/dropdown/index.d.ts +1 -5
- package/es/dropdown/index.js +1 -99
- package/es/dropdown/index.js.map +1 -1
- package/es/empty/empty.d.ts +4 -0
- package/es/empty/empty.js +28 -0
- package/es/empty/empty.js.map +1 -0
- package/es/empty/index.d.ts +1 -3
- package/es/empty/index.js +1 -26
- package/es/empty/index.js.map +1 -1
- package/es/flex/flex.d.ts +4 -0
- package/es/flex/flex.js +29 -0
- package/es/flex/flex.js.map +1 -0
- package/es/flex/index.d.ts +1 -3
- package/es/flex/index.js +1 -27
- package/es/flex/index.js.map +1 -1
- package/es/grid/types.d.ts +1 -1
- package/es/icon/icon.d.ts +4 -0
- package/es/icon/icon.js +17 -0
- package/es/icon/icon.js.map +1 -0
- package/es/icon/index.d.ts +1 -3
- package/es/icon/index.js +1 -15
- package/es/icon/index.js.map +1 -1
- package/es/image/image.d.ts +6 -0
- package/es/image/image.js +34 -0
- package/es/image/image.js.map +1 -0
- package/es/image/index.d.ts +1 -5
- package/es/image/index.js +1 -32
- package/es/image/index.js.map +1 -1
- package/es/input-number/index.d.ts +1 -3
- package/es/input-number/index.js +1 -60
- package/es/input-number/index.js.map +1 -1
- package/es/input-number/input-number.d.ts +4 -0
- package/es/input-number/input-number.js +62 -0
- package/es/input-number/input-number.js.map +1 -0
- package/es/input-password/index.d.ts +1 -2
- package/es/input-password/index.js +1 -19
- package/es/input-password/index.js.map +1 -1
- package/es/input-password/input-password.d.ts +3 -0
- package/es/input-password/input-password.js +21 -0
- package/es/input-password/input-password.js.map +1 -0
- package/es/intl-provider/index.d.ts +1 -7
- package/es/intl-provider/index.js +1 -6
- package/es/intl-provider/index.js.map +1 -1
- package/es/intl-provider/intl-provider.d.ts +8 -0
- package/es/intl-provider/intl-provider.js +8 -0
- package/es/intl-provider/intl-provider.js.map +1 -0
- package/es/keyboard/index.d.ts +1 -3
- package/es/keyboard/index.js +1 -13
- package/es/keyboard/index.js.map +1 -1
- package/es/keyboard/keyboard.d.ts +4 -0
- package/es/keyboard/keyboard.js +15 -0
- package/es/keyboard/keyboard.js.map +1 -0
- package/es/link/index.d.ts +1 -6
- package/es/link/index.js +1 -19
- package/es/link/index.js.map +1 -1
- package/es/link/link.d.ts +7 -0
- package/es/link/link.js +21 -0
- package/es/link/link.js.map +1 -0
- package/es/list/list.js +2 -4
- package/es/list/list.js.map +1 -1
- package/es/list/types.d.ts +2 -1
- package/es/loader/index.d.ts +1 -3
- package/es/loader/index.js +1 -23
- package/es/loader/index.js.map +1 -1
- package/es/loader/loader.d.ts +4 -0
- package/es/loader/loader.js +25 -0
- package/es/loader/loader.js.map +1 -0
- package/es/message/index.d.ts +2 -9
- package/es/message/index.js +1 -61
- package/es/message/index.js.map +1 -1
- package/es/message/message-container.d.ts +10 -0
- package/es/message/message-container.js +63 -0
- package/es/message/message-container.js.map +1 -0
- package/es/modal/index.d.ts +1 -3
- package/es/modal/index.js +1 -80
- package/es/modal/index.js.map +1 -1
- package/es/modal/modal.d.ts +4 -0
- package/es/modal/modal.js +82 -0
- package/es/modal/modal.js.map +1 -0
- package/es/notification/index.d.ts +1 -1
- package/es/notification/index.js +1 -72
- package/es/notification/index.js.map +1 -1
- package/es/notification/notification-container.d.ts +2 -0
- package/es/notification/notification-container.js +74 -0
- package/es/notification/notification-container.js.map +1 -0
- package/es/overlay/index.d.ts +1 -5
- package/es/overlay/index.js +1 -24
- package/es/overlay/index.js.map +1 -1
- package/es/overlay/overlay.d.ts +6 -0
- package/es/overlay/overlay.js +26 -0
- package/es/overlay/overlay.js.map +1 -0
- package/es/pagination/index.d.ts +1 -2
- package/es/pagination/index.js +1 -114
- package/es/pagination/index.js.map +1 -1
- package/es/pagination/pagination.d.ts +3 -0
- package/es/pagination/pagination.js +116 -0
- package/es/pagination/pagination.js.map +1 -0
- package/es/pop-confirm/index.d.ts +1 -5
- package/es/pop-confirm/index.js +1 -33
- package/es/pop-confirm/index.js.map +1 -1
- package/es/pop-confirm/pop-confirm.d.ts +6 -0
- package/es/pop-confirm/pop-confirm.js +35 -0
- package/es/pop-confirm/pop-confirm.js.map +1 -0
- package/es/popover/index.d.ts +1 -3
- package/es/popover/index.js +1 -15
- package/es/popover/index.js.map +1 -1
- package/es/popover/popover.d.ts +4 -0
- package/es/popover/popover.js +17 -0
- package/es/popover/popover.js.map +1 -0
- package/es/popup/index.d.ts +1 -2
- package/es/popup/index.js +1 -194
- package/es/popup/index.js.map +1 -1
- package/es/popup/popup.d.ts +3 -0
- package/es/popup/popup.js +196 -0
- package/es/popup/popup.js.map +1 -0
- package/es/portal/index.d.ts +1 -6
- package/es/portal/index.js +1 -5
- package/es/portal/index.js.map +1 -1
- package/es/portal/portal.d.ts +7 -0
- package/es/portal/portal.js +7 -0
- package/es/portal/portal.js.map +1 -0
- package/es/rate/index.d.ts +1 -3
- package/es/rate/index.js +1 -67
- package/es/rate/index.js.map +1 -1
- package/es/rate/rate.d.ts +4 -0
- package/es/rate/rate.js +69 -0
- package/es/rate/rate.js.map +1 -0
- package/es/result/index.d.ts +1 -3
- package/es/result/index.js +1 -35
- package/es/result/index.js.map +1 -1
- package/es/result/result.d.ts +4 -0
- package/es/result/result.js +37 -0
- package/es/result/result.js.map +1 -0
- package/es/scroll-indicator/index.d.ts +1 -6
- package/es/scroll-indicator/index.js +1 -36
- package/es/scroll-indicator/index.js.map +1 -1
- package/es/scroll-indicator/scroll-indicator.d.ts +7 -0
- package/es/scroll-indicator/scroll-indicator.js +38 -0
- package/es/scroll-indicator/scroll-indicator.js.map +1 -0
- package/es/skeleton/index.d.ts +1 -3
- package/es/skeleton/index.js +1 -16
- package/es/skeleton/index.js.map +1 -1
- package/es/skeleton/skeleton.d.ts +4 -0
- package/es/skeleton/skeleton.js +18 -0
- package/es/skeleton/skeleton.js.map +1 -0
- package/es/slider/index.d.ts +1 -3
- package/es/slider/index.js +1 -245
- package/es/slider/index.js.map +1 -1
- package/es/slider/slider.d.ts +4 -0
- package/es/slider/slider.js +247 -0
- package/es/slider/slider.js.map +1 -0
- package/es/space/index.d.ts +1 -3
- package/es/space/index.js +1 -27
- package/es/space/index.js.map +1 -1
- package/es/space/space.d.ts +4 -0
- package/es/space/space.js +29 -0
- package/es/space/space.js.map +1 -0
- package/es/split-button/index.d.ts +1 -6
- package/es/split-button/index.js +1 -17
- package/es/split-button/index.js.map +1 -1
- package/es/split-button/split-button.d.ts +7 -0
- package/es/split-button/split-button.js +19 -0
- package/es/split-button/split-button.js.map +1 -0
- package/es/sticky/index.d.ts +1 -5
- package/es/sticky/index.js +1 -125
- package/es/sticky/index.js.map +1 -1
- package/es/sticky/sticky.d.ts +6 -0
- package/es/sticky/sticky.js +127 -0
- package/es/sticky/sticky.js.map +1 -0
- package/es/strength-indicator/index.d.ts +1 -3
- package/es/strength-indicator/index.js +1 -22
- package/es/strength-indicator/index.js.map +1 -1
- package/es/strength-indicator/strength-indicator.d.ts +4 -0
- package/es/strength-indicator/strength-indicator.js +24 -0
- package/es/strength-indicator/strength-indicator.js.map +1 -0
- package/es/switch/index.d.ts +1 -3
- package/es/switch/index.js +1 -35
- package/es/switch/index.js.map +1 -1
- package/es/switch/switch.d.ts +4 -0
- package/es/switch/switch.js +37 -0
- package/es/switch/switch.js.map +1 -0
- package/es/table/table.js +2 -4
- package/es/table/table.js.map +1 -1
- package/es/table/types.d.ts +2 -1
- package/es/textarea/index.d.ts +1 -3
- package/es/textarea/index.js +1 -25
- package/es/textarea/index.js.map +1 -1
- package/es/textarea/textarea.d.ts +4 -0
- package/es/textarea/textarea.js +27 -0
- package/es/textarea/textarea.js.map +1 -0
- package/es/tooltip/index.d.ts +1 -3
- package/es/tooltip/index.js +1 -15
- package/es/tooltip/index.js.map +1 -1
- package/es/tooltip/tooltip.d.ts +4 -0
- package/es/tooltip/tooltip.js +17 -0
- package/es/tooltip/tooltip.js.map +1 -0
- package/es/transition/index.d.ts +2 -16
- package/es/transition/index.js +1 -7
- package/es/transition/index.js.map +1 -1
- package/es/transition/transition.d.ts +17 -0
- package/es/transition/transition.js +9 -0
- package/es/transition/transition.js.map +1 -0
- package/lib/_utils/use-theme.js +1 -1
- package/lib/_utils/use-theme.js.map +1 -1
- package/lib/alert/alert.d.ts +4 -0
- package/lib/alert/alert.js +59 -0
- package/lib/alert/alert.js.map +1 -0
- package/lib/alert/index.d.ts +1 -3
- package/lib/alert/index.js +2 -55
- package/lib/alert/index.js.map +1 -1
- package/lib/anchor/anchor.js +9 -0
- package/lib/anchor/anchor.js.map +1 -1
- package/lib/aspect-ratio/aspect-ratio.d.ts +4 -0
- package/lib/aspect-ratio/aspect-ratio.js +18 -0
- package/lib/aspect-ratio/aspect-ratio.js.map +1 -0
- package/lib/aspect-ratio/index.d.ts +1 -3
- package/lib/aspect-ratio/index.js +2 -14
- package/lib/aspect-ratio/index.js.map +1 -1
- package/lib/back-top/back-top.d.ts +3 -0
- package/lib/back-top/back-top.js +83 -0
- package/lib/back-top/back-top.js.map +1 -0
- package/lib/back-top/index.d.ts +1 -2
- package/lib/back-top/index.js +2 -79
- package/lib/back-top/index.js.map +1 -1
- package/lib/badge/badge.d.ts +4 -0
- package/lib/badge/badge.js +32 -0
- package/lib/badge/badge.js.map +1 -0
- package/lib/badge/index.d.ts +1 -3
- package/lib/badge/index.js +2 -28
- package/lib/badge/index.js.map +1 -1
- package/lib/calendar/calendar.d.ts +4 -0
- package/lib/calendar/calendar.js +120 -0
- package/lib/calendar/calendar.js.map +1 -0
- package/lib/calendar/index.d.ts +1 -3
- package/lib/calendar/index.js +2 -116
- package/lib/calendar/index.js.map +1 -1
- package/lib/collapse-transition/collapse-transition.d.ts +10 -0
- package/lib/collapse-transition/collapse-transition.js +91 -0
- package/lib/collapse-transition/collapse-transition.js.map +1 -0
- package/lib/collapse-transition/index.d.ts +1 -9
- package/lib/collapse-transition/index.js +3 -88
- package/lib/collapse-transition/index.js.map +1 -1
- package/lib/config-provider/config-provider.d.ts +6 -0
- package/lib/config-provider/config-provider.js +26 -0
- package/lib/config-provider/config-provider.js.map +1 -0
- package/lib/config-provider/index.d.ts +1 -5
- package/lib/config-provider/index.js +2 -22
- package/lib/config-provider/index.js.map +1 -1
- package/lib/copy-to-clipboard/copy-to-clipboard.d.ts +7 -0
- package/lib/copy-to-clipboard/copy-to-clipboard.js +50 -0
- package/lib/copy-to-clipboard/copy-to-clipboard.js.map +1 -0
- package/lib/copy-to-clipboard/index.d.ts +1 -6
- package/lib/copy-to-clipboard/index.js +2 -46
- package/lib/copy-to-clipboard/index.js.map +1 -1
- package/lib/countdown/countdown.d.ts +4 -0
- package/lib/countdown/countdown.js +45 -0
- package/lib/countdown/countdown.js.map +1 -0
- package/lib/countdown/index.d.ts +1 -3
- package/lib/countdown/index.js +2 -41
- package/lib/countdown/index.js.map +1 -1
- package/lib/date-picker/date-picker.d.ts +6 -0
- package/lib/date-picker/date-picker.js +145 -0
- package/lib/date-picker/date-picker.js.map +1 -0
- package/lib/date-picker/index.d.ts +1 -5
- package/lib/date-picker/index.js +2 -141
- package/lib/date-picker/index.js.map +1 -1
- package/lib/divider/divider.d.ts +4 -0
- package/lib/divider/divider.js +21 -0
- package/lib/divider/divider.js.map +1 -0
- package/lib/divider/index.d.ts +1 -3
- package/lib/divider/index.js +2 -17
- package/lib/divider/index.js.map +1 -1
- package/lib/drawer/drawer.d.ts +4 -0
- package/lib/drawer/drawer.js +70 -0
- package/lib/drawer/drawer.js.map +1 -0
- package/lib/drawer/index.d.ts +1 -3
- package/lib/drawer/index.js +2 -66
- package/lib/drawer/index.js.map +1 -1
- package/lib/dropdown/dropdown.d.ts +6 -0
- package/lib/dropdown/dropdown.js +104 -0
- package/lib/dropdown/dropdown.js.map +1 -0
- package/lib/dropdown/index.d.ts +1 -5
- package/lib/dropdown/index.js +2 -100
- package/lib/dropdown/index.js.map +1 -1
- package/lib/empty/empty.d.ts +4 -0
- package/lib/empty/empty.js +31 -0
- package/lib/empty/empty.js.map +1 -0
- package/lib/empty/index.d.ts +1 -3
- package/lib/empty/index.js +2 -27
- package/lib/empty/index.js.map +1 -1
- package/lib/flex/flex.d.ts +4 -0
- package/lib/flex/flex.js +32 -0
- package/lib/flex/flex.js.map +1 -0
- package/lib/flex/index.d.ts +1 -3
- package/lib/flex/index.js +2 -28
- package/lib/flex/index.js.map +1 -1
- package/lib/grid/types.d.ts +1 -1
- package/lib/icon/icon.d.ts +4 -0
- package/lib/icon/icon.js +20 -0
- package/lib/icon/icon.js.map +1 -0
- package/lib/icon/index.d.ts +1 -3
- package/lib/icon/index.js +2 -16
- package/lib/icon/index.js.map +1 -1
- package/lib/image/image.d.ts +6 -0
- package/lib/image/image.js +37 -0
- package/lib/image/image.js.map +1 -0
- package/lib/image/index.d.ts +1 -5
- package/lib/image/index.js +2 -33
- package/lib/image/index.js.map +1 -1
- package/lib/input-number/index.d.ts +1 -3
- package/lib/input-number/index.js +2 -61
- package/lib/input-number/index.js.map +1 -1
- package/lib/input-number/input-number.d.ts +4 -0
- package/lib/input-number/input-number.js +65 -0
- package/lib/input-number/input-number.js.map +1 -0
- package/lib/input-password/index.d.ts +1 -2
- package/lib/input-password/index.js +2 -20
- package/lib/input-password/index.js.map +1 -1
- package/lib/input-password/input-password.d.ts +3 -0
- package/lib/input-password/input-password.js +24 -0
- package/lib/input-password/input-password.js.map +1 -0
- package/lib/intl-provider/index.d.ts +1 -7
- package/lib/intl-provider/index.js +2 -7
- package/lib/intl-provider/index.js.map +1 -1
- package/lib/intl-provider/intl-provider.d.ts +8 -0
- package/lib/intl-provider/intl-provider.js +11 -0
- package/lib/intl-provider/intl-provider.js.map +1 -0
- package/lib/keyboard/index.d.ts +1 -3
- package/lib/keyboard/index.js +2 -14
- package/lib/keyboard/index.js.map +1 -1
- package/lib/keyboard/keyboard.d.ts +4 -0
- package/lib/keyboard/keyboard.js +18 -0
- package/lib/keyboard/keyboard.js.map +1 -0
- package/lib/link/index.d.ts +1 -6
- package/lib/link/index.js +2 -20
- package/lib/link/index.js.map +1 -1
- package/lib/link/link.d.ts +7 -0
- package/lib/link/link.js +24 -0
- package/lib/link/link.js.map +1 -0
- package/lib/list/list.js +2 -4
- package/lib/list/list.js.map +1 -1
- package/lib/list/types.d.ts +2 -1
- package/lib/loader/index.d.ts +1 -3
- package/lib/loader/index.js +2 -24
- package/lib/loader/index.js.map +1 -1
- package/lib/loader/loader.d.ts +4 -0
- package/lib/loader/loader.js +28 -0
- package/lib/loader/loader.js.map +1 -0
- package/lib/message/index.d.ts +2 -9
- package/lib/message/index.js +2 -62
- package/lib/message/index.js.map +1 -1
- package/lib/message/message-container.d.ts +10 -0
- package/lib/message/message-container.js +66 -0
- package/lib/message/message-container.js.map +1 -0
- package/lib/modal/index.d.ts +1 -3
- package/lib/modal/index.js +2 -81
- package/lib/modal/index.js.map +1 -1
- package/lib/modal/modal.d.ts +4 -0
- package/lib/modal/modal.js +85 -0
- package/lib/modal/modal.js.map +1 -0
- package/lib/notification/index.d.ts +1 -1
- package/lib/notification/index.js +2 -73
- package/lib/notification/index.js.map +1 -1
- package/lib/notification/notification-container.d.ts +2 -0
- package/lib/notification/notification-container.js +77 -0
- package/lib/notification/notification-container.js.map +1 -0
- package/lib/overlay/index.d.ts +1 -5
- package/lib/overlay/index.js +2 -25
- package/lib/overlay/index.js.map +1 -1
- package/lib/overlay/overlay.d.ts +6 -0
- package/lib/overlay/overlay.js +29 -0
- package/lib/overlay/overlay.js.map +1 -0
- package/lib/pagination/index.d.ts +1 -2
- package/lib/pagination/index.js +2 -115
- package/lib/pagination/index.js.map +1 -1
- package/lib/pagination/pagination.d.ts +3 -0
- package/lib/pagination/pagination.js +119 -0
- package/lib/pagination/pagination.js.map +1 -0
- package/lib/pop-confirm/index.d.ts +1 -5
- package/lib/pop-confirm/index.js +2 -34
- package/lib/pop-confirm/index.js.map +1 -1
- package/lib/pop-confirm/pop-confirm.d.ts +6 -0
- package/lib/pop-confirm/pop-confirm.js +38 -0
- package/lib/pop-confirm/pop-confirm.js.map +1 -0
- package/lib/popover/index.d.ts +1 -3
- package/lib/popover/index.js +2 -16
- package/lib/popover/index.js.map +1 -1
- package/lib/popover/popover.d.ts +4 -0
- package/lib/popover/popover.js +20 -0
- package/lib/popover/popover.js.map +1 -0
- package/lib/popup/index.d.ts +1 -2
- package/lib/popup/index.js +2 -195
- package/lib/popup/index.js.map +1 -1
- package/lib/popup/popup.d.ts +3 -0
- package/lib/popup/popup.js +199 -0
- package/lib/popup/popup.js.map +1 -0
- package/lib/portal/index.d.ts +1 -6
- package/lib/portal/index.js +2 -6
- package/lib/portal/index.js.map +1 -1
- package/lib/portal/portal.d.ts +7 -0
- package/lib/portal/portal.js +10 -0
- package/lib/portal/portal.js.map +1 -0
- package/lib/rate/index.d.ts +1 -3
- package/lib/rate/index.js +2 -68
- package/lib/rate/index.js.map +1 -1
- package/lib/rate/rate.d.ts +4 -0
- package/lib/rate/rate.js +72 -0
- package/lib/rate/rate.js.map +1 -0
- package/lib/result/index.d.ts +1 -3
- package/lib/result/index.js +2 -36
- package/lib/result/index.js.map +1 -1
- package/lib/result/result.d.ts +4 -0
- package/lib/result/result.js +40 -0
- package/lib/result/result.js.map +1 -0
- package/lib/scroll-indicator/index.d.ts +1 -6
- package/lib/scroll-indicator/index.js +2 -37
- package/lib/scroll-indicator/index.js.map +1 -1
- package/lib/scroll-indicator/scroll-indicator.d.ts +7 -0
- package/lib/scroll-indicator/scroll-indicator.js +41 -0
- package/lib/scroll-indicator/scroll-indicator.js.map +1 -0
- package/lib/skeleton/index.d.ts +1 -3
- package/lib/skeleton/index.js +2 -17
- package/lib/skeleton/index.js.map +1 -1
- package/lib/skeleton/skeleton.d.ts +4 -0
- package/lib/skeleton/skeleton.js +21 -0
- package/lib/skeleton/skeleton.js.map +1 -0
- package/lib/slider/index.d.ts +1 -3
- package/lib/slider/index.js +2 -246
- package/lib/slider/index.js.map +1 -1
- package/lib/slider/slider.d.ts +4 -0
- package/lib/slider/slider.js +250 -0
- package/lib/slider/slider.js.map +1 -0
- package/lib/space/index.d.ts +1 -3
- package/lib/space/index.js +2 -28
- package/lib/space/index.js.map +1 -1
- package/lib/space/space.d.ts +4 -0
- package/lib/space/space.js +32 -0
- package/lib/space/space.js.map +1 -0
- package/lib/split-button/index.d.ts +1 -6
- package/lib/split-button/index.js +2 -18
- package/lib/split-button/index.js.map +1 -1
- package/lib/split-button/split-button.d.ts +7 -0
- package/lib/split-button/split-button.js +22 -0
- package/lib/split-button/split-button.js.map +1 -0
- package/lib/sticky/index.d.ts +1 -5
- package/lib/sticky/index.js +2 -126
- package/lib/sticky/index.js.map +1 -1
- package/lib/sticky/sticky.d.ts +6 -0
- package/lib/sticky/sticky.js +130 -0
- package/lib/sticky/sticky.js.map +1 -0
- package/lib/strength-indicator/index.d.ts +1 -3
- package/lib/strength-indicator/index.js +2 -23
- package/lib/strength-indicator/index.js.map +1 -1
- package/lib/strength-indicator/strength-indicator.d.ts +4 -0
- package/lib/strength-indicator/strength-indicator.js +27 -0
- package/lib/strength-indicator/strength-indicator.js.map +1 -0
- package/lib/switch/index.d.ts +1 -3
- package/lib/switch/index.js +2 -36
- package/lib/switch/index.js.map +1 -1
- package/lib/switch/switch.d.ts +4 -0
- package/lib/switch/switch.js +40 -0
- package/lib/switch/switch.js.map +1 -0
- package/lib/table/table.js +2 -4
- package/lib/table/table.js.map +1 -1
- package/lib/table/types.d.ts +2 -1
- package/lib/textarea/index.d.ts +1 -3
- package/lib/textarea/index.js +2 -26
- package/lib/textarea/index.js.map +1 -1
- package/lib/textarea/textarea.d.ts +4 -0
- package/lib/textarea/textarea.js +30 -0
- package/lib/textarea/textarea.js.map +1 -0
- package/lib/tooltip/index.d.ts +1 -3
- package/lib/tooltip/index.js +2 -16
- package/lib/tooltip/index.js.map +1 -1
- package/lib/tooltip/tooltip.d.ts +4 -0
- package/lib/tooltip/tooltip.js +20 -0
- package/lib/tooltip/tooltip.js.map +1 -0
- package/lib/transition/index.d.ts +2 -16
- package/lib/transition/index.js +3 -8
- package/lib/transition/index.js.map +1 -1
- package/lib/transition/transition.d.ts +17 -0
- package/lib/transition/transition.js +11 -0
- package/lib/transition/transition.js.map +1 -0
- package/package.json +3 -2
- package/es/alert/style/_index.scss +0 -72
- package/es/alert/style/_mixin.scss +0 -5
- package/es/alert/style/css.js +0 -2
- package/es/anchor/style/_index.scss +0 -83
- package/es/anchor/style/css.js +0 -3
- package/es/aspect-ratio/style/_index.scss +0 -22
- package/es/aspect-ratio/style/css.js +0 -2
- package/es/auto-complete/style/_index.scss +0 -58
- package/es/auto-complete/style/css.js +0 -2
- package/es/avatar/style/_index.scss +0 -80
- package/es/avatar/style/css.js +0 -2
- package/es/back-top/style/_index.scss +0 -25
- package/es/back-top/style/css.js +0 -2
- package/es/badge/style/_index.scss +0 -60
- package/es/badge/style/_mixin.scss +0 -11
- package/es/badge/style/css.js +0 -2
- package/es/breadcrumb/style/_index.scss +0 -38
- package/es/breadcrumb/style/css.js +0 -2
- package/es/button/style/_index.scss +0 -215
- package/es/button/style/_mixin.scss +0 -45
- package/es/button/style/css.js +0 -2
- package/es/calendar/style/_index.scss +0 -190
- package/es/calendar/style/css.js +0 -2
- package/es/card/style/_index.scss +0 -57
- package/es/card/style/_mixin.scss +0 -4
- package/es/card/style/css.js +0 -2
- package/es/carousel/style/_index.scss +0 -158
- package/es/carousel/style/css.js +0 -2
- package/es/cascader/style/_index.scss +0 -162
- package/es/cascader/style/css.js +0 -2
- package/es/checkbox/style/_index.scss +0 -139
- package/es/checkbox/style/css.js +0 -2
- package/es/collapse/style/_index.scss +0 -101
- package/es/collapse/style/css.js +0 -2
- package/es/collapse-transition/style/_index.scss +0 -4
- package/es/collapse-transition/style/css.js +0 -2
- package/es/color-picker/style/_index.scss +0 -196
- package/es/color-picker/style/css.js +0 -2
- package/es/date-picker/style/_index.scss +0 -272
- package/es/date-picker/style/css.js +0 -2
- package/es/descriptions/style/_index.scss +0 -116
- package/es/descriptions/style/css.js +0 -2
- package/es/divider/style/_index.scss +0 -80
- package/es/divider/style/css.js +0 -2
- package/es/drawer/style/_index.scss +0 -148
- package/es/drawer/style/css.js +0 -4
- package/es/dropdown/style/_index.scss +0 -37
- package/es/dropdown/style/css.js +0 -4
- package/es/empty/style/_index.scss +0 -26
- package/es/empty/style/css.js +0 -2
- package/es/flex/style/_index.scss +0 -5
- package/es/flex/style/css.js +0 -2
- package/es/flip/style/_index.scss +0 -61
- package/es/flip/style/css.js +0 -2
- package/es/form/style/_index.scss +0 -93
- package/es/form/style/css.js +0 -3
- package/es/grid/style/_index.scss +0 -90
- package/es/grid/style/css.js +0 -2
- package/es/icon/style/_index.scss +0 -16
- package/es/icon/style/css.js +0 -2
- package/es/image/style/_index.scss +0 -9
- package/es/image/style/css.js +0 -2
- package/es/input/style/_index.scss +0 -180
- package/es/input/style/_mixin.scss +0 -38
- package/es/input/style/css.js +0 -2
- package/es/input-number/style/_index.scss +0 -142
- package/es/input-number/style/css.js +0 -3
- package/es/input-password/style/_index.scss +0 -20
- package/es/input-password/style/css.js +0 -3
- package/es/keyboard/style/_index.scss +0 -23
- package/es/keyboard/style/css.js +0 -2
- package/es/layout/style/_index.scss +0 -82
- package/es/layout/style/css.js +0 -2
- package/es/link/style/_index.scss +0 -17
- package/es/link/style/css.js +0 -2
- package/es/list/style/_index.scss +0 -172
- package/es/list/style/css.js +0 -2
- package/es/loader/style/_index.scss +0 -142
- package/es/loader/style/css.js +0 -2
- package/es/loading-bar/style/_index.scss +0 -17
- package/es/loading-bar/style/css.js +0 -2
- package/es/menu/style/_index.scss +0 -183
- package/es/menu/style/_mixin.scss +0 -16
- package/es/menu/style/css.js +0 -4
- package/es/message/style/_index.scss +0 -59
- package/es/message/style/css.js +0 -2
- package/es/modal/style/_index.scss +0 -115
- package/es/modal/style/css.js +0 -5
- package/es/native-select/style/_index.scss +0 -65
- package/es/native-select/style/_mixin.scss +0 -4
- package/es/native-select/style/css.js +0 -2
- package/es/notification/style/_index.scss +0 -66
- package/es/notification/style/css.js +0 -2
- package/es/overlay/style/_index.scss +0 -51
- package/es/overlay/style/css.js +0 -2
- package/es/pagination/style/_index.scss +0 -143
- package/es/pagination/style/css.js +0 -2
- package/es/pop-confirm/style/_index.scss +0 -25
- package/es/pop-confirm/style/css.js +0 -5
- package/es/popover/style/_index.scss +0 -42
- package/es/popover/style/css.js +0 -4
- package/es/popup/style/_index.scss +0 -84
- package/es/popup/style/css.js +0 -4
- package/es/progress/style/_index.scss +0 -170
- package/es/progress/style/css.js +0 -2
- package/es/radio/style/_index.scss +0 -86
- package/es/radio/style/css.js +0 -2
- package/es/rate/style/_index.scss +0 -31
- package/es/rate/style/css.js +0 -2
- package/es/result/style/_index.scss +0 -48
- package/es/result/style/css.js +0 -2
- package/es/scroll-indicator/style/_index.scss +0 -15
- package/es/scroll-indicator/style/css.js +0 -2
- package/es/segmented/style/_index.scss +0 -93
- package/es/segmented/style/css.js +0 -2
- package/es/select/style/_index.scss +0 -313
- package/es/select/style/css.js +0 -4
- package/es/skeleton/style/_index.scss +0 -42
- package/es/skeleton/style/css.js +0 -2
- package/es/slider/style/_index.scss +0 -177
- package/es/slider/style/css.js +0 -4
- package/es/space/style/_index.scss +0 -25
- package/es/space/style/css.js +0 -2
- package/es/speed-dial/style/_index.scss +0 -230
- package/es/speed-dial/style/css.js +0 -2
- package/es/split/style/_index.scss +0 -98
- package/es/split/style/css.js +0 -2
- package/es/split-button/style/_index.scss +0 -9
- package/es/split-button/style/css.js +0 -5
- package/es/statistic/style/_index.scss +0 -31
- package/es/statistic/style/css.js +0 -2
- package/es/steps/style/_index.scss +0 -208
- package/es/steps/style/css.js +0 -2
- package/es/sticky/style/_index.scss +0 -8
- package/es/sticky/style/css.js +0 -2
- package/es/strength-indicator/style/_index.scss +0 -46
- package/es/strength-indicator/style/css.js +0 -2
- package/es/style/_animation.scss +0 -31
- package/es/style/_component.scss +0 -78
- package/es/style/_font.scss +0 -981
- package/es/style/_mixins.scss +0 -13
- package/es/style/_normalise.scss +0 -405
- package/es/style/_theme.scss +0 -26
- package/es/style/_tokens.scss +0 -61
- package/es/style/_variables.scss +0 -266
- package/es/style/fonts/iconfont.eot +0 -0
- package/es/style/fonts/iconfont.svg +0 -752
- package/es/style/fonts/iconfont.ttf +0 -0
- package/es/style/fonts/iconfont.woff +0 -0
- package/es/style/index.css +0 -10104
- package/es/style/index.scss +0 -7
- package/es/style/themes/_dark.scss +0 -380
- package/es/style/themes/_light.scss +0 -380
- package/es/switch/style/_index.scss +0 -144
- package/es/switch/style/_mixin.scss +0 -16
- package/es/switch/style/css.js +0 -2
- package/es/table/style/_index.scss +0 -181
- package/es/table/style/css.js +0 -2
- package/es/tabs/style/css.js +0 -2
- package/es/tabs/style/index.css +0 -241
- package/es/tabs/style/index.scss +0 -315
- package/es/tag/style/_index.scss +0 -119
- package/es/tag/style/css.js +0 -2
- package/es/textarea/style/_index.scss +0 -28
- package/es/textarea/style/css.js +0 -4
- package/es/time-picker/style/_index.scss +0 -212
- package/es/time-picker/style/css.js +0 -2
- package/es/timeline/style/_index.scss +0 -91
- package/es/timeline/style/css.js +0 -2
- package/es/tooltip/style/_index.scss +0 -41
- package/es/tooltip/style/css.js +0 -4
- package/es/transfer/style/_index.scss +0 -98
- package/es/transfer/style/css.js +0 -6
- package/es/transition/style/_index.scss +0 -20
- package/es/transition/style/_mixin.scss +0 -58
- package/es/transition/style/css.js +0 -2
- package/es/tree/style/_index.scss +0 -66
- package/es/tree/style/css.js +0 -4
- package/es/typography/style/_index.scss +0 -126
- package/es/typography/style/css.js +0 -2
- package/es/upload/style/_index.scss +0 -99
- package/es/upload/style/css.js +0 -4
- package/lib/alert/style/_index.scss +0 -72
- package/lib/alert/style/_mixin.scss +0 -5
- package/lib/alert/style/css.js +0 -4
- package/lib/anchor/style/_index.scss +0 -83
- package/lib/anchor/style/css.js +0 -5
- package/lib/aspect-ratio/style/_index.scss +0 -22
- package/lib/aspect-ratio/style/css.js +0 -4
- package/lib/auto-complete/style/_index.scss +0 -58
- package/lib/auto-complete/style/css.js +0 -4
- package/lib/avatar/style/_index.scss +0 -80
- package/lib/avatar/style/css.js +0 -4
- package/lib/back-top/style/_index.scss +0 -25
- package/lib/back-top/style/css.js +0 -4
- package/lib/badge/style/_index.scss +0 -60
- package/lib/badge/style/_mixin.scss +0 -11
- package/lib/badge/style/css.js +0 -4
- package/lib/breadcrumb/style/_index.scss +0 -38
- package/lib/breadcrumb/style/css.js +0 -4
- package/lib/button/style/_index.scss +0 -215
- package/lib/button/style/_mixin.scss +0 -45
- package/lib/button/style/css.js +0 -4
- package/lib/calendar/style/_index.scss +0 -190
- package/lib/calendar/style/css.js +0 -4
- package/lib/card/style/_index.scss +0 -57
- package/lib/card/style/_mixin.scss +0 -4
- package/lib/card/style/css.js +0 -4
- package/lib/carousel/style/_index.scss +0 -158
- package/lib/carousel/style/css.js +0 -4
- package/lib/cascader/style/_index.scss +0 -162
- package/lib/cascader/style/css.js +0 -4
- package/lib/checkbox/style/_index.scss +0 -139
- package/lib/checkbox/style/css.js +0 -4
- package/lib/collapse/style/_index.scss +0 -101
- package/lib/collapse/style/css.js +0 -4
- package/lib/collapse-transition/style/_index.scss +0 -4
- package/lib/collapse-transition/style/css.js +0 -4
- package/lib/color-picker/style/_index.scss +0 -196
- package/lib/color-picker/style/css.js +0 -4
- package/lib/date-picker/style/_index.scss +0 -272
- package/lib/date-picker/style/css.js +0 -4
- package/lib/descriptions/style/_index.scss +0 -116
- package/lib/descriptions/style/css.js +0 -4
- package/lib/divider/style/_index.scss +0 -80
- package/lib/divider/style/css.js +0 -4
- package/lib/drawer/style/_index.scss +0 -148
- package/lib/drawer/style/css.js +0 -6
- package/lib/dropdown/style/_index.scss +0 -37
- package/lib/dropdown/style/css.js +0 -6
- package/lib/empty/style/_index.scss +0 -26
- package/lib/empty/style/css.js +0 -4
- package/lib/flex/style/_index.scss +0 -5
- package/lib/flex/style/css.js +0 -4
- package/lib/flip/style/_index.scss +0 -61
- package/lib/flip/style/css.js +0 -4
- package/lib/form/style/_index.scss +0 -93
- package/lib/form/style/css.js +0 -5
- package/lib/grid/style/_index.scss +0 -90
- package/lib/grid/style/css.js +0 -4
- package/lib/icon/style/_index.scss +0 -16
- package/lib/icon/style/css.js +0 -4
- package/lib/image/style/_index.scss +0 -9
- package/lib/image/style/css.js +0 -4
- package/lib/input/style/_index.scss +0 -180
- package/lib/input/style/_mixin.scss +0 -38
- package/lib/input/style/css.js +0 -4
- package/lib/input-number/style/_index.scss +0 -142
- package/lib/input-number/style/css.js +0 -5
- package/lib/input-password/style/_index.scss +0 -20
- package/lib/input-password/style/css.js +0 -5
- package/lib/keyboard/style/_index.scss +0 -23
- package/lib/keyboard/style/css.js +0 -4
- package/lib/layout/style/_index.scss +0 -82
- package/lib/layout/style/css.js +0 -4
- package/lib/link/style/_index.scss +0 -17
- package/lib/link/style/css.js +0 -4
- package/lib/list/style/_index.scss +0 -172
- package/lib/list/style/css.js +0 -4
- package/lib/loader/style/_index.scss +0 -142
- package/lib/loader/style/css.js +0 -4
- package/lib/loading-bar/style/_index.scss +0 -17
- package/lib/loading-bar/style/css.js +0 -4
- package/lib/menu/style/_index.scss +0 -183
- package/lib/menu/style/_mixin.scss +0 -16
- package/lib/menu/style/css.js +0 -6
- package/lib/message/style/_index.scss +0 -59
- package/lib/message/style/css.js +0 -4
- package/lib/modal/style/_index.scss +0 -115
- package/lib/modal/style/css.js +0 -7
- package/lib/native-select/style/_index.scss +0 -65
- package/lib/native-select/style/_mixin.scss +0 -4
- package/lib/native-select/style/css.js +0 -4
- package/lib/notification/style/_index.scss +0 -66
- package/lib/notification/style/css.js +0 -4
- package/lib/overlay/style/_index.scss +0 -51
- package/lib/overlay/style/css.js +0 -4
- package/lib/pagination/style/_index.scss +0 -143
- package/lib/pagination/style/css.js +0 -4
- package/lib/pop-confirm/style/_index.scss +0 -25
- package/lib/pop-confirm/style/css.js +0 -7
- package/lib/popover/style/_index.scss +0 -42
- package/lib/popover/style/css.js +0 -6
- package/lib/popup/style/_index.scss +0 -84
- package/lib/popup/style/css.js +0 -6
- package/lib/progress/style/_index.scss +0 -170
- package/lib/progress/style/css.js +0 -4
- package/lib/radio/style/_index.scss +0 -86
- package/lib/radio/style/css.js +0 -4
- package/lib/rate/style/_index.scss +0 -31
- package/lib/rate/style/css.js +0 -4
- package/lib/result/style/_index.scss +0 -48
- package/lib/result/style/css.js +0 -4
- package/lib/scroll-indicator/style/_index.scss +0 -15
- package/lib/scroll-indicator/style/css.js +0 -4
- package/lib/segmented/style/_index.scss +0 -93
- package/lib/segmented/style/css.js +0 -4
- package/lib/select/style/_index.scss +0 -313
- package/lib/select/style/css.js +0 -6
- package/lib/skeleton/style/_index.scss +0 -42
- package/lib/skeleton/style/css.js +0 -4
- package/lib/slider/style/_index.scss +0 -177
- package/lib/slider/style/css.js +0 -6
- package/lib/space/style/_index.scss +0 -25
- package/lib/space/style/css.js +0 -4
- package/lib/speed-dial/style/_index.scss +0 -230
- package/lib/speed-dial/style/css.js +0 -4
- package/lib/split/style/_index.scss +0 -98
- package/lib/split/style/css.js +0 -4
- package/lib/split-button/style/_index.scss +0 -9
- package/lib/split-button/style/css.js +0 -7
- package/lib/statistic/style/_index.scss +0 -31
- package/lib/statistic/style/css.js +0 -4
- package/lib/steps/style/_index.scss +0 -208
- package/lib/steps/style/css.js +0 -4
- package/lib/sticky/style/_index.scss +0 -8
- package/lib/sticky/style/css.js +0 -4
- package/lib/strength-indicator/style/_index.scss +0 -46
- package/lib/strength-indicator/style/css.js +0 -4
- package/lib/style/_animation.scss +0 -31
- package/lib/style/_component.scss +0 -78
- package/lib/style/_font.scss +0 -981
- package/lib/style/_mixins.scss +0 -13
- package/lib/style/_normalise.scss +0 -405
- package/lib/style/_theme.scss +0 -26
- package/lib/style/_tokens.scss +0 -61
- package/lib/style/_variables.scss +0 -266
- package/lib/style/fonts/iconfont.eot +0 -0
- package/lib/style/fonts/iconfont.svg +0 -752
- package/lib/style/fonts/iconfont.ttf +0 -0
- package/lib/style/fonts/iconfont.woff +0 -0
- package/lib/style/index.css +0 -10104
- package/lib/style/index.scss +0 -7
- package/lib/style/themes/_dark.scss +0 -380
- package/lib/style/themes/_light.scss +0 -380
- package/lib/switch/style/_index.scss +0 -144
- package/lib/switch/style/_mixin.scss +0 -16
- package/lib/switch/style/css.js +0 -4
- package/lib/table/style/_index.scss +0 -181
- package/lib/table/style/css.js +0 -4
- package/lib/tabs/style/css.js +0 -4
- package/lib/tabs/style/index.css +0 -241
- package/lib/tabs/style/index.scss +0 -315
- package/lib/tag/style/_index.scss +0 -119
- package/lib/tag/style/css.js +0 -4
- package/lib/textarea/style/_index.scss +0 -28
- package/lib/textarea/style/css.js +0 -6
- package/lib/time-picker/style/_index.scss +0 -212
- package/lib/time-picker/style/css.js +0 -4
- package/lib/timeline/style/_index.scss +0 -91
- package/lib/timeline/style/css.js +0 -4
- package/lib/tooltip/style/_index.scss +0 -41
- package/lib/tooltip/style/css.js +0 -6
- package/lib/transfer/style/_index.scss +0 -98
- package/lib/transfer/style/css.js +0 -8
- package/lib/transition/style/_index.scss +0 -20
- package/lib/transition/style/_mixin.scss +0 -58
- package/lib/transition/style/css.js +0 -4
- package/lib/tree/style/_index.scss +0 -66
- package/lib/tree/style/css.js +0 -6
- package/lib/typography/style/_index.scss +0 -126
- package/lib/typography/style/css.js +0 -4
- package/lib/upload/style/_index.scss +0 -99
- package/lib/upload/style/css.js +0 -6
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React, { useContext, useEffect, useId, useRef, useState } from 'react';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import { CSSTransition } from 'react-transition-group';
|
|
5
|
+
import Overlay from '../overlay';
|
|
6
|
+
import { ConfigContext } from '../config-provider/config-context';
|
|
7
|
+
import { getPrefixCls } from '../_utils/general';
|
|
8
|
+
const Drawer = React.forwardRef((props, ref) => {
|
|
9
|
+
const { visible, placement = 'right', size = 256, closable = true, unmountOnClose = true, maskType = 'default', maskClosable = true, onClose, prefixCls: customisedCls, afterClose, zIndex = 1000, header, footer, className, maskStyle, style, children, } = props;
|
|
10
|
+
const [drawerVisible, setDrawerVisible] = useState(visible);
|
|
11
|
+
const configContext = useContext(ConfigContext);
|
|
12
|
+
const prefixCls = getPrefixCls('drawer', configContext.prefixCls, customisedCls);
|
|
13
|
+
const cls = classNames(prefixCls, className, `${prefixCls}_${placement}`);
|
|
14
|
+
const sty = placement === 'top' || placement === 'bottom' ? { height: size } : { width: size };
|
|
15
|
+
const nodeRef = useRef(null);
|
|
16
|
+
const previousFocusRef = useRef(null);
|
|
17
|
+
const titleId = useId();
|
|
18
|
+
// Focus trap + Escape key
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (!visible)
|
|
21
|
+
return;
|
|
22
|
+
previousFocusRef.current = document.activeElement;
|
|
23
|
+
const handleKeyDown = (e) => {
|
|
24
|
+
if (e.key === 'Escape') {
|
|
25
|
+
onClose?.(e);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
if (e.key === 'Tab' && nodeRef.current) {
|
|
29
|
+
const focusable = nodeRef.current.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
|
|
30
|
+
if (focusable.length === 0)
|
|
31
|
+
return;
|
|
32
|
+
const first = focusable[0];
|
|
33
|
+
const last = focusable[focusable.length - 1];
|
|
34
|
+
if (e.shiftKey) {
|
|
35
|
+
if (document.activeElement === first) {
|
|
36
|
+
e.preventDefault();
|
|
37
|
+
last.focus();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
if (document.activeElement === last) {
|
|
42
|
+
e.preventDefault();
|
|
43
|
+
first.focus();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
document.addEventListener('keydown', handleKeyDown);
|
|
49
|
+
requestAnimationFrame(() => {
|
|
50
|
+
if (nodeRef.current) {
|
|
51
|
+
const focusable = nodeRef.current.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
|
|
52
|
+
if (focusable.length > 0)
|
|
53
|
+
focusable[0].focus();
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
return () => {
|
|
57
|
+
document.removeEventListener('keydown', handleKeyDown);
|
|
58
|
+
previousFocusRef.current?.focus();
|
|
59
|
+
};
|
|
60
|
+
}, [visible, onClose]);
|
|
61
|
+
return (_jsx(Overlay, { onEnter: () => setDrawerVisible(true), onExit: () => setDrawerVisible(false), zIndex: zIndex, type: maskType, unmountOnExit: unmountOnClose, isShow: visible, onExited: afterClose, clickCallback: (e) => {
|
|
62
|
+
maskClosable && onClose ? onClose(e) : undefined;
|
|
63
|
+
}, style: maskStyle, children: _jsx("div", { ref: ref, className: cls, style: { ...style, ...sty }, children: _jsx(CSSTransition, { appear: true, nodeRef: nodeRef, in: drawerVisible, timeout: 0, classNames: `${prefixCls}__content_move`, children: _jsxs("div", { ref: nodeRef, className: `${prefixCls}__content`, role: "dialog", "aria-modal": "true", "aria-labelledby": header ? titleId : undefined, onClick: (e) => e.stopPropagation(), children: [closable && (_jsx("button", { type: "button", className: `${prefixCls}__close-btn`, onClick: onClose, "aria-label": "Close", children: "\u2715" })), header && _jsx("div", { className: `${prefixCls}__header`, id: titleId, children: header }), _jsx("div", { className: `${prefixCls}__body`, children: children }), footer && _jsx("div", { className: `${prefixCls}__footer`, children: footer })] }) }) }) }));
|
|
64
|
+
});
|
|
65
|
+
Drawer.displayName = 'Drawer';
|
|
66
|
+
export default Drawer;
|
|
67
|
+
//# sourceMappingURL=drawer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawer.js","sourceRoot":"","sources":["../../components/drawer/drawer.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9E,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,OAAO,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGjD,MAAM,MAAM,GAAG,KAAK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SAAS,EAAE,GAAG,SAAS,aAAa,EAAE,OAAO,EAAE,OAAO,gBAAa,OAAO,uBAEvF,CACV,EACA,MAAM,IAAI,cAAK,SAAS,EAAE,GAAG,SAAS,UAAU,EAAE,EAAE,EAAE,OAAO,YAAG,MAAM,GAAO,EAC9E,cAAK,SAAS,EAAE,GAAG,SAAS,QAAQ,YAAG,QAAQ,GAAO,EACrD,MAAM,IAAI,cAAK,SAAS,EAAE,GAAG,SAAS,UAAU,YAAG,MAAM,GAAO,IAC7D,GACQ,GACZ,GACE,CACX,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,WAAW,GAAG,QAAQ,CAAC;AAE9B,eAAe,MAAM,CAAC"}
|
package/es/drawer/index.d.ts
CHANGED
package/es/drawer/index.js
CHANGED
|
@@ -1,67 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
import React, { useContext, useEffect, useId, useRef, useState } from 'react';
|
|
3
|
-
import classNames from 'classnames';
|
|
4
|
-
import { CSSTransition } from 'react-transition-group';
|
|
5
|
-
import Overlay from '../overlay';
|
|
6
|
-
import { ConfigContext } from '../config-provider/config-context';
|
|
7
|
-
import { getPrefixCls } from '../_utils/general';
|
|
8
|
-
const Drawer = React.forwardRef((props, ref) => {
|
|
9
|
-
const { visible, placement = 'right', size = 256, closable = true, unmountOnClose = true, maskType = 'default', maskClosable = true, onClose, prefixCls: customisedCls, afterClose, zIndex = 1000, header, footer, className, maskStyle, style, children, } = props;
|
|
10
|
-
const [drawerVisible, setDrawerVisible] = useState(visible);
|
|
11
|
-
const configContext = useContext(ConfigContext);
|
|
12
|
-
const prefixCls = getPrefixCls('drawer', configContext.prefixCls, customisedCls);
|
|
13
|
-
const cls = classNames(prefixCls, className, `${prefixCls}_${placement}`);
|
|
14
|
-
const sty = placement === 'top' || placement === 'bottom' ? { height: size } : { width: size };
|
|
15
|
-
const nodeRef = useRef(null);
|
|
16
|
-
const previousFocusRef = useRef(null);
|
|
17
|
-
const titleId = useId();
|
|
18
|
-
// Focus trap + Escape key
|
|
19
|
-
useEffect(() => {
|
|
20
|
-
if (!visible)
|
|
21
|
-
return;
|
|
22
|
-
previousFocusRef.current = document.activeElement;
|
|
23
|
-
const handleKeyDown = (e) => {
|
|
24
|
-
if (e.key === 'Escape') {
|
|
25
|
-
onClose?.(e);
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
if (e.key === 'Tab' && nodeRef.current) {
|
|
29
|
-
const focusable = nodeRef.current.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
|
|
30
|
-
if (focusable.length === 0)
|
|
31
|
-
return;
|
|
32
|
-
const first = focusable[0];
|
|
33
|
-
const last = focusable[focusable.length - 1];
|
|
34
|
-
if (e.shiftKey) {
|
|
35
|
-
if (document.activeElement === first) {
|
|
36
|
-
e.preventDefault();
|
|
37
|
-
last.focus();
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
if (document.activeElement === last) {
|
|
42
|
-
e.preventDefault();
|
|
43
|
-
first.focus();
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
document.addEventListener('keydown', handleKeyDown);
|
|
49
|
-
requestAnimationFrame(() => {
|
|
50
|
-
if (nodeRef.current) {
|
|
51
|
-
const focusable = nodeRef.current.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
|
|
52
|
-
if (focusable.length > 0)
|
|
53
|
-
focusable[0].focus();
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
return () => {
|
|
57
|
-
document.removeEventListener('keydown', handleKeyDown);
|
|
58
|
-
previousFocusRef.current?.focus();
|
|
59
|
-
};
|
|
60
|
-
}, [visible, onClose]);
|
|
61
|
-
return (_jsx(Overlay, { onEnter: () => setDrawerVisible(true), onExit: () => setDrawerVisible(false), zIndex: zIndex, type: maskType, unmountOnExit: unmountOnClose, isShow: visible, onExited: afterClose, clickCallback: (e) => {
|
|
62
|
-
maskClosable && onClose ? onClose(e) : undefined;
|
|
63
|
-
}, style: maskStyle, children: _jsx("div", { ref: ref, className: cls, style: { ...style, ...sty }, children: _jsx(CSSTransition, { appear: true, nodeRef: nodeRef, in: drawerVisible, timeout: 0, classNames: `${prefixCls}__content_move`, children: _jsxs("div", { ref: nodeRef, className: `${prefixCls}__content`, role: "dialog", "aria-modal": "true", "aria-labelledby": header ? titleId : undefined, onClick: (e) => e.stopPropagation(), children: [closable && (_jsx("button", { type: "button", className: `${prefixCls}__close-btn`, onClick: onClose, "aria-label": "Close", children: "\u2715" })), header && _jsx("div", { className: `${prefixCls}__header`, id: titleId, children: header }), _jsx("div", { className: `${prefixCls}__body`, children: children }), footer && _jsx("div", { className: `${prefixCls}__footer`, children: footer })] }) }) }) }));
|
|
64
|
-
});
|
|
65
|
-
Drawer.displayName = 'Drawer';
|
|
1
|
+
import Drawer from './drawer';
|
|
66
2
|
export default Drawer;
|
|
67
3
|
//# sourceMappingURL=index.js.map
|
package/es/drawer/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../components/drawer/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../components/drawer/index.tsx"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React, { useCallback, useContext, useEffect, useRef, useState } from 'react';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import { ConfigContext } from '../config-provider/config-context';
|
|
5
|
+
import { getPrefixCls } from '../_utils/general';
|
|
6
|
+
import Popup from '../popup';
|
|
7
|
+
const Dropdown = (props) => {
|
|
8
|
+
const { trigger = 'hover', placement = 'bottom-start', disabled = false, arrow = false, onVisibleChange, overlay, className, children, prefixCls: customisedCls, ...otherProps } = props;
|
|
9
|
+
const configContext = useContext(ConfigContext);
|
|
10
|
+
const prefixCls = getPrefixCls('dropdown', configContext.prefixCls, customisedCls);
|
|
11
|
+
const cls = classNames(prefixCls, className);
|
|
12
|
+
const [popupVisible, setPopupVisible] = useState('visible' in props ? props.visible : false);
|
|
13
|
+
const delayDisplayPopupTimer = useRef(undefined);
|
|
14
|
+
const delayHidePopupTimer = useRef(undefined);
|
|
15
|
+
const displayPopup = useCallback(() => {
|
|
16
|
+
!('visible' in props) && setPopupVisible(true);
|
|
17
|
+
onVisibleChange && onVisibleChange(true);
|
|
18
|
+
}, [props, onVisibleChange]);
|
|
19
|
+
const hidePopup = useCallback(() => {
|
|
20
|
+
!('visible' in props) && setPopupVisible(false);
|
|
21
|
+
onVisibleChange && onVisibleChange(false);
|
|
22
|
+
}, [props, onVisibleChange]);
|
|
23
|
+
const delayHidePopup = useCallback(() => {
|
|
24
|
+
delayHidePopupTimer.current = window.setTimeout(() => {
|
|
25
|
+
hidePopup();
|
|
26
|
+
}, 100);
|
|
27
|
+
}, [hidePopup]);
|
|
28
|
+
const renderOverlay = () => {
|
|
29
|
+
if (!overlay) {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
const overlayProps = {
|
|
33
|
+
overlayClassName: cls,
|
|
34
|
+
mode: 'vertical',
|
|
35
|
+
theme: 'light',
|
|
36
|
+
onMouseEnter: () => {
|
|
37
|
+
if (trigger === 'hover') {
|
|
38
|
+
displayPopup();
|
|
39
|
+
window.clearTimeout(delayHidePopupTimer.current);
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
onMouseLeave: () => {
|
|
43
|
+
if (trigger === 'hover') {
|
|
44
|
+
delayHidePopup();
|
|
45
|
+
window.clearTimeout(delayDisplayPopupTimer.current);
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
onSelect: (selectedIndex) => {
|
|
49
|
+
const { onSelect } = overlay.props;
|
|
50
|
+
onSelect && onSelect(selectedIndex);
|
|
51
|
+
hidePopup();
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
return React.cloneElement(overlay, overlayProps);
|
|
55
|
+
};
|
|
56
|
+
const handleTargetOnMouseEnter = () => {
|
|
57
|
+
if (trigger === 'hover') {
|
|
58
|
+
displayPopup();
|
|
59
|
+
window.clearTimeout(delayHidePopupTimer.current);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
const handleTargetOnMouseLeave = () => {
|
|
63
|
+
if (trigger === 'hover') {
|
|
64
|
+
delayHidePopup();
|
|
65
|
+
window.clearTimeout(delayDisplayPopupTimer.current);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
const handleTargetOnClick = () => {
|
|
69
|
+
if (trigger === 'click') {
|
|
70
|
+
displayPopup();
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
// Clear timers on unmount
|
|
74
|
+
useEffect(() => {
|
|
75
|
+
return () => {
|
|
76
|
+
window.clearTimeout(delayDisplayPopupTimer.current);
|
|
77
|
+
window.clearTimeout(delayHidePopupTimer.current);
|
|
78
|
+
};
|
|
79
|
+
}, []);
|
|
80
|
+
useEffect(() => {
|
|
81
|
+
'visible' in props && setPopupVisible(props.visible);
|
|
82
|
+
}, [props]);
|
|
83
|
+
const handleKeyDown = (e) => {
|
|
84
|
+
if (e.key === 'Escape' && popupVisible) {
|
|
85
|
+
hidePopup();
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
const childrenProps = {
|
|
89
|
+
onMouseEnter: handleTargetOnMouseEnter,
|
|
90
|
+
onMouseLeave: handleTargetOnMouseLeave,
|
|
91
|
+
onClick: handleTargetOnClick,
|
|
92
|
+
onKeyDown: handleKeyDown,
|
|
93
|
+
'aria-expanded': popupVisible,
|
|
94
|
+
'aria-haspopup': true,
|
|
95
|
+
};
|
|
96
|
+
React.Children.only(children);
|
|
97
|
+
return (_jsx(Popup, { ...otherProps, biZoom: false, arrow: arrow, disabled: disabled, placement: placement, flip: !('placement' in props), trigger: "manual", className: cls, visible: popupVisible, content: renderOverlay(), children: React.cloneElement(children, childrenProps) }));
|
|
98
|
+
};
|
|
99
|
+
Dropdown.displayName = 'Dropdown';
|
|
100
|
+
export default Dropdown;
|
|
101
|
+
//# sourceMappingURL=dropdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropdown.js","sourceRoot":"","sources":["../../components/dropdown/dropdown.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACpF,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGjD,OAAO,KAAK,MAAM,UAAU,CAAC;AAE7B,MAAM,QAAQ,GAAG,CAAC,KAAoB,EAAe,EAAE;IACrD,MAAM,EACJ,OAAO,GAAG,OAAO,EACjB,SAAS,GAAG,cAAc,EAC1B,QAAQ,GAAG,KAAK,EAChB,KAAK,GAAG,KAAK,EACb,eAAe,EACf,OAAO,EACP,SAAS,EACT,QAAQ,EACR,SAAS,EAAE,aAAa,EACxB,GAAG,UAAU,EACd,GAAG,KAAK,CAAC;IACV,MAAM,aAAa,GAAG,UAAU,CAAC,aAAa,CAAC,CAAC;IAChD,MAAM,SAAS,GAAG,YAAY,CAAC,UAAU,EAAE,aAAa,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;IACnF,MAAM,GAAG,GAAG,UAAU,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IAC7C,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAC9C,SAAS,IAAI,KAAK,CAAC,CAAC,CAAE,KAAK,CAAC,OAAmB,CAAC,CAAC,CAAC,KAAK,CACxD,CAAC;IACF,MAAM,sBAAsB,GAA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AAS,IAAI,KAAK,IAAI,eAAe,CAAC,KAAK,CAAC,OAAkB,CAAC,CAAC;IAClE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,MAAM,aAAa,GAAG,CAAC,CAAsB,EAAE,EAAE;QAC/C,IAAI,CAAC,CAAC,GAAG,KAAK,QAAQ,IAAI,YAAY,EAAE,CAAC;YACvC,SAAS,EAAE,CAAC;QACd,CAAC;IACH,CAAC,CAAC;IAEF,MAAM,aAAa,GAAG;QACpB,YAAY,EAAE,wBAAwB;QACtC,YAAY,EAAE,wBAAwB;QACtC,OAAO,EAAE,mBAAmB;QAC5B,SAAS,EAAE,aAAa;QACxB,eAAe,EAAE,YAAY;QAC7B,eAAe,EAAE,IAAa;KAC/B,CAAC;IAEF,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC9B,OAAO,CACL,KAAC,KAAK,OACA,UAAU,EACd,MAAM,EAAE,KAAK,EACb,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,CAAC,CAAC,WAAW,IAAI,KAAK,CAAC,EAC7B,OAAO,EAAC,QAAQ,EAChB,SAAS,EAAE,GAAG,EACd,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,aAAa,EAAE,YACvB,KAAK,CAAC,YAAY,CAAC,QAAQ,EAAE,aAAa,CAAC,GACtC,CACT,CAAC;AACJ,CAAC,CAAC;AAEF,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC;AAElC,eAAe,QAAQ,CAAC"}
|
package/es/dropdown/index.d.ts
CHANGED
package/es/dropdown/index.js
CHANGED
|
@@ -1,101 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
import React, { useCallback, useContext, useEffect, useRef, useState } from 'react';
|
|
3
|
-
import classNames from 'classnames';
|
|
4
|
-
import { ConfigContext } from '../config-provider/config-context';
|
|
5
|
-
import { getPrefixCls } from '../_utils/general';
|
|
6
|
-
import Popup from '../popup';
|
|
7
|
-
const Dropdown = (props) => {
|
|
8
|
-
const { trigger = 'hover', placement = 'bottom-start', disabled = false, arrow = false, onVisibleChange, overlay, className, children, prefixCls: customisedCls, ...otherProps } = props;
|
|
9
|
-
const configContext = useContext(ConfigContext);
|
|
10
|
-
const prefixCls = getPrefixCls('dropdown', configContext.prefixCls, customisedCls);
|
|
11
|
-
const cls = classNames(prefixCls, className);
|
|
12
|
-
const [popupVisible, setPopupVisible] = useState('visible' in props ? props.visible : false);
|
|
13
|
-
const delayDisplayPopupTimer = useRef(undefined);
|
|
14
|
-
const delayHidePopupTimer = useRef(undefined);
|
|
15
|
-
const displayPopup = useCallback(() => {
|
|
16
|
-
!('visible' in props) && setPopupVisible(true);
|
|
17
|
-
onVisibleChange && onVisibleChange(true);
|
|
18
|
-
}, [props, onVisibleChange]);
|
|
19
|
-
const hidePopup = useCallback(() => {
|
|
20
|
-
!('visible' in props) && setPopupVisible(false);
|
|
21
|
-
onVisibleChange && onVisibleChange(false);
|
|
22
|
-
}, [props, onVisibleChange]);
|
|
23
|
-
const delayHidePopup = useCallback(() => {
|
|
24
|
-
delayHidePopupTimer.current = window.setTimeout(() => {
|
|
25
|
-
hidePopup();
|
|
26
|
-
}, 100);
|
|
27
|
-
}, [hidePopup]);
|
|
28
|
-
const renderOverlay = () => {
|
|
29
|
-
if (!overlay) {
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
const overlayProps = {
|
|
33
|
-
overlayClassName: cls,
|
|
34
|
-
mode: 'vertical',
|
|
35
|
-
theme: 'light',
|
|
36
|
-
onMouseEnter: () => {
|
|
37
|
-
if (trigger === 'hover') {
|
|
38
|
-
displayPopup();
|
|
39
|
-
window.clearTimeout(delayHidePopupTimer.current);
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
onMouseLeave: () => {
|
|
43
|
-
if (trigger === 'hover') {
|
|
44
|
-
delayHidePopup();
|
|
45
|
-
window.clearTimeout(delayDisplayPopupTimer.current);
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
onSelect: (selectedIndex) => {
|
|
49
|
-
const { onSelect } = overlay.props;
|
|
50
|
-
onSelect && onSelect(selectedIndex);
|
|
51
|
-
hidePopup();
|
|
52
|
-
},
|
|
53
|
-
};
|
|
54
|
-
return React.cloneElement(overlay, overlayProps);
|
|
55
|
-
};
|
|
56
|
-
const handleTargetOnMouseEnter = () => {
|
|
57
|
-
if (trigger === 'hover') {
|
|
58
|
-
displayPopup();
|
|
59
|
-
window.clearTimeout(delayHidePopupTimer.current);
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
const handleTargetOnMouseLeave = () => {
|
|
63
|
-
if (trigger === 'hover') {
|
|
64
|
-
delayHidePopup();
|
|
65
|
-
window.clearTimeout(delayDisplayPopupTimer.current);
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
const handleTargetOnClick = () => {
|
|
69
|
-
if (trigger === 'click') {
|
|
70
|
-
displayPopup();
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
// Clear timers on unmount
|
|
74
|
-
useEffect(() => {
|
|
75
|
-
return () => {
|
|
76
|
-
window.clearTimeout(delayDisplayPopupTimer.current);
|
|
77
|
-
window.clearTimeout(delayHidePopupTimer.current);
|
|
78
|
-
};
|
|
79
|
-
}, []);
|
|
80
|
-
useEffect(() => {
|
|
81
|
-
'visible' in props && setPopupVisible(props.visible);
|
|
82
|
-
}, [props]);
|
|
83
|
-
const handleKeyDown = (e) => {
|
|
84
|
-
if (e.key === 'Escape' && popupVisible) {
|
|
85
|
-
hidePopup();
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
const childrenProps = {
|
|
89
|
-
onMouseEnter: handleTargetOnMouseEnter,
|
|
90
|
-
onMouseLeave: handleTargetOnMouseLeave,
|
|
91
|
-
onClick: handleTargetOnClick,
|
|
92
|
-
onKeyDown: handleKeyDown,
|
|
93
|
-
'aria-expanded': popupVisible,
|
|
94
|
-
'aria-haspopup': true,
|
|
95
|
-
};
|
|
96
|
-
React.Children.only(children);
|
|
97
|
-
return (_jsx(Popup, { ...otherProps, biZoom: false, arrow: arrow, disabled: disabled, placement: placement, flip: !('placement' in props), trigger: "manual", className: cls, visible: popupVisible, content: renderOverlay(), children: React.cloneElement(children, childrenProps) }));
|
|
98
|
-
};
|
|
99
|
-
Dropdown.displayName = 'Dropdown';
|
|
1
|
+
import Dropdown from './dropdown';
|
|
100
2
|
export default Dropdown;
|
|
101
3
|
//# sourceMappingURL=index.js.map
|
package/es/dropdown/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../components/dropdown/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../components/dropdown/index.tsx"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React, { useContext } from 'react';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import { ConfigContext } from '../config-provider/config-context';
|
|
5
|
+
import { getPrefixCls } from '../_utils/general';
|
|
6
|
+
import { useLocale } from '../_utils/use-locale';
|
|
7
|
+
const Empty = React.forwardRef((props, ref) => {
|
|
8
|
+
const locale = useLocale();
|
|
9
|
+
const { description = locale.Empty.description, image, imageStyle, descStyle, className, style, children, prefixCls: customisedCls, ...otherProps } = props;
|
|
10
|
+
const configContext = useContext(ConfigContext);
|
|
11
|
+
const prefixCls = getPrefixCls('empty', configContext.prefixCls, customisedCls);
|
|
12
|
+
const cls = classNames(prefixCls, className);
|
|
13
|
+
const renderImage = () => {
|
|
14
|
+
if (React.isValidElement(image)) {
|
|
15
|
+
return image;
|
|
16
|
+
}
|
|
17
|
+
else if (typeof image === 'string') {
|
|
18
|
+
return _jsx("img", { src: image, alt: "empty", style: imageStyle, className: `${prefixCls}__image` });
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
return (_jsx("svg", { width: "61px", height: "40px", viewBox: "0 0 61 40", version: "1.1", children: _jsx("g", { stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd", children: _jsxs("g", { transform: "translate(0.000000, 1.000000)", children: [_jsx("ellipse", { fill: "#F5F5F5", cx: "30.5", cy: "30.5", rx: "30.5", ry: "8.5" }), _jsx("path", { d: "M8,14 L16.1016016,14 C17.4262005,14 18.5,15.0737995 18.5,16.3983984 C18.5,17.7229972 19.5737995,18.7967967 20.8983984,18.7967967 L39.1016016,18.7967967 C40.4262005,18.7967967 41.5,17.7229972 41.5,16.3983984 C41.5,15.0737995 42.5737995,14 43.8983984,14 L52,14 C52.5522847,14 53,14.4477153 53,15 L53,29 C53,31.209139 51.209139,33 49,33 L11,33 C8.790861,33 7,31.209139 7,29 L7,15 C7,14.4477153 7.44771525,14 8,14 Z", stroke: "#D9D9D9", fill: "#FAFAFA" }), _jsx("path", { d: "M7.34587252,14.1911631 L14.8857295,1.90750067 C15.6132226,0.722295128 16.9040854,1.14364005e-15 18.2947537,0 L41.70114,0 C43.0918102,8.62632224e-15 44.3826743,0.722296971 45.1101669,1.90750495 L52.65,14.1911631 L52.65,14.1911631 L44.0201775,14.1911631 C42.6922539,14.1911631 41.6157591,15.2676579 41.6157591,16.5955815 C41.6157591,17.9235052 40.5392643,19 39.2113406,19 L20.7845564,19 C19.4566328,19 18.380138,17.9235052 18.380138,16.5955815 C18.380138,15.2676579 17.3036432,14.1911631 15.9757195,14.1911631 L7.34587252,14.1911631 L7.34587252,14.1911631 Z", stroke: "#D9D9D9", fill: "#FFFFFF" })] }) }) }));
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
return (_jsxs("div", { ...otherProps, ref: ref, className: cls, style: style, children: [_jsx("div", { className: `${prefixCls}__image-container`, children: renderImage() }), typeof props.description === 'boolean' && !description ? null : (_jsx("p", { className: `${prefixCls}__desc`, style: descStyle, children: description })), children && _jsx("div", { className: `${prefixCls}__footer`, children: children })] }));
|
|
25
|
+
});
|
|
26
|
+
Empty.displayName = 'Empty';
|
|
27
|
+
export default Empty;
|
|
28
|
+
//# sourceMappingURL=empty.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"empty.js","sourceRoot":"","sources":["../../components/empty/empty.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAa,UAAU,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGjD,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAA6B,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACxE,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,MAAM,EACJ,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,WAAW,EACtC,KAAK,EACL,UAAU,EACV,SAAS,EACT,SAAS,EACT,KAAK,EACL,QAAQ,EACR,SAAS,EAAE,aAAa,EACxB,GAAG,UAAU,EACd,GAAG,KAAK,CAAC;IACV,MAAM,aAAa,GAAG,UAAU,CAAC,aAAa,CAAC,CAAC;IAChD,MAAM,SAAS,GAAG,YAAY,CAAC,OAAO,EAAE,aAAa,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;IAChF,MAAM,GAAG,GAAG,UAAU,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IAE7C,MAAM,WAAW,GAAG,GAAc,EAAE;QAClC,IAAI,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC;YAChC,OAAO,KAAK,CAAC;QACf,CAAC;aAAM,IAAI,OAAO,KA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,GAAO,IACjE,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,KAAK,CAAC,WAAW,GAAG,OAAO,CAAC;AAE5B,eAAe,KAAK,CAAC"}
|
package/es/empty/index.d.ts
CHANGED
package/es/empty/index.js
CHANGED
|
@@ -1,28 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
import React, { useContext } from 'react';
|
|
3
|
-
import classNames from 'classnames';
|
|
4
|
-
import { ConfigContext } from '../config-provider/config-context';
|
|
5
|
-
import { getPrefixCls } from '../_utils/general';
|
|
6
|
-
import { useLocale } from '../_utils/use-locale';
|
|
7
|
-
const Empty = React.forwardRef((props, ref) => {
|
|
8
|
-
const locale = useLocale();
|
|
9
|
-
const { description = locale.Empty.description, image, imageStyle, descStyle, className, style, children, prefixCls: customisedCls, ...otherProps } = props;
|
|
10
|
-
const configContext = useContext(ConfigContext);
|
|
11
|
-
const prefixCls = getPrefixCls('empty', configContext.prefixCls, customisedCls);
|
|
12
|
-
const cls = classNames(prefixCls, className);
|
|
13
|
-
const renderImage = () => {
|
|
14
|
-
if (React.isValidElement(image)) {
|
|
15
|
-
return image;
|
|
16
|
-
}
|
|
17
|
-
else if (typeof image === 'string') {
|
|
18
|
-
return _jsx("img", { src: image, alt: "empty", style: imageStyle, className: `${prefixCls}__image` });
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
return (_jsx("svg", { width: "61px", height: "40px", viewBox: "0 0 61 40", version: "1.1", children: _jsx("g", { stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd", children: _jsxs("g", { transform: "translate(0.000000, 1.000000)", children: [_jsx("ellipse", { fill: "#F5F5F5", cx: "30.5", cy: "30.5", rx: "30.5", ry: "8.5" }), _jsx("path", { d: "M8,14 L16.1016016,14 C17.4262005,14 18.5,15.0737995 18.5,16.3983984 C18.5,17.7229972 19.5737995,18.7967967 20.8983984,18.7967967 L39.1016016,18.7967967 C40.4262005,18.7967967 41.5,17.7229972 41.5,16.3983984 C41.5,15.0737995 42.5737995,14 43.8983984,14 L52,14 C52.5522847,14 53,14.4477153 53,15 L53,29 C53,31.209139 51.209139,33 49,33 L11,33 C8.790861,33 7,31.209139 7,29 L7,15 C7,14.4477153 7.44771525,14 8,14 Z", stroke: "#D9D9D9", fill: "#FAFAFA" }), _jsx("path", { d: "M7.34587252,14.1911631 L14.8857295,1.90750067 C15.6132226,0.722295128 16.9040854,1.14364005e-15 18.2947537,0 L41.70114,0 C43.0918102,8.62632224e-15 44.3826743,0.722296971 45.1101669,1.90750495 L52.65,14.1911631 L52.65,14.1911631 L44.0201775,14.1911631 C42.6922539,14.1911631 41.6157591,15.2676579 41.6157591,16.5955815 C41.6157591,17.9235052 40.5392643,19 39.2113406,19 L20.7845564,19 C19.4566328,19 18.380138,17.9235052 18.380138,16.5955815 C18.380138,15.2676579 17.3036432,14.1911631 15.9757195,14.1911631 L7.34587252,14.1911631 L7.34587252,14.1911631 Z", stroke: "#D9D9D9", fill: "#FFFFFF" })] }) }) }));
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
return (_jsxs("div", { ...otherProps, ref: ref, className: cls, style: style, children: [_jsx("div", { className: `${prefixCls}__image-container`, children: renderImage() }), typeof props.description === 'boolean' && !description ? null : (_jsx("p", { className: `${prefixCls}__desc`, style: descStyle, children: description })), children && _jsx("div", { className: `${prefixCls}__footer`, children: children })] }));
|
|
25
|
-
});
|
|
26
|
-
Empty.displayName = 'Empty';
|
|
1
|
+
import Empty from './empty';
|
|
27
2
|
export default Empty;
|
|
28
3
|
//# sourceMappingURL=index.js.map
|
package/es/empty/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../components/empty/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../components/empty/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,SAAS,CAAC;AAE5B,eAAe,KAAK,CAAC"}
|
package/es/flex/flex.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React, { useContext } from 'react';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import { ConfigContext } from '../config-provider/config-context';
|
|
5
|
+
import { getPrefixCls } from '../_utils/general';
|
|
6
|
+
const gapSizes = {
|
|
7
|
+
sm: 8,
|
|
8
|
+
md: 16,
|
|
9
|
+
lg: 24,
|
|
10
|
+
};
|
|
11
|
+
const Flex = React.forwardRef((props, ref) => {
|
|
12
|
+
const { vertical = false, wrap, justify, align, gap, flex, component: Component = 'div', className, style, children, prefixCls: customisedCls, ...otherProps } = props;
|
|
13
|
+
const configContext = useContext(ConfigContext);
|
|
14
|
+
const prefixCls = getPrefixCls('flex', configContext.prefixCls, customisedCls);
|
|
15
|
+
const cls = classNames(prefixCls, className);
|
|
16
|
+
const mergedStyle = {
|
|
17
|
+
flexDirection: vertical ? 'column' : undefined,
|
|
18
|
+
flexWrap: wrap,
|
|
19
|
+
justifyContent: justify,
|
|
20
|
+
alignItems: align,
|
|
21
|
+
gap: typeof gap === 'string' && gap in gapSizes ? gapSizes[gap] : gap,
|
|
22
|
+
flex,
|
|
23
|
+
...style,
|
|
24
|
+
};
|
|
25
|
+
return (_jsx(Component, { ...otherProps, ref: ref, className: cls, style: mergedStyle, children: children }));
|
|
26
|
+
});
|
|
27
|
+
Flex.displayName = 'Flex';
|
|
28
|
+
export default Flex;
|
|
29
|
+
//# sourceMappingURL=flex.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flex.js","sourceRoot":"","sources":["../../components/flex/flex.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE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I,CAAC"}
|
package/es/flex/index.d.ts
CHANGED
package/es/flex/index.js
CHANGED
|
@@ -1,29 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
import React, { useContext } from 'react';
|
|
3
|
-
import classNames from 'classnames';
|
|
4
|
-
import { ConfigContext } from '../config-provider/config-context';
|
|
5
|
-
import { getPrefixCls } from '../_utils/general';
|
|
6
|
-
const gapSizes = {
|
|
7
|
-
sm: 8,
|
|
8
|
-
md: 16,
|
|
9
|
-
lg: 24,
|
|
10
|
-
};
|
|
11
|
-
const Flex = React.forwardRef((props, ref) => {
|
|
12
|
-
const { vertical = false, wrap, justify, align, gap, flex, component: Component = 'div', className, style, children, prefixCls: customisedCls, ...otherProps } = props;
|
|
13
|
-
const configContext = useContext(ConfigContext);
|
|
14
|
-
const prefixCls = getPrefixCls('flex', configContext.prefixCls, customisedCls);
|
|
15
|
-
const cls = classNames(prefixCls, className);
|
|
16
|
-
const mergedStyle = {
|
|
17
|
-
flexDirection: vertical ? 'column' : undefined,
|
|
18
|
-
flexWrap: wrap,
|
|
19
|
-
justifyContent: justify,
|
|
20
|
-
alignItems: align,
|
|
21
|
-
gap: typeof gap === 'string' && gap in gapSizes ? gapSizes[gap] : gap,
|
|
22
|
-
flex,
|
|
23
|
-
...style,
|
|
24
|
-
};
|
|
25
|
-
return (_jsx(Component, { ...otherProps, ref: ref, className: cls, style: mergedStyle, children: children }));
|
|
26
|
-
});
|
|
27
|
-
Flex.displayName = 'Flex';
|
|
1
|
+
import Flex from './flex';
|
|
28
2
|
export default Flex;
|
|
29
3
|
//# sourceMappingURL=index.js.map
|
package/es/flex/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../components/flex/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../components/flex/index.tsx"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,QAAQ,CAAC;AAE1B,eAAe,IAAI,CAAC"}
|
package/es/grid/types.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export interface RowProps extends BaseProps, React.PropsWithoutRef<JSX.Intrinsic
|
|
|
8
8
|
gutterSide?: boolean;
|
|
9
9
|
align?: RowAlign;
|
|
10
10
|
justify?: RowJustify;
|
|
11
|
-
children: React.ReactElement<ColProps>[]
|
|
11
|
+
children: React.ReactElement<ColProps>[] | React.ReactElement<ColProps>;
|
|
12
12
|
}
|
|
13
13
|
export type ColSize = {
|
|
14
14
|
span?: number;
|
package/es/icon/icon.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React, { useContext } from 'react';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import { ConfigContext } from '../config-provider/config-context';
|
|
5
|
+
import { getPrefixCls } from '../_utils/general';
|
|
6
|
+
const Icon = React.forwardRef((props, ref) => {
|
|
7
|
+
const { name, color, size, style, spin, className, prefixCls: customisedCls, ...otherProps } = props;
|
|
8
|
+
const configContext = useContext(ConfigContext);
|
|
9
|
+
const prefixCls = getPrefixCls('icon', configContext.prefixCls, customisedCls);
|
|
10
|
+
const cls = classNames(prefixCls, className, `ty--${name}`, {
|
|
11
|
+
[`${prefixCls}_spin`]: spin,
|
|
12
|
+
});
|
|
13
|
+
return _jsx("i", { ref: ref, className: cls, style: { color, fontSize: size, ...style }, ...otherProps });
|
|
14
|
+
});
|
|
15
|
+
Icon.displayName = 'Icon';
|
|
16
|
+
export default Icon;
|
|
17
|
+
//# sourceMappingURL=icon.js.map
|