@evlop/native-components 1.0.78 → 1.0.81
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/dist/src/Icon/index.d.ts
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import { Color, IconIdentifier } from '@evlop/commons';
|
|
2
|
+
import * as React from 'react';
|
|
3
3
|
import { IconProps as RNEIconProps } from 'react-native-elements';
|
|
4
4
|
declare type BaseIconProps = RNEIconProps & {
|
|
5
5
|
icon?: IconIdentifier;
|
|
6
6
|
size?: number;
|
|
7
|
-
color
|
|
7
|
+
color?: Color;
|
|
8
|
+
flipOnRTL?: boolean;
|
|
8
9
|
};
|
|
9
10
|
export declare const BaseIcon: React.FC<BaseIconProps>;
|
|
10
11
|
declare const IconWithSettings: React.ForwardRefExoticComponent<RNEIconProps & {
|
|
11
12
|
icon?: IconIdentifier;
|
|
12
13
|
size?: number;
|
|
13
|
-
color
|
|
14
|
+
color?: Color;
|
|
15
|
+
flipOnRTL?: boolean;
|
|
14
16
|
} & {
|
|
15
17
|
model?: string;
|
|
16
18
|
dataModel?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Icon/index.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Icon/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,cAAc,EAA0B,MAAM,gBAAgB,CAAC;AAC/E,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAmB,SAAS,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGnF,aAAK,aAAa,GAAG,YAAY,GAAG;IAAE,IAAI,CAAC,EAAE,cAAc,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAC;IAAC,SAAS,CAAC,EAAC,OAAO,CAAA;CAAE,CAAA;AAW/G,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAuB5C,CAAA;AAED,QAAA,MAAM,gBAAgB;WApCuB,cAAc;WAAS,MAAM;YAAU,KAAK;gBAAa,OAAO;;;;;;;;6BAqDjG,CAAC;AAMb,eAAe,gBAAgB,CAAC"}
|
package/dist/src/Icon/index.js
CHANGED
|
@@ -35,20 +35,27 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
35
35
|
};
|
|
36
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
37
|
exports.BaseIcon = void 0;
|
|
38
|
-
const React = __importStar(require("react"));
|
|
39
38
|
const commons_1 = require("@evlop/commons");
|
|
40
|
-
const
|
|
41
|
-
const react_native_elements_1 = require("react-native-elements");
|
|
39
|
+
const React = __importStar(require("react"));
|
|
42
40
|
const react_native_1 = require("react-native");
|
|
43
|
-
const
|
|
41
|
+
const react_native_elements_1 = require("react-native-elements");
|
|
42
|
+
const native_1 = require("styled-components/native");
|
|
43
|
+
const rtlIconStyle = { transform: [{ scaleX: react_native_1.I18nManager.isRTL ? -1 : 1 }] };
|
|
44
|
+
const iconTypeMap = {
|
|
45
|
+
'material-icons': 'material',
|
|
46
|
+
'material-community-icons': 'material-community',
|
|
47
|
+
'simple-line-icons': 'simple-line-icon',
|
|
48
|
+
'ionicons': 'ionicon',
|
|
49
|
+
'evilicons': 'evilicon',
|
|
50
|
+
};
|
|
44
51
|
const BaseIcon = (_a) => {
|
|
45
|
-
var { icon, name = "circle", type, color, iconStyle: _iconStyle } = _a, props = __rest(_a, ["icon", "name", "type", "color", "iconStyle"]);
|
|
52
|
+
var { icon, name = "circle", type, color, iconStyle: _iconStyle, flipOnRTL } = _a, props = __rest(_a, ["icon", "name", "type", "color", "iconStyle", "flipOnRTL"]);
|
|
46
53
|
const theme = React.useContext(native_1.ThemeContext);
|
|
47
54
|
const iconProps = React.useMemo(() => {
|
|
48
55
|
if (typeof icon === 'string') {
|
|
49
56
|
const iconDetails = commons_1.iconInfo[icon];
|
|
50
57
|
if (iconDetails) {
|
|
51
|
-
return { name: iconDetails.name, type: iconDetails.type, [iconDetails.variant]: true };
|
|
58
|
+
return { name: iconDetails.name, type: iconTypeMap[iconDetails.type] || iconDetails.type, [iconDetails.variant]: true };
|
|
52
59
|
}
|
|
53
60
|
else {
|
|
54
61
|
return { name: icon };
|
|
@@ -62,13 +69,10 @@ const BaseIcon = (_a) => {
|
|
|
62
69
|
}
|
|
63
70
|
}, [icon, name, type]);
|
|
64
71
|
const iconStyle = React.useMemo(() => {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
return rtlStyle;
|
|
68
|
-
return (0, lodash_1.assign)({}, _iconStyle, rtlStyle);
|
|
69
|
-
}, [_iconStyle]);
|
|
72
|
+
return react_native_1.StyleSheet.flatten([_iconStyle, flipOnRTL ? rtlIconStyle : null]);
|
|
73
|
+
}, [_iconStyle, flipOnRTL]);
|
|
70
74
|
const { colors: { [color]: colorCode } } = theme;
|
|
71
|
-
return React.createElement(react_native_elements_1.Icon, Object.assign({ name: "circle" }, props, { iconStyle: iconStyle, color: colorCode || color }, iconProps));
|
|
75
|
+
return React.createElement(react_native_elements_1.Icon, Object.assign({ type: "", name: "circle" }, props, { iconStyle: iconStyle, color: colorCode || color }, iconProps));
|
|
72
76
|
};
|
|
73
77
|
exports.BaseIcon = BaseIcon;
|
|
74
78
|
const IconWithSettings = (0, commons_1.withSettings)({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Icon/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Icon/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAA+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