react-native-ui-lib 7.46.2-snapshot.7316 → 7.46.3-snapshot.7330
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/package.json
CHANGED
|
@@ -111,6 +111,7 @@ export declare function extractModifierProps(props: Dictionary<any>): _.Dictiona
|
|
|
111
111
|
*/
|
|
112
112
|
export declare function extractOwnProps(props: Dictionary<any>, ignoreProps: string[]): _.Omit<_.Dictionary<any>, string>;
|
|
113
113
|
export declare function extractComponentProps(component: any, props: Dictionary<any>, ignoreProps?: string[]): _.Omit<_.Dictionary<any>, string>;
|
|
114
|
+
export declare function getComponentName(componentDisplayName: string): any;
|
|
114
115
|
export declare function getThemeProps<T extends object>(props?: T, context?: any, componentDisplayName?: string): T;
|
|
115
116
|
export declare function generateModifiersStyle(options: ModifiersOptions | undefined, props: Dictionary<any>): ExtractedStyle;
|
|
116
117
|
export declare function getAlteredModifiersOptions(currentProps: any, nextProps: any): AlteredOptions;
|
package/src/commons/modifiers.js
CHANGED
|
@@ -248,12 +248,15 @@ export function extractComponentProps(component, props, ignoreProps = []) {
|
|
|
248
248
|
const componentProps = _flow(props => _pickBy(props, (_value, key) => _includes(Object.keys(componentPropTypes), key)), props => _omit(props, ignoreProps))(props);
|
|
249
249
|
return componentProps;
|
|
250
250
|
}
|
|
251
|
+
export function getComponentName(componentDisplayName) {
|
|
252
|
+
//@ts-ignore
|
|
253
|
+
return componentDisplayName || this.displayName || this.constructor.displayName || this.constructor.name;
|
|
254
|
+
}
|
|
251
255
|
|
|
252
256
|
//@ts-ignore
|
|
253
257
|
export function getThemeProps(props = this.props, context = this.context, componentDisplayName = '') {
|
|
254
|
-
const componentName =
|
|
255
258
|
//@ts-ignore
|
|
256
|
-
|
|
259
|
+
const componentName = getComponentName.call(this, componentDisplayName);
|
|
257
260
|
let themeProps;
|
|
258
261
|
if (_isFunction(ThemeManager.components[componentName])) {
|
|
259
262
|
themeProps = ThemeManager.components[componentName](props, context);
|