@evlop/commons 1.0.205 → 1.0.207
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/src/components/hoc/withSettings.native.d.ts +11 -12
- package/dist/src/components/hoc/withSettings.native.d.ts.map +1 -1
- package/dist/src/components/hoc/withSettings.native.js +22 -25
- package/dist/src/components/hoc/withSettings.native.js.map +1 -1
- package/dist/src/constants/iconInfo/reactNativeVectorIcons.d.ts +7 -0
- package/dist/src/constants/iconInfo/reactNativeVectorIcons.d.ts.map +1 -1
- package/dist/src/constants/iconInfo/reactNativeVectorIcons.js +14 -1
- package/dist/src/constants/iconInfo/reactNativeVectorIcons.js.map +1 -1
- package/dist/src/constants/iconInfo/reactNativeVectorIcons.lookup.min.json +1 -1
- package/dist/src/constants/iconInfo/types.d.ts +9 -3
- package/dist/src/constants/iconInfo/types.d.ts.map +1 -1
- package/package.json +5 -6
@@ -1,19 +1,18 @@
|
|
1
1
|
import React, { PropsWithChildren, PropsWithoutRef, RefAttributes } from 'react';
|
2
|
-
|
3
|
-
declare type SettingProp = {
|
2
|
+
declare type ModalProps = {
|
4
3
|
model?: string;
|
5
4
|
dataModel?: string;
|
6
5
|
configModel?: string;
|
7
|
-
action?: Action;
|
8
6
|
};
|
9
|
-
export declare type ComponentWithSettings<P extends Object> = React.ForwardRefExoticComponent<PropsWithoutRef<PropsWithChildren<P &
|
10
|
-
export declare
|
11
|
-
valueOptions
|
12
|
-
configurationOptions
|
13
|
-
}
|
14
|
-
export declare const
|
15
|
-
|
16
|
-
|
17
|
-
}) =>
|
7
|
+
export declare type ComponentWithSettings<P extends Object> = React.ForwardRefExoticComponent<PropsWithoutRef<PropsWithChildren<P & ModalProps>> & RefAttributes<any>>;
|
8
|
+
export declare type SettingOptions = {
|
9
|
+
valueOptions: any[];
|
10
|
+
configurationOptions: any[];
|
11
|
+
};
|
12
|
+
export declare const withSettings: (settingOptions: SettingOptions) => <P extends Object>(BaseComponent: React.ComponentType<P>) => React.ForwardRefExoticComponent<React.PropsWithoutRef<React.PropsWithChildren<P & ModalProps>> & React.RefAttributes<any>>;
|
13
|
+
export declare const withModelPropsLoader: (settingOptions: SettingOptions) => <P extends Object>(BaseComponent: React.ComponentType<P>) => (props: P & ModalProps & {
|
14
|
+
_innerRef: any;
|
15
|
+
}) => JSX.Element;
|
16
|
+
export declare const withToolbar: (settingOptions: SettingOptions) => <P extends Object>(BaseComponent: React.ComponentType<P>) => React.ForwardRefExoticComponent<React.PropsWithoutRef<React.PropsWithChildren<P & ModalProps>> & React.RefAttributes<any>>;
|
18
17
|
export default withSettings;
|
19
18
|
//# sourceMappingURL=withSettings.native.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"withSettings.native.d.ts","sourceRoot":"","sources":["../../../../src/components/hoc/withSettings.native.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAc,iBAAiB,EAAE,eAAe,EAAE,aAAa,EAAW,MAAM,OAAO,CAAC;
|
1
|
+
{"version":3,"file":"withSettings.native.d.ts","sourceRoot":"","sources":["../../../../src/components/hoc/withSettings.native.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAc,iBAAiB,EAAE,eAAe,EAAE,aAAa,EAAW,MAAM,OAAO,CAAC;AAGtG,aAAK,UAAU,GAAG;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAE7E,oBAAY,qBAAqB,CAAC,CAAC,SAAS,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,eAAe,CAAC,iBAAiB,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC,CAAA;AAE9J,oBAAY,cAAc,GAAG;IAAC,YAAY,EAAE,GAAG,EAAE,CAAC;IAAC,oBAAoB,EAAE,GAAG,EAAE,CAAA;CAAC,CAAC;AAEhF,eAAO,MAAM,YAAY,mBAAoB,cAAc,4LAkB1D,CAAA;AAGD,eAAO,MAAM,oBAAoB,mBAAkB,cAAc;eAAwG,GAAG;iBAiB3K,CAAC;AAGF,eAAO,MAAM,WAAW,mBAzCqB,cAAc,4LAyCpB,CAAC;AACxC,eAAe,YAAY,CAAC"}
|
@@ -30,36 +30,33 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
30
30
|
return t;
|
31
31
|
};
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
33
|
-
exports.withToolbar = exports.withSettings = void 0;
|
33
|
+
exports.withToolbar = exports.withModelPropsLoader = exports.withSettings = void 0;
|
34
34
|
const lodash_1 = require("lodash");
|
35
35
|
const react_1 = __importStar(require("react"));
|
36
36
|
const hooks_1 = require("../../hooks");
|
37
|
-
const withSettings = (
|
38
|
-
const
|
37
|
+
const withSettings = (settingOptions) => (BaseComponent) => {
|
38
|
+
const ComponentWithModalPropsLoader = exports.withModelPropsLoader(settingOptions)(BaseComponent);
|
39
|
+
return react_1.forwardRef((props, forwardedRef) => {
|
40
|
+
const { model, dataModel = model, configModel = dataModel && `${dataModel}_config` } = props, remainingProps = __rest(props, ["model", "dataModel", "configModel"]);
|
41
|
+
if (dataModel || configModel) {
|
42
|
+
return react_1.default.createElement(ComponentWithModalPropsLoader, Object.assign({ _innerRef: forwardedRef, dataModel: dataModel, configModel: configModel }, remainingProps));
|
43
|
+
}
|
44
|
+
else {
|
45
|
+
return react_1.default.createElement(BaseComponent, Object.assign({ ref: forwardedRef }, props));
|
46
|
+
}
|
47
|
+
});
|
48
|
+
};
|
49
|
+
exports.withSettings = withSettings;
|
50
|
+
const withModelPropsLoader = (settingOptions) => (BaseComponent) => (props) => {
|
51
|
+
const { model, _innerRef, dataModel = model, configModel = dataModel && `${dataModel}_config` } = props, remainingProps = __rest(props, ["model", "_innerRef", "dataModel", "configModel"]);
|
39
52
|
const { data } = hooks_1.useComponentData();
|
40
|
-
// Extract values from component data
|
41
|
-
const
|
42
|
-
|
43
|
-
return {};
|
44
|
-
// merge configuration option from props and configuration option values from model
|
45
|
-
const valuePropNames = lodash_1.map(valueOptions, 'name');
|
46
|
-
const propsForValue = lodash_1.pick(props, valuePropNames);
|
47
|
-
return lodash_1.assign(propsForValue, lodash_1.get(data, dataModel));
|
53
|
+
// Extract values from component data,
|
54
|
+
const propsFromModel = react_1.useMemo(() => {
|
55
|
+
return lodash_1.assign({}, lodash_1.get(data, configModel), lodash_1.get(data, dataModel));
|
48
56
|
}, [dataModel, props, data]);
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
return {};
|
53
|
-
// merge configuration option from props and configuration option values from model
|
54
|
-
const configOptionPropNames = lodash_1.map(configurationOptions, 'name');
|
55
|
-
const propsForConfigOptions = lodash_1.pick(props, configOptionPropNames);
|
56
|
-
return lodash_1.assign(propsForConfigOptions, lodash_1.get(data, configModel));
|
57
|
-
}, [configModel, props, data]);
|
58
|
-
const action = values.action || actionProp || onPress;
|
59
|
-
const actionHandeller = hooks_1.useAction(action);
|
60
|
-
return (react_1.default.createElement(BaseComponent, Object.assign({ ref: forwardedRef }, remainingProps, configs, values, { onPress: actionHandeller, action: action })));
|
61
|
-
});
|
62
|
-
exports.withSettings = withSettings;
|
57
|
+
return (react_1.default.createElement(BaseComponent, Object.assign({ ref: _innerRef }, remainingProps, propsFromModel)));
|
58
|
+
};
|
59
|
+
exports.withModelPropsLoader = withModelPropsLoader;
|
63
60
|
exports.withToolbar = exports.withSettings;
|
64
61
|
exports.default = exports.withSettings;
|
65
62
|
//# sourceMappingURL=withSettings.native.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"withSettings.native.js","sourceRoot":"","sources":["../../../../src/components/hoc/withSettings.native.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAAgD;AAChD,+CAAsG;AACtG,
|
1
|
+
{"version":3,"file":"withSettings.native.js","sourceRoot":"","sources":["../../../../src/components/hoc/withSettings.native.tsx"],"names":[],"mappings":";;;;;;;;;;;;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,CAAC,IAAI,EAAE,WAAW,CAAC,EAAE,YAAG,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC;IACrE,CAAC,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;IAE7B,OAAO,CACH,8BAAC,aAAa,kBACV,GAAG,EAAE,SAAS,IACV,cAAc,EACd,cAAc,EACpB,CACL,CAAC;AACN,CAAC,CAAC;AAjBW,QAAA,oBAAoB,wBAiB/B;AAGW,QAAA,WAAW,GAAG,oBAAY,CAAC;AACxC,kBAAe,oBAAY,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"reactNativeVectorIcons.d.ts","sourceRoot":"","sources":["../../../../src/constants/iconInfo/reactNativeVectorIcons.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"reactNativeVectorIcons.d.ts","sourceRoot":"","sources":["../../../../src/constants/iconInfo/reactNativeVectorIcons.ts"],"names":[],"mappings":"AAyEA,QAAA,MAAO,sBAAsB;;;;;;;;;;;;;;;;;;;;;;CAA6C,CAAC;AAE3E,eAAe,sBAAsB,CAAA"}
|
@@ -10,6 +10,8 @@ const Feather_json_1 = __importDefault(require("react-native-vector-icons/glyphm
|
|
10
10
|
const FontAwesome_json_1 = __importDefault(require("react-native-vector-icons/glyphmaps/FontAwesome.json"));
|
11
11
|
const FontAwesome5Free_meta_json_1 = __importDefault(require("react-native-vector-icons/glyphmaps/FontAwesome5Free_meta.json"));
|
12
12
|
const FontAwesome5Free_json_1 = __importDefault(require("react-native-vector-icons/glyphmaps/FontAwesome5Free.json"));
|
13
|
+
const FontAwesome6Free_meta_json_1 = __importDefault(require("react-native-vector-icons/glyphmaps/FontAwesome6Free_meta.json"));
|
14
|
+
const FontAwesome6Free_json_1 = __importDefault(require("react-native-vector-icons/glyphmaps/FontAwesome6Free.json"));
|
13
15
|
const Fontisto_json_1 = __importDefault(require("react-native-vector-icons/glyphmaps/Fontisto.json"));
|
14
16
|
const Foundation_json_1 = __importDefault(require("react-native-vector-icons/glyphmaps/Foundation.json"));
|
15
17
|
const Ionicons_json_1 = __importDefault(require("react-native-vector-icons/glyphmaps/Ionicons.json"));
|
@@ -33,6 +35,17 @@ const fa5Icons = lodash_1.chain(FontAwesome5Free_meta_json_1.default)
|
|
33
35
|
})))
|
34
36
|
.keyBy('id')
|
35
37
|
.value();
|
38
|
+
const fa6Icons = lodash_1.chain(FontAwesome6Free_meta_json_1.default)
|
39
|
+
.flatMap((iconNames, variant) => lodash_1.map(iconNames, iconName => ({
|
40
|
+
id: `font-awesome-6:${variant}:${iconName}`,
|
41
|
+
type: 'font-awesome-6',
|
42
|
+
isDirected: lodash_1.get(directed_icons_1.default, ['font-awesome-6', iconName]),
|
43
|
+
name: iconName,
|
44
|
+
variant,
|
45
|
+
character: FontAwesome6Free_json_1.default[iconName],
|
46
|
+
})))
|
47
|
+
.keyBy('id')
|
48
|
+
.value();
|
36
49
|
const vectorIcons = lodash_1.chain(iconLibraries)
|
37
50
|
.mapValues((libraryIcons) => lodash_1.map(libraryIcons, (character, name) => ({ character, name })))
|
38
51
|
.flatMap((iconsOfCurrentType, iconLibrary) => lodash_1.map(iconsOfCurrentType, ({ name: iconName, character }) => ({
|
@@ -44,6 +57,6 @@ const vectorIcons = lodash_1.chain(iconLibraries)
|
|
44
57
|
})))
|
45
58
|
.keyBy('id')
|
46
59
|
.value();
|
47
|
-
const reactNativeVectorIcons = Object.assign(Object.assign({}, fa5Icons), vectorIcons);
|
60
|
+
const reactNativeVectorIcons = Object.assign(Object.assign(Object.assign({}, fa5Icons), fa6Icons), vectorIcons);
|
48
61
|
exports.default = reactNativeVectorIcons;
|
49
62
|
//# sourceMappingURL=reactNativeVectorIcons.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"reactNativeVectorIcons.js","sourceRoot":"","sources":["../../../../src/constants/iconInfo/reactNativeVectorIcons.ts"],"names":[],"mappings":";;;;;AAAA,wGAA2E;AAC3E,kGAAqE;AACr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