bkui-vue 2.0.1-beta.70 → 2.0.1-beta.70.search.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -15
- package/dist/index.cjs.js +167 -167
- package/dist/index.esm.js +30199 -31633
- package/dist/index.umd.js +167 -167
- package/dist/style.css +1 -1
- package/dist/style.variable.css +1 -1
- package/lib/affix/affix.css +0 -130
- package/lib/affix/affix.variable.css +1 -262
- package/lib/affix/index.js +7 -7
- package/lib/alert/alert.css +3 -133
- package/lib/alert/alert.d.ts +12 -5
- package/lib/alert/alert.variable.css +1 -262
- package/lib/alert/index.d.ts +26 -11
- package/lib/alert/index.js +6 -6
- package/lib/backtop/backtop.css +3 -133
- package/lib/backtop/backtop.d.ts +1 -1
- package/lib/backtop/backtop.variable.css +4 -395
- package/lib/backtop/index.d.ts +3 -3
- package/lib/backtop/index.js +6 -6
- package/lib/badge/badge.css +26 -156
- package/lib/badge/badge.variable.css +1 -262
- package/lib/badge/index.js +1 -1
- package/lib/breadcrumb/breadcrumb.css +5 -135
- package/lib/breadcrumb/breadcrumb.variable.css +6 -397
- package/lib/button/button.css +143 -273
- package/lib/button/button.d.ts +7 -7
- package/lib/button/button.variable.css +1 -262
- package/lib/button/index.d.ts +8 -8
- package/lib/button/index.js +7 -6
- package/lib/card/card.css +4 -134
- package/lib/card/card.variable.css +5 -396
- package/lib/cascader/cascader-panel.d.ts +1 -1
- package/lib/cascader/cascader.css +26 -156
- package/lib/cascader/cascader.d.ts +1 -1
- package/lib/cascader/cascader.less +4 -4
- package/lib/cascader/cascader.variable.css +27 -418
- package/lib/cascader/index.js +42 -43
- package/lib/cascader/interface.d.ts +1 -1
- package/lib/checkbox/checkbox-group.d.ts +16 -0
- package/lib/checkbox/checkbox.css +9 -147
- package/lib/checkbox/checkbox.d.ts +7 -39
- package/lib/checkbox/checkbox.less +0 -12
- package/lib/checkbox/checkbox.variable.css +1 -270
- package/lib/checkbox/index.d.ts +22 -57
- package/lib/checkbox/index.js +8 -21
- package/lib/checkbox/type.d.ts +1 -1
- package/lib/code-diff/code-diff.css +0 -130
- package/lib/code-diff/code-diff.variable.css +1 -262
- package/lib/code-diff/index.js +8 -8
- package/lib/collapse/collapse.css +1 -142
- package/lib/collapse/collapse.d.ts +0 -11
- package/lib/collapse/collapse.less +1 -15
- package/lib/collapse/collapse.variable.css +1 -273
- package/lib/collapse/index.d.ts +0 -23
- package/lib/collapse/index.js +3 -11
- package/lib/collapse/props.d.ts +0 -8
- package/lib/collapse/utils.d.ts +2 -2
- package/lib/collapse-transition/collapse-transition.css +0 -130
- package/lib/collapse-transition/collapse-transition.variable.css +1 -262
- package/lib/color-picker/color-picker.css +3 -133
- package/lib/color-picker/color-picker.d.ts +0 -16
- package/lib/color-picker/color-picker.less +3 -3
- package/lib/color-picker/color-picker.variable.css +4 -265
- package/lib/color-picker/index.d.ts +0 -23
- package/lib/color-picker/index.js +46 -53
- package/lib/components.d.ts +31 -32
- package/lib/components.js +30 -31
- package/lib/config-provider/config-provider.css +0 -130
- package/lib/config-provider/config-provider.variable.css +1 -262
- package/lib/config-provider/index.d.ts +1 -1
- package/lib/container/container.css +0 -130
- package/lib/container/container.variable.css +1 -392
- package/lib/container/index.js +7 -6
- package/lib/date-picker/base/date-table.d.ts +1 -1
- package/lib/date-picker/base/month-table.d.ts +1 -1
- package/lib/date-picker/base/picker-dropdown.d.ts +1 -1
- package/lib/date-picker/base/year-table.d.ts +3 -3
- package/lib/date-picker/date-picker.css +17 -147
- package/lib/date-picker/date-picker.d.ts +10 -0
- package/lib/date-picker/date-picker.variable.css +1 -262
- package/lib/date-picker/index.d.ts +22 -0
- package/lib/date-picker/index.js +234 -346
- package/lib/date-picker/interface.d.ts +9 -9
- package/lib/date-picker/panel/date-range.d.ts +68 -6
- package/lib/date-picker/panel/date.d.ts +1 -1
- package/lib/date-picker/panel/time-range.d.ts +10 -1
- package/lib/date-picker/panel/time.d.ts +11 -2
- package/lib/date-picker/props.d.ts +5 -1
- package/lib/date-picker/time-picker.d.ts +9 -0
- package/lib/date-picker/utils.d.ts +1 -5
- package/lib/dialog/dialog.css +88 -269
- package/lib/dialog/dialog.d.ts +152 -74
- package/lib/dialog/dialog.less +76 -9
- package/lib/dialog/dialog.variable.css +89 -531
- package/lib/dialog/index.d.ts +352 -171
- package/lib/dialog/index.js +222 -200
- package/lib/dialog/props.d.ts +55 -25
- package/lib/directives/index.d.ts +3 -3
- package/lib/directives/index.js +172 -178
- package/lib/directives/tooltips.d.ts +1 -1
- package/lib/dist.index.js +4 -2
- package/lib/divider/divider.css +3 -133
- package/lib/divider/divider.d.ts +5 -5
- package/lib/divider/divider.variable.css +1 -262
- package/lib/divider/index.d.ts +11 -11
- package/lib/divider/index.js +2 -2
- package/lib/divider/props.d.ts +2 -2
- package/lib/dropdown/dropdown-item.d.ts +1 -1
- package/lib/dropdown/dropdown-menu.d.ts +1 -1
- package/lib/dropdown/dropdown.css +0 -130
- package/lib/dropdown/dropdown.d.ts +5 -5
- package/lib/dropdown/dropdown.variable.css +1 -392
- package/lib/dropdown/index.d.ts +13 -13
- package/lib/dropdown/index.js +7 -7
- package/lib/exception/exception.css +0 -130
- package/lib/exception/exception.d.ts +9 -9
- package/lib/exception/exception.variable.css +1 -262
- package/lib/exception/index.d.ts +11 -11
- package/lib/exception/index.js +10 -10
- package/lib/exception/typings/index.d.ts +1 -1
- package/lib/fixed-navbar/fixed-navbar.css +4 -134
- package/lib/fixed-navbar/fixed-navbar.variable.css +1 -262
- package/lib/fixed-navbar/index.js +2 -2
- package/lib/form/form-item.d.ts +18 -6
- package/lib/form/form.css +0 -130
- package/lib/form/form.d.ts +2 -2
- package/lib/form/form.variable.css +1 -262
- package/lib/form/index.d.ts +13 -6
- package/lib/form/index.js +21 -22
- package/lib/form/type.d.ts +2 -2
- package/lib/icon/index.d.ts +11 -11
- package/lib/icon/index.js +11 -11
- package/lib/image/image-viewer.css +0 -130
- package/lib/image/image-viewer.d.ts +1 -1
- package/lib/image/image-viewer.variable.css +1 -262
- package/lib/image/image.css +0 -130
- package/lib/image/image.variable.css +1 -392
- package/lib/image/index.js +21 -20
- package/lib/index.d.ts +3 -9
- package/lib/index.js +29 -5
- package/lib/info-box/index.d.ts +2 -2
- package/lib/info-box/index.js +173 -326
- package/lib/info-box/info-box.css +7 -193
- package/lib/info-box/info-box.d.ts +23 -25
- package/lib/info-box/info-box.less +14 -76
- package/lib/info-box/info-box.variable.css +8 -325
- package/lib/input/index.d.ts +15 -15
- package/lib/input/index.js +517 -65
- package/lib/input/input.css +73 -225
- package/lib/input/input.d.ts +15 -15
- package/lib/input/input.less +1 -30
- package/lib/input/input.variable.css +74 -487
- package/lib/link/index.d.ts +11 -11
- package/lib/link/index.js +3 -3
- package/lib/link/link.css +16 -146
- package/lib/link/link.d.ts +5 -5
- package/lib/link/link.variable.css +1 -262
- package/lib/loading/index.d.ts +4 -4
- package/lib/loading/index.js +6 -6
- package/lib/loading/loading.css +16 -146
- package/lib/loading/loading.d.ts +6 -6
- package/lib/loading/loading.variable.css +17 -408
- package/lib/locale/index.d.ts +1 -1
- package/lib/menu/index.js +1 -0
- package/lib/menu/menu.css +18 -148
- package/lib/menu/menu.variable.css +19 -410
- package/lib/menu/submenu.css +0 -130
- package/lib/menu/submenu.variable.css +1 -262
- package/lib/menu/utils.d.ts +3 -3
- package/lib/message/index.js +18 -18
- package/lib/message/message.css +22 -153
- package/lib/message/message.less +2 -3
- package/lib/message/message.variable.css +2 -264
- package/lib/message/messageConstructor.d.ts +11 -11
- package/lib/modal/hooks.d.ts +1 -1
- package/lib/modal/index.d.ts +343 -68
- package/lib/modal/index.js +696 -265
- package/lib/modal/modal.css +32 -261
- package/lib/modal/modal.d.ts +131 -26
- package/lib/modal/modal.less +29 -83
- package/lib/modal/modal.variable.css +33 -523
- package/lib/modal/props.mixin.d.ts +51 -10
- package/lib/navigation/index.js +20 -20
- package/lib/navigation/navigation.css +2 -132
- package/lib/navigation/navigation.d.ts +1 -1
- package/lib/navigation/navigation.variable.css +1 -262
- package/lib/notify/index.js +4 -4
- package/lib/notify/notify.css +7 -137
- package/lib/notify/notify.variable.css +1 -262
- package/lib/overflow-title/components/overflow-title.d.ts +16 -9
- package/lib/overflow-title/index.d.ts +34 -19
- package/lib/overflow-title/index.js +64 -107
- package/lib/overflow-title/props.d.ts +21 -18
- package/lib/pagination/index.d.ts +19 -0
- package/lib/pagination/index.js +23 -61
- package/lib/pagination/pagination.css +9 -139
- package/lib/pagination/pagination.d.ts +13 -0
- package/lib/pagination/pagination.less +13 -14
- package/lib/pagination/pagination.variable.css +9 -270
- package/lib/pagination/type.d.ts +1 -1
- package/lib/pagination/use-limit.d.ts +1 -1
- package/lib/pagination/use-total.d.ts +1 -1
- package/lib/plugin-popover/index.js +21 -20
- package/lib/pop-confirm/index.d.ts +43 -11
- package/lib/pop-confirm/index.js +28 -27
- package/lib/pop-confirm/pop-confirm.css +1 -133
- package/lib/pop-confirm/pop-confirm.d.ts +19 -5
- package/lib/pop-confirm/pop-confirm.less +1 -3
- package/lib/pop-confirm/pop-confirm.variable.css +2 -265
- package/lib/pop-confirm/props.d.ts +11 -5
- package/lib/popover/const.d.ts +3 -3
- package/lib/popover/index.d.ts +19 -19
- package/lib/popover/index.js +21 -20
- package/lib/popover/plugin-popover.d.ts +1 -1
- package/lib/popover/popover.css +0 -130
- package/lib/popover/popover.d.ts +7 -7
- package/lib/popover/popover.variable.css +1 -262
- package/lib/popover/props.d.ts +4 -4
- package/lib/preset.d.ts +1 -0
- package/lib/preset.js +1 -0
- package/lib/process/index.js +3 -3
- package/lib/process/process.css +13 -143
- package/lib/process/process.variable.css +1 -262
- package/lib/progress/index.d.ts +11 -11
- package/lib/progress/index.js +11 -10
- package/lib/progress/progress.css +4 -134
- package/lib/progress/progress.d.ts +7 -7
- package/lib/progress/progress.variable.css +5 -396
- package/lib/radio/index.d.ts +0 -29
- package/lib/radio/index.js +26 -55
- package/lib/radio/radio-button.d.ts +0 -10
- package/lib/radio/radio-group.d.ts +0 -10
- package/lib/radio/radio.css +42 -172
- package/lib/radio/radio.d.ts +0 -10
- package/lib/radio/radio.variable.css +1 -262
- package/lib/radio/type.d.ts +1 -1
- package/lib/rate/index.js +8 -8
- package/lib/rate/rate.css +0 -157
- package/lib/rate/rate.less +0 -33
- package/lib/rate/rate.variable.css +1 -289
- package/lib/rate/star.css +27 -0
- package/lib/rate/star.less +34 -0
- package/lib/{styles/themes/themes.variable.css → rate/star.variable.css} +28 -2
- package/lib/resize-layout/index.d.ts +11 -34
- package/lib/resize-layout/index.js +14 -33
- package/lib/resize-layout/resize-layout.css +0 -130
- package/lib/resize-layout/resize-layout.d.ts +5 -16
- package/lib/resize-layout/resize-layout.variable.css +1 -262
- package/lib/search-select/index.d.ts +18 -48
- package/lib/search-select/index.js +171 -120
- package/lib/search-select/input.d.ts +1 -10
- package/lib/search-select/menu.d.ts +0 -12
- package/lib/search-select/search-select.css +34 -163
- package/lib/search-select/search-select.d.ts +4 -18
- package/lib/search-select/search-select.less +1 -1
- package/lib/search-select/search-select.variable.css +35 -425
- package/lib/search-select/selected.d.ts +0 -23
- package/lib/select/common.d.ts +4 -4
- package/lib/select/index.d.ts +74 -107
- package/lib/select/index.js +183 -262
- package/lib/select/option.d.ts +6 -5
- package/lib/select/select.css +45 -176
- package/lib/select/select.d.ts +27 -40
- package/lib/select/select.less +6 -8
- package/lib/select/select.variable.css +46 -438
- package/lib/select/selectTagInput.d.ts +6 -7
- package/lib/select/type.d.ts +11 -10
- package/lib/shared/index.d.ts +2 -2
- package/lib/shared/index.js +89 -108
- package/lib/shared/mask.d.ts +11 -0
- package/lib/shared/popover.d.ts +3 -3
- package/lib/shared/token.d.ts +1 -1
- package/lib/shared/vue-types.d.ts +46 -46
- package/lib/shared/z-index-manager.d.ts +6 -6
- package/lib/sideslider/index.d.ts +217 -75
- package/lib/sideslider/index.js +42 -68
- package/lib/sideslider/sideslider.css +92 -152
- package/lib/sideslider/sideslider.d.ts +103 -35
- package/lib/sideslider/sideslider.less +112 -31
- package/lib/sideslider/sideslider.variable.css +92 -283
- package/lib/slider/index.d.ts +0 -19
- package/lib/slider/index.js +26 -64
- package/lib/slider/slider.css +4 -148
- package/lib/slider/slider.d.ts +0 -9
- package/lib/slider/slider.less +0 -15
- package/lib/slider/slider.variable.css +1 -276
- package/lib/steps/index.d.ts +29 -14
- package/lib/steps/index.js +4 -3
- package/lib/steps/steps.css +38 -168
- package/lib/steps/steps.d.ts +18 -8
- package/lib/steps/steps.variable.css +1 -262
- package/lib/styles/index.d.ts +1 -1
- package/lib/styles/mixins/animate.css +0 -130
- package/lib/styles/mixins/animate.variable.css +1 -262
- package/lib/styles/mixins/mixins.css +0 -130
- package/lib/styles/mixins/mixins.variable.css +0 -130
- package/lib/styles/mixins/popper.css +0 -130
- package/lib/styles/mixins/popper.variable.css +1 -262
- package/lib/styles/mixins/scroll.css +0 -130
- package/lib/styles/mixins/scroll.variable.css +1 -262
- package/lib/styles/reset.css +0 -130
- package/lib/styles/reset.variable.css +1 -262
- package/lib/styles/themes/themes.less +129 -299
- package/lib/swiper/index.js +5 -5
- package/lib/swiper/swiper.css +0 -130
- package/lib/swiper/swiper.variable.css +1 -262
- package/lib/switcher/index.js +2 -2
- package/lib/switcher/switcher.css +17 -147
- package/lib/switcher/switcher.d.ts +2 -2
- package/lib/switcher/switcher.variable.css +18 -409
- package/lib/tab/index.d.ts +114 -44
- package/lib/tab/index.js +38 -47
- package/lib/tab/props.d.ts +50 -25
- package/lib/tab/tab-nav.d.ts +57 -24
- package/lib/tab/tab-panel.d.ts +0 -22
- package/lib/tab/tab.css +17 -211
- package/lib/tab/tab.d.ts +54 -10
- package/lib/tab/tab.less +4 -91
- package/lib/tab/tab.variable.css +1 -326
- package/lib/table/components/table-cell.d.ts +2 -25
- package/lib/table/components/table-column.d.ts +239 -20
- package/lib/table/const.d.ts +13 -26
- package/lib/table/events.d.ts +112 -16
- package/lib/table/index.d.ts +738 -135
- package/lib/table/index.js +5781 -23555
- package/lib/table/plugins/col-group.d.ts +38 -0
- package/lib/table/plugins/head-filter.css +4 -139
- package/lib/table/plugins/head-filter.d.ts +1 -2
- package/lib/table/plugins/head-filter.less +3 -7
- package/lib/table/plugins/head-filter.variable.css +5 -271
- package/lib/table/plugins/head-sort.css +0 -130
- package/lib/table/plugins/head-sort.variable.css +1 -262
- package/lib/table/plugins/settings.css +0 -131
- package/lib/table/plugins/settings.d.ts +16 -0
- package/lib/table/plugins/settings.less +0 -1
- package/lib/table/plugins/settings.variable.css +1 -263
- package/lib/table/plugins/use-active-columns.d.ts +16 -0
- package/lib/table/plugins/use-column-resize.d.ts +35 -0
- package/lib/table/{hooks → plugins}/use-draggable.d.ts +2 -2
- package/lib/table/plugins/use-fixed-column.d.ts +27 -0
- package/lib/table/plugins/use-head-cell.d.ts +7 -0
- package/lib/table/plugins/use-pagination.d.ts +21 -0
- package/lib/table/props.d.ts +64 -135
- package/lib/table/table.css +303 -638
- package/lib/table/table.d.ts +185 -62
- package/lib/table/table.less +148 -266
- package/lib/table/table.variable.css +312 -908
- package/lib/table/use-attributes.d.ts +61 -0
- package/lib/table/use-column.d.ts +276 -0
- package/lib/table/use-common.d.ts +1679 -0
- package/lib/table/use-render.d.ts +11 -0
- package/lib/table/utils.d.ts +21 -49
- package/lib/table-column/index.d.ts +579 -30
- package/lib/table-column/index.js +317 -17398
- package/lib/tag/index.d.ts +11 -11
- package/lib/tag/index.js +3 -2
- package/lib/tag/tag.css +6 -136
- package/lib/tag/tag.d.ts +5 -5
- package/lib/tag/tag.less +1 -1
- package/lib/tag/tag.variable.css +2 -263
- package/lib/tag-input/common.d.ts +1 -1
- package/lib/tag-input/index.d.ts +8 -8
- package/lib/tag-input/index.js +33 -37
- package/lib/tag-input/tag-input.css +18 -148
- package/lib/tag-input/tag-input.d.ts +4 -4
- package/lib/tag-input/tag-input.variable.css +1 -262
- package/lib/tag-input/tag-props.d.ts +2 -2
- package/lib/time-picker/index.d.ts +19 -0
- package/lib/time-picker/time-picker.css +0 -130
- package/lib/time-picker/time-picker.variable.css +1 -262
- package/lib/timeline/index.js +2 -2
- package/lib/timeline/timeline.css +19 -149
- package/lib/timeline/timeline.variable.css +1 -262
- package/lib/transfer/const.d.ts +2 -2
- package/lib/transfer/index.js +19 -19
- package/lib/transfer/transfer.css +28 -158
- package/lib/transfer/transfer.less +3 -3
- package/lib/transfer/transfer.variable.css +10 -271
- package/lib/tree/constant.d.ts +20 -24
- package/lib/tree/index.d.ts +24 -82
- package/lib/tree/index.js +90 -17660
- package/lib/tree/props.d.ts +10 -35
- package/lib/tree/tree.css +18 -256
- package/lib/tree/tree.d.ts +8 -34
- package/lib/tree/tree.less +1 -1
- package/lib/tree/tree.variable.css +19 -518
- package/lib/tree/use-empty.d.ts +1 -1
- package/lib/tree/use-node-action.d.ts +9 -10
- package/lib/tree/use-node-async.d.ts +1 -2
- package/lib/tree/use-node-attribute.d.ts +30 -47
- package/lib/tree/use-search.d.ts +1 -1
- package/lib/tree/use-tree-init.d.ts +5 -8
- package/lib/tree/util.d.ts +21 -21
- package/lib/upload/index.d.ts +4 -27
- package/lib/upload/index.js +51 -102
- package/lib/upload/props.d.ts +2 -7
- package/lib/upload/upload.css +27 -157
- package/lib/upload/upload.d.ts +2 -13
- package/lib/upload/upload.type.d.ts +7 -13
- package/lib/upload/upload.variable.css +28 -419
- package/lib/upload/use-file-handler.d.ts +1 -1
- package/lib/virtual-render/index.d.ts +46 -39
- package/lib/virtual-render/index.js +130 -17665
- package/lib/virtual-render/props.d.ts +9 -18
- package/lib/virtual-render/use-fix-top.d.ts +8 -3
- package/lib/virtual-render/v-virtual-render.d.ts +2 -9
- package/lib/virtual-render/virtual-render.css +9 -239
- package/lib/virtual-render/virtual-render.d.ts +22 -19
- package/lib/virtual-render/virtual-render.less +10 -1
- package/lib/virtual-render/virtual-render.variable.css +10 -501
- package/lib/volar.components.d.ts +0 -2
- package/package.json +55 -17
- package/lib/info-box/render-component.d.ts +0 -4
- package/lib/modal/mask.d.ts +0 -6
- package/lib/scrollbar/css/scrollbar.css +0 -239
- package/lib/scrollbar/css/scrollbar.less +0 -139
- package/lib/scrollbar/css/scrollbar.variable.css +0 -499
- package/lib/scrollbar/handlers/click-rail.d.ts +0 -2
- package/lib/scrollbar/handlers/drag-thumb.d.ts +0 -1
- package/lib/scrollbar/handlers/keyboard.d.ts +0 -2
- package/lib/scrollbar/handlers/mouse-wheel.d.ts +0 -2
- package/lib/scrollbar/handlers/touch.d.ts +0 -4
- package/lib/scrollbar/helper/class-names.d.ts +0 -21
- package/lib/scrollbar/helper/css.d.ts +0 -3
- package/lib/scrollbar/helper/dom.d.ts +0 -4
- package/lib/scrollbar/helper/event-manager.d.ts +0 -20
- package/lib/scrollbar/helper/util.d.ts +0 -11
- package/lib/scrollbar/index.d.ts +0 -135
- package/lib/scrollbar/index.js +0 -1661
- package/lib/scrollbar/process-scroll-diff.d.ts +0 -1
- package/lib/scrollbar/update-geometry.d.ts +0 -8
- package/lib/shared/frame-throttle.d.ts +0 -15
- package/lib/styles/themes/themes.css +0 -130
- package/lib/table/components/ghost-body.d.ts +0 -2
- package/lib/table/hooks/use-cell.d.ts +0 -20
- package/lib/table/hooks/use-column-resize.d.ts +0 -7
- package/lib/table/hooks/use-column-template.d.ts +0 -5
- package/lib/table/hooks/use-columns.d.ts +0 -69
- package/lib/table/hooks/use-fixed-column.d.ts +0 -10
- package/lib/table/hooks/use-head.d.ts +0 -16
- package/lib/table/hooks/use-layout.d.ts +0 -25
- package/lib/table/hooks/use-pagination.d.ts +0 -16
- package/lib/table/hooks/use-render.d.ts +0 -21
- package/lib/table/hooks/use-rows.d.ts +0 -30
- package/lib/table/hooks/use-settings.d.ts +0 -136
- package/lib/table/hooks/use-shift-key.d.ts +0 -15
- package/lib/tree/use-intersection-observer.d.ts +0 -27
- package/lib/virtual-render/use-scrollbar.d.ts +0 -11
- /package/lib/table/{components → plugins}/body-empty.d.ts +0 -0
- /package/lib/table/{hooks → plugins}/use-observer-resize.d.ts +0 -0
- /package/lib/table/{hooks → plugins}/use-scroll-loading.d.ts +0 -0
package/lib/scrollbar/index.js
DELETED
@@ -1,1661 +0,0 @@
|
|
1
|
-
import "../styles/reset.css";
|
2
|
-
/******/ // The require scope
|
3
|
-
/******/ var __webpack_require__ = {};
|
4
|
-
/******/
|
5
|
-
/************************************************************************/
|
6
|
-
/******/ /* webpack/runtime/define property getters */
|
7
|
-
/******/ (() => {
|
8
|
-
/******/ // define getter functions for harmony exports
|
9
|
-
/******/ __webpack_require__.d = (exports, definition) => {
|
10
|
-
/******/ for(var key in definition) {
|
11
|
-
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
12
|
-
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
13
|
-
/******/ }
|
14
|
-
/******/ }
|
15
|
-
/******/ };
|
16
|
-
/******/ })();
|
17
|
-
/******/
|
18
|
-
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
19
|
-
/******/ (() => {
|
20
|
-
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
21
|
-
/******/ })();
|
22
|
-
/******/
|
23
|
-
/************************************************************************/
|
24
|
-
var __webpack_exports__ = {};
|
25
|
-
|
26
|
-
// EXPORTS
|
27
|
-
__webpack_require__.d(__webpack_exports__, {
|
28
|
-
IScrollbarSize: () => (/* binding */ IScrollbarSize),
|
29
|
-
VirtualElement: () => (/* binding */ VirtualElement),
|
30
|
-
"default": () => (/* binding */ BkScrollbar)
|
31
|
-
});
|
32
|
-
|
33
|
-
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js
|
34
|
-
function _classCallCheck(instance, Constructor) {
|
35
|
-
if (!(instance instanceof Constructor)) {
|
36
|
-
throw new TypeError("Cannot call a class as a function");
|
37
|
-
}
|
38
|
-
}
|
39
|
-
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/typeof.js
|
40
|
-
function _typeof(o) {
|
41
|
-
"@babel/helpers - typeof";
|
42
|
-
|
43
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
44
|
-
return typeof o;
|
45
|
-
} : function (o) {
|
46
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
47
|
-
}, _typeof(o);
|
48
|
-
}
|
49
|
-
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js
|
50
|
-
|
51
|
-
function toPrimitive(t, r) {
|
52
|
-
if ("object" != _typeof(t) || !t) return t;
|
53
|
-
var e = t[Symbol.toPrimitive];
|
54
|
-
if (void 0 !== e) {
|
55
|
-
var i = e.call(t, r || "default");
|
56
|
-
if ("object" != _typeof(i)) return i;
|
57
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
58
|
-
}
|
59
|
-
return ("string" === r ? String : Number)(t);
|
60
|
-
}
|
61
|
-
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
|
62
|
-
|
63
|
-
|
64
|
-
function toPropertyKey(t) {
|
65
|
-
var i = toPrimitive(t, "string");
|
66
|
-
return "symbol" == _typeof(i) ? i : String(i);
|
67
|
-
}
|
68
|
-
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/createClass.js
|
69
|
-
|
70
|
-
function _defineProperties(target, props) {
|
71
|
-
for (var i = 0; i < props.length; i++) {
|
72
|
-
var descriptor = props[i];
|
73
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
74
|
-
descriptor.configurable = true;
|
75
|
-
if ("value" in descriptor) descriptor.writable = true;
|
76
|
-
Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
|
77
|
-
}
|
78
|
-
}
|
79
|
-
function _createClass(Constructor, protoProps, staticProps) {
|
80
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
81
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
82
|
-
Object.defineProperty(Constructor, "prototype", {
|
83
|
-
writable: false
|
84
|
-
});
|
85
|
-
return Constructor;
|
86
|
-
}
|
87
|
-
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
88
|
-
|
89
|
-
function _defineProperty(obj, key, value) {
|
90
|
-
key = toPropertyKey(key);
|
91
|
-
if (key in obj) {
|
92
|
-
Object.defineProperty(obj, key, {
|
93
|
-
value: value,
|
94
|
-
enumerable: true,
|
95
|
-
configurable: true,
|
96
|
-
writable: true
|
97
|
-
});
|
98
|
-
} else {
|
99
|
-
obj[key] = value;
|
100
|
-
}
|
101
|
-
return obj;
|
102
|
-
}
|
103
|
-
;// CONCATENATED MODULE: ../../packages/scrollbar/src/helper/dom.ts
|
104
|
-
/*
|
105
|
-
* Tencent is pleased to support the open source community by making
|
106
|
-
* 蓝鲸智云PaaS平台 (BlueKing PaaS) available.
|
107
|
-
*
|
108
|
-
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
109
|
-
*
|
110
|
-
* 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.
|
111
|
-
*
|
112
|
-
* License for 蓝鲸智云PaaS平台 (BlueKing PaaS):
|
113
|
-
*
|
114
|
-
* ---------------------------------------------------
|
115
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
116
|
-
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
117
|
-
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
118
|
-
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
119
|
-
*
|
120
|
-
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
121
|
-
* the Software.
|
122
|
-
*
|
123
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
124
|
-
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
125
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
126
|
-
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
127
|
-
* IN THE SOFTWARE.
|
128
|
-
*/
|
129
|
-
|
130
|
-
function div(className) {
|
131
|
-
var div = document.createElement('div');
|
132
|
-
div.className = className;
|
133
|
-
return div;
|
134
|
-
}
|
135
|
-
var elMatches = typeof Element !== 'undefined' && Element.prototype.matches;
|
136
|
-
function matches(el, query) {
|
137
|
-
var element = getElement(el);
|
138
|
-
if (!elMatches) {
|
139
|
-
throw new Error('No element matching method supported');
|
140
|
-
}
|
141
|
-
return elMatches.call(element, query);
|
142
|
-
}
|
143
|
-
function remove(el) {
|
144
|
-
var element = getElement(el);
|
145
|
-
if (element.remove) {
|
146
|
-
element.remove();
|
147
|
-
} else {
|
148
|
-
if (element.parentNode) {
|
149
|
-
element.parentNode.removeChild(element);
|
150
|
-
}
|
151
|
-
}
|
152
|
-
}
|
153
|
-
function queryChildren(element, selector) {
|
154
|
-
return Array.prototype.filter.call(element.children, function (child) {
|
155
|
-
return matches(child, selector);
|
156
|
-
});
|
157
|
-
}
|
158
|
-
;// CONCATENATED MODULE: ../../packages/scrollbar/src/helper/util.ts
|
159
|
-
var _navigator;
|
160
|
-
|
161
|
-
|
162
|
-
function toInt(x) {
|
163
|
-
return parseInt(x, 10) || 0;
|
164
|
-
}
|
165
|
-
function isEditable(el) {
|
166
|
-
return matches(el, 'input,[contenteditable]') || matches(el, 'select,[contenteditable]') || matches(el, 'textarea,[contenteditable]') || matches(el, 'button,[contenteditable]');
|
167
|
-
}
|
168
|
-
function util_outerWidth(element) {
|
169
|
-
var styles = get(element);
|
170
|
-
return toInt(styles.width) + toInt(styles.paddingLeft) + toInt(styles.paddingRight) + toInt(styles.borderLeftWidth) + toInt(styles.borderRightWidth);
|
171
|
-
}
|
172
|
-
var env = {
|
173
|
-
isWebKit: typeof document !== 'undefined' && 'WebkitAppearance' in document.documentElement.style,
|
174
|
-
supportsTouch: typeof window !== 'undefined' && ('ontouchstart' in window || 'maxTouchPoints' in window.navigator && window.navigator.maxTouchPoints > 0 ||
|
175
|
-
// @ts-ignore
|
176
|
-
window.DocumentTouch && document instanceof window.DocumentTouch),
|
177
|
-
// @ts-ignore
|
178
|
-
supportsIePointer: typeof navigator !== 'undefined' && navigator.msMaxTouchPoints,
|
179
|
-
isChrome: typeof navigator !== 'undefined' && /Chrome/i.test((_navigator = navigator) === null || _navigator === void 0 ? void 0 : _navigator.userAgent)
|
180
|
-
};
|
181
|
-
var getElement = function getElement(element) {
|
182
|
-
return element.isVirtualElement ? element.delegateElement : element;
|
183
|
-
};
|
184
|
-
;// CONCATENATED MODULE: ../../packages/scrollbar/src/helper/css.ts
|
185
|
-
|
186
|
-
function get(element) {
|
187
|
-
return getComputedStyle(getElement(element));
|
188
|
-
}
|
189
|
-
function set(element, obj) {
|
190
|
-
for (var key in obj) {
|
191
|
-
var val = obj[key];
|
192
|
-
if (typeof val === 'number') {
|
193
|
-
val = "".concat(val, "px");
|
194
|
-
}
|
195
|
-
element.style[key] = val;
|
196
|
-
}
|
197
|
-
return element;
|
198
|
-
}
|
199
|
-
;// CONCATENATED MODULE: ../../packages/scrollbar/src/update-geometry.ts
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
/* harmony default export */ function update_geometry(i) {
|
204
|
-
var element = i.element;
|
205
|
-
var roundedScrollTop = Math.floor(element.scrollTop);
|
206
|
-
var rect = element.getBoundingClientRect();
|
207
|
-
i.containerWidth = Math.round(rect.width);
|
208
|
-
i.containerHeight = Math.round(rect.height);
|
209
|
-
i.contentWidth = element.scrollWidth;
|
210
|
-
i.contentHeight = element.scrollHeight;
|
211
|
-
if (!element.contains(i.scrollbarXRail)) {
|
212
|
-
// clean up and append
|
213
|
-
queryChildren(element, i.cls.element.rail('x')).forEach(function (el) {
|
214
|
-
return remove(el);
|
215
|
-
});
|
216
|
-
element.appendChild(i.scrollbarXRail);
|
217
|
-
}
|
218
|
-
if (!element.contains(i.scrollbarYRail)) {
|
219
|
-
// clean up and append
|
220
|
-
queryChildren(element, i.cls.element.rail('y')).forEach(function (el) {
|
221
|
-
return remove(el);
|
222
|
-
});
|
223
|
-
element.appendChild(i.scrollbarYRail);
|
224
|
-
}
|
225
|
-
if (!i.settings.suppressScrollX && i.containerWidth + i.settings.scrollXMarginOffset < i.contentWidth) {
|
226
|
-
i.scrollbarXActive = true;
|
227
|
-
i.railXWidth = i.containerWidth - i.railXMarginWidth;
|
228
|
-
i.railXRatio = i.containerWidth / i.railXWidth;
|
229
|
-
i.scrollbarXWidth = getThumbSize(i, toInt(i.railXWidth * i.containerWidth / i.contentWidth));
|
230
|
-
i.scrollbarXLeft = toInt((i.negativeScrollAdjustment + element.scrollLeft) * (i.railXWidth - i.scrollbarXWidth) / (i.contentWidth - i.containerWidth));
|
231
|
-
} else {
|
232
|
-
i.scrollbarXActive = false;
|
233
|
-
}
|
234
|
-
if (!i.settings.suppressScrollY && i.containerHeight + i.settings.scrollYMarginOffset < i.contentHeight) {
|
235
|
-
i.scrollbarYActive = true;
|
236
|
-
i.railYHeight = i.containerHeight - i.railYMarginHeight;
|
237
|
-
i.railYRatio = i.containerHeight / i.railYHeight;
|
238
|
-
i.scrollbarYHeight = getThumbSize(i, toInt(i.railYHeight * i.containerHeight / i.contentHeight));
|
239
|
-
i.scrollbarYTop = i.element.isVirtualElement ? getThumbTop(i) : toInt(roundedScrollTop * (i.railYHeight - i.scrollbarYHeight) / (i.contentHeight - i.containerHeight));
|
240
|
-
} else {
|
241
|
-
i.scrollbarYActive = false;
|
242
|
-
}
|
243
|
-
if (i.scrollbarXLeft >= i.railXWidth - i.scrollbarXWidth) {
|
244
|
-
i.scrollbarXLeft = i.railXWidth - i.scrollbarXWidth;
|
245
|
-
}
|
246
|
-
if (i.scrollbarYTop >= i.railYHeight - i.scrollbarYHeight) {
|
247
|
-
i.scrollbarYTop = i.railYHeight - i.scrollbarYHeight;
|
248
|
-
}
|
249
|
-
updateCss(element, i);
|
250
|
-
if (i.scrollbarXActive) {
|
251
|
-
element.classList.add(i.cls.state.active('x'));
|
252
|
-
} else {
|
253
|
-
element.classList.remove(i.cls.state.active('x'));
|
254
|
-
i.scrollbarXWidth = 0;
|
255
|
-
i.scrollbarXLeft = 0;
|
256
|
-
element.scrollLeft = i.isRtl === true ? i.contentWidth : 0;
|
257
|
-
}
|
258
|
-
if (i.scrollbarYActive) {
|
259
|
-
element.classList.add(i.cls.state.active('y'));
|
260
|
-
} else {
|
261
|
-
element.classList.remove(i.cls.state.active('y'));
|
262
|
-
i.scrollbarYHeight = 0;
|
263
|
-
i.scrollbarYTop = 0;
|
264
|
-
element.scrollTop = 0;
|
265
|
-
}
|
266
|
-
}
|
267
|
-
function getThumbTop(i) {
|
268
|
-
var top = toInt(i.element.virtualScrollTop);
|
269
|
-
if (top >= 0) {
|
270
|
-
return top;
|
271
|
-
}
|
272
|
-
return 0;
|
273
|
-
}
|
274
|
-
function getThumbSize(i, thumbSize) {
|
275
|
-
if (i.settings.minScrollbarLength) {
|
276
|
-
thumbSize = Math.max(thumbSize, i.settings.minScrollbarLength);
|
277
|
-
}
|
278
|
-
if (i.settings.maxScrollbarLength) {
|
279
|
-
thumbSize = Math.min(thumbSize, i.settings.maxScrollbarLength);
|
280
|
-
}
|
281
|
-
return thumbSize;
|
282
|
-
}
|
283
|
-
function updateCss(element, i) {
|
284
|
-
var xRailOffset = {
|
285
|
-
width: i.railXWidth
|
286
|
-
};
|
287
|
-
var roundedScrollTop = element.isVirtualElement ? 0 : Math.floor(element.scrollTop);
|
288
|
-
if (i.isRtl) {
|
289
|
-
xRailOffset.left = i.negativeScrollAdjustment + element.scrollLeft + i.containerWidth - i.contentWidth;
|
290
|
-
} else {
|
291
|
-
xRailOffset.left = element.scrollLeft;
|
292
|
-
}
|
293
|
-
if (i.isScrollbarXUsingBottom) {
|
294
|
-
xRailOffset.bottom = i.scrollbarXBottom - roundedScrollTop;
|
295
|
-
} else {
|
296
|
-
xRailOffset.top = i.scrollbarXTop + roundedScrollTop;
|
297
|
-
}
|
298
|
-
set(i.scrollbarXRail, xRailOffset);
|
299
|
-
var yRailOffset = {
|
300
|
-
top: roundedScrollTop,
|
301
|
-
height: i.railYHeight
|
302
|
-
};
|
303
|
-
if (i.isScrollbarYUsingRight) {
|
304
|
-
if (i.isRtl) {
|
305
|
-
yRailOffset.right = i.contentWidth - (i.negativeScrollAdjustment + element.scrollLeft) - i.scrollbarYRight - i.scrollbarYOuterWidth - 9;
|
306
|
-
} else {
|
307
|
-
yRailOffset.right = i.scrollbarYRight - element.scrollLeft;
|
308
|
-
}
|
309
|
-
} else {
|
310
|
-
if (i.isRtl) {
|
311
|
-
yRailOffset.left = i.negativeScrollAdjustment + element.scrollLeft + i.containerWidth * 2 - i.contentWidth - i.scrollbarYLeft - i.scrollbarYOuterWidth;
|
312
|
-
} else {
|
313
|
-
yRailOffset.left = i.scrollbarYLeft + element.scrollLeft;
|
314
|
-
}
|
315
|
-
}
|
316
|
-
set(i.scrollbarYRail, yRailOffset);
|
317
|
-
set(i.scrollbarX, {
|
318
|
-
left: i.scrollbarXLeft,
|
319
|
-
width: i.scrollbarXWidth - i.railBorderXWidth
|
320
|
-
});
|
321
|
-
set(i.scrollbarY, {
|
322
|
-
top: i.scrollbarYTop,
|
323
|
-
height: i.scrollbarYHeight - i.railBorderYWidth
|
324
|
-
});
|
325
|
-
}
|
326
|
-
;// CONCATENATED MODULE: ../../packages/scrollbar/src/handlers/click-rail.ts
|
327
|
-
|
328
|
-
/* harmony default export */ function click_rail(i) {
|
329
|
-
i.event.bind(i.scrollbarY, 'mousedown', function (e) {
|
330
|
-
return e.stopPropagation();
|
331
|
-
});
|
332
|
-
i.event.bind(i.scrollbarYRail, 'mousedown', function (e) {
|
333
|
-
var positionTop = e.pageY - window.pageYOffset - i.scrollbarYRail.getBoundingClientRect().top;
|
334
|
-
var direction = positionTop > i.scrollbarYTop ? 1 : -1;
|
335
|
-
if (!i.element.isVirtualElement) {
|
336
|
-
i.element.scrollTop += direction * i.containerHeight;
|
337
|
-
} else {
|
338
|
-
i.element.scrollTop = positionTop / (i.element.offsetHeight / i.element.scrollHeight);
|
339
|
-
}
|
340
|
-
i.element.scrollTop += direction * i.containerHeight;
|
341
|
-
update_geometry(i);
|
342
|
-
e.stopPropagation();
|
343
|
-
});
|
344
|
-
i.event.bind(i.scrollbarX, 'mousedown', function (e) {
|
345
|
-
return e.stopPropagation();
|
346
|
-
});
|
347
|
-
i.event.bind(i.scrollbarXRail, 'mousedown', function (e) {
|
348
|
-
var positionLeft = e.pageX - window.pageXOffset - i.scrollbarXRail.getBoundingClientRect().left;
|
349
|
-
var direction = positionLeft > i.scrollbarXLeft ? 1 : -1;
|
350
|
-
i.element.scrollLeft += direction * i.containerWidth;
|
351
|
-
update_geometry(i);
|
352
|
-
e.stopPropagation();
|
353
|
-
});
|
354
|
-
}
|
355
|
-
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
|
356
|
-
function _arrayWithHoles(arr) {
|
357
|
-
if (Array.isArray(arr)) return arr;
|
358
|
-
}
|
359
|
-
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
|
360
|
-
function _iterableToArrayLimit(r, l) {
|
361
|
-
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
362
|
-
if (null != t) {
|
363
|
-
var e,
|
364
|
-
n,
|
365
|
-
i,
|
366
|
-
u,
|
367
|
-
a = [],
|
368
|
-
f = !0,
|
369
|
-
o = !1;
|
370
|
-
try {
|
371
|
-
if (i = (t = t.call(r)).next, 0 === l) {
|
372
|
-
if (Object(t) !== t) return;
|
373
|
-
f = !1;
|
374
|
-
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
375
|
-
} catch (r) {
|
376
|
-
o = !0, n = r;
|
377
|
-
} finally {
|
378
|
-
try {
|
379
|
-
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
|
380
|
-
} finally {
|
381
|
-
if (o) throw n;
|
382
|
-
}
|
383
|
-
}
|
384
|
-
return a;
|
385
|
-
}
|
386
|
-
}
|
387
|
-
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
|
388
|
-
function _arrayLikeToArray(arr, len) {
|
389
|
-
if (len == null || len > arr.length) len = arr.length;
|
390
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
391
|
-
return arr2;
|
392
|
-
}
|
393
|
-
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
|
394
|
-
|
395
|
-
function _unsupportedIterableToArray(o, minLen) {
|
396
|
-
if (!o) return;
|
397
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
398
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
399
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
400
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
401
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
402
|
-
}
|
403
|
-
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
|
404
|
-
function _nonIterableRest() {
|
405
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
406
|
-
}
|
407
|
-
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/slicedToArray.js
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
function _slicedToArray(arr, i) {
|
413
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
414
|
-
}
|
415
|
-
;// CONCATENATED MODULE: ../../packages/scrollbar/src/helper/class-names.ts
|
416
|
-
|
417
|
-
|
418
|
-
/*
|
419
|
-
* Tencent is pleased to support the open source community by making
|
420
|
-
* 蓝鲸智云PaaS平台 (BlueKing PaaS) available.
|
421
|
-
*
|
422
|
-
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
423
|
-
*
|
424
|
-
* 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.
|
425
|
-
*
|
426
|
-
* License for 蓝鲸智云PaaS平台 (BlueKing PaaS):
|
427
|
-
*
|
428
|
-
* ---------------------------------------------------
|
429
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
430
|
-
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
431
|
-
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
432
|
-
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
433
|
-
*
|
434
|
-
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
435
|
-
* the Software.
|
436
|
-
*
|
437
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
438
|
-
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
439
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
440
|
-
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
441
|
-
* IN THE SOFTWARE.
|
442
|
-
*/
|
443
|
-
var Cls = /*#__PURE__*/_createClass(function Cls() {
|
444
|
-
var prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'bk';
|
445
|
-
_classCallCheck(this, Cls);
|
446
|
-
this.main = "".concat(prefix, "-scrollbar");
|
447
|
-
this.rtl = "".concat(prefix, "-rtl");
|
448
|
-
this.element = {
|
449
|
-
thumb: function thumb(x) {
|
450
|
-
return "".concat(prefix, "__thumb-").concat(x);
|
451
|
-
},
|
452
|
-
rail: function rail(x) {
|
453
|
-
return "".concat(prefix, "__rail-").concat(x);
|
454
|
-
},
|
455
|
-
size: function size(x) {
|
456
|
-
return "".concat(prefix, "-scroll-size-").concat(x);
|
457
|
-
},
|
458
|
-
consuming: "".concat(prefix, "__child--consume")
|
459
|
-
};
|
460
|
-
this.state = {
|
461
|
-
focus: "".concat(prefix, "--focus"),
|
462
|
-
clicking: "".concat(prefix, "--clicking"),
|
463
|
-
active: function active(x) {
|
464
|
-
return "".concat(prefix, "--active-").concat(x);
|
465
|
-
},
|
466
|
-
scrolling: function scrolling(x) {
|
467
|
-
return "".concat(prefix, "--scrolling-").concat(x);
|
468
|
-
}
|
469
|
-
};
|
470
|
-
});
|
471
|
-
/* harmony default export */ const class_names = (Cls);
|
472
|
-
/*
|
473
|
-
* Helper methods
|
474
|
-
*/
|
475
|
-
var scrollingClassTimeout = {
|
476
|
-
x: null,
|
477
|
-
y: null
|
478
|
-
};
|
479
|
-
function addScrollingClass(i, x) {
|
480
|
-
var classList = i.element.classList;
|
481
|
-
var className = i.cls.state.scrolling(x);
|
482
|
-
if (classList.contains(className)) {
|
483
|
-
clearTimeout(scrollingClassTimeout[x]);
|
484
|
-
} else {
|
485
|
-
classList.add(className);
|
486
|
-
}
|
487
|
-
}
|
488
|
-
function removeScrollingClass(i, x) {
|
489
|
-
scrollingClassTimeout[x] = setTimeout(function () {
|
490
|
-
return i.isAlive && i.element.classList.remove(i.cls.state.scrolling(x));
|
491
|
-
}, i.settings.scrollingThreshold);
|
492
|
-
}
|
493
|
-
function setScrollingClassInstantly(i, x) {
|
494
|
-
addScrollingClass(i, x);
|
495
|
-
removeScrollingClass(i, x);
|
496
|
-
}
|
497
|
-
;// CONCATENATED MODULE: ../../packages/scrollbar/src/handlers/drag-thumb.ts
|
498
|
-
|
499
|
-
/*
|
500
|
-
* Tencent is pleased to support the open source community by making
|
501
|
-
* 蓝鲸智云PaaS平台 (BlueKing PaaS) available.
|
502
|
-
*
|
503
|
-
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
504
|
-
*
|
505
|
-
* 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.
|
506
|
-
*
|
507
|
-
* License for 蓝鲸智云PaaS平台 (BlueKing PaaS):
|
508
|
-
*
|
509
|
-
* ---------------------------------------------------
|
510
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
511
|
-
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
512
|
-
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
513
|
-
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
514
|
-
*
|
515
|
-
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
516
|
-
* the Software.
|
517
|
-
*
|
518
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
519
|
-
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
520
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
521
|
-
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
522
|
-
* IN THE SOFTWARE.
|
523
|
-
*/
|
524
|
-
|
525
|
-
|
526
|
-
/* harmony default export */ function drag_thumb(i) {
|
527
|
-
bindMouseScrollHandler(i, ['containerWidth', 'contentWidth', 'pageX', 'railXWidth', 'scrollbarX', 'scrollbarXWidth', 'scrollLeft', 'x', 'scrollbarXRail']);
|
528
|
-
bindMouseScrollHandler(i, ['containerHeight', 'contentHeight', 'pageY', 'railYHeight', 'scrollbarY', 'scrollbarYHeight', 'scrollTop', 'y', 'scrollbarYRail']);
|
529
|
-
}
|
530
|
-
function bindMouseScrollHandler(i, _ref) {
|
531
|
-
var _ref2 = _slicedToArray(_ref, 9),
|
532
|
-
containerHeight = _ref2[0],
|
533
|
-
contentHeight = _ref2[1],
|
534
|
-
pageY = _ref2[2],
|
535
|
-
railYHeight = _ref2[3],
|
536
|
-
scrollbarY = _ref2[4],
|
537
|
-
scrollbarYHeight = _ref2[5],
|
538
|
-
scrollTop = _ref2[6],
|
539
|
-
y = _ref2[7],
|
540
|
-
scrollbarYRail = _ref2[8];
|
541
|
-
var element = i.element;
|
542
|
-
var startingScrollTop = null;
|
543
|
-
var startingMousePageY = null;
|
544
|
-
var scrollBy = null;
|
545
|
-
function mouseMoveHandler(e) {
|
546
|
-
var _e$touches;
|
547
|
-
if ((_e$touches = e.touches) !== null && _e$touches !== void 0 && _e$touches[0]) {
|
548
|
-
e[pageY] = e.touches[0].pageY;
|
549
|
-
}
|
550
|
-
element[scrollTop] = startingScrollTop + scrollBy * (e[pageY] - startingMousePageY);
|
551
|
-
addScrollingClass(i, y);
|
552
|
-
update_geometry(i);
|
553
|
-
e.stopPropagation();
|
554
|
-
if (e.type.startsWith('touch') && e.changedTouches.length > 1) {
|
555
|
-
e.preventDefault();
|
556
|
-
}
|
557
|
-
}
|
558
|
-
function mouseUpHandler() {
|
559
|
-
removeScrollingClass(i, y);
|
560
|
-
i[scrollbarYRail].classList.remove(i.cls.state.clicking);
|
561
|
-
i.event.unbind(i.ownerDocument, 'mousemove', mouseMoveHandler);
|
562
|
-
}
|
563
|
-
function bindMoves(e, touchMode) {
|
564
|
-
startingScrollTop = element[scrollTop];
|
565
|
-
if (touchMode && e.touches) {
|
566
|
-
e[pageY] = e.touches[0].pageY;
|
567
|
-
}
|
568
|
-
startingMousePageY = e[pageY];
|
569
|
-
scrollBy = (i[contentHeight] - i[containerHeight]) / (i[railYHeight] - i[scrollbarYHeight]);
|
570
|
-
if (!touchMode) {
|
571
|
-
i.event.bind(i.ownerDocument, 'mousemove', mouseMoveHandler);
|
572
|
-
i.event.once(i.ownerDocument, 'mouseup', mouseUpHandler);
|
573
|
-
e.preventDefault();
|
574
|
-
} else {
|
575
|
-
i.event.bind(i.ownerDocument, 'touchmove', mouseMoveHandler);
|
576
|
-
}
|
577
|
-
i[scrollbarYRail].classList.add(i.cls.state.clicking);
|
578
|
-
e.stopPropagation();
|
579
|
-
}
|
580
|
-
i.event.bind(i[scrollbarY], 'mousedown', function (e) {
|
581
|
-
bindMoves(e);
|
582
|
-
});
|
583
|
-
i.event.bind(i[scrollbarY], 'touchstart', function (e) {
|
584
|
-
bindMoves(e, true);
|
585
|
-
});
|
586
|
-
}
|
587
|
-
;// CONCATENATED MODULE: ../../packages/scrollbar/src/handlers/keyboard.ts
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
/* harmony default export */ function keyboard(i) {
|
592
|
-
var element = i.element;
|
593
|
-
var elementHovered = function elementHovered() {
|
594
|
-
return matches(element, ':hover');
|
595
|
-
};
|
596
|
-
var scrollbarFocused = function scrollbarFocused() {
|
597
|
-
return matches(i.scrollbarX, ':focus') || matches(i.scrollbarY, ':focus');
|
598
|
-
};
|
599
|
-
function shouldPreventDefault(deltaX, deltaY) {
|
600
|
-
var scrollTop = Math.floor(element.scrollTop);
|
601
|
-
if (deltaX === 0) {
|
602
|
-
if (!i.scrollbarYActive) {
|
603
|
-
return false;
|
604
|
-
}
|
605
|
-
if (scrollTop === 0 && deltaY > 0 || scrollTop >= i.contentHeight - i.containerHeight && deltaY < 0) {
|
606
|
-
return !i.settings.wheelPropagation;
|
607
|
-
}
|
608
|
-
}
|
609
|
-
var scrollLeft = element.scrollLeft;
|
610
|
-
if (deltaY === 0) {
|
611
|
-
if (!i.scrollbarXActive) {
|
612
|
-
return false;
|
613
|
-
}
|
614
|
-
if (scrollLeft === 0 && deltaX < 0 || scrollLeft >= i.contentWidth - i.containerWidth && deltaX > 0) {
|
615
|
-
return !i.settings.wheelPropagation;
|
616
|
-
}
|
617
|
-
}
|
618
|
-
return true;
|
619
|
-
}
|
620
|
-
function getPageHeight() {
|
621
|
-
if (element.isVirtualElement) {
|
622
|
-
return i.containerHeight / i.element.scrollHeight * i.containerHeight;
|
623
|
-
}
|
624
|
-
return i.containerHeight;
|
625
|
-
}
|
626
|
-
function getContentHeight() {
|
627
|
-
if (element.isVirtualElement) {
|
628
|
-
return i.containerHeight;
|
629
|
-
}
|
630
|
-
return i.contentHeight;
|
631
|
-
}
|
632
|
-
i.event.bind(i.ownerDocument, 'keydown', function (e) {
|
633
|
-
var _e$isDefaultPrevented;
|
634
|
-
var step = 30;
|
635
|
-
if ((_e$isDefaultPrevented = e.isDefaultPrevented) !== null && _e$isDefaultPrevented !== void 0 && _e$isDefaultPrevented.call(e) || e.defaultPrevented) {
|
636
|
-
return;
|
637
|
-
}
|
638
|
-
if (!elementHovered() && !scrollbarFocused()) {
|
639
|
-
return;
|
640
|
-
}
|
641
|
-
var activeElement = document.activeElement ? document.activeElement : i.ownerDocument.activeElement;
|
642
|
-
if (activeElement) {
|
643
|
-
if (activeElement.tagName === 'IFRAME') {
|
644
|
-
// @ts-ignore
|
645
|
-
activeElement = activeElement.contentDocument.activeElement;
|
646
|
-
} else {
|
647
|
-
// go deeper if element is a webcomponent
|
648
|
-
while (activeElement.shadowRoot) {
|
649
|
-
activeElement = activeElement.shadowRoot.activeElement;
|
650
|
-
}
|
651
|
-
}
|
652
|
-
if (isEditable(activeElement)) {
|
653
|
-
return;
|
654
|
-
}
|
655
|
-
}
|
656
|
-
var deltaX = 0;
|
657
|
-
var deltaY = 0;
|
658
|
-
switch (e.which) {
|
659
|
-
case 37:
|
660
|
-
// left
|
661
|
-
if (e.metaKey) {
|
662
|
-
deltaX = -i.contentWidth;
|
663
|
-
} else if (e.altKey) {
|
664
|
-
deltaX = -i.containerWidth;
|
665
|
-
} else {
|
666
|
-
deltaX = -step;
|
667
|
-
}
|
668
|
-
break;
|
669
|
-
case 38:
|
670
|
-
// up
|
671
|
-
if (e.metaKey) {
|
672
|
-
deltaY = getContentHeight();
|
673
|
-
} else if (e.altKey) {
|
674
|
-
deltaY = getPageHeight();
|
675
|
-
} else {
|
676
|
-
deltaY = step;
|
677
|
-
}
|
678
|
-
break;
|
679
|
-
case 39:
|
680
|
-
// right
|
681
|
-
if (e.metaKey) {
|
682
|
-
deltaX = i.contentWidth;
|
683
|
-
} else if (e.altKey) {
|
684
|
-
deltaX = i.containerWidth;
|
685
|
-
} else {
|
686
|
-
deltaX = step;
|
687
|
-
}
|
688
|
-
break;
|
689
|
-
case 40:
|
690
|
-
// down
|
691
|
-
if (e.metaKey) {
|
692
|
-
deltaY = -getContentHeight();
|
693
|
-
} else if (e.altKey) {
|
694
|
-
deltaY = -getPageHeight();
|
695
|
-
} else {
|
696
|
-
deltaY = -step;
|
697
|
-
}
|
698
|
-
break;
|
699
|
-
case 32:
|
700
|
-
// space bar
|
701
|
-
if (e.shiftKey) {
|
702
|
-
deltaY = getPageHeight();
|
703
|
-
} else {
|
704
|
-
deltaY = -getPageHeight();
|
705
|
-
}
|
706
|
-
break;
|
707
|
-
case 33:
|
708
|
-
// page up
|
709
|
-
deltaY = getPageHeight();
|
710
|
-
break;
|
711
|
-
case 34:
|
712
|
-
// page down
|
713
|
-
deltaY = -getPageHeight();
|
714
|
-
break;
|
715
|
-
case 36:
|
716
|
-
// home
|
717
|
-
deltaY = getContentHeight();
|
718
|
-
break;
|
719
|
-
case 35:
|
720
|
-
// end
|
721
|
-
deltaY = -getContentHeight();
|
722
|
-
break;
|
723
|
-
default:
|
724
|
-
return;
|
725
|
-
}
|
726
|
-
if (i.settings.suppressScrollX && deltaX !== 0) {
|
727
|
-
return;
|
728
|
-
}
|
729
|
-
if (i.settings.suppressScrollY && deltaY !== 0) {
|
730
|
-
return;
|
731
|
-
}
|
732
|
-
element.scrollTop -= deltaY;
|
733
|
-
element.scrollLeft += deltaX;
|
734
|
-
update_geometry(i);
|
735
|
-
if (shouldPreventDefault(deltaX, deltaY)) {
|
736
|
-
e.preventDefault();
|
737
|
-
}
|
738
|
-
});
|
739
|
-
}
|
740
|
-
;// CONCATENATED MODULE: ../../packages/scrollbar/src/handlers/mouse-wheel.ts
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
/* harmony default export */ function mouse_wheel(i) {
|
746
|
-
var isVirtualElement = i.element.isVirtualElement;
|
747
|
-
var element = isVirtualElement ? i.element.delegateElement : i.element;
|
748
|
-
function shouldPreventDefault(deltaX, deltaY) {
|
749
|
-
var scrollTopValue = isVirtualElement ? i.element.virtualScrollTop : element.scrollTop;
|
750
|
-
var roundedScrollTop = Math.floor(scrollTopValue);
|
751
|
-
var isTop = scrollTopValue === 0;
|
752
|
-
var isBottom = function isBottom() {
|
753
|
-
if (isVirtualElement) {
|
754
|
-
return roundedScrollTop + i.scrollbarYHeight >= i.railYHeight;
|
755
|
-
}
|
756
|
-
return roundedScrollTop + i.element.offsetHeight === i.element.scrollHeight;
|
757
|
-
};
|
758
|
-
var isLeft = element.scrollLeft === 0;
|
759
|
-
var isRight = element.scrollLeft + element.offsetWidth === element.scrollWidth;
|
760
|
-
var hitsBound;
|
761
|
-
// pick axis with primary direction
|
762
|
-
if (Math.abs(deltaY) > Math.abs(deltaX)) {
|
763
|
-
hitsBound = isTop || isBottom();
|
764
|
-
} else {
|
765
|
-
hitsBound = isLeft || isRight;
|
766
|
-
}
|
767
|
-
return hitsBound ? !i.settings.wheelPropagation : true;
|
768
|
-
}
|
769
|
-
function getDeltaFromEvent(e) {
|
770
|
-
var deltaX = e.deltaX;
|
771
|
-
var deltaY = -1 * e.deltaY;
|
772
|
-
if (typeof deltaX === 'undefined' || typeof deltaY === 'undefined') {
|
773
|
-
// OS X Safari
|
774
|
-
deltaX = -1 * e.wheelDeltaX / 6;
|
775
|
-
deltaY = e.wheelDeltaY / 6;
|
776
|
-
}
|
777
|
-
if (e.deltaMode && e.deltaMode === 1) {
|
778
|
-
// Firefox in deltaMode 1: Line scrolling
|
779
|
-
deltaX *= 10;
|
780
|
-
deltaY *= 10;
|
781
|
-
}
|
782
|
-
if (deltaX !== deltaX && deltaY !== deltaY /* NaN checks */) {
|
783
|
-
// IE in some mouse drivers
|
784
|
-
deltaX = 0;
|
785
|
-
deltaY = e.wheelDelta;
|
786
|
-
}
|
787
|
-
if (e.shiftKey) {
|
788
|
-
// reverse axis with shift key
|
789
|
-
return [-deltaY, -deltaX];
|
790
|
-
}
|
791
|
-
return [deltaX, deltaY];
|
792
|
-
}
|
793
|
-
function shouldBeConsumedByChild(target, deltaX, deltaY) {
|
794
|
-
// FIXME: this is a workaround for <select> issue in FF and IE #571
|
795
|
-
if (!env.isWebKit && element.querySelector('select:focus')) {
|
796
|
-
return true;
|
797
|
-
}
|
798
|
-
if (!element.contains(target)) {
|
799
|
-
return false;
|
800
|
-
}
|
801
|
-
var cursor = target;
|
802
|
-
while (cursor && cursor !== element) {
|
803
|
-
if (cursor.classList.contains(i.cls.element.consuming)) {
|
804
|
-
return true;
|
805
|
-
}
|
806
|
-
var style = get(cursor);
|
807
|
-
// if deltaY && vertical scrollable
|
808
|
-
if (deltaY && style.overflowY.match(/(scroll|auto)/)) {
|
809
|
-
var maxScrollTop = cursor.scrollHeight - cursor.clientHeight;
|
810
|
-
if (maxScrollTop > 0) {
|
811
|
-
if (cursor.scrollTop > 0 && deltaY < 0 || cursor.scrollTop < maxScrollTop && deltaY > 0) {
|
812
|
-
return true;
|
813
|
-
}
|
814
|
-
}
|
815
|
-
}
|
816
|
-
// if deltaX && horizontal scrollable
|
817
|
-
if (deltaX && style.overflowX.match(/(scroll|auto)/)) {
|
818
|
-
var maxScrollLeft = cursor.scrollWidth - cursor.clientWidth;
|
819
|
-
if (maxScrollLeft > 0) {
|
820
|
-
if (cursor.scrollLeft > 0 && deltaX < 0 || cursor.scrollLeft < maxScrollLeft && deltaX > 0) {
|
821
|
-
return true;
|
822
|
-
}
|
823
|
-
}
|
824
|
-
}
|
825
|
-
cursor = cursor.parentNode;
|
826
|
-
}
|
827
|
-
return false;
|
828
|
-
}
|
829
|
-
var getMaxValue = function getMaxValue() {
|
830
|
-
return i.element.scrollHeight - i.element.offsetHeight;
|
831
|
-
};
|
832
|
-
function setScrollTop(diff) {
|
833
|
-
var newValue = i.element.scrollTop - diff;
|
834
|
-
var maxValue = getMaxValue();
|
835
|
-
if (newValue > maxValue) {
|
836
|
-
newValue = maxValue;
|
837
|
-
}
|
838
|
-
if (newValue < 0) {
|
839
|
-
newValue = 0;
|
840
|
-
}
|
841
|
-
i.element.scrollTop = newValue;
|
842
|
-
}
|
843
|
-
function mousewheelHandler(e) {
|
844
|
-
var _getDeltaFromEvent = getDeltaFromEvent(e),
|
845
|
-
_getDeltaFromEvent2 = _slicedToArray(_getDeltaFromEvent, 2),
|
846
|
-
deltaX = _getDeltaFromEvent2[0],
|
847
|
-
deltaY = _getDeltaFromEvent2[1];
|
848
|
-
if (shouldBeConsumedByChild(e.target, deltaX, deltaY)) {
|
849
|
-
return;
|
850
|
-
}
|
851
|
-
var shouldPrevent = false;
|
852
|
-
if (!i.settings.useBothWheelAxes) {
|
853
|
-
// deltaX will only be used for horizontal scrolling and deltaY will
|
854
|
-
// only be used for vertical scrolling - this is the default
|
855
|
-
setScrollTop(deltaY * i.settings.wheelSpeed);
|
856
|
-
element.scrollLeft += deltaX * i.settings.wheelSpeed;
|
857
|
-
} else if (i.scrollbarYActive && !i.scrollbarXActive) {
|
858
|
-
// only vertical scrollbar is active and useBothWheelAxes option is
|
859
|
-
// active, so let's scroll vertical bar using both mouse wheel axes
|
860
|
-
if (deltaY) {
|
861
|
-
setScrollTop(deltaY * i.settings.wheelSpeed);
|
862
|
-
} else {
|
863
|
-
setScrollTop(-deltaX * i.settings.wheelSpeed);
|
864
|
-
}
|
865
|
-
shouldPrevent = true;
|
866
|
-
} else if (i.scrollbarXActive && !i.scrollbarYActive) {
|
867
|
-
// useBothWheelAxes and only horizontal bar is active, so use both
|
868
|
-
// wheel axes for horizontal bar
|
869
|
-
if (deltaX) {
|
870
|
-
element.scrollLeft += deltaX * i.settings.wheelSpeed;
|
871
|
-
} else {
|
872
|
-
element.scrollLeft -= deltaY * i.settings.wheelSpeed;
|
873
|
-
}
|
874
|
-
shouldPrevent = true;
|
875
|
-
}
|
876
|
-
update_geometry(i);
|
877
|
-
shouldPrevent = shouldPrevent || shouldPreventDefault(deltaX, deltaY);
|
878
|
-
if (shouldPrevent && !e.ctrlKey) {
|
879
|
-
e.stopPropagation();
|
880
|
-
e.preventDefault();
|
881
|
-
}
|
882
|
-
}
|
883
|
-
if (typeof window.onwheel !== 'undefined') {
|
884
|
-
i.event.bind(element, 'wheel', mousewheelHandler);
|
885
|
-
// @ts-ignore
|
886
|
-
} else if (typeof window.onmousewheel !== 'undefined') {
|
887
|
-
i.event.bind(element, 'mousewheel', mousewheelHandler);
|
888
|
-
}
|
889
|
-
}
|
890
|
-
;// CONCATENATED MODULE: ../../packages/scrollbar/src/handlers/touch.ts
|
891
|
-
|
892
|
-
|
893
|
-
|
894
|
-
/* harmony default export */ function touch(i) {
|
895
|
-
if (!env.supportsTouch && !env.supportsIePointer) {
|
896
|
-
return;
|
897
|
-
}
|
898
|
-
var element = i.element;
|
899
|
-
function shouldPrevent(deltaX, deltaY) {
|
900
|
-
var scrollTop = Math.floor(element.scrollTop);
|
901
|
-
var scrollLeft = element.scrollLeft;
|
902
|
-
var magnitudeX = Math.abs(deltaX);
|
903
|
-
var magnitudeY = Math.abs(deltaY);
|
904
|
-
if (magnitudeY > magnitudeX) {
|
905
|
-
// user is perhaps trying to swipe up/down the page
|
906
|
-
if (deltaY < 0 && scrollTop === i.contentHeight - i.containerHeight || deltaY > 0 && scrollTop === 0) {
|
907
|
-
// set prevent for mobile Chrome refresh
|
908
|
-
return window.scrollY === 0 && deltaY > 0 && env.isChrome;
|
909
|
-
}
|
910
|
-
} else if (magnitudeX > magnitudeY) {
|
911
|
-
// user is perhaps trying to swipe left/right across the page
|
912
|
-
if (deltaX < 0 && scrollLeft === i.contentWidth - i.containerWidth || deltaX > 0 && scrollLeft === 0) {
|
913
|
-
return true;
|
914
|
-
}
|
915
|
-
}
|
916
|
-
return true;
|
917
|
-
}
|
918
|
-
function applyTouchMove(differenceX, differenceY) {
|
919
|
-
element.scrollLeft -= differenceX;
|
920
|
-
element.scrollTop -= differenceY;
|
921
|
-
update_geometry(i);
|
922
|
-
}
|
923
|
-
var startOffset = {};
|
924
|
-
var startTime = 0;
|
925
|
-
var speed = {};
|
926
|
-
var easingLoop = null;
|
927
|
-
function getTouch(e) {
|
928
|
-
if (e.targetTouches) {
|
929
|
-
return e.targetTouches[0];
|
930
|
-
} else {
|
931
|
-
// Maybe IE pointer
|
932
|
-
return e;
|
933
|
-
}
|
934
|
-
}
|
935
|
-
function shouldHandle(e) {
|
936
|
-
if (e.pointerType && e.pointerType === 'pen' && e.buttons === 0) {
|
937
|
-
return false;
|
938
|
-
}
|
939
|
-
if (e.targetTouches && e.targetTouches.length === 1) {
|
940
|
-
return true;
|
941
|
-
}
|
942
|
-
if (e.pointerType && e.pointerType !== 'mouse' && e.pointerType !== e.MSPOINTER_TYPE_MOUSE) {
|
943
|
-
return true;
|
944
|
-
}
|
945
|
-
return false;
|
946
|
-
}
|
947
|
-
function touchStart(e) {
|
948
|
-
if (!shouldHandle(e)) {
|
949
|
-
return;
|
950
|
-
}
|
951
|
-
var touch = getTouch(e);
|
952
|
-
startOffset.pageX = touch.pageX;
|
953
|
-
startOffset.pageY = touch.pageY;
|
954
|
-
startTime = new Date().getTime();
|
955
|
-
if (easingLoop !== null) {
|
956
|
-
clearInterval(easingLoop);
|
957
|
-
}
|
958
|
-
}
|
959
|
-
function shouldBeConsumedByChild(target, deltaX, deltaY) {
|
960
|
-
if (!element.contains(target)) {
|
961
|
-
return false;
|
962
|
-
}
|
963
|
-
var cursor = target;
|
964
|
-
while (cursor && cursor !== element) {
|
965
|
-
if (cursor.classList.contains(i.cls.element.consuming)) {
|
966
|
-
return true;
|
967
|
-
}
|
968
|
-
var style = get(cursor);
|
969
|
-
// if deltaY && vertical scrollable
|
970
|
-
if (deltaY && style.overflowY.match(/(scroll|auto)/)) {
|
971
|
-
var maxScrollTop = cursor.scrollHeight - cursor.clientHeight;
|
972
|
-
if (maxScrollTop > 0) {
|
973
|
-
if (cursor.scrollTop > 0 && deltaY < 0 || cursor.scrollTop < maxScrollTop && deltaY > 0) {
|
974
|
-
return true;
|
975
|
-
}
|
976
|
-
}
|
977
|
-
}
|
978
|
-
// if deltaX && horizontal scrollable
|
979
|
-
if (deltaX && style.overflowX.match(/(scroll|auto)/)) {
|
980
|
-
var maxScrollLeft = cursor.scrollWidth - cursor.clientWidth;
|
981
|
-
if (maxScrollLeft > 0) {
|
982
|
-
if (cursor.scrollLeft > 0 && deltaX < 0 || cursor.scrollLeft < maxScrollLeft && deltaX > 0) {
|
983
|
-
return true;
|
984
|
-
}
|
985
|
-
}
|
986
|
-
}
|
987
|
-
cursor = cursor.parentNode;
|
988
|
-
}
|
989
|
-
return false;
|
990
|
-
}
|
991
|
-
function touchMove(e) {
|
992
|
-
if (shouldHandle(e)) {
|
993
|
-
var touch = getTouch(e);
|
994
|
-
var currentOffset = {
|
995
|
-
pageX: touch.pageX,
|
996
|
-
pageY: touch.pageY
|
997
|
-
};
|
998
|
-
var differenceX = currentOffset.pageX - startOffset.pageX;
|
999
|
-
var differenceY = currentOffset.pageY - startOffset.pageY;
|
1000
|
-
if (shouldBeConsumedByChild(e.target, differenceX, differenceY)) {
|
1001
|
-
return;
|
1002
|
-
}
|
1003
|
-
applyTouchMove(differenceX, differenceY);
|
1004
|
-
startOffset = currentOffset;
|
1005
|
-
var currentTime = new Date().getTime();
|
1006
|
-
var timeGap = currentTime - startTime;
|
1007
|
-
if (timeGap > 0) {
|
1008
|
-
speed.x = differenceX / timeGap;
|
1009
|
-
speed.y = differenceY / timeGap;
|
1010
|
-
startTime = currentTime;
|
1011
|
-
}
|
1012
|
-
if (shouldPrevent(differenceX, differenceY)) {
|
1013
|
-
e.preventDefault();
|
1014
|
-
}
|
1015
|
-
}
|
1016
|
-
}
|
1017
|
-
function touchEnd() {
|
1018
|
-
if (i.settings.swipeEasing) {
|
1019
|
-
clearInterval(easingLoop);
|
1020
|
-
easingLoop = setInterval(function () {
|
1021
|
-
if (i.isInitialized) {
|
1022
|
-
clearInterval(easingLoop);
|
1023
|
-
return;
|
1024
|
-
}
|
1025
|
-
if (!speed.x && !speed.y) {
|
1026
|
-
clearInterval(easingLoop);
|
1027
|
-
return;
|
1028
|
-
}
|
1029
|
-
if (Math.abs(speed.x) < 0.01 && Math.abs(speed.y) < 0.01) {
|
1030
|
-
clearInterval(easingLoop);
|
1031
|
-
return;
|
1032
|
-
}
|
1033
|
-
if (!i.element) {
|
1034
|
-
clearInterval(easingLoop);
|
1035
|
-
return;
|
1036
|
-
}
|
1037
|
-
applyTouchMove(speed.x * 30, speed.y * 30);
|
1038
|
-
speed.x *= 0.8;
|
1039
|
-
speed.y *= 0.8;
|
1040
|
-
}, 10);
|
1041
|
-
}
|
1042
|
-
}
|
1043
|
-
if (env.supportsTouch) {
|
1044
|
-
i.event.bind(element, 'touchstart', touchStart);
|
1045
|
-
i.event.bind(element, 'touchmove', touchMove);
|
1046
|
-
i.event.bind(element, 'touchend', touchEnd);
|
1047
|
-
} else if (env.supportsIePointer) {
|
1048
|
-
if (window.PointerEvent) {
|
1049
|
-
i.event.bind(element, 'pointerdown', touchStart);
|
1050
|
-
i.event.bind(element, 'pointermove', touchMove);
|
1051
|
-
i.event.bind(element, 'pointerup', touchEnd);
|
1052
|
-
// @ts-ignore
|
1053
|
-
} else if (window.MSPointerEvent) {
|
1054
|
-
i.event.bind(element, 'MSPointerDown', touchStart);
|
1055
|
-
i.event.bind(element, 'MSPointerMove', touchMove);
|
1056
|
-
i.event.bind(element, 'MSPointerUp', touchEnd);
|
1057
|
-
}
|
1058
|
-
}
|
1059
|
-
}
|
1060
|
-
;// CONCATENATED MODULE: ../../packages/scrollbar/src/helper/event-manager.ts
|
1061
|
-
|
1062
|
-
|
1063
|
-
/*
|
1064
|
-
* Tencent is pleased to support the open source community by making
|
1065
|
-
* 蓝鲸智云PaaS平台 (BlueKing PaaS) available.
|
1066
|
-
*
|
1067
|
-
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
1068
|
-
*
|
1069
|
-
* 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.
|
1070
|
-
*
|
1071
|
-
* License for 蓝鲸智云PaaS平台 (BlueKing PaaS):
|
1072
|
-
*
|
1073
|
-
* ---------------------------------------------------
|
1074
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
1075
|
-
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
1076
|
-
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
1077
|
-
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
1078
|
-
*
|
1079
|
-
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
1080
|
-
* the Software.
|
1081
|
-
*
|
1082
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
1083
|
-
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
1084
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
1085
|
-
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
1086
|
-
* IN THE SOFTWARE.
|
1087
|
-
*/
|
1088
|
-
var EventElement = /*#__PURE__*/function () {
|
1089
|
-
function EventElement(element) {
|
1090
|
-
_classCallCheck(this, EventElement);
|
1091
|
-
this.element = element;
|
1092
|
-
this.handlers = {};
|
1093
|
-
}
|
1094
|
-
_createClass(EventElement, [{
|
1095
|
-
key: "bind",
|
1096
|
-
value: function bind(eventName, handler) {
|
1097
|
-
if (typeof this.handlers[eventName] === 'undefined') {
|
1098
|
-
this.handlers[eventName] = [];
|
1099
|
-
}
|
1100
|
-
this.handlers[eventName].push(handler);
|
1101
|
-
this.element.addEventListener(eventName, handler, false);
|
1102
|
-
}
|
1103
|
-
}, {
|
1104
|
-
key: "unbind",
|
1105
|
-
value: function unbind(eventName, target) {
|
1106
|
-
var _this = this;
|
1107
|
-
this.handlers[eventName] = this.handlers[eventName].filter(function (handler) {
|
1108
|
-
if (target && handler !== target) {
|
1109
|
-
return true;
|
1110
|
-
}
|
1111
|
-
_this.element.removeEventListener(eventName, handler, false);
|
1112
|
-
return false;
|
1113
|
-
});
|
1114
|
-
}
|
1115
|
-
}, {
|
1116
|
-
key: "unbindAll",
|
1117
|
-
value: function unbindAll() {
|
1118
|
-
for (var name in this.handlers) {
|
1119
|
-
this.unbind(name);
|
1120
|
-
}
|
1121
|
-
}
|
1122
|
-
}, {
|
1123
|
-
key: "isEmpty",
|
1124
|
-
get: function get() {
|
1125
|
-
var _this2 = this;
|
1126
|
-
return Object.keys(this.handlers).every(function (key) {
|
1127
|
-
return _this2.handlers[key].length === 0;
|
1128
|
-
});
|
1129
|
-
}
|
1130
|
-
}]);
|
1131
|
-
return EventElement;
|
1132
|
-
}();
|
1133
|
-
var EventManager = /*#__PURE__*/function () {
|
1134
|
-
function EventManager() {
|
1135
|
-
_classCallCheck(this, EventManager);
|
1136
|
-
this.eventElements = [];
|
1137
|
-
}
|
1138
|
-
_createClass(EventManager, [{
|
1139
|
-
key: "eventElement",
|
1140
|
-
value: function eventElement(element) {
|
1141
|
-
var ee = this.eventElements.filter(function (ee) {
|
1142
|
-
return ee.element === element;
|
1143
|
-
})[0];
|
1144
|
-
if (!ee) {
|
1145
|
-
ee = new EventElement(element);
|
1146
|
-
this.eventElements.push(ee);
|
1147
|
-
}
|
1148
|
-
return ee;
|
1149
|
-
}
|
1150
|
-
}, {
|
1151
|
-
key: "bind",
|
1152
|
-
value: function bind(element, eventName, handler) {
|
1153
|
-
this.eventElement(element).bind(eventName, handler);
|
1154
|
-
}
|
1155
|
-
}, {
|
1156
|
-
key: "unbind",
|
1157
|
-
value: function unbind(element, eventName, handler) {
|
1158
|
-
var ee = this.eventElement(element);
|
1159
|
-
ee.unbind(eventName, handler);
|
1160
|
-
if (ee.isEmpty) {
|
1161
|
-
// remove
|
1162
|
-
this.eventElements.splice(this.eventElements.indexOf(ee), 1);
|
1163
|
-
}
|
1164
|
-
}
|
1165
|
-
}, {
|
1166
|
-
key: "unbindAll",
|
1167
|
-
value: function unbindAll() {
|
1168
|
-
this.eventElements.forEach(function (e) {
|
1169
|
-
return e.unbindAll();
|
1170
|
-
});
|
1171
|
-
this.eventElements = [];
|
1172
|
-
}
|
1173
|
-
}, {
|
1174
|
-
key: "once",
|
1175
|
-
value: function once(element, eventName, handler) {
|
1176
|
-
var ee = this.eventElement(element);
|
1177
|
-
var onceHandler = function onceHandler(evt) {
|
1178
|
-
ee.unbind(eventName, onceHandler);
|
1179
|
-
handler(evt);
|
1180
|
-
};
|
1181
|
-
ee.bind(eventName, onceHandler);
|
1182
|
-
}
|
1183
|
-
}]);
|
1184
|
-
return EventManager;
|
1185
|
-
}();
|
1186
|
-
|
1187
|
-
;// CONCATENATED MODULE: ../../packages/scrollbar/src/process-scroll-diff.ts
|
1188
|
-
|
1189
|
-
/*
|
1190
|
-
* Tencent is pleased to support the open source community by making
|
1191
|
-
* 蓝鲸智云PaaS平台 (BlueKing PaaS) available.
|
1192
|
-
*
|
1193
|
-
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
1194
|
-
*
|
1195
|
-
* 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.
|
1196
|
-
*
|
1197
|
-
* License for 蓝鲸智云PaaS平台 (BlueKing PaaS):
|
1198
|
-
*
|
1199
|
-
* ---------------------------------------------------
|
1200
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
1201
|
-
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
1202
|
-
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
1203
|
-
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
1204
|
-
*
|
1205
|
-
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
1206
|
-
* the Software.
|
1207
|
-
*
|
1208
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
1209
|
-
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
1210
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
1211
|
-
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
1212
|
-
* IN THE SOFTWARE.
|
1213
|
-
*/
|
1214
|
-
|
1215
|
-
function createEvent(name) {
|
1216
|
-
if (typeof window.CustomEvent === 'function') {
|
1217
|
-
return new CustomEvent(name);
|
1218
|
-
} else {
|
1219
|
-
var evt = document.createEvent('CustomEvent');
|
1220
|
-
evt.initCustomEvent(name, false, false, undefined);
|
1221
|
-
return evt;
|
1222
|
-
}
|
1223
|
-
}
|
1224
|
-
/* harmony default export */ function process_scroll_diff(i, axis, diff) {
|
1225
|
-
var useScrollingClass = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
1226
|
-
var forceFireReachEvent = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
1227
|
-
var fields;
|
1228
|
-
if (axis === 'top') {
|
1229
|
-
fields = ['contentHeight', 'containerHeight', 'scrollTop', 'y', 'up', 'down'];
|
1230
|
-
} else if (axis === 'left') {
|
1231
|
-
fields = ['contentWidth', 'containerWidth', 'scrollLeft', 'x', 'left', 'right'];
|
1232
|
-
} else {
|
1233
|
-
throw new Error('A proper axis should be provided');
|
1234
|
-
}
|
1235
|
-
processScrollDiff(i, diff, fields, useScrollingClass, forceFireReachEvent);
|
1236
|
-
}
|
1237
|
-
function processScrollDiff(i, diff, _ref) {
|
1238
|
-
var _ref2 = _slicedToArray(_ref, 6),
|
1239
|
-
contentHeight = _ref2[0],
|
1240
|
-
containerHeight = _ref2[1],
|
1241
|
-
scrollTop = _ref2[2],
|
1242
|
-
y = _ref2[3],
|
1243
|
-
up = _ref2[4],
|
1244
|
-
down = _ref2[5];
|
1245
|
-
var useScrollingClass = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
1246
|
-
var forceFireReachEvent = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
1247
|
-
var element = i.element;
|
1248
|
-
// reset reach
|
1249
|
-
i.reach[y] = null;
|
1250
|
-
// 1 for subpixel rounding
|
1251
|
-
if (element[scrollTop] < 1) {
|
1252
|
-
i.reach[y] = 'start';
|
1253
|
-
}
|
1254
|
-
// 1 for subpixel rounding
|
1255
|
-
if (element[scrollTop] > i[contentHeight] - i[containerHeight] - 1) {
|
1256
|
-
i.reach[y] = 'end';
|
1257
|
-
}
|
1258
|
-
if (diff) {
|
1259
|
-
element.dispatchEvent(createEvent("ps-scroll-".concat(y)));
|
1260
|
-
if (diff < 0) {
|
1261
|
-
element.dispatchEvent(createEvent("ps-scroll-".concat(up)));
|
1262
|
-
} else if (diff > 0) {
|
1263
|
-
element.dispatchEvent(createEvent("ps-scroll-".concat(down)));
|
1264
|
-
}
|
1265
|
-
if (useScrollingClass) {
|
1266
|
-
setScrollingClassInstantly(i, y);
|
1267
|
-
}
|
1268
|
-
}
|
1269
|
-
if (i.reach[y] && (diff || forceFireReachEvent)) {
|
1270
|
-
element.dispatchEvent(createEvent("ps-".concat(y, "-reach-").concat(i.reach[y])));
|
1271
|
-
}
|
1272
|
-
}
|
1273
|
-
;// CONCATENATED MODULE: ../../packages/scrollbar/src/index.ts
|
1274
|
-
|
1275
|
-
|
1276
|
-
|
1277
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
1278
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
1279
|
-
/*
|
1280
|
-
* Tencent is pleased to support the open source community by making
|
1281
|
-
* 蓝鲸智云PaaS平台 (BlueKing PaaS) available.
|
1282
|
-
*
|
1283
|
-
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
1284
|
-
*
|
1285
|
-
* 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.
|
1286
|
-
*
|
1287
|
-
* License for 蓝鲸智云PaaS平台 (BlueKing PaaS):
|
1288
|
-
*
|
1289
|
-
* ---------------------------------------------------
|
1290
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
1291
|
-
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
1292
|
-
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
1293
|
-
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
1294
|
-
*
|
1295
|
-
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
1296
|
-
* the Software.
|
1297
|
-
*
|
1298
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
1299
|
-
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
1300
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
1301
|
-
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
1302
|
-
* IN THE SOFTWARE.
|
1303
|
-
*/
|
1304
|
-
|
1305
|
-
|
1306
|
-
|
1307
|
-
|
1308
|
-
|
1309
|
-
|
1310
|
-
|
1311
|
-
|
1312
|
-
|
1313
|
-
|
1314
|
-
|
1315
|
-
|
1316
|
-
var IScrollbarSize;
|
1317
|
-
(function (IScrollbarSize) {
|
1318
|
-
IScrollbarSize["Large"] = "large";
|
1319
|
-
IScrollbarSize["Normal"] = "normal";
|
1320
|
-
IScrollbarSize["Small"] = "small";
|
1321
|
-
})(IScrollbarSize || (IScrollbarSize = {}));
|
1322
|
-
// 默认配置
|
1323
|
-
var defaultSettings = function defaultSettings() {
|
1324
|
-
return {
|
1325
|
-
handlers: ['click-rail', 'drag-thumb', 'keyboard', 'wheel', 'touch'],
|
1326
|
-
maxScrollbarLength: null,
|
1327
|
-
minScrollbarLength: 16,
|
1328
|
-
scrollingThreshold: 1000,
|
1329
|
-
scrollXMarginOffset: 0,
|
1330
|
-
scrollYMarginOffset: 0,
|
1331
|
-
suppressScrollX: false,
|
1332
|
-
suppressScrollY: false,
|
1333
|
-
swipeEasing: true,
|
1334
|
-
useBothWheelAxes: false,
|
1335
|
-
wheelPropagation: true,
|
1336
|
-
wheelSpeed: 1,
|
1337
|
-
classPrefix: 'bk',
|
1338
|
-
scrollSize: IScrollbarSize.Normal
|
1339
|
-
};
|
1340
|
-
};
|
1341
|
-
// 处理器集合
|
1342
|
-
var handlers = {
|
1343
|
-
'click-rail': click_rail,
|
1344
|
-
'drag-thumb': drag_thumb,
|
1345
|
-
keyboard: keyboard,
|
1346
|
-
wheel: mouse_wheel,
|
1347
|
-
touch: touch
|
1348
|
-
};
|
1349
|
-
var VirtualElement = /*#__PURE__*/function () {
|
1350
|
-
function VirtualElement(_ref) {
|
1351
|
-
var _this = this;
|
1352
|
-
var scrollHeight = _ref.scrollHeight,
|
1353
|
-
delegateElement = _ref.delegateElement,
|
1354
|
-
onScollCallback = _ref.onScollCallback;
|
1355
|
-
_classCallCheck(this, VirtualElement);
|
1356
|
-
_defineProperty(this, "isVirtualElement", true);
|
1357
|
-
_defineProperty(this, "scrollTop", 0);
|
1358
|
-
this.scrollHeight = scrollHeight;
|
1359
|
-
this.delegateElement = delegateElement;
|
1360
|
-
this.virtualScrollTop = 0;
|
1361
|
-
this.virtualScrollLeft = 0;
|
1362
|
-
this.onScollCallback = onScollCallback;
|
1363
|
-
return new Proxy(this, {
|
1364
|
-
get: function get(target, prop, receiver) {
|
1365
|
-
if (prop in target) {
|
1366
|
-
var value = Reflect.get(target, prop, receiver);
|
1367
|
-
if (value !== undefined) {
|
1368
|
-
return value;
|
1369
|
-
}
|
1370
|
-
}
|
1371
|
-
if (delegateElement && prop in delegateElement) {
|
1372
|
-
var _value = delegateElement[prop];
|
1373
|
-
// Bind the method to delegateElement if it's a function
|
1374
|
-
if (typeof _value === 'function') {
|
1375
|
-
return _value.bind(delegateElement);
|
1376
|
-
}
|
1377
|
-
return _value;
|
1378
|
-
}
|
1379
|
-
return undefined;
|
1380
|
-
},
|
1381
|
-
set: function set(target, prop, value) {
|
1382
|
-
if (prop in target) {
|
1383
|
-
if (prop === 'scrollTop') {
|
1384
|
-
target.virtualScrollTop = value * target.delegateElement.offsetHeight / target.scrollHeight;
|
1385
|
-
var triggerCallbackFn = target.scrollTop !== value;
|
1386
|
-
target.scrollTop = value;
|
1387
|
-
if (triggerCallbackFn) {
|
1388
|
-
_this.handleScrollChanged('scrollTop');
|
1389
|
-
}
|
1390
|
-
return true;
|
1391
|
-
}
|
1392
|
-
target[prop] = value;
|
1393
|
-
return true;
|
1394
|
-
}
|
1395
|
-
if (delegateElement && prop in delegateElement) {
|
1396
|
-
delegateElement[prop] = value;
|
1397
|
-
_this.handleScrollChanged(prop);
|
1398
|
-
return true;
|
1399
|
-
}
|
1400
|
-
target[prop] = value;
|
1401
|
-
return true;
|
1402
|
-
}
|
1403
|
-
});
|
1404
|
-
}
|
1405
|
-
_createClass(VirtualElement, [{
|
1406
|
-
key: "handleScrollChanged",
|
1407
|
-
value: function handleScrollChanged(prop) {
|
1408
|
-
if (['scrollLeft', 'scrollTop'].includes(prop)) {
|
1409
|
-
var _this$onScollCallback;
|
1410
|
-
var args = {
|
1411
|
-
offset: {
|
1412
|
-
x: this.delegateElement.scrollLeft,
|
1413
|
-
y: this.scrollTop
|
1414
|
-
}
|
1415
|
-
};
|
1416
|
-
(_this$onScollCallback = this.onScollCallback) === null || _this$onScollCallback === void 0 || _this$onScollCallback.call(this, args);
|
1417
|
-
}
|
1418
|
-
}
|
1419
|
-
}, {
|
1420
|
-
key: "scrollTo",
|
1421
|
-
value: function scrollTo(_ref2) {
|
1422
|
-
var x = _ref2.x,
|
1423
|
-
y = _ref2.y;
|
1424
|
-
this.delegateElement.scrollLeft = x;
|
1425
|
-
this.scrollTop = y;
|
1426
|
-
this.delegateElement.scrollTo(x, y);
|
1427
|
-
}
|
1428
|
-
}]);
|
1429
|
-
return VirtualElement;
|
1430
|
-
}();
|
1431
|
-
// 自定义滚动条类
|
1432
|
-
var BkScrollbar = /*#__PURE__*/function () {
|
1433
|
-
/**
|
1434
|
-
* 构造函数
|
1435
|
-
* @param {Element | string} element - 滚动条元素或选择器字符串
|
1436
|
-
* @param {Partial<ISettingPropType>} userSettings - 用户配置
|
1437
|
-
*/
|
1438
|
-
function BkScrollbar(element) {
|
1439
|
-
var _element,
|
1440
|
-
_element2,
|
1441
|
-
_this2 = this,
|
1442
|
-
_this$contentWidth,
|
1443
|
-
_this$contentHeight;
|
1444
|
-
var userSettings = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
1445
|
-
_classCallCheck(this, BkScrollbar);
|
1446
|
-
if (typeof element === 'string') {
|
1447
|
-
element = document.querySelector(element);
|
1448
|
-
}
|
1449
|
-
if (!((_element = element) !== null && _element !== void 0 && _element.nodeName) && !((_element2 = element) !== null && _element2 !== void 0 && _element2.isVirtualElement)) {
|
1450
|
-
throw new Error('no element is specified to initialize PerfectScrollbar');
|
1451
|
-
}
|
1452
|
-
this.settings = _objectSpread(_objectSpread({}, defaultSettings()), userSettings);
|
1453
|
-
this.element = element;
|
1454
|
-
this.cls = new class_names(this.settings.classPrefix);
|
1455
|
-
element.classList.add(this.cls.main);
|
1456
|
-
this.containerWidth = null;
|
1457
|
-
this.containerHeight = null;
|
1458
|
-
this.contentWidth = null;
|
1459
|
-
this.contentHeight = null;
|
1460
|
-
var focus = function focus() {
|
1461
|
-
return element.classList.add(_this2.cls.state.focus);
|
1462
|
-
};
|
1463
|
-
var blur = function blur() {
|
1464
|
-
return element.classList.remove(_this2.cls.state.focus);
|
1465
|
-
};
|
1466
|
-
this.isRtl = get(element).direction === 'rtl';
|
1467
|
-
if (this.isRtl) {
|
1468
|
-
element.classList.add(this.cls.rtl);
|
1469
|
-
}
|
1470
|
-
this.isNegativeScroll = function () {
|
1471
|
-
var originalScrollLeft = element.scrollLeft;
|
1472
|
-
var result = null;
|
1473
|
-
element.scrollLeft = -1;
|
1474
|
-
result = element.scrollLeft < 0;
|
1475
|
-
element.scrollLeft = originalScrollLeft;
|
1476
|
-
return result;
|
1477
|
-
}();
|
1478
|
-
this.negativeScrollAdjustment = this.isNegativeScroll ? element.scrollWidth - element.clientWidth : 0;
|
1479
|
-
this.event = new EventManager();
|
1480
|
-
this.ownerDocument = element.ownerDocument || document;
|
1481
|
-
this.scrollbarXRail = div(this.cls.element.rail('x'));
|
1482
|
-
this.scrollbarXRail.classList.add(this.cls.element.size(this.settings.scrollSize));
|
1483
|
-
element.appendChild(this.scrollbarXRail);
|
1484
|
-
this.scrollbarX = div(this.cls.element.thumb('x'));
|
1485
|
-
this.scrollbarXRail.appendChild(this.scrollbarX);
|
1486
|
-
this.scrollbarX.setAttribute('tabindex', '0');
|
1487
|
-
this.event.bind(this.scrollbarX, 'focus', focus);
|
1488
|
-
this.event.bind(this.scrollbarX, 'blur', blur);
|
1489
|
-
this.scrollbarXActive = null;
|
1490
|
-
this.scrollbarXWidth = null;
|
1491
|
-
this.scrollbarXLeft = null;
|
1492
|
-
var railXStyle = get(this.scrollbarXRail);
|
1493
|
-
this.scrollbarXBottom = parseInt(railXStyle.bottom, 10);
|
1494
|
-
if (isNaN(this.scrollbarXBottom)) {
|
1495
|
-
this.isScrollbarXUsingBottom = false;
|
1496
|
-
this.scrollbarXTop = toInt(railXStyle.top);
|
1497
|
-
} else {
|
1498
|
-
this.isScrollbarXUsingBottom = true;
|
1499
|
-
}
|
1500
|
-
this.railBorderXWidth = toInt(railXStyle.borderLeftWidth) + toInt(railXStyle.borderRightWidth);
|
1501
|
-
set(this.scrollbarXRail, {
|
1502
|
-
display: 'block'
|
1503
|
-
});
|
1504
|
-
this.railXMarginWidth = toInt(railXStyle.marginLeft) + toInt(railXStyle.marginRight);
|
1505
|
-
set(this.scrollbarXRail, {
|
1506
|
-
display: ''
|
1507
|
-
});
|
1508
|
-
this.railXWidth = null;
|
1509
|
-
this.railXRatio = null;
|
1510
|
-
this.scrollbarYRail = div(this.cls.element.rail('y'));
|
1511
|
-
this.scrollbarYRail.classList.add(this.cls.element.size(this.settings.scrollSize));
|
1512
|
-
element.appendChild(this.scrollbarYRail);
|
1513
|
-
this.scrollbarY = div(this.cls.element.thumb('y'));
|
1514
|
-
this.scrollbarYRail.appendChild(this.scrollbarY);
|
1515
|
-
this.scrollbarY.setAttribute('tabindex', '0');
|
1516
|
-
this.event.bind(this.scrollbarY, 'focus', focus);
|
1517
|
-
this.event.bind(this.scrollbarY, 'blur', blur);
|
1518
|
-
this.scrollbarYActive = null;
|
1519
|
-
this.scrollbarYHeight = null;
|
1520
|
-
this.scrollbarYTop = null;
|
1521
|
-
var railYStyle = get(this.scrollbarYRail);
|
1522
|
-
this.scrollbarYRight = parseInt(railYStyle.right, 10);
|
1523
|
-
if (isNaN(this.scrollbarYRight)) {
|
1524
|
-
this.isScrollbarYUsingRight = false;
|
1525
|
-
this.scrollbarYLeft = toInt(railYStyle.left);
|
1526
|
-
} else {
|
1527
|
-
this.isScrollbarYUsingRight = true;
|
1528
|
-
}
|
1529
|
-
this.scrollbarYOuterWidth = this.isRtl ? util_outerWidth(this.scrollbarY) : null;
|
1530
|
-
this.railBorderYWidth = toInt(railYStyle.borderTopWidth) + toInt(railYStyle.borderBottomWidth);
|
1531
|
-
set(this.scrollbarYRail, {
|
1532
|
-
display: 'block'
|
1533
|
-
});
|
1534
|
-
this.railYMarginHeight = toInt(railYStyle.marginTop) + toInt(railYStyle.marginBottom);
|
1535
|
-
set(this.scrollbarYRail, {
|
1536
|
-
display: ''
|
1537
|
-
});
|
1538
|
-
this.railYHeight = null;
|
1539
|
-
this.railYRatio = null;
|
1540
|
-
this.reach = {
|
1541
|
-
x: element.scrollLeft <= 0 ? 'start' : element.scrollLeft >= ((_this$contentWidth = this.contentWidth) !== null && _this$contentWidth !== void 0 ? _this$contentWidth : 0) - this.containerWidth ? 'end' : null,
|
1542
|
-
y: element.scrollTop <= 0 ? 'start' : element.scrollTop >= ((_this$contentHeight = this.contentHeight) !== null && _this$contentHeight !== void 0 ? _this$contentHeight : 0) - this.containerHeight ? 'end' : null
|
1543
|
-
};
|
1544
|
-
this.isAlive = true;
|
1545
|
-
this.settings.handlers.forEach(function (handlerName) {
|
1546
|
-
return handlers[handlerName](_this2);
|
1547
|
-
});
|
1548
|
-
this.lastScrollTop = Math.floor(element.scrollTop);
|
1549
|
-
this.lastScrollLeft = element.scrollLeft;
|
1550
|
-
this.event.bind(this.element, 'scroll', function (e) {
|
1551
|
-
return _this2.onScroll(e);
|
1552
|
-
});
|
1553
|
-
update_geometry(this);
|
1554
|
-
}
|
1555
|
-
/**
|
1556
|
-
* 更新滚动条
|
1557
|
-
*/
|
1558
|
-
_createClass(BkScrollbar, [{
|
1559
|
-
key: "update",
|
1560
|
-
value: function update(virtaulElement) {
|
1561
|
-
if (!this.isAlive) {
|
1562
|
-
return;
|
1563
|
-
}
|
1564
|
-
if (virtaulElement !== null && virtaulElement !== void 0 && virtaulElement.isVirtualElement) {
|
1565
|
-
this.element = virtaulElement;
|
1566
|
-
}
|
1567
|
-
this.negativeScrollAdjustment = this.isNegativeScroll ? this.element.scrollWidth - this.element.clientWidth : 0;
|
1568
|
-
set(this.scrollbarXRail, {
|
1569
|
-
display: 'block'
|
1570
|
-
});
|
1571
|
-
set(this.scrollbarYRail, {
|
1572
|
-
display: 'block'
|
1573
|
-
});
|
1574
|
-
this.railXMarginWidth = toInt(get(this.scrollbarXRail).marginLeft) + toInt(get(this.scrollbarXRail).marginRight);
|
1575
|
-
this.railYMarginHeight = toInt(get(this.scrollbarYRail).marginTop) + toInt(get(this.scrollbarYRail).marginBottom);
|
1576
|
-
set(this.scrollbarXRail, {
|
1577
|
-
display: 'none'
|
1578
|
-
});
|
1579
|
-
set(this.scrollbarYRail, {
|
1580
|
-
display: 'none'
|
1581
|
-
});
|
1582
|
-
update_geometry(this);
|
1583
|
-
process_scroll_diff(this, 'top', 0, false, true);
|
1584
|
-
process_scroll_diff(this, 'left', 0, false, true);
|
1585
|
-
set(this.scrollbarXRail, {
|
1586
|
-
display: ''
|
1587
|
-
});
|
1588
|
-
set(this.scrollbarYRail, {
|
1589
|
-
display: ''
|
1590
|
-
});
|
1591
|
-
}
|
1592
|
-
/**
|
1593
|
-
* 滚动事件处理
|
1594
|
-
* @param {Event} _e - 滚动事件
|
1595
|
-
*/
|
1596
|
-
}, {
|
1597
|
-
key: "onScroll",
|
1598
|
-
value: function onScroll(_e) {
|
1599
|
-
if (!this.isAlive) {
|
1600
|
-
return;
|
1601
|
-
}
|
1602
|
-
update_geometry(this);
|
1603
|
-
process_scroll_diff(this, 'top', this.element.scrollTop - this.lastScrollTop);
|
1604
|
-
process_scroll_diff(this, 'left', this.element.scrollLeft - this.lastScrollLeft);
|
1605
|
-
this.lastScrollTop = Math.floor(this.element.scrollTop);
|
1606
|
-
this.lastScrollLeft = this.element.scrollLeft;
|
1607
|
-
}
|
1608
|
-
}, {
|
1609
|
-
key: "scrollTo",
|
1610
|
-
value: function scrollTo(_ref3) {
|
1611
|
-
var x = _ref3.x,
|
1612
|
-
y = _ref3.y;
|
1613
|
-
if (y !== undefined && typeof y === 'number') {
|
1614
|
-
this.element.scrollTop = y;
|
1615
|
-
}
|
1616
|
-
if (x !== undefined && typeof x === 'number') {
|
1617
|
-
this.element.scrollLeft = x;
|
1618
|
-
}
|
1619
|
-
update_geometry(this);
|
1620
|
-
}
|
1621
|
-
/**
|
1622
|
-
* 销毁滚动条实例
|
1623
|
-
*/
|
1624
|
-
}, {
|
1625
|
-
key: "destroy",
|
1626
|
-
value: function destroy() {
|
1627
|
-
if (!this.isAlive) {
|
1628
|
-
return;
|
1629
|
-
}
|
1630
|
-
this.event.unbindAll();
|
1631
|
-
remove(this.scrollbarX);
|
1632
|
-
remove(this.scrollbarY);
|
1633
|
-
remove(this.scrollbarXRail);
|
1634
|
-
remove(this.scrollbarYRail);
|
1635
|
-
this.removePsClasses();
|
1636
|
-
this.element = null;
|
1637
|
-
this.scrollbarX = null;
|
1638
|
-
this.scrollbarY = null;
|
1639
|
-
this.scrollbarXRail = null;
|
1640
|
-
this.scrollbarYRail = null;
|
1641
|
-
this.isAlive = false;
|
1642
|
-
}
|
1643
|
-
/**
|
1644
|
-
* 移除滚动条相关的类名
|
1645
|
-
*/
|
1646
|
-
}, {
|
1647
|
-
key: "removePsClasses",
|
1648
|
-
value: function removePsClasses() {
|
1649
|
-
var _this3 = this;
|
1650
|
-
this.element.className = this.element.className.split(' ').filter(function (name) {
|
1651
|
-
return !name.match(new RegExp("^".concat(_this3.settings.classPrefix, "([-_].+|)$")));
|
1652
|
-
}).join(' ');
|
1653
|
-
}
|
1654
|
-
}]);
|
1655
|
-
return BkScrollbar;
|
1656
|
-
}();
|
1657
|
-
|
1658
|
-
var __webpack_exports__IScrollbarSize = __webpack_exports__.IScrollbarSize;
|
1659
|
-
var __webpack_exports__VirtualElement = __webpack_exports__.VirtualElement;
|
1660
|
-
var __webpack_exports__default = __webpack_exports__["default"];
|
1661
|
-
export { __webpack_exports__IScrollbarSize as IScrollbarSize, __webpack_exports__VirtualElement as VirtualElement, __webpack_exports__default as default };
|