tntd 3.0.54 → 3.0.56
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 +9 -9
- package/es/button/button.js +2 -2
- package/es/cascader/cascader.js +1 -1
- package/es/check-card/group.js +8 -8
- package/es/check-card/index.js +6 -6
- package/es/checkbox/checkbox.js +1 -1
- package/es/color-picker/ColorPicker.js +6 -6
- package/es/color-picker/index.js +1 -1
- package/es/columns/index.js +1 -1
- package/es/config-provider/config-provider.js +1 -1
- package/es/date-picker/DatePicker.js +1 -1
- package/es/descriptions/descriptions.js +5 -5
- package/es/development-login/LoginModal.js +6 -6
- package/es/development-login/index.js +4 -4
- package/es/drawer/drawer.js +2 -2
- package/es/ellipsis/Svg/CopySVG.js +1 -1
- package/es/ellipsis/Svg/TickSVG.js +1 -1
- package/es/ellipsis/index.js +5 -5
- package/es/empty/empty.js +2 -2
- package/es/empty/empty.stories.js +2 -2
- package/es/exception/exception.js +1 -1
- package/es/form/form.js +2 -2
- package/es/grid-v4/col.js +2 -2
- package/es/grid-v4/hooks/useBreakpoint.js +1 -1
- package/es/grid-v4/index.js +1 -1
- package/es/grid-v4/row.js +6 -6
- package/es/handle/index.js +1 -1
- package/es/handle-icon/index.js +11 -11
- package/es/icon/IconFont.js +1 -1
- package/es/icon/components/Icon.js +9 -9
- package/es/icon/components/index.js +1 -1
- package/es/icon/components/utils.js +3 -3
- package/es/icon/index.js +7 -7
- package/es/icon/twoTonePrimaryColor.js +1 -1
- package/es/icon/utils.js +1 -1
- package/es/img/Contain.js +1 -1
- package/es/img/Cover.js +5 -5
- package/es/img/index.js +5 -5
- package/es/index.js +1 -1
- package/es/input/input.js +2 -2
- package/es/input-number/inputNumber.js +1 -1
- package/es/label/index.js +2 -2
- package/es/loading-button/index.js +5 -5
- package/es/locale/default.js +1 -1
- package/es/locale/en_US.js +1 -1
- package/es/locale/zh_CN.js +1 -1
- package/es/modal/modal.js +1 -1
- package/es/notification/assets/index.js +1 -1
- package/es/notification/index.js +1 -1
- package/es/notification/notification.js +1 -1
- package/es/page/Box.js +1 -1
- package/es/page/index.js +7 -7
- package/es/page-container/index.js +1 -1
- package/es/page-loading/index.js +1 -1
- package/es/popconfirm/popconfirm.js +1 -1
- package/es/popover/popover.js +1 -1
- package/es/preview-text/index.js +7 -7
- package/es/progress/progress.js +2 -2
- package/es/query-form/Field/Checkbox.js +1 -1
- package/es/query-form/Field/Composition/FieldPopover.js +459 -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 +253 -0
- package/es/query-form/Field/Composition/Select.js.map +1 -0
- package/es/query-form/Field/Composition/SelectInput.js +111 -0
- package/es/query-form/Field/Composition/SelectInput.js.map +1 -0
- package/es/query-form/Field/Composition/ValueTag.js +240 -0
- package/es/query-form/Field/Composition/ValueTag.js.map +1 -0
- package/es/query-form/Field/Composition/index.js +441 -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 +173 -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 +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/index.less +14 -0
- package/es/query-form/useForm.js +1 -1
- package/es/query-form-v2/index.less +133 -0
- package/es/query-list-scene/List.js +13 -13
- package/es/query-list-scene/QueryForm.js +9 -9
- package/es/query-list-scene/QueryListScene.js +10 -10
- package/es/query-list-scene/Title.js +1 -1
- package/es/query-list-scene/Toolbar.js +2 -2
- package/es/query-list-scene/createActions.js +1 -1
- package/es/query-list-scene/index.js +1 -1
- package/es/query-list-scene/useActions.js +1 -1
- package/es/radio/radio.js +1 -1
- package/es/render-empty/render-empty.js +1 -1
- package/es/scroll-bar/Bar.js +168 -0
- package/es/scroll-bar/Bar.js.map +1 -0
- package/es/scroll-bar/Context.js +17 -0
- package/es/scroll-bar/Context.js.map +1 -0
- package/es/scroll-bar/ScrollBar.js +132 -0
- package/es/scroll-bar/ScrollBar.js.map +1 -0
- package/es/scroll-bar/Thumb.js +202 -0
- package/es/scroll-bar/Thumb.js.map +1 -0
- package/es/scroll-bar/index.js +14 -0
- package/es/scroll-bar/index.js.map +1 -0
- package/es/scroll-bar/scrollBar.less +59 -0
- package/es/scroll-bar/util.js +66 -0
- package/es/scroll-bar/util.js.map +1 -0
- package/es/segmented/index.js +2 -2
- package/es/select/select.js +2 -2
- package/es/spin/spin.js +1 -1
- package/es/steps/steps.js +2 -2
- package/es/svg-components/index.js +1 -1
- package/es/table/hooks/use-column-setting.js +4 -4
- package/es/table/hooks/use-expand-fixed.js +6 -6
- package/es/table/resizableTable/index.js +6 -6
- package/es/table/table-hoc.js +1 -1
- package/es/table/table.js +9 -9
- package/es/table/table.stories.js +2 -2
- package/es/table/utils.js +1 -1
- package/es/table-container/index.js +1 -1
- package/es/tabs/tabs.js +2 -2
- package/es/tabs-container/index.js +1 -1
- package/es/tag/tag.js +2 -2
- package/es/time-picker/TimePicker.js +1 -1
- package/es/time-picker/index.js +1 -1
- package/es/title/index.js +1 -1
- package/es/tntd-action/Action.js +9 -9
- package/es/tntd-action/index.js +8 -8
- package/es/tntd-cascader/AntdCascader/component/context.js +1 -1
- package/es/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +1 -1
- package/es/tntd-cascader/AntdCascader/component/getIcons.js +1 -1
- package/es/tntd-cascader/AntdCascader/component/useCompactItemContext.js +2 -2
- package/es/tntd-cascader/AntdCascader/config/utils.js +2 -2
- package/es/tntd-cascader/AntdCascader/index.js +7 -7
- package/es/tntd-cascader/index.js +1 -1
- package/es/tntd-cascader/rc-cascader/Cascader.js +8 -8
- package/es/tntd-cascader/rc-cascader/OptionList/Checkbox.js +2 -2
- package/es/tntd-cascader/rc-cascader/OptionList/Column.js +7 -7
- package/es/tntd-cascader/rc-cascader/OptionList/index.js +9 -9
- package/es/tntd-cascader/rc-cascader/OptionList/useActive.js +5 -5
- package/es/tntd-cascader/rc-cascader/OptionList/useKeyboard.js +8 -8
- package/es/tntd-cascader/rc-cascader/hooks/useDisplayValues.js +5 -5
- package/es/tntd-cascader/rc-cascader/hooks/useSearchConfig.js +1 -1
- package/es/tntd-cascader/rc-cascader/hooks/useSearchOptions.js +6 -6
- package/es/tntd-cascader/rc-cascader/index.js +1 -1
- package/es/tntd-cascader/rc-cascader/utils/warningPropsUtil.js +4 -4
- package/es/tntd-form/ErrorList.js +7 -7
- package/es/tntd-form/Form.js +6 -6
- package/es/tntd-form/FormItem/ItemHolder.js +6 -6
- package/es/tntd-form/FormItem/index.js +8 -8
- package/es/tntd-form/FormItemInput.js +1 -1
- package/es/tntd-form/FormItemLabel.js +2 -2
- package/es/tntd-form/FormList.js +1 -1
- package/es/tntd-form/context.js +1 -1
- package/es/tntd-form/hooks/useDebounce.js +4 -4
- package/es/tntd-form/hooks/useForm.js +5 -5
- package/es/tntd-form/hooks/useFormItemStatus.js +1 -1
- package/es/tntd-form/hooks/useFrameState.js +5 -5
- package/es/tntd-form/index.js +1 -1
- package/es/tntd-icon/index.js +1 -1
- package/es/tntd-layout/AppList.js +6 -6
- package/es/tntd-layout/Application.js +6 -6
- package/es/tntd-layout/Avatar.js +2 -2
- package/es/tntd-layout/CompatibleLanguage.js +6 -6
- package/es/tntd-layout/EnterpriseLayout/Avatar.js +2 -2
- package/es/tntd-layout/EnterpriseLayout/Language.js +6 -6
- package/es/tntd-layout/EnterpriseLayout/Theme.js +6 -6
- package/es/tntd-layout/EnterpriseLayout/index.js +1 -1
- package/es/tntd-layout/GlobalNavigation/NavigationPopup.js +6 -6
- package/es/tntd-layout/GlobalNavigation/index.js +9 -9
- package/es/tntd-layout/Header.js +2 -2
- package/es/tntd-layout/HeaderActions.js +2 -2
- package/es/tntd-layout/HeaderNavs.js +6 -6
- package/es/tntd-layout/HeaderTabs.js +7 -7
- package/es/tntd-layout/Iconfont.js +1 -1
- package/es/tntd-layout/Language.js +6 -6
- package/es/tntd-layout/Layout.js +6 -6
- package/es/tntd-layout/Logo.js +2 -2
- package/es/tntd-layout/OrgAppList.js +6 -6
- package/es/tntd-layout/SideMenu.js +6 -6
- package/es/tntd-layout/Theme.js +6 -6
- package/es/tntd-layout/createActions.js +1 -1
- package/es/tntd-layout/images/index.js +1 -1
- package/es/tntd-layout/index.js +1 -1
- package/es/tntd-layout/paaslayout/CompactSideMenu.js +6 -6
- package/es/tntd-layout/paaslayout/Header.js +2 -2
- package/es/tntd-layout/paaslayout/Logo.js +2 -2
- package/es/tntd-layout/paaslayout/SideMenu.js +6 -6
- package/es/tntd-layout/paaslayout/index.js +6 -6
- package/es/tntd-layout/storage.js +1 -1
- package/es/tntd-modal/index.js +6 -6
- package/es/tntd-rc-select/_util/PurePanel.js +5 -5
- package/es/tntd-rc-select/_util/context.js +1 -1
- package/es/tntd-rc-select/_util/defaultRenderEmpty.js +1 -1
- package/es/tntd-rc-select/_util/getIcons.js +1 -1
- package/es/tntd-rc-select/_util/useCompactItemContext.js +2 -2
- package/es/tntd-rc-select/index.js +2 -2
- package/es/tntd-reference/AHref/index.js +1 -1
- package/es/tntd-reference/ReferenceBatchCheck/index.js +1 -1
- package/es/tntd-reference/ReferenceBatchDrawer/index.js +5 -5
- package/es/tntd-reference/ReferenceCheck/index.js +1 -1
- package/es/tntd-reference/ReferenceDrawer/index.js +5 -5
- package/es/tntd-reference/ReferenceInfo/index.js +1 -1
- package/es/tntd-reference/index.js +1 -1
- package/es/tntd-second-page/index.js +1 -1
- package/es/tntd-select/DropDownWrap.js +8 -8
- package/es/tntd-select/index.js +10 -9
- package/es/tntd-virtual-tree/index.js +8 -8
- package/es/tntd-virtual-tree/utils.js +28 -28
- package/es/tntd-virtual-tree-select/index.js +10 -10
- package/es/tntd-virtual-tree-select/utils.js +9 -9
- package/es/tooltip/tooltip.js +1 -1
- package/es/upload/index.js +6 -6
- package/es/upload/svg/UploadSVG.js +1 -1
- package/es/utils/checkAuth.js +4 -4
- package/es/utils/index.js +9 -9
- package/es/utils/lang.js +3 -3
- package/es/water-mark/index.js +5 -5
- package/lib/_util/context.js +3 -3
- package/lib/_util/defaultRenderEmpty.js +3 -3
- package/lib/_util/hooks/useFlexGapSupport.js +14 -15
- package/lib/_util/hooks/useForceUpdate.js +14 -15
- package/lib/_util/hooks/useScrollLock.js +17 -18
- package/lib/_util/responsiveObserve.js +7 -13
- package/lib/_util/styleChecker.js +3 -3
- package/lib/actions/index.js +3 -3
- package/lib/alert/alert.js +10 -16
- package/lib/alert/index.js +3 -3
- package/lib/anchor/anchor.js +17 -18
- package/lib/array-input/index.js +30 -37
- package/lib/button/button.js +10 -16
- package/lib/cascader/cascader.js +3 -3
- package/lib/check-card/group.js +23 -24
- package/lib/check-card/index.js +24 -31
- package/lib/checkbox/checkbox.js +3 -3
- package/lib/color-picker/ColorPicker.js +24 -31
- package/lib/color-picker/index.js +3 -3
- package/lib/columns/index.js +3 -3
- package/lib/config-provider/config-provider.js +3 -3
- package/lib/date-picker/DatePicker.js +3 -3
- package/lib/descriptions/descriptions.js +13 -19
- package/lib/development-login/LoginModal.js +24 -31
- package/lib/development-login/index.js +14 -15
- package/lib/drawer/drawer.js +10 -16
- package/lib/ellipsis/Svg/CopySVG.js +3 -3
- package/lib/ellipsis/Svg/TickSVG.js +3 -3
- package/lib/ellipsis/index.js +17 -18
- package/lib/empty/empty.js +10 -16
- package/lib/empty/empty.stories.js +6 -9
- package/lib/exception/exception.js +3 -3
- package/lib/form/form.js +10 -16
- package/lib/grid-v4/col.js +10 -16
- package/lib/grid-v4/hooks/useBreakpoint.js +3 -3
- package/lib/grid-v4/index.js +3 -3
- package/lib/grid-v4/row.js +24 -31
- package/lib/handle/index.js +3 -3
- package/lib/handle-icon/index.js +13 -13
- package/lib/icon/IconFont.js +3 -3
- package/lib/icon/components/Icon.js +44 -70
- package/lib/icon/components/index.js +3 -3
- package/lib/icon/components/utils.js +10 -18
- package/lib/icon/index.js +26 -33
- package/lib/icon/twoTonePrimaryColor.js +3 -3
- package/lib/icon/utils.js +3 -3
- package/lib/img/Contain.js +3 -3
- package/lib/img/Cover.js +17 -18
- package/lib/img/index.js +17 -18
- package/lib/index.js +3 -3
- package/lib/input/input.js +10 -16
- package/lib/input-number/inputNumber.js +3 -3
- package/lib/label/index.js +10 -16
- package/lib/loading-button/index.js +17 -18
- package/lib/locale/default.js +3 -3
- package/lib/locale/en_US.js +3 -3
- package/lib/locale/zh_CN.js +3 -3
- package/lib/modal/modal.js +3 -3
- package/lib/notification/assets/index.js +3 -3
- package/lib/notification/index.js +3 -3
- package/lib/notification/notification.js +3 -3
- package/lib/page/Box.js +3 -3
- package/lib/page/index.js +26 -33
- package/lib/page-container/index.js +3 -3
- package/lib/page-loading/index.js +3 -3
- package/lib/popconfirm/popconfirm.js +3 -3
- package/lib/popover/popover.js +3 -3
- package/lib/preview-text/index.js +9 -9
- package/lib/progress/progress.js +10 -16
- package/lib/query-form/Field/Checkbox.js +3 -3
- package/lib/query-form/Field/Composition/FieldPopover.d.ts +19 -0
- package/lib/query-form/Field/Composition/FieldPopover.d.ts.map +1 -0
- package/lib/query-form/Field/Composition/FieldPopover.js +459 -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 +253 -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 +111 -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 +240 -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 +441 -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 +24 -31
- package/lib/query-form/Field/SelectInput.js +24 -31
- package/lib/query-form/Field/fieldsMap.js +3 -3
- package/lib/query-form/Field/index.js +47 -73
- package/lib/query-form/createActions.js +3 -3
- package/lib/query-form/index.js +44 -70
- package/lib/query-form/index.less +14 -0
- package/lib/query-form/useForm.js +3 -3
- package/lib/query-form-v2/index.less +133 -0
- package/lib/query-list-scene/List.js +41 -61
- package/lib/query-list-scene/QueryForm.js +37 -57
- package/lib/query-list-scene/QueryListScene.js +44 -70
- package/lib/query-list-scene/Title.js +3 -3
- package/lib/query-list-scene/Toolbar.js +10 -16
- package/lib/query-list-scene/createActions.js +3 -3
- package/lib/query-list-scene/index.js +3 -3
- package/lib/query-list-scene/useActions.js +3 -3
- package/lib/radio/radio.js +3 -3
- package/lib/render-empty/render-empty.js +3 -3
- package/lib/scroll-bar/Bar.d.ts +4 -0
- package/lib/scroll-bar/Bar.d.ts.map +1 -0
- package/lib/scroll-bar/Bar.js +168 -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 +202 -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 +66 -0
- package/lib/scroll-bar/util.js.map +1 -0
- package/lib/segmented/index.js +10 -16
- package/lib/select/select.js +10 -16
- package/lib/spin/spin.js +3 -3
- package/lib/steps/steps.js +10 -16
- package/lib/svg-components/index.js +3 -3
- package/lib/table/hooks/use-column-setting.js +14 -15
- package/lib/table/hooks/use-expand-fixed.js +30 -36
- package/lib/table/resizableTable/index.js +24 -31
- package/lib/table/table-hoc.js +3 -3
- package/lib/table/table.js +27 -34
- package/lib/table/table.stories.js +10 -16
- package/lib/table/utils.js +3 -3
- package/lib/table-container/index.js +3 -3
- package/lib/tabs/tabs.js +10 -16
- package/lib/tabs-container/index.js +3 -3
- package/lib/tag/tag.js +10 -16
- package/lib/time-picker/TimePicker.js +3 -3
- package/lib/time-picker/index.js +3 -3
- package/lib/title/index.js +3 -3
- package/lib/tntd-action/Action.js +21 -22
- package/lib/tntd-action/index.js +20 -21
- package/lib/tntd-cascader/AntdCascader/component/context.js +3 -3
- package/lib/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +3 -3
- package/lib/tntd-cascader/AntdCascader/component/getIcons.js +3 -3
- package/lib/tntd-cascader/AntdCascader/component/useCompactItemContext.js +10 -16
- package/lib/tntd-cascader/AntdCascader/config/utils.js +10 -16
- package/lib/tntd-cascader/AntdCascader/index.js +26 -33
- package/lib/tntd-cascader/index.js +3 -3
- package/lib/tntd-cascader/rc-cascader/Cascader.js +23 -24
- package/lib/tntd-cascader/rc-cascader/OptionList/Checkbox.js +10 -16
- package/lib/tntd-cascader/rc-cascader/OptionList/Column.js +26 -33
- package/lib/tntd-cascader/rc-cascader/OptionList/index.js +30 -37
- package/lib/tntd-cascader/rc-cascader/OptionList/useActive.js +17 -18
- package/lib/tntd-cascader/rc-cascader/OptionList/useKeyboard.js +23 -24
- package/lib/tntd-cascader/rc-cascader/hooks/useDisplayValues.js +16 -17
- package/lib/tntd-cascader/rc-cascader/hooks/useSearchConfig.js +3 -3
- package/lib/tntd-cascader/rc-cascader/hooks/useSearchOptions.js +23 -30
- package/lib/tntd-cascader/rc-cascader/index.js +3 -3
- package/lib/tntd-cascader/rc-cascader/utils/warningPropsUtil.js +6 -6
- package/lib/tntd-form/ErrorList.js +26 -33
- package/lib/tntd-form/Form.js +24 -31
- package/lib/tntd-form/FormItem/ItemHolder.js +24 -31
- package/lib/tntd-form/FormItem/index.js +23 -24
- package/lib/tntd-form/FormItemInput.js +3 -3
- package/lib/tntd-form/FormItemLabel.js +10 -16
- package/lib/tntd-form/FormList.js +3 -3
- package/lib/tntd-form/context.js +3 -3
- package/lib/tntd-form/hooks/useDebounce.js +14 -15
- package/lib/tntd-form/hooks/useForm.js +17 -18
- package/lib/tntd-form/hooks/useFormItemStatus.js +3 -3
- package/lib/tntd-form/hooks/useFrameState.js +17 -18
- package/lib/tntd-form/index.js +3 -3
- package/lib/tntd-icon/index.js +3 -3
- package/lib/tntd-layout/AppList.js +20 -24
- package/lib/tntd-layout/Application.js +20 -24
- package/lib/tntd-layout/Avatar.js +6 -9
- package/lib/tntd-layout/CompatibleLanguage.js +20 -24
- package/lib/tntd-layout/EnterpriseLayout/Avatar.js +6 -9
- package/lib/tntd-layout/EnterpriseLayout/Language.js +20 -24
- package/lib/tntd-layout/EnterpriseLayout/Theme.js +20 -24
- package/lib/tntd-layout/EnterpriseLayout/index.js +3 -3
- package/lib/tntd-layout/GlobalNavigation/NavigationPopup.js +20 -24
- package/lib/tntd-layout/GlobalNavigation/index.js +26 -30
- package/lib/tntd-layout/Header.js +6 -9
- package/lib/tntd-layout/HeaderActions.js +6 -9
- package/lib/tntd-layout/HeaderNavs.js +20 -24
- package/lib/tntd-layout/HeaderTabs.js +27 -37
- package/lib/tntd-layout/Iconfont.js +3 -3
- package/lib/tntd-layout/Language.js +20 -24
- package/lib/tntd-layout/Layout.js +20 -24
- package/lib/tntd-layout/Logo.js +6 -9
- package/lib/tntd-layout/OrgAppList.js +20 -24
- package/lib/tntd-layout/SideMenu.js +20 -24
- package/lib/tntd-layout/Theme.js +20 -24
- package/lib/tntd-layout/createActions.js +3 -3
- package/lib/tntd-layout/images/index.js +3 -3
- package/lib/tntd-layout/index.js +3 -3
- package/lib/tntd-layout/paaslayout/CompactSideMenu.js +20 -24
- package/lib/tntd-layout/paaslayout/Header.js +6 -9
- package/lib/tntd-layout/paaslayout/Logo.js +6 -9
- package/lib/tntd-layout/paaslayout/SideMenu.js +20 -24
- package/lib/tntd-layout/paaslayout/index.js +20 -24
- package/lib/tntd-layout/storage.js +3 -3
- package/lib/tntd-modal/index.js +24 -31
- package/lib/tntd-rc-select/_util/PurePanel.js +17 -18
- package/lib/tntd-rc-select/_util/context.js +3 -3
- package/lib/tntd-rc-select/_util/defaultRenderEmpty.js +3 -3
- package/lib/tntd-rc-select/_util/getIcons.js +3 -3
- package/lib/tntd-rc-select/_util/useCompactItemContext.js +10 -16
- package/lib/tntd-rc-select/index.js +10 -16
- package/lib/tntd-reference/AHref/index.js +3 -3
- package/lib/tntd-reference/ReferenceBatchCheck/index.js +3 -3
- package/lib/tntd-reference/ReferenceBatchDrawer/index.js +17 -18
- package/lib/tntd-reference/ReferenceCheck/index.js +3 -3
- package/lib/tntd-reference/ReferenceDrawer/index.js +17 -18
- package/lib/tntd-reference/ReferenceInfo/index.js +3 -3
- package/lib/tntd-reference/index.js +3 -3
- package/lib/tntd-second-page/index.js +3 -3
- package/lib/tntd-select/DropDownWrap.js +34 -54
- package/lib/tntd-select/index.js +40 -57
- package/lib/tntd-virtual-tree/index.js +23 -24
- package/lib/tntd-virtual-tree/utils.js +62 -66
- package/lib/tntd-virtual-tree-select/index.js +22 -23
- package/lib/tntd-virtual-tree-select/utils.js +20 -21
- package/lib/tooltip/tooltip.js +3 -3
- package/lib/upload/index.js +41 -45
- package/lib/upload/svg/UploadSVG.js +3 -3
- package/lib/utils/checkAuth.js +6 -6
- package/lib/utils/index.js +20 -21
- package/lib/utils/lang.js +5 -5
- package/lib/water-mark/index.js +17 -18
- package/package.json +2 -2
- package/es/checkbox/checkbox-group.js +0 -16
- package/es/checkbox/checkbox-group.js.map +0 -1
- package/es/radio/radio-group.js +0 -16
- package/es/radio/radio-group.js.map +0 -1
- package/es/steps/stepStyle/small.less +0 -5
- package/es/table/total-shower.js +0 -20
- package/es/table/total-shower.js.map +0 -1
- package/es/utils/simple-template.js +0 -19
- package/es/utils/simple-template.js.map +0 -1
- package/lib/checkbox/checkbox-group.d.ts +0 -8
- package/lib/checkbox/checkbox-group.d.ts.map +0 -1
- package/lib/checkbox/checkbox-group.js +0 -16
- package/lib/checkbox/checkbox-group.js.map +0 -1
- package/lib/radio/radio-group.d.ts +0 -8
- package/lib/radio/radio-group.d.ts.map +0 -1
- package/lib/radio/radio-group.js +0 -16
- package/lib/radio/radio-group.js.map +0 -1
- package/lib/steps/stepStyle/small.less +0 -5
- package/lib/table/total-shower.d.ts +0 -9
- package/lib/table/total-shower.d.ts.map +0 -1
- package/lib/table/total-shower.js +0 -20
- package/lib/table/total-shower.js.map +0 -1
- package/lib/utils/simple-template.d.ts +0 -9
- package/lib/utils/simple-template.d.ts.map +0 -1
- package/lib/utils/simple-template.js +0 -19
- package/lib/utils/simple-template.js.map +0 -1
|
@@ -18,46 +18,32 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
18
18
|
var _Title = _interopRequireDefault(require("./Title"));
|
|
19
19
|
var _Toolbar = _interopRequireDefault(require("./Toolbar"));
|
|
20
20
|
var _createActions = _interopRequireDefault(require("./createActions"));
|
|
21
|
-
function _interopRequireDefault(
|
|
22
|
-
return
|
|
23
|
-
"default":
|
|
21
|
+
function _interopRequireDefault(e) {
|
|
22
|
+
return e && e.__esModule ? e : {
|
|
23
|
+
"default": e
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
function _defineProperty(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
writable: true
|
|
34
|
-
});
|
|
35
|
-
} else {
|
|
36
|
-
obj[key] = value;
|
|
37
|
-
}
|
|
38
|
-
return obj;
|
|
26
|
+
function _defineProperty(e, r, t) {
|
|
27
|
+
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
28
|
+
value: t,
|
|
29
|
+
enumerable: !0,
|
|
30
|
+
configurable: !0,
|
|
31
|
+
writable: !0
|
|
32
|
+
}) : e[r] = t, e;
|
|
39
33
|
}
|
|
40
|
-
function _classCallCheck(
|
|
41
|
-
if (!(
|
|
42
|
-
throw new TypeError("Cannot call a class as a function");
|
|
43
|
-
}
|
|
34
|
+
function _classCallCheck(a, n) {
|
|
35
|
+
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
44
36
|
}
|
|
45
|
-
function _defineProperties(
|
|
46
|
-
for (var
|
|
47
|
-
var
|
|
48
|
-
|
|
49
|
-
descriptor.configurable = true;
|
|
50
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
51
|
-
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
|
|
37
|
+
function _defineProperties(e, r) {
|
|
38
|
+
for (var t = 0; t < r.length; t++) {
|
|
39
|
+
var o = r[t];
|
|
40
|
+
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
|
52
41
|
}
|
|
53
42
|
}
|
|
54
|
-
function _createClass(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
writable: false
|
|
59
|
-
});
|
|
60
|
-
return Constructor;
|
|
43
|
+
function _createClass(e, r, t) {
|
|
44
|
+
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
|
|
45
|
+
writable: !1
|
|
46
|
+
}), e;
|
|
61
47
|
}
|
|
62
48
|
function _toPropertyKey(t) {
|
|
63
49
|
var i = _toPrimitive(t, "string");
|
|
@@ -76,19 +62,14 @@ function _toPrimitive(t, r) {
|
|
|
76
62
|
function _callSuper(t, o, e) {
|
|
77
63
|
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
|
78
64
|
}
|
|
79
|
-
function _possibleConstructorReturn(
|
|
80
|
-
if (
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
throw new TypeError("Derived constructors may only return object or undefined");
|
|
84
|
-
}
|
|
85
|
-
return _assertThisInitialized(self);
|
|
65
|
+
function _possibleConstructorReturn(t, e) {
|
|
66
|
+
if (e && ("object" == _typeof(e) || "function" == typeof e)) return e;
|
|
67
|
+
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
68
|
+
return _assertThisInitialized(t);
|
|
86
69
|
}
|
|
87
|
-
function _assertThisInitialized(
|
|
88
|
-
if (
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
return self;
|
|
70
|
+
function _assertThisInitialized(e) {
|
|
71
|
+
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
72
|
+
return e;
|
|
92
73
|
}
|
|
93
74
|
function _isNativeReflectConstruct() {
|
|
94
75
|
try {
|
|
@@ -98,34 +79,27 @@ function _isNativeReflectConstruct() {
|
|
|
98
79
|
return !!t;
|
|
99
80
|
})();
|
|
100
81
|
}
|
|
101
|
-
function _getPrototypeOf(
|
|
102
|
-
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function
|
|
103
|
-
return
|
|
104
|
-
};
|
|
105
|
-
return _getPrototypeOf(o);
|
|
82
|
+
function _getPrototypeOf(t) {
|
|
83
|
+
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
|
84
|
+
return t.__proto__ || Object.getPrototypeOf(t);
|
|
85
|
+
}, _getPrototypeOf(t);
|
|
106
86
|
}
|
|
107
|
-
function _inherits(
|
|
108
|
-
if (typeof
|
|
109
|
-
|
|
110
|
-
}
|
|
111
|
-
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
87
|
+
function _inherits(t, e) {
|
|
88
|
+
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
|
89
|
+
t.prototype = Object.create(e && e.prototype, {
|
|
112
90
|
constructor: {
|
|
113
|
-
value:
|
|
114
|
-
writable:
|
|
115
|
-
configurable:
|
|
91
|
+
value: t,
|
|
92
|
+
writable: !0,
|
|
93
|
+
configurable: !0
|
|
116
94
|
}
|
|
117
|
-
})
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
});
|
|
121
|
-
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
95
|
+
}), Object.defineProperty(t, "prototype", {
|
|
96
|
+
writable: !1
|
|
97
|
+
}), e && _setPrototypeOf(t, e);
|
|
122
98
|
}
|
|
123
|
-
function _setPrototypeOf(
|
|
124
|
-
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
};
|
|
128
|
-
return _setPrototypeOf(o, p);
|
|
99
|
+
function _setPrototypeOf(t, e) {
|
|
100
|
+
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
101
|
+
return t.__proto__ = e, t;
|
|
102
|
+
}, _setPrototypeOf(t, e);
|
|
129
103
|
}
|
|
130
104
|
var QueryListScene = exports["default"] = /*#__PURE__*/function (_React$Component) {
|
|
131
105
|
function QueryListScene(props) {
|
|
@@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
function _interopRequireDefault(
|
|
9
|
-
return
|
|
10
|
-
"default":
|
|
8
|
+
function _interopRequireDefault(e) {
|
|
9
|
+
return e && e.__esModule ? e : {
|
|
10
|
+
"default": e
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
@@ -6,9 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
|
-
function _interopRequireDefault(
|
|
10
|
-
return
|
|
11
|
-
"default":
|
|
9
|
+
function _interopRequireDefault(e) {
|
|
10
|
+
return e && e.__esModule ? e : {
|
|
11
|
+
"default": e
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
14
|
function _typeof(o) {
|
|
@@ -20,19 +20,13 @@ function _typeof(o) {
|
|
|
20
20
|
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
21
21
|
}, _typeof(o);
|
|
22
22
|
}
|
|
23
|
-
function _defineProperty(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
writable: true
|
|
31
|
-
});
|
|
32
|
-
} else {
|
|
33
|
-
obj[key] = value;
|
|
34
|
-
}
|
|
35
|
-
return obj;
|
|
23
|
+
function _defineProperty(e, r, t) {
|
|
24
|
+
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
25
|
+
value: t,
|
|
26
|
+
enumerable: !0,
|
|
27
|
+
configurable: !0,
|
|
28
|
+
writable: !0
|
|
29
|
+
}) : e[r] = t, e;
|
|
36
30
|
}
|
|
37
31
|
function _toPropertyKey(t) {
|
|
38
32
|
var i = _toPrimitive(t, "string");
|
|
@@ -7,9 +7,9 @@ exports["default"] = void 0;
|
|
|
7
7
|
var _set2 = _interopRequireDefault(require("lodash/set"));
|
|
8
8
|
var _get2 = _interopRequireDefault(require("lodash/get"));
|
|
9
9
|
var _eventemitter = _interopRequireDefault(require("eventemitter3"));
|
|
10
|
-
function _interopRequireDefault(
|
|
11
|
-
return
|
|
12
|
-
"default":
|
|
10
|
+
function _interopRequireDefault(e) {
|
|
11
|
+
return e && e.__esModule ? e : {
|
|
12
|
+
"default": e
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
15
|
var _default = exports["default"] = function _default() {
|
|
@@ -12,9 +12,9 @@ var _List = _interopRequireDefault(require("./List"));
|
|
|
12
12
|
var _createActions = _interopRequireDefault(require("./createActions"));
|
|
13
13
|
var _useActions = _interopRequireDefault(require("./useActions"));
|
|
14
14
|
require("./index.less");
|
|
15
|
-
function _interopRequireDefault(
|
|
16
|
-
return
|
|
17
|
-
"default":
|
|
15
|
+
function _interopRequireDefault(e) {
|
|
16
|
+
return e && e.__esModule ? e : {
|
|
17
|
+
"default": e
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
20
|
var QueryForm = exports.QueryForm = _QueryForm["default"];
|
|
@@ -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(e) {
|
|
10
|
+
return e && e.__esModule ? e : {
|
|
11
|
+
"default": e
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
14
|
function useActions() {
|
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(e) {
|
|
35
|
+
return e && e.__esModule ? e : {
|
|
36
|
+
"default": e
|
|
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(e) {
|
|
11
|
+
return e && e.__esModule ? e : {
|
|
12
|
+
"default": e
|
|
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,168 @@
|
|
|
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(e) {
|
|
21
|
+
return e && e.__esModule ? e : {
|
|
22
|
+
"default": e
|
|
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(r, e) {
|
|
51
|
+
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _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(r, a) {
|
|
57
|
+
if (r) {
|
|
58
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
59
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
60
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
function _arrayLikeToArray(r, a) {
|
|
64
|
+
(null == a || a > r.length) && (a = r.length);
|
|
65
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
66
|
+
return n;
|
|
67
|
+
}
|
|
68
|
+
function _iterableToArrayLimit(r, l) {
|
|
69
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
70
|
+
if (null != t) {
|
|
71
|
+
var e,
|
|
72
|
+
n,
|
|
73
|
+
i,
|
|
74
|
+
u,
|
|
75
|
+
a = [],
|
|
76
|
+
f = !0,
|
|
77
|
+
o = !1;
|
|
78
|
+
try {
|
|
79
|
+
if (i = (t = t.call(r)).next, 0 === l) {
|
|
80
|
+
if (Object(t) !== t) return;
|
|
81
|
+
f = !1;
|
|
82
|
+
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
83
|
+
} catch (r) {
|
|
84
|
+
o = !0, n = r;
|
|
85
|
+
} finally {
|
|
86
|
+
try {
|
|
87
|
+
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
|
|
88
|
+
} finally {
|
|
89
|
+
if (o) throw n;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return a;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
function _arrayWithHoles(r) {
|
|
96
|
+
if (Array.isArray(r)) return r;
|
|
97
|
+
}
|
|
98
|
+
var _default = exports["default"] = (0, _react.forwardRef)(function (props, ref) {
|
|
99
|
+
var _useContext = (0, _react.useContext)(_Context["default"]),
|
|
100
|
+
wrapElement = _useContext.wrapElement;
|
|
101
|
+
var _useState = (0, _react.useState)(0),
|
|
102
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
103
|
+
moveX = _useState2[0],
|
|
104
|
+
setMoveX = _useState2[1];
|
|
105
|
+
var _useState3 = (0, _react.useState)(0),
|
|
106
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
107
|
+
moveY = _useState4[0],
|
|
108
|
+
setMoveY = _useState4[1];
|
|
109
|
+
var _useState5 = (0, _react.useState)(0),
|
|
110
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
111
|
+
sizeWidth = _useState6[0],
|
|
112
|
+
setSizeWidth = _useState6[1];
|
|
113
|
+
var _useState7 = (0, _react.useState)(0),
|
|
114
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
115
|
+
sizeHeight = _useState8[0],
|
|
116
|
+
setSizeHeight = _useState8[1];
|
|
117
|
+
var _useState9 = (0, _react.useState)(1),
|
|
118
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
119
|
+
ratioX = _useState10[0],
|
|
120
|
+
setRatioX = _useState10[1];
|
|
121
|
+
var _useState11 = (0, _react.useState)(1),
|
|
122
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
123
|
+
ratioY = _useState12[0],
|
|
124
|
+
setRatioY = _useState12[1];
|
|
125
|
+
(0, _react.useImperativeHandle)(ref, function () {
|
|
126
|
+
return {
|
|
127
|
+
update: update,
|
|
128
|
+
handleScroll: handleScroll
|
|
129
|
+
};
|
|
130
|
+
});
|
|
131
|
+
function handleScroll() {
|
|
132
|
+
var wrap = wrapElement.current;
|
|
133
|
+
if (!wrap) return;
|
|
134
|
+
var offsetHeight = wrap.offsetHeight - _util.GAP;
|
|
135
|
+
var offsetWidth = wrap.offsetWidth - _util.GAP;
|
|
136
|
+
setMoveY(wrap.scrollTop * 100 / offsetHeight * ratioY);
|
|
137
|
+
setMoveX(wrap.scrollLeft * 100 / offsetWidth * ratioX);
|
|
138
|
+
}
|
|
139
|
+
function update() {
|
|
140
|
+
var wrap = wrapElement.current;
|
|
141
|
+
if (!wrap) return;
|
|
142
|
+
// 滚动窗口的高度
|
|
143
|
+
var offsetHeight = wrap.offsetHeight - _util.GAP;
|
|
144
|
+
var offsetWidth = wrap.offsetWidth - _util.GAP;
|
|
145
|
+
// 滚动条的逻辑高度
|
|
146
|
+
var originalHeight = Math.pow(offsetHeight, 2) / wrap.scrollHeight;
|
|
147
|
+
var originalWidth = Math.pow(offsetWidth, 2) / wrap.scrollWidth;
|
|
148
|
+
// 滚动条的实际高度,因为如果内容太长会导致滚动条非常短,可能难以点击拖拽,所以设置了最小高度
|
|
149
|
+
var height = Math.max(originalHeight, props.minSize);
|
|
150
|
+
var width = Math.max(originalWidth, props.minSize);
|
|
151
|
+
setRatioY(originalHeight / (offsetHeight - originalHeight) / (height / (offsetHeight - height)));
|
|
152
|
+
setRatioX(originalWidth / (offsetWidth - originalWidth) / (width / (offsetWidth - width)));
|
|
153
|
+
setSizeHeight(height + _util.GAP < offsetHeight ? height : 0);
|
|
154
|
+
setSizeWidth(width + _util.GAP < offsetWidth ? width : 0);
|
|
155
|
+
}
|
|
156
|
+
return _react["default"].createElement(_react["default"].Fragment, null, _react["default"].createElement(_Thumb["default"], {
|
|
157
|
+
always: props.always,
|
|
158
|
+
move: moveX,
|
|
159
|
+
size: sizeWidth,
|
|
160
|
+
ratio: ratioX
|
|
161
|
+
}), _react["default"].createElement(_Thumb["default"], {
|
|
162
|
+
always: props.always,
|
|
163
|
+
move: moveY,
|
|
164
|
+
size: sizeHeight,
|
|
165
|
+
ratio: ratioY,
|
|
166
|
+
vertical: true
|
|
167
|
+
}));
|
|
168
|
+
});
|
|
@@ -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(e) {
|
|
9
|
+
return e && e.__esModule ? e : {
|
|
10
|
+
"default": e
|
|
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(e) {
|
|
46
|
+
return e && e.__esModule ? e : {
|
|
47
|
+
"default": e
|
|
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"]}
|