@evlop/commons 1.0.89 → 1.0.93

Sign up to get free protection for your applications and to get access to all the features.
@@ -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;AA+BD,eAAe,oBAAoB,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;AAWhF,QAAA,MAAM,oBAAoB,EAAE,WA+B3B,CAAA;AAgCD,eAAe,oBAAoB,CAAC"}
@@ -67,13 +67,12 @@ 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 [
75
73
  lodash_1.get(requestOptions, 'key', ''),
76
74
  lodash_1.get(options, 'collectionName'),
75
+ lodash_1.get(requestOptions, 'search'),
77
76
  lodash_1.get(requestOptions, 'pageSize'),
78
77
  JSON.stringify(lodash_1.get(requestOptions, 'sort')),
79
78
  ...lodash_1.map(lodash_1.get(requestOptions, 'filter'), (v, k) => `${k}=${JSON.stringify(v)}`)
@@ -1 +1 @@
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,IAA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AC;IACnB,IAAG;QACC,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;KACrD;IAAA,OAAM,CAAC,EAAC,GAAE;IAEX,OAAO;QACH,YAAG,CAAC,cAAc,EAAE,KAAK,EAAE,EAAE,CAAC;QAC9B,YAAG,CAAC,OAAO,EAAE,gBAAgB,CAAC;QAC9B,YAAG,CAAC,cAAc,EAAE,QAAQ,CAAC;QAC7B,YAAG,CAAC,cAAc,EAAE,UAAU,CAAC;QAC/B,IAAI,CAAC,SAAS,CAAC,YAAG,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;QAC3C,GAAG,YAAG,CAAC,YAAG,CAAC,cAAc,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAC,EAAE,CAAA,GAAG,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;KAC7E,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AACf,CAAC,CAAC;AAGF,kBAAe,oBAAoB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"scopeDataSource.d.ts","sourceRoot":"","sources":["../../../src/data-sources/scopeDataSource.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,QAAA,MAAM,eAAe,EAAE,WAEtB,CAAC;AAWF,eAAe,eAAe,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;AAE1C,QAAA,MAAM,eAAe,EAAE,WAEtB,CAAC;AAcF,eAAe,eAAe,CAAC"}
@@ -4,7 +4,10 @@ const lodash_1 = require("lodash");
4
4
  const scopeDataSource = (options, { scope }) => {
5
5
  return lodash_1.get(scope, lodash_1.get(options, 'path'));
6
6
  };
7
- scopeDataSource.keyExtractor = (options) => options.path || options.sourceId;
7
+ scopeDataSource.keyExtractor = (options, { scope }) => {
8
+ const path = lodash_1.get(options, 'path', '');
9
+ return [path, JSON.stringify(lodash_1.get(scope, lodash_1.get(options, 'path')))].join(':');
10
+ };
8
11
  scopeDataSource.displayName = 'Scope';
9
12
  scopeDataSource.identifier = 'scope';
10
13
  scopeDataSource.type = 'Object';
@@ -1 +1 @@
1
- {"version":3,"file":"scopeDataSource.js","sourceRoot":"","sources":["../../../src/data-sources/scopeDataSource.ts"],"names":[],"mappings":";;AAAA,mCAA6B;AAG7B,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,EAAC,EAAE,CAAA,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,QAAQ,CAAC;AAC3E,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"}
1
+ {"version":3,"file":"scopeDataSource.js","sourceRoot":"","sources":["../../../src/data-sources/scopeDataSource.ts"],"names":[],"mappings":";;AAAA,mCAA6B;AAG7B,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,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ts","sourceRoot":"","sources":["../../../src/hooks/useDataSource.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAIxC,UAAU,iBAAiB;IACvB,IAAI,EAAE,QAAQ,GAAG,YAAY,GAAG,KAAK,GAAG,OAAO,GAAG,GAAG,CAAC;IACtD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAE;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,aAAK,IAAI,GAAG,UAAU,GAAG,MAAM,CAAC;AAEhC,eAAO,MAAM,aAAa,WAAa,MAAM,GAAG,iBAAiB,YAAa,iBAAiB,KAAI,IAwGlG,CAAC"}
@@ -11,7 +11,6 @@ const classes_1 = require("../classes");
11
11
  const reducers_1 = require("../reducers");
12
12
  const useScope_1 = require("./useScope");
13
13
  const useTemplate_1 = __importDefault(require("./useTemplate"));
14
- const initialValue = null;
15
14
  const useDataSource = (source, options) => {
16
15
  const dispatch = react_redux_1.useDispatch();
17
16
  const template = useTemplate_1.default();
@@ -36,8 +35,8 @@ const useDataSource = (source, options) => {
36
35
  }
37
36
  return { dependencies, dataSourceOptions: lodash_1.defaults(templatedValues, _dataSourceOptions) };
38
37
  }, [scope, template, dataSourceName, dataSource, _dataSourceOptions]);
39
- const key = dataSource && dataSource.keyExtractor(dataSourceOptions);
40
- const currentValue = react_redux_1.useSelector(state => state.dataSource.data[key]) || initialValue;
38
+ const key = dataSource && dataSource.keyExtractor(dataSourceOptions, { scope, dispatch });
39
+ const currentValue = react_redux_1.useSelector(state => state.dataSource.data[key]);
41
40
  const loadData = react_1.useCallback((params) => {
42
41
  return dispatch({
43
42
  type: reducers_1.DATA_SOURCE_LOAD_DATA,
@@ -78,8 +77,10 @@ const useDataSource = (source, options) => {
78
77
  });
79
78
  }, [loadData, dataSourceOptions, scope, key]);
80
79
  react_1.useEffect(() => {
81
- loadData();
82
- }, [key, ...dependencies]);
80
+ if (!currentValue) {
81
+ loadData();
82
+ }
83
+ }, [key]);
83
84
  return react_1.useMemo(() => {
84
85
  if (lodash_1.get(dataSource, 'type') === 'Array') {
85
86
  let items = lodash_1.get(currentValue, 'items');
@@ -1 +1 @@
1
- {"version":3,"file":"useDataSource.js","sourceRoot":"","sources":["../../../src/hooks/useDataSource.tsx"],"names":[],"mappings":";;;;;;AAAA,mCAAiG;AACjG,iCAAwD;AACxD,6CAAuD;AACvD,wCAAwC;AACxC,0CAAmK;AACnK,yCAAsC;AACtC,gEAAwC;AAWxC,MAAM,YAAY,GAAG,IAAI,CAAC;AAEnB,MAAM,aAAa,GAAG,CAAE,MAAkC,EAAG,OAA2B,EAAQ,EAAE;IACrG,MAAM,QAAQ,GAAG,yBAAW,EAAE,CAAC;IAC/B,MAAM,QAAQ,GAAG,qBAAW,EAAE,CAAC;IAC/B,MAAM,KAAK,GAAG,mBAAQ,EAAE,CAAC;IAEzB,IAAI,cAAc,EAAE,kBAAkB,CAAC;IACvC,IAAG,OAAO,MAAM,KAAK,QAAQ,EAAC;QAC1B,cAAc,GAAG,MAAM,CAAC,IAAI,CAAA;QAC5B,kBAAkB,GAAG,aAAI,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;KAC/C;SAAK;QACF,cAAc,GAAG,MAAM,CAAC;QACxB,kBAAkB,GAAG,OAAO,IAAI,EAAE,CAAC;KACtC;IAED,MAAM,UAAU,GAAgB,yBAAW,CAAC,KAAK,CAAA,EAAE,CAAA,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC,CAAC;IAEjG,MAAM,EAAE,YAAY,EAAE,iBAAiB,EAAE,GAAG,eAAO,CAAC,GAAE,EAAE;QACpD,MAAM,UAAU,GAAG,mBAAU,CAAC,YAAG,CAAC,YAAG,CAAC,UAAU,EAAE,sBAAsB,CAAC,EAAE,MAAM,CAAC,CAAC,CAAA;QACnF,MAAM,eAAe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,YAAG,CAAC,YAAY,EAAE,MAAM,EAAE,CAAC,CAAC;gBAClC,QAAQ,EAAE,YAAG,CAAC,YAAY,EAAE,UAAU,EAAE,EAAE,CAAC;gBAC3C,SAAS,EAAE,CAAC,YAAY,IAAI,YAAG,CAAC,YAAY,EAAE,WAAW,EAAE,KAAK,CAAC;gBACjE,YAAY,EAAG,YAAG,CAAC,YAAY,EAAE,cAAc,EAAE,KAAK,CAAC;gBACvD,OAAO,EAAE,YAAG,CAAC,YAAY,EAAE,SAAS,EAAE,KAAK,CAAC;gBAC5C,WAAW,EAAE,YAAG,CAAC,YAAY,EAAE,aAAa,EAAE,EAAE,CAAC;gBACjD,UAAU,EAAE,YAAG,CAAC,YAAY,EAAE,WAAW,EAAE,CAAC,CAAC;gBAC7C,YAAY,EAAE,YAAG,CAAC,YAAY,EAAE,cAAc,EAAE,CAAC,CAAC;gBAClD,OAAO,EAAE,QAAQ;gBACjB,MAAM;gBACN,QAAQ;gBACR,IAAI;gBACJ,QAAQ;aACX,CAAC,CAAC;SACN;QACD,OAAO,YAAY,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;IAC/C,CAAC,EAAE,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC,CAAC;AACnC,CAAC,CAAC;AAxGW,QAAA,aAAa,iBAwGxB"}
@@ -17,7 +17,10 @@ export interface _DataSource extends Function {
17
17
  scope: any;
18
18
  dispatch: any;
19
19
  }) => Promise<any>;
20
- keyExtractor: (options: any) => string;
20
+ keyExtractor: (options: any, { scope: Object, dispatch: Function }: {
21
+ scope: any;
22
+ dispatch: any;
23
+ }) => string;
21
24
  }
22
25
  export declare function registerDataSource(dataSource: _DataSource): {
23
26
  type: string;
@@ -1 +1 @@
1
- {"version":3,"file":"dataSource.d.ts","sourceRoot":"","sources":["../../../src/reducers/dataSource.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,yBAAyB,CAAC;AAC3D,eAAO,MAAM,uBAAuB,4BAA4B,CAAC;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,MAAM,6BAA6B,kCAAkC,CAAC;AAC7E,eAAO,MAAM,6BAA6B,kCAAkC,CAAC;AAC7E,eAAO,MAAM,4BAA4B,iCAAiC,CAAC;AAE3E,MAAM,WAAW,WAAY,SAAQ,QAAQ;IACzC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,QAAQ,GAAC,OAAO,CAAC;IACvB,oBAAoB,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAC;;;KAAA,KAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IAC1E,YAAY,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE;;;KAAA,KAAG,MAAM,CAAC;CAC/E;AAED,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,WAAW;;;EAKzD;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG;;;;EAMhD;;AAQD,wBAyBC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evlop/commons",
3
- "version": "1.0.89",
3
+ "version": "1.0.93",
4
4
  "description": "",
5
5
  "main": "dist/main.js",
6
6
  "peerDependencies": {