tntd 3.0.43 → 3.0.44
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/es/_util/context.js +1 -1
- package/es/_util/defaultRenderEmpty.js +1 -1
- package/es/_util/hooks/useFlexGapSupport.js +4 -4
- package/es/_util/hooks/useForceUpdate.js +4 -4
- package/es/_util/responsiveObserve.js +1 -1
- package/es/_util/styleChecker.js +1 -1
- package/es/actions/index.js +1 -1
- package/es/alert/alert.js +2 -2
- package/es/alert/index.js +1 -1
- package/es/array-input/index.js +9 -9
- package/es/button/button.js +2 -2
- package/es/cascader/cascader.js +1 -1
- package/es/check-card/group.js +8 -8
- package/es/check-card/index.js +6 -6
- package/es/checkbox/checkbox.js +1 -1
- package/es/color-picker/ColorPicker.js +6 -6
- package/es/color-picker/index.js +1 -1
- package/es/columns/index.js +1 -1
- package/es/config-provider/config-provider.js +1 -1
- package/es/date-picker/DatePicker.js +1 -1
- package/es/descriptions/descriptions.js +5 -5
- package/es/development-login/LoginModal.js +6 -6
- package/es/development-login/index.js +4 -4
- package/es/drawer/drawer.js +2 -2
- package/es/ellipsis/Svg/CopySVG.js +1 -1
- package/es/ellipsis/Svg/TickSVG.js +1 -1
- package/es/ellipsis/index.js +5 -5
- package/es/empty/empty.js +2 -2
- package/es/empty/empty.stories.js +2 -2
- package/es/exception/exception.js +1 -1
- package/es/form/form.js +2 -2
- package/es/grid-v4/col.js +2 -2
- package/es/grid-v4/hooks/useBreakpoint.js +1 -1
- package/es/grid-v4/index.js +1 -1
- package/es/grid-v4/row.js +6 -6
- package/es/handle/index.js +1 -1
- package/es/handle-icon/index.js +11 -11
- package/es/icon/IconFont.js +1 -1
- package/es/icon/components/Icon.js +9 -9
- package/es/icon/components/index.js +1 -1
- package/es/icon/components/utils.js +3 -3
- package/es/icon/index.js +7 -7
- package/es/icon/twoTonePrimaryColor.js +1 -1
- package/es/icon/utils.js +1 -1
- package/es/img/Contain.js +1 -1
- package/es/img/Cover.js +5 -5
- package/es/img/index.js +5 -5
- package/es/index.js +1 -1
- package/es/input/input.js +2 -2
- package/es/input-number/inputNumber.js +1 -1
- package/es/label/index.js +2 -2
- package/es/loading-button/index.js +5 -5
- package/es/locale/default.js +1 -1
- package/es/locale/en_US.js +1 -1
- package/es/locale/zh_CN.js +1 -1
- package/es/modal/modal.js +1 -1
- package/es/notification/assets/index.js +1 -1
- package/es/notification/index.js +1 -1
- package/es/notification/notification.js +1 -1
- package/es/page/Box.js +1 -1
- package/es/page/index.js +7 -7
- package/es/page-container/index.js +1 -1
- package/es/page-loading/index.js +1 -1
- package/es/popconfirm/popconfirm.js +1 -1
- package/es/popover/popover.js +1 -1
- package/es/preview-text/index.js +7 -7
- package/es/progress/progress.js +2 -2
- package/es/query-form/Field/Checkbox.js +1 -1
- package/es/query-form/Field/Composition/FieldPopover.js +361 -0
- package/es/query-form/Field/Composition/FieldPopover.js.map +1 -0
- package/es/query-form/Field/Composition/FieldPopover.less +35 -0
- package/es/query-form/Field/Composition/Select.js +157 -0
- package/es/query-form/Field/Composition/Select.js.map +1 -0
- package/es/query-form/Field/Composition/SelectInput.js +34 -0
- package/es/query-form/Field/Composition/SelectInput.js.map +1 -0
- package/es/query-form/Field/Composition/ValueTag.js +162 -0
- package/es/query-form/Field/Composition/ValueTag.js.map +1 -0
- package/es/query-form/Field/Composition/index.js +337 -0
- package/es/query-form/Field/Composition/index.js.map +1 -0
- package/es/query-form/Field/Composition/index.less +145 -0
- package/es/query-form/Field/Composition/utils.js +169 -0
- package/es/query-form/Field/Composition/utils.js.map +1 -0
- package/es/query-form/Field/Select.js +6 -6
- package/es/query-form/Field/SelectInput.js +20 -13
- package/es/query-form/Field/SelectInput.js.map +1 -1
- package/es/query-form/Field/fieldsMap.js +1 -1
- package/es/query-form/Field/index.js +11 -10
- package/es/query-form/Field/index.js.map +1 -1
- package/es/query-form/createActions.js +1 -1
- package/es/query-form/index.js +10 -10
- package/es/query-form/useForm.js +1 -1
- package/es/query-form-v2/index.less +133 -0
- package/es/query-list-scene/List.js +13 -13
- package/es/query-list-scene/QueryForm.js +9 -9
- package/es/query-list-scene/QueryListScene.js +10 -10
- package/es/query-list-scene/Title.js +1 -1
- package/es/query-list-scene/Toolbar.js +2 -2
- package/es/query-list-scene/createActions.js +1 -1
- package/es/query-list-scene/index.js +1 -1
- package/es/query-list-scene/useActions.js +1 -1
- package/es/radio/radio.js +1 -1
- package/es/render-empty/render-empty.js +1 -1
- package/es/scroll-bar/Bar.js +91 -0
- package/es/scroll-bar/Bar.js.map +1 -0
- package/es/scroll-bar/Context.js +13 -0
- package/es/scroll-bar/Context.js.map +1 -0
- package/es/scroll-bar/ScrollBar.js +97 -0
- package/es/scroll-bar/ScrollBar.js.map +1 -0
- package/es/scroll-bar/Thumb.js +125 -0
- package/es/scroll-bar/Thumb.js.map +1 -0
- package/es/scroll-bar/index.js +10 -0
- package/es/scroll-bar/index.js.map +1 -0
- package/es/scroll-bar/scrollBar.less +59 -0
- package/es/scroll-bar/util.js +39 -0
- package/es/scroll-bar/util.js.map +1 -0
- package/es/segmented/index.js +2 -2
- package/es/select/select.js +2 -2
- package/es/spin/spin.js +1 -1
- package/es/steps/steps.js +2 -2
- package/es/svg-components/index.js +1 -1
- package/es/table/hooks/use-column-setting.js +4 -4
- package/es/table/hooks/use-expand-fixed.js +6 -6
- package/es/table/resizableTable/index.js +6 -6
- package/es/table/table-hoc.js +1 -1
- package/es/table/table.js +9 -9
- package/es/table/table.stories.js +2 -2
- package/es/table/utils.js +1 -1
- package/es/table-container/index.js +1 -1
- package/es/tabs/tabs.js +2 -2
- package/es/tabs-container/index.js +1 -1
- package/es/tag/tag.js +2 -2
- package/es/time-picker/TimePicker.js +1 -1
- package/es/time-picker/index.js +1 -1
- package/es/title/index.js +1 -1
- package/es/tntd-action/Action.js +9 -9
- package/es/tntd-action/index.js +8 -8
- package/es/tntd-cascader/AntdCascader/component/context.js +1 -1
- package/es/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +1 -1
- package/es/tntd-cascader/AntdCascader/component/getIcons.js +1 -1
- package/es/tntd-cascader/AntdCascader/component/useCompactItemContext.js +2 -2
- package/es/tntd-cascader/AntdCascader/config/utils.js +2 -2
- package/es/tntd-cascader/AntdCascader/index.js +7 -7
- package/es/tntd-cascader/index.js +1 -1
- package/es/tntd-cascader/rc-cascader/Cascader.js +8 -8
- package/es/tntd-cascader/rc-cascader/OptionList/Checkbox.js +2 -2
- package/es/tntd-cascader/rc-cascader/OptionList/Column.js +7 -7
- package/es/tntd-cascader/rc-cascader/OptionList/index.js +9 -9
- package/es/tntd-cascader/rc-cascader/OptionList/useActive.js +5 -5
- package/es/tntd-cascader/rc-cascader/OptionList/useKeyboard.js +8 -8
- package/es/tntd-cascader/rc-cascader/hooks/useDisplayValues.js +5 -5
- package/es/tntd-cascader/rc-cascader/hooks/useSearchConfig.js +1 -1
- package/es/tntd-cascader/rc-cascader/hooks/useSearchOptions.js +6 -6
- package/es/tntd-cascader/rc-cascader/index.js +1 -1
- package/es/tntd-cascader/rc-cascader/utils/warningPropsUtil.js +4 -4
- package/es/tntd-form/ErrorList.js +7 -7
- package/es/tntd-form/Form.js +6 -6
- package/es/tntd-form/FormItem/ItemHolder.js +6 -6
- package/es/tntd-form/FormItem/index.js +8 -8
- package/es/tntd-form/FormItemInput.js +1 -1
- package/es/tntd-form/FormItemLabel.js +2 -2
- package/es/tntd-form/FormList.js +1 -1
- package/es/tntd-form/context.js +1 -1
- package/es/tntd-form/hooks/useDebounce.js +4 -4
- package/es/tntd-form/hooks/useForm.js +5 -5
- package/es/tntd-form/hooks/useFormItemStatus.js +1 -1
- package/es/tntd-form/hooks/useFrameState.js +5 -5
- package/es/tntd-form/index.js +1 -1
- package/es/tntd-icon/index.js +1 -1
- package/es/tntd-layout/AppList.js +6 -6
- package/es/tntd-layout/Application.js +6 -6
- package/es/tntd-layout/Avatar.js +2 -2
- package/es/tntd-layout/CompatibleLanguage.js +6 -6
- package/es/tntd-layout/EnterpriseLayout/Avatar.js +2 -2
- package/es/tntd-layout/EnterpriseLayout/Language.js +6 -6
- package/es/tntd-layout/EnterpriseLayout/Theme.js +6 -6
- package/es/tntd-layout/EnterpriseLayout/index.js +1 -1
- package/es/tntd-layout/GlobalNavigation/NavigationPopup.js +6 -6
- package/es/tntd-layout/GlobalNavigation/index.js +9 -9
- package/es/tntd-layout/Header.js +2 -2
- package/es/tntd-layout/HeaderActions.js +2 -2
- package/es/tntd-layout/HeaderNavs.js +6 -6
- package/es/tntd-layout/HeaderTabs.js +7 -7
- package/es/tntd-layout/Iconfont.js +1 -1
- package/es/tntd-layout/Language.js +6 -6
- package/es/tntd-layout/Layout.js +6 -6
- package/es/tntd-layout/Logo.js +2 -2
- package/es/tntd-layout/OrgAppList.js +6 -6
- package/es/tntd-layout/SideMenu.js +6 -6
- package/es/tntd-layout/Theme.js +6 -6
- package/es/tntd-layout/createActions.js +1 -1
- package/es/tntd-layout/images/index.js +1 -1
- package/es/tntd-layout/index.js +1 -1
- package/es/tntd-layout/paaslayout/CompactSideMenu.js +6 -6
- package/es/tntd-layout/paaslayout/Header.js +2 -2
- package/es/tntd-layout/paaslayout/Logo.js +2 -2
- package/es/tntd-layout/paaslayout/SideMenu.js +6 -6
- package/es/tntd-layout/paaslayout/index.js +6 -6
- package/es/tntd-layout/storage.js +1 -1
- package/es/tntd-modal/index.js +6 -6
- package/es/tntd-rc-select/_util/PurePanel.js +5 -5
- package/es/tntd-rc-select/_util/context.js +1 -1
- package/es/tntd-rc-select/_util/defaultRenderEmpty.js +1 -1
- package/es/tntd-rc-select/_util/getIcons.js +1 -1
- package/es/tntd-rc-select/_util/useCompactItemContext.js +2 -2
- package/es/tntd-rc-select/index.js +2 -2
- package/es/tntd-reference/AHref/index.js +1 -1
- package/es/tntd-reference/ReferenceBatchCheck/index.js +1 -1
- package/es/tntd-reference/ReferenceBatchDrawer/index.js +5 -5
- package/es/tntd-reference/ReferenceCheck/index.js +1 -1
- package/es/tntd-reference/ReferenceDrawer/index.js +5 -5
- package/es/tntd-reference/ReferenceInfo/index.js +1 -1
- package/es/tntd-reference/index.js +1 -1
- package/es/tntd-second-page/index.js +1 -1
- package/es/tntd-select/DropDownWrap.js +8 -8
- package/es/tntd-select/index.js +10 -9
- package/es/tntd-virtual-tree/index.js +8 -8
- package/es/tntd-virtual-tree/utils.js +28 -28
- package/es/tntd-virtual-tree-select/index.js +10 -10
- package/es/tntd-virtual-tree-select/utils.js +9 -9
- package/es/tooltip/tooltip.js +1 -1
- package/es/upload/index.js +6 -6
- package/es/upload/svg/UploadSVG.js +1 -1
- package/es/utils/checkAuth.js +4 -4
- package/es/utils/index.js +9 -9
- package/es/utils/lang.js +3 -3
- package/es/water-mark/index.js +5 -5
- package/lib/_util/context.js +3 -3
- package/lib/_util/defaultRenderEmpty.js +3 -3
- package/lib/_util/hooks/useFlexGapSupport.js +14 -15
- package/lib/_util/hooks/useForceUpdate.js +14 -15
- package/lib/_util/responsiveObserve.js +7 -13
- package/lib/_util/styleChecker.js +3 -3
- package/lib/actions/index.js +3 -3
- package/lib/alert/alert.js +10 -16
- package/lib/alert/index.js +3 -3
- package/lib/array-input/index.js +30 -37
- package/lib/button/button.js +10 -16
- package/lib/cascader/cascader.js +3 -3
- package/lib/check-card/group.js +23 -24
- package/lib/check-card/index.js +24 -31
- package/lib/checkbox/checkbox.js +3 -3
- package/lib/color-picker/ColorPicker.js +24 -31
- package/lib/color-picker/index.js +3 -3
- package/lib/columns/index.js +3 -3
- package/lib/config-provider/config-provider.js +3 -3
- package/lib/date-picker/DatePicker.js +3 -3
- package/lib/descriptions/descriptions.js +13 -19
- package/lib/development-login/LoginModal.js +24 -31
- package/lib/development-login/index.js +14 -15
- package/lib/drawer/drawer.js +10 -16
- package/lib/ellipsis/Svg/CopySVG.js +3 -3
- package/lib/ellipsis/Svg/TickSVG.js +3 -3
- package/lib/ellipsis/index.js +17 -18
- package/lib/empty/empty.js +10 -16
- package/lib/empty/empty.stories.js +6 -9
- package/lib/exception/exception.js +3 -3
- package/lib/form/form.js +10 -16
- package/lib/grid-v4/col.js +10 -16
- package/lib/grid-v4/hooks/useBreakpoint.js +3 -3
- package/lib/grid-v4/index.js +3 -3
- package/lib/grid-v4/row.js +24 -31
- package/lib/handle/index.js +3 -3
- package/lib/handle-icon/index.js +13 -13
- package/lib/icon/IconFont.js +3 -3
- package/lib/icon/components/Icon.js +44 -70
- package/lib/icon/components/index.js +3 -3
- package/lib/icon/components/utils.js +10 -18
- package/lib/icon/index.js +26 -33
- package/lib/icon/twoTonePrimaryColor.js +3 -3
- package/lib/icon/utils.js +3 -3
- package/lib/img/Contain.js +3 -3
- package/lib/img/Cover.js +17 -18
- package/lib/img/index.js +17 -18
- package/lib/index.js +3 -3
- package/lib/input/input.js +10 -16
- package/lib/input-number/inputNumber.js +3 -3
- package/lib/label/index.js +10 -16
- package/lib/loading-button/index.js +17 -18
- package/lib/locale/default.js +3 -3
- package/lib/locale/en_US.js +3 -3
- package/lib/locale/zh_CN.js +3 -3
- package/lib/modal/modal.js +3 -3
- package/lib/notification/assets/index.js +3 -3
- package/lib/notification/index.js +3 -3
- package/lib/notification/notification.js +3 -3
- package/lib/page/Box.js +3 -3
- package/lib/page/index.js +26 -33
- package/lib/page-container/index.js +3 -3
- package/lib/page-loading/index.js +3 -3
- package/lib/popconfirm/popconfirm.js +3 -3
- package/lib/popover/popover.js +3 -3
- package/lib/preview-text/index.js +9 -9
- package/lib/progress/progress.js +10 -16
- package/lib/query-form/Field/Checkbox.js +3 -3
- package/lib/query-form/Field/Composition/FieldPopover.js +46 -8
- package/lib/query-form/Field/Composition/FieldPopover.js.map +1 -1
- package/lib/query-form/Field/Composition/SelectInput.d.ts +3 -0
- package/lib/query-form/Field/Composition/SelectInput.d.ts.map +1 -0
- package/lib/query-form/Field/Composition/SelectInput.js +111 -0
- package/lib/query-form/Field/Composition/SelectInput.js.map +1 -0
- package/lib/query-form/Field/Composition/ValueTag.d.ts.map +1 -1
- package/lib/query-form/Field/Composition/ValueTag.js +6 -3
- package/lib/query-form/Field/Composition/ValueTag.js.map +1 -1
- package/lib/query-form/Field/Composition/index.d.ts +2 -0
- package/lib/query-form/Field/Composition/index.js +32 -16
- package/lib/query-form/Field/Composition/index.js.map +1 -1
- package/lib/query-form/Field/Composition/utils.d.ts +1 -1
- package/lib/query-form/Field/Composition/utils.d.ts.map +1 -1
- package/lib/query-form/Field/Composition/utils.js +47 -46
- package/lib/query-form/Field/Composition/utils.js.map +1 -1
- package/lib/query-form/Field/Select.js +24 -31
- package/lib/query-form/Field/SelectInput.d.ts.map +1 -1
- package/lib/query-form/Field/SelectInput.js +38 -38
- package/lib/query-form/Field/SelectInput.js.map +1 -1
- package/lib/query-form/Field/fieldsMap.js +3 -3
- package/lib/query-form/Field/index.d.ts.map +1 -1
- package/lib/query-form/Field/index.js +47 -72
- package/lib/query-form/Field/index.js.map +1 -1
- package/lib/query-form/createActions.js +3 -3
- package/lib/query-form/index.js +44 -70
- package/lib/query-form/useForm.js +3 -3
- package/lib/query-list-scene/List.js +41 -61
- package/lib/query-list-scene/QueryForm.js +37 -57
- package/lib/query-list-scene/QueryListScene.js +44 -70
- package/lib/query-list-scene/Title.js +3 -3
- package/lib/query-list-scene/Toolbar.js +10 -16
- package/lib/query-list-scene/createActions.js +3 -3
- package/lib/query-list-scene/index.js +3 -3
- package/lib/query-list-scene/useActions.js +3 -3
- package/lib/radio/radio.js +3 -3
- package/lib/render-empty/render-empty.js +3 -3
- package/lib/segmented/index.js +10 -16
- package/lib/select/select.js +10 -16
- package/lib/spin/spin.js +3 -3
- package/lib/steps/steps.js +10 -16
- package/lib/svg-components/index.js +3 -3
- package/lib/table/hooks/use-column-setting.js +14 -15
- package/lib/table/hooks/use-expand-fixed.js +30 -36
- package/lib/table/resizableTable/index.js +24 -31
- package/lib/table/table-hoc.js +3 -3
- package/lib/table/table.js +27 -34
- package/lib/table/table.stories.js +10 -16
- package/lib/table/utils.js +3 -3
- package/lib/table-container/index.js +3 -3
- package/lib/tabs/tabs.js +10 -16
- package/lib/tabs-container/index.js +3 -3
- package/lib/tag/tag.js +10 -16
- package/lib/time-picker/TimePicker.js +3 -3
- package/lib/time-picker/index.js +3 -3
- package/lib/title/index.js +3 -3
- package/lib/tntd-action/Action.js +21 -22
- package/lib/tntd-action/index.js +20 -21
- package/lib/tntd-cascader/AntdCascader/component/context.js +3 -3
- package/lib/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +3 -3
- package/lib/tntd-cascader/AntdCascader/component/getIcons.js +3 -3
- package/lib/tntd-cascader/AntdCascader/component/useCompactItemContext.js +10 -16
- package/lib/tntd-cascader/AntdCascader/config/utils.js +10 -16
- package/lib/tntd-cascader/AntdCascader/index.js +26 -33
- package/lib/tntd-cascader/index.js +3 -3
- package/lib/tntd-cascader/rc-cascader/Cascader.js +23 -24
- package/lib/tntd-cascader/rc-cascader/OptionList/Checkbox.js +10 -16
- package/lib/tntd-cascader/rc-cascader/OptionList/Column.js +26 -33
- package/lib/tntd-cascader/rc-cascader/OptionList/index.js +30 -37
- package/lib/tntd-cascader/rc-cascader/OptionList/useActive.js +17 -18
- package/lib/tntd-cascader/rc-cascader/OptionList/useKeyboard.js +23 -24
- package/lib/tntd-cascader/rc-cascader/hooks/useDisplayValues.js +16 -17
- package/lib/tntd-cascader/rc-cascader/hooks/useSearchConfig.js +3 -3
- package/lib/tntd-cascader/rc-cascader/hooks/useSearchOptions.js +23 -30
- package/lib/tntd-cascader/rc-cascader/index.js +3 -3
- package/lib/tntd-cascader/rc-cascader/utils/warningPropsUtil.js +6 -6
- package/lib/tntd-form/ErrorList.js +26 -33
- package/lib/tntd-form/Form.js +24 -31
- package/lib/tntd-form/FormItem/ItemHolder.js +24 -31
- package/lib/tntd-form/FormItem/index.js +23 -24
- package/lib/tntd-form/FormItemInput.js +3 -3
- package/lib/tntd-form/FormItemLabel.js +10 -16
- package/lib/tntd-form/FormList.js +3 -3
- package/lib/tntd-form/context.js +3 -3
- package/lib/tntd-form/hooks/useDebounce.js +14 -15
- package/lib/tntd-form/hooks/useForm.js +17 -18
- package/lib/tntd-form/hooks/useFormItemStatus.js +3 -3
- package/lib/tntd-form/hooks/useFrameState.js +17 -18
- package/lib/tntd-form/index.js +3 -3
- package/lib/tntd-icon/index.js +3 -3
- package/lib/tntd-layout/AppList.js +20 -24
- package/lib/tntd-layout/Application.js +20 -24
- package/lib/tntd-layout/Avatar.js +6 -9
- package/lib/tntd-layout/CompatibleLanguage.js +20 -24
- package/lib/tntd-layout/EnterpriseLayout/Avatar.js +6 -9
- package/lib/tntd-layout/EnterpriseLayout/Language.js +20 -24
- package/lib/tntd-layout/EnterpriseLayout/Theme.js +20 -24
- package/lib/tntd-layout/EnterpriseLayout/index.js +3 -3
- package/lib/tntd-layout/GlobalNavigation/NavigationPopup.js +20 -24
- package/lib/tntd-layout/GlobalNavigation/index.js +26 -30
- package/lib/tntd-layout/Header.js +6 -9
- package/lib/tntd-layout/HeaderActions.js +6 -9
- package/lib/tntd-layout/HeaderNavs.js +20 -24
- package/lib/tntd-layout/HeaderTabs.js +27 -37
- package/lib/tntd-layout/Iconfont.js +3 -3
- package/lib/tntd-layout/Language.js +20 -24
- package/lib/tntd-layout/Layout.js +20 -24
- package/lib/tntd-layout/Logo.js +6 -9
- package/lib/tntd-layout/OrgAppList.js +20 -24
- package/lib/tntd-layout/SideMenu.js +20 -24
- package/lib/tntd-layout/Theme.js +20 -24
- package/lib/tntd-layout/createActions.js +3 -3
- package/lib/tntd-layout/images/index.js +3 -3
- package/lib/tntd-layout/index.js +3 -3
- package/lib/tntd-layout/paaslayout/CompactSideMenu.js +20 -24
- package/lib/tntd-layout/paaslayout/Header.js +6 -9
- package/lib/tntd-layout/paaslayout/Logo.js +6 -9
- package/lib/tntd-layout/paaslayout/SideMenu.js +20 -24
- package/lib/tntd-layout/paaslayout/index.js +20 -24
- package/lib/tntd-layout/storage.js +3 -3
- package/lib/tntd-modal/index.js +24 -31
- package/lib/tntd-rc-select/_util/PurePanel.js +17 -18
- package/lib/tntd-rc-select/_util/context.js +3 -3
- package/lib/tntd-rc-select/_util/defaultRenderEmpty.js +3 -3
- package/lib/tntd-rc-select/_util/getIcons.js +3 -3
- package/lib/tntd-rc-select/_util/useCompactItemContext.js +10 -16
- package/lib/tntd-rc-select/index.js +10 -16
- package/lib/tntd-reference/AHref/index.js +3 -3
- package/lib/tntd-reference/ReferenceBatchCheck/index.js +3 -3
- package/lib/tntd-reference/ReferenceBatchDrawer/index.js +17 -18
- package/lib/tntd-reference/ReferenceCheck/index.js +3 -3
- package/lib/tntd-reference/ReferenceDrawer/index.js +17 -18
- package/lib/tntd-reference/ReferenceInfo/index.js +3 -3
- package/lib/tntd-reference/index.js +3 -3
- package/lib/tntd-second-page/index.js +3 -3
- package/lib/tntd-select/DropDownWrap.js +34 -54
- package/lib/tntd-select/index.js +40 -57
- package/lib/tntd-virtual-tree/index.js +23 -24
- package/lib/tntd-virtual-tree/utils.js +62 -66
- package/lib/tntd-virtual-tree-select/index.js +22 -23
- package/lib/tntd-virtual-tree-select/utils.js +20 -21
- package/lib/tooltip/tooltip.js +3 -3
- package/lib/upload/index.js +41 -45
- package/lib/upload/svg/UploadSVG.js +3 -3
- package/lib/utils/checkAuth.js +6 -6
- package/lib/utils/index.js +20 -21
- package/lib/utils/lang.js +5 -5
- package/lib/water-mark/index.js +17 -18
- package/package.json +1 -1
- package/CHANGELOG.json +0 -1034
- package/CHANGELOG.md +0 -605
- package/es/checkbox/checkbox-group.js +0 -16
- package/es/checkbox/checkbox-group.js.map +0 -1
- package/es/radio/radio-group.js +0 -16
- package/es/radio/radio-group.js.map +0 -1
- package/es/steps/stepStyle/small.less +0 -5
- package/es/table/total-shower.js +0 -20
- package/es/table/total-shower.js.map +0 -1
- package/es/utils/simple-template.js +0 -19
- package/es/utils/simple-template.js.map +0 -1
- package/lib/checkbox/checkbox-group.d.ts +0 -8
- package/lib/checkbox/checkbox-group.d.ts.map +0 -1
- package/lib/checkbox/checkbox-group.js +0 -16
- package/lib/checkbox/checkbox-group.js.map +0 -1
- package/lib/radio/radio-group.d.ts +0 -8
- package/lib/radio/radio-group.d.ts.map +0 -1
- package/lib/radio/radio-group.js +0 -16
- package/lib/radio/radio-group.js.map +0 -1
- package/lib/steps/stepStyle/small.less +0 -5
- package/lib/table/total-shower.d.ts +0 -9
- package/lib/table/total-shower.d.ts.map +0 -1
- package/lib/table/total-shower.js +0 -20
- package/lib/table/total-shower.js.map +0 -1
- package/lib/utils/simple-template.d.ts +0 -9
- package/lib/utils/simple-template.d.ts.map +0 -1
- package/lib/utils/simple-template.js +0 -19
- package/lib/utils/simple-template.js.map +0 -1
|
@@ -18,19 +18,19 @@ var _spin = _interopRequireDefault(require("../spin"));
|
|
|
18
18
|
var _table = _interopRequireDefault(require("../table"));
|
|
19
19
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
20
20
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
21
|
-
function _interopRequireDefault(
|
|
22
|
-
function _classCallCheck(
|
|
23
|
-
function _defineProperties(
|
|
24
|
-
function _createClass(
|
|
21
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
22
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
23
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
24
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
25
25
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
26
26
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
27
27
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
28
|
-
function _possibleConstructorReturn(
|
|
29
|
-
function _assertThisInitialized(
|
|
28
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
29
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
30
30
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
31
|
-
function _getPrototypeOf(
|
|
32
|
-
function _inherits(
|
|
33
|
-
function _setPrototypeOf(
|
|
31
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
32
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
33
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
34
34
|
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
35
35
|
var t = {};
|
|
36
36
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
@@ -328,7 +328,7 @@ var QueryList = exports["default"] = /*#__PURE__*/function (_React$PureComponent
|
|
|
328
328
|
this.fetchData(this.formData)["finally"](function () {
|
|
329
329
|
// 轮询
|
|
330
330
|
if (qlsProps.interval && !_this2.isUnmounted) {
|
|
331
|
-
var
|
|
331
|
+
var _doIntervalQuery = function doIntervalQuery(ms) {
|
|
332
332
|
// 组件unmounted后,不执行轮训逻辑
|
|
333
333
|
if (!_this2.isUnmounted) {
|
|
334
334
|
_this2.timmer = setTimeout(function () {
|
|
@@ -338,15 +338,15 @@ var QueryList = exports["default"] = /*#__PURE__*/function (_React$PureComponent
|
|
|
338
338
|
isInterval: true,
|
|
339
339
|
showLoading: false
|
|
340
340
|
}).then(function () {
|
|
341
|
-
|
|
341
|
+
_doIntervalQuery(ms);
|
|
342
342
|
});
|
|
343
343
|
} else {
|
|
344
|
-
|
|
344
|
+
_doIntervalQuery(ms);
|
|
345
345
|
}
|
|
346
346
|
}, ms);
|
|
347
347
|
}
|
|
348
348
|
};
|
|
349
|
-
|
|
349
|
+
_doIntervalQuery(qlsProps.interval);
|
|
350
350
|
}
|
|
351
351
|
});
|
|
352
352
|
}
|
|
@@ -8,19 +8,19 @@ exports["default"] = void 0;
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
10
|
var _queryForm = _interopRequireDefault(require("../query-form"));
|
|
11
|
-
function _interopRequireDefault(
|
|
12
|
-
function _classCallCheck(
|
|
13
|
-
function _defineProperties(
|
|
14
|
-
function _createClass(
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
12
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
13
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
14
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
15
15
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
16
16
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
17
17
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
18
|
-
function _possibleConstructorReturn(
|
|
19
|
-
function _assertThisInitialized(
|
|
18
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
19
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
20
20
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
21
|
-
function _getPrototypeOf(
|
|
22
|
-
function _inherits(
|
|
23
|
-
function _setPrototypeOf(
|
|
21
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
22
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
23
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
24
24
|
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
25
25
|
var t = {};
|
|
26
26
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
@@ -10,20 +10,20 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
10
10
|
var _Title = _interopRequireDefault(require("./Title"));
|
|
11
11
|
var _Toolbar = _interopRequireDefault(require("./Toolbar"));
|
|
12
12
|
var _createActions = _interopRequireDefault(require("./createActions"));
|
|
13
|
-
function _interopRequireDefault(
|
|
14
|
-
function _defineProperty(
|
|
15
|
-
function _classCallCheck(
|
|
16
|
-
function _defineProperties(
|
|
17
|
-
function _createClass(
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
14
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
15
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
16
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
17
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
18
18
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
19
19
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
20
20
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
21
|
-
function _possibleConstructorReturn(
|
|
22
|
-
function _assertThisInitialized(
|
|
21
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
22
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
23
23
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
24
|
-
function _getPrototypeOf(
|
|
25
|
-
function _inherits(
|
|
26
|
-
function _setPrototypeOf(
|
|
24
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
25
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
26
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
27
27
|
var QueryListScene = exports["default"] = /*#__PURE__*/function (_React$Component) {
|
|
28
28
|
function QueryListScene(props) {
|
|
29
29
|
var _this;
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
function _interopRequireDefault(
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
9
9
|
/**
|
|
10
10
|
* @file Title
|
|
11
11
|
* @author zhangyou
|
|
@@ -6,9 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
|
-
function _interopRequireDefault(
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
10
10
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
11
|
-
function _defineProperty(
|
|
11
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
12
12
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
13
13
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
14
14
|
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
@@ -7,7 +7,7 @@ exports["default"] = void 0;
|
|
|
7
7
|
var _set2 = _interopRequireDefault(require("lodash/set"));
|
|
8
8
|
var _get2 = _interopRequireDefault(require("lodash/get"));
|
|
9
9
|
var _eventemitter = _interopRequireDefault(require("eventemitter3"));
|
|
10
|
-
function _interopRequireDefault(
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
11
11
|
var _default = exports["default"] = function _default() {
|
|
12
12
|
var eventEmitter = new _eventemitter["default"]();
|
|
13
13
|
var data = {
|
|
@@ -12,7 +12,7 @@ var _List = _interopRequireDefault(require("./List"));
|
|
|
12
12
|
var _createActions = _interopRequireDefault(require("./createActions"));
|
|
13
13
|
var _useActions = _interopRequireDefault(require("./useActions"));
|
|
14
14
|
require("./index.less");
|
|
15
|
-
function _interopRequireDefault(
|
|
15
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
16
16
|
var QueryForm = exports.QueryForm = _QueryForm["default"];
|
|
17
17
|
var QueryList = exports.QueryList = _List["default"];
|
|
18
18
|
var createActions = exports.createActions = _createActions["default"];
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports["default"] = useActions;
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _createActions = _interopRequireDefault(require("./createActions"));
|
|
9
|
-
function _interopRequireDefault(
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
10
10
|
function useActions() {
|
|
11
11
|
var actions = (0, _react.useRef)((0, _createActions["default"])());
|
|
12
12
|
return actions.current;
|
package/es/radio/radio.js
CHANGED
|
@@ -23,7 +23,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
23
23
|
var _react = _interopRequireWildcard(require("react"));
|
|
24
24
|
var _connect = require("../connect");
|
|
25
25
|
var _previewText = require("../preview-text");
|
|
26
|
-
function _interopRequireDefault(
|
|
26
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
27
27
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
28
28
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
29
29
|
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
@@ -7,7 +7,7 @@ exports.renderEmpty = void 0;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _configProvider = require("../config-provider");
|
|
9
9
|
var _empty = require("../empty");
|
|
10
|
-
function _interopRequireDefault(
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
11
11
|
var renderEmpty = exports.renderEmpty = function renderEmpty(componentName) {
|
|
12
12
|
return _react["default"].createElement(_configProvider.ConfigConsumer, null, function () {
|
|
13
13
|
switch (componentName) {
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _Context = _interopRequireDefault(require("./Context"));
|
|
10
|
+
var _Thumb = _interopRequireDefault(require("./Thumb"));
|
|
11
|
+
var _util = require("./util");
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
13
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
14
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
15
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
16
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
17
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
18
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
19
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
20
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
21
|
+
var _default = exports["default"] = (0, _react.forwardRef)(function (props, ref) {
|
|
22
|
+
var _useContext = (0, _react.useContext)(_Context["default"]),
|
|
23
|
+
wrapElement = _useContext.wrapElement;
|
|
24
|
+
var _useState = (0, _react.useState)(0),
|
|
25
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
26
|
+
moveX = _useState2[0],
|
|
27
|
+
setMoveX = _useState2[1];
|
|
28
|
+
var _useState3 = (0, _react.useState)(0),
|
|
29
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
30
|
+
moveY = _useState4[0],
|
|
31
|
+
setMoveY = _useState4[1];
|
|
32
|
+
var _useState5 = (0, _react.useState)(0),
|
|
33
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
34
|
+
sizeWidth = _useState6[0],
|
|
35
|
+
setSizeWidth = _useState6[1];
|
|
36
|
+
var _useState7 = (0, _react.useState)(0),
|
|
37
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
38
|
+
sizeHeight = _useState8[0],
|
|
39
|
+
setSizeHeight = _useState8[1];
|
|
40
|
+
var _useState9 = (0, _react.useState)(1),
|
|
41
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
42
|
+
ratioX = _useState10[0],
|
|
43
|
+
setRatioX = _useState10[1];
|
|
44
|
+
var _useState11 = (0, _react.useState)(1),
|
|
45
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
46
|
+
ratioY = _useState12[0],
|
|
47
|
+
setRatioY = _useState12[1];
|
|
48
|
+
(0, _react.useImperativeHandle)(ref, function () {
|
|
49
|
+
return {
|
|
50
|
+
update: update,
|
|
51
|
+
handleScroll: handleScroll
|
|
52
|
+
};
|
|
53
|
+
});
|
|
54
|
+
function handleScroll() {
|
|
55
|
+
var wrap = wrapElement.current;
|
|
56
|
+
if (!wrap) return;
|
|
57
|
+
var offsetHeight = wrap.offsetHeight - _util.GAP;
|
|
58
|
+
var offsetWidth = wrap.offsetWidth - _util.GAP;
|
|
59
|
+
setMoveY(wrap.scrollTop * 100 / offsetHeight * ratioY);
|
|
60
|
+
setMoveX(wrap.scrollLeft * 100 / offsetWidth * ratioX);
|
|
61
|
+
}
|
|
62
|
+
function update() {
|
|
63
|
+
var wrap = wrapElement.current;
|
|
64
|
+
if (!wrap) return;
|
|
65
|
+
// 滚动窗口的高度
|
|
66
|
+
var offsetHeight = wrap.offsetHeight - _util.GAP;
|
|
67
|
+
var offsetWidth = wrap.offsetWidth - _util.GAP;
|
|
68
|
+
// 滚动条的逻辑高度
|
|
69
|
+
var originalHeight = Math.pow(offsetHeight, 2) / wrap.scrollHeight;
|
|
70
|
+
var originalWidth = Math.pow(offsetWidth, 2) / wrap.scrollWidth;
|
|
71
|
+
// 滚动条的实际高度,因为如果内容太长会导致滚动条非常短,可能难以点击拖拽,所以设置了最小高度
|
|
72
|
+
var height = Math.max(originalHeight, props.minSize);
|
|
73
|
+
var width = Math.max(originalWidth, props.minSize);
|
|
74
|
+
setRatioY(originalHeight / (offsetHeight - originalHeight) / (height / (offsetHeight - height)));
|
|
75
|
+
setRatioX(originalWidth / (offsetWidth - originalWidth) / (width / (offsetWidth - width)));
|
|
76
|
+
setSizeHeight(height + _util.GAP < offsetHeight ? height : 0);
|
|
77
|
+
setSizeWidth(width + _util.GAP < offsetWidth ? width : 0);
|
|
78
|
+
}
|
|
79
|
+
return _react["default"].createElement(_react["default"].Fragment, null, _react["default"].createElement(_Thumb["default"], {
|
|
80
|
+
always: props.always,
|
|
81
|
+
move: moveX,
|
|
82
|
+
size: sizeWidth,
|
|
83
|
+
ratio: ratioX
|
|
84
|
+
}), _react["default"].createElement(_Thumb["default"], {
|
|
85
|
+
always: props.always,
|
|
86
|
+
move: moveY,
|
|
87
|
+
size: sizeHeight,
|
|
88
|
+
ratio: ratioY,
|
|
89
|
+
vertical: true
|
|
90
|
+
}));
|
|
91
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Bar.js","sourceRoot":"","sources":["../../src/scroll-bar/Bar.js"],"names":[],"mappings":"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","sourcesContent":["import React, { forwardRef, useContext, useImperativeHandle, useState } from 'react'\nimport Context from './Context'\nimport Thumb from './Thumb'\nimport { GAP } from './util'\n\nexport default forwardRef((props, ref) => {\n const { wrapElement } = useContext(Context)\n\n const [moveX, setMoveX] = useState(0)\n const [moveY, setMoveY] = useState(0)\n const [sizeWidth, setSizeWidth] = useState(0)\n const [sizeHeight, setSizeHeight] = useState(0)\n const [ratioX, setRatioX] = useState(1)\n const [ratioY, setRatioY] = useState(1)\n\n useImperativeHandle(ref, () => ({\n update,\n handleScroll,\n }))\n\n function handleScroll() {\n const wrap = wrapElement.current\n if (!wrap) return\n const offsetHeight = wrap.offsetHeight - GAP\n const offsetWidth = wrap.offsetWidth - GAP\n setMoveY(((wrap.scrollTop * 100) / offsetHeight) * ratioY)\n setMoveX(((wrap.scrollLeft * 100) / offsetWidth) * ratioX)\n }\n\n function update() {\n const wrap = wrapElement.current\n if (!wrap) return\n // 滚动窗口的高度\n const offsetHeight = wrap.offsetHeight - GAP\n const offsetWidth = wrap.offsetWidth - GAP\n // 滚动条的逻辑高度\n const originalHeight = offsetHeight ** 2 / wrap.scrollHeight\n const originalWidth = offsetWidth ** 2 / wrap.scrollWidth\n // 滚动条的实际高度,因为如果内容太长会导致滚动条非常短,可能难以点击拖拽,所以设置了最小高度\n const height = Math.max(originalHeight, props.minSize)\n const width = Math.max(originalWidth, props.minSize)\n\n setRatioY(originalHeight / (offsetHeight - originalHeight) / (height / (offsetHeight - height)))\n setRatioX(originalWidth / (offsetWidth - originalWidth) / (width / (offsetWidth - width)))\n setSizeHeight(height + GAP < offsetHeight ? height : 0)\n setSizeWidth(width + GAP < offsetWidth ? width : 0)\n }\n\n return (\n <>\n <Thumb always={props.always} move={moveX} size={sizeWidth} ratio={ratioX} />\n <Thumb always={props.always} move={moveY} size={sizeHeight} ratio={ratioY} vertical />\n </>\n )\n})\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
9
|
+
var Context = _react["default"].createContext({
|
|
10
|
+
scrollbarElement: null,
|
|
11
|
+
wrapElement: null
|
|
12
|
+
});
|
|
13
|
+
var _default = exports["default"] = Context;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Context.js","sourceRoot":"","sources":["../../src/scroll-bar/Context.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,OAAO,GAAG,KAAK,CAAC,aAAa,CAAC;IAClC,gBAAgB,EAAE,IAAI;IACtB,WAAW,EAAE,IAAI;CAClB,CAAC,CAAA;AAEF,eAAe,OAAO,CAAA","sourcesContent":["import React from 'react'\n\nconst Context = React.createContext({\n scrollbarElement: null,\n wrapElement: null,\n})\n\nexport default Context\n"]}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _Bar = _interopRequireDefault(require("./Bar"));
|
|
11
|
+
var _Context = _interopRequireDefault(require("./Context"));
|
|
12
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
13
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
15
|
+
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
16
|
+
var t = {};
|
|
17
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
18
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
var _default = exports["default"] = (0, _react.forwardRef)(function (_a, ref) {
|
|
24
|
+
var children = _a.children,
|
|
25
|
+
_a$minSize = _a.minSize,
|
|
26
|
+
minSize = _a$minSize === void 0 ? 20 : _a$minSize,
|
|
27
|
+
props = __rest(_a, ["children", "minSize"]);
|
|
28
|
+
var scrollbarElement = (0, _react.useRef)();
|
|
29
|
+
var wrapElement = (0, _react.useRef)();
|
|
30
|
+
wrapElement = ref || wrapElement;
|
|
31
|
+
var resizeRef = (0, _react.useRef)();
|
|
32
|
+
var barRef = (0, _react.useRef)();
|
|
33
|
+
(0, _react.useEffect)(function () {
|
|
34
|
+
var wrapDom = wrapElement.current;
|
|
35
|
+
var resizeDom = resizeRef.current;
|
|
36
|
+
// 监听容器尺寸变化,因为尺寸可以设置类似height:100vh之类样式,高度并不是固定的
|
|
37
|
+
var observerCallback = function observerCallback() {
|
|
38
|
+
return requestAnimationFrame(function () {
|
|
39
|
+
var _a;
|
|
40
|
+
update();
|
|
41
|
+
(_a = barRef.current) === null || _a === void 0 ? void 0 : _a.handleScroll();
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
var observer = new ResizeObserver(observerCallback);
|
|
45
|
+
observer.observe(wrapDom);
|
|
46
|
+
observer.observe(resizeDom);
|
|
47
|
+
return function () {
|
|
48
|
+
observer.unobserve(wrapDom);
|
|
49
|
+
observer.unobserve(resizeDom);
|
|
50
|
+
};
|
|
51
|
+
}, []);
|
|
52
|
+
(0, _react.useEffect)(function () {
|
|
53
|
+
var _a;
|
|
54
|
+
if (!props["native"]) {
|
|
55
|
+
update();
|
|
56
|
+
(_a = barRef.current) === null || _a === void 0 ? void 0 : _a.handleScroll();
|
|
57
|
+
}
|
|
58
|
+
}, [props["native"]]);
|
|
59
|
+
function update() {
|
|
60
|
+
var _a;
|
|
61
|
+
(_a = barRef.current) === null || _a === void 0 ? void 0 : _a.update();
|
|
62
|
+
}
|
|
63
|
+
function handleScroll(e) {
|
|
64
|
+
var _a, _b;
|
|
65
|
+
(_a = barRef.current) === null || _a === void 0 ? void 0 : _a.handleScroll();
|
|
66
|
+
(_b = props.onScroll) === null || _b === void 0 ? void 0 : _b.call(props, e);
|
|
67
|
+
}
|
|
68
|
+
var wrapStyle = {
|
|
69
|
+
height: props.height,
|
|
70
|
+
maxHeight: props.maxHeight
|
|
71
|
+
};
|
|
72
|
+
var wrapClassName = (0, _classnames["default"])('tntd-scroll-bar-wrap', {
|
|
73
|
+
'tntd-scroll-bar-wrap-hidden-default': !props["native"]
|
|
74
|
+
});
|
|
75
|
+
return _react["default"].createElement(_Context["default"].Provider, {
|
|
76
|
+
value: {
|
|
77
|
+
scrollbarElement: scrollbarElement,
|
|
78
|
+
wrapElement: wrapElement
|
|
79
|
+
}
|
|
80
|
+
}, _react["default"].createElement("div", {
|
|
81
|
+
style: props.style,
|
|
82
|
+
className: (0, _classnames["default"])('tntd-scroll-bar', props.className),
|
|
83
|
+
ref: scrollbarElement
|
|
84
|
+
}, _react["default"].createElement("div", {
|
|
85
|
+
style: wrapStyle,
|
|
86
|
+
className: wrapClassName,
|
|
87
|
+
ref: wrapElement,
|
|
88
|
+
onScroll: handleScroll
|
|
89
|
+
}, _react["default"].createElement("div", {
|
|
90
|
+
className: "tntd-scroll-bar-view",
|
|
91
|
+
ref: resizeRef
|
|
92
|
+
}, children)), !props["native"] && _react["default"].createElement(_Bar["default"], {
|
|
93
|
+
ref: barRef,
|
|
94
|
+
always: props.always,
|
|
95
|
+
minSize: minSize
|
|
96
|
+
})));
|
|
97
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScrollBar.js","sourceRoot":"","sources":["../../src/scroll-bar/ScrollBar.js"],"names":[],"mappings":"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","sourcesContent":["import clsx from 'classnames'\nimport React, { forwardRef, useEffect, useRef } from 'react'\nimport Bar from './Bar'\nimport Context from './Context'\n\nexport default forwardRef(({ children, minSize = 20, ...props }, ref) => {\n const scrollbarElement = useRef()\n let wrapElement = useRef()\n wrapElement = ref || wrapElement\n const resizeRef = useRef()\n const barRef = useRef()\n\n useEffect(() => {\n const wrapDom = wrapElement.current\n const resizeDom = resizeRef.current\n // 监听容器尺寸变化,因为尺寸可以设置类似height:100vh之类样式,高度并不是固定的\n const observerCallback = () =>\n requestAnimationFrame(() => {\n update()\n barRef.current?.handleScroll()\n })\n const observer = new ResizeObserver(observerCallback)\n observer.observe(wrapDom)\n observer.observe(resizeDom)\n return () => {\n observer.unobserve(wrapDom)\n observer.unobserve(resizeDom)\n }\n }, [])\n useEffect(() => {\n if (!props.native) {\n update()\n barRef.current?.handleScroll()\n }\n }, [props.native])\n\n function update() {\n barRef.current?.update()\n }\n\n function handleScroll(e) {\n barRef.current?.handleScroll()\n props.onScroll?.(e)\n }\n\n const wrapStyle = { height: props.height, maxHeight: props.maxHeight }\n const wrapClassName = clsx('tntd-scroll-bar-wrap', {\n 'tntd-scroll-bar-wrap-hidden-default': !props.native,\n })\n\n return (\n <Context.Provider value={{ scrollbarElement, wrapElement }}>\n <div\n style={props.style}\n className={clsx('tntd-scroll-bar', props.className)}\n ref={scrollbarElement}\n >\n <div style={wrapStyle} className={wrapClassName} ref={wrapElement} onScroll={handleScroll}>\n <div className=\"tntd-scroll-bar-view\" ref={resizeRef}>\n {children}\n </div>\n </div>\n {!props.native && <Bar ref={barRef} always={props.always} minSize={minSize} />}\n </div>\n </Context.Provider>\n )\n})\n"]}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = Thumb;
|
|
8
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _Context = _interopRequireDefault(require("./Context"));
|
|
11
|
+
var _util = require("./util");
|
|
12
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
13
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
15
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
16
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
17
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
18
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
19
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
20
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
21
|
+
function Thumb(props) {
|
|
22
|
+
var _useContext = (0, _react.useContext)(_Context["default"]),
|
|
23
|
+
scrollbarElement = _useContext.scrollbarElement,
|
|
24
|
+
wrapElement = _useContext.wrapElement;
|
|
25
|
+
var instance = (0, _react.useRef)();
|
|
26
|
+
var thumb = (0, _react.useRef)();
|
|
27
|
+
var _useState = (0, _react.useState)(false),
|
|
28
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
29
|
+
visible = _useState2[0],
|
|
30
|
+
setVisible = _useState2[1];
|
|
31
|
+
// 当作非响应式变量使用
|
|
32
|
+
var thumbState = (0, _react.useRef)({});
|
|
33
|
+
var cursorDown = (0, _react.useRef)(false);
|
|
34
|
+
var cursorLeave = (0, _react.useRef)(false);
|
|
35
|
+
var originalOnSelectStart = (0, _react.useRef)(document.onselectstart);
|
|
36
|
+
var bar = _util.BAR_MAP[props.vertical ? 'vertical' : 'horizontal'];
|
|
37
|
+
(0, _react.useEffect)(function () {
|
|
38
|
+
var element = scrollbarElement.current;
|
|
39
|
+
element.addEventListener('mousemove', mouseMoveScrollbarHandler);
|
|
40
|
+
element.addEventListener('mouseleave', mouseLeaveScrollbarHandler);
|
|
41
|
+
return function () {
|
|
42
|
+
restoreOnselectstart();
|
|
43
|
+
document.removeEventListener('mouseup', mouseUpDocumentHandler);
|
|
44
|
+
element.removeEventListener('mousemove', mouseMoveScrollbarHandler);
|
|
45
|
+
element.removeEventListener('mouseleave', mouseLeaveScrollbarHandler);
|
|
46
|
+
};
|
|
47
|
+
}, []);
|
|
48
|
+
function mouseMoveScrollbarHandler() {
|
|
49
|
+
cursorLeave.current = false;
|
|
50
|
+
setVisible(true);
|
|
51
|
+
}
|
|
52
|
+
function mouseLeaveScrollbarHandler() {
|
|
53
|
+
cursorLeave.current = true;
|
|
54
|
+
setVisible(cursorDown.current);
|
|
55
|
+
}
|
|
56
|
+
function getOffsetRatio() {
|
|
57
|
+
return Math.pow(instance.current[bar.offset], 2) / wrapElement.current[bar.scrollSize] / props.ratio / thumb.current[bar.offset];
|
|
58
|
+
}
|
|
59
|
+
function clickTrackHandler(e) {
|
|
60
|
+
if (!thumb.current || !instance.current || !wrapElement.current) return;
|
|
61
|
+
// 鼠标点击的坐标距离顶端的距离
|
|
62
|
+
var offset = Math.abs(e.target.getBoundingClientRect()[bar.direction] - e[bar.client]);
|
|
63
|
+
var thumbHalf = thumb.current[bar.offset] / 2;
|
|
64
|
+
var thumbPositionPercentage = (offset - thumbHalf) * 100 * getOffsetRatio() / instance.current[bar.offset];
|
|
65
|
+
// 直接给scrollTop赋值,就会调用bar组件的handleScroll函数
|
|
66
|
+
wrapElement.current[bar.scroll] = thumbPositionPercentage * wrapElement.current[bar.scrollSize] / 100;
|
|
67
|
+
}
|
|
68
|
+
function clickThumbHandler(e) {
|
|
69
|
+
var _a;
|
|
70
|
+
e.stopPropagation();
|
|
71
|
+
if (e.ctrlKey || [1, 2].includes(e.button)) return;
|
|
72
|
+
(_a = window.getSelection()) === null || _a === void 0 ? void 0 : _a.removeAllRanges();
|
|
73
|
+
startDrag(e);
|
|
74
|
+
var el = e.currentTarget;
|
|
75
|
+
if (!el) return;
|
|
76
|
+
thumbState.current[bar.axis] = el[bar.offset] - (e[bar.client] - el.getBoundingClientRect()[bar.direction]);
|
|
77
|
+
}
|
|
78
|
+
function startDrag(e) {
|
|
79
|
+
e.persist();
|
|
80
|
+
cursorDown.current = true;
|
|
81
|
+
document.addEventListener('mousemove', mouseMoveDocumentHandler);
|
|
82
|
+
document.addEventListener('mouseup', mouseUpDocumentHandler);
|
|
83
|
+
originalOnSelectStart.current = document.onselectstart;
|
|
84
|
+
document.onselectstart = function () {
|
|
85
|
+
return false;
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
function mouseMoveDocumentHandler(e) {
|
|
89
|
+
if (!instance.current || !thumb.current) return;
|
|
90
|
+
if (cursorDown.current === false) return;
|
|
91
|
+
var prevPage = thumbState.current[bar.axis];
|
|
92
|
+
if (!prevPage) return;
|
|
93
|
+
var offset = (instance.current.getBoundingClientRect()[bar.direction] - e[bar.client]) * -1;
|
|
94
|
+
var thumbClickPosition = thumb.current[bar.offset] - prevPage;
|
|
95
|
+
var thumbPositionPercentage = (offset - thumbClickPosition) * 100 * getOffsetRatio() / instance.current[bar.offset];
|
|
96
|
+
wrapElement.current[bar.scroll] = thumbPositionPercentage * wrapElement.current[bar.scrollSize] / 100;
|
|
97
|
+
}
|
|
98
|
+
function mouseUpDocumentHandler() {
|
|
99
|
+
cursorDown.current = false;
|
|
100
|
+
thumbState.current[bar.axis] = 0;
|
|
101
|
+
document.removeEventListener('mousemove', mouseMoveDocumentHandler);
|
|
102
|
+
document.removeEventListener('mouseup', mouseUpDocumentHandler);
|
|
103
|
+
restoreOnselectstart();
|
|
104
|
+
if (cursorLeave.current) setVisible(false);
|
|
105
|
+
}
|
|
106
|
+
function restoreOnselectstart() {
|
|
107
|
+
if (document.onselectstart !== originalOnSelectStart.current) document.onselectstart = originalOnSelectStart.current;
|
|
108
|
+
}
|
|
109
|
+
var thumbStyle = (0, _util.renderThumbStyle)({
|
|
110
|
+
size: props.size,
|
|
111
|
+
move: props.move,
|
|
112
|
+
bar: bar
|
|
113
|
+
});
|
|
114
|
+
return _react["default"].createElement("div", {
|
|
115
|
+
hidden: !(props.always || visible),
|
|
116
|
+
className: (0, _classnames["default"])('tntd-scroll-bar-bar', bar.key),
|
|
117
|
+
ref: instance,
|
|
118
|
+
onMouseDown: clickTrackHandler
|
|
119
|
+
}, _react["default"].createElement("div", {
|
|
120
|
+
className: "tntd-scroll-bar-thumb",
|
|
121
|
+
style: thumbStyle,
|
|
122
|
+
ref: thumb,
|
|
123
|
+
onMouseDown: clickThumbHandler
|
|
124
|
+
}));
|
|
125
|
+
}
|