tntd 2.7.22 → 2.7.24
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/_util/motion.js +16 -0
- package/es/_util/motion.js.map +1 -0
- package/es/_util/type.js +4 -0
- package/es/_util/type.js.map +1 -0
- package/es/_util/warning.js +6 -0
- package/es/_util/warning.js.map +1 -0
- package/es/button/button.js +8 -0
- package/es/button/button.js.map +1 -1
- package/es/handle/handle.js +102 -0
- package/es/handle/handle.js.map +1 -0
- package/es/index.js +1 -0
- package/es/index.js.map +1 -1
- package/es/locale/en_US.js +6 -3
- package/es/locale/en_US.js.map +1 -1
- package/es/locale/zh_CN.js +4 -1
- package/es/locale/zh_CN.js.map +1 -1
- package/es/mention/index.js +4 -0
- package/es/mention/index.js.map +1 -0
- package/es/prev-locale.js +1 -1
- package/es/prev-locale.js.map +1 -1
- package/es/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +1 -1
- package/es/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js.map +1 -1
- package/es/tntd-form/TntdForm/components/Item.js +55 -0
- package/es/tntd-form/TntdForm/components/Item.js.map +1 -0
- package/es/tntd-form/TntdForm/components/ItemComp.js +186 -0
- package/es/tntd-form/TntdForm/components/ItemComp.js.map +1 -0
- package/es/tntd-form/TntdForm/components/List.js +102 -0
- package/es/tntd-form/TntdForm/components/List.js.map +1 -0
- package/es/tntd-form/TntdForm/index.js +55 -0
- package/es/tntd-form/TntdForm/index.js.map +1 -0
- package/es/tntd-form/TntdForm/interface.js +1 -0
- package/es/tntd-form/TntdForm/interface.js.map +1 -0
- package/es/tntd-form/TntdForm/store.js +2 -0
- package/es/tntd-form/TntdForm/store.js.map +1 -0
- package/es/tntd-form/TntdForm/utils.js +219 -0
- package/es/tntd-form/TntdForm/utils.js.map +1 -0
- package/es/tntd-rc-select/_util/DisabledContext.js +8 -0
- package/es/tntd-rc-select/_util/DisabledContext.js.map +1 -0
- package/es/tntd-rc-select/_util/FormItemInputContext.js +3 -0
- package/es/tntd-rc-select/_util/FormItemInputContext.js.map +1 -0
- package/es/tntd-rc-select/_util/PurePanel.js +55 -0
- package/es/tntd-rc-select/_util/PurePanel.js.map +1 -0
- package/es/tntd-rc-select/_util/SizeContext.js +3 -0
- package/es/tntd-rc-select/_util/SizeContext.js.map +1 -0
- package/es/tntd-rc-select/_util/context.js +14 -0
- package/es/tntd-rc-select/_util/context.js.map +1 -0
- package/es/tntd-rc-select/_util/defaultRenderEmpty.js +20 -0
- package/es/tntd-rc-select/_util/defaultRenderEmpty.js.map +1 -0
- package/es/tntd-rc-select/_util/getIcons.js +52 -0
- package/es/tntd-rc-select/_util/getIcons.js.map +1 -0
- package/es/tntd-rc-select/_util/interface.js +5 -0
- package/es/tntd-rc-select/_util/interface.js.map +1 -0
- package/es/tntd-rc-select/_util/motion.js +38 -0
- package/es/tntd-rc-select/_util/motion.js.map +1 -0
- package/es/tntd-rc-select/_util/type.js +4 -0
- package/es/tntd-rc-select/_util/type.js.map +1 -0
- package/es/tntd-rc-select/_util/useCompactItemContext.js +24 -0
- package/es/tntd-rc-select/_util/useCompactItemContext.js.map +1 -0
- package/es/tntd-rc-select/_util/warning.js +15 -0
- package/es/tntd-rc-select/_util/warning.js.map +1 -0
- package/es/tntd-rc-select/img/no-data-s.png +0 -0
- package/es/tntd-rc-select/index.js +103 -0
- package/es/tntd-rc-select/index.js.map +1 -0
- package/es/tntd-rc-select/style/index.less +1657 -0
- package/es/tntd-select/_util/DisabledContext.js +8 -0
- package/es/tntd-select/_util/DisabledContext.js.map +1 -0
- package/es/tntd-select/_util/FormItemInputContext.js +3 -0
- package/es/tntd-select/_util/FormItemInputContext.js.map +1 -0
- package/es/tntd-select/_util/PurePanel.js +55 -0
- package/es/tntd-select/_util/PurePanel.js.map +1 -0
- package/es/tntd-select/_util/SizeContext.js +3 -0
- package/es/tntd-select/_util/SizeContext.js.map +1 -0
- package/es/tntd-select/_util/context.js +14 -0
- package/es/tntd-select/_util/context.js.map +1 -0
- package/es/tntd-select/_util/defaultRenderEmpty.js +20 -0
- package/es/tntd-select/_util/defaultRenderEmpty.js.map +1 -0
- package/es/tntd-select/_util/getIcons.js +52 -0
- package/es/tntd-select/_util/getIcons.js.map +1 -0
- package/es/tntd-select/_util/interface.js +5 -0
- package/es/tntd-select/_util/interface.js.map +1 -0
- package/es/tntd-select/_util/motion.js +38 -0
- package/es/tntd-select/_util/motion.js.map +1 -0
- package/es/tntd-select/_util/type.js +4 -0
- package/es/tntd-select/_util/type.js.map +1 -0
- package/es/tntd-select/_util/useCompactItemContext.js +24 -0
- package/es/tntd-select/_util/useCompactItemContext.js.map +1 -0
- package/es/tntd-select/_util/warning.js +15 -0
- package/es/tntd-select/_util/warning.js.map +1 -0
- package/es/tntd-select/index.js +7 -1
- package/es/tntd-select/index.js.map +1 -1
- package/es/tntd-select/rc-select/BaseSelect.js +429 -0
- package/es/tntd-select/rc-select/BaseSelect.js.map +1 -0
- package/es/tntd-select/rc-select/OptGroup.js +5 -0
- package/es/tntd-select/rc-select/OptGroup.js.map +1 -0
- package/es/tntd-select/rc-select/Option.js +5 -0
- package/es/tntd-select/rc-select/Option.js.map +1 -0
- package/es/tntd-select/rc-select/OptionList.js +257 -0
- package/es/tntd-select/rc-select/OptionList.js.map +1 -0
- package/es/tntd-select/rc-select/Select.js +428 -0
- package/es/tntd-select/rc-select/Select.js.map +1 -0
- package/es/tntd-select/rc-select/SelectContext.js +4 -0
- package/es/tntd-select/rc-select/SelectContext.js.map +1 -0
- package/es/tntd-select/rc-select/SelectTrigger.js +91 -0
- package/es/tntd-select/rc-select/SelectTrigger.js.map +1 -0
- package/es/tntd-select/rc-select/Selector/Input.js +47 -0
- package/es/tntd-select/rc-select/Selector/Input.js.map +1 -0
- package/es/tntd-select/rc-select/Selector/MultipleSelector.js +97 -0
- package/es/tntd-select/rc-select/Selector/MultipleSelector.js.map +1 -0
- package/es/tntd-select/rc-select/Selector/SingleSelector.js +45 -0
- package/es/tntd-select/rc-select/Selector/SingleSelector.js.map +1 -0
- package/es/tntd-select/rc-select/Selector/index.js +136 -0
- package/es/tntd-select/rc-select/Selector/index.js.map +1 -0
- package/es/tntd-select/rc-select/TransBtn.js +22 -0
- package/es/tntd-select/rc-select/TransBtn.js.map +1 -0
- package/es/tntd-select/rc-select/hooks/useAllowClear.js +25 -0
- package/es/tntd-select/rc-select/hooks/useAllowClear.js.map +1 -0
- package/es/tntd-select/rc-select/hooks/useBaseProps.js +10 -0
- package/es/tntd-select/rc-select/hooks/useBaseProps.js.map +1 -0
- package/es/tntd-select/rc-select/hooks/useCache.js +34 -0
- package/es/tntd-select/rc-select/hooks/useCache.js.map +1 -0
- package/es/tntd-select/rc-select/hooks/useDelayReset.js +24 -0
- package/es/tntd-select/rc-select/hooks/useDelayReset.js.map +1 -0
- package/es/tntd-select/rc-select/hooks/useFilterOptions.js +55 -0
- package/es/tntd-select/rc-select/hooks/useFilterOptions.js.map +1 -0
- package/es/tntd-select/rc-select/hooks/useId.js +28 -0
- package/es/tntd-select/rc-select/hooks/useId.js.map +1 -0
- package/es/tntd-select/rc-select/hooks/useLayoutEffect.js +18 -0
- package/es/tntd-select/rc-select/hooks/useLayoutEffect.js.map +1 -0
- package/es/tntd-select/rc-select/hooks/useLock.js +26 -0
- package/es/tntd-select/rc-select/hooks/useLock.js.map +1 -0
- package/es/tntd-select/rc-select/hooks/useOptions.js +45 -0
- package/es/tntd-select/rc-select/hooks/useOptions.js.map +1 -0
- package/es/tntd-select/rc-select/hooks/useRefFunc.js +14 -0
- package/es/tntd-select/rc-select/hooks/useRefFunc.js.map +1 -0
- package/es/tntd-select/rc-select/hooks/useSelectTriggerControl.js +32 -0
- package/es/tntd-select/rc-select/hooks/useSelectTriggerControl.js.map +1 -0
- package/es/tntd-select/rc-select/index.js +8 -0
- package/es/tntd-select/rc-select/index.js.map +1 -0
- package/es/tntd-select/rc-select/interface.js +2 -0
- package/es/tntd-select/rc-select/interface.js.map +1 -0
- package/es/tntd-select/rc-select/utils/commonUtil.js +32 -0
- package/es/tntd-select/rc-select/utils/commonUtil.js.map +1 -0
- package/es/tntd-select/rc-select/utils/keyUtil.js +34 -0
- package/es/tntd-select/rc-select/utils/keyUtil.js.map +1 -0
- package/es/tntd-select/rc-select/utils/legacyUtil.js +32 -0
- package/es/tntd-select/rc-select/utils/legacyUtil.js.map +1 -0
- package/es/tntd-select/rc-select/utils/platformUtil.js +5 -0
- package/es/tntd-select/rc-select/utils/platformUtil.js.map +1 -0
- package/es/tntd-select/rc-select/utils/valueUtil.js +99 -0
- package/es/tntd-select/rc-select/utils/valueUtil.js.map +1 -0
- package/es/tntd-select/rc-select/utils/warningPropsUtil.js +100 -0
- package/es/tntd-select/rc-select/utils/warningPropsUtil.js.map +1 -0
- package/lib/_util/motion.d.ts +6 -0
- package/lib/_util/motion.d.ts.map +1 -0
- package/lib/_util/motion.js +20 -0
- package/lib/_util/motion.js.map +1 -0
- package/lib/_util/type.d.ts +4 -0
- package/lib/_util/type.d.ts.map +1 -0
- package/lib/_util/type.js +9 -0
- package/lib/_util/type.js.map +1 -0
- package/lib/_util/warning.d.ts +5 -0
- package/lib/_util/warning.d.ts.map +1 -0
- package/lib/_util/warning.js +32 -0
- package/lib/_util/warning.js.map +1 -0
- package/lib/button/button.d.ts.map +1 -1
- package/lib/button/button.js +8 -0
- package/lib/button/button.js.map +1 -1
- package/lib/handle/handle.d.ts +3 -0
- package/lib/handle/handle.d.ts.map +1 -0
- package/lib/handle/handle.js +130 -0
- package/lib/handle/handle.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -1
- package/lib/index.js.map +1 -1
- package/lib/locale/default.d.ts +4 -1
- package/lib/locale/default.d.ts.map +1 -1
- package/lib/locale/en_US.d.ts +4 -1
- package/lib/locale/en_US.d.ts.map +1 -1
- package/lib/locale/en_US.js +6 -3
- package/lib/locale/en_US.js.map +1 -1
- package/lib/locale/zh_CN.d.ts +4 -1
- package/lib/locale/zh_CN.d.ts.map +1 -1
- package/lib/locale/zh_CN.js +4 -1
- package/lib/locale/zh_CN.js.map +1 -1
- package/lib/mention/index.js +25 -0
- package/lib/prev-locale.js +1 -1
- package/lib/prev-locale.js.map +1 -1
- package/lib/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +1 -1
- package/lib/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js.map +1 -1
- package/lib/tntd-form/TntdForm/components/Item.js +65 -0
- package/lib/tntd-form/TntdForm/components/ItemComp.js +215 -0
- package/lib/tntd-form/TntdForm/components/List.js +123 -0
- package/lib/tntd-form/TntdForm/index.js +72 -0
- package/lib/tntd-form/TntdForm/interface.js +5 -0
- package/lib/tntd-form/TntdForm/store.js +10 -0
- package/lib/tntd-form/TntdForm/utils.js +239 -0
- package/lib/tntd-rc-select/_util/DisabledContext.d.ts +10 -0
- package/lib/tntd-rc-select/_util/DisabledContext.d.ts.map +1 -0
- package/lib/tntd-rc-select/_util/DisabledContext.js +35 -0
- package/lib/tntd-rc-select/_util/DisabledContext.js.map +1 -0
- package/lib/tntd-rc-select/_util/FormItemInputContext.d.ts +4 -0
- package/lib/tntd-rc-select/_util/FormItemInputContext.d.ts.map +1 -0
- package/lib/tntd-rc-select/_util/FormItemInputContext.js +29 -0
- package/lib/tntd-rc-select/_util/FormItemInputContext.js.map +1 -0
- package/lib/tntd-rc-select/_util/PurePanel.d.ts +9 -0
- package/lib/tntd-rc-select/_util/PurePanel.d.ts.map +1 -0
- package/lib/tntd-rc-select/_util/PurePanel.js +84 -0
- package/lib/tntd-rc-select/_util/PurePanel.js.map +1 -0
- package/lib/tntd-rc-select/_util/SizeContext.d.ts +4 -0
- package/lib/tntd-rc-select/_util/SizeContext.d.ts.map +1 -0
- package/lib/tntd-rc-select/_util/SizeContext.js +29 -0
- package/lib/tntd-rc-select/_util/SizeContext.js.map +1 -0
- package/lib/tntd-rc-select/_util/context.d.ts +42 -0
- package/lib/tntd-rc-select/_util/context.d.ts.map +1 -0
- package/lib/tntd-rc-select/_util/context.js +20 -0
- package/lib/tntd-rc-select/_util/context.js.map +1 -0
- package/lib/tntd-rc-select/_util/defaultRenderEmpty.d.ts +5 -0
- package/lib/tntd-rc-select/_util/defaultRenderEmpty.d.ts.map +1 -0
- package/lib/tntd-rc-select/_util/defaultRenderEmpty.js +48 -0
- package/lib/tntd-rc-select/_util/defaultRenderEmpty.js.map +1 -0
- package/lib/tntd-rc-select/_util/getIcons.d.ts +25 -0
- package/lib/tntd-rc-select/_util/getIcons.d.ts.map +1 -0
- package/lib/tntd-rc-select/_util/getIcons.js +78 -0
- package/lib/tntd-rc-select/_util/getIcons.js.map +1 -0
- package/lib/tntd-rc-select/_util/interface.d.ts +25 -0
- package/lib/tntd-rc-select/_util/interface.d.ts.map +1 -0
- package/lib/tntd-rc-select/_util/interface.js +9 -0
- package/lib/tntd-rc-select/_util/interface.js.map +1 -0
- package/lib/tntd-rc-select/_util/motion.d.ts +9 -0
- package/lib/tntd-rc-select/_util/motion.d.ts.map +1 -0
- package/lib/tntd-rc-select/_util/motion.js +42 -0
- package/lib/tntd-rc-select/_util/motion.js.map +1 -0
- package/lib/tntd-rc-select/_util/type.d.ts +10 -0
- package/lib/tntd-rc-select/_util/type.d.ts.map +1 -0
- package/lib/tntd-rc-select/_util/type.js +9 -0
- package/lib/tntd-rc-select/_util/type.js.map +1 -0
- package/lib/tntd-rc-select/_util/useCompactItemContext.d.ts +9 -0
- package/lib/tntd-rc-select/_util/useCompactItemContext.d.ts.map +1 -0
- package/lib/tntd-rc-select/_util/useCompactItemContext.js +54 -0
- package/lib/tntd-rc-select/_util/useCompactItemContext.js.map +1 -0
- package/lib/tntd-rc-select/_util/warning.d.ts +4 -0
- package/lib/tntd-rc-select/_util/warning.d.ts.map +1 -0
- package/lib/tntd-rc-select/_util/warning.js +40 -0
- package/lib/tntd-rc-select/_util/warning.js.map +1 -0
- package/lib/tntd-rc-select/img/no-data-s.png +0 -0
- package/lib/tntd-rc-select/index.d.ts +44 -0
- package/lib/tntd-rc-select/index.d.ts.map +1 -0
- package/lib/tntd-rc-select/index.js +131 -0
- package/lib/tntd-rc-select/index.js.map +1 -0
- package/lib/tntd-rc-select/style/index.less +1657 -0
- package/lib/tntd-select/_util/DisabledContext.d.ts +10 -0
- package/lib/tntd-select/_util/DisabledContext.d.ts.map +1 -0
- package/lib/tntd-select/_util/DisabledContext.js +35 -0
- package/lib/tntd-select/_util/DisabledContext.js.map +1 -0
- package/lib/tntd-select/_util/FormItemInputContext.d.ts +4 -0
- package/lib/tntd-select/_util/FormItemInputContext.d.ts.map +1 -0
- package/lib/tntd-select/_util/FormItemInputContext.js +29 -0
- package/lib/tntd-select/_util/FormItemInputContext.js.map +1 -0
- package/lib/tntd-select/_util/PurePanel.d.ts +9 -0
- package/lib/tntd-select/_util/PurePanel.d.ts.map +1 -0
- package/lib/tntd-select/_util/PurePanel.js +84 -0
- package/lib/tntd-select/_util/PurePanel.js.map +1 -0
- package/lib/tntd-select/_util/SizeContext.d.ts +4 -0
- package/lib/tntd-select/_util/SizeContext.d.ts.map +1 -0
- package/lib/tntd-select/_util/SizeContext.js +29 -0
- package/lib/tntd-select/_util/SizeContext.js.map +1 -0
- package/lib/tntd-select/_util/context.d.ts +42 -0
- package/lib/tntd-select/_util/context.d.ts.map +1 -0
- package/lib/tntd-select/_util/context.js +20 -0
- package/lib/tntd-select/_util/context.js.map +1 -0
- package/lib/tntd-select/_util/defaultRenderEmpty.d.ts +5 -0
- package/lib/tntd-select/_util/defaultRenderEmpty.d.ts.map +1 -0
- package/lib/tntd-select/_util/defaultRenderEmpty.js +48 -0
- package/lib/tntd-select/_util/defaultRenderEmpty.js.map +1 -0
- package/lib/tntd-select/_util/getIcons.d.ts +25 -0
- package/lib/tntd-select/_util/getIcons.d.ts.map +1 -0
- package/lib/tntd-select/_util/getIcons.js +78 -0
- package/lib/tntd-select/_util/getIcons.js.map +1 -0
- package/lib/tntd-select/_util/interface.d.ts +25 -0
- package/lib/tntd-select/_util/interface.d.ts.map +1 -0
- package/lib/tntd-select/_util/interface.js +9 -0
- package/lib/tntd-select/_util/interface.js.map +1 -0
- package/lib/tntd-select/_util/motion.d.ts +9 -0
- package/lib/tntd-select/_util/motion.d.ts.map +1 -0
- package/lib/tntd-select/_util/motion.js +42 -0
- package/lib/tntd-select/_util/motion.js.map +1 -0
- package/lib/tntd-select/_util/type.d.ts +10 -0
- package/lib/tntd-select/_util/type.d.ts.map +1 -0
- package/lib/tntd-select/_util/type.js +9 -0
- package/lib/tntd-select/_util/type.js.map +1 -0
- package/lib/tntd-select/_util/useCompactItemContext.d.ts +9 -0
- package/lib/tntd-select/_util/useCompactItemContext.d.ts.map +1 -0
- package/lib/tntd-select/_util/useCompactItemContext.js +54 -0
- package/lib/tntd-select/_util/useCompactItemContext.js.map +1 -0
- package/lib/tntd-select/_util/warning.d.ts +4 -0
- package/lib/tntd-select/_util/warning.d.ts.map +1 -0
- package/lib/tntd-select/_util/warning.js +40 -0
- package/lib/tntd-select/_util/warning.js.map +1 -0
- package/lib/tntd-select/index.d.ts.map +1 -1
- package/lib/tntd-select/index.js +7 -1
- package/lib/tntd-select/index.js.map +1 -1
- package/lib/tntd-select/rc-select/BaseSelect.d.ts +114 -0
- package/lib/tntd-select/rc-select/BaseSelect.d.ts.map +1 -0
- package/lib/tntd-select/rc-select/BaseSelect.js +459 -0
- package/lib/tntd-select/rc-select/BaseSelect.js.map +1 -0
- package/lib/tntd-select/rc-select/OptGroup.d.ts +13 -0
- package/lib/tntd-select/rc-select/OptGroup.d.ts.map +1 -0
- package/lib/tntd-select/rc-select/OptGroup.js +7 -0
- package/lib/tntd-select/rc-select/OptGroup.js.map +1 -0
- package/lib/tntd-select/rc-select/Option.d.ts +15 -0
- package/lib/tntd-select/rc-select/Option.d.ts.map +1 -0
- package/lib/tntd-select/rc-select/Option.js +7 -0
- package/lib/tntd-select/rc-select/Option.js.map +1 -0
- package/lib/tntd-select/rc-select/OptionList.d.ts +11 -0
- package/lib/tntd-select/rc-select/OptionList.d.ts.map +1 -0
- package/lib/tntd-select/rc-select/OptionList.js +285 -0
- package/lib/tntd-select/rc-select/OptionList.js.map +1 -0
- package/lib/tntd-select/rc-select/Select.d.ts +115 -0
- package/lib/tntd-select/rc-select/Select.d.ts.map +1 -0
- package/lib/tntd-select/rc-select/Select.js +456 -0
- package/lib/tntd-select/rc-select/Select.js.map +1 -0
- package/lib/tntd-select/rc-select/SelectContext.d.ts +23 -0
- package/lib/tntd-select/rc-select/SelectContext.d.ts.map +1 -0
- package/lib/tntd-select/rc-select/SelectContext.js +29 -0
- package/lib/tntd-select/rc-select/SelectContext.js.map +1 -0
- package/lib/tntd-select/rc-select/SelectTrigger.d.ts +31 -0
- package/lib/tntd-select/rc-select/SelectTrigger.d.ts.map +1 -0
- package/lib/tntd-select/rc-select/SelectTrigger.js +119 -0
- package/lib/tntd-select/rc-select/SelectTrigger.js.map +1 -0
- package/lib/tntd-select/rc-select/Selector/Input.d.ts +27 -0
- package/lib/tntd-select/rc-select/Selector/Input.d.ts.map +1 -0
- package/lib/tntd-select/rc-select/Selector/Input.js +75 -0
- package/lib/tntd-select/rc-select/Selector/Input.js.map +1 -0
- package/lib/tntd-select/rc-select/Selector/MultipleSelector.d.ts +17 -0
- package/lib/tntd-select/rc-select/Selector/MultipleSelector.d.ts.map +1 -0
- package/lib/tntd-select/rc-select/Selector/MultipleSelector.js +125 -0
- package/lib/tntd-select/rc-select/Selector/MultipleSelector.js.map +1 -0
- package/lib/tntd-select/rc-select/Selector/SingleSelector.d.ts +9 -0
- package/lib/tntd-select/rc-select/Selector/SingleSelector.d.ts.map +1 -0
- package/lib/tntd-select/rc-select/Selector/SingleSelector.js +73 -0
- package/lib/tntd-select/rc-select/Selector/SingleSelector.js.map +1 -0
- package/lib/tntd-select/rc-select/Selector/index.d.ts +83 -0
- package/lib/tntd-select/rc-select/Selector/index.d.ts.map +1 -0
- package/lib/tntd-select/rc-select/Selector/index.js +164 -0
- package/lib/tntd-select/rc-select/Selector/index.js.map +1 -0
- package/lib/tntd-select/rc-select/TransBtn.d.ts +13 -0
- package/lib/tntd-select/rc-select/TransBtn.d.ts.map +1 -0
- package/lib/tntd-select/rc-select/TransBtn.js +50 -0
- package/lib/tntd-select/rc-select/TransBtn.js.map +1 -0
- package/lib/tntd-select/rc-select/hooks/useAllowClear.d.ts +9 -0
- package/lib/tntd-select/rc-select/hooks/useAllowClear.d.ts.map +1 -0
- package/lib/tntd-select/rc-select/hooks/useAllowClear.js +32 -0
- package/lib/tntd-select/rc-select/hooks/useAllowClear.js.map +1 -0
- package/lib/tntd-select/rc-select/hooks/useBaseProps.d.ts +14 -0
- package/lib/tntd-select/rc-select/hooks/useBaseProps.d.ts.map +1 -0
- package/lib/tntd-select/rc-select/hooks/useBaseProps.js +37 -0
- package/lib/tntd-select/rc-select/hooks/useBaseProps.js.map +1 -0
- package/lib/tntd-select/rc-select/hooks/useCache.d.ts +8 -0
- package/lib/tntd-select/rc-select/hooks/useCache.d.ts.map +1 -0
- package/lib/tntd-select/rc-select/hooks/useCache.js +59 -0
- package/lib/tntd-select/rc-select/hooks/useCache.js.map +1 -0
- package/lib/tntd-select/rc-select/hooks/useDelayReset.d.ts +6 -0
- package/lib/tntd-select/rc-select/hooks/useDelayReset.d.ts.map +1 -0
- package/lib/tntd-select/rc-select/hooks/useDelayReset.js +50 -0
- package/lib/tntd-select/rc-select/hooks/useDelayReset.js.map +1 -0
- package/lib/tntd-select/rc-select/hooks/useFilterOptions.d.ts +4 -0
- package/lib/tntd-select/rc-select/hooks/useFilterOptions.d.ts.map +1 -0
- package/lib/tntd-select/rc-select/hooks/useFilterOptions.js +80 -0
- package/lib/tntd-select/rc-select/hooks/useFilterOptions.js.map +1 -0
- package/lib/tntd-select/rc-select/hooks/useId.d.ts +6 -0
- package/lib/tntd-select/rc-select/hooks/useId.d.ts.map +1 -0
- package/lib/tntd-select/rc-select/hooks/useId.js +59 -0
- package/lib/tntd-select/rc-select/hooks/useId.js.map +1 -0
- package/lib/tntd-select/rc-select/hooks/useLayoutEffect.d.ts +6 -0
- package/lib/tntd-select/rc-select/hooks/useLayoutEffect.d.ts.map +1 -0
- package/lib/tntd-select/rc-select/hooks/useLayoutEffect.js +44 -0
- package/lib/tntd-select/rc-select/hooks/useLayoutEffect.js.map +1 -0
- package/lib/tntd-select/rc-select/hooks/useLock.d.ts +8 -0
- package/lib/tntd-select/rc-select/hooks/useLock.d.ts.map +1 -0
- package/lib/tntd-select/rc-select/hooks/useLock.js +52 -0
- package/lib/tntd-select/rc-select/hooks/useLock.js.map +1 -0
- package/lib/tntd-select/rc-select/hooks/useOptions.d.ts +12 -0
- package/lib/tntd-select/rc-select/hooks/useOptions.d.ts.map +1 -0
- package/lib/tntd-select/rc-select/hooks/useOptions.js +71 -0
- package/lib/tntd-select/rc-select/hooks/useOptions.js.map +1 -0
- package/lib/tntd-select/rc-select/hooks/useRefFunc.d.ts +6 -0
- package/lib/tntd-select/rc-select/hooks/useRefFunc.d.ts.map +1 -0
- package/lib/tntd-select/rc-select/hooks/useRefFunc.js +40 -0
- package/lib/tntd-select/rc-select/hooks/useRefFunc.js.map +1 -0
- package/lib/tntd-select/rc-select/hooks/useSelectTriggerControl.d.ts +2 -0
- package/lib/tntd-select/rc-select/hooks/useSelectTriggerControl.d.ts.map +1 -0
- package/lib/tntd-select/rc-select/hooks/useSelectTriggerControl.js +58 -0
- package/lib/tntd-select/rc-select/hooks/useSelectTriggerControl.js.map +1 -0
- package/lib/tntd-select/rc-select/index.d.ts +11 -0
- package/lib/tntd-select/rc-select/index.d.ts.map +1 -0
- package/lib/tntd-select/rc-select/index.js +17 -0
- package/lib/tntd-select/rc-select/index.js.map +1 -0
- package/lib/tntd-select/rc-select/interface.d.ts +23 -0
- package/lib/tntd-select/rc-select/interface.d.ts.map +1 -0
- package/lib/tntd-select/rc-select/interface.js +3 -0
- package/lib/tntd-select/rc-select/interface.js.map +1 -0
- package/lib/tntd-select/rc-select/utils/commonUtil.d.ts +10 -0
- package/lib/tntd-select/rc-select/utils/commonUtil.d.ts.map +1 -0
- package/lib/tntd-select/rc-select/utils/commonUtil.js +39 -0
- package/lib/tntd-select/rc-select/utils/commonUtil.js.map +1 -0
- package/lib/tntd-select/rc-select/utils/keyUtil.d.ts +3 -0
- package/lib/tntd-select/rc-select/utils/keyUtil.d.ts.map +1 -0
- package/lib/tntd-select/rc-select/utils/keyUtil.js +41 -0
- package/lib/tntd-select/rc-select/utils/keyUtil.js.map +1 -0
- package/lib/tntd-select/rc-select/utils/legacyUtil.d.ts +4 -0
- package/lib/tntd-select/rc-select/utils/legacyUtil.d.ts.map +1 -0
- package/lib/tntd-select/rc-select/utils/legacyUtil.js +62 -0
- package/lib/tntd-select/rc-select/utils/legacyUtil.js.map +1 -0
- package/lib/tntd-select/rc-select/utils/platformUtil.d.ts +2 -0
- package/lib/tntd-select/rc-select/utils/platformUtil.d.ts.map +1 -0
- package/lib/tntd-select/rc-select/utils/platformUtil.js +9 -0
- package/lib/tntd-select/rc-select/utils/platformUtil.js.map +1 -0
- package/lib/tntd-select/rc-select/utils/valueUtil.d.ts +24 -0
- package/lib/tntd-select/rc-select/utils/valueUtil.d.ts.map +1 -0
- package/lib/tntd-select/rc-select/utils/valueUtil.js +109 -0
- package/lib/tntd-select/rc-select/utils/valueUtil.js.map +1 -0
- package/lib/tntd-select/rc-select/utils/warningPropsUtil.d.ts +5 -0
- package/lib/tntd-select/rc-select/utils/warningPropsUtil.d.ts.map +1 -0
- package/lib/tntd-select/rc-select/utils/warningPropsUtil.js +130 -0
- package/lib/tntd-select/rc-select/utils/warningPropsUtil.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare type RenderNode = React.ReactNode | ((props: any) => React.ReactNode);
|
|
4
|
+
export default function getIcons({ suffixIcon, clearIcon, menuItemSelectedIcon, removeIcon, loading, multiple, hasFeedback, prefixCls, showArrow, feedbackIcon, }: {
|
|
5
|
+
suffixIcon?: React.ReactNode;
|
|
6
|
+
clearIcon?: RenderNode;
|
|
7
|
+
menuItemSelectedIcon?: RenderNode;
|
|
8
|
+
removeIcon?: RenderNode;
|
|
9
|
+
loading?: boolean;
|
|
10
|
+
multiple?: boolean;
|
|
11
|
+
hasFeedback?: boolean;
|
|
12
|
+
feedbackIcon?: ReactNode;
|
|
13
|
+
prefixCls: string;
|
|
14
|
+
showArrow?: boolean;
|
|
15
|
+
}): {
|
|
16
|
+
clearIcon: {};
|
|
17
|
+
suffixIcon: JSX.Element | (({ open, showSearch }: {
|
|
18
|
+
open: boolean;
|
|
19
|
+
showSearch: boolean;
|
|
20
|
+
}) => JSX.Element);
|
|
21
|
+
itemIcon: {} | null;
|
|
22
|
+
removeIcon: {} | null;
|
|
23
|
+
};
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=getIcons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getIcons.d.ts","sourceRoot":"","sources":["../../../src/tntd-rc-select/_util/getIcons.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,aAAK,UAAU,GAAG,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK,KAAK,CAAC,SAAS,CAAC,CAAA;AAErE,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAC/B,UAAU,EACV,SAAS,EACT,oBAAoB,EACpB,UAAU,EACV,OAAO,EACP,QAAQ,EACR,WAAW,EACX,SAAS,EACT,SAAS,EACT,YAAY,GACb,EAAE;IACD,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC5B,SAAS,CAAC,EAAE,UAAU,CAAA;IACtB,oBAAoB,CAAC,EAAE,UAAU,CAAA;IACjC,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,YAAY,CAAC,EAAE,SAAS,CAAA;IACxB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;;;cAoBqD,OAAO;oBAAc,OAAO;;;;EA+BjF"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
const React = __importStar(require("react"));
|
|
27
|
+
const antd_1 = require("antd");
|
|
28
|
+
function getIcons({ suffixIcon, clearIcon, menuItemSelectedIcon, removeIcon, loading, multiple, hasFeedback, prefixCls, showArrow, feedbackIcon, }) {
|
|
29
|
+
// Clear Icon
|
|
30
|
+
const mergedClearIcon = clearIcon !== null && clearIcon !== void 0 ? clearIcon : React.createElement(antd_1.Icon, { type: "close-circle", theme: "filled" });
|
|
31
|
+
// Validation Feedback Icon
|
|
32
|
+
const getSuffixIconNode = (arrowIcon) => (React.createElement(React.Fragment, null,
|
|
33
|
+
showArrow !== false && arrowIcon,
|
|
34
|
+
hasFeedback && feedbackIcon));
|
|
35
|
+
// Arrow item icon
|
|
36
|
+
let mergedSuffixIcon = null;
|
|
37
|
+
if (suffixIcon !== undefined) {
|
|
38
|
+
mergedSuffixIcon = getSuffixIconNode(suffixIcon);
|
|
39
|
+
}
|
|
40
|
+
else if (loading) {
|
|
41
|
+
mergedSuffixIcon = getSuffixIconNode(React.createElement(antd_1.Icon, { type: "loading" }));
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
const iconCls = `${prefixCls}-suffix`;
|
|
45
|
+
mergedSuffixIcon = ({ open, showSearch }) => {
|
|
46
|
+
if (open && showSearch) {
|
|
47
|
+
return getSuffixIconNode(React.createElement(antd_1.Icon, { className: iconCls, type: "search" }));
|
|
48
|
+
}
|
|
49
|
+
return getSuffixIconNode(React.createElement(antd_1.Icon, { className: iconCls, type: "down" }));
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
// Checked item icon
|
|
53
|
+
let mergedItemIcon = null;
|
|
54
|
+
if (menuItemSelectedIcon !== undefined) {
|
|
55
|
+
mergedItemIcon = menuItemSelectedIcon;
|
|
56
|
+
}
|
|
57
|
+
else if (multiple) {
|
|
58
|
+
mergedItemIcon = React.createElement(antd_1.Icon, { type: "check" });
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
mergedItemIcon = null;
|
|
62
|
+
}
|
|
63
|
+
let mergedRemoveIcon = null;
|
|
64
|
+
if (removeIcon !== undefined) {
|
|
65
|
+
mergedRemoveIcon = removeIcon;
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
mergedRemoveIcon = React.createElement(antd_1.Icon, { type: "close" });
|
|
69
|
+
}
|
|
70
|
+
return {
|
|
71
|
+
clearIcon: mergedClearIcon,
|
|
72
|
+
suffixIcon: mergedSuffixIcon,
|
|
73
|
+
itemIcon: mergedItemIcon,
|
|
74
|
+
removeIcon: mergedRemoveIcon,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
exports.default = getIcons;
|
|
78
|
+
//# sourceMappingURL=getIcons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getIcons.js","sourceRoot":"","sources":["../../../src/tntd-rc-select/_util/getIcons.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,6CAA8B;AAC9B,+BAA2B;AAI3B,SAAwB,QAAQ,CAAC,EAC/B,UAAU,EACV,SAAS,EACT,oBAAoB,EACpB,UAAU,EACV,OAAO,EACP,QAAQ,EACR,WAAW,EACX,SAAS,EACT,SAAS,EACT,YAAY,GAYb;IACC,aAAa;IACb,MAAM,eAAe,GAAG,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,oBAAC,WAAI,IAAC,IAAI,EAAC,cAAc,EAAC,KAAK,EAAC,QAAQ,GAAG,CAAA;IAEhF,2BAA2B;IAC3B,MAAM,iBAAiB,GAAG,CAAC,SAAqB,EAAE,EAAE,CAAC,CACnD;QACG,SAAS,KAAK,KAAK,IAAI,SAAS;QAChC,WAAW,IAAI,YAAY,CAC3B,CACJ,CAAA;IAED,kBAAkB;IAClB,IAAI,gBAAgB,GAAG,IAAI,CAAA;IAC3B,IAAI,UAAU,KAAK,SAAS,EAAE;QAC5B,gBAAgB,GAAG,iBAAiB,CAAC,UAAU,CAAC,CAAA;KACjD;SAAM,IAAI,OAAO,EAAE;QAClB,gBAAgB,GAAG,iBAAiB,CAAC,oBAAC,WAAI,IAAC,IAAI,EAAC,SAAS,GAAG,CAAC,CAAA;KAC9D;SAAM;QACL,MAAM,OAAO,GAAG,GAAG,SAAS,SAAS,CAAA;QACrC,gBAAgB,GAAG,CAAC,EAAE,IAAI,EAAE,UAAU,EAA0C,EAAE,EAAE;YAClF,IAAI,IAAI,IAAI,UAAU,EAAE;gBACtB,OAAO,iBAAiB,CAAC,oBAAC,WAAI,IAAC,SAAS,EAAE,OAAO,EAAE,IAAI,EAAC,QAAQ,GAAG,CAAC,CAAA;aACrE;YACD,OAAO,iBAAiB,CAAC,oBAAC,WAAI,IAAC,SAAS,EAAE,OAAO,EAAE,IAAI,EAAC,MAAM,GAAG,CAAC,CAAA;QACpE,CAAC,CAAA;KACF;IAED,oBAAoB;IACpB,IAAI,cAAc,GAAG,IAAI,CAAA;IACzB,IAAI,oBAAoB,KAAK,SAAS,EAAE;QACtC,cAAc,GAAG,oBAAoB,CAAA;KACtC;SAAM,IAAI,QAAQ,EAAE;QACnB,cAAc,GAAG,oBAAC,WAAI,IAAC,IAAI,EAAC,OAAO,GAAG,CAAA;KACvC;SAAM;QACL,cAAc,GAAG,IAAI,CAAA;KACtB;IAED,IAAI,gBAAgB,GAAG,IAAI,CAAA;IAC3B,IAAI,UAAU,KAAK,SAAS,EAAE;QAC5B,gBAAgB,GAAG,UAAU,CAAA;KAC9B;SAAM;QACL,gBAAgB,GAAG,oBAAC,WAAI,IAAC,IAAI,EAAC,OAAO,GAAG,CAAA;KACzC;IAED,OAAO;QACL,SAAS,EAAE,eAAe;QAC1B,UAAU,EAAE,gBAAgB;QAC5B,QAAQ,EAAE,cAAc;QACxB,UAAU,EAAE,gBAAgB;KAC7B,CAAA;AACH,CAAC;AAzED,2BAyEC","sourcesContent":["import type { ReactNode } from 'react'\nimport * as React from 'react'\nimport { Icon } from 'antd'\n\ntype RenderNode = React.ReactNode | ((props: any) => React.ReactNode)\n\nexport default function getIcons({\n suffixIcon,\n clearIcon,\n menuItemSelectedIcon,\n removeIcon,\n loading,\n multiple,\n hasFeedback,\n prefixCls,\n showArrow,\n feedbackIcon,\n}: {\n suffixIcon?: React.ReactNode\n clearIcon?: RenderNode\n menuItemSelectedIcon?: RenderNode\n removeIcon?: RenderNode\n loading?: boolean\n multiple?: boolean\n hasFeedback?: boolean\n feedbackIcon?: ReactNode\n prefixCls: string\n showArrow?: boolean\n}) {\n // Clear Icon\n const mergedClearIcon = clearIcon ?? <Icon type=\"close-circle\" theme=\"filled\" />\n\n // Validation Feedback Icon\n const getSuffixIconNode = (arrowIcon?: ReactNode) => (\n <>\n {showArrow !== false && arrowIcon}\n {hasFeedback && feedbackIcon}\n </>\n )\n\n // Arrow item icon\n let mergedSuffixIcon = null\n if (suffixIcon !== undefined) {\n mergedSuffixIcon = getSuffixIconNode(suffixIcon)\n } else if (loading) {\n mergedSuffixIcon = getSuffixIconNode(<Icon type=\"loading\" />)\n } else {\n const iconCls = `${prefixCls}-suffix`\n mergedSuffixIcon = ({ open, showSearch }: { open: boolean; showSearch: boolean }) => {\n if (open && showSearch) {\n return getSuffixIconNode(<Icon className={iconCls} type=\"search\" />)\n }\n return getSuffixIconNode(<Icon className={iconCls} type=\"down\" />)\n }\n }\n\n // Checked item icon\n let mergedItemIcon = null\n if (menuItemSelectedIcon !== undefined) {\n mergedItemIcon = menuItemSelectedIcon\n } else if (multiple) {\n mergedItemIcon = <Icon type=\"check\" />\n } else {\n mergedItemIcon = null\n }\n\n let mergedRemoveIcon = null\n if (removeIcon !== undefined) {\n mergedRemoveIcon = removeIcon\n } else {\n mergedRemoveIcon = <Icon type=\"close\" />\n }\n\n return {\n clearIcon: mergedClearIcon,\n suffixIcon: mergedSuffixIcon,\n itemIcon: mergedItemIcon,\n removeIcon: mergedRemoveIcon,\n }\n}\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ReactElement, JSXElementConstructor } from 'react';
|
|
2
|
+
export declare type SizeType = 'small' | 'middle' | 'large' | undefined;
|
|
3
|
+
export declare type DirectionType = 'ltr' | 'rtl' | undefined;
|
|
4
|
+
export declare const tuple: <T extends string[]>(...args: T) => T;
|
|
5
|
+
declare const ValidateStatuses: ["success", "warning", "error", "validating", ""];
|
|
6
|
+
export declare type ValidateStatus = typeof ValidateStatuses[number];
|
|
7
|
+
declare const SelectPlacements: ["bottomLeft", "bottomRight", "topLeft", "topRight"];
|
|
8
|
+
export declare type SelectCommonPlacement = typeof SelectPlacements[number];
|
|
9
|
+
declare const InputStatuses: ["warning", "error", ""];
|
|
10
|
+
export declare type InputStatus = typeof InputStatuses[number];
|
|
11
|
+
export interface SpaceCompactItemContextType {
|
|
12
|
+
compactSize?: SizeType;
|
|
13
|
+
compactDirection?: 'horizontal' | 'vertical';
|
|
14
|
+
isFirstItem?: boolean;
|
|
15
|
+
isLastItem?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface FormItemStatusContextProps {
|
|
18
|
+
isFormItemInput?: boolean;
|
|
19
|
+
status?: ValidateStatus;
|
|
20
|
+
hasFeedback?: boolean;
|
|
21
|
+
feedbackIcon?: React.ReactNode;
|
|
22
|
+
}
|
|
23
|
+
export declare type DropdownRender = (menu: ReactElement<any, string | JSXElementConstructor<any>>) => ReactElement<any, string | JSXElementConstructor<any>>;
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../src/tntd-rc-select/_util/interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,OAAO,CAAA;AAEhE,oBAAY,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAA;AAE/D,oBAAY,aAAa,GAAG,KAAK,GAAG,KAAK,GAAG,SAAS,CAAA;AAErD,eAAO,MAAM,KAAK,uCAA2C,CAAA;AAE7D,QAAA,MAAM,gBAAgB,mDAAyD,CAAA;AAE/E,oBAAY,cAAc,GAAG,OAAO,gBAAgB,CAAC,MAAM,CAAC,CAAA;AAE5D,QAAA,MAAM,gBAAgB,sDAA4D,CAAA;AAElF,oBAAY,qBAAqB,GAAG,OAAO,gBAAgB,CAAC,MAAM,CAAC,CAAA;AAEnE,QAAA,MAAM,aAAa,0BAAgC,CAAA;AAEnD,oBAAY,WAAW,GAAG,OAAO,aAAa,CAAC,MAAM,CAAC,CAAA;AAEtD,MAAM,WAAW,2BAA2B;IAC1C,WAAW,CAAC,EAAE,QAAQ,CAAA;IACtB,gBAAgB,CAAC,EAAE,YAAY,GAAG,UAAU,CAAA;IAC5C,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED,MAAM,WAAW,0BAA0B;IACzC,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,MAAM,CAAC,EAAE,cAAc,CAAA;IACvB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC/B;AAED,oBAAY,cAAc,GAAG,CAC3B,IAAI,EAAE,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,qBAAqB,CAAC,GAAG,CAAC,CAAC,KACzD,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,qBAAqB,CAAC,GAAG,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.tuple = void 0;
|
|
4
|
+
const tuple = (...args) => args;
|
|
5
|
+
exports.tuple = tuple;
|
|
6
|
+
const ValidateStatuses = (0, exports.tuple)('success', 'warning', 'error', 'validating', '');
|
|
7
|
+
const SelectPlacements = (0, exports.tuple)('bottomLeft', 'bottomRight', 'topLeft', 'topRight');
|
|
8
|
+
const InputStatuses = (0, exports.tuple)('warning', 'error', '');
|
|
9
|
+
//# sourceMappingURL=interface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../src/tntd-rc-select/_util/interface.ts"],"names":[],"mappings":";;;AAMO,MAAM,KAAK,GAAG,CAAqB,GAAG,IAAO,EAAE,EAAE,CAAC,IAAI,CAAA;AAAhD,QAAA,KAAK,SAA2C;AAE7D,MAAM,gBAAgB,GAAG,IAAA,aAAK,EAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,CAAC,CAAA;AAI/E,MAAM,gBAAgB,GAAG,IAAA,aAAK,EAAC,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,CAAC,CAAA;AAIlF,MAAM,aAAa,GAAG,IAAA,aAAK,EAAC,SAAS,EAAE,OAAO,EAAE,EAAE,CAAC,CAAA","sourcesContent":["import type { ReactElement, JSXElementConstructor } from 'react'\n\nexport type SizeType = 'small' | 'middle' | 'large' | undefined\n\nexport type DirectionType = 'ltr' | 'rtl' | undefined\n\nexport const tuple = <T extends string[]>(...args: T) => args\n\nconst ValidateStatuses = tuple('success', 'warning', 'error', 'validating', '')\n\nexport type ValidateStatus = typeof ValidateStatuses[number]\n\nconst SelectPlacements = tuple('bottomLeft', 'bottomRight', 'topLeft', 'topRight')\n\nexport type SelectCommonPlacement = typeof SelectPlacements[number]\n\nconst InputStatuses = tuple('warning', 'error', '')\n\nexport type InputStatus = typeof InputStatuses[number]\n\nexport interface SpaceCompactItemContextType {\n compactSize?: SizeType\n compactDirection?: 'horizontal' | 'vertical'\n isFirstItem?: boolean\n isLastItem?: boolean\n}\n\nexport interface FormItemStatusContextProps {\n isFormItemInput?: boolean\n status?: ValidateStatus\n hasFeedback?: boolean\n feedbackIcon?: React.ReactNode\n}\n\nexport type DropdownRender = (\n menu: ReactElement<any, string | JSXElementConstructor<any>>\n) => ReactElement<any, string | JSXElementConstructor<any>>\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CSSMotionProps } from 'rc-motion';
|
|
2
|
+
declare const collapseMotion: CSSMotionProps;
|
|
3
|
+
declare const SelectPlacements: ["bottomLeft", "bottomRight", "topLeft", "topRight"];
|
|
4
|
+
export declare type SelectCommonPlacement = typeof SelectPlacements[number];
|
|
5
|
+
declare const getTransitionDirection: (placement: SelectCommonPlacement | undefined) => "slide-down" | "slide-up";
|
|
6
|
+
declare const getTransitionName: (rootPrefixCls: string, motion: string, transitionName?: string | undefined) => string;
|
|
7
|
+
export { getTransitionName, getTransitionDirection };
|
|
8
|
+
export default collapseMotion;
|
|
9
|
+
//# sourceMappingURL=motion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"motion.d.ts","sourceRoot":"","sources":["../../../src/tntd-rc-select/_util/motion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAA6C,MAAM,WAAW,CAAA;AAc1F,QAAA,MAAM,cAAc,EAAE,cAYrB,CAAA;AAED,QAAA,MAAM,gBAAgB,sDAA4D,CAAA;AAClF,oBAAY,qBAAqB,GAAG,OAAO,gBAAgB,CAAC,MAAM,CAAC,CAAA;AAEnE,QAAA,MAAM,sBAAsB,cAAe,qBAAqB,GAAG,SAAS,8BAK3E,CAAA;AAED,QAAA,MAAM,iBAAiB,kBAAmB,MAAM,UAAU,MAAM,gDAK/D,CAAA;AACD,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,CAAA;AACpD,eAAe,cAAc,CAAA"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTransitionDirection = exports.getTransitionName = void 0;
|
|
4
|
+
const type_1 = require("./type");
|
|
5
|
+
// ================== Collapse Motion ==================
|
|
6
|
+
const getCollapsedHeight = () => ({ height: 0, opacity: 0 });
|
|
7
|
+
const getRealHeight = (node) => {
|
|
8
|
+
const { scrollHeight } = node;
|
|
9
|
+
return { height: scrollHeight, opacity: 1 };
|
|
10
|
+
};
|
|
11
|
+
const getCurrentHeight = (node) => ({ height: node ? node.offsetHeight : 0 });
|
|
12
|
+
const skipOpacityTransition = (_, event) => (event === null || event === void 0 ? void 0 : event.deadline) === true || event.propertyName === 'height';
|
|
13
|
+
const collapseMotion = {
|
|
14
|
+
motionName: 'ant-motion-collapse',
|
|
15
|
+
onAppearStart: getCollapsedHeight,
|
|
16
|
+
onEnterStart: getCollapsedHeight,
|
|
17
|
+
onAppearActive: getRealHeight,
|
|
18
|
+
onEnterActive: getRealHeight,
|
|
19
|
+
onLeaveStart: getCurrentHeight,
|
|
20
|
+
onLeaveActive: getCollapsedHeight,
|
|
21
|
+
onAppearEnd: skipOpacityTransition,
|
|
22
|
+
onEnterEnd: skipOpacityTransition,
|
|
23
|
+
onLeaveEnd: skipOpacityTransition,
|
|
24
|
+
motionDeadline: 500,
|
|
25
|
+
};
|
|
26
|
+
const SelectPlacements = (0, type_1.tuple)('bottomLeft', 'bottomRight', 'topLeft', 'topRight');
|
|
27
|
+
const getTransitionDirection = (placement) => {
|
|
28
|
+
if (placement !== undefined && (placement === 'topLeft' || placement === 'topRight')) {
|
|
29
|
+
return `slide-down`;
|
|
30
|
+
}
|
|
31
|
+
return `slide-up`;
|
|
32
|
+
};
|
|
33
|
+
exports.getTransitionDirection = getTransitionDirection;
|
|
34
|
+
const getTransitionName = (rootPrefixCls, motion, transitionName) => {
|
|
35
|
+
if (transitionName !== undefined) {
|
|
36
|
+
return transitionName;
|
|
37
|
+
}
|
|
38
|
+
return `${rootPrefixCls}-${motion}`;
|
|
39
|
+
};
|
|
40
|
+
exports.getTransitionName = getTransitionName;
|
|
41
|
+
exports.default = collapseMotion;
|
|
42
|
+
//# sourceMappingURL=motion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"motion.js","sourceRoot":"","sources":["../../../src/tntd-rc-select/_util/motion.ts"],"names":[],"mappings":";;;AAEA,iCAA8B;AAE9B,wDAAwD;AACxD,MAAM,kBAAkB,GAAuB,GAAG,EAAE,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CAAA;AACnB,CAAC,CAAA;AAQ2B,wDAAsB;AANlD,MAAM,iBAAiB,GAAG,CAAC,aAAqB,EAAE,MAAc,EAAE,cAAuB,EAAE,EAAE;IAC3F,IAAI,cAAc,KAAK,SAAS,EAAE;QAChC,OAAO,cAAc,CAAA;KACtB;IACD,OAAO,GAAG,aAAa,IAAI,MAAM,EAAE,CAAA;AACrC,CAAC,CAAA;AACQ,8CAAiB;AAC1B,kBAAe,cAAc,CAAA","sourcesContent":["import type { CSSMotionProps, MotionEndEventHandler, MotionEventHandler } from 'rc-motion'\nimport type { MotionEvent } from 'rc-motion/lib/interface'\nimport { tuple } from './type'\n\n// ================== Collapse Motion ==================\nconst getCollapsedHeight: MotionEventHandler = () => ({ height: 0, opacity: 0 })\nconst getRealHeight: MotionEventHandler = (node) => {\n const { scrollHeight } = node\n return { height: scrollHeight, opacity: 1 }\n}\nconst getCurrentHeight: MotionEventHandler = (node) => ({ height: node ? node.offsetHeight : 0 })\nconst skipOpacityTransition: MotionEndEventHandler = (_, event: MotionEvent) =>\n event?.deadline === true || (event as TransitionEvent).propertyName === 'height'\n\nconst collapseMotion: CSSMotionProps = {\n motionName: 'ant-motion-collapse',\n onAppearStart: getCollapsedHeight,\n onEnterStart: getCollapsedHeight,\n onAppearActive: getRealHeight,\n onEnterActive: getRealHeight,\n onLeaveStart: getCurrentHeight,\n onLeaveActive: getCollapsedHeight,\n onAppearEnd: skipOpacityTransition,\n onEnterEnd: skipOpacityTransition,\n onLeaveEnd: skipOpacityTransition,\n motionDeadline: 500,\n}\n\nconst SelectPlacements = tuple('bottomLeft', 'bottomRight', 'topLeft', 'topRight')\nexport type SelectCommonPlacement = typeof SelectPlacements[number]\n\nconst getTransitionDirection = (placement: SelectCommonPlacement | undefined) => {\n if (placement !== undefined && (placement === 'topLeft' || placement === 'topRight')) {\n return `slide-down`\n }\n return `slide-up`\n}\n\nconst getTransitionName = (rootPrefixCls: string, motion: string, transitionName?: string) => {\n if (transitionName !== undefined) {\n return transitionName\n }\n return `${rootPrefixCls}-${motion}`\n}\nexport { getTransitionName, getTransitionDirection }\nexport default collapseMotion\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const tuple: <T extends string[]>(...args: T) => T;
|
|
2
|
+
export declare const tupleNum: <T extends number[]>(...args: T) => T;
|
|
3
|
+
/**
|
|
4
|
+
* https://stackoverflow.com/a/59187769 Extract the type of an element of an array/tuple without
|
|
5
|
+
* performing indexing
|
|
6
|
+
*/
|
|
7
|
+
export declare type ElementOf<T> = T extends (infer E)[] ? E : T extends readonly (infer F)[] ? F : never;
|
|
8
|
+
/** https://github.com/Microsoft/TypeScript/issues/29729 */
|
|
9
|
+
export declare type LiteralUnion<T extends U, U> = T | (U & {});
|
|
10
|
+
//# sourceMappingURL=type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../src/tntd-rc-select/_util/type.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,KAAK,uCAA2C,CAAA;AAE7D,eAAO,MAAM,QAAQ,uCAA2C,CAAA;AAEhE;;;GAGG;AACH,oBAAY,SAAS,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,SAAS,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,KAAK,CAAA;AAEjG,2DAA2D;AAC3D,oBAAY,YAAY,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.tupleNum = exports.tuple = void 0;
|
|
4
|
+
// https://stackoverflow.com/questions/46176165/ways-to-get-string-literal-type-of-array-values-without-enum-overhead
|
|
5
|
+
const tuple = (...args) => args;
|
|
6
|
+
exports.tuple = tuple;
|
|
7
|
+
const tupleNum = (...args) => args;
|
|
8
|
+
exports.tupleNum = tupleNum;
|
|
9
|
+
//# sourceMappingURL=type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../../src/tntd-rc-select/_util/type.ts"],"names":[],"mappings":";;;AAAA,qHAAqH;AAC9G,MAAM,KAAK,GAAG,CAAqB,GAAG,IAAO,EAAE,EAAE,CAAC,IAAI,CAAA;AAAhD,QAAA,KAAK,SAA2C;AAEtD,MAAM,QAAQ,GAAG,CAAqB,GAAG,IAAO,EAAE,EAAE,CAAC,IAAI,CAAA;AAAnD,QAAA,QAAQ,YAA2C","sourcesContent":["// https://stackoverflow.com/questions/46176165/ways-to-get-string-literal-type-of-array-values-without-enum-overhead\nexport const tuple = <T extends string[]>(...args: T) => args\n\nexport const tupleNum = <T extends number[]>(...args: T) => args\n\n/**\n * https://stackoverflow.com/a/59187769 Extract the type of an element of an array/tuple without\n * performing indexing\n */\nexport type ElementOf<T> = T extends (infer E)[] ? E : T extends readonly (infer F)[] ? F : never\n\n/** https://github.com/Microsoft/TypeScript/issues/29729 */\nexport type LiteralUnion<T extends U, U> = T | (U & {})\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { DirectionType, SpaceCompactItemContextType } from './interface';
|
|
3
|
+
export declare const SpaceCompactItemContext: React.Context<SpaceCompactItemContextType | null>;
|
|
4
|
+
export declare const useCompactItemContext: (prefixCls: string, direction: DirectionType) => {
|
|
5
|
+
compactSize: import("./interface").SizeType;
|
|
6
|
+
compactDirection: "horizontal" | "vertical" | undefined;
|
|
7
|
+
compactItemClassnames: string;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=useCompactItemContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCompactItemContext.d.ts","sourceRoot":"","sources":["../../../src/tntd-rc-select/_util/useCompactItemContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAE,aAAa,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAA;AAG7E,eAAO,MAAM,uBAAuB,mDAAgE,CAAA;AAEpG,eAAO,MAAM,qBAAqB,cAAe,MAAM,aAAa,aAAa;;;;CAsBhF,CAAA"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.useCompactItemContext = exports.SpaceCompactItemContext = void 0;
|
|
30
|
+
const React = __importStar(require("react"));
|
|
31
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
32
|
+
exports.SpaceCompactItemContext = React.createContext(null);
|
|
33
|
+
const useCompactItemContext = (prefixCls, direction) => {
|
|
34
|
+
const compactItemContext = React.useContext(exports.SpaceCompactItemContext);
|
|
35
|
+
const compactItemClassnames = React.useMemo(() => {
|
|
36
|
+
if (!compactItemContext)
|
|
37
|
+
return '';
|
|
38
|
+
const { compactDirection, isFirstItem, isLastItem } = compactItemContext;
|
|
39
|
+
const separator = compactDirection === 'vertical' ? '-vertical-' : '-';
|
|
40
|
+
return (0, classnames_1.default)({
|
|
41
|
+
[`${prefixCls}-compact${separator}item`]: true,
|
|
42
|
+
[`${prefixCls}-compact${separator}first-item`]: isFirstItem,
|
|
43
|
+
[`${prefixCls}-compact${separator}last-item`]: isLastItem,
|
|
44
|
+
[`${prefixCls}-compact${separator}item-rtl`]: direction === 'rtl',
|
|
45
|
+
});
|
|
46
|
+
}, [prefixCls, direction, compactItemContext]);
|
|
47
|
+
return {
|
|
48
|
+
compactSize: compactItemContext === null || compactItemContext === void 0 ? void 0 : compactItemContext.compactSize,
|
|
49
|
+
compactDirection: compactItemContext === null || compactItemContext === void 0 ? void 0 : compactItemContext.compactDirection,
|
|
50
|
+
compactItemClassnames,
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
exports.useCompactItemContext = useCompactItemContext;
|
|
54
|
+
//# sourceMappingURL=useCompactItemContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCompactItemContext.js","sourceRoot":"","sources":["../../../src/tntd-rc-select/_util/useCompactItemContext.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA8B;AAE9B,4DAAmC;AAEtB,QAAA,uBAAuB,GAAG,KAAK,CAAC,aAAa,CAAqC,IAAI,CAAC,CAAA;AAE7F,MAAM,qBAAqB,GAAG,CAAC,SAAiB,EAAE,SAAwB,EAAE,EAAE;IACnF,MAAM,kBAAkB,GAAG,KAAK,CAAC,UAAU,CAAC,+BAAuB,CAAC,CAAA;IAEpE,MAAM,qBAAqB,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QAC/C,IAAI,CAAC,kBAAkB;YAAE,OAAO,EAAE,CAAA;QAElC,MAAM,EAAE,gBAAgB,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,kBAAkB,CAAA;QACxE,MAAM,SAAS,GAAG,gBAAgB,KAAK,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,CAAA;QAEtE,OAAO,IAAA,oBAAU,EAAC;YAChB,CAAC,GAAG,SAAS,WAAW,SAAS,MAAM,CAAC,EAAE,IAAI;YAC9C,CAAC,GAAG,SAAS,WAAW,SAAS,YAAY,CAAC,EAAE,WAAW;YAC3D,CAAC,GAAG,SAAS,WAAW,SAAS,WAAW,CAAC,EAAE,UAAU;YACzD,CAAC,GAAG,SAAS,WAAW,SAAS,UAAU,CAAC,EAAE,SAAS,KAAK,KAAK;SAClE,CAAC,CAAA;IACJ,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,kBAAkB,CAAC,CAAC,CAAA;IAE9C,OAAO;QACL,WAAW,EAAE,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAE,WAAW;QAC5C,gBAAgB,EAAE,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAE,gBAAgB;QACtD,qBAAqB;KACtB,CAAA;AACH,CAAC,CAAA;AAtBY,QAAA,qBAAqB,yBAsBjC","sourcesContent":["import * as React from 'react'\nimport type { DirectionType, SpaceCompactItemContextType } from './interface'\nimport classNames from 'classnames'\n\nexport const SpaceCompactItemContext = React.createContext<SpaceCompactItemContextType | null>(null)\n\nexport const useCompactItemContext = (prefixCls: string, direction: DirectionType) => {\n const compactItemContext = React.useContext(SpaceCompactItemContext)\n\n const compactItemClassnames = React.useMemo(() => {\n if (!compactItemContext) return ''\n\n const { compactDirection, isFirstItem, isLastItem } = compactItemContext\n const separator = compactDirection === 'vertical' ? '-vertical-' : '-'\n\n return classNames({\n [`${prefixCls}-compact${separator}item`]: true,\n [`${prefixCls}-compact${separator}first-item`]: isFirstItem,\n [`${prefixCls}-compact${separator}last-item`]: isLastItem,\n [`${prefixCls}-compact${separator}item-rtl`]: direction === 'rtl',\n })\n }, [prefixCls, direction, compactItemContext])\n\n return {\n compactSize: compactItemContext?.compactSize,\n compactDirection: compactItemContext?.compactDirection,\n compactItemClassnames,\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"warning.d.ts","sourceRoot":"","sources":["../../../src/tntd-rc-select/_util/warning.ts"],"names":[],"mappings":"AAIA,aAAK,OAAO,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;AAG5E,QAAA,IAAI,OAAO,EAAE,OAAc,CAAA;AAY3B,eAAe,OAAO,CAAA"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
const warning_1 = __importStar(require("rc-util/lib/warning"));
|
|
27
|
+
function noop() { }
|
|
28
|
+
// eslint-disable-next-line import/no-mutable-exports
|
|
29
|
+
let warning = noop;
|
|
30
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
31
|
+
warning = (valid, component, message) => {
|
|
32
|
+
(0, warning_1.default)(valid, `[antd: ${component}] ${message}`);
|
|
33
|
+
// StrictMode will inject console which will not throw warning in React 17.
|
|
34
|
+
if (process.env.NODE_ENV === 'test') {
|
|
35
|
+
(0, warning_1.resetWarned)();
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
exports.default = warning;
|
|
40
|
+
//# sourceMappingURL=warning.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"warning.js","sourceRoot":"","sources":["../../../src/tntd-rc-select/_util/warning.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+DAA4D;AAE5D,SAAS,IAAI,KAAI,CAAC;AAIlB,qDAAqD;AACrD,IAAI,OAAO,GAAY,IAAI,CAAA;AAC3B,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE;IACzC,OAAO,GAAG,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE;QACtC,IAAA,iBAAS,EAAC,KAAK,EAAE,UAAU,SAAS,KAAK,OAAO,EAAE,CAAC,CAAA;QAEnD,2EAA2E;QAC3E,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM,EAAE;YACnC,IAAA,qBAAW,GAAE,CAAA;SACd;IACH,CAAC,CAAA;CACF;AAED,kBAAe,OAAO,CAAA","sourcesContent":["import rcWarning, { resetWarned } from 'rc-util/lib/warning'\n\nfunction noop() {}\n\ntype Warning = (valid: boolean, component: string, message?: string) => void\n\n// eslint-disable-next-line import/no-mutable-exports\nlet warning: Warning = noop\nif (process.env.NODE_ENV !== 'production') {\n warning = (valid, component, message) => {\n rcWarning(valid, `[antd: ${component}] ${message}`)\n\n // StrictMode will inject console which will not throw warning in React 17.\n if (process.env.NODE_ENV === 'test') {\n resetWarned()\n }\n }\n}\n\nexport default warning\n"]}
|
|
Binary file
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { SelectProps as RcSelectProps } from 'rc-select';
|
|
2
|
+
import { BaseSelectRef, OptGroup, Option } from 'rc-select';
|
|
3
|
+
import type { OptionProps } from 'rc-select/lib/Option';
|
|
4
|
+
import type { BaseOptionType, DefaultOptionType } from 'rc-select/lib/Select';
|
|
5
|
+
import * as React from 'react';
|
|
6
|
+
import type { SizeType } from '../config-provider/SizeContext';
|
|
7
|
+
import type { SelectCommonPlacement } from './_util/motion';
|
|
8
|
+
import './style/index.less';
|
|
9
|
+
declare type RawValue = string | number;
|
|
10
|
+
export { OptionProps, BaseSelectRef as RefSelectProps, BaseOptionType, DefaultOptionType };
|
|
11
|
+
export interface LabeledValue {
|
|
12
|
+
key?: string;
|
|
13
|
+
value: RawValue;
|
|
14
|
+
label: React.ReactNode;
|
|
15
|
+
}
|
|
16
|
+
export declare type SelectValue = RawValue | RawValue[] | LabeledValue | LabeledValue[] | undefined;
|
|
17
|
+
export interface InternalSelectProps<ValueType = any, OptionType extends BaseOptionType | DefaultOptionType = DefaultOptionType> extends Omit<RcSelectProps<ValueType, OptionType>, 'mode'> {
|
|
18
|
+
suffixIcon?: React.ReactNode;
|
|
19
|
+
size?: SizeType;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
mode?: 'multiple' | 'tags' | 'SECRET_COMBOBOX_MODE_DO_NOT_USE';
|
|
22
|
+
bordered?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface SelectProps<ValueType = any, OptionType extends BaseOptionType | DefaultOptionType = DefaultOptionType> extends Omit<InternalSelectProps<ValueType, OptionType>, 'inputIcon' | 'mode' | 'getInputElement' | 'getRawInputElement' | 'backfill' | 'placement'> {
|
|
25
|
+
placement?: SelectCommonPlacement;
|
|
26
|
+
mode?: 'multiple' | 'tags';
|
|
27
|
+
/**
|
|
28
|
+
* @deprecated `dropdownClassName` is deprecated which will be removed in next major
|
|
29
|
+
* version.Please use `popupClassName` instead.
|
|
30
|
+
*/
|
|
31
|
+
dropdownClassName?: string;
|
|
32
|
+
popupClassName?: string;
|
|
33
|
+
}
|
|
34
|
+
declare const TntdRcSelect: (<ValueType = any, OptionType extends BaseOptionType | DefaultOptionType = DefaultOptionType>(props: SelectProps<ValueType, OptionType> & {
|
|
35
|
+
children?: React.ReactNode;
|
|
36
|
+
} & {
|
|
37
|
+
ref?: React.Ref<BaseSelectRef> | undefined;
|
|
38
|
+
}) => React.ReactElement) & {
|
|
39
|
+
SECRET_COMBOBOX_MODE_DO_NOT_USE: string;
|
|
40
|
+
Option: typeof Option;
|
|
41
|
+
OptGroup: typeof OptGroup;
|
|
42
|
+
};
|
|
43
|
+
export default TntdRcSelect;
|
|
44
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tntd-rc-select/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,IAAI,aAAa,EAAE,MAAM,WAAW,CAAA;AAC7D,OAAiB,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM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B,CACzE,SAAQ,IAAI,CACV,mBAAmB,CAAC,SAAS,EAAE,UAAU,CAAC,EAC1C,WAAW,GAAG,MAAM,GAAG,iBAAiB,GAAG,oBAAoB,GAAG,UAAU,GAAG,WAAW,CAC3F;IACD,SAAS,CAAC,EAAE,qBAAqB,CAAA;IACjC,IAAI,CAAC,EAAE,UAAU,GAAG,MAAM,CAAA;IAE1B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB;AAiKD,QAAA,MAAM,YAAY;;;;MAOb,MAAM,YAAY;qCACY,MAAM;YAC/B,aAAa;cACX,eAAe;CAC1B,CAAA;AAMD,eAAe,YAAY,CAAA"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// TODO: 4.0 - codemod should help to change `filterOption` to support node props.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
20
|
+
if (mod && mod.__esModule) return mod;
|
|
21
|
+
var result = {};
|
|
22
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
23
|
+
__setModuleDefault(result, mod);
|
|
24
|
+
return result;
|
|
25
|
+
};
|
|
26
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
27
|
+
var t = {};
|
|
28
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
29
|
+
t[p] = s[p];
|
|
30
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
31
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
32
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
33
|
+
t[p[i]] = s[p[i]];
|
|
34
|
+
}
|
|
35
|
+
return t;
|
|
36
|
+
};
|
|
37
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
38
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
39
|
+
};
|
|
40
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
42
|
+
const rc_select_1 = __importStar(require("rc-select"));
|
|
43
|
+
const omit_1 = __importDefault(require("rc-util/lib/omit"));
|
|
44
|
+
const React = __importStar(require("react"));
|
|
45
|
+
const react_1 = require("react");
|
|
46
|
+
const context_1 = require("./_util/context");
|
|
47
|
+
const defaultRenderEmpty_1 = __importDefault(require("./_util/defaultRenderEmpty"));
|
|
48
|
+
const DisabledContext_1 = __importDefault(require("../config-provider/DisabledContext"));
|
|
49
|
+
const SizeContext_1 = __importDefault(require("../config-provider/SizeContext"));
|
|
50
|
+
const FormItemInputContext_1 = require("./_util/FormItemInputContext");
|
|
51
|
+
const motion_1 = require("./_util/motion");
|
|
52
|
+
const getIcons_1 = __importDefault(require("./_util/getIcons"));
|
|
53
|
+
const warning_1 = __importDefault(require("./_util/warning"));
|
|
54
|
+
const useCompactItemContext_1 = require("./_util/useCompactItemContext");
|
|
55
|
+
require("./style/index.less");
|
|
56
|
+
const SECRET_COMBOBOX_MODE_DO_NOT_USE = 'SECRET_COMBOBOX_MODE_DO_NOT_USE';
|
|
57
|
+
const InternalSelect = (_a, ref) => {
|
|
58
|
+
var { prefixCls: customizePrefixCls, bordered = true, className, getPopupContainer, dropdownClassName, popupClassName, listHeight = 256, placement, listItemHeight = 24, size: customizeSize, disabled: customDisabled, notFoundContent,
|
|
59
|
+
// status: customStatus,
|
|
60
|
+
showArrow } = _a, props = __rest(_a, ["prefixCls", "bordered", "className", "getPopupContainer", "dropdownClassName", "popupClassName", "listHeight", "placement", "listItemHeight", "size", "disabled", "notFoundContent", "showArrow"]);
|
|
61
|
+
const { getPopupContainer: getContextPopupContainer, getPrefixCls, renderEmpty, direction, virtual, dropdownMatchSelectWidth, } = React.useContext(context_1.ConfigContext);
|
|
62
|
+
const size = React.useContext(SizeContext_1.default);
|
|
63
|
+
const prefixCls = getPrefixCls('select', customizePrefixCls);
|
|
64
|
+
const rootPrefixCls = getPrefixCls();
|
|
65
|
+
const { compactSize, compactItemClassnames } = (0, useCompactItemContext_1.useCompactItemContext)(prefixCls, direction);
|
|
66
|
+
const mode = React.useMemo(() => {
|
|
67
|
+
const { mode: m } = props;
|
|
68
|
+
if (m === 'combobox') {
|
|
69
|
+
return undefined;
|
|
70
|
+
}
|
|
71
|
+
if (m === SECRET_COMBOBOX_MODE_DO_NOT_USE) {
|
|
72
|
+
return 'combobox';
|
|
73
|
+
}
|
|
74
|
+
return m;
|
|
75
|
+
}, [props.mode]);
|
|
76
|
+
const isMultiple = mode === 'multiple' || mode === 'tags';
|
|
77
|
+
const mergedShowArrow = showArrow !== undefined ? showArrow : props.loading || !(isMultiple || mode === 'combobox');
|
|
78
|
+
// =================== Warning =====================
|
|
79
|
+
(0, warning_1.default)(!dropdownClassName, 'Select', '`dropdownClassName` is deprecated which will be removed in next major version. Please use `popupClassName` instead.');
|
|
80
|
+
// ===================== Form Status =====================
|
|
81
|
+
const { status: contextStatus, hasFeedback, isFormItemInput, feedbackIcon, } = (0, react_1.useContext)(FormItemInputContext_1.FormItemInputContext);
|
|
82
|
+
// const mergedStatus = getMergedStatus(contextStatus, customStatus);
|
|
83
|
+
// ===================== Empty =====================
|
|
84
|
+
let mergedNotFound;
|
|
85
|
+
if (notFoundContent !== undefined) {
|
|
86
|
+
mergedNotFound = notFoundContent;
|
|
87
|
+
}
|
|
88
|
+
else if (mode === 'combobox') {
|
|
89
|
+
mergedNotFound = null;
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
mergedNotFound = (renderEmpty || defaultRenderEmpty_1.default)('Select');
|
|
93
|
+
}
|
|
94
|
+
// ===================== Icons =====================
|
|
95
|
+
const { suffixIcon, itemIcon, removeIcon, clearIcon } = (0, getIcons_1.default)(Object.assign(Object.assign({}, props), { multiple: isMultiple, hasFeedback,
|
|
96
|
+
feedbackIcon, showArrow: mergedShowArrow, prefixCls }));
|
|
97
|
+
const selectProps = (0, omit_1.default)(props, ['suffixIcon', 'itemIcon']);
|
|
98
|
+
const rcSelectRtlDropdownClassName = (0, classnames_1.default)(popupClassName || dropdownClassName, {
|
|
99
|
+
[`${prefixCls}-dropdown-${direction}`]: direction === 'rtl',
|
|
100
|
+
});
|
|
101
|
+
const mergedSize = compactSize || customizeSize || size;
|
|
102
|
+
// ===================== Disabled =====================
|
|
103
|
+
const disabled = React.useContext(DisabledContext_1.default);
|
|
104
|
+
const mergedDisabled = customDisabled !== null && customDisabled !== void 0 ? customDisabled : disabled;
|
|
105
|
+
const mergedClassName = (0, classnames_1.default)({
|
|
106
|
+
[`${prefixCls}-lg`]: mergedSize === 'large',
|
|
107
|
+
[`${prefixCls}-sm`]: mergedSize === 'small',
|
|
108
|
+
[`${prefixCls}-rtl`]: direction === 'rtl',
|
|
109
|
+
[`${prefixCls}-borderless`]: !bordered,
|
|
110
|
+
[`${prefixCls}-in-form-item`]: isFormItemInput,
|
|
111
|
+
},
|
|
112
|
+
// prefixCls||hasFeedback,
|
|
113
|
+
// getStatusClassNames(prefixCls, mergedStatus, hasFeedback),
|
|
114
|
+
compactItemClassnames, className);
|
|
115
|
+
// ===================== Placement =====================
|
|
116
|
+
const getPlacement = () => {
|
|
117
|
+
if (placement !== undefined) {
|
|
118
|
+
return placement;
|
|
119
|
+
}
|
|
120
|
+
return direction === 'rtl'
|
|
121
|
+
? 'bottomRight'
|
|
122
|
+
: 'bottomLeft';
|
|
123
|
+
};
|
|
124
|
+
return (React.createElement(rc_select_1.default, Object.assign({ ref: ref, virtual: virtual, dropdownMatchSelectWidth: dropdownMatchSelectWidth }, selectProps, { transitionName: (0, motion_1.getTransitionName)(rootPrefixCls, (0, motion_1.getTransitionDirection)(placement), props.transitionName), listHeight: listHeight, listItemHeight: listItemHeight, mode: mode, prefixCls: prefixCls, placement: getPlacement(), direction: direction, inputIcon: suffixIcon, menuItemSelectedIcon: itemIcon, removeIcon: removeIcon, clearIcon: clearIcon, notFoundContent: mergedNotFound, className: mergedClassName, getPopupContainer: getPopupContainer || getContextPopupContainer, dropdownClassName: rcSelectRtlDropdownClassName, showArrow: hasFeedback || showArrow, disabled: mergedDisabled })));
|
|
125
|
+
};
|
|
126
|
+
const TntdRcSelect = React.forwardRef(InternalSelect);
|
|
127
|
+
TntdRcSelect.SECRET_COMBOBOX_MODE_DO_NOT_USE = SECRET_COMBOBOX_MODE_DO_NOT_USE;
|
|
128
|
+
TntdRcSelect.Option = rc_select_1.Option;
|
|
129
|
+
TntdRcSelect.OptGroup = rc_select_1.OptGroup;
|
|
130
|
+
exports.default = TntdRcSelect;
|
|
131
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tntd-rc-select/index.tsx"],"names":[],"mappings":";AAAA,kFAAkF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAElF,4DAAmC;AAEnC,uDAAqE;AAGrE,4DAAmC;A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Ac,EAAE,cAAc,EAC9B,IAAI,EAAE,IAAW,EACjB,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,YAAY,EAAE,EACzB,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,UAAU,EACrB,oBAAoB,EAAE,QAAQ,EAC9B,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,cAAc,EAC/B,SAAS,EAAE,eAAe,EAC1B,iBAAiB,EAAE,iBAAiB,IAAI,wBAAwB,EAChE,iBAAiB,EAAE,4BAA4B,EAC/C,SAAS,EAAE,WAAW,IAAI,SAAS,EACnC,QAAQ,EAAE,cAAc,IACxB,CACH,CAAA;AACH,CAAC,CAAA;AAED,MAAM,YAAY,GAAG,KAAK,CAAC,UAAU,CAAC,cAAc,CAWnD,CAAA;AAED,YAAY,CAAC,+BAA+B,GAAG,+BAA+B,CAAA;AAC9E,YAAY,CAAC,MAAM,GAAG,kBAAM,CAAA;AAC5B,YAAY,CAAC,QAAQ,GAAG,oBAAQ,CAAA;AAEhC,kBAAe,YAAY,CAAA","sourcesContent":["// TODO: 4.0 - codemod should help to change `filterOption` to support node props.\n\nimport classNames from 'classnames'\nimport type { SelectProps as RcSelectProps } from 'rc-select'\nimport RcSelect, { BaseSelectRef, OptGroup, Option } from 'rc-select'\nimport type { OptionProps } from 'rc-select/lib/Option'\nimport type { BaseOptionType, DefaultOptionType } from 'rc-select/lib/Select'\nimport omit from 'rc-util/lib/omit'\nimport * as React from 'react'\nimport { useContext } from 'react'\nimport { ConfigContext } from './_util/context'\nimport defaultRenderEmpty from './_util/defaultRenderEmpty'\nimport DisabledContext from '../config-provider/DisabledContext'\nimport type { SizeType } from '../config-provider/SizeContext'\nimport SizeContext from '../config-provider/SizeContext'\nimport { FormItemInputContext } from './_util/FormItemInputContext'\nimport type { SelectCommonPlacement } from './_util/motion'\nimport { getTransitionDirection, getTransitionName } from './_util/motion'\nimport getIcons from './_util/getIcons'\nimport warning from './_util/warning'\nimport { useCompactItemContext } from './_util/useCompactItemContext'\nimport './style/index.less'\ntype RawValue = string | number\n\nexport { OptionProps, BaseSelectRef as RefSelectProps, BaseOptionType, DefaultOptionType }\n\nexport interface LabeledValue {\n key?: string\n value: RawValue\n label: React.ReactNode\n}\n\nexport type SelectValue = RawValue | RawValue[] | LabeledValue | LabeledValue[] | undefined\n\nexport interface InternalSelectProps<\n ValueType = any,\n OptionType extends BaseOptionType | DefaultOptionType = DefaultOptionType\n> extends Omit<RcSelectProps<ValueType, OptionType>, 'mode'> {\n suffixIcon?: React.ReactNode\n size?: SizeType\n disabled?: boolean\n mode?: 'multiple' | 'tags' | 'SECRET_COMBOBOX_MODE_DO_NOT_USE'\n bordered?: boolean\n}\n\nexport interface SelectProps<\n ValueType = any,\n OptionType extends BaseOptionType | DefaultOptionType = DefaultOptionType\n> extends Omit<\n InternalSelectProps<ValueType, OptionType>,\n 'inputIcon' | 'mode' | 'getInputElement' | 'getRawInputElement' | 'backfill' | 'placement'\n > {\n placement?: SelectCommonPlacement\n mode?: 'multiple' | 'tags'\n // status?: InputStatus;\n /**\n * @deprecated `dropdownClassName` is deprecated which will be removed in next major\n * version.Please use `popupClassName` instead.\n */\n dropdownClassName?: string\n popupClassName?: string\n}\n\nconst SECRET_COMBOBOX_MODE_DO_NOT_USE = 'SECRET_COMBOBOX_MODE_DO_NOT_USE'\n\nconst InternalSelect = <OptionType extends BaseOptionType | DefaultOptionType = DefaultOptionType>(\n {\n prefixCls: customizePrefixCls,\n bordered = true,\n className,\n getPopupContainer,\n dropdownClassName,\n popupClassName,\n listHeight = 256,\n placement,\n listItemHeight = 24,\n size: customizeSize,\n disabled: customDisabled,\n notFoundContent,\n // status: customStatus,\n showArrow,\n ...props\n }: SelectProps<OptionType>,\n ref: React.Ref<BaseSelectRef>\n) => {\n const {\n getPopupContainer: getContextPopupContainer,\n getPrefixCls,\n renderEmpty,\n direction,\n virtual,\n dropdownMatchSelectWidth,\n } = React.useContext(ConfigContext)\n const size = React.useContext(SizeContext)\n\n const prefixCls = getPrefixCls('select', customizePrefixCls)\n\n const rootPrefixCls = getPrefixCls()\n\n const { compactSize, compactItemClassnames } = useCompactItemContext(prefixCls, direction)\n\n const mode = React.useMemo(() => {\n const { mode: m } = props as InternalSelectProps<OptionType>\n\n if ((m as any) === 'combobox') {\n return undefined\n }\n\n if (m === SECRET_COMBOBOX_MODE_DO_NOT_USE) {\n return 'combobox'\n }\n\n return m\n }, [props.mode])\n\n const isMultiple = mode === 'multiple' || mode === 'tags'\n const mergedShowArrow =\n showArrow !== undefined ? showArrow : props.loading || !(isMultiple || mode === 'combobox')\n\n // =================== Warning =====================\n warning(\n !dropdownClassName,\n 'Select',\n '`dropdownClassName` is deprecated which will be removed in next major version. Please use `popupClassName` instead.'\n )\n\n // ===================== Form Status =====================\n const {\n status: contextStatus,\n hasFeedback,\n isFormItemInput,\n feedbackIcon,\n } = useContext(FormItemInputContext)\n // const mergedStatus = getMergedStatus(contextStatus, customStatus);\n\n // ===================== Empty =====================\n let mergedNotFound: React.ReactNode\n if (notFoundContent !== undefined) {\n mergedNotFound = notFoundContent\n } else if (mode === 'combobox') {\n mergedNotFound = null\n } else {\n mergedNotFound = (renderEmpty || defaultRenderEmpty)('Select')\n }\n\n // ===================== Icons =====================\n const { suffixIcon, itemIcon, removeIcon, clearIcon } = getIcons({\n ...props,\n multiple: isMultiple,\n hasFeedback,\n feedbackIcon,\n showArrow: mergedShowArrow,\n prefixCls,\n })\n\n const selectProps = omit(props as typeof props & { itemIcon: any }, ['suffixIcon', 'itemIcon'])\n\n const rcSelectRtlDropdownClassName = classNames(popupClassName || dropdownClassName, {\n [`${prefixCls}-dropdown-${direction}`]: direction === 'rtl',\n })\n\n const mergedSize = compactSize || customizeSize || size\n\n // ===================== Disabled =====================\n const disabled = React.useContext(DisabledContext)\n const mergedDisabled = customDisabled ?? disabled\n\n const mergedClassName = classNames(\n {\n [`${prefixCls}-lg`]: mergedSize === 'large',\n [`${prefixCls}-sm`]: mergedSize === 'small',\n [`${prefixCls}-rtl`]: direction === 'rtl',\n [`${prefixCls}-borderless`]: !bordered,\n [`${prefixCls}-in-form-item`]: isFormItemInput,\n },\n // prefixCls||hasFeedback,\n // getStatusClassNames(prefixCls, mergedStatus, hasFeedback),\n compactItemClassnames,\n className\n )\n\n // ===================== Placement =====================\n const getPlacement = () => {\n if (placement !== undefined) {\n return placement\n }\n return direction === 'rtl'\n ? ('bottomRight' as SelectCommonPlacement)\n : ('bottomLeft' as SelectCommonPlacement)\n }\n\n return (\n <RcSelect<any, any>\n ref={ref as any}\n virtual={virtual}\n dropdownMatchSelectWidth={dropdownMatchSelectWidth}\n {...selectProps}\n transitionName={getTransitionName(\n rootPrefixCls,\n getTransitionDirection(placement),\n props.transitionName\n )}\n listHeight={listHeight}\n listItemHeight={listItemHeight}\n mode={mode as any}\n prefixCls={prefixCls}\n placement={getPlacement()}\n direction={direction}\n inputIcon={suffixIcon}\n menuItemSelectedIcon={itemIcon}\n removeIcon={removeIcon}\n clearIcon={clearIcon}\n notFoundContent={mergedNotFound}\n className={mergedClassName}\n getPopupContainer={getPopupContainer || getContextPopupContainer}\n dropdownClassName={rcSelectRtlDropdownClassName}\n showArrow={hasFeedback || showArrow}\n disabled={mergedDisabled}\n />\n )\n}\n\nconst TntdRcSelect = React.forwardRef(InternalSelect) as unknown as (<\n ValueType = any,\n OptionType extends BaseOptionType | DefaultOptionType = DefaultOptionType\n>(\n props: React.PropsWithChildren<SelectProps<ValueType, OptionType>> & {\n ref?: React.Ref<BaseSelectRef>\n }\n) => React.ReactElement) & {\n SECRET_COMBOBOX_MODE_DO_NOT_USE: string\n Option: typeof Option\n OptGroup: typeof OptGroup\n}\n\nTntdRcSelect.SECRET_COMBOBOX_MODE_DO_NOT_USE = SECRET_COMBOBOX_MODE_DO_NOT_USE\nTntdRcSelect.Option = Option\nTntdRcSelect.OptGroup = OptGroup\n\nexport default TntdRcSelect\n"]}
|