@evlop/commons 1.0.86 → 1.0.90
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/src/data-sources/collection.d.ts.map +1 -1
- package/dist/src/data-sources/collection.js +2 -3
- package/dist/src/data-sources/collection.js.map +1 -1
- package/dist/src/hooks/useCollectionRecordProvider.d.ts.map +1 -1
- package/dist/src/hooks/useCollectionRecordProvider.js +2 -2
- package/dist/src/hooks/useCollectionRecordProvider.js.map +1 -1
- package/dist/src/hooks/useNavigator.app.d.ts.map +1 -1
- package/dist/src/hooks/useNavigator.app.js +2 -1
- package/dist/src/hooks/useNavigator.app.js.map +1 -1
- package/dist/src/hooks/useNavigator.d.ts.map +1 -1
- package/dist/src/hooks/useNavigator.js +2 -3
- package/dist/src/hooks/useNavigator.js.map +1 -1
- package/package.json +1 -1
@@ -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;AAWhF,QAAA,MAAM,oBAAoB,EAAE,WA+B3B,CAAA;
|
1
|
+
{"version":3,"file":"collection.d.ts","sourceRoot":"","sources":["../../../src/data-sources/collection.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAwC,MAAM,aAAa,CAAC;AAWhF,QAAA,MAAM,oBAAoB,EAAE,WA+B3B,CAAA;AA+BD,eAAe,oBAAoB,CAAC"}
|
@@ -67,15 +67,14 @@ collectionDataSource.keyExtractor = (options) => {
|
|
67
67
|
let requestOptions;
|
68
68
|
try {
|
69
69
|
requestOptions = JSON.parse(requestOptionsString);
|
70
|
-
if (requestOptions.key)
|
71
|
-
return requestOptions.key;
|
72
70
|
}
|
73
71
|
catch (e) { }
|
74
72
|
return [
|
73
|
+
lodash_1.get(requestOptions, 'key', ''),
|
75
74
|
lodash_1.get(options, 'collectionName'),
|
76
75
|
lodash_1.get(requestOptions, 'pageSize'),
|
77
76
|
JSON.stringify(lodash_1.get(requestOptions, 'sort')),
|
78
|
-
lodash_1.
|
77
|
+
...lodash_1.map(lodash_1.get(requestOptions, 'filter'), (v, k) => `${k}=${JSON.stringify(v)}`)
|
79
78
|
].join(':');
|
80
79
|
};
|
81
80
|
exports.default = collectionDataSource;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"collection.js","sourceRoot":"","sources":["../../../src/data-sources/collection.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,
|
1
|
+
{"version":3,"file":"collection.js","sourceRoot":"","sources":["../../../src/data-sources/collection.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,mCAAiE;AACjE,wCAAmC;AACnC,0CAAgF;AAEhF,SAAS,SAAS,CAAE,cAAc,EAAE,QAAQ;IACxC,IAAG,CAAC,cAAc;QAAE,OAAO,eAAK,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC;IAC5D,MAAM,KAAK,GAAG,QAAQ,CAAC,gCAAqB,CAAC,cAAc,CAAC,CAAC,CAAA;IAC7D,IAAG,KAAK;QAAE,OAAO,KAAK,CAAC;IACvB,OAAO,eAAK,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;AACnD,CAAC;AAED,MAAM,QAAQ,GAAG,gBAAO,CAAC,SAAS,CAAC,CAAC;AAEpC,MAAM,oBAAoB,GAAgB,CAAO,OAAO,EAAE,EAAC,QAAQ,EAAC,EAAC,EAAE;IACnE,MAAM,EAAC,GAAG,EAAE,QAAQ,EAAE,cAAc,GAAG,QAAQ,EAAE,IAAI,GAAG,CAAC,EAAE,MAAM,EAAE,cAAc,EAAC,GAAG,OAAO,CAAC;IAE7F,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,G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CAAC,EAAE,CAAC;KAC7E,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AACf,CAAC,CAAC;AAGF,kBAAe,oBAAoB,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useCollectionRecordProvider.d.ts","sourceRoot":"","sources":["../../../src/hooks/useCollectionRecordProvider.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"useCollectionRecordProvider.d.ts","sourceRoot":"","sources":["../../../src/hooks/useCollectionRecordProvider.tsx"],"names":[],"mappings":"AAQA,eAAO,MAAM,2BAA2B,kDAkBvC,CAAC;AAEF,eAAQ,MAAM,uBAAuB,kDAA8B,CAAC"}
|
@@ -10,10 +10,10 @@ const react_1 = require("react");
|
|
10
10
|
const react_redux_1 = require("react-redux");
|
11
11
|
const reducers_1 = require("../reducers");
|
12
12
|
const useCollectionRecord_1 = require("./useCollectionRecord");
|
13
|
-
const
|
13
|
+
const useParams_1 = require("./useParams");
|
14
14
|
const useCollectionRecordProvider = (collectionName, paramName = 'slug') => {
|
15
15
|
const dispatch = react_redux_1.useDispatch();
|
16
|
-
const { [paramName]: param } =
|
16
|
+
const { [paramName]: param } = useParams_1.useParams();
|
17
17
|
const record = useCollectionRecord_1.useCollectionRecord(collectionName, param);
|
18
18
|
const key = change_case_1.constantCase(pluralize_1.default.singular(collectionName));
|
19
19
|
react_1.useEffect(() => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useCollectionRecordProvider.js","sourceRoot":"","sources":["../../../src/hooks/useCollectionRecordProvider.tsx"],"names":[],"mappings":";;;;;;AAAA,6CAA2C;AAC3C,0DAAkC;AAClC,iCAAkC;AAClC,6CAA0C;AAC1C,0CAA0D;AAC1D,+DAA4D;
|
1
|
+
{"version":3,"file":"useCollectionRecordProvider.js","sourceRoot":"","sources":["../../../src/hooks/useCollectionRecordProvider.tsx"],"names":[],"mappings":";;;;;;AAAA,6CAA2C;AAC3C,0DAAkC;AAClC,iCAAkC;AAClC,6CAA0C;AAC1C,0CAA0D;AAC1D,+DAA4D;AAC5D,2CAAwC;AAEjC,MAAM,2BAA2B,GAAG,CAAE,cAAc,EAAE,SAAS,GAAG,MAAM,EAAE,EAAE;IAC/E,MAAM,QAAQ,GAAG,yBAAW,EAAE,CAAC;IAE/B,MAAM,EAAC,CAAC,SAAS,CAAC,EAAE,KAAK,EAAC,GAAG,qBAAS,EAAE,CAAC;IAEzC,MAAM,MAAM,GAAG,yCAAmB,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IAE1D,MAAM,GAAG,GAAG,0BAAY,CAAC,mBAAS,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC;IAG7D,iBAAS,CAAC,GAAE,EAAE;QACV,QAAQ,CACJ,wBAAa,CAAC,GAAG,EAAE,MAAM,CAAC,CAC7B,CAAC;QACF,OAAO,GAAE,EAAE,CAAC,uBAAY,CAAC,GAAG,CAAC,CAAA;IACjC,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;IAE5B,OAAO,MAAM,CAAC;AAClB,CAAC,CAAC;AAlBW,QAAA,2BAA2B,+BAkBtC;AAEY,QAAA,uBAAuB,GAAG,mCAA2B,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useNavigator.app.d.ts","sourceRoot":"","sources":["../../../src/hooks/useNavigator.app.tsx"],"names":[],"mappings":"AAOA,eAAO,MAAM,YAAY,
|
1
|
+
{"version":3,"file":"useNavigator.app.d.ts","sourceRoot":"","sources":["../../../src/hooks/useNavigator.app.tsx"],"names":[],"mappings":"AAOA,eAAO,MAAM,YAAY,WAYxB,CAAC;AAEF,eAAO,MAAM,aAAa,WAAe,CAAC"}
|
@@ -11,7 +11,8 @@ const useNavigator = () => {
|
|
11
11
|
const navigation = native_1.useNavigation();
|
12
12
|
const route = native_1.useRoute();
|
13
13
|
const dispatch = react_redux_1.useDispatch();
|
14
|
-
|
14
|
+
const navigator = react_1.useRef({});
|
15
|
+
return react_1.useMemo(() => lodash_1.assign(navigator.current, navigation, {
|
15
16
|
getParam: (name) => lodash_1.get(route.params, name),
|
16
17
|
openPage: (pageId, params) => navigation.push(dispatch(reducers_1.getPageRouteName(pageId)), params),
|
17
18
|
openRoute: (route) => navigation.push(dispatch(reducers_1.getPageRouteName(route))),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useNavigator.app.js","sourceRoot":"","sources":["../../../src/hooks/useNavigator.app.tsx"],"names":[],"mappings":";;;AAAA,qDAAsF;AACtF,mCAAqC;AACrC,
|
1
|
+
{"version":3,"file":"useNavigator.app.js","sourceRoot":"","sources":["../../../src/hooks/useNavigator.app.tsx"],"names":[],"mappings":";;;AAAA,qDAAsF;AACtF,mCAAqC;AACrC,iCAAwC;AACxC,+CAAuC;AACvC,6CAAwC;AACxC,0CAA+C;AAExC,MAAM,YAAY,GAAG,GAAE,EAAE;IAC5B,MAAM,UAAU,GAAG,sBAAe,EAAE,CAAC;IACrC,MAAM,KAAK,GAAG,iBAAQ,EAAE,CAAC;IACzB,MAAM,QAAQ,GAAG,yBAAW,EAAE,CAAC;IAC/B,MAAM,SAAS,GAAG,cAAM,CAAM,EAAE,CAAC,CAAC;IAElC,OAAO,eAAO,CAAC,GAAE,EAAE,CAAA,eAAM,CAAC,SAAS,CAAC,OAAO,EAAE,UAAU,EAAE;QACrD,QAAQ,EAAE,CAAC,IAAS,EAAE,EAAE,CAAC,YAAG,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC;QAChD,QAAQ,EAAE,CAAC,MAAW,EAAE,MAAW,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,2BAAgB,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC;QACnG,SAAS,EAAE,CAAC,KAAU,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,2BAAgB,CAAC,KAAK,CAAC,CAAC,CAAC;QAC7E,OAAO,EAAE,CAAC,GAAQ,EAAE,EAAE,CAAC,sBAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAM,EAAC,EAAE,CAAC,CAAC,IAAI,sBAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,GAAE,EAAE,GAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAA,CAAA,CAAC,CAAC;KAC5I,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;AACtB,CAAC,CAAC;AAZW,QAAA,YAAY,gBAYvB;AAEW,QAAA,aAAa,GAAG,oBAAY,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useNavigator.d.ts","sourceRoot":"","sources":["../../../src/hooks/useNavigator.tsx"],"names":[],"mappings":"AAOA,eAAO,MAAM,YAAY,
|
1
|
+
{"version":3,"file":"useNavigator.d.ts","sourceRoot":"","sources":["../../../src/hooks/useNavigator.tsx"],"names":[],"mappings":"AAOA,eAAO,MAAM,YAAY,WAwBxB,CAAC;AAEF,eAAO,MAAM,aAAa,WAAe,CAAC"}
|
@@ -16,10 +16,10 @@ const useNavigator = () => {
|
|
16
16
|
const { state, search, hash, pathname } = react_router_1.useLocation();
|
17
17
|
const dispatch = react_redux_1.useDispatch();
|
18
18
|
const navigator = react_1.useRef({});
|
19
|
-
react_1.
|
19
|
+
return react_1.useMemo(() => {
|
20
20
|
const allParams = params;
|
21
21
|
const queryParams = query_string_1.default.parse(search);
|
22
|
-
lodash_1.assign(navigator.current, history, {
|
22
|
+
return lodash_1.assign(navigator.current, history, {
|
23
23
|
pop: history.back,
|
24
24
|
navigate: (name, params) => history.push(dispatch(reducers_1.getPagePath(name, params))),
|
25
25
|
openPage: (name, params) => history.push(dispatch(reducers_1.getPagePath(name, params))),
|
@@ -33,7 +33,6 @@ const useNavigator = () => {
|
|
33
33
|
})
|
34
34
|
});
|
35
35
|
}, [params, history, pathname, hash, search, state]);
|
36
|
-
return navigator.current;
|
37
36
|
};
|
38
37
|
exports.useNavigator = useNavigator;
|
39
38
|
exports.useNavigation = exports.useNavigator;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useNavigator.js","sourceRoot":"","sources":["../../../src/hooks/useNavigator.tsx"],"names":[],"mappings":";;;;;;AAAA,mCAAgC;AAChC,iCAAmD;AACnD,6CAA0C;AAC1C,gEAAuC;AACvC,+CAAkE;AAClE,0CAA0C;AAEnC,MAAM,YAAY,GAAG,GAAG,EAAE;IAC7B,MAAM,MAAM,GAAG,wBAAS,EAAE,CAAC;IAC3B,MAAM,OAAO,GAAG,yBAAU,EAAE,CAAC;IAC7B,MAAM,EAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAC,GAAG,0BAAW,EAAE,CAAC;IACtD,MAAM,QAAQ,GAAG,yBAAW,EAAE,CAAC;IAC/B,MAAM,SAAS,GAAG,cAAM,CAAM,EAAE,CAAC,CAAC;IAElC,
|
1
|
+
{"version":3,"file":"useNavigator.js","sourceRoot":"","sources":["../../../src/hooks/useNavigator.tsx"],"names":[],"mappings":";;;;;;AAAA,mCAAgC;AAChC,iCAAmD;AACnD,6CAA0C;AAC1C,gEAAuC;AACvC,+CAAkE;AAClE,0CAA0C;AAEnC,MAAM,YAAY,GAAG,GAAG,EAAE;IAC7B,MAAM,MAAM,GAAG,wBAAS,EAAE,CAAC;IAC3B,MAAM,OAAO,GAAG,yBAAU,EAAE,CAAC;IAC7B,MAAM,EAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAC,GAAG,0BAAW,EAAE,CAAC;IACtD,MAAM,QAAQ,GAAG,yBAAW,EAAE,CAAC;IAC/B,MAAM,SAAS,GAAG,cAAM,CAAM,EAAE,CAAC,CAAC;IAElC,OAAO,eAAO,CAAC,GAAE,EAAE;QACf,MAAM,SAAS,GAAG,MAAM,CAAC;QACzB,MAAM,WAAW,GAAG,sBAAW,CAAC,KAAK,CAA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