tiny-ui 1.0.1 → 1.0.3
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 +8 -64
- 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/drawer/style/_index.scss +4 -0
- 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/style/_index.scss +0 -31
- 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/modal/style/_index.scss +2 -1
- 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/style/_theme.scss +3 -3
- package/es/style/index.css +8 -64
- 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/style/_index.scss +0 -38
- 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/drawer/style/_index.scss +4 -0
- 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/style/_index.scss +0 -31
- 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/modal/style/_index.scss +2 -1
- 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/style/_theme.scss +3 -3
- package/lib/style/index.css +8 -64
- 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/style/_index.scss +0 -38
- 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
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const COLLAPSE_DURATION = 250;
|
|
6
|
+
const CollapseTransition = (props) => {
|
|
7
|
+
const { isShow, children } = props;
|
|
8
|
+
const leaveTimerRef = (0, react_1.useRef)(null);
|
|
9
|
+
const enterTimerRef = (0, react_1.useRef)(null);
|
|
10
|
+
const ref = (0, react_1.useRef)(null);
|
|
11
|
+
const beforeEnter = (0, react_1.useCallback)(() => {
|
|
12
|
+
const el = ref.current;
|
|
13
|
+
if (el) {
|
|
14
|
+
el.style.display = 'block';
|
|
15
|
+
el.style.height = '0px';
|
|
16
|
+
}
|
|
17
|
+
}, []);
|
|
18
|
+
const afterEnter = (0, react_1.useCallback)(() => {
|
|
19
|
+
const el = ref.current;
|
|
20
|
+
if (el) {
|
|
21
|
+
el.style.display = 'block';
|
|
22
|
+
el.style.height = '';
|
|
23
|
+
}
|
|
24
|
+
}, []);
|
|
25
|
+
const enter = (0, react_1.useCallback)(() => {
|
|
26
|
+
const el = ref.current;
|
|
27
|
+
if (el) {
|
|
28
|
+
if (el.scrollHeight !== 0) {
|
|
29
|
+
el.style.height = el.scrollHeight + 'px';
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
el.style.height = '';
|
|
33
|
+
}
|
|
34
|
+
enterTimerRef.current = window.setTimeout(() => afterEnter(), COLLAPSE_DURATION);
|
|
35
|
+
}
|
|
36
|
+
}, [afterEnter]);
|
|
37
|
+
const beforeLeave = (0, react_1.useCallback)(() => {
|
|
38
|
+
const el = ref.current;
|
|
39
|
+
if (el) {
|
|
40
|
+
el.style.display = 'block';
|
|
41
|
+
if (el.scrollHeight !== 0) {
|
|
42
|
+
el.style.height = el.scrollHeight + 'px';
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}, []);
|
|
46
|
+
const afterLeave = (0, react_1.useCallback)(() => {
|
|
47
|
+
const el = ref.current;
|
|
48
|
+
if (el) {
|
|
49
|
+
el.style.display = 'none';
|
|
50
|
+
el.style.height = '';
|
|
51
|
+
}
|
|
52
|
+
}, []);
|
|
53
|
+
const leave = (0, react_1.useCallback)(() => {
|
|
54
|
+
const el = ref.current;
|
|
55
|
+
if (el) {
|
|
56
|
+
if (el.scrollHeight !== 0) {
|
|
57
|
+
el.style.height = '0px';
|
|
58
|
+
}
|
|
59
|
+
leaveTimerRef.current = window.setTimeout(() => afterLeave(), COLLAPSE_DURATION);
|
|
60
|
+
}
|
|
61
|
+
}, [afterLeave]);
|
|
62
|
+
const triggerChange = (0, react_1.useCallback)((isCollapsed) => {
|
|
63
|
+
const enterTimer = enterTimerRef.current;
|
|
64
|
+
const leaveTimer = leaveTimerRef.current;
|
|
65
|
+
enterTimer && window.clearTimeout(enterTimer);
|
|
66
|
+
leaveTimer && window.clearTimeout(leaveTimer);
|
|
67
|
+
if (isCollapsed) {
|
|
68
|
+
beforeEnter();
|
|
69
|
+
enter();
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
beforeLeave();
|
|
73
|
+
leave();
|
|
74
|
+
}
|
|
75
|
+
}, [enter, leave, beforeEnter, beforeLeave]);
|
|
76
|
+
(0, react_1.useEffect)(() => {
|
|
77
|
+
beforeEnter();
|
|
78
|
+
enter();
|
|
79
|
+
return () => {
|
|
80
|
+
beforeLeave();
|
|
81
|
+
leave();
|
|
82
|
+
};
|
|
83
|
+
}, [enter, leave, beforeEnter, beforeLeave]);
|
|
84
|
+
(0, react_1.useEffect)(() => {
|
|
85
|
+
triggerChange(isShow);
|
|
86
|
+
}, [isShow, triggerChange]);
|
|
87
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "ty-collapse-transition", ref: ref, children: children }));
|
|
88
|
+
};
|
|
89
|
+
CollapseTransition.displayName = 'CollapseTransition';
|
|
90
|
+
exports.default = CollapseTransition;
|
|
91
|
+
//# sourceMappingURL=collapse-transition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collapse-transition.js","sourceRoot":"","sources":["../../components/collapse-transition/collapse-transition.tsx"],"names":[],"mappings":";;;AAAA,iCAA8D;AAO9D,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAE9B,MAAM,kBAAkB,GAAG,CAAC,KAA8B,EAAe,EAAE;IACzE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IACnC,MAAM,aAAa,GAAG,IAAA,cAAM,EAAgB,IAAI,CAAC,CAAC;IAClD,MAAM,aAAa,GAAG,IAAA,cAAM,EAAgB,IAAI,CAAC,CAAC;IAClD,MAAM,GAAG,GAAG,IAAA,cAAM,EAAwB,IAAI,CAAC,CAAC;IAEhD,MAAM,WAAW,GAAG,IAAA,mBAAW,EAAC,GAAS,EAAE;QACzC,MAAM,EAAE,GAAG,GAAG,CAAC,OAAO,CAAC;QACvB,IAAI,EAAE,EAAE,CAAC;YACP,EAAE,CAAC,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC;YAC3B,EAAE,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC;QAC1B,CAAC;IACH,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,UAAU,GAAG,IAAA,mBAAW,EAAC,GAAS,EAAE;QACxC,MAAM,EAAE,GAAG,GAAG,CAAC,OAAO,CAAC;QACvB,IAAI,EAAE,EAAE,CAAC;YACP,EAAE,CAAC,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC;YAC3B,EAAE,CAAC,KAAK,CAAC,MAAM,GAAG,EAAE,CAAC;QACvB,C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AS,EAAC,GAAG,EAAE;QACb,aAAa,CAAC,MAAM,CAAC,CAAC;IACxB,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC;IAE5B,OAAO,CACL,gCAAK,SAAS,EAAC,wBAAwB,EAAC,GAAG,EAAE,GAAG,YAC7C,QAAQ,GACL,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAkB,CAAC,WAAW,GAAG,oBAAoB,CAAC;AAEtD,kBAAe,kBAAkB,CAAC"}
|
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
type CollapseTransitionProps = {
|
|
3
|
-
isShow: boolean;
|
|
4
|
-
children: React.ReactNode;
|
|
5
|
-
};
|
|
6
|
-
declare const CollapseTransition: {
|
|
7
|
-
(props: CollapseTransitionProps): JSX.Element;
|
|
8
|
-
displayName: string;
|
|
9
|
-
};
|
|
1
|
+
import CollapseTransition from './collapse-transition';
|
|
10
2
|
export default CollapseTransition;
|
|
@@ -1,91 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
const CollapseTransition = (props) => {
|
|
7
|
-
const { isShow, children } = props;
|
|
8
|
-
const leaveTimerRef = (0, react_1.useRef)(null);
|
|
9
|
-
const enterTimerRef = (0, react_1.useRef)(null);
|
|
10
|
-
const ref = (0, react_1.useRef)(null);
|
|
11
|
-
const beforeEnter = (0, react_1.useCallback)(() => {
|
|
12
|
-
const el = ref.current;
|
|
13
|
-
if (el) {
|
|
14
|
-
el.style.display = 'block';
|
|
15
|
-
el.style.height = '0px';
|
|
16
|
-
}
|
|
17
|
-
}, []);
|
|
18
|
-
const afterEnter = (0, react_1.useCallback)(() => {
|
|
19
|
-
const el = ref.current;
|
|
20
|
-
if (el) {
|
|
21
|
-
el.style.display = 'block';
|
|
22
|
-
el.style.height = '';
|
|
23
|
-
}
|
|
24
|
-
}, []);
|
|
25
|
-
const enter = (0, react_1.useCallback)(() => {
|
|
26
|
-
const el = ref.current;
|
|
27
|
-
if (el) {
|
|
28
|
-
if (el.scrollHeight !== 0) {
|
|
29
|
-
el.style.height = el.scrollHeight + 'px';
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
el.style.height = '';
|
|
33
|
-
}
|
|
34
|
-
enterTimerRef.current = window.setTimeout(() => afterEnter(), COLLAPSE_DURATION);
|
|
35
|
-
}
|
|
36
|
-
}, [afterEnter]);
|
|
37
|
-
const beforeLeave = (0, react_1.useCallback)(() => {
|
|
38
|
-
const el = ref.current;
|
|
39
|
-
if (el) {
|
|
40
|
-
el.style.display = 'block';
|
|
41
|
-
if (el.scrollHeight !== 0) {
|
|
42
|
-
el.style.height = el.scrollHeight + 'px';
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}, []);
|
|
46
|
-
const afterLeave = (0, react_1.useCallback)(() => {
|
|
47
|
-
const el = ref.current;
|
|
48
|
-
if (el) {
|
|
49
|
-
el.style.display = 'none';
|
|
50
|
-
el.style.height = '';
|
|
51
|
-
}
|
|
52
|
-
}, []);
|
|
53
|
-
const leave = (0, react_1.useCallback)(() => {
|
|
54
|
-
const el = ref.current;
|
|
55
|
-
if (el) {
|
|
56
|
-
if (el.scrollHeight !== 0) {
|
|
57
|
-
el.style.height = '0px';
|
|
58
|
-
}
|
|
59
|
-
leaveTimerRef.current = window.setTimeout(() => afterLeave(), COLLAPSE_DURATION);
|
|
60
|
-
}
|
|
61
|
-
}, [afterLeave]);
|
|
62
|
-
const triggerChange = (0, react_1.useCallback)((isCollapsed) => {
|
|
63
|
-
const enterTimer = enterTimerRef.current;
|
|
64
|
-
const leaveTimer = leaveTimerRef.current;
|
|
65
|
-
enterTimer && window.clearTimeout(enterTimer);
|
|
66
|
-
leaveTimer && window.clearTimeout(leaveTimer);
|
|
67
|
-
if (isCollapsed) {
|
|
68
|
-
beforeEnter();
|
|
69
|
-
enter();
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
beforeLeave();
|
|
73
|
-
leave();
|
|
74
|
-
}
|
|
75
|
-
}, [enter, leave, beforeEnter, beforeLeave]);
|
|
76
|
-
(0, react_1.useEffect)(() => {
|
|
77
|
-
beforeEnter();
|
|
78
|
-
enter();
|
|
79
|
-
return () => {
|
|
80
|
-
beforeLeave();
|
|
81
|
-
leave();
|
|
82
|
-
};
|
|
83
|
-
}, [enter, leave, beforeEnter, beforeLeave]);
|
|
84
|
-
(0, react_1.useEffect)(() => {
|
|
85
|
-
triggerChange(isShow);
|
|
86
|
-
}, [isShow, triggerChange]);
|
|
87
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: "ty-collapse-transition", ref: ref, children: children }));
|
|
88
|
-
};
|
|
89
|
-
CollapseTransition.displayName = 'CollapseTransition';
|
|
90
|
-
exports.default = CollapseTransition;
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const collapse_transition_1 = tslib_1.__importDefault(require("./collapse-transition"));
|
|
5
|
+
exports.default = collapse_transition_1.default;
|
|
91
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../components/collapse-transition/index.tsx"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../components/collapse-transition/index.tsx"],"names":[],"mappings":";;;AAAA,wFAAuD;AAEvD,kBAAe,6BAAkB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const config_context_1 = require("./config-context");
|
|
7
|
+
const intl_provider_1 = tslib_1.__importDefault(require("../intl-provider"));
|
|
8
|
+
const ConfigProvider = (props) => {
|
|
9
|
+
const { children, theme, locale, ...otherProps } = props;
|
|
10
|
+
(0, react_1.useEffect)(() => {
|
|
11
|
+
if (!theme)
|
|
12
|
+
return;
|
|
13
|
+
const html = document.documentElement;
|
|
14
|
+
if (theme === 'system') {
|
|
15
|
+
html.removeAttribute('data-theme');
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
html.setAttribute('data-theme', theme);
|
|
19
|
+
}
|
|
20
|
+
}, [theme]);
|
|
21
|
+
const content = locale ? ((0, jsx_runtime_1.jsx)(intl_provider_1.default, { locale: locale, children: children })) : (children);
|
|
22
|
+
return ((0, jsx_runtime_1.jsx)(config_context_1.ConfigContext.Provider, { value: { theme, locale, ...otherProps }, children: content }));
|
|
23
|
+
};
|
|
24
|
+
ConfigProvider.displayName = 'ConfigProvider';
|
|
25
|
+
exports.default = ConfigProvider;
|
|
26
|
+
//# sourceMappingURL=config-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-provider.js","sourceRoot":"","sources":["../../components/config-provider/config-provider.tsx"],"names":[],"mappings":";;;;AAAA,iCAAkC;AAClC,qDAAiD;AAEjD,6EAA4C;AAE5C,MAAM,cAAc,GAAG,CAAC,KAA0B,EAAe,EAAE;IACjE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,UAAU,EAAE,GAAG,KAAK,CAAC;IAEzD,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,CAAC,KAAK;YAAE,OAAO;QACnB,MAAM,IAAI,GAAG,QAAQ,CAAC,eAAe,CAAC;QACtC,IAAI,KAAK,KAAK,QAAQ,EAAE,CAAC;YACvB,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;QACrC,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;QACzC,CAAC;IACH,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,MAAM,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC,CACvB,uBAAC,uBAAY,IAAC,MAAM,EAAE,MAAM,YAAG,QAAQ,GAAgB,CACxD,CAAC,CAAC,CAAC,CACF,QAAQ,CACT,CAAC;IAEF,OAAO,CACL,uBAAC,8BAAa,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,UAAU,EAAE,YAC5D,OAAO,GACe,CAC1B,CAAC;AACJ,CAAC,CAAC;AAEF,cAAc,CAAC,WAAW,GAAG,gBAAgB,CAAC;AAE9C,kBAAe,cAAc,CAAC"}
|
|
@@ -1,26 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
const config_context_1 = require("./config-context");
|
|
7
|
-
const intl_provider_1 = tslib_1.__importDefault(require("../intl-provider"));
|
|
8
|
-
const ConfigProvider = (props) => {
|
|
9
|
-
const { children, theme, locale, ...otherProps } = props;
|
|
10
|
-
(0, react_1.useEffect)(() => {
|
|
11
|
-
if (!theme)
|
|
12
|
-
return;
|
|
13
|
-
const html = document.documentElement;
|
|
14
|
-
if (theme === 'system') {
|
|
15
|
-
html.removeAttribute('data-theme');
|
|
16
|
-
}
|
|
17
|
-
else {
|
|
18
|
-
html.setAttribute('data-theme', theme);
|
|
19
|
-
}
|
|
20
|
-
}, [theme]);
|
|
21
|
-
const content = locale ? ((0, jsx_runtime_1.jsx)(intl_provider_1.default, { locale: locale, children: children })) : (children);
|
|
22
|
-
return ((0, jsx_runtime_1.jsx)(config_context_1.ConfigContext.Provider, { value: { theme, locale, ...otherProps }, children: content }));
|
|
23
|
-
};
|
|
24
|
-
ConfigProvider.displayName = 'ConfigProvider';
|
|
25
|
-
exports.default = ConfigProvider;
|
|
4
|
+
const config_provider_1 = tslib_1.__importDefault(require("./config-provider"));
|
|
5
|
+
exports.default = config_provider_1.default;
|
|
26
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../components/config-provider/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../components/config-provider/index.tsx"],"names":[],"mappings":";;;AAAA,gFAA+C;AAE/C,kBAAe,yBAAc,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
7
|
+
const config_context_1 = require("../config-provider/config-context");
|
|
8
|
+
const general_1 = require("../_utils/general");
|
|
9
|
+
const copy = async (value) => {
|
|
10
|
+
if (navigator.clipboard) {
|
|
11
|
+
try {
|
|
12
|
+
await navigator.clipboard.writeText(value);
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
fallbackCopy(value);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
fallbackCopy(value);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
const fallbackCopy = (value) => {
|
|
23
|
+
const textArea = document.createElement('textarea');
|
|
24
|
+
textArea.style.position = 'fixed';
|
|
25
|
+
textArea.style.opacity = '0';
|
|
26
|
+
textArea.value = value;
|
|
27
|
+
document.body.appendChild(textArea);
|
|
28
|
+
textArea.select();
|
|
29
|
+
try {
|
|
30
|
+
document.execCommand('copy');
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
// copy failed silently
|
|
34
|
+
}
|
|
35
|
+
document.body.removeChild(textArea);
|
|
36
|
+
};
|
|
37
|
+
const CopyToClipboard = (props) => {
|
|
38
|
+
const { prefixCls: customisedCls, text, className, children, onClick, ...otherProps } = props;
|
|
39
|
+
const configContext = (0, react_1.useContext)(config_context_1.ConfigContext);
|
|
40
|
+
const prefixCls = (0, general_1.getPrefixCls)('copy', configContext.prefixCls, customisedCls);
|
|
41
|
+
const cls = (0, classnames_1.default)(prefixCls, className);
|
|
42
|
+
const btnOnClick = (e) => {
|
|
43
|
+
copy(text);
|
|
44
|
+
onClick && onClick(e);
|
|
45
|
+
};
|
|
46
|
+
return ((0, jsx_runtime_1.jsx)("span", { ...otherProps, className: cls, onClick: btnOnClick, children: children }));
|
|
47
|
+
};
|
|
48
|
+
CopyToClipboard.displayName = 'CopyToClipboard';
|
|
49
|
+
exports.default = CopyToClipboard;
|
|
50
|
+
//# sourceMappingURL=copy-to-clipboard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copy-to-clipboard.js","sourceRoot":"","sources":["../../components/copy-to-clipboard/copy-to-clipboard.tsx"],"names":[],"mappings":";;;;AAAA,iCAA0C;AAC1C,oEAAoC;AACpC,sEAAkE;AAClE,+CAAiD;AAGjD,MAAM,IAAI,GAAG,KAAK,EAAE,KAAa,EAAE,EAAE;IACnC,IAAI,SAAS,CAAC,SAAS,EAAE,CAAC;QACxB,IAAI,CAAC;YACH,MAAM,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAC7C,CAAC;QAAC,MAAM,CAAC;YACP,YAAY,CAAC,KAAK,CAAC,CAAC;QACtB,CAAC;IACH,CAAC;SAAM,CAAC;QACN,YAAY,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,KAAa,EAAE,EAAE;IACrC,MAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IACpD,QAAQ,CAAC,KAAK,CAAC,QAAQ,GAAG,OAAO,CAAC;IAClC,QAAQ,CAAC,KAAK,CAAC,OAAO,GAAG,GAAG,CAAC;IA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opyToClipboardProps): React.ReactElement;
|
|
5
|
-
displayName: string;
|
|
6
|
-
};
|
|
1
|
+
import CopyToClipboard from './copy-to-clipboard';
|
|
7
2
|
export default CopyToClipboard;
|
|
@@ -1,50 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
7
|
-
const config_context_1 = require("../config-provider/config-context");
|
|
8
|
-
const general_1 = require("../_utils/general");
|
|
9
|
-
const copy = async (value) => {
|
|
10
|
-
if (navigator.clipboard) {
|
|
11
|
-
try {
|
|
12
|
-
await navigator.clipboard.writeText(value);
|
|
13
|
-
}
|
|
14
|
-
catch {
|
|
15
|
-
fallbackCopy(value);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
fallbackCopy(value);
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
const fallbackCopy = (value) => {
|
|
23
|
-
const textArea = document.createElement('textarea');
|
|
24
|
-
textArea.style.position = 'fixed';
|
|
25
|
-
textArea.style.opacity = '0';
|
|
26
|
-
textArea.value = value;
|
|
27
|
-
document.body.appendChild(textArea);
|
|
28
|
-
textArea.select();
|
|
29
|
-
try {
|
|
30
|
-
document.execCommand('copy');
|
|
31
|
-
}
|
|
32
|
-
catch {
|
|
33
|
-
// copy failed silently
|
|
34
|
-
}
|
|
35
|
-
document.body.removeChild(textArea);
|
|
36
|
-
};
|
|
37
|
-
const CopyToClipboard = (props) => {
|
|
38
|
-
const { prefixCls: customisedCls, text, className, children, onClick, ...otherProps } = props;
|
|
39
|
-
const configContext = (0, react_1.useContext)(config_context_1.ConfigContext);
|
|
40
|
-
const prefixCls = (0, general_1.getPrefixCls)('copy', configContext.prefixCls, customisedCls);
|
|
41
|
-
const cls = (0, classnames_1.default)(prefixCls, className);
|
|
42
|
-
const btnOnClick = (e) => {
|
|
43
|
-
copy(text);
|
|
44
|
-
onClick && onClick(e);
|
|
45
|
-
};
|
|
46
|
-
return ((0, jsx_runtime_1.jsx)("span", { ...otherProps, className: cls, onClick: btnOnClick, children: children }));
|
|
47
|
-
};
|
|
48
|
-
CopyToClipboard.displayName = 'CopyToClipboard';
|
|
49
|
-
exports.default = CopyToClipboard;
|
|
4
|
+
const copy_to_clipboard_1 = tslib_1.__importDefault(require("./copy-to-clipboard"));
|
|
5
|
+
exports.default = copy_to_clipboard_1.default;
|
|
50
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../components/copy-to-clipboard/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../components/copy-to-clipboard/index.tsx"],"names":[],"mappings":";;;AAAA,oFAAkD;AAElD,kBAAe,2BAAe,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
|
+
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
7
|
+
const config_context_1 = require("../config-provider/config-context");
|
|
8
|
+
const general_1 = require("../_utils/general");
|
|
9
|
+
const Countdown = react_1.default.forwardRef((props, ref) => {
|
|
10
|
+
const { millisec = false, prefixCls: customisedCls, value, onFinish, className, style, children, } = props;
|
|
11
|
+
const configContext = (0, react_1.useContext)(config_context_1.ConfigContext);
|
|
12
|
+
const prefixCls = (0, general_1.getPrefixCls)('countdown', configContext.prefixCls, customisedCls);
|
|
13
|
+
const cls = (0, classnames_1.default)(prefixCls, className);
|
|
14
|
+
const [date, setDate] = (0, react_1.useState)({ day: 0, hour: 0, min: 0, sec: 0, millisec: 0 });
|
|
15
|
+
const timerRef = (0, react_1.useRef)();
|
|
16
|
+
const startInterval = (0, react_1.useCallback)(() => {
|
|
17
|
+
timerRef.current = window.setInterval(() => {
|
|
18
|
+
const distance = value.getTime() - Date.now();
|
|
19
|
+
// when the count down finished
|
|
20
|
+
if (distance < 0) {
|
|
21
|
+
window.clearInterval(timerRef.current);
|
|
22
|
+
setDate({ day: 0, hour: 0, min: 0, sec: 0, millisec: 0 });
|
|
23
|
+
onFinish && onFinish();
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
// calculate the specific time
|
|
27
|
+
const day = Math.floor(distance / 86400000);
|
|
28
|
+
const hour = Math.floor((distance % 86400000) / 3600000);
|
|
29
|
+
const min = Math.floor((distance % 3600000) / 60000);
|
|
30
|
+
const sec = Math.floor((distance % 60000) / 1000);
|
|
31
|
+
const millisecond = Math.floor((distance % 60000) % 1000);
|
|
32
|
+
setDate({ day, hour, min, sec, millisec: millisecond });
|
|
33
|
+
}, millisec ? 1 : 1000);
|
|
34
|
+
}, [millisec, onFinish, value]);
|
|
35
|
+
(0, react_1.useEffect)(() => {
|
|
36
|
+
value && startInterval();
|
|
37
|
+
return () => {
|
|
38
|
+
window.clearInterval(timerRef.current);
|
|
39
|
+
};
|
|
40
|
+
}, [value, startInterval]);
|
|
41
|
+
return ((0, jsx_runtime_1.jsx)("div", { ref: ref, className: cls, style: style, role: "timer", "aria-live": "polite", children: typeof children === 'function' && children(date) }));
|
|
42
|
+
});
|
|
43
|
+
Countdown.displayName = 'Countdown';
|
|
44
|
+
exports.default = Countdown;
|
|
45
|
+
//# sourceMappingURL=countdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"countdown.js","sourceRoot":"","sources":["../../components/countdown/countdown.tsx"],"names":[],"mappings":";;;;AAAA,uDAAoF;AACpF,oEAAoC;AACpC,sEAAkE;AAClE,+CAAiD;AAGjD,MAAM,SAAS,GAAG,eAAK,CAAC,UAAU,CA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,CAAC,CAAC,CAAC;AAEH,SAAS,CAAC,WAAW,GAAG,WAAW,CAAC;AAEpC,kBAAe,SAAS,CAAC"}
|
package/lib/countdown/index.d.ts
CHANGED
package/lib/countdown/index.js
CHANGED
|
@@ -1,45 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
7
|
-
const config_context_1 = require("../config-provider/config-context");
|
|
8
|
-
const general_1 = require("../_utils/general");
|
|
9
|
-
const Countdown = react_1.default.forwardRef((props, ref) => {
|
|
10
|
-
const { millisec = false, prefixCls: customisedCls, value, onFinish, className, style, children, } = props;
|
|
11
|
-
const configContext = (0, react_1.useContext)(config_context_1.ConfigContext);
|
|
12
|
-
const prefixCls = (0, general_1.getPrefixCls)('countdown', configContext.prefixCls, customisedCls);
|
|
13
|
-
const cls = (0, classnames_1.default)(prefixCls, className);
|
|
14
|
-
const [date, setDate] = (0, react_1.useState)({ day: 0, hour: 0, min: 0, sec: 0, millisec: 0 });
|
|
15
|
-
const timerRef = (0, react_1.useRef)();
|
|
16
|
-
const startInterval = (0, react_1.useCallback)(() => {
|
|
17
|
-
timerRef.current = window.setInterval(() => {
|
|
18
|
-
const distance = value.getTime() - Date.now();
|
|
19
|
-
// when the count down finished
|
|
20
|
-
if (distance < 0) {
|
|
21
|
-
window.clearInterval(timerRef.current);
|
|
22
|
-
setDate({ day: 0, hour: 0, min: 0, sec: 0, millisec: 0 });
|
|
23
|
-
onFinish && onFinish();
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
// calculate the specific time
|
|
27
|
-
const day = Math.floor(distance / 86400000);
|
|
28
|
-
const hour = Math.floor((distance % 86400000) / 3600000);
|
|
29
|
-
const min = Math.floor((distance % 3600000) / 60000);
|
|
30
|
-
const sec = Math.floor((distance % 60000) / 1000);
|
|
31
|
-
const millisecond = Math.floor((distance % 60000) % 1000);
|
|
32
|
-
setDate({ day, hour, min, sec, millisec: millisecond });
|
|
33
|
-
}, millisec ? 1 : 1000);
|
|
34
|
-
}, [millisec, onFinish, value]);
|
|
35
|
-
(0, react_1.useEffect)(() => {
|
|
36
|
-
value && startInterval();
|
|
37
|
-
return () => {
|
|
38
|
-
window.clearInterval(timerRef.current);
|
|
39
|
-
};
|
|
40
|
-
}, [value, startInterval]);
|
|
41
|
-
return ((0, jsx_runtime_1.jsx)("div", { ref: ref, className: cls, style: style, role: "timer", "aria-live": "polite", children: typeof children === 'function' && children(date) }));
|
|
42
|
-
});
|
|
43
|
-
Countdown.displayName = 'Countdown';
|
|
44
|
-
exports.default = Countdown;
|
|
4
|
+
const countdown_1 = tslib_1.__importDefault(require("./countdown"));
|
|
5
|
+
exports.default = countdown_1.default;
|
|
45
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../components/countdown/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../components/countdown/index.tsx"],"names":[],"mappings":";;;AAAA,oEAAoC;AAEpC,kBAAe,mBAAS,CAAC"}
|