tntd 3.0.52 → 3.0.53-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +5 -5
- 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/anchor/anchor.js +5 -5
- package/es/array-input/index.js +11 -12
- package/es/array-input/index.js.map +1 -1
- package/es/array-input/index.less +10 -3
- 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-group.js +5 -1
- 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/form/style/index.less +5 -5
- 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 +8 -1
- package/es/index.js.map +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 +2 -2
- package/es/query-form/Field/Checkbox.js.map +1 -1
- package/es/query-form/Field/Composition/FieldPopover.js +363 -0
- package/es/query-form/Field/Composition/FieldPopover.js.map +1 -0
- package/es/query-form/Field/Composition/FieldPopover.less +41 -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 +163 -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 +167 -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 +22 -18
- package/es/query-form/Field/SelectInput.js.map +1 -1
- package/es/query-form/Field/fieldsMap.js +3 -3
- package/es/query-form/Field/fieldsMap.js.map +1 -1
- package/es/query-form/Field/index.js +12 -11
- package/es/query-form/Field/index.js.map +1 -1
- package/es/query-form/createActions.js +1 -1
- package/es/query-form/index.js +228 -359
- package/es/query-form/index.js.map +1 -1
- package/es/query-form/index.less +26 -63
- package/es/query-form/useForm.js +1 -1
- package/es/query-form-v2/index.less +133 -0
- package/es/query-list-scene/List.js +29 -16
- package/es/query-list-scene/List.js.map +1 -1
- package/es/query-list-scene/QueryForm.js +44 -22
- package/es/query-list-scene/QueryForm.js.map +1 -1
- 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 +3 -2
- package/es/query-list-scene/index.js.map +1 -1
- package/es/query-list-scene/useActions.js +1 -1
- package/es/radio/radio-group.js +5 -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/stepStyle/small.less +5 -0
- 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-column-setting.js.map +1 -1
- package/es/table/hooks/use-expand-fixed.js +6 -6
- package/es/table/resizableTable/index.js +6 -6
- package/es/table/resizableTable/index.less +1 -1
- package/es/table/table-hoc.js +1 -1
- package/es/table/table.js +17 -11
- package/es/table/table.js.map +1 -1
- package/es/table/table.stories.js +2 -2
- package/es/table/total-shower.js +5 -1
- 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 +9 -10
- package/es/tntd-select/index.js.map +1 -1
- package/es/tntd-virtual-tree/index.js +8 -11
- package/es/tntd-virtual-tree/index.js.map +1 -1
- package/es/tntd-virtual-tree/utils.js +30 -29
- package/es/tntd-virtual-tree/utils.js.map +1 -1
- 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 +15 -14
- package/lib/_util/hooks/useForceUpdate.js +15 -14
- package/lib/_util/hooks/useScrollLock.js +18 -17
- package/lib/_util/responsiveObserve.js +13 -7
- package/lib/_util/styleChecker.js +3 -3
- package/lib/actions/index.js +3 -3
- package/lib/alert/alert.js +16 -10
- package/lib/alert/index.js +3 -3
- package/lib/anchor/anchor.js +18 -17
- package/lib/array-input/index.d.ts.map +1 -1
- package/lib/array-input/index.js +39 -33
- package/lib/array-input/index.js.map +1 -1
- package/lib/array-input/index.less +10 -3
- package/lib/button/button.js +16 -10
- package/lib/cascader/cascader.js +3 -3
- 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/checkbox/checkbox.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/date-picker/DatePicker.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/form/style/index.less +5 -5
- 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.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +10 -3
- package/lib/index.js.map +1 -1
- package/lib/input/input.js +16 -10
- package/lib/input-number/inputNumber.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/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 +16 -10
- package/lib/query-form/Field/Checkbox.js +4 -4
- package/lib/query-form/Field/Checkbox.js.map +1 -1
- package/lib/query-form/Field/Composition/FieldPopover.d.ts +19 -0
- package/lib/query-form/Field/Composition/FieldPopover.d.ts.map +1 -0
- package/lib/query-form/Field/Composition/FieldPopover.js +466 -0
- package/lib/query-form/Field/Composition/FieldPopover.js.map +1 -0
- package/lib/query-form/Field/Composition/FieldPopover.less +41 -0
- package/lib/query-form/Field/Composition/Select.d.ts +4 -0
- package/lib/query-form/Field/Composition/Select.d.ts.map +1 -0
- package/lib/query-form/Field/Composition/Select.js +260 -0
- package/lib/query-form/Field/Composition/Select.js.map +1 -0
- 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 +112 -0
- package/lib/query-form/Field/Composition/SelectInput.js.map +1 -0
- package/lib/query-form/Field/Composition/ValueTag.d.ts +13 -0
- package/lib/query-form/Field/Composition/ValueTag.d.ts.map +1 -0
- package/lib/query-form/Field/Composition/ValueTag.js +241 -0
- package/lib/query-form/Field/Composition/ValueTag.js.map +1 -0
- package/lib/query-form/Field/Composition/index.d.ts +15 -0
- package/lib/query-form/Field/Composition/index.d.ts.map +1 -0
- package/lib/query-form/Field/Composition/index.js +448 -0
- package/lib/query-form/Field/Composition/index.js.map +1 -0
- package/lib/query-form/Field/Composition/index.less +167 -0
- package/lib/query-form/Field/Composition/utils.d.ts +21 -0
- package/lib/query-form/Field/Composition/utils.d.ts.map +1 -0
- package/lib/query-form/Field/Composition/utils.js +173 -0
- package/lib/query-form/Field/Composition/utils.js.map +1 -0
- package/lib/query-form/Field/Select.js +31 -24
- package/lib/query-form/Field/SelectInput.d.ts.map +1 -1
- package/lib/query-form/Field/SelectInput.js +47 -36
- package/lib/query-form/Field/SelectInput.js.map +1 -1
- package/lib/query-form/Field/fieldsMap.d.ts +6 -3
- package/lib/query-form/Field/fieldsMap.d.ts.map +1 -1
- package/lib/query-form/Field/fieldsMap.js +5 -5
- package/lib/query-form/Field/fieldsMap.js.map +1 -1
- package/lib/query-form/Field/index.d.ts.map +1 -1
- package/lib/query-form/Field/index.js +74 -47
- package/lib/query-form/Field/index.js.map +1 -1
- package/lib/query-form/createActions.js +3 -3
- package/lib/query-form/index.d.ts +1 -36
- package/lib/query-form/index.d.ts.map +1 -1
- package/lib/query-form/index.js +278 -406
- package/lib/query-form/index.js.map +1 -1
- package/lib/query-form/index.less +26 -63
- package/lib/query-form/useForm.js +3 -3
- package/lib/query-form-v2/index.less +133 -0
- package/lib/query-list-scene/List.d.ts.map +1 -1
- package/lib/query-list-scene/List.js +77 -44
- package/lib/query-list-scene/List.js.map +1 -1
- package/lib/query-list-scene/QueryForm.d.ts +5 -4
- package/lib/query-list-scene/QueryForm.d.ts.map +1 -1
- package/lib/query-list-scene/QueryForm.js +92 -50
- package/lib/query-list-scene/QueryForm.js.map +1 -1
- 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.d.ts.map +1 -1
- package/lib/query-list-scene/index.js +5 -4
- package/lib/query-list-scene/index.js.map +1 -1
- package/lib/query-list-scene/useActions.js +3 -3
- package/lib/radio/radio-group.js +3 -3
- package/lib/radio/radio.js +3 -3
- package/lib/render-empty/render-empty.js +3 -3
- package/lib/scroll-bar/Bar.d.ts +4 -0
- package/lib/scroll-bar/Bar.d.ts.map +1 -0
- package/lib/scroll-bar/Bar.js +169 -0
- package/lib/scroll-bar/Bar.js.map +1 -0
- package/lib/scroll-bar/Context.d.ts +7 -0
- package/lib/scroll-bar/Context.d.ts.map +1 -0
- package/lib/scroll-bar/Context.js +17 -0
- package/lib/scroll-bar/Context.js.map +1 -0
- package/lib/scroll-bar/ScrollBar.d.ts +4 -0
- package/lib/scroll-bar/ScrollBar.d.ts.map +1 -0
- package/lib/scroll-bar/ScrollBar.js +132 -0
- package/lib/scroll-bar/ScrollBar.js.map +1 -0
- package/lib/scroll-bar/Thumb.d.ts +3 -0
- package/lib/scroll-bar/Thumb.d.ts.map +1 -0
- package/lib/scroll-bar/Thumb.js +203 -0
- package/lib/scroll-bar/Thumb.js.map +1 -0
- package/lib/scroll-bar/index.d.ts +3 -0
- package/lib/scroll-bar/index.d.ts.map +1 -0
- package/lib/scroll-bar/index.js +14 -0
- package/lib/scroll-bar/index.js.map +1 -0
- package/lib/scroll-bar/scrollBar.less +59 -0
- package/lib/scroll-bar/util.d.ts +40 -0
- package/lib/scroll-bar/util.d.ts.map +1 -0
- package/lib/scroll-bar/util.js +72 -0
- package/lib/scroll-bar/util.js.map +1 -0
- package/lib/segmented/index.js +16 -10
- package/lib/select/select.js +16 -10
- package/lib/spin/spin.js +3 -3
- package/lib/steps/stepStyle/small.less +5 -0
- package/lib/steps/steps.js +16 -10
- package/lib/svg-components/index.js +3 -3
- package/lib/table/hooks/use-column-setting.d.ts +1 -0
- package/lib/table/hooks/use-column-setting.d.ts.map +1 -1
- package/lib/table/hooks/use-column-setting.js +15 -14
- package/lib/table/hooks/use-column-setting.js.map +1 -1
- package/lib/table/hooks/use-expand-fixed.js +36 -30
- package/lib/table/resizableTable/index.js +31 -24
- package/lib/table/resizableTable/index.less +1 -1
- package/lib/table/table-hoc.js +3 -3
- package/lib/table/table.d.ts.map +1 -1
- package/lib/table/table.js +42 -29
- package/lib/table/table.js.map +1 -1
- 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/tabs.js +16 -10
- package/lib/tabs-container/index.js +3 -3
- package/lib/tag/tag.js +16 -10
- 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 +22 -21
- package/lib/tntd-action/index.js +21 -20
- 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.d.ts.map +1 -1
- package/lib/tntd-select/index.js +57 -40
- package/lib/tntd-select/index.js.map +1 -1
- package/lib/tntd-virtual-tree/index.js +24 -26
- package/lib/tntd-virtual-tree/index.js.map +1 -1
- package/lib/tntd-virtual-tree/utils.d.ts.map +1 -1
- package/lib/tntd-virtual-tree/utils.js +68 -63
- package/lib/tntd-virtual-tree/utils.js.map +1 -1
- 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 +5 -5
- package/lib/water-mark/index.js +18 -17
- package/package.json +3 -2
- package/es/array-input/icon.js +0 -32
- package/es/array-input/icon.js.map +0 -1
- package/es/drawer/drawer.less +0 -20
- package/es/grid/RowContext.js +0 -9
- package/es/grid/RowContext.js.map +0 -1
- package/es/grid/col.js +0 -100
- package/es/grid/col.js.map +0 -1
- package/es/grid/hooks/useBreakpoint.js +0 -28
- package/es/grid/hooks/useBreakpoint.js.map +0 -1
- package/es/grid/row.js +0 -183
- package/es/grid/row.js.map +0 -1
- package/es/grid/style/rtl.less +0 -69
- package/lib/array-input/icon.d.ts +0 -3
- 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/drawer/drawer.less +0 -20
- package/lib/grid/RowContext.d.ts +0 -9
- package/lib/grid/RowContext.d.ts.map +0 -1
- package/lib/grid/RowContext.js +0 -9
- package/lib/grid/RowContext.js.map +0 -1
- package/lib/grid/col.d.ts +0 -29
- package/lib/grid/col.d.ts.map +0 -1
- package/lib/grid/col.js +0 -154
- package/lib/grid/col.js.map +0 -1
- package/lib/grid/hooks/useBreakpoint.d.ts +0 -4
- package/lib/grid/hooks/useBreakpoint.d.ts.map +0 -1
- package/lib/grid/hooks/useBreakpoint.js +0 -32
- package/lib/grid/hooks/useBreakpoint.js.map +0 -1
- package/lib/grid/row.d.ts +0 -21
- package/lib/grid/row.d.ts.map +0 -1
- package/lib/grid/row.js +0 -279
- package/lib/grid/row.js.map +0 -1
- package/lib/grid/style/rtl.less +0 -69
|
@@ -11,10 +11,11 @@ var _Toolbar = _interopRequireDefault(require("./Toolbar"));
|
|
|
11
11
|
var _List = _interopRequireDefault(require("./List"));
|
|
12
12
|
var _createActions = _interopRequireDefault(require("./createActions"));
|
|
13
13
|
var _useActions = _interopRequireDefault(require("./useActions"));
|
|
14
|
+
var _Field = _interopRequireDefault(require("../query-form/Field"));
|
|
14
15
|
require("./index.less");
|
|
15
|
-
function _interopRequireDefault(
|
|
16
|
-
return
|
|
17
|
-
"default":
|
|
16
|
+
function _interopRequireDefault(obj) {
|
|
17
|
+
return obj && obj.__esModule ? obj : {
|
|
18
|
+
"default": obj
|
|
18
19
|
};
|
|
19
20
|
}
|
|
20
21
|
var QueryForm = exports.QueryForm = _QueryForm["default"];
|
|
@@ -24,7 +25,7 @@ _QueryListScene["default"].Title = _Title["default"];
|
|
|
24
25
|
_QueryListScene["default"].QueryForm = _QueryForm["default"];
|
|
25
26
|
_QueryListScene["default"].Toolbar = _Toolbar["default"];
|
|
26
27
|
_QueryListScene["default"].QueryList = _List["default"];
|
|
27
|
-
_QueryListScene["default"].Field =
|
|
28
|
+
_QueryListScene["default"].Field = _Field["default"];
|
|
28
29
|
_QueryListScene["default"].useActions = _useActions["default"];
|
|
29
30
|
_QueryListScene["default"].createActions = createActions;
|
|
30
31
|
var _default = exports["default"] = _QueryListScene["default"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/query-list-scene/index.js"],"names":[],"mappings":";;;;;;AAAA,sEAA6C;AAC7C,oDAA2B;AAC3B,4DAA8B;AAC9B,wDAA+B;AAC/B,kDAAyB;AACzB,oEAAqC;AACrC,8DAAqC;AACrC,wBAAqB;AAER,QAAA,SAAS,GAAG,mBAAI,CAAA;AAChB,QAAA,SAAS,GAAG,cAAI,CAAA;AAChB,QAAA,aAAa,GAAG,uBAAO,CAAA;AAEpC,wBAAc,CAAC,KAAK,GAAG,eAAK,CAAA;AAC5B,wBAAc,CAAC,SAAS,GAAG,mBAAI,CAAA;AAC/B,wBAAc,CAAC,OAAO,GAAG,iBAAO,CAAA;AAChC,wBAAc,CAAC,SAAS,GAAG,cAAI,CAAA;AAC/B,wBAAc,CAAC,KAAK,GAAG,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/query-list-scene/index.js"],"names":[],"mappings":";;;;;;AAAA,sEAA6C;AAC7C,oDAA2B;AAC3B,4DAA8B;AAC9B,wDAA+B;AAC/B,kDAAyB;AACzB,oEAAqC;AACrC,8DAAqC;AACrC,gEAAwC;AACxC,wBAAqB;AAER,QAAA,SAAS,GAAG,mBAAI,CAAA;AAChB,QAAA,SAAS,GAAG,cAAI,CAAA;AAChB,QAAA,aAAa,GAAG,uBAAO,CAAA;AAEpC,wBAAc,CAAC,KAAK,GAAG,eAAK,CAAA;AAC5B,wBAAc,CAAC,SAAS,GAAG,mBAAI,CAAA;AAC/B,wBAAc,CAAC,OAAO,GAAG,iBAAO,CAAA;AAChC,wBAAc,CAAC,SAAS,GAAG,cAAI,CAAA;AAC/B,wBAAc,CAAC,KAAK,GAAG,eAAK,CAAA;AAE5B,wBAAc,CAAC,UAAU,GAAG,oBAAU,CAAA;AACtC,wBAAc,CAAC,aAAa,GAAG,qBAAa,CAAA;AAE5C,kBAAe,wBAAc,CAAA","sourcesContent":["import QueryListScene from './QueryListScene'\nimport Title from './Title'\nimport Form from './QueryForm'\nimport Toolbar from './Toolbar'\nimport List from './List'\nimport Actions from './createActions'\nimport useActions from './useActions'\nimport Field from '../query-form/Field';\nimport './index.less'\n\nexport const QueryForm = Form\nexport const QueryList = List\nexport const createActions = Actions\n\nQueryListScene.Title = Title\nQueryListScene.QueryForm = Form\nQueryListScene.Toolbar = Toolbar\nQueryListScene.QueryList = List\nQueryListScene.Field = Field\n\nQueryListScene.useActions = useActions\nQueryListScene.createActions = createActions\n\nexport default QueryListScene\n"]}
|
|
@@ -6,9 +6,9 @@ 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(
|
|
10
|
-
return
|
|
11
|
-
"default":
|
|
9
|
+
function _interopRequireDefault(obj) {
|
|
10
|
+
return obj && obj.__esModule ? obj : {
|
|
11
|
+
"default": obj
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
14
|
function useActions() {
|
package/lib/radio/radio-group.js
CHANGED
|
@@ -8,9 +8,9 @@ require("react");
|
|
|
8
8
|
var _radio = _interopRequireDefault(require("antd/lib/radio"));
|
|
9
9
|
var _connect = require("../connect");
|
|
10
10
|
var _previewText = _interopRequireDefault(require("../preview-text"));
|
|
11
|
-
function _interopRequireDefault(
|
|
12
|
-
return
|
|
13
|
-
"default":
|
|
11
|
+
function _interopRequireDefault(obj) {
|
|
12
|
+
return obj && obj.__esModule ? obj : {
|
|
13
|
+
"default": obj
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
16
|
var _default = exports["default"] = (0, _connect.connectReadonlyComponent)(_radio["default"].Group, _previewText["default"].Select);
|
package/lib/radio/radio.js
CHANGED
|
@@ -31,9 +31,9 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
31
31
|
var _react = _interopRequireWildcard(require("react"));
|
|
32
32
|
var _connect = require("../connect");
|
|
33
33
|
var _previewText = require("../preview-text");
|
|
34
|
-
function _interopRequireDefault(
|
|
35
|
-
return
|
|
36
|
-
"default":
|
|
34
|
+
function _interopRequireDefault(obj) {
|
|
35
|
+
return obj && obj.__esModule ? obj : {
|
|
36
|
+
"default": obj
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
39
|
function _getRequireWildcardCache(e) {
|
|
@@ -7,9 +7,9 @@ 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(
|
|
11
|
-
return
|
|
12
|
-
"default":
|
|
10
|
+
function _interopRequireDefault(obj) {
|
|
11
|
+
return obj && obj.__esModule ? obj : {
|
|
12
|
+
"default": obj
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
15
|
var renderEmpty = exports.renderEmpty = function renderEmpty(componentName) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Bar.d.ts","sourceRoot":"","sources":["../../src/scroll-bar/Bar.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,169 @@
|
|
|
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 _react = _interopRequireWildcard(require("react"));
|
|
17
|
+
var _Context = _interopRequireDefault(require("./Context"));
|
|
18
|
+
var _Thumb = _interopRequireDefault(require("./Thumb"));
|
|
19
|
+
var _util = require("./util");
|
|
20
|
+
function _interopRequireDefault(obj) {
|
|
21
|
+
return obj && obj.__esModule ? obj : {
|
|
22
|
+
"default": obj
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function _getRequireWildcardCache(e) {
|
|
26
|
+
if ("function" != typeof WeakMap) return null;
|
|
27
|
+
var r = new WeakMap(),
|
|
28
|
+
t = new WeakMap();
|
|
29
|
+
return (_getRequireWildcardCache = function _getRequireWildcardCache(e) {
|
|
30
|
+
return e ? t : r;
|
|
31
|
+
})(e);
|
|
32
|
+
}
|
|
33
|
+
function _interopRequireWildcard(e, r) {
|
|
34
|
+
if (!r && e && e.__esModule) return e;
|
|
35
|
+
if (null === e || "object" != _typeof(e) && "function" != typeof e) return {
|
|
36
|
+
"default": e
|
|
37
|
+
};
|
|
38
|
+
var t = _getRequireWildcardCache(r);
|
|
39
|
+
if (t && t.has(e)) return t.get(e);
|
|
40
|
+
var n = {
|
|
41
|
+
__proto__: null
|
|
42
|
+
},
|
|
43
|
+
a = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
44
|
+
for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) {
|
|
45
|
+
var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;
|
|
46
|
+
i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u];
|
|
47
|
+
}
|
|
48
|
+
return n["default"] = e, t && t.set(e, n), n;
|
|
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
|
+
var _default = exports["default"] = (0, _react.forwardRef)(function (props, ref) {
|
|
100
|
+
var _useContext = (0, _react.useContext)(_Context["default"]),
|
|
101
|
+
wrapElement = _useContext.wrapElement;
|
|
102
|
+
var _useState = (0, _react.useState)(0),
|
|
103
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
104
|
+
moveX = _useState2[0],
|
|
105
|
+
setMoveX = _useState2[1];
|
|
106
|
+
var _useState3 = (0, _react.useState)(0),
|
|
107
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
108
|
+
moveY = _useState4[0],
|
|
109
|
+
setMoveY = _useState4[1];
|
|
110
|
+
var _useState5 = (0, _react.useState)(0),
|
|
111
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
112
|
+
sizeWidth = _useState6[0],
|
|
113
|
+
setSizeWidth = _useState6[1];
|
|
114
|
+
var _useState7 = (0, _react.useState)(0),
|
|
115
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
116
|
+
sizeHeight = _useState8[0],
|
|
117
|
+
setSizeHeight = _useState8[1];
|
|
118
|
+
var _useState9 = (0, _react.useState)(1),
|
|
119
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
120
|
+
ratioX = _useState10[0],
|
|
121
|
+
setRatioX = _useState10[1];
|
|
122
|
+
var _useState11 = (0, _react.useState)(1),
|
|
123
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
124
|
+
ratioY = _useState12[0],
|
|
125
|
+
setRatioY = _useState12[1];
|
|
126
|
+
(0, _react.useImperativeHandle)(ref, function () {
|
|
127
|
+
return {
|
|
128
|
+
update: update,
|
|
129
|
+
handleScroll: handleScroll
|
|
130
|
+
};
|
|
131
|
+
});
|
|
132
|
+
function handleScroll() {
|
|
133
|
+
var wrap = wrapElement.current;
|
|
134
|
+
if (!wrap) return;
|
|
135
|
+
var offsetHeight = wrap.offsetHeight - _util.GAP;
|
|
136
|
+
var offsetWidth = wrap.offsetWidth - _util.GAP;
|
|
137
|
+
setMoveY(wrap.scrollTop * 100 / offsetHeight * ratioY);
|
|
138
|
+
setMoveX(wrap.scrollLeft * 100 / offsetWidth * ratioX);
|
|
139
|
+
}
|
|
140
|
+
function update() {
|
|
141
|
+
var wrap = wrapElement.current;
|
|
142
|
+
if (!wrap) return;
|
|
143
|
+
// 滚动窗口的高度
|
|
144
|
+
var offsetHeight = wrap.offsetHeight - _util.GAP;
|
|
145
|
+
var offsetWidth = wrap.offsetWidth - _util.GAP;
|
|
146
|
+
// 滚动条的逻辑高度
|
|
147
|
+
var originalHeight = Math.pow(offsetHeight, 2) / wrap.scrollHeight;
|
|
148
|
+
var originalWidth = Math.pow(offsetWidth, 2) / wrap.scrollWidth;
|
|
149
|
+
// 滚动条的实际高度,因为如果内容太长会导致滚动条非常短,可能难以点击拖拽,所以设置了最小高度
|
|
150
|
+
var height = Math.max(originalHeight, props.minSize);
|
|
151
|
+
var width = Math.max(originalWidth, props.minSize);
|
|
152
|
+
setRatioY(originalHeight / (offsetHeight - originalHeight) / (height / (offsetHeight - height)));
|
|
153
|
+
setRatioX(originalWidth / (offsetWidth - originalWidth) / (width / (offsetWidth - width)));
|
|
154
|
+
setSizeHeight(height + _util.GAP < offsetHeight ? height : 0);
|
|
155
|
+
setSizeWidth(width + _util.GAP < offsetWidth ? width : 0);
|
|
156
|
+
}
|
|
157
|
+
return _react["default"].createElement(_react["default"].Fragment, null, _react["default"].createElement(_Thumb["default"], {
|
|
158
|
+
always: props.always,
|
|
159
|
+
move: moveX,
|
|
160
|
+
size: sizeWidth,
|
|
161
|
+
ratio: ratioX
|
|
162
|
+
}), _react["default"].createElement(_Thumb["default"], {
|
|
163
|
+
always: props.always,
|
|
164
|
+
move: moveY,
|
|
165
|
+
size: sizeHeight,
|
|
166
|
+
ratio: ratioY,
|
|
167
|
+
vertical: true
|
|
168
|
+
}));
|
|
169
|
+
});
|
|
@@ -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 @@
|
|
|
1
|
+
{"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../src/scroll-bar/Context.js"],"names":[],"mappings":";AAEA;;;GAGE"}
|
|
@@ -0,0 +1,17 @@
|
|
|
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(obj) {
|
|
9
|
+
return obj && obj.__esModule ? obj : {
|
|
10
|
+
"default": obj
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
var Context = _react["default"].createContext({
|
|
14
|
+
scrollbarElement: null,
|
|
15
|
+
wrapElement: null
|
|
16
|
+
});
|
|
17
|
+
var _default = exports["default"] = Context;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Context.js","sourceRoot":"","sources":["../../src/scroll-bar/Context.js"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AAEzB,MAAM,OAAO,GAAG,eAAK,CAAC,aAAa,CAAC;IAClC,gBAAgB,EAAE,IAAI;IACtB,WAAW,EAAE,IAAI;CAClB,CAAC,CAAA;AAEF,kBAAe,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 @@
|
|
|
1
|
+
{"version":3,"file":"ScrollBar.d.ts","sourceRoot":"","sources":["../../src/scroll-bar/ScrollBar.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,132 @@
|
|
|
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
|
+
});
|
|
@@ -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 @@
|
|
|
1
|
+
{"version":3,"file":"Thumb.d.ts","sourceRoot":"","sources":["../../src/scroll-bar/Thumb.js"],"names":[],"mappings":"AAKA,6DA6HC"}
|