tntd 2.0.14 → 2.0.15
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/array-input/index.js +6 -31
- package/es/array-input/style/index.js +1 -0
- package/es/array-input/style/index.js.map +1 -0
- package/es/auth-context/style/index.js +1 -0
- package/es/auth-context/style/index.js.map +1 -0
- package/es/columns/index.js +6 -12
- package/es/development-login/LoginModal.js +4 -10
- package/es/development-login/style/index.js +1 -0
- package/es/development-login/style/index.js.map +1 -0
- package/es/drawer/drawer.js +5 -9
- package/es/drawer/drawer.js.map +1 -1
- package/es/drawer/drawer.less +13 -11
- package/es/ellipsis/index.js +14 -25
- package/es/ellipsis/style/index.js +1 -0
- package/es/ellipsis/style/index.js.map +1 -0
- package/es/empty/empty.js +9 -13
- package/es/empty/render-empty.js +22 -0
- package/es/empty/render-empty.js.map +1 -0
- package/es/empty/style/index.js +2 -0
- package/es/empty/style/index.js.map +1 -0
- package/es/handle/index.js +14 -27
- package/es/handle/style/index.js +1 -0
- package/es/handle/style/index.js.map +1 -0
- package/es/icon-list/style/index.js +1 -0
- package/es/icon-list/style/index.js.map +1 -0
- package/es/img/Contain.js +13 -19
- package/es/img/Cover.js +13 -24
- package/es/img/index.js +14 -21
- package/es/img/style/index.js +1 -0
- package/es/img/style/index.js.map +1 -0
- package/es/index.js +0 -1
- package/es/loading-button/index.js +6 -13
- package/es/loading-button/style/index.js +1 -0
- package/es/loading-button/style/index.js.map +1 -0
- package/es/locale/default.js +0 -2
- package/es/locale/en_US.js +0 -2
- package/es/locale/zh_CN.js +0 -2
- package/es/modal/index.js +11 -2
- package/es/modal/index.js.map +1 -1
- package/es/modal/modal.js +44 -0
- package/es/modal/modal.js.map +1 -0
- package/es/modal/modal.less +27 -25
- package/es/page/Box.js +19 -28
- package/es/page/index.js +22 -38
- package/es/page/style/index.js +1 -0
- package/es/page/style/index.js.map +1 -0
- package/es/page/utils.js +0 -5
- package/es/prev-locale.js +0 -3
- package/es/query-form/Field/Checkbox.js +4 -8
- package/es/query-form/Field/Select.js +10 -17
- package/es/query-form/Field/SelectInput.js +4 -18
- package/es/query-form/Field/fieldsMap.js +0 -1
- package/es/query-form/Field/index.js +2 -11
- package/es/query-form/createActions.js +0 -8
- package/es/query-form/index.js +2 -34
- package/es/query-form/style/index.js +1 -0
- package/es/query-form/style/index.js.map +1 -0
- package/es/query-list-scene/List.js +18 -39
- package/es/query-list-scene/QueryForm.js +10 -19
- package/es/query-list-scene/QueryListScene.js +0 -2
- package/es/query-list-scene/Toolbar.js +6 -10
- package/es/query-list-scene/createActions.js +0 -3
- package/es/query-list-scene/style/index.js +1 -0
- package/es/query-list-scene/style/index.js.map +1 -0
- package/es/render-empty/render-empty.js +0 -2
- package/es/render-empty/style/index.js +1 -0
- package/es/render-empty/style/index.js.map +1 -0
- package/es/steps/steps.js +9 -17
- package/es/svg-components/illustration-403.js +0 -2
- package/es/svg-components/illustration-404.js +0 -2
- package/es/svg-components/illustration-500.js +0 -2
- package/es/svg-components/illustration-empty.js +0 -2
- package/es/svg-components/illustration-failure.js +0 -2
- package/es/svg-components/illustration-no-access.js +0 -2
- package/es/svg-components/illustration-no-chart.js +0 -2
- package/es/svg-components/illustration-no-result.js +0 -2
- package/es/svg-components/illustration-offline.js +0 -2
- package/es/svg-components/illustration-success.js +0 -2
- package/es/table/assets/image-loading-background.js +0 -2
- package/es/table/assets/image-loading.js +0 -2
- package/es/table/hooks/use-column-setting.js +0 -1
- package/es/table/style/index.js +2 -0
- package/es/table/style/index.js.map +1 -0
- package/es/table/table.js +14 -19
- package/es/table/table.stories.js +0 -2
- package/es/table/utils.js +2 -6
- package/es/title/index.js +10 -14
- package/es/title/style/index.js +1 -0
- package/es/title/style/index.js.map +1 -0
- package/es/tntd-cascader/AntdCascader/component/context.js +2 -4
- package/es/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +0 -2
- package/es/tntd-cascader/AntdCascader/component/getIcons.js +6 -15
- package/es/tntd-cascader/AntdCascader/config/utils.js +0 -2
- package/es/tntd-cascader/AntdCascader/config/warning.js +4 -8
- package/es/tntd-cascader/AntdCascader/index.js +51 -73
- package/es/tntd-cascader/rc-cascader/Cascader.js +86 -113
- package/es/tntd-cascader/rc-cascader/OptionList/Column.js +16 -26
- package/es/tntd-cascader/rc-cascader/OptionList/index.js +26 -43
- package/es/tntd-cascader/rc-cascader/OptionList/useActive.js +5 -7
- package/es/tntd-cascader/rc-cascader/OptionList/useKeyboard.js +12 -41
- package/es/tntd-cascader/rc-cascader/hooks/useDisplayValues.js +4 -10
- package/es/tntd-cascader/rc-cascader/hooks/useEntities.js +2 -4
- package/es/tntd-cascader/rc-cascader/hooks/useMissingValues.js +0 -1
- package/es/tntd-cascader/rc-cascader/hooks/useRefFunc.js +0 -1
- package/es/tntd-cascader/rc-cascader/hooks/useSearchConfig.js +2 -7
- package/es/tntd-cascader/rc-cascader/hooks/useSearchOptions.js +8 -15
- package/es/tntd-cascader/rc-cascader/utils/commonUtil.js +2 -6
- package/es/tntd-cascader/rc-cascader/utils/treeUtil.js +2 -4
- package/es/tntd-cascader/rc-cascader/utils/warningPropsUtil.js +2 -7
- package/es/tntd-icon/fonts/iconfont.js +7 -12
- package/es/tntd-icon/index.js +5 -9
- package/es/tntd-icon/style/index.js +1 -0
- package/es/tntd-icon/style/index.js.map +1 -0
- package/es/tntd-layout/ActionsContext.js +2 -2
- package/es/tntd-layout/AppList.js +2 -14
- package/es/tntd-layout/Application.js +0 -4
- package/es/tntd-layout/Avatar.js +0 -4
- package/es/tntd-layout/CompatibleLanguage.js +0 -13
- package/es/tntd-layout/EnterpriseLayout/Avatar.js +0 -4
- package/es/tntd-layout/EnterpriseLayout/Language.js +0 -6
- package/es/tntd-layout/EnterpriseLayout/Theme.js +0 -4
- package/es/tntd-layout/EnterpriseLayout/index.js +2 -2
- package/es/tntd-layout/GlobalNavigation/NavigationPopup.js +2 -33
- package/es/tntd-layout/GlobalNavigation/index.js +0 -6
- package/es/tntd-layout/HeaderActions.js +28 -32
- package/es/tntd-layout/HeaderNavs.js +6 -14
- package/es/tntd-layout/HeaderTabs.js +14 -35
- package/es/tntd-layout/Language.js +0 -6
- package/es/tntd-layout/Layout.js +2 -7
- package/es/tntd-layout/Logo.js +4 -11
- package/es/tntd-layout/OrgAppList.js +22 -39
- package/es/tntd-layout/SideMenu.js +8 -45
- package/es/tntd-layout/Theme.js +0 -6
- package/es/tntd-layout/index.js +9 -17
- package/es/tntd-layout/paaslayout/CompactSideMenu.js +0 -15
- package/es/tntd-layout/paaslayout/SideMenu.js +0 -15
- package/es/tntd-layout/paaslayout/index.js +4 -13
- package/es/tntd-layout/storage.js +2 -2
- package/es/tntd-layout/style/index.js +1 -0
- package/es/tntd-layout/style/index.js.map +1 -0
- package/es/tntd-modal/index.js +12 -18
- package/es/tntd-modal/style/index.js +1 -0
- package/es/tntd-modal/style/index.js.map +1 -0
- package/es/tntd-second-page/index.js +0 -3
- package/es/tntd-select/DropDownWrap.js +4 -8
- package/es/tntd-select/index.js +74 -118
- package/es/tntd-select/style/index.js +1 -0
- package/es/tntd-select/style/index.js.map +1 -0
- package/es/utils/checkAuth.js +0 -1
- package/es/utils/findMenuInfoByPath.js +0 -3
- package/es/utils/index.js +2 -11
- package/lib/affix/index.js +4 -10
- package/lib/alert/index.js +4 -10
- package/lib/anchor/index.js +4 -10
- package/lib/array-input/icon.js +1 -7
- package/lib/array-input/index.js +41 -91
- package/lib/array-input/style/index.d.ts +1 -0
- package/lib/array-input/style/index.d.ts.map +1 -0
- package/lib/array-input/style/index.js +1 -0
- package/lib/array-input/style/index.js.map +1 -0
- package/lib/auth-context/index.js +0 -3
- package/lib/auth-context/style/index.d.ts +1 -0
- package/lib/auth-context/style/index.d.ts.map +1 -0
- package/lib/auth-context/style/index.js +1 -0
- package/lib/auth-context/style/index.js.map +1 -0
- package/lib/auto-complete/index.js +4 -10
- package/lib/avatar/index.js +4 -10
- package/lib/back-top/index.js +4 -10
- package/lib/badge/index.js +4 -10
- package/lib/breadcrumb/index.js +4 -10
- package/lib/button/index.js +4 -10
- package/lib/calendar/index.js +4 -10
- package/lib/card/index.js +4 -10
- package/lib/carousel/index.js +4 -10
- package/lib/cascader/index.js +4 -10
- package/lib/checkbox/index.js +4 -10
- package/lib/col/index.js +4 -10
- package/lib/collapse/index.js +4 -11
- package/lib/columns/index.js +14 -28
- package/lib/comment/index.js +4 -10
- package/lib/config-provider/config-provider.js +0 -2
- package/lib/config-provider/index.js +4 -10
- package/lib/date-picker/index.js +4 -10
- package/lib/descriptions/index.js +4 -10
- package/lib/development-login/LoginModal.js +25 -50
- package/lib/development-login/index.js +11 -22
- package/lib/development-login/style/index.d.ts +1 -0
- package/lib/development-login/style/index.d.ts.map +1 -0
- package/lib/development-login/style/index.js +1 -0
- package/lib/development-login/style/index.js.map +1 -0
- package/lib/divider/index.js +4 -10
- package/lib/drawer/drawer.d.ts.map +1 -1
- package/lib/drawer/drawer.js +7 -17
- package/lib/drawer/drawer.js.map +1 -1
- package/lib/drawer/drawer.less +13 -11
- package/lib/drawer/index.js +1 -5
- package/lib/dropdown/index.js +4 -10
- package/lib/ellipsis/Svg/CopySVG.js +0 -4
- package/lib/ellipsis/Svg/TickSVG.js +0 -4
- package/lib/ellipsis/index.js +42 -73
- package/lib/ellipsis/style/index.d.ts +1 -0
- package/lib/ellipsis/style/index.d.ts.map +1 -0
- package/lib/ellipsis/style/index.js +1 -0
- package/lib/ellipsis/style/index.js.map +1 -0
- package/lib/empty/empty.js +14 -30
- package/lib/empty/empty.stories.js +3 -21
- package/lib/empty/index.js +1 -5
- package/lib/empty/render-empty.d.ts +3 -0
- package/lib/empty/render-empty.d.ts.map +1 -0
- package/lib/empty/render-empty.js +32 -0
- package/lib/empty/render-empty.js.map +1 -0
- package/lib/empty/style/index.d.ts +3 -0
- package/lib/empty/style/index.d.ts.map +1 -0
- package/lib/empty/style/index.js +4 -0
- package/lib/empty/style/index.js.map +1 -0
- package/lib/exception/exception.js +7 -14
- package/lib/exception/index.js +1 -4
- package/lib/form/index.js +4 -10
- package/lib/handle/index.js +19 -46
- package/lib/handle/style/index.d.ts +1 -0
- package/lib/handle/style/index.d.ts.map +1 -0
- package/lib/handle/style/index.js +1 -0
- package/lib/handle/style/index.js.map +1 -0
- package/lib/icon/index.js +4 -10
- package/lib/icon-list/style/index.d.ts +3 -0
- package/lib/icon-list/style/index.d.ts.map +1 -0
- package/lib/icon-list/style/index.js +8 -0
- package/lib/icon-list/style/index.js.map +1 -0
- package/lib/img/Contain.js +12 -23
- package/lib/img/Cover.js +31 -53
- package/lib/img/index.js +29 -47
- package/lib/img/style/index.d.ts +1 -0
- package/lib/img/style/index.d.ts.map +1 -0
- package/lib/img/style/index.js +1 -0
- package/lib/img/style/index.js.map +1 -0
- package/lib/index.js +100 -187
- package/lib/input/index.js +4 -10
- package/lib/input-number/index.js +4 -10
- package/lib/layout/index.js +4 -10
- package/lib/list/index.js +4 -10
- package/lib/loading-button/index.js +15 -32
- package/lib/loading-button/style/index.d.ts +1 -0
- package/lib/loading-button/style/index.d.ts.map +1 -0
- package/lib/loading-button/style/index.js +1 -0
- package/lib/loading-button/style/index.js.map +1 -0
- package/lib/locale/default.js +0 -5
- package/lib/locale/en_US.js +0 -4
- package/lib/locale/index.js +3 -6
- package/lib/locale/zh_CN.js +0 -4
- package/lib/locale-provider/index.js +4 -10
- package/lib/mention/index.js +4 -10
- package/lib/mentions/index.js +4 -10
- package/lib/menu/index.js +4 -10
- package/lib/message/index.js +4 -11
- package/lib/modal/index.d.ts +2 -2
- package/lib/modal/index.d.ts.map +1 -1
- package/lib/modal/index.js +13 -14
- package/lib/modal/index.js.map +1 -1
- package/lib/modal/modal.d.ts +15 -0
- package/lib/modal/modal.d.ts.map +1 -0
- package/lib/modal/modal.js +66 -0
- package/lib/modal/modal.js.map +1 -0
- package/lib/modal/modal.less +27 -25
- package/lib/notification/index.js +4 -10
- package/lib/page/Box.js +24 -37
- package/lib/page/index.js +37 -66
- package/lib/page/style/index.d.ts +1 -0
- package/lib/page/style/index.d.ts.map +1 -0
- package/lib/page/style/index.js +1 -0
- package/lib/page/style/index.js.map +1 -0
- package/lib/page/utils.js +1 -9
- package/lib/page-header/index.js +4 -10
- package/lib/pagination/index.js +4 -10
- package/lib/popconfirm/index.js +4 -10
- package/lib/popover/index.js +4 -10
- package/lib/prev-locale.js +1 -10
- package/lib/progress/index.js +4 -10
- package/lib/query-form/Field/Checkbox.js +2 -11
- package/lib/query-form/Field/Select.js +27 -45
- package/lib/query-form/Field/SelectInput.js +21 -46
- package/lib/query-form/Field/fieldsMap.js +1 -12
- package/lib/query-form/Field/index.js +38 -70
- package/lib/query-form/createActions.js +0 -7
- package/lib/query-form/index.js +52 -121
- package/lib/query-form/style/index.d.ts +1 -0
- package/lib/query-form/style/index.d.ts.map +1 -0
- package/lib/query-form/style/index.js +1 -0
- package/lib/query-form/style/index.js.map +1 -0
- package/lib/query-form/useForm.js +0 -4
- package/lib/query-list-scene/List.js +58 -111
- package/lib/query-list-scene/QueryForm.js +37 -67
- package/lib/query-list-scene/QueryListScene.js +21 -42
- package/lib/query-list-scene/Title.js +1 -5
- package/lib/query-list-scene/Toolbar.js +8 -15
- package/lib/query-list-scene/createActions.js +0 -6
- package/lib/query-list-scene/index.js +0 -10
- package/lib/query-list-scene/style/index.d.ts +1 -0
- package/lib/query-list-scene/style/index.d.ts.map +1 -0
- package/lib/query-list-scene/style/index.js +1 -0
- package/lib/query-list-scene/style/index.js.map +1 -0
- package/lib/query-list-scene/useActions.js +0 -4
- package/lib/radio/index.js +4 -10
- package/lib/rate/index.js +4 -10
- package/lib/render-empty/index.js +0 -2
- package/lib/render-empty/render-empty.js +0 -8
- package/lib/render-empty/style/index.d.ts +2 -0
- package/lib/render-empty/style/index.d.ts.map +1 -0
- package/lib/render-empty/style/index.js +3 -0
- package/lib/render-empty/style/index.js.map +1 -0
- package/lib/result/index.js +4 -10
- package/lib/row/index.js +4 -10
- package/lib/select/index.js +4 -10
- package/lib/skeleton/index.js +4 -10
- package/lib/slider/index.js +4 -10
- package/lib/spin/index.js +4 -10
- package/lib/statistic/index.js +4 -10
- package/lib/steps/index.js +1 -5
- package/lib/steps/steps.js +12 -29
- package/lib/svg-components/illustration-403.js +3 -9
- package/lib/svg-components/illustration-404.js +3 -9
- package/lib/svg-components/illustration-500.js +3 -9
- package/lib/svg-components/illustration-empty.js +3 -9
- package/lib/svg-components/illustration-failure.js +3 -9
- package/lib/svg-components/illustration-no-access.js +3 -9
- package/lib/svg-components/illustration-no-chart.js +3 -9
- package/lib/svg-components/illustration-no-result.js +3 -9
- package/lib/svg-components/illustration-offline.js +3 -9
- package/lib/svg-components/illustration-success.js +3 -9
- package/lib/svg-components/index.js +0 -11
- package/lib/switch/index.js +4 -10
- package/lib/table/assets/image-loading-background.js +3 -9
- package/lib/table/assets/image-loading.js +3 -9
- package/lib/table/context.js +0 -2
- package/lib/table/hooks/index.js +1 -2
- package/lib/table/hooks/use-column-setting.js +8 -16
- package/lib/table/index.js +1 -5
- package/lib/table/style/index.d.ts +3 -0
- package/lib/table/style/index.d.ts.map +1 -0
- package/lib/table/style/index.js +4 -0
- package/lib/table/style/index.js.map +1 -0
- package/lib/table/table.js +34 -63
- package/lib/table/table.stories.js +2 -11
- package/lib/table/utils.js +2 -11
- package/lib/tabs/index.js +4 -10
- package/lib/tag/index.js +4 -10
- package/lib/time-picker/index.js +4 -10
- package/lib/timeline/index.js +4 -10
- package/lib/title/index.js +10 -20
- package/lib/title/style/index.d.ts +1 -0
- package/lib/title/style/index.d.ts.map +1 -0
- package/lib/title/style/index.js +1 -0
- package/lib/title/style/index.js.map +1 -0
- package/lib/tntd-cascader/AntdCascader/component/DisabledContext.js +4 -11
- package/lib/tntd-cascader/AntdCascader/component/FormItemInputContext.js +3 -8
- package/lib/tntd-cascader/AntdCascader/component/SizeContext.js +3 -8
- package/lib/tntd-cascader/AntdCascader/component/context.js +3 -9
- package/lib/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +4 -12
- package/lib/tntd-cascader/AntdCascader/component/getIcons.js +19 -37
- package/lib/tntd-cascader/AntdCascader/component/useCompactItemContext.js +8 -17
- package/lib/tntd-cascader/AntdCascader/config/utils.js +6 -15
- package/lib/tntd-cascader/AntdCascader/config/warning.js +7 -15
- package/lib/tntd-cascader/AntdCascader/index.js +80 -133
- package/lib/tntd-cascader/AntdCascader/interface.js +0 -3
- package/lib/tntd-cascader/index.js +0 -2
- package/lib/tntd-cascader/rc-cascader/Cascader.js +123 -188
- package/lib/tntd-cascader/rc-cascader/OptionList/Checkbox.js +11 -21
- package/lib/tntd-cascader/rc-cascader/OptionList/Column.js +60 -88
- package/lib/tntd-cascader/rc-cascader/OptionList/index.js +65 -109
- package/lib/tntd-cascader/rc-cascader/OptionList/useActive.js +18 -33
- package/lib/tntd-cascader/rc-cascader/OptionList/useKeyboard.js +56 -106
- package/lib/tntd-cascader/rc-cascader/context.js +3 -8
- package/lib/tntd-cascader/rc-cascader/hooks/useDisplayValues.js +14 -31
- package/lib/tntd-cascader/rc-cascader/hooks/useEntities.js +5 -15
- package/lib/tntd-cascader/rc-cascader/hooks/useMissingValues.js +3 -11
- package/lib/tntd-cascader/rc-cascader/hooks/useRefFunc.js +3 -8
- package/lib/tntd-cascader/rc-cascader/hooks/useSearchConfig.js +3 -15
- package/lib/tntd-cascader/rc-cascader/hooks/useSearchOptions.js +26 -41
- package/lib/tntd-cascader/rc-cascader/index.js +0 -3
- package/lib/tntd-cascader/rc-cascader/utils/commonUtil.js +9 -20
- package/lib/tntd-cascader/rc-cascader/utils/treeUtil.js +0 -8
- package/lib/tntd-cascader/rc-cascader/utils/warningPropsUtil.js +7 -14
- package/lib/tntd-icon/fonts/iconfont.js +7 -12
- package/lib/tntd-icon/index.js +6 -17
- package/lib/tntd-icon/style/index.d.ts +1 -0
- package/lib/tntd-icon/style/index.d.ts.map +1 -0
- package/lib/tntd-icon/style/index.js +1 -0
- package/lib/tntd-icon/style/index.js.map +1 -0
- package/lib/tntd-layout/ActionsContext.js +0 -3
- package/lib/tntd-layout/AppList.js +30 -105
- package/lib/tntd-layout/Application.js +22 -84
- package/lib/tntd-layout/Avatar.js +18 -72
- package/lib/tntd-layout/CompatibleLanguage.js +32 -105
- package/lib/tntd-layout/EnterpriseLayout/Avatar.js +24 -80
- package/lib/tntd-layout/EnterpriseLayout/Language.js +14 -45
- package/lib/tntd-layout/EnterpriseLayout/Theme.js +16 -46
- package/lib/tntd-layout/EnterpriseLayout/index.js +4 -12
- package/lib/tntd-layout/GlobalNavigation/NavigationPopup.js +45 -174
- package/lib/tntd-layout/GlobalNavigation/index.js +19 -70
- package/lib/tntd-layout/Header.js +20 -54
- package/lib/tntd-layout/HeaderActions.js +33 -64
- package/lib/tntd-layout/HeaderNavs.js +19 -59
- package/lib/tntd-layout/HeaderTabs.js +43 -111
- package/lib/tntd-layout/Iconfont.js +0 -5
- package/lib/tntd-layout/Language.js +14 -45
- package/lib/tntd-layout/Layout.js +74 -113
- package/lib/tntd-layout/Logo.js +14 -41
- package/lib/tntd-layout/OrgAppList.js +51 -119
- package/lib/tntd-layout/SideMenu.js +42 -120
- package/lib/tntd-layout/Theme.js +19 -71
- package/lib/tntd-layout/createActions.js +0 -5
- package/lib/tntd-layout/images/index.js +0 -28
- package/lib/tntd-layout/index.js +21 -49
- package/lib/tntd-layout/paaslayout/CompactSideMenu.js +29 -81
- package/lib/tntd-layout/paaslayout/Header.js +14 -47
- package/lib/tntd-layout/paaslayout/Logo.js +2 -19
- package/lib/tntd-layout/paaslayout/SideMenu.js +31 -82
- package/lib/tntd-layout/paaslayout/index.js +62 -108
- package/lib/tntd-layout/storage.d.ts +1 -1
- package/lib/tntd-layout/storage.d.ts.map +1 -1
- package/lib/tntd-layout/storage.js +3 -33
- package/lib/tntd-layout/style/index.d.ts +1 -0
- package/lib/tntd-layout/style/index.d.ts.map +1 -0
- package/lib/tntd-layout/style/index.js +1 -0
- package/lib/tntd-layout/style/index.js.map +1 -0
- package/lib/tntd-modal/index.js +32 -51
- package/lib/tntd-modal/style/index.d.ts +1 -0
- package/lib/tntd-modal/style/index.d.ts.map +1 -0
- package/lib/tntd-modal/style/index.js +1 -0
- package/lib/tntd-modal/style/index.js.map +1 -0
- package/lib/tntd-second-page/index.js +14 -24
- package/lib/tntd-select/DropDownWrap.js +24 -45
- package/lib/tntd-select/index.js +117 -206
- package/lib/tntd-select/style/index.d.ts +1 -0
- package/lib/tntd-select/style/index.d.ts.map +1 -0
- package/lib/tntd-select/style/index.js +1 -0
- package/lib/tntd-select/style/index.js.map +1 -0
- package/lib/tooltip/index.js +4 -10
- package/lib/transfer/index.js +4 -10
- package/lib/tree/index.js +4 -10
- package/lib/tree-select/index.js +4 -10
- package/lib/typography/index.js +4 -10
- package/lib/upload/index.js +4 -10
- package/lib/utils/checkAuth.js +4 -10
- package/lib/utils/findMenuInfoByPath.js +1 -7
- package/lib/utils/index.js +13 -41
- package/lib/version/index.js +4 -10
- package/package.json +1 -1
package/es/tntd-select/index.js
CHANGED
|
@@ -1,21 +1,18 @@
|
|
|
1
1
|
var __rest = this && this.__rest || function (s, e) {
|
|
2
2
|
var t = {};
|
|
3
|
-
|
|
4
3
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
5
|
-
|
|
6
4
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
5
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
8
6
|
}
|
|
9
7
|
return t;
|
|
10
8
|
};
|
|
11
|
-
|
|
12
9
|
import React, { PureComponent } from 'react';
|
|
13
10
|
import Select from '../select';
|
|
14
11
|
import Empty from '../empty';
|
|
15
|
-
import DropDownWrap from './DropDownWrap';
|
|
16
|
-
|
|
17
|
-
const ITEM_ELEMENT_NUMBER = 30;
|
|
18
|
-
|
|
12
|
+
import DropDownWrap from './DropDownWrap';
|
|
13
|
+
// 页面实际渲染的下拉菜单数量,实际为 2 * ITEM_ELEMENT_NUMBER
|
|
14
|
+
const ITEM_ELEMENT_NUMBER = 30;
|
|
15
|
+
// Select size 配置
|
|
19
16
|
const ITEM_HEIGHT_CFG = {
|
|
20
17
|
small: 24,
|
|
21
18
|
large: 40,
|
|
@@ -27,7 +24,6 @@ const ARROW_CODE = {
|
|
|
27
24
|
};
|
|
28
25
|
const DROPDOWN_HEIGHT = 224;
|
|
29
26
|
const Option = Select.Option;
|
|
30
|
-
|
|
31
27
|
class SuperSelect extends PureComponent {
|
|
32
28
|
constructor(props) {
|
|
33
29
|
super(props);
|
|
@@ -38,7 +34,6 @@ class SuperSelect extends PureComponent {
|
|
|
38
34
|
value: children => {
|
|
39
35
|
if (!children) return [];
|
|
40
36
|
let arr = [];
|
|
41
|
-
|
|
42
37
|
if (children && children.props) {
|
|
43
38
|
arr.push(children);
|
|
44
39
|
} else {
|
|
@@ -52,7 +47,6 @@ class SuperSelect extends PureComponent {
|
|
|
52
47
|
}
|
|
53
48
|
});
|
|
54
49
|
}
|
|
55
|
-
|
|
56
50
|
return arr;
|
|
57
51
|
}
|
|
58
52
|
});
|
|
@@ -71,45 +65,36 @@ class SuperSelect extends PureComponent {
|
|
|
71
65
|
const selectWidth = selectDom.clientWidth || selectDom.offsetWidth;
|
|
72
66
|
let arr = [];
|
|
73
67
|
let formulaMaxWidth = 10;
|
|
74
|
-
|
|
75
68
|
if (!dropdownMatchSelectWidth) {
|
|
76
69
|
formulaMaxWidth = maxWidth || 10;
|
|
77
70
|
}
|
|
78
|
-
|
|
79
71
|
if (!dropdownMatchSelectWidth && !maxWidth) {
|
|
80
72
|
const children = this.turnChildren(arr2);
|
|
81
|
-
|
|
82
73
|
for (let i = 0; i < children.length; i++) {
|
|
83
74
|
const val = children[i].props.children;
|
|
84
75
|
const textWidth = this.getTextPixelWith(val);
|
|
85
76
|
arr.push(textWidth.toFixed(2));
|
|
86
77
|
}
|
|
87
|
-
|
|
88
78
|
if (arr.length > 0) {
|
|
89
79
|
formulaMaxWidth = Math.max(...arr);
|
|
90
80
|
}
|
|
91
81
|
}
|
|
92
|
-
|
|
93
82
|
this.setState({
|
|
94
83
|
selectWidth,
|
|
95
84
|
maxWidth: formulaMaxWidth
|
|
96
85
|
});
|
|
97
86
|
}
|
|
98
|
-
});
|
|
99
|
-
|
|
87
|
+
});
|
|
88
|
+
// 获取单行文本的像素宽度
|
|
100
89
|
Object.defineProperty(this, "getTextPixelWith", {
|
|
101
90
|
enumerable: true,
|
|
102
91
|
configurable: true,
|
|
103
92
|
writable: true,
|
|
104
93
|
value: (text, fontStyle = '14px') => {
|
|
105
94
|
let canvas = document.createElement('canvas'); // 创建 canvas 画布
|
|
106
|
-
|
|
107
95
|
let context = canvas.getContext('2d'); // 获取 canvas 绘图上下文环境
|
|
108
|
-
|
|
109
96
|
context.font = fontStyle; // 设置字体样式,使用前设置好对应的 font 样式才能准确获取文字的像素长度
|
|
110
|
-
|
|
111
97
|
let dimension = context.measureText(text); // 测量文字
|
|
112
|
-
|
|
113
98
|
return dimension.width;
|
|
114
99
|
}
|
|
115
100
|
});
|
|
@@ -129,16 +114,16 @@ class SuperSelect extends PureComponent {
|
|
|
129
114
|
configurable: true,
|
|
130
115
|
writable: true,
|
|
131
116
|
value: () => {
|
|
132
|
-
this.scrollEle = document.querySelector(`.${this.dropdownClassName}`);
|
|
133
|
-
|
|
117
|
+
this.scrollEle = document.querySelector(`.${this.dropdownClassName}`);
|
|
118
|
+
// 下拉菜单未展开时元素不存在
|
|
134
119
|
if (!this.scrollEle) return;
|
|
135
120
|
this.scrollEle.addEventListener('scroll', this.onScroll, false);
|
|
136
121
|
this.inputEle = document.querySelector(`#${this.id}`);
|
|
137
122
|
if (!this.inputEle) return;
|
|
138
123
|
this.inputEle.addEventListener('keydown', this.onKeyDown, false);
|
|
139
124
|
}
|
|
140
|
-
});
|
|
141
|
-
|
|
125
|
+
});
|
|
126
|
+
// 模拟 antd select 按下 上下箭头 键时滚动列表
|
|
142
127
|
Object.defineProperty(this, "onKeyDown", {
|
|
143
128
|
enumerable: true,
|
|
144
129
|
configurable: true,
|
|
@@ -154,29 +139,26 @@ class SuperSelect extends PureComponent {
|
|
|
154
139
|
offsetTop
|
|
155
140
|
} = activeItem;
|
|
156
141
|
const isUp = ARROW_CODE[keyCode] === 'up';
|
|
157
|
-
const isDown = ARROW_CODE[keyCode] === 'down';
|
|
158
|
-
|
|
142
|
+
const isDown = ARROW_CODE[keyCode] === 'down';
|
|
143
|
+
// 在所有列表第一行按上键
|
|
159
144
|
if (offsetTop - this.prevTop > DROPDOWN_HEIGHT && isUp) {
|
|
160
145
|
this.scrollEle.scrollTo(0, this.allHeight - DROPDOWN_HEIGHT);
|
|
161
146
|
this.prevTop = this.allHeight;
|
|
162
147
|
return;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
|
|
148
|
+
}
|
|
149
|
+
// 在所有列表中最后一行按下键
|
|
166
150
|
if (this.prevTop > offsetTop + DROPDOWN_HEIGHT && isDown) {
|
|
167
151
|
this.scrollEle.scrollTo(0, 0);
|
|
168
152
|
this.prevTop = 0;
|
|
169
153
|
return;
|
|
170
154
|
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
155
|
+
this.prevTop = offsetTop;
|
|
156
|
+
// 向下滚动到下拉框最后一行时,向下滚动一行的高度
|
|
174
157
|
if (offsetTop > this.scrollEle.scrollTop + DROPDOWN_HEIGHT - this.ITEM_HEIGHT + 10 && isDown) {
|
|
175
158
|
this.scrollEle.scrollTo(0, this.scrollTop + this.ITEM_HEIGHT);
|
|
176
159
|
return;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
|
|
160
|
+
}
|
|
161
|
+
// 向上滚动到下拉框第一一行时,向上滚动一行的高度
|
|
180
162
|
if (offsetTop < this.scrollEle.scrollTop && isUp) {
|
|
181
163
|
this.scrollEle.scrollTo(0, this.scrollTop - this.ITEM_HEIGHT);
|
|
182
164
|
}
|
|
@@ -199,8 +181,8 @@ class SuperSelect extends PureComponent {
|
|
|
199
181
|
startIndex,
|
|
200
182
|
endIndex
|
|
201
183
|
} = this.getStartAndEndIndex();
|
|
202
|
-
this.prevScrollTop = this.scrollTop;
|
|
203
|
-
|
|
184
|
+
this.prevScrollTop = this.scrollTop;
|
|
185
|
+
// 重新渲染列表组件 Wrap
|
|
204
186
|
const allHeight = this.allList.length * this.ITEM_HEIGHT || 100;
|
|
205
187
|
this.wrap.reactList(allHeight, startIndex, endIndex);
|
|
206
188
|
}
|
|
@@ -210,14 +192,14 @@ class SuperSelect extends PureComponent {
|
|
|
210
192
|
configurable: true,
|
|
211
193
|
writable: true,
|
|
212
194
|
value: () => {
|
|
213
|
-
this.scrollTop = this.scrollEle.scrollTop;
|
|
214
|
-
|
|
195
|
+
this.scrollTop = this.scrollEle.scrollTop;
|
|
196
|
+
// 滚动的高度
|
|
215
197
|
let delta = this.prevScrollTop - this.scrollTop;
|
|
216
198
|
delta = delta < 0 ? 0 - delta : delta;
|
|
217
199
|
delta > this.reactDelta && this.onScrollReal();
|
|
218
200
|
}
|
|
219
|
-
});
|
|
220
|
-
|
|
201
|
+
});
|
|
202
|
+
// 列表可展示所有 children
|
|
221
203
|
Object.defineProperty(this, "getUseChildrenList", {
|
|
222
204
|
enumerable: true,
|
|
223
205
|
configurable: true,
|
|
@@ -238,8 +220,8 @@ class SuperSelect extends PureComponent {
|
|
|
238
220
|
endIndex
|
|
239
221
|
};
|
|
240
222
|
}
|
|
241
|
-
});
|
|
242
|
-
|
|
223
|
+
});
|
|
224
|
+
// 须使用 setTimeout 确保在 dom 加载完成之后添加事件
|
|
243
225
|
Object.defineProperty(this, "setSuperDrowDownMenu", {
|
|
244
226
|
enumerable: true,
|
|
245
227
|
configurable: true,
|
|
@@ -247,12 +229,11 @@ class SuperSelect extends PureComponent {
|
|
|
247
229
|
value: visible => {
|
|
248
230
|
if (!visible) return;
|
|
249
231
|
this.allList = this.getUseChildrenList();
|
|
250
|
-
|
|
251
232
|
if (!this.eventTimer || !this.scrollEle) {
|
|
252
233
|
this.eventTimer = setTimeout(() => this.addEvent(), 0);
|
|
253
234
|
} else {
|
|
254
|
-
const allHeight = this.allList.length * this.ITEM_HEIGHT || 100;
|
|
255
|
-
|
|
235
|
+
const allHeight = this.allList.length * this.ITEM_HEIGHT || 100;
|
|
236
|
+
// 下拉列表单独重新渲染
|
|
256
237
|
const {
|
|
257
238
|
startIndex,
|
|
258
239
|
endIndex
|
|
@@ -275,8 +256,8 @@ class SuperSelect extends PureComponent {
|
|
|
275
256
|
const {
|
|
276
257
|
value,
|
|
277
258
|
children
|
|
278
|
-
} = this.state;
|
|
279
|
-
|
|
259
|
+
} = this.state;
|
|
260
|
+
// 关闭下拉框前清空筛选条件,防止下次打开任然显示筛选后的 options
|
|
280
261
|
if (!visible) {
|
|
281
262
|
// 定时器确保关闭后再设置 filterChildren,防止列表刷新闪烁
|
|
282
263
|
setTimeout(() => {
|
|
@@ -284,13 +265,14 @@ class SuperSelect extends PureComponent {
|
|
|
284
265
|
filterChildren: null
|
|
285
266
|
});
|
|
286
267
|
this.setDefaultScrollTop(value);
|
|
287
|
-
}, 100);
|
|
268
|
+
}, 100);
|
|
269
|
+
// this.removeEvent();
|
|
288
270
|
} else {
|
|
289
271
|
// this.addEvent();
|
|
290
272
|
if (value) {
|
|
291
273
|
// 如果已有 value, 设置默认滚动位置
|
|
292
|
-
this.setDefaultScrollTop();
|
|
293
|
-
|
|
274
|
+
this.setDefaultScrollTop();
|
|
275
|
+
// 设置下拉列表显示数据
|
|
294
276
|
this.setSuperDrowDownMenu(visible);
|
|
295
277
|
} else if (!value && value !== 0 && children && children.length > 0) {
|
|
296
278
|
// 无数据时,下拉回归至第一个
|
|
@@ -310,8 +292,8 @@ class SuperSelect extends PureComponent {
|
|
|
310
292
|
} = this.props;
|
|
311
293
|
onDeselect && onDeselect(value);
|
|
312
294
|
}
|
|
313
|
-
});
|
|
314
|
-
|
|
295
|
+
});
|
|
296
|
+
// 在搜索重新计算下拉滚动条高度
|
|
315
297
|
Object.defineProperty(this, "onChange", {
|
|
316
298
|
enumerable: true,
|
|
317
299
|
configurable: true,
|
|
@@ -324,7 +306,6 @@ class SuperSelect extends PureComponent {
|
|
|
324
306
|
maxCount,
|
|
325
307
|
mode
|
|
326
308
|
} = this.props;
|
|
327
|
-
|
|
328
309
|
if (showSearch || this.isMultiple) {
|
|
329
310
|
// 搜索模式下选择后是否需要重置搜索状态
|
|
330
311
|
if (autoClearSearchValue !== false) {
|
|
@@ -336,7 +317,6 @@ class SuperSelect extends PureComponent {
|
|
|
336
317
|
});
|
|
337
318
|
}
|
|
338
319
|
}
|
|
339
|
-
|
|
340
320
|
if (mode === 'multiple') {
|
|
341
321
|
if (value.length <= maxCount) {
|
|
342
322
|
this.setState({
|
|
@@ -348,9 +328,7 @@ class SuperSelect extends PureComponent {
|
|
|
348
328
|
value
|
|
349
329
|
});
|
|
350
330
|
}
|
|
351
|
-
|
|
352
331
|
onChange && onChange(value, opt);
|
|
353
|
-
|
|
354
332
|
if (mode !== 'multiple') {
|
|
355
333
|
this.select && this.select.blur();
|
|
356
334
|
}
|
|
@@ -368,26 +346,23 @@ class SuperSelect extends PureComponent {
|
|
|
368
346
|
children: arr
|
|
369
347
|
} = this.props;
|
|
370
348
|
let children = this.turnChildren(arr);
|
|
371
|
-
|
|
372
349
|
if (showSearch && filterOption !== false) {
|
|
373
350
|
// 须根据 filterOption(如有该自定义函数)手动 filter 搜索匹配的列表
|
|
374
351
|
let filterChildren = null;
|
|
375
|
-
|
|
376
352
|
if (typeof filterOption === 'function') {
|
|
377
353
|
filterChildren = children.filter(item => filterOption(v, item));
|
|
378
354
|
} else if (filterOption === undefined) {
|
|
379
355
|
filterChildren = children.filter(item => this.filterOption(v, item));
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
|
|
356
|
+
}
|
|
357
|
+
// 搜索框有值,去除disabled=true的children
|
|
383
358
|
let newFilterChild = [];
|
|
384
359
|
filterChildren && filterChildren.forEach((item, index) => {
|
|
385
360
|
if (!item.props.disabled) {
|
|
386
361
|
newFilterChild.push(item);
|
|
387
362
|
}
|
|
388
363
|
});
|
|
389
|
-
filterChildren = newFilterChild;
|
|
390
|
-
|
|
364
|
+
filterChildren = newFilterChild;
|
|
365
|
+
// 设置下拉列表显示数据
|
|
391
366
|
this.setState({
|
|
392
367
|
filterChildren: v === '' ? null : filterChildren
|
|
393
368
|
}, () => {
|
|
@@ -396,14 +371,12 @@ class SuperSelect extends PureComponent {
|
|
|
396
371
|
if (filterChildren) {
|
|
397
372
|
this.scrollTop = 0;
|
|
398
373
|
this.scrollEle.scrollTo(0, 0);
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
|
|
374
|
+
}
|
|
375
|
+
// 搜索成功后需要重新设置列表的总高度
|
|
402
376
|
this.setSuperDrowDownMenu(true);
|
|
403
377
|
}, 0);
|
|
404
378
|
});
|
|
405
379
|
}
|
|
406
|
-
|
|
407
380
|
onSearch && onSearch(v);
|
|
408
381
|
}
|
|
409
382
|
});
|
|
@@ -430,18 +403,15 @@ class SuperSelect extends PureComponent {
|
|
|
430
403
|
} = this.props;
|
|
431
404
|
const children = this.turnChildren(arr);
|
|
432
405
|
let val = data || data === 0 ? data : value;
|
|
433
|
-
|
|
434
406
|
for (let i = 0; i < children.length; i++) {
|
|
435
407
|
const item = children[i];
|
|
436
408
|
const itemValue = item.props.value;
|
|
437
|
-
|
|
438
409
|
if (itemValue === val || Array.isArray(val) && val.includes(itemValue)) {
|
|
439
410
|
const targetScrollTop = i * this.ITEM_HEIGHT;
|
|
440
411
|
setTimeout(() => {
|
|
441
412
|
if (!this.scrollEle) {
|
|
442
413
|
this.addEvent();
|
|
443
414
|
}
|
|
444
|
-
|
|
445
415
|
this.scrollEle && this.scrollEle.scrollTo(0, targetScrollTop);
|
|
446
416
|
}, 100);
|
|
447
417
|
return;
|
|
@@ -468,8 +438,8 @@ class SuperSelect extends PureComponent {
|
|
|
468
438
|
children: arr
|
|
469
439
|
} = props;
|
|
470
440
|
this.isMultiple = ['tags', 'multiple'].includes(mode);
|
|
471
|
-
const children = this.turnChildren(arr);
|
|
472
|
-
|
|
441
|
+
const children = this.turnChildren(arr);
|
|
442
|
+
// 设置默认 value
|
|
473
443
|
let defaultV = this.isMultiple ? [] : '';
|
|
474
444
|
defaultV = value || defaultValue || defaultV;
|
|
475
445
|
this.state = {
|
|
@@ -478,25 +448,24 @@ class SuperSelect extends PureComponent {
|
|
|
478
448
|
value: defaultV,
|
|
479
449
|
maxWidth: null,
|
|
480
450
|
selectWidth: null
|
|
481
|
-
};
|
|
482
|
-
|
|
483
|
-
this.ITEM_HEIGHT = optionHeight || ITEM_HEIGHT_CFG[props.size || 'default'];
|
|
484
|
-
|
|
485
|
-
this.visibleDomHeight = this.ITEM_HEIGHT * ITEM_ELEMENT_NUMBER;
|
|
486
|
-
|
|
487
|
-
this.reactDelta = this.visibleDomHeight / 3;
|
|
488
|
-
|
|
489
|
-
this.isStopReact = false;
|
|
490
|
-
|
|
491
|
-
this.prevScrollTop = 0;
|
|
492
|
-
|
|
451
|
+
};
|
|
452
|
+
// 下拉菜单项行高
|
|
453
|
+
this.ITEM_HEIGHT = optionHeight || ITEM_HEIGHT_CFG[props.size || 'default'];
|
|
454
|
+
// 可视区 dom 高度
|
|
455
|
+
this.visibleDomHeight = this.ITEM_HEIGHT * ITEM_ELEMENT_NUMBER;
|
|
456
|
+
// 滚动时重新渲染的 scrollTop 判断值,大于 reactDelta 则刷新下拉列表
|
|
457
|
+
this.reactDelta = this.visibleDomHeight / 3;
|
|
458
|
+
// 是否拖动滚动条快速滚动状态
|
|
459
|
+
this.isStopReact = false;
|
|
460
|
+
// 上一次滚动的 scrollTop 值
|
|
461
|
+
this.prevScrollTop = 0;
|
|
462
|
+
// 上一次按下方向键时 scrollTop 值
|
|
493
463
|
this.prevTop = 0;
|
|
494
|
-
this.scrollTop = 0;
|
|
495
|
-
|
|
464
|
+
this.scrollTop = 0;
|
|
465
|
+
// className
|
|
496
466
|
this.dropdownClassName = `dc${+new Date()}`;
|
|
497
467
|
this.id = `sid${+new Date()}`;
|
|
498
468
|
}
|
|
499
|
-
|
|
500
469
|
componentDidMount() {
|
|
501
470
|
// defaultOpens=true 时添加滚动事件
|
|
502
471
|
setTimeout(() => {
|
|
@@ -505,9 +474,10 @@ class SuperSelect extends PureComponent {
|
|
|
505
474
|
const {
|
|
506
475
|
children: arr
|
|
507
476
|
} = this.props;
|
|
508
|
-
const children = this.turnChildren(arr);
|
|
509
|
-
|
|
510
|
-
this.formulaWidth();
|
|
477
|
+
const children = this.turnChildren(arr);
|
|
478
|
+
// if (children && children.length > 0) {
|
|
479
|
+
this.formulaWidth();
|
|
480
|
+
// }
|
|
511
481
|
}
|
|
512
482
|
|
|
513
483
|
componentDidUpdate(prevProps) {
|
|
@@ -518,19 +488,16 @@ class SuperSelect extends PureComponent {
|
|
|
518
488
|
children
|
|
519
489
|
} = this.props;
|
|
520
490
|
let arr = this.turnChildren(children);
|
|
521
|
-
|
|
522
491
|
if (prevProps.children !== children) {
|
|
523
492
|
this.isMultiple = ['tags', 'multiple'].includes(mode);
|
|
524
493
|
this.setState({
|
|
525
494
|
children: arr || [],
|
|
526
495
|
filterChildren: null
|
|
527
496
|
});
|
|
528
|
-
|
|
529
497
|
if (arr && arr.length > 0) {
|
|
530
498
|
this.formulaWidth();
|
|
531
499
|
}
|
|
532
500
|
}
|
|
533
|
-
|
|
534
501
|
if (prevProps.value !== value) {
|
|
535
502
|
// 更新时设置默认 value
|
|
536
503
|
let defaultV = this.isMultiple ? [] : '';
|
|
@@ -540,25 +507,21 @@ class SuperSelect extends PureComponent {
|
|
|
540
507
|
});
|
|
541
508
|
}
|
|
542
509
|
}
|
|
543
|
-
|
|
544
510
|
componentWillUnmount() {
|
|
545
511
|
this.removeEvent();
|
|
546
512
|
}
|
|
547
|
-
|
|
548
513
|
render() {
|
|
549
514
|
const {
|
|
550
515
|
maxWidth,
|
|
551
516
|
selectWidth
|
|
552
517
|
} = this.state;
|
|
553
|
-
|
|
554
518
|
let _a = this.props,
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
519
|
+
{
|
|
520
|
+
dropdownStyle,
|
|
521
|
+
optionLabelProp,
|
|
522
|
+
dropdownClassName
|
|
523
|
+
} = _a,
|
|
524
|
+
props = __rest(_a, ["dropdownStyle", "optionLabelProp", "dropdownClassName"]);
|
|
562
525
|
this.allList = this.getUseChildrenList();
|
|
563
526
|
this.allHeight = this.allList.length * this.ITEM_HEIGHT || 100;
|
|
564
527
|
const {
|
|
@@ -566,11 +529,9 @@ class SuperSelect extends PureComponent {
|
|
|
566
529
|
endIndex
|
|
567
530
|
} = this.getStartAndEndIndex();
|
|
568
531
|
let dynamicWidth = maxWidth;
|
|
569
|
-
|
|
570
532
|
if (this.allList.length === 0 || maxWidth < selectWidth) {
|
|
571
533
|
dynamicWidth = selectWidth;
|
|
572
534
|
}
|
|
573
|
-
|
|
574
535
|
dropdownStyle = Object.assign(Object.assign({
|
|
575
536
|
maxHeight: `${DROPDOWN_HEIGHT}px`
|
|
576
537
|
}, dropdownStyle), {
|
|
@@ -580,19 +541,17 @@ class SuperSelect extends PureComponent {
|
|
|
580
541
|
});
|
|
581
542
|
const {
|
|
582
543
|
value
|
|
583
|
-
} = this.state;
|
|
584
|
-
|
|
585
|
-
const _props = Object.assign({}, props);
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
544
|
+
} = this.state;
|
|
545
|
+
// 判断处于 antd Form 中时不自动设置 value
|
|
546
|
+
const _props = Object.assign({}, props);
|
|
547
|
+
// 先删除 value,再手动赋值,防止空 value 影响 placeholder
|
|
548
|
+
delete _props.value;
|
|
549
|
+
// value 为空字符会隐藏 placeholder,改为 undefined
|
|
590
550
|
if (typeof value === 'string' && !value) {
|
|
591
551
|
_props.value = undefined;
|
|
592
552
|
} else {
|
|
593
553
|
_props.value = value;
|
|
594
554
|
}
|
|
595
|
-
|
|
596
555
|
optionLabelProp = optionLabelProp || 'children';
|
|
597
556
|
return React.createElement(Select, Object.assign({}, _props, {
|
|
598
557
|
id: this.id,
|
|
@@ -614,7 +573,6 @@ class SuperSelect extends PureComponent {
|
|
|
614
573
|
image: Empty.PRESENTED_IMAGE_SIMPLE
|
|
615
574
|
}));
|
|
616
575
|
}
|
|
617
|
-
|
|
618
576
|
return React.createElement(DropDownWrap, Object.assign({}, {
|
|
619
577
|
startIndex,
|
|
620
578
|
endIndex,
|
|
@@ -629,8 +587,6 @@ class SuperSelect extends PureComponent {
|
|
|
629
587
|
}
|
|
630
588
|
}), this.allList);
|
|
631
589
|
}
|
|
632
|
-
|
|
633
590
|
}
|
|
634
|
-
|
|
635
591
|
SuperSelect.Option = Option;
|
|
636
592
|
export default SuperSelect;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tntd-select/style/index.ts"],"names":[],"mappings":"","sourcesContent":[""]}
|
package/es/utils/checkAuth.js
CHANGED
|
@@ -4,7 +4,6 @@ export const findMenuInfoByPath = (menuTree, path, matchFunc) => {
|
|
|
4
4
|
let subMenu;
|
|
5
5
|
let matchedSubMenu;
|
|
6
6
|
let parentMenus;
|
|
7
|
-
|
|
8
7
|
if (path) {
|
|
9
8
|
traverseTree(menuTree, (menu, pnode, pnodes) => {
|
|
10
9
|
if (!isGroupMenu(menu)) {
|
|
@@ -14,7 +13,6 @@ export const findMenuInfoByPath = (menuTree, path, matchFunc) => {
|
|
|
14
13
|
parentMenus = pnodes;
|
|
15
14
|
return false;
|
|
16
15
|
}
|
|
17
|
-
|
|
18
16
|
if (!matchedSubMenu && matchFunc && matchFunc(menu)) {
|
|
19
17
|
matchedSubMenu = menu;
|
|
20
18
|
menu = pnode;
|
|
@@ -29,7 +27,6 @@ export const findMenuInfoByPath = (menuTree, path, matchFunc) => {
|
|
|
29
27
|
parentMenus
|
|
30
28
|
};
|
|
31
29
|
}
|
|
32
|
-
|
|
33
30
|
return {
|
|
34
31
|
subMenu,
|
|
35
32
|
menu,
|
package/es/utils/index.js
CHANGED
|
@@ -5,7 +5,6 @@ export const getSelectedMenuInfo = (selectedKey, menus = []) => {
|
|
|
5
5
|
let subMenu;
|
|
6
6
|
let menu;
|
|
7
7
|
let parentMenus = [];
|
|
8
|
-
|
|
9
8
|
if (selectedKey) {
|
|
10
9
|
traverseTree(menus, (node, pnode, pnodes) => {
|
|
11
10
|
if (!isGroupMenu(node) && node.code === selectedKey) {
|
|
@@ -26,7 +25,6 @@ export const getSelectedMenuInfo = (selectedKey, menus = []) => {
|
|
|
26
25
|
}
|
|
27
26
|
});
|
|
28
27
|
}
|
|
29
|
-
|
|
30
28
|
return {
|
|
31
29
|
subMenu,
|
|
32
30
|
menu,
|
|
@@ -36,10 +34,8 @@ export const getSelectedMenuInfo = (selectedKey, menus = []) => {
|
|
|
36
34
|
export const hasLevel3 = menus => {
|
|
37
35
|
return menus === null || menus === void 0 ? void 0 : menus.some(menu => {
|
|
38
36
|
var _a;
|
|
39
|
-
|
|
40
37
|
return (_a = menu === null || menu === void 0 ? void 0 : menu.children) === null || _a === void 0 ? void 0 : _a.some(item => {
|
|
41
38
|
var _a;
|
|
42
|
-
|
|
43
39
|
return (_a = item === null || item === void 0 ? void 0 : item.children) === null || _a === void 0 ? void 0 : _a.length;
|
|
44
40
|
});
|
|
45
41
|
});
|
|
@@ -58,29 +54,24 @@ export const traverseTree = (treeData, callback, pnode, pnodes = []) => {
|
|
|
58
54
|
;
|
|
59
55
|
(treeData || []).every((node, index) => {
|
|
60
56
|
let result;
|
|
61
|
-
|
|
62
57
|
if (callback) {
|
|
63
58
|
result = callback(node, pnode, (pnodes === null || pnodes === void 0 ? void 0 : pnodes.length) ? pnodes : [pnode].filter(item => !!item), index);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
59
|
+
}
|
|
60
|
+
// 回调函数返回false则终止遍历
|
|
67
61
|
if (result !== false) {
|
|
68
62
|
node && traverseTree(node.children || [], callback, node, [node, ...pnodes]);
|
|
69
63
|
}
|
|
70
|
-
|
|
71
64
|
return result !== false;
|
|
72
65
|
});
|
|
73
66
|
return treeData;
|
|
74
67
|
};
|
|
75
68
|
export const safeParseJSON = (str, defaultObj) => {
|
|
76
69
|
let result;
|
|
77
|
-
|
|
78
70
|
try {
|
|
79
71
|
result = JSON.parse(str);
|
|
80
72
|
} catch (err) {
|
|
81
73
|
console.warn('json parse error:', err);
|
|
82
74
|
result = typeof defaultObj === 'undefined' ? str : defaultObj;
|
|
83
75
|
}
|
|
84
|
-
|
|
85
76
|
return result || defaultObj;
|
|
86
77
|
};
|
package/lib/affix/index.js
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) {
|
|
4
|
-
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
var _exportNames = {};
|
|
9
8
|
exports["default"] = void 0;
|
|
10
|
-
|
|
11
9
|
var _affix = _interopRequireWildcard(require("antd/lib/affix"));
|
|
12
|
-
|
|
13
10
|
Object.keys(_affix).forEach(function (key) {
|
|
14
11
|
if (key === "default" || key === "__esModule") return;
|
|
15
12
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
13
|
+
if (key in exports && exports[key] === _affix[key]) return;
|
|
16
14
|
Object.defineProperty(exports, key, {
|
|
17
15
|
enumerable: true,
|
|
18
16
|
get: function get() {
|
|
@@ -20,12 +18,8 @@ Object.keys(_affix).forEach(function (key) {
|
|
|
20
18
|
}
|
|
21
19
|
});
|
|
22
20
|
});
|
|
23
|
-
|
|
24
21
|
require("antd/lib/affix/style");
|
|
25
|
-
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
29
|
-
|
|
22
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
30
24
|
var _default = _affix["default"];
|
|
31
25
|
exports["default"] = _default;
|