tntd 2.0.13 → 2.0.14
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 +31 -6
- package/es/columns/index.js +12 -6
- package/es/development-login/LoginModal.js +10 -4
- package/es/drawer/drawer.js +8 -4
- package/es/ellipsis/index.js +25 -14
- package/es/empty/empty.js +13 -9
- package/es/handle/index.js +27 -14
- package/es/img/Contain.js +19 -13
- package/es/img/Cover.js +24 -13
- package/es/img/index.js +21 -14
- package/es/index.js +1 -0
- package/es/loading-button/index.js +13 -6
- package/es/locale/default.js +2 -0
- package/es/locale/en_US.js +2 -0
- package/es/locale/zh_CN.js +2 -0
- package/es/page/Box.js +28 -19
- package/es/page/index.js +38 -22
- package/es/page/utils.js +5 -0
- package/es/prev-locale.js +3 -0
- package/es/query-form/Field/Checkbox.js +8 -4
- package/es/query-form/Field/Select.js +17 -10
- package/es/query-form/Field/SelectInput.js +18 -4
- package/es/query-form/Field/fieldsMap.js +1 -0
- package/es/query-form/Field/index.js +11 -2
- package/es/query-form/createActions.js +8 -0
- package/es/query-form/index.js +34 -2
- package/es/query-list-scene/List.js +39 -18
- package/es/query-list-scene/QueryForm.js +19 -10
- package/es/query-list-scene/QueryListScene.js +2 -0
- package/es/query-list-scene/Toolbar.js +10 -6
- package/es/query-list-scene/createActions.js +3 -0
- package/es/render-empty/render-empty.js +2 -0
- package/es/steps/steps.js +17 -9
- package/es/steps/style/nav.less +3 -1
- package/es/svg-components/illustration-403.js +2 -0
- package/es/svg-components/illustration-404.js +2 -0
- package/es/svg-components/illustration-500.js +2 -0
- package/es/svg-components/illustration-empty.js +2 -0
- package/es/svg-components/illustration-failure.js +2 -0
- package/es/svg-components/illustration-no-access.js +2 -0
- package/es/svg-components/illustration-no-chart.js +2 -0
- package/es/svg-components/illustration-no-result.js +2 -0
- package/es/svg-components/illustration-offline.js +2 -0
- package/es/svg-components/illustration-success.js +2 -0
- package/es/table/assets/image-loading-background.js +2 -0
- package/es/table/assets/image-loading.js +2 -0
- package/es/table/hooks/use-column-setting.js +1 -0
- package/es/table/table.js +19 -14
- package/es/table/table.stories.js +2 -0
- package/es/table/utils.js +6 -2
- package/es/title/index.js +14 -10
- package/es/tntd-cascader/AntdCascader/component/context.js +4 -2
- package/es/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +2 -0
- package/es/tntd-cascader/AntdCascader/component/getIcons.js +15 -6
- package/es/tntd-cascader/AntdCascader/config/utils.js +2 -0
- package/es/tntd-cascader/AntdCascader/config/warning.js +8 -4
- package/es/tntd-cascader/AntdCascader/index.js +73 -51
- package/es/tntd-cascader/rc-cascader/Cascader.js +113 -86
- package/es/tntd-cascader/rc-cascader/OptionList/Column.js +26 -16
- package/es/tntd-cascader/rc-cascader/OptionList/index.js +43 -26
- package/es/tntd-cascader/rc-cascader/OptionList/useActive.js +7 -5
- package/es/tntd-cascader/rc-cascader/OptionList/useKeyboard.js +41 -12
- package/es/tntd-cascader/rc-cascader/hooks/useDisplayValues.js +10 -4
- package/es/tntd-cascader/rc-cascader/hooks/useEntities.js +4 -2
- package/es/tntd-cascader/rc-cascader/hooks/useMissingValues.js +1 -0
- package/es/tntd-cascader/rc-cascader/hooks/useRefFunc.js +1 -0
- package/es/tntd-cascader/rc-cascader/hooks/useSearchConfig.js +7 -2
- package/es/tntd-cascader/rc-cascader/hooks/useSearchOptions.js +15 -8
- package/es/tntd-cascader/rc-cascader/utils/commonUtil.js +6 -2
- package/es/tntd-cascader/rc-cascader/utils/treeUtil.js +4 -2
- package/es/tntd-cascader/rc-cascader/utils/warningPropsUtil.js +7 -2
- package/es/tntd-icon/fonts/iconfont.js +12 -7
- package/es/tntd-icon/index.js +9 -5
- package/es/tntd-layout/ActionsContext.js +2 -2
- package/es/tntd-layout/AppList.js +14 -2
- package/es/tntd-layout/Application.js +4 -0
- package/es/tntd-layout/Avatar.js +4 -0
- package/es/tntd-layout/CompatibleLanguage.js +13 -0
- package/es/tntd-layout/EnterpriseLayout/Avatar.js +4 -0
- package/es/tntd-layout/EnterpriseLayout/Language.js +6 -0
- package/es/tntd-layout/EnterpriseLayout/Theme.js +4 -0
- package/es/tntd-layout/EnterpriseLayout/index.js +2 -2
- package/es/tntd-layout/GlobalNavigation/NavigationPopup.js +33 -2
- package/es/tntd-layout/GlobalNavigation/index.js +6 -0
- package/es/tntd-layout/HeaderActions.js +32 -28
- package/es/tntd-layout/HeaderNavs.js +14 -6
- package/es/tntd-layout/HeaderTabs.js +35 -14
- package/es/tntd-layout/Language.js +6 -0
- package/es/tntd-layout/Layout.js +7 -2
- package/es/tntd-layout/Logo.js +11 -4
- package/es/tntd-layout/OrgAppList.js +39 -22
- package/es/tntd-layout/SideMenu.js +45 -8
- package/es/tntd-layout/Theme.js +6 -0
- package/es/tntd-layout/index.js +17 -9
- package/es/tntd-layout/paaslayout/CompactSideMenu.js +15 -0
- package/es/tntd-layout/paaslayout/SideMenu.js +15 -0
- package/es/tntd-layout/paaslayout/index.js +13 -4
- package/es/tntd-layout/storage.js +2 -2
- package/es/tntd-modal/index.js +18 -12
- package/es/tntd-second-page/index.js +3 -0
- package/es/tntd-select/DropDownWrap.js +8 -4
- package/es/tntd-select/index.js +118 -74
- package/es/utils/checkAuth.js +1 -0
- package/es/utils/findMenuInfoByPath.js +3 -0
- package/es/utils/index.js +11 -2
- package/lib/affix/index.js +10 -4
- package/lib/alert/index.js +10 -4
- package/lib/anchor/index.js +10 -4
- package/lib/array-input/icon.js +7 -1
- package/lib/array-input/index.js +91 -41
- package/lib/auth-context/index.js +3 -0
- package/lib/auto-complete/index.js +10 -4
- package/lib/avatar/index.js +10 -4
- package/lib/back-top/index.js +10 -4
- package/lib/badge/index.js +10 -4
- package/lib/breadcrumb/index.js +10 -4
- package/lib/button/index.js +10 -4
- package/lib/calendar/index.js +10 -4
- package/lib/card/index.js +10 -4
- package/lib/carousel/index.js +10 -4
- package/lib/cascader/index.js +10 -4
- package/lib/checkbox/index.js +10 -4
- package/lib/col/index.js +10 -4
- package/lib/collapse/index.js +11 -4
- package/lib/columns/index.js +28 -14
- package/lib/comment/index.js +10 -4
- package/lib/config-provider/config-provider.js +2 -0
- package/lib/config-provider/index.js +10 -4
- package/lib/date-picker/index.js +10 -4
- package/lib/descriptions/index.js +10 -4
- package/lib/development-login/LoginModal.js +50 -25
- package/lib/development-login/index.js +22 -11
- package/lib/divider/index.js +10 -4
- package/lib/drawer/drawer.js +16 -6
- package/lib/drawer/index.js +5 -1
- package/lib/dropdown/index.js +10 -4
- package/lib/ellipsis/Svg/CopySVG.js +4 -0
- package/lib/ellipsis/Svg/TickSVG.js +4 -0
- package/lib/ellipsis/index.js +73 -42
- package/lib/empty/empty.js +30 -14
- package/lib/empty/empty.stories.js +21 -3
- package/lib/empty/index.js +5 -1
- package/lib/exception/exception.js +14 -7
- package/lib/exception/index.js +4 -1
- package/lib/form/index.js +10 -4
- package/lib/handle/index.js +46 -19
- package/lib/icon/index.js +10 -4
- package/lib/img/Contain.js +23 -12
- package/lib/img/Cover.js +53 -31
- package/lib/img/index.js +47 -29
- package/lib/index.js +187 -100
- package/lib/input/index.js +10 -4
- package/lib/input-number/index.js +10 -4
- package/lib/layout/index.js +10 -4
- package/lib/list/index.js +10 -4
- package/lib/loading-button/index.js +32 -15
- package/lib/locale/default.js +5 -0
- package/lib/locale/en_US.js +4 -0
- package/lib/locale/index.js +6 -3
- package/lib/locale/zh_CN.js +4 -0
- package/lib/locale-provider/index.js +10 -4
- package/lib/mention/index.js +10 -4
- package/lib/mentions/index.js +10 -4
- package/lib/menu/index.js +10 -4
- package/lib/message/index.js +11 -4
- package/lib/modal/index.js +11 -4
- package/lib/notification/index.js +10 -4
- package/lib/page/Box.js +37 -24
- package/lib/page/index.js +66 -37
- package/lib/page/utils.js +9 -1
- package/lib/page-header/index.js +10 -4
- package/lib/pagination/index.js +10 -4
- package/lib/popconfirm/index.js +10 -4
- package/lib/popover/index.js +10 -4
- package/lib/prev-locale.js +10 -1
- package/lib/progress/index.js +10 -4
- package/lib/query-form/Field/Checkbox.js +11 -2
- package/lib/query-form/Field/Select.js +45 -27
- package/lib/query-form/Field/SelectInput.js +46 -21
- package/lib/query-form/Field/fieldsMap.js +12 -1
- package/lib/query-form/Field/index.js +70 -38
- package/lib/query-form/createActions.js +7 -0
- package/lib/query-form/index.js +121 -52
- package/lib/query-form/useForm.js +4 -0
- package/lib/query-list-scene/List.js +111 -58
- package/lib/query-list-scene/QueryForm.js +67 -37
- package/lib/query-list-scene/QueryListScene.js +42 -21
- package/lib/query-list-scene/Title.js +5 -1
- package/lib/query-list-scene/Toolbar.js +15 -8
- package/lib/query-list-scene/createActions.js +6 -0
- package/lib/query-list-scene/index.js +10 -0
- package/lib/query-list-scene/useActions.js +4 -0
- package/lib/radio/index.js +10 -4
- package/lib/rate/index.js +10 -4
- package/lib/render-empty/index.js +2 -0
- package/lib/render-empty/render-empty.js +8 -0
- package/lib/result/index.js +10 -4
- package/lib/row/index.js +10 -4
- package/lib/select/index.js +10 -4
- package/lib/skeleton/index.js +10 -4
- package/lib/slider/index.js +10 -4
- package/lib/spin/index.js +10 -4
- package/lib/statistic/index.js +10 -4
- package/lib/steps/index.js +5 -1
- package/lib/steps/steps.js +29 -12
- package/lib/steps/style/nav.less +3 -1
- package/lib/svg-components/illustration-403.js +9 -3
- package/lib/svg-components/illustration-404.js +9 -3
- package/lib/svg-components/illustration-500.js +9 -3
- package/lib/svg-components/illustration-empty.js +9 -3
- package/lib/svg-components/illustration-failure.js +9 -3
- package/lib/svg-components/illustration-no-access.js +9 -3
- package/lib/svg-components/illustration-no-chart.js +9 -3
- package/lib/svg-components/illustration-no-result.js +9 -3
- package/lib/svg-components/illustration-offline.js +9 -3
- package/lib/svg-components/illustration-success.js +9 -3
- package/lib/svg-components/index.js +11 -0
- package/lib/switch/index.js +10 -4
- package/lib/table/assets/image-loading-background.js +9 -3
- package/lib/table/assets/image-loading.js +9 -3
- package/lib/table/context.js +2 -0
- package/lib/table/hooks/index.js +2 -1
- package/lib/table/hooks/use-column-setting.js +16 -8
- package/lib/table/index.js +5 -1
- package/lib/table/table.js +63 -34
- package/lib/table/table.stories.js +11 -2
- package/lib/table/utils.js +11 -2
- package/lib/tabs/index.js +10 -4
- package/lib/tag/index.js +10 -4
- package/lib/time-picker/index.js +10 -4
- package/lib/timeline/index.js +10 -4
- package/lib/title/index.js +20 -10
- package/lib/tntd-cascader/AntdCascader/component/DisabledContext.js +11 -4
- package/lib/tntd-cascader/AntdCascader/component/FormItemInputContext.js +8 -3
- package/lib/tntd-cascader/AntdCascader/component/SizeContext.js +8 -3
- package/lib/tntd-cascader/AntdCascader/component/context.js +9 -3
- package/lib/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +12 -4
- package/lib/tntd-cascader/AntdCascader/component/getIcons.js +37 -19
- package/lib/tntd-cascader/AntdCascader/component/useCompactItemContext.js +17 -8
- package/lib/tntd-cascader/AntdCascader/config/utils.js +15 -6
- package/lib/tntd-cascader/AntdCascader/config/warning.js +15 -7
- package/lib/tntd-cascader/AntdCascader/index.js +133 -80
- package/lib/tntd-cascader/AntdCascader/interface.js +3 -0
- package/lib/tntd-cascader/index.js +2 -0
- package/lib/tntd-cascader/rc-cascader/Cascader.js +188 -123
- package/lib/tntd-cascader/rc-cascader/OptionList/Checkbox.js +21 -11
- package/lib/tntd-cascader/rc-cascader/OptionList/Column.js +88 -60
- package/lib/tntd-cascader/rc-cascader/OptionList/index.js +109 -65
- package/lib/tntd-cascader/rc-cascader/OptionList/useActive.js +33 -18
- package/lib/tntd-cascader/rc-cascader/OptionList/useKeyboard.js +106 -56
- package/lib/tntd-cascader/rc-cascader/context.js +8 -3
- package/lib/tntd-cascader/rc-cascader/hooks/useDisplayValues.js +31 -14
- package/lib/tntd-cascader/rc-cascader/hooks/useEntities.js +15 -5
- package/lib/tntd-cascader/rc-cascader/hooks/useMissingValues.js +11 -3
- package/lib/tntd-cascader/rc-cascader/hooks/useRefFunc.js +8 -3
- package/lib/tntd-cascader/rc-cascader/hooks/useSearchConfig.js +15 -3
- package/lib/tntd-cascader/rc-cascader/hooks/useSearchOptions.js +41 -26
- package/lib/tntd-cascader/rc-cascader/index.js +3 -0
- package/lib/tntd-cascader/rc-cascader/utils/commonUtil.js +20 -9
- package/lib/tntd-cascader/rc-cascader/utils/treeUtil.js +8 -0
- package/lib/tntd-cascader/rc-cascader/utils/warningPropsUtil.js +14 -7
- package/lib/tntd-icon/fonts/iconfont.js +12 -7
- package/lib/tntd-icon/index.js +17 -6
- package/lib/tntd-layout/ActionsContext.js +3 -0
- package/lib/tntd-layout/AppList.js +105 -30
- package/lib/tntd-layout/Application.js +84 -22
- package/lib/tntd-layout/Avatar.js +72 -18
- package/lib/tntd-layout/CompatibleLanguage.js +105 -32
- package/lib/tntd-layout/EnterpriseLayout/Avatar.js +80 -24
- package/lib/tntd-layout/EnterpriseLayout/Language.js +45 -14
- package/lib/tntd-layout/EnterpriseLayout/Theme.js +46 -16
- package/lib/tntd-layout/EnterpriseLayout/index.js +12 -4
- package/lib/tntd-layout/GlobalNavigation/NavigationPopup.js +174 -45
- package/lib/tntd-layout/GlobalNavigation/index.js +70 -19
- package/lib/tntd-layout/Header.js +54 -20
- package/lib/tntd-layout/HeaderActions.js +64 -33
- package/lib/tntd-layout/HeaderNavs.js +59 -19
- package/lib/tntd-layout/HeaderTabs.js +111 -43
- package/lib/tntd-layout/Iconfont.js +5 -0
- package/lib/tntd-layout/Language.js +45 -14
- package/lib/tntd-layout/Layout.js +113 -74
- package/lib/tntd-layout/Logo.js +41 -14
- package/lib/tntd-layout/OrgAppList.js +119 -51
- package/lib/tntd-layout/SideMenu.js +120 -42
- package/lib/tntd-layout/Theme.js +71 -19
- package/lib/tntd-layout/createActions.js +5 -0
- package/lib/tntd-layout/images/index.js +28 -0
- package/lib/tntd-layout/index.js +49 -21
- package/lib/tntd-layout/paaslayout/CompactSideMenu.js +81 -29
- package/lib/tntd-layout/paaslayout/Header.js +47 -14
- package/lib/tntd-layout/paaslayout/Logo.js +19 -2
- package/lib/tntd-layout/paaslayout/SideMenu.js +82 -31
- package/lib/tntd-layout/paaslayout/index.js +108 -62
- 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 +33 -3
- package/lib/tntd-modal/index.js +51 -32
- package/lib/tntd-second-page/index.js +24 -14
- package/lib/tntd-select/DropDownWrap.js +45 -24
- package/lib/tntd-select/index.js +206 -117
- package/lib/tooltip/index.js +10 -4
- package/lib/transfer/index.js +10 -4
- package/lib/tree/index.js +10 -4
- package/lib/tree-select/index.js +10 -4
- package/lib/typography/index.js +10 -4
- package/lib/upload/index.js +10 -4
- package/lib/utils/checkAuth.js +10 -4
- package/lib/utils/findMenuInfoByPath.js +7 -1
- package/lib/utils/index.js +41 -13
- package/lib/version/index.js +10 -4
- package/package.json +1 -1
- package/es/array-input/style/index.js +0 -1
- package/es/array-input/style/index.js.map +0 -1
- package/es/auth-context/style/index.js +0 -1
- package/es/auth-context/style/index.js.map +0 -1
- package/es/development-login/style/index.js +0 -1
- package/es/development-login/style/index.js.map +0 -1
- package/es/ellipsis/style/index.js +0 -1
- package/es/ellipsis/style/index.js.map +0 -1
- package/es/empty/render-empty.js +0 -22
- package/es/empty/render-empty.js.map +0 -1
- package/es/empty/style/index.js +0 -2
- package/es/empty/style/index.js.map +0 -1
- package/es/handle/style/index.js +0 -1
- package/es/handle/style/index.js.map +0 -1
- package/es/icon-list/style/index.js +0 -1
- package/es/icon-list/style/index.js.map +0 -1
- package/es/img/style/index.js +0 -1
- package/es/img/style/index.js.map +0 -1
- package/es/loading-button/style/index.js +0 -1
- package/es/loading-button/style/index.js.map +0 -1
- package/es/page/style/index.js +0 -1
- package/es/page/style/index.js.map +0 -1
- package/es/query-form/style/index.js +0 -1
- package/es/query-form/style/index.js.map +0 -1
- package/es/query-list-scene/style/index.js +0 -1
- package/es/query-list-scene/style/index.js.map +0 -1
- package/es/render-empty/style/index.js +0 -1
- package/es/render-empty/style/index.js.map +0 -1
- package/es/table/style/index.js +0 -2
- package/es/table/style/index.js.map +0 -1
- package/es/title/style/index.js +0 -1
- package/es/title/style/index.js.map +0 -1
- package/es/tntd-icon/style/index.js +0 -1
- package/es/tntd-icon/style/index.js.map +0 -1
- package/es/tntd-layout/style/index.js +0 -1
- package/es/tntd-layout/style/index.js.map +0 -1
- package/es/tntd-modal/style/index.js +0 -1
- package/es/tntd-modal/style/index.js.map +0 -1
- package/es/tntd-select/style/index.js +0 -1
- package/es/tntd-select/style/index.js.map +0 -1
- package/lib/array-input/style/index.d.ts +0 -1
- package/lib/array-input/style/index.d.ts.map +0 -1
- package/lib/array-input/style/index.js +0 -1
- package/lib/array-input/style/index.js.map +0 -1
- package/lib/auth-context/style/index.d.ts +0 -1
- package/lib/auth-context/style/index.d.ts.map +0 -1
- package/lib/auth-context/style/index.js +0 -1
- package/lib/auth-context/style/index.js.map +0 -1
- package/lib/development-login/style/index.d.ts +0 -1
- package/lib/development-login/style/index.d.ts.map +0 -1
- package/lib/development-login/style/index.js +0 -1
- package/lib/development-login/style/index.js.map +0 -1
- package/lib/ellipsis/style/index.d.ts +0 -1
- package/lib/ellipsis/style/index.d.ts.map +0 -1
- package/lib/ellipsis/style/index.js +0 -1
- package/lib/ellipsis/style/index.js.map +0 -1
- package/lib/empty/render-empty.d.ts +0 -3
- package/lib/empty/render-empty.d.ts.map +0 -1
- package/lib/empty/render-empty.js +0 -32
- package/lib/empty/render-empty.js.map +0 -1
- package/lib/empty/style/index.d.ts +0 -3
- package/lib/empty/style/index.d.ts.map +0 -1
- package/lib/empty/style/index.js +0 -4
- package/lib/empty/style/index.js.map +0 -1
- package/lib/handle/style/index.d.ts +0 -1
- package/lib/handle/style/index.d.ts.map +0 -1
- package/lib/handle/style/index.js +0 -1
- package/lib/handle/style/index.js.map +0 -1
- package/lib/icon-list/style/index.d.ts +0 -3
- package/lib/icon-list/style/index.d.ts.map +0 -1
- package/lib/icon-list/style/index.js +0 -8
- package/lib/icon-list/style/index.js.map +0 -1
- package/lib/img/style/index.d.ts +0 -1
- package/lib/img/style/index.d.ts.map +0 -1
- package/lib/img/style/index.js +0 -1
- package/lib/img/style/index.js.map +0 -1
- package/lib/loading-button/style/index.d.ts +0 -1
- package/lib/loading-button/style/index.d.ts.map +0 -1
- package/lib/loading-button/style/index.js +0 -1
- package/lib/loading-button/style/index.js.map +0 -1
- package/lib/page/style/index.d.ts +0 -1
- package/lib/page/style/index.d.ts.map +0 -1
- package/lib/page/style/index.js +0 -1
- package/lib/page/style/index.js.map +0 -1
- package/lib/query-form/style/index.d.ts +0 -1
- package/lib/query-form/style/index.d.ts.map +0 -1
- package/lib/query-form/style/index.js +0 -1
- package/lib/query-form/style/index.js.map +0 -1
- package/lib/query-list-scene/style/index.d.ts +0 -1
- package/lib/query-list-scene/style/index.d.ts.map +0 -1
- package/lib/query-list-scene/style/index.js +0 -1
- package/lib/query-list-scene/style/index.js.map +0 -1
- package/lib/render-empty/style/index.d.ts +0 -2
- package/lib/render-empty/style/index.d.ts.map +0 -1
- package/lib/render-empty/style/index.js +0 -3
- package/lib/render-empty/style/index.js.map +0 -1
- package/lib/table/style/index.d.ts +0 -3
- package/lib/table/style/index.d.ts.map +0 -1
- package/lib/table/style/index.js +0 -4
- package/lib/table/style/index.js.map +0 -1
- package/lib/title/style/index.d.ts +0 -1
- package/lib/title/style/index.d.ts.map +0 -1
- package/lib/title/style/index.js +0 -1
- package/lib/title/style/index.js.map +0 -1
- package/lib/tntd-icon/style/index.d.ts +0 -1
- package/lib/tntd-icon/style/index.d.ts.map +0 -1
- package/lib/tntd-icon/style/index.js +0 -1
- package/lib/tntd-icon/style/index.js.map +0 -1
- package/lib/tntd-layout/style/index.d.ts +0 -1
- package/lib/tntd-layout/style/index.d.ts.map +0 -1
- package/lib/tntd-layout/style/index.js +0 -1
- package/lib/tntd-layout/style/index.js.map +0 -1
- package/lib/tntd-modal/style/index.d.ts +0 -1
- package/lib/tntd-modal/style/index.d.ts.map +0 -1
- package/lib/tntd-modal/style/index.js +0 -1
- package/lib/tntd-modal/style/index.js.map +0 -1
- package/lib/tntd-select/style/index.d.ts +0 -1
- package/lib/tntd-select/style/index.d.ts.map +0 -1
- package/lib/tntd-select/style/index.js +0 -1
- package/lib/tntd-select/style/index.js.map +0 -1
|
@@ -1,101 +1,122 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) {
|
|
3
|
+
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
|
-
exports.FIX_LABEL = void 0;
|
|
8
8
|
exports["default"] = Column;
|
|
9
|
+
exports.FIX_LABEL = void 0;
|
|
10
|
+
|
|
9
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
|
+
|
|
10
13
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
14
|
+
|
|
11
15
|
var _commonUtil = require("../utils/commonUtil");
|
|
16
|
+
|
|
12
17
|
var _context = _interopRequireDefault(require("../context"));
|
|
18
|
+
|
|
13
19
|
var _Checkbox = _interopRequireDefault(require("./Checkbox"));
|
|
20
|
+
|
|
14
21
|
var _useSearchOptions = require("../hooks/useSearchOptions");
|
|
22
|
+
|
|
15
23
|
var _rcVirtualList = _interopRequireDefault(require("rc-virtual-list"));
|
|
24
|
+
|
|
16
25
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
|
-
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
function
|
|
21
|
-
|
|
22
|
-
function
|
|
23
|
-
|
|
24
|
-
function
|
|
25
|
-
|
|
26
|
-
function
|
|
27
|
-
|
|
26
|
+
|
|
27
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
28
|
+
|
|
29
|
+
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; }
|
|
30
|
+
|
|
31
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
32
|
+
|
|
33
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
|
|
34
|
+
|
|
35
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
|
|
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
|
+
|
|
28
41
|
var FIX_LABEL = '__cascader_fix_label__';
|
|
29
42
|
exports.FIX_LABEL = FIX_LABEL;
|
|
43
|
+
|
|
30
44
|
function Column(_ref) {
|
|
31
45
|
var prefixCls = _ref.prefixCls,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
multiple = _ref.multiple,
|
|
47
|
+
options = _ref.options,
|
|
48
|
+
activeValue = _ref.activeValue,
|
|
49
|
+
prevValuePath = _ref.prevValuePath,
|
|
50
|
+
onToggleOpen = _ref.onToggleOpen,
|
|
51
|
+
onSelect = _ref.onSelect,
|
|
52
|
+
onActive = _ref.onActive,
|
|
53
|
+
checkedSet = _ref.checkedSet,
|
|
54
|
+
halfCheckedSet = _ref.halfCheckedSet,
|
|
55
|
+
loadingKeys = _ref.loadingKeys,
|
|
56
|
+
isSelectable = _ref.isSelectable,
|
|
57
|
+
renderItem = _ref.renderItem,
|
|
58
|
+
searchValue = _ref.searchValue,
|
|
59
|
+
level = _ref.level,
|
|
60
|
+
dropdownVisible = _ref.dropdownVisible,
|
|
61
|
+
optionHeight = _ref.optionHeight;
|
|
48
62
|
var ref = React.useRef(null);
|
|
49
63
|
var menuPrefixCls = "".concat(prefixCls, "-menu ").concat(prefixCls, "-menu-").concat(level);
|
|
50
64
|
var menuItemPrefixCls = "".concat(prefixCls, "-menu-item");
|
|
65
|
+
|
|
51
66
|
var _React$useContext = React.useContext(_context["default"]),
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
67
|
+
fieldNames = _React$useContext.fieldNames,
|
|
68
|
+
changeOnSelect = _React$useContext.changeOnSelect,
|
|
69
|
+
expandTrigger = _React$useContext.expandTrigger,
|
|
70
|
+
expandIcon = _React$useContext.expandIcon,
|
|
71
|
+
loadingIcon = _React$useContext.loadingIcon,
|
|
72
|
+
dropdownMenuColumnStyle = _React$useContext.dropdownMenuColumnStyle;
|
|
73
|
+
|
|
58
74
|
var hoverOpen = expandTrigger === 'hover';
|
|
59
75
|
/** 单选情况下滚动到相应的位置 */
|
|
76
|
+
|
|
60
77
|
React.useEffect(function () {
|
|
61
78
|
var timer = null;
|
|
79
|
+
|
|
62
80
|
if (ref.current && ref.current.scrollTo && !multiple && dropdownVisible) {
|
|
63
81
|
var index = options.findIndex(function (it) {
|
|
64
82
|
return it[fieldNames.value] === activeValue;
|
|
65
83
|
});
|
|
84
|
+
|
|
66
85
|
if (index > 0 && !isNaN(index)) {
|
|
67
86
|
timer = window.setTimeout(function () {
|
|
68
87
|
ref.current.scrollTo((optionHeight || 36) * index);
|
|
69
88
|
}, 5);
|
|
70
89
|
}
|
|
71
90
|
}
|
|
91
|
+
|
|
72
92
|
return function () {
|
|
73
93
|
if (timer) {
|
|
74
94
|
window.clearTimeout(timer);
|
|
75
95
|
}
|
|
96
|
+
|
|
76
97
|
timer = null;
|
|
77
98
|
};
|
|
78
|
-
}, [multiple, activeValue, options, fieldNames, dropdownVisible, optionHeight]);
|
|
79
|
-
|
|
99
|
+
}, [multiple, activeValue, options, fieldNames, dropdownVisible, optionHeight]); // ============================ Option ============================
|
|
100
|
+
|
|
80
101
|
var optionInfoList = React.useMemo(function () {
|
|
81
102
|
return options.map(function (option) {
|
|
82
103
|
var _a;
|
|
104
|
+
|
|
83
105
|
var disabled = option.disabled;
|
|
84
106
|
var searchOptions = option[_useSearchOptions.SEARCH_MARK];
|
|
85
107
|
var label = (_a = option[FIX_LABEL]) !== null && _a !== void 0 ? _a : option[fieldNames.label];
|
|
86
108
|
var value = option[fieldNames.value];
|
|
87
|
-
var isMergedLeaf = (0, _commonUtil.isLeaf)(option, fieldNames);
|
|
88
|
-
|
|
89
|
-
var fullPath = searchOptions ?
|
|
90
|
-
// @ts-ignore
|
|
109
|
+
var isMergedLeaf = (0, _commonUtil.isLeaf)(option, fieldNames); // Get real value of option. Search option is different way.
|
|
110
|
+
|
|
111
|
+
var fullPath = searchOptions ? // @ts-ignore
|
|
91
112
|
searchOptions.map(function (opt) {
|
|
92
113
|
return opt[fieldNames.value];
|
|
93
114
|
}) : [].concat(_toConsumableArray(prevValuePath), [value]);
|
|
94
115
|
var fullPathKey = (0, _commonUtil.toPathKey)(fullPath);
|
|
95
|
-
var isLoading = loadingKeys.includes(fullPathKey);
|
|
96
|
-
|
|
97
|
-
var checked = checkedSet.has(fullPathKey);
|
|
98
|
-
|
|
116
|
+
var isLoading = loadingKeys.includes(fullPathKey); // >>>>> checked
|
|
117
|
+
|
|
118
|
+
var checked = checkedSet.has(fullPathKey); // >>>>> halfChecked
|
|
119
|
+
|
|
99
120
|
var halfChecked = halfCheckedSet.has(fullPathKey);
|
|
100
121
|
return {
|
|
101
122
|
disabled: disabled,
|
|
@@ -110,8 +131,8 @@ function Column(_ref) {
|
|
|
110
131
|
fullPathKey: fullPathKey
|
|
111
132
|
};
|
|
112
133
|
});
|
|
113
|
-
}, [options, checkedSet, fieldNames, halfCheckedSet, loadingKeys, prevValuePath]);
|
|
114
|
-
|
|
134
|
+
}, [options, checkedSet, fieldNames, halfCheckedSet, loadingKeys, prevValuePath]); // ============================ Render ============================
|
|
135
|
+
|
|
115
136
|
return React.createElement("ul", {
|
|
116
137
|
className: menuPrefixCls,
|
|
117
138
|
role: "menu"
|
|
@@ -124,35 +145,41 @@ function Column(_ref) {
|
|
|
124
145
|
ref: ref
|
|
125
146
|
}, function (_ref2) {
|
|
126
147
|
var _classNames;
|
|
148
|
+
|
|
127
149
|
var disabled = _ref2.disabled,
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
150
|
+
label = _ref2.label,
|
|
151
|
+
value = _ref2.value,
|
|
152
|
+
isMergedLeaf = _ref2.isLeaf,
|
|
153
|
+
isLoading = _ref2.isLoading,
|
|
154
|
+
checked = _ref2.checked,
|
|
155
|
+
halfChecked = _ref2.halfChecked,
|
|
156
|
+
option = _ref2.option,
|
|
157
|
+
fullPath = _ref2.fullPath,
|
|
158
|
+
fullPathKey = _ref2.fullPathKey;
|
|
159
|
+
|
|
137
160
|
// >>>>> Open
|
|
138
161
|
var triggerOpenPath = function triggerOpenPath() {
|
|
139
162
|
if (!disabled && (!hoverOpen || !isMergedLeaf)) {
|
|
140
163
|
onActive(fullPath);
|
|
141
164
|
}
|
|
142
|
-
};
|
|
143
|
-
|
|
165
|
+
}; // >>>>> Selection
|
|
166
|
+
|
|
167
|
+
|
|
144
168
|
var triggerSelect = function triggerSelect() {
|
|
145
169
|
if (isSelectable(option)) {
|
|
146
170
|
onSelect(fullPath, isMergedLeaf);
|
|
147
171
|
}
|
|
148
|
-
};
|
|
149
|
-
|
|
172
|
+
}; // >>>>> Title
|
|
173
|
+
|
|
174
|
+
|
|
150
175
|
var title;
|
|
176
|
+
|
|
151
177
|
if (typeof option.title === 'string') {
|
|
152
178
|
title = option.title;
|
|
153
179
|
} else if (typeof label === 'string') {
|
|
154
180
|
title = label;
|
|
155
181
|
}
|
|
182
|
+
|
|
156
183
|
return React.createElement("li", {
|
|
157
184
|
key: fullPathKey,
|
|
158
185
|
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)),
|
|
@@ -164,6 +191,7 @@ function Column(_ref) {
|
|
|
164
191
|
"data-path-key": fullPathKey,
|
|
165
192
|
onClick: function onClick() {
|
|
166
193
|
triggerOpenPath();
|
|
194
|
+
|
|
167
195
|
if (!multiple || isMergedLeaf) {
|
|
168
196
|
triggerSelect();
|
|
169
197
|
}
|
|
@@ -1,78 +1,105 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) {
|
|
3
|
+
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports["default"] = void 0;
|
|
9
|
+
|
|
8
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
+
|
|
9
12
|
var _rcSelect = require("rc-select");
|
|
13
|
+
|
|
10
14
|
var React = _interopRequireWildcard(require("react"));
|
|
15
|
+
|
|
11
16
|
var _context = _interopRequireDefault(require("../context"));
|
|
17
|
+
|
|
12
18
|
var _commonUtil = require("../utils/commonUtil");
|
|
19
|
+
|
|
13
20
|
var _treeUtil = require("../utils/treeUtil");
|
|
21
|
+
|
|
14
22
|
var _Column = _interopRequireWildcard(require("./Column"));
|
|
23
|
+
|
|
15
24
|
var _useActive3 = _interopRequireDefault(require("./useActive"));
|
|
25
|
+
|
|
16
26
|
var _useKeyboard = _interopRequireDefault(require("./useKeyboard"));
|
|
17
|
-
|
|
18
|
-
function
|
|
27
|
+
|
|
28
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
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
|
+
|
|
19
32
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
20
|
-
|
|
21
|
-
function
|
|
22
|
-
|
|
23
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) ||
|
|
24
|
-
|
|
25
|
-
function
|
|
26
|
-
|
|
27
|
-
function
|
|
28
|
-
|
|
29
|
-
function
|
|
30
|
-
|
|
31
|
-
function
|
|
33
|
+
|
|
34
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
35
|
+
|
|
36
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
|
|
37
|
+
|
|
38
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
|
|
39
|
+
|
|
40
|
+
function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
|
|
41
|
+
|
|
42
|
+
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; } }
|
|
43
|
+
|
|
44
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
|
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
|
+
|
|
32
50
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
51
|
+
|
|
33
52
|
var RefOptionList = React.forwardRef(function (props, ref) {
|
|
34
53
|
var _ref3, _classNames;
|
|
54
|
+
|
|
35
55
|
var _a, _b;
|
|
56
|
+
|
|
36
57
|
var _useBaseProps = (0, _rcSelect.useBaseProps)(),
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
58
|
+
prefixCls = _useBaseProps.prefixCls,
|
|
59
|
+
multiple = _useBaseProps.multiple,
|
|
60
|
+
searchValue = _useBaseProps.searchValue,
|
|
61
|
+
toggleOpen = _useBaseProps.toggleOpen,
|
|
62
|
+
notFoundContent = _useBaseProps.notFoundContent,
|
|
63
|
+
direction = _useBaseProps.direction,
|
|
64
|
+
optionHeight = _useBaseProps.optionHeight;
|
|
65
|
+
|
|
44
66
|
var containerRef = React.useRef();
|
|
45
67
|
var rtl = direction === 'rtl';
|
|
68
|
+
|
|
46
69
|
var _React$useContext = React.useContext(_context["default"]),
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
// ========================= loadData =========================
|
|
70
|
+
options = _React$useContext.options,
|
|
71
|
+
values = _React$useContext.values,
|
|
72
|
+
halfValues = _React$useContext.halfValues,
|
|
73
|
+
fieldNames = _React$useContext.fieldNames,
|
|
74
|
+
changeOnSelect = _React$useContext.changeOnSelect,
|
|
75
|
+
onSelect = _React$useContext.onSelect,
|
|
76
|
+
searchOptions = _React$useContext.searchOptions,
|
|
77
|
+
dropdownPrefixCls = _React$useContext.dropdownPrefixCls,
|
|
78
|
+
loadData = _React$useContext.loadData,
|
|
79
|
+
expandTrigger = _React$useContext.expandTrigger,
|
|
80
|
+
renderItem = _React$useContext.renderItem,
|
|
81
|
+
dropdownVisible = _React$useContext.dropdownVisible;
|
|
82
|
+
|
|
83
|
+
var mergedPrefixCls = dropdownPrefixCls || prefixCls; // ========================= loadData =========================
|
|
84
|
+
|
|
61
85
|
var _React$useState = React.useState([]),
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
86
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
87
|
+
loadingKeys = _React$useState2[0],
|
|
88
|
+
setLoadingKeys = _React$useState2[1];
|
|
89
|
+
|
|
65
90
|
var internalLoadData = function internalLoadData(valueCells) {
|
|
66
91
|
// Do not load when search
|
|
67
92
|
if (!loadData || searchValue) {
|
|
68
93
|
return;
|
|
69
94
|
}
|
|
95
|
+
|
|
70
96
|
var optionList = (0, _treeUtil.toPathOptions)(valueCells, options, fieldNames);
|
|
71
97
|
var rawOptions = optionList.map(function (_ref) {
|
|
72
98
|
var option = _ref.option;
|
|
73
99
|
return option;
|
|
74
100
|
});
|
|
75
101
|
var lastOption = rawOptions[rawOptions.length - 1];
|
|
102
|
+
|
|
76
103
|
if (lastOption && !(0, _commonUtil.isLeaf)(lastOption, fieldNames)) {
|
|
77
104
|
var pathKey = (0, _commonUtil.toPathKey)(valueCells);
|
|
78
105
|
setLoadingKeys(function (keys) {
|
|
@@ -80,8 +107,9 @@ var RefOptionList = React.forwardRef(function (props, ref) {
|
|
|
80
107
|
});
|
|
81
108
|
loadData(rawOptions);
|
|
82
109
|
}
|
|
83
|
-
};
|
|
84
|
-
|
|
110
|
+
}; // zombieJ: This is bad. We should make this same as `rc-tree` to use Promise instead.
|
|
111
|
+
|
|
112
|
+
|
|
85
113
|
React.useEffect(function () {
|
|
86
114
|
if (loadingKeys.length) {
|
|
87
115
|
loadingKeys.forEach(function (loadingKey) {
|
|
@@ -91,6 +119,7 @@ var RefOptionList = React.forwardRef(function (props, ref) {
|
|
|
91
119
|
return option;
|
|
92
120
|
});
|
|
93
121
|
var lastOption = optionList[optionList.length - 1];
|
|
122
|
+
|
|
94
123
|
if (!lastOption || lastOption[fieldNames.children] || (0, _commonUtil.isLeaf)(lastOption, fieldNames)) {
|
|
95
124
|
setLoadingKeys(function (keys) {
|
|
96
125
|
return keys.filter(function (key) {
|
|
@@ -100,92 +129,107 @@ var RefOptionList = React.forwardRef(function (props, ref) {
|
|
|
100
129
|
}
|
|
101
130
|
});
|
|
102
131
|
}
|
|
103
|
-
}, [options, loadingKeys, fieldNames]);
|
|
104
|
-
|
|
132
|
+
}, [options, loadingKeys, fieldNames]); // ========================== Values ==========================
|
|
133
|
+
|
|
105
134
|
var checkedSet = React.useMemo(function () {
|
|
106
135
|
return new Set((0, _commonUtil.toPathKeys)(values));
|
|
107
136
|
}, [values]);
|
|
108
137
|
var halfCheckedSet = React.useMemo(function () {
|
|
109
138
|
return new Set((0, _commonUtil.toPathKeys)(halfValues));
|
|
110
|
-
}, [halfValues]);
|
|
111
|
-
|
|
139
|
+
}, [halfValues]); // ====================== Accessibility =======================
|
|
140
|
+
|
|
112
141
|
var _useActive = (0, _useActive3["default"])(),
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
142
|
+
_useActive2 = _slicedToArray(_useActive, 2),
|
|
143
|
+
activeValueCells = _useActive2[0],
|
|
144
|
+
setActiveValueCells = _useActive2[1]; // =========================== Path ===========================
|
|
145
|
+
|
|
146
|
+
|
|
117
147
|
var onPathOpen = function onPathOpen(nextValueCells) {
|
|
118
|
-
setActiveValueCells(nextValueCells);
|
|
119
|
-
|
|
148
|
+
setActiveValueCells(nextValueCells); // Trigger loadData
|
|
149
|
+
|
|
120
150
|
internalLoadData(nextValueCells);
|
|
121
151
|
};
|
|
152
|
+
|
|
122
153
|
var isSelectable = function isSelectable(option) {
|
|
123
154
|
var disabled = option.disabled;
|
|
124
155
|
var isMergedLeaf = (0, _commonUtil.isLeaf)(option, fieldNames);
|
|
125
156
|
return !disabled && (isMergedLeaf || changeOnSelect || multiple);
|
|
126
157
|
};
|
|
158
|
+
|
|
127
159
|
var onPathSelect = function onPathSelect(valuePath, leaf) {
|
|
128
160
|
var fromKeyboard = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
129
161
|
onSelect(valuePath);
|
|
162
|
+
|
|
130
163
|
if (!multiple && (leaf || changeOnSelect && (expandTrigger === 'hover' || fromKeyboard))) {
|
|
131
164
|
toggleOpen(false);
|
|
132
165
|
}
|
|
133
|
-
};
|
|
134
|
-
|
|
166
|
+
}; // ========================== Option ==========================
|
|
167
|
+
|
|
168
|
+
|
|
135
169
|
var mergedOptions = React.useMemo(function () {
|
|
136
170
|
if (searchValue) {
|
|
137
171
|
return searchOptions;
|
|
138
172
|
}
|
|
173
|
+
|
|
139
174
|
return options;
|
|
140
|
-
}, [searchValue, searchOptions, options]);
|
|
141
|
-
|
|
175
|
+
}, [searchValue, searchOptions, options]); // ========================== Column ==========================
|
|
176
|
+
|
|
142
177
|
var optionColumns = React.useMemo(function () {
|
|
143
178
|
var optionList = [{
|
|
144
179
|
options: mergedOptions
|
|
145
180
|
}];
|
|
146
181
|
var currentList = mergedOptions;
|
|
182
|
+
|
|
147
183
|
var _loop = function _loop(i) {
|
|
148
184
|
var activeValueCell = activeValueCells[i];
|
|
149
185
|
var currentOption = currentList.find(function (option) {
|
|
150
186
|
return option[fieldNames.value] === activeValueCell;
|
|
151
187
|
});
|
|
152
188
|
var subOptions = currentOption === null || currentOption === void 0 ? void 0 : currentOption[fieldNames.children];
|
|
189
|
+
|
|
153
190
|
if (!(subOptions === null || subOptions === void 0 ? void 0 : subOptions.length)) {
|
|
154
191
|
return "break";
|
|
155
192
|
}
|
|
193
|
+
|
|
156
194
|
currentList = subOptions;
|
|
157
195
|
optionList.push({
|
|
158
196
|
options: subOptions
|
|
159
197
|
});
|
|
160
198
|
};
|
|
199
|
+
|
|
161
200
|
for (var i = 0; i < activeValueCells.length; i += 1) {
|
|
162
201
|
var _ret = _loop(i);
|
|
202
|
+
|
|
163
203
|
if (_ret === "break") break;
|
|
164
204
|
}
|
|
205
|
+
|
|
165
206
|
return optionList;
|
|
166
|
-
}, [mergedOptions, activeValueCells, fieldNames]);
|
|
167
|
-
|
|
207
|
+
}, [mergedOptions, activeValueCells, fieldNames]); // ========================= Keyboard =========================
|
|
208
|
+
|
|
168
209
|
var onKeyboardSelect = function onKeyboardSelect(selectValueCells, option) {
|
|
169
210
|
if (isSelectable(option)) {
|
|
170
211
|
onPathSelect(selectValueCells, (0, _commonUtil.isLeaf)(option, fieldNames), true);
|
|
171
212
|
}
|
|
172
213
|
};
|
|
173
|
-
|
|
174
|
-
// >>>>> Active Scroll
|
|
214
|
+
|
|
215
|
+
(0, _useKeyboard["default"])(ref, mergedOptions, fieldNames, activeValueCells, onPathOpen, onKeyboardSelect); // >>>>> Active Scroll
|
|
216
|
+
|
|
175
217
|
React.useEffect(function () {
|
|
176
218
|
var _a;
|
|
219
|
+
|
|
177
220
|
for (var i = 0; i < activeValueCells.length; i += 1) {
|
|
178
221
|
var cellPath = activeValueCells.slice(0, i + 1);
|
|
179
222
|
var cellKeyPath = (0, _commonUtil.toPathKey)(cellPath);
|
|
180
223
|
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
|
|
181
224
|
);
|
|
225
|
+
|
|
182
226
|
if (ele) {
|
|
183
227
|
(0, _commonUtil.scrollIntoParentView)(ele);
|
|
184
228
|
}
|
|
185
229
|
}
|
|
186
|
-
}, [activeValueCells]);
|
|
187
|
-
// ========================== Render ==========================
|
|
230
|
+
}, [activeValueCells]); // ========================== Render ==========================
|
|
188
231
|
// >>>>> Empty
|
|
232
|
+
|
|
189
233
|
var isEmpty = !((_b = (_a = optionColumns[0]) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.length);
|
|
190
234
|
var emptyList = [(_ref3 = {}, _defineProperty(_ref3, fieldNames.value, '__EMPTY__'), _defineProperty(_ref3, _Column.FIX_LABEL, notFoundContent), _defineProperty(_ref3, "disabled", true), _ref3)];
|
|
191
235
|
var columnProps = Object.assign(Object.assign({}, props), {
|
|
@@ -197,8 +241,8 @@ var RefOptionList = React.forwardRef(function (props, ref) {
|
|
|
197
241
|
halfCheckedSet: halfCheckedSet,
|
|
198
242
|
loadingKeys: loadingKeys,
|
|
199
243
|
isSelectable: isSelectable
|
|
200
|
-
});
|
|
201
|
-
|
|
244
|
+
}); // >>>>> Columns
|
|
245
|
+
|
|
202
246
|
var mergedOptionColumns = isEmpty ? [{
|
|
203
247
|
options: emptyList
|
|
204
248
|
}] : optionColumns;
|
|
@@ -218,8 +262,8 @@ var RefOptionList = React.forwardRef(function (props, ref) {
|
|
|
218
262
|
activeValue: activeValue,
|
|
219
263
|
renderItem: renderItem
|
|
220
264
|
}));
|
|
221
|
-
});
|
|
222
|
-
|
|
265
|
+
}); // >>>>> Render
|
|
266
|
+
|
|
223
267
|
return React.createElement("div", {
|
|
224
268
|
className: (0, _classnames["default"])("".concat(mergedPrefixCls, "-menus"), (_classNames = {}, _defineProperty(_classNames, "".concat(mergedPrefixCls, "-menu-empty"), isEmpty), _defineProperty(_classNames, "".concat(mergedPrefixCls, "-rtl"), rtl), _classNames)),
|
|
225
269
|
ref: containerRef
|