UNPKG

@teamix/pro-action

Version:

action组件

25 lines 1.72 kB
var _excluded = ["schema"]; function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } import { TeamixProContext } from '@teamix/provider'; import { NoContext } from '@teamix/utils'; import { useContext } from 'react'; import useDialogAction from "./dialog"; export function useDialogInfoAction(action, context) { var _components$ProInfo; var schema = action.schema, others = _objectWithoutProperties(action, _excluded); var _useContext = useContext(TeamixProContext), components = _useContext.components; var ProInfo = (_components$ProInfo = components === null || components === void 0 ? void 0 : components.ProInfo) !== null && _components$ProInfo !== void 0 ? _components$ProInfo : NoContext; return useDialogAction(Object.assign({ component: ProInfo, closeable: true, size: 'mini', schema: Object.assign({ backgroundColor: 'grey', compacted: false }, schema) }, others), context); } export default useDialogInfoAction;