Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /var/www/html/wincloud_gateway/node_modules/react-intl/lib/components/ drwxr-xr-x | |
| Viewing file: Select action/file-type: import * as React from 'react';
import * as hoistNonReactStatics_ from 'hoist-non-react-statics';
// Since rollup cannot deal with namespace being a function,
// this is to interop with TypeScript since `invariant`
// does not export a default
// https://github.com/rollup/rollup/issues/1267
const hoistNonReactStatics = hoistNonReactStatics_.default || hoistNonReactStatics_;
import { invariantIntlContext } from '../utils';
function getDisplayName(Component) {
return Component.displayName || Component.name || 'Component';
}
// TODO: We should provide initial value here
const IntlContext = React.createContext(null);
const { Consumer: IntlConsumer, Provider: IntlProvider } = IntlContext;
export const Provider = IntlProvider;
export const Context = IntlContext;
export default function injectIntl(WrappedComponent, options) {
const { intlPropName = 'intl', forwardRef = false, enforceContext = true } = options || {};
const WithIntl = props => (React.createElement(IntlConsumer, null, (intl) => {
if (enforceContext) {
invariantIntlContext(intl);
}
const intlProp = { [intlPropName]: intl };
return (React.createElement(WrappedComponent, Object.assign({}, props, intlProp, { ref: forwardRef ? props.forwardedRef : null })));
}));
WithIntl.displayName = `injectIntl(${getDisplayName(WrappedComponent)})`;
WithIntl.WrappedComponent = WrappedComponent;
if (forwardRef) {
return hoistNonReactStatics(React.forwardRef((props, ref) => (React.createElement(WithIntl, Object.assign({}, props, { forwardedRef: ref })))), WrappedComponent);
}
return hoistNonReactStatics(WithIntl, WrappedComponent);
}
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0047 ]-- |