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
|
@@ -15,40 +15,49 @@ export default ((ref, options, fieldNames, activeValueCells, setActiveValueCells
|
|
|
15
15
|
let currentOptions = options;
|
|
16
16
|
const mergedActiveIndexes = [];
|
|
17
17
|
const mergedActiveValueCells = [];
|
|
18
|
-
const len = activeValueCells.length;
|
|
19
|
-
|
|
18
|
+
const len = activeValueCells.length; // Fill validate active value cells and index
|
|
19
|
+
|
|
20
20
|
for (let i = 0; i < len && currentOptions; i += 1) {
|
|
21
21
|
// Mark the active index for current options
|
|
22
22
|
const nextActiveIndex = currentOptions.findIndex(option => option[fieldNames.value] === activeValueCells[i]);
|
|
23
|
+
|
|
23
24
|
if (nextActiveIndex === -1) {
|
|
24
25
|
break;
|
|
25
26
|
}
|
|
27
|
+
|
|
26
28
|
activeIndex = nextActiveIndex;
|
|
27
29
|
mergedActiveIndexes.push(activeIndex);
|
|
28
30
|
mergedActiveValueCells.push(activeValueCells[i]);
|
|
29
31
|
currentOptions = currentOptions[activeIndex][fieldNames.children];
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
+
} // Fill last active options
|
|
33
|
+
|
|
34
|
+
|
|
32
35
|
let activeOptions = options;
|
|
36
|
+
|
|
33
37
|
for (let i = 0; i < mergedActiveIndexes.length - 1; i += 1) {
|
|
34
38
|
activeOptions = activeOptions[mergedActiveIndexes[i]][fieldNames.children];
|
|
35
39
|
}
|
|
40
|
+
|
|
36
41
|
return [mergedActiveValueCells, activeIndex, activeOptions];
|
|
37
|
-
}, [activeValueCells, fieldNames, options]);
|
|
38
|
-
|
|
42
|
+
}, [activeValueCells, fieldNames, options]); // Update active value cells and scroll to target element
|
|
43
|
+
|
|
39
44
|
const internalSetActiveValueCells = next => {
|
|
40
45
|
setActiveValueCells(next);
|
|
41
|
-
};
|
|
42
|
-
|
|
46
|
+
}; // Same options offset
|
|
47
|
+
|
|
48
|
+
|
|
43
49
|
const offsetActiveOption = offset => {
|
|
44
50
|
const len = lastActiveOptions.length;
|
|
45
51
|
let currentIndex = lastActiveIndex;
|
|
52
|
+
|
|
46
53
|
if (currentIndex === -1 && offset < 0) {
|
|
47
54
|
currentIndex = len;
|
|
48
55
|
}
|
|
56
|
+
|
|
49
57
|
for (let i = 0; i < len; i += 1) {
|
|
50
58
|
currentIndex = (currentIndex + offset + len) % len;
|
|
51
59
|
const option = lastActiveOptions[currentIndex];
|
|
60
|
+
|
|
52
61
|
if (option && !option.disabled) {
|
|
53
62
|
const value = option[fieldNames.value];
|
|
54
63
|
const nextActiveCells = validActiveValueCells.slice(0, -1).concat(value);
|
|
@@ -56,8 +65,9 @@ export default ((ref, options, fieldNames, activeValueCells, setActiveValueCells
|
|
|
56
65
|
return;
|
|
57
66
|
}
|
|
58
67
|
}
|
|
59
|
-
};
|
|
60
|
-
|
|
68
|
+
}; // Different options offset
|
|
69
|
+
|
|
70
|
+
|
|
61
71
|
const prevColumn = () => {
|
|
62
72
|
if (validActiveValueCells.length > 1) {
|
|
63
73
|
const nextActiveCells = validActiveValueCells.slice(0, -1);
|
|
@@ -66,37 +76,46 @@ export default ((ref, options, fieldNames, activeValueCells, setActiveValueCells
|
|
|
66
76
|
toggleOpen(false);
|
|
67
77
|
}
|
|
68
78
|
};
|
|
79
|
+
|
|
69
80
|
const nextColumn = () => {
|
|
70
81
|
var _a;
|
|
82
|
+
|
|
71
83
|
const nextOptions = ((_a = lastActiveOptions[lastActiveIndex]) === null || _a === void 0 ? void 0 : _a[fieldNames.children]) || [];
|
|
72
84
|
const nextOption = nextOptions.find(option => !option.disabled);
|
|
85
|
+
|
|
73
86
|
if (nextOption) {
|
|
74
87
|
const nextActiveCells = [...validActiveValueCells, nextOption[fieldNames.value]];
|
|
75
88
|
internalSetActiveValueCells(nextActiveCells);
|
|
76
89
|
}
|
|
77
90
|
};
|
|
91
|
+
|
|
78
92
|
React.useImperativeHandle(ref, () => ({
|
|
79
93
|
// scrollTo: treeRef.current?.scrollTo,
|
|
80
94
|
onKeyDown: event => {
|
|
81
95
|
const {
|
|
82
96
|
which
|
|
83
97
|
} = event;
|
|
98
|
+
|
|
84
99
|
switch (which) {
|
|
85
100
|
// >>> Arrow keys
|
|
86
101
|
case KeyCode.UP:
|
|
87
102
|
case KeyCode.DOWN:
|
|
88
103
|
{
|
|
89
104
|
let offset = 0;
|
|
105
|
+
|
|
90
106
|
if (which === KeyCode.UP) {
|
|
91
107
|
offset = -1;
|
|
92
108
|
} else if (which === KeyCode.DOWN) {
|
|
93
109
|
offset = 1;
|
|
94
110
|
}
|
|
111
|
+
|
|
95
112
|
if (offset !== 0) {
|
|
96
113
|
offsetActiveOption(offset);
|
|
97
114
|
}
|
|
115
|
+
|
|
98
116
|
break;
|
|
99
117
|
}
|
|
118
|
+
|
|
100
119
|
case KeyCode.LEFT:
|
|
101
120
|
{
|
|
102
121
|
if (rtl) {
|
|
@@ -104,8 +123,10 @@ export default ((ref, options, fieldNames, activeValueCells, setActiveValueCells
|
|
|
104
123
|
} else {
|
|
105
124
|
prevColumn();
|
|
106
125
|
}
|
|
126
|
+
|
|
107
127
|
break;
|
|
108
128
|
}
|
|
129
|
+
|
|
109
130
|
case KeyCode.RIGHT:
|
|
110
131
|
{
|
|
111
132
|
if (rtl) {
|
|
@@ -113,34 +134,42 @@ export default ((ref, options, fieldNames, activeValueCells, setActiveValueCells
|
|
|
113
134
|
} else {
|
|
114
135
|
nextColumn();
|
|
115
136
|
}
|
|
137
|
+
|
|
116
138
|
break;
|
|
117
139
|
}
|
|
140
|
+
|
|
118
141
|
case KeyCode.BACKSPACE:
|
|
119
142
|
{
|
|
120
143
|
if (!searchValue) {
|
|
121
144
|
prevColumn();
|
|
122
145
|
}
|
|
146
|
+
|
|
123
147
|
break;
|
|
124
148
|
}
|
|
125
149
|
// >>> Select
|
|
150
|
+
|
|
126
151
|
case KeyCode.ENTER:
|
|
127
152
|
{
|
|
128
153
|
if (validActiveValueCells.length) {
|
|
129
|
-
const option = lastActiveOptions[lastActiveIndex];
|
|
130
|
-
|
|
154
|
+
const option = lastActiveOptions[lastActiveIndex]; // Search option should revert back of origin options
|
|
155
|
+
|
|
131
156
|
const originOptions = (option === null || option === void 0 ? void 0 : option[SEARCH_MARK]) || [];
|
|
157
|
+
|
|
132
158
|
if (originOptions.length) {
|
|
133
159
|
onKeyBoardSelect(originOptions.map(opt => opt[fieldNames.value]), originOptions[originOptions.length - 1]);
|
|
134
160
|
} else {
|
|
135
161
|
onKeyBoardSelect(validActiveValueCells, lastActiveOptions[lastActiveIndex]);
|
|
136
162
|
}
|
|
137
163
|
}
|
|
164
|
+
|
|
138
165
|
break;
|
|
139
166
|
}
|
|
140
167
|
// >>> Close
|
|
168
|
+
|
|
141
169
|
case KeyCode.ESC:
|
|
142
170
|
{
|
|
143
171
|
toggleOpen(false);
|
|
172
|
+
|
|
144
173
|
if (open) {
|
|
145
174
|
event.stopPropagation();
|
|
146
175
|
}
|
|
@@ -4,33 +4,39 @@ import * as React from 'react';
|
|
|
4
4
|
import { toPathKey } from '../utils/commonUtil';
|
|
5
5
|
export default ((rawValues, options, fieldNames, multiple, displayRender) => {
|
|
6
6
|
return React.useMemo(() => {
|
|
7
|
-
const mergedDisplayRender = displayRender || (
|
|
8
|
-
// Default displayRender
|
|
7
|
+
const mergedDisplayRender = displayRender || ( // Default displayRender
|
|
9
8
|
labels => {
|
|
10
9
|
const mergedLabels = multiple ? labels.slice(-1) : labels;
|
|
11
10
|
const SPLIT = ' / ';
|
|
11
|
+
|
|
12
12
|
if (mergedLabels.every(label => ['string', 'number'].includes(typeof label))) {
|
|
13
13
|
return mergedLabels.join(SPLIT);
|
|
14
|
-
}
|
|
15
|
-
|
|
14
|
+
} // If exist non-string value, use ReactNode instead
|
|
15
|
+
|
|
16
|
+
|
|
16
17
|
return mergedLabels.reduce((list, label, index) => {
|
|
17
18
|
const keyedLabel = React.isValidElement(label) ? React.cloneElement(label, {
|
|
18
19
|
key: index
|
|
19
20
|
}) : label;
|
|
21
|
+
|
|
20
22
|
if (index === 0) {
|
|
21
23
|
return [keyedLabel];
|
|
22
24
|
}
|
|
25
|
+
|
|
23
26
|
return [...list, SPLIT, keyedLabel];
|
|
24
27
|
}, []);
|
|
25
28
|
});
|
|
29
|
+
|
|
26
30
|
return rawValues.map(valueCells => {
|
|
27
31
|
var _a, _b;
|
|
32
|
+
|
|
28
33
|
const valueOptions = toPathOptions(valueCells, options, fieldNames);
|
|
29
34
|
const label = mergedDisplayRender(valueOptions.map(({
|
|
30
35
|
option,
|
|
31
36
|
value
|
|
32
37
|
}) => {
|
|
33
38
|
var _a;
|
|
39
|
+
|
|
34
40
|
return (_a = option === null || option === void 0 ? void 0 : option[fieldNames.label]) !== null && _a !== void 0 ? _a : value;
|
|
35
41
|
}), valueOptions.map(({
|
|
36
42
|
option
|
|
@@ -3,6 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import { convertDataToEntities } from 'rc-tree/lib/utils/treeUtil';
|
|
4
4
|
import { VALUE_SPLIT } from '../utils/commonUtil';
|
|
5
5
|
/** Lazy parse options data into conduct-able info to avoid perf issue in single mode */
|
|
6
|
+
|
|
6
7
|
export default ((options, fieldNames) => {
|
|
7
8
|
const cacheRef = React.useRef({
|
|
8
9
|
options: null,
|
|
@@ -18,13 +19,14 @@ export default ((options, fieldNames) => {
|
|
|
18
19
|
}),
|
|
19
20
|
processEntity: (entity, wrapper) => {
|
|
20
21
|
const pathKey = entity.nodes.map(node => node[fieldNames.value]).join(VALUE_SPLIT);
|
|
21
|
-
wrapper.pathKeyEntities[pathKey] = entity;
|
|
22
|
-
// Overwrite origin key.
|
|
22
|
+
wrapper.pathKeyEntities[pathKey] = entity; // Overwrite origin key.
|
|
23
23
|
// this is very hack but we need let conduct logic work with connect path
|
|
24
|
+
|
|
24
25
|
entity.key = pathKey;
|
|
25
26
|
}
|
|
26
27
|
});
|
|
27
28
|
}
|
|
29
|
+
|
|
28
30
|
return cacheRef.current.info.pathKeyEntities;
|
|
29
31
|
}, [fieldNames, options]);
|
|
30
32
|
return getEntities;
|
|
@@ -1,25 +1,30 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import warning from 'rc-util/lib/warning';
|
|
4
|
-
|
|
3
|
+
import warning from 'rc-util/lib/warning'; // Convert `showSearch` to unique config
|
|
4
|
+
|
|
5
5
|
export default function useSearchConfig(showSearch) {
|
|
6
6
|
return React.useMemo(() => {
|
|
7
7
|
if (!showSearch) {
|
|
8
8
|
return [false, {}];
|
|
9
9
|
}
|
|
10
|
+
|
|
10
11
|
let searchConfig = {
|
|
11
12
|
matchInputWidth: true,
|
|
12
13
|
limit: 50
|
|
13
14
|
};
|
|
15
|
+
|
|
14
16
|
if (showSearch && typeof showSearch === 'object') {
|
|
15
17
|
searchConfig = Object.assign(Object.assign({}, searchConfig), showSearch);
|
|
16
18
|
}
|
|
19
|
+
|
|
17
20
|
if (searchConfig.limit <= 0) {
|
|
18
21
|
delete searchConfig.limit;
|
|
22
|
+
|
|
19
23
|
if (process.env.NODE_ENV !== 'production') {
|
|
20
24
|
warning(false, "'limit' of showSearch should be positive number or false.");
|
|
21
25
|
}
|
|
22
26
|
}
|
|
27
|
+
|
|
23
28
|
return [true, searchConfig];
|
|
24
29
|
}, [showSearch]);
|
|
25
30
|
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export const SEARCH_MARK = '__rc_cascader_search_mark__';
|
|
3
|
+
|
|
3
4
|
const defaultFilter = (search, options, {
|
|
4
5
|
label
|
|
5
6
|
}) => options.some(opt => String(opt[label]).toLowerCase().includes(search.toLowerCase()));
|
|
7
|
+
|
|
6
8
|
const defaultRender = (inputValue, path, prefixCls, fieldNames) => path.map(opt => opt[fieldNames.label]).join(' / ');
|
|
9
|
+
|
|
7
10
|
export default ((search, options, fieldNames, prefixCls, config, changeOnSelect) => {
|
|
8
11
|
const {
|
|
9
12
|
filter = defaultFilter,
|
|
@@ -13,22 +16,23 @@ export default ((search, options, fieldNames, prefixCls, config, changeOnSelect)
|
|
|
13
16
|
} = config;
|
|
14
17
|
return React.useMemo(() => {
|
|
15
18
|
const filteredOptions = [];
|
|
19
|
+
|
|
16
20
|
if (!search) {
|
|
17
21
|
return [];
|
|
18
22
|
}
|
|
23
|
+
|
|
19
24
|
function dig(list, pathOptions) {
|
|
20
25
|
list.forEach(option => {
|
|
21
26
|
// Perf saving when `sort` is disabled and `limit` is provided
|
|
22
27
|
if (!sort && limit > 0 && filteredOptions.length >= limit) {
|
|
23
28
|
return;
|
|
24
29
|
}
|
|
30
|
+
|
|
25
31
|
const connectedPathOptions = [...pathOptions, option];
|
|
26
|
-
const children = option[fieldNames.children];
|
|
27
|
-
|
|
28
|
-
if (
|
|
29
|
-
// If is
|
|
30
|
-
!children || children.length === 0 ||
|
|
31
|
-
// If is changeOnSelect
|
|
32
|
+
const children = option[fieldNames.children]; // If current option is filterable
|
|
33
|
+
|
|
34
|
+
if ( // If is leaf option
|
|
35
|
+
!children || children.length === 0 || // If is changeOnSelect
|
|
32
36
|
changeOnSelect) {
|
|
33
37
|
if (filter(search, connectedPathOptions, {
|
|
34
38
|
label: fieldNames.label
|
|
@@ -39,18 +43,21 @@ export default ((search, options, fieldNames, prefixCls, config, changeOnSelect)
|
|
|
39
43
|
}));
|
|
40
44
|
}
|
|
41
45
|
}
|
|
46
|
+
|
|
42
47
|
if (children) {
|
|
43
48
|
dig(option[fieldNames.children], connectedPathOptions);
|
|
44
49
|
}
|
|
45
50
|
});
|
|
46
51
|
}
|
|
47
|
-
|
|
48
|
-
// Do sort
|
|
52
|
+
|
|
53
|
+
dig(options, []); // Do sort
|
|
54
|
+
|
|
49
55
|
if (sort) {
|
|
50
56
|
filteredOptions.sort((a, b) => {
|
|
51
57
|
return sort(a[SEARCH_MARK], b[SEARCH_MARK], search, fieldNames);
|
|
52
58
|
});
|
|
53
59
|
}
|
|
60
|
+
|
|
54
61
|
return limit > 0 ? filteredOptions.slice(0, limit) : filteredOptions;
|
|
55
62
|
}, [search, options, fieldNames, prefixCls, render, changeOnSelect, filter, sort, limit]);
|
|
56
63
|
});
|
|
@@ -25,16 +25,20 @@ export function fillFieldNames(fieldNames) {
|
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
27
|
export function isLeaf(option, fieldNames) {
|
|
28
|
-
var _a, _b;
|
|
29
|
-
|
|
28
|
+
var _a, _b; // @ts-ignore
|
|
29
|
+
|
|
30
|
+
|
|
30
31
|
return (_a = option.isLeaf) !== null && _a !== void 0 ? _a : !((_b = option[fieldNames.children]) === null || _b === void 0 ? void 0 : _b.length);
|
|
31
32
|
}
|
|
32
33
|
export function scrollIntoParentView(element) {
|
|
33
34
|
const parent = element.parentElement;
|
|
35
|
+
|
|
34
36
|
if (!parent) {
|
|
35
37
|
return;
|
|
36
38
|
}
|
|
39
|
+
|
|
37
40
|
const elementToParent = element.offsetTop - parent.offsetTop; // offsetParent may not be parent.
|
|
41
|
+
|
|
38
42
|
if (elementToParent - parent.scrollTop < 0) {
|
|
39
43
|
parent.scrollTo({
|
|
40
44
|
top: elementToParent
|
|
@@ -9,12 +9,13 @@ export function formatStrategyValues(pathKeys, getKeyPathEntities, showCheckedSt
|
|
|
9
9
|
return showCheckedStrategy === SHOW_CHILD ? !(children && children.some(child => child.key && valueSet.has(child.key))) : !(parent && !parent.node.disabled && valueSet.has(parent.key));
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
|
-
export function toPathOptions(valueCells, options, fieldNames,
|
|
13
|
-
// Used for loadingKeys which saved loaded keys as string
|
|
12
|
+
export function toPathOptions(valueCells, options, fieldNames, // Used for loadingKeys which saved loaded keys as string
|
|
14
13
|
stringMode = false) {
|
|
15
14
|
var _a;
|
|
15
|
+
|
|
16
16
|
let currentList = options;
|
|
17
17
|
const valueOptions = [];
|
|
18
|
+
|
|
18
19
|
for (let i = 0; i < valueCells.length; i += 1) {
|
|
19
20
|
const valueCell = valueCells[i];
|
|
20
21
|
const foundIndex = currentList === null || currentList === void 0 ? void 0 : currentList.findIndex(option => {
|
|
@@ -30,5 +31,6 @@ stringMode = false) {
|
|
|
30
31
|
});
|
|
31
32
|
currentList = foundOption === null || foundOption === void 0 ? void 0 : foundOption[fieldNames.children];
|
|
32
33
|
}
|
|
34
|
+
|
|
33
35
|
return valueOptions;
|
|
34
36
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
2
|
import warning from 'rc-util/lib/warning';
|
|
3
|
+
|
|
3
4
|
function warningProps(props) {
|
|
4
5
|
const {
|
|
5
6
|
onPopupVisibleChange,
|
|
@@ -11,22 +12,26 @@ function warningProps(props) {
|
|
|
11
12
|
warning(popupVisible === undefined, '`popupVisible` is deprecated. Please use `open` instead.');
|
|
12
13
|
warning(popupClassName === undefined, '`popupClassName` is deprecated. Please use `dropdownClassName` instead.');
|
|
13
14
|
warning(popupPlacement === undefined, '`popupPlacement` is deprecated. Please use `placement` instead.');
|
|
14
|
-
}
|
|
15
|
-
|
|
15
|
+
} // value in Cascader options should not be null
|
|
16
|
+
|
|
17
|
+
|
|
16
18
|
export function warningNullOptions(options, fieldNames) {
|
|
17
19
|
if (options) {
|
|
18
20
|
const recursiveOptions = optionsList => {
|
|
19
21
|
for (let i = 0; i < optionsList.length; i++) {
|
|
20
22
|
const option = optionsList[i];
|
|
23
|
+
|
|
21
24
|
if (option[fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value] === null) {
|
|
22
25
|
warning(false, '`value` in Cascader options should not be `null`.');
|
|
23
26
|
return true;
|
|
24
27
|
}
|
|
28
|
+
|
|
25
29
|
if (Array.isArray(option[fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children]) && recursiveOptions(option[fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children])) {
|
|
26
30
|
return true;
|
|
27
31
|
}
|
|
28
32
|
}
|
|
29
33
|
};
|
|
34
|
+
|
|
30
35
|
recursiveOptions(options);
|
|
31
36
|
}
|
|
32
37
|
}
|