tntd 2.8.39 → 2.8.40
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/hooks/useScrollLock.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/array-input/index.js +26 -13
- package/es/array-input/index.js.map +1 -1
- package/es/array-input/index.less +123 -1
- package/es/array-input/utils.js +71 -0
- package/es/array-input/utils.js.map +1 -0
- package/es/check-card/group.js +8 -8
- package/es/check-card/index.js +6 -6
- package/es/checkbox/checkbox-group.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/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/index.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/preview-text/index.js +7 -7
- package/es/query-form/Field/Checkbox.js +1 -1
- package/es/query-form/Field/Select.js +6 -6
- package/es/query-form/Field/SelectInput.js +6 -6
- package/es/query-form/Field/fieldsMap.js +1 -1
- package/es/query-form/Field/index.js +10 -10
- 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-list-scene/List.js +13 -13
- package/es/query-list-scene/QueryForm.js +10 -10
- 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/index.js +1 -1
- package/es/radio/radio-group.js +1 -1
- package/es/render-empty/render-empty.js +1 -1
- package/es/segmented/index.js +2 -2
- package/es/select/select.js +2 -2
- package/es/steps/steps.js +2 -2
- package/es/svg-components/index.js +1 -1
- package/es/switch/switch.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/total-shower.js +1 -1
- package/es/table/utils.js +1 -1
- package/es/table-container/index.js +1 -1
- package/es/tabs-container/index.js +1 -1
- package/es/tag/tag.js +2 -2
- package/es/title/index.js +1 -1
- 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 +9 -10
- 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 +1 -1
- 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 +15 -14
- package/lib/_util/hooks/useForceUpdate.js +15 -14
- package/lib/_util/hooks/useScrollLock.js +15 -14
- package/lib/_util/responsiveObserve.js +13 -7
- package/lib/_util/styleChecker.js +3 -3
- package/lib/actions/index.js +3 -3
- package/lib/array-input/index.d.ts.map +1 -1
- package/lib/array-input/index.js +54 -34
- package/lib/array-input/index.js.map +1 -1
- package/lib/array-input/index.less +123 -1
- package/lib/array-input/utils.d.ts +2 -0
- package/lib/array-input/utils.d.ts.map +1 -0
- package/lib/array-input/utils.js +414 -0
- package/lib/array-input/utils.js.map +1 -0
- package/lib/check-card/group.js +24 -23
- package/lib/check-card/index.js +31 -24
- package/lib/checkbox/checkbox-group.js +3 -3
- package/lib/color-picker/ColorPicker.js +31 -24
- 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/descriptions/descriptions.js +19 -13
- package/lib/development-login/LoginModal.js +31 -24
- package/lib/development-login/index.js +15 -14
- package/lib/drawer/drawer.js +16 -10
- package/lib/ellipsis/Svg/CopySVG.js +3 -3
- package/lib/ellipsis/Svg/TickSVG.js +3 -3
- package/lib/ellipsis/index.js +18 -17
- package/lib/empty/empty.js +16 -10
- package/lib/empty/empty.stories.js +9 -6
- package/lib/exception/exception.js +3 -3
- package/lib/form/form.js +16 -10
- package/lib/grid-v4/col.js +16 -10
- package/lib/grid-v4/hooks/useBreakpoint.js +3 -3
- package/lib/grid-v4/index.js +3 -3
- package/lib/grid-v4/row.js +31 -24
- 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 +70 -44
- package/lib/icon/components/index.js +3 -3
- package/lib/icon/components/utils.js +18 -10
- package/lib/icon/index.js +33 -26
- 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 +18 -17
- package/lib/img/index.js +18 -17
- package/lib/index.js +3 -3
- package/lib/input/input.js +16 -10
- package/lib/input-number/index.js +3 -3
- package/lib/label/index.js +16 -10
- package/lib/loading-button/index.js +18 -17
- 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 +33 -26
- package/lib/page-container/index.js +3 -3
- package/lib/page-loading/index.js +3 -3
- package/lib/preview-text/index.js +9 -9
- package/lib/query-form/Field/Checkbox.js +3 -3
- package/lib/query-form/Field/Select.js +31 -24
- package/lib/query-form/Field/SelectInput.js +31 -24
- package/lib/query-form/Field/fieldsMap.js +3 -3
- package/lib/query-form/Field/index.js +73 -47
- package/lib/query-form/createActions.js +3 -3
- package/lib/query-form/index.js +70 -44
- package/lib/query-form/useForm.js +3 -3
- package/lib/query-list-scene/List.js +61 -41
- package/lib/query-list-scene/QueryForm.js +70 -44
- package/lib/query-list-scene/QueryListScene.js +70 -44
- package/lib/query-list-scene/Title.js +3 -3
- package/lib/query-list-scene/Toolbar.js +16 -10
- 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/index.js +3 -3
- package/lib/radio/radio-group.js +3 -3
- package/lib/render-empty/render-empty.js +3 -3
- package/lib/segmented/index.js +16 -10
- package/lib/select/select.js +16 -10
- package/lib/steps/steps.js +16 -10
- package/lib/svg-components/index.js +3 -3
- package/lib/switch/switch.js +3 -3
- package/lib/table/hooks/use-column-setting.js +15 -14
- package/lib/table/hooks/use-expand-fixed.js +36 -30
- package/lib/table/resizableTable/index.js +31 -24
- package/lib/table/table-hoc.js +3 -3
- package/lib/table/table.js +34 -27
- package/lib/table/table.stories.js +16 -10
- package/lib/table/total-shower.js +3 -3
- package/lib/table/utils.js +3 -3
- package/lib/table-container/index.js +3 -3
- package/lib/tabs-container/index.js +3 -3
- package/lib/tag/tag.js +16 -10
- package/lib/title/index.js +3 -3
- 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 +16 -10
- package/lib/tntd-cascader/AntdCascader/config/utils.js +16 -10
- package/lib/tntd-cascader/AntdCascader/index.js +33 -26
- package/lib/tntd-cascader/index.js +3 -3
- package/lib/tntd-cascader/rc-cascader/Cascader.js +24 -23
- package/lib/tntd-cascader/rc-cascader/OptionList/Checkbox.js +16 -10
- package/lib/tntd-cascader/rc-cascader/OptionList/Column.js +33 -26
- package/lib/tntd-cascader/rc-cascader/OptionList/index.js +37 -30
- package/lib/tntd-cascader/rc-cascader/OptionList/useActive.js +18 -17
- package/lib/tntd-cascader/rc-cascader/OptionList/useKeyboard.js +24 -23
- package/lib/tntd-cascader/rc-cascader/hooks/useDisplayValues.js +17 -16
- package/lib/tntd-cascader/rc-cascader/hooks/useSearchConfig.js +3 -3
- package/lib/tntd-cascader/rc-cascader/hooks/useSearchOptions.js +30 -23
- 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 +33 -26
- package/lib/tntd-form/Form.js +31 -24
- package/lib/tntd-form/FormItem/ItemHolder.js +31 -24
- package/lib/tntd-form/FormItem/index.js +24 -23
- package/lib/tntd-form/FormItemInput.js +3 -3
- package/lib/tntd-form/FormItemLabel.js +16 -10
- package/lib/tntd-form/FormList.js +3 -3
- package/lib/tntd-form/context.js +3 -3
- package/lib/tntd-form/hooks/useDebounce.js +15 -14
- package/lib/tntd-form/hooks/useForm.js +18 -17
- package/lib/tntd-form/hooks/useFormItemStatus.js +3 -3
- package/lib/tntd-form/hooks/useFrameState.js +18 -17
- package/lib/tntd-form/index.js +3 -3
- package/lib/tntd-icon/index.js +3 -3
- package/lib/tntd-layout/AppList.js +24 -20
- package/lib/tntd-layout/Application.js +24 -20
- package/lib/tntd-layout/Avatar.js +9 -6
- package/lib/tntd-layout/CompatibleLanguage.js +24 -20
- package/lib/tntd-layout/EnterpriseLayout/Avatar.js +9 -6
- package/lib/tntd-layout/EnterpriseLayout/Language.js +24 -20
- package/lib/tntd-layout/EnterpriseLayout/Theme.js +24 -20
- package/lib/tntd-layout/EnterpriseLayout/index.js +3 -3
- package/lib/tntd-layout/GlobalNavigation/NavigationPopup.js +24 -20
- package/lib/tntd-layout/GlobalNavigation/index.js +30 -26
- package/lib/tntd-layout/Header.js +9 -6
- package/lib/tntd-layout/HeaderActions.js +9 -6
- package/lib/tntd-layout/HeaderNavs.js +24 -20
- package/lib/tntd-layout/HeaderTabs.js +37 -27
- package/lib/tntd-layout/Iconfont.js +3 -3
- package/lib/tntd-layout/Language.js +24 -20
- package/lib/tntd-layout/Layout.js +24 -20
- package/lib/tntd-layout/Logo.js +9 -6
- package/lib/tntd-layout/OrgAppList.js +24 -20
- package/lib/tntd-layout/SideMenu.js +24 -20
- package/lib/tntd-layout/Theme.js +24 -20
- 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 +24 -20
- package/lib/tntd-layout/paaslayout/Header.js +9 -6
- package/lib/tntd-layout/paaslayout/Logo.js +9 -6
- package/lib/tntd-layout/paaslayout/SideMenu.js +24 -20
- package/lib/tntd-layout/paaslayout/index.js +24 -20
- package/lib/tntd-layout/storage.js +3 -3
- package/lib/tntd-modal/index.js +31 -24
- package/lib/tntd-rc-select/_util/PurePanel.js +18 -17
- 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 +16 -10
- package/lib/tntd-rc-select/index.js +16 -10
- 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 +18 -17
- package/lib/tntd-reference/ReferenceCheck/index.js +3 -3
- package/lib/tntd-reference/ReferenceDrawer/index.js +18 -17
- 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 +54 -34
- package/lib/tntd-select/index.js +57 -40
- package/lib/tntd-virtual-tree/index.js +24 -23
- package/lib/tntd-virtual-tree/utils.js +66 -62
- package/lib/tntd-virtual-tree-select/index.js +23 -22
- package/lib/tntd-virtual-tree-select/utils.js +21 -20
- package/lib/tooltip/tooltip.js +3 -3
- package/lib/upload/index.js +45 -41
- package/lib/upload/svg/UploadSVG.js +3 -3
- package/lib/utils/checkAuth.js +6 -6
- package/lib/utils/index.js +21 -20
- package/lib/utils/lang.js +3 -3
- package/lib/water-mark/index.js +18 -17
- package/package.json +2 -2
- package/es/alert/alert.js +0 -93
- package/es/alert/alert.js.map +0 -1
- package/es/anchor/anchor.js +0 -96
- package/es/anchor/anchor.js.map +0 -1
- package/es/array-input/icon.js +0 -32
- package/es/array-input/icon.js.map +0 -1
- package/es/cascader/cascader.js +0 -49
- package/es/cascader/cascader.js.map +0 -1
- package/es/checkbox/checkbox.js +0 -65
- package/es/checkbox/checkbox.js.map +0 -1
- package/es/date-picker/DatePicker.js +0 -128
- package/es/date-picker/DatePicker.js.map +0 -1
- package/es/input-number/inputNumber.js +0 -54
- package/es/input-number/inputNumber.js.map +0 -1
- package/es/page-loading/loading1.gif +0 -0
- package/es/popconfirm/popconfirm.js +0 -61
- package/es/popconfirm/popconfirm.js.map +0 -1
- package/es/popover/popover.js +0 -55
- package/es/popover/popover.js.map +0 -1
- package/es/progress/progress.js +0 -148
- package/es/progress/progress.js.map +0 -1
- package/es/query-form/Field/Composition/FieldPopover.js +0 -464
- package/es/query-form/Field/Composition/FieldPopover.js.map +0 -1
- package/es/query-form/Field/Composition/FieldPopover.less +0 -35
- package/es/query-form/Field/Composition/Select.js +0 -260
- package/es/query-form/Field/Composition/Select.js.map +0 -1
- package/es/query-form/Field/Composition/SelectInput.js +0 -112
- package/es/query-form/Field/Composition/SelectInput.js.map +0 -1
- package/es/query-form/Field/Composition/ValueTag.js +0 -240
- package/es/query-form/Field/Composition/ValueTag.js.map +0 -1
- package/es/query-form/Field/Composition/index.js +0 -448
- package/es/query-form/Field/Composition/index.js.map +0 -1
- package/es/query-form/Field/Composition/index.less +0 -145
- package/es/query-form/Field/Composition/utils.js +0 -173
- package/es/query-form/Field/Composition/utils.js.map +0 -1
- package/es/query-form-v2/index.less +0 -133
- package/es/radio/radio.js +0 -75
- package/es/radio/radio.js.map +0 -1
- package/es/scroll-bar/Bar.js +0 -169
- package/es/scroll-bar/Bar.js.map +0 -1
- package/es/scroll-bar/Context.js +0 -17
- package/es/scroll-bar/Context.js.map +0 -1
- package/es/scroll-bar/ScrollBar.js +0 -132
- package/es/scroll-bar/ScrollBar.js.map +0 -1
- package/es/scroll-bar/Thumb.js +0 -203
- package/es/scroll-bar/Thumb.js.map +0 -1
- package/es/scroll-bar/index.js +0 -14
- package/es/scroll-bar/index.js.map +0 -1
- package/es/scroll-bar/scrollBar.less +0 -59
- package/es/scroll-bar/util.js +0 -72
- package/es/scroll-bar/util.js.map +0 -1
- package/es/spin/spin.js +0 -44
- package/es/spin/spin.js.map +0 -1
- package/es/time-picker/TimePicker.js +0 -55
- package/es/time-picker/TimePicker.js.map +0 -1
- package/es/tntd-action/Action.js +0 -141
- package/es/tntd-action/Action.js.map +0 -1
- package/lib/alert/alert.d.ts +0 -12
- package/lib/alert/alert.d.ts.map +0 -1
- package/lib/alert/alert.js +0 -147
- package/lib/alert/alert.js.map +0 -1
- package/lib/anchor/anchor.d.ts +0 -15
- package/lib/anchor/anchor.d.ts.map +0 -1
- package/lib/anchor/anchor.js +0 -131
- package/lib/anchor/anchor.js.map +0 -1
- package/lib/array-input/icon.d.ts +0 -4
- package/lib/array-input/icon.d.ts.map +0 -1
- package/lib/array-input/icon.js +0 -36
- package/lib/array-input/icon.js.map +0 -1
- package/lib/cascader/cascader.d.ts +0 -10
- package/lib/cascader/cascader.d.ts.map +0 -1
- package/lib/cascader/cascader.js +0 -84
- package/lib/cascader/cascader.js.map +0 -1
- package/lib/checkbox/checkbox.d.ts +0 -16
- package/lib/checkbox/checkbox.d.ts.map +0 -1
- package/lib/checkbox/checkbox.js +0 -100
- package/lib/checkbox/checkbox.js.map +0 -1
- package/lib/date-picker/DatePicker.d.ts +0 -21
- package/lib/date-picker/DatePicker.d.ts.map +0 -1
- package/lib/date-picker/DatePicker.js +0 -163
- package/lib/date-picker/DatePicker.js.map +0 -1
- package/lib/input-number/inputNumber.d.ts +0 -10
- package/lib/input-number/inputNumber.d.ts.map +0 -1
- package/lib/input-number/inputNumber.js +0 -89
- package/lib/input-number/inputNumber.js.map +0 -1
- package/lib/page-loading/loading1.gif +0 -0
- package/lib/popconfirm/popconfirm.d.ts +0 -8
- package/lib/popconfirm/popconfirm.d.ts.map +0 -1
- package/lib/popconfirm/popconfirm.js +0 -96
- package/lib/popconfirm/popconfirm.js.map +0 -1
- package/lib/popover/popover.d.ts +0 -14
- package/lib/popover/popover.d.ts.map +0 -1
- package/lib/popover/popover.js +0 -90
- package/lib/popover/popover.js.map +0 -1
- package/lib/progress/progress.d.ts +0 -12
- package/lib/progress/progress.d.ts.map +0 -1
- package/lib/progress/progress.js +0 -179
- package/lib/progress/progress.js.map +0 -1
- package/lib/query-form/Field/Composition/FieldPopover.d.ts +0 -19
- package/lib/query-form/Field/Composition/FieldPopover.d.ts.map +0 -1
- package/lib/query-form/Field/Composition/FieldPopover.js +0 -464
- package/lib/query-form/Field/Composition/FieldPopover.js.map +0 -1
- package/lib/query-form/Field/Composition/FieldPopover.less +0 -35
- package/lib/query-form/Field/Composition/Select.d.ts +0 -4
- package/lib/query-form/Field/Composition/Select.d.ts.map +0 -1
- package/lib/query-form/Field/Composition/Select.js +0 -260
- package/lib/query-form/Field/Composition/Select.js.map +0 -1
- package/lib/query-form/Field/Composition/SelectInput.d.ts +0 -3
- package/lib/query-form/Field/Composition/SelectInput.d.ts.map +0 -1
- package/lib/query-form/Field/Composition/SelectInput.js +0 -112
- package/lib/query-form/Field/Composition/SelectInput.js.map +0 -1
- package/lib/query-form/Field/Composition/ValueTag.d.ts +0 -13
- package/lib/query-form/Field/Composition/ValueTag.d.ts.map +0 -1
- package/lib/query-form/Field/Composition/ValueTag.js +0 -240
- package/lib/query-form/Field/Composition/ValueTag.js.map +0 -1
- package/lib/query-form/Field/Composition/index.d.ts +0 -15
- package/lib/query-form/Field/Composition/index.d.ts.map +0 -1
- package/lib/query-form/Field/Composition/index.js +0 -448
- package/lib/query-form/Field/Composition/index.js.map +0 -1
- package/lib/query-form/Field/Composition/index.less +0 -145
- package/lib/query-form/Field/Composition/utils.d.ts +0 -21
- package/lib/query-form/Field/Composition/utils.d.ts.map +0 -1
- package/lib/query-form/Field/Composition/utils.js +0 -173
- package/lib/query-form/Field/Composition/utils.js.map +0 -1
- package/lib/query-form-v2/index.less +0 -133
- package/lib/radio/radio.d.ts +0 -17
- package/lib/radio/radio.d.ts.map +0 -1
- package/lib/radio/radio.js +0 -110
- package/lib/radio/radio.js.map +0 -1
- package/lib/scroll-bar/Bar.d.ts +0 -4
- package/lib/scroll-bar/Bar.d.ts.map +0 -1
- package/lib/scroll-bar/Bar.js +0 -169
- package/lib/scroll-bar/Bar.js.map +0 -1
- package/lib/scroll-bar/Context.d.ts +0 -7
- package/lib/scroll-bar/Context.d.ts.map +0 -1
- package/lib/scroll-bar/Context.js +0 -17
- package/lib/scroll-bar/Context.js.map +0 -1
- package/lib/scroll-bar/ScrollBar.d.ts +0 -4
- package/lib/scroll-bar/ScrollBar.d.ts.map +0 -1
- package/lib/scroll-bar/ScrollBar.js +0 -132
- package/lib/scroll-bar/ScrollBar.js.map +0 -1
- package/lib/scroll-bar/Thumb.d.ts +0 -3
- package/lib/scroll-bar/Thumb.d.ts.map +0 -1
- package/lib/scroll-bar/Thumb.js +0 -203
- package/lib/scroll-bar/Thumb.js.map +0 -1
- package/lib/scroll-bar/index.d.ts +0 -3
- package/lib/scroll-bar/index.d.ts.map +0 -1
- package/lib/scroll-bar/index.js +0 -14
- package/lib/scroll-bar/index.js.map +0 -1
- package/lib/scroll-bar/scrollBar.less +0 -59
- package/lib/scroll-bar/util.d.ts +0 -40
- package/lib/scroll-bar/util.d.ts.map +0 -1
- package/lib/scroll-bar/util.js +0 -72
- package/lib/scroll-bar/util.js.map +0 -1
- package/lib/spin/spin.d.ts +0 -9
- package/lib/spin/spin.d.ts.map +0 -1
- package/lib/spin/spin.js +0 -79
- package/lib/spin/spin.js.map +0 -1
- package/lib/time-picker/TimePicker.d.ts +0 -9
- package/lib/time-picker/TimePicker.d.ts.map +0 -1
- package/lib/time-picker/TimePicker.js +0 -90
- package/lib/time-picker/TimePicker.js.map +0 -1
- package/lib/tntd-action/Action.d.ts +0 -6
- package/lib/tntd-action/Action.d.ts.map +0 -1
- package/lib/tntd-action/Action.js +0 -218
- package/lib/tntd-action/Action.js.map +0 -1
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(o) {
|
|
4
|
-
"@babel/helpers - typeof";
|
|
5
|
-
|
|
6
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
7
|
-
return typeof o;
|
|
8
|
-
} : function (o) {
|
|
9
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
10
|
-
}, _typeof(o);
|
|
11
|
-
}
|
|
12
|
-
Object.defineProperty(exports, "__esModule", {
|
|
13
|
-
value: true
|
|
14
|
-
});
|
|
15
|
-
exports["default"] = void 0;
|
|
16
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
17
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
18
|
-
var _Bar = _interopRequireDefault(require("./Bar"));
|
|
19
|
-
var _Context = _interopRequireDefault(require("./Context"));
|
|
20
|
-
function _getRequireWildcardCache(e) {
|
|
21
|
-
if ("function" != typeof WeakMap) return null;
|
|
22
|
-
var r = new WeakMap(),
|
|
23
|
-
t = new WeakMap();
|
|
24
|
-
return (_getRequireWildcardCache = function _getRequireWildcardCache(e) {
|
|
25
|
-
return e ? t : r;
|
|
26
|
-
})(e);
|
|
27
|
-
}
|
|
28
|
-
function _interopRequireWildcard(e, r) {
|
|
29
|
-
if (!r && e && e.__esModule) return e;
|
|
30
|
-
if (null === e || "object" != _typeof(e) && "function" != typeof e) return {
|
|
31
|
-
"default": e
|
|
32
|
-
};
|
|
33
|
-
var t = _getRequireWildcardCache(r);
|
|
34
|
-
if (t && t.has(e)) return t.get(e);
|
|
35
|
-
var n = {
|
|
36
|
-
__proto__: null
|
|
37
|
-
},
|
|
38
|
-
a = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
39
|
-
for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) {
|
|
40
|
-
var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;
|
|
41
|
-
i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u];
|
|
42
|
-
}
|
|
43
|
-
return n["default"] = e, t && t.set(e, n), n;
|
|
44
|
-
}
|
|
45
|
-
function _interopRequireDefault(obj) {
|
|
46
|
-
return obj && obj.__esModule ? obj : {
|
|
47
|
-
"default": obj
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
51
|
-
var t = {};
|
|
52
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
53
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
54
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
55
|
-
}
|
|
56
|
-
return t;
|
|
57
|
-
};
|
|
58
|
-
var _default = exports["default"] = (0, _react.forwardRef)(function (_a, ref) {
|
|
59
|
-
var children = _a.children,
|
|
60
|
-
_a$minSize = _a.minSize,
|
|
61
|
-
minSize = _a$minSize === void 0 ? 20 : _a$minSize,
|
|
62
|
-
props = __rest(_a, ["children", "minSize"]);
|
|
63
|
-
var scrollbarElement = (0, _react.useRef)();
|
|
64
|
-
var wrapElement = (0, _react.useRef)();
|
|
65
|
-
wrapElement = ref || wrapElement;
|
|
66
|
-
var resizeRef = (0, _react.useRef)();
|
|
67
|
-
var barRef = (0, _react.useRef)();
|
|
68
|
-
(0, _react.useEffect)(function () {
|
|
69
|
-
var wrapDom = wrapElement.current;
|
|
70
|
-
var resizeDom = resizeRef.current;
|
|
71
|
-
// 监听容器尺寸变化,因为尺寸可以设置类似height:100vh之类样式,高度并不是固定的
|
|
72
|
-
var observerCallback = function observerCallback() {
|
|
73
|
-
return requestAnimationFrame(function () {
|
|
74
|
-
var _a;
|
|
75
|
-
update();
|
|
76
|
-
(_a = barRef.current) === null || _a === void 0 ? void 0 : _a.handleScroll();
|
|
77
|
-
});
|
|
78
|
-
};
|
|
79
|
-
var observer = new ResizeObserver(observerCallback);
|
|
80
|
-
observer.observe(wrapDom);
|
|
81
|
-
observer.observe(resizeDom);
|
|
82
|
-
return function () {
|
|
83
|
-
observer.unobserve(wrapDom);
|
|
84
|
-
observer.unobserve(resizeDom);
|
|
85
|
-
};
|
|
86
|
-
}, []);
|
|
87
|
-
(0, _react.useEffect)(function () {
|
|
88
|
-
var _a;
|
|
89
|
-
if (!props["native"]) {
|
|
90
|
-
update();
|
|
91
|
-
(_a = barRef.current) === null || _a === void 0 ? void 0 : _a.handleScroll();
|
|
92
|
-
}
|
|
93
|
-
}, [props["native"]]);
|
|
94
|
-
function update() {
|
|
95
|
-
var _a;
|
|
96
|
-
(_a = barRef.current) === null || _a === void 0 ? void 0 : _a.update();
|
|
97
|
-
}
|
|
98
|
-
function handleScroll(e) {
|
|
99
|
-
var _a, _b;
|
|
100
|
-
(_a = barRef.current) === null || _a === void 0 ? void 0 : _a.handleScroll();
|
|
101
|
-
(_b = props.onScroll) === null || _b === void 0 ? void 0 : _b.call(props, e);
|
|
102
|
-
}
|
|
103
|
-
var wrapStyle = {
|
|
104
|
-
height: props.height,
|
|
105
|
-
maxHeight: props.maxHeight
|
|
106
|
-
};
|
|
107
|
-
var wrapClassName = (0, _classnames["default"])('tntd-scroll-bar-wrap', {
|
|
108
|
-
'tntd-scroll-bar-wrap-hidden-default': !props["native"]
|
|
109
|
-
});
|
|
110
|
-
return _react["default"].createElement(_Context["default"].Provider, {
|
|
111
|
-
value: {
|
|
112
|
-
scrollbarElement: scrollbarElement,
|
|
113
|
-
wrapElement: wrapElement
|
|
114
|
-
}
|
|
115
|
-
}, _react["default"].createElement("div", {
|
|
116
|
-
style: props.style,
|
|
117
|
-
className: (0, _classnames["default"])('tntd-scroll-bar', props.className),
|
|
118
|
-
ref: scrollbarElement
|
|
119
|
-
}, _react["default"].createElement("div", {
|
|
120
|
-
style: wrapStyle,
|
|
121
|
-
className: wrapClassName,
|
|
122
|
-
ref: wrapElement,
|
|
123
|
-
onScroll: handleScroll
|
|
124
|
-
}, _react["default"].createElement("div", {
|
|
125
|
-
className: "tntd-scroll-bar-view",
|
|
126
|
-
ref: resizeRef
|
|
127
|
-
}, children)), !props["native"] && _react["default"].createElement(_Bar["default"], {
|
|
128
|
-
ref: barRef,
|
|
129
|
-
always: props.always,
|
|
130
|
-
minSize: minSize
|
|
131
|
-
})));
|
|
132
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ScrollBar.js","sourceRoot":"","sources":["../../src/scroll-bar/ScrollBar.js"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,IAAI,MAAM,YAAY,CAAA;AAC7B,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAC5D,OAAO,GAAG,MAAM,OAAO,CAAA;AACvB,OAAO,OAAO,MAAM,WAAW,CAAA;AAE/B,eAAe,UAAU,CAAC,CAAC,EAAoC,EAAE,GAAG,EAAE,EAAE;QAA7C,EAAE,QAAQ,EAAE,OAAO,GAAG,EAAE,OAAY,EAAP,KAAK,cAAlC,uBAAoC,CAAF;IAC3D,MAAM,gBAAgB,GAAG,MAAM,EAAE,CAAA;IACjC,IAAI,WAAW,GAAG,MAAM,EAAE,CAAA;IAC1B,WAAW,GAAG,GAAG,IAAI,WA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,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,CAAA;IACtE,MAAM,aAAa,GAAG,IAAI,CAAC,sBAAsB,EAAE;QACjD,qCAAqC,EAAE,CAAC,KAAK,CAAC,MAAM;KACrD,CAAC,CAAA;IAEF,OAAO,CACL,oBAAC,OAAO,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,gBAAgB,EAAE,WAAW,EAAE;QACxD,6BACE,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,SAAS,EAAE,IAAI,CAAC,iBAAiB,EAAE,KAAK,CAAC,SAAS,CAAC,EACnD,GAAG,EAAE,gBAAgB;YAErB,6BAAK,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,GAAG,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY;gBACvF,6BAAK,SAAS,EAAC,sBAAsB,EAAC,GAAG,EAAE,SAAS,IACjD,QAAQ,CACL,CACF;YACL,CAAC,KAAK,CAAC,MAAM,IAAI,oBAAC,GAAG,IAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,GAAI,CAC1E,CACW,CACpB,CAAA;AACH,CAAC,CAAC,CAAA","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"]}
|
package/es/scroll-bar/Thumb.js
DELETED
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(o) {
|
|
4
|
-
"@babel/helpers - typeof";
|
|
5
|
-
|
|
6
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
7
|
-
return typeof o;
|
|
8
|
-
} : function (o) {
|
|
9
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
10
|
-
}, _typeof(o);
|
|
11
|
-
}
|
|
12
|
-
Object.defineProperty(exports, "__esModule", {
|
|
13
|
-
value: true
|
|
14
|
-
});
|
|
15
|
-
exports["default"] = Thumb;
|
|
16
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
17
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
18
|
-
var _Context = _interopRequireDefault(require("./Context"));
|
|
19
|
-
var _util = require("./util");
|
|
20
|
-
function _getRequireWildcardCache(e) {
|
|
21
|
-
if ("function" != typeof WeakMap) return null;
|
|
22
|
-
var r = new WeakMap(),
|
|
23
|
-
t = new WeakMap();
|
|
24
|
-
return (_getRequireWildcardCache = function _getRequireWildcardCache(e) {
|
|
25
|
-
return e ? t : r;
|
|
26
|
-
})(e);
|
|
27
|
-
}
|
|
28
|
-
function _interopRequireWildcard(e, r) {
|
|
29
|
-
if (!r && e && e.__esModule) return e;
|
|
30
|
-
if (null === e || "object" != _typeof(e) && "function" != typeof e) return {
|
|
31
|
-
"default": e
|
|
32
|
-
};
|
|
33
|
-
var t = _getRequireWildcardCache(r);
|
|
34
|
-
if (t && t.has(e)) return t.get(e);
|
|
35
|
-
var n = {
|
|
36
|
-
__proto__: null
|
|
37
|
-
},
|
|
38
|
-
a = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
39
|
-
for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) {
|
|
40
|
-
var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;
|
|
41
|
-
i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u];
|
|
42
|
-
}
|
|
43
|
-
return n["default"] = e, t && t.set(e, n), n;
|
|
44
|
-
}
|
|
45
|
-
function _interopRequireDefault(obj) {
|
|
46
|
-
return obj && obj.__esModule ? obj : {
|
|
47
|
-
"default": obj
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
function _slicedToArray(arr, i) {
|
|
51
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
52
|
-
}
|
|
53
|
-
function _nonIterableRest() {
|
|
54
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
55
|
-
}
|
|
56
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
57
|
-
if (!o) return;
|
|
58
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
59
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
60
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
61
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
62
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
63
|
-
}
|
|
64
|
-
function _arrayLikeToArray(arr, len) {
|
|
65
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
66
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
67
|
-
return arr2;
|
|
68
|
-
}
|
|
69
|
-
function _iterableToArrayLimit(r, l) {
|
|
70
|
-
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
71
|
-
if (null != t) {
|
|
72
|
-
var e,
|
|
73
|
-
n,
|
|
74
|
-
i,
|
|
75
|
-
u,
|
|
76
|
-
a = [],
|
|
77
|
-
f = !0,
|
|
78
|
-
o = !1;
|
|
79
|
-
try {
|
|
80
|
-
if (i = (t = t.call(r)).next, 0 === l) {
|
|
81
|
-
if (Object(t) !== t) return;
|
|
82
|
-
f = !1;
|
|
83
|
-
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
84
|
-
} catch (r) {
|
|
85
|
-
o = !0, n = r;
|
|
86
|
-
} finally {
|
|
87
|
-
try {
|
|
88
|
-
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
|
|
89
|
-
} finally {
|
|
90
|
-
if (o) throw n;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
return a;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
function _arrayWithHoles(arr) {
|
|
97
|
-
if (Array.isArray(arr)) return arr;
|
|
98
|
-
}
|
|
99
|
-
function Thumb(props) {
|
|
100
|
-
var _useContext = (0, _react.useContext)(_Context["default"]),
|
|
101
|
-
scrollbarElement = _useContext.scrollbarElement,
|
|
102
|
-
wrapElement = _useContext.wrapElement;
|
|
103
|
-
var instance = (0, _react.useRef)();
|
|
104
|
-
var thumb = (0, _react.useRef)();
|
|
105
|
-
var _useState = (0, _react.useState)(false),
|
|
106
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
107
|
-
visible = _useState2[0],
|
|
108
|
-
setVisible = _useState2[1];
|
|
109
|
-
// 当作非响应式变量使用
|
|
110
|
-
var thumbState = (0, _react.useRef)({});
|
|
111
|
-
var cursorDown = (0, _react.useRef)(false);
|
|
112
|
-
var cursorLeave = (0, _react.useRef)(false);
|
|
113
|
-
var originalOnSelectStart = (0, _react.useRef)(document.onselectstart);
|
|
114
|
-
var bar = _util.BAR_MAP[props.vertical ? 'vertical' : 'horizontal'];
|
|
115
|
-
(0, _react.useEffect)(function () {
|
|
116
|
-
var element = scrollbarElement.current;
|
|
117
|
-
element.addEventListener('mousemove', mouseMoveScrollbarHandler);
|
|
118
|
-
element.addEventListener('mouseleave', mouseLeaveScrollbarHandler);
|
|
119
|
-
return function () {
|
|
120
|
-
restoreOnselectstart();
|
|
121
|
-
document.removeEventListener('mouseup', mouseUpDocumentHandler);
|
|
122
|
-
element.removeEventListener('mousemove', mouseMoveScrollbarHandler);
|
|
123
|
-
element.removeEventListener('mouseleave', mouseLeaveScrollbarHandler);
|
|
124
|
-
};
|
|
125
|
-
}, []);
|
|
126
|
-
function mouseMoveScrollbarHandler() {
|
|
127
|
-
cursorLeave.current = false;
|
|
128
|
-
setVisible(true);
|
|
129
|
-
}
|
|
130
|
-
function mouseLeaveScrollbarHandler() {
|
|
131
|
-
cursorLeave.current = true;
|
|
132
|
-
setVisible(cursorDown.current);
|
|
133
|
-
}
|
|
134
|
-
function getOffsetRatio() {
|
|
135
|
-
return Math.pow(instance.current[bar.offset], 2) / wrapElement.current[bar.scrollSize] / props.ratio / thumb.current[bar.offset];
|
|
136
|
-
}
|
|
137
|
-
function clickTrackHandler(e) {
|
|
138
|
-
if (!thumb.current || !instance.current || !wrapElement.current) return;
|
|
139
|
-
// 鼠标点击的坐标距离顶端的距离
|
|
140
|
-
var offset = Math.abs(e.target.getBoundingClientRect()[bar.direction] - e[bar.client]);
|
|
141
|
-
var thumbHalf = thumb.current[bar.offset] / 2;
|
|
142
|
-
var thumbPositionPercentage = (offset - thumbHalf) * 100 * getOffsetRatio() / instance.current[bar.offset];
|
|
143
|
-
// 直接给scrollTop赋值,就会调用bar组件的handleScroll函数
|
|
144
|
-
wrapElement.current[bar.scroll] = thumbPositionPercentage * wrapElement.current[bar.scrollSize] / 100;
|
|
145
|
-
}
|
|
146
|
-
function clickThumbHandler(e) {
|
|
147
|
-
var _a;
|
|
148
|
-
e.stopPropagation();
|
|
149
|
-
if (e.ctrlKey || [1, 2].includes(e.button)) return;
|
|
150
|
-
(_a = window.getSelection()) === null || _a === void 0 ? void 0 : _a.removeAllRanges();
|
|
151
|
-
startDrag(e);
|
|
152
|
-
var el = e.currentTarget;
|
|
153
|
-
if (!el) return;
|
|
154
|
-
thumbState.current[bar.axis] = el[bar.offset] - (e[bar.client] - el.getBoundingClientRect()[bar.direction]);
|
|
155
|
-
}
|
|
156
|
-
function startDrag(e) {
|
|
157
|
-
e.persist();
|
|
158
|
-
cursorDown.current = true;
|
|
159
|
-
document.addEventListener('mousemove', mouseMoveDocumentHandler);
|
|
160
|
-
document.addEventListener('mouseup', mouseUpDocumentHandler);
|
|
161
|
-
originalOnSelectStart.current = document.onselectstart;
|
|
162
|
-
document.onselectstart = function () {
|
|
163
|
-
return false;
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
|
-
function mouseMoveDocumentHandler(e) {
|
|
167
|
-
if (!instance.current || !thumb.current) return;
|
|
168
|
-
if (cursorDown.current === false) return;
|
|
169
|
-
var prevPage = thumbState.current[bar.axis];
|
|
170
|
-
if (!prevPage) return;
|
|
171
|
-
var offset = (instance.current.getBoundingClientRect()[bar.direction] - e[bar.client]) * -1;
|
|
172
|
-
var thumbClickPosition = thumb.current[bar.offset] - prevPage;
|
|
173
|
-
var thumbPositionPercentage = (offset - thumbClickPosition) * 100 * getOffsetRatio() / instance.current[bar.offset];
|
|
174
|
-
wrapElement.current[bar.scroll] = thumbPositionPercentage * wrapElement.current[bar.scrollSize] / 100;
|
|
175
|
-
}
|
|
176
|
-
function mouseUpDocumentHandler() {
|
|
177
|
-
cursorDown.current = false;
|
|
178
|
-
thumbState.current[bar.axis] = 0;
|
|
179
|
-
document.removeEventListener('mousemove', mouseMoveDocumentHandler);
|
|
180
|
-
document.removeEventListener('mouseup', mouseUpDocumentHandler);
|
|
181
|
-
restoreOnselectstart();
|
|
182
|
-
if (cursorLeave.current) setVisible(false);
|
|
183
|
-
}
|
|
184
|
-
function restoreOnselectstart() {
|
|
185
|
-
if (document.onselectstart !== originalOnSelectStart.current) document.onselectstart = originalOnSelectStart.current;
|
|
186
|
-
}
|
|
187
|
-
var thumbStyle = (0, _util.renderThumbStyle)({
|
|
188
|
-
size: props.size,
|
|
189
|
-
move: props.move,
|
|
190
|
-
bar: bar
|
|
191
|
-
});
|
|
192
|
-
return _react["default"].createElement("div", {
|
|
193
|
-
hidden: !(props.always || visible),
|
|
194
|
-
className: (0, _classnames["default"])('tntd-scroll-bar-bar', bar.key),
|
|
195
|
-
ref: instance,
|
|
196
|
-
onMouseDown: clickTrackHandler
|
|
197
|
-
}, _react["default"].createElement("div", {
|
|
198
|
-
className: "tntd-scroll-bar-thumb",
|
|
199
|
-
style: thumbStyle,
|
|
200
|
-
ref: thumb,
|
|
201
|
-
onMouseDown: clickThumbHandler
|
|
202
|
-
}));
|
|
203
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Thumb.js","sourceRoot":"","sources":["../../src/scroll-bar/Thumb.js"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,YAAY,CAAA;AAC7B,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,C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BAAgB,CAAC;QAClC,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,GAAG,EAAE,GAAG;KACT,CAAC,CAAA;IAEF,OAAO,CACL,6BACE,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,IAAI,OAAO,CAAC,EAClC,SAAS,EAAE,IAAI,CAAC,qBAAqB,EAAE,GAAG,CAAC,GAAG,CAAC,EAC/C,GAAG,EAAE,QAAQ,EACb,WAAW,EAAE,iBAAiB;QAE9B,6BACE,SAAS,EAAC,uBAAuB,EACjC,KAAK,EAAE,UAAU,EACjB,GAAG,EAAE,KAAK,EACV,WAAW,EAAE,iBAAiB,GAC9B,CACE,CACP,CAAA;AACH,CAAC","sourcesContent":["import clsx from 'classnames'\nimport React, { useContext, useEffect, useRef, useState } from 'react'\nimport Context from './Context'\nimport { BAR_MAP, renderThumbStyle } from './util'\n\nexport default function Thumb(props) {\n const { scrollbarElement, wrapElement } = useContext(Context)\n const instance = useRef()\n const thumb = useRef()\n const [visible, setVisible] = useState(false)\n // 当作非响应式变量使用\n const thumbState = useRef({})\n const cursorDown = useRef(false)\n const cursorLeave = useRef(false)\n const originalOnSelectStart = useRef(document.onselectstart)\n const bar = BAR_MAP[props.vertical ? 'vertical' : 'horizontal']\n\n useEffect(() => {\n const element = scrollbarElement.current\n element.addEventListener('mousemove', mouseMoveScrollbarHandler)\n element.addEventListener('mouseleave', mouseLeaveScrollbarHandler)\n return () => {\n restoreOnselectstart()\n document.removeEventListener('mouseup', mouseUpDocumentHandler)\n element.removeEventListener('mousemove', mouseMoveScrollbarHandler)\n element.removeEventListener('mouseleave', mouseLeaveScrollbarHandler)\n }\n }, [])\n\n function mouseMoveScrollbarHandler() {\n cursorLeave.current = false\n setVisible(true)\n }\n\n function mouseLeaveScrollbarHandler() {\n cursorLeave.current = true\n setVisible(cursorDown.current)\n }\n\n function getOffsetRatio() {\n return (\n instance.current[bar.offset] ** 2 /\n wrapElement.current[bar.scrollSize] /\n props.ratio /\n thumb.current[bar.offset]\n )\n }\n\n function clickTrackHandler(e) {\n if (!thumb.current || !instance.current || !wrapElement.current) return\n // 鼠标点击的坐标距离顶端的距离\n const offset = Math.abs(e.target.getBoundingClientRect()[bar.direction] - e[bar.client])\n const thumbHalf = thumb.current[bar.offset] / 2\n const thumbPositionPercentage =\n ((offset - thumbHalf) * 100 * getOffsetRatio()) / instance.current[bar.offset]\n // 直接给scrollTop赋值,就会调用bar组件的handleScroll函数\n wrapElement.current[bar.scroll] =\n (thumbPositionPercentage * wrapElement.current[bar.scrollSize]) / 100\n }\n\n function clickThumbHandler(e) {\n e.stopPropagation()\n if (e.ctrlKey || [1, 2].includes(e.button)) return\n window.getSelection()?.removeAllRanges()\n startDrag(e)\n\n const el = e.currentTarget\n if (!el) return\n thumbState.current[bar.axis] =\n el[bar.offset] - (e[bar.client] - el.getBoundingClientRect()[bar.direction])\n }\n\n function startDrag(e) {\n e.persist()\n cursorDown.current = true\n document.addEventListener('mousemove', mouseMoveDocumentHandler)\n document.addEventListener('mouseup', mouseUpDocumentHandler)\n originalOnSelectStart.current = document.onselectstart\n document.onselectstart = () => false\n }\n\n function mouseMoveDocumentHandler(e) {\n if (!instance.current || !thumb.current) return\n if (cursorDown.current === false) return\n const prevPage = thumbState.current[bar.axis]\n if (!prevPage) return\n\n const offset = (instance.current.getBoundingClientRect()[bar.direction] - e[bar.client]) * -1\n const thumbClickPosition = thumb.current[bar.offset] - prevPage\n const thumbPositionPercentage =\n ((offset - thumbClickPosition) * 100 * getOffsetRatio()) / instance.current[bar.offset]\n wrapElement.current[bar.scroll] =\n (thumbPositionPercentage * wrapElement.current[bar.scrollSize]) / 100\n }\n\n function mouseUpDocumentHandler() {\n cursorDown.current = false\n thumbState.current[bar.axis] = 0\n document.removeEventListener('mousemove', mouseMoveDocumentHandler)\n document.removeEventListener('mouseup', mouseUpDocumentHandler)\n restoreOnselectstart()\n if (cursorLeave.current) setVisible(false)\n }\n\n function restoreOnselectstart() {\n if (document.onselectstart !== originalOnSelectStart.current)\n document.onselectstart = originalOnSelectStart.current\n }\n\n const thumbStyle = renderThumbStyle({\n size: props.size,\n move: props.move,\n bar: bar,\n })\n\n return (\n <div\n hidden={!(props.always || visible)}\n className={clsx('tntd-scroll-bar-bar', bar.key)}\n ref={instance}\n onMouseDown={clickTrackHandler}\n >\n <div\n className=\"tntd-scroll-bar-thumb\"\n style={thumbStyle}\n ref={thumb}\n onMouseDown={clickThumbHandler}\n />\n </div>\n )\n}\n"]}
|
package/es/scroll-bar/index.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
var _ScrollBar = _interopRequireDefault(require("./ScrollBar"));
|
|
8
|
-
require("./scrollBar.less");
|
|
9
|
-
function _interopRequireDefault(obj) {
|
|
10
|
-
return obj && obj.__esModule ? obj : {
|
|
11
|
-
"default": obj
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
var _default = exports["default"] = _ScrollBar["default"];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/scroll-bar/index.js"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,aAAa,CAAA;AACnC,OAAO,kBAAkB,CAAA;AAEzB,eAAe,SAAS,CAAA","sourcesContent":["import ScrollBar from './ScrollBar'\nimport './scrollBar.less'\n\nexport default ScrollBar\n"]}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
.tntd-scroll-bar {
|
|
2
|
-
position: relative;
|
|
3
|
-
height: 100%;
|
|
4
|
-
overflow: hidden;
|
|
5
|
-
}
|
|
6
|
-
.tntd-scroll-bar-wrap {
|
|
7
|
-
height: 100%;
|
|
8
|
-
overflow: auto;
|
|
9
|
-
}
|
|
10
|
-
.tntd-scroll-bar-wrap-hidden-default {
|
|
11
|
-
scrollbar-width: none;
|
|
12
|
-
&::-webkit-scrollbar {
|
|
13
|
-
display: none;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
.tntd-scroll-bar-view {
|
|
17
|
-
width: fit-content;
|
|
18
|
-
min-width: 100%;
|
|
19
|
-
}
|
|
20
|
-
.tntd-scroll-bar-bar {
|
|
21
|
-
position: absolute;
|
|
22
|
-
right: 2px;
|
|
23
|
-
bottom: 2px;
|
|
24
|
-
z-index: 1;
|
|
25
|
-
border-radius: 4px;
|
|
26
|
-
|
|
27
|
-
&.vertical {
|
|
28
|
-
top: 2px;
|
|
29
|
-
width: 6px;
|
|
30
|
-
|
|
31
|
-
> div {
|
|
32
|
-
width: 100%;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
&.horizontal {
|
|
37
|
-
left: 2px;
|
|
38
|
-
height: 6px;
|
|
39
|
-
|
|
40
|
-
> div {
|
|
41
|
-
height: 100%;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
.tntd-scroll-bar-thumb {
|
|
46
|
-
position: relative;
|
|
47
|
-
display: block;
|
|
48
|
-
width: 0;
|
|
49
|
-
height: 0;
|
|
50
|
-
cursor: pointer;
|
|
51
|
-
background-color: #909399;
|
|
52
|
-
border-radius: inherit;
|
|
53
|
-
opacity: 0.3;
|
|
54
|
-
transition: 0.3s background-color;
|
|
55
|
-
|
|
56
|
-
&:hover {
|
|
57
|
-
opacity: 0.5;
|
|
58
|
-
}
|
|
59
|
-
}
|
package/es/scroll-bar/util.js
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.renderThumbStyle = exports.GAP = exports.BAR_MAP = void 0;
|
|
7
|
-
function _typeof(o) {
|
|
8
|
-
"@babel/helpers - typeof";
|
|
9
|
-
|
|
10
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
11
|
-
return typeof o;
|
|
12
|
-
} : function (o) {
|
|
13
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
14
|
-
}, _typeof(o);
|
|
15
|
-
}
|
|
16
|
-
function _defineProperty(obj, key, value) {
|
|
17
|
-
key = _toPropertyKey(key);
|
|
18
|
-
if (key in obj) {
|
|
19
|
-
Object.defineProperty(obj, key, {
|
|
20
|
-
value: value,
|
|
21
|
-
enumerable: true,
|
|
22
|
-
configurable: true,
|
|
23
|
-
writable: true
|
|
24
|
-
});
|
|
25
|
-
} else {
|
|
26
|
-
obj[key] = value;
|
|
27
|
-
}
|
|
28
|
-
return obj;
|
|
29
|
-
}
|
|
30
|
-
function _toPropertyKey(t) {
|
|
31
|
-
var i = _toPrimitive(t, "string");
|
|
32
|
-
return "symbol" == _typeof(i) ? i : i + "";
|
|
33
|
-
}
|
|
34
|
-
function _toPrimitive(t, r) {
|
|
35
|
-
if ("object" != _typeof(t) || !t) return t;
|
|
36
|
-
var e = t[Symbol.toPrimitive];
|
|
37
|
-
if (void 0 !== e) {
|
|
38
|
-
var i = e.call(t, r || "default");
|
|
39
|
-
if ("object" != _typeof(i)) return i;
|
|
40
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
41
|
-
}
|
|
42
|
-
return ("string" === r ? String : Number)(t);
|
|
43
|
-
}
|
|
44
|
-
var GAP = exports.GAP = 4; // top 2 + bottom 2 of bar instance
|
|
45
|
-
var BAR_MAP = exports.BAR_MAP = {
|
|
46
|
-
vertical: {
|
|
47
|
-
offset: 'offsetHeight',
|
|
48
|
-
scroll: 'scrollTop',
|
|
49
|
-
scrollSize: 'scrollHeight',
|
|
50
|
-
size: 'height',
|
|
51
|
-
key: 'vertical',
|
|
52
|
-
axis: 'Y',
|
|
53
|
-
client: 'clientY',
|
|
54
|
-
direction: 'top'
|
|
55
|
-
},
|
|
56
|
-
horizontal: {
|
|
57
|
-
offset: 'offsetWidth',
|
|
58
|
-
scroll: 'scrollLeft',
|
|
59
|
-
scrollSize: 'scrollWidth',
|
|
60
|
-
size: 'width',
|
|
61
|
-
key: 'horizontal',
|
|
62
|
-
axis: 'X',
|
|
63
|
-
client: 'clientX',
|
|
64
|
-
direction: 'left'
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
var renderThumbStyle = exports.renderThumbStyle = function renderThumbStyle(_ref) {
|
|
68
|
-
var move = _ref.move,
|
|
69
|
-
size = _ref.size,
|
|
70
|
-
bar = _ref.bar;
|
|
71
|
-
return _defineProperty(_defineProperty({}, bar.size, size), "transform", "translate".concat(bar.axis, "(").concat(move, "%)"));
|
|
72
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/scroll-bar/util.js"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,CAAA,CAAC,mCAAmC;AAExD,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,QAAQ,EAAE;QACR,MAAM,EAAE,cAAc;QACtB,MAAM,EAAE,WAAW;QACnB,UAAU,EAAE,cAAc;QAC1B,IAAI,EAAE,QAAQ;QACd,GAAG,EAAE,UAAU;QACf,IAAI,EAAE,GAAG;QACT,MAAM,EAAE,SAAS;QACjB,SAAS,EAAE,KAAK;KACjB;IACD,UAAU,EAAE;QACV,MAAM,EAAE,aAAa;QACrB,MAAM,EAAE,YAAY;QACpB,UAAU,EAAE,aAAa;QACzB,IAAI,EAAE,OAAO;QACb,GAAG,EAAE,YAAY;QACjB,IAAI,EAAE,GAAG;QACT,MAAM,EAAE,SAAS;QACjB,SAAS,EAAE,MAAM;KAClB;CACF,CAAA;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC;IACxD,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI;IAChB,SAAS,EAAE,YAAY,GAAG,CAAC,IAAI,IAAI,IAAI,IAAI;CAC5C,CAAC,CAAA","sourcesContent":["export const GAP = 4 // top 2 + bottom 2 of bar instance\n\nexport const BAR_MAP = {\n vertical: {\n offset: 'offsetHeight',\n scroll: 'scrollTop',\n scrollSize: 'scrollHeight',\n size: 'height',\n key: 'vertical',\n axis: 'Y',\n client: 'clientY',\n direction: 'top',\n },\n horizontal: {\n offset: 'offsetWidth',\n scroll: 'scrollLeft',\n scrollSize: 'scrollWidth',\n size: 'width',\n key: 'horizontal',\n axis: 'X',\n client: 'clientX',\n direction: 'left',\n },\n}\n\nexport const renderThumbStyle = ({ move, size, bar }) => ({\n [bar.size]: size,\n transform: `translate${bar.axis}(${move}%)`,\n})\n"]}
|
package/es/spin/spin.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
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.Spin = void 0;
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _configProvider = require("antd/es/config-provider");
|
|
10
|
-
var _spin = _interopRequireDefault(require("antd/es/spin"));
|
|
11
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
12
|
-
require("./spin.less");
|
|
13
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
14
|
-
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); }
|
|
15
|
-
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; }
|
|
16
|
-
/*
|
|
17
|
-
* @Author: 周泽飞 zefei.zhou@tongdun.net
|
|
18
|
-
* @Date: 2024-07-19 18:49:24
|
|
19
|
-
* @LastEditors: 周泽飞 zefei.zhou@tongdun.net
|
|
20
|
-
* @LastEditTime: 2024-07-19 18:54:42
|
|
21
|
-
* @FilePath: /tntd/packages/tntd/src/spin/spin.tsx
|
|
22
|
-
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
23
|
-
*/
|
|
24
|
-
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
25
|
-
var t = {};
|
|
26
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
27
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
28
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
29
|
-
}
|
|
30
|
-
return t;
|
|
31
|
-
};
|
|
32
|
-
var Spin = exports.Spin = (0, _react.forwardRef)(function (props, ref) {
|
|
33
|
-
var className = props.className,
|
|
34
|
-
wrapperClassName = props.wrapperClassName,
|
|
35
|
-
restProps = __rest(props, ["className", "wrapperClassName"]);
|
|
36
|
-
return _react["default"].createElement(_configProvider.ConfigConsumer, null, function () {
|
|
37
|
-
return _react["default"].createElement(_spin["default"], Object.assign({
|
|
38
|
-
wrapperClassName: (0, _classnames["default"])('tnt-spin-nested', wrapperClassName || ''),
|
|
39
|
-
className: (0, _classnames["default"])('tnt-spin', className || '')
|
|
40
|
-
}, restProps, {
|
|
41
|
-
ref: ref
|
|
42
|
-
}));
|
|
43
|
-
});
|
|
44
|
-
});
|
package/es/spin/spin.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spin.js","sourceRoot":"","sources":["../../src/spin/spin.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;;;;;;;;;;;;AAEH,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,UAAU,MAAM,YAAY,CAAA;AAEnC,OAAO,aAAa,CAAA;AAKpB,MAAM,CAAC,MAAM,IAAI,GAAG,UAAU,CAA0B,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACrE,MAAM,EAAE,SAAS,EAAE,gBAAgB,KAAmB,KAAK,EAAnB,SAAS,UAAK,KAAK,EAArD,iCAA6C,CAAQ,CAAA;IAC3D,OAAO,CACL,oBAAC,cAAc,QACZ,GAAG,EAAE;QACJ,OAAO,CACL,oBAAC,QAAQ,kBACP,gBAAgB,EAAE,UAAU,CAAC,iBAAiB,EAAE,gBAAgB,IAAI,EAAE,CAAC,EACvE,SAAS,EAAE,UAAU,CAAC,UAAU,EAAE,SAAS,IAAI,EAAE,CAAC,IAC9C,SAAS,IACb,GAAG,EAAE,GAAG,IACR,CACH,CAAA;IACH,CAAC,CACc,CAClB,CAAA;AACH,CAAC,CAAkB,CAAA","sourcesContent":["/*\n * @Author: 周泽飞 zefei.zhou@tongdun.net\n * @Date: 2024-07-19 18:49:24\n * @LastEditors: 周泽飞 zefei.zhou@tongdun.net\n * @LastEditTime: 2024-07-19 18:54:42\n * @FilePath: /tntd/packages/tntd/src/spin/spin.tsx\n * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE\n */\n\nimport React, { forwardRef } from 'react'\nimport type { SpinProps as AntdSpinProps } from 'antd/es/spin'\nimport { ConfigConsumer } from 'antd/es/config-provider'\nimport { default as AntdSpin } from 'antd/es/spin'\nimport classNames from 'classnames'\n\nimport './spin.less'\n\ninterface SpinComponent\n extends React.ForwardRefExoticComponent<AntdSpinProps & React.RefAttributes<AntdSpin>> {}\n\nexport const Spin = forwardRef<AntdSpin, AntdSpinProps>((props, ref) => {\n const { className, wrapperClassName, ...restProps } = props\n return (\n <ConfigConsumer>\n {() => {\n return (\n <AntdSpin\n wrapperClassName={classNames('tnt-spin-nested', wrapperClassName || '')}\n className={classNames('tnt-spin', className || '')}\n {...restProps}\n ref={ref}\n />\n )\n }}\n </ConfigConsumer>\n )\n}) as SpinComponent\n"]}
|
|
@@ -1,55 +0,0 @@
|
|
|
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
|
-
var _exportNames = {};
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
var _react = _interopRequireDefault(require("react"));
|
|
10
|
-
var _icon = _interopRequireDefault(require("../icon"));
|
|
11
|
-
var _configProvider = require("antd/es/config-provider");
|
|
12
|
-
var _timePicker = _interopRequireWildcard(require("antd/es/time-picker"));
|
|
13
|
-
Object.keys(_timePicker).forEach(function (key) {
|
|
14
|
-
if (key === "default" || key === "__esModule") return;
|
|
15
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
16
|
-
if (key in exports && exports[key] === _timePicker[key]) return;
|
|
17
|
-
Object.defineProperty(exports, key, {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function get() {
|
|
20
|
-
return _timePicker[key];
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
25
|
-
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); }
|
|
26
|
-
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; }
|
|
27
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
28
|
-
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
29
|
-
var t = {};
|
|
30
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
31
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
32
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
33
|
-
}
|
|
34
|
-
return t;
|
|
35
|
-
};
|
|
36
|
-
var TimePicker = function TimePicker(props) {
|
|
37
|
-
//theme样式类型 outline | fill 默认 outline
|
|
38
|
-
var _props$theme = props.theme,
|
|
39
|
-
theme = _props$theme === void 0 ? 'outline' : _props$theme,
|
|
40
|
-
className = props.className,
|
|
41
|
-
suffixIcon = props.suffixIcon,
|
|
42
|
-
restProps = __rest(props, ["theme", "className", "suffixIcon"]);
|
|
43
|
-
var defaultIcon = _react["default"].createElement(_icon["default"], {
|
|
44
|
-
type: "clock-circle"
|
|
45
|
-
});
|
|
46
|
-
return _react["default"].createElement(_configProvider.ConfigConsumer, null, function (_ref) {
|
|
47
|
-
var getPrefixCls = _ref.getPrefixCls;
|
|
48
|
-
var prefixCls = getPrefixCls('time-picker');
|
|
49
|
-
return _react["default"].createElement(_timePicker["default"], Object.assign({
|
|
50
|
-
suffixIcon: suffixIcon || defaultIcon,
|
|
51
|
-
className: (0, _classnames["default"])(className, "".concat(prefixCls, "-").concat(theme))
|
|
52
|
-
}, restProps));
|
|
53
|
-
});
|
|
54
|
-
};
|
|
55
|
-
var _default = exports["default"] = TimePicker;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TimePicker.js","sourceRoot":"","sources":["../../src/time-picker/TimePicker.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAmB,MAAM,OAAO,CAAA;AACvC,OAAO,IAAI,MAAM,SAAS,CAAA;AAE1B,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,aAAa,MAAM,qBAAqB,CAAA;AAC/C,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,cAAc,qBAAqB,CAAA;AACnC,MAAM,UAAU,GAA2E,CACzF,KAAK,EACL,EAAE;IACF,sCAAsC;IACtC,MAAM,EAAE,KAAK,GAAG,SAAS,EAAE,SAAS,EAAE,UAAU,KAAmB,KAAK,EAAnB,SAAS,UAAK,KAAK,EAAlE,oCAA0D,CAAQ,CAAA;IACxE,MAAM,WAAW,GAAG,oBAAC,IAAI,IAAC,IAAI,EAAC,cAAc,GAAG,CAAA;IAEhD,OAAO,CACL,oBAAC,cAAc,QACZ,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE;QACpB,MAAM,SAAS,GAAG,YAAY,CAAC,aAAa,CAAC,CAAA;QAC7C,OAAO,CACL,oBAAC,aAAa,kBACZ,UAAU,EAAE,UAAU,IAAI,WAAW,EACrC,SAAS,EAAE,UAAU,CAAC,SAAS,EAAE,GAAG,SAAS,IAAI,KAAK,EAAE,CAAC,IACrD,SAAS,EACb,CACH,CAAA;IACH,CAAC,CACc,CAClB,CAAA;AACH,CAAC,CAAA;AAED,eAAe,UAAU,CAAA","sourcesContent":["import React, { useState } from 'react'\nimport Icon from '../icon'\nimport type { TimePickerProps as AntdTimePickerProps } from 'antd/es/time-picker'\nimport { ConfigConsumer } from 'antd/es/config-provider'\nimport AntTimePicker from 'antd/es/time-picker'\nimport classNames from 'classnames'\nexport * from 'antd/es/time-picker'\nconst TimePicker: React.FC<AntdTimePickerProps & { theme?: string; readonly?: boolean }> = (\n props\n) => {\n //theme样式类型 outline | fill 默认 outline\n const { theme = 'outline', className, suffixIcon, ...restProps } = props\n const defaultIcon = <Icon type=\"clock-circle\" />\n\n return (\n <ConfigConsumer>\n {({ getPrefixCls }) => {\n const prefixCls = getPrefixCls('time-picker')\n return (\n <AntTimePicker\n suffixIcon={suffixIcon || defaultIcon}\n className={classNames(className, `${prefixCls}-${theme}`)}\n {...restProps}\n />\n )\n }}\n </ConfigConsumer>\n )\n}\n\nexport default TimePicker\n"]}
|