@evlop/commons 1.0.93 → 1.0.97
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/src/constants/index.d.ts +1 -0
- package/dist/src/constants/index.d.ts.map +1 -1
- package/dist/src/constants/index.js +2 -1
- package/dist/src/constants/index.js.map +1 -1
- package/dist/src/data-sources/collection.d.ts.map +1 -1
- package/dist/src/data-sources/collection.js +4 -2
- package/dist/src/data-sources/collection.js.map +1 -1
- package/dist/src/data-sources/listUrl.d.ts.map +1 -1
- package/dist/src/data-sources/listUrl.js +17 -0
- package/dist/src/data-sources/listUrl.js.map +1 -1
- package/dist/src/data-sources/scopeDataSource.d.ts.map +1 -1
- package/dist/src/data-sources/scopeDataSource.js +3 -1
- package/dist/src/data-sources/scopeDataSource.js.map +1 -1
- package/dist/src/hooks/useAction.d.ts +1 -1
- package/dist/src/hooks/useAction.d.ts.map +1 -1
- package/dist/src/hooks/useAction.js +14 -14
- package/dist/src/hooks/useAction.js.map +1 -1
- package/package.json +6 -3
@@ -8,6 +8,7 @@ export declare const HORIZONTAL_LAYOUT = "layout/horizontal";
|
|
8
8
|
export declare const TYPE_COMPONENT = "type/component";
|
9
9
|
export declare const API_BASE_URL: string;
|
10
10
|
export declare const SOCKET_URL: string;
|
11
|
+
export declare const DATA_SOURCE_KEY_NAMESPACE = "a0aec1c8-4fed-4d5d-b399-504887b3b8e4";
|
11
12
|
export { default as iconInfo } from './iconInfo';
|
12
13
|
export * from './platformSpecific';
|
13
14
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/constants/index.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM,SAAgE,CAAC;AAEpF,eAAO,MAAM,aAAa,kBAAkB,CAAC;AAC7C,eAAO,MAAM,eAAe,oBAAoB,CAAC;AACjD,eAAO,MAAM,gBAAgB,qBAAqB,CAAC;AACnD,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAG/C,eAAO,MAAM,eAAe,oBAAoB,CAAC;AACjD,eAAO,MAAM,iBAAiB,sBAAsB,CAAC;AAErD,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAC/C,eAAO,MAAM,YAAY,QAAiE,CAAC;AAC3F,eAAO,MAAM,UAAU,QAA6E,CAAC;AAErG,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,cAAc,oBAAoB,CAAC"}
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/constants/index.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM,SAAgE,CAAC;AAEpF,eAAO,MAAM,aAAa,kBAAkB,CAAC;AAC7C,eAAO,MAAM,eAAe,oBAAoB,CAAC;AACjD,eAAO,MAAM,gBAAgB,qBAAqB,CAAC;AACnD,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAG/C,eAAO,MAAM,eAAe,oBAAoB,CAAC;AACjD,eAAO,MAAM,iBAAiB,sBAAsB,CAAC;AAErD,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAC/C,eAAO,MAAM,YAAY,QAAiE,CAAC;AAC3F,eAAO,MAAM,UAAU,QAA6E,CAAC;AAErG,eAAO,MAAM,yBAAyB,yCAAyC,CAAC;AAEhF,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,cAAc,oBAAoB,CAAC"}
|
@@ -13,7 +13,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
13
13
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
14
14
|
};
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
16
|
-
exports.iconInfo = exports.SOCKET_URL = exports.API_BASE_URL = exports.TYPE_COMPONENT = exports.HORIZONTAL_LAYOUT = exports.VERTICAL_LAYOUT = exports.DIRECTION_LEFT = exports.DIRECTION_BOTTOM = exports.DIRECTION_RIGHT = exports.DIRECTION_TOP = exports.IS_SSR = void 0;
|
16
|
+
exports.iconInfo = exports.DATA_SOURCE_KEY_NAMESPACE = exports.SOCKET_URL = exports.API_BASE_URL = exports.TYPE_COMPONENT = exports.HORIZONTAL_LAYOUT = exports.VERTICAL_LAYOUT = exports.DIRECTION_LEFT = exports.DIRECTION_BOTTOM = exports.DIRECTION_RIGHT = exports.DIRECTION_TOP = exports.IS_SSR = void 0;
|
17
17
|
exports.IS_SSR = ['true', '1'].includes(String(process.env.SSR).toLowerCase());
|
18
18
|
exports.DIRECTION_TOP = "direction/Top";
|
19
19
|
exports.DIRECTION_RIGHT = "direction/Right";
|
@@ -24,6 +24,7 @@ exports.HORIZONTAL_LAYOUT = 'layout/horizontal';
|
|
24
24
|
exports.TYPE_COMPONENT = "type/component";
|
25
25
|
exports.API_BASE_URL = process.env.API_BASE_URL || process.env.REACT_APP_API_BASE_URL;
|
26
26
|
exports.SOCKET_URL = process.env.SOCKET_URL || process.env.REACT_APP_SOCKET_URL || exports.API_BASE_URL;
|
27
|
+
exports.DATA_SOURCE_KEY_NAMESPACE = "a0aec1c8-4fed-4d5d-b399-504887b3b8e4";
|
27
28
|
var iconInfo_1 = require("./iconInfo");
|
28
29
|
Object.defineProperty(exports, "iconInfo", { enumerable: true, get: function () { return __importDefault(iconInfo_1).default; } });
|
29
30
|
__exportStar(require("./platformSpecific"), exports);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/constants/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAa,QAAA,MAAM,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;AAEvE,QAAA,aAAa,GAAG,eAAe,CAAC;AAChC,QAAA,eAAe,GAAG,iBAAiB,CAAC;AACpC,QAAA,gBAAgB,GAAG,kBAAkB,CAAC;AACtC,QAAA,cAAc,GAAG,gBAAgB,CAAC;AAGlC,QAAA,eAAe,GAAG,iBAAiB,CAAC;AACpC,QAAA,iBAAiB,GAAG,mBAAmB,CAAC;AAExC,QAAA,cAAc,GAAG,gBAAgB,CAAC;AAClC,QAAA,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC;AAC9E,QAAA,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,oBAAY,CAAC;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/constants/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAa,QAAA,MAAM,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;AAEvE,QAAA,aAAa,GAAG,eAAe,CAAC;AAChC,QAAA,eAAe,GAAG,iBAAiB,CAAC;AACpC,QAAA,gBAAgB,GAAG,kBAAkB,CAAC;AACtC,QAAA,cAAc,GAAG,gBAAgB,CAAC;AAGlC,QAAA,eAAe,GAAG,iBAAiB,CAAC;AACpC,QAAA,iBAAiB,GAAG,mBAAmB,CAAC;AAExC,QAAA,cAAc,GAAG,gBAAgB,CAAC;AAClC,QAAA,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC;AAC9E,QAAA,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,oBAAY,CAAC;AAExF,QAAA,yBAAyB,GAAG,sCAAsC,CAAC;AAEhF,uCAAiD;AAAxC,qHAAA,OAAO,OAAY;AAC5B,qDAAmC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"collection.d.ts","sourceRoot":"","sources":["../../../src/data-sources/collection.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAwC,MAAM,aAAa,CAAC;
|
1
|
+
{"version":3,"file":"collection.d.ts","sourceRoot":"","sources":["../../../src/data-sources/collection.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAwC,MAAM,aAAa,CAAC;AAchF,QAAA,MAAM,oBAAoB,EAAE,WA+B3B,CAAA;AAgCD,eAAe,oBAAoB,CAAC"}
|
@@ -12,6 +12,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
const lodash_1 = require("lodash");
|
13
13
|
const classes_1 = require("../classes");
|
14
14
|
const reducers_1 = require("../reducers");
|
15
|
+
const uuid_1 = require("uuid");
|
16
|
+
const constants_1 = require("../constants");
|
15
17
|
function _getModel(collectionName, dispatch) {
|
16
18
|
if (!collectionName)
|
17
19
|
return classes_1.Model.forCollection('no-operations');
|
@@ -69,14 +71,14 @@ collectionDataSource.keyExtractor = (options) => {
|
|
69
71
|
requestOptions = JSON.parse(requestOptionsString);
|
70
72
|
}
|
71
73
|
catch (e) { }
|
72
|
-
return [
|
74
|
+
return uuid_1.v5([
|
73
75
|
lodash_1.get(requestOptions, 'key', ''),
|
74
76
|
lodash_1.get(options, 'collectionName'),
|
75
77
|
lodash_1.get(requestOptions, 'search'),
|
76
78
|
lodash_1.get(requestOptions, 'pageSize'),
|
77
79
|
JSON.stringify(lodash_1.get(requestOptions, 'sort')),
|
78
80
|
...lodash_1.map(lodash_1.get(requestOptions, 'filter'), (v, k) => `${k}=${JSON.stringify(v)}`)
|
79
|
-
].join(':');
|
81
|
+
].join(':'), constants_1.DATA_SOURCE_KEY_NAMESPACE);
|
80
82
|
};
|
81
83
|
exports.default = collectionDataSource;
|
82
84
|
//# sourceMappingURL=collection.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"collection.js","sourceRoot":"","sources":["../../../src/data-sources/collection.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,mCAAiE;AACj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"file":"listUrl.d.ts","sourceRoot":"","sources":["../../../src/data-sources/listUrl.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"listUrl.d.ts","sourceRoot":"","sources":["../../../src/data-sources/listUrl.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAI1C,QAAA,MAAM,iBAAiB,EAAE,WAyCxB,CAAA;AAiCD,eAAe,iBAAiB,CAAC"}
|
@@ -11,6 +11,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
12
12
|
const lodash_1 = require("lodash");
|
13
13
|
const actions_1 = require("../actions");
|
14
|
+
const uuid_1 = require("uuid");
|
15
|
+
const constants_1 = require("../constants");
|
14
16
|
const listUrlDataSource = (options, { dispatch }) => __awaiter(void 0, void 0, void 0, function* () {
|
15
17
|
const { sourceId, url = sourceId, data, requestOptions, page } = options;
|
16
18
|
let reqOptions = {};
|
@@ -60,5 +62,20 @@ listUrlDataSource.defaultValues = {
|
|
60
62
|
requestOptions: JSON.stringify({ params: {}, data: {}, method: 'get' }, null, 2),
|
61
63
|
};
|
62
64
|
listUrlDataSource.keyExtractor = (options) => options.url || options.sourceId;
|
65
|
+
listUrlDataSource.keyExtractor = (options) => {
|
66
|
+
const { url = '', requestOptions: requestOptionsString } = options;
|
67
|
+
let requestOptions;
|
68
|
+
try {
|
69
|
+
requestOptions = JSON.parse(requestOptionsString);
|
70
|
+
}
|
71
|
+
catch (e) { }
|
72
|
+
return uuid_1.v5([
|
73
|
+
lodash_1.get(requestOptions, 'key', ''),
|
74
|
+
url,
|
75
|
+
lodash_1.get(requestOptions, 'method', ''),
|
76
|
+
JSON.stringify(lodash_1.get(requestOptions, 'data', {})),
|
77
|
+
JSON.stringify(lodash_1.get(requestOptions, 'params')),
|
78
|
+
].join(':'), constants_1.DATA_SOURCE_KEY_NAMESPACE);
|
79
|
+
};
|
63
80
|
exports.default = listUrlDataSource;
|
64
81
|
//# sourceMappingURL=listUrl.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"listUrl.js","sourceRoot":"","sources":["../../../src/data-sources/listUrl.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,
|
1
|
+
{"version":3,"file":"listUrl.js","sourceRoot":"","sources":["../../../src/data-sources/listUrl.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,mCAAyD;AACzD,wCAAqC;AAErC,+BAAkC;AAClC,4CAAyD;AAEzD,MAAM,iBAAiB,GAAgB,CAAO,OAAO,EAAE,EAAC,QAAQ,EAAC,EAAC,EAAE;IAChE,MAAM,EAAE,QAAQ,EAAE,GAAG,GAAG,QAAQ,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IACzE,IAAI,UAAU,GAAG,EAAE,CAAC;IACpB,IAAG,cAAc,EAAC;QACd,IAAI,OAAO,cAAc,KAAK,QAAQ,EAAC;YACnC,IAAG;gBACC,eAAM,CAAC,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC;aAClD;YAAC,OAAM,CAAC,EAAC;gBACN,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;aAChC;SACJ;aAAM,IAAI,OAAO,cAAc,KAAK,QAAQ,EAAC;YAC1C,eAAM,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;SACtC;KACJ;IACD,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,UAAU,EAAE,cAAc,CAAC,CAAC;IACtD,MAAM,QAAQ,GAAG,YAAG,CAAC,UAAU,EAAE,UAAU,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC;IACjE,MAAM,iBAAiB,GAAG,YAAG,CAAC,UAAU,EAAE,oBAAoB,EAAE,UAAU,CAAC,CAAC;IAC5E,MAAM,aAAa,GAAG,YAAG,CAAC,UAAU,EAAE,gBAAgB,EAAE,MAAM,CAAC,C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ts","sourceRoot":"","sources":["../../../src/data-sources/scopeDataSource.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;
|
1
|
+
{"version":3,"file":"scopeDataSource.d.ts","sourceRoot":"","sources":["../../../src/data-sources/scopeDataSource.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAK1C,QAAA,MAAM,eAAe,EAAE,WAEtB,CAAC;AAcF,eAAe,eAAe,CAAC"}
|
@@ -1,12 +1,14 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const lodash_1 = require("lodash");
|
4
|
+
const uuid_1 = require("uuid");
|
5
|
+
const constants_1 = require("../constants");
|
4
6
|
const scopeDataSource = (options, { scope }) => {
|
5
7
|
return lodash_1.get(scope, lodash_1.get(options, 'path'));
|
6
8
|
};
|
7
9
|
scopeDataSource.keyExtractor = (options, { scope }) => {
|
8
10
|
const path = lodash_1.get(options, 'path', '');
|
9
|
-
return [path, JSON.stringify(lodash_1.get(scope, lodash_1.get(options, 'path')))].join(':');
|
11
|
+
return uuid_1.v5([path, JSON.stringify(lodash_1.get(scope, lodash_1.get(options, 'path')))].join(':'), constants_1.DATA_SOURCE_KEY_NAMESPACE);
|
10
12
|
};
|
11
13
|
scopeDataSource.displayName = 'Scope';
|
12
14
|
scopeDataSource.identifier = 'scope';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"scopeDataSource.js","sourceRoot":"","sources":["../../../src/data-sources/scopeDataSource.ts"],"names":[],"mappings":";;AAAA,mCAA6B;
|
1
|
+
{"version":3,"file":"scopeDataSource.js","sourceRoot":"","sources":["../../../src/data-sources/scopeDataSource.ts"],"names":[],"mappings":";;AAAA,mCAA6B;AAE7B,+BAAkC;AAClC,4CAAyD;AAGzD,MAAM,eAAe,GAAgB,CAAC,OAAO,EAAE,EAAC,KAAK,EAAC,EAAC,EAAE;IACjD,OAAO,YAAG,CAAC,KAAK,EAAC,YAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAA;AAC9C,CAAC,CAAC;AAEF,eAAe,CAAC,YAAY,GAAG,CAAC,OAAO,EAAE,EAAC,KAAK,EAAC,EAAC,EAAE;IAC/C,MAAM,IAAI,GAAG,YAAG,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC;IACtC,OAAO,SAAM,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,YAAG,CAAC,KAAK,EAAC,YAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,qCAAyB,CAAC,CAAA;AAC/G,CAAC,CAAC;AACF,eAAe,CAAC,WAAW,GAAG,OAAO,CAAC;AACtC,eAAe,CAAC,UAAU,GAAG,OAAO,CAAC;AACrC,eAAe,CAAC,IAAI,GAAG,QAAQ,CAAC;AAChC,eAAe,CAAC,oBAAoB,GAAG;IACnC,EAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,YAAY,EAAG,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAC;CAEjG,CAAC;AAEF,kBAAe,eAAe,CAAC"}
|
@@ -13,6 +13,6 @@ interface ActionObject {
|
|
13
13
|
callback: Function;
|
14
14
|
}
|
15
15
|
declare type Action = ActionObject | Function | any;
|
16
|
-
export declare const useAction: (action: Action) => any;
|
16
|
+
export declare const useAction: (action: Action) => (event: any) => any;
|
17
17
|
export default useAction;
|
18
18
|
//# sourceMappingURL=useAction.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useAction.d.ts","sourceRoot":"","sources":["../../../src/hooks/useAction.tsx"],"names":[],"mappings":"AASA;;;;GAIG;AAEF,UAAU,YAAY;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;IACjC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;IAC7B,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC5B,QAAQ,EAAE,QAAQ,CAAC;CACtB;AAED,aAAK,MAAM,GAAG,YAAY,GAAG,QAAQ,GAAG,GAAG,CAAA;AAE5C,eAAO,MAAM,SAAS,WAAY,MAAM,
|
1
|
+
{"version":3,"file":"useAction.d.ts","sourceRoot":"","sources":["../../../src/hooks/useAction.tsx"],"names":[],"mappings":"AASA;;;;GAIG;AAEF,UAAU,YAAY;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;IACjC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;IAC7B,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC5B,QAAQ,EAAE,QAAQ,CAAC;CACtB;AAED,aAAK,MAAM,GAAG,YAAY,GAAG,QAAQ,GAAG,GAAG,CAAA;AAE5C,eAAO,MAAM,SAAS,WAAY,MAAM,wBAgCvC,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
@@ -16,7 +16,7 @@ const useAction = (action) => {
|
|
16
16
|
const dispatch = react_redux_1.useDispatch();
|
17
17
|
const scope = useScope_1.useScope();
|
18
18
|
const template = useTemplate_1.default();
|
19
|
-
return react_1.
|
19
|
+
return react_1.useCallback((event) => {
|
20
20
|
let actionToUse = action;
|
21
21
|
while (actionToUse && actionToUse.bindKey) {
|
22
22
|
actionToUse = lodash_1.get(scope, actionToUse.bindKey);
|
@@ -26,25 +26,25 @@ const useAction = (action) => {
|
|
26
26
|
if (actionToUse) {
|
27
27
|
const { link, navigate, push, page, params, dispatch: dispatchAction, route, callback } = actionToUse;
|
28
28
|
if (link)
|
29
|
-
return
|
29
|
+
return navigator.openURL(template(link));
|
30
30
|
if (navigate)
|
31
|
-
return
|
31
|
+
return navigator.navigate(...lodash_1.castArray(JSON.parse(template(JSON.stringify(navigate)))));
|
32
32
|
if (push)
|
33
|
-
return
|
34
|
-
if (page)
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
33
|
+
return navigator.push(...lodash_1.castArray(JSON.parse(template(JSON.stringify(navigate)))));
|
34
|
+
if (page) {
|
35
|
+
console.log(page, params);
|
36
|
+
const routeParams = lodash_2.mapValues(params, (paramValue) => template(paramValue.toString()));
|
37
|
+
return navigator.openPage(page, routeParams);
|
38
|
+
}
|
39
|
+
;
|
40
40
|
if (route)
|
41
|
-
return
|
41
|
+
return navigator.openRoute(template(route));
|
42
42
|
if (dispatchAction)
|
43
|
-
return
|
43
|
+
return dispatch(dispatchAction);
|
44
44
|
if (callback)
|
45
|
-
return
|
45
|
+
return callback({ event, navigator, dispatch });
|
46
46
|
}
|
47
|
-
}, [action, navigator, dispatch]);
|
47
|
+
}, [action, navigator, dispatch, template, scope]);
|
48
48
|
};
|
49
49
|
exports.useAction = useAction;
|
50
50
|
exports.default = exports.useAction;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useAction.js","sourceRoot":"","sources":["../../../src/hooks/useAction.tsx"],"names":[],"mappings":";;;;;;AAAA,
|
1
|
+
{"version":3,"file":"useAction.js","sourceRoot":"","sources":["../../../src/hooks/useAction.tsx"],"names":[],"mappings":";;;;;;AAAA,iCAA6C;AAC7C,6CAA0C;AAC1C,mCAAwC;AACxC,iDAA4C;AAC5C,yCAAoC;AACpC,gEAAwC;AACxC,mCAAiC;AAqB1B,MAAM,SAAS,GAAG,CAAC,MAAc,EAAC,EAAE;IAEvC,MAAM,SAAS,GAAG,2BAAY,EAAE,CAAC;IACjC,MAAM,QAAQ,GAAG,yBAAW,EAAE,CAAC;IAC/B,MAAM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AQ,CAAC,IAAI,EAAE,WAAW,CAAC,CAAA;aAC/C;YAAA,CAAC;YACF,IAAI,KAAK;gBAAE,OAAO,SAAS,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;YACvD,IAAI,cAAc;gBAAE,OAAO,QAAQ,CAAC,cAAc,CAAC,CAAC;YACpD,IAAI,QAAQ;gBAAE,OAAO,QAAQ,CAAC,EAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAC,CAAC,CAAC;SAC/D;IACL,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC;AACvD,CAAC,CAAC;AAhCW,QAAA,SAAS,aAgCpB;AAEF,kBAAe,iBAAS,CAAC"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@evlop/commons",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.97",
|
4
4
|
"description": "",
|
5
5
|
"main": "dist/main.js",
|
6
6
|
"peerDependencies": {
|
@@ -21,7 +21,8 @@
|
|
21
21
|
"pluralize": "latest",
|
22
22
|
"query-string": "latest",
|
23
23
|
"@react-native-async-storage/async-storage": "latest",
|
24
|
-
"react-native-vector-icons": "^9.0.0"
|
24
|
+
"react-native-vector-icons": "^9.0.0",
|
25
|
+
"uuid": "^8.3.2"
|
25
26
|
},
|
26
27
|
"optionalDependencies": {},
|
27
28
|
"dependencies": {
|
@@ -47,6 +48,7 @@
|
|
47
48
|
"@types/lodash": "^4.14.168",
|
48
49
|
"@types/node": "^15.0.2",
|
49
50
|
"@types/react": "^16.14.0",
|
51
|
+
"@types/uuid": "^8.3.4",
|
50
52
|
"chai": "^4.3.4",
|
51
53
|
"change-case": "^4.1.2",
|
52
54
|
"jest": "^26.6.3",
|
@@ -54,6 +56,7 @@
|
|
54
56
|
"mocha": "^8.4.0",
|
55
57
|
"react-native-vector-icons": "^9.0.0",
|
56
58
|
"ts-node": "^10.4.0",
|
57
|
-
"typescript": "^4.1.3"
|
59
|
+
"typescript": "^4.1.3",
|
60
|
+
"uuid": "^8.3.2"
|
58
61
|
}
|
59
62
|
}
|