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
|
@@ -1,122 +1,101 @@
|
|
|
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
|
-
exports["default"] = Column;
|
|
9
7
|
exports.FIX_LABEL = void 0;
|
|
10
|
-
|
|
8
|
+
exports["default"] = Column;
|
|
11
9
|
var React = _interopRequireWildcard(require("react"));
|
|
12
|
-
|
|
13
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
14
|
-
|
|
15
11
|
var _commonUtil = require("../utils/commonUtil");
|
|
16
|
-
|
|
17
12
|
var _context = _interopRequireDefault(require("../context"));
|
|
18
|
-
|
|
19
13
|
var _Checkbox = _interopRequireDefault(require("./Checkbox"));
|
|
20
|
-
|
|
21
14
|
var _useSearchOptions = require("../hooks/useSearchOptions");
|
|
22
|
-
|
|
23
15
|
var _rcVirtualList = _interopRequireDefault(require("rc-virtual-list"));
|
|
24
|
-
|
|
25
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
26
|
-
|
|
27
|
-
function
|
|
28
|
-
|
|
29
|
-
function
|
|
30
|
-
|
|
31
|
-
function
|
|
32
|
-
|
|
33
|
-
function
|
|
34
|
-
|
|
35
|
-
function
|
|
36
|
-
|
|
37
|
-
function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
|
|
38
|
-
|
|
39
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
|
|
40
|
-
|
|
17
|
+
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); }
|
|
18
|
+
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; }
|
|
19
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
20
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
21
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
22
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
23
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
24
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
25
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
26
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
27
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
41
28
|
var FIX_LABEL = '__cascader_fix_label__';
|
|
42
29
|
exports.FIX_LABEL = FIX_LABEL;
|
|
43
|
-
|
|
44
30
|
function Column(_ref) {
|
|
45
31
|
var prefixCls = _ref.prefixCls,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
32
|
+
multiple = _ref.multiple,
|
|
33
|
+
options = _ref.options,
|
|
34
|
+
activeValue = _ref.activeValue,
|
|
35
|
+
prevValuePath = _ref.prevValuePath,
|
|
36
|
+
onToggleOpen = _ref.onToggleOpen,
|
|
37
|
+
onSelect = _ref.onSelect,
|
|
38
|
+
onActive = _ref.onActive,
|
|
39
|
+
checkedSet = _ref.checkedSet,
|
|
40
|
+
halfCheckedSet = _ref.halfCheckedSet,
|
|
41
|
+
loadingKeys = _ref.loadingKeys,
|
|
42
|
+
isSelectable = _ref.isSelectable,
|
|
43
|
+
renderItem = _ref.renderItem,
|
|
44
|
+
searchValue = _ref.searchValue,
|
|
45
|
+
level = _ref.level,
|
|
46
|
+
dropdownVisible = _ref.dropdownVisible,
|
|
47
|
+
optionHeight = _ref.optionHeight;
|
|
62
48
|
var ref = React.useRef(null);
|
|
63
49
|
var menuPrefixCls = "".concat(prefixCls, "-menu ").concat(prefixCls, "-menu-").concat(level);
|
|
64
50
|
var menuItemPrefixCls = "".concat(prefixCls, "-menu-item");
|
|
65
|
-
|
|
66
51
|
var _React$useContext = React.useContext(_context["default"]),
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
52
|
+
fieldNames = _React$useContext.fieldNames,
|
|
53
|
+
changeOnSelect = _React$useContext.changeOnSelect,
|
|
54
|
+
expandTrigger = _React$useContext.expandTrigger,
|
|
55
|
+
expandIcon = _React$useContext.expandIcon,
|
|
56
|
+
loadingIcon = _React$useContext.loadingIcon,
|
|
57
|
+
dropdownMenuColumnStyle = _React$useContext.dropdownMenuColumnStyle;
|
|
74
58
|
var hoverOpen = expandTrigger === 'hover';
|
|
75
59
|
/** 单选情况下滚动到相应的位置 */
|
|
76
|
-
|
|
77
60
|
React.useEffect(function () {
|
|
78
61
|
var timer = null;
|
|
79
|
-
|
|
80
62
|
if (ref.current && ref.current.scrollTo && !multiple && dropdownVisible) {
|
|
81
63
|
var index = options.findIndex(function (it) {
|
|
82
64
|
return it[fieldNames.value] === activeValue;
|
|
83
65
|
});
|
|
84
|
-
|
|
85
66
|
if (index > 0 && !isNaN(index)) {
|
|
86
67
|
timer = window.setTimeout(function () {
|
|
87
68
|
ref.current.scrollTo((optionHeight || 36) * index);
|
|
88
69
|
}, 5);
|
|
89
70
|
}
|
|
90
71
|
}
|
|
91
|
-
|
|
92
72
|
return function () {
|
|
93
73
|
if (timer) {
|
|
94
74
|
window.clearTimeout(timer);
|
|
95
75
|
}
|
|
96
|
-
|
|
97
76
|
timer = null;
|
|
98
77
|
};
|
|
99
|
-
}, [multiple, activeValue, options, fieldNames, dropdownVisible, optionHeight]);
|
|
100
|
-
|
|
78
|
+
}, [multiple, activeValue, options, fieldNames, dropdownVisible, optionHeight]);
|
|
79
|
+
// ============================ Option ============================
|
|
101
80
|
var optionInfoList = React.useMemo(function () {
|
|
102
81
|
return options.map(function (option) {
|
|
103
82
|
var _a;
|
|
104
|
-
|
|
105
83
|
var disabled = option.disabled;
|
|
106
84
|
var searchOptions = option[_useSearchOptions.SEARCH_MARK];
|
|
107
85
|
var label = (_a = option[FIX_LABEL]) !== null && _a !== void 0 ? _a : option[fieldNames.label];
|
|
108
86
|
var value = option[fieldNames.value];
|
|
109
|
-
var isMergedLeaf = (0, _commonUtil.isLeaf)(option, fieldNames);
|
|
110
|
-
|
|
111
|
-
var fullPath = searchOptions ?
|
|
87
|
+
var isMergedLeaf = (0, _commonUtil.isLeaf)(option, fieldNames);
|
|
88
|
+
// Get real value of option. Search option is different way.
|
|
89
|
+
var fullPath = searchOptions ?
|
|
90
|
+
// @ts-ignore
|
|
112
91
|
searchOptions.map(function (opt) {
|
|
113
92
|
return opt[fieldNames.value];
|
|
114
93
|
}) : [].concat(_toConsumableArray(prevValuePath), [value]);
|
|
115
94
|
var fullPathKey = (0, _commonUtil.toPathKey)(fullPath);
|
|
116
|
-
var isLoading = loadingKeys.includes(fullPathKey);
|
|
117
|
-
|
|
118
|
-
var checked = checkedSet.has(fullPathKey);
|
|
119
|
-
|
|
95
|
+
var isLoading = loadingKeys.includes(fullPathKey);
|
|
96
|
+
// >>>>> checked
|
|
97
|
+
var checked = checkedSet.has(fullPathKey);
|
|
98
|
+
// >>>>> halfChecked
|
|
120
99
|
var halfChecked = halfCheckedSet.has(fullPathKey);
|
|
121
100
|
return {
|
|
122
101
|
disabled: disabled,
|
|
@@ -131,8 +110,8 @@ function Column(_ref) {
|
|
|
131
110
|
fullPathKey: fullPathKey
|
|
132
111
|
};
|
|
133
112
|
});
|
|
134
|
-
}, [options, checkedSet, fieldNames, halfCheckedSet, loadingKeys, prevValuePath]);
|
|
135
|
-
|
|
113
|
+
}, [options, checkedSet, fieldNames, halfCheckedSet, loadingKeys, prevValuePath]);
|
|
114
|
+
// ============================ Render ============================
|
|
136
115
|
return React.createElement("ul", {
|
|
137
116
|
className: menuPrefixCls,
|
|
138
117
|
role: "menu"
|
|
@@ -145,41 +124,35 @@ function Column(_ref) {
|
|
|
145
124
|
ref: ref
|
|
146
125
|
}, function (_ref2) {
|
|
147
126
|
var _classNames;
|
|
148
|
-
|
|
149
127
|
var disabled = _ref2.disabled,
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
128
|
+
label = _ref2.label,
|
|
129
|
+
value = _ref2.value,
|
|
130
|
+
isMergedLeaf = _ref2.isLeaf,
|
|
131
|
+
isLoading = _ref2.isLoading,
|
|
132
|
+
checked = _ref2.checked,
|
|
133
|
+
halfChecked = _ref2.halfChecked,
|
|
134
|
+
option = _ref2.option,
|
|
135
|
+
fullPath = _ref2.fullPath,
|
|
136
|
+
fullPathKey = _ref2.fullPathKey;
|
|
160
137
|
// >>>>> Open
|
|
161
138
|
var triggerOpenPath = function triggerOpenPath() {
|
|
162
139
|
if (!disabled && (!hoverOpen || !isMergedLeaf)) {
|
|
163
140
|
onActive(fullPath);
|
|
164
141
|
}
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
|
|
142
|
+
};
|
|
143
|
+
// >>>>> Selection
|
|
168
144
|
var triggerSelect = function triggerSelect() {
|
|
169
145
|
if (isSelectable(option)) {
|
|
170
146
|
onSelect(fullPath, isMergedLeaf);
|
|
171
147
|
}
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
|
|
148
|
+
};
|
|
149
|
+
// >>>>> Title
|
|
175
150
|
var title;
|
|
176
|
-
|
|
177
151
|
if (typeof option.title === 'string') {
|
|
178
152
|
title = option.title;
|
|
179
153
|
} else if (typeof label === 'string') {
|
|
180
154
|
title = label;
|
|
181
155
|
}
|
|
182
|
-
|
|
183
156
|
return React.createElement("li", {
|
|
184
157
|
key: fullPathKey,
|
|
185
158
|
className: (0, _classnames["default"])(menuItemPrefixCls, (_classNames = {}, _defineProperty(_classNames, "".concat(menuItemPrefixCls, "-expand"), !isMergedLeaf), _defineProperty(_classNames, "".concat(menuItemPrefixCls, "-active"), activeValue === value), _defineProperty(_classNames, "".concat(menuItemPrefixCls, "-disabled"), disabled), _defineProperty(_classNames, "".concat(menuItemPrefixCls, "-loading"), isLoading), _classNames)),
|
|
@@ -191,7 +164,6 @@ function Column(_ref) {
|
|
|
191
164
|
"data-path-key": fullPathKey,
|
|
192
165
|
onClick: function onClick() {
|
|
193
166
|
triggerOpenPath();
|
|
194
|
-
|
|
195
167
|
if (!multiple || isMergedLeaf) {
|
|
196
168
|
triggerSelect();
|
|
197
169
|
}
|
|
@@ -1,105 +1,78 @@
|
|
|
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
|
exports["default"] = void 0;
|
|
9
|
-
|
|
10
8
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
-
|
|
12
9
|
var _rcSelect = require("rc-select");
|
|
13
|
-
|
|
14
10
|
var React = _interopRequireWildcard(require("react"));
|
|
15
|
-
|
|
16
11
|
var _context = _interopRequireDefault(require("../context"));
|
|
17
|
-
|
|
18
12
|
var _commonUtil = require("../utils/commonUtil");
|
|
19
|
-
|
|
20
13
|
var _treeUtil = require("../utils/treeUtil");
|
|
21
|
-
|
|
22
14
|
var _Column = _interopRequireWildcard(require("./Column"));
|
|
23
|
-
|
|
24
15
|
var _useActive3 = _interopRequireDefault(require("./useActive"));
|
|
25
|
-
|
|
26
16
|
var _useKeyboard = _interopRequireDefault(require("./useKeyboard"));
|
|
27
|
-
|
|
28
|
-
function
|
|
29
|
-
|
|
30
|
-
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; }
|
|
31
|
-
|
|
17
|
+
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); }
|
|
18
|
+
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; }
|
|
32
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
33
|
-
|
|
34
|
-
function
|
|
35
|
-
|
|
36
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
|
|
37
|
-
|
|
38
|
-
function
|
|
39
|
-
|
|
40
|
-
function
|
|
41
|
-
|
|
42
|
-
function
|
|
43
|
-
|
|
44
|
-
function
|
|
45
|
-
|
|
46
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
|
47
|
-
|
|
48
|
-
function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
49
|
-
|
|
20
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
21
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
22
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
23
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
24
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
25
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
26
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
27
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
28
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
29
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
30
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
31
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
50
32
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
51
|
-
|
|
52
33
|
var RefOptionList = React.forwardRef(function (props, ref) {
|
|
53
34
|
var _ref3, _classNames;
|
|
54
|
-
|
|
55
35
|
var _a, _b;
|
|
56
|
-
|
|
57
36
|
var _useBaseProps = (0, _rcSelect.useBaseProps)(),
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
37
|
+
prefixCls = _useBaseProps.prefixCls,
|
|
38
|
+
multiple = _useBaseProps.multiple,
|
|
39
|
+
searchValue = _useBaseProps.searchValue,
|
|
40
|
+
toggleOpen = _useBaseProps.toggleOpen,
|
|
41
|
+
notFoundContent = _useBaseProps.notFoundContent,
|
|
42
|
+
direction = _useBaseProps.direction,
|
|
43
|
+
optionHeight = _useBaseProps.optionHeight;
|
|
66
44
|
var containerRef = React.useRef();
|
|
67
45
|
var rtl = direction === 'rtl';
|
|
68
|
-
|
|
69
46
|
var _React$useContext = React.useContext(_context["default"]),
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
47
|
+
options = _React$useContext.options,
|
|
48
|
+
values = _React$useContext.values,
|
|
49
|
+
halfValues = _React$useContext.halfValues,
|
|
50
|
+
fieldNames = _React$useContext.fieldNames,
|
|
51
|
+
changeOnSelect = _React$useContext.changeOnSelect,
|
|
52
|
+
onSelect = _React$useContext.onSelect,
|
|
53
|
+
searchOptions = _React$useContext.searchOptions,
|
|
54
|
+
dropdownPrefixCls = _React$useContext.dropdownPrefixCls,
|
|
55
|
+
loadData = _React$useContext.loadData,
|
|
56
|
+
expandTrigger = _React$useContext.expandTrigger,
|
|
57
|
+
renderItem = _React$useContext.renderItem,
|
|
58
|
+
dropdownVisible = _React$useContext.dropdownVisible;
|
|
59
|
+
var mergedPrefixCls = dropdownPrefixCls || prefixCls;
|
|
60
|
+
// ========================= loadData =========================
|
|
85
61
|
var _React$useState = React.useState([]),
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
62
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
63
|
+
loadingKeys = _React$useState2[0],
|
|
64
|
+
setLoadingKeys = _React$useState2[1];
|
|
90
65
|
var internalLoadData = function internalLoadData(valueCells) {
|
|
91
66
|
// Do not load when search
|
|
92
67
|
if (!loadData || searchValue) {
|
|
93
68
|
return;
|
|
94
69
|
}
|
|
95
|
-
|
|
96
70
|
var optionList = (0, _treeUtil.toPathOptions)(valueCells, options, fieldNames);
|
|
97
71
|
var rawOptions = optionList.map(function (_ref) {
|
|
98
72
|
var option = _ref.option;
|
|
99
73
|
return option;
|
|
100
74
|
});
|
|
101
75
|
var lastOption = rawOptions[rawOptions.length - 1];
|
|
102
|
-
|
|
103
76
|
if (lastOption && !(0, _commonUtil.isLeaf)(lastOption, fieldNames)) {
|
|
104
77
|
var pathKey = (0, _commonUtil.toPathKey)(valueCells);
|
|
105
78
|
setLoadingKeys(function (keys) {
|
|
@@ -107,9 +80,8 @@ var RefOptionList = React.forwardRef(function (props, ref) {
|
|
|
107
80
|
});
|
|
108
81
|
loadData(rawOptions);
|
|
109
82
|
}
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
|
|
83
|
+
};
|
|
84
|
+
// zombieJ: This is bad. We should make this same as `rc-tree` to use Promise instead.
|
|
113
85
|
React.useEffect(function () {
|
|
114
86
|
if (loadingKeys.length) {
|
|
115
87
|
loadingKeys.forEach(function (loadingKey) {
|
|
@@ -119,7 +91,6 @@ var RefOptionList = React.forwardRef(function (props, ref) {
|
|
|
119
91
|
return option;
|
|
120
92
|
});
|
|
121
93
|
var lastOption = optionList[optionList.length - 1];
|
|
122
|
-
|
|
123
94
|
if (!lastOption || lastOption[fieldNames.children] || (0, _commonUtil.isLeaf)(lastOption, fieldNames)) {
|
|
124
95
|
setLoadingKeys(function (keys) {
|
|
125
96
|
return keys.filter(function (key) {
|
|
@@ -129,107 +100,92 @@ var RefOptionList = React.forwardRef(function (props, ref) {
|
|
|
129
100
|
}
|
|
130
101
|
});
|
|
131
102
|
}
|
|
132
|
-
}, [options, loadingKeys, fieldNames]);
|
|
133
|
-
|
|
103
|
+
}, [options, loadingKeys, fieldNames]);
|
|
104
|
+
// ========================== Values ==========================
|
|
134
105
|
var checkedSet = React.useMemo(function () {
|
|
135
106
|
return new Set((0, _commonUtil.toPathKeys)(values));
|
|
136
107
|
}, [values]);
|
|
137
108
|
var halfCheckedSet = React.useMemo(function () {
|
|
138
109
|
return new Set((0, _commonUtil.toPathKeys)(halfValues));
|
|
139
|
-
}, [halfValues]);
|
|
140
|
-
|
|
110
|
+
}, [halfValues]);
|
|
111
|
+
// ====================== Accessibility =======================
|
|
141
112
|
var _useActive = (0, _useActive3["default"])(),
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
113
|
+
_useActive2 = _slicedToArray(_useActive, 2),
|
|
114
|
+
activeValueCells = _useActive2[0],
|
|
115
|
+
setActiveValueCells = _useActive2[1];
|
|
116
|
+
// =========================== Path ===========================
|
|
147
117
|
var onPathOpen = function onPathOpen(nextValueCells) {
|
|
148
|
-
setActiveValueCells(nextValueCells);
|
|
149
|
-
|
|
118
|
+
setActiveValueCells(nextValueCells);
|
|
119
|
+
// Trigger loadData
|
|
150
120
|
internalLoadData(nextValueCells);
|
|
151
121
|
};
|
|
152
|
-
|
|
153
122
|
var isSelectable = function isSelectable(option) {
|
|
154
123
|
var disabled = option.disabled;
|
|
155
124
|
var isMergedLeaf = (0, _commonUtil.isLeaf)(option, fieldNames);
|
|
156
125
|
return !disabled && (isMergedLeaf || changeOnSelect || multiple);
|
|
157
126
|
};
|
|
158
|
-
|
|
159
127
|
var onPathSelect = function onPathSelect(valuePath, leaf) {
|
|
160
128
|
var fromKeyboard = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
161
129
|
onSelect(valuePath);
|
|
162
|
-
|
|
163
130
|
if (!multiple && (leaf || changeOnSelect && (expandTrigger === 'hover' || fromKeyboard))) {
|
|
164
131
|
toggleOpen(false);
|
|
165
132
|
}
|
|
166
|
-
};
|
|
167
|
-
|
|
168
|
-
|
|
133
|
+
};
|
|
134
|
+
// ========================== Option ==========================
|
|
169
135
|
var mergedOptions = React.useMemo(function () {
|
|
170
136
|
if (searchValue) {
|
|
171
137
|
return searchOptions;
|
|
172
138
|
}
|
|
173
|
-
|
|
174
139
|
return options;
|
|
175
|
-
}, [searchValue, searchOptions, options]);
|
|
176
|
-
|
|
140
|
+
}, [searchValue, searchOptions, options]);
|
|
141
|
+
// ========================== Column ==========================
|
|
177
142
|
var optionColumns = React.useMemo(function () {
|
|
178
143
|
var optionList = [{
|
|
179
144
|
options: mergedOptions
|
|
180
145
|
}];
|
|
181
146
|
var currentList = mergedOptions;
|
|
182
|
-
|
|
183
147
|
var _loop = function _loop(i) {
|
|
184
148
|
var activeValueCell = activeValueCells[i];
|
|
185
149
|
var currentOption = currentList.find(function (option) {
|
|
186
150
|
return option[fieldNames.value] === activeValueCell;
|
|
187
151
|
});
|
|
188
152
|
var subOptions = currentOption === null || currentOption === void 0 ? void 0 : currentOption[fieldNames.children];
|
|
189
|
-
|
|
190
153
|
if (!(subOptions === null || subOptions === void 0 ? void 0 : subOptions.length)) {
|
|
191
154
|
return "break";
|
|
192
155
|
}
|
|
193
|
-
|
|
194
156
|
currentList = subOptions;
|
|
195
157
|
optionList.push({
|
|
196
158
|
options: subOptions
|
|
197
159
|
});
|
|
198
160
|
};
|
|
199
|
-
|
|
200
161
|
for (var i = 0; i < activeValueCells.length; i += 1) {
|
|
201
162
|
var _ret = _loop(i);
|
|
202
|
-
|
|
203
163
|
if (_ret === "break") break;
|
|
204
164
|
}
|
|
205
|
-
|
|
206
165
|
return optionList;
|
|
207
|
-
}, [mergedOptions, activeValueCells, fieldNames]);
|
|
208
|
-
|
|
166
|
+
}, [mergedOptions, activeValueCells, fieldNames]);
|
|
167
|
+
// ========================= Keyboard =========================
|
|
209
168
|
var onKeyboardSelect = function onKeyboardSelect(selectValueCells, option) {
|
|
210
169
|
if (isSelectable(option)) {
|
|
211
170
|
onPathSelect(selectValueCells, (0, _commonUtil.isLeaf)(option, fieldNames), true);
|
|
212
171
|
}
|
|
213
172
|
};
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
173
|
+
(0, _useKeyboard["default"])(ref, mergedOptions, fieldNames, activeValueCells, onPathOpen, onKeyboardSelect);
|
|
174
|
+
// >>>>> Active Scroll
|
|
217
175
|
React.useEffect(function () {
|
|
218
176
|
var _a;
|
|
219
|
-
|
|
220
177
|
for (var i = 0; i < activeValueCells.length; i += 1) {
|
|
221
178
|
var cellPath = activeValueCells.slice(0, i + 1);
|
|
222
179
|
var cellKeyPath = (0, _commonUtil.toPathKey)(cellPath);
|
|
223
180
|
var ele = (_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.querySelector("li[data-path-key=\"".concat(cellKeyPath.replace(/\\{0,2}"/g, '\\"'), "\"]") // matches unescaped double quotes
|
|
224
181
|
);
|
|
225
|
-
|
|
226
182
|
if (ele) {
|
|
227
183
|
(0, _commonUtil.scrollIntoParentView)(ele);
|
|
228
184
|
}
|
|
229
185
|
}
|
|
230
|
-
}, [activeValueCells]);
|
|
186
|
+
}, [activeValueCells]);
|
|
187
|
+
// ========================== Render ==========================
|
|
231
188
|
// >>>>> Empty
|
|
232
|
-
|
|
233
189
|
var isEmpty = !((_b = (_a = optionColumns[0]) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.length);
|
|
234
190
|
var emptyList = [(_ref3 = {}, _defineProperty(_ref3, fieldNames.value, '__EMPTY__'), _defineProperty(_ref3, _Column.FIX_LABEL, notFoundContent), _defineProperty(_ref3, "disabled", true), _ref3)];
|
|
235
191
|
var columnProps = Object.assign(Object.assign({}, props), {
|
|
@@ -241,8 +197,8 @@ var RefOptionList = React.forwardRef(function (props, ref) {
|
|
|
241
197
|
halfCheckedSet: halfCheckedSet,
|
|
242
198
|
loadingKeys: loadingKeys,
|
|
243
199
|
isSelectable: isSelectable
|
|
244
|
-
});
|
|
245
|
-
|
|
200
|
+
});
|
|
201
|
+
// >>>>> Columns
|
|
246
202
|
var mergedOptionColumns = isEmpty ? [{
|
|
247
203
|
options: emptyList
|
|
248
204
|
}] : optionColumns;
|
|
@@ -262,8 +218,8 @@ var RefOptionList = React.forwardRef(function (props, ref) {
|
|
|
262
218
|
activeValue: activeValue,
|
|
263
219
|
renderItem: renderItem
|
|
264
220
|
}));
|
|
265
|
-
});
|
|
266
|
-
|
|
221
|
+
});
|
|
222
|
+
// >>>>> Render
|
|
267
223
|
return React.createElement("div", {
|
|
268
224
|
className: (0, _classnames["default"])("".concat(mergedPrefixCls, "-menus"), (_classNames = {}, _defineProperty(_classNames, "".concat(mergedPrefixCls, "-menu-empty"), isEmpty), _defineProperty(_classNames, "".concat(mergedPrefixCls, "-rtl"), rtl), _classNames)),
|
|
269
225
|
ref: containerRef
|