tntd 2.7.23 → 2.7.25
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/index.js +1 -0
- package/es/index.js.map +1 -1
- package/es/locale/en_US.js +21 -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/table/context.js.map +1 -1
- package/es/table/table.js +3 -2
- package/es/table/table.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-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 +4 -17
- package/es/tntd-select/_util/PurePanel.js.map +1 -1
- 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 +15 -8
- package/es/tntd-select/_util/motion.js.map +1 -1
- 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 +14 -5
- package/es/tntd-select/_util/warning.js.map +1 -1
- 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/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 +11 -1
- package/lib/locale/en_US.d.ts.map +1 -1
- package/lib/locale/en_US.js +21 -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/table/context.d.ts +1 -0
- package/lib/table/context.d.ts.map +1 -1
- package/lib/table/context.js.map +1 -1
- package/lib/table/table.d.ts +2 -1
- package/lib/table/table.d.ts.map +1 -1
- package/lib/table/table.js +3 -2
- package/lib/table/table.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-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 +3 -2
- package/lib/tntd-select/_util/PurePanel.d.ts.map +1 -1
- package/lib/tntd-select/_util/PurePanel.js +4 -19
- package/lib/tntd-select/_util/PurePanel.js.map +1 -1
- 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 +5 -4
- package/lib/tntd-select/_util/motion.d.ts.map +1 -1
- package/lib/tntd-select/_util/motion.js +16 -8
- package/lib/tntd-select/_util/motion.js.map +1 -1
- 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 +3 -4
- package/lib/tntd-select/_util/warning.d.ts.map +1 -1
- package/lib/tntd-select/_util/warning.js +13 -5
- package/lib/tntd-select/_util/warning.js.map +1 -1
- 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,80 @@
|
|
|
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 commonUtil_1 = require("../utils/commonUtil");
|
|
28
|
+
const valueUtil_1 = require("../utils/valueUtil");
|
|
29
|
+
function includes(test, search) {
|
|
30
|
+
return (0, commonUtil_1.toArray)(test).join('').toUpperCase().includes(search);
|
|
31
|
+
}
|
|
32
|
+
exports.default = (options, fieldNames, searchValue, filterOption, optionFilterProp) => React.useMemo(() => {
|
|
33
|
+
if (!searchValue || filterOption === false) {
|
|
34
|
+
return options;
|
|
35
|
+
}
|
|
36
|
+
const { options: fieldOptions, label: fieldLabel, value: fieldValue } = fieldNames;
|
|
37
|
+
const filteredOptions = [];
|
|
38
|
+
const customizeFilter = typeof filterOption === 'function';
|
|
39
|
+
const upperSearch = searchValue.toUpperCase();
|
|
40
|
+
const filterFunc = customizeFilter
|
|
41
|
+
? filterOption
|
|
42
|
+
: (_, option) => {
|
|
43
|
+
// Use provided `optionFilterProp`
|
|
44
|
+
if (optionFilterProp) {
|
|
45
|
+
return includes(option[optionFilterProp], upperSearch);
|
|
46
|
+
}
|
|
47
|
+
// Auto select `label` or `value` by option type
|
|
48
|
+
if (option[fieldOptions]) {
|
|
49
|
+
// hack `fieldLabel` since `OptionGroup` children is not `label`
|
|
50
|
+
return includes(option[fieldLabel !== 'children' ? fieldLabel : 'label'], upperSearch);
|
|
51
|
+
}
|
|
52
|
+
return includes(option[fieldValue], upperSearch);
|
|
53
|
+
};
|
|
54
|
+
const wrapOption = customizeFilter
|
|
55
|
+
? (opt) => (0, valueUtil_1.injectPropsWithOption)(opt)
|
|
56
|
+
: (opt) => opt;
|
|
57
|
+
options.forEach((item) => {
|
|
58
|
+
// Group should check child options
|
|
59
|
+
if (item[fieldOptions]) {
|
|
60
|
+
// Check group first
|
|
61
|
+
const matchGroup = filterFunc(searchValue, wrapOption(item));
|
|
62
|
+
if (matchGroup) {
|
|
63
|
+
filteredOptions.push(item);
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
// Check option
|
|
67
|
+
const subOptions = item[fieldOptions].filter((subItem) => filterFunc(searchValue, wrapOption(subItem)));
|
|
68
|
+
if (subOptions.length) {
|
|
69
|
+
filteredOptions.push(Object.assign(Object.assign({}, item), { [fieldOptions]: subOptions }));
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
if (filterFunc(searchValue, wrapOption(item))) {
|
|
75
|
+
filteredOptions.push(item);
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
return filteredOptions;
|
|
79
|
+
}, [options, filterOption, optionFilterProp, searchValue, fieldNames]);
|
|
80
|
+
//# sourceMappingURL=useFilterOptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFilterOptions.js","sourceRoot":"","sources":["../../../../src/tntd-select/rc-select/hooks/useFilterOptions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA+B;AAC/B,oDAA8C;AAE9C,kDAA2D;AAE3D,SAAS,QAAQ,CAAC,IAAqB,EAAE,MAAc;IACrD,OAAO,IAAA,oBAAO,EAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAC/D,CAAC;AAED,kBAAe,CACb,OAA4B,EAC5B,UAAsB,EACtB,WAAoB,EACpB,YAA0C,EAC1C,gBAAyB,EACzB,EAAE,CACF,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;IACjB,IAAI,CAAC,WAAW,IAAI,YAAY,KAAK,KAAK,EAAE;QAC1C,OAAO,OAAO,CAAC;KAChB;IAED,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,UAAU,CAAC;IACnF,MAAM,eAAe,GAAwB,EAAE,CAAC;IAEhD,MAAM,eAAe,GAAG,OAAO,YAAY,KAAK,UAAU,CAAC;IAE3D,MAAM,WAAW,GAAG,WAAW,CAAC,WAAW,EAAE,CAAC;IAC9C,MAAM,UAAU,GAAG,eAAe;QAChC,CAAC,CAAC,YAAY;QACd,CAAC,CAAC,CAAC,CAAS,EAAE,MAAyB,EAAE,EAAE;YACvC,kCAAkC;YAClC,IAAI,gBAAgB,EAAE;gBACpB,OAAO,QAAQ,CAAC,MAAM,CAAC,gBAAgB,CAAC,EAAE,WAAW,CAAC,CAAC;aACxD;YAED,gDAAgD;YAChD,IAAI,MAAM,CAAC,YAAY,CAAC,EAAE;gBACxB,gEAAgE;gBAChE,OAAO,QAAQ,CAAC,MAAM,CAAC,UAAU,KAAK,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC,CAAC;aACxF;YAED,OAAO,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,WAAW,CAAC,CAAC;QACnD,CAAC,CAAC;IAEN,MAAM,UAAU,GAAkD,eAAe;QAC/E,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,iCAAqB,EAAC,GAAG,CAAC;QACrC,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC;IAEjB,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACvB,mCAAmC;QACnC,IAAI,IAAI,CAAC,YAAY,CAAC,EAAE;YACtB,oBAAoB;YACpB,MAAM,UAAU,GAAG,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;YAC7D,IAAI,UAAU,EAAE;gBACd,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aAC5B;iBAAM;gBACL,eAAe;gBACf,MAAM,UAAU,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC,OAA0B,EAAE,EAAE,CAC1E,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC,CAC7C,CAAC;gBACF,IAAI,UAAU,CAAC,MAAM,EAAE;oBACrB,eAAe,CAAC,IAAI,iCACf,IAAI,KACP,CAAC,YAAY,CAAC,EAAE,UAAU,IAC1B,CAAC;iBACJ;aACF;YAED,OAAO;SACR;QAED,IAAI,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC,EAAE;YAC7C,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SAC5B;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,eAAe,CAAC;AACzB,CAAC,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport { toArray } from '../utils/commonUtil';\nimport type { FieldNames, DefaultOptionType, SelectProps } from '../Select';\nimport { injectPropsWithOption } from '../utils/valueUtil';\n\nfunction includes(test: React.ReactNode, search: string) {\n return toArray(test).join('').toUpperCase().includes(search);\n}\n\nexport default (\n options: DefaultOptionType[],\n fieldNames: FieldNames,\n searchValue?: string,\n filterOption?: SelectProps['filterOption'],\n optionFilterProp?: string,\n) =>\n React.useMemo(() => {\n if (!searchValue || filterOption === false) {\n return options;\n }\n\n const { options: fieldOptions, label: fieldLabel, value: fieldValue } = fieldNames;\n const filteredOptions: DefaultOptionType[] = [];\n\n const customizeFilter = typeof filterOption === 'function';\n\n const upperSearch = searchValue.toUpperCase();\n const filterFunc = customizeFilter\n ? filterOption\n : (_: string, option: DefaultOptionType) => {\n // Use provided `optionFilterProp`\n if (optionFilterProp) {\n return includes(option[optionFilterProp], upperSearch);\n }\n\n // Auto select `label` or `value` by option type\n if (option[fieldOptions]) {\n // hack `fieldLabel` since `OptionGroup` children is not `label`\n return includes(option[fieldLabel !== 'children' ? fieldLabel : 'label'], upperSearch);\n }\n\n return includes(option[fieldValue], upperSearch);\n };\n\n const wrapOption: (opt: DefaultOptionType) => DefaultOptionType = customizeFilter\n ? (opt) => injectPropsWithOption(opt)\n : (opt) => opt;\n\n options.forEach((item) => {\n // Group should check child options\n if (item[fieldOptions]) {\n // Check group first\n const matchGroup = filterFunc(searchValue, wrapOption(item));\n if (matchGroup) {\n filteredOptions.push(item);\n } else {\n // Check option\n const subOptions = item[fieldOptions].filter((subItem: DefaultOptionType) =>\n filterFunc(searchValue, wrapOption(subItem)),\n );\n if (subOptions.length) {\n filteredOptions.push({\n ...item,\n [fieldOptions]: subOptions,\n });\n }\n }\n\n return;\n }\n\n if (filterFunc(searchValue, wrapOption(item))) {\n filteredOptions.push(item);\n }\n });\n\n return filteredOptions;\n }, [options, filterOption, optionFilterProp, searchValue, fieldNames]);\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Is client side and not jsdom */
|
|
2
|
+
export declare const isBrowserClient: boolean;
|
|
3
|
+
/** Get unique id for accessibility usage */
|
|
4
|
+
export declare function getUUID(): number | string;
|
|
5
|
+
export default function useId(id?: string): string | undefined;
|
|
6
|
+
//# sourceMappingURL=useId.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useId.d.ts","sourceRoot":"","sources":["../../../../src/tntd-select/rc-select/hooks/useId.ts"],"names":[],"mappings":"AAKA,mCAAmC;AACnC,eAAO,MAAM,eAAe,SAAiD,CAAC;AAE9E,4CAA4C;AAC5C,wBAAgB,OAAO,IAAI,MAAM,GAAG,MAAM,CAazC;AAED,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAE,CAAC,EAAE,MAAM,sBAOxC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
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.getUUID = exports.isBrowserClient = void 0;
|
|
30
|
+
const React = __importStar(require("react"));
|
|
31
|
+
const canUseDom_1 = __importDefault(require("rc-util/lib/Dom/canUseDom"));
|
|
32
|
+
let uuid = 0;
|
|
33
|
+
/** Is client side and not jsdom */
|
|
34
|
+
exports.isBrowserClient = process.env.NODE_ENV !== 'test' && (0, canUseDom_1.default)();
|
|
35
|
+
/** Get unique id for accessibility usage */
|
|
36
|
+
function getUUID() {
|
|
37
|
+
let retId;
|
|
38
|
+
// Test never reach
|
|
39
|
+
/* istanbul ignore if */
|
|
40
|
+
if (exports.isBrowserClient) {
|
|
41
|
+
retId = uuid;
|
|
42
|
+
uuid += 1;
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
retId = 'TEST_OR_SSR';
|
|
46
|
+
}
|
|
47
|
+
return retId;
|
|
48
|
+
}
|
|
49
|
+
exports.getUUID = getUUID;
|
|
50
|
+
function useId(id) {
|
|
51
|
+
// Inner id for accessibility usage. Only work in client side
|
|
52
|
+
const [innerId, setInnerId] = React.useState();
|
|
53
|
+
React.useEffect(() => {
|
|
54
|
+
setInnerId(`rc_select_${getUUID()}`);
|
|
55
|
+
}, []);
|
|
56
|
+
return id || innerId;
|
|
57
|
+
}
|
|
58
|
+
exports.default = useId;
|
|
59
|
+
//# sourceMappingURL=useId.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useId.js","sourceRoot":"","sources":["../../../../src/tntd-select/rc-select/hooks/useId.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA+B;AAC/B,0EAAkD;AAElD,IAAI,IAAI,GAAG,CAAC,CAAC;AAEb,mCAAmC;AACtB,QAAA,eAAe,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM,IAAI,IAAA,mBAAS,GAAE,CAAC;AAE9E,4CAA4C;AAC5C,SAAgB,OAAO;IACrB,IAAI,KAAsB,CAAC;IAE3B,mBAAmB;IACnB,wBAAwB;IACxB,IAAI,uBAAe,EAAE;QACnB,KAAK,GAAG,IAAI,CAAC;QACb,IAAI,IAAI,CAAC,CAAC;KACX;SAAM;QACL,KAAK,GAAG,aAAa,CAAC;KACvB;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAbD,0BAaC;AAED,SAAwB,KAAK,CAAC,EAAW;IACvC,6DAA6D;IAC7D,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAU,CAAC;IACvD,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,UAAU,CAAC,aAAa,OAAO,EAAE,EAAE,CAAC,CAAC;IACvC,CAAC,EAAE,EAAE,CAAC,CAAC;IACP,OAAO,EAAE,IAAI,OAAO,CAAC;AACvB,CAAC;AAPD,wBAOC","sourcesContent":["import * as React from 'react';\nimport canUseDom from 'rc-util/lib/Dom/canUseDom';\n\nlet uuid = 0;\n\n/** Is client side and not jsdom */\nexport const isBrowserClient = process.env.NODE_ENV !== 'test' && canUseDom();\n\n/** Get unique id for accessibility usage */\nexport function getUUID(): number | string {\n let retId: string | number;\n\n // Test never reach\n /* istanbul ignore if */\n if (isBrowserClient) {\n retId = uuid;\n uuid += 1;\n } else {\n retId = 'TEST_OR_SSR';\n }\n\n return retId;\n}\n\nexport default function useId(id?: string) {\n // Inner id for accessibility usage. Only work in client side\n const [innerId, setInnerId] = React.useState<string>();\n React.useEffect(() => {\n setInnerId(`rc_select_${getUUID()}`);\n }, []);\n return id || innerId;\n}\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Wrap `React.useLayoutEffect` which will not throw warning message in test env
|
|
4
|
+
*/
|
|
5
|
+
export default function useLayoutEffect(effect: React.EffectCallback, deps?: React.DependencyList): void;
|
|
6
|
+
//# sourceMappingURL=useLayoutEffect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLayoutEffect.d.ts","sourceRoot":"","sources":["../../../../src/tntd-select/rc-select/hooks/useLayoutEffect.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,EAAE,IAAI,CAAC,EAAE,KAAK,CAAC,cAAc,QAQhG"}
|
|
@@ -0,0 +1,44 @@
|
|
|
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
|
+
/* eslint-disable react-hooks/rules-of-hooks */
|
|
27
|
+
const React = __importStar(require("react"));
|
|
28
|
+
const commonUtil_1 = require("../utils/commonUtil");
|
|
29
|
+
/**
|
|
30
|
+
* Wrap `React.useLayoutEffect` which will not throw warning message in test env
|
|
31
|
+
*/
|
|
32
|
+
function useLayoutEffect(effect, deps) {
|
|
33
|
+
// Never happen in test env
|
|
34
|
+
if (commonUtil_1.isBrowserClient) {
|
|
35
|
+
/* istanbul ignore next */
|
|
36
|
+
React.useLayoutEffect(effect, deps);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
React.useEffect(effect, deps);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.default = useLayoutEffect;
|
|
43
|
+
/* eslint-enable */
|
|
44
|
+
//# sourceMappingURL=useLayoutEffect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLayoutEffect.js","sourceRoot":"","sources":["../../../../src/tntd-select/rc-select/hooks/useLayoutEffect.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA+C;AAC/C,6CAA+B;AAC/B,oDAAsD;AAEtD;;GAEG;AACH,SAAwB,eAAe,CAAC,MAA4B,EAAE,IAA2B;IAC/F,2BAA2B;IAC3B,IAAI,4BAAe,EAAE;QACnB,0BAA0B;QAC1B,KAAK,CAAC,eAAe,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;KACrC;SAAM;QACL,KAAK,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;KAC/B;AACH,CAAC;AARD,kCAQC;AACD,mBAAmB","sourcesContent":["/* eslint-disable react-hooks/rules-of-hooks */\nimport * as React from 'react';\nimport { isBrowserClient } from '../utils/commonUtil';\n\n/**\n * Wrap `React.useLayoutEffect` which will not throw warning message in test env\n */\nexport default function useLayoutEffect(effect: React.EffectCallback, deps?: React.DependencyList) {\n // Never happen in test env\n if (isBrowserClient) {\n /* istanbul ignore next */\n React.useLayoutEffect(effect, deps);\n } else {\n React.useEffect(effect, deps);\n }\n}\n/* eslint-enable */\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Locker return cached mark.
|
|
3
|
+
* If set to `true`, will return `true` in a short time even if set `false`.
|
|
4
|
+
* If set to `false` and then set to `true`, will change to `true`.
|
|
5
|
+
* And after time duration, it will back to `null` automatically.
|
|
6
|
+
*/
|
|
7
|
+
export default function useLock(duration?: number): [() => boolean, (lock: boolean) => void];
|
|
8
|
+
//# sourceMappingURL=useLock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLock.d.ts","sourceRoot":"","sources":["../../../../src/tntd-select/rc-select/hooks/useLock.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,QAAQ,GAAE,MAAY,GAAG,CAAC,MAAM,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC,CAwBhG"}
|
|
@@ -0,0 +1,52 @@
|
|
|
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
|
+
/**
|
|
28
|
+
* Locker return cached mark.
|
|
29
|
+
* If set to `true`, will return `true` in a short time even if set `false`.
|
|
30
|
+
* If set to `false` and then set to `true`, will change to `true`.
|
|
31
|
+
* And after time duration, it will back to `null` automatically.
|
|
32
|
+
*/
|
|
33
|
+
function useLock(duration = 250) {
|
|
34
|
+
const lockRef = React.useRef(null);
|
|
35
|
+
const timeoutRef = React.useRef(null);
|
|
36
|
+
// Clean up
|
|
37
|
+
React.useEffect(() => () => {
|
|
38
|
+
window.clearTimeout(timeoutRef.current);
|
|
39
|
+
}, []);
|
|
40
|
+
function doLock(locked) {
|
|
41
|
+
if (locked || lockRef.current === null) {
|
|
42
|
+
lockRef.current = locked;
|
|
43
|
+
}
|
|
44
|
+
window.clearTimeout(timeoutRef.current);
|
|
45
|
+
timeoutRef.current = window.setTimeout(() => {
|
|
46
|
+
lockRef.current = null;
|
|
47
|
+
}, duration);
|
|
48
|
+
}
|
|
49
|
+
return [() => lockRef.current, doLock];
|
|
50
|
+
}
|
|
51
|
+
exports.default = useLock;
|
|
52
|
+
//# sourceMappingURL=useLock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLock.js","sourceRoot":"","sources":["../../../../src/tntd-select/rc-select/hooks/useLock.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA+B;AAE/B;;;;;GAKG;AACH,SAAwB,OAAO,CAAC,WAAmB,GAAG;IACpD,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAU,IAAI,CAAC,CAAC;IAC5C,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAS,IAAI,CAAC,CAAC;IAE9C,WAAW;IACX,KAAK,CAAC,SAAS,CACb,GAAG,EAAE,CAAC,GAAG,EAAE;QACT,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IAC1C,CAAC,EACD,EAAE,CACH,CAAC;IAEF,SAAS,MAAM,CAAC,MAAe;QAC7B,IAAI,MAAM,IAAI,OAAO,CAAC,OAAO,KAAK,IAAI,EAAE;YACtC,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC;SAC1B;QAED,MAAM,CAAC,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QACxC,UAAU,CAAC,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE;YAC1C,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;QACzB,CAAC,EAAE,QAAQ,CAAC,CAAC;IACf,CAAC;IAED,OAAO,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;AACzC,CAAC;AAxBD,0BAwBC","sourcesContent":["import * as React from 'react';\n\n/**\n * Locker return cached mark.\n * If set to `true`, will return `true` in a short time even if set `false`.\n * If set to `false` and then set to `true`, will change to `true`.\n * And after time duration, it will back to `null` automatically.\n */\nexport default function useLock(duration: number = 250): [() => boolean, (lock: boolean) => void] {\n const lockRef = React.useRef<boolean>(null);\n const timeoutRef = React.useRef<number>(null);\n\n // Clean up\n React.useEffect(\n () => () => {\n window.clearTimeout(timeoutRef.current);\n },\n [],\n );\n\n function doLock(locked: boolean) {\n if (locked || lockRef.current === null) {\n lockRef.current = locked;\n }\n\n window.clearTimeout(timeoutRef.current);\n timeoutRef.current = window.setTimeout(() => {\n lockRef.current = null;\n }, duration);\n }\n\n return [() => lockRef.current, doLock];\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { FieldNames, RawValueType } from '../Select';
|
|
3
|
+
/**
|
|
4
|
+
* Parse `children` to `options` if `options` is not provided.
|
|
5
|
+
* Then flatten the `options`.
|
|
6
|
+
*/
|
|
7
|
+
export default function useOptions<OptionType>(options: OptionType[], children: React.ReactNode, fieldNames: FieldNames, optionFilterProp: string, optionLabelProp: string): {
|
|
8
|
+
options: OptionType[];
|
|
9
|
+
valueOptions: Map<RawValueType, OptionType>;
|
|
10
|
+
labelOptions: Map<React.ReactNode, OptionType>;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=useOptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useOptions.d.ts","sourceRoot":"","sources":["../../../../src/tntd-select/rc-select/hooks/useOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAG1D;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,UAAU,EAC3C,OAAO,EAAE,UAAU,EAAE,EACrB,QAAQ,EAAE,KAAK,CAAC,SAAS,EACzB,UAAU,EAAE,UAAU,EACtB,gBAAgB,EAAE,MAAM,EACxB,eAAe,EAAE,MAAM;;;;EA0CxB"}
|
|
@@ -0,0 +1,71 @@
|
|
|
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 legacyUtil_1 = require("../utils/legacyUtil");
|
|
28
|
+
/**
|
|
29
|
+
* Parse `children` to `options` if `options` is not provided.
|
|
30
|
+
* Then flatten the `options`.
|
|
31
|
+
*/
|
|
32
|
+
function useOptions(options, children, fieldNames, optionFilterProp, optionLabelProp) {
|
|
33
|
+
return React.useMemo(() => {
|
|
34
|
+
let mergedOptions = options;
|
|
35
|
+
const childrenAsData = !options;
|
|
36
|
+
if (childrenAsData) {
|
|
37
|
+
mergedOptions = (0, legacyUtil_1.convertChildrenToData)(children);
|
|
38
|
+
}
|
|
39
|
+
const valueOptions = new Map();
|
|
40
|
+
const labelOptions = new Map();
|
|
41
|
+
const setLabelOptions = (labelOptionsMap, option, key) => {
|
|
42
|
+
if (key && typeof key === 'string') {
|
|
43
|
+
labelOptionsMap.set(option[key], option);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
function dig(optionList, isChildren = false) {
|
|
47
|
+
// for loop to speed up collection speed
|
|
48
|
+
for (let i = 0; i < optionList.length; i += 1) {
|
|
49
|
+
const option = optionList[i];
|
|
50
|
+
if (!option[fieldNames.options] || isChildren) {
|
|
51
|
+
valueOptions.set(option[fieldNames.value], option);
|
|
52
|
+
setLabelOptions(labelOptions, option, fieldNames.label);
|
|
53
|
+
// https://github.com/ant-design/ant-design/issues/35304
|
|
54
|
+
setLabelOptions(labelOptions, option, optionFilterProp);
|
|
55
|
+
setLabelOptions(labelOptions, option, optionLabelProp);
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
dig(option[fieldNames.options], true);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
dig(mergedOptions);
|
|
63
|
+
return {
|
|
64
|
+
options: mergedOptions,
|
|
65
|
+
valueOptions,
|
|
66
|
+
labelOptions,
|
|
67
|
+
};
|
|
68
|
+
}, [options, children, fieldNames, optionFilterProp, optionLabelProp]);
|
|
69
|
+
}
|
|
70
|
+
exports.default = useOptions;
|
|
71
|
+
//# sourceMappingURL=useOptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useOptions.js","sourceRoot":"","sources":["../../../../src/tntd-select/rc-select/hooks/useOptions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA+B;AAE/B,oDAA4D;AAE5D;;;GAGG;AACH,SAAwB,UAAU,CAChC,OAAqB,EACrB,QAAyB,EACzB,UAAsB,EACtB,gBAAwB,EACxB,eAAuB;IAEvB,OAAO,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QACxB,IAAI,aAAa,GAAG,OAAO,CAAC;QAC5B,MAAM,cAAc,GAAG,CAAC,OAAO,CAAC;QAEhC,IAAI,cAAc,EAAE;YAClB,aAAa,GAAG,IAAA,kCAAqB,EAAC,QAAQ,CAAC,CAAC;SACjD;QAED,MAAM,YAAY,GAAG,IAAI,GAAG,EAA4B,CAAC;QACzD,MAAM,YAAY,GAAG,IAAI,GAAG,EAA+B,CAAC;QAE5D,MAAM,eAAe,GAAG,CAAC,eAAe,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE;YACvD,IAAI,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;gBAClC,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC;aAC1C;QACH,CAAC,CAAC;QAEF,SAAS,GAAG,CAAC,UAAwB,EAAE,UAAU,GAAG,KAAK;YACvD,wCAAwC;YACxC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;gBAC7C,MAAM,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;gBAC7B,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,UAAU,EAAE;oBAC7C,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC;oBACnD,eAAe,CAAC,YAAY,EAAE,MAAM,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;oBACxD,wDAAwD;oBACxD,eAAe,CAAC,YAAY,EAAE,MAAM,EAAE,gBAAgB,CAAC,CAAC;oBACxD,eAAe,CAAC,YAAY,EAAE,MAAM,EAAE,eAAe,CAAC,CAAC;iBACxD;qBAAM;oBACL,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,CAAC;iBACvC;aACF;QACH,CAAC;QACD,GAAG,CAAC,aAAa,CAAC,CAAC;QAEnB,OAAO;YACL,OAAO,EAAE,aAAa;YACtB,YAAY;YACZ,YAAY;SACb,CAAC;IACJ,CAAC,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,gBAAgB,EAAE,eAAe,CAAC,CAAC,CAAC;AACzE,CAAC;AA/CD,6BA+CC","sourcesContent":["import * as React from 'react';\nimport type { FieldNames, RawValueType } from '../Select';\nimport { convertChildrenToData } from '../utils/legacyUtil';\n\n/**\n * Parse `children` to `options` if `options` is not provided.\n * Then flatten the `options`.\n */\nexport default function useOptions<OptionType>(\n options: OptionType[],\n children: React.ReactNode,\n fieldNames: FieldNames,\n optionFilterProp: string,\n optionLabelProp: string,\n) {\n return React.useMemo(() => {\n let mergedOptions = options;\n const childrenAsData = !options;\n\n if (childrenAsData) {\n mergedOptions = convertChildrenToData(children);\n }\n\n const valueOptions = new Map<RawValueType, OptionType>();\n const labelOptions = new Map<React.ReactNode, OptionType>();\n\n const setLabelOptions = (labelOptionsMap, option, key) => {\n if (key && typeof key === 'string') {\n labelOptionsMap.set(option[key], option);\n }\n };\n\n function dig(optionList: OptionType[], isChildren = false) {\n // for loop to speed up collection speed\n for (let i = 0; i < optionList.length; i += 1) {\n const option = optionList[i];\n if (!option[fieldNames.options] || isChildren) {\n valueOptions.set(option[fieldNames.value], option);\n setLabelOptions(labelOptions, option, fieldNames.label);\n // https://github.com/ant-design/ant-design/issues/35304\n setLabelOptions(labelOptions, option, optionFilterProp);\n setLabelOptions(labelOptions, option, optionLabelProp);\n } else {\n dig(option[fieldNames.options], true);\n }\n }\n }\n dig(mergedOptions);\n\n return {\n options: mergedOptions,\n valueOptions,\n labelOptions,\n };\n }, [options, children, fieldNames, optionFilterProp, optionLabelProp]);\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRefFunc.d.ts","sourceRoot":"","sources":["../../../../src/tntd-select/rc-select/hooks/useRefFunc.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC,CASpF"}
|
|
@@ -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 React = __importStar(require("react"));
|
|
27
|
+
/**
|
|
28
|
+
* Same as `React.useCallback` but always return a memoized function
|
|
29
|
+
* but redirect to real function.
|
|
30
|
+
*/
|
|
31
|
+
function useRefFunc(callback) {
|
|
32
|
+
const funcRef = React.useRef();
|
|
33
|
+
funcRef.current = callback;
|
|
34
|
+
const cacheFn = React.useCallback((...args) => {
|
|
35
|
+
return funcRef.current(...args);
|
|
36
|
+
}, []);
|
|
37
|
+
return cacheFn;
|
|
38
|
+
}
|
|
39
|
+
exports.default = useRefFunc;
|
|
40
|
+
//# sourceMappingURL=useRefFunc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRefFunc.js","sourceRoot":"","sources":["../../../../src/tntd-select/rc-select/hooks/useRefFunc.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA+B;AAE/B;;;GAGG;AACH,SAAwB,UAAU,CAAoC,QAAW;IAC/E,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,EAAK,CAAC;IAClC,OAAO,CAAC,OAAO,GAAG,QAAQ,CAAC;IAE3B,MAAM,OAAO,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,GAAG,IAAW,EAAE,EAAE;QACnD,OAAO,OAAO,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC;IAClC,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,OAAc,CAAC;AACxB,CAAC;AATD,6BASC","sourcesContent":["import * as React from 'react';\n\n/**\n * Same as `React.useCallback` but always return a memoized function\n * but redirect to real function.\n */\nexport default function useRefFunc<T extends (...args: any[]) => any>(callback: T): T {\n const funcRef = React.useRef<T>();\n funcRef.current = callback;\n\n const cacheFn = React.useCallback((...args: any[]) => {\n return funcRef.current(...args);\n }, []);\n\n return cacheFn as any;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSelectTriggerControl.d.ts","sourceRoot":"","sources":["../../../../src/tntd-select/rc-select/hooks/useSelectTriggerControl.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAC7C,QAAQ,EAAE,MAAM,CAAC,WAAW,GAAG,SAAS,CAAC,EAAE,EAC3C,IAAI,EAAE,OAAO,EACb,WAAW,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,EACpC,iBAAiB,EAAE,OAAO,QAoC3B"}
|
|
@@ -0,0 +1,58 @@
|
|
|
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
|
+
function useSelectTriggerControl(elements, open, triggerOpen, customizedTrigger) {
|
|
28
|
+
const propsRef = React.useRef(null);
|
|
29
|
+
propsRef.current = {
|
|
30
|
+
open,
|
|
31
|
+
triggerOpen,
|
|
32
|
+
customizedTrigger,
|
|
33
|
+
};
|
|
34
|
+
React.useEffect(() => {
|
|
35
|
+
function onGlobalMouseDown(event) {
|
|
36
|
+
var _a;
|
|
37
|
+
// If trigger is customized, Trigger will take control of popupVisible
|
|
38
|
+
if ((_a = propsRef.current) === null || _a === void 0 ? void 0 : _a.customizedTrigger) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
let target = event.target;
|
|
42
|
+
if (target.shadowRoot && event.composed) {
|
|
43
|
+
target = (event.composedPath()[0] || target);
|
|
44
|
+
}
|
|
45
|
+
if (propsRef.current.open &&
|
|
46
|
+
elements()
|
|
47
|
+
.filter((element) => element)
|
|
48
|
+
.every((element) => !element.contains(target) && element !== target)) {
|
|
49
|
+
// Should trigger close
|
|
50
|
+
propsRef.current.triggerOpen(false);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
window.addEventListener('mousedown', onGlobalMouseDown);
|
|
54
|
+
return () => window.removeEventListener('mousedown', onGlobalMouseDown);
|
|
55
|
+
}, []);
|
|
56
|
+
}
|
|
57
|
+
exports.default = useSelectTriggerControl;
|
|
58
|
+
//# sourceMappingURL=useSelectTriggerControl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSelectTriggerControl.js","sourceRoot":"","sources":["../../../../src/tntd-select/rc-select/hooks/useSelectTriggerControl.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA+B;AAE/B,SAAwB,uBAAuB,CAC7C,QAA2C,EAC3C,IAAa,EACb,WAAoC,EACpC,iBAA0B;IAE1B,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACpC,QAAQ,CAAC,OAAO,GAAG;QACjB,IAAI;QACJ,WAAW;QACX,iBAAiB;KAClB,CAAC;IAEF,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,SAAS,iBAAiB,CAAC,KAAiB;;YAC1C,sEAAsE;YACtE,IAAI,MAAA,QAAQ,CAAC,OAAO,0CAAE,iBAAiB,EAAE;gBACvC,OAAO;aACR;YAED,IAAI,MAAM,GAAG,KAAK,CAAC,MAAqB,CAAC;YAEzC,IAAI,MAAM,CAAC,UAAU,IAAI,KAAK,CAAC,QAAQ,EAAE;gBACvC,MAAM,GAAG,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,IAAI,MAAM,CAAgB,CAAC;aAC7D;YAED,IACE,QAAQ,CAAC,OAAO,CAAC,IAAI;gBACrB,QAAQ,EAAE;qBACP,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC;qBAC5B,KAAK,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,OAAO,KAAK,MAAM,CAAC,EACtE;gBACA,uBAAuB;gBACvB,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;aACrC;QACH,CAAC;QAED,MAAM,CAAC,gBAAgB,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC;QACxD,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC,mBAAmB,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC;IAC1E,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC;AAxCD,0CAwCC","sourcesContent":["import * as React from 'react';\n\nexport default function useSelectTriggerControl(\n elements: () => (HTMLElement | undefined)[],\n open: boolean,\n triggerOpen: (open: boolean) => void,\n customizedTrigger: boolean,\n) {\n const propsRef = React.useRef(null);\n propsRef.current = {\n open,\n triggerOpen,\n customizedTrigger,\n };\n\n React.useEffect(() => {\n function onGlobalMouseDown(event: MouseEvent) {\n // If trigger is customized, Trigger will take control of popupVisible\n if (propsRef.current?.customizedTrigger) {\n return;\n }\n\n let target = event.target as HTMLElement;\n\n if (target.shadowRoot && event.composed) {\n target = (event.composedPath()[0] || target) as HTMLElement;\n }\n\n if (\n propsRef.current.open &&\n elements()\n .filter((element) => element)\n .every((element) => !element.contains(target) && element !== target)\n ) {\n // Should trigger close\n propsRef.current.triggerOpen(false);\n }\n }\n\n window.addEventListener('mousedown', onGlobalMouseDown);\n return () => window.removeEventListener('mousedown', onGlobalMouseDown);\n }, []);\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import Select from './Select';
|
|
2
|
+
import Option from './Option';
|
|
3
|
+
import OptGroup from './OptGroup';
|
|
4
|
+
import type { SelectProps } from './Select';
|
|
5
|
+
import BaseSelect from './BaseSelect';
|
|
6
|
+
import type { BaseSelectProps, BaseSelectRef, BaseSelectPropsWithoutPrivate } from './BaseSelect';
|
|
7
|
+
import useBaseProps from './hooks/useBaseProps';
|
|
8
|
+
export { Option, OptGroup, BaseSelect, useBaseProps };
|
|
9
|
+
export type { SelectProps, BaseSelectProps, BaseSelectRef, BaseSelectPropsWithoutPrivate };
|
|
10
|
+
export default Select;
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tntd-select/rc-select/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,6BAA6B,EAAE,MAAM,cAAc,CAAC;AAClG,OAAO,YAAY,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,CAAC;AACtD,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,aAAa,EAAE,6BAA6B,EAAE,CAAC;AAE3F,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.useBaseProps = exports.BaseSelect = exports.OptGroup = exports.Option = void 0;
|
|
7
|
+
const Select_1 = __importDefault(require("./Select"));
|
|
8
|
+
const Option_1 = __importDefault(require("./Option"));
|
|
9
|
+
exports.Option = Option_1.default;
|
|
10
|
+
const OptGroup_1 = __importDefault(require("./OptGroup"));
|
|
11
|
+
exports.OptGroup = OptGroup_1.default;
|
|
12
|
+
const BaseSelect_1 = __importDefault(require("./BaseSelect"));
|
|
13
|
+
exports.BaseSelect = BaseSelect_1.default;
|
|
14
|
+
const useBaseProps_1 = __importDefault(require("./hooks/useBaseProps"));
|
|
15
|
+
exports.useBaseProps = useBaseProps_1.default;
|
|
16
|
+
exports.default = Select_1.default;
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tntd-select/rc-select/index.ts"],"names":[],"mappings":";;;;;;AAAA,sDAA8B;AAC9B,sDAA8B;AAOrB,iBAPF,gBAAM,CAOE;AANf,0DAAkC;AAMjB,mBANV,kBAAQ,CAMU;AAJzB,8DAAsC;AAIX,qBAJpB,oBAAU,CAIoB;AAFrC,wEAAgD;AAET,uBAFhC,sBAAY,CAEgC;AAGnD,kBAAe,gBAAM,CAAC","sourcesContent":["import Select from './Select';\nimport Option from './Option';\nimport OptGroup from './OptGroup';\nimport type { SelectProps } from './Select';\nimport BaseSelect from './BaseSelect';\nimport type { BaseSelectProps, BaseSelectRef, BaseSelectPropsWithoutPrivate } from './BaseSelect';\nimport useBaseProps from './hooks/useBaseProps';\n\nexport { Option, OptGroup, BaseSelect, useBaseProps };\nexport type { SelectProps, BaseSelectProps, BaseSelectRef, BaseSelectPropsWithoutPrivate };\n\nexport default Select;\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
export declare type RawValueType = string | number;
|
|
3
|
+
export interface FlattenOptionData<OptionType> {
|
|
4
|
+
label?: React.ReactNode;
|
|
5
|
+
data: OptionType;
|
|
6
|
+
key: React.Key;
|
|
7
|
+
value?: RawValueType;
|
|
8
|
+
groupOption?: boolean;
|
|
9
|
+
group?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface DisplayValueType {
|
|
12
|
+
key?: React.Key;
|
|
13
|
+
value?: RawValueType;
|
|
14
|
+
label?: React.ReactNode;
|
|
15
|
+
title?: string | number;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare type RenderNode = React.ReactNode | ((props: any) => React.ReactNode);
|
|
19
|
+
export declare type RenderDOMFunc = (props: any) => HTMLElement;
|
|
20
|
+
export declare type Mode = 'multiple' | 'tags' | 'combobox';
|
|
21
|
+
export declare type Placement = 'bottomLeft' | 'bottomRight' | 'topLeft' | 'topRight';
|
|
22
|
+
export declare type DisplayInfoType = 'add' | 'remove' | 'clear';
|
|
23
|
+
//# sourceMappingURL=interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../src/tntd-select/rc-select/interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAEpC,oBAAY,YAAY,GAAG,MAAM,GAAG,MAAM,CAAC;AAC3C,MAAM,WAAW,iBAAiB,CAAC,UAAU;IAC3C,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,IAAI,EAAE,UAAU,CAAC;IACjB,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC;IACf,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC/B,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC;IAChB,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,oBAAY,UAAU,GAAG,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;AAE7E,oBAAY,aAAa,GAAG,CAAC,KAAK,EAAE,GAAG,KAAK,WAAW,CAAC;AAExD,oBAAY,IAAI,GAAG,UAAU,GAAG,MAAM,GAAG,UAAU,CAAC;AAEpD,oBAAY,SAAS,GAAG,YAAY,GAAG,aAAa,GAAG,SAAS,GAAG,UAAU,CAAC;AAE9E,oBAAY,eAAe,GAAG,KAAK,GAAG,QAAQ,GAAG,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../src/tntd-select/rc-select/interface.ts"],"names":[],"mappings":"","sourcesContent":["import type * as React from 'react';\n\nexport type RawValueType = string | number;\nexport interface FlattenOptionData<OptionType> {\n label?: React.ReactNode;\n data: OptionType;\n key: React.Key;\n value?: RawValueType;\n groupOption?: boolean;\n group?: boolean;\n}\n\nexport interface DisplayValueType {\n key?: React.Key;\n value?: RawValueType;\n label?: React.ReactNode;\n title?: string | number;\n disabled?: boolean;\n}\n\nexport type RenderNode = React.ReactNode | ((props: any) => React.ReactNode);\n\nexport type RenderDOMFunc = (props: any) => HTMLElement;\n\nexport type Mode = 'multiple' | 'tags' | 'combobox';\n\nexport type Placement = 'bottomLeft' | 'bottomRight' | 'topLeft' | 'topRight';\n\nexport type DisplayInfoType = 'add' | 'remove' | 'clear';\n\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { DisplayValueType } from '../BaseSelect';
|
|
2
|
+
export declare function toArray<T>(value: T | T[]): T[];
|
|
3
|
+
export declare const isClient: false | HTMLElement;
|
|
4
|
+
/** Is client side and not jsdom */
|
|
5
|
+
export declare const isBrowserClient: false | HTMLElement;
|
|
6
|
+
export declare function hasValue(value: any): boolean;
|
|
7
|
+
/** combo mode no value judgment function */
|
|
8
|
+
export declare function isComboNoValue(value: any): boolean;
|
|
9
|
+
export declare function getTitle(item: DisplayValueType): string;
|
|
10
|
+
//# sourceMappingURL=commonUtil.d.ts.map
|