tntd 2.0.14 → 2.0.16
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/context.js.map +1 -1
- 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 +29 -33
- package/es/table/table.js.map +1 -1
- package/es/table/table.less +5 -0
- 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.d.ts +0 -9
- package/lib/table/context.d.ts.map +1 -1
- package/lib/table/context.js +0 -2
- package/lib/table/context.js.map +1 -1
- 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.d.ts.map +1 -1
- package/lib/table/table.js +46 -77
- package/lib/table/table.js.map +1 -1
- package/lib/table/table.less +5 -0
- 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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/page/style/index.ts"],"names":[],"mappings":"","sourcesContent":[""]}
|
package/es/page/utils.js
CHANGED
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
const computeWidth = width => {
|
|
2
2
|
let flex = '1';
|
|
3
3
|
const validNumber = isValidNumber(width);
|
|
4
|
-
|
|
5
4
|
if (/(%|px)$/.test(width) && validNumber) {
|
|
6
5
|
flex = `0 0 ${width}`;
|
|
7
6
|
} else if (!isNaN(width)) {
|
|
8
7
|
flex = `0 0 ${width}px`;
|
|
9
8
|
}
|
|
10
|
-
|
|
11
9
|
return flex;
|
|
12
10
|
};
|
|
13
|
-
|
|
14
11
|
const isValidNumber = value => !isNaN(parseFloat(value));
|
|
15
|
-
|
|
16
12
|
const addUnitForValue = (value, unit = 'px') => !isNaN(value) ? `${value}${unit}` : value;
|
|
17
|
-
|
|
18
13
|
export { computeWidth, isValidNumber, addUnitForValue };
|
package/es/prev-locale.js
CHANGED
|
@@ -38,18 +38,15 @@ export const en_US = {
|
|
|
38
38
|
};
|
|
39
39
|
export const getText = (key, language = 'cn', ...params) => {
|
|
40
40
|
var _a;
|
|
41
|
-
|
|
42
41
|
const text = (_a = {
|
|
43
42
|
cn: zh_CN,
|
|
44
43
|
en: en_US
|
|
45
44
|
}[language] || zh_CN) === null || _a === void 0 ? void 0 : _a[key];
|
|
46
|
-
|
|
47
45
|
if (params === null || params === void 0 ? void 0 : params.length) {
|
|
48
46
|
return params.reduce((acc, cur) => {
|
|
49
47
|
return acc.replace(/%s/, cur);
|
|
50
48
|
}, text);
|
|
51
49
|
}
|
|
52
|
-
|
|
53
50
|
return text;
|
|
54
51
|
};
|
|
55
52
|
export const getLanguage = () => localStorage.getItem('lang') || 'cn';
|
|
@@ -1,23 +1,19 @@
|
|
|
1
1
|
var __rest = this && this.__rest || function (s, e) {
|
|
2
2
|
var t = {};
|
|
3
|
-
|
|
4
3
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
5
|
-
|
|
6
4
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
5
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
8
6
|
}
|
|
9
7
|
return t;
|
|
10
8
|
};
|
|
11
|
-
|
|
12
9
|
import React from 'react';
|
|
13
10
|
import Checkbox from '../../checkbox';
|
|
14
11
|
export default (_a => {
|
|
15
12
|
var {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
value,
|
|
14
|
+
onChange
|
|
15
|
+
} = _a,
|
|
16
|
+
props = __rest(_a, ["value", "onChange"]);
|
|
21
17
|
return React.createElement(Checkbox, Object.assign({}, props, {
|
|
22
18
|
checked: value,
|
|
23
19
|
onChange: evt => {
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
var __rest = this && this.__rest || function (s, e) {
|
|
2
2
|
var t = {};
|
|
3
|
-
|
|
4
3
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
5
|
-
|
|
6
4
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
5
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
8
6
|
}
|
|
9
7
|
return t;
|
|
10
8
|
};
|
|
11
|
-
|
|
12
9
|
import React, { useState, useEffect } from 'react';
|
|
13
10
|
import Select from '../../select';
|
|
14
11
|
const {
|
|
@@ -16,24 +13,21 @@ const {
|
|
|
16
13
|
} = Select;
|
|
17
14
|
export default (props => {
|
|
18
15
|
const {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
16
|
+
options,
|
|
17
|
+
params,
|
|
18
|
+
queryKey = 'name',
|
|
19
|
+
fieldNames = {
|
|
20
|
+
label: 'label',
|
|
21
|
+
value: 'value'
|
|
22
|
+
},
|
|
23
|
+
loadData
|
|
24
|
+
} = props,
|
|
25
|
+
rest = __rest(props, ["options", "params", "queryKey", "fieldNames", "loadData"]);
|
|
30
26
|
const [items, setItems] = useState(options || []);
|
|
31
27
|
const [query, setQuery] = useState('');
|
|
32
|
-
|
|
33
28
|
const onSearch = val => {
|
|
34
29
|
setQuery(val);
|
|
35
30
|
};
|
|
36
|
-
|
|
37
31
|
if (loadData) {
|
|
38
32
|
useEffect(() => {
|
|
39
33
|
loadData(Object.assign({
|
|
@@ -43,7 +37,6 @@ export default (props => {
|
|
|
43
37
|
});
|
|
44
38
|
}, [params, query]);
|
|
45
39
|
}
|
|
46
|
-
|
|
47
40
|
useEffect(() => {
|
|
48
41
|
setItems(options || []);
|
|
49
42
|
}, [options]);
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import _get from "lodash/get";
|
|
2
|
-
|
|
3
2
|
var __rest = this && this.__rest || function (s, e) {
|
|
4
3
|
var t = {};
|
|
5
|
-
|
|
6
4
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
7
|
-
|
|
8
5
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
9
6
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
10
7
|
}
|
|
11
8
|
return t;
|
|
12
9
|
};
|
|
13
|
-
|
|
14
10
|
import React, { useState, useEffect } from 'react';
|
|
15
11
|
import Select from '../../select';
|
|
16
12
|
import Input from '../../input';
|
|
@@ -19,38 +15,30 @@ const {
|
|
|
19
15
|
} = Select;
|
|
20
16
|
export default (props => {
|
|
21
17
|
const {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
options = [],
|
|
19
|
+
addonBeforeStyle
|
|
20
|
+
} = props,
|
|
21
|
+
inputProps = __rest(props, ["options", "addonBeforeStyle"]);
|
|
27
22
|
const [items, setItems] = useState(options);
|
|
28
|
-
|
|
29
23
|
const getInitialKey = () => {
|
|
30
24
|
let key = _get(options, '0.value');
|
|
31
|
-
|
|
32
25
|
if (inputProps.value) {
|
|
33
26
|
key = _get(Object.keys(inputProps.value), '0') || key;
|
|
34
27
|
}
|
|
35
|
-
|
|
36
28
|
return key;
|
|
37
29
|
};
|
|
38
|
-
|
|
39
30
|
const [key, setKey] = useState(getInitialKey());
|
|
40
|
-
|
|
41
31
|
const onKeyChange = key => {
|
|
42
32
|
setKey(key);
|
|
43
33
|
props.onChange({
|
|
44
34
|
[key]: ''
|
|
45
35
|
});
|
|
46
36
|
};
|
|
47
|
-
|
|
48
37
|
const onChange = evt => {
|
|
49
38
|
props.onChange({
|
|
50
39
|
[key]: evt.target.value
|
|
51
40
|
});
|
|
52
41
|
};
|
|
53
|
-
|
|
54
42
|
const addonBefore = React.createElement(Select, {
|
|
55
43
|
value: key,
|
|
56
44
|
onChange: onKeyChange,
|
|
@@ -64,11 +52,9 @@ export default (props => {
|
|
|
64
52
|
key: value,
|
|
65
53
|
value: value
|
|
66
54
|
}, label)));
|
|
67
|
-
|
|
68
55
|
const getInputValue = () => {
|
|
69
56
|
return _get(inputProps.value, key);
|
|
70
57
|
};
|
|
71
|
-
|
|
72
58
|
useEffect(() => {
|
|
73
59
|
setItems(options);
|
|
74
60
|
setKey(getInitialKey());
|
|
@@ -3,9 +3,7 @@ import React, { PureComponent } from 'react';
|
|
|
3
3
|
import fieldsMap, { getFieldWidth } from './fieldsMap';
|
|
4
4
|
import Form from '../../form';
|
|
5
5
|
const FormItem = Form.Item;
|
|
6
|
-
|
|
7
6
|
const isInput = type => ['input', 'string', 'search'].includes(type);
|
|
8
|
-
|
|
9
7
|
export default class Field extends PureComponent {
|
|
10
8
|
constructor(props) {
|
|
11
9
|
super(props);
|
|
@@ -36,12 +34,11 @@ export default class Field extends PureComponent {
|
|
|
36
34
|
const {
|
|
37
35
|
onChange
|
|
38
36
|
} = fieldProps || {};
|
|
39
|
-
onChange && onChange(...args);
|
|
40
|
-
|
|
37
|
+
onChange && onChange(...args);
|
|
38
|
+
// Input onChange第一个参数为Event对象,取值特殊处理
|
|
41
39
|
if (!component && isInput(type)) {
|
|
42
40
|
args[0] = _get(args[0], 'target.value');
|
|
43
41
|
}
|
|
44
|
-
|
|
45
42
|
this.setState({
|
|
46
43
|
value: args[0]
|
|
47
44
|
});
|
|
@@ -62,10 +59,8 @@ export default class Field extends PureComponent {
|
|
|
62
59
|
value: props.initialValue
|
|
63
60
|
};
|
|
64
61
|
}
|
|
65
|
-
|
|
66
62
|
render() {
|
|
67
63
|
var _a;
|
|
68
|
-
|
|
69
64
|
const {
|
|
70
65
|
type = 'input',
|
|
71
66
|
title,
|
|
@@ -88,7 +83,6 @@ export default class Field extends PureComponent {
|
|
|
88
83
|
}, isInput(type) ? {
|
|
89
84
|
onPressEnter: evt => {
|
|
90
85
|
var _a;
|
|
91
|
-
|
|
92
86
|
return form.emit('search', {
|
|
93
87
|
[name]: (_a = evt === null || evt === void 0 ? void 0 : evt.target) === null || _a === void 0 ? void 0 : _a.value,
|
|
94
88
|
current: 1
|
|
@@ -101,7 +95,6 @@ export default class Field extends PureComponent {
|
|
|
101
95
|
onChange: this.onChange
|
|
102
96
|
})));
|
|
103
97
|
}
|
|
104
|
-
|
|
105
98
|
componentDidMount() {
|
|
106
99
|
const {
|
|
107
100
|
form
|
|
@@ -109,7 +102,6 @@ export default class Field extends PureComponent {
|
|
|
109
102
|
form.on('setValue', this.updateValue);
|
|
110
103
|
form.on('setValues', this.onFormChange);
|
|
111
104
|
}
|
|
112
|
-
|
|
113
105
|
componentWillUnmount() {
|
|
114
106
|
const {
|
|
115
107
|
form
|
|
@@ -117,5 +109,4 @@ export default class Field extends PureComponent {
|
|
|
117
109
|
form.off('setValue', this.updateValue);
|
|
118
110
|
form.off('setValues', this.onFormChange);
|
|
119
111
|
}
|
|
120
|
-
|
|
121
112
|
}
|
|
@@ -11,37 +11,29 @@ export default (() => {
|
|
|
11
11
|
setData(key, value) {
|
|
12
12
|
_set(data, key, value);
|
|
13
13
|
},
|
|
14
|
-
|
|
15
14
|
getData(key) {
|
|
16
15
|
_get(data, key);
|
|
17
16
|
},
|
|
18
|
-
|
|
19
17
|
setValues(values) {
|
|
20
18
|
data.values = values;
|
|
21
19
|
eventEmitter.emit('setValues', values);
|
|
22
20
|
},
|
|
23
|
-
|
|
24
21
|
getValues() {
|
|
25
22
|
return data.values;
|
|
26
23
|
},
|
|
27
|
-
|
|
28
24
|
resetValues() {
|
|
29
25
|
data.values = Object.assign({}, data.initialValues);
|
|
30
26
|
eventEmitter.emit('setValues', data.values);
|
|
31
27
|
},
|
|
32
|
-
|
|
33
28
|
setValue(name, value) {
|
|
34
29
|
data.values = data.values || {};
|
|
35
30
|
data.values[name] = value;
|
|
36
31
|
eventEmitter.emit('setValue', name, value);
|
|
37
32
|
},
|
|
38
|
-
|
|
39
33
|
getValue(name) {
|
|
40
34
|
var _a;
|
|
41
|
-
|
|
42
35
|
return (_a = data.values) === null || _a === void 0 ? void 0 : _a[name];
|
|
43
36
|
},
|
|
44
|
-
|
|
45
37
|
on: (eventName, callback) => {
|
|
46
38
|
eventEmitter.on(eventName, callback);
|
|
47
39
|
},
|
package/es/query-form/index.js
CHANGED
|
@@ -12,7 +12,6 @@ import { getLanguage, getText } from '../prev-locale';
|
|
|
12
12
|
import Icon from '../tntd-icon';
|
|
13
13
|
import './index.less';
|
|
14
14
|
const clsPrefix = 'tnt-queryform';
|
|
15
|
-
|
|
16
15
|
class QueryForm extends React.PureComponent {
|
|
17
16
|
constructor(props) {
|
|
18
17
|
super(props);
|
|
@@ -24,7 +23,6 @@ class QueryForm extends React.PureComponent {
|
|
|
24
23
|
const {
|
|
25
24
|
current
|
|
26
25
|
} = this.fieldsRef;
|
|
27
|
-
|
|
28
26
|
if (current) {
|
|
29
27
|
setTimeout(() => {
|
|
30
28
|
this.setState({
|
|
@@ -48,7 +46,6 @@ class QueryForm extends React.PureComponent {
|
|
|
48
46
|
writable: true,
|
|
49
47
|
value: () => {
|
|
50
48
|
var _a, _b;
|
|
51
|
-
|
|
52
49
|
(_b = (_a = this.props).onSearch) === null || _b === void 0 ? void 0 : _b.call(_a, this.form.getValues());
|
|
53
50
|
}
|
|
54
51
|
});
|
|
@@ -72,7 +69,6 @@ class QueryForm extends React.PureComponent {
|
|
|
72
69
|
writable: true,
|
|
73
70
|
value: () => {
|
|
74
71
|
var _a, _b;
|
|
75
|
-
|
|
76
72
|
this.setState({
|
|
77
73
|
expanded: !this.state.expanded
|
|
78
74
|
});
|
|
@@ -121,18 +117,14 @@ class QueryForm extends React.PureComponent {
|
|
|
121
117
|
showFieldCount,
|
|
122
118
|
children
|
|
123
119
|
} = this.props;
|
|
124
|
-
|
|
125
120
|
if (showFieldCount) {
|
|
126
121
|
const drawerFieldsValueCount = children.reduce((acc, cur, index) => {
|
|
127
122
|
var _a;
|
|
128
|
-
|
|
129
123
|
if (index >= showFieldCount && (values === null || values === void 0 ? void 0 : values[(_a = cur === null || cur === void 0 ? void 0 : cur.props) === null || _a === void 0 ? void 0 : _a.name])) {
|
|
130
124
|
acc++;
|
|
131
125
|
}
|
|
132
|
-
|
|
133
126
|
return acc;
|
|
134
127
|
}, 0);
|
|
135
|
-
|
|
136
128
|
if (drawerFieldsValueCount !== this.state.drawerFieldsValueCount) {
|
|
137
129
|
this.setState({
|
|
138
130
|
drawerFieldsValueCount
|
|
@@ -150,7 +142,6 @@ class QueryForm extends React.PureComponent {
|
|
|
150
142
|
const {
|
|
151
143
|
current
|
|
152
144
|
} = this.fieldsRef;
|
|
153
|
-
|
|
154
145
|
if (current) {
|
|
155
146
|
const observer = new ResizeObserver(this.onWindowResize);
|
|
156
147
|
observer.observe(current);
|
|
@@ -181,7 +172,6 @@ class QueryForm extends React.PureComponent {
|
|
|
181
172
|
this.form.setData('initialValues', initialValues);
|
|
182
173
|
this.form.setData('values', Object.assign({}, initialValues));
|
|
183
174
|
}
|
|
184
|
-
|
|
185
175
|
render() {
|
|
186
176
|
const {
|
|
187
177
|
children,
|
|
@@ -201,7 +191,6 @@ class QueryForm extends React.PureComponent {
|
|
|
201
191
|
drawerVisible,
|
|
202
192
|
drawerFieldsValueCount
|
|
203
193
|
} = this.state;
|
|
204
|
-
|
|
205
194
|
const renderFormActions = renderActions || (() => React.createElement(React.Fragment, null, showFieldCount && React.createElement(Badge, {
|
|
206
195
|
count: drawerFieldsValueCount
|
|
207
196
|
}, React.createElement(Button, {
|
|
@@ -219,10 +208,8 @@ class QueryForm extends React.PureComponent {
|
|
|
219
208
|
onClick: this.onToggleExpand
|
|
220
209
|
}, this.getText(expanded ? 'collapse' : 'expand')), React.Children.map(children, child => {
|
|
221
210
|
var _a;
|
|
222
|
-
|
|
223
211
|
return child && ((_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.align) === 'right' && React.cloneElement(child);
|
|
224
212
|
})));
|
|
225
|
-
|
|
226
213
|
return React.createElement("div", {
|
|
227
214
|
ref: this.formBoxRef,
|
|
228
215
|
className: classnames(clsPrefix, {
|
|
@@ -238,7 +225,6 @@ class QueryForm extends React.PureComponent {
|
|
|
238
225
|
ref: this.fieldsRef
|
|
239
226
|
}, React.Children.map(children, (child, index) => {
|
|
240
227
|
var _a;
|
|
241
|
-
|
|
242
228
|
return child && ((_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.align) !== 'right' && (!showFieldCount || showFieldCount > index) && React.cloneElement(child, {
|
|
243
229
|
form: this.form,
|
|
244
230
|
initialValue: initialValues === null || initialValues === void 0 ? void 0 : initialValues[child.props.name],
|
|
@@ -275,16 +261,13 @@ class QueryForm extends React.PureComponent {
|
|
|
275
261
|
className: `${clsPrefix}-extra`
|
|
276
262
|
}, extraActions));
|
|
277
263
|
}
|
|
278
|
-
|
|
279
264
|
getText(key) {
|
|
280
265
|
return getText(key, this.props.language || getLanguage());
|
|
281
266
|
}
|
|
282
|
-
|
|
283
267
|
isFieldsWidthOverflow() {
|
|
284
268
|
const {
|
|
285
269
|
current
|
|
286
270
|
} = this.fieldsRef;
|
|
287
|
-
|
|
288
271
|
if (current) {
|
|
289
272
|
return parseFloat(window.getComputedStyle(current).width, 10) < [].reduce.call(current.children, (acc, cur) => {
|
|
290
273
|
const {
|
|
@@ -296,33 +279,25 @@ class QueryForm extends React.PureComponent {
|
|
|
296
279
|
return acc;
|
|
297
280
|
}, 0);
|
|
298
281
|
}
|
|
299
|
-
|
|
300
282
|
return false;
|
|
301
283
|
}
|
|
302
|
-
|
|
303
284
|
updateFieldHeight() {
|
|
304
285
|
var _a, _b, _c;
|
|
305
|
-
|
|
306
286
|
const {
|
|
307
287
|
formBoxRef,
|
|
308
288
|
fieldsRef
|
|
309
289
|
} = this;
|
|
310
|
-
|
|
311
290
|
const getFieldHeight = () => {
|
|
312
291
|
var _a;
|
|
313
|
-
|
|
314
292
|
const {
|
|
315
293
|
current
|
|
316
294
|
} = fieldsRef;
|
|
317
295
|
let height = '32px';
|
|
318
|
-
|
|
319
296
|
if (current && ((_a = current.children) === null || _a === void 0 ? void 0 : _a[0])) {
|
|
320
297
|
height = window.getComputedStyle(current.children[0]).height;
|
|
321
298
|
}
|
|
322
|
-
|
|
323
299
|
return height;
|
|
324
300
|
};
|
|
325
|
-
|
|
326
301
|
const queryFormActionsDom = (_a = formBoxRef === null || formBoxRef === void 0 ? void 0 : formBoxRef.current) === null || _a === void 0 ? void 0 : _a.querySelector(`.${clsPrefix}-actions`);
|
|
327
302
|
const queryFormExtraDom = (_b = formBoxRef === null || formBoxRef === void 0 ? void 0 : formBoxRef.current) === null || _b === void 0 ? void 0 : _b.querySelector(`.${clsPrefix}-extra`);
|
|
328
303
|
const formItemsDomList = (_c = fieldsRef === null || fieldsRef === void 0 ? void 0 : fieldsRef.current) === null || _c === void 0 ? void 0 : _c.querySelectorAll('.ant-form-item-control');
|
|
@@ -338,7 +313,6 @@ class QueryForm extends React.PureComponent {
|
|
|
338
313
|
item.style.lineHeight = fieldHeight;
|
|
339
314
|
});
|
|
340
315
|
}
|
|
341
|
-
|
|
342
316
|
componentDidMount() {
|
|
343
317
|
const {
|
|
344
318
|
current
|
|
@@ -348,20 +322,18 @@ class QueryForm extends React.PureComponent {
|
|
|
348
322
|
showExpand = true
|
|
349
323
|
} = this.props;
|
|
350
324
|
this.updateFieldHeight();
|
|
351
|
-
this.form.on('search', this.search);
|
|
325
|
+
this.form.on('search', this.search);
|
|
326
|
+
// 未设置第一行显示数量且禁止了展开操作 或 自定义了操作区域,则不需要处理展开计算逻辑
|
|
352
327
|
// || renderActions
|
|
353
|
-
|
|
354
328
|
if (!showFieldCount && !showExpand) {
|
|
355
329
|
return;
|
|
356
330
|
}
|
|
357
|
-
|
|
358
331
|
if (!showFieldCount) {
|
|
359
332
|
if (current && this.isFieldsWidthOverflow()) {
|
|
360
333
|
this.setState({
|
|
361
334
|
showMore: true
|
|
362
335
|
});
|
|
363
336
|
}
|
|
364
|
-
|
|
365
337
|
this.removeResizeListener = this.addResizeListener();
|
|
366
338
|
} else {
|
|
367
339
|
this.updateDrawerFieldsValueCount();
|
|
@@ -369,18 +341,14 @@ class QueryForm extends React.PureComponent {
|
|
|
369
341
|
this.form.on('setValue', this.updateDrawerFieldsValueCount);
|
|
370
342
|
}
|
|
371
343
|
}
|
|
372
|
-
|
|
373
344
|
componentWillUnmount() {
|
|
374
345
|
var _a;
|
|
375
|
-
|
|
376
346
|
(_a = this.removeResizeListener) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
377
347
|
this.form.off('setValues', this.updateDrawerFieldsValueCount);
|
|
378
348
|
this.form.off('setValue', this.updateDrawerFieldsValueCount);
|
|
379
349
|
this.form.off('search', this.search);
|
|
380
350
|
}
|
|
381
|
-
|
|
382
351
|
}
|
|
383
|
-
|
|
384
352
|
QueryForm.Field = Field;
|
|
385
353
|
QueryForm.useForm = useForm;
|
|
386
354
|
QueryForm.createForm = createActions;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/query-form/style/index.ts"],"names":[],"mappings":"","sourcesContent":[""]}
|
|
@@ -3,12 +3,9 @@ import _pickBy from "lodash/pickBy";
|
|
|
3
3
|
import _isEmpty from "lodash/isEmpty";
|
|
4
4
|
import _get from "lodash/get";
|
|
5
5
|
import _debounce from "lodash/debounce";
|
|
6
|
-
|
|
7
6
|
var __rest = this && this.__rest || function (s, e) {
|
|
8
7
|
var t = {};
|
|
9
|
-
|
|
10
8
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
11
|
-
|
|
12
9
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
13
10
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
14
11
|
}
|
|
@@ -18,8 +15,6 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
18
15
|
* @file QueryList
|
|
19
16
|
* @author you.zhang
|
|
20
17
|
*/
|
|
21
|
-
|
|
22
|
-
|
|
23
18
|
import cn from 'classnames';
|
|
24
19
|
import React, { createRef } from 'react';
|
|
25
20
|
import { findDOMNode } from 'react-dom';
|
|
@@ -29,7 +24,6 @@ import Table from '../table';
|
|
|
29
24
|
export default class QueryList extends React.PureComponent {
|
|
30
25
|
constructor(props) {
|
|
31
26
|
var _a;
|
|
32
|
-
|
|
33
27
|
super(props);
|
|
34
28
|
Object.defineProperty(this, "onWindowResize", {
|
|
35
29
|
enumerable: true,
|
|
@@ -67,22 +61,19 @@ export default class QueryList extends React.PureComponent {
|
|
|
67
61
|
pagination
|
|
68
62
|
} = this.state;
|
|
69
63
|
const hasPagination = this.props.pagination !== false;
|
|
70
|
-
|
|
71
64
|
if (hasPagination) {
|
|
72
65
|
params = Object.assign({
|
|
73
66
|
pageSize: pagination.pageSize,
|
|
74
67
|
current: pagination.current
|
|
75
68
|
}, params);
|
|
76
69
|
}
|
|
77
|
-
|
|
78
70
|
showLoading && this.setState({
|
|
79
71
|
loading: true
|
|
80
|
-
});
|
|
81
|
-
|
|
72
|
+
});
|
|
73
|
+
// 当用户操作查询还未得到服务端响应前,不要执行轮询请求时序问题导致覆盖
|
|
82
74
|
if (!isInterval) {
|
|
83
75
|
this.isFetching = true;
|
|
84
76
|
}
|
|
85
|
-
|
|
86
77
|
actions.setData('submittedFormData', params);
|
|
87
78
|
return query(_pickBy(params, val => val !== '' && val !== null && val !== undefined)).then(result => {
|
|
88
79
|
const dataSource = hasPagination ? result.data || [] : result;
|
|
@@ -150,8 +141,8 @@ export default class QueryList extends React.PureComponent {
|
|
|
150
141
|
callback,
|
|
151
142
|
showLoading = true
|
|
152
143
|
} = {}) => {
|
|
153
|
-
this.formData = Object.assign(Object.assign({}, this.formData), values);
|
|
154
|
-
|
|
144
|
+
this.formData = Object.assign(Object.assign({}, this.formData), values);
|
|
145
|
+
// this.props.actions.setData('formData', this.formData);
|
|
155
146
|
return this.fetchData(this.formData, {
|
|
156
147
|
callback,
|
|
157
148
|
showLoading
|
|
@@ -174,18 +165,17 @@ export default class QueryList extends React.PureComponent {
|
|
|
174
165
|
sorter: _isEmpty(sorter) ? undefined : sorter
|
|
175
166
|
};
|
|
176
167
|
console.log('onTableChange...', actions.getSubmittedFormData(), this.formData);
|
|
177
|
-
Object.assign(this.formData, tableParams);
|
|
168
|
+
Object.assign(this.formData, tableParams);
|
|
169
|
+
// 排序变化暂时不处理,因为有时可能是前端sorter不需要走请求
|
|
178
170
|
// 所以暂时排序有使用者自己处理
|
|
179
|
-
|
|
180
171
|
if (!localPagination) {
|
|
181
172
|
this.fetchData(Object.assign(Object.assign({}, actions.getSubmittedFormData()), tableParams));
|
|
182
173
|
return;
|
|
183
174
|
}
|
|
184
|
-
|
|
185
175
|
const {
|
|
186
176
|
dataSource
|
|
187
|
-
} = this.state;
|
|
188
|
-
|
|
177
|
+
} = this.state;
|
|
178
|
+
// 前端本地分页
|
|
189
179
|
if (localPagination) {
|
|
190
180
|
this.setState({
|
|
191
181
|
dataSource,
|
|
@@ -223,7 +213,6 @@ export default class QueryList extends React.PureComponent {
|
|
|
223
213
|
} = tableBody;
|
|
224
214
|
return scrollHeight === scrollTop + offsetHeight;
|
|
225
215
|
};
|
|
226
|
-
|
|
227
216
|
this.setState({
|
|
228
217
|
hasScrollToBottom: isScrollToBottom(tableBody)
|
|
229
218
|
});
|
|
@@ -249,20 +238,18 @@ export default class QueryList extends React.PureComponent {
|
|
|
249
238
|
actions.on('setPagination', this.updatePagination);
|
|
250
239
|
actions.on('setFormData', this.onFormChange);
|
|
251
240
|
}
|
|
252
|
-
|
|
253
241
|
render() {
|
|
254
242
|
const _a = this.props,
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
243
|
+
{
|
|
244
|
+
columns,
|
|
245
|
+
children,
|
|
246
|
+
pagination,
|
|
247
|
+
localPagination = false,
|
|
248
|
+
paginationSticky = false,
|
|
249
|
+
className = '',
|
|
250
|
+
qlsProps
|
|
251
|
+
} = _a,
|
|
252
|
+
rest = __rest(_a, ["columns", "children", "pagination", "localPagination", "paginationSticky", "className", "qlsProps"]);
|
|
266
253
|
const {
|
|
267
254
|
dataSource,
|
|
268
255
|
loading,
|
|
@@ -299,16 +286,13 @@ export default class QueryList extends React.PureComponent {
|
|
|
299
286
|
onChange: this.onTableChange
|
|
300
287
|
}), !columns && children)));
|
|
301
288
|
}
|
|
302
|
-
|
|
303
289
|
componentDidMount() {
|
|
304
290
|
var _a;
|
|
305
|
-
|
|
306
291
|
const {
|
|
307
292
|
qlsProps,
|
|
308
293
|
actions
|
|
309
294
|
} = this.props;
|
|
310
295
|
this.formData = Object.assign(Object.assign({}, actions.getFormData() || {}), qlsProps.memory ? actions.getPagination() : {});
|
|
311
|
-
|
|
312
296
|
if (!qlsProps.initSearch) {
|
|
313
297
|
// 默认进来不请求
|
|
314
298
|
this.fetchData(this.formData).finally(() => {
|
|
@@ -332,15 +316,12 @@ export default class QueryList extends React.PureComponent {
|
|
|
332
316
|
}, ms);
|
|
333
317
|
}
|
|
334
318
|
};
|
|
335
|
-
|
|
336
319
|
doIntervalQuery(qlsProps.interval);
|
|
337
320
|
}
|
|
338
321
|
});
|
|
339
322
|
}
|
|
340
|
-
|
|
341
323
|
if ((_a = this.state.scroll) === null || _a === void 0 ? void 0 : _a.y) {
|
|
342
324
|
window.addEventListener('resize', this.onWindowResize);
|
|
343
|
-
|
|
344
325
|
if (this.tableRef.current) {
|
|
345
326
|
// table内垂直滚动,需要动态设置分页组件上阴影样式
|
|
346
327
|
const tableBody = findDOMNode(this.tableRef.current).querySelector('.ant-table-body');
|
|
@@ -350,7 +331,6 @@ export default class QueryList extends React.PureComponent {
|
|
|
350
331
|
}
|
|
351
332
|
}
|
|
352
333
|
}
|
|
353
|
-
|
|
354
334
|
componentWillUnmount() {
|
|
355
335
|
const {
|
|
356
336
|
actions
|
|
@@ -363,5 +343,4 @@ export default class QueryList extends React.PureComponent {
|
|
|
363
343
|
window.removeEventListener('resize', this.onWindowResize);
|
|
364
344
|
this.timmer && clearTimeout(this.timmer);
|
|
365
345
|
}
|
|
366
|
-
|
|
367
346
|
}
|